Arcium LogoArcium TS SDK Docs

Packer

Type-safe packer for converting between TypeScript objects and circuit-compatible bigint arrays.

Type Parameters

Type ParameterDescription
TInputInput object type with field names as keys
TOutputOutput object type (typically same structure as input)

Methods

pack()

pack(data): bigint[]

Pack input values into bigint array for circuit execution.

Parameters

ParameterTypeDescription
dataTInputObject with field values matching the packer's field definitions.

Returns

bigint[]

Packed bigint array ready for encryption.

Throws

Error if a required field is missing.


unpack()

unpack(packed): TOutput

Unpack circuit output back to typed object.

Parameters

ParameterTypeDescription
packedbigint[]Bigint array from decrypted circuit output.

Returns

TOutput

Typed object with field values.