CborMapBuilder
Defined in: ootle/src/helpers/cbor-builder.ts:210
Builds a Rust BTreeMap or HashMap argument. Create one with CborBuilder.map.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CborMapBuilder():
CborMapBuilder
Returns
Section titled “Returns”CborMapBuilder
Methods
Section titled “Methods”entry()
Section titled “entry()”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).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
finish()
Section titled “finish()”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.
Returns
Section titled “Returns”InstructionArg
Throws
Section titled “Throws”if the keys are of mixed kinds or a key is repeated.
toLiteral()
Section titled “toLiteral()”toLiteral():
InstructionArg
Defined in: ootle/src/helpers/cbor-builder.ts:250
Returns
Section titled “Returns”InstructionArg