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.
Files changed (208) hide show
  1. package/COMPATIBILITY.md +58 -0
  2. package/LICENSE +21 -0
  3. package/README.md +307 -0
  4. package/README.zh-CN.md +307 -0
  5. package/SKILL.md +490 -0
  6. package/adapters/binance-ai.md +22 -0
  7. package/adapters/claude.md +21 -0
  8. package/adapters/gemini.md +26 -0
  9. package/adapters/gpt.md +28 -0
  10. package/adapters/kimi.md +26 -0
  11. package/adapters/mimo.md +22 -0
  12. package/adapters/openclaw.md +29 -0
  13. package/assets/skillpp-banner.png +0 -0
  14. package/package.json +59 -0
  15. package/pipelines.md +310 -0
  16. package/prompts/newbie-mode.md +48 -0
  17. package/prompts/router-prompt.md +32 -0
  18. package/prompts/universal-system-prompt.md +41 -0
  19. package/registry.md +209 -0
  20. package/rules.md +323 -0
  21. package/schemas/audit.schema.json +67 -0
  22. package/schemas/checkpoint.schema.json +86 -0
  23. package/schemas/handoff.schema.json +82 -0
  24. package/schemas/token.schema.json +36 -0
  25. package/scripts/compatibility-check.mjs +130 -0
  26. package/scripts/selftest.mjs +384 -0
  27. package/scripts/skillpp.mjs +448 -0
  28. package/scripts/validate-skillpp.mjs +140 -0
  29. package/skillpp.manifest.json +714 -0
  30. package/skills/audit-plus/SKILL.md +612 -0
  31. package/skills/binance/binance/CHANGELOG.md +112 -0
  32. package/skills/binance/binance/LICENSE.md +9 -0
  33. package/skills/binance/binance/SKILL.md +69 -0
  34. package/skills/binance/binance/references/algo.md +21 -0
  35. package/skills/binance/binance/references/alpha.md +9 -0
  36. package/skills/binance/binance/references/auth.md +32 -0
  37. package/skills/binance/binance/references/c2c.md +5 -0
  38. package/skills/binance/binance/references/convert.md +19 -0
  39. package/skills/binance/binance/references/copy-trading.md +6 -0
  40. package/skills/binance/binance/references/crypto-loan.md +27 -0
  41. package/skills/binance/binance/references/derivatives-options-streams.md +25 -0
  42. package/skills/binance/binance/references/derivatives-options.md +85 -0
  43. package/skills/binance/binance/references/derivatives-portfolio-margin-pro-streams.md +5 -0
  44. package/skills/binance/binance/references/derivatives-portfolio-margin-pro.md +34 -0
  45. package/skills/binance/binance/references/derivatives-portfolio-margin-streams.md +5 -0
  46. package/skills/binance/binance/references/derivatives-portfolio-margin.md +146 -0
  47. package/skills/binance/binance/references/dual-investment.md +15 -0
  48. package/skills/binance/binance/references/fiat.md +9 -0
  49. package/skills/binance/binance/references/futures-coin-streams.md +29 -0
  50. package/skills/binance/binance/references/futures-coin.md +109 -0
  51. package/skills/binance/binance/references/futures-usds-streams.md +35 -0
  52. package/skills/binance/binance/references/futures-usds.md +144 -0
  53. package/skills/binance/binance/references/gift-card.md +10 -0
  54. package/skills/binance/binance/references/margin-trading-streams.md +6 -0
  55. package/skills/binance/binance/references/margin-trading.md +101 -0
  56. package/skills/binance/binance/references/mining.md +17 -0
  57. package/skills/binance/binance/references/pay.md +5 -0
  58. package/skills/binance/binance/references/rebate.md +5 -0
  59. package/skills/binance/binance/references/simple-earn.md +56 -0
  60. package/skills/binance/binance/references/spot-streams.md +25 -0
  61. package/skills/binance/binance/references/spot.md +114 -0
  62. package/skills/binance/binance/references/staking.md +59 -0
  63. package/skills/binance/binance/references/sub-account.md +67 -0
  64. package/skills/binance/binance/references/vip-loan.md +27 -0
  65. package/skills/binance/binance/references/wallet.md +75 -0
  66. package/skills/binance/fiat/CHANGELOG.md +11 -0
  67. package/skills/binance/fiat/LICENSE.md +9 -0
  68. package/skills/binance/fiat/SKILL.md +169 -0
  69. package/skills/binance/fiat/references/authentication.md +126 -0
  70. package/skills/binance/fiat/references/sapi-endpoints.md +217 -0
  71. package/skills/binance/onchain-pay/.local.md.example +10 -0
  72. package/skills/binance/onchain-pay/CHANGELOG.md +20 -0
  73. package/skills/binance/onchain-pay/LICENSE.md +9 -0
  74. package/skills/binance/onchain-pay/SKILL.md +466 -0
  75. package/skills/binance/onchain-pay/references/authentication.md +92 -0
  76. package/skills/binance/onchain-pay/scripts/sign_and_call.sh +52 -0
  77. package/skills/binance/p2p/CHANGELOG.md +33 -0
  78. package/skills/binance/p2p/LICENSE.md +9 -0
  79. package/skills/binance/p2p/SKILL.md +1082 -0
  80. package/skills/binance/p2p/references/agent-sapi-api.md +795 -0
  81. package/skills/binance/p2p/references/authentication.md +100 -0
  82. package/skills/binance/payment/SKILL.md +824 -0
  83. package/skills/binance/payment/common.py +560 -0
  84. package/skills/binance/payment/payment_skill.py +86 -0
  85. package/skills/binance/payment/receive.py +109 -0
  86. package/skills/binance/payment/references/setup-guide.md +77 -0
  87. package/skills/binance/payment/requirements.txt +4 -0
  88. package/skills/binance/payment/send.py +952 -0
  89. package/skills/binance/payment/send_extension/__init__.py +43 -0
  90. package/skills/binance/payment/send_extension/base.py +48 -0
  91. package/skills/binance/payment/send_extension/c2c.py +193 -0
  92. package/skills/binance/payment/send_extension/pix.py +316 -0
  93. package/skills/binance/square-post/README.md +62 -0
  94. package/skills/binance/square-post/SKILL.md +171 -0
  95. package/skills/binance/square-post/scripts/lib.mjs +175 -0
  96. package/skills/binance/square-post/scripts/post-image.mjs +80 -0
  97. package/skills/binance/square-post/scripts/post-text.mjs +41 -0
  98. package/skills/binance/square-post/scripts/post-video.mjs +110 -0
  99. package/skills/binance/square-post/scripts/save-key.mjs +34 -0
  100. package/skills/binance-web3/binance-agentic-wallet/SKILL.md +150 -0
  101. package/skills/binance-web3/binance-agentic-wallet/references/authentication.md +136 -0
  102. package/skills/binance-web3/binance-agentic-wallet/references/limit-order.md +204 -0
  103. package/skills/binance-web3/binance-agentic-wallet/references/market-order.md +179 -0
  104. package/skills/binance-web3/binance-agentic-wallet/references/prediction.md +489 -0
  105. package/skills/binance-web3/binance-agentic-wallet/references/preflight.md +66 -0
  106. package/skills/binance-web3/binance-agentic-wallet/references/security.md +47 -0
  107. package/skills/binance-web3/binance-agentic-wallet/references/send.md +53 -0
  108. package/skills/binance-web3/binance-agentic-wallet/references/wallet-setting.md +86 -0
  109. package/skills/binance-web3/binance-agentic-wallet/references/wallet-view.md +312 -0
  110. package/skills/binance-web3/binance-agentic-wallet/references/x402-payment.md +259 -0
  111. package/skills/binance-web3/binance-tokenized-securities-info/SKILL.md +613 -0
  112. package/skills/binance-web3/crypto-market-rank/SKILL.md +91 -0
  113. package/skills/binance-web3/crypto-market-rank/references/cli.md +219 -0
  114. package/skills/binance-web3/crypto-market-rank/scripts/cli.mjs +149 -0
  115. package/skills/binance-web3/meme-rush/SKILL.md +72 -0
  116. package/skills/binance-web3/meme-rush/references/cli.md +158 -0
  117. package/skills/binance-web3/meme-rush/scripts/cli.mjs +101 -0
  118. package/skills/binance-web3/query-address-info/SKILL.md +61 -0
  119. package/skills/binance-web3/query-address-info/references/cli.md +56 -0
  120. package/skills/binance-web3/query-address-info/scripts/cli.mjs +132 -0
  121. package/skills/binance-web3/query-token-audit/SKILL.md +162 -0
  122. package/skills/binance-web3/query-token-info/SKILL.md +83 -0
  123. package/skills/binance-web3/query-token-info/references/cli.md +135 -0
  124. package/skills/binance-web3/query-token-info/scripts/cli.mjs +112 -0
  125. package/skills/binance-web3/trading-signal/SKILL.md +66 -0
  126. package/skills/binance-web3/trading-signal/references/cli.md +90 -0
  127. package/skills/binance-web3/trading-signal/scripts/cli.mjs +92 -0
  128. package/skills/four-meme/four-guard/API-Contract-TaxToken.md +277 -0
  129. package/skills/four-meme/four-guard/API-CreateToken.02-02-2026.md +285 -0
  130. package/skills/four-meme/four-guard/API-Documents.03-03-2026.md +789 -0
  131. package/skills/four-meme/four-guard/AgentIdentifier.abi +585 -0
  132. package/skills/four-meme/four-guard/README.md +21 -0
  133. package/skills/four-meme/four-guard/SKILL.md +31 -0
  134. package/skills/four-meme/four-guard/TaxToken.abi +969 -0
  135. package/skills/four-meme/four-guard/TokenIdentifierSample.js_ +81 -0
  136. package/skills/four-meme/four-guard/TokenIdentifierSample.sol +69 -0
  137. package/skills/four-meme/four-guard/TokenManager.lite.abi +836 -0
  138. package/skills/four-meme/four-guard/TokenManager2.lite.abi +2325 -0
  139. package/skills/four-meme/four-guard/TokenManagerHelper3.abi +999 -0
  140. package/skills/four-meme/four-guard/go.mod +36 -0
  141. package/skills/four-meme/four-guard/go.sum +127 -0
  142. package/skills/four-meme/four-guard/main.go +183 -0
  143. package/skills/four-meme/four-meme-ai/SKILL.md +31 -0
  144. package/skills/four-meme/four-meme-ai/references/agent-creator-and-wallets.md +87 -0
  145. package/skills/four-meme/four-meme-ai/references/api-create-token.md +55 -0
  146. package/skills/four-meme/four-meme-ai/references/contract-addresses.md +47 -0
  147. package/skills/four-meme/four-meme-ai/references/create-token-scripts.md +131 -0
  148. package/skills/four-meme/four-meme-ai/references/errors.md +29 -0
  149. package/skills/four-meme/four-meme-ai/references/event-listening.md +75 -0
  150. package/skills/four-meme/four-meme-ai/references/execute-trade.md +31 -0
  151. package/skills/four-meme/four-meme-ai/references/tax-token-query.md +38 -0
  152. package/skills/four-meme/four-meme-ai/references/token-query-api.md +44 -0
  153. package/skills/four-meme/four-meme-ai/references/token-tax-info.md +77 -0
  154. package/skills/four-meme/four-meme-ai/scripts/8004-balance.ts +52 -0
  155. package/skills/four-meme/four-meme-ai/scripts/8004-register.ts +108 -0
  156. package/skills/four-meme/four-meme-ai/scripts/create-token-api.ts +321 -0
  157. package/skills/four-meme/four-meme-ai/scripts/create-token-chain.ts +102 -0
  158. package/skills/four-meme/four-meme-ai/scripts/create-token-instant.ts +106 -0
  159. package/skills/four-meme/four-meme-ai/scripts/execute-buy.ts +198 -0
  160. package/skills/four-meme/four-meme-ai/scripts/execute-sell.ts +150 -0
  161. package/skills/four-meme/four-meme-ai/scripts/get-public-config.ts +25 -0
  162. package/skills/four-meme/four-meme-ai/scripts/get-recent-events.ts +76 -0
  163. package/skills/four-meme/four-meme-ai/scripts/get-tax-token-info.ts +69 -0
  164. package/skills/four-meme/four-meme-ai/scripts/get-token-info.ts +94 -0
  165. package/skills/four-meme/four-meme-ai/scripts/quote-buy.ts +85 -0
  166. package/skills/four-meme/four-meme-ai/scripts/quote-sell.ts +66 -0
  167. package/skills/four-meme/four-meme-ai/scripts/send-token.ts +98 -0
  168. package/skills/four-meme/four-meme-ai/scripts/token-get.ts +31 -0
  169. package/skills/four-meme/four-meme-ai/scripts/token-list.ts +134 -0
  170. package/skills/four-meme/four-meme-ai/scripts/token-rankings.ts +162 -0
  171. package/skills/four-meme/four-meme-ai/scripts/verify-events.ts +47 -0
  172. package/skills/four-meme/four-meme-integration/SKILL.md +374 -0
  173. package/skills/four-meme/four-meme-integration/references/agent-creator-and-wallets.md +87 -0
  174. package/skills/four-meme/four-meme-integration/references/api-create-token.md +55 -0
  175. package/skills/four-meme/four-meme-integration/references/contract-addresses.md +47 -0
  176. package/skills/four-meme/four-meme-integration/references/create-token-scripts.md +131 -0
  177. package/skills/four-meme/four-meme-integration/references/errors.md +29 -0
  178. package/skills/four-meme/four-meme-integration/references/event-listening.md +75 -0
  179. package/skills/four-meme/four-meme-integration/references/execute-trade.md +31 -0
  180. package/skills/four-meme/four-meme-integration/references/tax-token-query.md +38 -0
  181. package/skills/four-meme/four-meme-integration/references/token-query-api.md +44 -0
  182. package/skills/four-meme/four-meme-integration/references/token-tax-info.md +77 -0
  183. package/skills/four-meme/four-meme-integration/scripts/8004-balance.ts +52 -0
  184. package/skills/four-meme/four-meme-integration/scripts/8004-register.ts +108 -0
  185. package/skills/four-meme/four-meme-integration/scripts/create-token-api.ts +321 -0
  186. package/skills/four-meme/four-meme-integration/scripts/create-token-chain.ts +102 -0
  187. package/skills/four-meme/four-meme-integration/scripts/create-token-instant.ts +106 -0
  188. package/skills/four-meme/four-meme-integration/scripts/execute-buy.ts +198 -0
  189. package/skills/four-meme/four-meme-integration/scripts/execute-sell.ts +150 -0
  190. package/skills/four-meme/four-meme-integration/scripts/get-public-config.ts +25 -0
  191. package/skills/four-meme/four-meme-integration/scripts/get-recent-events.ts +76 -0
  192. package/skills/four-meme/four-meme-integration/scripts/get-tax-token-info.ts +69 -0
  193. package/skills/four-meme/four-meme-integration/scripts/get-token-info.ts +94 -0
  194. package/skills/four-meme/four-meme-integration/scripts/quote-buy.ts +85 -0
  195. package/skills/four-meme/four-meme-integration/scripts/quote-sell.ts +66 -0
  196. package/skills/four-meme/four-meme-integration/scripts/send-token.ts +98 -0
  197. package/skills/four-meme/four-meme-integration/scripts/token-get.ts +31 -0
  198. package/skills/four-meme/four-meme-integration/scripts/token-list.ts +134 -0
  199. package/skills/four-meme/four-meme-integration/scripts/token-rankings.ts +162 -0
  200. package/skills/four-meme/four-meme-integration/scripts/verify-events.ts +47 -0
  201. package/skills/skillpp/contract-profiler/SKILL.md +118 -0
  202. package/skills/skillpp/newbie-tutor/SKILL.md +85 -0
  203. package/skills/skillpp/opportunity-board/SKILL.md +87 -0
  204. package/skills/skillpp/risk-fusion/SKILL.md +146 -0
  205. package/skills/skillpp/scam-pattern-lab/SKILL.md +115 -0
  206. package/skills/skillpp/wallet-doctor/SKILL.md +119 -0
  207. package/skills/skillpp/watchtower/SKILL.md +72 -0
  208. package/tests/compatibility/v0.1.0.json +117 -0
