# Changelog

## 1.1.0 — 2026-05-12

Adds x402 **batch-settlement** support. Pure-additive: every v1.0.x API still works unchanged.

### Added

- `checkChannel(channelConfig, options?)` — pre-flight trust gate for a batch-settlement channel. Verifies both `payerAuthorizer` and `receiverAuthorizer` have live Vaultfire bonds across configured chains. Returns a `ChannelTrustDecision` with a `recommendation` of `open`, `open-with-cap`, `single-payment-only`, or `decline`.
- `verifyVoucherCounterparty(payerAuthorizer, options?)` — hot-path gate for every incoming voucher. 60-second cache by default to avoid hammering RPC under a busy agent loop.
- `assertChannelTrusted(channel, options?)` / `ChannelTrustError` — throw-on-fail variant.
- `isValidWithdrawDelay(seconds)` — bounds check matching the on-chain constants.
- Constants exported from the [Cantina-audited](https://cantina.xyz/portfolio/5035772b-2800-4f00-bb62-e7994419f8dd) `x402-foundation/x402` repo @ commit `ca60063c`:
  - `BATCH_SETTLEMENT_DOMAIN` — `{ name: 'x402 Batch Settlement', version: '1' }`
  - `BATCH_SETTLEMENT_ADDRESS` — `0x4020074e9dF2ce1deE5A9C1b5c3f541D02a10003`
  - `ERC3009_DEPOSIT_COLLECTOR_ADDRESS` — `0x4020806089470a89826cB9fB1f4059150b550004`
  - `PERMIT2_DEPOSIT_COLLECTOR_ADDRESS` — `0x4020425FAf3B746C082C2f942b4E5159887B0005`
  - `MIN_WITHDRAW_DELAY_SECONDS` — `900`
  - `MAX_WITHDRAW_DELAY_SECONDS` — `2_592_000`
- Types: `ChannelConfigLike`, `ChannelTrustRecommendation`, `ChannelTrustDecision`, `VoucherCounterpartyDecision`, `CheckChannelOptions`, `VerifyVoucherCounterpartyOptions`.

### Test coverage

- 6 new tests covering the offline pure helpers AND live on-chain `checkChannel` / `verifyVoucherCounterparty` decisions against Base mainnet.
- 12/12 total tests pass (including the original 6 from v1.0.1, unchanged).

### Acknowledged audit issues (read before shipping)

1. **USDC/USDT blacklist of payer or receiver permanently traps escrow.** Cap per-channel size and use short `withdrawDelay`.
2. **Plain `refund()` invalidates pre-signed `refundWithSignature()` authorizations** (nonce collision). Don't expose `refundWithSignature` publicly without first coordinating a plain `refund()`.

## 1.0.1

Initial pre-payment trust check for single x402 payments. Multi-chain (Base / Arbitrum / Polygon / Avalanche), `wrapFetch` helper, ethers v6 RPC handling that distinguishes contract reverts from rate limits.
