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:29

Only pay these hostnames. Unset means any host.


allowUnshielded? โ€‹

ts
optional allowUnshielded?: boolean;

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

Also pay servers that only speak standard EVM exact. Unshields into a throwaway address, so it is off by default.


budget โ€‹

ts
budget: Budget;

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

Required, so an autonomous payer always has a ceiling. Human decimal units, applied per asset.


fetchImpl? โ€‹

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

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

Defaults to bound globalThis.fetch.

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:31

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:33

Passed through to the shielded mechanism.


unshielded? โ€‹

ts
optional unshielded?: UnshieldedExactOptions;

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

Passed through to the unshielded mechanism.

Lelantosno cookies ๐Ÿช ยท no tracking ๐Ÿ‘๏ธ ยท no accounts ๐Ÿ‘คwalletexplorer4536080GitHub