onchain-pay-open-api

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Binance Onchain-Pay Open API Skill

Binance Onchain-Pay Open API技能

Call Binance Onchain-Pay Open API endpoints with automatic RSA SHA256 request signing.
通过自动RSA SHA256请求签名调用Binance Onchain-Pay Open API端点。

Quick Reference

快速参考

EndpointAPI PathRequired ParamsOptional Params
Payment Method List (v1)
papi/v1/ramp/connect/buy/payment-method-list
fiatCurrency, cryptoCurrency, totalAmount, amountTypenetwork, contractAddress
Payment Method List (v2)
papi/v2/ramp/connect/buy/payment-method-list
(none)lang
Trading Pairs
papi/v1/ramp/connect/buy/trading-pairs
(none)(none)
Estimated Quote
papi/v1/ramp/connect/buy/estimated-quote
fiatCurrency, requestedAmount, payMethodCode, amountTypecryptoCurrency, contractAddress, address, network
Pre-order
papi/v1/ramp/connect/gray/buy/pre-order
externalOrderId, merchantCode, merchantName, tsfiatCurrency, fiatAmount, cryptoCurrency, requestedAmount, amountType, address, network, payMethodCode, payMethodSubCode, redirectUrl, failRedirectUrl, redirectDeepLink, failRedirectDeepLink, customization, destContractAddress, destContractABI, destContractParams, affiliateCode, gtrTemplateCode, contractAddress
Get Order
papi/v1/ramp/connect/order
externalOrderId(none)
Crypto Network
papi/v1/ramp/connect/crypto-network
(none)(none)
P2P Trading Pairs
papi/v1/ramp/connect/buy/p2p/trading-pairs
(none)fiatCurrency

端点API路径必填参数可选参数
支付方式列表(v1)
papi/v1/ramp/connect/buy/payment-method-list
fiatCurrency, cryptoCurrency, totalAmount, amountTypenetwork, contractAddress
支付方式列表(v2)
papi/v2/ramp/connect/buy/payment-method-list
lang
交易对
papi/v1/ramp/connect/buy/trading-pairs
预估报价
papi/v1/ramp/connect/buy/estimated-quote
fiatCurrency, requestedAmount, payMethodCode, amountTypecryptoCurrency, contractAddress, address, network
预下单
papi/v1/ramp/connect/gray/buy/pre-order
externalOrderId, merchantCode, merchantName, tsfiatCurrency, fiatAmount, cryptoCurrency, requestedAmount, amountType, address, network, payMethodCode, payMethodSubCode, redirectUrl, failRedirectUrl, redirectDeepLink, failRedirectDeepLink, customization, destContractAddress, destContractABI, destContractParams, affiliateCode, gtrTemplateCode, contractAddress
查询订单
papi/v1/ramp/connect/order
externalOrderId
加密货币网络
papi/v1/ramp/connect/crypto-network
P2P交易对
papi/v1/ramp/connect/buy/p2p/trading-pairs
fiatCurrency

How to Execute a Request

如何执行请求

Step 1: Gather credentials

步骤1:收集凭证

Use the default account (prod) unless the user specifies otherwise. You need:
  • BASE_URL: API base URL
  • CLIENT_ID: Client identifier
  • API_KEY: The sign access token
  • PEM_PATH: Absolute path to the RSA private key PEM file
Use the account marked
(default)
in
.local.md
.
除非用户指定,否则使用默认账户(生产环境)。你需要:
  • BASE_URL:API基础URL
  • CLIENT_ID:客户端标识符
  • API_KEY:签名访问令牌
  • PEM_PATH:RSA私钥PEM文件的绝对路径
使用
.local.md
中标记为
(default)
的账户。

Step 2: Build the JSON body

步骤2:构建JSON请求体

Build a compact JSON body from user-specified parameters. Remove any parameters the user did not provide.
根据用户指定的参数构建紧凑的JSON请求体,移除用户未提供的任何参数。

Step 3: Sign and call using the bundled script

