@bankofai/x402-cli 1.0.1-beta.2 → 1.0.1-beta.3
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 +15 -14
- package/dist/cli.js +4 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
TypeScript command-line client for BankofAI x402 payments. This version uses
|
|
4
4
|
the npm TypeScript SDK packages only:
|
|
5
5
|
|
|
6
|
-
- `@bankofai/x402-core@1.0.1-beta.
|
|
7
|
-
- `@bankofai/x402-evm@1.0.1-beta.
|
|
8
|
-
- `@bankofai/x402-tron@1.0.1-beta.
|
|
6
|
+
- `@bankofai/x402-core@1.0.1-beta.4`
|
|
7
|
+
- `@bankofai/x402-evm@1.0.1-beta.4`
|
|
8
|
+
- `@bankofai/x402-tron@1.0.1-beta.4`
|
|
9
9
|
|
|
10
10
|
Stablecoin payments support `scheme=exact` and TRON `scheme=exact_gasfree`.
|
|
11
11
|
The GasFree flow lets the relayer pay network energy while deducting its fee
|
|
@@ -21,7 +21,7 @@ npm run build
|
|
|
21
21
|
Run from source during development:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
npm run dev -- serve --pay-to <recipient> --amount 0.0001 --network tron:
|
|
24
|
+
npm run dev -- serve --pay-to <recipient> --amount 0.0001 --network tron:0xcd8690dc --token USDT
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
Run the compiled CLI:
|
|
@@ -52,7 +52,7 @@ Start a local x402 paywall endpoint:
|
|
|
52
52
|
node dist/cli.js serve \
|
|
53
53
|
--pay-to <recipient> \
|
|
54
54
|
--amount 0.0001 \
|
|
55
|
-
--network tron:
|
|
55
|
+
--network tron:0xcd8690dc \
|
|
56
56
|
--token USDT \
|
|
57
57
|
--port 4020
|
|
58
58
|
```
|
|
@@ -71,7 +71,7 @@ Pay an x402-protected URL:
|
|
|
71
71
|
```bash
|
|
72
72
|
TRON_PRIVATE_KEY=<hex> \
|
|
73
73
|
node dist/cli.js pay http://127.0.0.1:4020/pay \
|
|
74
|
-
--network tron:
|
|
74
|
+
--network tron:0xcd8690dc \
|
|
75
75
|
--token USDT
|
|
76
76
|
```
|
|
77
77
|
|
|
@@ -81,7 +81,7 @@ the server challenge):
|
|
|
81
81
|
```bash
|
|
82
82
|
TRON_PRIVATE_KEY=<hex> \
|
|
83
83
|
node dist/cli.js pay https://api.example.com/pay \
|
|
84
|
-
--network tron:
|
|
84
|
+
--network tron:0xcd8690dc \
|
|
85
85
|
--token USDT \
|
|
86
86
|
--scheme exact_gasfree
|
|
87
87
|
```
|
|
@@ -100,7 +100,7 @@ TRON_PRIVATE_KEY=<hex> \
|
|
|
100
100
|
node dist/cli.js roundtrip \
|
|
101
101
|
--pay-to <recipient> \
|
|
102
102
|
--amount 0.0001 \
|
|
103
|
-
--network tron:
|
|
103
|
+
--network tron:0xcd8690dc \
|
|
104
104
|
--token USDT
|
|
105
105
|
```
|
|
106
106
|
|
|
@@ -108,16 +108,17 @@ node dist/cli.js roundtrip \
|
|
|
108
108
|
|
|
109
109
|
Supported built-in token registry:
|
|
110
110
|
|
|
111
|
-
- `tron:
|
|
112
|
-
- `tron:
|
|
113
|
-
- `tron:
|
|
111
|
+
- `tron:0x2b6653dc` USDT, USDD
|
|
112
|
+
- `tron:0xcd8690dc` USDT, USDD
|
|
113
|
+
- `tron:0x94a9059e` USDT
|
|
114
114
|
- `eip155:56` USDT
|
|
115
115
|
- `eip155:97` USDT, USDC
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
Legacy aliases remain accepted for backward compatibility, but new commands and
|
|
118
|
+
configuration should use the canonical IDs above:
|
|
118
119
|
|
|
119
|
-
- `tron-mainnet` -> `tron:
|
|
120
|
-
- `tron-nile` -> `tron:
|
|
120
|
+
- `tron-mainnet` -> `tron:0x2b6653dc`
|
|
121
|
+
- `tron-nile` -> `tron:0xcd8690dc`
|
|
121
122
|
- `bsc-mainnet` -> `eip155:56`
|
|
122
123
|
- `bsc-testnet` -> `eip155:97`
|
|
123
124
|
|
package/dist/cli.js
CHANGED
|
@@ -335,7 +335,7 @@ Options:
|
|
|
335
335
|
--pay-to <address> Recipient wallet address
|
|
336
336
|
--amount <amount> Human-readable token amount (default: 0.0001)
|
|
337
337
|
--raw-amount <amount> Smallest-unit amount
|
|
338
|
-
--network <caip2> Payment network (default: tron:
|
|
338
|
+
--network <caip2> Payment network (default: tron:0xcd8690dc)
|
|
339
339
|
--scheme <scheme> Payment scheme: exact or exact_gasfree (default: exact)
|
|
340
340
|
--token <symbol> Token symbol (default: USDT)
|
|
341
341
|
--asset <address> Explicit token address
|
|
@@ -349,7 +349,7 @@ Options:
|
|
|
349
349
|
--json Print JSON envelope
|
|
350
350
|
|
|
351
351
|
Examples:
|
|
352
|
-
x402-cli serve --pay-to T... --network tron:
|
|
352
|
+
x402-cli serve --pay-to T... --network tron:0xcd8690dc --token USDT
|
|
353
353
|
x402-cli serve --pay-to 0x... --network eip155:97 --token USDT --amount 0.0001
|
|
354
354
|
`,
|
|
355
355
|
roundtrip: `Usage:
|
|
@@ -968,7 +968,7 @@ async function catalogExportGateway(gatewayUrl, options) {
|
|
|
968
968
|
emit({ command: "catalog export-gateway", mode: outputMode(options), result: { provider: providerFqn, catalog: catalogPath, payMd: payMdPath } });
|
|
969
969
|
}
|
|
970
970
|
function buildRequirement(options) {
|
|
971
|
-
const network = normalizeNetwork(opt(options, "network", "tron:
|
|
971
|
+
const network = normalizeNetwork(opt(options, "network", "tron:0xcd8690dc"));
|
|
972
972
|
const scheme = opt(options, "scheme", "exact");
|
|
973
973
|
if (!["exact", "exact_gasfree"].includes(scheme))
|
|
974
974
|
throw new Error(`unsupported scheme ${scheme}`);
|
|
@@ -1372,7 +1372,7 @@ routing:
|
|
|
1372
1372
|
type: proxy
|
|
1373
1373
|
|
|
1374
1374
|
operator:
|
|
1375
|
-
network: tron
|
|
1375
|
+
network: tron:0xcd8690dc
|
|
1376
1376
|
currencies:
|
|
1377
1377
|
usd: ["USDT"]
|
|
1378
1378
|
recipient: <provider-recipient-address>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bankofai/x402-cli",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.3",
|
|
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.
|
|
25
|
+
"@bankofai/x402-gateway": "1.0.1-beta.3",
|
|
26
26
|
"@bankofai/x402-tron": "1.0.1-beta.4",
|
|
27
27
|
"tronweb": "6.4.0",
|
|
28
28
|
"viem": "^2.55.0",
|