Skip to main content

StateValue

For the complete documentation index, see llms.txt

@midnight-ntwrk/onchain-runtime v3.0.0


@midnight-ntwrk/onchain-runtime / StateValue

Class: StateValue

컨트랙트 상태의 핵심을 나타내며, 각 구성 요소를 재귀적으로 표현합니다.

상태 값에는 다양한 종류가 있습니다:

상태 값은 불변이며, 상태를 변경하는 모든 연산은 기존 상태를 수정하는 대신 새 상태를 반환합니다.

Methods​

arrayPush()​

arrayPush(value): StateValue

Parameters​

value​

StateValue

Returns​

StateValue


asArray()​

asArray(): undefined | StateValue[]

Returns​

undefined | StateValue[]


asBoundedMerkleTree()​

asBoundedMerkleTree(): undefined | StateBoundedMerkleTree

Returns​

undefined | StateBoundedMerkleTree


asCell()​

asCell(): AlignedValue

Returns​

AlignedValue


asMap()​

asMap(): undefined | StateMap

Returns​

undefined | StateMap


encode()​

encode(): EncodedStateValue

Internal

Returns​

EncodedStateValue


logSize()​

logSize(): number

Returns​

number


toString()​

toString(compact?): string

Parameters​

compact?​

boolean

Returns​

string


type()​

type():
| "map"
| "null"
| "cell"
| "array"
| "boundedMerkleTree"

Returns​

| "map" | "null" | "cell" | "array" | "boundedMerkleTree"


decode()​

static decode(value): StateValue

Internal

Parameters​

value​

EncodedStateValue

Returns​

StateValue


newArray()​

static newArray(): StateValue

Returns​

StateValue


newBoundedMerkleTree()​

static newBoundedMerkleTree(tree): StateValue

Parameters​

tree​

StateBoundedMerkleTree

Returns​

StateValue


newCell()​

static newCell(value): StateValue

Parameters​

value​

AlignedValue

Returns​

StateValue


newMap()​

static newMap(map): StateValue

Parameters​

map​

StateMap

Returns​

StateValue


newNull()​

static newNull(): StateValue

Returns​

StateValue