@bankofai/x402-cli 1.0.1-beta.6 → 1.0.1-beta.7
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 +8 -8
- package/dist/gateway/server.js +2 -0
- package/package.json +5 -5
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
|
|
7
|
-
- `@bankofai/x402-evm@1.0.1
|
|
8
|
-
- `@bankofai/x402-tron@1.0.1
|
|
6
|
+
- `@bankofai/x402-core@1.0.1`
|
|
7
|
+
- `@bankofai/x402-evm@1.0.1`
|
|
8
|
+
- `@bankofai/x402-tron@1.0.1`
|
|
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
|
|
@@ -16,7 +16,7 @@ from the payment token, so the payer does not need TRX.
|
|
|
16
16
|
Install the CLI package:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
npm install -g @bankofai/x402-cli
|
|
19
|
+
npm install -g @bankofai/x402-cli@beta
|
|
20
20
|
x402-cli --version
|
|
21
21
|
```
|
|
22
22
|
|
|
@@ -58,7 +58,7 @@ envelope with `ok`, `command`, `result`, or structured `error` fields.
|
|
|
58
58
|
Start a local x402 paywall endpoint:
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
|
|
61
|
+
x402-cli serve \
|
|
62
62
|
--pay-to <recipient> \
|
|
63
63
|
--amount 0.0001 \
|
|
64
64
|
--network tron:0xcd8690dc \
|
|
@@ -79,7 +79,7 @@ Pay an x402-protected URL:
|
|
|
79
79
|
|
|
80
80
|
```bash
|
|
81
81
|
TRON_PRIVATE_KEY=<hex> \
|
|
82
|
-
|
|
82
|
+
x402-cli pay http://127.0.0.1:4020/pay \
|
|
83
83
|
--network tron:0xcd8690dc \
|
|
84
84
|
--token USDT
|
|
85
85
|
```
|
|
@@ -92,7 +92,7 @@ the server challenge):
|
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
94
|
TRON_PRIVATE_KEY=<hex> \
|
|
95
|
-
|
|
95
|
+
x402-cli pay https://api.example.com/pay \
|
|
96
96
|
--network tron:0xcd8690dc \
|
|
97
97
|
--token USDT \
|
|
98
98
|
--scheme exact_gasfree
|
|
@@ -133,7 +133,7 @@ Start a temporary local server and immediately pay it:
|
|
|
133
133
|
|
|
134
134
|
```bash
|
|
135
135
|
TRON_PRIVATE_KEY=<hex> \
|
|
136
|
-
|
|
136
|
+
x402-cli roundtrip \
|
|
137
137
|
--pay-to <recipient> \
|
|
138
138
|
--amount 0.0001 \
|
|
139
139
|
--network tron:0xcd8690dc \
|
package/dist/gateway/server.js
CHANGED
|
@@ -173,6 +173,8 @@ function isVerifySuccess(verify) {
|
|
|
173
173
|
return verify?.valid === true || verify?.isValid === true;
|
|
174
174
|
}
|
|
175
175
|
function isSettleSuccess(settle) {
|
|
176
|
+
if (settle?.success === false || settle?.settled === false)
|
|
177
|
+
return false;
|
|
176
178
|
return (settle?.success === true ||
|
|
177
179
|
settle?.settled === true ||
|
|
178
180
|
(typeof settle?.transaction === "string" && settle.transaction.length > 0) ||
|
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.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"node": ">=20"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@bankofai/x402-core": "1.0.1
|
|
24
|
-
"@bankofai/x402-evm": "1.0.1
|
|
25
|
-
"@bankofai/x402-gateway": "1.0.1-beta.
|
|
26
|
-
"@bankofai/x402-tron": "1.0.1
|
|
23
|
+
"@bankofai/x402-core": "1.0.1",
|
|
24
|
+
"@bankofai/x402-evm": "1.0.1",
|
|
25
|
+
"@bankofai/x402-gateway": "1.0.1-beta.6",
|
|
26
|
+
"@bankofai/x402-tron": "1.0.1",
|
|
27
27
|
"tronweb": "6.4.0",
|
|
28
28
|
"viem": "^2.55.0",
|
|
29
29
|
"yaml": "^2.8.2"
|