@bankofai/x402-cli 1.0.1-beta.3 → 1.0.1-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -114,11 +114,10 @@ Supported built-in token registry:
114
114
  - `eip155:56` USDT
115
115
  - `eip155:97` USDT, USDC
116
116
 
117
- Legacy aliases remain accepted for backward compatibility, but new commands and
118
- configuration should use the canonical IDs above:
117
+ Non-CAIP TRON aliases are rejected. Use the canonical TRON IDs above.
118
+
119
+ EVM convenience aliases accepted:
119
120
 
120
- - `tron-mainnet` -> `tron:0x2b6653dc`
121
- - `tron-nile` -> `tron:0xcd8690dc`
122
121
  - `bsc-mainnet` -> `eip155:56`
123
122
  - `bsc-testnet` -> `eip155:97`
124
123
 
@@ -16,19 +16,25 @@ export const TOKENS = {
16
16
  },
17
17
  };
18
18
  export function normalizeNetwork(network) {
19
- return ({
19
+ const legacyTronIds = {
20
20
  "tron-mainnet": "tron:0x2b6653dc",
21
21
  "tron:mainnet": "tron:0x2b6653dc",
22
- "mainnet": "tron:0x2b6653dc",
22
+ mainnet: "tron:0x2b6653dc",
23
23
  "tron-shasta": "tron:0x94a9059e",
24
24
  "tron:shasta": "tron:0x94a9059e",
25
- "shasta": "tron:0x94a9059e",
25
+ shasta: "tron:0x94a9059e",
26
26
  "tron-nile": "tron:0xcd8690dc",
27
27
  "tron:nile": "tron:0xcd8690dc",
28
- "nile": "tron:0xcd8690dc",
28
+ nile: "tron:0xcd8690dc",
29
+ };
30
+ const canonical = legacyTronIds[network];
31
+ if (canonical) {
32
+ throw new Error(`legacy TRON network identifier ${network} is not supported; use ${canonical}`);
33
+ }
34
+ return {
29
35
  "bsc-mainnet": "eip155:56",
30
36
  "bsc-testnet": "eip155:97",
31
- }[network] ?? network);
37
+ }[network] ?? network;
32
38
  }
33
39
  export function getToken(network, symbol) {
34
40
  const normalized = normalizeNetwork(network);
package/dist/tokens.js CHANGED
@@ -74,19 +74,25 @@ export const TOKENS = {
74
74
  },
75
75
  };
76
76
  export function normalizeNetwork(network) {
77
- return ({
77
+ const legacyTronIds = {
78
78
  "tron-mainnet": "tron:0x2b6653dc",
79
79
  "tron:mainnet": "tron:0x2b6653dc",
80
- "mainnet": "tron:0x2b6653dc",
80
+ mainnet: "tron:0x2b6653dc",
81
81
  "tron-shasta": "tron:0x94a9059e",
82
82
  "tron:shasta": "tron:0x94a9059e",
83
- "shasta": "tron:0x94a9059e",
83
+ shasta: "tron:0x94a9059e",
84
84
  "tron-nile": "tron:0xcd8690dc",
85
85
  "tron:nile": "tron:0xcd8690dc",
86
- "nile": "tron:0xcd8690dc",
86
+ nile: "tron:0xcd8690dc",
87
+ };
88
+ const canonical = legacyTronIds[network];
89
+ if (canonical) {
90
+ throw new Error(`legacy TRON network identifier ${network} is not supported; use ${canonical}`);
91
+ }
92
+ return {
87
93
  "bsc-mainnet": "eip155:56",
88
94
  "bsc-testnet": "eip155:97",
89
- }[network] ?? network);
95
+ }[network] ?? network;
90
96
  }
91
97
  export function getToken(network, symbol) {
92
98
  const token = TOKENS[normalizeNetwork(network)]?.[symbol.toUpperCase()];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bankofai/x402-cli",
3
- "version": "1.0.1-beta.3",
3
+ "version": "1.0.1-beta.4",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "@bankofai/x402-core": "1.0.1-beta.4",
24
24
  "@bankofai/x402-evm": "1.0.1-beta.4",
25
- "@bankofai/x402-gateway": "1.0.1-beta.3",
25
+ "@bankofai/x402-gateway": "1.0.1-beta.4",
26
26
  "@bankofai/x402-tron": "1.0.1-beta.4",
27
27
  "tronweb": "6.4.0",
28
28
  "viem": "^2.55.0",