@integraledger/lcp/evm
eip155 rail pieces: EIP-3009 and Permit2 typed data, the settlement read from a token's events, the read of a signed pull authorization's use, ERC-7710 permission contexts, the commerce-payments escrow's pieces, and x402's Permit2 proxy addresses.
For AI agents: this page as Markdown, and llms.txt, the index of every page.
eip155 rail pieces: EIP-3009 and Permit2 typed data, the settlement read from a token's events, the read of a signed pull authorization's use, ERC-7710 permission contexts, the commerce-payments escrow's pieces, and x402's Permit2 proxy addresses.
The settlement read is from the token's AuthorizationUsed event and the transfer it produced, and a pull
authorization's use is read before any transaction is named. It also holds the identity digest of a transfer; the
ERC-7710 permission-context decoder and MetaMask's DelegationManager address; and the commerce-payments escrow's
payment hash and the salt commitment to a receiver authorizer and policy.
Classes
ReaderError
Why a reader's call gave no answer: it timed out, its answer exceeded the reader's bound or the endpoint refused the
range asked, it did not complete, its answer was malformed, or the endpoint does not hold the history or state asked
for (history), which a read answers unreadable, history-gap.
Extends
Error
Constructors
Constructor
new ReaderError(
kind,message?):ReaderError
Parameters
| Parameter | Type |
|---|---|
kind | "history" | "transport" | "timeout" | "too-large" | "malformed" |
message? | string |
Returns
Overrides
Error.constructor
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
cause? | public | unknown | - | Error.cause |
kind | readonly | "history" | "transport" | "timeout" | "too-large" | "malformed" | - | - |
message | public | string | - | Error.message |
name | public | string | - | Error.name |
stack? | public | string | - | Error.stack |
stackTraceLimit | static | number | The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | Error.stackTraceLimit |
Methods
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
Error.captureStackTrace
prepareStackTrace()
staticprepareStackTrace(err,stackTraces):any
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Error.prepareStackTrace
Interfaces
AuthCaptureRef
The reference the auth-capture reads take.
Extends
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
asset | readonly | `0x${string}` | - | - |
escrow | readonly | `0x${string}` | The escrow deployment and the event of the option's flow. | - |
event | readonly | `0x${string}` | - | - |
expiry | readonly | string | preApprovalExpiry, in decimal. | - |
h | readonly | `0x${string}` | - | X402EvmRefBase.h |
network | readonly | `eip155:${string}` | - | X402EvmRefBase.network |
payee | readonly | string | - | X402EvmRefBase.payee |
payer | readonly | `0x${string}` | The escrow's PaymentInfo.payer, the token authorization's signer. | - |
paymentId | readonly | `0x${string}` | The escrow's payment hash of the presented PaymentInfo, and that hash with payer zero, the signed nonce. | - |
salt | readonly | `0x${string}` | PaymentInfo.salt: H, or the commitment to the receiver authorizer, the policy and H. | - |
scheme | readonly | "permit2" | "eip3009" | - | - |
signatureNonce | readonly | `0x${string}` | - | - |
transaction? | readonly | `0x${string}` | A transaction a settler or the caller named, read beside the search; never needed. | X402EvmRefBase.transaction |
BatchEvmRef
The reference the read of x402/batch-settlement/eip155 takes: the channel the opening deposits into, by its id and
its config whole (the payer, who signs the deposit authorization; the payer authorizer; the receiver; the receiver
authorizer; the token; the withdrawal delay; the salt), which the id commits to, and the deposit authorization's
nonce, its bound and the amount it moves.
Extends
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
amount | readonly | string | - | - |
asset | readonly | `0x${string}` | The channel's token. | - |
channel | readonly | `0x${string}` | The channel id, and the config's other members. | - |
h | readonly | `0x${string}` | - | X402EvmRefBase.h |
network | readonly | `eip155:${string}` | - | X402EvmRefBase.network |
nonce | readonly | `0x${string}` | The deposit authorization's nonce, a 32-byte word: keccak256(abi.encode(channelId, authSalt)) on ERC-3009, the permit's nonce on Permit2. | - |
payee | readonly | string | - | X402EvmRefBase.payee |
payer | readonly | `0x${string}` | The channel's payer, the deposit authorization's signer. | - |
payerAuthorizer | readonly | `0x${string}` | - | - |
receiver | readonly | `0x${string}` | - | - |
receiverAuthorizer | readonly | `0x${string}` | - | - |
refundAuthorizer? | readonly | `0x${string}` | In the scheme's refund-authorizer mode, the option's refund authorizer, whose 20 bytes end the channel salt: H is then the deposit authorization's salt, or the permit's nonce, and not the channel salt. | - |
salt | readonly | `0x${string}` | - | - |
scheme | readonly | "permit2" | "eip3009" | - | - |
settleBy | readonly | string | The deposit authorization's validBefore or deadline, and the deposit's amount, in decimal. | - |
transaction? | readonly | `0x${string}` | A transaction a settler or the caller named, read beside the search; never needed. | X402EvmRefBase.transaction |
withdrawDelay | readonly | number | - | - |
Delegation
Properties
| Property | Type |
|---|---|
authority | `0x${string}` |
caveats | object[] |
delegate | `0x${string}` |
delegator | `0x${string}` |
salt | `0x${string}` |
signature | `0x${string}` |
Eip3009Ref
The reference the exact EIP-3009 read takes.
Extends
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
asset | readonly | `0x${string}` | The token under whose domain the authorization is signed, the option's asset. | - |
h | readonly | `0x${string}` | - | X402EvmRefBase.h |
network | readonly | `eip155:${string}` | - | X402EvmRefBase.network |
payee | readonly | string | - | X402EvmRefBase.payee |
payer | readonly | `0x${string}` | The authorization's from, the signer of H. | - |
presented | readonly | Signed | The members of the payment presented: the token, from, to, value and nonce, lowercase, value in decimal. | - |
transaction? | readonly | `0x${string}` | A transaction a settler or the caller named, read beside the search; never needed. | X402EvmRefBase.transaction |
validBefore | readonly | string | The authorization's validBefore, in decimal: the lapse's deadline, no member compared. | - |
Eip3009TypedData
Properties
| Property | Type |
|---|---|
domain | object |
domain.chainId | number |
domain.name | string |
domain.verifyingContract | `0x${string}` |
domain.version | string |
message | object |
message.from | `0x${string}` |
message.nonce | `0x${string}` |
message.to | `0x${string}` |
message.validAfter | bigint |
message.validBefore | bigint |
message.value | bigint |
primaryType | "TransferWithAuthorization" |
types | object |
types.EIP712Domain | Field[] |
types.TransferWithAuthorization | Field[] |
Erc7710Ref
The reference the ERC-7710 reads take.
Extends
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
asset | readonly | `0x${string}` | - | - |
h | readonly | `0x${string}` | - | X402EvmRefBase.h |
network | readonly | `eip155:${string}` | - | X402EvmRefBase.network |
payee | readonly | string | - | X402EvmRefBase.payee |
payer | readonly | `0x${string}` | The payment's delegator: at the salt level the root delegator, whose account the transfer comes from. | - |
presented? | readonly | Readonly<Record<string, string>> | The payment presented: delegation, the EIP-712 hash of the leaf delegation its permission context encodes (delegationHash), which covers the leaf's caveats and, through its authority, every delegation above it, and which status compares with the leaf a RedeemedDelegation log carries. Absent where the context does not decode as the reference manager's: the read then shows no member, and presented is unshown. | - |
transaction? | readonly | `0x${string}` | A transaction a settler or the caller named, read beside the search; never needed. | X402EvmRefBase.transaction |
EvmLog
One receipt log: the emitter, its topics and its data.
Extended by
Properties
| Property | Type |
|---|---|
address | `0x${string}` |
data | `0x${string}` |
topics | readonly `0x${string}`[] |
EvmReader
Bounded, read-only calls against one network's endpoint. Every failure rejects, for example with ReaderError; a
rejected receipt, transaction or call reads as unreadable. A rejected blockNumber counts as a mark not
reached where a read places a receipt it has read against the marks; where a read takes the marks before anything
else, as the x402 reads on eip155 do with a reader that has no block, a rejected finalized mark is unreadable and
a rejected safe mark reads as the final one.
Extended by
Properties
| Property | Modifier | Type |
|---|---|---|
network | readonly | `eip155:${string}` | HederaNetwork |
Methods
block()?
optionalblock(at):Promise<{number:bigint;timestamp:bigint; }>
eth_getBlockByNumber(at, false): its number and timestamp. Rejects with a ReaderError of kind history where the
endpoint does not hold that block. Absent where the reader reads no block; a read that needs a block's time then
reads no lapse.
Parameters
| Parameter | Type |
|---|---|
at | bigint | "safe" | "finalized" | "latest" |
Returns
Promise<{ number: bigint; timestamp: bigint; }>
blockNumber()
blockNumber(
tag):Promise<bigint>
eth_getBlockByNumber(tag, false).number.
Parameters
| Parameter | Type |
|---|---|
tag | "safe" | "finalized" |
Returns
Promise<bigint>
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}`>
logs()?
optionallogs(filter):Promise<readonlyEvmLogEntry[]>
eth_getLogs over fromBlock to toBlock: address absent, every contract's; a topic null, any value there.
Rejects with a ReaderError of kind too-large for a range the endpoint refuses, and of kind history where the
endpoint does not hold the history of the range. Absent where the reader makes no log query: a read that needs a
search then holds its search open and answers no failed that rests on one.
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<readonly EvmLogEntry[]>
receipt()
receipt(
tx):Promise<EvmReceipt|null>
eth_getTransactionReceipt; null when the node holds none.
Parameters
| Parameter | Type |
|---|---|
tx | `0x${string}` |
Returns
Promise<EvmReceipt | null>
transaction()
transaction(
tx):Promise<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 | null>
EvmReadRefBase
The reference every read over statusOf takes: the network, the option's payee, and a named transaction as a hint.
Extended by
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
network | readonly | `eip155:${string}` | - |
payee | readonly | string | - |
transaction? | readonly | `0x${string}` | A transaction a settler or the caller named, read beside the search; never needed. |
EvmReceipt
Properties
| Property | Type |
|---|---|
blockNumber | bigint |
logs | readonly EvmLog[] |
status | 0 | 1 |
EvmRef
The read keys for a later settlement read of an EVM payment, and nothing else.
Extended by
Properties
| Property | Type | Description |
|---|---|---|
authorization? | PullAuthorization | The signed pull authorization and where the chain records its use, where the pairing's reference records one. |
bindingLog? | { address: `0x${string}`; topic0: `0x${string}`; value: `0x${string}`; } & ({ index: 2 | 1 | 3; } | { dataWord: number; }) | The log carrying H or its commitment: in topic index, or in 32-byte data word dataWord. |
network | `eip155:${string}` | HederaNetwork | - |
payee | string | The option's payee, which reference takes from the option the payment answers. |
search? | object | The log filter that finds the transaction when none is named; absent, only a named transaction is read. |
search.address | `0x${string}` | - |
search.topics | readonly (`0x${string}` | null)[] | - |
settleBy? | string | Decimal Unix seconds after which the payment can no longer execute. |
transferLog? | TransferLog | The token transfer this payment made, identified by the digest of the named fields. |
EvmTransaction
A transaction as eth_getTransactionByHash gives it: from, the address that signed it; to; and input.
Properties
| Property | Type |
|---|---|
from | `0x${string}` |
input | `0x${string}` |
to | `0x${string}` | null |
EvmTxRef
The reference an EIP-3009 status reads: the network, the token, the transaction and the option's payee.
Properties
| Property | Type |
|---|---|
asset | `0x${string}` |
network | `eip155:${string}` |
payee | string |
transaction | `0x${string}` |
Field
Properties
| Property | Type |
|---|---|
name | string |
type | string |
PaymentInfo
Properties
| Property | Type |
|---|---|
authorizationExpiry | bigint |
feeReceiver | `0x${string}` |
maxAmount | bigint |
maxFeeBps | number |
minFeeBps | number |
operator | `0x${string}` |
payer | `0x${string}` |
preApprovalExpiry | bigint |
receiver | `0x${string}` |
refundExpiry | bigint |
salt | `0x${string}` |
token | `0x${string}` |
Permit2Ref
The reference the Permit2 reads take.
Extends
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
asset | readonly | `0x${string}` | - | - |
deadline | readonly | string | The permit's deadline, in decimal. | - |
h | readonly | `0x${string}` | - | X402EvmRefBase.h |
network | readonly | `eip155:${string}` | - | X402EvmRefBase.network |
payee | readonly | string | - | X402EvmRefBase.payee |
payer | readonly | `0x${string}` | The permit's owner, the signer of H. | - |
presented | readonly | Signed | The members of the payment presented: the permit's token, amount, nonce and deadline, its spender, the owner, and the witness's to and validAfter, with facilitator on upto. | - |
transaction? | readonly | `0x${string}` | A transaction a settler or the caller named, read beside the search; never needed. | X402EvmRefBase.transaction |
Permit2TypedData
Properties
| Property | Type |
|---|---|
domain | object |
domain.chainId | number |
domain.name | "Permit2" |
domain.verifyingContract | `0x${string}` |
message | object |
message.deadline | bigint |
message.nonce | bigint |
message.permitted | { amount: bigint; token: `0x${string}`; } | object[] |
message.spender | `0x${string}` |
message.witness? | object |
primaryType | "PermitTransferFrom" | "PermitWitnessTransferFrom" | "PermitBatchWitnessTransferFrom" |
types | object |
types.EIP712Domain | Field[] |
types.TokenPermissions | Field[] |
PullAuthorization
The signed pull authorization of a payment that has not landed, as the chain records its use: what a settlement
reader needs to decide, with authorizationUsed and the payment's authorizer, whether it executed or can still
execute.
eip3009: the tokenatanswersauthorizationState(authorizer, nonce), true once the authorization is used. It executes only in a block whose timestamp is belowdeadline(EIP-3009'svalidBefore).permit2: the Permit2 deploymentatanswersnonceBitmap(authorizer, nonce >> 8), whose bitnonce & 0xffis set once the nonce is used. The permit executes only in a block whose timestamp is at mostdeadline.
Properties
| Property | Type | Description |
|---|---|---|
asset | `0x${string}` | The token the authorization moves. |
at | `0x${string}` | The contract that records the nonce's use: the token for eip3009, the Permit2 deployment for permit2. |
deadline | string | The signed time bound, in decimal Unix seconds. |
nonce | `0x${string}` | The nonce the payer signed, as that contract records it: 0x and 64 lowercase hex digits. |
scheme | "permit2" | "eip3009" | - |
TransferLog
A token transfer, identified by the core's hash over the fields identity names (see transferDigest).
Properties
| Property | Type |
|---|---|
address | `0x${string}` |
digest | `0x${string}` |
identity | TransferIdentity |
topic0 | `0x${string}` |
X402EvmRefBase
The reference every x402 eip155 read takes: EvmReadRefBase and H.
Extends
Extended by
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
h | readonly | `0x${string}` | - | - |
network | readonly | `eip155:${string}` | - | EvmReadRefBase.network |
payee | readonly | string | - | EvmReadRefBase.payee |
transaction? | readonly | `0x${string}` | A transaction a settler or the caller named, read beside the search; never needed. | EvmReadRefBase.transaction |
Type Aliases
Eip155
Eip155 =
`eip155:${string}`
CAIP-2 for EVM chains; the reference is the decimal chain id.
EvmBreadthStatus
EvmBreadthStatus =
StatusAnswer<bigint,EvmMark>
What the EVM breadth pairings' status answers, in the same terms as EvmStatus.
EvmLogEntry
EvmLogEntry =
EvmLog&object
A log as eth_getLogs gives it: the log, the transaction that emitted it, its block and its index in the block.
Type Declaration
| Name | Type |
|---|---|
blockNumber | bigint |
logIndex | number |
transactionHash | Hex |
EvmStatus
EvmStatus =
StatusAnswer<bigint,EvmMark>
What an EVM status answers: its positions are block numbers, its marks EvmMark.
HederaNetwork
HederaNetwork =
"hedera:mainnet"|"hedera:testnet"|"hedera:previewnet"|"hedera:devnet"
Hedera's CAIP-2 networks, read through their JSON-RPC relay with the same reader shape.
Hex
Hex =
`0x${string}`
Signed
Signed =
Readonly<Record<string,string>>
The members of what the payer signed, as read from a landed act or as presented, each a lowercase string.
TransferIdentity
TransferIdentity =
"from,to,value"|"from,to"|"from"|"to,value"|"to"
Variables
AUTHORIZATION_CANCELED_TOPIC
constAUTHORIZATION_CANCELED_TOPIC:`0x${string}`
keccak256("AuthorizationCanceled(address,bytes32)")
AUTHORIZATION_STATE_SELECTOR
constAUTHORIZATION_STATE_SELECTOR:"0xe94a0102"
keccak256("authorizationState(address,bytes32)")[0..4]
AUTHORIZATION_USED_TOPIC
constAUTHORIZATION_USED_TOPIC:"0x98de503528ee59b575ef0c0a2576a82497bfc029a5685b209e9ec333479b10a5"
keccak256("AuthorizationUsed(address,bytes32)")
DELEGATION_MANAGER
constDELEGATION_MANAGER:"0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3"
MetaMask's reference DelegationManager, v1.3.0, at one CREATE2 address.
DELEGATION_MANAGER_CHAINS
constDELEGATION_MANAGER_CHAINS: readonlynumber[]
The chain ids on which an erc7710 payment through DELEGATION_MANAGER is read at the salt level,
x402/exact/eip155/erc7710-salt; on any other chain that pairing refuses it with x402/manager-not-reference.
eip3009Status
consteip3009Status: (ref,reader,query) =>Promise<StatusAnswer<bigint,EvmMark>>
status of x402/exact/eip155/eip3009.
Parameters
| Parameter | Type |
|---|---|
ref | Eip3009Ref |
reader | EvmReader |
query | EvmQuery<unknown> |
Returns
Promise<StatusAnswer<bigint, EvmMark>>
ESCROW
constESCROW: { readonly [d in "v1.1" | "v1.0"]: { chargedTopic: Hex; eip3009Collector: Hex; escrow: Hex; permit2Collector: Hex } }
The commerce-payments escrow's two deployments: the escrow, its two token collectors, and PaymentCharged's topic.
EXACT_PERMIT2_PROXY
constEXACT_PERMIT2_PROXY:"0x402085c248EeA27D92E8b30b2C58ed07f9E20001"
MAX_SEARCH_PAGES
constMAX_SEARCH_PAGES:8=8
lcp's own bound on the pages one status call reads, so that one call makes a bounded number of reader calls; a
search with range left answers its position, from which the next call resumes.
NONCE_BITMAP_SELECTOR
constNONCE_BITMAP_SELECTOR:"0x4fe02b44"
keccak256("nonceBitmap(address,uint256)")[0..4]
PAYMENT_AUTHORIZED_TOPIC
constPAYMENT_AUTHORIZED_TOPIC:"0x1c81fb2e3bab27f6bb09bee9a0dddf61600b7cbaf2c12683e4864e0cbdb9d284"
PAYMENT_INFO_TYPEHASH
constPAYMENT_INFO_TYPEHASH:"0xae68ac7ce30c86ece8196b61a7c486d8f0061f575037fbd34e7fe4e2820c6591"
PERMIT2
constPERMIT2:"0x000000000022D473030F116dDEE9F6B43aC78BA3"
REDEEMED_DELEGATION_TOPIC
constREDEEMED_DELEGATION_TOPIC:"0x40dadaa36c6c2e3d7317e24757451ffb2d603d875f0ad5e92c5dd156573b1873"
SALT_BINDING_TYPEHASH
constSALT_BINDING_TYPEHASH:"0x8a2a7e41a0bda000ded071ff38b79401d2603e1826516ff2635b11fe9e30877f"
SEARCH_PAGE_BLOCKS
constSEARCH_PAGE_BLOCKS:10000=10_000
The blocks one page of a search reads: a public endpoint refuses a wider range (Arc's refused a range above 10,000 blocks on 2026-11-16), and a page an endpoint refuses is halved.
TRANSFER_TOPIC
constTRANSFER_TOPIC:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
keccak256("Transfer(address,address,uint256)")
TRANSFER_WITH_AUTHORIZATION_TYPEHASH
constTRANSFER_WITH_AUTHORIZATION_TYPEHASH:"0x7c7c6cdb67a18743f49ec6fa9b35f50d52ed05cbed4cc592e13b44501c1a2267"
keccak256("TransferWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)")
UNORDERED_NONCE_INVALIDATION_TOPIC
constUNORDERED_NONCE_INVALIDATION_TOPIC:`0x${string}`
keccak256("UnorderedNonceInvalidation(address,uint256,uint256)"), Permit2's cancellation of a word of nonces.
UPTO_PERMIT2_PROXY
constUPTO_PERMIT2_PROXY:"0x4020A4f3b7b90ccA423B9fabCc0CE57C6C240002"
Functions
authorizationIdDigest()
authorizationIdDigest(
from,to,value):Promise<Refusal|`0x${string}`>
SHA-256 over the 72 bytes of abi.encodePacked(address from, address to, uint256 value): the identity of one
transfer, which a Transfer(from, to, value) log in the settlement transaction reproduces.
Parameters
| Parameter | Type |
|---|---|
from | `0x${string}` |
to | `0x${string}` |
value | string | bigint |
Returns
Promise<Refusal | `0x${string}`>
authorizationUsed()
authorizationUsed(
ref,authorizer,block,reader):Promise<boolean|Refusal>
Whether authorizer had used the payment's pull authorization, ref.authorization, in the state after block
block: one eth_call to authorization.at, of authorizationState(authorizer, nonce) for eip3009, or of
nonceBitmap(authorizer, nonce >> 8) for permit2, whose bit nonce & 0xff is then read. A reader for another
network than ref.network is evm/wrong-reader. A failed call, or an answer that is not one 32-byte word (for
eip3009, one holding 0 or 1), is evm/unreadable. A ref with no well-formed authorization, an authorizer that
is not an address, or a block that is not a non-negative bigint is evm/field-malformed.
Parameters
| Parameter | Type |
|---|---|
ref | Pick<EvmRef, "network" | "authorization"> |
authorizer | `0x${string}` |
block | bigint |
reader | EvmReader |
Returns
Promise<boolean | Refusal>
bindSalt()
bindSalt(
receiverAuthorizer,policy,h):Refusal|`0x${string}`
keccak256(abi.encode(SALT_BINDING_TYPEHASH, receiverAuthorizer, policy, h)).
Parameters
| Parameter | Type |
|---|---|
receiverAuthorizer | `0x${string}` |
policy | `0x${string}` |
h | `0x${string}` |
Returns
Refusal | `0x${string}`
decodePermissionContext()
decodePermissionContext(
ctx):Refusal|Delegation[]
Decodes abi.encode(Delegation[]) of at most 32 KiB, strictly: the input is a non-empty multiple of 32 bytes, every
offset and length word lies inside it at a 32-byte-aligned position, every offset is a multiple of 32, address words
carry 12 zero bytes, and there are at most 8 delegations, 16 caveats each, and 8 KiB per bytes; the padding after a
bytes value is not read. The array is returned in the input's order, leaf first. An empty array decodes to [].
Parameters
| Parameter | Type |
|---|---|
ctx | `0x${string}` |
Returns
Refusal | Delegation[]
eip3009Recover()
eip3009Recover(
input,reader):Promise<Refusal|`0x${string}`>
Recovers the hash from a settlement transaction alone: the one distinct nonce among the AuthorizationUsed logs
that the option's asset emitted in it; none is evm/no-authorization-use, and more than one evm/ambiguous. A
failed read, a reader answer that is neither null nor a receipt, or a receipt holding a log that is not an object
with a string address, an array of string topics and a string data, is evm/unreadable; no receipt (null) is
evm/not-found. A reverted transaction is evm/reverted. A revert, evm/no-authorization-use and evm/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 evm/not-final, a read to repeat: a block above the mark can be replaced by one in which the
transaction succeeds or holds other logs, and a refusal names no mark. The mark is read only for those. An input or
reader that is not an object, a reader for another network, a tx that is not a 32-byte hash, or an option whose
asset is not an address, is evm/wrong-reader, with nothing read. At most two calls.
Parameters
| Parameter | Type |
|---|---|
input | RecoverInput<`eip155:${string}`, PaymentRequirements> |
reader | EvmReader |
Returns
Promise<Refusal | `0x${string}`>
eip3009TypedData()
eip3009TypedData(
a):Refusal|Eip3009TypedData
The EIP-712 typed data for TransferWithAuthorization, with the field lists in EIP-3009's order. The domain's
verifyingContract is the token.
Parameters
| Parameter | Type |
|---|---|
a | { asset: `0x${string}`; from: `0x${string}`; name: string; network: `eip155:${string}`; nonce: `0x${string}`; to: `0x${string}`; validAfter: bigint; validBefore: bigint; value: string; version: string; } |
a.asset | `0x${string}` |
a.from | `0x${string}` |
a.name | string |
a.network | `eip155:${string}` |
a.nonce | `0x${string}` |
a.to | `0x${string}` |
a.validAfter | bigint |
a.validBefore | bigint |
a.value | string |
a.version | string |
Returns
evmStatus()
evmStatus(
ref,reader,query):Promise<EvmBreadthStatus>
Reads the named transaction, and answers as the profile read-status does for what it observed, at coverage full:
the ref names the log that carries H. The read is settled when the receipt succeeded and each log the ref names is
present, emitted by the named contract: the binding log with value in its topic or data word, and the transfer log
whose named fields hash to the digest. Where the binding log is EIP-3009's AuthorizationUsed and the transfer log
names from, the two are one authorization's, paired as eip3009Status pairs them: the transfer is the one paired
with a use of the binding's value, from its authorizer (topic 1). Where the binding log and the transfer log name one
event of one contract, as Tempo's TransferWithMemo carries the memo and the transfer together, they are one log:
the transfer counts only from a log that carries the binding. Where the binding log is the DelegationManager's
RedeemedDelegation, only a leaf's log carries it: one whose delegate (data word 1) is the redeemer (topic 2) or the
wildcard delegate, as redeemedLeafRecover reads it. The transfer's from is then that leaf's root delegator
(topic 1); two leaves of one root delegator redeemed in one transaction are read alike, so one transfer from it
counts for either. Settled carries the highest finality mark reached and the receipt's block as the position: the act
at that mark, settled at or above the finality asked for and below-mark under it. A receipt the reader does not
hold, a reverted one, a missing log, and a transfer a Tempo receive policy sent to RECEIVE_POLICY_GUARD are no act,
and with no search for H yet answer pending search-incomplete. A reader that rejects is unreadable by its error
(rejected), a reader for another network chain-mismatch, and a ref whose transaction is not a 32-byte hash, or
whose bindingLog or transferLog is present and not of the form a reference writes, a malformed reader answer, or a
query that is not one status takes, unparseable, with nothing read for a ref or a query. At most three calls.
Parameters
Returns
Promise<EvmBreadthStatus>
paymentHash()
paymentHash(
chainId,escrow,p):Refusal|`0x${string}`
The escrow's getHash: keccak256(abi.encode(chainId, escrow, keccak256(abi.encode(PAYMENT_INFO_TYPEHASH, p)))).
With payer zero it is x402's signatureNonce.
Parameters
| Parameter | Type |
|---|---|
chainId | number |
escrow | `0x${string}` |
p | PaymentInfo |
Returns
Refusal | `0x${string}`
permit2TypedData()
permit2TypedData(
a):Refusal|Permit2TypedData
Permit2's typed data under its domain (name "Permit2", no version). No witness gives PermitTransferFrom; a
witness gives PermitWitnessTransferFrom, or PermitBatchWitnessTransferFrom when permitted is an array. An empty
permitted array, one of more than 32 entries, and an array with no witness are refused evm/field-malformed. So is
a witness that is not an object; whose type is not an upper-case letter followed by up to 63 letters and digits, or
is TokenPermissions or starts with Permit; whose fields is not an array of objects with a string name and
type; or whose value is not an object.
Parameters
| Parameter | Type |
|---|---|
a | { chainId: number; deadline: bigint; nonce: bigint; permitted: { amount: bigint; token: `0x${string}`; } | readonly object[]; spender: `0x${string}`; verifyingContract?: `0x${string}`; witness?: { fields: readonly Field[]; type: string; value: {[k: string]: Json; }; }; } |
a.chainId | number |
a.deadline | bigint |
a.nonce | bigint |
a.permitted | { amount: bigint; token: `0x${string}`; } | readonly object[] |
a.spender | `0x${string}` |
a.verifyingContract? | `0x${string}` |
a.witness? | { fields: readonly Field[]; type: string; value: {[k: string]: Json; }; } |
a.witness.fields | readonly Field[] |
a.witness.type | string |
a.witness.value | {[k: string]: Json; } |
Returns
transferDigest()
transferDigest(
v):Promise<Refusal|`0x${string}`>
the core's hash over the fields present, in the order from, to, value: 20, 20 and 32 bytes, the value as a
big-endian uint256. authorizationIdDigest(from, to, value) equals transferDigest({from, to, value}).
Parameters
| Parameter | Type |
|---|---|
v | { from?: `0x${string}`; to?: `0x${string}`; value?: bigint; } |
v.from? | `0x${string}` |
v.to? | `0x${string}` |
v.value? | bigint |
Returns
Promise<Refusal | `0x${string}`>
References
EvmMark
Re-exports EvmMark
EvmQuery
Re-exports EvmQuery
Last updated on
@integraledger/lcp/discovery
The discovery document of LCP §2, served at `/.well-known/legal-context.json`: `parse` reads one, and `emit` writes one.
@integraledger/lcp/hedera
Hedera: the x402 pairings `x402/exact/hedera` (the ATR hash as the signed body memo) and `x402/exact/hedera/transfer-executor` (the hash advertised in the challenge only), with the transaction wire form and the Mirror Node settlement read.