@arcium-hq/clientInterfaces
Packer
Type-safe packer for converting between TypeScript objects and circuit-compatible bigint arrays.
Type Parameters
| Type Parameter | Description |
|---|---|
TInput | Input object type with field names as keys |
TOutput | Output object type (typically same structure as input) |
Methods
pack()
pack(
data):bigint[]
Pack input values into bigint array for circuit execution.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | TInput | Object 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
| Parameter | Type | Description |
|---|---|---|
packed | bigint[] | Bigint array from decrypted circuit output. |
Returns
TOutput
Typed object with field values.