@bankofai/x402-gateway 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
@@ -155,11 +155,11 @@ provider configs that say `exact_permit` are normalized to `exact`. For GasFree,
155
155
  set both `scheme` and `protocol` to `exact_gasfree`; the facilitator must support
156
156
  GasFree for the selected TRON network and token.
157
157
 
158
- Legacy network aliases remain accepted for backward compatibility, but new
159
- provider files should use canonical CAIP-2 IDs:
158
+ Non-CAIP TRON aliases are rejected. Provider files must use canonical TRON
159
+ CAIP-2 IDs.
160
+
161
+ EVM convenience aliases accepted:
160
162
 
161
- - `tron-mainnet` -> `tron:0x2b6653dc`
162
- - `tron-nile` -> `tron:0xcd8690dc`
163
163
  - `bsc-mainnet` -> `eip155:56`
164
164
  - `bsc-testnet` -> `eip155:97`
165
165
 
package/dist/tokens.js CHANGED
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bankofai/x402-gateway",
3
- "version": "1.0.1-beta.3",
3
+ "version": "1.0.1-beta.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [