Skip to content
Integra Protocol
API

@integraledger/lcp/x402-batch-settlement

The exports of @integraledger/lcp/x402-batch-settlement.

Interfaces

BatchEvmOpen

Extends

Properties

PropertyTypeInherited from
acceptedPaymentRequirementsX402Choice.accepted
authSalt`0x${string}`-
depositbigint-
from`0x${string}`X402Choice.from
nownumberX402Choice.now
payerAuthorizer`0x${string}`-
requiredPaymentRequiredX402Choice.required

BatchPaymentPayload

Properties

PropertyType
acceptedPaymentRequirements
extensions?object
payloadobject
payload.typestring
resource?object
resource.urlstring
x402Version2

BatchSvmOpen

Properties

PropertyType
acceptedPaymentRequirements
computeUnitLimit?number
computeUnitPrice?bigint
depositbigint
openSlotbigint
payerstring
payerAuthorizerstring
recentBlockhashstring
requiredPaymentRequired
saltbigint
tokenProgramstring

BatchUnsigned

Several signing requests, signed in order. complete takes one signature per request: 0x hex for eip712, base58 for solana-message and ed25519-raw.

Properties

PropertyType
requestsreadonly SigningRequest[]

Methods

complete()

complete(signatures): Refusal | BatchPaymentPayload

Parameters
ParameterType
signaturesreadonly string[]
Returns

Refusal | BatchPaymentPayload


BatchWithin

Properties

PropertyTypeDescription
acceptedPaymentRequirements-
channelConfigJsonExactly as sent at the opening.
computeUnitLimit?numberSVM refund: the Compute Budget values, 200 000 units and 1 microlamport when absent.
computeUnitPrice?bigint-
maxClaimableAmountbigint-
recentBlockhash?stringSVM refund: the blockhash to use when the option carries no extra.recentBlockhash.
refund?objectA refund. EVM: its amount, absent for a full refund. SVM: {}, a full refund whose request_close is built here.
refund.amount?bigint-
requiredPaymentRequired-

ChannelConfig

Properties

PropertyTypeDescription
payer`0x${string}`-
payerAuthorizer`0x${string}`-
receiver`0x${string}`-
receiverAuthorizer`0x${string}`-
salt`0x${string}`0x and 64 hex digits.
token`0x${string}`-
withdrawDelaynumber-

ChannelMembers

Properties

PropertyType
channelobject
channel.boundWithinPromise<`0x${string}` | Refusal>
channel.kind"open" | "close" | Refusal | "within"
channel.refPromise<Refusal | { channel: string; network: string; }>
channel.untilnumber | undefined

CloudflarePaymentPayload

The request's payment document: the option's amount and asset, with the challenge's extensions echoed.

Properties

PropertyType
acceptedPaymentRequirements
extensionsobject
payloadobject
payload.amountstring
payload.assetstring
x402Version2

Eip712Request

An EIP-712 request for the buyer's signer; numbers in message are decimal strings.

Properties

PropertyType
domainobject
domain.chainIdnumber
domain.namestring
domain.verifyingContract`0x${string}`
domain.version?string
messageobject
primaryTypestring
typesobject

Type Aliases

BatchPairingId

BatchPairingId = typeof EVM_ID | typeof SVM_ID | typeof CF_ID


SigningRequest

SigningRequest = { kind: "eip712"; typedData: Eip712Request | ReceiveTypedData | Permit2TypedData; } | { kind: "solana-message"; message: Uint8Array; } | { kind: "ed25519-raw"; message: Uint8Array; signer: string; }

A request to the buyer's signer.

Variables

BATCH_SETTLEMENT

const BATCH_SETTLEMENT: "0x4020074e9dF2ce1deE5A9C1b5c3f541D02a10003"


batchCloudflare

const batchCloudflare: Readonly<{ advertise: X402Advertise; bound: (presented) => Promise<`0x${string}` | Refusal>; build: (c, h) => Promise<Refusal | CloudflarePaymentPayload>; claims: boolean; id: "x402/batch-settlement/cloudflare"; pattern: LcpPattern; read: (doc) => Refusal | X402Read; tie: (accepts, request) => ["x402", { accepts: readonly PaymentRequirements[]; request: RequestCommitment; }]; unplaced: (option) => PaymentRequirements; }>


batchEvm

