Skip to content

fix(tron): use decimal CAIP-2 identifiers - #96

Merged
roger-gan merged 2 commits into
developfrom
fix/tron-decimal-caip2
Sep 1, 2026
Merged

fix(tron): use decimal CAIP-2 identifiers#96
roger-gan merged 2 commits into
developfrom
fix/tron-decimal-caip2

Conversation

@roger-gan

@roger-gan roger-gan commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Description

Use decimal TRON chain IDs as the canonical CAIP-2 references for Mainnet
(tron:728126428), Nile (tron:3448148188), and Shasta (tron:2494104990).
This prepares x402 for the canonical identifiers proposed in
ChainAgnostic/namespaces#170 and removes the
ambiguity between the CAIP-2 reference and TIP-712's numeric chainId.

The migration is tolerant on input and canonical on new configuration:

  • exported constants, built-in configuration, registration helpers, specs, and examples use decimal identifiers;
  • deprecated hexadecimal identifiers remain accepted by network matching, RPC, token, contract, GasFree, approval, and resource-sponsoring lookups;
  • payload/requirements verification treats equivalent decimal and hexadecimal identifiers as the same TRON network;
  • TIP-712 numeric chain IDs and deployed contract addresses are unchanged.

Breaking change

The values of TRON_MAINNET, TRON_NILE, and TRON_SHASTA change to decimal CAIP-2 identifiers.
@bankofai/x402-tron therefore has a major changeset; the core compatibility matcher has a patch
changeset. Existing hexadecimal inputs continue to work during migration.

Tests

  • pnpm --filter @bankofai/x402-tron lint:check
  • pnpm --filter @bankofai/x402-tron format:check
  • pnpm --filter @bankofai/x402-tron test — 24 files, 258 tests passed
  • pnpm --filter @bankofai/x402-tron build
  • pnpm --filter @bankofai/x402-core lint:check
  • pnpm --filter @bankofai/x402-core format:check
  • pnpm --filter @bankofai/x402-core test — 22 files, 650 tests passed
  • pnpm --filter @bankofai/x402-core build
  • pnpm --filter @bankofai/x402-evm test — 38 files, 830 tests passed
  • git diff --check origin/develop...HEAD

Branch route

  • Normal development targets develop
  • Only release_* or hotfix/* targets main

Checklist

  • I have formatted and linted my code
  • All new and existing tests pass
  • I added a Changeset for publishable package changes, or this PR does not require one

@roger-gan
roger-gan force-pushed the fix/tron-decimal-caip2 branch from 82145d2 to 42829dc Compare August 31, 2026 11:27
@roger-gan roger-gan changed the title Fix/tron decimal caip2 fix(tron): use decimal CAIP-2 identifiers Aug 31, 2026
@roger-gan
roger-gan merged commit 6e5642c into develop Sep 1, 2026
6 checks passed
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.

2 participants