Chapter 11 · Tabs
No typed details class — a JSON payload in a general-purpose VDXF object, with chain-time alignment and bigint arithmetic instead of floats.
FIGURE 11.1 · The newest tab takes a different approach.
Every other tab has a purpose-built details class in the primitives library. Transaction signing does not: it sends a JSON payload describing a pre-built transaction, inside a general-purpose VDXF object keyed by a text key. That is the escape hatch the library provides for request types it does not model yet.
new GeneralTypeOrdinalVDXFObject({
type: VDXF_OBJECT_RESERVED_BYTE_VDXF_ID_STRING,
key: TX_SIGNING_TEMPLATE_VDXF_TEXT_KEY,
data: Buffer.from(JSON.stringify({
type: "tx-signing-template",
chain: isTestnet ? "VRSCTEST" : "VRSC",
signed, signingId,
hextx,
outputtotalsSats, feeSats
}), "utf-8")
})
parseFixedPointToSats rejects scientific
notation, requires at most eight decimals, and does the arithmetic in bigint.alignCreatedAtToChainTime asks for
the current height, fetches the block, and uses the block's timestamp — so a request generated on a
machine with a drifting clock is still inside the wallet's validity window.applyOptionalSignature and
verifySignedRequestSignature let the tab return either an unsigned template or a
verified signed request.| Field | Meaning |
|---|---|
hextx | The exact transaction to sign |
outputtotalsSats | Per-destination totals the wallet should verify against the transaction |
feeSats | Declared fee, so the wallet can refuse a mismatch |
chain | Which network the transaction belongs to |
src/routes/requests/txSigning.ts parseFixedPointToSats / parseHexTransaction / parseOutputTotals buildTxSigningRequest / alignCreatedAtToChainTime verifySignedRequestSignature / applyOptionalSignature generateTxSigningQr