PrefixedCountNodeA node that represents a count strategy where the number of items is stored as a number prefix. This enables nodes such as ArrayTypeNode to represent arrays such that their length is stored as a prefix.
| Attribute | Type | Description |
|---|---|---|
kind |
"prefixedCountNode" |
The node discriminator. |
| Attribute | Type | Description |
|---|---|---|
prefix |
NestedTypeNode<NumberTypeNode> |
The node that determines the number of items. |
prefixedCountNode(prefix)Helper function that creates a PrefixedCountNode object from a number node.
const node = prefixedCountNode(numberTypeNode(u32));
arrayTypeNode(publicKeyTypeNode(), prefixedCountNode(numberTypeNode(u32)));