改写统一API的参数
注意,统一API的大部分方法都可以接受一个可选的params
参数,它是一个
关联数组(字典,默认为空),包含了你希望改写的参数。params
的内容
是与特定交易所相关的,参考交易所的API文档了解其支持的字段和值。如果
你需要传入自定义设置或可选的参数,那么可以使用params
字典。
JavaScript示例代码:
(async () => {
const params = {
'foo': 'bar', // exchange-specific overrides in unified queries
'Hello': 'World!', // see their docs for more details on parameter names
}
// the overrides go into the last argument to the unified call ↓ HERE
const result = await exchange.fetchOrderBook (symbol, length, params)
}) ()
Python示例代码:
params = {
'foo': 'bar', # exchange-specific overrides in unified queries
'Hello': 'World!', # see their docs for more details on parameter names
}
# overrides go in the last argument to the unified call ↓ HERE
result = exchange.fetch_order_book(symbol, length, params)
PHP示例代码:
$params = array (
'foo' => 'bar', // exchange-specific overrides in unified queries
'Hello' => 'World!', // see their docs for more details on parameter names
}
// overrides go into the last argument to the unified call ↓ HERE
$result = $exchange->fetch_order_book ($symbol, $length, $params);