Skip to content

decodeBoxValue

decodeBoxValue(path, raw, opts): any

Defined in: packages/store-kit/src/objects/state.ts:244

Decode one raw box value (as stored on-chain) at path (without the prefix), the way fromBoxesRaw does.

Raw bytes go to unpack when the path is schema-covered so it can route through decodePathBytes; otherwise the value is UTF-8 decoded first for the legacy JSON path. The string-side unpack also detects the legacy ARC4 envelope (boxes written by store-kit ≤ 0.0.3).

Parameters

path

string

raw

Uint8Array

opts

schema?

null | CompiledSchema

Returns

any