Chapter 01 · Foundations
Not a client, not a wallet — a byte-level description of Verus data structures. Learn the directory once and every class in it becomes readable.
FIGURE 1.1 · The directory that this book walks.
verus-typescript-primitives is the byte-level description of Verus's data structures in
TypeScript. It does not talk to a node, hold keys, or decide policy. It serialises and
deserialises: given an object, produce the exact bytes a Verus daemon would accept; given bytes,
produce the object back.
That framing answers the first question people have — "where do I send this?" You send the bytes. Everything above this library (a wallet, a web app, a QR code) is a transport for a buffer that this library knows how to build and parse.
| Layer | Lives in | Responsibility |
|---|---|---|
| Primitives | utils/, constants/ | Buffer readers/writers, varint, base58 check, hash helpers |
| Chain objects | pbaas/, transaction/, identity/ | Identities, currencies, tx outputs — the chain's own vocabulary |
| VDXF objects | vdxf/classes/ | Requests, responses, envelopes, signatures, request families |
| Keys | vdxf/keys.ts, vdxf/ordinals.ts | The registry that turns a name into a 20-byte key |
The habit that makes the code readable: every class implements toBuffer,
fromBuffer, toJson, fromJson, and a
getDataByteLength-style length calculation. Once you can read one class, you can read
all of them.
Chapters 2–6 build the transport: object model, Request/Response, signatures, envelope, generic request. Chapters 7–9 walk the request families. Chapter 10 puts the whole lifecycle on one page with a code sketch you can run against the package.
cd ~/verus-ts-primitives yarn install # or npm install ls src/vdxf/classes # the maps in this book are this directory git log -1 # 3ffa9d7 "Fix ordinal payload length mismatch bug"