← Book map

Chapter 01 · Foundations

What this library is

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.

Where the VDXF classes live The package root splits into transaction, pbaas and vdxf; vdxf holds the key registry and classes, and classes nests request, response, login, identity, payment, appencryption, data, ordinals, provisioning and envelope. src/ verus-typescript-primitives transaction pbaas vdxf utils classes/ Request.ts Response.ts envelope/ request/ response/ ordinals/ login/ identity/ payment/ data/ Every request family is the same shape: a Details class, an ordinal wrapper, and a key in keys.ts.

FIGURE 1.1 · The directory that this book walks.

What this library actually is

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.

Four layers, one habit

LayerLives inResponsibility
Primitivesutils/, constants/Buffer readers/writers, varint, base58 check, hash helpers
Chain objectspbaas/, transaction/, identity/Identities, currencies, tx outputs — the chain's own vocabulary
VDXF objectsvdxf/classes/Requests, responses, envelopes, signatures, request families
Keysvdxf/keys.ts, vdxf/ordinals.tsThe 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.

Reading order for this book

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.

Open it locally

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"