const batchEvm: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | PaymentRequired; bound: (presented) => Promise<`0x${string}` | Refusal>; build: (c, h) => Promise<Refusal | BatchUnsigned>; buildWithin: (w, h) => Promise<Refusal | BatchUnsigned>; channel: Readonly<{ boundWithin: (presented) => Promise<`0x${string}` | Refusal>; kind: (p) => "open" | "close" | Refusal | "within"; ref: (p) => Promise<Refusal | { channel: string; network: string; }>; until: (_p) => number | undefined; }>; claims: boolean; id: "x402/batch-settlement/eip155"; pattern: LcpPattern; read: (doc) => Refusal | X402Read; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (presented) => Promise<Refusal | EvmRef>; status: (ref, reader) => Promise<EvmBreadthStatus>; tie: (accepts, request) => ["x402", { accepts: readonly PaymentRequirements[]; request: RequestCommitment; }]; unplaced: (option) => PaymentRequirements; }>


batchSvm

const batchSvm: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | PaymentRequired; bound: (presented) => Promise<`0x${string}` | Refusal>; build: (c, h) => Promise<Refusal | BatchUnsigned>; buildWithin: (w, _h) => Promise<Refusal | BatchUnsigned>; carrier: "extra.memo"; channel: Readonly<{ boundWithin: (_p) => Promise<`0x${string}` | Refusal>; kind: (p) => "open" | "close" | Refusal | "within"; ref: (p) => Promise<Refusal | { channel: string; network: string; }>; until: (_p) => number | undefined; }>; claims: boolean; id: "x402/batch-settlement/solana"; pattern: LcpPattern; read: (doc) => Refusal | X402Read; recover: (ref, reader) => Promise<`0x${string}` | Refusal>; reference: (presented) => Promise<Refusal | Omit<SvmRef, "fromSlot">>; status: (ref, reader) => Promise<ChannelStatus>; tie: (accepts, request) => ["x402", { accepts: readonly PaymentRequirements[]; request: RequestCommitment; }]; unplaced: (option) => PaymentRequirements; }>


CHANNEL_CONFIG_TYPEHASH

const CHANNEL_CONFIG_TYPEHASH: "0x1c9a06ceab9b0ebbd3301dc56c9111bb6d9af421356dc9ccb3b7084c755db308"


CHANNEL_CREATED_TOPIC

const CHANNEL_CREATED_TOPIC: "0x69d8248d5566bdb2ebc4d218970710d8378a2ff9b709a999e052b71970f808fa"


DEPOSITED_TOPIC

const DEPOSITED_TOPIC: "0x6c2a09353b5e75e70d0b9778b80a413809bb235d46c211811c474b3346791d89"


ERC3009_DEPOSIT_COLLECTOR

const ERC3009_DEPOSIT_COLLECTOR: "0x4020806089470a89826cB9fB1f4059150b550004"


PERMIT2_DEPOSIT_COLLECTOR

const PERMIT2_DEPOSIT_COLLECTOR: "0x4020425FAf3B746C082C2f942b4E5159887B0005"


VOUCHER_TYPEHASH

const VOUCHER_TYPEHASH: "0x1e1bd6ff84c3e0d9029a292b212e039c0ca97ec497c55191a4a5874294609a69"

Functions

batchChannelCreated()

batchChannelCreated(log, chainId): Refusal | { channelId: `0x${string}`; config: ChannelConfig; }

The config and id of a ChannelCreated(channelId, config) log, the id recomputed from the 7-word data.

Parameters

ParameterType
logEvmLog
chainIdnumber

Returns

Refusal | { channelId: `0x${string}`; config: ChannelConfig; }


batchChannelId()

batchChannelId(chainId, c): `0x${string}` | Refusal

The channel id: the EIP-712 digest of the configuration under the x402 Batch Settlement domain.

Parameters

ParameterType
chainIdnumber
cChannelConfig

Returns

`0x${string}` | Refusal


erc3009DepositNonce()

erc3009DepositNonce(channelId, authSalt): `0x${string}` | Refusal

The ERC-3009 deposit's nonce: keccak256(abi.encode(bytes32 channelId, uint256 authSalt)).

Parameters

ParameterType
channelId`0x${string}`
authSalt`0x${string}`

Returns

`0x${string}` | Refusal


pairingOf()

pairingOf(option): BatchPairingId | undefined

The batch-settlement pairing an option names, or undefined.

Parameters

ParameterType
optionPaymentRequirements

Returns

BatchPairingId | undefined

Last updated on

On this page