提交 7c013c4b 编写于 作者: T Travis CI

1.62.89

[ci skip]
上级 5a744b19
......@@ -219,13 +219,13 @@ console.log (ccxt.exchanges) // print all available exchanges
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.62.88/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@1.62.88/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.62.89/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@1.62.89/dist/ccxt.browser.js
CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
```HTML
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@1.62.88/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@1.62.89/dist/ccxt.browser.js"></script>
```
Creates a global `ccxt` object:
......
......@@ -36,7 +36,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building
const version = '1.62.88'
const version = '1.62.89'
Exchange.ccxtVersion = version
......
......@@ -44,7 +44,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building
const version = '1.62.88'
const version = '1.62.89'
Exchange.ccxtVersion = version
......@@ -47317,43 +47317,40 @@ module.exports = class bybit extends Exchange {
//
// fetchTrades (public)
//
// {
// id: 43785688,
// symbol: 'BTCUSD',
// price: 7786,
// qty: 67,
// side: 'Sell',
// time: '2020-03-11T19:18:30.123Z'
// }
// {
// "id": "44275042152",
// "symbol": "AAVEUSDT",
// "price": "256.35",
// "qty": "0.1",
// "side": "Buy",
// "time": "2021-11-30T12:46:14.000Z",
// "trade_time_ms": "1638276374312"
// }
//
// fetchMyTrades, fetchOrderTrades (private)
//
// {
// "closed_size": 0,
// "cross_seq": 277136382,
// "exec_fee": "0.0000001",
// "exec_id": "256e5ef8-abfe-5772-971b-f944e15e0d68",
// "exec_price": "8178.5",
// "exec_qty": 1,
// // the docs say the exec_time field is "abandoned" now
// // the user should use "trade_time_ms"
// "exec_time": "1571676941.70682",
// "exec_type": "Trade", //Exec Type Enum
// "exec_value": "0.00012227",
// "fee_rate": "0.00075",
// "last_liquidity_ind": "RemovedLiquidity", //Liquidity Enum
// "leaves_qty": 0,
// "nth_fill": 2,
// "order_id": "7ad50cb1-9ad0-4f74-804b-d82a516e1029",
// "order_link_id": "",
// "order_price": "8178",
// "order_qty": 1,
// "order_type": "Market", //Order Type Enum
// "side": "Buy", //Side Enum
// "symbol": "BTCUSD", //Symbol Enum
// "user_id": 1,
// "trade_time_ms": 1577480599000
// }
// {
// "order_id": "b020b4bc-6fe2-45b5-adbc-dd07794f9746",
// "order_link_id": "",
// "side": "Buy",
// "symbol": "AAVEUSDT",
// "exec_id": "09abe8f0-aea6-514e-942b-7da8cb935120",
// "price": "269.3",
// "order_price": "269.3",
// "order_qty": "0.1",
// "order_type": "Market",
// "fee_rate": "0.00075",
// "exec_price": "256.35",
// "exec_type": "Trade",
// "exec_qty": "0.1",
// "exec_fee": "0.01922625",
// "exec_value": "25.635",
// "leaves_qty": "0",
// "closed_size": "0",
// "last_liquidity_ind": "RemovedLiquidity",
// "trade_time": "1638276374",
// "trade_time_ms": "1638276374312"
// }
//
const id = this.safeString2 (trade, 'id', 'exec_id');
const marketId = this.safeString (trade, 'symbol');
......@@ -47361,12 +47358,7 @@ module.exports = class bybit extends Exchange {
const symbol = market['symbol'];
const amountString = this.safeString2 (trade, 'qty', 'exec_qty');
const priceString = this.safeString2 (trade, 'exec_price', 'price');
let cost = this.safeNumber (trade, 'exec_value');
const amount = this.parseNumber (amountString);
const price = this.parseNumber (priceString);
if (cost === undefined) {
cost = this.parseNumber (Precise.stringMul (priceString, amountString));
}
const costString = this.safeString (trade, 'exec_value');
let timestamp = this.parse8601 (this.safeString (trade, 'time'));
if (timestamp === undefined) {
timestamp = this.safeInteger (trade, 'trade_time_ms');
......@@ -47374,17 +47366,17 @@ module.exports = class bybit extends Exchange {
const side = this.safeStringLower (trade, 'side');
const lastLiquidityInd = this.safeString (trade, 'last_liquidity_ind');
const takerOrMaker = (lastLiquidityInd === 'AddedLiquidity') ? 'maker' : 'taker';
const feeCost = this.safeNumber (trade, 'exec_fee');
const feeCostString = this.safeString (trade, 'exec_fee');
let fee = undefined;
if (feeCost !== undefined) {
if (feeCostString !== undefined) {
const feeCurrencyCode = market['inverse'] ? market['base'] : market['quote'];
fee = {
'cost': feeCost,
'cost': feeCostString,
'currency': feeCurrencyCode,
'rate': this.safeNumber (trade, 'fee_rate'),
'rate': this.safeString (trade, 'fee_rate'),
};
}
return {
return this.safeTrade ({
'id': id,
'info': trade,
'timestamp': timestamp,
......@@ -47394,11 +47386,11 @@ module.exports = class bybit extends Exchange {
'type': this.safeStringLower (trade, 'order_type'),
'side': side,
'takerOrMaker': takerOrMaker,
'price': price,
'amount': amount,
'cost': cost,
'price': priceString,
'amount': amountString,
'cost': costString,
'fee': fee,
};
}, market);
}
async fetchTrades (symbol, since = undefined, limit = undefined, params = {}) {
......@@ -47490,6 +47482,7 @@ module.exports = class bybit extends Exchange {
}
async fetchBalance (params = {}) {
// note: any funds in the 'spot' account will not be returned or visible from this endpoint
await this.loadMarkets ();
const request = {};
const coin = this.safeString (params, 'coin');
......@@ -47698,12 +47691,11 @@ module.exports = class bybit extends Exchange {
}
const status = this.parseOrderStatus (this.safeString2 (order, 'order_status', 'stop_order_status'));
const side = this.safeStringLower (order, 'side');
const feeCostString = this.safeString (order, 'cum_exec_fee');
const feeCost = this.parseNumber (Precise.stringAbs (feeCostString));
const feeCostString = Precise.stringAbs (this.safeString (order, 'cum_exec_fee'));
let fee = undefined;
if (feeCost !== undefined) {
if (feeCostString !== undefined) {
fee = {
'cost': feeCost,
'cost': feeCostString,
'currency': feeCurrency,
};
}
......@@ -48385,6 +48377,9 @@ module.exports = class bybit extends Exchange {
}
async fetchMyTrades (symbol = undefined, since = undefined, limit = undefined, params = {}) {
if (symbol === undefined) {
throw new ArgumentsRequired (this.id + ' fetchMyTrades() requires a symbol argument');
}
await this.loadMarkets ();
const request = {
// 'order_id': 'f185806b-b801-40ff-adec-52289370ed62', // if not provided will return user's trading records
......@@ -48394,18 +48389,13 @@ module.exports = class bybit extends Exchange {
// 'limit' 20, // max 50
};
let market = undefined;
if (symbol === undefined) {
const orderId = this.safeString (params, 'order_id');
if (orderId === undefined) {
throw new ArgumentsRequired (this.id + ' fetchMyTrades() requires a symbol argument or an order_id param');
} else {
request['order_id'] = orderId;
params = this.omit (params, 'order_id');
}
} else {
market = this.market (symbol);
request['symbol'] = market['id'];
const orderId = this.safeString (params, 'order_id');
if (orderId !== undefined) {
request['order_id'] = orderId;
params = this.omit (params, 'order_id');
}
market = this.market (symbol);
request['symbol'] = market['id'];
if (since !== undefined) {
request['start_time'] = since;
}
......@@ -1924,14 +1924,14 @@ JavaScript (for use with the ``<script>`` tag):
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.62.88/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@1.62.88/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.62.89/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@1.62.89/dist/ccxt.browser.js
CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
.. code-block:: HTML
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@1.62.88/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@1.62.89/dist/ccxt.browser.js"></script>
Creates a global ``ccxt`` object:
......
{
"name": "ccxt",
"version": "1.62.88",
"version": "1.62.89",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"name": "ccxt",
"version": "1.62.88",
"version": "1.62.89",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 130+ exchanges",
"main": "./ccxt.js",
"unpkg": "dist/ccxt.browser.js",
......
......@@ -36,7 +36,7 @@ use Elliptic\EdDSA;
use BN\BN;
use Exception;
$version = '1.62.88';
$version = '1.62.89';
// rounding mode
const TRUNCATE = 0;
......@@ -55,7 +55,7 @@ const PAD_WITH_ZERO = 1;
class Exchange {
const VERSION = '1.62.88';
const VERSION = '1.62.89';
private static $base58_alphabet = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
private static $base58_encoder = null;
......
......@@ -28,11 +28,11 @@ use Exception;
include 'Throttle.php';
$version = '1.62.88';
$version = '1.62.89';
class Exchange extends \ccxt\Exchange {
const VERSION = '1.62.88';
const VERSION = '1.62.89';
public static $loop;
public static $kernel;
......
......@@ -952,43 +952,40 @@ class bybit extends Exchange {
//
// fetchTrades (public)
//
// {
// $id => 43785688,
// $symbol => 'BTCUSD',
// $price => 7786,
// qty => 67,
// $side => 'Sell',
// time => '2020-03-11T19:18:30.123Z'
// }
// {
// "id" => "44275042152",
// "symbol" => "AAVEUSDT",
// "price" => "256.35",
// "qty" => "0.1",
// "side" => "Buy",
// "time" => "2021-11-30T12:46:14.000Z",
// "trade_time_ms" => "1638276374312"
// }
//
// fetchMyTrades, fetchOrderTrades (private)
//
// {
// "closed_size" => 0,
// "cross_seq" => 277136382,
// "exec_fee" => "0.0000001",
// "exec_id" => "256e5ef8-abfe-5772-971b-f944e15e0d68",
// "exec_price" => "8178.5",
// "exec_qty" => 1,
// // the docs say the exec_time field is "abandoned" now
// // the user should use "trade_time_ms"
// "exec_time" => "1571676941.70682",
// "exec_type" => "Trade", //Exec Type Enum
// "exec_value" => "0.00012227",
// "fee_rate" => "0.00075",
// "last_liquidity_ind" => "RemovedLiquidity", //Liquidity Enum
// "leaves_qty" => 0,
// "nth_fill" => 2,
// "order_id" => "7ad50cb1-9ad0-4f74-804b-d82a516e1029",
// "order_link_id" => "",
// "order_price" => "8178",
// "order_qty" => 1,
// "order_type" => "Market", //Order Type Enum
// "side" => "Buy", //Side Enum
// "symbol" => "BTCUSD", //Symbol Enum
// "user_id" => 1,
// "trade_time_ms" => 1577480599000
// }
// {
// "order_id" => "b020b4bc-6fe2-45b5-adbc-dd07794f9746",
// "order_link_id" => "",
// "side" => "Buy",
// "symbol" => "AAVEUSDT",
// "exec_id" => "09abe8f0-aea6-514e-942b-7da8cb935120",
// "price" => "269.3",
// "order_price" => "269.3",
// "order_qty" => "0.1",
// "order_type" => "Market",
// "fee_rate" => "0.00075",
// "exec_price" => "256.35",
// "exec_type" => "Trade",
// "exec_qty" => "0.1",
// "exec_fee" => "0.01922625",
// "exec_value" => "25.635",
// "leaves_qty" => "0",
// "closed_size" => "0",
// "last_liquidity_ind" => "RemovedLiquidity",
// "trade_time" => "1638276374",
// "trade_time_ms" => "1638276374312"
// }
//
$id = $this->safe_string_2($trade, 'id', 'exec_id');
$marketId = $this->safe_string($trade, 'symbol');
......@@ -996,12 +993,7 @@ class bybit extends Exchange {
$symbol = $market['symbol'];
$amountString = $this->safe_string_2($trade, 'qty', 'exec_qty');
$priceString = $this->safe_string_2($trade, 'exec_price', 'price');
$cost = $this->safe_number($trade, 'exec_value');
$amount = $this->parse_number($amountString);
$price = $this->parse_number($priceString);
if ($cost === null) {
$cost = $this->parse_number(Precise::string_mul($priceString, $amountString));
}
$costString = $this->safe_string($trade, 'exec_value');
$timestamp = $this->parse8601($this->safe_string($trade, 'time'));
if ($timestamp === null) {
$timestamp = $this->safe_integer($trade, 'trade_time_ms');
......@@ -1009,17 +1001,17 @@ class bybit extends Exchange {
$side = $this->safe_string_lower($trade, 'side');
$lastLiquidityInd = $this->safe_string($trade, 'last_liquidity_ind');
$takerOrMaker = ($lastLiquidityInd === 'AddedLiquidity') ? 'maker' : 'taker';
$feeCost = $this->safe_number($trade, 'exec_fee');
$feeCostString = $this->safe_string($trade, 'exec_fee');
$fee = null;
if ($feeCost !== null) {
if ($feeCostString !== null) {
$feeCurrencyCode = $market['inverse'] ? $market['base'] : $market['quote'];
$fee = array(
'cost' => $feeCost,
'cost' => $feeCostString,
'currency' => $feeCurrencyCode,
'rate' => $this->safe_number($trade, 'fee_rate'),
'rate' => $this->safe_string($trade, 'fee_rate'),
);
}
return array(
return $this->safe_trade(array(
'id' => $id,
'info' => $trade,
'timestamp' => $timestamp,
......@@ -1029,11 +1021,11 @@ class bybit extends Exchange {
'type' => $this->safe_string_lower($trade, 'order_type'),
'side' => $side,
'takerOrMaker' => $takerOrMaker,
'price' => $price,
'amount' => $amount,
'cost' => $cost,
'price' => $priceString,
'amount' => $amountString,
'cost' => $costString,
'fee' => $fee,
);
), $market);
}
public function fetch_trades($symbol, $since = null, $limit = null, $params = array ()) {
......@@ -1125,6 +1117,7 @@ class bybit extends Exchange {
}
public function fetch_balance($params = array ()) {
// note => any funds in the 'spot' $account will not be returned or visible from this endpoint
yield $this->load_markets();
$request = array();
$coin = $this->safe_string($params, 'coin');
......@@ -1333,12 +1326,11 @@ class bybit extends Exchange {
}
$status = $this->parse_order_status($this->safe_string_2($order, 'order_status', 'stop_order_status'));
$side = $this->safe_string_lower($order, 'side');
$feeCostString = $this->safe_string($order, 'cum_exec_fee');
$feeCost = $this->parse_number(Precise::string_abs($feeCostString));
$feeCostString = Precise::string_abs($this->safe_string($order, 'cum_exec_fee'));
$fee = null;
if ($feeCost !== null) {
if ($feeCostString !== null) {
$fee = array(
'cost' => $feeCost,
'cost' => $feeCostString,
'currency' => $feeCurrency,
);
}
......@@ -2020,6 +2012,9 @@ class bybit extends Exchange {
}
public function fetch_my_trades($symbol = null, $since = null, $limit = null, $params = array ()) {
if ($symbol === null) {
throw new ArgumentsRequired($this->id . ' fetchMyTrades() requires a $symbol argument');
}
yield $this->load_markets();
$request = array(
// 'order_id' => 'f185806b-b801-40ff-adec-52289370ed62', // if not provided will return user's trading records
......@@ -2029,18 +2024,13 @@ class bybit extends Exchange {
// 'limit' 20, // max 50
);
$market = null;
if ($symbol === null) {
$orderId = $this->safe_string($params, 'order_id');
if ($orderId === null) {
throw new ArgumentsRequired($this->id . ' fetchMyTrades() requires a $symbol argument or an order_id param');
} else {
$request['order_id'] = $orderId;
$params = $this->omit($params, 'order_id');
}
} else {
$market = $this->market($symbol);
$request['symbol'] = $market['id'];
$orderId = $this->safe_string($params, 'order_id');
if ($orderId !== null) {
$request['order_id'] = $orderId;
$params = $this->omit($params, 'order_id');
}
$market = $this->market($symbol);
$request['symbol'] = $market['id'];
if ($since !== null) {
$request['start_time'] = $since;
}
......
......@@ -951,43 +951,40 @@ class bybit extends Exchange {
//
// fetchTrades (public)
//
// {
// $id => 43785688,
// $symbol => 'BTCUSD',
// $price => 7786,
// qty => 67,
// $side => 'Sell',
// time => '2020-03-11T19:18:30.123Z'
// }
// {
// "id" => "44275042152",
// "symbol" => "AAVEUSDT",
// "price" => "256.35",
// "qty" => "0.1",
// "side" => "Buy",
// "time" => "2021-11-30T12:46:14.000Z",
// "trade_time_ms" => "1638276374312"
// }
//
// fetchMyTrades, fetchOrderTrades (private)
//
// {
// "closed_size" => 0,
// "cross_seq" => 277136382,
// "exec_fee" => "0.0000001",
// "exec_id" => "256e5ef8-abfe-5772-971b-f944e15e0d68",
// "exec_price" => "8178.5",
// "exec_qty" => 1,
// // the docs say the exec_time field is "abandoned" now
// // the user should use "trade_time_ms"
// "exec_time" => "1571676941.70682",
// "exec_type" => "Trade", //Exec Type Enum
// "exec_value" => "0.00012227",
// "fee_rate" => "0.00075",
// "last_liquidity_ind" => "RemovedLiquidity", //Liquidity Enum
// "leaves_qty" => 0,
// "nth_fill" => 2,
// "order_id" => "7ad50cb1-9ad0-4f74-804b-d82a516e1029",
// "order_link_id" => "",
// "order_price" => "8178",
// "order_qty" => 1,
// "order_type" => "Market", //Order Type Enum
// "side" => "Buy", //Side Enum
// "symbol" => "BTCUSD", //Symbol Enum
// "user_id" => 1,
// "trade_time_ms" => 1577480599000
// }
// {
// "order_id" => "b020b4bc-6fe2-45b5-adbc-dd07794f9746",
// "order_link_id" => "",
// "side" => "Buy",
// "symbol" => "AAVEUSDT",
// "exec_id" => "09abe8f0-aea6-514e-942b-7da8cb935120",
// "price" => "269.3",
// "order_price" => "269.3",
// "order_qty" => "0.1",
// "order_type" => "Market",
// "fee_rate" => "0.00075",
// "exec_price" => "256.35",
// "exec_type" => "Trade",
// "exec_qty" => "0.1",
// "exec_fee" => "0.01922625",
// "exec_value" => "25.635",
// "leaves_qty" => "0",
// "closed_size" => "0",
// "last_liquidity_ind" => "RemovedLiquidity",
// "trade_time" => "1638276374",
// "trade_time_ms" => "1638276374312"
// }
//
$id = $this->safe_string_2($trade, 'id', 'exec_id');
$marketId = $this->safe_string($trade, 'symbol');
......@@ -995,12 +992,7 @@ class bybit extends Exchange {
$symbol = $market['symbol'];
$amountString = $this->safe_string_2($trade, 'qty', 'exec_qty');
$priceString = $this->safe_string_2($trade, 'exec_price', 'price');
$cost = $this->safe_number($trade, 'exec_value');
$amount = $this->parse_number($amountString);
$price = $this->parse_number($priceString);
if ($cost === null) {
$cost = $this->parse_number(Precise::string_mul($priceString, $amountString));
}
$costString = $this->safe_string($trade, 'exec_value');
$timestamp = $this->parse8601($this->safe_string($trade, 'time'));
if ($timestamp === null) {
$timestamp = $this->safe_integer($trade, 'trade_time_ms');
......@@ -1008,17 +1000,17 @@ class bybit extends Exchange {
$side = $this->safe_string_lower($trade, 'side');
$lastLiquidityInd = $this->safe_string($trade, 'last_liquidity_ind');
$takerOrMaker = ($lastLiquidityInd === 'AddedLiquidity') ? 'maker' : 'taker';
$feeCost = $this->safe_number($trade, 'exec_fee');
$feeCostString = $this->safe_string($trade, 'exec_fee');
$fee = null;
if ($feeCost !== null) {
if ($feeCostString !== null) {
$feeCurrencyCode = $market['inverse'] ? $market['base'] : $market['quote'];
$fee = array(
'cost' => $feeCost,
'cost' => $feeCostString,
'currency' => $feeCurrencyCode,
'rate' => $this->safe_number($trade, 'fee_rate'),
'rate' => $this->safe_string($trade, 'fee_rate'),
);
}
return array(
return $this->safe_trade(array(
'id' => $id,
'info' => $trade,
'timestamp' => $timestamp,
......@@ -1028,11 +1020,11 @@ class bybit extends Exchange {
'type' => $this->safe_string_lower($trade, 'order_type'),
'side' => $side,
'takerOrMaker' => $takerOrMaker,
'price' => $price,
'amount' => $amount,
'cost' => $cost,
'price' => $priceString,
'amount' => $amountString,
'cost' => $costString,
'fee' => $fee,
);
), $market);
}
public function fetch_trades($symbol, $since = null, $limit = null, $params = array ()) {
......@@ -1124,6 +1116,7 @@ class bybit extends Exchange {
}
public function fetch_balance($params = array ()) {
// note => any funds in the 'spot' $account will not be returned or visible from this endpoint
$this->load_markets();
$request = array();
$coin = $this->safe_string($params, 'coin');
......@@ -1332,12 +1325,11 @@ class bybit extends Exchange {
}
$status = $this->parse_order_status($this->safe_string_2($order, 'order_status', 'stop_order_status'));
$side = $this->safe_string_lower($order, 'side');
$feeCostString = $this->safe_string($order, 'cum_exec_fee');
$feeCost = $this->parse_number(Precise::string_abs($feeCostString));
$feeCostString = Precise::string_abs($this->safe_string($order, 'cum_exec_fee'));
$fee = null;
if ($feeCost !== null) {
if ($feeCostString !== null) {
$fee = array(
'cost' => $feeCost,
'cost' => $feeCostString,
'currency' => $feeCurrency,
);
}
......@@ -2019,6 +2011,9 @@ class bybit extends Exchange {
}
public function fetch_my_trades($symbol = null, $since = null, $limit = null, $params = array ()) {
if ($symbol === null) {
throw new ArgumentsRequired($this->id . ' fetchMyTrades() requires a $symbol argument');
}
$this->load_markets();
$request = array(
// 'order_id' => 'f185806b-b801-40ff-adec-52289370ed62', // if not provided will return user's trading records
......@@ -2028,18 +2023,13 @@ class bybit extends Exchange {
// 'limit' 20, // max 50
);
$market = null;
if ($symbol === null) {
$orderId = $this->safe_string($params, 'order_id');
if ($orderId === null) {
throw new ArgumentsRequired($this->id . ' fetchMyTrades() requires a $symbol argument or an order_id param');
} else {
$request['order_id'] = $orderId;
$params = $this->omit($params, 'order_id');
}
} else {
$market = $this->market($symbol);
$request['symbol'] = $market['id'];
$orderId = $this->safe_string($params, 'order_id');
if ($orderId !== null) {
$request['order_id'] = $orderId;
$params = $this->omit($params, 'order_id');
}
$market = $