`, each byte field in its own fresh
`ArrayBuffer`, and `suiCarrier` takes any backing.
#### Type Parameters
| Type Parameter | Default type |
| ------ | ------ |
| `B` *extends* `ArrayBufferLike` | `ArrayBufferLike` |
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `bytes` | `Uint8Array`\<`B`\> | - |
| `digest` | `string` | Base58 of Blake2b-256 over `"TransactionData::"` followed by the bytes. |
| `sender` | `string` | The sender, who signed the bytes: `0x` and 64 lowercase hex digits. |
| `transfers` | readonly [`SuiTransfer`](https://lcp.integraledger.com/reference/api/sui.md#suitransfer)[] | The transfers the signed commands name, each with the recipient it names (`SuiTransfer`). |
| `untilEpoch` | `bigint` \| `null` | - |
| `unusedPure` | readonly `Uint8Array`\<`B`\>[] | - |
***
### SuiUnsigned
What `build` hands the payer's wallet, and how it checks what comes back.
#### Properties
| Property | Type |
| ------ | ------ |
| `request` | `object` |
| `request.accepted` | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) |
| `request.expiration` | `"epoch-bounded"` |
| `request.kind` | `"sui-transaction"` |
| `request.pureInput` | `Uint8Array`\<`ArrayBuffer`\> |
#### Methods
##### complete()
> **complete**(`signed`, `sent?`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SuiPaymentPayload`](https://lcp.integraledger.com/reference/api.md#suipaymentpayload)
The payment, once the signed transaction carries H. `sent` is the transaction the client sent to the option's gas
station (`extra.gasStation`), base64 of its `TransactionData`: on the sponsored path it is required, and the signed
transaction must equal it in everything but the gas data (its owner, payment, price and budget), else
`sui/not-as-sent`, since a gas station that changed the sender, an input, a command or the expiration could raise
the amount or remove the lapse under a valid H.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `signed` | [`SuiPayload`](https://lcp.integraledger.com/reference/api/sui.md#suipayload) |
| `sent?` | `string` |
###### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SuiPaymentPayload`](https://lcp.integraledger.com/reference/api.md#suipaymentpayload)
## Type Aliases
### SuiMark
> **SuiMark** = `"executed"` \| `"final"`
***
### SuiNetwork
> **SuiNetwork** = `"sui:mainnet"` \| `"sui:testnet"` \| `"sui:devnet"`
***
### SuiStatus
> **SuiStatus** = [`StatusAnswer`](https://lcp.integraledger.com/reference/api.md#statusanswer)\<`bigint`, [`SuiMark`](https://lcp.integraledger.com/reference/api/sui.md#suimark), `bigint`\>
The answer of `suiStatus`, as the profile `read-status` gives it, and on `settled` whether its act is the payment
presented. Positions are checkpoint sequence numbers, and so is the search's position. The one mark a query can ask
for is `final`, certified effects in a checkpoint; `executed`, a transaction the endpoint returns with no checkpoint,
is the state below it that the endpoint tells apart and no query names.
## Variables
### exactSui
> `const` **exactSui**: `Readonly`\<\{ `advertise`: (`doc`, `h`, `link`, `offer`, `agreementUrl?`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired); `bound`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `broadcaster`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>; `build`: (`choice`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SuiUnsigned`](https://lcp.integraledger.com/reference/api/sui.md#suiunsigned)\>; `claims`: `boolean`; `data`: [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata); `id`: `"x402/exact/sui"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Read`](https://lcp.integraledger.com/reference/api/aptos.md#x402read); `recover`: (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `reference`: (`presented`, `option`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SuiRef`](https://lcp.integraledger.com/reference/api/sui.md#suiref)\>; `status`: (`ref`, `reader`, `query`) => `Promise`\<[`SuiStatus`](https://lcp.integraledger.com/reference/api/sui.md#suistatus)\>; `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment); \}\]; `unplaced`: (`option`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements); \}\>
`x402/exact/sui`. The payee broadcasts (`broadcaster` answers `"payee"`): the seller's facilitator executes the
transaction the payer signed; `status` reads it by the digest the signed bytes fix.
***
### MAX\_SUI\_BALANCE\_CHANGES
> `const` **MAX\_SUI\_BALANCE\_CHANGES**: `4096` = `4096`
The most balance changes the read takes of one executed transaction: lcp's own bound on the work one reader's answer
asks of it. Sui sets no count a GraphQL answer is held to; a transaction with more is out of the reader's form.
***
### MAX\_SUI\_COIN\_TYPE\_LENGTH
> `const` **MAX\_SUI\_COIN\_TYPE\_LENGTH**: `4096` = `4096`
The longest coin type, in characters, the read takes from a balance change: lcp's own bound on a reader's answer. Sui
bounds a type by its nesting (16) and its identifiers, not by its text; a coin type with type parameters, such as a
pool's share `…::reserve::CToken`, is a coin type all the same.
***
### MAX\_SUI\_SEARCH\_PAGES
> `const` **MAX\_SUI\_SEARCH\_PAGES**: `8` = `8`
The pages one call of `status` reads of the search before it answers with the search's position: lcp's own bound on
the reads one call makes. The next call resumes from that position.
## Functions
### decodeSuiTx()
> **decodeSuiTx**(`base64`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SuiTx`](https://lcp.integraledger.com/reference/api/sui.md#suitx)\<`ArrayBuffer`\>
Decodes a base64 `TransactionData` V1 with a programmable kind. A programmable transaction with a type (a call's
type argument, a vector's element type, a funds withdrawal's type) that has a node at depth 16, Sui's type depth
limit, is `sui/tx-malformed`, the code of bytes that do not decode: @mysten/sui decodes a type by recursion, and the
bound gives the same answer whether this host's stack would hold the type or not. A V1 `TransactionData` of another
kind is `sui/not-programmable`, answered from its kind's tag before its body is decoded. The base64, the size bound
and the two tags are read without @mysten/sui: without it, bytes they refuse get the code they get with it, and any
other bytes are `sui/peer-missing`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `base64` | `string` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SuiTx`](https://lcp.integraledger.com/reference/api/sui.md#suitx)\<`ArrayBuffer`\>
***
### suiCarrier()
> **suiCarrier**(`tx`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``
The hash carried by exactly one unused `Pure` input of exactly 32 bytes. A `tx` that is not a decoded transaction, an
object whose `unusedPure` is an array of `Uint8Array`s, is `sui/tx-malformed`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `tx` | [`SuiTx`](https://lcp.integraledger.com/reference/api/sui.md#suitx) |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``
***
### suiFloor()
> **suiFloor**(`input`): `bigint` \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
The agreement's floor, the smallest amount an agreement option can name, in the coin type's base units, by the gas
path the option fixes (the profile `x402-exact-sui`, rules 7 and 16): 0 where the buyer pays gas (`buyer`, the option
carrying neither `extra.gasStation` nor `extra.gasless`) or a sponsor does (`sponsored`, `extra.gasStation`); on the
gasless path (`gasless`, `extra.gasless` true) the larger of 1 and the coin type's smallest transfer on the network,
`smallestTransfer`: the minimum Sui's protocol configuration lists beside the coin type among the tokens a gasless
transaction may move (`gasless_allowed_token_types`), which the caller reads for the option's network, since a
protocol upgrade can change it; the option filter refuses an amount of `"0"` on that path. A gas path not one of the
three, or on the gasless path a `smallestTransfer` that is not a non-negative bigint, is `sui/floor-input`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | \{ `gasPath`: `"buyer"` \| `"gasless"` \| `"sponsored"`; `smallestTransfer?`: `bigint`; \} |
| `input.gasPath` | `"buyer"` \| `"gasless"` \| `"sponsored"` |
| `input.smallestTransfer?` | `bigint` |
#### Returns
`bigint` \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
***
### suiRecover()
> **suiRecover**(`input`, `reader`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>
Reads the hash back from the executed transaction alone, by its digest, the input's `tx`; the input's `option` is
the option the payment answers, an object, of which the read needs no member. An input whose `tx` is not base58 of
32 bytes, or whose option is not an object, is `sui/wrong-reader`, with nothing read. Bytes that do not hash to the
digest are `sui/unreadable`; bytes that do, and that `decodeSuiTx` refuses, give its refusal, as `suiStatus` reads
no act in them. Without @mysten/sui the transaction cannot be decoded: bytes that hash to the digest, of a
transaction that did not abort, are `sui/peer-missing`, after the input, the reader and the read are checked, which
need no peer. One call.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | [`RecoverInput`](https://lcp.integraledger.com/reference/api.md#recoverinput)\<[`SuiNetwork`](https://lcp.integraledger.com/reference/api/sui.md#suinetwork), [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) \| [`MppChallenge`](https://lcp.integraledger.com/reference/api/mpp.md#mppchallenge)\> |
| `reader` | [`SuiReader`](https://lcp.integraledger.com/reference/api/sui.md#suireader) |
#### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>
***
### suiStatus()
> **suiStatus**(`ref`, `reader`, `query`): `Promise`\<[`SuiStatus`](https://lcp.integraledger.com/reference/api/sui.md#suistatus)\>
Answers the read of the recorded digest as the profile `read-status` gives it, with the search for H the profile
`x402/exact/sui` states. The digest is the single-use value: Sui derives it from the signed bytes alone, so the
transaction with it, succeeded or not, consumed it. That transaction must be these bytes carrying this hash, else
the answer is unreadable `unparseable`. It is classified from what landed: its signer, the sender, against the
option's payee and the reference's sender; the account it names, a positive balance change the payee's address owns
or a recipient a signed transfer names, against the payee; and whether it is another act the caller gave by its
reference. One with no checkpoint is in the state `executed`, after every checkpoint, so after the position given,
and below the final mark. An absent transaction can still land while the endpoint holds transactions from the
position given and the epoch at the search's head is not past its bound, or it has none; past it, it lapsed. Where
the read would answer `failed` for any reason but `before-position`, it reads the search for H: the sender's
transactions after the position given, or after the search's position an earlier answer returned, to the last
checkpoint the endpoint states it holds for the sender filter, at most `MAX_SUI_SEARCH_PAGES` pages a call, each transaction
read as `bound` reads one, those that carry H classified as the digest's is. A transaction it passes that does not
hash to its digest or does not decode is named among the items the search could not decode, held at the checkpoint
before it. A rejected read is
unreadable `transport`; an answer out of the reader's form `unparseable`; transaction bytes over the bound
`too-large`; a reader for another network `chain-mismatch`; a ref, a reader or a query that is not one is
`unparseable`, with nothing read.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `ref` | [`SuiRef`](https://lcp.integraledger.com/reference/api/sui.md#suiref) & `object` |
| `reader` | [`SuiReader`](https://lcp.integraledger.com/reference/api/sui.md#suireader) |
| `query` | [`StatusQuery`](https://lcp.integraledger.com/reference/api.md#statusquery)\<[`SuiRef`](https://lcp.integraledger.com/reference/api/sui.md#suiref) & `object`, `bigint`, [`SuiMark`](https://lcp.integraledger.com/reference/api/sui.md#suimark), `bigint`\> |
#### Returns
`Promise`\<[`SuiStatus`](https://lcp.integraledger.com/reference/api/sui.md#suistatus)\>
## References
### Broadcaster
Re-exports [Broadcaster](https://lcp.integraledger.com/reference/api.md#broadcaster)
***
### SuiPaymentPayload
Re-exports [SuiPaymentPayload](https://lcp.integraledger.com/reference/api.md#suipaymentpayload)
***
### X402Read
Re-exports [X402Read](https://lcp.integraledger.com/reference/api/aptos.md#x402read)
---
# @integraledger/lcp/svm
> Solana rail pieces: the wire transaction and its one Memo instruction carrying the ATR hash in LCP string form, the settlement read, and the payment-channels program's pieces.
Source: https://lcp.integraledger.com/reference/api/svm
Updated 2026-11-18. Documents @integraledger/lcp 0.6.3 and @integraledger/profile-facilitator 0.5.1.
Solana rail pieces: the wire transaction and its one Memo instruction carrying the ATR hash in LCP string form, the
settlement read, and the payment-channels program's pieces.
It also holds the digest of the message the payer signed. The settlement is read through a bounded reader. The
payment-channels pieces are its instructions and PDAs, the voucher, the session proof, and the channel's status read.
## Interfaces
### ChannelBuildInput
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `computeUnitLimit` | `number` | - |
| `computeUnitPrice` | `bigint` | - |
| `feePayer` | `string` | - |
| `instruction` | \{ `channel`: `string`; `deposit`: `bigint`; `gracePeriod`: `number`; `kind`: `"open"`; `openSlot`: `bigint`; `recipient`: `string`; `salt`: `bigint`; `signer`: `string`; \} \| \{ `amount`: `bigint`; `channel`: `string`; `kind`: `"top_up"`; \} \| \{ `channel`: `string`; `kind`: `"request_close"`; \} | - |
| `memo?` | `string` | The one Memo v3 instruction's text, a well-formed string; absent, the message carries no memo. |
| `mint` | `string` | - |
| `payer` | `string` | - |
| `recentBlockhash` | `string` | - |
| `tokenProgram` | `string` | - |
| `v1?` | [`SvmV1Header`](https://lcp.integraledger.com/reference/api/svm.md#svmv1header) | Present, a version-1 message (SIMD-0385) whose header carries the compute budget in this form; absent, v0. |
***
### ChannelIx
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `channel` | `string` | - |
| `data` | `Uint8Array`\<`ArrayBuffer`\> | A copy of the instruction's data. |
| `kind` | `"open"` \| `"top_up"` \| `"request_close"` | - |
***
### SvmBuildInput
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `amount` | `bigint` | - |
| `computeUnitLimit` | `number` | - |
| `computeUnitPrice` | `bigint` | - |
| `decimals` | `number` | - |
| `feePayer` | `string` | - |
| `memo` | `string` | - |
| `mint` | `string` | - |
| `payer` | `string` | - |
| `payTo` | `string` | - |
| `recentBlockhash` | `string` | - |
| `tokenProgram` | `string` | - |
| `v1?` | [`SvmV1Header`](https://lcp.integraledger.com/reference/api/svm.md#svmv1header) | Present, a version-1 message (SIMD-0385) whose header carries the compute budget in this form; absent, v0. |
***
### SvmCursor
The search's handle, which a `pending` answer returns and the next call takes: `before`, the signature below which
the buyer's account has range left to read; `head`, the newest signature an earlier pass read, so the next pass reads
the head down to it; `met`, the signatures of the transactions carrying H an earlier pass met that the answer rests
on, each a transaction that consumed the value or one the payer signed, other than those the caller gave, which the
next pass looks up by signature, since the ranges it resumes no longer list them; and `validAt`, the context slot of
the first `isBlockhashValid` answer of `true` at `confirmed`, as a decimal string, which bounds the blockhash's own
slot from above.
#### Properties
| Property | Modifier | Type |
| ------ | ------ | ------ |
| `before?` | `readonly` | `string` |
| `head?` | `readonly` | `string` |
| `met?` | `readonly` | readonly `string`[] |
| `validAt?` | `readonly` | `string` |
***
### SvmInner
One instruction of `meta.innerInstructions`: the top-level instruction it ran under (`index`), and its own fields.
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `accounts` | readonly `number`[] | - |
| `data` | `Uint8Array` | - |
| `index` | `number` | The index, among the message's top-level instructions, of the instruction it ran under. |
| `program` | `number` | Indexes the static keys, then `loaded.writable`, then `loaded.readonly`, as a top-level instruction does. |
***
### SvmInstruction
One compiled instruction of an `SvmTx`; `B` is what its data is backed by, as for `SvmTx`.
#### Type Parameters
| Type Parameter | Default type |
| ------ | ------ |
| `B` *extends* `ArrayBufferLike` | `ArrayBufferLike` |
#### Properties
| Property | Type |
| ------ | ------ |
| `accounts` | readonly `number`[] |
| `data` | `Uint8Array`\<`B`\> |
| `program` | `number` |
***
### SvmLanded
A landed transaction as `getTransaction` returns it with encoding `base64` and `maxSupportedTransactionVersion` 1,
the highest message version this package decodes.
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `err` | `unknown` | - |
| `inner` | readonly [`SvmInner`](https://lcp.integraledger.com/reference/api/svm.md#svminner)[] | `meta.innerInstructions`, in the node's order, each with the top-level instruction it ran under. |
| `loaded` | `object` | - |
| `loaded.readonly` | readonly `Uint8Array`\<`ArrayBufferLike`\>[] | - |
| `loaded.writable` | readonly `Uint8Array`\<`ArrayBufferLike`\>[] | - |
| `post?` | readonly [`SvmTokenBalance`](https://lcp.integraledger.com/reference/api/svm.md#svmtokenbalance)[] | `meta.postTokenBalances`; absent read as none. |
| `pre?` | readonly [`SvmTokenBalance`](https://lcp.integraledger.com/reference/api/svm.md#svmtokenbalance)[] | `meta.preTokenBalances`; absent read as none. |
| `slot?` | `bigint` | The slot of the block that holds it, as `getTransaction` gives it; absent where the endpoint gives none. |
| `wire` | `Uint8Array` | - |
***
### SvmNonce
The durable nonce a message uses: the nonce account its `AdvanceNonceAccount` instruction names, and the nonce value
the message carries in its blockhash field.
#### Properties
| Property | Type |
| ------ | ------ |
| `account` | `string` |
| `value` | `string` |
***
### SvmReader
Bounded, read-only calls against one network's endpoint. Every failure rejects, for example with `ReaderError` from
`@integraledger/lcp/evm`, and no function in this package reads a rejection as finding nothing: a rejected call is
`unreadable`, `transport` (`too-large` or `unparseable` for a `ReaderError` of kind `too-large` or `malformed`).
#### Properties
| Property | Modifier | Type |
| ------ | ------ | ------ |
| `network` | `readonly` | `` `solana:${string}` `` |
#### Methods
##### account()
> **account**(`address`, `commitment`): `Promise`\<\{ `slot`: `bigint`; `value`: \{ `data`: `Uint8Array`; `owner`: `string`; \} \| `null`; \}\>
`getAccountInfo` at that commitment with encoding `base64`: the response's context slot, and the account's owner and
data, or null when no account exists at that address.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `address` | `string` |
| `commitment` | [`SvmCommitment`](https://lcp.integraledger.com/reference/api/svm.md#svmcommitment) |
###### Returns
`Promise`\<\{ `slot`: `bigint`; `value`: \{ `data`: `Uint8Array`; `owner`: `string`; \} \| `null`; \}\>
##### blockhashValid()
> **blockhashValid**(`blockhash`, `commitment`): `Promise`\<\{ `slot`: `bigint`; `valid`: `boolean`; \}\>
`isBlockhashValid` at that commitment: `valid` is the response's `value`, and `slot` its context slot, the slot the
node evaluated it at.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `blockhash` | `string` |
| `commitment` | [`SvmCommitment`](https://lcp.integraledger.com/reference/api/svm.md#svmcommitment) |
###### Returns
`Promise`\<\{ `slot`: `bigint`; `valid`: `boolean`; \}\>
##### firstAvailableBlock()
> **firstAvailableBlock**(): `Promise`\<`bigint`\>
`getFirstAvailableBlock`: the lowest slot whose block the node still holds.
###### Returns
`Promise`\<`bigint`\>
##### signatures()
> **signatures**(`address`, `page`): `Promise`\
`getSignaturesForAddress` at that commitment, newest first, `before` and `until` as the RPC takes them (each
exclusive), and `minContextSlot`, "the minimum slot that the request can be evaluated at", so a node that has not
reached it fails the call.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `address` | `string` |
| `page` | \{ `before?`: `string`; `commitment`: [`SvmCommitment`](https://lcp.integraledger.com/reference/api/svm.md#svmcommitment); `limit`: `1000`; `minContextSlot?`: `bigint`; `until?`: `string`; \} |
| `page.before?` | `string` |
| `page.commitment` | [`SvmCommitment`](https://lcp.integraledger.com/reference/api/svm.md#svmcommitment) |
| `page.limit` | `1000` |
| `page.minContextSlot?` | `bigint` |
| `page.until?` | `string` |
###### Returns
`Promise`\
##### slot()
> **slot**(`commitment`): `Promise`\<`bigint`\>
`getSlot` at that commitment.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `commitment` | [`SvmCommitment`](https://lcp.integraledger.com/reference/api/svm.md#svmcommitment) |
###### Returns
`Promise`\<`bigint`\>
##### transaction()
> **transaction**(`signature`, `commitment`): `Promise`\<[`SvmLanded`](https://lcp.integraledger.com/reference/api/svm.md#svmlanded) \| \{ `notFound`: `true`; `slot`: `bigint` \| `null`; \}\>
`getTransaction` at that commitment, with encoding `base64` and `maxSupportedTransactionVersion: 1`, or `notFound`
with the node's slot there (`getSlot`, read from the same node before the lookup), or null when the reader cannot
read it. A reader must ask with 1: a node asked with 0 answers a version-1 transaction with an error (-32015).
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `signature` | `string` |
| `commitment` | [`SvmCommitment`](https://lcp.integraledger.com/reference/api/svm.md#svmcommitment) |
###### Returns
`Promise`\<[`SvmLanded`](https://lcp.integraledger.com/reference/api/svm.md#svmlanded) \| \{ `notFound`: `true`; `slot`: `bigint` \| `null`; \}\>
***
### SvmRef
The read keys of a presented payment, which `reference` returns: the network; the transaction id once the message is
signed in its first slot; the digest of the message the payer signed, the payment presented compared whole, absent
where the payment was presented as a transaction alone; the buyer's account, which the search pages and whose
signature is the act's; H as the presented payment carries it, which the search looks for; the option's payee, the
key of the read's two party tests; the fee payer; and what bounds the message's life: its recent blockhash, or the
durable nonce it uses.
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `blockhash?` | `string` | The recent blockhash; absent for a durable-nonce message and for a transaction alone. |
| `digest?` | `` `0x${string}` `` | - |
| `feePayer?` | `string` | - |
| `h` | `` `0x${string}` `` | - |
| `network` | `` `solana:${string}` `` | - |
| `nonce?` | [`SvmNonce`](https://lcp.integraledger.com/reference/api/svm.md#svmnonce) | Present exactly when the message uses a durable nonce. |
| `payee` | `string` | - |
| `payer` | `string` | - |
| `transaction?` | `string` | - |
***
### SvmSignature
One entry of `getSignaturesForAddress`.
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `memo` | `string` \| `null` | The RPC's rendering of the transaction's memos (`[len] text`, joined by `; `), or null when it has none. |
| `signature` | `string` | - |
| `slot` | `bigint` | - |
***
### SvmTokenBalance
One entry of `meta.preTokenBalances` or `meta.postTokenBalances`.
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `account` | `number` | `accountIndex`: the token account, indexing the keys as an instruction does. |
| `mint` | `string` | - |
| `owner?` | `string` | The token account's owner, which the read requires: a landed transaction whose balances name no owner cannot show whose account a transfer reached, so the search holds it as an item it could not decode, never another account. |
***
### SvmTx
A decoded wire transaction. `B` is what its bytes are backed by: `decodeSvmTx` gives `SvmTx`, each byte
field in its own fresh `ArrayBuffer`, and a function that reads one takes any backing.
#### Type Parameters
| Type Parameter | Default type |
| ------ | ------ |
| `B` *extends* `ArrayBufferLike` | `ArrayBufferLike` |
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `blockhash` | `Uint8Array`\<`B`\> | - |
| `instructions` | readonly [`SvmInstruction`](https://lcp.integraledger.com/reference/api/svm.md#svminstruction)\<`B`\>[] | - |
| `keys` | readonly `Uint8Array`\<`B`\>[] | The static account keys, in order. |
| `message` | `Uint8Array`\<`B`\> | Exactly the bytes every signer signed. |
| `signatures` | readonly `Uint8Array`\<`B`\>[] | - |
***
### SvmV1Header
The form of a version-1 message's header, which carries the compute budget in place of Compute Budget
instructions: the compute unit limit, the priority fee in lamports for the limit at the budget's price per unit,
rounded up, and the loaded-account-data limit.
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `loadedAccountsDataSizeLimit` | `number` | The loaded-account-data limit the header carries, in bytes. |
| `zeroPriorityFee` | `boolean` | Whether the header carries a priority fee of 0 lamports; otherwise a fee of 0 is left out. |
## Type Aliases
### ChannelStatus
> **ChannelStatus** = [`SvmStatus`](https://lcp.integraledger.com/reference/api/svm.md#svmstatus)
A channel opening's read: the answer `svmStatus` gives.
***
### SolanaNetwork
> **SolanaNetwork** = `` `solana:${string}` ``
CAIP-2: `solana:` and 32 base58 characters.
***
### SvmCloseRef
> **SvmCloseRef** = `object`
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `channel` | `string` | - |
| `network` | [`SolanaNetwork`](https://lcp.integraledger.com/reference/api/svm.md#solananetwork) | - |
| `payee` | `string` | The option's payee. |
| `phase` | `"close"` | - |
| `program` | `string` | - |
| `transaction` | `string` | - |
***
### SvmCloseStatus
> **SvmCloseStatus** = [`SvmStatus`](https://lcp.integraledger.com/reference/api/svm.md#svmstatus)
A reported close's read, as the profile `read-status` answers it: the answer `SvmStatus` names.
***
### SvmCommitment
> **SvmCommitment** = `"confirmed"` \| `"finalized"`
A commitment an RPC call names: `finalized`, the mark, or `confirmed`, a block a supermajority of the cluster voted
on, which is the latest head the search for H and the lookups read on to before a `failed`, and no mark.
***
### SvmMark
> **SvmMark** = `"finalized"`
The one Solana mark: `finalized`, a block at maximum lockout, the default and the final mark. A seller names it
alone, and a caller asks for it alone.
***
### SvmQuery
> **SvmQuery** = [`StatusQuery`](https://lcp.integraledger.com/reference/api.md#statusquery)\<[`SvmRef`](https://lcp.integraledger.com/reference/api/svm.md#svmref), `bigint`, [`SvmMark`](https://lcp.integraledger.com/reference/api/svm.md#svmmark), [`SvmCursor`](https://lcp.integraledger.com/reference/api/svm.md#svmcursor)\>
What a Solana status read takes with the reference and the reader.
***
### SvmStatus
> **SvmStatus** = [`StatusAnswer`](https://lcp.integraledger.com/reference/api.md#statusanswer)\<`bigint`, [`SvmMark`](https://lcp.integraledger.com/reference/api/svm.md#svmmark), [`SvmCursor`](https://lcp.integraledger.com/reference/api/svm.md#svmcursor)\>
A Solana settlement read, as the profile `read-status` answers it, the position a slot and the one mark `finalized`.
A `settled` answer states `presented`: `yes` where the landed message is the one the reference holds, by its digest,
or, for a payment presented as a transaction alone, where the act is that transaction; `no` otherwise; never
`unshown`, since the read decodes every message it settles on. A `pending` or `failed` answer that names a
transaction met only above the final head names no finality.
## Variables
### ATA\_PROGRAM
> `const` **ATA\_PROGRAM**: `"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"` = `"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"`
The Associated Token Account program id.
***
### COMPUTE\_BUDGET
> `const` **COMPUTE\_BUDGET**: `"ComputeBudget111111111111111111111111111111"` = `"ComputeBudget111111111111111111111111111111"`
The Compute Budget program id.
***
### MEMO\_V3
> `const` **MEMO\_V3**: `"MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"` = `"MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"`
An SPL Memo program id: a top-level instruction to it is a Memo instruction.
***
### MEMO\_V4
> `const` **MEMO\_V4**: `"Memo4c2pN8afCj432Lb7RMVKi9PbQnnW7ewFFaV3oAH"` = `"Memo4c2pN8afCj432Lb7RMVKi9PbQnnW7ewFFaV3oAH"`
An SPL Memo program id: a top-level instruction to it is a Memo instruction.
***
### OPEN\_DISCRIMINATOR
> `const` **OPEN\_DISCRIMINATOR**: `1` = `1`
***
### PAYMENT\_CHANNELS
> `const` **PAYMENT\_CHANNELS**: `"CHNLxYvVA28MJP9PrFuDXccuoGXAx7jBacfLEkahyGsX"` = `"CHNLxYvVA28MJP9PrFuDXccuoGXAx7jBacfLEkahyGsX"`
The payment-channels program id.
***
### RENT\_SYSVAR
> `const` **RENT\_SYSVAR**: `"SysvarRent111111111111111111111111111111111"` = `"SysvarRent111111111111111111111111111111111"`
The Rent sysvar id.
***
### SEAL\_DISCRIMINATOR
> `const` **SEAL\_DISCRIMINATOR**: `6` = `6`
***
### SETTLE\_AND\_SEAL\_DISCRIMINATOR
> `const` **SETTLE\_AND\_SEAL\_DISCRIMINATOR**: `4` = `4`
***
### SVM\_MAX\_CANDIDATES
> `const` **SVM\_MAX\_CANDIDATES**: `50` = `50`
The most candidates one pass of the search reads: lcp's own bound, since each candidate costs up to two
`getTransaction` calls, so one pass makes at most 100 lookups beside its 10 pages. A pass that meets more is not read
whole, and the next call resumes it.
***
### SVM\_SEARCH\_SHOWN
> `const` **SVM\_SEARCH\_SHOWN**: `false` = `false`
Whether a run has shown the fact the search's completeness rests on: that every transaction the buyer signs is listed
under its account's signatures (`getSignaturesForAddress`), which no run has shown yet. Until a run shows it,
a search read whole proves no absence (read-status rule 25): the read answers no `failed` but `before-position`, and
where it would answer `failed` it answers `pending`, `search-incomplete`. A later release sets it from that run.
***
### SYSTEM
> `const` **SYSTEM**: `"11111111111111111111111111111111"` = `"11111111111111111111111111111111"`
The System program id.
***
### TOKEN
> `const` **TOKEN**: `"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"` = `"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"`
The SPL Token program id.
***
### TOKEN\_2022
> `const` **TOKEN\_2022**: `"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"` = `"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"`
The SPL Token-2022 program id.
## Functions
### buildChannelMessage()
> **buildChannelMessage**(`i`): `Promise`\<`Uint8Array`\<`ArrayBuffer`\> \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)\>
The message for a channel instruction: `SetComputeUnitLimit`, `SetComputeUnitPrice`, the payment-channels
instruction with its accounts in the program's order, then one v3 Memo instruction when `memo` is given, as a v0
message; with `v1`, the same without the two Compute Budget instructions, as a version-1 message whose header
carries the budget (`compileV1`). The fee
payer is also the `open`'s rent payer and payee. A memo that is not a well-formed string (one holding a lone
surrogate has no UTF-8 form) is `svm/input-malformed`, with nothing built.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `i` | [`ChannelBuildInput`](https://lcp.integraledger.com/reference/api/svm.md#channelbuildinput) |
#### Returns
`Promise`\<`Uint8Array`\<`ArrayBuffer`\> \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)\>
***
### buildSvmMessage()
> **buildSvmMessage**(`i`): `Promise`\<`Uint8Array`\<`ArrayBuffer`\> \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)\>
The versioned message bytes for a token payment: `SetComputeUnitLimit`, `SetComputeUnitPrice`, `TransferChecked`
from the payer's associated token account to the payee's, then one v3 Memo instruction whose data is the memo's
UTF-8 bytes, as a v0 message; with `v1`, the same without the two Compute Budget instructions, as a version-1
message whose header carries the budget (`compileV1`). No lookup tables. A memo that is not a well-formed string
(one holding a lone surrogate has no UTF-8 form) is `svm/input-malformed`, with nothing built.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `i` | [`SvmBuildInput`](https://lcp.integraledger.com/reference/api/svm.md#svmbuildinput) |
#### Returns
`Promise`\<`Uint8Array`\<`ArrayBuffer`\> \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)\>
***
### channelInstruction()
> **channelInstruction**(`tx`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`ChannelIx`](https://lcp.integraledger.com/reference/api/svm.md#channelix)
The transaction's one top-level payment-channels instruction, by its discriminator. A `tx` that is not a decoded
transaction is `svm/tx-malformed`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `tx` | [`SvmTx`](https://lcp.integraledger.com/reference/api/svm.md#svmtx) |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`ChannelIx`](https://lcp.integraledger.com/reference/api/svm.md#channelix)
***
### channelPda()
> **channelPda**(`a`): `string` \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
The channel PDA: seeds "channel", payer, payee, mint, signer, u64le(salt), u64le(openSlot).
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `a` | \{ `mint`: `string`; `openSlot`: `bigint`; `payee`: `string`; `payer`: `string`; `salt`: `bigint`; `signer`: `string`; \} |
| `a.mint` | `string` |
| `a.openSlot` | `bigint` |
| `a.payee` | `string` |
| `a.payer` | `string` |
| `a.salt` | `bigint` |
| `a.signer` | `string` |
#### Returns
`string` \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
***
### channelVoucherMessage()
> **channelVoucherMessage**(`channelId`, `cumulative`, `expiresAt`): `Uint8Array`\<`ArrayBuffer`\>
The 50 bytes a channel voucher signs: `56 01` ‖ channelId ‖ cumulative u64 LE ‖ expiresAt i64 LE. Throws TypeError
when the channel id is not a base58 key or a number is out of range.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `channelId` | `string` |
| `cumulative` | `bigint` |
| `expiresAt` | `bigint` |
#### Returns
`Uint8Array`\<`ArrayBuffer`\>
***
### decodeSvmTx()
> **decodeSvmTx**(`wire`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SvmTx`](https://lcp.integraledger.com/reference/api/svm.md#svmtx)\<`ArrayBuffer`\>
Decodes a legacy or v0 wire transaction of at most 1,232 bytes, or a v1 wire transaction (SIMD-0385) of at most 4,096
bytes; a longer one is `svm/tx-too-large`. Bytes that are not one well-formed transaction are `svm/tx-malformed`, as
is a v0 message with an address table lookup that names no index, which the runtime refuses ("each lookup table must
be used to load at least one account"), and a v1 message that SIMD-0385's sanitization refuses (`decodeV1`). Each
byte field is a copy, so none shares memory with `wire`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `wire` | `Uint8Array` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SvmTx`](https://lcp.integraledger.com/reference/api/svm.md#svmtx)\<`ArrayBuffer`\>
***
### findPda()
> **findPda**(`seeds`, `program`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `address`: `string`; `bump`: `number`; \}
The program-derived address of `seeds` under `program`: for bumps 255 down to 0, the first
SHA-256(seeds ‖ bump ‖ program ‖ "ProgramDerivedAddress") that does not decompress to an Ed25519 point.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `seeds` | readonly `Uint8Array`\<`ArrayBufferLike`\>[] |
| `program` | `string` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `address`: `string`; `bump`: `number`; \}
***
### isKey()
> **isKey**(`s`): `s is string`
True when `s` is a Solana public key: a base58 string of 32 to 44 characters that decodes to exactly 32 bytes. An
account address, a program id and a recent blockhash all take this form.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `s` | `unknown` |
#### Returns
`s is string`
***
### openInstructionData()
> **openInstructionData**(`a`): `Uint8Array`\<`ArrayBuffer`\>
The `open` instruction's data: `01` ‖ salt u64 ‖ deposit u64 ‖ gracePeriod u32 ‖ openSlot u64 ‖ one recipient
(`01000000` ‖ recipient ‖ bps 10 000 as u16), little-endian. 67 bytes. Throws TypeError on a value out of range.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `a` | \{ `deposit`: `bigint`; `gracePeriod`: `number`; `openSlot`: `bigint`; `recipient`: `string`; `salt`: `bigint`; \} |
| `a.deposit` | `bigint` |
| `a.gracePeriod` | `number` |
| `a.openSlot` | `bigint` |
| `a.recipient` | `string` |
| `a.salt` | `bigint` |
#### Returns
`Uint8Array`\<`ArrayBuffer`\>
***
### openOf()
> **openOf**(`tx`, `program`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `channel`: `string`; `salt`: `bigint`; \}
The one top-level instruction of `program` whose data starts with `OPEN_DISCRIMINATOR`, with at least 33 bytes of
data and 6 accounts: its salt (data bytes 1–8, little-endian) and its channel (account 5). Else `svm/open-not-found`,
as is a channel named through an address lookup table: the message holds the table's address and an index, not the
account, and this function reads no table.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `tx` | [`SvmTx`](https://lcp.integraledger.com/reference/api/svm.md#svmtx) |
| `program` | `string` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `channel`: `string`; `salt`: `bigint`; \}
***
### sessionProof()
> **sessionProof**(`p`): `Uint8Array`\<`ArrayBuffer`\>
The UTF-8 of the core's `canonicalJson` of `{channelId, domain: "mpp-session-auth-v1", payer, sessionChallengeId}`.
Throws TypeError when `p` is not an object, or when its `channelId`, `payer` or `challengeId` is not a well-formed
string (one holding a lone surrogate has no UTF-8 form): it never returns a message the caller did not write.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `p` | \{ `challengeId`: `string`; `channelId`: `string`; `payer`: `string`; \} |
| `p.challengeId` | `string` |
| `p.channelId` | `string` |
| `p.payer` | `string` |
#### Returns
`Uint8Array`\<`ArrayBuffer`\>
***
### solanaVoucher()
> **solanaVoucher**(`channelId`, `cumulative`, `expiresAt?`): `Uint8Array`\<`ArrayBuffer`\> \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
The 50 bytes a voucher signs: `56 01` ‖ channel id ‖ cumulative u64 LE ‖ expiresAt i64 LE (0 when absent). A
malformed channel id or an out-of-range number is `svm/input-malformed`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `channelId` | `string` |
| `cumulative` | `bigint` |
| `expiresAt?` | `bigint` |
#### Returns
`Uint8Array`\<`ArrayBuffer`\> \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
***
### svmCarrier()
> **svmCarrier**(`tx`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `h`: `` `0x${string}` ``; `memo`: `string`; \}
The one top-level Memo instruction (v3 or v4) and the ATR hash its UTF-8 data carries in LCP string form. None, or
more than one, is `svm/memo-count`. The memo must be `toLcpString(h)` exactly, in lowercase hex; the same hash in
any other spelling is `svm/carrier-not-canonical`. A `tx` that is not a decoded transaction is `svm/tx-malformed`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `tx` | [`SvmTx`](https://lcp.integraledger.com/reference/api/svm.md#svmtx) |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `h`: `` `0x${string}` ``; `memo`: `string`; \}
***
### svmChannelStatus()
> **svmChannelStatus**(`ref`, `reader`, `query`): `Promise`\<[`SvmStatus`](https://lcp.integraledger.com/reference/api/svm.md#svmstatus)\>
The read of a channel opening that carries H (`x402/upto/solana`, `x402/batch-settlement/solana`, `mpp/session/solana/memo`).
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `ref` | [`SvmRef`](https://lcp.integraledger.com/reference/api/svm.md#svmref) |
| `reader` | [`SvmReader`](https://lcp.integraledger.com/reference/api/svm.md#svmreader) |
| `query` | [`SvmQuery`](https://lcp.integraledger.com/reference/api/svm.md#svmquery) |
#### Returns
`Promise`\<[`SvmStatus`](https://lcp.integraledger.com/reference/api/svm.md#svmstatus)\>
***
### svmDigest()
> **svmDigest**(`tx`): `Promise`\<`` `0x${string}` ``\>
SHA-256 over the message bytes every signer signed. Rejects with a TypeError when `tx` is not an object whose
`message` is a `Uint8Array`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `tx` | [`SvmTx`](https://lcp.integraledger.com/reference/api/svm.md#svmtx) |
#### Returns
`Promise`\<`` `0x${string}` ``\>
***
### svmOpeningStatus()
> **svmOpeningStatus**(`ref`, `reader`, `query`): `Promise`\<[`SvmStatus`](https://lcp.integraledger.com/reference/api/svm.md#svmstatus)\>
The read of a named channel opening at coverage `none` (`mpp/session/solana/stock`): the opening the reference names
is the act, whether or not it carries H, and the read makes no search.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `ref` | [`SvmRef`](https://lcp.integraledger.com/reference/api/svm.md#svmref) |
| `reader` | [`SvmReader`](https://lcp.integraledger.com/reference/api/svm.md#svmreader) |
| `query` | [`SvmQuery`](https://lcp.integraledger.com/reference/api/svm.md#svmquery) |
#### Returns
`Promise`\<[`SvmStatus`](https://lcp.integraledger.com/reference/api/svm.md#svmstatus)\>
***
### svmRecover()
> **svmRecover**(`input`, `reader`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>
Zero-party recovery: the ATR hash in the landed transaction's one memo, read by `tx`, the transaction's signature, at
`finalized`; `option`, the x402 option or MPP challenge the ATR's binding slot holds, must be an object, and no
member of it is read. A transaction that landed with an error at `finalized` is `svm/err`; one the read at
`confirmed` alone holds, with an error or none, is `svm/not-final`, a read to repeat, since a block not yet finalized
can be replaced. A landed wire that does not decode is `svm/unreadable`. An input or option that is not an object,
and a `tx` that is not a signature, are `svm/wrong-reader`, with nothing read. One or two calls.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | [`RecoverInput`](https://lcp.integraledger.com/reference/api.md#recoverinput)\<`` `solana:${string}` ``, [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) \| [`MppChallenge`](https://lcp.integraledger.com/reference/api/mpp.md#mppchallenge)\> |
| `reader` | [`SvmReader`](https://lcp.integraledger.com/reference/api/svm.md#svmreader) |
#### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>
***
### svmStatus()
> **svmStatus**(`ref`, `reader`, `query`): `Promise`\<[`SvmStatus`](https://lcp.integraledger.com/reference/api/svm.md#svmstatus)\>
The read of a transfer pairing (`x402/exact/solana`, the three MPP charges, `mpp/subscription/solana`).
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `ref` | [`SvmRef`](https://lcp.integraledger.com/reference/api/svm.md#svmref) |
| `reader` | [`SvmReader`](https://lcp.integraledger.com/reference/api/svm.md#svmreader) |
| `query` | [`SvmQuery`](https://lcp.integraledger.com/reference/api/svm.md#svmquery) |
#### Returns
`Promise`\<[`SvmStatus`](https://lcp.integraledger.com/reference/api/svm.md#svmstatus)\>
---
# @integraledger/lcp/tempo
> Tempo rail pieces: the `0x76` transaction's calls, the TIP-20 `transferWithMemo` calldata, the TIP-20 channel reserve's descriptor and ids, and the account keychain's key authorizations.
Source: https://lcp.integraledger.com/reference/api/tempo
Updated 2026-11-18. Documents @integraledger/lcp 0.6.3 and @integraledger/profile-facilitator 0.5.1.
Tempo rail pieces: the `0x76` transaction's calls, the TIP-20 `transferWithMemo` calldata, the TIP-20 channel
reserve's descriptor and ids, and the account keychain's key authorizations.
Tempo serves eip155 JSON-RPC, so the reader is `EvmReader`. Nothing here throws on a caller's value; refusals are
values.
## Interfaces
### KeyAuthorizationUnsigned
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `request` | `object` | `digest` is keccak256(rlp(authorization)); the root key signs it. |
| `request.authorization` | [`TempoKeyAuthorization`](https://lcp.integraledger.com/reference/api/tempo.md#tempokeyauthorization) | - |
| `request.digest` | `` `0x${string}` `` | - |
| `request.kind` | `"tempo-key-authorization"` | - |
#### Methods
##### complete()
> **complete**(`rootSignature`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`MppCredential`](https://lcp.integraledger.com/reference/api/mpp.md#mppcredential)
The credential for the root key's signature over `digest`, checked in `bound`'s order: a credential over the
credential size bound, 64 KiB, its echoed challenge included, is `mpp/credential-malformed`, then a signed key
authorization over 8,192 bytes is `tempo/key-authorization-malformed`, as `bound` refuses each.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `rootSignature` | `` `0x${string}` `` |
###### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`MppCredential`](https://lcp.integraledger.com/reference/api/mpp.md#mppcredential)
***
### TempoCall
#### Properties
| Property | Type |
| ------ | ------ |
| `input` | `Uint8Array`\<`ArrayBuffer`\> |
| `to` | `` `0x${string}` `` \| `null` |
| `value` | `bigint` |
***
### TempoDescriptor
#### Properties
| Property | Type |
| ------ | ------ |
| `authorizedSigner` | `` `0x${string}` `` |
| `expiringNonceHash` | `` `0x${string}` `` |
| `operator` | `` `0x${string}` `` |
| `payee` | `` `0x${string}` `` |
| `payer` | `` `0x${string}` `` |
| `salt` | `` `0x${string}` `` |
| `token` | `` `0x${string}` `` |
***
### TempoKeyAuthorization
#### Properties
| Property | Type |
| ------ | ------ |
| `allowedCalls` | `object`[] |
| `chainId` | `bigint` |
| `expiry` | `bigint` |
| `keyId` | `` `0x${string}` `` |
| `keyType` | `0` \| `1` \| `2` |
| `limits` | `object`[] |
| `witness` | `` `0x${string}` `` |
***
### TempoSearchReader
A reader of a Tempo network: an `EvmSearchReader` that also reads a storage slot, an account's protocol nonce and the
transactions of a block, each in the state after the block named. Every failure rejects.
#### Extends
- [`EvmSearchReader`](https://lcp.integraledger.com/reference/api/mpp.md#evmsearchreader)
#### Properties
| Property | Modifier | Type | Inherited from |
| ------ | ------ | ------ | ------ |
| `network` | `readonly` | `` `eip155:${string}` `` \| [`HederaNetwork`](https://lcp.integraledger.com/reference/api/evm.md#hederanetwork) | [`EvmSearchReader`](https://lcp.integraledger.com/reference/api/mpp.md#evmsearchreader).[`network`](https://lcp.integraledger.com/reference/api/mpp.md#property-network-1) |
#### Methods
##### block()
> **block**(`at`): `Promise`\<\{ `number`: `bigint`; `timestamp`: `bigint`; \}\>
`eth_getBlockByNumber(at, false)`: the block's number and its timestamp, in seconds.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `at` | `bigint` \| `"safe"` \| `"finalized"` \| `"latest"` |
###### Returns
`Promise`\<\{ `number`: `bigint`; `timestamp`: `bigint`; \}\>
###### Inherited from
[`EvmSearchReader`](https://lcp.integraledger.com/reference/api/mpp.md#evmsearchreader).[`block`](https://lcp.integraledger.com/reference/api/mpp.md#block)
##### blockNumber()
> **blockNumber**(`tag`): `Promise`\<`bigint`\>
`eth_getBlockByNumber(tag, false).number`.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `tag` | `"safe"` \| `"finalized"` |
###### Returns
`Promise`\<`bigint`\>
###### Inherited from
[`EvmSearchReader`](https://lcp.integraledger.com/reference/api/mpp.md#evmsearchreader).[`blockNumber`](https://lcp.integraledger.com/reference/api/mpp.md#blocknumber)
##### blockTransactions()
> **blockTransactions**(`block`): `Promise`\
`eth_getBlockByNumber(block, false)`'s `transactions`: the hashes of the block's transactions, in its order.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `block` | `bigint` |
###### Returns
`Promise`\
##### call()
> **call**(`to`, `data`, `block`): `Promise`\<`` `0x${string}` ``\>
`eth_call` of `data` to the contract `to`, in the state after block `block`: the return data.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `to` | `` `0x${string}` `` |
| `data` | `` `0x${string}` `` |
| `block` | `bigint` |
###### Returns
`Promise`\<`` `0x${string}` ``\>
###### Inherited from
[`EvmSearchReader`](https://lcp.integraledger.com/reference/api/mpp.md#evmsearchreader).[`call`](https://lcp.integraledger.com/reference/api/mpp.md#call)
##### logs()
> **logs**(`filter`): `Promise`\
`eth_getLogs` over `[fromBlock, toBlock]`: `address` absent reads every contract, and each topic is matched by its
position, `null` matching any.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `filter` | \{ `address?`: `` `0x${string}` ``; `fromBlock`: `bigint`; `toBlock`: `bigint`; `topics`: readonly (`` `0x${string}` `` \| `null`)[]; \} |
| `filter.address?` | `` `0x${string}` `` |
| `filter.fromBlock` | `bigint` |
| `filter.toBlock` | `bigint` |
| `filter.topics` | readonly (`` `0x${string}` `` \| `null`)[] |
###### Returns
`Promise`\
###### Inherited from
[`EvmSearchReader`](https://lcp.integraledger.com/reference/api/mpp.md#evmsearchreader).[`logs`](https://lcp.integraledger.com/reference/api/mpp.md#logs)
##### nonceAt()
> **nonceAt**(`account`, `block`): `Promise`\<`bigint`\>
`eth_getTransactionCount(account, block)`.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `account` | `` `0x${string}` `` |
| `block` | `bigint` |
###### Returns
`Promise`\<`bigint`\>
##### raw()
> **raw**(`tx`): `Promise`\<`` `0x${string}` `` \| `null`\>
`eth_getRawTransactionByHash`: the signed transaction's bytes; null when the node holds none.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `tx` | `` `0x${string}` `` |
###### Returns
`Promise`\<`` `0x${string}` `` \| `null`\>
###### Inherited from
[`EvmSearchReader`](https://lcp.integraledger.com/reference/api/mpp.md#evmsearchreader).[`raw`](https://lcp.integraledger.com/reference/api/mpp.md#raw)
##### receipt()
> **receipt**(`tx`): `Promise`\<[`EvmReceipt`](https://lcp.integraledger.com/reference/api/evm.md#evmreceipt) \| `null`\>
`eth_getTransactionReceipt`; null when the node holds none.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `tx` | `` `0x${string}` `` |
###### Returns
`Promise`\<[`EvmReceipt`](https://lcp.integraledger.com/reference/api/evm.md#evmreceipt) \| `null`\>
###### Inherited from
[`EvmSearchReader`](https://lcp.integraledger.com/reference/api/mpp.md#evmsearchreader).[`receipt`](https://lcp.integraledger.com/reference/api/mpp.md#receipt)
##### storageAt()
> **storageAt**(`address`, `slot`, `block`): `Promise`\<`` `0x${string}` ``\>
`eth_getStorageAt(address, slot, block)`: the 32-byte word.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `address` | `` `0x${string}` `` |
| `slot` | `` `0x${string}` `` |
| `block` | `bigint` |
###### Returns
`Promise`\<`` `0x${string}` ``\>
##### transaction()
> **transaction**(`tx`): `Promise`\<[`EvmTransaction`](https://lcp.integraledger.com/reference/api/evm.md#evmtransaction) \| `null`\>
`eth_getTransactionByHash`: the sender, the recipient (null for a contract creation) and the calldata; null when
none.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `tx` | `` `0x${string}` `` |
###### Returns
`Promise`\<[`EvmTransaction`](https://lcp.integraledger.com/reference/api/evm.md#evmtransaction) \| `null`\>
###### Inherited from
[`EvmSearchReader`](https://lcp.integraledger.com/reference/api/mpp.md#evmsearchreader).[`transaction`](https://lcp.integraledger.com/reference/api/mpp.md#transaction)
## Variables
### ACCESS\_KEY\_SPEND\_TOPIC
> `const` **ACCESS\_KEY\_SPEND\_TOPIC**: `"0xe0815e3aaadddf4dd75bde97fc060f0c38afe18e87a169be86a3f5c28247f192"`
AccessKeySpend(address,address,address,uint256,uint256): the account, the key id and the token are topics 1 to 3; the
keychain emits it for each spend an access key with enforced limits makes against its limit.
***
### ACCOUNT\_KEYCHAIN
> `const` **ACCOUNT\_KEYCHAIN**: `"0xaaaaaaaa00000000000000000000000000000000"`
The account keychain precompile.
***
### CHANNEL\_CLOSED\_V1\_TOPIC
> `const` **CHANNEL\_CLOSED\_V1\_TOPIC**: `"0x92ed5fe0fe56b3f4185e688efb342e92a4492b9df29ad5de596c44e64d097b51"`
ChannelClosed(bytes32,address,address,uint256,uint256), the v1 escrow's event.
***
### CHANNEL\_CLOSED\_V2\_TOPIC
> `const` **CHANNEL\_CLOSED\_V2\_TOPIC**: `"0x5613aed96d5bf39f928408dbe1d4143490b9bb5957eac2dd8e69b5dc4b2206e6"`
ChannelClosed(bytes32,address,address,uint96,uint96)
***
### CHANNEL\_OPENED\_V1\_TOPIC
> `const` **CHANNEL\_OPENED\_V1\_TOPIC**: `"0xcd6e60364f8ee4c2b0d62afc07a1fb04fd267ce94693f93f8f85daaa099b5c94"`
ChannelOpened(bytes32,address,address,address,address,bytes32,uint256), the v1 escrow's event as it is deployed and as
`mppx`'s legacy escrow ABI has it (0.15.0 `dist/tempo/legacy/session/escrow.abi.js:517-561`): the channel id, the payer
and the payee indexed; the token, the authorized signer, the salt and the deposit, data words 0 to 3.
***
### CHANNEL\_OPENED\_V2\_TOPIC
> `const` **CHANNEL\_OPENED\_V2\_TOPIC**: `"0xdebaba36f0e9c7978f536fed432d9360b1f9646d7ca88531c34c3eae43f154a7"`
ChannelOpened(bytes32,address,address,address,address,address,bytes32,bytes32,uint96)
***
### KEY\_AUTHORIZATION\_WITNESS\_TOPIC
> `const` **KEY\_AUTHORIZATION\_WITNESS\_TOPIC**: `"0x1f09d8956d18ea185372a3f7f40aca24bb45f303920c37c5f0605f4871da41f6"`
KeyAuthorizationWitness(address,bytes32)
***
### KEY\_REVOKED\_TOPIC
> `const` **KEY\_REVOKED\_TOPIC**: `"0x14ce4f0c8c12936436b733974fb13d10fc13e8c41c06dc8e19d82001c93d7989"`
KeyRevoked(address,address)
***
### OPEN\_V1\_SELECTOR
> `const` **OPEN\_V1\_SELECTOR**: `"0xc79ea485"`
open(address,address,uint128,bytes32,address)
***
### OPEN\_V2\_SELECTOR
> `const` **OPEN\_V2\_SELECTOR**: `"0xedc53b00"`
open(address,address,address,uint96,bytes32,address)
***
### RECEIVE\_POLICY\_GUARD
> `const` **RECEIVE\_POLICY\_GUARD**: `"0xb10c000000000000000000000000000000000000"`
Where a Tempo receive policy sends a blocked transfer.
***
### TIP20\_CHANNEL\_RESERVE
> `const` **TIP20\_CHANNEL\_RESERVE**: `"0x4d50500000000000000000000000000000000000"`
The TIP-20 channel reserve precompile.
***
### TRANSFER\_WITH\_MEMO\_SELECTOR
> `const` **TRANSFER\_WITH\_MEMO\_SELECTOR**: `"0x95777d59"`
The first four bytes of keccak256("transferWithMemo(address,uint256,bytes32)").
***
### TRANSFER\_WITH\_MEMO\_TOPIC
> `const` **TRANSFER\_WITH\_MEMO\_TOPIC**: `"0x57bc7354aa85aed339e000bccffabbc529466af35f0772c8f8ee1145927de7f0"`
keccak256("TransferWithMemo(address,address,uint256,bytes32)")
## Functions
### decodeKeyAuthorization()
> **decodeKeyAuthorization**(`signed`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `allowedCalls`: `object`[]; `digest`: `` `0x${string}` ``; `keyId`: `` `0x${string}` ``; `limits`: `object`[]; `witness?`: `` `0x${string}` ``; \}
Reads a signed key authorization: an RLP list of the authorization (3 to 9 items) and a byte-string signature. The
digest is keccak256 over the authorization's bytes as received. The witness is item 6, 32 bytes, when present. The
scope the payer signed is item 4, the limits (each a 20-byte token, a limit and, when non-zero, a period; an absent
period is 0), and item 5, the allowed calls (each a 20-byte target and its selector rules, each a 4-byte selector and
20-byte recipients). An absent item and an empty list both read as an empty list, though Tempo gives them opposite
meanings (absent: no limit or no call restriction; empty: no spending or no calls).
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `signed` | `` `0x${string}` `` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `allowedCalls`: `object`[]; `digest`: `` `0x${string}` ``; `keyId`: `` `0x${string}` ``; `limits`: `object`[]; `witness?`: `` `0x${string}` ``; \}
***
### decodeTempoTx()
> **decodeTempoTx**(`wire`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `calls`: [`TempoCall`](https://lcp.integraledger.com/reference/api/tempo.md#tempocall)[]; `chainId`: `bigint`; `validBefore`: `bigint` \| `null`; \}
The chain id, the calls and `valid_before` of a signed `0x76` transaction. Each call is `rlp([to, value, input])`,
with an empty `to` read as null and `input` a copy of `wire`'s bytes. `valid_before` written empty is null.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `wire` | `Uint8Array` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `calls`: [`TempoCall`](https://lcp.integraledger.com/reference/api/tempo.md#tempocall)[]; `chainId`: `bigint`; `validBefore`: `bigint` \| `null`; \}
***
### encodeKeyAuthorization()
> **encodeKeyAuthorization**(`a`, `signature?`): `Uint8Array`\<`ArrayBuffer`\> \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
rlp([chain_id, key_type, key_id, expiry, limits, allowed_calls, witness]); with a signature,
rlp([that list, signature]). At most 16 limits and 16 scopes, 16 selector rules each and 16 recipients each. Every
item is written, the empty ones included: an `expiry` of 0 as `0x80`, which Tempo reads as no expiry, and an empty
`limits` or `allowedCalls` as an empty list, which Tempo reads as no spending or no calls, never as the absent item.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `a` | [`TempoKeyAuthorization`](https://lcp.integraledger.com/reference/api/tempo.md#tempokeyauthorization) |
| `signature?` | `` `0x${string}` `` |
#### Returns
`Uint8Array`\<`ArrayBuffer`\> \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
***
### expiringNonceHash()
> **expiringNonceHash**(`signedTx`, `sender`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``
keccak256(`0x76` ‖ rlp(every envelope field before the sender's signature) ‖ sender). When a fee payer has signed,
`fee_token` is written as `0x80` and the fee payer's signature as `0x00`, as the sender signed them.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `signedTx` | `Uint8Array` |
| `sender` | `` `0x${string}` `` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``
***
### keyAuthorizationDigest()
> **keyAuthorizationDigest**(`a`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``
The digest a key authorization's root key signs: keccak256 of `encodeKeyAuthorization(a)`, the authorization with no
signature, the `digest` of `KeyAuthorizationUnsigned`'s request. An authorization `encodeKeyAuthorization` refuses is
refused the same way.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `a` | [`TempoKeyAuthorization`](https://lcp.integraledger.com/reference/api/tempo.md#tempokeyauthorization) |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``
***
### memoCalldata()
> **memoCalldata**(`to`, `amount`, `memo`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``
`transferWithMemo(to, amount, memo)` calldata: the selector, then the three 32-byte words.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `to` | `` `0x${string}` `` |
| `amount` | `bigint` |
| `memo` | `` `0x${string}` `` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``
***
### tempoChannelId()
> **tempoChannelId**(`d`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``
The TIP-20 channel reserve's channel id: keccak256(abi.encode(payer, payee, operator, token, salt,
authorizedSigner, expiringNonceHash, escrow, chainId)).
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `d` | [`TempoDescriptor`](https://lcp.integraledger.com/reference/api/tempo.md#tempodescriptor) & `object` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``
***
### witnessRecover()
> **witnessRecover**(`input`, `reader`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>
Reads the transaction's receipt and returns topic 2 of its one `KeyAuthorizationWitness` log from the account
keychain: none is `tempo/no-witness`, and more than one `tempo/ambiguous`. A failed read is `tempo/unreadable`, no
receipt `tempo/not-found` and a revert `tempo/reverted`, as `readReceiptAtMark` answers. A revert,
`tempo/no-witness` and `tempo/ambiguous` are given only where the receipt's block is at or below the reader's
`finalized` mark: above it, or where that mark cannot be read, each is `tempo/not-final`, a read to repeat, since a
block above the mark can be replaced by one in which the transaction succeeds or holds other logs. The mark is read
only for those. The challenge is not read. An input or reader that is not an object, an input whose `tx` is not a
32-byte hash, or a reader for another network than the input names, is `tempo/wrong-reader`, with nothing read. At
most two calls.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | [`RecoverInput`](https://lcp.integraledger.com/reference/api.md#recoverinput)\<`string`, [`MppChallenge`](https://lcp.integraledger.com/reference/api/mpp.md#mppchallenge)\> |
| `reader` | [`EvmReader`](https://lcp.integraledger.com/reference/api/evm.md#evmreader) |
#### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>
---
# @integraledger/lcp/tron
> Tron: the pairing `x402/exact/tron/lcp-trc20-memo`, whose payer-signed TRC-20 transfer carries the ATR hash as its memo, `raw_data.data`, in LCP string form, and the transaction pieces it uses.
Source: https://lcp.integraledger.com/reference/api/tron
Updated 2026-11-18. Documents @integraledger/lcp 0.6.3 and @integraledger/profile-facilitator 0.5.1.
Tron: the pairing `x402/exact/tron/lcp-trc20-memo`, whose payer-signed TRC-20 transfer carries the ATR hash as its
memo, `raw_data.data`, in LCP string form, and the transaction pieces it uses.
The pieces are protobuf for the fields the profile uses, base58check addresses and the transaction id. Settlement is
read by transaction id through a bounded reader.
## Interfaces
### TronBlock
A block as `getblockbylimitnext` and `getblockbynum` give it: its `blockID`, the `number` and `parentHash` of its
header's `raw_data`, and the `raw_data_hex` of each of its `transactions`, in order (java-tron at `4e8389f1`,
`framework/src/main/java/org/tron/core/services/http/Util.java:137-148`, `:295-298`).
#### Properties
| Property | Type |
| ------ | ------ |
| `blockId` | `` `0x${string}` `` |
| `number` | `bigint` |
| `parentHash` | `` `0x${string}` `` |
| `transactions` | readonly `string`[] |
***
### TronChoice
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `accepted` | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) | - |
| `feeLimit` | `bigint` | In sun, from 1 to 15,000,000,000. |
| `now` | `bigint` | Milliseconds since the epoch. |
| `payer` | `string` | The payer's base58check address. |
| `refBlock` | `object` | A recent block from the buyer's FullNode. |
| `refBlock.id` | `` `0x${string}` `` | - |
| `refBlock.number` | `bigint` | - |
| `required` | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired) | - |
***
### TronCursor
The search's position: the last block it linked, by its number and `blockID`, at or below the solidified head. A
`pending` answer returns it, and the next call takes it as `query.search` and reads on from the block after it.
#### Properties
| Property | Modifier | Type |
| ------ | ------ | ------ |
| `blockId` | `readonly` | `` `0x${string}` `` |
| `number` | `readonly` | `bigint` |
***
### TronInfo
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `blockNumber` | `bigint` | - |
| `logs` | readonly `object`[] | `address` is 20-byte hex as the node returns it; `data`, where given, the log's data in hex. |
| `result` | `string` | `receipt.result` as the node returns it: "SUCCESS", "REVERT", … |
***
### TronNow
A node's latest block at a level, as its `getnowblock` names it: its number, its `blockID` and its time in ms.
#### Properties
| Property | Type |
| ------ | ------ |
| `blockId` | `` `0x${string}` `` |
| `number` | `bigint` |
| `timestamp` | `bigint` |
***
### TronRaw
The `Transaction.raw` fields this profile uses. `B` is what its bytes are backed by: `decodeTronTx` gives
`TronRaw`, each byte field in its own fresh `ArrayBuffer`, and `encodeTronRaw` and `tronCarrier` take
any backing.
#### Type Parameters
| Type Parameter | Default type |
| ------ | ------ |
| `B` *extends* `ArrayBufferLike` | `ArrayBufferLike` |
#### Properties
| Property | Type |
| ------ | ------ |
| `callData` | `Uint8Array`\<`B`\> |
| `contractAddress` | `Uint8Array`\<`B`\> |
| `data` | `Uint8Array`\<`B`\> |
| `expiration` | `bigint` |
| `feeLimit` | `bigint` |
| `owner` | `Uint8Array`\<`B`\> |
| `refBlockBytes` | `Uint8Array`\<`B`\> |
| `refBlockHash` | `Uint8Array`\<`B`\> |
| `timestamp` | `bigint` |
***
### TronReader
Bounded, read-only calls against one network's FullNode: its `/walletsolidity` API for solidified data and its
`/wallet` API at the head. Every failure rejects, for example with `ReaderError` from `@integraledger/lcp/evm`, and
reads as unreadable `transport`; a rejection whose `kind` is `too-large`, as `ReaderError` carries it, is an answer over
the reader's byte bound.
#### Properties
| Property | Modifier | Type | Description |
| ------ | ------ | ------ | ------ |
| `archival?` | `readonly` | `boolean` | Declared by the caller where its node holds the chain's whole history, so that with no position given absence can be read; absent, it is not declared. |
| `network` | `readonly` | `` `tron:${number}` `` | - |
#### Methods
##### block()
> **block**(`num`, `level`): `Promise`\<\{ `block`: [`TronBlock`](https://lcp.integraledger.com/reference/api/tron.md#tronblock) \| `null`; `head`: `bigint` \| `null`; \}\>
`getblockbynum` at the level: the block, or null for the node's `{}`; and `head`, as `blocks` gives it.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `num` | `bigint` |
| `level` | [`TronLevel`](https://lcp.integraledger.com/reference/api/tron.md#tronlevel) |
###### Returns
`Promise`\<\{ `block`: [`TronBlock`](https://lcp.integraledger.com/reference/api/tron.md#tronblock) \| `null`; `head`: `bigint` \| `null`; \}\>
##### blocks()
> **blocks**(`start`, `end`, `level`): `Promise`\<\{ `blocks`: readonly [`TronBlock`](https://lcp.integraledger.com/reference/api/tron.md#tronblock)[]; `head`: `bigint` \| `null`; \}\>
`getblockbylimitnext` under `/walletsolidity` ("solid") or `/wallet` ("head"): the blocks from `start` up to `end`,
not including it, at most 100, in the order the node gives them, none for its `{}`; and `head`, the number of that
node's latest block at that level, read from that same node before the call, or null where the reader cannot.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `start` | `bigint` |
| `end` | `bigint` |
| `level` | [`TronLevel`](https://lcp.integraledger.com/reference/api/tron.md#tronlevel) |
###### Returns
`Promise`\<\{ `blocks`: readonly [`TronBlock`](https://lcp.integraledger.com/reference/api/tron.md#tronblock)[]; `head`: `bigint` \| `null`; \}\>
##### info()
> **info**(`txid`, `level`): `Promise`\<[`TronInfo`](https://lcp.integraledger.com/reference/api/tron.md#troninfo) \| \{ `notFound`: `true`; `timestamp`: `bigint` \| `null`; \}\>
`/walletsolidity/gettransactioninfobyid` ("solid") or `/wallet/gettransactioninfobyid` ("head"). When the node does
not know the transaction, `notFound` with `timestamp`: the time in milliseconds of the latest block at that level
on the node that answered (`/walletsolidity/getnowblock` or `/wallet/getnowblock`), read from that same node before
the lookup, or null when the reader cannot read it from that node. A lookup naming no time never reads failed.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `txid` | `` `0x${string}` `` |
| `level` | [`TronLevel`](https://lcp.integraledger.com/reference/api/tron.md#tronlevel) |
###### Returns
`Promise`\<[`TronInfo`](https://lcp.integraledger.com/reference/api/tron.md#troninfo) \| \{ `notFound`: `true`; `timestamp`: `bigint` \| `null`; \}\>
##### now()
> **now**(`level`): `Promise`\<[`TronNow`](https://lcp.integraledger.com/reference/api/tron.md#tronnow)\>
`/walletsolidity/getnowblock` ("solid") or `/wallet/getnowblock` ("head"): the latest block at that level.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `level` | [`TronLevel`](https://lcp.integraledger.com/reference/api/tron.md#tronlevel) |
###### Returns
`Promise`\<[`TronNow`](https://lcp.integraledger.com/reference/api/tron.md#tronnow)\>
##### transaction()
> **transaction**(`txid`): `Promise`\<\{ `rawDataHex`: `string`; \} \| `null`\>
`/walletsolidity/gettransactionbyid`; null: none.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `txid` | `` `0x${string}` `` |
###### Returns
`Promise`\<\{ `rawDataHex`: `string`; \} \| `null`\>
***
### TronRef
The read keys `reference` returns, JSON-serialisable. `raw` is the `raw_data` the owner signed, lowercase hex, which
is the payment presented; `txid` its SHA-256, the single-use value; `asset` the contract's 21-byte address;
`expiration` decimal milliseconds; `payer` the transaction's owner in base58check, read from the signed bytes; and
`payee` the `payTo` of the option the payment answers, the key of the two party tests and no search key.
#### Properties
| Property | Type |
| ------ | ------ |
| `asset` | `` `0x${string}` `` |
| `expiration` | `string` |
| `network` | `` `tron:${number}` `` |
| `payee` | `string` |
| `payer` | `string` |
| `raw` | `string` |
| `txid` | `` `0x${string}` `` |
***
### TronUnsigned
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `request` | `object` | What the payer signs. `rawBytes` is the transaction's `raw_data`, `Transaction.raw` as `encodeTronRaw` writes it; `txid` is its SHA-256, the 32-byte transaction id. `tronRequest` reads them. |
| `request.kind` | `"tron-txid"` | - |
| `request.rawBytes` | `Uint8Array`\<`ArrayBuffer`\> | - |
| `request.txid` | `Uint8Array`\<`ArrayBuffer`\> | - |
#### Methods
##### complete()
> **complete**(`signature`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`TronPayment`](https://lcp.integraledger.com/reference/api.md#tronpayment)
Takes the 65-byte secp256k1 signature `r ‖ s ‖ v`, v in {0, 1, 27, 28}.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `signature` | `Uint8Array` |
###### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`TronPayment`](https://lcp.integraledger.com/reference/api.md#tronpayment)
## Type Aliases
### TronLevel
> **TronLevel** = `"solid"` \| `"head"`
The level a read goes through: the full node's `/walletsolidity` API ("solid") or its `/wallet` API ("head").
***
### TronMark
> **TronMark** = `"head"` \| `"solidified"`
***
### TronNetwork
> **TronNetwork** = `` `tron:${number}` ``
CAIP-2 with the decimal chain id: tron:728126428 mainnet, tron:3448148188 Nile, tron:2494104990 Shasta.
***
### TronQuery
> **TronQuery** = [`StatusQuery`](https://lcp.integraledger.com/reference/api.md#statusquery)\<[`TronRef`](https://lcp.integraledger.com/reference/api/tron.md#tronref), `bigint`, [`TronMark`](https://lcp.integraledger.com/reference/api/tron.md#tronmark), [`TronCursor`](https://lcp.integraledger.com/reference/api/tron.md#troncursor)\>
The query `tronStatus` takes: the profile `read-status`'s, its search position a `TronCursor`.
***
### TronStatus
> **TronStatus** = [`StatusAnswer`](https://lcp.integraledger.com/reference/api.md#statusanswer)\<`bigint`, [`TronMark`](https://lcp.integraledger.com/reference/api/tron.md#tronmark), [`TronCursor`](https://lcp.integraledger.com/reference/api/tron.md#troncursor)\>
The answer of `tronStatus`, as the profile `read-status` gives it. Its marks are `head` and `solidified`, in that
order, its position the block number and its search position a `TronCursor`. A `settled` answer states `presented`:
`yes` where the settled transaction's id is the reference's, the id being the SHA-256 of the `raw_data` the owner
signed, and `no` otherwise; its `signer` is the transaction's owner in base58check, and its `authority` the
contract's `Permission_id`, as `Permission_id 0`, 0 where the transaction names none.
## Variables
### exactTronMemo
> `const` **exactTronMemo**: `Readonly`\<\{ `advertise`: (`doc`, `h`, `link`, `offer`, `agreementUrl?`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired); `bound`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `broadcaster`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>; `build`: (`c`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`TronUnsigned`](https://lcp.integraledger.com/reference/api/tron.md#tronunsigned)\>; `claims`: `boolean`; `data`: [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata); `id`: `"x402/exact/tron/lcp-trc20-memo"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Read`](https://lcp.integraledger.com/reference/api/aptos.md#x402read); `recover`: (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `reference`: (`presented`, `option`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`TronRef`](https://lcp.integraledger.com/reference/api/tron.md#tronref)\>; `status`: (`ref`, `reader`, `query`) => `Promise`\<[`TronStatus`](https://lcp.integraledger.com/reference/api/tron.md#tronstatus)\>; `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment); \}\]; `unplaced`: (`option`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements); \}\>
`x402/exact/tron/lcp-trc20-memo`. The payee broadcasts (`broadcaster` answers `"payee"`): the seller's facilitator
broadcasts the TRC-20 transfer the payer signed; `status` reads it by transaction id.
***
### LCP\_TRC20\_MEMO
> `const` **LCP\_TRC20\_MEMO**: `"lcp-trc20-memo"` = `"lcp-trc20-memo"`
***
### TRANSFER\_SELECTOR
> `const` **TRANSFER\_SELECTOR**: `"a9059cbb"` = `"a9059cbb"`
transfer(address,uint256)
***
### TRANSFER\_TOPIC
> `const` **TRANSFER\_TOPIC**: `"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"` = `"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"`
keccak256("Transfer(address,address,uint256)")
***
### TRIGGER\_SMART\_CONTRACT
> `const` **TRIGGER\_SMART\_CONTRACT**: `31` = `31`
***
### TRIGGER\_URL
> `const` **TRIGGER\_URL**: `"type.googleapis.com/protocol.TriggerSmartContract"` = `"type.googleapis.com/protocol.TriggerSmartContract"`
***
### TRON\_BOUNDS
> `const` **TRON\_BOUNDS**: `Readonly`\<\{ `callData`: `68`; `feeLimit`: `15000000000`; `maxTimeoutSeconds`: `86340`; `rangeBlocks`: `100`; `searchBlocks`: `200`; `signatureBytes`: `65`; `signatures`: `5`; `transactionHex`: `8192`; \}\>
The pairing's bounds, each the chain's, the profile's or lcp's own resource bound, with its reason.
`transactionHex`: lcp's bound on a signed transaction's hex digits, which the profile's transaction fits many times
over and which bounds what is decoded. `signatures`: lcp's bound on the signatures decoded, enough for an owner's
permission of five keys. `signatureBytes`: a secp256k1 signature `r ‖ s ‖ v`. `callData`: `transfer(address,uint256)`,
its selector and two 32-byte words. `feeLimit`: the network's largest `fee_limit` in sun. `maxTimeoutSeconds`: the
profile's, which keeps a signed `expiration` within the node's 24-hour cap. `rangeBlocks`: the node's own bound on a
range of `getblockbylimitnext` (java-tron at `4e8389f1`, `GetBlockByLimitNextServlet.java:18`). `searchBlocks`: lcp's
resource bound, the blocks one call of `tronStatus` reads of its search, two full ranges, so that each call's reads
are bounded; the next call takes the search's position.
## Functions
### decodeTronTx()
> **decodeTronTx**(`hex`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `raw`: [`TronRaw`](https://lcp.integraledger.com/reference/api/tron.md#tronraw)\<`ArrayBuffer`\>; `rawBytes`: `Uint8Array`\<`ArrayBuffer`\>; `signatures`: `Uint8Array`\<`ArrayBuffer`\>[]; \}
Decodes a signed `Transaction` from lowercase hex: `raw_data` with exactly one `TriggerSmartContract` and only the
fields TronRaw names, and 1 to 5 signatures of 65 bytes. The raw bytes must be exactly what `encodeTronRaw` writes
for the fields read.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `hex` | `string` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `raw`: [`TronRaw`](https://lcp.integraledger.com/reference/api/tron.md#tronraw)\<`ArrayBuffer`\>; `rawBytes`: `Uint8Array`\<`ArrayBuffer`\>; `signatures`: `Uint8Array`\<`ArrayBuffer`\>[]; \}
***
### encodeTronRaw()
> **encodeTronRaw**(`r`): `Uint8Array`\<`ArrayBuffer`\>
`Transaction.raw` as java-tron serialises it: fields in ascending order, default values omitted. Throws TypeError
when `r` is not an object, a bytes field is not a `Uint8Array`, or `expiration`, `timestamp` or `feeLimit` is not a
bigint from 0 below 2^63, the values `decodeTronTx` reads back.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `r` | [`TronRaw`](https://lcp.integraledger.com/reference/api/tron.md#tronraw) |
#### Returns
`Uint8Array`\<`ArrayBuffer`\>
***
### tronAddress()
> **tronAddress**(`address`): `Promise`\<`Uint8Array`\<`ArrayBuffer`\> \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)\>
Decodes a base58check address to its 21 bytes, which begin 0x41. The checksum is SHA-256 twice.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `address` | `string` |
#### Returns
`Promise`\<`Uint8Array`\<`ArrayBuffer`\> \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)\>
***
### tronCarrier()
> **tronCarrier**(`tx`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `h`: `` `0x${string}` ``; `txid`: `` `0x${string}` ``; \}\>
The hash in the memo of a transaction whose one contract calls `transfer`, and the transaction id. A `tx` that is not
`decodeTronTx`'s `{ raw, rawBytes }` is `tron/tx-malformed`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `tx` | \{ `raw`: [`TronRaw`](https://lcp.integraledger.com/reference/api/tron.md#tronraw); `rawBytes`: `Uint8Array`; \} |
| `tx.raw` | [`TronRaw`](https://lcp.integraledger.com/reference/api/tron.md#tronraw) |
| `tx.rawBytes` | `Uint8Array` |
#### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `h`: `` `0x${string}` ``; `txid`: `` `0x${string}` ``; \}\>
***
### tronRecover()
> **tronRecover**(`input`, `reader`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>
Recovers the hash from the transaction id alone: the memo of the transaction whose raw bytes hash to the id. A ref
whose `txid` is not a 32-byte hash is `tron/wrong-reader`, with nothing read. Raw data longer than the size bound
`decodeTronTx` reads is `tron/tx-too-large`, the code that function gives such a transaction. Raw data whose SHA-256
is not the id is not the transaction it names, and is `tron/unreadable`, as a failed read is. The input's `tx` is the
id, and its `option` the option the payment answers, an object, of which the read needs no member; an input whose
`tx` is not a 32-byte hash, or whose option is not an object, is `tron/wrong-reader`, with nothing read. One call.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | [`RecoverInput`](https://lcp.integraledger.com/reference/api.md#recoverinput)\<`` `tron:${number}` ``, [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) \| [`MppChallenge`](https://lcp.integraledger.com/reference/api/mpp.md#mppchallenge)\> |
| `reader` | [`TronReader`](https://lcp.integraledger.com/reference/api/tron.md#tronreader) |
#### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>
***
### tronRequest()
> **tronRequest**(`rawBytes`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `amount`: `string`; `asset`: `string`; `h`: `` `0x${string}` ``; `payer`: `string`; `payTo`: `string`; `raw`: [`TronRaw`](https://lcp.integraledger.com/reference/api/tron.md#tronraw)\<`ArrayBuffer`\>; `txid`: `Uint8Array`\<`ArrayBuffer`\>; \}\>
Reads the `raw_data` a `tron-txid` request carries, as `decodeTronTx` reads a signed transaction's and `tronCarrier`
reads its call and memo, with their codes, and gives `txid`, its SHA-256, which is the request's `txid` when the bytes
are its `rawBytes`. `raw` is every field the bytes hold, which are all the fields `decodeTronTx` admits: the reference
block's bytes and hash, `expiration` and `timestamp` in milliseconds, the memo `data`, `fee_limit` in sun, and the one
contract, a `TriggerSmartContract` with no call value from `owner` to `contractAddress` whose call data is
`transfer(address,uint256)`. Read from them: `payer`, the owner, and `asset`, the contract, in base58check; `payTo`,
the transfer's recipient, its address word's last 20 bytes under 0x41, in base58check; `amount`, the transfer's
value, in decimal; and `h`, the hash the memo carries. Bytes longer than the longest transaction `decodeTronTx` reads,
4,096 bytes, are `tron/tx-too-large`, and a value that is not a `Uint8Array` `tron/tx-malformed`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `rawBytes` | `Uint8Array` |
#### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `amount`: `string`; `asset`: `string`; `h`: `` `0x${string}` ``; `payer`: `string`; `payTo`: `string`; `raw`: [`TronRaw`](https://lcp.integraledger.com/reference/api/tron.md#tronraw)\<`ArrayBuffer`\>; `txid`: `Uint8Array`\<`ArrayBuffer`\>; \}\>
***
### tronStatus()
> **tronStatus**(`ref`, `reader`, `query`): `Promise`\<[`TronStatus`](https://lcp.integraledger.com/reference/api/tron.md#tronstatus)\>
Answers the read of the act the query asks about as the profile `read-status` gives it, by the pairing's profile, rule
8. The single-use value is the transaction id, the SHA-256 of the `raw_data` the owner signed, which the reference
holds whole as the payment presented. The read takes the latest solidified block first, then the transaction by id at
the solidified level and at the head, each lookup naming its own node's latest block time. Found, the transaction
consumed the id: it is the payer's act where its owner is the reference's payer and not the option's payee, it
succeeded where its receipt's result is `SUCCESS`, and what it moved is each `Transfer` log of its receipt whose
sender is the owner, named by the id and the log's place among the receipt's logs, or, where the receipt holds no
`Transfer` log and its signed call is a transfer of zero, that call's transfer of zero to its `to`; on the act
`payment` it is the payment only where one of those names `payTo`. Its owner is the answer's signer, and its
`Permission_id` the answer's authority. Absent from both lookups, each lookup's node at or past the solidified head's time, and the node holding the
block at the position the caller gave (or declared archival where it gave none), the id is unconsumed: before the
lapse, two slots past `expiration`, `instrument-live`. Only a `failed` answer needs the search for H, which the read
makes only then: it reads every block after the position given, or after the search position an earlier answer
returned, up to the solidified head read first through `/walletsolidity`, then on to the full node's head under
`/wallet`, at most `TRON_BOUNDS.rangeBlocks` a call and `TRON_BOUNDS.searchBlocks` a read, each block linked to the one
before it by its `parentHash`. Each transaction whose `data`, field 10 of its `raw_data`, is H's LCP string, its hex digits
in either case as `bound` reads it, is read by its id: one of the form whose owner is the payer and that meets the act's tests is the act asked about; any other is
named as a foreign item where a reason holds. Until a run shows that a block's answer lists every transaction of its
block, a search read whole proves no absence, so no `failed` but `before-position` is answered. A ref, a reader or a
query that is not one, a ref whose `raw` does not hash to its `txid`, is not the form's or is not owned by its
`payer`, or a search position that is not a `TronCursor`, is unreadable `unparseable`, with nothing read; a reader for
another network `chain-mismatch`; a read that rejects `transport`; one block over the reader's byte bound
`too-large`; and absence where the node does not hold the history `history-gap`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `ref` | [`TronRef`](https://lcp.integraledger.com/reference/api/tron.md#tronref) |
| `reader` | [`TronReader`](https://lcp.integraledger.com/reference/api/tron.md#tronreader) |
| `query` | [`TronQuery`](https://lcp.integraledger.com/reference/api/tron.md#tronquery) |
#### Returns
`Promise`\<[`TronStatus`](https://lcp.integraledger.com/reference/api/tron.md#tronstatus)\>
## References
### Broadcaster
Re-exports [Broadcaster](https://lcp.integraledger.com/reference/api.md#broadcaster)
***
### TronPayment
Re-exports [TronPayment](https://lcp.integraledger.com/reference/api.md#tronpayment)
***
### X402Payment
Re-exports [X402Payment](https://lcp.integraledger.com/reference/api.md#x402payment)
***
### X402Read
Re-exports [X402Read](https://lcp.integraledger.com/reference/api/aptos.md#x402read)
---
# @integraledger/lcp/tvm
> TON: the pairing `x402/exact/tvm`. The ATR hash rides in the scheme's `extra.forwardPayload` as a TEP-74 text comment holding its LCP string.
Source: https://lcp.integraledger.com/reference/api/tvm
Updated 2026-11-19. Documents @integraledger/lcp 0.6.3 and @integraledger/profile-facilitator 0.5.1.
TON: the pairing `x402/exact/tvm`. The ATR hash rides in the scheme's `extra.forwardPayload` as a TEP-74 text comment
holding its LCP string.
The payer's W5 wallet signs a request whose one Jetton transfer carries that payload; settlement is read from the W5
wallet's transaction with that request and the Jetton wallets' transactions it led to, through a bounded reader.
## Interfaces
### TonAccountState
An account's status and data hash, as TON Center v3 states them before or after a transaction.
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `dataHash` | `string` \| `null` | The representation hash of the account's data, in the index's spelling; null where the account holds none. |
| `status` | [`TonAccountStatus`](https://lcp.integraledger.com/reference/api/tvm.md#tonaccountstatus) | - |
***
### TonCell
A TON cell, as `@ton/core`'s `Cell` gives one: its data bits, its references and its representation hash. The entry
point's public types name this shape rather than the optional peer's class, and a `Cell` is one.
#### Properties
| Property | Modifier | Type |
| ------ | ------ | ------ |
| `bits` | `readonly` | `object` |
| `bits.length` | `readonly` | `number` |
| `refs` | `readonly` | readonly [`TonCell`](https://lcp.integraledger.com/reference/api/tvm.md#toncell)[] |
#### Methods
##### hash()
> **hash**(`level?`): `Uint8Array`
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `level?` | `number` |
###### Returns
`Uint8Array`
***
### TonIndexed
The index's statement of the masterchain blocks it holds: every block from `first` through `last`, a finalized block.
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `first` | `bigint` | - |
| `last` | `bigint` | - |
| `utime` | `number` | `last`'s `gen_utime`. |
***
### TonLink
A transaction of the wallet's list by the two members its successor links it by: its hash and its logical time.
#### Properties
| Property | Modifier | Type | Description |
| ------ | ------ | ------ | ------ |
| `hash` | `readonly` | `string` | - |
| `lt` | `readonly` | `string` | In decimal. |
***
### TonOutMsg
A transaction's out message: its hash, its body's opcode (null where it has none), and its body as a BoC.
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `body?` | `Uint8Array`\<`ArrayBufferLike`\> \| `null` | The body as a bag of cells (`message_content.body`); absent or null where the index gives none. |
| `hash` | `string` | - |
| `opcode` | `number` \| `null` | - |
***
### TonTx
A transaction as a TON Center v3 endpoint reports it. `inBody` is the inbound message body as a BoC, or null when the
transaction has no inbound message body (its `in_msg`, or that message's `message_content.body`, is null). The members
after `outMsgs` are the ones the expiry read takes, from `/api/v3/transactions`: a transaction lacking one cannot be
placed, linked or classed, and the read holds its search there.
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `aborted` | `boolean` | - |
| `account` | `string` | - |
| `after?` | [`TonAccountState`](https://lcp.integraledger.com/reference/api/tvm.md#tonaccountstate) | The account's state after it: its status TON Center v3's `end_status`, its data hash `account_state_after`'s `data_hash`. |
| `before?` | [`TonAccountState`](https://lcp.integraledger.com/reference/api/tvm.md#tonaccountstate) | The account's state before it: its status TON Center v3's `orig_status`, its data hash `account_state_before`'s `data_hash`. A transaction whose account did not exist before it, the account's deploy, carries it with the status `nonexist`, its `orig_status`, though `account_state_before` then states no `account_status`; so given, the expiry read does not hold its search there. |
| `finality` | `0` \| `1` \| `2` | TON Center v3's `FinalityState`: 0 pending, 1 confirmed, 2 finalized. |
| `hash` | `string` | - |
| `inBody` | `Uint8Array`\<`ArrayBufferLike`\> \| `null` | - |
| `inSource?` | `string` \| `null` | The inbound message's source, raw (`in_msg.source`); null for an external message. |
| `lt?` | `string` | Its logical time, in decimal (`lt`). |
| `mcSeqno?` | `bigint` \| `null` | The masterchain block that holds it (`mc_block_seqno`); null while none does. |
| `outMsgs` | readonly [`TonOutMsg`](https://lcp.integraledger.com/reference/api/tvm.md#tonoutmsg)[] | - |
| `prev?` | \{ `hash`: `string`; `lt`: `string`; \} \| `null` | Its predecessor on the account (`prev_trans_hash`, `prev_trans_lt`); null for the account's first. |
***
### TonWalletState
A wallet's state as the index holds it (`walletStates`): status, code hash, sequence number, last transaction.
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `codeHash` | `` `0x${string}` `` \| `null` | The representation hash of the account's code, `0x` and 64 hex digits; null where it holds none. |
| `last` | \{ `hash`: `string`; `lt`: `string`; \} \| `null` | The account's last transaction; null where it has none. |
| `seqno` | `number` \| `null` | The wallet's sequence number; null where the account holds no data. |
| `status` | [`TonAccountStatus`](https://lcp.integraledger.com/reference/api/tvm.md#tonaccountstatus) | - |
***
### TvmChoice
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `accepted` | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) | - |
| `attachNanotons` | `bigint` | The value attached to the outgoing message, above `forwardTonAmount`. |
| `jettonWallet` | `string` | The payer's Jetton wallet for `asset`, raw (`get_wallet_address` on the master), on a workchain as `wallet` is. |
| `now` | `number` | Seconds since the epoch. |
| `required` | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired) | - |
| `seqno` | `number` | - |
| `stateInit?` | `string` \| [`TonCell`](https://lcp.integraledger.com/reference/api/tvm.md#toncell) | The wallet's state init, for a wallet not yet deployed: a cell, or a base64 BoC of one root cell. It must be exactly one `StateInit`, as TON reads a message's state init: no bit or reference after its fields, at most 1,024 cells read, and at most two Merkle proofs or updates nested in it. It must be one TON deploys a wallet from at the configuration of the option's network: no libraries dictionary (global version 15), a fixed prefix length of at most ConfigParam 43's `max_acc_fixed_prefix_length`, 8 (global version 10), and a representation hash that is `wallet`'s 256-bit address, except the first fixed-prefix-length bits, which may differ, since TON deploys an account only from a state init whose hash is its address (`check_in_msg_state_hash`). Else `x402/option-malformed`. The settlement message carries it as its `init` exactly as given. |
| `wallet` | `string` | The payer's W5 wallet, raw, on a workchain TON's configuration holds (-1 or 0; else `x402/option-malformed`). |
| `walletId` | `number` | `get_subwallet_id`. |
***
### TvmReader
Bounded, read-only calls against one network's TON Center v3 endpoint. Every failure rejects, for example with
`ReaderError` from `@integraledger/lcp/evm`: one of kind `too-large` reads as `too-large`, one of kind `malformed` as
`unparseable`, and any other rejection as `transport`.
#### Properties
| Property | Modifier | Type |
| ------ | ------ | ------ |
| `network` | `readonly` | `` `tvm:${number}` `` |
#### Methods
##### byHash()
> **byHash**(`txHash`): `Promise`\<[`TonTx`](https://lcp.integraledger.com/reference/api/tvm.md#tontx) \| `null`\>
GET /api/v3/transactions?hash=…
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `txHash` | `string` |
###### Returns
`Promise`\<[`TonTx`](https://lcp.integraledger.com/reference/api/tvm.md#tontx) \| `null`\>
##### byInBody()
> **byInBody**(`bodyHash`): `Promise`\
GET /api/v3/transactionsByMessage?body_hash=…&direction=in: the transactions that took a message with this body.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `bodyHash` | `` `0x${string}` `` |
###### Returns
`Promise`\
##### byInMessage()
> **byInMessage**(`msgHash`): `Promise`\
GET /api/v3/transactionsByMessage?msg_hash=…&direction=in
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `msgHash` | `string` |
###### Returns
`Promise`\
##### headUtime()
> **headUtime**(): `Promise`\<`number`\>
GET /api/v3/masterchainInfo: the latest masterchain block's gen_utime, the latest head the endpoint serves.
###### Returns
`Promise`\<`number`\>
##### indexed()
> **indexed**(): `Promise`\<[`TonIndexed`](https://lcp.integraledger.com/reference/api/tvm.md#tonindexed) \| `null`\>
The index's own statement of the masterchain blocks through which it holds every block, from the same index that
answers the other calls, or null where it states none. `masterchainInfo`'s `last` is no such statement: it can be
ahead of an earlier block the index has not finished writing.
###### Returns
`Promise`\<[`TonIndexed`](https://lcp.integraledger.com/reference/api/tvm.md#tonindexed) \| `null`\>
##### jettonMaster()
> **jettonMaster**(`jettonWallet`): `Promise`\<`string`\>
`runGetMethod` `get_wallet_data` on a Jetton wallet: its master, raw.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `jettonWallet` | `string` |
###### Returns
`Promise`\<`string`\>
##### jettonWallet()
> **jettonWallet**(`master`, `owner`): `Promise`\<`string`\>
`runGetMethod` `get_wallet_address` on a Jetton master for an owner: the owner's Jetton wallet, raw.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `master` | `string` |
| `owner` | `string` |
###### Returns
`Promise`\<`string`\>
##### transactions()
> **transactions**(`account`, `from`, `limit`): `Promise`\
GET /api/v3/transactions?account=…&end_lt=…&sort=desc&limit=…: the account's transactions from `from` back, newest
first, at most `limit`, each with the members the expiry read takes.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `account` | `string` |
| `from` | \{ `hash`: `string`; `lt`: `string`; \} |
| `from.hash` | `string` |
| `from.lt` | `string` |
| `limit` | `number` |
###### Returns
`Promise`\
##### walletState()
> **walletState**(`account`): `Promise`\<[`TonWalletState`](https://lcp.integraledger.com/reference/api/tvm.md#tonwalletstate)\>
GET /api/v3/walletStates?address=…: the wallet's state as the index holds it.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `account` | `string` |
###### Returns
`Promise`\<[`TonWalletState`](https://lcp.integraledger.com/reference/api/tvm.md#tonwalletstate)\>
***
### TvmRef
The read keys a payment's settlement is read by, the members of the payment presented, and the payee, the `payTo` of
the option the payment answers, for both party tests and no search key. It names no asset.
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `codeHash?` | `` `0x${string}` `` | The representation hash of the code in the state init the payment carries; absent where it carries none. |
| `h` | `` `0x${string}` `` | H, which the request's Jetton transfer carries: the search for H looks for it in every run of the wallet. |
| `jettonWallet` | `string` | The payer's Jetton wallet, raw: the address TON sends the W5 request's one message to. |
| `network` | `` `tvm:${number}` `` | - |
| `payee` | `string` | - |
| `requestBodyHash` | `` `0x${string}` `` | The representation hash of the signed W5 request: the whole body of the message to the payer's wallet, its signature and any bit or reference after `has_other_actions` 0, which W5 does not read, included. |
| `seqno` | `number` | The sequence number the request was signed against: the single-use value. |
| `signedHash` | `` `0x${string}` `` | The representation hash of the W5 request with its signature removed, its last 512 bits: the hash the wallet's key signs. It holds the members of the payment presented, the request the payer signed, whole, its signature apart. |
| `transferBodyHash` | `` `0x${string}` `` | The representation hash of the Jetton transfer body the W5 request sends. |
| `validUntil` | `number` | - |
| `wallet` | `string` | The payer's W5 wallet, raw: the address TON sends the settlement message to. |
***
### TvmSearch
The search position of the expiry read, from which the next read resumes: `top`, the newest transaction of the
wallet the search had listed, and `next`, the transaction it reads next, at or below which nothing is read yet. The
next read lists the wallet's transactions above `top`, which landed since, then reads on from `next`; the ones
between were read.
#### Properties
| Property | Modifier | Type |
| ------ | ------ | ------ |
| `next` | `readonly` | [`TonLink`](https://lcp.integraledger.com/reference/api/tvm.md#tonlink) |
| `top` | `readonly` | [`TonLink`](https://lcp.integraledger.com/reference/api/tvm.md#tonlink) |
***
### TvmUnsigned
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `request` | `object` | What the wallet key signs. `signedBoc` is the W5 request, its signature not in it, as a base64 bag of cells of one root; `hash` is that root cell's 32-byte representation hash. `tvmRequest` reads them. |
| `request.hash` | `Uint8Array`\<`ArrayBuffer`\> | - |
| `request.kind` | `"ton-w5"` | - |
| `request.signedBoc` | `string` | - |
#### Methods
##### complete()
> **complete**(`signature`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`TvmPayment`](https://lcp.integraledger.com/reference/api.md#tvmpayment)
Takes the 64-byte Ed25519 signature.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `signature` | `Uint8Array` |
###### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`TvmPayment`](https://lcp.integraledger.com/reference/api.md#tvmpayment)
## Type Aliases
### TonAccountStatus
> **TonAccountStatus** = `"active"` \| `"uninit"` \| `"nonexist"` \| `"frozen"`
An account's status as TON Center v3 states it.
***
### TvmMark
> **TvmMark** = `"confirmed"` \| `"finalized"`
***
### TvmNetwork
> **TvmNetwork** = `` `tvm:${number}` ``
tvm:: tvm:-239 mainnet, tvm:-3 testnet.
***
### TvmStatus
> **TvmStatus** = [`StatusAnswer`](https://lcp.integraledger.com/reference/api.md#statusanswer)\<`bigint`, [`TvmMark`](https://lcp.integraledger.com/reference/api/tvm.md#tvmmark), [`TvmSearch`](https://lcp.integraledger.com/reference/api/tvm.md#tvmsearch)\>
The answer of `tvmStatus`, as the profile `read-status` gives it: each transfer of what moved named by the W5
transaction and, as its `place`, the hash of the Jetton `transfer` message that made it. Its marks are
`confirmed` and `finalized`, TON Center v3's finality states 1 and 2, in that order; a position is a masterchain
block's sequence number, and the search position a `TvmSearch`.
## Variables
### exactTvm
> `const` **exactTvm**: `Readonly`\<\{ `advertise`: (`doc`, `h`, `link`, `offer`, `agreementUrl?`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired); `bound`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `broadcaster`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>; `build`: (`c`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`TvmUnsigned`](https://lcp.integraledger.com/reference/api/tvm.md#tvmunsigned)\>; `claims`: `boolean`; `data`: [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata); `id`: `"x402/exact/tvm"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Read`](https://lcp.integraledger.com/reference/api/aptos.md#x402read); `recover`: (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `reference`: (`presented`, `option`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`TvmRef`](https://lcp.integraledger.com/reference/api/tvm.md#tvmref)\>; `status`: (`ref`, `reader`, `query`) => `Promise`\<[`TvmStatus`](https://lcp.integraledger.com/reference/api/tvm.md#tvmstatus)\>; `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment); \}\]; `unplaced`: (`option`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements); \}\>
`x402/exact/tvm`. The payee broadcasts (`broadcaster` answers `"payee"`): the seller's facilitator sends the request
the payer's W5 wallet signed; `status` reads the wallet's transaction and the Jetton transfers it led to.
***
### MAX\_TVM\_ATTACHED\_ABOVE\_FORWARD
> `const` **MAX\_TVM\_ATTACHED\_ABOVE\_FORWARD**: `30000000n` = `30_000_000n`
The most nanotons `build` attaches above the option's forward TON amount: x402's TON facilitator (`@x402/tvm`)
refuses a request whose attached value is above `forwardTonAmount` plus this (`@x402/tvm` 2.30.0,
`src/exact/facilitator/scheme.ts:326-329`, `DEFAULT_JETTON_WALLET_MESSAGE_AMOUNT` in `src/constants.ts:14`).
***
### MAX\_TVM\_BOC\_BYTES
> `const` **MAX\_TVM\_BOC\_BYTES**: `8192` = `8192`
The largest bag of cells the pairing reads, in bytes: lcp's own resource bound, far above the settlement message
of one W5 request with a deploying state init (a few hundred bytes).
***
### MAX\_TVM\_CELLS
> `const` **MAX\_TVM\_CELLS**: `512` = `512`
The most distinct cells a bag of cells the pairing reads may hold: lcp's own resource bound, as above.
***
### MAX\_TVM\_DEPTH
> `const` **MAX\_TVM\_DEPTH**: `32` = `32`
The deepest a bag of cells the pairing reads may be: lcp's own resource bound, as above.
***
### MAX\_TVM\_LISTED
> `const` **MAX\_TVM\_LISTED**: `256` = `256`
The most transactions of the payer's wallet one read lists, back from its latest: lcp's own resource bound. Past it
the search is held at the last masterchain block read.
***
### OP
> `const` **OP**: `object`
#### Type Declaration
| Name | Type | Default value |
| ------ | ------ | ------ |
| `internalSigned` | `1936289396` | `0x73696e74` |
| `internalTransfer` | `395134233` | `0x178d4519` |
| `jettonTransfer` | `260734629` | `0x0f8a7ea5` |
| `sendMsg` | `247711853` | `0x0ec3c86d` |
***
### TVM\_EXPIRY\_MARGIN
> `const` **TVM\_EXPIRY\_MARGIN**: `60` = `60`
The seconds a masterchain block's time must pass `validUntil` by before the read takes the request's validity as
passed at that block: a W5 transaction runs at its shard block's time, and a masterchain block references that shard
block only later, so the masterchain head can pass `validUntil` before an index holds a transaction that ran in time.
***
### W5R1\_CODE\_HASH
> `const` **W5R1\_CODE\_HASH**: `"0x20834b7b72b112147e1b2fb457b84e74d1a30f04f737d4f62a668e9552d2b72f"` = `"0x20834b7b72b112147e1b2fb457b84e74d1a30f04f737d4f62a668e9552d2b72f"`
W5R1's code hash, the one entry of the scheme's list of wallets (`scheme_exact_ton.md:166` at `x402-foundation/x402@88b66dd4`).
## Functions
### lcpComment()
> **lcpComment**(`h`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`TonCell`](https://lcp.integraledger.com/reference/api/tvm.md#toncell)
TEP-74's text comment: 32 zero bits, then the UTF-8 of the hash's LCP string. A value that is not a 32-byte hash is
`x402/payload-malformed`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `h` | `` `0x${string}` `` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`TonCell`](https://lcp.integraledger.com/reference/api/tvm.md#toncell)
***
### tvmCarrier()
> **tvmCarrier**(`settlementBoc`, `network`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `codeHash?`: `` `0x${string}` ``; `h`: `` `0x${string}` ``; `jettonWallet`: `string`; `payload`: [`TonCell`](https://lcp.integraledger.com/reference/api/tvm.md#toncell); `requestBodyHash`: `` `0x${string}` ``; `seqno`: `number`; `signedHash`: `` `0x${string}` ``; `transferBodyHash`: `` `0x${string}` ``; `validUntil`: `number`; `wallet`: `string`; \}
Reads the signed request in a settlement BoC: an internal message whose body is a W5 `internal_signed` request with
exactly one `action_send_msg` behind an empty list, carrying a Jetton transfer whose forward payload is a reference
to a text comment holding an LCP string. The request is read as W5's `internal_signed` path reads it
(ton-blockchain/wallet-contract-v5 `contracts/wallet_v5.fc`, `recv_internal`, `process_signed_request` and
`process_actions`): at least 640 bits, its signature the body's last 512 bits, and the signed part the rest with all
its references, in which the wallet id, `valid_until`, seqno, the action list's `Maybe ^Cell` and
`has_other_actions` are read; W5 reads nothing after `has_other_actions` 0, and neither does this, so bits and
references there are carried, not read. A body W5 does not run as a signed request, or whose signed part ends before
those fields, is `tvm/not-w5-signed`, and an empty action list or `has_other_actions` 1 is `tvm/actions`. The
signature is not verified. The BoC's bytes are read as TON deserializes a bag of cells, and bytes TON
refuses are `tvm/boc-malformed`. `requestBodyHash` and `transferBodyHash` are the representation hashes TON gives,
for any cell TON reads, a pruned branch of any level mask included. Each message is read as TON's action phase sends
it, at the configuration lcp holds for `network`, as `bound` and `reference` read the payment of an option on that
network: a source of `addr_none` or an `addr_std` with no anycast (the outgoing message's the W5 wallet's own), a
destination TON sends to, a value and an `extra_flags` of at most 3 each in its shortest form, its state init
validated as TON validates it, a referenced body that is an ordinary cell with nothing after it, and at most two
nested Merkle proofs or updates; the W5 action's send mode is one TON sends with. The network is `tvm:-239` (mainnet)
or `tvm:-3` (testnet), and any other is `tvm/network-malformed`. The settlement message TON would not send is
`tvm/boc-malformed`, and the outgoing one `tvm/not-jetton-transfer`; a send mode other than 1 or 3, the two the
scheme admits, is `tvm/actions`. It also gives the request's sequence number, `signedHash`, the representation hash of
the request less its signature, which the wallet's key signs, and, where the message carries a state init, the
hash of its code. The
settlement message's source names the account that relays it, which the BoC cannot show: one naming another account
is read, and TON sends it when that account relays it. `wallet` and `jettonWallet` are the addresses TON sends to: an
`addr_var` of 256 bits names its `addr_std`. The network, the base64, the 8 KiB bound, the bag-of-cells layout and
its CRC32C need no peer: without @ton/core they give the codes they give with it, and a BoC that passes them is
`tvm/peer-missing`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `settlementBoc` | `string` |
| `network` | `` `tvm:${number}` `` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `codeHash?`: `` `0x${string}` ``; `h`: `` `0x${string}` ``; `jettonWallet`: `string`; `payload`: [`TonCell`](https://lcp.integraledger.com/reference/api/tvm.md#toncell); `requestBodyHash`: `` `0x${string}` ``; `seqno`: `number`; `signedHash`: `` `0x${string}` ``; `transferBodyHash`: `` `0x${string}` ``; `validUntil`: `number`; `wallet`: `string`; \}
***
### tvmRecover()
> **tvmRecover**(`input`, `reader`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>
Recovers the hash from the payer Jetton wallet's transaction: the comment in its inbound Jetton transfer. A
transaction with no inbound message body, or whose body is not a Jetton `transfer`, is `tvm/not-jetton-transfer`. A
body that is not a bag of cells with one root is an answer out of the reader's documented form, `tvm/unreadable`. A
ref that names no `transaction` string is `tvm/wrong-reader`, with nothing read. Without @ton/core the body's cells
cannot be read: a transaction with an inbound message body is `tvm/peer-missing`, after the ref, the reader, the read
and the body's size, bag-of-cells layout and CRC32C are checked, which need no peer, so an empty body is
`tvm/unreadable` and one over 8 KiB `tvm/boc-too-large` either way. The input's `tx` is the transaction's hash, and
its `option` the option the payment answers, an object, of which the read needs no member; an input whose `tx` is
not a non-empty string, or whose option is not an object, is `tvm/wrong-reader`, with nothing read. One call.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | [`RecoverInput`](https://lcp.integraledger.com/reference/api.md#recoverinput)\<`` `tvm:${number}` ``, [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) \| [`MppChallenge`](https://lcp.integraledger.com/reference/api/mpp.md#mppchallenge)\> |
| `reader` | [`TvmReader`](https://lcp.integraledger.com/reference/api/tvm.md#tvmreader) |
#### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>
***
### tvmRequest()
> **tvmRequest**(`signedBoc`, `network`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `amount`: `string`; `attachNanotons`: `bigint`; `customPayload?`: `string`; `extraCurrencies`: `object`[]; `forwardTonAmount`: `string`; `h`: `` `0x${string}` ``; `hash`: `Uint8Array`\<`ArrayBuffer`\>; `jettonWallet`: `string`; `mode`: `number`; `payTo`: `string`; `queryId`: `bigint`; `responseDestination`: `string` \| `null`; `seqno`: `number`; `stateInit?`: `string`; `validUntil`: `number`; `walletId`: `number`; \}
Reads the W5 request a `ton-w5` request carries, `signedBoc`, as `tvmCarrier` reads the signed part of a settlement
message's body at the network's configuration, with its codes, and gives `hash`, the root cell's representation hash,
which is the request's `hash` when the text is its `signedBoc`. The root must be an ordinary cell whose op is
`internal_signed`, or it is `tvm/not-w5-signed`. It gives every member W5 reads: the wallet id, `validUntil`, the
sequence number and the one action's send mode; and of the one message that action sends, its destination
(`jettonWallet`), the nanotons it attaches, each extra currency it attaches by its id, and its state init, where it
carries one, as a base64 bag of cells; and of the Jetton `transfer` it carries, the query id, `amount`, the
destination (`payTo`), the response destination or null for `addr_none`, the custom payload where it carries one, as
a base64 bag of cells, the forward TON amount and the hash the forward payload's comment holds. Addresses are raw. A
request holds one action, sending one Jetton `transfer`, or it is refused, so nothing else runs under the signature;
W5 reads nothing after `has_other_actions`, and neither does this. The request names no wallet, so the message's
source is read as the settlement message's sender is, by its form alone.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `signedBoc` | `string` |
| `network` | `` `tvm:${number}` `` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `amount`: `string`; `attachNanotons`: `bigint`; `customPayload?`: `string`; `extraCurrencies`: `object`[]; `forwardTonAmount`: `string`; `h`: `` `0x${string}` ``; `hash`: `Uint8Array`\<`ArrayBuffer`\>; `jettonWallet`: `string`; `mode`: `number`; `payTo`: `string`; `queryId`: `bigint`; `responseDestination`: `string` \| `null`; `seqno`: `number`; `stateInit?`: `string`; `validUntil`: `number`; `walletId`: `number`; \}
***
### tvmStatus()
> **tvmStatus**(`ref`, `reader`, `query`): `Promise`\<[`TvmStatus`](https://lcp.integraledger.com/reference/api/tvm.md#tvmstatus)\>
Answers the read of the request as the profile `read-status` gives it, from the facts the profile `x402-exact-tvm`
(rule 6) names, with `presented` on `settled`. The read takes, from one TON Center v3 index: the latest head's time;
the index's statement of the masterchain blocks it holds; the W5 wallet's transactions with the request's body; the
wallet's state; and, for a W5 wallet, its transactions from the latest back, each by its predecessor, to the first at
or before the position given (the expiry read, which is the search for H). Every run of the wallet whose Jetton
`transfer` carries H is followed to the payer's Jetton wallet and from its `internal_transfer` to the Jetton wallet
that took it, and tested by the two party tests: the W5 wallet is not the option's payee, on either act; and, on the
act `payment`, the delivering account is the payee's Jetton wallet of the payer's Jetton wallet's master, read by
`get_wallet_address` for `payTo` through the reader. Positions are masterchain block sequence numbers. The single-use
value is the signed sequence number: consumed where a listed run is at it, where the active wallet's number is above
it, or where a listed transaction removed or deployed the account; lapsed where the latest head is more than 60
seconds past `validUntil`, and read at the final mark only where the stated finalized block is too. The search is
read whole only through a reader that declares `listsWhole`. A wallet that is not W5 gets no expiry read: its value
is not read, and the body-hash lookup is its search, read whole where the stated block is at or past the latest head.
The read decodes the cells it reads itself, without @ton/core, and compares raw addresses itself, so every answer is
the same with it and without it. A ref, a reader or a query that is not one, or a ref whose hashes are not `0x` and
64 hex digits, is unreadable `unparseable`, with nothing read; a reader for another network than the ref's is
`chain-mismatch`; a rejected read is `transport`, or `too-large` or `unparseable` for a `ReaderError` of that kind;
an answer out of the reader's form is `unparseable`. A frozen account, its code removed, runs no request until a
message restores the state its hash fixes, its number among it, so it reads as `uninit` and `nonexist` do: the number
not passed.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `ref` | [`TvmRef`](https://lcp.integraledger.com/reference/api/tvm.md#tvmref) |
| `reader` | [`TvmReader`](https://lcp.integraledger.com/reference/api/tvm.md#tvmreader) |
| `query` | [`StatusQuery`](https://lcp.integraledger.com/reference/api.md#statusquery)\<[`TvmRef`](https://lcp.integraledger.com/reference/api/tvm.md#tvmref), `bigint`, [`TvmMark`](https://lcp.integraledger.com/reference/api/tvm.md#tvmmark), [`TvmSearch`](https://lcp.integraledger.com/reference/api/tvm.md#tvmsearch)\> |
#### Returns
`Promise`\<[`TvmStatus`](https://lcp.integraledger.com/reference/api/tvm.md#tvmstatus)\>
## References
### Broadcaster
Re-exports [Broadcaster](https://lcp.integraledger.com/reference/api.md#broadcaster)
***
### TvmPayment
Re-exports [TvmPayment](https://lcp.integraledger.com/reference/api.md#tvmpayment)
***
### X402Payment
Re-exports [X402Payment](https://lcp.integraledger.com/reference/api.md#x402payment)
***
### X402Read
Re-exports [X402Read](https://lcp.integraledger.com/reference/api/aptos.md#x402read)
---
# @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.
Source: https://lcp.integraledger.com/reference/api/ucp
Updated 2026-11-18. Documents @integraledger/lcp 0.6.3 and @integraledger/profile-facilitator 0.5.1.
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.
The `ap2-mandate` pairings read the hash from the checkout JWT presented beside the buyer's checkout mandate, after
AP2's `checkout_hash` check, the mandate presented alone or last in AP2's chain after the open mandate;
`ucp/checkout/agent-signed` reads it from the `legal_context` member of the platform's signed request, once the
request's `Content-Digest` matches its body; the `unsigned` pairings have nothing signed to read. Nothing here takes
a key, signs, or verifies a signature, a `cnf` delegation or a link between chained mandates.
## Interfaces
### AgentSignedPresented
The platform's signed request as the business received it: its body, as text, and its `Content-Digest` value.
#### Properties
| Property | Type |
| ------ | ------ |
| `body` | `string` |
| `contentDigest` | `string` |
***
### AgentSignedUnsigned
The member the platform writes into the request that completes the checkout, before it signs the request.
#### Properties
| Property | Type |
| ------ | ------ |
| `legal_context` | `object` |
| `legal_context.type` | `"sha256"` |
| `legal_context.value` | `` `0x${string}` `` |
***
### UcpBinding
The shape of a UCP pairing: its id, data, binding record and codec, over the checkout or booking option `O`.
#### Type Parameters
| Type Parameter |
| ------ |
| `Id` *extends* `string` |
| `O` *extends* [`Option`](https://lcp.integraledger.com/reference/api/ucp.md#option) |
#### Properties
| Property | Type |
| ------ | ------ |
| `claims` | `boolean` |
| `data` | [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata) |
| `id` | `Id` |
| `pattern` | [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern) |
#### Methods
##### advertise()
> **advertise**(`doc`, `h`, `link`, `offer`, `agreementUrl?`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Checkout`](https://lcp.integraledger.com/reference/api/ucp.md#checkout)
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `doc` | [`Checkout`](https://lcp.integraledger.com/reference/api/ucp.md#checkout) |
| `h` | `` `0x${string}` `` |
| `link` | `string` |
| `offer` | `O` |
| `agreementUrl?` | `string` |
###### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Checkout`](https://lcp.integraledger.com/reference/api/ucp.md#checkout)
##### bound()
> **bound**(`presented`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `presented` | `unknown` |
###### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>
##### broadcaster()
> **broadcaster**(`presented`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>
Who broadcasts what the payer presents: the seller, which completes the payment (`"payee"`).
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `presented` | `unknown` |
###### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>
##### build()
> **build**(`offer`, `h`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Unsigned`](https://lcp.integraledger.com/reference/api/ucp.md#unsigned)\>
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `offer` | [`UcpOffer`](https://lcp.integraledger.com/reference/api/ucp.md#ucpoffer) |
| `h` | `` `0x${string}` `` |
###### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Unsigned`](https://lcp.integraledger.com/reference/api/ucp.md#unsigned)\>
##### read()
> **read**(`doc`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `agreement?`: `string`; `h`: `` `0x${string}` ``; `link`: `string`; `offer`: [`UcpOffer`](https://lcp.integraledger.com/reference/api/ucp.md#ucpoffer); \}
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `doc` | [`Checkout`](https://lcp.integraledger.com/reference/api/ucp.md#checkout) |
###### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `agreement?`: `string`; `h`: `` `0x${string}` ``; `link`: `string`; `offer`: [`UcpOffer`](https://lcp.integraledger.com/reference/api/ucp.md#ucpoffer); \}
##### tie()
> **tie**(`options`): \[`"ucp"`, \{ `options`: readonly `O`[]; \}\]
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `options` | readonly `O`[] |
###### Returns
\[`"ucp"`, \{ `options`: readonly `O`[]; \}\]
##### unplaced()
> **unplaced**(`option`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `O`
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `option` | `O` |
###### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `O`
***
### UcpOffer
The offer a UCP pairing's `read` gives, and the buyer's input to its `build`: the checkout the business returned,
carrying the `legal_context` link.
#### Properties
| Property | Type |
| ------ | ------ |
| `checkout` | [`Checkout`](https://lcp.integraledger.com/reference/api/ucp.md#checkout) |
***
### Unsigned
The checkout as the business signed it, and the claims the buyer's checkout mandate carries for it: the checkout JWT
(`checkoutJwt`) and its hash. `complete` takes the signed mandate and returns it beside that JWT.
#### Properties
| Property | Type |
| ------ | ------ |
| `checkout` | [`Checkout`](https://lcp.integraledger.com/reference/api/ucp.md#checkout) |
| `content` | `object` |
| `content.checkout_hash` | `string` |
| `content.checkout_jwt` | `string` |
| `content.vct` | `"mandate.checkout.1"` |
#### Methods
##### complete()
> **complete**(`checkout_mandate`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Presented`](https://lcp.integraledger.com/reference/api/ap2.md#presented)\>
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `checkout_mandate` | `string` |
###### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Presented`](https://lcp.integraledger.com/reference/api/ap2.md#presented)\>
## Type Aliases
### BookingOption
> **BookingOption** = `object`
A booking session's own `id`, 1–256 characters.
#### Properties
| Property | Type |
| ------ | ------ |
| `booking` | `string` |
***
### Checkout
> **Checkout** = `object` & `object`
#### Type Declaration
| Name | Type |
| ------ | ------ |
| `ap2?` | `object` & `object` |
| `id` | `string` |
| `links?` | [`Link`](https://lcp.integraledger.com/reference/api/ucp.md#link)[] |
***
### CheckoutOption
> **CheckoutOption** = `object`
A checkout's own `id`, 1–256 characters.
#### Properties
| Property | Type |
| ------ | ------ |
| `checkout` | `string` |
***
### Link
> **Link** = `object`
#### Properties
| Property | Type |
| ------ | ------ |
| `title?` | `string` |
| `type` | `string` |
| `url` | `string` |
***
### Option
> **Option** = [`CheckoutOption`](https://lcp.integraledger.com/reference/api/ucp.md#checkoutoption) \| [`BookingOption`](https://lcp.integraledger.com/reference/api/ucp.md#bookingoption)
## Variables
### agentSigned
> `const` **agentSigned**: `Readonly`\<\{ `advertise`: (`doc`, `h`, `link`, `offer`, `agreementUrl?`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Checkout`](https://lcp.integraledger.com/reference/api/ucp.md#checkout); `bound`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `broadcaster`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>; `build`: (`offer`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`AgentSignedUnsigned`](https://lcp.integraledger.com/reference/api/ucp.md#agentsignedunsigned)\>; `claims`: `boolean`; `data`: [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata); `id`: `"ucp/checkout/agent-signed"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `agreement?`: `string`; `h`: `` `0x${string}` ``; `link`: `string`; `offer`: [`UcpOffer`](https://lcp.integraledger.com/reference/api/ucp.md#ucpoffer); \}; `tie`: (`options`) => \[`"ucp"`, \{ `options`: readonly [`CheckoutOption`](https://lcp.integraledger.com/reference/api/ucp.md#checkoutoption)[]; \}\]; `unplaced`: (`option`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`CheckoutOption`](https://lcp.integraledger.com/reference/api/ucp.md#checkoutoption); \}\>
`ucp/checkout/agent-signed`. The payee broadcasts (`broadcaster` answers `"payee"`): the business's payment handler
executes the payment the signed request completes; nothing here reads it. A value that is not an object gets
`ucp/request-malformed`, as `bound` refuses it.
***
### ap2Mandate
> `const` **ap2Mandate**: [`UcpBinding`](https://lcp.integraledger.com/reference/api/ucp.md#ucpbinding)\<`"ucp/checkout/ap2-mandate"`, [`CheckoutOption`](https://lcp.integraledger.com/reference/api/ucp.md#checkoutoption)\>
`ucp/checkout/ap2-mandate`. The payee broadcasts (`broadcaster` answers `"payee"`): the business's payment handler
executes the payment the buyer's checkout mandate authorizes; nothing here reads it. A value that is not a JSON
object gets `ap2/mandate-malformed`, as `bound` refuses it.
***
### bookingAp2Mandate
> `const` **bookingAp2Mandate**: [`UcpBinding`](https://lcp.integraledger.com/reference/api/ucp.md#ucpbinding)\<`"ucp/booking/ap2-mandate"`, [`BookingOption`](https://lcp.integraledger.com/reference/api/ucp.md#bookingoption)\>
`ucp/booking/ap2-mandate`. The payee broadcasts (`broadcaster` answers `"payee"`): the business's payment handler
executes the payment the buyer's checkout mandate authorizes; nothing here reads it. A value that is not a JSON
object gets `ap2/mandate-malformed`, as `bound` refuses it.
***
### bookingUnsigned
> `const` **bookingUnsigned**: [`UcpBinding`](https://lcp.integraledger.com/reference/api/ucp.md#ucpbinding)\<`"ucp/booking/unsigned"`, [`BookingOption`](https://lcp.integraledger.com/reference/api/ucp.md#bookingoption)\>
`ucp/booking/unsigned`. The payee broadcasts (`broadcaster` answers `"payee"`): the business's payment handler
executes the payment the booking completed; nothing here reads it.
***
### issuedDigest
> `const` **issuedDigest**: *typeof* [`digestJson`](https://lcp.integraledger.com/reference/api.md#digestjson) = `digestJson`
The option digest the issuer keeps: SHA-256 over the RFC 8785 form.
***
### LINK\_TYPE
> `const` **LINK\_TYPE**: `"legal_context"` = `"legal_context"`
***
### unsigned
> `const` **unsigned**: [`UcpBinding`](https://lcp.integraledger.com/reference/api/ucp.md#ucpbinding)\<`"ucp/checkout/unsigned"`, [`CheckoutOption`](https://lcp.integraledger.com/reference/api/ucp.md#checkoutoption)\> & `object`
`ucp/checkout/unsigned`. The payee broadcasts (`broadcaster` answers `"payee"`): the business's payment handler
executes the payment the checkout completed; nothing here reads it. `reference` names the charge by the seller's own
reference for it.
#### Type Declaration
| Name | Type |
| ------ | ------ |
| `reference()` | (`presented`, `option`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`ChargeRef`](https://lcp.integraledger.com/reference/api/acp.md#chargeref)\> |
## Functions
### checkoutJwt()
> **checkoutJwt**(`c`): `string` \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
The checkout JWT a buyer's checkout mandate commits to, for a checkout the business signed: its detached
`ap2.merchant_authorization` with the payload reinserted, `header.payload.signature`, the payload being the base64url
of the RFC 8785 form of the checkout without its `ap2` member, the bytes that signature covers (UCP 2026-08-25, the
AP2 Mandates extension, *Business Authorization*). UCP does not say which bytes are the checkout JWT; this is the
second of the two readings its open issue 905 sets out, and the profile states it as provisional. A checkout with no
`ap2.merchant_authorization` of the form `header..signature` is `ucp/ap2-not-active`; one with no RFC 8785 form is
`ucp/checkout-malformed`. No signature is verified.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `c` | [`Checkout`](https://lcp.integraledger.com/reference/api/ucp.md#checkout) |
#### Returns
`string` \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
***
### legalContextLink()
> **legalContextLink**(`c`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `h`: `` `0x${string}` ``; `link`: `string`; \}
The hash and link of the checkout's one `legal_context` link. Nothing else of the checkout is read.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `c` | [`Checkout`](https://lcp.integraledger.com/reference/api/ucp.md#checkout) |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `h`: `` `0x${string}` ``; `link`: `string`; \}
***
### tie()
> **tie**\<`O`\>(`options`): \[`"ucp"`, \{ `options`: readonly `O`[]; \}\]
The binding slot: the checkouts or bookings this ATR was minted for, each by its own `id`.
#### Type Parameters
| Type Parameter |
| ------ |
| `O` *extends* [`Option`](https://lcp.integraledger.com/reference/api/ucp.md#option) |
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `options` | readonly `O`[] |
#### Returns
\[`"ucp"`, \{ `options`: readonly `O`[]; \}\]
## References
### Broadcaster
Re-exports [Broadcaster](https://lcp.integraledger.com/reference/api.md#broadcaster)
***
### ChargePresented
Re-exports [ChargePresented](https://lcp.integraledger.com/reference/api/acp.md#chargepresented)
***
### ChargeRef
Re-exports [ChargeRef](https://lcp.integraledger.com/reference/api/acp.md#chargeref)
---
# @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.
Source: https://lcp.integraledger.com/reference/api/x402
Updated 2026-11-18. Documents @integraledger/lcp 0.6.3 and @integraledger/profile-facilitator 0.5.1.
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
- [`X402Choice`](https://lcp.integraledger.com/reference/api/x402.md#x402choice)
#### Properties
| Property | Type | Inherited from |
| ------ | ------ | ------ |
| `accepted` | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) | [`X402Choice`](https://lcp.integraledger.com/reference/api/x402.md#x402choice).[`accepted`](https://lcp.integraledger.com/reference/api/x402.md#property-accepted-1) |
| `from` | `` `0x${string}` `` | [`X402Choice`](https://lcp.integraledger.com/reference/api/x402.md#x402choice).[`from`](https://lcp.integraledger.com/reference/api/x402.md#property-from-1) |
| `minValiditySeconds` | `number` | - |
| `now` | `number` | [`X402Choice`](https://lcp.integraledger.com/reference/api/x402.md#x402choice).[`now`](https://lcp.integraledger.com/reference/api/x402.md#property-now-1) |
| `required` | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired) | [`X402Choice`](https://lcp.integraledger.com/reference/api/x402.md#x402choice).[`required`](https://lcp.integraledger.com/reference/api/x402.md#property-required-1) |
***
### 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`](https://lcp.integraledger.com/reference/api/evm.md#field)[] |
| `types.TransferWithAuthorization` | [`Field`](https://lcp.integraledger.com/reference/api/evm.md#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`](https://lcp.integraledger.com/reference/api/x402.md#gatewaybatchedtypeddata) |
#### Methods
##### complete()
> **complete**(`signature`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`GatewayBatchedPayment`](https://lcp.integraledger.com/reference/api/x402.md#gatewaybatchedpayment)
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `signature` | `` `0x${string}` `` |
###### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`GatewayBatchedPayment`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api/evm.md#eip3009typeddata) |
#### Methods
##### complete()
> **complete**(`signature`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentPayload`](https://lcp.integraledger.com/reference/api/x402.md#paymentpayload)
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `signature` | `` `0x${string}` `` |
###### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentPayload`](https://lcp.integraledger.com/reference/api/x402.md#paymentpayload)
***
### 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
- [`BatchEvmOpen`](https://lcp.integraledger.com/reference/api/x402-batch-settlement.md#batchevmopen)
- [`GatewayBatchedChoice`](https://lcp.integraledger.com/reference/api/x402.md#gatewaybatchedchoice)
#### Properties
| Property | Type |
| ------ | ------ |
| `accepted` | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) |
| `from` | `` `0x${string}` `` |
| `now` | `number` |
| `required` | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[] |
| `required` | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api/x402.md#breadthid) |
#### Properties
| Property | Modifier | Type |
| ------ | ------ | ------ |
| `advertise` | `readonly` | [`X402Advertise`](https://lcp.integraledger.com/reference/api/casper.md#x402advertise) |
| `broadcaster` | `readonly` | (`presented`) => `Promise`\<[`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster) \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)\> |
| `claims` | `readonly` | `boolean` |
| `data` | `readonly` | [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata) |
| `id` | `readonly` | `Id` |
| `pattern` | `readonly` | [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern) |
| `read` | `readonly` | (`doc`) => [`X402Read`](https://lcp.integraledger.com/reference/api/aptos.md#x402read) \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) |
| `tie` | `readonly` | *typeof* [`tie`](https://lcp.integraledger.com/reference/api/x402.md#tie) |
| `unplaced` | `readonly` | (`option`) => [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) |
***
### BreadthId
> **BreadthId** = `Exclude`\<`Extract`\, `"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`](https://lcp.integraledger.com/reference/api/x402.md#paymentpayload) & `object`
A payment of the `x402/exact/eip155/eip3009` pairing.
#### Type Declaration
| Name | Type |
| ------ | ------ |
| `payload` | `object` |
| `payload.authorization` | [`Eip3009Authorization`](https://lcp.integraledger.com/reference/api/x402.md#eip3009authorization) |
| `payload.signature` | [`Hex`](https://lcp.integraledger.com/reference/api/evm.md#hex) |
***
### GatewayBatchedPayment
> **GatewayBatchedPayment** = [`PaymentPayload`](https://lcp.integraledger.com/reference/api/x402.md#paymentpayload) & `object`
A payment of `x402/exact/eip155/gateway-batched`.
#### Type Declaration
| Name | Type |
| ------ | ------ |
| `payload` | `object` |
| `payload.authorization` | [`BatchedAuthorization`](https://lcp.integraledger.com/reference/api/x402.md#batchedauthorization) |
| `payload.signature` | [`Hex`](https://lcp.integraledger.com/reference/api/evm.md#hex) |
***
### HeaderFields
> **HeaderFields** = `Readonly`\<`Record`\<`string`, `string` \| readonly `string`[]\>\>
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`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) |
| `extensions?` | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired)\[`"extensions"`\] |
| `payload` | [`X402SchemePayload`](https://lcp.integraledger.com/reference/api/x402.md#x402schemepayload) |
| `resource?` | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api.md#atrhash) |
| `headers?` | readonly [`HeaderDigest`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api.md#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`](https://lcp.integraledger.com/reference/api/evm.md#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`](https://lcp.integraledger.com/reference/api/x402.md#eip3009authorization); `signature`: [`Hex`](https://lcp.integraledger.com/reference/api/evm.md#hex); \} \| \{ `permit2Authorization`: [`Permit2Authorization`](https://lcp.integraledger.com/reference/api/x402.md#permit2authorization); `signature`: [`Hex`](https://lcp.integraledger.com/reference/api/evm.md#hex); \} \| \{ `delegationManager`: `string`; `delegator`: `string`; `permissionContext`: `string`; \} \| \{ `authorization`: [`Eip3009Authorization`](https://lcp.integraledger.com/reference/api/x402.md#eip3009authorization); `salt`: `string`; `saltNonce?`: `string`; `signature`: [`Hex`](https://lcp.integraledger.com/reference/api/evm.md#hex); \} \| \{ `permit2Authorization`: [`Permit2Authorization`](https://lcp.integraledger.com/reference/api/x402.md#permit2authorization); `salt`: `string`; `saltNonce?`: `string`; `signature`: [`Hex`](https://lcp.integraledger.com/reference/api/evm.md#hex); \}
The payload of each x402 EVM scheme this package carries; every member is a string.
***
### X402Unsigned
> **X402Unsigned** = \{ `request`: \{ `escrow?`: [`Hex`](https://lcp.integraledger.com/reference/api/evm.md#hex); `kind`: `"eip712"`; `paymentInfo?`: [`PaymentInfo`](https://lcp.integraledger.com/reference/api/evm.md#paymentinfo); `typedData`: [`Permit2TypedData`](https://lcp.integraledger.com/reference/api/evm.md#permit2typeddata) \| [`Eip3009TypedData`](https://lcp.integraledger.com/reference/api/evm.md#eip3009typeddata) \| [`ReceiveTypedData`](https://lcp.integraledger.com/reference/api/mpp.md#receivetypeddata); \}; `complete`: [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentPayload`](https://lcp.integraledger.com/reference/api/x402.md#paymentpayload); \} \| \{ `request`: \{ `amount`: `bigint`; `chainId`: `number`; `kind`: `"erc7710"`; `payTo`: [`Hex`](https://lcp.integraledger.com/reference/api/evm.md#hex); `salt`: [`AtrHash`](https://lcp.integraledger.com/reference/api.md#atrhash); `token`: [`Hex`](https://lcp.integraledger.com/reference/api/evm.md#hex); \}; `complete`: [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentPayload`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api/evm.md#hex); `kind`: `"eip712"`; `paymentInfo?`: [`PaymentInfo`](https://lcp.integraledger.com/reference/api/evm.md#paymentinfo); `typedData`: [`Permit2TypedData`](https://lcp.integraledger.com/reference/api/evm.md#permit2typeddata) \| [`Eip3009TypedData`](https://lcp.integraledger.com/reference/api/evm.md#eip3009typeddata) \| [`ReceiveTypedData`](https://lcp.integraledger.com/reference/api/mpp.md#receivetypeddata); \}; `complete`: [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentPayload`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api/evm.md#hex) | - |
| `request.kind` | `"eip712"` | - |
| `request.paymentInfo?` | [`PaymentInfo`](https://lcp.integraledger.com/reference/api/evm.md#paymentinfo) | - |
| `request.typedData` | [`Permit2TypedData`](https://lcp.integraledger.com/reference/api/evm.md#permit2typeddata) \| [`Eip3009TypedData`](https://lcp.integraledger.com/reference/api/evm.md#eip3009typeddata) \| [`ReceiveTypedData`](https://lcp.integraledger.com/reference/api/mpp.md#receivetypeddata) | - |
| `complete()` | (`sig`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentPayload`](https://lcp.integraledger.com/reference/api/x402.md#paymentpayload) | - |
***
##### Type Literal
\{ `request`: \{ `amount`: `bigint`; `chainId`: `number`; `kind`: `"erc7710"`; `payTo`: [`Hex`](https://lcp.integraledger.com/reference/api/evm.md#hex); `salt`: [`AtrHash`](https://lcp.integraledger.com/reference/api.md#atrhash); `token`: [`Hex`](https://lcp.integraledger.com/reference/api/evm.md#hex); \}; `complete`: [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentPayload`](https://lcp.integraledger.com/reference/api/x402.md#paymentpayload); \}
## Variables
### authCaptureEip3009
> `const` **authCaptureEip3009**: [`BreadthBase`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | - |
| `bound()` | (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | - |
| `build()` | (`choice`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Unsigned`](https://lcp.integraledger.com/reference/api/x402.md#x402unsigned)\> | - |
| `recover()` | (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | - |
| `reference()` | (`presented`, `option`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`AuthCaptureRef`](https://lcp.integraledger.com/reference/api/evm.md#authcaptureref)\> | - |
| `status()` | (`ref`, `reader`, `query`) => `Promise`\<[`StatusAnswer`](https://lcp.integraledger.com/reference/api.md#statusanswer)\<`bigint`, [`EvmMark`](https://lcp.integraledger.com/reference/api/ap2.md#evmmark)\>\> | `authCaptureRead` |
***
### authCapturePermit2
> `const` **authCapturePermit2**: [`BreadthBase`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | - |
| `bound()` | (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | - |
| `build()` | (`choice`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Unsigned`](https://lcp.integraledger.com/reference/api/x402.md#x402unsigned)\> | - |
| `recover()` | (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | - |
| `reference()` | (`presented`, `option`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`AuthCaptureRef`](https://lcp.integraledger.com/reference/api/evm.md#authcaptureref)\> | - |
| `status()` | (`ref`, `reader`, `query`) => `Promise`\<[`StatusAnswer`](https://lcp.integraledger.com/reference/api.md#statusanswer)\<`bigint`, [`EvmMark`](https://lcp.integraledger.com/reference/api/ap2.md#evmmark)\>\> | `authCaptureRead` |
***
### exactEip3009
> `const` **exactEip3009**: `Readonly`\<\{ `advertise`: [`X402Advertise`](https://lcp.integraledger.com/reference/api/casper.md#x402advertise); `authorizer`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `bound`: (`presented`, `given?`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `broadcaster`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>; `build`: (`choice`, `h`, `act?`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Unsigned`](https://lcp.integraledger.com/reference/api/x402.md#unsigned)\>; `claims`: `boolean`; `data`: [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata); `id`: `"x402/exact/eip155/eip3009"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Read`](https://lcp.integraledger.com/reference/api/aptos.md#x402read); `recover`: (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `reference`: (`presented`, `option`, `given?`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Eip3009Ref`](https://lcp.integraledger.com/reference/api/evm.md#eip3009ref)\>; `status`: (`ref`, `reader`, `query`) => `Promise`\<[`StatusAnswer`](https://lcp.integraledger.com/reference/api.md#statusanswer)\<`bigint`, [`EvmMark`](https://lcp.integraledger.com/reference/api/ap2.md#evmmark)\>\>; `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment); \}\]; `unplaced`: (`option`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#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
> `const` **exactErc7710**: [`BreadthBase`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | `erc7710Bound` |
| `build()` | (`choice`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Unsigned`](https://lcp.integraledger.com/reference/api/x402.md#x402unsigned)\> | `erc7710Build` |
| `reference()` | (`presented`, `option`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Erc7710Ref`](https://lcp.integraledger.com/reference/api/evm.md#erc7710ref)\> | - |
| `status()` | (`ref`, `reader`, `query`) => `Promise`\<[`StatusAnswer`](https://lcp.integraledger.com/reference/api.md#statusanswer)\<`bigint`, [`EvmMark`](https://lcp.integraledger.com/reference/api/ap2.md#evmmark)\>\> | `erc7710Read` |
***
### exactErc7710Salt
> `const` **exactErc7710Salt**: [`BreadthBase`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | `erc7710SaltAuthorizer` |
| `bound()` | (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | `erc7710SaltBound` |
| `build()` | (`choice`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Unsigned`](https://lcp.integraledger.com/reference/api/x402.md#x402unsigned)\> | `erc7710Build` |
| `recover()` | (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | `redeemedLeafRecover` |
| `reference()` | (`presented`, `option`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Erc7710Ref`](https://lcp.integraledger.com/reference/api/evm.md#erc7710ref)\> | - |
| `status()` | (`ref`, `reader`, `query`) => `Promise`\<[`StatusAnswer`](https://lcp.integraledger.com/reference/api.md#statusanswer)\<`bigint`, [`EvmMark`](https://lcp.integraledger.com/reference/api/ap2.md#evmmark)\>\> | `erc7710SaltRead` |
***
### exactGatewayBatched
> `const` **exactGatewayBatched**: `Readonly`\<\{ `advertise`: [`X402Advertise`](https://lcp.integraledger.com/reference/api/casper.md#x402advertise); `authorizer`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `bound`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `broadcaster`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>; `build`: (`choice`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`GatewayBatchedUnsigned`](https://lcp.integraledger.com/reference/api/x402.md#gatewaybatchedunsigned)\>; `claims`: `boolean`; `data`: [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata); `id`: `"x402/exact/eip155/gateway-batched"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Read`](https://lcp.integraledger.com/reference/api/aptos.md#x402read); `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment); \}\]; `unplaced`: (`option`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#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
> `const` **exactPermit2**: [`BreadthBase`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | - |
| `bound()` | (`presented`, `given?`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | - |
| `build()` | (`choice`, `h`, `act?`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Unsigned`](https://lcp.integraledger.com/reference/api/x402.md#x402unsigned)\> | - |
| `recover()` | (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | - |
| `reference()` | (`presented`, `option`, `given?`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Permit2Ref`](https://lcp.integraledger.com/reference/api/evm.md#permit2ref)\> | - |
| `status()` | (`ref`, `reader`, `query`) => `Promise`\<[`StatusAnswer`](https://lcp.integraledger.com/reference/api.md#statusanswer)\<`bigint`, [`EvmMark`](https://lcp.integraledger.com/reference/api/ap2.md#evmmark)\>\> | `permit2ExactRead` |
***
### LEGAL\_CONTEXT
> `const` **LEGAL\_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
> `const` **LEGAL\_CONTEXT\_SCHEMA**: [`Json`](https://lcp.integraledger.com/reference/api.md#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
> `const` **PAYMENT\_REQUIRED**: `"PAYMENT-REQUIRED"` = `"PAYMENT-REQUIRED"`
The response header that carries `PaymentRequired`.
***
### PAYMENT\_RESPONSE
> `const` **PAYMENT\_RESPONSE**: `"PAYMENT-RESPONSE"` = `"PAYMENT-RESPONSE"`
The response header that carries the settlement response.
***
### PAYMENT\_SIGNATURE
> `const` **PAYMENT\_SIGNATURE**: `"PAYMENT-SIGNATURE"` = `"PAYMENT-SIGNATURE"`
The request header that carries `PaymentPayload`.
***
### uptoPermit2
> `const` **uptoPermit2**: [`BreadthBase`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | - |
| `bound()` | (`presented`, `given?`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | - |
| `build()` | (`choice`, `h`, `act?`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Unsigned`](https://lcp.integraledger.com/reference/api/x402.md#x402unsigned)\> | - |
| `recover()` | (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> | - |
| `reference()` | (`presented`, `option`, `given?`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Permit2Ref`](https://lcp.integraledger.com/reference/api/evm.md#permit2ref)\> | - |
| `status()` | (`ref`, `reader`, `query`) => `Promise`\<[`StatusAnswer`](https://lcp.integraledger.com/reference/api.md#statusanswer)\<`bigint`, [`EvmMark`](https://lcp.integraledger.com/reference/api/ap2.md#evmmark)\>\> | `permit2UptoRead` |
## Functions
### decodePaymentRequired()
> **decodePaymentRequired**(`header`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired)
`PAYMENT-REQUIRED`'s value: an x402 v2 `PaymentRequired`, else as `decodeHeader` refuses it.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `header` | `unknown` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired)
***
### decodePaymentResponse()
> **decodePaymentResponse**(`header`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SettlementResponse`](https://lcp.integraledger.com/reference/api/x402.md#settlementresponse)
`PAYMENT-RESPONSE`'s value: a settlement response, whose `success` is a boolean, else as `decodeHeader` refuses it.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `header` | `unknown` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SettlementResponse`](https://lcp.integraledger.com/reference/api/x402.md#settlementresponse)
***
### decodePaymentSignature()
> **decodePaymentSignature**(`header`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentPayload`](https://lcp.integraledger.com/reference/api/x402.md#paymentpayload)
`PAYMENT-SIGNATURE`'s value: an x402 v2 `PaymentPayload`, else as `decodeHeader` refuses it.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `header` | `unknown` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentPayload`](https://lcp.integraledger.com/reference/api/x402.md#paymentpayload)
***
### encodeHeader()
> **encodeHeader**(`value`): `string` \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#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`](https://lcp.integraledger.com/reference/api/x402.md#paymentpayload) \| [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired) \| [`SettlementResponse`](https://lcp.integraledger.com/reference/api/x402.md#settlementresponse) |
#### Returns
`string` \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
***
### issuedDigest()
> **issuedDigest**(`v`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#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`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>
***
### pairingOfPayment()
> **pairingOfPayment**(`p`): `"x402/exact/eip155/gateway-batched"` \| [`X402PairingId`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api/x402.md#paymentpayload) |
#### Returns
`"x402/exact/eip155/gateway-batched"` \| [`X402PairingId`](https://lcp.integraledger.com/reference/api/x402.md#x402pairingid) \| `undefined`
***
### requestCommitment()
> **requestCommitment**(`r`, `fields?`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api/x402.md#httprequest) |
| `fields?` | readonly `string`[] |
#### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment)\>
***
### tie()
> **tie**(`accepts`, `request`): \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[] |
| `request` | [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment) |
#### Returns
\[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment); \}\]
***
### toolCallCommitment()
> **toolCallCommitment**(`call`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#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`](https://lcp.integraledger.com/reference/api/x402.md#toolcall) |
#### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment)\>
## References
### Broadcaster
Re-exports [Broadcaster](https://lcp.integraledger.com/reference/api.md#broadcaster)
***
### Eip3009TypedData
Re-exports [Eip3009TypedData](https://lcp.integraledger.com/reference/api/evm.md#eip3009typeddata)
***
### EvmMark
Re-exports [EvmMark](https://lcp.integraledger.com/reference/api/ap2.md#evmmark)
***
### EvmQuery
Re-exports [EvmQuery](https://lcp.integraledger.com/reference/api/ap2.md#evmquery)
***
### X402Advertise
Re-exports [X402Advertise](https://lcp.integraledger.com/reference/api/casper.md#x402advertise)
***
### X402Read
Re-exports [X402Read](https://lcp.integraledger.com/reference/api/aptos.md#x402read)
---
# @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.
Source: https://lcp.integraledger.com/reference/api/x402-batch-settlement
Updated 2026-11-18. Documents @integraledger/lcp 0.6.3 and @integraledger/profile-facilitator 0.5.1.
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.
On EVM the channel id commits to the `salt`, and every signature signs it; on Solana the seller Memo instruction
(`extra.memo`) sits beside x402's receiver-authorizer binding memo; on Cloudflare there is no channel.
## Interfaces
### BatchEvmOpen
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`.
#### Extends
- [`X402Choice`](https://lcp.integraledger.com/reference/api/x402.md#x402choice)
#### Properties
| Property | Type | Description | Inherited from |
| ------ | ------ | ------ | ------ |
| `accepted` | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) | - | [`X402Choice`](https://lcp.integraledger.com/reference/api/x402.md#x402choice).[`accepted`](https://lcp.integraledger.com/reference/api/x402.md#property-accepted-1) |
| `authSalt` | `` `0x${string}` `` | 32 bytes the caller draws at random: the deposit authorization's salt (ERC-3009) or the deposit permit's nonce (Permit2); under an option in the scheme's refund-authorizer mode, where H is that salt or nonce, the entropy the channel salt packs. | - |
| `deposit` | `bigint` | - | - |
| `from` | `` `0x${string}` `` | - | [`X402Choice`](https://lcp.integraledger.com/reference/api/x402.md#x402choice).[`from`](https://lcp.integraledger.com/reference/api/x402.md#property-from-1) |
| `now` | `number` | - | [`X402Choice`](https://lcp.integraledger.com/reference/api/x402.md#x402choice).[`now`](https://lcp.integraledger.com/reference/api/x402.md#property-now-1) |
| `payerAuthorizer` | `` `0x${string}` `` | - | - |
| `required` | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired) | - | [`X402Choice`](https://lcp.integraledger.com/reference/api/x402.md#x402choice).[`required`](https://lcp.integraledger.com/reference/api/x402.md#property-required-1) |
***
### BatchSvmOpen
#### Properties
| Property | Type |
| ------ | ------ |
| `accepted` | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) |
| `computeUnitLimit?` | `number` |
| `computeUnitPrice?` | `bigint` |
| `deposit` | `bigint` |
| `openSlot` | `bigint` |
| `payer` | `string` |
| `payerAuthorizer` | `string` |
| `recentBlockhash` | `string` |
| `required` | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#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 | Description |
| ------ | ------ | ------ |
| `authSalt?` | `` `0x${string}` `` | On an EVM opening, the deposit authorization's salt: the ERC-3009 deposit's nonce is `erc3009DepositNonce(channelId, authSalt)` and the Permit2 deposit's nonce is `authSalt` as a uint256. It is the caller's `authSalt`, or H under an option in the refund-authorizer mode, so a client holds each nonce to it without repeating the mode test. No other build gives it. |
| `config?` | [`ChannelConfig`](https://lcp.integraledger.com/reference/api/x402-batch-settlement.md#channelconfig) | On an EVM opening, the channel's configuration: `batchChannelId(chainId, config)` is the `channelId` the deposit authorization and the voucher sign, `chainId` their domain's. It names the receiver and the authorizers the signatures grant, so a client can show them and hold the channel id to them. No other build gives it. |
| `requests` | readonly [`SigningRequest`](https://lcp.integraledger.com/reference/api/x402-batch-settlement.md#signingrequest)[] | - |
#### Methods
##### complete()
> **complete**(`signatures`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`BatchPaymentPayload`](https://lcp.integraledger.com/reference/api.md#batchpaymentpayload)
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `signatures` | readonly `string`[] |
###### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`BatchPaymentPayload`](https://lcp.integraledger.com/reference/api.md#batchpaymentpayload)
***
### BatchWithin
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `accepted` | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) | - |
| `channelConfig` | [`Json`](https://lcp.integraledger.com/reference/api.md#json) | Exactly as sent at the opening. |
| `computeUnitLimit?` | `number` | SVM refund's `request_close`: the Compute Budget values, 200 000 units and 1 microlamport when absent. |
| `computeUnitPrice?` | `bigint` | - |
| `maxClaimableAmount` | `bigint` | - |
| `recentBlockhash?` | `string` | SVM refund: the blockhash of its `request_close`. Given, the refund carries that transaction, which x402 sends only on a retry after `invalid_batch_settlement_svm_receiver_binding_unavailable`. |
| `refund?` | `object` | A refund. EVM: its amount, absent for a full refund. SVM: `{}`, a full refund carrying the voucher for `maxClaimableAmount`, the server's accepted cumulative amount, and, with `recentBlockhash`, a payer-signed `request_close` built here. |
| `refund.amount?` | `bigint` | - |
| `required` | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired) | - |
***
### ChannelConfig
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `payer` | `` `0x${string}` `` | - |
| `payerAuthorizer` | `` `0x${string}` `` | - |
| `receiver` | `` `0x${string}` `` | - |
| `receiverAuthorizer` | `` `0x${string}` `` | - |
| `salt` | `` `0x${string}` `` | `0x` and 64 hex digits. |
| `token` | `` `0x${string}` `` | - |
| `withdrawDelay` | `number` | - |
***
### ChannelMembers
#### Properties
| Property | Type |
| ------ | ------ |
| `channel` | `object` |
| `channel.boundWithin` | `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\> |
| `channel.kind` | `"open"` \| `"close"` \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `"within"` |
| `channel.ref` | `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `channel`: `string`; `network`: `string`; \}\> |
| `channel.until` | `number` \| `undefined` |
***
### 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
### SigningRequest
> **SigningRequest** = \{ `kind`: `"eip712"`; `typedData`: [`Eip712Request`](https://lcp.integraledger.com/reference/api/x402-batch-settlement.md#eip712request) \| [`ReceiveTypedData`](https://lcp.integraledger.com/reference/api/mpp.md#receivetypeddata) \| [`Permit2TypedData`](https://lcp.integraledger.com/reference/api/evm.md#permit2typeddata); \} \| \{ `kind`: `"solana-message"`; `message`: `Uint8Array`\<`ArrayBuffer`\>; \} \| \{ `kind`: `"ed25519-raw"`; `message`: `Uint8Array`\<`ArrayBuffer`\>; `signer`: `string`; \}
A request to the buyer's signer.
## Variables
### BATCH\_SETTLEMENT
> `const` **BATCH\_SETTLEMENT**: `"0x4020074e9dF2ce1deE5A9C1b5c3f541D02a10003"`
***
### batchCloudflare
> `const` **batchCloudflare**: `Readonly`\<\{ `advertise`: [`X402Advertise`](https://lcp.integraledger.com/reference/api/casper.md#x402advertise); `bound`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `broadcaster`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>; `build`: (`c`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`CloudflarePaymentPayload`](https://lcp.integraledger.com/reference/api.md#cloudflarepaymentpayload)\>; `claims`: `boolean`; `data`: [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata); `id`: `"x402/batch-settlement/cloudflare"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Read`](https://lcp.integraledger.com/reference/api/aptos.md#x402read); `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment); \}\]; `unplaced`: (`option`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements); \}\>
`x402/batch-settlement/cloudflare`. The payee broadcasts (`broadcaster` answers `"payee"`): Cloudflare, for the
seller, verifies the agent's signed request and bills its registered identity off chain; no `status` reads it.
***
### batchEvm
> `const` **batchEvm**: `Readonly`\<\{ `advertise`: (`doc`, `h`, `link`, `offer`, `agreementUrl?`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired); `bound`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `broadcaster`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>; `build`: (`c`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`BatchUnsigned`](https://lcp.integraledger.com/reference/api/x402-batch-settlement.md#batchunsigned)\>; `buildWithin`: (`w`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`BatchUnsigned`](https://lcp.integraledger.com/reference/api/x402-batch-settlement.md#batchunsigned)\>; `channel`: `Readonly`\<\{ `boundWithin`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `kind`: (`p`) => `"open"` \| `"close"` \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `"within"`; `ref`: (`p`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `channel`: `string`; `network`: `string`; \}\>; `until`: (`_p`) => `number` \| `undefined`; \}\>; `claims`: `boolean`; `data`: [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata); `id`: `"x402/batch-settlement/eip155"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Read`](https://lcp.integraledger.com/reference/api/aptos.md#x402read); `recover`: (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `reference`: (`presented`, `option`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`BatchEvmRef`](https://lcp.integraledger.com/reference/api/evm.md#batchevmref)\>; `status`: (`ref`, `reader`, `query`) => `Promise`\<[`StatusAnswer`](https://lcp.integraledger.com/reference/api.md#statusanswer)\<`bigint`, [`EvmMark`](https://lcp.integraledger.com/reference/api/ap2.md#evmmark)\>\>; `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment); \}\]; `unplaced`: (`option`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements); \}\>
`x402/batch-settlement/eip155`. The payee broadcasts (`broadcaster` answers `"payee"` for each payment type
`channel.kind` takes): for every payment of the channel: the seller's facilitator executes the deposit's token
authorization, redeems vouchers when it claims, and executes a refund; `status` reads them, and `channel.kind`
classifies each payment. A payment of any other type gets `x402/not-an-opening`, as `bound` refuses it. `bound` reads
a deposit alone, so `channel.kind` reads the rest: a refund whose `amount` is not a positive decimal below 2^128 gets
`x402/payload-malformed`, as `channel.kind` refuses it.
***
### batchSvm
> `const` **batchSvm**: `Readonly`\<\{ `advertise`: (`doc`, `h`, `link`, `offer`, `agreementUrl?`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired); `bound`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `broadcaster`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>; `build`: (`c`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`BatchUnsigned`](https://lcp.integraledger.com/reference/api/x402-batch-settlement.md#batchunsigned)\>; `buildWithin`: (`w`, `_h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`BatchUnsigned`](https://lcp.integraledger.com/reference/api/x402-batch-settlement.md#batchunsigned)\>; `channel`: `Readonly`\<\{ `boundWithin`: (`_p`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `kind`: (`p`) => `"open"` \| `"close"` \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `"within"`; `ref`: (`p`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `channel`: `string`; `network`: `string`; \}\>; `until`: (`_p`) => `number` \| `undefined`; \}\>; `claims`: `boolean`; `data`: [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata); `id`: `"x402/batch-settlement/solana"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Read`](https://lcp.integraledger.com/reference/api/aptos.md#x402read); `recover`: (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `reference`: (`presented`, `option`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SvmRef`](https://lcp.integraledger.com/reference/api/svm.md#svmref)\>; `status`: (`ref`, `reader`, `query`) => `Promise`\<[`SvmStatus`](https://lcp.integraledger.com/reference/api/svm.md#svmstatus)\>; `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment); \}\]; `unplaced`: (`option`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements); \}\>
`x402/batch-settlement/solana`. The payee broadcasts (`broadcaster` answers `"payee"` for each payment type
`channel.kind` takes): for every payment of the channel: the seller's facilitator, the `feePayer`, co-signs and sends
the deposit and top-up transactions the payer signed, redeems vouchers when it settles, and sends the refund;
`status` reads them, and `channel.kind` classifies each payment. A payment of any other type gets
`x402/not-an-opening`, as `bound` refuses it.
***
### 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`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `channelId`: `` `0x${string}` ``; `config`: [`ChannelConfig`](https://lcp.integraledger.com/reference/api/x402-batch-settlement.md#channelconfig); \}
The config and id of a `ChannelCreated(channelId, config)` log, the id recomputed from the 7-word data.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `log` | [`EvmLog`](https://lcp.integraledger.com/reference/api/evm.md#evmlog) |
| `chainId` | `number` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `channelId`: `` `0x${string}` ``; `config`: [`ChannelConfig`](https://lcp.integraledger.com/reference/api/x402-batch-settlement.md#channelconfig); \}
***
### batchChannelId()
> **batchChannelId**(`chainId`, `c`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``
The channel id: the EIP-712 digest of the configuration under the `x402 Batch Settlement` domain.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `chainId` | `number` |
| `c` | [`ChannelConfig`](https://lcp.integraledger.com/reference/api/x402-batch-settlement.md#channelconfig) |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``
***
### erc3009DepositNonce()
> **erc3009DepositNonce**(`channelId`, `authSalt`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``
The EIP-3009 deposit's nonce: keccak256(abi.encode(bytes32 channelId, uint256 authSalt)). A `channelId` or
`authSalt` that is not a string of `0x` and 64 hex digits is `evm/field-malformed`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `channelId` | `` `0x${string}` `` |
| `authSalt` | `` `0x${string}` `` |
#### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``
## References
### BatchPaymentPayload
Re-exports [BatchPaymentPayload](https://lcp.integraledger.com/reference/api.md#batchpaymentpayload)
***
### Broadcaster
Re-exports [Broadcaster](https://lcp.integraledger.com/reference/api.md#broadcaster)
***
### CloudflarePaymentPayload
Re-exports [CloudflarePaymentPayload](https://lcp.integraledger.com/reference/api.md#cloudflarepaymentpayload)
***
### EvmMark
Re-exports [EvmMark](https://lcp.integraledger.com/reference/api/ap2.md#evmmark)
***
### EvmQuery
Re-exports [EvmQuery](https://lcp.integraledger.com/reference/api/ap2.md#evmquery)
***
### X402Advertise
Re-exports [X402Advertise](https://lcp.integraledger.com/reference/api/casper.md#x402advertise)
***
### X402Read
Re-exports [X402Read](https://lcp.integraledger.com/reference/api/aptos.md#x402read)
---
# @integraledger/lcp/x402-exact-solana
> The `x402/exact/solana` pairing: the ATR hash placed as the option's `extra.memo` in LCP string form, written by the payer as the transaction's one Memo instruction, read back from the signed message, and read from the settlement.
Source: https://lcp.integraledger.com/reference/api/x402-exact-solana
Updated 2026-11-20. Documents @integraledger/lcp 0.6.3 and @integraledger/profile-facilitator 0.5.1.
The `x402/exact/solana` pairing: the ATR hash placed as the option's `extra.memo` in LCP string form, written by the
payer as the transaction's one Memo instruction, read back from the signed message, and read from the settlement.
## Interfaces
### SvmChoice
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `accepted` | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) | - |
| `computeUnitLimit?` | `number` | - |
| `computeUnitPrice?` | `bigint` | - |
| `decimals` | `number` | - |
| `payer` | `string` | - |
| `reader?` | `Pick`\<[`SvmReader`](https://lcp.integraledger.com/reference/api/svm.md#svmreader), `"network"` \| `"account"`\> | A reader of the option's network, through whose `account` `build` reads a Token-2022 mint at `confirmed` and, where its `TransferHook` extension names a program, the accounts the transfer hook needs (the profile's rule 9). Absent, `build` reads nothing and writes `TransferChecked` with its four accounts, which a mint whose hook names a program does not take. |
| `recentBlockhash` | `string` | - |
| `required` | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired) | - |
| `tokenProgram` | `string` | - |
***
### SvmUnsigned
What the payer signs, and how its signature completes the payment.
#### Type Parameters
| Type Parameter | Default type |
| ------ | ------ |
| `P` | [`SvmPaymentPayload`](https://lcp.integraledger.com/reference/api.md#svmpaymentpayload) |
#### Properties
| Property | Type |
| ------ | ------ |
| `request` | `object` |
| `request.kind` | `"solana-message"` |
| `request.message` | `Uint8Array`\<`ArrayBuffer`\> |
#### Methods
##### complete()
> **complete**(`signature`): [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `P`
A 64-byte Ed25519 signature by the payer.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `signature` | `Uint8Array` |
###### Returns
[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `P`
## Variables
### exactSvm
> `const` **exactSvm**: `Readonly`\<\{ `advertise`: (`doc`, `h`, `link`, `offer`, `agreementUrl?`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired); `bound`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `broadcaster`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>; `build`: (`c`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SvmUnsigned`](https://lcp.integraledger.com/reference/api/x402-exact-solana.md#svmunsigned)\<[`SvmPaymentPayload`](https://lcp.integraledger.com/reference/api.md#svmpaymentpayload)\>\>; `claims`: `boolean`; `data`: [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata); `id`: `"x402/exact/solana"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Read`](https://lcp.integraledger.com/reference/api/aptos.md#x402read); `recover`: (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `reference`: (`presented`, `option`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SvmRef`](https://lcp.integraledger.com/reference/api/svm.md#svmref)\>; `status`: (`ref`, `reader`, `query`) => `Promise`\<[`SvmStatus`](https://lcp.integraledger.com/reference/api/svm.md#svmstatus)\>; `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment); \}\]; `unplaced`: (`option`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements); \}\>
`x402/exact/solana`. The payee broadcasts (`broadcaster` answers `"payee"`): the seller's facilitator, the option's
`feePayer`, co-signs and sends the transaction the payer signed; `status` reads it.
## References
### Broadcaster
Re-exports [Broadcaster](https://lcp.integraledger.com/reference/api.md#broadcaster)
***
### SvmPaymentPayload
Re-exports [SvmPaymentPayload](https://lcp.integraledger.com/reference/api.md#svmpaymentpayload)
***
### X402Read
Re-exports [X402Read](https://lcp.integraledger.com/reference/api/aptos.md#x402read)
---
# @integraledger/lcp/x402-exact-stellar
> Stellar on x402: the pairing `x402/exact/stellar/precondition` (`exactStellarPrecondition`), an agreement in which the buyer signs a Soroban authorization of `transfer(buyer, payTo, amount)` and a 40-byte payload of H and that authorization's nonce.
Source: https://lcp.integraledger.com/reference/api/x402-exact-stellar
Updated 2026-11-20. Documents @integraledger/lcp 0.6.3 and @integraledger/profile-facilitator 0.5.1.
Stellar on x402: the pairing `x402/exact/stellar/precondition` (`exactStellarPrecondition`), an agreement in which
the buyer signs a Soroban authorization of `transfer(buyer, payTo, amount)` and a 40-byte payload of H and that
authorization's nonce.
The transaction carries that payload as a signed-payload precondition. The entry point also exports the pairing's
choice type `StellarPreconditionChoice`, its `assetTransferMethod` `LCP_PRECONDITION`, and the `Broadcaster` type,
which every pairing's `broadcaster` answers.
## Interfaces
### StellarPreconditionChoice
The buyer's inputs to `build`: the chosen option, the buyer's simulated transaction, the current ledger, and the
buyer's account (`G…`), which must be the simulated transfer's `from`.
#### Properties
| Property | Type |
| ------ | ------ |
| `accepted` | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) |
| `currentLedger` | `number` |
| `payer` | `string` |
| `required` | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired) |
| `simulatedXdr` | `string` |
## Variables
### exactStellarPrecondition
> `const` **exactStellarPrecondition**: `Readonly`\<\{ `advertise`: (`doc`, `h`, `link`, `offer`, `agreementUrl?`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired); `bound`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `broadcaster`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>; `build`: (`c`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`StellarUnsigned`](https://lcp.integraledger.com/reference/api/stellar.md#stellarunsigned)\>; `claims`: `boolean`; `data`: [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata); `id`: `"x402/exact/stellar/precondition"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Read`](https://lcp.integraledger.com/reference/api/aptos.md#x402read); `recover`: (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `reference`: (`presented`, `option`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`StellarRef`](https://lcp.integraledger.com/reference/api/stellar.md#stellarref)\>; `status`: (`ref`, `reader`, `query`) => `Promise`\<[`StellarStatus`](https://lcp.integraledger.com/reference/api/stellar.md#stellarstatus)\>; `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment); \}\]; `unplaced`: (`option`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements); \}\>
`x402/exact/stellar/precondition`. The payee broadcasts (`broadcaster` answers `"payee"`): the seller's settler
submits the transaction as its source; `status` finds it by the buyer's events and holds it to the five checks.
***
### LCP\_PRECONDITION
> `const` **LCP\_PRECONDITION**: `"lcp-precondition"` = `"lcp-precondition"`
The profile's `assetTransferMethod`, which tells this form's option from every other Stellar option.
## References
### Broadcaster
Re-exports [Broadcaster](https://lcp.integraledger.com/reference/api.md#broadcaster)
***
### X402Read
Re-exports [X402Read](https://lcp.integraledger.com/reference/api/aptos.md#x402read)
---
# @integraledger/lcp/x402-exact-xrpl
> The `x402/exact/xrpl` pairing: the ATR hash's LCP string placed as the option's `extra.invoiceId`, whose SHA-256 the payer signs as the Payment's `InvoiceID`.
Source: https://lcp.integraledger.com/reference/api/x402-exact-xrpl
Updated 2026-11-18. Documents @integraledger/lcp 0.6.3 and @integraledger/profile-facilitator 0.5.1.
The `x402/exact/xrpl` pairing: the ATR hash's LCP string placed as the option's `extra.invoiceId`, whose SHA-256 the
payer signs as the Payment's `InvoiceID`.
The hash is read back from the signed blob, single-signed or multisigned, and settlement is read by the payer's
instrument, its `Account` with the signed `Sequence` or ticket.
## Interfaces
### XrplChoice
#### Properties
| Property | Type |
| ------ | ------ |
| `accepted` | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) |
| `account` | `string` |
| `fee` | `string` |
| `lastLedgerSequence` | `number` |
| `required` | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired) |
| `sequence` | `number` |
| `ticketSequence?` | `number` |
## Variables
### exactXrpl
> `const` **exactXrpl**: `Readonly`\<\{ `advertise`: (`doc`, `h`, `link`, `offer`, `agreementUrl?`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired); `bound`: (`presented`, `_given?`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `broadcaster`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>; `build`: (`c`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`XrplUnsigned`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplunsigned)\<[`XrplPaymentPayload`](https://lcp.integraledger.com/reference/api.md#xrplpaymentpayload)\>\>; `claims`: `boolean`; `data`: [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata); `id`: `"x402/exact/xrpl"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Read`](https://lcp.integraledger.com/reference/api/aptos.md#x402read); `recover`: (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `reference`: (`presented`, `option`, `_given?`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `Omit`\<[`XrplRef`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplref), `"fromLedger"`\>\>; `status`: (`ref`, `reader`, `query`) => `Promise`\<[`XrplStatus`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplstatus)\>; `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment); \}\]; `unplaced`: (`option`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements); \}\>
`x402/exact/xrpl`. The payee broadcasts (`broadcaster` answers `"payee"`): the seller's facilitator submits the
signed `Payment` blob; `status` reads it by the payer's instrument (`xrplStatus`). `recover` returns the value the
landed `Payment` carries in H's place, its `InvoiceID`, the SHA-256 of H's LCP string, as `0x` and 64 lowercase hex
digits (`xrplInvoiceOf`): a digest is not read back to H, so a holder of the ATR computes the SHA-256 of its own
H's LCP string and compares the two.
## References
### Broadcaster
Re-exports [Broadcaster](https://lcp.integraledger.com/reference/api.md#broadcaster)
***
### X402Read
Re-exports [X402Read](https://lcp.integraledger.com/reference/api/aptos.md#x402read)
***
### XrplPaymentPayload
Re-exports [XrplPaymentPayload](https://lcp.integraledger.com/reference/api.md#xrplpaymentpayload)
***
### XrplQuery
Re-exports [XrplQuery](https://lcp.integraledger.com/reference/api/mpp.md#xrplquery)
---
# @integraledger/lcp/x402-upto-solana
> The `x402/upto/solana` pairing: the ATR hash placed as the option's `extra.memo` in LCP string form, written by the payer as the one Memo instruction of the transaction that opens a one-request payment channel.
Source: https://lcp.integraledger.com/reference/api/x402-upto-solana
Updated 2026-11-18. Documents @integraledger/lcp 0.6.3 and @integraledger/profile-facilitator 0.5.1.
The `x402/upto/solana` pairing: the ATR hash placed as the option's `extra.memo` in LCP string form, written by the
payer as the one Memo instruction of the transaction that opens a one-request payment channel.
The channel escrows the signed maximum. The hash is read back from that transaction, and settlement is read from the
opening.
## Interfaces
### UptoSvmChoice
#### Properties
| Property | Type |
| ------ | ------ |
| `accepted` | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) |
| `computeUnitLimit?` | `number` |
| `computeUnitPrice?` | `bigint` |
| `nonce` | `bigint` |
| `now` | `number` |
| `openSlot` | `bigint` |
| `payer` | `string` |
| `recentBlockhash` | `string` |
| `required` | [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired) |
| `tokenProgram` | `string` |
***
### UptoSvmPayload
#### Properties
| Property | Type | Description |
| ------ | ------ | ------ |
| `authorizedSigner` | `string` | - |
| `channelId` | `string` | - |
| `deposit` | `string` | - |
| `expiresAt` | `number` | - |
| `from` | `string` | - |
| `maxAmount` | `string` | - |
| `nonce` | `string` | - |
| `openSlot` | `number` | - |
| `openTransaction` | `string` | Base64 of the partially signed `open` transaction. |
| `validAfter` | `number` | - |
## Variables
### uptoSvm
> `const` **uptoSvm**: `Readonly`\<\{ `advertise`: (`doc`, `h`, `link`, `offer`, `agreementUrl?`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired); `bound`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `broadcaster`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>; `build`: (`c`, `h`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SvmUnsigned`](https://lcp.integraledger.com/reference/api/x402-exact-solana.md#svmunsigned)\<[`UptoSvmPaymentPayload`](https://lcp.integraledger.com/reference/api.md#uptosvmpaymentpayload)\>\>; `claims`: `true`; `data`: [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata); `id`: `"x402/upto/solana"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Read`](https://lcp.integraledger.com/reference/api/aptos.md#x402read); `recover`: (`input`, `reader`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `reference`: (`presented`, `option`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`SvmRef`](https://lcp.integraledger.com/reference/api/svm.md#svmref)\>; `status`: (`ref`, `reader`, `query`) => `Promise`\<[`SvmStatus`](https://lcp.integraledger.com/reference/api/svm.md#svmstatus)\>; `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment); \}\]; `unplaced`: (`option`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements); \}\>
`x402/upto/solana`. The payee broadcasts (`broadcaster` answers `"payee"`): the seller's facilitator, the option's
`feePayer`, co-signs and sends the opening the payer signed, and settles the metered amount in a later transaction;
`status` reads the opening.
## References
### Broadcaster
Re-exports [Broadcaster](https://lcp.integraledger.com/reference/api.md#broadcaster)
***
### UptoSvmPaymentPayload
Re-exports [UptoSvmPaymentPayload](https://lcp.integraledger.com/reference/api.md#uptosvmpaymentpayload)
***
### X402Read
Re-exports [X402Read](https://lcp.integraledger.com/reference/api/aptos.md#x402read)
---
# @integraledger/lcp/x402-upto-xrpl
> The `x402/upto/xrpl` pairing: x402's `upto` scheme on the XRP Ledger, at coverage `none`, its payment following an agreement on the same network.
Source: https://lcp.integraledger.com/reference/api/x402-upto-xrpl
Updated 2026-11-18. Documents @integraledger/lcp 0.6.3 and @integraledger/profile-facilitator 0.5.1.
The `x402/upto/xrpl` pairing: x402's `upto` scheme on the XRP Ledger, at coverage `none`, its payment following an
agreement on the same network.
The payer opens a payment channel to the option's `payTo` itself and presents the channel and its own account, so
nothing it signs carries the ATR hash. Settlement is read from the channel's create.
## Interfaces
### UptoXrplPayload
What the payer presents: the channel's id, the maximum its claim signs, the claim's signature, the channel's
`PublicKey` and the channel's `Account` (`specs/schemes/upto/scheme_upto_xrpl.md:172-188` at x402 `88b66dd4`).
#### Properties
| Property | Type |
| ------ | ------ |
| `channelId` | `string` |
| `maxAmount` | `string` |
| `payer` | `string` |
| `publicKey` | `string` |
| `signature` | `string` |
***
### UptoXrplPaymentPayload
A payment on `x402/upto/xrpl`.
#### Properties
| Property | Type |
| ------ | ------ |
| `accepted` | [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements) |
| `extensions?` | `object` |
| `payload` | [`UptoXrplPayload`](https://lcp.integraledger.com/reference/api/x402-upto-xrpl.md#uptoxrplpayload) |
| `resource?` | `object` |
| `resource.url` | `string` |
| `x402Version` | `2` |
## Variables
### uptoXrpl
> `const` **uptoXrpl**: `Readonly`\<\{ `advertise`: (`doc`, `h`, `link`, `offer`, `agreementUrl?`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequired`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequired); `bound`: (`presented`, `_given?`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `` `0x${string}` ``\>; `broadcaster`: (`presented`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`Broadcaster`](https://lcp.integraledger.com/reference/api.md#broadcaster)\>; `claims`: `boolean`; `data`: [`PairingData`](https://lcp.integraledger.com/reference/api.md#pairingdata); `id`: `"x402/upto/xrpl"`; `pattern`: [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402.md#lcppattern); `read`: (`doc`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`X402Read`](https://lcp.integraledger.com/reference/api/aptos.md#x402read); `reference`: (`presented`, `option`, `_given?`) => `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `Omit`\<[`XrplChannelRef`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplchannelref), `"fromLedger"`\>\>; `status`: (`ref`, `reader`, `query`) => `Promise`\<[`XrplStatus`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplstatus)\>; `tie`: (`accepts`, `request`) => \[`"x402"`, \{ `accepts`: readonly [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements)[]; `request`: [`RequestCommitment`](https://lcp.integraledger.com/reference/api/x402.md#requestcommitment) \| [`ToolCallCommitment`](https://lcp.integraledger.com/reference/api/x402.md#toolcallcommitment); \}\]; `unplaced`: (`option`) => [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| [`PaymentRequirements`](https://lcp.integraledger.com/reference/api/x402.md#paymentrequirements); \}\>
`x402/upto/xrpl`. The payer broadcasts (`broadcaster` answers `"payer"`): its client submits the channel's create
before it presents the payment, and the payment names that channel. `status` reads the create
(`xrplChannelStatus`). It has no `build`, the payer's own client opening the channel, and no `recover`, nothing on
the ledger carrying H.
## References
### Broadcaster
Re-exports [Broadcaster](https://lcp.integraledger.com/reference/api.md#broadcaster)
***
### X402Read
Re-exports [X402Read](https://lcp.integraledger.com/reference/api/aptos.md#x402read)
---
# @integraledger/lcp/xrpl
> XRP Ledger rail pieces: the signed blob, its `InvoiceID` or memo carrying the ATR hash in each scheme's form, the transaction hash computed from the blob, the reads of a payment, an opening, a channel and a close through a bounded reader, and the payment channel's id and claim.
Source: https://lcp.integraledger.com/reference/api/xrpl
Updated 2026-11-20. Documents @integraledger/lcp 0.6.3 and @integraledger/profile-facilitator 0.5.1.
XRP Ledger rail pieces: the signed blob, its `InvoiceID` or memo carrying the ATR hash in each scheme's form, the
transaction hash computed from the blob, the reads of a payment, an opening, a channel and a close through a
bounded reader, and the payment channel's id and claim.
## Interfaces
### XrplChannelEntry
A `PayChannel` ledger entry.
#### Properties
| Property | Modifier | Type |
| ------ | ------ | ------ |
| `account` | `readonly` | `string` |
| `amount` | `readonly` | `string` |
| `destination` | `readonly` | `string` |
***
### XrplChannelRef
The read keys of a channel at coverage `none`: the network, the channel the presented payment names, in upper case,
the payer it names, the option's payee, and the ledger index the create must come after, which is the caller's.
#### Properties
| Property | Type |
| ------ | ------ |
| `channel` | `string` |
| `fromLedger` | `number` |
| `network` | `` `xrpl:${number}` `` |
| `payee` | `string` |
| `payer` | `string` |
***
### XrplLanded
A transaction as the server answers it: its signed blob and what its metadata shows.
#### Properties
| Property | Modifier | Type | Description |
| ------ | ------ | ------ | ------ |
| `blob` | `readonly` | `string` | The signed transaction, hex (`tx_blob`); an inner `Batch` transaction's own serialization. |
| `createdChannels?` | `readonly` | readonly `string`[] | The ids of the `PayChannel` entries the metadata creates. |
| `deletedChannels?` | `readonly` | readonly `string`[] | The ids of the `PayChannel` entries the metadata deletes. |
| `delivered?` | `readonly` | [`XrplAmount`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplamount) | `meta.delivered_amount` where the metadata gives one: drops, or an issued or MPT amount. |
| `hash` | `readonly` | `string` | The transaction's hash, 64 hex digits, as the server names it. |
| `ledgerIndex?` | `readonly` | `number` | The index of the ledger that holds it; absent where the server names none. |
| `parent?` | `readonly` | `string` | For an inner `Batch` transaction, the hash of the `Batch` that holds it (`meta.ParentBatchID`). |
| `result` | `readonly` | `string` | `meta.TransactionResult`. |
| `validated` | `readonly` | `boolean` | Whether the ledger that holds it is validated. |
***
### XrplPage
One page of `account_tx`, forward, in binary form: the transactions, the ledgers it covered, and its marker.
#### Properties
| Property | Modifier | Type | Description |
| ------ | ------ | ------ | ------ |
| `marker?` | `readonly` | `unknown` | `marker`, where more of the range is left to read. |
| `max` | `readonly` | `number` | - |
| `min` | `readonly` | `number` | `ledger_index_min` and `ledger_index_max` as the server answers them: the ledgers the page's search covered. |
| `transactions` | `readonly` | readonly [`XrplLanded`](https://lcp.integraledger.com/reference/api/xrpl.md#xrpllanded)[] | - |
***
### XrplReader
Bounded, read-only calls against one network's server. Every failure rejects, for example with `ReaderError` from
`@integraledger/lcp/evm`; any rejection reads as unreadable. A call the server refuses because it names ledgers the
server does not hold, as rippled on API version 2 refuses `account_tx` from a ledger below those it holds with
`lgrIdxMalformed`, rejects with `ReaderError` of kind `history`, which reads as `history-gap`. A call that names a
ledger answers with the index of the ledger it read.
#### Properties
| Property | Modifier | Type |
| ------ | ------ | ------ |
| `network` | `readonly` | `` `xrpl:${number}` `` |
#### Methods
##### accountInfo()
> **accountInfo**(`account`, `ledger`): `Promise`\<\{ `ledgerIndex`: `number`; `sequence`: `number`; \} \| \{ `ledgerIndex`: `number`; `notFound`: `true`; \}\>
`account_info` at the ledger named: the account's `Sequence`, or no such account (`actNotFound`).
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `account` | `string` |
| `ledger` | [`XrplLedgerName`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplledgername) |
###### Returns
`Promise`\<\{ `ledgerIndex`: `number`; `sequence`: `number`; \} \| \{ `ledgerIndex`: `number`; `notFound`: `true`; \}\>
##### accountTx()
> **accountTx**(`account`, `range`, `marker?`): `Promise`\<[`XrplPage`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplpage)\>
`account_tx` for `account`, forward, binary, over the range, resuming at `marker`: one page.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `account` | `string` |
| `range` | \{ `max`: `number`; `min`: `number`; \} |
| `range.max` | `number` |
| `range.min?` | `number` |
| `marker?` | `unknown` |
###### Returns
`Promise`\<[`XrplPage`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplpage)\>
##### channel()
> **channel**(`id`, `ledger`): `Promise`\<[`XrplChannelEntry`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplchannelentry) \| \{ `ledgerIndex`: `number`; `notFound`: `true`; \}\>
`ledger_entry` of a `PayChannel` at the ledger named, or no such entry (`entryNotFound`).
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `id` | `string` |
| `ledger` | [`XrplLedgerName`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplledgername) |
###### Returns
`Promise`\<[`XrplChannelEntry`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplchannelentry) \| \{ `ledgerIndex`: `number`; `notFound`: `true`; \}\>
##### server()
> **server**(): `Promise`\<[`XrplServer`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplserver)\>
`server_info`.
###### Returns
`Promise`\<[`XrplServer`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplserver)\>
##### ticket()
> **ticket**(`account`, `ticketSequence`, `ledger`): `Promise`\<\{ `ledgerIndex`: `number`; `present`: `boolean`; \}\>
`ledger_entry` of the account's `Ticket` at the ledger named: whether it is present.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `account` | `string` |
| `ticketSequence` | `number` |
| `ledger` | [`XrplLedgerName`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplledgername) |
###### Returns
`Promise`\<\{ `ledgerIndex`: `number`; `present`: `boolean`; \}\>
##### tx()
> **tx**(`hash`, `range`): `Promise`\<[`XrplLanded`](https://lcp.integraledger.com/reference/api/xrpl.md#xrpllanded) \| \{ `notFound`: `true`; `searchedAll`: `boolean`; \}\>
`tx` by hash, with `min_ledger` and `max_ledger` where a range is given: the transaction, or not found.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `hash` | `string` |
| `range` | \{ `max`: `number`; `min`: `number`; \} \| `null` |
###### Returns
`Promise`\<[`XrplLanded`](https://lcp.integraledger.com/reference/api/xrpl.md#xrpllanded) \| \{ `notFound`: `true`; `searchedAll`: `boolean`; \}\>
***
### XrplRef
The read keys `reference` returns: the network; the presented transaction's hash, a way to look and never the
identity; H; the option's payee, which `reference` takes from the option the payment answers; and, where the
payment presents its blob, the payer's instrument and signed body. `fromLedger`, the ledger index the search starts
from, the issue ledger, is the caller's.
#### Properties
| Property | Type |
| ------ | ------ |
| `fromLedger` | `number` |
| `h` | `` `0x${string}` `` |
| `network` | `` `xrpl:${number}` `` |
| `payee` | `string` |
| `signed?` | [`XrplSigned`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplsigned) |
| `transaction` | `string` |
***
### XrplServer
What `server_info` states: the ledgers the server holds and serves, and the network it serves.
#### Properties
| Property | Modifier | Type | Description |
| ------ | ------ | ------ | ------ |
| `completeLedgers` | `readonly` | `string` | `complete_ledgers`, as the server writes it: `"empty"`, or ranges `a-b` and single indexes joined by commas. |
| `latest` | `readonly` | `number` | The index of the latest ledger the server serves at the read, validated or not, to which a search reads. |
| `networkId?` | `readonly` | `number` | `network_id`, where the server states one. |
| `validated` | `readonly` | `number` | `validated_ledger.seq`: the index of the latest validated ledger. |
***
### XrplSigned
The payer's instrument and the message it signed, read from a presented blob: the signed `Account`, its `Sequence`
or, where `Sequence` is 0, its `TicketSequence`, its `LastLedgerSequence` or null, and the signed body, the blob's
fields but `TxnSignature`, `SigningPubKey` and `Signers`, in the codec's canonical encoding, hex.
#### Properties
| Property | Modifier | Type |
| ------ | ------ | ------ |
| `account` | `readonly` | `string` |
| `body` | `readonly` | `string` |
| `lastLedgerSequence` | `readonly` | `number` \| `null` |
| `sequence` | `readonly` | `number` |
| `ticket?` | `readonly` | `number` |
***
### XrplTxJson
#### Indexable
> \[`field`: `string`\]: `unknown`
#### Properties
| Property | Type |
| ------ | ------ |
| `Account` | `string` |
| `InvoiceID?` | `string` |
| `LastLedgerSequence?` | `number` |
| `Memos?` | `unknown` |
| `TransactionType` | `string` |
***
### XrplUnsigned
What the wallet signs, and how its signed blob completes the payment.
#### Type Parameters
| Type Parameter |
| ------ |
| `P` |
#### Properties
| Property | Type |
| ------ | ------ |
| `request` | `object` |
| `request.kind` | `"xrpl-tx"` |
| `request.txJson` | [`XrplTxJson`](https://lcp.integraledger.com/reference/api/xrpl.md#xrpltxjson) |
#### Methods
##### complete()
> **complete**(`signedBlob`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `P`\>
The payment of the wallet's signed blob, hex, read as `bound` reads it: a blob that does not decode, or is
multi-signed, gets the refusal `bound` gives it, and one whose `NetworkID` a node of the option's network does not
take, as rippled reads it, is `xrpl/network-mismatch`.
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `signedBlob` | `string` |
###### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| `P`\>
## Type Aliases
### XrplAmount
> **XrplAmount** = `string` \| \{ `currency`: `string`; `issuer`: `string`; `value`: `string`; \} \| \{ `mpt_issuance_id`: `string`; `value`: `string`; \}
An amount as rippled writes it: drops of XRP, an issued currency's value, or an MPT's.
***
### XrplCloseRef
> **XrplCloseRef** = `object`
The read keys of a reported close: the network, the channel, the close's transaction and the option's payee.
#### Properties
| Property | Type |
| ------ | ------ |
| `channel` | `string` |
| `network` | [`XrplNetwork`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplnetwork) |
| `payee` | `string` |
| `phase` | `"close"` |
| `transaction` | `string` |
***
### XrplCloseStatus
> **XrplCloseStatus** = [`XrplStatus`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplstatus)
A reported close's read, as the profile `read-status` answers it: the answer `XrplStatus` names.
***
### XrplLedgerName
> **XrplLedgerName** = `"validated"` \| `"current"`
The ledger an `account_info` or `ledger_entry` call names: the latest validated one, or the current one.
***
### XrplMark
> **XrplMark** = `"validated"`
The XRP Ledger's one mark, `validated`: a state of a transaction its servers tell apart, the default and the final
mark, and the only finality a query names.
***
### XrplNetwork
> **XrplNetwork** = `` `xrpl:${number}` ``
CAIP-2: `xrpl:` and the chain's NetworkID, 0 to 4294967295.
***
### XrplReached
> **XrplReached** = [`XrplMark`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplmark) \| `"current"`
What a read reached for a transaction it names: `validated`, the mark, or `current`, a ledger the server serves above
the latest validated one, up to the latest ledger the search for H reads on to. `current` is no mark a query names:
an act or a lapse read there is `pending`, `below-mark`.
***
### XrplStatus
> **XrplStatus** = [`StatusAnswer`](https://lcp.integraledger.com/reference/api.md#statusanswer)\<`number`, [`XrplReached`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplreached)\>
An XRPL read, as the profile `read-status` answers it. The position is a ledger index, and so is the search's.
## Variables
### XRPL\_MAX\_BLOB\_BYTES
> `const` **XRPL\_MAX\_BLOB\_BYTES**: `16384` = `16_384`
The largest signed blob lcp decodes, in bytes: lcp's own bound, read by every XRPL pairing. It holds a Payment or a
PaymentChannelCreate signed by the 32 signers a signer list admits at most (rippled `3c72fb54`,
`include/xrpl/protocol/STTx.h:49`), with the paths a stock client finds and memos of rippled's 1,024 bytes
(`src/libxrpl/protocol/STTx.cpp:697`); rippled's own bound on a transaction, 1 MB (`include/xrpl/protocol/Protocol.h:38`),
is no payment's.
***
### XRPL\_MAX\_DEPTH
> `const` **XRPL\_MAX\_DEPTH**: `10` = `10`
The deepest level a field of a transaction sits at, rippled's limit: its deserializer refuses a field whose depth is
above 10 (rippled 3.4.1, `src/libxrpl/protocol/STVar.cpp` L104-108, the `STVar` constructor that reads a
`SerialIter`). A top-level field is at level 1, each field inside an STObject or STArray field one level below that
field, and an array's member object one level below the array. An end marker that closes its own object or array
sits at no level, so an object or array at this level holds no field.
***
### XRPL\_MAX\_PAGES
> `const` **XRPL\_MAX\_PAGES**: `16` = `16`
The most `account_tx` pages one read takes: lcp's own bound on the calls a read makes. A search with pages left
answers `pending`, `search-incomplete`, with the ledger the next read resumes from.
***
### xrplChargeStatus
> `const` **xrplChargeStatus**: (`ref`, `reader`, `query`) => `Promise`\<[`XrplStatus`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplstatus)\>
The read of `mpp/charge/xrpl`: `xrplPaymentStatus` of MPP's `InvoiceID`, H itself.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `ref` | [`XrplRef`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplref) |
| `reader` | [`XrplReader`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplreader) |
| `query` | [`XrplQuery`](https://lcp.integraledger.com/reference/api/mpp.md#xrplquery)\<[`XrplRef`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplref)\> |
#### Returns
`Promise`\<[`XrplStatus`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplstatus)\>
***
### xrplOpenStatus
> `const` **xrplOpenStatus**: (`ref`, `reader`, `query`) => `Promise`\<[`XrplStatus`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplstatus)\>
The read of an in-band opening, `mpp/session/xrpl`: `xrplPaymentStatus` of the opening's one LCP memo.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `ref` | [`XrplRef`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplref) |
| `reader` | [`XrplReader`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplreader) |
| `query` | [`XrplQuery`](https://lcp.integraledger.com/reference/api/mpp.md#xrplquery)\<[`XrplRef`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplref)\> |
#### Returns
`Promise`\<[`XrplStatus`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplstatus)\>
***
### xrplStatus
> `const` **xrplStatus**: (`ref`, `reader`, `query`) => `Promise`\<[`XrplStatus`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplstatus)\>
The read of `x402/exact/xrpl`: `xrplPaymentStatus` of x402's `InvoiceID`, the SHA-256 of H's LCP string.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `ref` | [`XrplRef`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplref) |
| `reader` | [`XrplReader`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplreader) |
| `query` | [`XrplQuery`](https://lcp.integraledger.com/reference/api/mpp.md#xrplquery)\<[`XrplRef`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplref)\> |
#### Returns
`Promise`\<[`XrplStatus`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplstatus)\>
## Functions
### decodeBlob()
> **decodeBlob**(`hex`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `hash`: `string`; `tx`: [`XrplTxJson`](https://lcp.integraledger.com/reference/api/xrpl.md#xrpltxjson); \}\>
Decodes a signed blob of at most `XRPL_MAX_BLOB_BYTES` bytes, and computes its transaction hash as the ledger
does: SHA-512Half over `54584E00` and the blob, in upper case. Before the codec decodes it, a single pass over its
fields refuses a blob with a field deeper than `XRPL_MAX_DEPTH`, or with an end marker in an object or array it does
not close, as rippled refuses either. The blob must be the canonical serialization of what it decodes to: the
codec's encoding of the decoded fields gives back the same bytes, so nothing follows a top-level end marker and every
array member is an object.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `hex` | `string` |
#### Returns
`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal) \| \{ `hash`: `string`; `tx`: [`XrplTxJson`](https://lcp.integraledger.com/reference/api/xrpl.md#xrpltxjson); \}\>
***
### mppInvoiceId()
> **mppInvoiceId**(`h`): `string`
The hash's 64 hex digits in upper case, without `0x`: MPP's `methodDetails.invoiceId`. Throws TypeError when `h` is
not a 32-byte hash.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `h` | `` `0x${string}` `` |
#### Returns
`string`
***
### x402InvoiceId()
> **x402InvoiceId**(`h`): `Promise`\<`string`\>
Uppercase hex of SHA-256 over the UTF-8 bytes of the hash's LCP string: x402's `InvoiceID` for `extra.invoiceId`.
Rejects with a TypeError when `h` is not a 32-byte hash.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `h` | `` `0x${string}` `` |
#### Returns
`Promise`\<`string`\>
***
### xrplChannelId()
> **xrplChannelId**(`account`, `destination`, `sequence`): `string` \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
The PayChannel id: SHA-512Half of `0x0078` ‖ the source's AccountID ‖ the destination's AccountID ‖ the creating
transaction's sequence (or ticket sequence), big-endian; upper-case hex. An address that is not a classic address,
or a sequence that is not a UInt32, is `mpp/input-malformed`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `account` | `string` |
| `destination` | `string` |
| `sequence` | `number` |
#### Returns
`string` \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
***
### xrplChannelStatus()
> **xrplChannelStatus**(`ref`, `reader`, `query`): `Promise`\<[`XrplStatus`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplstatus)\>
The read of a channel at coverage `none`, as the profile `read-status` answers it: the `PayChannel` at the validated
ledger (`ledger_entry`); then the `account_tx` of the channel's `Account`, or, where the validated ledger does not
show the channel, of the payer the presented payment names, from the ledger the create must come after, or the
search position the query gives, to the latest ledger the server serves, for the `PaymentChannelCreate` whose
metadata creates the channel's entry, or, where the metadata names none, whose `Account`, `Destination` and sequence
or ticket give the channel's id. That create is the act where its `Account` is the payer and its `Destination` the
payee; one another account opened, or one to another account, took the channel and answers `failed`,
`instrument-consumed`; one at or before the query's `after`, `failed`, `before-position`. A channel the validated
ledger shows whose create the search, read whole, does not hold is `unreadable`, `history-gap` where the server does
not hold the range; where it holds it, the create was made at or before the search's start, so at or before the
query's `after` where the search began no later than the ledger after it, `failed`, `before-position`, since
`account_tx` lists every transaction of the opener's account, a delegated create and an inner `Batch` create among
them. A channel it does not show whose create the search does not hold is
`pending`, `not-found`, where the history holds, and `unreadable`, `history-gap` where it does not. `presented` is
`yes` where the create's `Account` is the payer the payment names, the create being the one whose metadata made the
channel's entry, so on every `settled` answer.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `ref` | [`XrplChannelRef`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplchannelref) |
| `reader` | [`XrplReader`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplreader) |
| `query` | [`XrplQuery`](https://lcp.integraledger.com/reference/api/mpp.md#xrplquery)\<[`XrplChannelRef`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplchannelref)\> |
#### Returns
`Promise`\<[`XrplStatus`](https://lcp.integraledger.com/reference/api/xrpl.md#xrplstatus)\>
***
### xrplClaim()
> **xrplClaim**(`channelId`, `drops`): `Uint8Array`\<`ArrayBuffer`\> \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
The bytes a channel claim signs: `CLM\0` ‖ channel id (32 bytes) ‖ drops as u64 big-endian. A channel id that is not
64 hex digits, or drops that are not a `bigint` UInt64, is `mpp/input-malformed`.
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `channelId` | `string` |
| `drops` | `bigint` |
#### Returns
`Uint8Array`\<`ArrayBuffer`\> \| [`Refusal`](https://lcp.integraledger.com/reference/api.md#refusal)
## References
### XrplQuery
Re-exports [XrplQuery](https://lcp.integraledger.com/reference/api/mpp.md#xrplquery)