fiat

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Binance Fiat Skill

Binance 法币操作Skill

Fiat request on Binance using authenticated API endpoints. Requires API key and secret key for certain endpoints. Return the result in JSON format.
使用已认证的API端点在Binance上进行法币相关请求。部分端点需要API密钥和Secret Key。返回JSON格式的结果。

Quick Reference

快速参考

EndpointDescriptionRequiredOptionalAuthentication
/sapi/v1/fiat/deposit
(POST)
Deposit(TRADE)NonerecvWindowYes
/sapi/v2/fiat/withdraw
(POST)
Fiat Withdraw(WITHDRAW)NonerecvWindowYes
/sapi/v1/fiat/orders
(GET)
Get Fiat Deposit/Withdraw History (USER_DATA)transactionTypebeginTime, endTime, page, rows, recvWindowYes
/sapi/v1/fiat/payments
(GET)
Get Fiat Payments History (USER_DATA)transactionTypebeginTime, endTime, page, rows, recvWindowYes
/sapi/v1/fiat/get-order-detail
(GET)
Get Order Detail(USER_DATA)orderNorecvWindowYes

端点描述必填参数可选参数是否需要认证
/sapi/v1/fiat/deposit
(POST)
法币存入(交易类)recvWindow
/sapi/v2/fiat/withdraw
(POST)
法币提取(提现类)recvWindow
/sapi/v1/fiat/orders
(GET)
获取法币存提历史(用户数据类)transactionTypebeginTime, endTime, page, rows, recvWindow
/sapi/v1/fiat/payments
(GET)
获取法币支付历史(用户数据类)transactionTypebeginTime, endTime, page, rows, recvWindow
/sapi/v1/fiat/get-order-detail
(GET)
获取订单详情(用户数据类)orderNorecvWindow

Parameters

参数说明

Common Parameters

通用参数

  • recvWindow: (e.g., 5000)
  • transactionType: 0-buy,1-sell
  • beginTime:
  • endTime: (e.g., 1641782889000)
  • page: default 1 (e.g., 1)
  • rows: default 100, max 500 (e.g., 100)
  • orderNo: order id retrieved from the api call of withdrawal
  • recvWindow: 请求超时窗口(示例:5000)
  • transactionType: 0-买入,1-卖出
  • beginTime: 起始时间
  • endTime: 结束时间(示例:1641782889000)
  • page: 默认值1(示例:1)
  • rows: 默认值100,最大值500(示例:100)
  • orderNo: 从提现API调用中获取的订单ID

Authentication

认证方式

For endpoints that require authentication, you will need to provide Binance API credentials. Required credentials:
  • apiKey: Your Binance API key (for header)
  • secretKey: Your Binance API secret (for signing)
Base URLs:
对于需要认证的端点,你需要提供Binance API凭证。 所需凭证:
  • apiKey: 你的Binance API密钥(用于请求头)
  • secretKey: 你的Binance API密钥(用于签名)
基础URL:

Security

安全规范

Share Credentials

凭证共享方式

Users can provide Binance API credentials by sending a file where the content is in the following format:
bash
abc123...xyz
secret123...key
用户可以通过发送文件的方式提供Binance API凭证,文件内容格式如下:
bash
abc123...xyz
secret123...key

Never Disclose API Key and Secret

切勿泄露API密钥和Secret Key

Never disclose the location of the API key and secret file.
Never send the API key and secret to any website other than Mainnet and Testnet.
切勿泄露API密钥和Secret Key文件的存储位置。
切勿将API密钥和Secret Key发送至主网(Mainnet)和测试网(Testnet)以外的任何网站。

Never Display Full Secrets

切勿显示完整密钥

When showing credentials to users:
  • API Key: Show first 5 + last 4 characters:
    su1Qc...8akf
  • Secret Key: Always mask, show only last 5:
    ***...aws1
Example response when asked for credentials: Account: main API Key: su1Qc...8akf Secret: ***...aws1
向用户展示凭证时:
  • API密钥: 仅显示前5位+后4位字符:
    su1Qc...8akf
  • Secret Key: 始终隐藏,仅显示最后5位:
    ***...aws1