@@ -0,0 +1,1082 @@
1
+ ---
2
+ name: p2p
3
+ description: |
4
+ Binance P2P trading assistant for natural-language queries about P2P/C2C market ads, the user's own P2P order history, order detail & appeal tracking, and advertisement publish & management.
5
+
6
+ Use when the user asks about P2P prices, searching/choosing ads, comparing payment methods, reviewing P2P order history, checking order detail/appeal status, querying complaints, publishing/updating/managing P2P advertisements, or viewing merchant profiles.
7
+
8
+ Do NOT use for spot/futures prices, exchange trading, deposits/withdrawals, on-chain transfers, or anything unrelated to P2P/C2C.
9
+ ---
10
+
11
+ # Binance P2P Trading Skill
12
+
13
+ Help users interact with **Binance P2P (C2C)** via natural-language queries.
14
+
15
+ ## When to Use / When NOT to Use
16
+
17
+ ### Use this skill when the user wants to:
18
+ - Check **P2P** buy/sell quotes for a crypto/fiat pair (e.g., USDT/CNY).
19
+ - Search **P2P advertisements** and filter by payment method(s), limits, merchant quality.
20
+ - Compare prices across payment methods (e.g., Alipay vs bank transfer).
21
+ - View **their own P2P order history / summary** (requires API key).
22
+ - Query **order detail** and view full order timeline (requires API key).
23
+ - Check **appeal/complaint status** and view complaint history (requires API key).
24
+ - **Submit evidence** for an existing appeal (upload files + submit description) (requires API key).
25
+ - **View complaint process timeline** (flow of actions, CS notes, evidence) (requires API key).
26
+ - **Cancel an existing appeal** (withdraw complaint, irreversible) (requires API key).
27
+ - **View available complaint reasons** for an order (requires API key).
28
+ - **Publish, update, or manage P2P advertisements** (requires API key + merchant permission).
29
+ - View **merchant profiles** and their ad listings (requires API key).
30
+ - Query **supported digital and fiat currencies** (requires API key).
31
+
32
+ ### Do NOT use this skill when the user asks about:
33
+ - Spot/Convert prices, futures/derivatives, margin, trading bots.
34
+ - Deposits/withdrawals, wallet transfers, on-chain transactions.
35
+ - Creating/cancelling orders, releasing coins (trading operations). Cancelling **appeals** (complaints) IS supported.
36
+ - Initiating new appeals (submit-complaint is deferred; evidence supplement for existing appeals IS supported).
37
+ - Sending chat messages in order conversations.
38
+
39
+ ### Ask clarifying questions (do not guess) if any key inputs are missing:
40
+ - `fiat` (e.g., CNY)
41
+ - `asset` (e.g., USDT)
42
+ - user intent: **buy crypto** or **sell crypto**
43
+ - preferred payment method(s)
44
+ - target amount (optional but recommended for ad filtering)
45
+
46
+ ## Core Concepts
47
+
48
+ ### `tradeType` mapping (avoid ambiguity)
49
+ - User wants to **buy crypto** (pay fiat, receive USDT/BTC) → `tradeType=BUY`
50
+ - User wants to **sell crypto** (receive fiat, pay USDT/BTC) → `tradeType=SELL`
51
+
52
+ Always reflect this mapping in responses when the user's wording is ambiguous.
53
+
54
+ ## Capabilities
55
+
56
+ ### Phase 1 — Public Market (No Auth)
57
+ - Quote P2P prices
58
+ - Search ads
59
+ - Compare payment methods
60
+ - Filter/Rank ads by limits and merchant indicators
61
+
62
+ ### Phase 2 — Personal Orders (Requires API Key)
63
+ - List P2P order history
64
+ - Filter by trade type / time range
65
+ - Provide summary statistics
66
+
67
+ ### Phase 3 — Order & Appeal + Ad Publish & Management (Requires API Key)
68
+ - Query order detail by order number
69
+ - List orders with rich filters (status, trade type, asset, date range)
70
+ - View order timeline (creation → payment → release → completion)
71
+ - Detect appeal status and show appeal details
72
+ - Query complaint/appeal records with filters
73
+ - Get market reference prices for pricing decisions
74
+ - Upload appeal evidence files (S3 presigned URL + submit)
75
+ - View complaint process timeline / flow details
76
+ - Cancel an existing appeal / withdraw complaint
77
+ - Get available complaint reasons for an order
78
+ - Search and analyze market ad distribution
79
+ - Get available ad categories for current user
80
+ - Get user's configured payment methods
81
+ - List all system trade methods
82
+ - Publish new advertisements (with confirmation)
83
+ - Update existing ad parameters (with confirmation)
84
+ - Update ad status: online / offline / close (with confirmation)
85
+ - View merchant profile and ad listings
86
+ - List all supported digital currencies
87
+ - List all supported fiat currencies
88
+
89
+ ## Environment Configuration
90
+
91
+ ### Base URLs (production)
92
+
93
+ | Logical Name | URL |
94
+ |-------------|-----|
95
+ | `SAPI_BASE` | `https://api.binance.com` |
96
+ | `MGS_BASE` | `https://www.binance.com` |
97
+ | `C2C_WEB` | `https://c2c.binance.com` |
98
+
99
+ ### Implementation hint (for code generation)
100
+
101
+ When the skill generates curl / Python / JS code, use these fixed base URLs:
102
+
103
+ ```python
104
+ import os
105
+
106
+ SAPI_BASE = "https://api.binance.com"
107
+ MGS_BASE = "https://www.binance.com"
108
+ C2C_WEB = "https://c2c.binance.com"
109
+
110
+ def common_headers(api_key: str) -> dict:
111
+ return {
112
+ "X-MBX-APIKEY": api_key,
113
+ "User-Agent": "binance-wallet/1.0.0 (Skill)",
114
+ }
115
+
116
+ # Usage:
117
+ # f"{SAPI_BASE}/sapi/v1/c2c/agent/orderMatch/getUserOrderDetail"
118
+ # f"{MGS_BASE}/bapi/c2c/v1/public/c2c/agent/quote-price"
119
+ # f"{C2C_WEB}/en/adv?code={advNo}"
120
+ # headers = common_headers(os.getenv("BINANCE_API_KEY"))
121
+ ```
122
+
123
+ ```bash
124
+ # Bash equivalent:
125
+ SAPI_BASE="https://api.binance.com"
126
+ MGS_BASE="https://www.binance.com"
127
+ C2C_WEB="https://c2c.binance.com"
128
+ ```
129
+
130
+ > **Note:** SAPI signing uses HMAC SHA256, no param sorting required.
131
+
132
+ ## Security & Privacy Rules
133
+
134
+ ### Credentials
135
+ - Required env vars:
136
+ - `BINANCE_API_KEY` (sent as header)
137
+ - `BINANCE_SECRET_KEY` (used for signing)
138
+
139
+ ### Never display full secrets
140
+ - API Key: show **first 5 + last 4** characters: `abc12...z789`
141
+ - Secret Key: always mask; show **only last 5**: `***...c123`
142
+
143
+ ### Permission minimization
144
+ - Binance API permissions: **Enable Reading** only (Phase 1/2).
145
+ - Phase 3 ad management additionally needs write permissions.
146
+ - Do NOT request/encourage withdrawal or modification permissions beyond what's needed.
147
+
148
+ ### Storage guidance
149
+ - Prefer environment injection (session/runtime env vars) over writing to disk.
150
+ - Only write to `.env` if the user explicitly agrees.
151
+ - Ensure `.env` is in `.gitignore` before saving.
152
+
153
+ ## ⚠️ CRITICAL: SAPI Signing (Different from Standard Binance API)
154
+
155
+ ### Parameter ordering
156
+ - **DO NOT sort parameters** for SAPI requests.
157
+ - Keep original insertion order when building the query string.
158
+
159
+ Example:
160
+ ```py
161
+ # ✅ Correct for SAPI: keep insertion order
162
+ params = {"page": 1, "rows": 20, "timestamp": 1710460800000}
163
+ query_string = urlencode(params) # NO sorting
164
+
165
+ # ❌ Wrong (standard Binance API only): sorted
166
+ query_string = urlencode(sorted(params.items()))
167
+ ```
168
+
169
+ ### Signing details
170
+ See: `references/authentication.md` for:
171
+ - RFC 3986 percent-encoding
172
+ - HMAC SHA256 signing process
173
+ - Required headers (incl. User-Agent)
174
+ - SAPI-specific parameter ordering
175
+
176
+ ## API Overview
177
+
178
+ ### Public Queries (MGS C2C Agent API — No Auth)
179
+ Base URL: `https://www.binance.com`
180
+
181
+ | Endpoint | Method | Params | Usage |
182
+ |----------|--------|--------|-------|
183
+ | `/bapi/c2c/v1/public/c2c/agent/quote-price` | GET | fiat, asset, tradeType | Quick price quote |
184
+ | `/bapi/c2c/v1/public/c2c/agent/ad-list` | GET | fiat, asset, tradeType, limit, order, tradeMethodIdentifiers | Search ads |
185
+ | `/bapi/c2c/v1/public/c2c/agent/trade-methods` | GET | fiat | Payment methods |
186
+
187
+ Parameter notes:
188
+ - `tradeType`: `BUY` or `SELL` (treat as case-insensitive)
189
+ - `limit`: 1–20 (default 10)
190
+ - `tradeMethodIdentifiers`: pass as a **plain string** (not JSON array) — e.g. `tradeMethodIdentifiers=BANK` or `tradeMethodIdentifiers=WECHAT`. Values **must** use the `identifier` field returned by the `trade-methods` endpoint (see workflow below). ⚠️ Do NOT use JSON array syntax like `["BANK"]` — it will return empty results.
191
+
192
+ ### Workflow: Compare Prices by Payment Method
193
+
194
+ When the user wants to compare prices across payment methods (e.g., "Alipay vs WeChat"), follow this two-step flow:
195
+
196
+ **Step 1** — Call `trade-methods` to get the correct identifiers for the target fiat:
197
+ ```
198
+ GET /bapi/c2c/v1/public/c2c/agent/trade-methods?fiat=CNY
199
+ → [{"identifier":"ALIPAY",...}, {"identifier":"WECHAT",...}, {"identifier":"BANK",...}]
200
+ ```
201
+
202
+ **Step 2** — Pass the identifier as a plain string into `ad-list` via `tradeMethodIdentifiers`, one payment method per request, then compare:
203
+ ```
204
+ GET /bapi/c2c/v1/public/c2c/agent/ad-list?fiat=CNY&asset=USDT&tradeType=BUY&limit=5&tradeMethodIdentifiers=ALIPAY&tradeMethodIdentifiers=WECHAT
205
+ ```
206
+ Compare the best price from each result set.
207
+
208
+ > **Important:** Do not hardcode identifier values like `"Alipay"` or `"BANK"`. Always call `trade-methods` first to get the exact `identifier` strings for the given fiat currency.
209
+
210
+ ### Personal Orders (Binance SAPI — Requires Auth)
211
+ Base URL: `https://api.binance.com`
212
+
213
+ | Endpoint | Method | Auth | Usage |
214
+ |----------|--------|------|-------|
215
+ | `/sapi/v1/c2c/orderMatch/listUserOrderHistory` | GET | Yes | Order history |
216
+ | `/sapi/v1/c2c/orderMatch/getUserOrderSummary` | GET | Yes | User statistics |
217
+
218
+ Authentication requirements:
219
+ - Header: `X-MBX-APIKEY`
220
+ - Query: `timestamp` + `signature`
221
+ - Header: `User-Agent: binance-wallet/1.0.0 (Skill)`
222
+
223
+ ## Output Format Guidelines
224
+
225
+ ### Price quote
226
+ - Show both sides when available (best buy / best sell).
227
+ - Use fiat symbol and 2-decimal formatting.
228
+
229
+ Example:
230
+ ```
231
+ USDT/CNY (P2P)
232
+ - Buy USDT (you buy crypto): ¥7.20
233
+ - Sell USDT (you sell crypto): ¥7.18
234
+ ```
235
+
236
+ ### Ad list
237
+ Return **Top N** items with a stable schema:
238
+ 1) adNo (ad number / identifier)
239
+ 2) price (fiat)
240
+ 3) merchant name
241
+ 4) completion rate
242
+ 5) limits
243
+ 6) payment methods (identifiers)
244
+
245
+ Avoid generating parameterized external URLs unless the API returns them.
246
+
247
+ **Placing orders (when user requests):**
248
+ - This skill does NOT support automated order placement.
249
+ - When user wants to place an order, provide a direct link to the specific ad using the adNo:
250
+ ```
251
+ https://c2c.binance.com/en/adv?code={adNo}
252
+ ```
253
+ - `{adNo}`: the ad number/identifier from the ad list result
254
+
255
+ Example: `https://c2c.binance.com/en/adv?code=123`
256
+ - This opens the specific ad detail page where user can place order directly with the selected advertisement.
257
+
258
+ ### Personal orders
259
+ - Time format: `YYYY-MM-DD HH:mm (UTC+0)` — always display in UTC timezone
260
+ - Include: type, asset/fiat, amount, total, status
261
+ - Provide a brief summary line (count + totals) when filtering
262
+
263
+ **Time field conversion (for `createTime` in `listUserOrderHistory`):**
264
+ - The `createTime` field returns a Unix timestamp in **milliseconds** (13 digits).
265
+ - Convert to human-readable format in **UTC+0 timezone**:
266
+ ```
267
+ # Python example
268
+ from datetime import datetime, timezone
269
+ readable_time = datetime.fromtimestamp(createTime / 1000, tz=timezone.utc).strftime('%Y-%m-%d %H:%M (UTC+0)')
270
+
271
+ # JavaScript example
272
+ const readableTime = new Date(createTime).toISOString().replace('T', ' ').slice(0, 16) + ' (UTC+0)';
273
+ // Or more explicitly:
274
+ const date = new Date(createTime);
275
+ const readableTime = date.getUTCFullYear() + '-' +
276
+ String(date.getUTCMonth() + 1).padStart(2, '0') + '-' +
277
+ String(date.getUTCDate()).padStart(2, '0') + ' ' +
278
+ String(date.getUTCHours()).padStart(2, '0') + ':' +
279
+ String(date.getUTCMinutes()).padStart(2, '0') + ' (UTC+0)';
280
+ ```
281
+ - Always display the converted time to users with timezone info, not the raw timestamp.
282
+
283
+ ## Error Handling (User-Facing)
284
+
285
+ - Invalid API key (-2015): prompt to verify `.env` / API Management.
286
+ - Signature failed (-1022): warn about wrong secret, sorted params, or stale timestamp.
287
+ - Timestamp invalid (-1021): advise time sync / regenerate timestamp.
288
+ - Rate limit: ask to retry later.
289
+
290
+ ## Limitations (By Design)
291
+
292
+ This skill does NOT:
293
+ - Place/cancel orders
294
+ - Mark as paid / release coins
295
+ - Initiate new appeals / submit-complaint (only evidence supplement for existing appeals is supported)
296
+ - Post/modify advertisements (Phase 1/2 only — Phase 3 adds ad management for merchants)
297
+ - Expose sensitive order-detail endpoints beyond what's needed for history/summary
298
+
299
+ For in-app actions, guide users to the official P2P orders page (only as a general entry point).
300
+
301
+ ## Developer Notes
302
+
303
+ ### Version Check (First Invocation per Conversation)
304
+ On the first invocation of this skill per conversation, call:
305
+
306
+ - `GET /bapi/c2c/v1/public/c2c/agent/check-version?version=2.0.0` (Base: `https://www.binance.com`)
307
+
308
+ Behavior:
309
+ - If `needUpdate=true`: show: `New version of P2P Skill is available (current: {clientVersion}, latest: {latestVersion}), update recommended.`
310
+ - Else / on failure: proceed silently.
311
+
312
+ ### Client-side operations
313
+ - Asset filtering: if API doesn't support it, fetch then filter locally.
314
+ - Aggregations: compute totals client-side when summary endpoint is insufficient.
315
+
316
+ ---
317
+
318
+ # Phase 3 — Order & Appeal + Ad Publish & Management
319
+
320
+ Phase 3 extends the skill from read-only market/order queries to **write operations** (ad management) and **advanced order workflows** (order detail, appeal/complaint tracking).
321
+
322
+ ## Phase 3 Design Constraints
323
+
324
+ | Constraint | Details |
325
+ |-----------|---------|
326
+ | Authentication | All Phase 3 features require API Key + Secret Key |
327
+ | Write-op confirmation | Any write operation (publish ad, update ad, change status) **must show an operation summary and get explicit user confirmation** before executing |
328
+ | API Key permissions | Phase 1 only needed "Enable Reading"; Phase 3 additionally needs write permissions for ad management |
329
+ | Privacy masking | Never display counterparty sensitive info (bank card, Alipay account, phone, email, real name) or internal IDs (`payId`). Even if the API returns these fields, **filter them out in user-facing output**. For payment methods, show only `tradeMethodName` (e.g. "支付宝") |
330
+
331
+ ---
332
+
333
+ ## Scene 1: Order Query & Appeal Handling
334
+
335
+ ### 1.1 Query Order Detail
336
+
337
+ **Trigger examples:**
338
+ - "查看订单 20260315123456 的详情"
339
+ - "我最近那笔 USDT 买入订单怎么样了?"
340
+ - "帮我查一下这个订单号"
341
+ - "Show me the details of order 20260315123456"
342
+
343
+ **Behavior:**
344
+ 1. If user provides an order number → call `getUserOrderDetail`
345
+ 2. If user describes an order vaguely → call `listOrders` with filters, then let user pick
346
+ 3. Based on order status, branch:
347
+
348
+ **Status branch handling:**
349
+
350
+ | Status | Action |
351
+ |--------|--------|
352
+ | Completed (4) | Show full timeline (create → pay → confirm → complete), finish |
353
+ | Cancelled (6) / Expired (7) | Show cancel reason (timeout / manual / system), finish |
354
+ | In Progress (1=Unpaid, 2=Paid, 3=Releasing) | Show current step + countdown timers |
355
+ | In Appeal (5) | Auto-enter 1.2 — show appeal status |
356
+
357
+ **Output format (Order Detail):**
358
+ ```
359
+ 📋 Order No: {orderNumber}
360
+ ├─ Type: {tradeType} {asset}
361
+ ├─ Amount: {amount} {asset} @ {price} {fiatUnit}
362
+ ├─ Total: {fiatSymbol}{totalPrice}
363
+ ├─ Status: {orderStatus description}
364
+ ├─ Counterparty: {buyerNickname / sellerNickname}
365
+ ├─ Created: {createTime in UTC+0}
366
+
367
+ ├─ Timeline:
368
+ │ ├─ Created: {createTime}
369
+ │ ├─ Paid: {notifyPayTime or "—"}
370
+ │ ├─ Confirmed: {confirmPayTime or "—"}
371
+ │ └─ Cancelled: {cancelTime or "—"}
372
+
373
+ ├─ Commission: maker {commissionRate}% = {commission} {asset}
374
+ │ taker {takerCommissionRate}% = {takerCommission} {asset}
375
+ └─ Complaint: {isComplaintAllowed ? "Allowed" : "Not Allowed"} | Status: {complaintStatus or "None"}
376
+ ```
377
+
378
+ **Countdown display (for in-progress orders):**
379
+ - If status=1 (Unpaid): show "Payment deadline: {notifyPayEndTime}" with remaining time
380
+ - If status=2 (Paid): show "Release deadline: {confirmPayEndTime}" with remaining time
381
+
382
+ ### 1.2 View Appeal / Complaint Status
383
+
384
+ **Trigger:**
385
+ - Automatically when order status = In Appeal (5)
386
+ - "这个申诉进展到哪了?"
387
+ - "订单 20260315123456 的申诉怎么样了?"
388
+ - "What's the appeal status?"
389
+
390
+ **Behavior:**
391
+ 1. Call `query-complaints` with the order number
392
+ 2. Display complaint info in structured format
393
+
394
+ **Output format:**
395
+ ```
396
+ ⚠️ Appeal Status for Order {orderNo}
397
+ ├─ Complaint No: {complaintNo}
398
+ ├─ Status: {complaintStatus description}
399
+ ├─ Role: {roleIdentity} (COMPLAINANT / RESPONDENT)
400
+ ├─ Reason: {reason}
401
+ ├─ Created: {complaintCreateTime}
402
+ ├─ Order Asset: {orderAsset} | Fiat: {orderFiat}
403
+ ├─ Order Amount: {orderAmount} ({fiatSymbol})
404
+ ├─ Amount in USDT: {orderAmountInUsdt}
405
+ └─ Dispute Amount: {disputeAmount}
406
+ ```
407
+
408
+ **Follow-up guidance (append after the status block, based on complaintStatus):**
409
+
410
+ | complaintStatus | Guidance to show |
411
+ |----------------|------------------|
412
+ | 0 (Respondent Processing) | "Waiting for the counterparty to respond. You will be notified when there is an update." |
413
+ | 1 (Complainant Processing) | "⚡ Action needed — you need to provide evidence or respond. Say **\"submit evidence for order {orderNo}\"** to upload proof now." |
414
+ | 2 (CS Processing) | "💡 Both parties may still submit evidence at this stage. You can submit evidence directly through this skill — say **\"submit evidence for order {orderNo}\"** or **\"提交证据\"** to upload payment proof, screenshots, or other supporting documents." |
415
+ | 3 (Completed) | "This appeal has been resolved." |
416
+ | 4 (Cancelled) | "This appeal has been cancelled." |
417
+
418
+ > **MUST follow:** When `complaintStatus` is 0, 1, or 2 (appeal still active), NEVER tell the user to "go to the app" or "head to the dispute center". Always guide them to use this skill to submit evidence. The skill supports the full evidence upload flow (Scene 1.5).
419
+
420
+ **Complaint status mapping:**
421
+
422
+ | Status Code | Display Name | Description |
423
+ |------------|-------------|-------------|
424
+ | 0 | Respondent Processing (被申诉人处理中) | Complaint initiated, waiting for counterparty to respond |
425
+ | 1 | Complainant Processing (申诉人处理中) | Waiting for complainant to provide evidence or take action |
426
+ | 2 | CS Processing (客服处理中) | Customer service reviewing; both parties may submit evidence |
427
+ | 3 | Completed (已完成) | Appeal resolved |
428
+ | 4 | Complaint Cancelled (申诉取消) | Appeal withdrawn |
429
+
430
+ > **Important:** Do NOT confuse these with `orderStatus` codes — they are separate enums.
431
+ > When `complaintStatus=2` (CS Processing), the user should be guided to submit evidence if needed; do NOT tell them to "wait for counterparty".
432
+
433
+ ### 1.3 Complaint History Query
434
+
435
+ **Trigger:**
436
+ - "查看我的所有申诉记录"
437
+ - "最近3个月有哪些申诉?"
438
+ - "List my complaints as complainant"
439
+
440
+ **Behavior:**
441
+ 1. Call `query-complaints` with optional filters (roleIdentity, status, date range)
442
+ 2. Default: last 90 days if no date specified
443
+ 3. Show paginated results
444
+
445
+ **Output format:**
446
+ ```
447
+ 📋 Complaint Records (Total: {total})
448
+ ┌───────────┬──────────────┬──────────┬────────┬───────────────┐
449
+ │ Order No │ Complaint No │ Status │ Role │ Created │
450
+ ├───────────┼──────────────┼──────────┼────────┼───────────────┤
451
+ │ {orderNo} │ {no} │ {status} │ {role} │ {time UTC+0} │
452
+ └───────────┴──────────────┴──────────┴────────┴───────────────┘
453
+ ```
454
+
455
+ ### 1.4 Order List & History
456
+
457
+ **Trigger:**
458
+ - "查看我的订单列表"
459
+ - "最近的 USDT 买入订单"
460
+ - "Show my completed orders this week"
461
+
462
+ **Behavior:**
463
+ - For active/recent orders → use `listOrders` (richer filter: advNo, status, payType)
464
+ - For historical orders → use `listUserOrderHistory` (supports tradeType, date range)
465
+
466
+ **Output format (Order List):**
467
+ ```
468
+ 📋 Orders (Page {page}, Total: {total})
469
+ ┌──────────────┬──────┬───────┬──────────────┬────────┬───────────────┐
470
+ │ Order No │ Type │ Asset │ Total │ Status │ Created │
471
+ ├──────────────┼──────┼───────┼──────────────┼────────┼───────────────┤
472
+ │ {orderNo} │ BUY │ USDT │ ¥{totalPrice}│ 已完成 │ {time UTC+0} │
473
+ └──────────────┴──────┴───────┴──────────────┴────────┴───────────────┘
474
+ ```
475
+
476
+ **Order status code mapping:**
477
+
478
+ | Code | Name | Chinese |
479
+ |------|------|---------|
480
+ | 0 | Pending | 处理中 |
481
+ | 1 | Unpaid | 未付款 |
482
+ | 2 | Paid (Unconfirmed) | 已付款 |
483
+ | 3 | Releasing | 放币处理中 |
484
+ | 4 | Completed | 已完成 |
485
+ | 5 | In Appeal | 申诉中 |
486
+ | 6 | Cancelled | 已取消 |
487
+ | 7 | Expired (System Cancel) | 超时取消 |
488
+
489
+ ### 1.5 Submit Appeal Evidence
490
+
491
+ **Trigger:**
492
+ - "帮我上传这个截图作为申诉证据"
493
+ - "我要提交付款凭证"
494
+ - "Submit evidence for order 228..."
495
+ - "Upload proof of payment for my appeal"
496
+ - Automatically suggested when order is in Appeal (status=5) and `complaintStatus=2` (CS Processing)
497
+
498
+ **Behavior (3-step flow):**
499
+
500
+ **Step 1 — Get presigned upload URL:**
501
+ ```
502
+ GET /sapi/v1/c2c/agent/file-upload/get-s3-presigned-url?fileName=proof.jpg&scenario=complaint
503
+ → { "uploadUrl": "https://s3...presigned...", "filePath": "/client_upload/c2c/complaint/..." }
504
+ ```
505
+
506
+ **Step 2 — Upload file to S3:**
507
+ ```bash
508
+ curl -X PUT -T /path/to/local/file.jpg "{uploadUrl}"
509
+ ```
510
+ > The presigned URL is valid for **5 minutes**. Upload must complete within this window.
511
+
512
+ **Step 3 — Submit evidence to SAPI:**
513
+ ```
514
+ POST /sapi/v1/c2c/agent/complaint/submit-evidence
515
+ Body: { "orderNo": "228...", "description": "付款截图", "fileUrls": ["/client_upload/c2c/complaint/..."] }
516
+ → { "data": true }
517
+ ```
518
+
519
+ **Supported file types:**
520
+ `txt, doc, xls, docx, xlsx, jpg, jpeg, png, pdf, mp3, mp4, avi, rm, rmvb, mov, wmv`
521
+
522
+ **Output format (Upload Progress):**
523
+ ```
524
+ 📤 Evidence Upload for Order {orderNo}
525
+ ├─ Step 1/3: Getting upload URL... ✅
526
+ ├─ Step 2/3: Uploading file "{fileName}"... ✅
527
+ ├─ Step 3/3: Submitting evidence...
528
+ │ ├─ Description: {description}
529
+ │ └─ Files: {n} file(s)
530
+ └─ Result: ✅ Evidence submitted successfully
531
+
532
+ 💡 Tip: You can submit additional evidence by saying "再上传一个文件"
533
+ ```
534
+
535
+ **Output format (Failure):**
536
+ ```
537
+ ❌ Evidence Upload Failed
538
+ ├─ Step: {which step failed}
539
+ ├─ Error: {error message}
540
+ └─ Suggestion: {actionable fix}
541
+ ```
542
+
543
+ **Common errors:**
544
+ - `Unsupported file type` → Check file extension; see supported types above
545
+ - `Presigned URL expired` → Re-request upload URL (Step 1)
546
+ - `Order not in appeal` → Evidence can only be submitted for orders with active complaints
547
+ - `File too large` → Reduce file size or split into multiple files
548
+
549
+ **Write-op confirmation rule:**
550
+ Evidence submission follows the same confirmation protocol as Scene 2 write operations:
551
+ 1. Show a summary of what will be submitted (file name, description, order number)
552
+ 2. Wait for user to confirm before executing Step 3
553
+
554
+ **Confirmation format:**
555
+ ```
556
+ 📋 Evidence Submission Summary
557
+ ├─ Order: {orderNo}
558
+ ├─ Description: {description}
559
+ ├─ Files to submit:
560
+ │ 1. {fileName1} ({fileType}, uploaded ✅)
561
+ │ 2. {fileName2} ({fileType}, uploaded ✅)
562
+ └─ ⚠️ Confirm submission? (reply "确认" or "confirm")
563
+ ```
564
+
565
+ ### 1.6 View Complaint Process Timeline
566
+
567
+ **Trigger:**
568
+ - "查看申诉的处理流程"
569
+ - "这个申诉经历了哪些步骤?"
570
+ - "Show complaint timeline for order 228..."
571
+ - "What happened in the appeal process?"
572
+
573
+ **Behavior:**
574
+ 1. Call `get-complaint-flows` with orderNo (and optionally complaintNo)
575
+ 2. Display chronological timeline of all process steps
576
+
577
+ **Output format:**
578
+ ```
579
+ 📜 Complaint Timeline: Order {orderNo} (Complaint #{complaintNo})
580
+
581
+ ├─ [{createTime}] {creatorNickName}
582
+ │ ├─ Type: {infoType description}
583
+ │ ├─ Description: {description}
584
+ │ ├─ Evidence: {fileUrls count} file(s) attached
585
+ │ └─ Source: {source}
586
+
587
+ ├─ [{createTime}] {operatorName or creatorNickName}
588
+ │ ├─ Type: {infoType description}
589
+ │ ├─ Remark: {remark}
590
+ │ └─ Evidence: {fileUrls or "None"}
591
+
592
+ └─ ... (chronological order)
593
+
594
+ 💡 Actions: "提交证据" to submit evidence | "刷新" to check for updates
595
+ ```
596
+
597
+ **Info type mapping (for display):**
598
+
599
+ | infoType | Description |
600
+ |----------|-------------|
601
+ | 1 | Complaint Initiated |
602
+ | 2 | Evidence Submitted |
603
+ | 3 | CS Review Note |
604
+ | 4 | Resolution / Decision |
605
+
606
+ > **Note:** `fileUrls` in the response are CDN-assembled URLs that can be directly accessed.
607
+ > `remarkHtml` takes precedence over `remark` when available for rendering.
608
+
609
+ ### 1.7 Cancel Complaint / Appeal
610
+
611
+ **Trigger:**
612
+ - "取消这个申诉"
613
+ - "我不想继续申诉了"
614
+ - "Cancel my appeal for order 228..."
615
+ - "Withdraw my complaint"
616
+
617
+ **⚠️ This is a DESTRUCTIVE action — mandatory confirmation required!**
618
+
619
+ Cancelling an appeal is **irreversible**. The user forfeits their dispute and the order proceeds to its normal resolution. The agent MUST follow this strict confirmation protocol:
620
+
621
+ **Behavior:**
622
+ 1. When user expresses intent to cancel, FIRST show a clear warning
623
+ 2. Wait for explicit confirmation ("确认取消" / "confirm cancel" / "yes")
624
+ 3. Only then call `cancel-complaint` with the orderNo
625
+ 4. Display the result
626
+
627
+ **Warning format (MUST show before executing):**
628
+ ```
629
+ ⚠️ Cancel Appeal Confirmation
630
+ ├─ Order: {orderNo}
631
+ ├─ Current complaint status: {status from previous query if available}
632
+
633
+ ╔══════════════════════════════════════════════╗
634
+ ║ WARNING: This action CANNOT be undone! ║
635
+ ║ - Your appeal will be permanently withdrawn ║
636
+ ║ - You will lose the right to dispute this ║
637
+ ║ order through the appeal process ║
638
+ ║ - The order will proceed to normal ║
639
+ ║ resolution without CS intervention ║
640
+ ╚══════════════════════════════════════════════╝
641
+
642
+ └─ Reply "确认取消" or "confirm cancel" to proceed
643
+ ```
644
+
645
+ **On success:**
646
+ ```
647
+ ✅ Appeal Cancelled
648
+ ├─ Order: {orderNo}
649
+ ├─ Status: Appeal withdrawn
650
+ └─ The order will now proceed to normal resolution.
651
+ ```
652
+
653
+ **On failure:**
654
+ ```
655
+ ❌ Cancel Failed
656
+ ├─ Order: {orderNo}
657
+ ├─ Reason: {error message}
658
+ └─ Possible causes: no active appeal, order already resolved, or insufficient permissions.
659
+ ```
660
+
661
+ **MUST-follow rules:**
662
+ - NEVER cancel without showing the warning and receiving explicit confirmation
663
+ - If user says anything ambiguous (like "算了" / "never mind" in a conversation about something else), do NOT interpret it as cancel intent — ask to clarify
664
+ - If the complaint status is already resolved/closed, inform user instead of attempting the API call
665
+
666
+ ### 1.8 Get Complaint Reasons
667
+
668
+ **Trigger:**
669
+ - "我可以用什么理由申诉?"
670
+ - "What reasons can I use to appeal?"
671
+ - "Show available complaint reasons for this order"
672
+ - "申诉理由有哪些?"
673
+
674
+ **Behavior:**
675
+ 1. Call `get-complaint-reasons` with orderNo
676
+ 2. Display the list of available reason codes and descriptions
677
+
678
+ **Output format:**
679
+ ```
680
+ 📋 Available Complaint Reasons for Order {orderNo}
681
+
682
+ ├─ [{reasonCode}] {reasonDesc}
683
+ ├─ [{reasonCode}] {reasonDesc}
684
+ ├─ [{reasonCode}] {reasonDesc}
685
+ └─ ...
686
+
687
+ 💡 Note: These are the reasons you can use when initiating an appeal.
688
+ This skill does NOT support initiating appeals — only viewing reasons.
689
+ ```
690
+
691
+ > **Note:** This is a read-only informational query. The skill does NOT support actually submitting a new complaint (that requires the user to use the App).
692
+
693
+ ---
694
+
695
+ ## Scene 2: Ad Publish & Management
696
+
697
+ ### ⚠️ Write Operation Safety Rules
698
+
699
+ **ALL write operations** in Scene 2 MUST follow this protocol:
700
+
701
+ 1. **Pre-check**: Verify user has merchant permission (the API itself checks, but inform user clearly on 403/Permission denied)
702
+ 2. **Show summary**: Before executing any write API, display a complete operation summary
703
+ 3. **Explicit confirmation**: Wait for user to say "确认" / "confirm" / "发布" / "yes" before proceeding
704
+ 4. **Never auto-execute**: Even if user says "just do it" in the initial request, still show summary first
705
+
706
+ ### 2.1 Market Analysis & Reference Pricing
707
+
708
+ **Trigger:**
709
+ - "我想发一个 USDT/CNY 的卖单广告"
710
+ - "帮我挂一个 BTC 买单"
711
+ - "当前市场参考价是多少?"
712
+ - "What's the reference price for USDT/CNY?"
713
+
714
+ **Behavior:**
715
+ 1. Call `getReferencePrice` to get market reference prices
716
+ 2. Call `search` to analyze current market ad distribution
717
+ 3. Present pricing intelligence to help user decide
718
+
719
+ **Output format (Reference Price):**
720
+ ```
721
+ 📊 Market Reference Price
722
+ ├─ Asset: {asset} / {fiatCurrency}
723
+ ├─ Reference Price: {currencySymbol}{referencePrice}
724
+ ├─ Price Scale: {priceScale} decimals
725
+ └─ Asset Scale: {assetScale} decimals
726
+ ```
727
+
728
+ **Output format (Market Analysis):**
729
+ ```
730
+ 📊 Market Ad Analysis: {asset}/{fiat} ({tradeType})
731
+ ├─ Total Active Ads: {total}
732
+ ├─ Price Range: {min} ~ {max}
733
+ ├─ Top 5 Ads:
734
+ │ 1. {advNo} | {price} | {surplusAmount} {asset} | Limit: {min}~{max} | {merchantNick}
735
+ │ └─ Terms: {remarks or "—"}
736
+ │ 2. ...
737
+ └─ Recommended Price: {suggestion based on reference + market}
738
+ ```
739
+
740
+ ### 2.2 Ad Configuration
741
+
742
+ **Trigger:**
743
+ - "用浮动价格,溢价 0.5%"
744
+ - "加上支付宝"
745
+ - "就按推荐的来"
746
+ - "单价改成 6.99,限额改到 1000-100000"
747
+
748
+ **Pre-publish preparation workflow:**
749
+
750
+ **Step 1** — Get available categories:
751
+ ```
752
+ GET /sapi/v1/c2c/agent/ads/getAvailableAdsCategory
753
+ → {"advClassifies": ["mass", "profession", ...]}
754
+ ```
755
+
756
+ **Step 2** — Get user's payment methods (for SELL ads, need payId):
757
+ ```
758
+ GET /sapi/v1/c2c/agent/ads/getPayMethodByUserId
759
+ → [{"payId": 123, "identifier": "ALIPAY", "tradeMethodName": "支付宝"}]
760
+ ```
761
+ > **Display rule:** Only show `tradeMethodName` (e.g. "支付宝", "WeChat", "Bank Transfer") to the user.
762
+ > `payId` is an internal identifier used only in the API request body — **never expose payId values in user-facing output**.
763
+
764
+ **Step 3** — Get all system trade methods (for BUY ads, need identifier):
765
+ ```
766
+ POST /sapi/v1/c2c/agent/ads/listAllTradeMethods
767
+ → [{"identifier": "ALIPAY", "tradeMethodName": "支付宝", ...}]
768
+ ```
769
+
770
+ **Ad parameter reference:**
771
+
772
+ | Parameter | Required | Description |
773
+ |-----------|----------|-------------|
774
+ | classify | Y | Ad category: mass / profession / block / cash (default: mass) |
775
+ | tradeType | Y | 0 = BUY, 1 = SELL |
776
+ | asset | Y | Crypto: BTC, ETH, USDT, BNB |
777
+ | fiatUnit | Y | Fiat: CNY, USD, etc. |
778
+ | priceType | Y | 1 = Fixed price, 2 = Floating price |
779
+ | price | Conditional | Fixed price value (required if priceType=1) |
780
+ | priceFloatingRatio | Conditional | Floating ratio % (required if priceType=2) |
781
+ | initAmount | Y | Total crypto quantity |
782
+ | maxSingleTransAmount | Y | Max per-order fiat amount |
783
+ | minSingleTransAmount | Y | Min per-order fiat amount |
784
+ | buyerKycLimit | Y | Require buyer KYC: 0=No, 1=Yes |
785
+ | tradeMethods | Y | Payment methods: [{payId, identifier}] |
786
+ | payTimeLimit | N | Payment time limit in minutes (default 15) |
787
+ | onlineNow | N | Go online immediately (default true) |
788
+ | remarks | N | Ad trading terms / conditions (max 1000 chars, no crypto-related words) |
789
+ | autoReplyMsg | N | Auto-reply message on order creation (max 1000 chars) |
790
+ | buyerRegDaysLimit | N | Min buyer registration days |
791
+ | buyerBtcPositionLimit | N | Min buyer BTC holding |
792
+ | takerAdditionalKycRequired | N | Require extra verification: 0=No, 1=Yes |
793
+ | launchCountry | N | Target countries (default: all regions) |
794
+
795
+ **Confirmation summary format:**
796
+ ```
797
+ 📋 Ad Configuration Summary
798
+ ┌────────────────────────────────────┐
799
+ │ Trade Direction: {SELL/BUY} {asset}│
800
+ │ Fiat Currency: {fiatUnit} │
801
+ │ Price Type: {Fixed/Floating} │
802
+ │ Price: {price or ratio%} │
803
+ │ Total Quantity: {initAmount} {asset}│
804
+ │ Order Limit: {min} ~ {max} {fiat}│
805
+ │ Payment Methods: {method1, method2}│
806
+ │ Payment Timeout: {payTimeLimit} min│
807
+ │ Status: {Online/Offline} │
808
+ ├────────────────────────────────────┤
809
+ │ Advanced Settings: │
810
+ │ Buyer KYC: {Yes/No} │
811
+ │ Min Reg Days: {days or "—"} │
812
+ │ Min BTC: {amount or "—"} │
813
+ │ Extra Verify: {Yes/No} │
814
+ │ Regions: {countries or "All"} │
815
+ │ Remarks: {text or "—"} │
816
+ │ Auto Reply: {text or "—"} │
817
+ └────────────────────────────────────┘
818
+
819
+ ⚠️ Please confirm to publish (reply "确认" or "confirm")
820
+ ```
821
+
822
+ ### 2.3 Publish Ad
823
+
824
+ **Trigger:**
825
+ - "确认" / "confirm" / "发布" (after 2.2 summary)
826
+
827
+ **Behavior:**
828
+ 1. User confirms → call `POST /sapi/v1/c2c/agent/ads/post`
829
+ 2. Return result
830
+
831
+ **Output format (Success):**
832
+ ```
833
+ ✅ Ad Published Successfully!
834
+ ├─ Ad Number: {advNo}
835
+ ├─ Status: Online
836
+ ├─ View: https://c2c.binance.com/en/adv?code={advNo}
837
+ └─ Manage: say "查看我的广告" to see all your ads
838
+ ```
839
+
840
+ **Output format (Failure):**
841
+ ```
842
+ ❌ Ad Publish Failed
843
+ ├─ Error: {error message}
844
+ └─ Suggestion: {actionable fix}
845
+ ```
846
+
847
+ **Common errors:**
848
+ - `Permission denied` → User is not a verified merchant
849
+ - `FIAT_ASSET_ILLEGAL` → BIDR can only pair with IDR
850
+ - Insufficient balance → Check asset balance before publishing
851
+
852
+ ### 2.4 Manage Existing Ads
853
+
854
+ **Trigger:**
855
+ - "查看我的广告" / "List my ads"
856
+ - "把第 1 条广告下架" / "Take the first ad offline"
857
+ - "修改我那条 USDT 卖单的价格" / "Update price for my USDT sell ad"
858
+
859
+ #### List My Ads
860
+ Call `POST /sapi/v1/c2c/agent/ads/listWithPagination`
861
+
862
+ **Output format:**
863
+ ```
864
+ 📋 My Advertisements (Total: {total})
865
+ ┌────┬──────────────┬──────┬───────┬──────────┬─────────────┬──────────┬────────┐
866
+ │ # │ Ad No │ Type │ Asset │ Price │ Remaining │ Limit │ Status │
867
+ ├────┼──────────────┼──────┼───────┼──────────┼─────────────┼──────────┼────────┤
868
+ │ 1 │ {advNo} │ SELL │ USDT │ ¥{price} │ {surplus} │ {min}~{max}│ Online │
869
+ │ 2 │ {advNo} │ BUY │ BTC │ ¥{price} │ {surplus} │ {min}~{max}│ Offline│
870
+ └────┴──────────────┴──────┴───────┴──────────┴─────────────┴──────────┴────────┘
871
+
872
+ # If any ad has remarks or autoReplyMsg, show below the table:
873
+ Ad Terms:
874
+ #1: {remarks or "—"} | Auto-reply: {autoReplyMsg or "—"}
875
+ #2: {remarks or "—"} | Auto-reply: {autoReplyMsg or "—"}
876
+
877
+ Actions: "修改第1条广告价格" | "下架第2条" | "查看详情 {advNo}"
878
+ ```
879
+
880
+ #### View Ad Detail
881
+ Call `POST /sapi/v1/c2c/agent/ads/getDetailByNo`
882
+
883
+ **Trigger:** "查看详情 {advNo}" / "Show ad detail"
884
+
885
+ **Output format:**
886
+ ```
887
+ 📄 Ad Detail: {advNo}
888
+ ├─ Type: {tradeType} {asset}/{fiatUnit}
889
+ ├─ Price: {currencySymbol}{price} ({priceType: Fixed/Floating})
890
+ ├─ Remaining: {surplusAmount} / {initAmount} {asset}
891
+ ├─ Limit: {minSingleTransAmount} ~ {maxSingleTransAmount} {fiatUnit}
892
+ ├─ Payment Methods: {tradeMethodName1, tradeMethodName2}
893
+ ├─ Status: {status}
894
+ ├─ Payment Timeout: {payTimeLimit} min
895
+
896
+ ├─ Trading Terms:
897
+ │ {remarks or "No terms set"}
898
+
899
+ ├─ Auto-Reply Message:
900
+ │ {autoReplyMsg or "No auto-reply set"}
901
+
902
+ └─ Advanced:
903
+ ├─ Buyer KYC: {Yes/No}
904
+ ├─ Min Reg Days: {buyerRegDaysLimit or "—"}
905
+ └─ Extra Verify: {takerAdditionalKycRequired ? "Yes" : "No"}
906
+ ```
907
+
908
+ > **Display rule for `remarks` and `autoReplyMsg`:** These fields are returned by `getDetailByNo`, `listWithPagination`, and `search`. When present and non-empty, always show them. When null/empty, show "—" or a placeholder like "No terms set". Never omit the section silently — the user should know whether terms exist.
909
+
910
+ **Ad status code mapping:**
911
+
912
+ | Code | Display | Chinese |
913
+ |------|---------|---------|
914
+ | 1 | Online | 在线 |
915
+ | 2 | Offline | 离线 |
916
+ | 4 | Closed | 已关闭 |
917
+
918
+ #### Update Ad
919
+
920
+ **Behavior:**
921
+ 1. Identify which ad to update (by # in list or advNo)
922
+ 2. Show diff: old value → new value
923
+ 3. Wait for confirmation
924
+ 4. Call `POST /sapi/v1/c2c/agent/ads/update`
925
+
926
+ **Confirmation format:**
927
+ ```
928
+ 📝 Update Ad: {advNo}
929
+ ┌──────────────┬─────────────┬─────────────┐
930
+ │ Field │ Current │ New │
931
+ ├──────────────┼─────────────┼─────────────┤
932
+ │ Price │ ¥7.20 │ ¥6.99 │
933
+ │ Max Limit │ ¥50,000 │ ¥100,000 │
934
+ └──────────────┴─────────────┴─────────────┘
935
+
936
+ ⚠️ Confirm update? (reply "确认" or "confirm")
937
+ ```
938
+
939
+ #### Update Ad Status (Online / Offline / Close)
940
+
941
+ **Behavior:**
942
+ 1. Identify target ad(s) — supports batch operation
943
+ 2. Show confirmation
944
+ 3. Call `POST /sapi/v1/c2c/agent/ads/updateStatus`
945
+
946
+ **Confirmation format:**
947
+ ```
948
+ 🔄 Status Update
949
+ ├─ Ads: {advNo1}, {advNo2}
950
+ ├─ Action: {Online → Offline}
951
+ └─ ⚠️ Confirm? (reply "确认" or "confirm")
952
+ ```
953
+
954
+ **Result format:**
955
+ ```
956
+ ✅ Status updated: {n} ad(s) → {status}
957
+ # Or if partial failure:
958
+ ⚠️ Partial success: {n} updated, {m} failed
959
+ Failed:
960
+ ├─ {advNo}: {errorMessage}
961
+ ```
962
+
963
+ ---
964
+
965
+ ## Scene 2 Supplement: Merchant & Currency Queries
966
+
967
+ ### View Merchant Profile
968
+
969
+ **Trigger:**
970
+ - "查看商家 {merchantNo} 的信息"
971
+ - "Show me merchant details"
972
+
973
+ **Behavior:** Call `GET /sapi/v1/c2c/agent/merchant/getAdDetails?merchantNo={merchantNo}`
974
+
975
+ **Output format:**
976
+ ```
977
+ 👤 Merchant: {nickName}
978
+ ├─ Type: {userType}
979
+ ├─ Total Orders: {orderCount}
980
+ ├─ 30-Day Orders: {monthOrderCount}
981
+ ├─ 30-Day Completion: {monthFinishRate}%
982
+ ├─ Avg Release Time: {advConfirmTime}s
983
+ ├─ Online: {onlineStatus}
984
+ ├─ Registered: {registerDays} days
985
+
986
+ ├─ 30-Day Stats:
987
+ │ ├─ Avg Release: {avgReleaseTimeOfLatest30day}s
988
+ │ ├─ Avg Payment: {avgPayTimeOfLatest30day}s
989
+ │ └─ Completed: {completedOrderNumOfLatest30day}
990
+
991
+ ├─ Buy Ads ({n}):
992
+ │ 1. {advNo} | {asset}/{fiat} | {price} | {surplus} remaining
993
+ │ └─ Terms: {remarks or "—"}
994
+
995
+ └─ Sell Ads ({n}):
996
+ 1. {advNo} | {asset}/{fiat} | {price} | {surplus} remaining
997
+ └─ Terms: {remarks or "—"}
998
+ ```
999
+
1000
+ ### List Supported Currencies
1001
+
1002
+ **Trigger:**
1003
+ - "P2P支持哪些币种?"
1004
+ - "What fiat currencies are supported?"
1005
+
1006
+ **Behavior:**
1007
+ - Digital currencies: `POST /sapi/v1/c2c/agent/digitalCurrency/list`
1008
+ - Fiat currencies: `POST /sapi/v1/c2c/agent/fiatCurrency/list`
1009
+
1010
+ ---
1011
+
1012
+ ## Phase 3 API Overview
1013
+
1014
+ ### Order & Appeal (SAPI Agent — Requires Auth)
1015
+ Base URL: `https://api.binance.com`
1016
+
1017
+ | Endpoint | Method | Auth | Usage |
1018
+ |----------|--------|------|-------|
1019
+ | `/sapi/v1/c2c/agent/orderMatch/getUserOrderDetail` | POST | Yes | Get order detail by order number |
1020
+ | `/sapi/v1/c2c/agent/orderMatch/listOrders` | POST | Yes | List orders with filters |
1021
+ | `/sapi/v1/c2c/agent/orderMatch/listUserOrderHistory` | GET | Yes | List order history (paginated) |
1022
+ | `/sapi/v1/c2c/agent/complaint/query-complaints` | POST | Yes | Query complaint/appeal records |
1023
+ | `/sapi/v1/c2c/agent/complaint/submit-evidence` | POST | Yes | Submit appeal evidence (**write**) |
1024
+ | `/sapi/v1/c2c/agent/complaint/get-complaint-flows` | POST | Yes | Get complaint process timeline |
1025
+ | `/sapi/v1/c2c/agent/complaint/cancel-complaint` | POST | Yes | Cancel/withdraw appeal (**write**, irreversible) |
1026
+ | `/sapi/v1/c2c/agent/complaint/get-complaint-reasons` | POST | Yes | Get available complaint reasons |
1027
+ | `/sapi/v1/c2c/agent/file-upload/get-s3-presigned-url` | GET | Yes | Get S3 presigned URL for evidence upload |
1028
+
1029
+ ### Ad Management (SAPI Agent — Requires Auth)
1030
+ Base URL: `https://api.binance.com`
1031
+
1032
+ | Endpoint | Method | Auth | Usage |
1033
+ |----------|--------|------|-------|
1034
+ | `/sapi/v1/c2c/agent/ads/getDetailByNo` | POST | Yes | Get ad detail by ad number |
1035
+ | `/sapi/v1/c2c/agent/ads/listWithPagination` | POST | Yes | List user's own ads (paginated) |
1036
+ | `/sapi/v1/c2c/agent/ads/search` | POST | Yes | Search market ads with filters |
1037
+ | `/sapi/v1/c2c/agent/ads/getReferencePrice` | POST | Yes | Get reference price for asset/fiat |
1038
+ | `/sapi/v1/c2c/agent/ads/getAvailableAdsCategory` | GET | Yes | Get publishable ad categories |
1039
+ | `/sapi/v1/c2c/agent/ads/getPayMethodByUserId` | GET | Yes | Get user's payment methods |
1040
+ | `/sapi/v1/c2c/agent/ads/listAllTradeMethods` | POST | Yes | List all system trade methods |
1041
+ | `/sapi/v1/c2c/agent/ads/post` | POST | Yes | Publish a new ad (**write**) |
1042
+ | `/sapi/v1/c2c/agent/ads/update` | POST | Yes | Update an existing ad (**write**) |
1043
+ | `/sapi/v1/c2c/agent/ads/updateStatus` | POST | Yes | Batch update ad status (**write**) |
1044
+
1045
+ ### Merchant (SAPI Agent — Requires Auth)
1046
+ Base URL: `https://api.binance.com`
1047
+
1048
+ | Endpoint | Method | Auth | Usage |
1049
+ |----------|--------|------|-------|
1050
+ | `/sapi/v1/c2c/agent/merchant/getAdDetails` | GET | Yes | Get merchant profile + ad listings |
1051
+
1052
+ ### Support (SAPI Agent — Requires Auth)
1053
+ Base URL: `https://api.binance.com`
1054
+
1055
+ | Endpoint | Method | Auth | Usage |
1056
+ |----------|--------|------|-------|
1057
+ | `/sapi/v1/c2c/agent/digitalCurrency/list` | POST | Yes | List supported digital currencies |
1058
+ | `/sapi/v1/c2c/agent/fiatCurrency/list` | POST | Yes | List supported fiat currencies |
1059
+
1060
+ > **Full API reference** with request/response schemas: see `references/agent-sapi-api.md`
1061
+
1062
+ ## Phase 3 Error Handling (Additional)
1063
+
1064
+ | Error | Cause | User Action |
1065
+ |-------|-------|-------------|
1066
+ | Permission denied | User is not a verified merchant | Guide to merchant verification page |
1067
+ | FIAT_ASSET_ILLEGAL | BIDR paired with non-IDR fiat | Use IDR as fiat for BIDR |
1068
+ | ILLEGAL_PARAMETERS | Missing or invalid fields | Re-check required parameters |
1069
+ | Ad not found | Invalid advNo | Verify ad number via list |
1070
+ | Status update partial failure | Some ads can't change status | Check individual error codes in failList |
1071
+
1072
+ ## Phase 3 Limitations
1073
+
1074
+ This skill does NOT (in Phase 3):
1075
+ - Initiate new appeals / submit-complaint (only evidence supplement for existing appeals is supported)
1076
+ - Auto-monitor appeal status changes (polling not supported in skill)
1077
+ - Place orders on behalf of user (guide to ad detail page instead)
1078
+ - Access chat messages or send messages in order chat
1079
+ - Modify payment method configurations (only read)
1080
+ - Access KYC/verification status details
1081
+
1082
+ For appeal initiation and real-time appeal monitoring, guide users to the official P2P dispute center.