{"version":3,"sources":["../../src/batch-settlement/constants.ts","../../src/batch-settlement/utils.ts","../../src/batch-settlement/errors.ts","../../src/batch-settlement/abi.ts"],"sourcesContent":["import { keccak256, toBytes } from \"viem\";\n\n/** Scheme identifier for the batch-settlement payment scheme. */\nexport const BATCH_SETTLEMENT_SCHEME = \"batch-settlement\" as const;\n\n/** Deployed address of the x402BatchSettlement contract. */\nexport const BATCH_SETTLEMENT_ADDRESS = \"0x4020074e9dF2ce1deE5A9C1b5c3f541D02a10003\" as const;\n\n/** Deployed address of the ERC3009DepositCollector contract. */\nexport const ERC3009_DEPOSIT_COLLECTOR_ADDRESS =\n  \"0x4020806089470a89826cB9fB1f4059150b550004\" as const;\n\n/** Deployed address of the Permit2DepositCollector contract. */\nexport const PERMIT2_DEPOSIT_COLLECTOR_ADDRESS =\n  \"0x4020425FAf3B746C082C2f942b4E5159887B0005\" as const;\n\n/** Minimum withdraw delay in seconds (15 minutes), matching the onchain constant. */\nexport const MIN_WITHDRAW_DELAY = 900;\n\n/** Maximum withdraw delay in seconds (30 days), matching the onchain constant. */\nexport const MAX_WITHDRAW_DELAY = 2_592_000;\n\n/** EIP-712 domain fields shared across all batch-settlement typed-data signatures. */\nexport const BATCH_SETTLEMENT_DOMAIN = {\n  name: \"x402 Batch Settlement\",\n  version: \"1\",\n} as const;\n\n/** EIP-712 type hash for channel identity. */\nexport const CHANNEL_CONFIG_TYPEHASH = keccak256(\n  toBytes(\n    \"ChannelConfig(address payer,address payerAuthorizer,address receiver,address receiverAuthorizer,address token,uint40 withdrawDelay,bytes32 salt)\",\n  ),\n);\n\n/** EIP-712 type definition for a channel configuration. */\nexport const channelConfigTypes = {\n  ChannelConfig: [\n    { name: \"payer\", type: \"address\" },\n    { name: \"payerAuthorizer\", type: \"address\" },\n    { name: \"receiver\", type: \"address\" },\n    { name: \"receiverAuthorizer\", type: \"address\" },\n    { name: \"token\", type: \"address\" },\n    { name: \"withdrawDelay\", type: \"uint40\" },\n    { name: \"salt\", type: \"bytes32\" },\n  ],\n} as const;\n\n/** EIP-712 type definition for a cumulative voucher: `Voucher(bytes32 channelId, uint128 maxClaimableAmount)`. */\nexport const voucherTypes = {\n  Voucher: [\n    { name: \"channelId\", type: \"bytes32\" },\n    { name: \"maxClaimableAmount\", type: \"uint128\" },\n  ],\n} as const;\n\n/** EIP-712 type definition for cooperative refund: `Refund(bytes32 channelId, uint256 nonce, uint128 amount)`. */\nexport const refundTypes = {\n  Refund: [\n    { name: \"channelId\", type: \"bytes32\" },\n    { name: \"nonce\", type: \"uint256\" },\n    { name: \"amount\", type: \"uint128\" },\n  ],\n} as const;\n\n/** EIP-712 type definitions for a receiver-authorizer claim batch (nested ClaimEntry). */\nexport const claimBatchTypes = {\n  ClaimBatch: [{ name: \"claims\", type: \"ClaimEntry[]\" }],\n  ClaimEntry: [\n    { name: \"channelId\", type: \"bytes32\" },\n    { name: \"maxClaimableAmount\", type: \"uint128\" },\n    { name: \"totalClaimed\", type: \"uint128\" },\n  ],\n} as const;\n\n/** EIP-712 type definition for ERC-3009 `ReceiveWithAuthorization` (used for gasless deposits). */\nexport const receiveAuthorizationTypes = {\n  ReceiveWithAuthorization: [\n    { name: \"from\", type: \"address\" },\n    { name: \"to\", type: \"address\" },\n    { name: \"value\", type: \"uint256\" },\n    { name: \"validAfter\", type: \"uint256\" },\n    { name: \"validBefore\", type: \"uint256\" },\n    { name: \"nonce\", type: \"bytes32\" },\n  ],\n} as const;\n\n/** Permit2 typed data for channel-bound batch deposits. */\nexport const batchPermit2WitnessTypes = {\n  PermitWitnessTransferFrom: [\n    { name: \"permitted\", type: \"TokenPermissions\" },\n    { name: \"spender\", type: \"address\" },\n    { name: \"nonce\", type: \"uint256\" },\n    { name: \"deadline\", type: \"uint256\" },\n    { name: \"witness\", type: \"DepositWitness\" },\n  ],\n  TokenPermissions: [\n    { name: \"token\", type: \"address\" },\n    { name: \"amount\", type: \"uint256\" },\n  ],\n  DepositWitness: [{ name: \"channelId\", type: \"bytes32\" }],\n} as const;\n","import { getAddress, hashTypedData } from \"viem\";\nimport { BATCH_SETTLEMENT_ADDRESS, BATCH_SETTLEMENT_DOMAIN, channelConfigTypes } from \"./constants\";\nimport type { ChannelConfig } from \"./types\";\nimport { getEvmChainId } from \"../utils\";\n\n/**\n * Computes the chain-bound channel id from a {@link ChannelConfig} struct.\n *\n * @param config - The immutable channel configuration.\n * @param networkOrChainId - CAIP-2 network identifier or numeric EVM chain id.\n * @returns The `bytes32` channel id as a hex string.\n */\nexport function computeChannelId(\n  config: ChannelConfig,\n  networkOrChainId: string | number,\n): `0x${string}` {\n  const chainId =\n    typeof networkOrChainId === \"number\" ? networkOrChainId : getEvmChainId(networkOrChainId);\n  return hashTypedData({\n    domain: getBatchSettlementEip712Domain(chainId),\n    types: channelConfigTypes,\n    primaryType: \"ChannelConfig\",\n    message: {\n      payer: config.payer,\n      payerAuthorizer: config.payerAuthorizer,\n      receiver: config.receiver,\n      receiverAuthorizer: config.receiverAuthorizer,\n      token: config.token,\n      withdrawDelay: config.withdrawDelay,\n      salt: config.salt,\n    },\n  });\n}\n\n/**\n * Returns the full EIP-712 domain for the batch-settlement contract on the given chain.\n *\n * @param chainId - Numeric EVM chain id.\n * @returns EIP-712 domain with `name`, `version`, `chainId`, and checksummed `verifyingContract`.\n */\nexport function getBatchSettlementEip712Domain(chainId: number) {\n  return {\n    ...BATCH_SETTLEMENT_DOMAIN,\n    chainId,\n    verifyingContract: getAddress(BATCH_SETTLEMENT_ADDRESS),\n  } as const;\n}\n","/** Error codes for the batch-settlement EVM scheme (see scheme_batch_settlement_evm2.md). */\n\nexport const ErrChannelNotFound = \"invalid_batch_settlement_evm_channel_not_found\";\nexport const ErrTokenMismatch = \"invalid_batch_settlement_evm_token_mismatch\";\nexport const ErrInvalidVoucherSignature = \"invalid_batch_settlement_evm_voucher_signature\";\nexport const ErrCumulativeExceedsBalance =\n  \"invalid_batch_settlement_evm_cumulative_exceeds_balance\";\nexport const ErrCumulativeAmountBelowClaimed =\n  \"invalid_batch_settlement_evm_cumulative_below_claimed\";\nexport const ErrInsufficientBalance = \"invalid_batch_settlement_evm_insufficient_balance\";\nexport const ErrDepositTransactionFailed =\n  \"invalid_batch_settlement_evm_deposit_transaction_failed\";\nexport const ErrClaimTransactionFailed = \"invalid_batch_settlement_evm_claim_transaction_failed\";\nexport const ErrSettleTransactionFailed = \"invalid_batch_settlement_evm_settle_transaction_failed\";\nexport const ErrInvalidScheme = \"invalid_batch_settlement_evm_scheme\";\nexport const ErrNetworkMismatch = \"invalid_batch_settlement_evm_network_mismatch\";\nexport const ErrMissingEip712Domain = \"invalid_batch_settlement_evm_missing_eip712_domain\";\nexport const ErrValidBeforeExpired =\n  \"invalid_batch_settlement_evm_payload_authorization_valid_before\";\nexport const ErrValidAfterInFuture =\n  \"invalid_batch_settlement_evm_payload_authorization_valid_after\";\nexport const ErrInvalidReceiveAuthorizationSignature =\n  \"invalid_batch_settlement_evm_receive_authorization_signature\";\nexport const ErrErc3009AuthorizationRequired =\n  \"invalid_batch_settlement_evm_erc3009_authorization_required\";\nexport const ErrRefundTransactionFailed = \"invalid_batch_settlement_evm_refund_transaction_failed\";\nexport const ErrInvalidPayloadType = \"invalid_batch_settlement_evm_payload_type\";\nexport const ErrWithdrawDelayOutOfRange =\n  \"invalid_batch_settlement_evm_withdraw_delay_out_of_range\";\nexport const ErrChannelIdMismatch = \"invalid_batch_settlement_evm_channel_id_mismatch\";\nexport const ErrReceiverMismatch = \"invalid_batch_settlement_evm_receiver_mismatch\";\nexport const ErrReceiverAuthorizerMismatch =\n  \"invalid_batch_settlement_evm_receiver_authorizer_mismatch\";\nexport const ErrWithdrawDelayMismatch = \"invalid_batch_settlement_evm_withdraw_delay_mismatch\";\nexport const ErrAuthorizerAddressMismatch =\n  \"invalid_batch_settlement_evm_authorizer_address_mismatch\";\nexport const ErrAuthorizerNotConfigured = \"invalid_batch_settlement_evm_authorizer_not_configured\";\nexport const ErrDepositSimulationFailed = \"invalid_batch_settlement_evm_deposit_simulation_failed\";\n\n// ERC-6492 counterfactual deployment errors (ERC-3009 deposit path). Wire values keep the\n// scheme prefix to match the rest of this module's contract.\nexport const ErrFactoryNotAllowed = \"invalid_batch_settlement_evm_eip6492_factory_not_allowed\";\nexport const ErrSmartWalletDeploymentFailed =\n  \"invalid_batch_settlement_evm_smart_wallet_deployment_failed\";\nexport const ErrClaimSimulationFailed = \"invalid_batch_settlement_evm_claim_simulation_failed\";\nexport const ErrSettleSimulationFailed = \"invalid_batch_settlement_evm_settle_simulation_failed\";\nexport const ErrNothingToSettle = \"invalid_batch_settlement_evm_nothing_to_settle\";\nexport const ErrRefundPayload = \"invalid_batch_settlement_evm_refund_payload\";\nexport const ErrRefundSimulationFailed = \"invalid_batch_settlement_evm_refund_simulation_failed\";\nexport const ErrRpcReadFailed = \"invalid_batch_settlement_evm_rpc_read_failed\";\nexport const ErrPermit2AuthorizationRequired =\n  \"invalid_batch_settlement_evm_permit2_authorization_required\";\nexport const ErrPermit2InvalidSpender = \"invalid_batch_settlement_evm_permit2_invalid_spender\";\nexport const ErrPermit2AmountMismatch = \"invalid_batch_settlement_evm_permit2_amount_mismatch\";\nexport const ErrPermit2DeadlineExpired = \"invalid_batch_settlement_evm_permit2_deadline_expired\";\nexport const ErrPermit2InvalidSignature = \"invalid_batch_settlement_evm_permit2_invalid_signature\";\nexport const ErrPermit2AllowanceRequired =\n  \"invalid_batch_settlement_evm_permit2_allowance_required\";\nexport const ErrEip2612AmountMismatch = \"invalid_batch_settlement_evm_eip2612_amount_mismatch\";\nexport const ErrEip2612OwnerMismatch = \"invalid_batch_settlement_evm_eip2612_owner_mismatch\";\nexport const ErrEip2612AssetMismatch = \"invalid_batch_settlement_evm_eip2612_asset_mismatch\";\nexport const ErrEip2612SpenderMismatch = \"invalid_batch_settlement_evm_eip2612_spender_mismatch\";\nexport const ErrEip2612DeadlineExpired = \"invalid_batch_settlement_evm_eip2612_deadline_expired\";\nexport const ErrErc20ApprovalUnavailable =\n  \"invalid_batch_settlement_evm_erc20_approval_unavailable\";\n\n/** Resource server: 402 `error` and lifecycle `reason` (same strings as the spec). */\nexport const ErrCumulativeAmountMismatch =\n  \"invalid_batch_settlement_evm_cumulative_amount_mismatch\";\nexport const ErrChannelBusy = \"invalid_batch_settlement_evm_channel_busy\";\nexport const ErrChargeExceedsSignedCumulative =\n  \"invalid_batch_settlement_evm_charge_exceeds_signed_cumulative\";\nexport const ErrMissingChannel = \"invalid_batch_settlement_evm_missing_channel\";\nexport const ErrRefundNoBalance = \"invalid_batch_settlement_evm_refund_no_balance\";\nexport const ErrRefundAmountInvalid = \"invalid_batch_settlement_evm_refund_amount_invalid\";\n","export const channelConfigComponents = [\n  { name: \"payer\", type: \"address\" },\n  { name: \"payerAuthorizer\", type: \"address\" },\n  { name: \"receiver\", type: \"address\" },\n  { name: \"receiverAuthorizer\", type: \"address\" },\n  { name: \"token\", type: \"address\" },\n  { name: \"withdrawDelay\", type: \"uint40\" },\n  { name: \"salt\", type: \"bytes32\" },\n] as const;\n\nconst voucherClaimComponents = [\n  {\n    name: \"voucher\",\n    type: \"tuple\",\n    components: [\n      {\n        name: \"channel\",\n        type: \"tuple\",\n        components: channelConfigComponents,\n      },\n      { name: \"maxClaimableAmount\", type: \"uint128\" },\n    ],\n  },\n  { name: \"signature\", type: \"bytes\" },\n  { name: \"totalClaimed\", type: \"uint128\" },\n] as const;\n\nexport const batchSettlementABI = [\n  {\n    type: \"function\",\n    name: \"multicall\",\n    inputs: [{ name: \"data\", type: \"bytes[]\" }],\n    outputs: [{ name: \"results\", type: \"bytes[]\" }],\n    stateMutability: \"nonpayable\",\n  },\n  {\n    type: \"function\",\n    name: \"deposit\",\n    inputs: [\n      { name: \"config\", type: \"tuple\", components: channelConfigComponents },\n      { name: \"amount\", type: \"uint128\" },\n      { name: \"collector\", type: \"address\" },\n      { name: \"collectorData\", type: \"bytes\" },\n    ],\n    outputs: [],\n    stateMutability: \"nonpayable\",\n  },\n  {\n    type: \"function\",\n    name: \"claim\",\n    inputs: [{ name: \"voucherClaims\", type: \"tuple[]\", components: voucherClaimComponents }],\n    outputs: [],\n    stateMutability: \"nonpayable\",\n  },\n  {\n    type: \"function\",\n    name: \"claimWithSignature\",\n    inputs: [\n      { name: \"voucherClaims\", type: \"tuple[]\", components: voucherClaimComponents },\n      { name: \"authorizerSignature\", type: \"bytes\" },\n    ],\n    outputs: [],\n    stateMutability: \"nonpayable\",\n  },\n  {\n    type: \"function\",\n    name: \"settle\",\n    inputs: [\n      { name: \"receiver\", type: \"address\" },\n      { name: \"token\", type: \"address\" },\n    ],\n    outputs: [],\n    stateMutability: \"nonpayable\",\n  },\n  {\n    type: \"function\",\n    name: \"initiateWithdraw\",\n    inputs: [\n      { name: \"config\", type: \"tuple\", components: channelConfigComponents },\n      { name: \"amount\", type: \"uint128\" },\n    ],\n    outputs: [],\n    stateMutability: \"nonpayable\",\n  },\n  {\n    type: \"function\",\n    name: \"finalizeWithdraw\",\n    inputs: [{ name: \"config\", type: \"tuple\", components: channelConfigComponents }],\n    outputs: [],\n    stateMutability: \"nonpayable\",\n  },\n  {\n    type: \"function\",\n    name: \"refund\",\n    inputs: [\n      { name: \"config\", type: \"tuple\", components: channelConfigComponents },\n      { name: \"amount\", type: \"uint128\" },\n    ],\n    outputs: [],\n    stateMutability: \"nonpayable\",\n  },\n  {\n    type: \"function\",\n    name: \"refundWithSignature\",\n    inputs: [\n      { name: \"config\", type: \"tuple\", components: channelConfigComponents },\n      { name: \"amount\", type: \"uint128\" },\n      { name: \"nonce\", type: \"uint256\" },\n      { name: \"receiverAuthorizerSignature\", type: \"bytes\" },\n    ],\n    outputs: [],\n    stateMutability: \"nonpayable\",\n  },\n  {\n    type: \"function\",\n    name: \"getChannelId\",\n    inputs: [{ name: \"config\", type: \"tuple\", components: channelConfigComponents }],\n    outputs: [{ name: \"\", type: \"bytes32\" }],\n    stateMutability: \"view\",\n  },\n  {\n    type: \"function\",\n    name: \"CHANNEL_CONFIG_TYPEHASH\",\n    inputs: [],\n    outputs: [{ name: \"\", type: \"bytes32\" }],\n    stateMutability: \"view\",\n  },\n  {\n    type: \"function\",\n    name: \"channels\",\n    inputs: [{ name: \"channelId\", type: \"bytes32\" }],\n    outputs: [\n      { name: \"balance\", type: \"uint128\" },\n      { name: \"totalClaimed\", type: \"uint128\" },\n    ],\n    stateMutability: \"view\",\n  },\n  {\n    type: \"function\",\n    name: \"pendingWithdrawals\",\n    inputs: [{ name: \"channelId\", type: \"bytes32\" }],\n    outputs: [\n      { name: \"amount\", type: \"uint128\" },\n      { name: \"initiatedAt\", type: \"uint40\" },\n    ],\n    stateMutability: \"view\",\n  },\n  {\n    type: \"function\",\n    name: \"receivers\",\n    inputs: [\n      { name: \"receiver\", type: \"address\" },\n      { name: \"token\", type: \"address\" },\n    ],\n    outputs: [\n      { name: \"totalClaimed\", type: \"uint128\" },\n      { name: \"totalSettled\", type: \"uint128\" },\n    ],\n    stateMutability: \"view\",\n  },\n  {\n    type: \"function\",\n    name: \"getVoucherDigest\",\n    inputs: [\n      { name: \"channelId\", type: \"bytes32\" },\n      { name: \"maxClaimableAmount\", type: \"uint128\" },\n    ],\n    outputs: [{ name: \"\", type: \"bytes32\" }],\n    stateMutability: \"view\",\n  },\n  {\n    type: \"function\",\n    name: \"getRefundDigest\",\n    inputs: [\n      { name: \"channelId\", type: \"bytes32\" },\n      { name: \"nonce\", type: \"uint256\" },\n      { name: \"amount\", type: \"uint128\" },\n    ],\n    outputs: [{ name: \"\", type: \"bytes32\" }],\n    stateMutability: \"view\",\n  },\n  {\n    type: \"function\",\n    name: \"refundNonce\",\n    inputs: [{ name: \"channelId\", type: \"bytes32\" }],\n    outputs: [{ name: \"\", type: \"uint256\" }],\n    stateMutability: \"view\",\n  },\n  {\n    type: \"function\",\n    name: \"getClaimBatchDigest\",\n    inputs: [{ name: \"voucherClaims\", type: \"tuple[]\", components: voucherClaimComponents }],\n    outputs: [{ name: \"\", type: \"bytes32\" }],\n    stateMutability: \"view\",\n  },\n  {\n    type: \"event\",\n    name: \"Settled\",\n    inputs: [\n      { name: \"receiver\", type: \"address\", indexed: true },\n      { name: \"token\", type: \"address\", indexed: true },\n      { name: \"sender\", type: \"address\", indexed: true },\n      { name: \"amount\", type: \"uint128\", indexed: false },\n    ],\n    anonymous: false,\n  },\n] as const;\n\nexport const erc20BalanceOfABI = [\n  {\n    type: \"function\",\n    name: \"balanceOf\",\n    inputs: [{ name: \"account\", type: \"address\" }],\n    outputs: [{ name: \"\", type: \"uint256\" }],\n    stateMutability: \"view\",\n  },\n] as const;\n"],"mappings":";;;;;AAAA,SAAS,WAAW,eAAe;AAG5B,IAAM,0BAA0B;AAGhC,IAAM,2BAA2B;AAGjC,IAAM,oCACX;AAGK,IAAM,oCACX;AAGK,IAAM,qBAAqB;AAG3B,IAAM,qBAAqB;AAG3B,IAAM,0BAA0B;AAAA,EACrC,MAAM;AAAA,EACN,SAAS;AACX;AAGO,IAAM,0BAA0B;AAAA,EACrC;AAAA,IACE;AAAA,EACF;AACF;AAGO,IAAM,qBAAqB;AAAA,EAChC,eAAe;AAAA,IACb,EAAE,MAAM,SAAS,MAAM,UAAU;AAAA,IACjC,EAAE,MAAM,mBAAmB,MAAM,UAAU;AAAA,IAC3C,EAAE,MAAM,YAAY,MAAM,UAAU;AAAA,IACpC,EAAE,MAAM,sBAAsB,MAAM,UAAU;AAAA,IAC9C,EAAE,MAAM,SAAS,MAAM,UAAU;AAAA,IACjC,EAAE,MAAM,iBAAiB,MAAM,SAAS;AAAA,IACxC,EAAE,MAAM,QAAQ,MAAM,UAAU;AAAA,EAClC;AACF;AAGO,IAAM,eAAe;AAAA,EAC1B,SAAS;AAAA,IACP,EAAE,MAAM,aAAa,MAAM,UAAU;AAAA,IACrC,EAAE,MAAM,sBAAsB,MAAM,UAAU;AAAA,EAChD;AACF;AAGO,IAAM,cAAc;AAAA,EACzB,QAAQ;AAAA,IACN,EAAE,MAAM,aAAa,MAAM,UAAU;AAAA,IACrC,EAAE,MAAM,SAAS,MAAM,UAAU;AAAA,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