步骤3:使用捆绑脚本签名并调用

bash
bash <skill_path>/scripts/sign_and_call.sh \
  "<BASE_URL>" \
  "<API_PATH>" \
  "<CLIENT_ID>" \
  "<API_KEY>" \
  "<PEM_PATH>" \
  '<JSON_BODY>'
bash
bash <skill_path>/scripts/sign_and_call.sh \
  "<BASE_URL>" \
  "<API_PATH>" \
  "<CLIENT_ID>" \
  "<API_KEY>" \
  "<PEM_PATH>" \
  '<JSON_BODY>'

Step 4: Return results

步骤4:返回结果

Display the JSON response to the user in a readable format.

以易读格式向用户展示JSON响应。

Authentication

身份验证

See
references/authentication.md
for full signing details.
Summary:
  1. Payload =
    JSON_BODY
    +
    TIMESTAMP
    (milliseconds)
  2. Sign payload with RSA SHA256 using PEM private key
  3. Base64 encode the signature (single line)
  4. Send as POST with headers:
    X-Tesla-ClientId
    ,
    X-Tesla-SignAccessToken
    ,
    X-Tesla-Signature
    ,
    X-Tesla-Timestamp
    ,
    Content-Type: application/json

完整的签名细节请参阅
references/authentication.md
摘要:
  1. 载荷 =
    JSON_BODY
    +
    TIMESTAMP
    (毫秒级)
  2. 使用PEM私钥通过RSA SHA256对载荷进行签名
  3. 对签名进行Base64编码(单行)
  4. 以POST方式发送,携带请求头:
    X-Tesla-ClientId
    ,
    X-Tesla-SignAccessToken
    ,
    X-Tesla-Signature
    ,
    X-Tesla-Timestamp
    ,
    Content-Type: application/json

Parameters Reference

参数参考

Payment Method List v1 (
buy/payment-method-list
)

