Skip to content

feat(x402): add X Layer (eip155:196) support for x402 payments#420

Open
imagine-yao wants to merge 3 commits into
nansen-ai:mainfrom
imagine-yao:feat/xlayer-support
Open

feat(x402): add X Layer (eip155:196) support for x402 payments#420
imagine-yao wants to merge 3 commits into
nansen-ai:mainfrom
imagine-yao:feat/xlayer-support

Conversation

@imagine-yao
Copy link
Copy Markdown

@imagine-yao imagine-yao commented Apr 24, 2026

Summary

Generalize checkX402Balance to resolve the RPC by chainId and accept the asset address from payment requirements, so USDG/USDT on X Layer trigger correct low-balance warnings instead of assuming Base USDC. asset is threaded through _x402Retry and both payment generators (local + Privy).

  • Register X Layer (eip155:196) in chain-ids.js and rpc-urls.js
  • checkX402Balance now takes chainId + asset from payment requirements
  • Pass asset through _x402Retry, local, and Privy payment paths
  • Tests: x402-xlayer.test.js, xlayer.test.js, x402-api-retry.test.js

Checklist

  • Tests pass (npm test)
  • src/schema.json updated if new commands or flags were added
  • README.md updated if new top-level commands or categories were added
  • Changeset added (.changeset/) — only required for user-facing changes
    (new commands, flags, bug fixes, breaking changes)

imagine-yao and others added 3 commits April 13, 2026 19:34
Generalize checkX402Balance to resolve RPC by chainId and accept
asset address from payment requirements, so USDG/USDT on X Layer
trigger correct low-balance warnings. Thread asset through
_x402Retry and both payment generators (local + Privy).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant