IntersectMBO / IntersectMBO/evolution-sdk

docs: Data guide is missing withSchema, toHash, DataEncoded, DataError, and a helper API reference

Abierto
#154 0 comentarios 0 reacciones 0 asignados Ver en GitHub
documentation enhancement
Lenguaje dominante
TypeScript
Estrellas
22
Forks
30
Merge medio
5 h 29 min
PR fusionados (30 d)
12

Descripción

## Problem

The Data guide page at \`docs/content/docs/encoding/data.mdx\` covers the five PlutusData types and basic CBOR encoding well, but is missing several important areas of the \`Data\` module.

### Missing Sections

**Data.withSchema()** — The most important bridge between raw \`Data\` and \`TSchema\`. The page mentions TSchema at the bottom but never explains \`Data.withSchema()\` itself, the codec it returns (\`toData\`, \`fromData\`, \`toCBORHex\`, \`toCBORBytes\`, \`fromCBORHex\`, \`fromCBORBytes\`), or where this API lives relative to raw Data manipulation.

**Data.toHash()** — Computing a datum hash from PlutusData is a core operation when attaching non-inline datums to transactions. This is absent from the guide.

**DataEncoded type** — The JSON-serializable representation of PlutusData (used by node APIs, block explorers, and CML interop). Not mentioned.

**DataError** — Error handling when decoding fails. The error type exists but is never referenced in the guide.

**Helper API reference** — \`Data.constr()\`, \`Data.map()\`, \`Data.toCBORHex()\`, \`Data.fromCBORHex()\`, \`Data.toCBORBytes()\`, \`Data.fromCBORBytes()\`, \`Data.equals()\` are all used in examples but there is no dedicated reference section listing each with its signature and behavior.

**Constr class vs constr helper** — The \`Constr\` class (with \`index\` and \`fields\`) and the \`Data.constr()\` convenience function both exist but the distinction is not explained anywhere in the guide.

### Acceptance Criteria

- [ ] \`Data.withSchema()\` has its own section with codec API documented (\`toData\`, \`fromData\`, \`toCBORHex\`, etc.)
- [ ] \`Data.toHash()\` is documented with an example showing datum hash computation
- [ ] \`DataEncoded\` type is explained — what it is, where it comes from, when you encounter it
- [ ] \`DataError\` and decoding error handling is covered
- [ ] A Reference section enumerates all helper exports with signatures and one-line descriptions
- [ ] \`Constr\` class vs \`Data.constr()\` helper distinction is clarified
- [ ] All examples use \`twoslash\` code fences and compile

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start with docs/content/docs/encoding/data.mdx and review its existing Data and TSchema coverage alongside the named APIs: withSchema, toHash, DataEncoded, DataError, helper exports, and Constr. Done means adding the requested sections, reference entries, examples, and Constr distinction, with every example using twoslash fences and compiling.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
typescript
Área
documentation
Tipo de issue
Documentación
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
55/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.