export { E as ExactEvmScheme } from './scheme-B1TCGcAi.js'; import { F as FacilitatorEvmSigner } from './signer-m5yRWbVQ.js'; export { C as ClientEvmSigner, t as toClientEvmSigner, a as toFacilitatorEvmSigner } from './signer-m5yRWbVQ.js'; export { P as Permit2AllowanceParams, c as createPermit2ApprovalTx, g as getPermit2AllowanceReadParams } from './permit2-ClggjaRg.js'; export { P as PERMIT2_ADDRESS, b as authorizationTypes, c as eip3009ABI, e as erc20AllowanceAbi, p as permit2WitnessTypes, u as uptoPermit2WitnessTypes, x as x402ExactPermit2ProxyABI, d as x402ExactPermit2ProxyAddress, f as x402UptoPermit2ProxyABI, h as x402UptoPermit2ProxyAddress } from './constants-BOdyCd_Z.js'; import { A as AssetTransferMethod } from './types-jUmTMbYs.js'; export { E as ExactEIP3009Payload, a as ExactEvmPayloadV1, b as ExactEvmPayloadV2, c as ExactPermit2Payload, P as Permit2Authorization, d as Permit2Witness, U as UptoPermit2Authorization, e as UptoPermit2Payload, f as UptoPermit2Witness, i as isEIP3009Payload, g as isPermit2Payload, h as isUptoPermit2Payload } from './types-jUmTMbYs.js'; export { UptoEvmScheme } from './upto/client/index.js'; export { e as BatchSettlementEvmScheme } from './scheme-CB2-kHB4.js'; export { A as AuthorizerSigner, e as BatchSettlementClaimPayload, f as BatchSettlementDepositPayload, g as BatchSettlementEnrichedRefundPayload, h as BatchSettlementErc3009Authorization, i as BatchSettlementFacilitatorSettlePayload, j as BatchSettlementPayload, k as BatchSettlementPaymentRequirementsExtra, l as BatchSettlementPaymentResponseExtra, m as BatchSettlementRefundPayload, n as BatchSettlementSettlePayload, B as BatchSettlementVoucherClaim, b as BatchSettlementVoucherFields, o as BatchSettlementVoucherPayload, C as ChannelConfig, p as ChannelState, q as isBatchSettlementClaimPayload, r as isBatchSettlementDepositPayload, s as isBatchSettlementEnrichedRefundPayload, t as isBatchSettlementRefundPayload, u as isBatchSettlementSettlePayload, v as isBatchSettlementVoucherPayload } from './types-DfRtdFYJ.js'; export { D as DEFAULT_ASSETS, a as DefaultAssetInfo, E as ExactDefaultAssetInfo, f as findDefaultAsset, g as getDefaultAsset } from './defaultAssets-DyTlDVvA.js'; import { TypedDataDomain, Hex } from 'viem'; import { FacilitatorExtension, PaymentPayload, PaymentRequirements, FacilitatorContext } from '@bankofai/x402-core/types'; export { AuthCaptureEvmScheme } from './auth-capture/client/index.js'; import './rpc-BBJ9foT3.js'; import './storage-6W5MO46W.js'; /** Scheme identifier for the batch-settlement payment scheme. */ declare const BATCH_SETTLEMENT_SCHEME: "batch-settlement"; /** Deployed address of the x402BatchSettlement contract. */ declare const BATCH_SETTLEMENT_ADDRESS: "0x4020074e9dF2ce1deE5A9C1b5c3f541D02a10003"; /** Deployed address of the ERC3009DepositCollector contract. */ declare const ERC3009_DEPOSIT_COLLECTOR_ADDRESS: "0x4020806089470a89826cB9fB1f4059150b550004"; /** EIP-712 domain fields shared across all batch-settlement typed-data signatures. */ declare const BATCH_SETTLEMENT_DOMAIN: { readonly name: "x402 Batch Settlement"; readonly version: "1"; }; /** EIP-712 type definition for a cumulative voucher: `Voucher(bytes32 channelId, uint128 maxClaimableAmount)`. */ declare const voucherTypes: { readonly Voucher: readonly [{ readonly name: "channelId"; readonly type: "bytes32"; }, { readonly name: "maxClaimableAmount"; readonly type: "uint128"; }]; }; /** EIP-712 type definition for cooperative refund: `Refund(bytes32 channelId, uint256 nonce, uint128 amount)`. */ declare const refundTypes: { readonly Refund: readonly [{ readonly name: "channelId"; readonly type: "bytes32"; }, { readonly name: "nonce"; readonly type: "uint256"; }, { readonly name: "amount"; readonly type: "uint128"; }]; }; /** EIP-712 type definitions for a receiver-authorizer claim batch (nested ClaimEntry). */ declare const claimBatchTypes: { readonly ClaimBatch: readonly [{ readonly name: "claims"; readonly type: "ClaimEntry[]"; }]; readonly ClaimEntry: readonly [{ readonly name: "channelId"; readonly type: "bytes32"; }, { readonly name: "maxClaimableAmount"; readonly type: "uint128"; }, { readonly name: "totalClaimed"; readonly type: "uint128"; }]; }; /** * Detection utilities for the ERC-7702 delegation designation (`0xef0100 + 20-byte address`). * * NOTE: These helpers are diagnostic only. The signature-verification path does * not branch on 7702 detection — it routes by `code.length` (matching on-chain * SignatureChecker) and the delegate decides via `isValidSignature`. See * {@link ./verifySignature.ts} for the verification primitive. * * Use these helpers for telemetry, logging, or surfacing wallet types in UIs. */ /** * Returns `true` if `bytecode` is a valid ERC-7702 delegation designation. * * The check is case-insensitive — `eth_getCode` casing is not normalized at the * JSON-RPC layer, so callers using ethers, custom signers, or post-processed * hex can pass uppercase variants. * * @param bytecode - Raw hex bytecode returned by `eth_getCode`. * @returns `true` if the bytecode is an ERC-7702 delegation designation. */ declare function isERC7702Delegation(bytecode: `0x${string}` | undefined | null): boolean; /** * Extracts the 20-byte delegate address from a 7702 delegation designation. * Returns the address in **lowercase** hex with a `0x` prefix. * The Go equivalent ({@link GetERC7702DelegateAddress}) returns a checksummed EIP-55 address. * The Python equivalent returns lowercase hex. Normalise with `getAddress()` when comparing * cross-SDK outputs or storing in a case-sensitive index. * Returns `null` for non-7702 bytecode. * * @param bytecode - Raw hex bytecode returned by `eth_getCode`. * @returns The lowercase `0x`-prefixed delegate address, or `null` if `bytecode` is not a 7702 designation. */ declare function getERC7702DelegateAddress(bytecode: `0x${string}` | undefined | null): `0x${string}` | null; /** * Parsed ERC-6492 classification for a payer address. * * `isCounterfactual` is true when the payment comes from an undeployed smart wallet * (ERC-6492 wrapper present, no bytecode at the payer address yet). In this case * pre-verification of the signature is deferred to on-chain simulation or settle. */ type Erc6492Classification = { isCounterfactual: boolean; isDeployedAtPayer: boolean; hasDeploymentInfo: boolean; innerSignature: `0x${string}`; eip6492Deployment?: { factoryAddress: `0x${string}`; factoryCalldata: `0x${string}`; }; }; /** * Classify an ERC-6492 payer in one RPC round-trip: parse the sig wrapper, fetch code, * and determine counterfactual vs deployed state. * * @param signer - Facilitator signer used to call `eth_getCode` on the payer address. * @param signature - The full signature, which may be an ERC-6492 wrapper. * @param payerAddress - The address whose bytecode is fetched to detect deployment state. * @returns Classification result including counterfactual flag, deployment state, and inner signature. */ declare function classifyErc6492Payer(signer: FacilitatorEvmSigner, signature: `0x${string}`, payerAddress: `0x${string}`): Promise; /** * Verify a typed-data signature using strict on-chain SignatureChecker semantics. * * @param signer - Facilitator signer used for `eth_getCode` and `isValidSignature` calls. * @param params - Typed-data verification parameters. * @param params.address - The address that is expected to have signed the data. * @param params.domain - EIP-712 domain. * @param params.types - EIP-712 type definitions. * @param params.primaryType - The primary type to hash. * @param params.message - The typed-data message. * @param params.signature - The signature to verify. * @returns `true` if the signature is valid, `false` otherwise. */ declare function verifyTypedDataSignature(signer: FacilitatorEvmSigner, params: { address: `0x${string}`; domain: TypedDataDomain; types: Record; primaryType: string; message: Record; signature: `0x${string}`; }): Promise; /** * Lower-level variant of {@link verifyTypedDataSignature} for callers that already have the digest. * * @param signer - Facilitator signer used for `eth_getCode` and `isValidSignature` calls. * @param address - The address that is expected to have produced the signature. * @param digest - The EIP-191 / EIP-712 message hash to verify against. * @param signature - The signature to verify. * @returns `true` if the signature is valid, `false` otherwise. */ declare function verifyHashSignature(signer: FacilitatorEvmSigner, address: `0x${string}`, digest: `0x${string}`, signature: `0x${string}`): Promise; /** * Like {@link verifyHashSignature} but accepts pre-fetched bytecode to avoid a * redundant `eth_getCode` RPC when the caller already has it (e.g. after the * ERC-6492 counterfactual check in {@link classifyErc6492Payer}). * * Pass `undefined` or `"0x"` for `code` to take the EOA (ecrecover) path. * * @param signer - Facilitator signer used for `isValidSignature` calls on deployed contracts. * @param address - The address that is expected to have produced the signature. * @param code - Pre-fetched bytecode at `address`; `undefined` or `"0x"` takes the ECDSA path. * @param digest - The message hash to verify against. * @param signature - The signature to verify. * @returns `true` if the signature is valid, `false` otherwise. */ declare function verifyHashSignatureWithCode(signer: FacilitatorEvmSigner, address: `0x${string}`, code: `0x${string}` | undefined, digest: `0x${string}`, signature: `0x${string}`): Promise; declare const BUILDER_CODE_KEY: "builder-code"; interface DataSuffixContext { paymentPayload: PaymentPayload; paymentRequirements: PaymentRequirements; } interface BuilderCodeFacilitatorExtension extends FacilitatorExtension { key: typeof BUILDER_CODE_KEY; buildDataSuffix?(ctx: DataSuffixContext): Hex | undefined | Promise; } /** * Resolves and concatenates data suffixes from registered extensions. * * @param context - Facilitator context with registered extensions * @param ctx - Data suffix context passed to extension resolvers * @returns Hex-encoded suffix to append to settlement calldata, or undefined if none */ declare function resolveDataSuffix(context: FacilitatorContext | undefined, ctx: DataSuffixContext): Promise; /** * Appends a hex data suffix to encoded contract calldata. * * @param calldata - Base encoded function calldata * @param suffix - Optional hex suffix (with or without 0x prefix) * @returns Calldata with suffix appended, or the original calldata when suffix is empty */ declare function appendDataSuffix(calldata: Hex, suffix?: Hex): Hex; /** * auth-capture wire-format types. * * Spec-level field names (captureAuthorizer, captureDeadline, refundDeadline, * feeRecipient) live here at the extra/wire layer. The on-chain PaymentInfo * struct keeps the canonical Solidity field names (operator, authorizationExpiry, * refundExpiry, feeReceiver) so the EIP-712 typehash stays byte-identical with * the AuthCaptureEscrow contract. * * Salt is NOT in extra. It is generated client-side per signing call and rides * on the payload alongside the signature. */ interface AuthCaptureExtra { captureAuthorizer: `0x${string}`; captureDeadline: number; refundDeadline: number; feeRecipient: `0x${string}`; minFeeBps: number; maxFeeBps: number; name: string; version: string; autoCapture?: boolean; assetTransferMethod?: AssetTransferMethod; } /** * Type guard for AuthCaptureExtra. Checks the structural shape an auth-capture * scheme requires inside `PaymentRequirements.extra`: every spec-mandated * required field present with the right primitive type. * * @param value - Candidate object from `requirements.extra`. * @returns True if `value` has every required AuthCaptureExtra field. */ declare function isAuthCaptureExtra(value: unknown): value is AuthCaptureExtra; interface Eip3009Payload { authorization: { from: `0x${string}`; to: `0x${string}`; value: string; validAfter: string; validBefore: string; nonce: `0x${string}`; }; signature: `0x${string}`; salt: `0x${string}`; } interface Permit2Payload { permit2Authorization: { from: `0x${string}`; permitted: { token: `0x${string}`; amount: string; }; spender: `0x${string}`; nonce: string; deadline: string; }; signature: `0x${string}`; salt: `0x${string}`; } type AuthCapturePayload = Eip3009Payload | Permit2Payload; /** * Type guard for any auth-capture payload. Returns true if `value` matches * either the EIP-3009 envelope or the Permit2 envelope. * * @param value - Candidate payment payload from the wire. * @returns True if `value` is a valid auth-capture envelope of either shape. */ declare function isAuthCapturePayload(value: unknown): value is AuthCapturePayload; /** * On-chain PaymentInfo struct (canonical Solidity names — DO NOT RENAME). * Reconstructed by the facilitator from extra + payload.salt + payer + receiver/asset/amount. */ interface PaymentInfoStruct { operator: `0x${string}`; payer: `0x${string}`; receiver: `0x${string}`; token: `0x${string}`; maxAmount: string; preApprovalExpiry: number; authorizationExpiry: number; refundExpiry: number; minFeeBps: number; maxFeeBps: number; feeReceiver: `0x${string}`; salt: `0x${string}`; } declare const AUTH_CAPTURE_SCHEME: "auth-capture"; declare const AUTH_CAPTURE_ESCROW_ADDRESS: "0xBdEA0D1bcC5966192B070Fdf62aB4EF5b4420cff"; declare const EIP3009_TOKEN_COLLECTOR_ADDRESS: "0x0E3dF9510de65469C4518D7843919c0b8C7A7757"; declare const PERMIT2_TOKEN_COLLECTOR_ADDRESS: "0x992476B9Ee81d52a5BdA0622C333938D0Af0aB26"; export { AUTH_CAPTURE_ESCROW_ADDRESS, AUTH_CAPTURE_SCHEME, AssetTransferMethod, type Eip3009Payload as AuthCaptureEip3009Payload, type AuthCaptureExtra, type AuthCapturePayload, type PaymentInfoStruct as AuthCapturePaymentInfo, type Permit2Payload as AuthCapturePermit2Payload, BATCH_SETTLEMENT_ADDRESS, BATCH_SETTLEMENT_DOMAIN, BATCH_SETTLEMENT_SCHEME, BUILDER_CODE_KEY, type BuilderCodeFacilitatorExtension, type DataSuffixContext, EIP3009_TOKEN_COLLECTOR_ADDRESS, ERC3009_DEPOSIT_COLLECTOR_ADDRESS, type Erc6492Classification, FacilitatorEvmSigner, PERMIT2_TOKEN_COLLECTOR_ADDRESS, appendDataSuffix, claimBatchTypes, classifyErc6492Payer, getERC7702DelegateAddress, isAuthCaptureExtra, isAuthCapturePayload, isERC7702Delegation, refundTypes, resolveDataSuffix, verifyHashSignature, verifyHashSignatureWithCode, verifyTypedDataSignature, voucherTypes };