skillpp 0.1.0
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/COMPATIBILITY.md +58 -0
- package/LICENSE +21 -0
- package/README.md +307 -0
- package/README.zh-CN.md +307 -0
- package/SKILL.md +490 -0
- package/adapters/binance-ai.md +22 -0
- package/adapters/claude.md +21 -0
- package/adapters/gemini.md +26 -0
- package/adapters/gpt.md +28 -0
- package/adapters/kimi.md +26 -0
- package/adapters/mimo.md +22 -0
- package/adapters/openclaw.md +29 -0
- package/assets/skillpp-banner.png +0 -0
- package/package.json +59 -0
- package/pipelines.md +310 -0
- package/prompts/newbie-mode.md +48 -0
- package/prompts/router-prompt.md +32 -0
- package/prompts/universal-system-prompt.md +41 -0
- package/registry.md +209 -0
- package/rules.md +323 -0
- package/schemas/audit.schema.json +67 -0
- package/schemas/checkpoint.schema.json +86 -0
- package/schemas/handoff.schema.json +82 -0
- package/schemas/token.schema.json +36 -0
- package/scripts/compatibility-check.mjs +130 -0
- package/scripts/selftest.mjs +384 -0
- package/scripts/skillpp.mjs +448 -0
- package/scripts/validate-skillpp.mjs +140 -0
- package/skillpp.manifest.json +714 -0
- package/skills/audit-plus/SKILL.md +612 -0
- package/skills/binance/binance/CHANGELOG.md +112 -0
- package/skills/binance/binance/LICENSE.md +9 -0
- package/skills/binance/binance/SKILL.md +69 -0
- package/skills/binance/binance/references/algo.md +21 -0
- package/skills/binance/binance/references/alpha.md +9 -0
- package/skills/binance/binance/references/auth.md +32 -0
- package/skills/binance/binance/references/c2c.md +5 -0
- package/skills/binance/binance/references/convert.md +19 -0
- package/skills/binance/binance/references/copy-trading.md +6 -0
- package/skills/binance/binance/references/crypto-loan.md +27 -0
- package/skills/binance/binance/references/derivatives-options-streams.md +25 -0
- package/skills/binance/binance/references/derivatives-options.md +85 -0
- package/skills/binance/binance/references/derivatives-portfolio-margin-pro-streams.md +5 -0
- package/skills/binance/binance/references/derivatives-portfolio-margin-pro.md +34 -0
- package/skills/binance/binance/references/derivatives-portfolio-margin-streams.md +5 -0
- package/skills/binance/binance/references/derivatives-portfolio-margin.md +146 -0
- package/skills/binance/binance/references/dual-investment.md +15 -0
- package/skills/binance/binance/references/fiat.md +9 -0
- package/skills/binance/binance/references/futures-coin-streams.md +29 -0
- package/skills/binance/binance/references/futures-coin.md +109 -0
- package/skills/binance/binance/references/futures-usds-streams.md +35 -0
- package/skills/binance/binance/references/futures-usds.md +144 -0
- package/skills/binance/binance/references/gift-card.md +10 -0
- package/skills/binance/binance/references/margin-trading-streams.md +6 -0
- package/skills/binance/binance/references/margin-trading.md +101 -0
- package/skills/binance/binance/references/mining.md +17 -0
- package/skills/binance/binance/references/pay.md +5 -0
- package/skills/binance/binance/references/rebate.md +5 -0
- package/skills/binance/binance/references/simple-earn.md +56 -0
- package/skills/binance/binance/references/spot-streams.md +25 -0
- package/skills/binance/binance/references/spot.md +114 -0
- package/skills/binance/binance/references/staking.md +59 -0
- package/skills/binance/binance/references/sub-account.md +67 -0
- package/skills/binance/binance/references/vip-loan.md +27 -0
- package/skills/binance/binance/references/wallet.md +75 -0
- package/skills/binance/fiat/CHANGELOG.md +11 -0
- package/skills/binance/fiat/LICENSE.md +9 -0
- package/skills/binance/fiat/SKILL.md +169 -0
- package/skills/binance/fiat/references/authentication.md +126 -0
- package/skills/binance/fiat/references/sapi-endpoints.md +217 -0
- package/skills/binance/onchain-pay/.local.md.example +10 -0
- package/skills/binance/onchain-pay/CHANGELOG.md +20 -0
- package/skills/binance/onchain-pay/LICENSE.md +9 -0
- package/skills/binance/onchain-pay/SKILL.md +466 -0
- package/skills/binance/onchain-pay/references/authentication.md +92 -0
- package/skills/binance/onchain-pay/scripts/sign_and_call.sh +52 -0
- package/skills/binance/p2p/CHANGELOG.md +33 -0
- package/skills/binance/p2p/LICENSE.md +9 -0
- package/skills/binance/p2p/SKILL.md +1082 -0
- package/skills/binance/p2p/references/agent-sapi-api.md +795 -0
- package/skills/binance/p2p/references/authentication.md +100 -0
- package/skills/binance/payment/SKILL.md +824 -0
- package/skills/binance/payment/common.py +560 -0
- package/skills/binance/payment/payment_skill.py +86 -0
- package/skills/binance/payment/receive.py +109 -0
- package/skills/binance/payment/references/setup-guide.md +77 -0
- package/skills/binance/payment/requirements.txt +4 -0
- package/skills/binance/payment/send.py +952 -0
- package/skills/binance/payment/send_extension/__init__.py +43 -0
- package/skills/binance/payment/send_extension/base.py +48 -0
- package/skills/binance/payment/send_extension/c2c.py +193 -0
- package/skills/binance/payment/send_extension/pix.py +316 -0
- package/skills/binance/square-post/README.md +62 -0
- package/skills/binance/square-post/SKILL.md +171 -0
- package/skills/binance/square-post/scripts/lib.mjs +175 -0
- package/skills/binance/square-post/scripts/post-image.mjs +80 -0
- package/skills/binance/square-post/scripts/post-text.mjs +41 -0
- package/skills/binance/square-post/scripts/post-video.mjs +110 -0
- package/skills/binance/square-post/scripts/save-key.mjs +34 -0
- package/skills/binance-web3/binance-agentic-wallet/SKILL.md +150 -0
- package/skills/binance-web3/binance-agentic-wallet/references/authentication.md +136 -0
- package/skills/binance-web3/binance-agentic-wallet/references/limit-order.md +204 -0
- package/skills/binance-web3/binance-agentic-wallet/references/market-order.md +179 -0
- package/skills/binance-web3/binance-agentic-wallet/references/prediction.md +489 -0
- package/skills/binance-web3/binance-agentic-wallet/references/preflight.md +66 -0
- package/skills/binance-web3/binance-agentic-wallet/references/security.md +47 -0
- package/skills/binance-web3/binance-agentic-wallet/references/send.md +53 -0
- package/skills/binance-web3/binance-agentic-wallet/references/wallet-setting.md +86 -0
- package/skills/binance-web3/binance-agentic-wallet/references/wallet-view.md +312 -0
- package/skills/binance-web3/binance-agentic-wallet/references/x402-payment.md +259 -0
- package/skills/binance-web3/binance-tokenized-securities-info/SKILL.md +613 -0
- package/skills/binance-web3/crypto-market-rank/SKILL.md +91 -0
- package/skills/binance-web3/crypto-market-rank/references/cli.md +219 -0
- package/skills/binance-web3/crypto-market-rank/scripts/cli.mjs +149 -0
- package/skills/binance-web3/meme-rush/SKILL.md +72 -0
- package/skills/binance-web3/meme-rush/references/cli.md +158 -0
- package/skills/binance-web3/meme-rush/scripts/cli.mjs +101 -0
- package/skills/binance-web3/query-address-info/SKILL.md +61 -0
- package/skills/binance-web3/query-address-info/references/cli.md +56 -0
- package/skills/binance-web3/query-address-info/scripts/cli.mjs +132 -0
- package/skills/binance-web3/query-token-audit/SKILL.md +162 -0
- package/skills/binance-web3/query-token-info/SKILL.md +83 -0
- package/skills/binance-web3/query-token-info/references/cli.md +135 -0
- package/skills/binance-web3/query-token-info/scripts/cli.mjs +112 -0
- package/skills/binance-web3/trading-signal/SKILL.md +66 -0
- package/skills/binance-web3/trading-signal/references/cli.md +90 -0
- package/skills/binance-web3/trading-signal/scripts/cli.mjs +92 -0
- package/skills/four-meme/four-guard/API-Contract-TaxToken.md +277 -0
- package/skills/four-meme/four-guard/API-CreateToken.02-02-2026.md +285 -0
- package/skills/four-meme/four-guard/API-Documents.03-03-2026.md +789 -0
- package/skills/four-meme/four-guard/AgentIdentifier.abi +585 -0
- package/skills/four-meme/four-guard/README.md +21 -0
- package/skills/four-meme/four-guard/SKILL.md +31 -0
- package/skills/four-meme/four-guard/TaxToken.abi +969 -0
- package/skills/four-meme/four-guard/TokenIdentifierSample.js_ +81 -0
- package/skills/four-meme/four-guard/TokenIdentifierSample.sol +69 -0
- package/skills/four-meme/four-guard/TokenManager.lite.abi +836 -0
- package/skills/four-meme/four-guard/TokenManager2.lite.abi +2325 -0
- package/skills/four-meme/four-guard/TokenManagerHelper3.abi +999 -0
- package/skills/four-meme/four-guard/go.mod +36 -0
- package/skills/four-meme/four-guard/go.sum +127 -0
- package/skills/four-meme/four-guard/main.go +183 -0
- package/skills/four-meme/four-meme-ai/SKILL.md +31 -0
- package/skills/four-meme/four-meme-ai/references/agent-creator-and-wallets.md +87 -0
- package/skills/four-meme/four-meme-ai/references/api-create-token.md +55 -0
- package/skills/four-meme/four-meme-ai/references/contract-addresses.md +47 -0
- package/skills/four-meme/four-meme-ai/references/create-token-scripts.md +131 -0
- package/skills/four-meme/four-meme-ai/references/errors.md +29 -0
- package/skills/four-meme/four-meme-ai/references/event-listening.md +75 -0
- package/skills/four-meme/four-meme-ai/references/execute-trade.md +31 -0
- package/skills/four-meme/four-meme-ai/references/tax-token-query.md +38 -0
- package/skills/four-meme/four-meme-ai/references/token-query-api.md +44 -0
- package/skills/four-meme/four-meme-ai/references/token-tax-info.md +77 -0
- package/skills/four-meme/four-meme-ai/scripts/8004-balance.ts +52 -0
- package/skills/four-meme/four-meme-ai/scripts/8004-register.ts +108 -0
- package/skills/four-meme/four-meme-ai/scripts/create-token-api.ts +321 -0
- package/skills/four-meme/four-meme-ai/scripts/create-token-chain.ts +102 -0
- package/skills/four-meme/four-meme-ai/scripts/create-token-instant.ts +106 -0
- package/skills/four-meme/four-meme-ai/scripts/execute-buy.ts +198 -0
- package/skills/four-meme/four-meme-ai/scripts/execute-sell.ts +150 -0
- package/skills/four-meme/four-meme-ai/scripts/get-public-config.ts +25 -0
- package/skills/four-meme/four-meme-ai/scripts/get-recent-events.ts +76 -0
- package/skills/four-meme/four-meme-ai/scripts/get-tax-token-info.ts +69 -0
- package/skills/four-meme/four-meme-ai/scripts/get-token-info.ts +94 -0
- package/skills/four-meme/four-meme-ai/scripts/quote-buy.ts +85 -0
- package/skills/four-meme/four-meme-ai/scripts/quote-sell.ts +66 -0
- package/skills/four-meme/four-meme-ai/scripts/send-token.ts +98 -0
- package/skills/four-meme/four-meme-ai/scripts/token-get.ts +31 -0
- package/skills/four-meme/four-meme-ai/scripts/token-list.ts +134 -0
- package/skills/four-meme/four-meme-ai/scripts/token-rankings.ts +162 -0
- package/skills/four-meme/four-meme-ai/scripts/verify-events.ts +47 -0
- package/skills/four-meme/four-meme-integration/SKILL.md +374 -0
- package/skills/four-meme/four-meme-integration/references/agent-creator-and-wallets.md +87 -0
- package/skills/four-meme/four-meme-integration/references/api-create-token.md +55 -0
- package/skills/four-meme/four-meme-integration/references/contract-addresses.md +47 -0
- package/skills/four-meme/four-meme-integration/references/create-token-scripts.md +131 -0
- package/skills/four-meme/four-meme-integration/references/errors.md +29 -0
- package/skills/four-meme/four-meme-integration/references/event-listening.md +75 -0
- package/skills/four-meme/four-meme-integration/references/execute-trade.md +31 -0
- package/skills/four-meme/four-meme-integration/references/tax-token-query.md +38 -0
- package/skills/four-meme/four-meme-integration/references/token-query-api.md +44 -0
- package/skills/four-meme/four-meme-integration/references/token-tax-info.md +77 -0
- package/skills/four-meme/four-meme-integration/scripts/8004-balance.ts +52 -0
- package/skills/four-meme/four-meme-integration/scripts/8004-register.ts +108 -0
- package/skills/four-meme/four-meme-integration/scripts/create-token-api.ts +321 -0
- package/skills/four-meme/four-meme-integration/scripts/create-token-chain.ts +102 -0
- package/skills/four-meme/four-meme-integration/scripts/create-token-instant.ts +106 -0
- package/skills/four-meme/four-meme-integration/scripts/execute-buy.ts +198 -0
- package/skills/four-meme/four-meme-integration/scripts/execute-sell.ts +150 -0
- package/skills/four-meme/four-meme-integration/scripts/get-public-config.ts +25 -0
- package/skills/four-meme/four-meme-integration/scripts/get-recent-events.ts +76 -0
- package/skills/four-meme/four-meme-integration/scripts/get-tax-token-info.ts +69 -0
- package/skills/four-meme/four-meme-integration/scripts/get-token-info.ts +94 -0
- package/skills/four-meme/four-meme-integration/scripts/quote-buy.ts +85 -0
- package/skills/four-meme/four-meme-integration/scripts/quote-sell.ts +66 -0
- package/skills/four-meme/four-meme-integration/scripts/send-token.ts +98 -0
- package/skills/four-meme/four-meme-integration/scripts/token-get.ts +31 -0
- package/skills/four-meme/four-meme-integration/scripts/token-list.ts +134 -0
- package/skills/four-meme/four-meme-integration/scripts/token-rankings.ts +162 -0
- package/skills/four-meme/four-meme-integration/scripts/verify-events.ts +47 -0
- package/skills/skillpp/contract-profiler/SKILL.md +118 -0
- package/skills/skillpp/newbie-tutor/SKILL.md +85 -0
- package/skills/skillpp/opportunity-board/SKILL.md +87 -0
- package/skills/skillpp/risk-fusion/SKILL.md +146 -0
- package/skills/skillpp/scam-pattern-lab/SKILL.md +115 -0
- package/skills/skillpp/wallet-doctor/SKILL.md +119 -0
- package/skills/skillpp/watchtower/SKILL.md +72 -0
- package/tests/compatibility/v0.1.0.json +117 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Wallet Settings
|
|
2
|
+
|
|
3
|
+
View the wallet's current security configuration and daily quota. Settings can only be changed in the Binance App — this command is read-only.
|
|
4
|
+
|
|
5
|
+
## `wallet settings`
|
|
6
|
+
|
|
7
|
+
### Syntax
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
baw wallet settings --json
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Parameters
|
|
14
|
+
|
|
15
|
+
No command-specific parameters.
|
|
16
|
+
|
|
17
|
+
### Example
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
baw wallet settings --json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Response
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"success": true,
|
|
28
|
+
"data": {
|
|
29
|
+
"maxSigninDuration": "48h",
|
|
30
|
+
"inactiveSignoutDuration": "24h",
|
|
31
|
+
"dailyLimit": 50000,
|
|
32
|
+
"abnormalTxnHandling": "AutoReject",
|
|
33
|
+
"tradeAllTokens": false,
|
|
34
|
+
"predictionEnabled": true,
|
|
35
|
+
"predictionDailyLimit": 50000,
|
|
36
|
+
"predictionQuotaUsed": 0,
|
|
37
|
+
"predictionQuotaLeft": 50000,
|
|
38
|
+
"predictionQuotaDate": "2026-04-03",
|
|
39
|
+
"x402DailyLimit": 20,
|
|
40
|
+
"x402QuotaUsed": 0,
|
|
41
|
+
"x402QuotaLeft": 20,
|
|
42
|
+
"x402QuotaDate": "2026-04-03",
|
|
43
|
+
"quotaUsed": 0,
|
|
44
|
+
"quotaLeft": 50000,
|
|
45
|
+
"quotaDate": "2026-04-03",
|
|
46
|
+
"inactiveSignOutTime": "2026-04-04T06:32:05+08:00",
|
|
47
|
+
"sessionExpireTime": "2026-04-04T06:32:05+08:00"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Returns the current security settings:
|
|
53
|
+
- **maxSigninDuration** — The maximum time the Agentic Wallet can stay signed in before the Agent is automatically signed out.
|
|
54
|
+
- **inactiveSignoutDuration** — The Agent will be signed out after this period of inactivity, regardless of the Max Sign-In Duration. Currently fixed at 24 hours and not user-configurable.
|
|
55
|
+
- **dailyLimit** — maximum total transaction value allowed in a 24-hour period.
|
|
56
|
+
- **abnormalTxnHandling** — How the wallet handles transactions flagged as high-risk or with abnormal price impact. Only two values are possible:
|
|
57
|
+
- `AutoReject` — automatically block abnormal transactions without prompting the user.
|
|
58
|
+
- `NeedConfirmation` — send a double-confirm request to the Binance App and wait for the user to approve or reject.
|
|
59
|
+
- **tradeAllTokens** — whether the wallet can trade any token or only those on the allowed list.
|
|
60
|
+
- **predictionEnabled** — whether prediction-market trading (see [`prediction`](./prediction.md) commands) is enabled for this wallet. When `false`, `prediction trade *` calls will be rejected by policy.
|
|
61
|
+
- **predictionDailyLimit** — maximum total prediction-trade value (in USD) allowed in a 24-hour period. **Independent from `dailyLimit`**: prediction trades only consume `predictionQuotaUsed`.
|
|
62
|
+
- **x402DailyLimit** — maximum total x402 payment value (in USD) allowed in a 24-hour period. **Independent from `dailyLimit` and `predictionDailyLimit`**: x402 payments only consume `x402QuotaUsed`.
|
|
63
|
+
|
|
64
|
+
The response also includes current status information:
|
|
65
|
+
- **quotaUsed** — how much of the daily limit (in USD) has been consumed so far today.
|
|
66
|
+
- **quotaLeft** — remaining daily limit (in USD) available for transactions today.
|
|
67
|
+
- **quotaDate** — the date these quota figures apply to.
|
|
68
|
+
- **predictionQuotaUsed** — how much of `predictionDailyLimit` has been consumed by prediction trades today.
|
|
69
|
+
- **predictionQuotaLeft** — remaining prediction-trade quota available today.
|
|
70
|
+
- **predictionQuotaDate** — the date these prediction-quota figures apply to.
|
|
71
|
+
- **x402QuotaUsed** — how much of the x402 daily limit (in USD) has been consumed so far today.
|
|
72
|
+
- **x402QuotaLeft** — remaining x402 daily limit (in USD) available for x402 payments today.
|
|
73
|
+
- **x402QuotaDate** — the date these x402 quota figures apply to.
|
|
74
|
+
- **inactiveSignOutTime** - when the agent will sign out due to the inactive signout duration settings.
|
|
75
|
+
- **sessionExpireTime** — when the current session will expire and the wallet will automatically sign out.
|
|
76
|
+
|
|
77
|
+
### Changing Settings
|
|
78
|
+
|
|
79
|
+
Settings cannot be changed via the CLI. To update them, follow these steps in the Binance App:
|
|
80
|
+
|
|
81
|
+
1. Open the **Binance Wallet App**.
|
|
82
|
+
2. Navigate to the **Agentic Wallet** management page.
|
|
83
|
+
3. Tap the **settings icon** in the top-right corner to enter wallet Settings.
|
|
84
|
+
4. Adjust the desired security settings.
|
|
85
|
+
|
|
86
|
+
When a transaction is rejected because of a security policy (e.g., token not on the allowed list, daily limit exceeded, x402 daily limit exceeded, prediction disabled, prediction daily limit exceeded), use `wallet settings` to explain the restriction and guide the user to the App to make adjustments.
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
# Wallet View Commands
|
|
2
|
+
|
|
3
|
+
## `wallet status`
|
|
4
|
+
|
|
5
|
+
Check the current authentication and wallet state.
|
|
6
|
+
|
|
7
|
+
### Syntax
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
baw wallet status --json
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Parameters
|
|
14
|
+
|
|
15
|
+
No command-specific parameters.
|
|
16
|
+
|
|
17
|
+
### Example
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
baw wallet status --json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Response
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"success": true,
|
|
28
|
+
"data": {
|
|
29
|
+
"status": "CONNECTED"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
| Status | Meaning |
|
|
35
|
+
|---------------|--------------------------------|
|
|
36
|
+
| `UNCONNECTED` | Not signed in |
|
|
37
|
+
| `CREATING` | Signed in; wallet being set up |
|
|
38
|
+
| `CONNECTED` | Signed in; wallet ready to use |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## `wallet chains`
|
|
43
|
+
|
|
44
|
+
List the blockchain networks the wallet currently supports.
|
|
45
|
+
|
|
46
|
+
### Syntax
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
baw wallet chains --json
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Parameters
|
|
53
|
+
|
|
54
|
+
No command-specific parameters.
|
|
55
|
+
|
|
56
|
+
### Example
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
baw wallet chains --json
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Response
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"success": true,
|
|
67
|
+
"data": [
|
|
68
|
+
{ "binanceChainId": "56", "name": "BNB Smart Chain", "simpleName": "BSC" }
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## `wallet address`
|
|
76
|
+
|
|
77
|
+
Retrieve the wallet addresses.
|
|
78
|
+
|
|
79
|
+
### Syntax
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
baw wallet address --json
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Parameters
|
|
86
|
+
|
|
87
|
+
No command-specific parameters.
|
|
88
|
+
|
|
89
|
+
### Example
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
baw wallet address --json
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Response
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"success": true,
|
|
100
|
+
"data": {
|
|
101
|
+
"addresses": [
|
|
102
|
+
{
|
|
103
|
+
"binanceChainId": "CT_501",
|
|
104
|
+
"chainName": "Solana",
|
|
105
|
+
"address": "E...S"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"binanceChainId": "1",
|
|
109
|
+
"chainName": "Ethereum",
|
|
110
|
+
"address": "0x1234...5678"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"binanceChainId": "56",
|
|
114
|
+
"chainName": "BSC",
|
|
115
|
+
"address": "0x1234...5678"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"binanceChainId": "8453",
|
|
119
|
+
"chainName": "Base",
|
|
120
|
+
"address": "0x1234...5678"
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## `wallet balance`
|
|
130
|
+
|
|
131
|
+
Query token balances. Only tokens with a value of at least $0.01 USD are returned; tokens worth less than $0.01 are hidden by CLI.
|
|
132
|
+
|
|
133
|
+
### Syntax
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
baw wallet balance [--symbol <symbol>] [--tokenAddress <tokenAddress>] [--binanceChainId <binanceChainId>] --json
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Parameters
|
|
140
|
+
|
|
141
|
+
| Parameter | Required | Default | Description |
|
|
142
|
+
|--------------------|----------|---------|---------------------------------------------------------------------------------------|
|
|
143
|
+
| `--symbol` | No | — | Filter by token symbol (e.g., `BNB`, `USDT`, `USDC`) |
|
|
144
|
+
| `--tokenAddress` | No | — | Filter by token contract address |
|
|
145
|
+
| `--binanceChainId` | No | — | Binance chain ID: `56` (BSC), `CT_501` (Solana). For a full list, see `wallet chains` |
|
|
146
|
+
|
|
147
|
+
### Example
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Query all balances
|
|
151
|
+
baw wallet balance --json
|
|
152
|
+
|
|
153
|
+
# Query USDT balance only
|
|
154
|
+
baw wallet balance --symbol USDT --json
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Response
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"success": true,
|
|
162
|
+
"data": [
|
|
163
|
+
{ "symbol": "USDT", "address": "0x55d398326f99059fF775485246999027B3197955", "binanceChainId": "56", "balance": "1000.50", "price": "1.0", "value": "1000.50" }
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## `wallet tx-history`
|
|
171
|
+
|
|
172
|
+
Retrieve transaction history with optional filtering and pagination.
|
|
173
|
+
|
|
174
|
+
### Syntax
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
baw wallet tx-history [--type <type>] [--size <size>] [--nextCursor <nextCursor>] [--tx <tx>] [--startTime <startTime>] [--endTime <endTime>] [--binanceChainId <binanceChainId>] --json
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Parameters
|
|
181
|
+
|
|
182
|
+
| Parameter | Required | Default | Description |
|
|
183
|
+
|--------------------|----------|--------------|---------------------------------------------------------------------------------------|
|
|
184
|
+
| `--type` | No | `all` | `all`, `pending`, `confirmed` |
|
|
185
|
+
| `--size` | No | `20` | Results per page (max 100) |
|
|
186
|
+
| `--nextCursor` | No | — | Pagination cursor from a previous response |
|
|
187
|
+
| `--tx` | No | — | Look up a single transaction by hash |
|
|
188
|
+
| `--startTime` | No | 3 months ago | Start time (ms timestamp) |
|
|
189
|
+
| `--endTime` | No | — | End time (ms timestamp) |
|
|
190
|
+
| `--binanceChainId` | No | — | Binance chain ID: `56` (BSC), `CT_501` (Solana). For a full list, see `wallet chains` |
|
|
191
|
+
|
|
192
|
+
### Example
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# Query recent transactions
|
|
196
|
+
baw wallet tx-history --json
|
|
197
|
+
|
|
198
|
+
# Query pending transactions
|
|
199
|
+
baw wallet tx-history --type pending --json
|
|
200
|
+
|
|
201
|
+
# Look up a specific transaction
|
|
202
|
+
baw wallet tx-history --tx 0xabc123... --json
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Response
|
|
206
|
+
|
|
207
|
+
```json
|
|
208
|
+
{
|
|
209
|
+
"success": true,
|
|
210
|
+
"data": {
|
|
211
|
+
"transactions": [
|
|
212
|
+
{
|
|
213
|
+
"txType": "swap",
|
|
214
|
+
"txHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
|
|
215
|
+
"txTime": "2026-04-01T09:05:30+08:00",
|
|
216
|
+
"binanceChainId": "56",
|
|
217
|
+
"status": "confirmed",
|
|
218
|
+
"txHashList": [
|
|
219
|
+
{
|
|
220
|
+
"binanceChainId": "56",
|
|
221
|
+
"txHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
|
|
222
|
+
"status": "confirmed",
|
|
223
|
+
"networkFee": {
|
|
224
|
+
"binanceChainId": "56",
|
|
225
|
+
"feeTokenAddress": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
|
226
|
+
"feeTokenSymbol": "BNB",
|
|
227
|
+
"feeValue": "0",
|
|
228
|
+
"feeTokenDecimals": 18
|
|
229
|
+
},
|
|
230
|
+
"instructions": {
|
|
231
|
+
"send": [
|
|
232
|
+
{
|
|
233
|
+
"binanceChainId": "56",
|
|
234
|
+
"amount": "1000000000000000000",
|
|
235
|
+
"addressInfo": { "address": "0x1234...5678" },
|
|
236
|
+
"tokenInfo": {
|
|
237
|
+
"binanceChainId": "56",
|
|
238
|
+
"contractAddress": "0xcaca...1231",
|
|
239
|
+
"symbol": "Token1",
|
|
240
|
+
"tokenId": null,
|
|
241
|
+
"decimals": 18
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
"receive": [
|
|
246
|
+
{
|
|
247
|
+
"binanceChainId": "56",
|
|
248
|
+
"amount": "1000000000000000000",
|
|
249
|
+
"addressInfo": { "address": "0x1234...5678" },
|
|
250
|
+
"tokenInfo": {
|
|
251
|
+
"binanceChainId": "56",
|
|
252
|
+
"contractAddress": "0xcaca...1232",
|
|
253
|
+
"symbol": "Token2",
|
|
254
|
+
"tokenId": null,
|
|
255
|
+
"decimals": 18
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
],
|
|
264
|
+
"hasMore": true,
|
|
265
|
+
"nextCursor": "__CONFIRMED__:1234567890"
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## `wallet tx-lock`
|
|
273
|
+
|
|
274
|
+
Check whether the wallet is currently locked from sending new transactions.
|
|
275
|
+
|
|
276
|
+
### Syntax
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
baw wallet tx-lock --binanceChainId <binanceChainId> --json
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Parameters
|
|
283
|
+
|
|
284
|
+
| Parameter | Required | Default | Description |
|
|
285
|
+
|--------------------|----------|--------------|---------------------------------------------------------------------------------------|
|
|
286
|
+
| `--binanceChainId` | Yes | — | Binance chain ID: `56` (BSC), `CT_501` (Solana). For a full list, see `wallet chains` |
|
|
287
|
+
|
|
288
|
+
### Example
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
baw wallet tx-lock --binanceChainId 56 --json
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Response
|
|
295
|
+
|
|
296
|
+
```json
|
|
297
|
+
{
|
|
298
|
+
"success": true,
|
|
299
|
+
"data": {
|
|
300
|
+
"status": "UNLOCKED"
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
| Status | Meaning |
|
|
306
|
+
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
307
|
+
| `UNLOCKED` | The wallet is free to send new transactions. |
|
|
308
|
+
| `LOCKED` | A transaction is pending on-chain, or a double-confirm request is waiting in the Binance App. The user must resolve it before starting a new transaction. |
|
|
309
|
+
|
|
310
|
+
The wallet becomes locked in two situations:
|
|
311
|
+
1. **Transaction pending on-chain** — a previously submitted transaction has not yet been confirmed on the blockchain. Nothing to do but wait; re-check with `wallet tx-lock` after a short while.
|
|
312
|
+
2. **Double-confirm pending** — the transaction triggered a risk-control check (either the token is flagged as risky, or a DEX swap has excessive price deviation). Tell the user to open the Binance App to approve or reject it (5-minute timeout).
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
# x402 Payment
|
|
2
|
+
|
|
3
|
+
Pay for an x402 HTTP resource by previewing payment options, then signing one.
|
|
4
|
+
|
|
5
|
+
## `x402-payment preview`
|
|
6
|
+
|
|
7
|
+
Preview payment options from a Merchant's `PaymentRequired` response.
|
|
8
|
+
|
|
9
|
+
### Syntax
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
baw x402-payment preview --paymentRequirements <base64-or-raw-json> --json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Required | Description |
|
|
18
|
+
|-------------------------|----------|----------------------------------------------------------------------------------------------------|
|
|
19
|
+
| `--paymentRequirements` | Yes | The `PaymentRequired` payload — either the base64 `PAYMENT-REQUIRED` header value or its raw JSON. |
|
|
20
|
+
|
|
21
|
+
### Example
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
baw x402-payment preview --paymentRequirements '{
|
|
25
|
+
"x402Version": 2,
|
|
26
|
+
"resource": {"url": "https://merchant/api"},
|
|
27
|
+
"accepts": [
|
|
28
|
+
{
|
|
29
|
+
"scheme": "exact",
|
|
30
|
+
"network": "eip155:8453",
|
|
31
|
+
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
32
|
+
"amount": "10000000",
|
|
33
|
+
"payTo": "0x1111111111111111111111111111111111111111",
|
|
34
|
+
"extra": {"name": "USD Coin", "version": "2"}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"scheme": "exact",
|
|
38
|
+
"network": "eip155:56",
|
|
39
|
+
"asset": "0x55d398326f99059fF775485246999027B3197955",
|
|
40
|
+
"amount": "10000000000000000000",
|
|
41
|
+
"payTo": "0x1111111111111111111111111111111111111111",
|
|
42
|
+
"extra": {"name": "Tether USD", "version": "1"}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"scheme": "exact",
|
|
46
|
+
"network": "eip155:42161",
|
|
47
|
+
"asset": "0xcaca...1231",
|
|
48
|
+
"amount": "10000000",
|
|
49
|
+
"payTo": "0x1111111111111111111111111111111111111111",
|
|
50
|
+
"extra": {"name": "USD Coin", "version": "2"}
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}' --json
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Response
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"success": true,
|
|
61
|
+
"data": {
|
|
62
|
+
"paymentId": "550e8400-e29b-41d4-a716-446655440000",
|
|
63
|
+
"options": [
|
|
64
|
+
{
|
|
65
|
+
"index": 1,
|
|
66
|
+
"status": "READY_TO_SIGN",
|
|
67
|
+
"reasons": [],
|
|
68
|
+
"scheme": "exact",
|
|
69
|
+
"assetTransferMethod": "eip3009",
|
|
70
|
+
"binanceChainId": "8453",
|
|
71
|
+
"tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
72
|
+
"tokenSymbol": "USDC",
|
|
73
|
+
"amount": "10",
|
|
74
|
+
"amountUsd": "10.00",
|
|
75
|
+
"payTo": "0x1111111111111111111111111111111111111111",
|
|
76
|
+
"userWalletAddress": "0x2222222222222222222222222222222222222222",
|
|
77
|
+
"currentBalance": "100",
|
|
78
|
+
"currentBalanceUsd": "100.00",
|
|
79
|
+
"needApproveFirst": false,
|
|
80
|
+
"originalAccept": {
|
|
81
|
+
"scheme": "exact",
|
|
82
|
+
"network": "eip155:8453",
|
|
83
|
+
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
84
|
+
"amount": "10000000",
|
|
85
|
+
"payTo": "0x1111111111111111111111111111111111111111",
|
|
86
|
+
"extra": {
|
|
87
|
+
"name": "USD Coin",
|
|
88
|
+
"version": "2"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"index": 2,
|
|
94
|
+
"status": "ACTION_REQUIRED",
|
|
95
|
+
"reasons": [
|
|
96
|
+
"INSUFFICIENT_BALANCE"
|
|
97
|
+
],
|
|
98
|
+
"scheme": "exact",
|
|
99
|
+
"assetTransferMethod": "eip3009",
|
|
100
|
+
"binanceChainId": "56",
|
|
101
|
+
"tokenAddress": "0x55d398326f99059fF775485246999027B3197955",
|
|
102
|
+
"tokenSymbol": "USDT",
|
|
103
|
+
"amount": "10",
|
|
104
|
+
"amountUsd": "10.01",
|
|
105
|
+
"payTo": "0x1111111111111111111111111111111111111111",
|
|
106
|
+
"userWalletAddress": "0x2222222222222222222222222222222222222222",
|
|
107
|
+
"currentBalance": "1.5",
|
|
108
|
+
"currentBalanceUsd": "1.50",
|
|
109
|
+
"needApproveFirst": false,
|
|
110
|
+
"originalAccept": {
|
|
111
|
+
"scheme": "exact",
|
|
112
|
+
"network": "eip155:56",
|
|
113
|
+
"asset": "0x55d398326f99059fF775485246999027B3197955",
|
|
114
|
+
"amount": "10000000000000000000",
|
|
115
|
+
"payTo": "0x1111111111111111111111111111111111111111",
|
|
116
|
+
"extra": {
|
|
117
|
+
"name": "Tether USD",
|
|
118
|
+
"version": "1"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"index": 3,
|
|
124
|
+
"status": "NOT_SIGNABLE",
|
|
125
|
+
"reasons": [
|
|
126
|
+
"UNSUPPORTED_NETWORK"
|
|
127
|
+
],
|
|
128
|
+
"scheme": "exact",
|
|
129
|
+
"originalAccept": {
|
|
130
|
+
"scheme": "exact",
|
|
131
|
+
"network": "eip155:42161",
|
|
132
|
+
"asset": "0xcaca...1231"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
| Field | Description |
|
|
141
|
+
|---------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
142
|
+
| `paymentId` | UUID identifying this payment. |
|
|
143
|
+
| `options[].index` | 1-based selector (first option is `1`, not `0`) to pass to `sign --selectedIndex`. |
|
|
144
|
+
| `options[].status` | The option's status, which drives the next step. See table below. |
|
|
145
|
+
| `options[].reasons` | Reasons the option isn't ready to sign. See table below. |
|
|
146
|
+
| `options[].scheme` | x402 scheme, such as `exact`. |
|
|
147
|
+
| `options[].assetTransferMethod` | Asset transfer method, such as `eip3009`, `permit2`, `spl-transfer`, etc. |
|
|
148
|
+
| `options[].binanceChainId` | Binance chain ID: `56` (BSC), `CT_501` (Solana). |
|
|
149
|
+
| `options[].tokenAddress` | Token contract address. |
|
|
150
|
+
| `options[].tokenSymbol` | Token symbol, e.g. `USDT`. |
|
|
151
|
+
| `options[].amount` | Amount of tokens to pay, in human-readable units. |
|
|
152
|
+
| `options[].amountUsd` | Equivalent USD value at the current token price. |
|
|
153
|
+
| `options[].payTo` | Recipient (Merchant) address. |
|
|
154
|
+
| `options[].userWalletAddress` | User's own wallet address on this chain. |
|
|
155
|
+
| `options[].currentBalance` | User's current balance of `tokenAddress`, in human-readable units. |
|
|
156
|
+
| `options[].currentBalanceUsd` | Equivalent USD value of `currentBalance` at the current token price. |
|
|
157
|
+
| `options[].needApproveFirst` | Whether a Permit2 approve tx is required before this payment. If true, `sign` will dispatch the approve tx alongside the signature — on BSC the approve gas is sponsored. |
|
|
158
|
+
| `options[].originalAccept` | The Merchant's original accept entry. |
|
|
159
|
+
|
|
160
|
+
`options[].status` values:
|
|
161
|
+
|
|
162
|
+
| Value | Meaning |
|
|
163
|
+
|-------------------|------------------------------------------------------|
|
|
164
|
+
| `READY_TO_SIGN` | Can be signed directly. No user action required. |
|
|
165
|
+
| `ACTION_REQUIRED` | Can only be signed after the user takes some action. |
|
|
166
|
+
| `NOT_SIGNABLE` | Cannot be signed. Retrying won't help. |
|
|
167
|
+
|
|
168
|
+
`options[].reasons` values:
|
|
169
|
+
|
|
170
|
+
| Value | Implied status | Meaning |
|
|
171
|
+
|-------------------------------|-----------------|--------------------------------------------------------------------------------------------------------|
|
|
172
|
+
| `INSUFFICIENT_BALANCE` | ACTION_REQUIRED | The user's balance of `tokenAddress` on this chain is below `amount`. |
|
|
173
|
+
| `INVALID_ACCEPT_STRUCTURE` | NOT_SIGNABLE | The Merchant's original accept structure is invalid. |
|
|
174
|
+
| `UNSUPPORTED_NETWORK` | NOT_SIGNABLE | The accept's `network` is outside our supported set. |
|
|
175
|
+
| `UNSUPPORTED_SCHEME` | NOT_SIGNABLE | The accept's `scheme` is outside our supported set. |
|
|
176
|
+
| `UNSUPPORTED_METHOD` | NOT_SIGNABLE | The accept's `assetTransferMethod` is outside our supported set: `eip3009`, `permit2`, `spl-transfer`. |
|
|
177
|
+
| `NO_WALLET_ON_CHAIN` | NOT_SIGNABLE | The user's agentic wallet has no address on this chain. |
|
|
178
|
+
| `BLOCKED_BY_SECURITY_CHECK` | NOT_SIGNABLE | Security check flagged the payment as risky. |
|
|
179
|
+
| `BLOCKED_DAILY_LIMIT_REACHED` | NOT_SIGNABLE | The user's daily x402 spending limit has been reached. |
|
|
180
|
+
|
|
181
|
+
### Acting on preview result
|
|
182
|
+
|
|
183
|
+
- The returned options are pre-sorted; options earlier in the list are recommended over later ones.
|
|
184
|
+
- Only options with `status = READY_TO_SIGN` can be signed directly. `ACTION_REQUIRED` options can be signed after the user takes a remediation action; `NOT_SIGNABLE` options cannot be signed.
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## `x402-payment sign`
|
|
189
|
+
|
|
190
|
+
Sign a payment option from `preview` and return the replay x402 header.
|
|
191
|
+
|
|
192
|
+
### Syntax
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
baw x402-payment sign --paymentId <payment-id> --selectedIndex <index> --json
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Parameters
|
|
199
|
+
|
|
200
|
+
| Parameter | Required | Description |
|
|
201
|
+
|-------------------|----------|--------------------------------------------------------------------------------|
|
|
202
|
+
| `--paymentId` | Yes | The `paymentId` returned by `preview`. |
|
|
203
|
+
| `--selectedIndex` | Yes | The selected option `index` returned by `preview`. Must not be `NOT_SIGNABLE`. |
|
|
204
|
+
|
|
205
|
+
### Example
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
baw x402-payment sign --paymentId 550e8400-e29b-41d4-a716-446655440000 --selectedIndex 1 --json
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Response
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"success": true,
|
|
216
|
+
"data": {
|
|
217
|
+
"paymentHeaderName": "PAYMENT-SIGNATURE",
|
|
218
|
+
"paymentHeaderValue": "eyJ4NDAyVmVyc2lvbiI6Mi...",
|
|
219
|
+
"approveTxHash": null,
|
|
220
|
+
"binanceChainId": null,
|
|
221
|
+
"signatureExpiresAt": 1747900800
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
| Field | Description |
|
|
227
|
+
|----------------------|---------------------------------------------------------------------------------------------------------------------|
|
|
228
|
+
| `paymentHeaderName` | HTTP header name to use when replaying. For x402 v2 this is always `PAYMENT-SIGNATURE`. |
|
|
229
|
+
| `paymentHeaderValue` | HTTP header value to use when replaying. Set this as the `paymentHeaderName` header on the request to the Merchant. |
|
|
230
|
+
| `approveTxHash` | Non-null only when this sign also dispatched a Permit2 approve tx. See _Replaying the Request_. |
|
|
231
|
+
| `binanceChainId` | Binance chain ID where `approveTxHash` was dispatched. Null when no approve was dispatched. |
|
|
232
|
+
| `signatureExpiresAt` | Unix epoch seconds (UTC) after which the signature is no longer valid. See _Replaying the Request_. |
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
### Replaying the Request
|
|
237
|
+
|
|
238
|
+
- Replay the original HTTP request with the `paymentHeaderName: paymentHeaderValue` header from `sign` attached.
|
|
239
|
+
- Construct the replay request using the schema from the x402 payment requirements' `extensions` field if available.
|
|
240
|
+
- If `approveTxHash` is non-null (Permit2), wait for it to confirm (e.g. `baw wallet tx-history --tx <hash>`) before replaying.
|
|
241
|
+
- A signature can only be used once and is valid until `signatureExpiresAt`. If exceeded, restart from `preview`.
|
|
242
|
+
- The `PAYMENT-RESPONSE` response header (base64 JSON) carries settlement metadata, including the `txHash`.
|
|
243
|
+
- Infer the response body's schema before parsing it; don't parse blindly.
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Guardrails
|
|
248
|
+
|
|
249
|
+
1. **Confirm before signing.** Always confirm with the user before calling `sign`; only proceed once they've consented.
|
|
250
|
+
2. **Confirm before signing another payment option.** Always confirm with the user before switching to a different payment option, network, or token; only proceed once they've consented.
|
|
251
|
+
3. **Confirm before changing to a new resource.** Always confirm with the user before paying for a different resource or service; never silently substitute — if the current one fails, report the error and let the user decide.
|
|
252
|
+
4. **Confirm before retrying more than once.** If replaying the request fails due to a network or unknown error, retry at most once automatically. Before any further retries, confirm with the user.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Limitations
|
|
257
|
+
|
|
258
|
+
- Only x402 v2 is supported.
|
|
259
|
+
- Only BSC, Base, and Solana are supported. Ethereum is not supported.
|