Skip to content

CborMapBuilder

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

Builds a Rust BTreeMap or HashMap argument. Create one with CborBuilder.map.

new CborMapBuilder(): CborMapBuilder

CborMapBuilder

entry(key, value): this

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

Adds an entry. A key is any value; the keys of one map must all be strings, all integers, or all other values (addresses, public keys, bytes, builders).

CborValue

CborValue

this


finish(): InstructionArg

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

Encodes the map. A builder nested in another does not need this: its parent calls it.

Entries are written in a fixed order, whatever order they were added in. A template decodes a map in any order, so the order only decides the bytes. For string keys, integer keys, and fixed-size keys such as addresses, public keys and hashes, it is the order Rust writes a BTreeMap in. Other keys (variable-length bytes, structs, tuples, enums) are ordered by their encoded bytes, which is not always Rust’s order.

InstructionArg

if the keys are of mixed kinds or a key is repeated.


toLiteral(): InstructionArg

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

InstructionArg

CborEncodable.toLiteral