exchange.IO("base", ...)
Queries or switches the base address of the exchange API. On a Web3 exchange object it sets the RPC node address, see exchange.IO("base", ...).
exchange.IO(k)
exchange.IO(k, address)Examples
Switch the exchange API base address.
javascript
function main () {
// exchanges[0] is the first exchange object added when the live trading was created
var old = exchanges[0].IO("base", "https://api.huobi.pro")
Log("Base address before:", old, "current base address:", exchanges[0].IO("base"))
}
python
def main():
old = exchanges[0].IO("base", "https://api.huobi.pro")
Log("Base address before:", old, "current base address:", exchanges[0].IO("base"))
rust
fn main() {
// exchanges[0] is the first exchange object added when the live trading was created
let old = exchanges[0].IO(("base", "https://api.huobi.pro"));
Log!("Base address before:", old, "current base address:", exchanges[0].IO("base"));
}Returns
| Type | Description |
string / null value | Without |
Arguments
| Name | Type | Required | Description |
k | string | Yes | Selects the |
address | string | No | New base address, e.g. |
See Also
Remarks
Querying and switching the base address (base mode)
exchange.IO("base", address): switches the exchange API base address, equivalent toexchange.SetBase.exchange.IO("base"): queries the current base address; if it has never been switched, the exchange's default API address is returned. Equivalent toexchange.GetBase.
A few exchanges have separate base address commands (for example for coin-margined contracts, options or the market data API); see the IO command table of the exchange page (all exchanges are listed in Capability Matrix).