支付方式列表v1(
buy/payment-method-list

ParameterTypeRequiredDescription
fiatCurrencystringYesFiat currency code (e.g.,
USD
,
EUR
,
BRL
,
UGX
)
cryptoCurrencystringYesCrypto currency code (e.g.,
BTC
,
USDT
,
USDC
,
SEI
)
totalAmountnumberYesAmount value
amountTypenumberYes
1
= fiat amount,
2
= crypto amount
networkstringNoBlockchain network (e.g.,
BSC
,
ETH
,
SOL
,
BASE
,
SEI
)
contractAddressstringNoToken contract address (required for non-native tokens)
参数类型必填描述
fiatCurrencystring法币代码(例如:
USD
,
EUR
,
BRL
,
UGX
cryptoCurrencystring加密货币代码(例如:
BTC
,
USDT
,
USDC
,
SEI
totalAmountnumber金额数值
amountTypenumber
1
= 法币金额,
2
= 加密货币金额
networkstring区块链网络(例如:
BSC
,
ETH
,
SOL
,
BASE
,
SEI
contractAddressstring代币合约地址(非原生代币必填)

Payment Method List v2 (
v2/buy/payment-method-list
)

支付方式列表v2(
v2/buy/payment-method-list

Get all available payment methods without specifying fiat/crypto parameters. Simplified version of v1.
ParameterTypeRequiredDescription
langstringNoLanguage code for localized payment method names (e.g.,
en
,
cn
,
es
)
Differences from v1:
  • Simpler: No need to specify fiatCurrency, cryptoCurrency, or amount
  • Comprehensive: Returns all available payment methods for the merchant
  • Use case: Useful for displaying all options before user input
Response Format: Same as v1, returns list of payment methods with their limits and properties.
无需指定法币/加密货币参数即可获取所有可用支付方式,是v1的简化版本。
参数类型必填描述
langstring支付方式名称的本地化语言代码(例如:
en
,
cn
,
es
与v1的差异
  • 更简单:无需指定fiatCurrency、cryptoCurrency或金额
  • 更全面:返回商家可用的所有支付方式
  • 使用场景:适合在用户输入前展示所有选项
响应格式:与v1相同,返回包含限额和属性的支付方式列表。

Estimated Quote (
buy/estimated-quote
)

预估报价(
buy/estimated-quote

ParameterTypeRequiredDescription
fiatCurrencystringYesFiat currency code
cryptoCurrencystringNoCrypto currency code (optional if contractAddress provided)
requestedAmountnumberYesAmount value
payMethodCodestringYesPayment method (e.g.,
BUY_CARD
,
BUY_GOOGLE_PAY
,
BUY_P2P
,
BUY_WALLET
)
amountTypenumberYes
1
= fiat amount,
2
= crypto amount
networkstringNoBlockchain network
contractAddressstringNoToken contract address
addressstringNoDestination wallet address
参数类型必填描述
fiatCurrencystring法币代码
cryptoCurrencystring加密货币代码(若提供contractAddress则可选)
requestedAmountnumber金额数值
payMethodCodestring支付方式(例如:
BUY_CARD
,
BUY_GOOGLE_PAY
,
BUY_P2P
,
BUY_WALLET
amountTypenumber
1
= 法币金额,
2
= 加密货币金额
networkstring区块链网络
contractAddressstring代币合约地址
addressstring接收加密货币的目标钱包地址

Pre-order (
buy/pre-order
)

预下单(
buy/pre-order

Create a buy pre-order and return the redirect link for payment.
ParameterTypeRequiredDescription
externalOrderIdstringYesPartner's unique order ID (must be unique)
merchantCodestringYesMerchant code (e.g.,
connect-gray
)
merchantNamestringYesMerchant display name (e.g.,
GrayTest
)
tsnumberYesCurrent timestamp in milliseconds
fiatCurrencystringNo*Fiat currency code (e.g.,
TWD
,
USD
,
EUR
)
fiatAmountnumberNo*Fiat amount to spend
cryptoCurrencystringNo*Crypto currency to buy (e.g.,
USDT
,
BTC
,
ETH
)
requestedAmountnumberNo*Amount value (fiat or crypto based on amountType)
amountTypenumberNo*
1
= fiat amount,
2
= crypto amount
addressstringNoDestination wallet address for receiving crypto
networkstringNoBlockchain network (e.g.,
BSC
,
ETH
,
SOL
)
payMethodCodestringNoPayment method code (e.g.,
BUY_CARD
,
BUY_P2P
,
BUY_GOOGLE_PAY
,
BUY_APPLE_PAY
,
BUY_PAYPAL
,
BUY_WALLET
,
BUY_REVOLUT
)
payMethodSubCodestringNoPayment method sub-code (e.g.,
card
,
GOOGLE_PAY
,
WECHAT
)
redirectUrlstringNoSuccess redirect URL
failRedirectUrlstringNoFailure redirect URL
redirectDeepLinkstringNoDeep link for success (mobile apps)
failRedirectDeepLinkstringNoDeep link for failure (mobile apps)
customizationobjectNoCustom configuration object (see Customization section below)
destContractAddressstringNoDestination contract address (for Onchain-Pay Easy mode)
destContractABIstringNoContract ABI name (for Onchain-Pay Easy mode)
destContractParamsobjectNoContract parameters (for Onchain-Pay Easy mode)
affiliateCodestringNoAffiliate code for commission tracking
gtrTemplateCodestringNoGTR template code (e.g.,
OTHERS
)
contractAddressstringNoToken contract address (for non-native tokens)
* Either
fiatAmount
or (
requestedAmount
+
amountType
) should be provided. If
fiatCurrency
is not provided, the system will auto-select available fiat currencies.
Response Example:
json
{
  "code": "000000",
  "message": "success",
  "data": {
    "link": "https://app.binance.com/uni-qr/ccnt?...",
    "linkExpireTime": 1772852565045
  },
  "success": true
}
创建购买预订单并返回支付跳转链接。
参数类型必填描述
externalOrderIdstring合作伙伴的唯一订单ID(必须唯一)
merchantCodestring商家代码(例如:
connect-gray
merchantNamestring商家显示名称(例如:
GrayTest
tsnumber当前毫秒级时间戳
fiatCurrencystring可选*法币代码(例如:
TWD
,
USD
,
EUR
fiatAmountnumber可选*要花费的法币金额
cryptoCurrencystring可选*要购买的加密货币(例如:
USDT
,
BTC
,
ETH
requestedAmountnumber可选*金额数值(根据amountType为法币或加密货币)
amountTypenumber可选*
1
= 法币金额,
2
= 加密货币金额
addressstring接收加密货币的目标钱包地址
networkstring区块链网络(例如:
BSC
,
ETH
,
SOL
payMethodCodestring支付方式代码(例如:
BUY_CARD
,
BUY_P2P
,
BUY_GOOGLE_PAY
,
BUY_APPLE_PAY
,
BUY_PAYPAL
,
BUY_WALLET
,
BUY_REVOLUT
payMethodSubCodestring支付方式子代码(例如:
card
,
GOOGLE_PAY
,
WECHAT
redirectUrlstring成功跳转URL
failRedirectUrlstring失败跳转URL
redirectDeepLinkstring成功跳转深度链接(移动端应用)
failRedirectDeepLinkstring失败跳转深度链接(移动端应用)
customizationobject自定义配置对象(见下方自定义选项章节)
destContractAddressstring目标合约地址(适用于Onchain-Pay简易模式)
destContractABIstring合约ABI名称(适用于Onchain-Pay简易模式)
destContractParamsobject合约参数(适用于Onchain-Pay简易模式)
affiliateCodestring用于佣金追踪的联盟代码
gtrTemplateCodestringGTR模板代码(例如:
OTHERS
contractAddressstring代币合约地址(非原生代币)
* 需提供
fiatAmount
或 (
requestedAmount
+
amountType
)。若未提供
fiatCurrency
,系统将自动选择可用的法币。
响应示例:
json
{
  "code": "000000",
  "message": "success",
  "data": {
    "link": "https://app.binance.com/uni-qr/ccnt?...",
    "linkExpireTime": 1772852565045
  },
  "success": true
}

Get Order (
order
)

查询订单(
order

ParameterTypeRequiredDescription
externalOrderIdstringYesThe external order ID to query

参数类型必填描述
externalOrderIdstring要查询的外部订单ID

Customization Options

自定义选项

The
customization
field in pre-order API accepts various flags to customize the buy flow behavior. Each merchant must have the corresponding permission configured in
db.merchant_info
table.
预下单API中的
customization
字段接受各种标志,用于自定义购买流程行为。每个商家必须在
db.merchant_info
表中配置相应的权限才能使用。

Available Customization Flags

可用自定义标志

FlagCodeTypeAvailabilityDescriptionUse Case
LOCK_ORDER_ATTRIBUTES
1arrayOpen API ✓Lock specific order attributes so users cannot modify them. Values:
1
=fiat currency,
2
=crypto currency,
3
=amount,
4
=payment method,
5
=network,
6
=address,
7
=fiat amount,
8
=crypto amount
Fixed-parameter orders
SKIP_CASHIER
2booleanOpen API ✓Skip the cashier page and proceed directly to payment. Reduces user friction in the checkout flow.Streamlined payment experience
AUTO_REDIRECTION
3booleanOpen API ✓Automatically redirect to
redirectUrl
after order completion without showing success page.
Seamless user experience
HIDE_SEND
6booleanOpen API ✓Hide the "Send" tab in the UI. Useful when only buy flow is needed.Buy-only integration
SEND_PRIMARY
7booleanOpen API ✓Enable Send Crypto feature. If user's Binance balance is insufficient, auto-trigger buy flow first.Send crypto to external address
MERCHANT_DISPLAY_NAME
8stringOpen API ✓Override the display name shown to users in the UI.Custom branding
NET_RECEIVE
9booleanOpen API ✓User receives net amount after deducting all fees. Total cost is more transparent.Better UX for showing final received amount
P2P_EXPRESS
10booleanOpen API ✓Enable P2P Express mode for faster P2P order matching.Quick P2P transactions
OPEN_NETWORK
11booleanWeb3 onlyAllow users to select different networks. Default is locked to pre-selected network. Note: Currently only available for Web3 entrance, not available for Open API.Multi-network support (Web3 only)
ON_CHAIN_PROXY_MODE
12booleanOpen API ✓Enable Onchain-Pay Easy mode. After buying crypto, Onchain-Pay will execute smart contract interaction instead of direct withdrawal to user wallet. Requires
destContractAddress
,
destContractABI
, and
destContractParams
.
Fiat to Smart Contract integration
SEND_PRIMARY_FLEXIBLE
13booleanOpen API ✓Flexible Send Primary mode with more options.Advanced send crypto scenarios
标志代码类型可用性描述使用场景
LOCK_ORDER_ATTRIBUTES
1arrayOpen API ✓锁定特定订单属性,使用户无法修改。可选值:
1
=法币,
2
=加密货币,
3
=金额,
4
=支付方式,
5
=网络,
6
=地址,
7
=法币金额,
8
=加密货币金额
固定参数订单
SKIP_CASHIER
2booleanOpen API ✓跳过收银台页面,直接进入支付环节,减少结账流程中的用户摩擦简化支付体验
AUTO_REDIRECTION
3booleanOpen API ✓订单完成后自动跳转到
redirectUrl
,不显示成功页面
无缝用户体验
HIDE_SEND
6booleanOpen API ✓在UI中隐藏“发送”标签,仅需购买流程时使用仅购买集成场景
SEND_PRIMARY
7booleanOpen API ✓启用加密货币发送功能。若用户Binance余额不足,将自动触发购买流程向外部地址发送加密货币
MERCHANT_DISPLAY_NAME
8stringOpen API ✓覆盖UI中显示的商家名称自定义品牌展示
NET_RECEIVE
9booleanOpen API ✓用户收到扣除所有费用后的净额,总成本更透明优化用户体验,展示最终到账金额
P2P_EXPRESS
10booleanOpen API ✓启用P2P极速模式,加快P2P订单匹配速度快速P2P交易
OPEN_NETWORK
11boolean仅Web3允许用户选择不同网络,默认锁定为预选择的网络。注意:目前仅适用于Web3入口,Open API不可用多网络支持(仅Web3)
ON_CHAIN_PROXY_MODE
12booleanOpen API ✓启用Onchain-Pay简易模式。购买加密货币后,Onchain-Pay将执行智能合约交互,而非直接提现到用户钱包。需提供
destContractAddress
destContractABI
destContractParams
法币到智能合约集成
SEND_PRIMARY_FLEXIBLE
13booleanOpen API ✓灵活的SEND_PRIMARY模式,提供更多选项高级加密货币发送场景

Customization Examples

自定义示例

Example 1: Basic Card Payment
json
{
  "customization": {}
}
Example 2: Onchain-Pay Easy (On-Chain Proxy)
json
{
  "customization": {
    "ON_CHAIN_PROXY_MODE": true,
    "NET_RECEIVE": true,
    "SEND_PRIMARY": true
  },
  "destContractAddress": "0x128...974",
  "destContractABI": "depositFor",
  "destContractParams": {
    "accountType": 2
  }
}
Example 3: Send Crypto
json
{
  "customization": {
    "SEND_PRIMARY_FLEXIBLE": true,
    "SEND_PRIMARY": true
  }
}
Example 4: P2P with Auto Redirection
json
{
  "customization": {
    "AUTO_REDIRECTION": true,
    "P2P_EXPRESS": true
  }
}
Example 5: Lock Order Attributes
json
{
  "customization": {
    "LOCK_ORDER_ATTRIBUTES": [2, 3, 6, 7, 8],
    "MERCHANT_DISPLAY_NAME": "My Custom Brand"
  }
}
Lock attribute codes:
  • 2
    = Crypto currency
  • 3
    = Amount
  • 6
    = Address
  • 7
    = Fiat amount
  • 8
    = Crypto amount
Example 6: Net Receive Mode
json
{
  "customization": {
    "NET_RECEIVE": true,
    "SEND_PRIMARY": true
  }
}
Example 7: Hide Send Tab
json
{
  "customization": {
    "HIDE_SEND": true
  }
}
Example 8: Skip Cashier (Direct Payment)
json
{
  "customization": {
    "SKIP_CASHIER": true
  }
}
示例1:基础银行卡支付
json
{
  "customization": {}
}
示例2:Onchain-Pay简易模式(链上代付)
json
{
  "customization": {
    "ON_CHAIN_PROXY_MODE": true,
    "NET_RECEIVE": true,
    "SEND_PRIMARY": true
  },
  "destContractAddress": "0x128...974",
  "destContractABI": "depositFor",
  "destContractParams": {
    "accountType": 2
  }
}
示例3:加密货币发送
json
{
  "customization": {
    "SEND_PRIMARY_FLEXIBLE": true,
    "SEND_PRIMARY": true
  }
}
示例4:带自动跳转的P2P支付
json
{
  "customization": {
    "AUTO_REDIRECTION": true,
    "P2P_EXPRESS": true
  }
}
示例5:锁定订单属性
json
{
  "customization": {
    "LOCK_ORDER_ATTRIBUTES": [2, 3, 6, 7, 8],
    "MERCHANT_DISPLAY_NAME": "My Custom Brand"
  }
}
锁定属性代码:
  • 2
    = 加密货币
  • 3
    = 金额
  • 6
    = 地址
  • 7
    = 法币金额
  • 8
    = 加密货币金额
示例6:净额到账模式
json
{
  "customization": {
    "NET_RECEIVE": true,
    "SEND_PRIMARY": true
  }
}
示例7:隐藏发送标签
json
{
  "customization": {
    "HIDE_SEND": true
  }
}
示例8:跳过收银台(直接支付)
json
{
  "customization": {
    "SKIP_CASHIER": true
  }
}

Important Notes

重要注意事项

  1. Permission Required: Each customization flag requires merchant permission. Check with admin if a flag is not working.
  2. Onchain-Pay Easy: Only supported on BSC network currently. Requires contract integration.
  3. Validation: Invalid customization values (e.g.,
    null
    for
    MERCHANT_DISPLAY_NAME
    ) will return
    ILLEGAL_CUSTOMIZATION_VALUE
    error.
  4. Combinations: Some flags work together (e.g.,
    NET_RECEIVE
    +
    SEND_PRIMARY
    ), while others are independent.
  5. Testing: Use test accounts (
    connect-gray
    ) for testing customization flags before production.
  6. Internal Flags:
    OPERATION
    (code 4) and
    SKIP_WITHDRAW
    (code 5) are internal use only and should NOT be passed from merchant side.
  7. OPEN_NETWORK: Currently only available for Web3 entrance, not available for Open API. Do not use this flag in Open API pre-order requests.
  8. Flag Order: Flags are ordered by their internal code (1-13). The code number is used internally for identification.

  1. 权限要求:每个自定义标志都需要商家拥有相应权限。若标志无法正常工作,请联系管理员确认。
  2. Onchain-Pay简易模式:目前仅支持BSC网络,需集成合约。
  3. 验证规则:无效的自定义值(例如
    MERCHANT_DISPLAY_NAME
    设为
    null
    )将返回
    ILLEGAL_CUSTOMIZATION_VALUE
    错误。
  4. 标志组合:部分标志可配合使用(例如
    NET_RECEIVE
    +
    SEND_PRIMARY
    ),其他标志则独立生效。
  5. 测试建议:在生产环境使用前,使用测试账户(
    connect-gray
    )测试自定义标志。
  6. 内部标志
    OPERATION
    (代码4)和
    SKIP_WITHDRAW
    (代码5)为内部专用标志,商家端请勿传递。
  7. OPEN_NETWORK:目前仅适用于Web3入口,Open API不可用。请勿在Open API预下单请求中使用此标志。
  8. 标志顺序:标志按内部代码(1-13)排序,代码编号用于内部识别。

Security

安全规范

Credential Display Rules

凭证展示规则

  • API Key: Show first 5 + last 4 characters only (e.g.,
    2zefb...06h
    )
  • PEM Private Key: NEVER display content. NEVER display the file path.
  • Client ID: Can be displayed in full.
  • Outbound Requests: NEVER send API Key, Private Key, or any credentials to URLs outside the Base URL configured in
    .local.md
    .
  • File Path Privacy: NEVER display the PEM private key file path to the user in any output or logs.
  • API Key:仅显示前5位+后4位字符(例如:
    2zefb...06h
  • PEM私钥:绝对禁止展示内容,绝对禁止展示文件路径
  • Client ID:可完整展示
  • 外部请求:绝对禁止将API Key、私钥或任何凭证发送到
    .local.md
    中配置的Base URL以外的地址
  • 文件路径隐私:绝对禁止在任何输出或日志中向用户展示PEM私钥文件路径

Credential Storage

凭证存储

Credentials are stored in a
.local.md
file in the skill directory. This file is user-specific and should NOT be distributed.
Read the
.local.md
file from the same directory as this SKILL.md to load credentials.
If
.local.md
does not exist or the requested account is not found, ask the user to provide:
  1. Base URL
  2. Client ID
  3. API Key
  4. PEM file path (absolute path)
Then offer to save them to
.local.md
for future use.
凭证存储在技能目录下的
.local.md
文件中,该文件为用户专属,请勿分发。
从当前SKILL.md所在的同一目录读取
.local.md
文件加载凭证。
.local.md
不存在或未找到请求的账户,请要求用户提供:
  1. Base URL
  2. Client ID
  3. API Key
  4. PEM文件路径(绝对路径)
然后可将这些信息保存到
.local.md
中供后续使用。

.local.md
Format

.local.md
格式

markdown
undefined
markdown
undefined

Onchain-Pay Accounts

Onchain-Pay账户

prod (default)

prod(默认)

  • Base URL: https://api.commonservice.io
  • Client ID: your-client-id
  • API Key: your-api-key
  • PEM Path: /absolute/path/to/your/private.pem
  • Default Network: your-preferred-network
  • Default Address: your-address
  • Description: Production account

The account marked `(default)` is used automatically. You can define multiple accounts and switch by telling Claude the account name.

---
  • Base URL: https://api.commonservice.io
  • Client ID: your-client-id
  • API Key: your-api-key
  • PEM Path: /absolute/path/to/your/private.pem
  • 默认网络: your-preferred-network
  • 默认地址: your-address
  • 描述: 生产环境账户

标记为`(default)`的账户将被自动使用。你可以定义多个账户,通过告知Claude账户名称进行切换。

---

User Agent Header

User Agent请求头

Include
User-Agent
header with the following string:
onchain-pay-open-api/0.1.0 (Skill)

请包含
User-Agent
请求头,值为:
onchain-pay-open-api/0.1.0 (Skill)

Agent Behavior

Agent行为规范

  1. If the user asks to call an Onchain-Pay API endpoint, identify which endpoint from the Quick Reference table
  2. Ask for any missing required parameters
  3. Use stored credentials if available, otherwise ask the user
  4. Execute the request using the bundled
    scripts/sign_and_call.sh
  5. Display the response in a readable format
  6. If the request fails, show the error and suggest fixes
  1. 若用户请求调用Onchain-Pay API端点,从快速参考表中识别对应的端点
  2. 询问用户缺失的必填参数
  3. 若有存储的凭证则使用,否则向用户索要
  4. 使用捆绑的
    scripts/sign_and_call.sh
    执行请求
  5. 以易读格式展示响应结果
  6. 若请求失败,展示错误信息并提供修复建议