Skip to content

@lelantos-org/sdk / x402 / X402Options

Interface: X402Options ​

Defined in: @lelantos-org/sdk/dist/x402/fetch.d.ts:17

Properties ​

allowHosts? ​

ts
optional allowHosts?: string[];

Defined in: @lelantos-org/sdk/dist/x402/fetch.d.ts:23

Only pay these hostnames. Unset means any host.


allowUnshielded? ​

ts
optional allowUnshielded?: boolean;

Defined in: @lelantos-org/sdk/dist/x402/fetch.d.ts:21

Also pay standard EVM exact servers, unshielding into a throwaway address. Default off.


budget ​

ts
budget: Budget;

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

Required spend ceiling. Human decimal units, applied per asset.


http? ​

ts
optional http?: object;

Defined in: @lelantos-org/sdk/dist/x402/fetch.d.ts:34

Transport for the wrapped requests, named as connect's http option. fetch defaults to globalThis.fetch, looked up at call time.

fetch? ​

ts
optional fetch?: (input, init?) => Promise<Response>;

MDN Reference

Parameters ​
ParameterType
inputRequestInfo | URL
init?RequestInit
Returns ​

Promise<Response>


onPayment? ​

ts
optional onPayment?: (record) => void;

Defined in: @lelantos-org/sdk/dist/x402/fetch.d.ts:25

Fired after each successful payment. Errors from it are swallowed.

Parameters ​

ParameterType
recordPaymentRecord

Returns ​

void


shielded? ​

ts
optional shielded?: ShieldedExactOptions;

Defined in: @lelantos-org/sdk/dist/x402/fetch.d.ts:27

Passed through to the shielded mechanism.


unshielded? ​

ts
optional unshielded?: UnshieldedExactOptions;

Defined in: @lelantos-org/sdk/dist/x402/fetch.d.ts:29

Passed through to the unshielded mechanism.