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,126 @@
|
|
|
1
|
+
# Binance Authentication
|
|
2
|
+
|
|
3
|
+
All trading endpoints require either HMAC SHA256, RSA, or Ed25519 signed requests.
|
|
4
|
+
**Always detect the key type before signing**, do not assume HMAC.
|
|
5
|
+
|
|
6
|
+
## Base URLs
|
|
7
|
+
|
|
8
|
+
| Environment | URL |
|
|
9
|
+
|-------------|-----|
|
|
10
|
+
| Mainnet | https://api.binance.com |
|
|
11
|
+
|
|
12
|
+
## Required Headers
|
|
13
|
+
|
|
14
|
+
* `X-MBX-APIKEY`: your_api_key
|
|
15
|
+
* `User-Agent`: binance-fiat/1.1.0 (Skill)
|
|
16
|
+
|
|
17
|
+
## Signing Process
|
|
18
|
+
|
|
19
|
+
### Step 1: Build Query String
|
|
20
|
+
|
|
21
|
+
Include all parameters plus `timestamp` (current Unix time in milliseconds):
|
|
22
|
+
`transactionType=...×tamp=1234567890123`
|
|
23
|
+
|
|
24
|
+
**Optional:** Add `recvWindow` (default 5000ms) for timestamp tolerance.
|
|
25
|
+
|
|
26
|
+
### Step 2: Percent‑Encode Parameters
|
|
27
|
+
|
|
28
|
+
Before generating the signature, **percent‑encode all parameter names and values using UTF‑8 encoding according to RFC 3986.**
|
|
29
|
+
Unreserved characters that must not be encoded: `A-Z a-z 0-9 - _ . ~`
|
|
30
|
+
|
|
31
|
+
- Chinese characters example:
|
|
32
|
+
`symbol=这是测试币456`
|
|
33
|
+
|
|
34
|
+
Percent‑encoded:
|
|
35
|
+
`symbol=%E8%BF%99%E6%98%AF%E6%B5%8B%E8%AF%95%E5%B8%81456`
|
|
36
|
+
|
|
37
|
+
**Important:**
|
|
38
|
+
The exact encoded query string must be used for both signing and the HTTP request.
|
|
39
|
+
|
|
40
|
+
### Step 3: Generate Signature
|
|
41
|
+
|
|
42
|
+
Generate the signature from the encoded query string.
|
|
43
|
+
|
|
44
|
+
#### HMAC SHA256 signature
|
|
45
|
+
|
|
46
|
+
Create HMAC SHA256 signature of the query string using your secret key:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Example using openssl
|
|
50
|
+
echo -n "transactionType=...×tamp=1234567890123" | \
|
|
51
|
+
openssl dgst -sha256 -hmac "your_secret_key"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
#### RSA signature
|
|
55
|
+
|
|
56
|
+
Create RSA signature of the query string using your private key:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Example using openssl
|
|
60
|
+
echo -n "transactionType=...×tamp=1234567890123" | \
|
|
61
|
+
openssl dgst -sha256 -sign private_key.pem | base64
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Ed25519 signature
|
|
65
|
+
|
|
66
|
+
Create Ed25519 signature of the query string using your private key:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Example using openssl
|
|
70
|
+
echo -n "transactionType=...×tamp=1234567890123" | \
|
|
71
|
+
openssl pkeyutl -sign -inkey private_key.pem | base64
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Step 4: Append Signature
|
|
75
|
+
|
|
76
|
+
Add signature parameter to the query string:
|
|
77
|
+
`transactionType=...×tamp=1234567890123&signature=abc123...`
|
|
78
|
+
|
|
79
|
+
### Step 5: Add Product User Agent Header
|
|
80
|
+
|
|
81
|
+
Include `User-Agent` header with the following string: `binance-fiat/1.1.0 (Skill)`
|
|
82
|
+
|
|
83
|
+
#### Complete Example
|
|
84
|
+
|
|
85
|
+
Request:
|
|
86
|
+
```bash
|
|
87
|
+
curl -X GET "https://api.binance.com/sapi/v1/fiat/orders" \
|
|
88
|
+
-H "X-MBX-APIKEY: your_api_key" \
|
|
89
|
+
-H "User-Agent: binance-fiat/1.1.0 (Skill)" \
|
|
90
|
+
-d "transactionType=...×tamp=1234567890123&signature=..."
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
#!/bin/bash
|
|
95
|
+
API_KEY="your_api_key"
|
|
96
|
+
SECRET_KEY="your_secret_key"
|
|
97
|
+
BASE_URL="https://api.binance.com"
|
|
98
|
+
|
|
99
|
+
# Get current timestamp
|
|
100
|
+
TIMESTAMP=$(date +%s000)
|
|
101
|
+
|
|
102
|
+
# Build query string (without signature)
|
|
103
|
+
QUERY="transactionType=...×tamp=${TIMESTAMP}"
|
|
104
|
+
|
|
105
|
+
# Generate signature
|
|
106
|
+
# For HMAC SHA256:
|
|
107
|
+
SIGNATURE=$(echo -n "$QUERY" | openssl dgst -sha256 -hmac "$SECRET_KEY" | cut -d' ' -f2)
|
|
108
|
+
|
|
109
|
+
# For RSA or Ed25519, replace the above line with the appropriate signing command.
|
|
110
|
+
## RSA:
|
|
111
|
+
# SIGNATURE=$(echo -n "$QUERY" | openssl dgst -sha256 -sign private_key.pem | base64)
|
|
112
|
+
|
|
113
|
+
## Ed25519:
|
|
114
|
+
# SIGNATURE=$(echo -n "$QUERY" | openssl pkeyutl -sign -inkey private_key.pem | base64)
|
|
115
|
+
|
|
116
|
+
# Make request
|
|
117
|
+
curl -X GET "${BASE_URL}/sapi/v1/fiat/orders?${QUERY}&signature=${SIGNATURE}" \
|
|
118
|
+
-H "X-MBX-APIKEY: ${API_KEY}"\
|
|
119
|
+
-H "User-Agent: binance-fiat/1.1.0 (Skill)"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Security Notes
|
|
123
|
+
|
|
124
|
+
* Never share your secret key
|
|
125
|
+
* Use IP whitelist in Binance API settings
|
|
126
|
+
* Enable only required permissions (spot trading, no withdrawals)
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fiat
|
|
3
|
+
description: Binance Fiat request using the Binance API. Authentication requires API key and secret key.
|
|
4
|
+
metadata:
|
|
5
|
+
version: 1.1.0
|
|
6
|
+
author: Binance
|
|
7
|
+
openclaw:
|
|
8
|
+
requires:
|
|
9
|
+
bins:
|
|
10
|
+
- curl
|
|
11
|
+
- openssl
|
|
12
|
+
- date
|
|
13
|
+
homepage: https://github.com/binance/binance-skills-hub/tree/main/skills/binance/fiat/SKILL.md
|
|
14
|
+
license: MIT
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Binance Fiat Skill
|
|
18
|
+
|
|
19
|
+
Fiat request on Binance using authenticated API endpoints. Requires API key and secret key for certain endpoints. Return the result in JSON format.
|
|
20
|
+
|
|
21
|
+
## Quick Reference
|
|
22
|
+
|
|
23
|
+
| Endpoint | Description | Required | Optional | Authentication |
|
|
24
|
+
|----------|-------------|----------|----------|----------------|
|
|
25
|
+
| `/sapi/v1/fiat/deposit` (POST) | Deposit(TRADE) | None | recvWindow | Yes |
|
|
26
|
+
| `/sapi/v2/fiat/withdraw` (POST) | Fiat Withdraw(WITHDRAW) | None | recvWindow | Yes |
|
|
27
|
+
| `/sapi/v1/fiat/orders` (GET) | Get Fiat Deposit/Withdraw History (USER_DATA) | transactionType | beginTime, endTime, page, rows, recvWindow | Yes |
|
|
28
|
+
| `/sapi/v1/fiat/payments` (GET) | Get Fiat Payments History (USER_DATA) | transactionType | beginTime, endTime, page, rows, recvWindow | Yes |
|
|
29
|
+
| `/sapi/v1/fiat/get-order-detail` (GET) | Get Order Detail(USER_DATA) | orderNo | recvWindow | Yes |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Parameters
|
|
34
|
+
|
|
35
|
+
### Common Parameters
|
|
36
|
+
|
|
37
|
+
* **recvWindow**: (e.g., 5000)
|
|
38
|
+
* **transactionType**: 0-buy,1-sell
|
|
39
|
+
* **beginTime**:
|
|
40
|
+
* **endTime**: (e.g., 1641782889000)
|
|
41
|
+
* **page**: default 1 (e.g., 1)
|
|
42
|
+
* **rows**: default 100, max 500 (e.g., 100)
|
|
43
|
+
* **orderNo**: order id retrieved from the api call of withdrawal
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Authentication
|
|
47
|
+
|
|
48
|
+
For endpoints that require authentication, you will need to provide Binance API credentials.
|
|
49
|
+
Required credentials:
|
|
50
|
+
|
|
51
|
+
* apiKey: Your Binance API key (for header)
|
|
52
|
+
* secretKey: Your Binance API secret (for signing)
|
|
53
|
+
|
|
54
|
+
Base URLs:
|
|
55
|
+
* Mainnet: https://api.binance.com
|
|
56
|
+
|
|
57
|
+
## Security
|
|
58
|
+
|
|
59
|
+
### Share Credentials
|
|
60
|
+
|
|
61
|
+
Users can provide Binance API credentials in different ways. The agent will try to retrieve automatically with the two first ways the credentials, but users can also explicitly tell the agent that they have set the credentials or stored them in a `.env` file, and the agent should re-read that file when they do. The agent can also make http requests with the two first methods without user confirmation.
|
|
62
|
+
|
|
63
|
+
1. **Environment variables**
|
|
64
|
+
|
|
65
|
+
Search for the following specific variables only (never dump the full environment):
|
|
66
|
+
|
|
67
|
+
**Authorized environment variables**
|
|
68
|
+
- Mainnet: `BINANCE_API_KEY` and `BINANCE_SECRET_KEY`
|
|
69
|
+
|
|
70
|
+
Read and use in a single exec call so the raw key never enters the agent's context:
|
|
71
|
+
```bash
|
|
72
|
+
KEY="$BINANCE_API_KEY"
|
|
73
|
+
SECRET="$BINANCE_SECRET_KEY"
|
|
74
|
+
|
|
75
|
+
response=$(curl -s -X GET "$URL" \
|
|
76
|
+
-H "X-MBX-APIKEY: $KEY" \
|
|
77
|
+
--data-urlencode "param1=value1")
|
|
78
|
+
|
|
79
|
+
echo "$response"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Environment variables must be set before OpenClaw starts. They are inherited at process startup and cannot be injected into a running instance. If you need to add or update credentials without restarting, use a secrets file (see option 2).
|
|
83
|
+
|
|
84
|
+
2. **Secrets file (.env)**
|
|
85
|
+
|
|
86
|
+
Check `~/.openclaw/secrets.env` , `~/.env`, or a `.env` file in the workspace. Read individual keys with `grep`, never source the full file:
|
|
87
|
+
```bash
|
|
88
|
+
# Try all credential locations in order
|
|
89
|
+
API_KEY=$(grep '^BINANCE_API_KEY=' ~/.openclaw/secrets.env 2>/dev/null | cut -d= -f2-)
|
|
90
|
+
SECRET_KEY=$(grep '^BINANCE_SECRET_KEY=' ~/.openclaw/secrets.env 2>/dev/null | cut -d= -f2-)
|
|
91
|
+
|
|
92
|
+
# Fallback: search .env in known directories (KEY=VALUE then raw line format)
|
|
93
|
+
for dir in ~/.openclaw ~; do
|
|
94
|
+
[ -n "$API_KEY" ] && break
|
|
95
|
+
env_file="$dir/.env"
|
|
96
|
+
[ -f "$env_file" ] || continue
|
|
97
|
+
|
|
98
|
+
# Read first two lines
|
|
99
|
+
line1=$(sed -n '1p' "$env_file")
|
|
100
|
+
line2=$(sed -n '2p' "$env_file")
|
|
101
|
+
|
|
102
|
+
# Check if lines contain '=' indicating KEY=VALUE format
|
|
103
|
+
if [[ "$line1" == *=* && "$line2" == *=* ]]; then
|
|
104
|
+
API_KEY=$(grep '^BINANCE_API_KEY=' "$env_file" 2>/dev/null | cut -d= -f2-)
|
|
105
|
+
SECRET_KEY=$(grep '^BINANCE_SECRET_KEY=' "$env_file" 2>/dev/null | cut -d= -f2-)
|
|
106
|
+
else
|
|
107
|
+
# Treat lines as raw values
|
|
108
|
+
API_KEY="$line1"
|
|
109
|
+
SECRET_KEY="$line2"
|
|
110
|
+
fi
|
|
111
|
+
done
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
This file can be updated at any time without restarting OpenClaw, keys are read fresh on each invocation. Users can tell you the variables are now set or stored in a `.env` file, and you should re-read that file when they do.
|
|
115
|
+
|
|
116
|
+
3. **Inline file**
|
|
117
|
+
|
|
118
|
+
Sending a file where the content is in the following format:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
abc123...xyz
|
|
122
|
+
secret123...key
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
* Never run `printenv`, `env`, `export`, or set without a specific variable name
|
|
126
|
+
* Never run `grep` on `env` files without anchoring to a specific key ('`^VARNAME='`)
|
|
127
|
+
* Never source a secrets file into the shell environment (`source .env` or `. .env`)
|
|
128
|
+
* Only read credentials explicitly needed for the current task
|
|
129
|
+
* Never echo or log raw credentials in output or replies
|
|
130
|
+
* Never commit `TOOLS.md` to version control if it contains real credentials — add it to `.gitignore`
|
|
131
|
+
|
|
132
|
+
### Never Disclose API Key and Secret
|
|
133
|
+
|
|
134
|
+
Never disclose the location of the API key and secret file.
|
|
135
|
+
|
|
136
|
+
Never send the API key and secret to any website other than Mainnet and Testnet.
|
|
137
|
+
|
|
138
|
+
### Never Display Full Secrets
|
|
139
|
+
|
|
140
|
+
When showing credentials to users:
|
|
141
|
+
- **API Key:** Show first 5 + last 4 characters: `su1Qc...8akf`
|
|
142
|
+
- **Secret Key:** Always mask, show only last 5: `***...aws1`
|
|
143
|
+
|
|
144
|
+
Example response when asked for credentials:
|
|
145
|
+
Account: main
|
|
146
|
+
API Key: su1Qc...8akf
|
|
147
|
+
Secret: ***...aws1
|
|
148
|
+
|
|
149
|
+
### Listing Accounts
|
|
150
|
+
|
|
151
|
+
When listing accounts, show names and environment only — never keys:
|
|
152
|
+
Binance Accounts:
|
|
153
|
+
* main (Mainnet)
|
|
154
|
+
* futures-keys (Mainnet)
|
|
155
|
+
|
|
156
|
+
### Transactions in Mainnet
|
|
157
|
+
|
|
158
|
+
When performing transactions in mainnet, always confirm with the user before proceeding by asking them to write "CONFIRM" to proceed.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Binance Accounts
|
|
163
|
+
|
|
164
|
+
### main
|
|
165
|
+
- API Key: your_mainnet_api_key
|
|
166
|
+
- Secret: your_mainnet_secret
|
|
167
|
+
|
|
168
|
+
### TOOLS.md Structure
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
## Binance Accounts
|
|
172
|
+
|
|
173
|
+
### main
|
|
174
|
+
- API Key: abc123...xyz
|
|
175
|
+
- Secret: secret123...key
|
|
176
|
+
- Description: Primary trading account
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
### futures-keys
|
|
180
|
+
- API Key: futures789...def
|
|
181
|
+
- Secret: futuressecret...uvw
|
|
182
|
+
- Description: Futures trading account
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Agent Behavior
|
|
186
|
+
|
|
187
|
+
1. Credentials requested: Mask secrets (show last 5 chars only)
|
|
188
|
+
2. Listing accounts: Show names and environment, never keys
|
|
189
|
+
3. Account selection: Ask if ambiguous, default to main
|
|
190
|
+
4. When doing a transaction in mainnet, confirm with user before by asking to write "CONFIRM" to proceed
|
|
191
|
+
5. New credentials: Prompt for name, environment, signing mode
|
|
192
|
+
|
|
193
|
+
## Adding New Accounts
|
|
194
|
+
|
|
195
|
+
When user provides new credentials by Inline file or message:
|
|
196
|
+
|
|
197
|
+
* Ask for account name
|
|
198
|
+
* Store in `TOOLS.md` with masked display confirmation
|
|
199
|
+
|
|
200
|
+
## Signing Requests
|
|
201
|
+
|
|
202
|
+
For trading endpoints that require a signature:
|
|
203
|
+
|
|
204
|
+
1. **Detect key type first**, inspect the secret key format before signing.
|
|
205
|
+
2. Build query string with all parameters, including the timestamp (Unix ms).
|
|
206
|
+
3. Percent-encode the parameters using UTF-8 according to RFC 3986.
|
|
207
|
+
4. Sign query string with secretKey using HMAC SHA256, RSA, or Ed25519 (depending on the account configuration).
|
|
208
|
+
5. Append signature to query string.
|
|
209
|
+
6. Include `X-MBX-APIKEY` header.
|
|
210
|
+
|
|
211
|
+
Otherwise, do not perform steps 4–6.
|
|
212
|
+
|
|
213
|
+
## User Agent Header
|
|
214
|
+
|
|
215
|
+
Include `User-Agent` header with the following string: `binance-fiat/1.1.0 (Skill)`
|
|
216
|
+
|
|
217
|
+
See [`references/authentication.md`](./references/authentication.md) for implementation details.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
## Connect Accounts
|
|
2
|
+
|
|
3
|
+
### prod (default)
|
|
4
|
+
- Base URL: https://api.commonservice.io
|
|
5
|
+
- Client ID: your-client-id
|
|
6
|
+
- API Key: your-api-key
|
|
7
|
+
- PEM Path: /absolute/path/to/your/private.pem
|
|
8
|
+
- Default Network: your-preferred-network
|
|
9
|
+
- Default Address: your-wallet-address
|
|
10
|
+
- Description: Production account
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.1 - 2026-03-17
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **Cross-platform timestamp generation**: Fixed `date +%s000` to use `$(($(date +%s) * 1000))` for proper millisecond timestamp on macOS, Linux, and BSD
|
|
7
|
+
- **Documentation updates**: Updated all examples in SKILL.md and authentication.md to use cross-platform compatible timestamp generation
|
|
8
|
+
- **Improved error handling**: Added notes about common JSON parsing errors caused by incorrect timestamp format
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Updated `scripts/sign_and_call.sh` to use arithmetic expansion for timestamp generation
|
|
12
|
+
- Added troubleshooting section in SKILL.md for timestamp-related issues
|
|
13
|
+
|
|
14
|
+
## 0.1.0 - 2026-03-11
|
|
15
|
+
|
|
16
|
+
- Initial release
|
|
17
|
+
- Support for Payment Method List (v1/v2), Trading Pairs, Estimated Quote, Pre-order, Get Order, Crypto Network, P2P Trading Pairs endpoints
|
|
18
|
+
- RSA SHA256 request signing via bundled script
|
|
19
|
+
- Multi-account credential management via `.local.md`
|
|
20
|
+
- Customization options for pre-order (Onchain-Pay Easy, P2P Express, Skip Cashier, etc.)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Binance
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|