Skip to content

packWire

packWire(value, opts): Wire

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

Encode a value for on-chain box storage, returning a tagged Wire so the caller can route schema-typed paths through the contract’s set_bytes ABI and uncovered paths through the legacy set ABI.

  • Schema-covered path → { kind: "bytes", bytes: raw ARC4 }
  • Otherwise → { kind: "string", str: JSON.stringify(value) }

Only the value itself is persisted — no timestamps or other metadata. The Algorand round in which the record was last submitted serves as the authoritative ordering signal and is recoverable from the chain when needed.

Parameters

value

any

opts

PackOptions = {}

Returns

Wire