GetExchangeList
获取平台支持的交易所列表,以及每个交易所需要填写的配置项。
示例
列出支持的交易所Id和名称(概要信息)。
python
# api() 见「签名验证」页面的Python示例
r = api('GetExchangeList', True)
for e in r['data']['result']['exchanges']:
print(e['eid'], e['name'])返回值
| 类型 | 描述 |
object | 成功时 |
参数
| 名称 | 类型 | 必填 | 描述 |
isSummary | bool | 是 |
|
属性
| 名称 | 类型 | 描述 |
exchanges[].eid | string | 交易所Id,例如 |
exchanges[].name | string | 显示名称,写作 |
exchanges[].category | string | 分类。 |
exchanges[].meta | string | 交易所配置项的元数据(JSON文本),只在 |
exchanges[].stocks | string | 常用交易对,逗号分隔,只在 |
备注
返回示例(isSummary为false)
json
{
"code": 0,
"data": {
"result": {
"exchanges": [{
"category": "加密货币||Crypto",
"eid": "Futures_Binance",
"id": 74,
"logo": "/upload/asset/d8d84b23e573e9326b99.svg",
"meta": "[...]",
"name": "币安期货|Futures_Binance",
"priority": 200,
"stocks": "BTC_USDT,ETH_USDT,ETH_USD",
"website": "https://accounts.binance.com/zh-TC/register?ref=45110270"
}]
},
"error": null
}
}
其中meta是JSON文本,解析后为配置项数组:
json
[
{"desc": "Access Key", "qr": "apiKey", "required": true, "type": "string",
"name": "AccessKey", "label": "Access Key"},
{"encrypt": true, "qr": "secretKey", "name": "SecretKey", "required": true,
"label": "Secret Key", "type": "password", "desc": "Secret Key"}
]
返回示例(isSummary为true)
json
{
"code": 0,
"data": {
"result": {
"exchanges": [{
"category": "加密货币||Crypto",
"eid": "Futures_Binance",
"id": 74,
"logo": "/upload/asset/d8d84b23e573e9326b99.svg",
"name": "币安期货|Futures_Binance",
"priority": 200,
"website": "https://accounts.binance.com/zh-TC/register?ref=45110270"
}]
},
"error": null
}
}