查询凭证时的示例回复: 账户:主网 API密钥:su1Qc...8akf Secret Key:***...aws1

Listing Accounts

列出账户

When listing accounts, show names and environment only — never keys: Binance Accounts:
  • main (Mainnet)
  • futures-keys (Mainnet)
列出账户时,仅显示账户名称和环境信息——切勿显示密钥: Binance账户列表:
  • main (Mainnet)
  • futures-keys (Mainnet)

Transactions in Mainnet

主网交易操作

When performing transactions in mainnet, always confirm with the user before proceeding by asking them to write "CONFIRM" to proceed.

在主网执行交易操作前,必须先与用户确认,要求用户输入“CONFIRM”后再继续。

Binance Accounts

Binance 账户

main

main

  • API Key: your_mainnet_api_key
  • Secret: your_mainnet_secret
  • API Key: your_mainnet_api_key
  • Secret: your_mainnet_secret

TOOLS.md Structure

TOOLS.md 文件结构

bash
undefined
bash
undefined

Binance Accounts

Binance Accounts

main

main

  • API Key: abc123...xyz
  • Secret: secret123...key
  • Description: Primary trading account
  • API Key: abc123...xyz
  • Secret: secret123...key
  • Description: Primary trading account

futures-keys

futures-keys

  • API Key: futures789...def
  • Secret: futuressecret...uvw
  • Description: Futures trading account
undefined
  • API Key: futures789...def
  • Secret: futuressecret...uvw
  • Description: Futures trading account
undefined

Agent Behavior

Agent 行为规范

  1. Credentials requested: Mask secrets (show last 5 chars only)
  2. Listing accounts: Show names and environment, never keys
  3. Account selection: Ask if ambiguous, default to main
  4. When doing a transaction in mainnet, confirm with user before by asking to write "CONFIRM" to proceed
  5. New credentials: Prompt for name, environment, signing mode
  1. 当请求凭证时:隐藏密钥(仅显示最后5位字符)
  2. 列出账户时:仅显示名称和环境,绝不显示密钥
  3. 账户选择:若存在歧义则询问用户,默认选择main账户
  4. 在主网执行交易时,先要求用户输入“CONFIRM”进行确认
  5. 添加新凭证时:提示用户输入账户名称、环境、签名模式

Adding New Accounts

添加新账户

When user provides new credentials:
  • Ask for account name
  • Store in
    TOOLS.md
    with masked display confirmation
当用户提供新凭证时:
  • 询问账户名称
  • 存储至
    TOOLS.md
    中,并向用户展示已掩码的凭证信息进行确认

Signing Requests

请求签名

For trading endpoints that require a signature:
  1. Build query string with all parameters, including the timestamp (Unix ms).
  2. Percent-encode the parameters using UTF-8 according to RFC 3986.
  3. Sign query string with secretKey using HMAC SHA256, RSA, or Ed25519 (depending on the account configuration).
  4. Append signature to query string.
  5. Include
    X-MBX-APIKEY
    header.
Otherwise, do not perform steps 3–5.
对于需要签名的交易类端点:
  1. 构建包含所有参数的查询字符串,包括时间戳(Unix毫秒格式)。
  2. 根据RFC 3986标准,使用UTF-8编码对参数进行百分号编码。
  3. 使用secretKey通过HMAC SHA256、RSA或Ed25519算法对查询字符串进行签名(具体取决于账户配置)。
  4. 将签名追加至查询字符串末尾。
  5. 在请求头中包含
    X-MBX-APIKEY
    字段。
若无需签名,则跳过步骤3至5。

User Agent Header

User Agent 请求头

Include
User-Agent
header with the following string:
binance-fiat/1.0.0 (Skill)
See
references/authentication.md
for implementation details.
请求头中需包含
User-Agent
字段,值为:
binance-fiat/1.0.0 (Skill)
实现细节请参考
references/authentication.md