Skip to main content
Faremeter API
Faremeter API / payment-evm/src / exact

exact

Type Aliases

eip712Domain

eip712Domain = typeof eip712Domain.infer
Defined in: packages/payment-evm/src/exact/constants.ts:97

x402ExactPayload

x402ExactPayload = typeof x402ExactPayload.infer
Defined in: packages/payment-evm/src/exact/constants.ts:79

Variables

EIP712_TYPES

const EIP712_TYPES: object
Defined in: packages/payment-evm/src/exact/constants.ts:64

Type declaration

TransferWithAuthorization
readonly TransferWithAuthorization: readonly [{ name: "from"; type: "address"; }, { name: "to"; type: "address"; }, { name: "value"; type: "uint256"; }, { name: "validAfter"; type: "uint256"; }, { name: "validBefore"; type: "uint256"; }, { name: "nonce"; type: "bytes32"; }]

eip712Domain

const eip712Domain: Type<{ chainId?: number; name?: string; verifyingContract?: string; version?: string; }, { }>
Defined in: packages/payment-evm/src/exact/constants.ts:97 Validator for EIP-712 domain parameters provided in payment requirements.

TRANSFER_WITH_AUTHORIZATION_ABI

const TRANSFER_WITH_AUTHORIZATION_ABI: readonly [{ inputs: readonly [{ name: "from"; type: "address"; }, { name: "to"; type: "address"; }, { name: "value"; type: "uint256"; }, { name: "validAfter"; type: "uint256"; }, { name: "validBefore"; type: "uint256"; }, { name: "nonce"; type: "bytes32"; }, { name: "v"; type: "uint8"; }, { name: "r"; type: "bytes32"; }, { name: "s"; type: "bytes32"; }]; name: "transferWithAuthorization"; outputs: readonly []; stateMutability: "nonpayable"; type: "function"; }, { inputs: readonly [{ name: "authorizer"; type: "address"; }, { name: "nonce"; type: "bytes32"; }]; name: "authorizationState"; outputs: readonly [{ name: ""; type: "bool"; }]; stateMutability: "view"; type: "function"; }, { inputs: readonly []; name: "name"; outputs: readonly [{ name: ""; type: "string"; }]; stateMutability: "view"; type: "function"; }, { inputs: readonly []; name: "version"; outputs: readonly [{ name: ""; type: "string"; }]; stateMutability: "view"; type: "function"; }, { inputs: readonly []; name: "DOMAIN_SEPARATOR"; outputs: readonly [{ name: ""; type: "bytes32"; }]; stateMutability: "view"; type: "function"; }]
Defined in: packages/payment-evm/src/exact/constants.ts:13

X402_EXACT_SCHEME

const X402_EXACT_SCHEME: "exact" = "exact"
Defined in: packages/payment-evm/src/exact/constants.ts:11

x402ExactPayload

const x402ExactPayload: Type<{ authorization: { from: (In) => Out<`0x${string}`>; nonce: (In) => Out<`0x${string}`>; to: (In) => Out<`0x${string}`>; validAfter: string; validBefore: string; value: string; }; signature: (In) => Out<`0x${string}`>; }, { }>
Defined in: packages/payment-evm/src/exact/constants.ts:79 Validator for the x402 exact payment payload containing an EIP-3009 authorization and signature.

Functions

createFacilitatorHandler()

createFacilitatorHandler(chain, privateKey, assetNameOrInfo, opts): Promise<FacilitatorHandler>
Defined in: packages/payment-evm/src/exact/facilitator.ts:70 Creates a facilitator handler for the EVM exact payment scheme. The handler verifies EIP-3009 authorization signatures and executes the transferWithAuthorization call on the token contract.

Parameters

chain
ChainInfoWithRPC Chain configuration including RPC URLs
privateKey
string Private key for signing settlement transactions
assetNameOrInfo
AssetNameOrContractInfo Asset name or contract info for the token
opts
CreateFacilitatorHandlerOpts = {} Optional configuration for network and transport

Returns

Promise<FacilitatorHandler> A FacilitatorHandler for processing EVM exact payments

createPaymentHandler()

createPaymentHandler(wallet, opts): PaymentHandler
Defined in: packages/payment-evm/src/exact/client.ts:59 Creates a payment handler for the EVM exact payment scheme. The handler generates EIP-3009 transferWithAuthorization signatures that can be executed by the facilitator to complete payments.

Parameters

wallet
WalletForPayment Wallet providing chain context and signing capabilities
opts
CreatePaymentHandlerOpts = {} Optional configuration for the asset

Returns

PaymentHandler A PaymentHandler function for use with the x402 client