@integraledger/lcp/x402
x402 v2 documents, the request commitment, and the x402 pairings on eip155 chains: `exact` over EIP-3009, Permit2 and ERC-7710 (with its salt level), `upto` over Permit2, `auth-capture` over EIP-3009 and Permit2, and `exact` in Circle Gateway's batched domain.
For AI agents: this page as Markdown, and llms.txt, the index of every page.
x402 v2 documents, the request commitment, and the x402 pairings on eip155 chains: exact over EIP-3009, Permit2 and
ERC-7710 (with its salt level), upto over Permit2, auth-capture over EIP-3009 and Permit2, and exact in Circle
Gateway's batched domain.
The ATR hash is advertised in the challenge's extensions.legalContext; each pairing's pattern record states how
the pairing binds it.
Interfaces
GatewayBatchedChoice
The buyer's choice: x402's, with the minValiditySeconds Circle Gateway's /supported serves for the network.
Extends
Properties
| Property | Type | Inherited from |
|---|---|---|
accepted | PaymentRequirements | X402Choice.accepted |
from | `0x${string}` | X402Choice.from |
minValiditySeconds | number | - |
now | number | X402Choice.now |
required | PaymentRequired | X402Choice.required |
GatewayBatchedTypedData
The EIP-712 typed data the payer signs: TransferWithAuthorization in the Gateway Wallet's domain.
Properties
| Property | Type |
|---|---|
domain | object |
domain.chainId | number |
domain.name | string |
domain.salt? | `0x${string}` |
domain.verifyingContract | `0x${string}` |
domain.version | "1" | "2" |
message | object |
message.from | `0x${string}` |
message.nonce | `0x${string}` |
message.to | `0x${string}` |
message.validAfter | bigint |
message.validBefore | bigint |
message.value | bigint |
primaryType | "TransferWithAuthorization" |
types | object |
types.EIP712Domain | Field[] |
types.TransferWithAuthorization | Field[] |
GatewayBatchedUnsigned
What build gives: the typed data to sign, and the step that wraps the signature in the payment.
Properties
| Property | Type |
|---|---|
typedData | GatewayBatchedTypedData |
Methods
complete()
complete(
signature):Refusal|GatewayBatchedPayment
Parameters
| Parameter | Type |
|---|---|
signature | `0x${string}` |
Returns
Refusal | GatewayBatchedPayment
HeaderDigest
One named field of a request commitment: its lower-cased name, and SHA-256 of its value, null where the request lacks it.
Properties
| Property | Modifier | Type |
|---|---|---|
digest | readonly | `0x${string}` | null |
name | readonly | string |
HttpRequest
An HTTP request as received: the method token, the raw origin-form target and the body bytes, and, where the commitment names header fields, the request's header fields, each name with its lines in the order received.
Properties
| Property | Type |
|---|---|
body | Uint8Array |
headers? | Readonly<Record<string, string | readonly string[]>> |
method | string |
target | string |
ToolCall
An MCP tools/call request's tool call, as received: its params.name and params.arguments.
Properties
| Property | Type |
|---|---|
arguments? | object |
name | string |
Unsigned
What exactEip3009.build gives: the EIP-712 typed data the payer signs (typedData), and complete, which takes
the payer's signature and gives the PaymentPayload to present, or x402/signature-malformed for a signature that
is not one.
Properties
| Property | Type |
|---|---|
typedData | Eip3009TypedData |
Methods
complete()
complete(
signature):Refusal|PaymentPayload
Parameters
| Parameter | Type |
|---|---|
signature | `0x${string}` |
Returns
X402Choice
The buyer's inputs to the build of an x402 pairing on an eip155 chain: the document (required), the option chosen
from its accepts (accepted), the payer's address (from), and the current time in Unix seconds (now); the
authorization's deadline is now plus the option's maxTimeoutSeconds.
Extended by
Properties
| Property | Type |
|---|---|
accepted | PaymentRequirements |
from | `0x${string}` |
now | number |
required | PaymentRequired |
X402Offer
The offer an x402 pairing's read gives: the document read (required), and the options of its accepts that the
pairing serves, through its option filter, in document order.
Properties
| Property | Type |
|---|---|
options | readonly PaymentRequirements[] |
required | PaymentRequired |
Type Aliases
BatchedAuthorization
BatchedAuthorization =
object
The batched authorization, every member a string, as Circle's client writes it.
Properties
| Property | Type |
|---|---|
from | string |
nonce | string |
to | string |
validAfter | string |
validBefore | string |
value | string |
BreadthBase
BreadthBase<
Id> =object
The members every x402 EVM breadth pairing shares.
Type Parameters
| Type Parameter |
|---|
Id extends BreadthId |
Properties
| Property | Modifier | Type |
|---|---|---|
advertise | readonly | X402Advertise |
broadcaster | readonly | (presented) => Promise<Broadcaster | Refusal> |
claims | readonly | boolean |
data | readonly | PairingData |
id | readonly | Id |
pattern | readonly | LcpPattern |
read | readonly | (doc) => X402Read | Refusal |
tie | readonly | typeof tie |
unplaced | readonly | (option) => PaymentRequirements | Refusal |
BreadthId
BreadthId =
Exclude<Extract<keyof typeofEIP155_X402,`x402/${string}`>,"x402/exact/eip155/eip3009"|"x402/batch-settlement/eip155"|"x402/batch-settlement/cloudflare"|"x402/exact/eip155/gateway-batched">
The x402 EVM breadth pairings: those with data in the EVM family's module but EIP-3009 exact.
Eip3009Authorization
Eip3009Authorization =
object
Properties
| Property | Type |
|---|---|
from | string |
nonce | string |
to | string |
validAfter | string |
validBefore | string |
value | string |
Eip3009Payment
Eip3009Payment =
PaymentPayload&object
A payment of the x402/exact/eip155/eip3009 pairing.
Type Declaration
| Name | Type |
|---|---|
payload | object |
payload.authorization | Eip3009Authorization |
payload.signature | Hex |
GatewayBatchedPayment
GatewayBatchedPayment =
PaymentPayload&object
A payment of x402/exact/eip155/gateway-batched.
Type Declaration
| Name | Type |
|---|---|
payload | object |
payload.authorization | BatchedAuthorization |
payload.signature | Hex |
HeaderFields
HeaderFields =
Readonly<Record<string,string| readonlystring[]>>
A request's header fields as received: each field's name, in any case, with its field lines in the order received, or with its one line. Each line is the field's value as HTTP parses it; its leading and trailing spaces and tabs are not part of it.
LcpPattern
LcpPattern =
object
A pairing's binding record: its binding pattern, absent where none of these names it; the profile that defines the binding, where one does; whether the binding is visible on a public ledger; whether the hash can be recovered from the chain alone; and whether the chain indexes it.
Properties
| Property | Type |
|---|---|
forwardIndexable | boolean |
onChain | boolean |
pattern? | "native-field" | "overlay-contract" | "sidecar-attestation" | "opaque-challenge" | "id-reuse" | "protocol-extension" | "http-advisory" |
profile? | string |
zeroPartyRecoverable | boolean |
Pairings
Pairings<
K> ={ readonly [id in K]: PairingData }
A family's pairings' data, keyed by pairing id.
Type Parameters
| Type Parameter |
|---|
K extends string |
PaymentPayload
PaymentPayload =
object
An x402 v2 payment, as the PAYMENT-SIGNATURE header carries it: the option it answers (accepted), the scheme's
payload, and the resource and extensions echoed from the document.
Properties
| Property | Type |
|---|---|
accepted | PaymentRequirements |
extensions? | PaymentRequired["extensions"] |
payload | X402SchemePayload |
resource? | PaymentRequired["resource"] |
x402Version | 2 |
PaymentRequired
PaymentRequired =
object
An x402 v2 402 document, as the PAYMENT-REQUIRED header carries it: the resource, the options it accepts and its
extensions. A pairing's advertise places the ATR hash and link in extensions.legalContext, and its read reads
them from there.
Properties
| Property | Type |
|---|---|
accepts | PaymentRequirements[] |
error? | string |
extensions? | object |
resource | object |
resource.url | string |
x402Version | 2 |
PaymentRequirements
PaymentRequirements =
object
An x402 v2 payment option, one entry of a PaymentRequired document's accepts: the scheme, the CAIP-2 network,
the amount in the asset's base units, the asset, the payee (payTo), the longest the payment may take in seconds
(maxTimeoutSeconds), and the scheme's extra members.
Properties
| Property | Type |
|---|---|
amount | string |
asset | string |
extra? | object |
maxTimeoutSeconds | number |
network | string |
payTo | string |
scheme | string |
Permit2Authorization
Permit2Authorization =
object
Properties
| Property | Type |
|---|---|
deadline | string |
from | string |
nonce | string |
permitted | object |
permitted.amount | string |
permitted.token | string |
spender | string |
witness? | object |
RequestCommitment
RequestCommitment =
object
The commitment to an HTTP request: its method, path, query and body's digest, and, where the resource server names
header fields, headers: each named field's lower-cased name and SHA-256 of its value, never the value.
Properties
| Property | Type |
|---|---|
bodyDigest | AtrHash |
headers? | readonly HeaderDigest[] |
method | string |
path | string |
query | string |
SettlementResponse
SettlementResponse =
object
x402's settlement response, as PAYMENT-RESPONSE carries it; any other member is kept as it is.
Indexable
[
k:string]:Json|undefined
Properties
| Property | Type |
|---|---|
errorReason? | string |
network | string |
payer? | string |
success | boolean |
transaction | string |
ToolCallCommitment
ToolCallCommitment =
object
The commitment to an MCP tool call: the tool's name, and SHA-256 over the RFC 8785 form of its arguments.
Properties
| Property | Type |
|---|---|
argumentsDigest | Hex |
tool | string |
X402PairingId
X402PairingId =
"x402/exact/eip155/eip3009"|"x402/exact/eip155/permit2"|"x402/exact/eip155/erc7710"|"x402/exact/eip155/erc7710-salt"|"x402/upto/eip155/permit2"|"x402/auth-capture/eip155/eip3009"|"x402/auth-capture/eip155/permit2"
X402SchemePayload
X402SchemePayload = {
authorization:Eip3009Authorization;signature:Hex; } | {permit2Authorization:Permit2Authorization;signature:Hex; } | {delegationManager:string;delegator:string;permissionContext:string; } | {authorization:Eip3009Authorization;salt:string;saltNonce?:string;signature:Hex; } | {permit2Authorization:Permit2Authorization;salt:string;saltNonce?:string;signature:Hex; }
The payload of each x402 EVM scheme this package carries; every member is a string.
X402Unsigned
X402Unsigned = {
request: {escrow?:Hex;kind:"eip712";paymentInfo?:PaymentInfo;typedData:Permit2TypedData|Eip3009TypedData|ReceiveTypedData; };complete:Refusal|PaymentPayload; } | {request: {amount:bigint;chainId:number;kind:"erc7710";payTo:Hex;salt:AtrHash;token:Hex; };complete:Refusal|PaymentPayload; }
What a breadth pairing's build asks the buyer's signer for, and how the answer completes the payment.
Union Members
Type Literal
{ request: { escrow?: Hex; kind: "eip712"; paymentInfo?: PaymentInfo; typedData: Permit2TypedData | Eip3009TypedData | ReceiveTypedData; }; complete: Refusal | PaymentPayload; }
| Name | Type | Description |
|---|---|---|
request | object | On x402/auth-capture/eip155, paymentInfo and escrow are what the typed data's nonce is the hash of: paymentHash(chainId, escrow, paymentInfo), chainId the typed data's domain's, paymentInfo's payer the zero address, as the escrow's collectors compute it. They name the operator, the receiver and both expiries the signature grants, so a client can show them and hold the nonce to them. No other pairing gives them. |
request.escrow? | Hex | - |
request.kind | "eip712" | - |
request.paymentInfo? | PaymentInfo | - |
request.typedData | Permit2TypedData | Eip3009TypedData | ReceiveTypedData | - |
complete() | (sig) => Refusal | PaymentPayload | - |
Type Literal
{ request: { amount: bigint; chainId: number; kind: "erc7710"; payTo: Hex; salt: AtrHash; token: Hex; }; complete: Refusal | PaymentPayload; }
Variables
authCaptureEip3009
constauthCaptureEip3009:BreadthBase<"x402/auth-capture/eip155/eip3009"> &object
x402/auth-capture/eip155/eip3009. The payee broadcasts (broadcaster answers "payee"): the seller's
facilitator submits the escrow call that executes the authorization the payer signed, and names its transaction;
status reads it.
Type Declaration
| Name | Type | Default value |
|---|---|---|
authorizer() | (presented) => Promise<Refusal | `0x${string}`> | - |
bound() | (presented) => Promise<Refusal | `0x${string}`> | - |
build() | (choice, h) => Promise<Refusal | X402Unsigned> | - |
recover() | (input, reader) => Promise<Refusal | `0x${string}`> | - |
reference() | (presented, option) => Promise<Refusal | AuthCaptureRef> | - |
status() | (ref, reader, query) => Promise<StatusAnswer<bigint, EvmMark>> | authCaptureRead |
authCapturePermit2
constauthCapturePermit2:BreadthBase<"x402/auth-capture/eip155/permit2"> &object
x402/auth-capture/eip155/permit2. The payee broadcasts (broadcaster answers "payee"): the seller's
facilitator submits the escrow call that executes the Permit2 transfer the payer signed, and names its transaction;
status reads it.
Type Declaration
| Name | Type | Default value |
|---|---|---|
authorizer() | (presented) => Promise<Refusal | `0x${string}`> | - |
bound() | (presented) => Promise<Refusal | `0x${string}`> | - |
build() | (choice, h) => Promise<Refusal | X402Unsigned> | - |
recover() | (input, reader) => Promise<Refusal | `0x${string}`> | - |
reference() | (presented, option) => Promise<Refusal | AuthCaptureRef> | - |
status() | (ref, reader, query) => Promise<StatusAnswer<bigint, EvmMark>> | authCaptureRead |
exactEip3009
constexactEip3009:Readonly<{advertise:X402Advertise;authorizer: (presented) =>Promise<Refusal|`0x${string}`>;bound: (presented,given?) =>Promise<Refusal|`0x${string}`>;broadcaster: (presented) =>Promise<Refusal|Broadcaster>;build: (choice,h,act?) =>Promise<Refusal|Unsigned>;claims:boolean;data:PairingData;id:"x402/exact/eip155/eip3009";pattern:LcpPattern;read: (doc) =>Refusal|X402Read;recover: (input,reader) =>Promise<Refusal|`0x${string}`>;reference: (presented,option,given?) =>Promise<Refusal|Eip3009Ref>;status: (ref,reader,query) =>Promise<StatusAnswer<bigint,EvmMark>>;tie: (accepts,request) => ["x402", {accepts: readonlyPaymentRequirements[];request:RequestCommitment|ToolCallCommitment; }];unplaced: (option) =>Refusal|PaymentRequirements; }>
x402/exact/eip155/eip3009. The payee broadcasts (broadcaster answers "payee"): the seller's facilitator submits
transferWithAuthorization with the authorization the payer signed, and names its transaction; status reads it.
exactErc7710
constexactErc7710:BreadthBase<"x402/exact/eip155/erc7710"> &object
x402/exact/eip155/erc7710. The payee broadcasts (broadcaster answers "payee"): the seller's facilitator redeems
the delegation the payer signed. Nothing the delegator signed carries H, so a read of the chain alone never settles
it: its status reads the transaction the caller names, after the position of the agreement's own settlement, which
the caller gives, and holds it to a Transfer from the payment's delegator to the option's payee.
Type Declaration
| Name | Type | Default value |
|---|---|---|
bound() | (presented) => Promise<Refusal | `0x${string}`> | erc7710Bound |
build() | (choice, h) => Promise<Refusal | X402Unsigned> | erc7710Build |
reference() | (presented, option) => Promise<Refusal | Erc7710Ref> | - |
status() | (ref, reader, query) => Promise<StatusAnswer<bigint, EvmMark>> | erc7710Read |
exactErc7710Salt
constexactErc7710Salt:BreadthBase<"x402/exact/eip155/erc7710-salt"> &object
x402/exact/eip155/erc7710-salt. The payee broadcasts (broadcaster answers "payee"): the seller's
facilitator redeems the delegation the payer signed, and names its transaction; status reads it.
Type Declaration
| Name | Type | Default value |
|---|---|---|
authorizer() | (presented) => Promise<Refusal | `0x${string}`> | erc7710SaltAuthorizer |
bound() | (presented) => Promise<Refusal | `0x${string}`> | erc7710SaltBound |
build() | (choice, h) => Promise<Refusal | X402Unsigned> | erc7710Build |
recover() | (input, reader) => Promise<Refusal | `0x${string}`> | redeemedLeafRecover |
reference() | (presented, option) => Promise<Refusal | Erc7710Ref> | - |
status() | (ref, reader, query) => Promise<StatusAnswer<bigint, EvmMark>> | erc7710SaltRead |
exactGatewayBatched
constexactGatewayBatched:Readonly<{advertise:X402Advertise;authorizer: (presented) =>Promise<Refusal|`0x${string}`>;bound: (presented) =>Promise<Refusal|`0x${string}`>;broadcaster: (presented) =>Promise<Refusal|Broadcaster>;build: (choice,h) =>Promise<Refusal|GatewayBatchedUnsigned>;claims:boolean;data:PairingData;id:"x402/exact/eip155/gateway-batched";pattern:LcpPattern;read: (doc) =>Refusal|X402Read;tie: (accepts,request) => ["x402", {accepts: readonlyPaymentRequirements[];request:RequestCommitment|ToolCallCommitment; }];unplaced: (option) =>Refusal|PaymentRequirements; }>
x402/exact/eip155/gateway-batched. The payee broadcasts (broadcaster answers "payee"): the resource server
hands the authorization the payer signed to Circle Gateway, which settles it; no status reads it.
exactPermit2
constexactPermit2:BreadthBase<"x402/exact/eip155/permit2"> &object
x402/exact/eip155/permit2. The payee broadcasts (broadcaster answers "payee"): the seller's facilitator
submits the Permit2 transfer the payer signed, and names its transaction; status reads it.
Type Declaration
| Name | Type | Default value |
|---|---|---|
authorizer() | (presented) => Promise<Refusal | `0x${string}`> | - |
bound() | (presented, given?) => Promise<Refusal | `0x${string}`> | - |
build() | (choice, h, act?) => Promise<Refusal | X402Unsigned> | - |
recover() | (input, reader) => Promise<Refusal | `0x${string}`> | - |
reference() | (presented, option, given?) => Promise<Refusal | Permit2Ref> | - |
status() | (ref, reader, query) => Promise<StatusAnswer<bigint, EvmMark>> | permit2ExactRead |
LEGAL_CONTEXT
constLEGAL_CONTEXT:"legalContext"="legalContext"
The key of the x402 extension that carries the ATR hash and link, in a document's or payment's extensions.
LEGAL_CONTEXT_SCHEMA
constLEGAL_CONTEXT_SCHEMA:Json
The JSON Schema advertise writes as the schema of the legalContext extension: an object whose type is
"sha256", whose value is H as 0x and 64 lowercase hex digits, and whose legalContextUrl is an https URL.
PAYMENT_REQUIRED
constPAYMENT_REQUIRED:"PAYMENT-REQUIRED"="PAYMENT-REQUIRED"
The response header that carries PaymentRequired.
PAYMENT_RESPONSE
constPAYMENT_RESPONSE:"PAYMENT-RESPONSE"="PAYMENT-RESPONSE"
The response header that carries the settlement response.
PAYMENT_SIGNATURE
constPAYMENT_SIGNATURE:"PAYMENT-SIGNATURE"="PAYMENT-SIGNATURE"
The request header that carries PaymentPayload.
uptoPermit2
constuptoPermit2:BreadthBase<"x402/upto/eip155/permit2"> &object
x402/upto/eip155/permit2. The payee broadcasts (broadcaster answers "payee"): the seller's facilitator,
the witness's facilitator, submits the Permit2 transfer the payer signed for the amount it settles, and names its
transaction; status reads it.
Type Declaration
| Name | Type | Default value |
|---|---|---|
authorizer() | (presented) => Promise<Refusal | `0x${string}`> | - |
bound() | (presented, given?) => Promise<Refusal | `0x${string}`> | - |
build() | (choice, h, act?) => Promise<Refusal | X402Unsigned> | - |
recover() | (input, reader) => Promise<Refusal | `0x${string}`> | - |
reference() | (presented, option, given?) => Promise<Refusal | Permit2Ref> | - |
status() | (ref, reader, query) => Promise<StatusAnswer<bigint, EvmMark>> | permit2UptoRead |
Functions
decodePaymentRequired()
decodePaymentRequired(
header):Refusal|PaymentRequired
PAYMENT-REQUIRED's value: an x402 v2 PaymentRequired, else as decodeHeader refuses it.
Parameters
| Parameter | Type |
|---|---|
header | unknown |
Returns
decodePaymentResponse()
decodePaymentResponse(
header):Refusal|SettlementResponse
PAYMENT-RESPONSE's value: a settlement response, whose success is a boolean, else as decodeHeader refuses it.
Parameters
| Parameter | Type |
|---|---|
header | unknown |
Returns
decodePaymentSignature()
decodePaymentSignature(
header):Refusal|PaymentPayload
PAYMENT-SIGNATURE's value: an x402 v2 PaymentPayload, else as decodeHeader refuses it.
Parameters
| Parameter | Type |
|---|---|
header | unknown |
Returns
encodeHeader()
encodeHeader(
value):string|Refusal
A header's value as @x402/core 2.30.0 writes it (src/http/index.ts:17-18, :50-51, :76-80): JSON.stringify
of value, in its own member order, as UTF-8, in padded standard base64 (RFC 4648 §4). A member whose value is
undefined, at any depth, is left out, as JSON.stringify leaves it out, and a top-level extensionResponses is
left out, as encodePaymentResponseHeader deletes it; no x402 PaymentRequired or PaymentPayload has that member.
Nothing else that JSON.stringify would leave out or rewrite is taken (an undefined array item, a function, a
bigint): a value that is not then a JSON object, or whose UTF-8 is over MAX_HEADER_BYTES, is
x402/header-malformed.
Parameters
| Parameter | Type |
|---|---|
value | PaymentPayload | PaymentRequired | SettlementResponse |
Returns
string | Refusal
issuedDigest()
issuedDigest(
v):Promise<Refusal|`0x${string}`>
SHA-256 over the RFC 8785 form of an issued option or request commitment. Takes any value and refuses one that is not
JSON as core/content-not-json, as digestJson does.
Parameters
| Parameter | Type |
|---|---|
v | unknown |
Returns
Promise<Refusal | `0x${string}`>
pairingOfPayment()
pairingOfPayment(
p):"x402/exact/eip155/gateway-batched"|X402PairingId|undefined
The eip155 pairing of this entry point that serves a presented payment: the exact, upto or auth-capture pairing
its accepted names, Circle Gateway's batched exact option being x402/exact/eip155/gateway-batched, except that an erc7710 payment is the salt level only where its delegation manager is
DELEGATION_MANAGER, on a chain in DELEGATION_MANAGER_CHAINS, and the leaf delegation of its permission context
carries as its salt the H its echoed extensions.legalContext.info names. Every other delegation, a stock client's
whose leaf salt is drawn at random among them, or one whose context or extension does not decode, is the level that
signs no H. Undefined for any other option, an option on another rail included; the root pairingOf names the x402
pairing of an option on any rail.
Parameters
| Parameter | Type |
|---|---|
p | PaymentPayload |
Returns
"x402/exact/eip155/gateway-batched" | X402PairingId | undefined
requestCommitment()
requestCommitment(
r,fields?):Promise<Refusal|RequestCommitment>
The commitment to the request a challenge answers (x402-request-commitment.md): the method as received, a token (RFC
9110 §9.1, else x402/request-target-invalid), the target split at its first ?, and SHA-256 over the body bytes
exactly as received; and, where fields names request header fields, headers: for each, in the order named, its
lower-cased name and SHA-256 of its value as r.headers gives it, the lines of a field given more than once joined
by a comma and a space, cookie's by a semicolon and a space, and null for a field the request lacks. With no
field named the commitment has no headers member. Names that are not distinct field names, fields named with no
r.headers, header fields that are not a record of strings or lists of strings, two keys naming one named field, or
a named field's value holding a character outside visible ASCII, the space and the tab, are
x402/request-header-invalid; a named field's value over 1 MiB is x402/request-too-large.
Parameters
| Parameter | Type |
|---|---|
r | HttpRequest |
fields? | readonly string[] |
Returns
Promise<Refusal | RequestCommitment>
tie()
tie(
accepts,request): ["x402", {accepts: readonlyPaymentRequirements[];request:RequestCommitment|ToolCallCommitment; }]
The binding slot: every option the challenge offers, exactly as issued, and the request they answer, an HTTP request
(requestCommitment) or an MCP tool call (toolCallCommitment).
Parameters
| Parameter | Type |
|---|---|
accepts | readonly PaymentRequirements[] |
request | RequestCommitment | ToolCallCommitment |
Returns
["x402", { accepts: readonly PaymentRequirements[]; request: RequestCommitment | ToolCallCommitment; }]
toolCallCommitment()
toolCallCommitment(
call):Promise<Refusal|ToolCallCommitment>
The commitment to the MCP tool call a challenge answers (x402-request-commitment.md): the tool's name as received,
and SHA-256 over the RFC 8785 form of its arguments, absent read as {}. Nothing else of the request is read:
params._meta, where the payment rides, and the JSON-RPC envelope are not committed. A call that is not an object, a
name that is not a well-formed string of 1 to 8192 characters, or arguments that are not a JSON object, is
x402/tool-call-malformed; arguments over 1 MiB in that form are x402/request-too-large.
Parameters
| Parameter | Type |
|---|---|
call | ToolCall |
Returns
Promise<Refusal | ToolCallCommitment>
References
Broadcaster
Re-exports Broadcaster
Eip3009TypedData
Re-exports Eip3009TypedData
EvmMark
Re-exports EvmMark
EvmQuery
Re-exports EvmQuery
X402Advertise
Re-exports X402Advertise
X402Read
Re-exports X402Read
Last updated on
@integraledger/lcp/ucp
UCP checkouts and bookings, and five pairings, each of which carries the ATR hash and link as one `links[]` entry of type `legal_context` in the checkout response.
@integraledger/lcp/x402-batch-settlement
x402 `batch-settlement`: one ATR per channel, its hash the EVM channel configuration's `salt`, the Solana opening transaction's seller Memo instruction, or, on Cloudflare, the echoed `extensions.legalContext` of each request.