@lelantos-org/sdk / x402 / UnshieldedExactOptions
Interface: UnshieldedExactOptions โ
Defined in: @lelantos-org/sdk/dist/x402/unshielded.d.ts:7
Properties โ
assetIds? โ
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. Defaults to the single default asset. The registry is not enumerable, so the tokenโid direction has to be a lookup over candidates.
index? โ
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? โ
optional maxPolls?: number;Defined in: @lelantos-org/sdk/dist/x402/unshielded.d.ts:30
Give up waiting after this many polls. Default 30.
onPhase? โ
optional onPhase?: OnPhase<SpendPhase>;Defined in: @lelantos-org/sdk/dist/x402/unshielded.d.ts:26
Forwarded to wallet.withdraw.
onTopUp? โ
optional onTopUp?: (info) => void;Defined in: @lelantos-org/sdk/dist/x402/unshielded.d.ts:43
Fires when a top-up is about to unshield into the payer address.
The budget caps payments, not the withdrawals that fund them, and it cannot do otherwise: a top-up moves value to an address the user still controls, so counting it as spend would double-count every payment made from it. But topUpMultiple means far more leaves the pool than any one payment costs, and if the poll below times out it has left with nothing recorded anywhere. This is the hook that makes that observable.
Must not throw.
Parameters โ
| Parameter | Type |
|---|---|
info | { amount: CircuitAmount; asset: AssetId; payer: EvmAddress; } |
info.amount | CircuitAmount |
info.asset | AssetId |
info.payer | EvmAddress |
Returns โ
void
pollMs? โ
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? โ
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.