Skip to content

CborValue

CborValue = InstructionArg | CborEncodable | string | number | bigint | boolean | Uint8Array | null | undefined | CborValue[]

Defined in: ootle/src/helpers/cbor-builder.ts:46

A value a builder accepts:

  • an already-encoded Literal (e.g. from resourceAddressLiteral) or a builder;
  • string → CBOR text, boolean, Uint8Array → CBOR bytes;
  • number (an integer) or bigint → a CBOR integer, which is also how an Amount is written;
  • null/undefined → Option::None;
  • an array → a Vec of its encoded elements.

A string is always text: an address must go through its own literal helper, which writes the tagged form a template expects.