@integraledger/lcp/x402-batch-settlement
The exports of @integraledger/lcp/x402-batch-settlement.
Interfaces
BatchEvmOpen
Extends
Properties
| Property | Type | Inherited from |
|---|---|---|
accepted | PaymentRequirements | X402Choice.accepted |
authSalt | `0x${string}` | - |
deposit | bigint | - |
from | `0x${string}` | X402Choice.from |
now | number | X402Choice.now |
payerAuthorizer | `0x${string}` | - |
required | PaymentRequired | X402Choice.required |
BatchPaymentPayload
Properties
| Property | Type |
|---|---|
accepted | PaymentRequirements |
extensions? | object |
payload | object |
payload.type | string |
resource? | object |
resource.url | string |
x402Version | 2 |
BatchSvmOpen
Properties
| Property | Type |
|---|---|
accepted | PaymentRequirements |
computeUnitLimit? | number |
computeUnitPrice? | bigint |
deposit | bigint |
openSlot | bigint |
payer | string |
payerAuthorizer | string |
recentBlockhash | string |
required | PaymentRequired |
salt | bigint |
tokenProgram | string |
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
| Property | Type |
|---|---|
requests | readonly SigningRequest[] |
Methods
complete()
complete(
signatures):Refusal|BatchPaymentPayload
Parameters
| Parameter | Type |
|---|---|
signatures | readonly string[] |
Returns
BatchWithin
Properties
| Property | Type | Description |
|---|---|---|
accepted | PaymentRequirements | - |
channelConfig | Json | Exactly as sent at the opening. |
computeUnitLimit? | number | SVM refund: the Compute Budget values, 200 000 units and 1 microlamport when absent. |
computeUnitPrice? | bigint | - |
maxClaimableAmount | bigint | - |
recentBlockhash? | string | SVM refund: the blockhash to use when the option carries no extra.recentBlockhash. |
refund? | object | A refund. EVM: its amount, absent for a full refund. SVM: {}, a full refund whose request_close is built here. |
refund.amount? | bigint | - |
required | PaymentRequired | - |
ChannelConfig
Properties
ChannelMembers
Properties
| Property | Type |
|---|---|
channel | object |
channel.boundWithin | Promise<`0x${string}` | Refusal> |
channel.kind | "open" | "close" | Refusal | "within" |
channel.ref | Promise<Refusal | { channel: string; network: string; }> |
channel.until | number | undefined |
CloudflarePaymentPayload
The request's payment document: the option's amount and asset, with the challenge's extensions echoed.
Properties
| Property | Type |
|---|---|
accepted | PaymentRequirements |
extensions | object |
payload | object |
payload.amount | string |
payload.asset | string |
x402Version | 2 |
Eip712Request
An EIP-712 request for the buyer's signer; numbers in message are decimal strings.
Properties
| Property | Type |
|---|---|
domain | object |
domain.chainId | number |
domain.name | string |
domain.verifyingContract | `0x${string}` |
domain.version? | string |
message | object |
primaryType | string |
types | object |
Type Aliases
BatchPairingId
BatchPairingId = typeof
EVM_ID| typeofSVM_ID| typeofCF_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
constBATCH_SETTLEMENT:"0x4020074e9dF2ce1deE5A9C1b5c3f541D02a10003"
batchCloudflare
constbatchCloudflare: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: readonlyPaymentRequirements[];request:RequestCommitment; }];unplaced: (option) =>PaymentRequirements; }>
batchEvm
constbatchEvm: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: readonlyPaymentRequirements[];request:RequestCommitment; }];unplaced: (option) =>PaymentRequirements; }>
batchSvm
constbatchSvm: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: readonlyPaymentRequirements[];request:RequestCommitment; }];unplaced: (option) =>PaymentRequirements; }>
CHANNEL_CONFIG_TYPEHASH
constCHANNEL_CONFIG_TYPEHASH:"0x1c9a06ceab9b0ebbd3301dc56c9111bb6d9af421356dc9ccb3b7084c755db308"
CHANNEL_CREATED_TOPIC
constCHANNEL_CREATED_TOPIC:"0x69d8248d5566bdb2ebc4d218970710d8378a2ff9b709a999e052b71970f808fa"
DEPOSITED_TOPIC
constDEPOSITED_TOPIC:"0x6c2a09353b5e75e70d0b9778b80a413809bb235d46c211811c474b3346791d89"
ERC3009_DEPOSIT_COLLECTOR
constERC3009_DEPOSIT_COLLECTOR:"0x4020806089470a89826cB9fB1f4059150b550004"
PERMIT2_DEPOSIT_COLLECTOR
constPERMIT2_DEPOSIT_COLLECTOR:"0x4020425FAf3B746C082C2f942b4E5159887B0005"
VOUCHER_TYPEHASH
constVOUCHER_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
| Parameter | Type |
|---|---|
log | EvmLog |
chainId | number |
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
| Parameter | Type |
|---|---|
chainId | number |
c | ChannelConfig |
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
| Parameter | Type |
|---|---|
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
| Parameter | Type |
|---|---|
option | PaymentRequirements |
Returns
BatchPairingId | undefined
Last updated on