Skip to content

@lelantos-org/sdk / x402 / UnshieldedExactOptions

Interface: UnshieldedExactOptions ​

Defined in: @lelantos-org/sdk/dist/x402/unshielded.d.ts:7

Properties ​

assetIds? ​

ts
optional assetIds?: readonly AssetId[];

Defined in: @lelantos-org/sdk/dist/x402/unshielded.d.ts:13

MASP asset ids to consider when resolving the server's ERC-20 address. Default: every registered asset over that token (each verified against the pool). Pass ids to restrict which assets may fund a payment.


index? ​

ts
optional index?: number;

Defined in: @lelantos-org/sdk/dist/x402/unshielded.d.ts:19

Pin the ephemeral payer slot. Defaults to a slot derived from the resource host, giving each server a distinct payer address (see hostPayerIndex). Set to reuse one address across hosts.


maxPolls? ​

ts
optional maxPolls?: number;

Defined in: @lelantos-org/sdk/dist/x402/unshielded.d.ts:30

Give up waiting after this many polls. Default 30.


onPhase? ​

ts
optional onPhase?: (phase, info) => void;

Defined in: @lelantos-org/sdk/dist/x402/unshielded.d.ts:26

Forwarded to wallet.withdraw.

Parameters ​

ParameterType
phaseSpendPhase
infoPhaseInfo

Returns ​

void


onTopUp? ​

ts
optional onTopUp?: (info) => void;

Defined in: @lelantos-org/sdk/dist/x402/unshielded.d.ts:41

Fires when a top-up is about to unshield into the payer address. Must not throw.

The budget caps payments, not the withdrawals that fund them: a top-up moves value to an address the user controls, and counting it would double-count every payment made from it. topUpMultiple withdraws more than one payment costs and a poll timeout leaves no other record, so this hook is how top-ups are observed.

Parameters ​

ParameterType
info{ amount: CircuitAmount; asset: AssetId; payer: EvmAddress; }
info.amountCircuitAmount
info.assetAssetId
info.payerEvmAddress

Returns ​

void


pollMs? ​

ts
optional pollMs?: number;

Defined in: @lelantos-org/sdk/dist/x402/unshielded.d.ts:28

Poll interval while waiting for the withdrawal to land. Default 2000ms.


topUpMultiple? ​

ts
optional topUpMultiple?: bigint;

Defined in: @lelantos-org/sdk/dist/x402/unshielded.d.ts:24

When a top-up is needed, withdraw this many times the payment so one proving run covers several calls. Default 10.