Skip to content

@lelantos-org/sdk / protocol / SpendArgs

Interface: SpendArgs ​

Defined in: @lelantos-org/sdk/dist/bundle/spend.d.ts:4

Properties ​

artifacts? ​

ts
optional artifacts?: ProverArtifacts;

Defined in: @lelantos-org/sdk/dist/bundle/common.d.ts:62

Proving backend: artifacts (the SDK proves with snarkjs) or a custom prover (remote, worker, mock). One is required; prover takes precedence.

Inherited from ​

ts
BundleCommon.artifacts

asset ​

ts
asset: bigint;

Defined in: @lelantos-org/sdk/dist/bundle/common.d.ts:44

Registry id publicOut leaves the pool in. Published as publicAssetId only when publicOut is non-zero.

Inherited from ​

ts
BundleCommon.asset

chainId ​

ts
chainId: bigint;

Defined in: @lelantos-org/sdk/dist/bundle/common.d.ts:39

Inherited from ​

ts
BundleCommon.chainId

inputs ​

ts
inputs: InputSlots;

Defined in: @lelantos-org/sdk/dist/bundle/spend.d.ts:7


intentHash? ​

ts
optional intentHash?: bigint;

Defined in: @lelantos-org/sdk/dist/bundle/common.d.ts:57

PubInputs.Transact.intentHash, a field element. A swap's withdraw leg must set it to swapIntentHash of the swap it funds; every other spend leaves it at the zero default.

Inherited from ​

ts
BundleCommon.intentHash

J ​

ts
J: Jubjub;

Defined in: @lelantos-org/sdk/dist/bundle/common.d.ts:38

Inherited from ​

ts
BundleCommon.J

kind ​

ts
kind: SpendKind;

Defined in: @lelantos-org/sdk/dist/bundle/spend.d.ts:6

Which on-chain entry point the relayer should call.


merkleRoot ​

ts
merkleRoot: bigint;

Defined in: @lelantos-org/sdk/dist/bundle/spend.d.ts:8


outgoingKey ​

ts
outgoingKey: Uint8Array;

Defined in: @lelantos-org/sdk/dist/bundle/spend.d.ts:26

The sender's outgoing key (deriveOutgoingKey). Every output's blinder, ECDH ephemeral and clue blinder derive from it, the output itself and the spend's nullifiers (sealOutput), so the sender can recompute them and prove what an output paid.


outputs ​

ts
outputs: readonly OutputSpec[];

Defined in: @lelantos-org/sdk/dist/bundle/spend.d.ts:18

One entry per output slot: the send note of a transfer, the relayer's fee note, change back to self, and zero-value pads. Per asset, the values must sum to the real input value, less publicOut for asset.

Change takes the sender's own address. A pad takes an address drawn for it, never the sender's: a clue for the sender's key on every unused slot would mark the spend as the sender's to a detector.


P ​

ts
P: Poseidon;

Defined in: @lelantos-org/sdk/dist/bundle/common.d.ts:37

Inherited from ​

ts
BundleCommon.P

payerAddress ​

ts
payerAddress: string;

Defined in: @lelantos-org/sdk/dist/bundle/common.d.ts:45

Inherited from ​

ts
BundleCommon.payerAddress

prover? ​

ts
optional prover?: Prover;

Defined in: @lelantos-org/sdk/dist/bundle/common.d.ts:63

Inherited from ​

ts
BundleCommon.prover

publicOut? ​

ts
optional publicOut?: bigint;

Defined in: @lelantos-org/sdk/dist/bundle/spend.d.ts:20

Value leaving the shielded pool. 0 for a transfer.


recipientAddress ​

ts
recipientAddress: string;

Defined in: @lelantos-org/sdk/dist/bundle/common.d.ts:52

Inherited from ​

ts
BundleCommon.recipientAddress

relayerAddress ​

ts
relayerAddress: string;

Defined in: @lelantos-org/sdk/dist/bundle/common.d.ts:51

0x ETH. The relayer's submitter address (/chains relayerAddress): the pool's msg.sender for its spends, so it must equal pi.relayer. For a relayer submitting through its Bundler contract this is the Bundler's address, not the signing EOA.

Inherited from ​

ts
BundleCommon.relayerAddress

shape? ​

ts
optional shape?: CircuitShape;

Defined in: @lelantos-org/sdk/dist/bundle/common.d.ts:71

Circuit arity, when the caller knows it. Supplying it enables a pre-flight check of the slot counts. toCircomInput infers the shape from the array lengths, so without it a spend with the wrong slot count for the zkey builds a valid witness with the wrong number of public inputs and fails inside the prover.

Inherited from ​

ts
BundleCommon.shape

treeDepth ​

ts
treeDepth: number;

Defined in: @lelantos-org/sdk/dist/bundle/common.d.ts:64

Inherited from ​

ts
BundleCommon.treeDepth