Skip to content
Integra Protocol
API

@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
ParameterType
kind"history" | "transport" | "timeout" | "too-large" | "malformed"
message?string
Returns

ReaderError

Overrides

Error.constructor

Properties

PropertyModifierTypeDescriptionInherited from
cause?publicunknown-Error.cause
kindreadonly"history" | "transport" | "timeout" | "too-large" | "malformed"--
messagepublicstring-Error.message
namepublicstring-Error.name
stack?publicstring-Error.stack
stackTraceLimitstaticnumberThe 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()

static captureStackTrace(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
ParameterType
targetObjectobject
constructorOpt?Function
Returns

void

Inherited from

Error.captureStackTrace

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Parameters
ParameterType
errError
stackTracesCallSite[]
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

PropertyModifierTypeDescriptionInherited from
assetreadonly`0x${string}`--
escrowreadonly`0x${string}`The escrow deployment and the event of the option's flow.-
eventreadonly`0x${string}`--
expiryreadonlystringpreApprovalExpiry, in decimal.-
hreadonly`0x${string}`-X402EvmRefBase.h
networkreadonly`eip155:${string}`-X402EvmRefBase.network
payeereadonlystring-X402EvmRefBase.payee
payerreadonly`0x${string}`The escrow's PaymentInfo.payer, the token authorization's signer.-
paymentIdreadonly`0x${string}`The escrow's payment hash of the presented PaymentInfo, and that hash with payer zero, the signed nonce.-
saltreadonly`0x${string}`PaymentInfo.salt: H, or the commitment to the receiver authorizer, the policy and H.-
schemereadonly"permit2" | "eip3009"--
signatureNoncereadonly`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

PropertyModifierTypeDescriptionInherited from
amountreadonlystring--
assetreadonly`0x${string}`The channel's token.-
channelreadonly`0x${string}`The channel id, and the config's other members.-
hreadonly`0x${string}`-X402EvmRefBase.h
networkreadonly`eip155:${string}`-X402EvmRefBase.network
noncereadonly`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.-
payeereadonlystring-X402EvmRefBase.payee
payerreadonly`0x${string}`The channel's payer, the deposit authorization's signer.-
payerAuthorizerreadonly`0x${string}`--
receiverreadonly`0x${string}`--
receiverAuthorizerreadonly`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.-
saltreadonly`0x${string}`--
schemereadonly"permit2" | "eip3009"--
settleByreadonlystringThe 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
withdrawDelayreadonlynumber--

Delegation

Properties

PropertyType
authority`0x${string}`
caveatsobject[]
delegate`0x${string}`
delegator`0x${string}`
salt`0x${string}`
signature`0x${string}`

Eip3009Ref

The reference the exact EIP-3009 read takes.

Extends

Properties

PropertyModifierTypeDescriptionInherited from
assetreadonly`0x${string}`The token under whose domain the authorization is signed, the option's asset.-
hreadonly`0x${string}`-X402EvmRefBase.h
networkreadonly`eip155:${string}`-X402EvmRefBase.network
payeereadonlystring-X402EvmRefBase.payee
payerreadonly`0x${string}`The authorization's from, the signer of H.-
presentedreadonlySignedThe 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
validBeforereadonlystringThe authorization's validBefore, in decimal: the lapse's deadline, no member compared.-

Eip3009TypedData

Properties

PropertyType
domainobject
domain.chainIdnumber
domain.namestring
domain.verifyingContract`0x${string}`
domain.versionstring
messageobject
message.from`0x${string}`
message.nonce`0x${string}`
message.to`0x${string}`
message.validAfterbigint
message.validBeforebigint
message.valuebigint
primaryType"TransferWithAuthorization"
typesobject
types.EIP712DomainField[]
types.TransferWithAuthorizationField[]

Erc7710Ref

The reference the ERC-7710 reads take.

Extends

Properties

PropertyModifierTypeDescriptionInherited from
assetreadonly`0x${string}`--
hreadonly`0x${string}`-X402EvmRefBase.h
networkreadonly`eip155:${string}`-X402EvmRefBase.network
payeereadonlystring-X402EvmRefBase.payee
payerreadonly`0x${string}`The payment's delegator: at the salt level the root delegator, whose account the transfer comes from.-
presented?readonlyReadonly<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

PropertyType
address`0x${string}`
data`0x${string}`
topicsreadonly `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

PropertyModifierType
networkreadonly`eip155:${string}` | HederaNetwork

Methods

block()?

optional block(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
ParameterType
atbigint | "safe" | "finalized" | "latest"
Returns

Promise<{ number: bigint; timestamp: bigint; }>

blockNumber()

blockNumber(tag): Promise<bigint>

eth_getBlockByNumber(tag, false).number.

Parameters
ParameterType
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
ParameterType
to`0x${string}`
data`0x${string}`
blockbigint
Returns

Promise<`0x${string}`>

logs()?

optional logs(filter): Promise<readonly EvmLogEntry[]>

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
ParameterType
filter{ address?: `0x${string}`; fromBlock: bigint; toBlock: bigint; topics: readonly (`0x${string}` | null)[]; }
filter.address?`0x${string}`
filter.fromBlockbigint
filter.toBlockbigint
filter.topicsreadonly (`0x${string}` | null)[]
Returns

Promise<readonly EvmLogEntry[]>

receipt()

receipt(tx): Promise<EvmReceipt | null>

eth_getTransactionReceipt; null when the node holds none.

Parameters
ParameterType
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
ParameterType
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

PropertyModifierTypeDescription
networkreadonly`eip155:${string}`-
payeereadonlystring-
transaction?readonly`0x${string}`A transaction a settler or the caller named, read beside the search; never needed.

EvmReceipt

Properties

PropertyType
blockNumberbigint
logsreadonly EvmLog[]
status0 | 1

EvmRef

The read keys for a later settlement read of an EVM payment, and nothing else.

Extended by

Properties

PropertyTypeDescription
authorization?PullAuthorizationThe 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-
payeestringThe option's payee, which reference takes from the option the payment answers.
search?objectThe log filter that finds the transaction when none is named; absent, only a named transaction is read.
search.address`0x${string}`-
search.topicsreadonly (`0x${string}` | null)[]-
settleBy?stringDecimal Unix seconds after which the payment can no longer execute.
transferLog?TransferLogThe 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

PropertyType
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

PropertyType
asset`0x${string}`
network`eip155:${string}`
payeestring
transaction`0x${string}`

Field

Properties

PropertyType
namestring
typestring

PaymentInfo

Properties

PropertyType
authorizationExpirybigint
feeReceiver`0x${string}`
maxAmountbigint
maxFeeBpsnumber
minFeeBpsnumber
operator`0x${string}`
payer`0x${string}`
preApprovalExpirybigint
receiver`0x${string}`
refundExpirybigint
salt`0x${string}`
token`0x${string}`

Permit2Ref

The reference the Permit2 reads take.

Extends

Properties

PropertyModifierTypeDescriptionInherited from
assetreadonly`0x${string}`--
deadlinereadonlystringThe permit's deadline, in decimal.-
hreadonly`0x${string}`-X402EvmRefBase.h
networkreadonly`eip155:${string}`-X402EvmRefBase.network
payeereadonlystring-X402EvmRefBase.payee
payerreadonly`0x${string}`The permit's owner, the signer of H.-
presentedreadonlySignedThe 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

PropertyType
domainobject
domain.chainIdnumber
domain.name"Permit2"
domain.verifyingContract`0x${string}`
messageobject
message.deadlinebigint
message.noncebigint
message.permitted{ amount: bigint; token: `0x${string}`; } | object[]
message.spender`0x${string}`
message.witness?object
primaryType"PermitTransferFrom" | "PermitWitnessTransferFrom" | "PermitBatchWitnessTransferFrom"
typesobject
types.EIP712DomainField[]
types.TokenPermissionsField[]

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 token at answers authorizationState(authorizer, nonce), true once the authorization is used. It executes only in a block whose timestamp is below deadline (EIP-3009's validBefore).
  • permit2: the Permit2 deployment at answers nonceBitmap(authorizer, nonce >> 8), whose bit nonce & 0xff is set once the nonce is used. The permit executes only in a block whose timestamp is at most deadline.

Properties

PropertyTypeDescription
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.
deadlinestringThe 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

PropertyType
address`0x${string}`
digest`0x${string}`
identityTransferIdentity
topic0`0x${string}`

X402EvmRefBase

The reference every x402 eip155 read takes: EvmReadRefBase and H.

Extends

Extended by

Properties

PropertyModifierTypeDescriptionInherited from
hreadonly`0x${string}`--
networkreadonly`eip155:${string}`-EvmReadRefBase.network
payeereadonlystring-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

NameType
blockNumberbigint
logIndexnumber
transactionHashHex

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

const AUTHORIZATION_CANCELED_TOPIC: `0x${string}`

keccak256("AuthorizationCanceled(address,bytes32)")


AUTHORIZATION_STATE_SELECTOR

const AUTHORIZATION_STATE_SELECTOR: "0xe94a0102"

keccak256("authorizationState(address,bytes32)")[0..4]


AUTHORIZATION_USED_TOPIC

const AUTHORIZATION_USED_TOPIC: "0x98de503528ee59b575ef0c0a2576a82497bfc029a5685b209e9ec333479b10a5"

keccak256("AuthorizationUsed(address,bytes32)")


DELEGATION_MANAGER

const DELEGATION_MANAGER: "0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3"

MetaMask's reference DelegationManager, v1.3.0, at one CREATE2 address.


DELEGATION_MANAGER_CHAINS

const DELEGATION_MANAGER_CHAINS: readonly number[]

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

const eip3009Status: (ref, reader, query) => Promise<StatusAnswer<bigint, EvmMark>>

status of x402/exact/eip155/eip3009.

Parameters

ParameterType
refEip3009Ref
readerEvmReader
queryEvmQuery<unknown>

Returns

Promise<StatusAnswer<bigint, EvmMark>>


ESCROW

const ESCROW: { 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

const EXACT_PERMIT2_PROXY: "0x402085c248EeA27D92E8b30b2C58ed07f9E20001"


MAX_SEARCH_PAGES

const MAX_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

const NONCE_BITMAP_SELECTOR: "0x4fe02b44"

keccak256("nonceBitmap(address,uint256)")[0..4]


PAYMENT_AUTHORIZED_TOPIC

const PAYMENT_AUTHORIZED_TOPIC: "0x1c81fb2e3bab27f6bb09bee9a0dddf61600b7cbaf2c12683e4864e0cbdb9d284"


PAYMENT_INFO_TYPEHASH

const PAYMENT_INFO_TYPEHASH: "0xae68ac7ce30c86ece8196b61a7c486d8f0061f575037fbd34e7fe4e2820c6591"


PERMIT2

const PERMIT2: "0x000000000022D473030F116dDEE9F6B43aC78BA3"


REDEEMED_DELEGATION_TOPIC

const REDEEMED_DELEGATION_TOPIC: "0x40dadaa36c6c2e3d7317e24757451ffb2d603d875f0ad5e92c5dd156573b1873"


SALT_BINDING_TYPEHASH

const SALT_BINDING_TYPEHASH: "0x8a2a7e41a0bda000ded071ff38b79401d2603e1826516ff2635b11fe9e30877f"


SEARCH_PAGE_BLOCKS

const SEARCH_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

const TRANSFER_TOPIC: "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"

keccak256("Transfer(address,address,uint256)")


TRANSFER_WITH_AUTHORIZATION_TYPEHASH

const TRANSFER_WITH_AUTHORIZATION_TYPEHASH: "0x7c7c6cdb67a18743f49ec6fa9b35f50d52ed05cbed4cc592e13b44501c1a2267"

keccak256("TransferWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)")


UNORDERED_NONCE_INVALIDATION_TOPIC

const UNORDERED_NONCE_INVALIDATION_TOPIC: `0x${string}`

keccak256("UnorderedNonceInvalidation(address,uint256,uint256)"), Permit2's cancellation of a word of nonces.


UPTO_PERMIT2_PROXY

const UPTO_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

ParameterType
from`0x${string}`
to`0x${string}`
valuestring | 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

ParameterType
refPick<EvmRef, "network" | "authorization">
authorizer`0x${string}`
blockbigint
readerEvmReader

Returns

Promise<boolean | Refusal>


bindSalt()

bindSalt(receiverAuthorizer, policy, h): Refusal | `0x${string}`

keccak256(abi.encode(SALT_BINDING_TYPEHASH, receiverAuthorizer, policy, h)).

Parameters

ParameterType
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

ParameterType
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

ParameterType
inputRecoverInput<`eip155:${string}`, PaymentRequirements>
readerEvmReader

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

ParameterType
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.namestring
a.network`eip155:${string}`
a.nonce`0x${string}`
a.to`0x${string}`
a.validAfterbigint
a.validBeforebigint
a.valuestring
a.versionstring

Returns

Refusal | Eip3009TypedData


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

ParameterType
refEvmRef & object
readerEvmReader
queryEvmQuery<EvmRef & object>

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

ParameterType
chainIdnumber
escrow`0x${string}`
pPaymentInfo

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

ParameterType
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.chainIdnumber
a.deadlinebigint
a.noncebigint
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.fieldsreadonly Field[]
a.witness.typestring
a.witness.value{[k: string]: Json; }

Returns

Refusal | Permit2TypedData


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

ParameterType
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

On this page

ClassesReaderErrorExtendsConstructorsConstructorParametersReturnsOverridesPropertiesMethodscaptureStackTrace()ParametersReturnsInherited fromprepareStackTrace()ParametersReturnsSeeInherited fromInterfacesAuthCaptureRefExtendsPropertiesBatchEvmRefExtendsPropertiesDelegationPropertiesEip3009RefExtendsPropertiesEip3009TypedDataPropertiesErc7710RefExtendsPropertiesEvmLogExtended byPropertiesEvmReaderExtended byPropertiesMethodsblock()?ParametersReturnsblockNumber()ParametersReturnscall()ParametersReturnslogs()?ParametersReturnsreceipt()ParametersReturnstransaction()ParametersReturnsEvmReadRefBaseExtended byPropertiesEvmReceiptPropertiesEvmRefExtended byPropertiesEvmTransactionPropertiesEvmTxRefPropertiesFieldPropertiesPaymentInfoPropertiesPermit2RefExtendsPropertiesPermit2TypedDataPropertiesPullAuthorizationPropertiesTransferLogPropertiesX402EvmRefBaseExtendsExtended byPropertiesType AliasesEip155EvmBreadthStatusEvmLogEntryType DeclarationEvmStatusHederaNetworkHexSignedTransferIdentityVariablesAUTHORIZATION_CANCELED_TOPICAUTHORIZATION_STATE_SELECTORAUTHORIZATION_USED_TOPICDELEGATION_MANAGERDELEGATION_MANAGER_CHAINSeip3009StatusParametersReturnsESCROWEXACT_PERMIT2_PROXYMAX_SEARCH_PAGESNONCE_BITMAP_SELECTORPAYMENT_AUTHORIZED_TOPICPAYMENT_INFO_TYPEHASHPERMIT2REDEEMED_DELEGATION_TOPICSALT_BINDING_TYPEHASHSEARCH_PAGE_BLOCKSTRANSFER_TOPICTRANSFER_WITH_AUTHORIZATION_TYPEHASHUNORDERED_NONCE_INVALIDATION_TOPICUPTO_PERMIT2_PROXYFunctionsauthorizationIdDigest()ParametersReturnsauthorizationUsed()ParametersReturnsbindSalt()ParametersReturnsdecodePermissionContext()ParametersReturnseip3009Recover()ParametersReturnseip3009TypedData()ParametersReturnsevmStatus()ParametersReturnspaymentHash()ParametersReturnspermit2TypedData()ParametersReturnstransferDigest()ParametersReturnsReferencesEvmMarkEvmQuery