ccxt 4.1.73 → 4.1.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -8
- package/dist/ccxt.browser.js +1108 -1455
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -4
- package/dist/cjs/src/base/Exchange.js +31 -4
- package/dist/cjs/src/base/ws/Client.js +11 -14
- package/dist/cjs/src/bigone.js +38 -9
- package/dist/cjs/src/bingx.js +57 -18
- package/dist/cjs/src/bitmart.js +33 -11
- package/dist/cjs/src/bybit.js +30 -7
- package/dist/cjs/src/cex.js +61 -3
- package/dist/cjs/src/exmo.js +34 -31
- package/dist/cjs/src/gate.js +1 -0
- package/dist/cjs/src/gemini.js +21 -19
- package/dist/cjs/src/kraken.js +156 -11
- package/dist/cjs/src/okx.js +45 -2
- package/dist/cjs/src/poloniex.js +27 -25
- package/dist/cjs/src/pro/binance.js +60 -8
- package/dist/cjs/src/pro/cex.js +317 -10
- package/dist/cjs/src/pro/coinbasepro.js +1 -1
- package/js/ccxt.d.ts +2 -5
- package/js/ccxt.js +2 -4
- package/js/src/abstract/kraken.d.ts +2 -0
- package/js/src/base/Exchange.d.ts +2 -0
- package/js/src/base/Exchange.js +31 -4
- package/js/src/base/ws/Client.js +11 -14
- package/js/src/bigone.d.ts +1 -0
- package/js/src/bigone.js +38 -9
- package/js/src/bingx.d.ts +3 -0
- package/js/src/bingx.js +58 -19
- package/js/src/bitmart.d.ts +1 -0
- package/js/src/bitmart.js +33 -11
- package/js/src/bybit.d.ts +1 -0
- package/js/src/bybit.js +30 -7
- package/js/src/cex.d.ts +1 -0
- package/js/src/cex.js +61 -3
- package/js/src/exmo.d.ts +1 -1
- package/js/src/exmo.js +34 -31
- package/js/src/gate.js +1 -0
- package/js/src/gemini.js +21 -19
- package/js/src/kraken.d.ts +2 -0
- package/js/src/kraken.js +156 -11
- package/js/src/okx.d.ts +2 -0
- package/js/src/okx.js +45 -2
- package/js/src/poloniex.js +27 -25
- package/js/src/pro/binance.d.ts +1 -0
- package/js/src/pro/binance.js +61 -9
- package/js/src/pro/cex.d.ts +11 -2
- package/js/src/pro/cex.js +318 -11
- package/js/src/pro/coinbasepro.js +1 -1
- package/package.json +1 -1
- package/js/src/abstract/tidex.d.ts +0 -28
- package/js/src/abstract/tidex.js +0 -11
package/dist/ccxt.browser.js
CHANGED
|
@@ -1248,22 +1248,6 @@ class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchang
|
|
|
1248
1248
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange);
|
|
1249
1249
|
|
|
1250
1250
|
|
|
1251
|
-
/***/ }),
|
|
1252
|
-
|
|
1253
|
-
/***/ 6057:
|
|
1254
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1255
|
-
|
|
1256
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1257
|
-
/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
1258
|
-
/* harmony export */ });
|
|
1259
|
-
/* harmony import */ var _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3043);
|
|
1260
|
-
// -------------------------------------------------------------------------------
|
|
1261
|
-
|
|
1262
|
-
class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e {
|
|
1263
|
-
}
|
|
1264
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange);
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
1251
|
/***/ }),
|
|
1268
1252
|
|
|
1269
1253
|
/***/ 1696:
|
|
@@ -7353,6 +7337,7 @@ class Exchange {
|
|
|
7353
7337
|
'createMarketOrder': true,
|
|
7354
7338
|
'createOrder': true,
|
|
7355
7339
|
'createMarketBuyOrderWithCost': undefined,
|
|
7340
|
+
'createMarketOrderWithCost': undefined,
|
|
7356
7341
|
'createMarketSellOrderWithCost': undefined,
|
|
7357
7342
|
'createOrders': undefined,
|
|
7358
7343
|
'createPostOnlyOrder': undefined,
|
|
@@ -10555,28 +10540,50 @@ class Exchange {
|
|
|
10555
10540
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
10556
10541
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' createOrder() is not supported yet');
|
|
10557
10542
|
}
|
|
10543
|
+
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
10544
|
+
/**
|
|
10545
|
+
* @method
|
|
10546
|
+
* @name createMarketOrderWithCost
|
|
10547
|
+
* @description create a market order by providing the symbol, side and cost
|
|
10548
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
10549
|
+
* @param {string} side 'buy' or 'sell'
|
|
10550
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
10551
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10552
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
10553
|
+
*/
|
|
10554
|
+
if (this.options['createMarketOrderWithCost'] || (this.options['createMarketBuyOrderWithCost'] && this.options['createMarketSellOrderWithCost'])) {
|
|
10555
|
+
return await this.createOrder(symbol, 'market', side, cost, 1, params);
|
|
10556
|
+
}
|
|
10557
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' createMarketOrderWithCost() is not supported yet');
|
|
10558
|
+
}
|
|
10558
10559
|
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
10559
10560
|
/**
|
|
10560
10561
|
* @method
|
|
10561
|
-
* @name
|
|
10562
|
+
* @name createMarketBuyOrderWithCost
|
|
10562
10563
|
* @description create a market buy order by providing the symbol and cost
|
|
10563
10564
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
10564
10565
|
* @param {float} cost how much you want to trade in units of the quote currency
|
|
10565
10566
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10566
10567
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
10567
10568
|
*/
|
|
10569
|
+
if (this.options['createMarketBuyOrderRequiresPrice'] || this.options['createMarketBuyOrderWithCost']) {
|
|
10570
|
+
return await this.createOrder(symbol, 'market', 'buy', cost, 1, params);
|
|
10571
|
+
}
|
|
10568
10572
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' createMarketBuyOrderWithCost() is not supported yet');
|
|
10569
10573
|
}
|
|
10570
10574
|
async createMarketSellOrderWithCost(symbol, cost, params = {}) {
|
|
10571
10575
|
/**
|
|
10572
10576
|
* @method
|
|
10573
10577
|
* @name createMarketSellOrderWithCost
|
|
10574
|
-
* @description create a market
|
|
10578
|
+
* @description create a market sell order by providing the symbol and cost
|
|
10575
10579
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
10576
10580
|
* @param {float} cost how much you want to trade in units of the quote currency
|
|
10577
10581
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10578
10582
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
10579
10583
|
*/
|
|
10584
|
+
if (this.options['createMarketSellOrderRequiresPrice'] || this.options['createMarketSellOrderWithCost']) {
|
|
10585
|
+
return await this.createOrder(symbol, 'market', 'sell', cost, 1, params);
|
|
10586
|
+
}
|
|
10580
10587
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' createMarketSellOrderWithCost() is not supported yet');
|
|
10581
10588
|
}
|
|
10582
10589
|
async createOrders(orders, params = {}) {
|
|
@@ -11661,6 +11668,10 @@ class Exchange {
|
|
|
11661
11668
|
if (cursorValue === undefined) {
|
|
11662
11669
|
break;
|
|
11663
11670
|
}
|
|
11671
|
+
const lastTimestamp = this.safeInteger(last, 'timestamp');
|
|
11672
|
+
if (lastTimestamp !== undefined && lastTimestamp < since) {
|
|
11673
|
+
break;
|
|
11674
|
+
}
|
|
11664
11675
|
}
|
|
11665
11676
|
catch (e) {
|
|
11666
11677
|
errors += 1;
|
|
@@ -11713,10 +11724,10 @@ class Exchange {
|
|
|
11713
11724
|
const first = this.safeValue(result, 0);
|
|
11714
11725
|
if (first !== undefined) {
|
|
11715
11726
|
if ('timestamp' in first) {
|
|
11716
|
-
return this.sortBy(result, 'timestamp');
|
|
11727
|
+
return this.sortBy(result, 'timestamp', true);
|
|
11717
11728
|
}
|
|
11718
11729
|
if ('id' in first) {
|
|
11719
|
-
return this.sortBy(result, 'id');
|
|
11730
|
+
return this.sortBy(result, 'id', true);
|
|
11720
11731
|
}
|
|
11721
11732
|
}
|
|
11722
11733
|
return result;
|
|
@@ -14386,23 +14397,20 @@ class Client {
|
|
|
14386
14397
|
// MessageEvent {isTrusted: true, data: "{"e":"depthUpdate","E":1581358737706,"s":"ETHBTC",…"0.06200000"]],"a":[["0.02261300","0.00000000"]]}", origin: "wss://stream.binance.com:9443", lastEventId: "", source: null, …}
|
|
14387
14398
|
let message = messageEvent.data;
|
|
14388
14399
|
let arrayBuffer;
|
|
14389
|
-
if (
|
|
14390
|
-
if (
|
|
14391
|
-
arrayBuffer = _static_dependencies_scure_base_index_js__WEBPACK_IMPORTED_MODULE_6__/* .utf8 */ .KA.decode(message);
|
|
14392
|
-
}
|
|
14393
|
-
else {
|
|
14400
|
+
if (typeof message !== 'string') {
|
|
14401
|
+
if (this.gunzip || this.inflate) {
|
|
14394
14402
|
arrayBuffer = new Uint8Array(message.buffer.slice(message.byteOffset, message.byteOffset + message.byteLength));
|
|
14403
|
+
if (this.gunzip) {
|
|
14404
|
+
arrayBuffer = (0,_static_dependencies_fflake_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .gunzipSync */ ._Z)(arrayBuffer);
|
|
14405
|
+
}
|
|
14406
|
+
else if (this.inflate) {
|
|
14407
|
+
arrayBuffer = (0,_static_dependencies_fflake_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .inflateSync */ .n)(arrayBuffer);
|
|
14408
|
+
}
|
|
14409
|
+
message = _static_dependencies_scure_base_index_js__WEBPACK_IMPORTED_MODULE_6__/* .utf8 */ .KA.encode(arrayBuffer);
|
|
14395
14410
|
}
|
|
14396
|
-
|
|
14397
|
-
|
|
14398
|
-
}
|
|
14399
|
-
else if (this.inflate) {
|
|
14400
|
-
arrayBuffer = (0,_static_dependencies_fflake_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .inflateSync */ .n)(arrayBuffer);
|
|
14411
|
+
else {
|
|
14412
|
+
message = message.toString();
|
|
14401
14413
|
}
|
|
14402
|
-
message = _static_dependencies_scure_base_index_js__WEBPACK_IMPORTED_MODULE_6__/* .utf8 */ .KA.encode(arrayBuffer);
|
|
14403
|
-
}
|
|
14404
|
-
if (typeof message !== 'string') {
|
|
14405
|
-
message = message.toString();
|
|
14406
14414
|
}
|
|
14407
14415
|
try {
|
|
14408
14416
|
if ((0,_base_functions_js__WEBPACK_IMPORTED_MODULE_7__/* .isJsonEncodedObject */ .Dd)(message)) {
|
|
@@ -15038,6 +15046,8 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
15038
15046
|
'option': undefined,
|
|
15039
15047
|
'cancelAllOrders': true,
|
|
15040
15048
|
'cancelOrder': true,
|
|
15049
|
+
'createMarketBuyOrderWithCost': true,
|
|
15050
|
+
'createMarketSellOrderWithCost': false,
|
|
15041
15051
|
'createOrder': true,
|
|
15042
15052
|
'createPostOnlyOrder': true,
|
|
15043
15053
|
'createStopLimitOrder': true,
|
|
@@ -16160,6 +16170,20 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16160
16170
|
'trades': undefined,
|
|
16161
16171
|
}, market);
|
|
16162
16172
|
}
|
|
16173
|
+
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
16174
|
+
/**
|
|
16175
|
+
* @method
|
|
16176
|
+
* @name bigone#createMarketBuyOrderWithCost
|
|
16177
|
+
* @see https://open.big.one/docs/spot_orders.html#create-order
|
|
16178
|
+
* @description create a market buy order by providing the symbol and cost
|
|
16179
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
16180
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
16181
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
16182
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
16183
|
+
*/
|
|
16184
|
+
params['createMarketBuyOrderRequiresPrice'] = false;
|
|
16185
|
+
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
|
|
16186
|
+
}
|
|
16163
16187
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
16164
16188
|
/**
|
|
16165
16189
|
* @method
|
|
@@ -16187,7 +16211,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16187
16211
|
const requestSide = isBuy ? 'BID' : 'ASK';
|
|
16188
16212
|
let uppercaseType = type.toUpperCase();
|
|
16189
16213
|
const isLimit = uppercaseType === 'LIMIT';
|
|
16190
|
-
const exchangeSpecificParam = this.safeValue(params, 'post_only');
|
|
16214
|
+
const exchangeSpecificParam = this.safeValue(params, 'post_only', false);
|
|
16191
16215
|
let postOnly = undefined;
|
|
16192
16216
|
[postOnly, params] = this.handlePostOnly((uppercaseType === 'MARKET'), exchangeSpecificParam, params);
|
|
16193
16217
|
const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'stop_price']);
|
|
@@ -16211,21 +16235,34 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16211
16235
|
request['post_only'] = true;
|
|
16212
16236
|
}
|
|
16213
16237
|
}
|
|
16238
|
+
request['amount'] = this.amountToPrecision(symbol, amount);
|
|
16214
16239
|
}
|
|
16215
16240
|
else {
|
|
16216
|
-
|
|
16217
|
-
|
|
16218
|
-
|
|
16219
|
-
|
|
16241
|
+
if (isBuy) {
|
|
16242
|
+
let createMarketBuyOrderRequiresPrice = true;
|
|
16243
|
+
[createMarketBuyOrderRequiresPrice, params] = this.handleOptionAndParams(params, 'createOrder', 'createMarketBuyOrderRequiresPrice', true);
|
|
16244
|
+
const cost = this.safeNumber(params, 'cost');
|
|
16245
|
+
params = this.omit(params, 'cost');
|
|
16246
|
+
if (createMarketBuyOrderRequiresPrice) {
|
|
16247
|
+
if ((price === undefined) && (cost === undefined)) {
|
|
16248
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder(this.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument');
|
|
16249
|
+
}
|
|
16250
|
+
else {
|
|
16251
|
+
const amountString = this.numberToString(amount);
|
|
16252
|
+
const priceString = this.numberToString(price);
|
|
16253
|
+
const quoteAmount = this.parseToNumeric(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(amountString, priceString));
|
|
16254
|
+
const costRequest = (cost !== undefined) ? cost : quoteAmount;
|
|
16255
|
+
request['amount'] = this.costToPrecision(symbol, costRequest);
|
|
16256
|
+
}
|
|
16220
16257
|
}
|
|
16221
16258
|
else {
|
|
16222
|
-
|
|
16223
|
-
const priceString = this.numberToString(price);
|
|
16224
|
-
amount = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(amountString, priceString));
|
|
16259
|
+
request['amount'] = this.costToPrecision(symbol, amount);
|
|
16225
16260
|
}
|
|
16226
16261
|
}
|
|
16262
|
+
else {
|
|
16263
|
+
request['amount'] = this.amountToPrecision(symbol, amount);
|
|
16264
|
+
}
|
|
16227
16265
|
}
|
|
16228
|
-
request['amount'] = this.amountToPrecision(symbol, amount);
|
|
16229
16266
|
if (triggerPrice !== undefined) {
|
|
16230
16267
|
request['stop_price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
16231
16268
|
request['operator'] = isBuy ? 'GTE' : 'LTE';
|
|
@@ -26882,6 +26919,9 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
26882
26919
|
'cancelAllOrders': true,
|
|
26883
26920
|
'cancelOrder': true,
|
|
26884
26921
|
'cancelOrders': true,
|
|
26922
|
+
'createMarketBuyOrderWithCost': true,
|
|
26923
|
+
'createMarketOrderWithCost': true,
|
|
26924
|
+
'createMarketSellOrderWithCost': true,
|
|
26885
26925
|
'createOrder': true,
|
|
26886
26926
|
'createOrders': true,
|
|
26887
26927
|
'fetchBalance': true,
|
|
@@ -28474,6 +28514,46 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
28474
28514
|
'takeProfitPrice': undefined,
|
|
28475
28515
|
});
|
|
28476
28516
|
}
|
|
28517
|
+
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
28518
|
+
/**
|
|
28519
|
+
* @method
|
|
28520
|
+
* @name bingx#createMarketOrderWithCost
|
|
28521
|
+
* @description create a market order by providing the symbol, side and cost
|
|
28522
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
28523
|
+
* @param {string} side 'buy' or 'sell'
|
|
28524
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
28525
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
28526
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
28527
|
+
*/
|
|
28528
|
+
params['quoteOrderQty'] = cost;
|
|
28529
|
+
return await this.createOrder(symbol, 'market', side, cost, undefined, params);
|
|
28530
|
+
}
|
|
28531
|
+
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
28532
|
+
/**
|
|
28533
|
+
* @method
|
|
28534
|
+
* @name bingx#createMarketBuyOrderWithCost
|
|
28535
|
+
* @description create a market buy order by providing the symbol and cost
|
|
28536
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
28537
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
28538
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
28539
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
28540
|
+
*/
|
|
28541
|
+
params['quoteOrderQty'] = cost;
|
|
28542
|
+
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
|
|
28543
|
+
}
|
|
28544
|
+
async createMarketSellOrderWithCost(symbol, cost, params = {}) {
|
|
28545
|
+
/**
|
|
28546
|
+
* @method
|
|
28547
|
+
* @name bingx#createMarketSellOrderWithCost
|
|
28548
|
+
* @description create a market sell order by providing the symbol and cost
|
|
28549
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
28550
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
28551
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
28552
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
28553
|
+
*/
|
|
28554
|
+
params['quoteOrderQty'] = cost;
|
|
28555
|
+
return await this.createOrder(symbol, 'market', 'sell', cost, undefined, params);
|
|
28556
|
+
}
|
|
28477
28557
|
createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
28478
28558
|
/**
|
|
28479
28559
|
* @method
|
|
@@ -28509,26 +28589,21 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
28509
28589
|
if (postOnly || (timeInForce === 'POC')) {
|
|
28510
28590
|
request['timeInForce'] = 'POC';
|
|
28511
28591
|
}
|
|
28512
|
-
const
|
|
28513
|
-
|
|
28514
|
-
|
|
28515
|
-
|
|
28516
|
-
|
|
28517
|
-
|
|
28518
|
-
|
|
28519
|
-
|
|
28520
|
-
|
|
28521
|
-
|
|
28522
|
-
request['quoteOrderQty'] = this.parseToNumeric(this.priceToPrecision(symbol, cost));
|
|
28523
|
-
}
|
|
28592
|
+
const cost = this.safeNumber2(params, 'cost', 'quoteOrderQty');
|
|
28593
|
+
params = this.omit(params, 'cost');
|
|
28594
|
+
if (cost !== undefined) {
|
|
28595
|
+
request['quoteOrderQty'] = this.parseToNumeric(this.costToPrecision(symbol, cost));
|
|
28596
|
+
}
|
|
28597
|
+
else {
|
|
28598
|
+
if (market['spot'] && isMarketOrder && (price !== undefined)) {
|
|
28599
|
+
// keep the legacy behavior, to avoid breaking the old spot-market-buying code
|
|
28600
|
+
const calculatedCost = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(this.numberToString(amount), this.numberToString(price));
|
|
28601
|
+
request['quoteOrderQty'] = this.parseToNumeric(calculatedCost);
|
|
28524
28602
|
}
|
|
28525
28603
|
else {
|
|
28526
|
-
request['
|
|
28604
|
+
request['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, amount));
|
|
28527
28605
|
}
|
|
28528
28606
|
}
|
|
28529
|
-
else {
|
|
28530
|
-
request['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, amount));
|
|
28531
|
-
}
|
|
28532
28607
|
if (!isMarketOrder) {
|
|
28533
28608
|
request['price'] = this.parseToNumeric(this.priceToPrecision(symbol, price));
|
|
28534
28609
|
}
|
|
@@ -28603,8 +28678,8 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
28603
28678
|
* @method
|
|
28604
28679
|
* @name bingx#createOrder
|
|
28605
28680
|
* @description create a trade order
|
|
28606
|
-
* @see https://bingx-api.github.io/docs/#/spot/trade-api.html#Create%20an%20Order
|
|
28607
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Trade%20order
|
|
28681
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Create%20an%20Order
|
|
28682
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Trade%20order
|
|
28608
28683
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
28609
28684
|
* @param {string} type 'market' or 'limit'
|
|
28610
28685
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -28617,6 +28692,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
28617
28692
|
* @param {float} [params.triggerPrice] *swap only* triggerPrice at which the attached take profit / stop loss order will be triggered
|
|
28618
28693
|
* @param {float} [params.stopLossPrice] *swap only* stop loss trigger price
|
|
28619
28694
|
* @param {float} [params.takeProfitPrice] *swap only* take profit trigger price
|
|
28695
|
+
* @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount
|
|
28620
28696
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
28621
28697
|
*/
|
|
28622
28698
|
await this.loadMarkets();
|
|
@@ -48343,6 +48419,9 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
48343
48419
|
'cancelAllOrders': true,
|
|
48344
48420
|
'cancelOrder': true,
|
|
48345
48421
|
'cancelOrders': false,
|
|
48422
|
+
'createMarketBuyOrderWithCost': true,
|
|
48423
|
+
'createMarketOrderWithCost': false,
|
|
48424
|
+
'createMarketSellOrderWithCost': false,
|
|
48346
48425
|
'createOrder': true,
|
|
48347
48426
|
'createPostOnlyOrder': true,
|
|
48348
48427
|
'createStopLimitOrder': false,
|
|
@@ -50468,12 +50547,31 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
50468
50547
|
const statuses = this.safeValue(statusesByType, type, {});
|
|
50469
50548
|
return this.safeString(statuses, status, status);
|
|
50470
50549
|
}
|
|
50550
|
+
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
50551
|
+
/**
|
|
50552
|
+
* @method
|
|
50553
|
+
* @name bitmart#createMarketBuyOrderWithCost
|
|
50554
|
+
* @description create a market buy order by providing the symbol and cost
|
|
50555
|
+
* @see https://developer-pro.bitmart.com/en/spot/#new-order-v2-signed
|
|
50556
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
50557
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
50558
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
50559
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
50560
|
+
*/
|
|
50561
|
+
await this.loadMarkets();
|
|
50562
|
+
const market = this.market(symbol);
|
|
50563
|
+
if (!market['spot']) {
|
|
50564
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot orders only');
|
|
50565
|
+
}
|
|
50566
|
+
params['createMarketBuyOrderRequiresPrice'] = false;
|
|
50567
|
+
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
|
|
50568
|
+
}
|
|
50471
50569
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
50472
50570
|
/**
|
|
50473
50571
|
* @method
|
|
50474
50572
|
* @name bitmart#createOrder
|
|
50475
50573
|
* @description create a trade order
|
|
50476
|
-
* @see https://developer-pro.bitmart.com/en/spot/#
|
|
50574
|
+
* @see https://developer-pro.bitmart.com/en/spot/#new-order-v2-signed
|
|
50477
50575
|
* @see https://developer-pro.bitmart.com/en/spot/#place-margin-order
|
|
50478
50576
|
* @see https://developer-pro.bitmart.com/en/futures/#submit-order-signed
|
|
50479
50577
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
@@ -50650,18 +50748,18 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
50650
50748
|
else if (isMarketOrder) {
|
|
50651
50749
|
// for market buy it requires the amount of quote currency to spend
|
|
50652
50750
|
if (side === 'buy') {
|
|
50653
|
-
let notional = this.
|
|
50654
|
-
|
|
50751
|
+
let notional = this.safeNumber2(params, 'cost', 'notional');
|
|
50752
|
+
params = this.omit(params, 'cost');
|
|
50753
|
+
let createMarketBuyOrderRequiresPrice = true;
|
|
50754
|
+
[createMarketBuyOrderRequiresPrice, params] = this.handleOptionAndParams(params, 'createOrder', 'createMarketBuyOrderRequiresPrice', true);
|
|
50655
50755
|
if (createMarketBuyOrderRequiresPrice) {
|
|
50656
|
-
if (price
|
|
50657
|
-
|
|
50658
|
-
const amountString = this.numberToString(amount);
|
|
50659
|
-
const priceString = this.numberToString(price);
|
|
50660
|
-
notional = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(amountString, priceString));
|
|
50661
|
-
}
|
|
50756
|
+
if ((price === undefined) && (notional === undefined)) {
|
|
50757
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder(this.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument or in the "notional" extra parameter (the exchange-specific behaviour)');
|
|
50662
50758
|
}
|
|
50663
|
-
else
|
|
50664
|
-
|
|
50759
|
+
else {
|
|
50760
|
+
const amountString = this.numberToString(amount);
|
|
50761
|
+
const priceString = this.numberToString(price);
|
|
50762
|
+
notional = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(amountString, priceString));
|
|
50665
50763
|
}
|
|
50666
50764
|
}
|
|
50667
50765
|
else {
|
|
@@ -75955,6 +76053,8 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
75955
76053
|
'borrowCrossMargin': true,
|
|
75956
76054
|
'cancelAllOrders': true,
|
|
75957
76055
|
'cancelOrder': true,
|
|
76056
|
+
'createMarketBuyOrderWithCost': true,
|
|
76057
|
+
'createMarketSellOrderWithCost': false,
|
|
75958
76058
|
'createOrder': true,
|
|
75959
76059
|
'createOrders': true,
|
|
75960
76060
|
'createPostOnlyOrder': true,
|
|
@@ -79366,6 +79466,25 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
79366
79466
|
}
|
|
79367
79467
|
return this.safeValue(result, 0);
|
|
79368
79468
|
}
|
|
79469
|
+
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
79470
|
+
/**
|
|
79471
|
+
* @method
|
|
79472
|
+
* @name bybit#createMarketBuyOrderWithCost
|
|
79473
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/create-order
|
|
79474
|
+
* @description create a market buy order by providing the symbol and cost
|
|
79475
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
79476
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
79477
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
79478
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
79479
|
+
*/
|
|
79480
|
+
await this.loadMarkets();
|
|
79481
|
+
const market = this.market(symbol);
|
|
79482
|
+
if (!market['spot']) {
|
|
79483
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot orders only');
|
|
79484
|
+
}
|
|
79485
|
+
params['createMarketBuyOrderRequiresPrice'] = false;
|
|
79486
|
+
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
|
|
79487
|
+
}
|
|
79369
79488
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
79370
79489
|
/**
|
|
79371
79490
|
* @method
|
|
@@ -79466,18 +79585,20 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
79466
79585
|
}
|
|
79467
79586
|
if (market['spot'] && (type === 'market') && (side === 'buy')) {
|
|
79468
79587
|
// for market buy it requires the amount of quote currency to spend
|
|
79469
|
-
|
|
79470
|
-
|
|
79471
|
-
|
|
79472
|
-
|
|
79473
|
-
|
|
79588
|
+
let createMarketBuyOrderRequiresPrice = true;
|
|
79589
|
+
[createMarketBuyOrderRequiresPrice, params] = this.handleOptionAndParams(params, 'createOrder', 'createMarketBuyOrderRequiresPrice', true);
|
|
79590
|
+
const cost = this.safeNumber(params, 'cost');
|
|
79591
|
+
params = this.omit(params, 'cost');
|
|
79592
|
+
if (createMarketBuyOrderRequiresPrice) {
|
|
79593
|
+
if ((price === undefined) && (cost === undefined)) {
|
|
79594
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument');
|
|
79474
79595
|
}
|
|
79475
79596
|
else {
|
|
79476
79597
|
const amountString = this.numberToString(amount);
|
|
79477
79598
|
const priceString = this.numberToString(price);
|
|
79478
79599
|
const quoteAmount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(amountString, priceString);
|
|
79479
|
-
|
|
79480
|
-
request['qty'] = this.costToPrecision(symbol,
|
|
79600
|
+
const costRequest = (cost !== undefined) ? cost : quoteAmount;
|
|
79601
|
+
request['qty'] = this.costToPrecision(symbol, costRequest);
|
|
79481
79602
|
}
|
|
79482
79603
|
}
|
|
79483
79604
|
else {
|
|
@@ -83539,6 +83660,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
83539
83660
|
'future': false,
|
|
83540
83661
|
'option': false,
|
|
83541
83662
|
'addMargin': false,
|
|
83663
|
+
'cancelAllOrders': true,
|
|
83542
83664
|
'cancelOrder': true,
|
|
83543
83665
|
'cancelOrders': false,
|
|
83544
83666
|
'createDepositAddress': false,
|
|
@@ -83974,6 +84096,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
83974
84096
|
/**
|
|
83975
84097
|
* @method
|
|
83976
84098
|
* @name cex#fetchBalance
|
|
84099
|
+
* @see https://docs.cex.io/#account-balance
|
|
83977
84100
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
83978
84101
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
83979
84102
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
@@ -83986,6 +84109,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
83986
84109
|
/**
|
|
83987
84110
|
* @method
|
|
83988
84111
|
* @name cex#fetchOrderBook
|
|
84112
|
+
* @see https://docs.cex.io/#orderbook
|
|
83989
84113
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
83990
84114
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
83991
84115
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
@@ -84028,6 +84152,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
84028
84152
|
/**
|
|
84029
84153
|
* @method
|
|
84030
84154
|
* @name cex#fetchOHLCV
|
|
84155
|
+
* @see https://docs.cex.io/#historical-ohlcv-chart
|
|
84031
84156
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
84032
84157
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
84033
84158
|
* @param {string} timeframe the length of time each candle represents
|
|
@@ -84133,6 +84258,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
84133
84258
|
/**
|
|
84134
84259
|
* @method
|
|
84135
84260
|
* @name cex#fetchTicker
|
|
84261
|
+
* @see https://docs.cex.io/#ticker
|
|
84136
84262
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
84137
84263
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
84138
84264
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -84185,6 +84311,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
84185
84311
|
/**
|
|
84186
84312
|
* @method
|
|
84187
84313
|
* @name cex#fetchTrades
|
|
84314
|
+
* @see https://docs.cex.io/#trade-history
|
|
84188
84315
|
* @description get the list of most recent trades for a particular symbol
|
|
84189
84316
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
84190
84317
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
@@ -84204,6 +84331,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
84204
84331
|
/**
|
|
84205
84332
|
* @method
|
|
84206
84333
|
* @name cex#fetchTradingFees
|
|
84334
|
+
* @see https://docs.cex.io/#get-my-fee
|
|
84207
84335
|
* @description fetch the trading fees for multiple markets
|
|
84208
84336
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
84209
84337
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
@@ -84245,6 +84373,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
84245
84373
|
/**
|
|
84246
84374
|
* @method
|
|
84247
84375
|
* @name cex#createOrder
|
|
84376
|
+
* @see https://docs.cex.io/#place-order
|
|
84248
84377
|
* @description create a trade order
|
|
84249
84378
|
* @see https://cex.io/rest-api#place-order
|
|
84250
84379
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
@@ -84328,6 +84457,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
84328
84457
|
/**
|
|
84329
84458
|
* @method
|
|
84330
84459
|
* @name cex#cancelOrder
|
|
84460
|
+
* @see https://docs.cex.io/#cancel-order
|
|
84331
84461
|
* @description cancels an open order
|
|
84332
84462
|
* @param {string} id order id
|
|
84333
84463
|
* @param {string} symbol not used by cex cancelOrder ()
|
|
@@ -84342,6 +84472,36 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
84342
84472
|
// 'true'
|
|
84343
84473
|
return this.extend(this.parseOrder({}), { 'info': response, 'type': undefined, 'id': id, 'status': 'canceled' });
|
|
84344
84474
|
}
|
|
84475
|
+
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
84476
|
+
/**
|
|
84477
|
+
* @method
|
|
84478
|
+
* @name cex#cancelAllOrders
|
|
84479
|
+
* @see https://docs.cex.io/#cancel-all-orders-for-given-pair
|
|
84480
|
+
* @description cancel all open orders in a market
|
|
84481
|
+
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
84482
|
+
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
84483
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
84484
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
84485
|
+
*/
|
|
84486
|
+
if (symbol === undefined) {
|
|
84487
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelAllOrders requires a symbol.');
|
|
84488
|
+
}
|
|
84489
|
+
await this.loadMarkets();
|
|
84490
|
+
const market = this.market(symbol);
|
|
84491
|
+
const request = {
|
|
84492
|
+
'pair': market['id'],
|
|
84493
|
+
};
|
|
84494
|
+
const orders = await this.privatePostCancelOrdersPair(this.extend(request, params));
|
|
84495
|
+
//
|
|
84496
|
+
// {
|
|
84497
|
+
// "e":"cancel_orders",
|
|
84498
|
+
// "ok":"ok",
|
|
84499
|
+
// "data":[
|
|
84500
|
+
// ]
|
|
84501
|
+
// }
|
|
84502
|
+
//
|
|
84503
|
+
return orders;
|
|
84504
|
+
}
|
|
84345
84505
|
parseOrder(order, market = undefined) {
|
|
84346
84506
|
// Depending on the call, 'time' can be a unix int, unix string or ISO string
|
|
84347
84507
|
// Yes, really
|
|
@@ -84355,9 +84515,9 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
84355
84515
|
timestamp = parseInt(timestamp);
|
|
84356
84516
|
}
|
|
84357
84517
|
let symbol = undefined;
|
|
84358
|
-
|
|
84359
|
-
|
|
84360
|
-
|
|
84518
|
+
const baseId = this.safeString(order, 'symbol1');
|
|
84519
|
+
const quoteId = this.safeString(order, 'symbol2');
|
|
84520
|
+
if (market === undefined && baseId !== undefined && quoteId !== undefined) {
|
|
84361
84521
|
const base = this.safeCurrencyCode(baseId);
|
|
84362
84522
|
const quote = this.safeCurrencyCode(quoteId);
|
|
84363
84523
|
if ((base !== undefined) && (quote !== undefined)) {
|
|
@@ -84612,6 +84772,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
84612
84772
|
/**
|
|
84613
84773
|
* @method
|
|
84614
84774
|
* @name cex#fetchOpenOrders
|
|
84775
|
+
* @see https://docs.cex.io/#open-orders
|
|
84615
84776
|
* @description fetch all unfilled currently open orders
|
|
84616
84777
|
* @param {string} symbol unified market symbol
|
|
84617
84778
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
@@ -84638,6 +84799,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
84638
84799
|
/**
|
|
84639
84800
|
* @method
|
|
84640
84801
|
* @name cex#fetchClosedOrders
|
|
84802
|
+
* @see https://docs.cex.io/#archived-orders
|
|
84641
84803
|
* @description fetches information on multiple closed orders made by the user
|
|
84642
84804
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
84643
84805
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
@@ -84659,6 +84821,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
84659
84821
|
/**
|
|
84660
84822
|
* @method
|
|
84661
84823
|
* @name cex#fetchOrder
|
|
84824
|
+
* @see https://docs.cex.io/?python#get-order-details
|
|
84662
84825
|
* @description fetches information on an order made by the user
|
|
84663
84826
|
* @param {string} symbol not used by cex fetchOrder
|
|
84664
84827
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -84776,6 +84939,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
84776
84939
|
/**
|
|
84777
84940
|
* @method
|
|
84778
84941
|
* @name cex#fetchOrders
|
|
84942
|
+
* @see https://docs.cex.io/#archived-orders
|
|
84779
84943
|
* @description fetches information on multiple orders made by the user
|
|
84780
84944
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
84781
84945
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
@@ -84998,6 +85162,20 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
84998
85162
|
return this.safeString(this.options['order']['status'], status, status);
|
|
84999
85163
|
}
|
|
85000
85164
|
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
85165
|
+
/**
|
|
85166
|
+
* @method
|
|
85167
|
+
* @name cex#editOrderWs
|
|
85168
|
+
* @description edit a trade order
|
|
85169
|
+
* @see https://docs.cex.io/#cancel-replace-order
|
|
85170
|
+
* @param {string} id order id
|
|
85171
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
85172
|
+
* @param {string} type 'market' or 'limit'
|
|
85173
|
+
* @param {string} side 'buy' or 'sell'
|
|
85174
|
+
* @param {float} amount how much of the currency you want to trade in units of the base currency
|
|
85175
|
+
* @param {float|undefined} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
85176
|
+
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
85177
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure}
|
|
85178
|
+
*/
|
|
85001
85179
|
if (amount === undefined) {
|
|
85002
85180
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' editOrder() requires a amount argument');
|
|
85003
85181
|
}
|
|
@@ -85021,6 +85199,7 @@ class cex extends _abstract_cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
85021
85199
|
/**
|
|
85022
85200
|
* @method
|
|
85023
85201
|
* @name cex#fetchDepositAddress
|
|
85202
|
+
* @see https://docs.cex.io/#get-crypto-address
|
|
85024
85203
|
* @description fetch the deposit address for a currency associated with this account
|
|
85025
85204
|
* @param {string} code unified currency code
|
|
85026
85205
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -119344,14 +119523,13 @@ class exmo extends _abstract_exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
119344
119523
|
'position_id': market['id'],
|
|
119345
119524
|
'quantity': amount,
|
|
119346
119525
|
};
|
|
119347
|
-
let
|
|
119526
|
+
let response = undefined;
|
|
119348
119527
|
if (type === 'add') {
|
|
119349
|
-
|
|
119528
|
+
response = await this.privatePostMarginUserPositionMarginAdd(this.extend(request, params));
|
|
119350
119529
|
}
|
|
119351
119530
|
else if (type === 'reduce') {
|
|
119352
|
-
|
|
119531
|
+
response = await this.privatePostMarginUserPositionMarginRemove(this.extend(request, params));
|
|
119353
119532
|
}
|
|
119354
|
-
const response = await this[method](this.extend(request, params));
|
|
119355
119533
|
//
|
|
119356
119534
|
// {}
|
|
119357
119535
|
//
|
|
@@ -119410,13 +119588,16 @@ class exmo extends _abstract_exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
119410
119588
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
119411
119589
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
119412
119590
|
*/
|
|
119413
|
-
|
|
119591
|
+
const options = this.safeValue(this.options, 'fetchTradingFees', {});
|
|
119592
|
+
const defaultMethod = this.safeString(options, 'method', 'fetchPrivateTradingFees');
|
|
119593
|
+
const method = this.safeString(params, 'method', defaultMethod);
|
|
119414
119594
|
params = this.omit(params, 'method');
|
|
119415
|
-
if (method ===
|
|
119416
|
-
|
|
119417
|
-
|
|
119595
|
+
if (method === 'fetchPrivateTradingFees') {
|
|
119596
|
+
return await this.fetchPrivateTradingFees(params);
|
|
119597
|
+
}
|
|
119598
|
+
else {
|
|
119599
|
+
return await this.fetchPublicTradingFees(params);
|
|
119418
119600
|
}
|
|
119419
|
-
return await this[method](params);
|
|
119420
119601
|
}
|
|
119421
119602
|
async fetchPrivateTradingFees(params = {}) {
|
|
119422
119603
|
await this.loadMarkets();
|
|
@@ -120529,7 +120710,6 @@ class exmo extends _abstract_exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
120529
120710
|
// 'client_id': 123, // optional, must be a positive integer
|
|
120530
120711
|
// 'comment': '', // up to 50 latin symbols, whitespaces, underscores
|
|
120531
120712
|
};
|
|
120532
|
-
let method = isSpot ? 'privatePostOrderCreate' : 'privatePostMarginUserOrderCreate';
|
|
120533
120713
|
let clientOrderId = this.safeValue2(params, 'client_id', 'clientOrderId');
|
|
120534
120714
|
if (clientOrderId !== undefined) {
|
|
120535
120715
|
clientOrderId = this.safeInteger2(params, 'client_id', 'clientOrderId');
|
|
@@ -120545,32 +120725,22 @@ class exmo extends _abstract_exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
120545
120725
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' createOrder requires an extra param params["leverage"] for margin orders');
|
|
120546
120726
|
}
|
|
120547
120727
|
params = this.omit(params, ['stopPrice', 'stop_price', 'triggerPrice', 'timeInForce', 'client_id', 'clientOrderId']);
|
|
120548
|
-
if (
|
|
120549
|
-
|
|
120728
|
+
if (price !== undefined) {
|
|
120729
|
+
request['price'] = this.priceToPrecision(market['symbol'], price);
|
|
120730
|
+
}
|
|
120731
|
+
let response = undefined;
|
|
120732
|
+
if (isSpot) {
|
|
120733
|
+
if (triggerPrice !== undefined) {
|
|
120550
120734
|
if (type === 'limit') {
|
|
120551
120735
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' createOrder () cannot create stop limit orders for spot, only stop market');
|
|
120552
120736
|
}
|
|
120553
120737
|
else {
|
|
120554
|
-
method = 'privatePostStopMarketOrderCreate';
|
|
120555
120738
|
request['type'] = side;
|
|
120556
120739
|
request['trigger_price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
120557
120740
|
}
|
|
120741
|
+
response = await this.privatePostStopMarketOrderCreate(this.extend(request, params));
|
|
120558
120742
|
}
|
|
120559
120743
|
else {
|
|
120560
|
-
request['stop_price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
120561
|
-
if (type === 'limit') {
|
|
120562
|
-
request['type'] = 'stop_limit_' + side;
|
|
120563
|
-
}
|
|
120564
|
-
else if (type === 'market') {
|
|
120565
|
-
request['type'] = 'stop_' + side;
|
|
120566
|
-
}
|
|
120567
|
-
else {
|
|
120568
|
-
request['type'] = type;
|
|
120569
|
-
}
|
|
120570
|
-
}
|
|
120571
|
-
}
|
|
120572
|
-
else {
|
|
120573
|
-
if (isSpot) {
|
|
120574
120744
|
const execType = this.safeString(params, 'exec_type');
|
|
120575
120745
|
let isPostOnly = undefined;
|
|
120576
120746
|
[isPostOnly, params] = this.handlePostOnly(type === 'market', execType === 'post_only', params);
|
|
@@ -120588,6 +120758,21 @@ class exmo extends _abstract_exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
120588
120758
|
else if (timeInForce !== undefined) {
|
|
120589
120759
|
request['exec_type'] = timeInForce;
|
|
120590
120760
|
}
|
|
120761
|
+
response = await this.privatePostOrderCreate(this.extend(request, params));
|
|
120762
|
+
}
|
|
120763
|
+
}
|
|
120764
|
+
else {
|
|
120765
|
+
if (triggerPrice !== undefined) {
|
|
120766
|
+
request['stop_price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
120767
|
+
if (type === 'limit') {
|
|
120768
|
+
request['type'] = 'stop_limit_' + side;
|
|
120769
|
+
}
|
|
120770
|
+
else if (type === 'market') {
|
|
120771
|
+
request['type'] = 'stop_' + side;
|
|
120772
|
+
}
|
|
120773
|
+
else {
|
|
120774
|
+
request['type'] = type;
|
|
120775
|
+
}
|
|
120591
120776
|
}
|
|
120592
120777
|
else {
|
|
120593
120778
|
if (type === 'limit' || type === 'market') {
|
|
@@ -120597,11 +120782,8 @@ class exmo extends _abstract_exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
120597
120782
|
request['type'] = type;
|
|
120598
120783
|
}
|
|
120599
120784
|
}
|
|
120785
|
+
response = await this.privatePostMarginUserOrderCreate(this.extend(request, params));
|
|
120600
120786
|
}
|
|
120601
|
-
if (price !== undefined) {
|
|
120602
|
-
request['price'] = this.priceToPrecision(market['symbol'], price);
|
|
120603
|
-
}
|
|
120604
|
-
const response = await this[method](this.extend(request, params));
|
|
120605
120787
|
return this.parseOrder(response, market);
|
|
120606
120788
|
}
|
|
120607
120789
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
@@ -121846,6 +122028,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
121846
122028
|
'subAccounts': 'https://api.gateio.ws/api/v4',
|
|
121847
122029
|
'rebate': 'https://api.gateio.ws/api/v4',
|
|
121848
122030
|
'earn': 'https://api.gateio.ws/api/v4',
|
|
122031
|
+
'account': 'https://api.gateio.ws/api/v4',
|
|
121849
122032
|
},
|
|
121850
122033
|
},
|
|
121851
122034
|
'test': {
|
|
@@ -129148,26 +129331,28 @@ class gemini extends _abstract_gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
129148
129331
|
const networks = {};
|
|
129149
129332
|
const networkId = this.safeString(currency, 9);
|
|
129150
129333
|
const networkCode = this.networkIdToCode(networkId);
|
|
129151
|
-
|
|
129152
|
-
|
|
129153
|
-
|
|
129154
|
-
|
|
129155
|
-
|
|
129156
|
-
|
|
129157
|
-
|
|
129158
|
-
|
|
129159
|
-
|
|
129160
|
-
|
|
129161
|
-
'
|
|
129162
|
-
'
|
|
129163
|
-
|
|
129164
|
-
|
|
129165
|
-
|
|
129166
|
-
'
|
|
129167
|
-
|
|
129334
|
+
if (networkCode !== undefined) {
|
|
129335
|
+
networks[networkCode] = {
|
|
129336
|
+
'info': currency,
|
|
129337
|
+
'id': networkId,
|
|
129338
|
+
'network': networkCode,
|
|
129339
|
+
'active': undefined,
|
|
129340
|
+
'deposit': undefined,
|
|
129341
|
+
'withdraw': undefined,
|
|
129342
|
+
'fee': undefined,
|
|
129343
|
+
'precision': precision,
|
|
129344
|
+
'limits': {
|
|
129345
|
+
'deposit': {
|
|
129346
|
+
'min': undefined,
|
|
129347
|
+
'max': undefined,
|
|
129348
|
+
},
|
|
129349
|
+
'withdraw': {
|
|
129350
|
+
'min': undefined,
|
|
129351
|
+
'max': undefined,
|
|
129352
|
+
},
|
|
129168
129353
|
},
|
|
129169
|
-
}
|
|
129170
|
-
}
|
|
129354
|
+
};
|
|
129355
|
+
}
|
|
129171
129356
|
result[code] = {
|
|
129172
129357
|
'info': currency,
|
|
129173
129358
|
'id': id,
|
|
@@ -150425,6 +150610,8 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
150425
150610
|
'Withdraw': 3,
|
|
150426
150611
|
'WithdrawCancel': 3,
|
|
150427
150612
|
'WithdrawInfo': 3,
|
|
150613
|
+
'WithdrawMethods': 3,
|
|
150614
|
+
'WithdrawAddresses': 3,
|
|
150428
150615
|
'WithdrawStatus': 3,
|
|
150429
150616
|
'WalletTransfer': 3,
|
|
150430
150617
|
// sub accounts
|
|
@@ -150555,6 +150742,91 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
150555
150742
|
'ZEC': 'Zcash (Transparent)',
|
|
150556
150743
|
'ZRX': '0x (ZRX)',
|
|
150557
150744
|
},
|
|
150745
|
+
'withdrawMethods': {
|
|
150746
|
+
'Lightning': 'Lightning',
|
|
150747
|
+
'Bitcoin': 'BTC',
|
|
150748
|
+
'Ripple': 'XRP',
|
|
150749
|
+
'Litecoin': 'LTC',
|
|
150750
|
+
'Dogecoin': 'DOGE',
|
|
150751
|
+
'Stellar': 'XLM',
|
|
150752
|
+
'Ethereum': 'ERC20',
|
|
150753
|
+
'Arbitrum One': 'Arbitrum',
|
|
150754
|
+
'Polygon': 'MATIC',
|
|
150755
|
+
'Arbitrum Nova': 'Arbitrum',
|
|
150756
|
+
'Optimism': 'Optimism',
|
|
150757
|
+
'zkSync Era': 'zkSync',
|
|
150758
|
+
'Ethereum Classic': 'ETC',
|
|
150759
|
+
'Zcash': 'ZEC',
|
|
150760
|
+
'Monero': 'XMR',
|
|
150761
|
+
'Tron': 'TRC20',
|
|
150762
|
+
'Solana': 'SOL',
|
|
150763
|
+
'EOS': 'EOS',
|
|
150764
|
+
'Bitcoin Cash': 'BCH',
|
|
150765
|
+
'Cardano': 'ADA',
|
|
150766
|
+
'Qtum': 'QTUM',
|
|
150767
|
+
'Tezos': 'XTZ',
|
|
150768
|
+
'Cosmos': 'ATOM',
|
|
150769
|
+
'Nano': 'NANO',
|
|
150770
|
+
'Siacoin': 'SC',
|
|
150771
|
+
'Lisk': 'LSK',
|
|
150772
|
+
'Waves': 'WAVES',
|
|
150773
|
+
'ICON': 'ICX',
|
|
150774
|
+
'Algorand': 'ALGO',
|
|
150775
|
+
'Polygon - USDC.e': 'MATIC',
|
|
150776
|
+
'Arbitrum One - USDC.e': 'Arbitrum',
|
|
150777
|
+
'Polkadot': 'DOT',
|
|
150778
|
+
'Kava': 'KAVA',
|
|
150779
|
+
'Filecoin': 'FIL',
|
|
150780
|
+
'Kusama': 'KSM',
|
|
150781
|
+
'Flow': 'FLOW',
|
|
150782
|
+
'Energy Web': 'EW',
|
|
150783
|
+
'Mina': 'MINA',
|
|
150784
|
+
'Centrifuge': 'CFG',
|
|
150785
|
+
'Karura': 'KAR',
|
|
150786
|
+
'Moonriver': 'MOVR',
|
|
150787
|
+
'Shiden': 'SDN',
|
|
150788
|
+
'Khala': 'PHA',
|
|
150789
|
+
'Bifrost Kusama': 'BNC',
|
|
150790
|
+
'Songbird': 'SGB',
|
|
150791
|
+
'Terra classic': 'LUNC',
|
|
150792
|
+
'KILT': 'KILT',
|
|
150793
|
+
'Basilisk': 'BSX',
|
|
150794
|
+
'Flare': 'FLR',
|
|
150795
|
+
'Avalanche C-Chain': 'AVAX',
|
|
150796
|
+
'Kintsugi': 'KINT',
|
|
150797
|
+
'Altair': 'AIR',
|
|
150798
|
+
'Moonbeam': 'GLMR',
|
|
150799
|
+
'Acala': 'ACA',
|
|
150800
|
+
'Astar': 'ASTR',
|
|
150801
|
+
'Akash': 'AKT',
|
|
150802
|
+
'Robonomics': 'XRT',
|
|
150803
|
+
'Fantom': 'FTM',
|
|
150804
|
+
'Elrond': 'EGLD',
|
|
150805
|
+
'THORchain': 'RUNE',
|
|
150806
|
+
'Secret': 'SCRT',
|
|
150807
|
+
'Near': 'NEAR',
|
|
150808
|
+
'Internet Computer Protocol': 'ICP',
|
|
150809
|
+
'Picasso': 'PICA',
|
|
150810
|
+
'Crust Shadow': 'CSM',
|
|
150811
|
+
'Integritee': 'TEER',
|
|
150812
|
+
'Parallel Finance': 'PARA',
|
|
150813
|
+
'HydraDX': 'HDX',
|
|
150814
|
+
'Interlay': 'INTR',
|
|
150815
|
+
'Fetch.ai': 'FET',
|
|
150816
|
+
'NYM': 'NYM',
|
|
150817
|
+
'Terra 2.0': 'LUNA2',
|
|
150818
|
+
'Juno': 'JUNO',
|
|
150819
|
+
'Nodle': 'NODL',
|
|
150820
|
+
'Stacks': 'STX',
|
|
150821
|
+
'Ethereum PoW': 'ETHW',
|
|
150822
|
+
'Aptos': 'APT',
|
|
150823
|
+
'Sui': 'SUI',
|
|
150824
|
+
'Genshiro': 'GENS',
|
|
150825
|
+
'Aventus': 'AVT',
|
|
150826
|
+
'Sei': 'SEI',
|
|
150827
|
+
'OriginTrail': 'OTP',
|
|
150828
|
+
'Celestia': 'TIA',
|
|
150829
|
+
},
|
|
150558
150830
|
},
|
|
150559
150831
|
'precisionMode': _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__/* .TICK_SIZE */ .sh,
|
|
150560
150832
|
'exceptions': {
|
|
@@ -152301,6 +152573,10 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
152301
152573
|
};
|
|
152302
152574
|
return this.safeString(statuses, status, status);
|
|
152303
152575
|
}
|
|
152576
|
+
parseNetwork(network) {
|
|
152577
|
+
const withdrawMethods = this.safeValue(this.options, 'withdrawMethods', {});
|
|
152578
|
+
return this.safeString(withdrawMethods, network, network);
|
|
152579
|
+
}
|
|
152304
152580
|
parseTransaction(transaction, currency = undefined) {
|
|
152305
152581
|
//
|
|
152306
152582
|
// fetchDeposits
|
|
@@ -152351,6 +152627,8 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
152351
152627
|
// "fee": "0.0050000000",
|
|
152352
152628
|
// "time": 1530481750,
|
|
152353
152629
|
// "status": "Success"
|
|
152630
|
+
// "key":"Huobi wallet",
|
|
152631
|
+
// "network":"Tron"
|
|
152354
152632
|
// status-prop: 'on-hold' // this field might not be present in some cases
|
|
152355
152633
|
// }
|
|
152356
152634
|
//
|
|
@@ -152387,7 +152665,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
152387
152665
|
'id': id,
|
|
152388
152666
|
'currency': code,
|
|
152389
152667
|
'amount': amount,
|
|
152390
|
-
'network':
|
|
152668
|
+
'network': this.parseNetwork(this.safeString(transaction, 'network')),
|
|
152391
152669
|
'address': address,
|
|
152392
152670
|
'addressTo': undefined,
|
|
152393
152671
|
'addressFrom': undefined,
|
|
@@ -152491,19 +152769,28 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
152491
152769
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
152492
152770
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
152493
152771
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
152772
|
+
* @param {object} [params.end] End timestamp, withdrawals created strictly after will be not be included in the response
|
|
152773
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times
|
|
152494
152774
|
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
152495
|
-
|
|
152496
|
-
// https://www.kraken.com/en-us/help/api#withdraw-status
|
|
152497
|
-
if (code === undefined) {
|
|
152498
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchWithdrawals() requires a currency code argument');
|
|
152499
|
-
}
|
|
152775
|
+
*/
|
|
152500
152776
|
await this.loadMarkets();
|
|
152501
|
-
|
|
152502
|
-
|
|
152503
|
-
|
|
152504
|
-
|
|
152777
|
+
let paginate = false;
|
|
152778
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
|
|
152779
|
+
if (paginate) {
|
|
152780
|
+
params['cursor'] = true;
|
|
152781
|
+
return await this.fetchPaginatedCallCursor('fetchWithdrawals', code, since, limit, params, 'next_cursor', 'cursor');
|
|
152782
|
+
}
|
|
152783
|
+
const request = {};
|
|
152784
|
+
if (code !== undefined) {
|
|
152785
|
+
const currency = this.currency(code);
|
|
152786
|
+
request['asset'] = currency['id'];
|
|
152787
|
+
}
|
|
152788
|
+
if (since !== undefined) {
|
|
152789
|
+
request['since'] = since.toString();
|
|
152790
|
+
}
|
|
152505
152791
|
const response = await this.privatePostWithdrawStatus(this.extend(request, params));
|
|
152506
152792
|
//
|
|
152793
|
+
// with no pagination
|
|
152507
152794
|
// { error: [],
|
|
152508
152795
|
// "result": [ { "method": "Ether",
|
|
152509
152796
|
// "aclass": "currency",
|
|
@@ -152515,8 +152802,51 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
152515
152802
|
// "fee": "0.0050000000",
|
|
152516
152803
|
// "time": 1530481750,
|
|
152517
152804
|
// "status": "Success" } ] }
|
|
152805
|
+
// with pagination
|
|
152806
|
+
// {
|
|
152807
|
+
// "error":[],
|
|
152808
|
+
// "result":{
|
|
152809
|
+
// "withdrawals":[
|
|
152810
|
+
// {
|
|
152811
|
+
// "method":"Tether USD (TRC20)",
|
|
152812
|
+
// "aclass":"currency",
|
|
152813
|
+
// "asset":"USDT",
|
|
152814
|
+
// "refid":"BSNFZU2-MEFN4G-J3NEZV",
|
|
152815
|
+
// "txid":"1c7a642fb7387bbc2c6a2c509fd1ae146937f4cf793b4079a4f0715e3a02615a",
|
|
152816
|
+
// "info":"TQmdxSuC16EhFg8FZWtYgrfFRosoRF7bCp",
|
|
152817
|
+
// "amount":"1996.50000000",
|
|
152818
|
+
// "fee":"2.50000000",
|
|
152819
|
+
// "time":1669126657,
|
|
152820
|
+
// "status":"Success",
|
|
152821
|
+
// "key":"poloniex",
|
|
152822
|
+
// "network":"Tron"
|
|
152823
|
+
// },
|
|
152824
|
+
// ...
|
|
152825
|
+
// ],
|
|
152826
|
+
// "next_cursor":"HgAAAAAAAABGVFRSd3k1LVF4Y0JQY05Gd0xRY0NxenFndHpybkwBAQH2AwEBAAAAAQAAAAAAAAABAAAAAAAZAAAAAAAAAA=="
|
|
152827
|
+
// }
|
|
152828
|
+
// }
|
|
152518
152829
|
//
|
|
152519
|
-
|
|
152830
|
+
let rawWithdrawals = undefined;
|
|
152831
|
+
const result = this.safeValue(response, 'result');
|
|
152832
|
+
if (!Array.isArray(result)) {
|
|
152833
|
+
rawWithdrawals = this.addPaginationCursorToResult(result);
|
|
152834
|
+
}
|
|
152835
|
+
else {
|
|
152836
|
+
rawWithdrawals = result;
|
|
152837
|
+
}
|
|
152838
|
+
return this.parseTransactionsByType('withdrawal', rawWithdrawals, code, since, limit);
|
|
152839
|
+
}
|
|
152840
|
+
addPaginationCursorToResult(result) {
|
|
152841
|
+
const cursor = this.safeString(result, 'next_cursor');
|
|
152842
|
+
const data = this.safeValue(result, 'withdrawals');
|
|
152843
|
+
const dataLength = data.length;
|
|
152844
|
+
if (cursor !== undefined && dataLength > 0) {
|
|
152845
|
+
const last = data[dataLength - 1];
|
|
152846
|
+
last['next_cursor'] = cursor;
|
|
152847
|
+
data[dataLength - 1] = last;
|
|
152848
|
+
}
|
|
152849
|
+
return data;
|
|
152520
152850
|
}
|
|
152521
152851
|
async createDepositAddress(code, params = {}) {
|
|
152522
152852
|
/**
|
|
@@ -185352,6 +185682,8 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
185352
185682
|
'cancelOrder': true,
|
|
185353
185683
|
'cancelOrders': true,
|
|
185354
185684
|
'createDepositAddress': false,
|
|
185685
|
+
'createMarketBuyOrderWithCost': true,
|
|
185686
|
+
'createMarketSellOrderWithCost': true,
|
|
185355
185687
|
'createOrder': true,
|
|
185356
185688
|
'createOrders': true,
|
|
185357
185689
|
'createPostOnlyOrder': true,
|
|
@@ -187806,6 +188138,46 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
187806
188138
|
//
|
|
187807
188139
|
return this.parseBalanceByType(marketType, response);
|
|
187808
188140
|
}
|
|
188141
|
+
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
188142
|
+
/**
|
|
188143
|
+
* @method
|
|
188144
|
+
* @name okx#createMarketBuyOrderWithCost
|
|
188145
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-order
|
|
188146
|
+
* @description create a market buy order by providing the symbol and cost
|
|
188147
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
188148
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
188149
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
188150
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
188151
|
+
*/
|
|
188152
|
+
await this.loadMarkets();
|
|
188153
|
+
const market = this.market(symbol);
|
|
188154
|
+
if (!market['spot']) {
|
|
188155
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot markets only');
|
|
188156
|
+
}
|
|
188157
|
+
params['createMarketBuyOrderRequiresPrice'] = false;
|
|
188158
|
+
params['tgtCcy'] = 'quote_ccy';
|
|
188159
|
+
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
|
|
188160
|
+
}
|
|
188161
|
+
async createMarketSellOrderWithCost(symbol, cost, params = {}) {
|
|
188162
|
+
/**
|
|
188163
|
+
* @method
|
|
188164
|
+
* @name okx#createMarketSellOrderWithCost
|
|
188165
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-order
|
|
188166
|
+
* @description create a market buy order by providing the symbol and cost
|
|
188167
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
188168
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
188169
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
188170
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
188171
|
+
*/
|
|
188172
|
+
await this.loadMarkets();
|
|
188173
|
+
const market = this.market(symbol);
|
|
188174
|
+
if (!market['spot']) {
|
|
188175
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' createMarketSellOrderWithCost() supports spot markets only');
|
|
188176
|
+
}
|
|
188177
|
+
params['createMarketBuyOrderRequiresPrice'] = false;
|
|
188178
|
+
params['tgtCcy'] = 'quote_ccy';
|
|
188179
|
+
return await this.createOrder(symbol, 'market', 'sell', cost, undefined, params);
|
|
188180
|
+
}
|
|
187809
188181
|
createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
187810
188182
|
const market = this.market(symbol);
|
|
187811
188183
|
const request = {
|
|
@@ -187899,8 +188271,10 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
187899
188271
|
// see documentation: https://www.okx.com/docs-v5/en/#rest-api-trade-place-order
|
|
187900
188272
|
if (tgtCcy === 'quote_ccy') {
|
|
187901
188273
|
// quote_ccy: sz refers to units of quote currency
|
|
188274
|
+
let createMarketBuyOrderRequiresPrice = true;
|
|
188275
|
+
[createMarketBuyOrderRequiresPrice, params] = this.handleOptionAndParams(params, 'createOrder', 'createMarketBuyOrderRequiresPrice', true);
|
|
187902
188276
|
let notional = this.safeNumber2(params, 'cost', 'sz');
|
|
187903
|
-
|
|
188277
|
+
params = this.omit(params, ['cost', 'sz']);
|
|
187904
188278
|
if (createMarketBuyOrderRequiresPrice) {
|
|
187905
188279
|
if (price !== undefined) {
|
|
187906
188280
|
if (notional === undefined) {
|
|
@@ -187918,7 +188292,6 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
187918
188292
|
notional = (notional === undefined) ? amount : notional;
|
|
187919
188293
|
}
|
|
187920
188294
|
request['sz'] = this.costToPrecision(symbol, notional);
|
|
187921
|
-
params = this.omit(params, ['cost', 'sz']);
|
|
187922
188295
|
}
|
|
187923
188296
|
}
|
|
187924
188297
|
if (marketIOC && contract) {
|
|
@@ -199562,32 +199935,34 @@ class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
199562
199935
|
let withdrawAvailable = this.safeValue(result[code], 'withdraw');
|
|
199563
199936
|
withdrawAvailable = (withdrawEnabled) ? withdrawEnabled : withdrawAvailable;
|
|
199564
199937
|
const networks = this.safeValue(result[code], 'networks', {});
|
|
199565
|
-
|
|
199566
|
-
|
|
199567
|
-
|
|
199568
|
-
|
|
199569
|
-
|
|
199570
|
-
|
|
199571
|
-
|
|
199572
|
-
|
|
199573
|
-
|
|
199574
|
-
|
|
199575
|
-
|
|
199576
|
-
|
|
199577
|
-
'
|
|
199578
|
-
'
|
|
199579
|
-
|
|
199580
|
-
|
|
199581
|
-
|
|
199582
|
-
'
|
|
199583
|
-
|
|
199584
|
-
|
|
199585
|
-
|
|
199586
|
-
'
|
|
199587
|
-
|
|
199938
|
+
if (networkCode !== undefined) {
|
|
199939
|
+
networks[networkCode] = {
|
|
199940
|
+
'info': currency,
|
|
199941
|
+
'id': networkId,
|
|
199942
|
+
'network': networkCode,
|
|
199943
|
+
'currencyId': id,
|
|
199944
|
+
'numericId': numericId,
|
|
199945
|
+
'deposit': depositEnabled,
|
|
199946
|
+
'withdraw': withdrawEnabled,
|
|
199947
|
+
'active': active,
|
|
199948
|
+
'fee': this.parseNumber(feeString),
|
|
199949
|
+
'precision': undefined,
|
|
199950
|
+
'limits': {
|
|
199951
|
+
'amount': {
|
|
199952
|
+
'min': undefined,
|
|
199953
|
+
'max': undefined,
|
|
199954
|
+
},
|
|
199955
|
+
'withdraw': {
|
|
199956
|
+
'min': undefined,
|
|
199957
|
+
'max': undefined,
|
|
199958
|
+
},
|
|
199959
|
+
'deposit': {
|
|
199960
|
+
'min': undefined,
|
|
199961
|
+
'max': undefined,
|
|
199962
|
+
},
|
|
199588
199963
|
},
|
|
199589
|
-
}
|
|
199590
|
-
}
|
|
199964
|
+
};
|
|
199965
|
+
}
|
|
199591
199966
|
result[code]['networks'] = networks;
|
|
199592
199967
|
const info = this.safeValue(result[code], 'info', []);
|
|
199593
199968
|
const rawInfo = {};
|
|
@@ -204694,6 +205069,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
204694
205069
|
'watchOrderBook': true,
|
|
204695
205070
|
'watchOrderBookForSymbols': true,
|
|
204696
205071
|
'watchOrders': true,
|
|
205072
|
+
'watchOrdersForSymbols': true,
|
|
204697
205073
|
'watchPositions': true,
|
|
204698
205074
|
'watchTicker': true,
|
|
204699
205075
|
'watchTickers': true,
|
|
@@ -206733,6 +207109,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
206733
207109
|
/**
|
|
206734
207110
|
* @method
|
|
206735
207111
|
* @name binance#watchOrders
|
|
207112
|
+
* @see https://binance-docs.github.io/apidocs/spot/en/#payload-order-update
|
|
206736
207113
|
* @description watches information on multiple orders made by the user
|
|
206737
207114
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
206738
207115
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
@@ -206746,7 +207123,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
206746
207123
|
if (symbol !== undefined) {
|
|
206747
207124
|
market = this.market(symbol);
|
|
206748
207125
|
symbol = market['symbol'];
|
|
206749
|
-
messageHash += '
|
|
207126
|
+
messageHash += '::' + symbol;
|
|
206750
207127
|
}
|
|
206751
207128
|
let type = undefined;
|
|
206752
207129
|
[type, params] = this.handleMarketTypeAndParams('watchOrders', market, params);
|
|
@@ -206769,11 +207146,63 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
206769
207146
|
this.setBalanceCache(client, type);
|
|
206770
207147
|
this.setPositionsCache(client, type);
|
|
206771
207148
|
const message = undefined;
|
|
206772
|
-
const
|
|
207149
|
+
const newOrder = await this.watch(url, messageHash, message, type);
|
|
206773
207150
|
if (this.newUpdates) {
|
|
206774
|
-
|
|
207151
|
+
return newOrder;
|
|
206775
207152
|
}
|
|
206776
|
-
return this.filterBySymbolSinceLimit(orders, symbol, since, limit, true);
|
|
207153
|
+
return this.filterBySymbolSinceLimit(this.orders, symbol, since, limit, true);
|
|
207154
|
+
}
|
|
207155
|
+
async watchOrdersForSymbols(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
207156
|
+
/**
|
|
207157
|
+
* @method
|
|
207158
|
+
* @name binance#watchOrdersForSymbols
|
|
207159
|
+
* @see https://binance-docs.github.io/apidocs/spot/en/#payload-order-update
|
|
207160
|
+
* @description watches information on multiple orders made by the user
|
|
207161
|
+
* @param {string[]} symbols unified symbol of the market to fetch orders for
|
|
207162
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
207163
|
+
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
207164
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
207165
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
207166
|
+
*/
|
|
207167
|
+
let marginMode = undefined;
|
|
207168
|
+
[marginMode, params] = this.handleMarginModeAndParams('authenticate', params);
|
|
207169
|
+
const isIsolatedMargin = (marginMode === 'isolated');
|
|
207170
|
+
if (isIsolatedMargin) {
|
|
207171
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' watchOrdersForSymbols does not support isolated margin markets, use watchOrders instead');
|
|
207172
|
+
}
|
|
207173
|
+
await this.loadMarkets();
|
|
207174
|
+
let type = undefined;
|
|
207175
|
+
const market = this.getMarketFromSymbols(symbols);
|
|
207176
|
+
[type, params] = this.handleMarketTypeAndParams('watchOrdersForSymbols', market, params);
|
|
207177
|
+
symbols = this.marketSymbols(symbols, type, true, true, true);
|
|
207178
|
+
let messageHash = 'orders';
|
|
207179
|
+
if (symbols !== undefined) {
|
|
207180
|
+
messageHash = messageHash + '::' + symbols.join(',');
|
|
207181
|
+
}
|
|
207182
|
+
let subType = undefined;
|
|
207183
|
+
[subType, params] = this.handleSubTypeAndParams('watchOrdersForSymbols', market, params);
|
|
207184
|
+
if (this.isLinear(type, subType)) {
|
|
207185
|
+
type = 'future';
|
|
207186
|
+
}
|
|
207187
|
+
else if (this.isInverse(type, subType)) {
|
|
207188
|
+
type = 'delivery';
|
|
207189
|
+
}
|
|
207190
|
+
params = this.extend(params, { 'type': type });
|
|
207191
|
+
await this.authenticate(params);
|
|
207192
|
+
let urlType = type;
|
|
207193
|
+
if (type === 'margin') {
|
|
207194
|
+
urlType = 'spot'; // spot-margin shares the same stream as regular spot
|
|
207195
|
+
}
|
|
207196
|
+
const url = this.urls['api']['ws'][urlType] + '/' + this.options[type]['listenKey'];
|
|
207197
|
+
const client = this.client(url);
|
|
207198
|
+
this.setBalanceCache(client, type);
|
|
207199
|
+
this.setPositionsCache(client, type);
|
|
207200
|
+
const message = undefined;
|
|
207201
|
+
const newOrders = await this.watch(url, messageHash, message, type);
|
|
207202
|
+
if (this.newUpdates) {
|
|
207203
|
+
return newOrders;
|
|
207204
|
+
}
|
|
207205
|
+
return this.filterBySymbolsSinceLimit(this.orders, symbols, since, limit, true);
|
|
206777
207206
|
}
|
|
206778
207207
|
parseWsOrder(order, market = undefined) {
|
|
206779
207208
|
//
|
|
@@ -207404,7 +207833,6 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
207404
207833
|
}
|
|
207405
207834
|
}
|
|
207406
207835
|
handleOrder(client, message) {
|
|
207407
|
-
const messageHash = 'orders';
|
|
207408
207836
|
const parsed = this.parseWsOrder(message);
|
|
207409
207837
|
const symbol = this.safeString(parsed, 'symbol');
|
|
207410
207838
|
const orderId = this.safeString(parsed, 'id');
|
|
@@ -207433,9 +207861,8 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
207433
207861
|
}
|
|
207434
207862
|
}
|
|
207435
207863
|
cachedOrders.append(parsed);
|
|
207436
|
-
|
|
207437
|
-
|
|
207438
|
-
client.resolve(this.orders, messageHashSymbol);
|
|
207864
|
+
this.resolvePromiseIfMessagehashMatches(client, 'orders::', symbol, parsed);
|
|
207865
|
+
client.resolve(parsed, 'orders');
|
|
207439
207866
|
}
|
|
207440
207867
|
}
|
|
207441
207868
|
handleAcountUpdate(client, message) {
|
|
@@ -221373,10 +221800,10 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
221373
221800
|
/* harmony export */ Z: () => (/* binding */ cex)
|
|
221374
221801
|
/* harmony export */ });
|
|
221375
221802
|
/* harmony import */ var _cex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6445);
|
|
221803
|
+
/* harmony import */ var _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1372);
|
|
221376
221804
|
/* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
|
|
221377
221805
|
/* harmony import */ var _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2194);
|
|
221378
221806
|
/* harmony import */ var _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3020);
|
|
221379
|
-
/* harmony import */ var _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1372);
|
|
221380
221807
|
// ---------------------------------------------------------------------------
|
|
221381
221808
|
|
|
221382
221809
|
|
|
@@ -221398,6 +221825,14 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
221398
221825
|
'watchOrderBook': true,
|
|
221399
221826
|
'watchOHLCV': true,
|
|
221400
221827
|
'watchPosition': undefined,
|
|
221828
|
+
'createOrderWs': true,
|
|
221829
|
+
'editOrderWs': true,
|
|
221830
|
+
'cancelOrderWs': true,
|
|
221831
|
+
'cancelOrdersWs': true,
|
|
221832
|
+
'fetchOrderWs': true,
|
|
221833
|
+
'fetchOpenOrdersWs': true,
|
|
221834
|
+
'fetchTickerWs': true,
|
|
221835
|
+
'fetchBalanceWs': true,
|
|
221401
221836
|
},
|
|
221402
221837
|
'urls': {
|
|
221403
221838
|
'api': {
|
|
@@ -221414,7 +221849,7 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
221414
221849
|
requestId() {
|
|
221415
221850
|
const requestId = this.sum(this.safeInteger(this.options, 'requestId', 0), 1);
|
|
221416
221851
|
this.options['requestId'] = requestId;
|
|
221417
|
-
return requestId;
|
|
221852
|
+
return requestId.toString();
|
|
221418
221853
|
}
|
|
221419
221854
|
async watchBalance(params = {}) {
|
|
221420
221855
|
/**
|
|
@@ -221426,7 +221861,7 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
221426
221861
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
221427
221862
|
*/
|
|
221428
221863
|
await this.authenticate(params);
|
|
221429
|
-
const messageHash =
|
|
221864
|
+
const messageHash = this.requestId();
|
|
221430
221865
|
const url = this.urls['api']['ws'];
|
|
221431
221866
|
const subscribe = {
|
|
221432
221867
|
'e': 'get-balance',
|
|
@@ -221473,7 +221908,8 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
221473
221908
|
result[code] = account;
|
|
221474
221909
|
}
|
|
221475
221910
|
this.balance = this.safeBalance(result);
|
|
221476
|
-
|
|
221911
|
+
const messageHash = this.safeString(message, 'oid');
|
|
221912
|
+
client.resolve(this.balance, messageHash);
|
|
221477
221913
|
}
|
|
221478
221914
|
async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
221479
221915
|
/**
|
|
@@ -221663,6 +222099,27 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
221663
222099
|
}
|
|
221664
222100
|
return this.filterByArray(this.tickers, 'symbol', symbols);
|
|
221665
222101
|
}
|
|
222102
|
+
async fetchTickerWs(symbol, params = {}) {
|
|
222103
|
+
/**
|
|
222104
|
+
* @method
|
|
222105
|
+
* @name cex#fetchTickerWs
|
|
222106
|
+
* @see https://docs.cex.io/#ws-api-ticker-deprecated
|
|
222107
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
222108
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
222109
|
+
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
222110
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
222111
|
+
*/
|
|
222112
|
+
await this.loadMarkets();
|
|
222113
|
+
const market = this.market(symbol);
|
|
222114
|
+
const url = this.urls['api']['ws'];
|
|
222115
|
+
const messageHash = this.requestId();
|
|
222116
|
+
const request = this.extend({
|
|
222117
|
+
'e': 'ticker',
|
|
222118
|
+
'oid': messageHash,
|
|
222119
|
+
'data': [market['base'], market['quote']],
|
|
222120
|
+
}, params);
|
|
222121
|
+
return await this.watch(url, messageHash, request, messageHash);
|
|
222122
|
+
}
|
|
221666
222123
|
handleTicker(client, message) {
|
|
221667
222124
|
//
|
|
221668
222125
|
// {
|
|
@@ -221679,10 +222136,12 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
221679
222136
|
const data = this.safeValue(message, 'data', {});
|
|
221680
222137
|
const ticker = this.parseWsTicker(data);
|
|
221681
222138
|
const symbol = ticker['symbol'];
|
|
221682
|
-
const messageHash = 'ticker:' + symbol;
|
|
221683
222139
|
this.tickers[symbol] = ticker;
|
|
222140
|
+
let messageHash = 'ticker:' + symbol;
|
|
221684
222141
|
client.resolve(ticker, messageHash);
|
|
221685
222142
|
client.resolve(ticker, 'tickers');
|
|
222143
|
+
messageHash = this.safeString(message, 'oid');
|
|
222144
|
+
client.resolve(ticker, messageHash);
|
|
221686
222145
|
}
|
|
221687
222146
|
parseWsTicker(ticker, market = undefined) {
|
|
221688
222147
|
//
|
|
@@ -221747,6 +222206,25 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
221747
222206
|
'info': ticker,
|
|
221748
222207
|
}, market);
|
|
221749
222208
|
}
|
|
222209
|
+
async fetchBalanceWs(params = {}) {
|
|
222210
|
+
/**
|
|
222211
|
+
* @method
|
|
222212
|
+
* @name cex#fetchBalanceWs
|
|
222213
|
+
* @see https://docs.cex.io/#ws-api-get-balance
|
|
222214
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
222215
|
+
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
222216
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/en/latest/manual.html?#balance-structure}
|
|
222217
|
+
*/
|
|
222218
|
+
await this.loadMarkets();
|
|
222219
|
+
await this.authenticate();
|
|
222220
|
+
const url = this.urls['api']['ws'];
|
|
222221
|
+
const messageHash = this.requestId();
|
|
222222
|
+
const request = this.extend({
|
|
222223
|
+
'e': 'get-balance',
|
|
222224
|
+
'oid': messageHash,
|
|
222225
|
+
}, params);
|
|
222226
|
+
return await this.watch(url, messageHash, request, messageHash);
|
|
222227
|
+
}
|
|
221750
222228
|
async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
221751
222229
|
/**
|
|
221752
222230
|
* @method
|
|
@@ -222035,7 +222513,8 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
222035
222513
|
const limit = this.safeInteger(this.options, 'ordersLimit', 1000);
|
|
222036
222514
|
this.orders = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCacheBySymbolById */ .hl(limit);
|
|
222037
222515
|
}
|
|
222038
|
-
const
|
|
222516
|
+
const storedOrders = this.orders;
|
|
222517
|
+
const ordersBySymbol = this.safeValue(storedOrders.hashmap, symbol, {});
|
|
222039
222518
|
let order = this.safeValue(ordersBySymbol, orderId);
|
|
222040
222519
|
if (order === undefined) {
|
|
222041
222520
|
order = this.parseWsOrderUpdate(data, market);
|
|
@@ -222060,7 +222539,6 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
222060
222539
|
order['timestamp'] = timestamp;
|
|
222061
222540
|
order['datetime'] = this.iso8601(timestamp);
|
|
222062
222541
|
order = this.safeOrder(order);
|
|
222063
|
-
const storedOrders = this.orders;
|
|
222064
222542
|
storedOrders.append(order);
|
|
222065
222543
|
const messageHash = 'orders:' + symbol;
|
|
222066
222544
|
client.resolve(storedOrders, messageHash);
|
|
@@ -222121,7 +222599,10 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
222121
222599
|
}
|
|
222122
222600
|
const base = this.safeCurrencyCode(baseId);
|
|
222123
222601
|
const quote = this.safeCurrencyCode(quoteId);
|
|
222124
|
-
|
|
222602
|
+
let symbol = undefined;
|
|
222603
|
+
if (base !== undefined && quote !== undefined) {
|
|
222604
|
+
symbol = base + '/' + quote;
|
|
222605
|
+
}
|
|
222125
222606
|
market = this.safeMarket(symbol, market);
|
|
222126
222607
|
const time = this.safeInteger(order, 'time', this.milliseconds());
|
|
222127
222608
|
let timestamp = time;
|
|
@@ -222486,6 +222967,236 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
222486
222967
|
client.resolve(stored, messageHash);
|
|
222487
222968
|
}
|
|
222488
222969
|
}
|
|
222970
|
+
async fetchOrderWs(id, symbol = undefined, params = {}) {
|
|
222971
|
+
/**
|
|
222972
|
+
* @method
|
|
222973
|
+
* @name cex#fetchOrderWs
|
|
222974
|
+
* @description fetches information on an order made by the user
|
|
222975
|
+
* @see https://docs.cex.io/#ws-api-get-order
|
|
222976
|
+
* @param {string} symbol not used by cex fetchOrder
|
|
222977
|
+
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
222978
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
222979
|
+
*/
|
|
222980
|
+
await this.loadMarkets();
|
|
222981
|
+
await this.authenticate();
|
|
222982
|
+
let market = undefined;
|
|
222983
|
+
if (symbol !== undefined) {
|
|
222984
|
+
market = this.market(symbol);
|
|
222985
|
+
}
|
|
222986
|
+
const data = this.extend({
|
|
222987
|
+
'order_id': id.toString(),
|
|
222988
|
+
}, params);
|
|
222989
|
+
const url = this.urls['api']['ws'];
|
|
222990
|
+
const messageHash = this.requestId();
|
|
222991
|
+
const request = {
|
|
222992
|
+
'e': 'get-order',
|
|
222993
|
+
'oid': messageHash,
|
|
222994
|
+
'data': data,
|
|
222995
|
+
};
|
|
222996
|
+
const response = await this.watch(url, messageHash, request, messageHash);
|
|
222997
|
+
return this.parseOrder(response, market);
|
|
222998
|
+
}
|
|
222999
|
+
async fetchOpenOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
223000
|
+
/**
|
|
223001
|
+
* @method
|
|
223002
|
+
* @name cex#fetchOpenOrdersWs
|
|
223003
|
+
* @see https://docs.cex.io/#ws-api-open-orders
|
|
223004
|
+
* @description fetch all unfilled currently open orders
|
|
223005
|
+
* @param {string} symbol unified market symbol
|
|
223006
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
223007
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
223008
|
+
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
223009
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
223010
|
+
*/
|
|
223011
|
+
if (symbol === undefined) {
|
|
223012
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + 'fetchOpenOrdersWs requires a symbol.');
|
|
223013
|
+
}
|
|
223014
|
+
await this.loadMarkets();
|
|
223015
|
+
await this.authenticate();
|
|
223016
|
+
const market = this.market(symbol);
|
|
223017
|
+
const url = this.urls['api']['ws'];
|
|
223018
|
+
const messageHash = this.requestId();
|
|
223019
|
+
const data = this.extend({
|
|
223020
|
+
'pair': [market['baseId'], market['quoteId']],
|
|
223021
|
+
}, params);
|
|
223022
|
+
const request = {
|
|
223023
|
+
'e': 'open-orders',
|
|
223024
|
+
'oid': messageHash,
|
|
223025
|
+
'data': data,
|
|
223026
|
+
};
|
|
223027
|
+
const response = await this.watch(url, messageHash, request, messageHash);
|
|
223028
|
+
return this.parseOrders(response, market, since, limit, params);
|
|
223029
|
+
}
|
|
223030
|
+
async createOrderWs(symbol, type, side, amount, price = undefined, params = {}) {
|
|
223031
|
+
/**
|
|
223032
|
+
* @method
|
|
223033
|
+
* @name cex#createOrderWs
|
|
223034
|
+
* @see https://docs.cex.io/#ws-api-order-placement
|
|
223035
|
+
* @description create a trade order
|
|
223036
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
223037
|
+
* @param {string} type 'market' or 'limit'
|
|
223038
|
+
* @param {string} side 'buy' or 'sell'
|
|
223039
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
223040
|
+
* @param {float} price the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
223041
|
+
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
223042
|
+
* @param {boolean} [params.maker_only] Optional, maker only places an order only if offers best sell (<= max) or buy(>= max) price for this pair, if not order placement will be rejected with an error - "Order is not maker"
|
|
223043
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure}
|
|
223044
|
+
*/
|
|
223045
|
+
if (price === undefined) {
|
|
223046
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' createOrderWs requires a price argument');
|
|
223047
|
+
}
|
|
223048
|
+
await this.loadMarkets();
|
|
223049
|
+
await this.authenticate();
|
|
223050
|
+
const market = this.market(symbol);
|
|
223051
|
+
const url = this.urls['api']['ws'];
|
|
223052
|
+
const messageHash = this.requestId();
|
|
223053
|
+
const data = this.extend({
|
|
223054
|
+
'pair': [market['baseId'], market['quoteId']],
|
|
223055
|
+
'amount': amount,
|
|
223056
|
+
'price': price,
|
|
223057
|
+
'type': side,
|
|
223058
|
+
}, params);
|
|
223059
|
+
const request = {
|
|
223060
|
+
'e': 'place-order',
|
|
223061
|
+
'oid': messageHash,
|
|
223062
|
+
'data': data,
|
|
223063
|
+
};
|
|
223064
|
+
const rawOrder = await this.watch(url, messageHash, request, messageHash);
|
|
223065
|
+
return this.parseOrder(rawOrder, market);
|
|
223066
|
+
}
|
|
223067
|
+
async editOrderWs(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
223068
|
+
/**
|
|
223069
|
+
* @method
|
|
223070
|
+
* @name cex#editOrderWs
|
|
223071
|
+
* @description edit a trade order
|
|
223072
|
+
* @see https://docs.cex.io/#ws-api-cancel-replace
|
|
223073
|
+
* @param {string} id order id
|
|
223074
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
223075
|
+
* @param {string} type 'market' or 'limit'
|
|
223076
|
+
* @param {string} side 'buy' or 'sell'
|
|
223077
|
+
* @param {float} amount how much of the currency you want to trade in units of the base currency
|
|
223078
|
+
* @param {float|undefined} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
223079
|
+
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
223080
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure}
|
|
223081
|
+
*/
|
|
223082
|
+
if (amount === undefined) {
|
|
223083
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' editOrder() requires a amount argument');
|
|
223084
|
+
}
|
|
223085
|
+
if (price === undefined) {
|
|
223086
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' editOrder() requires a price argument');
|
|
223087
|
+
}
|
|
223088
|
+
await this.loadMarkets();
|
|
223089
|
+
await this.authenticate();
|
|
223090
|
+
const market = this.market(symbol);
|
|
223091
|
+
const data = this.extend({
|
|
223092
|
+
'pair': [market['baseId'], market['quoteId']],
|
|
223093
|
+
'type': side,
|
|
223094
|
+
'amount': amount,
|
|
223095
|
+
'price': price,
|
|
223096
|
+
'order_id': id,
|
|
223097
|
+
}, params);
|
|
223098
|
+
const messageHash = this.requestId();
|
|
223099
|
+
const url = this.urls['api']['ws'];
|
|
223100
|
+
const request = {
|
|
223101
|
+
'e': 'cancel-replace-order',
|
|
223102
|
+
'oid': messageHash,
|
|
223103
|
+
'data': data,
|
|
223104
|
+
};
|
|
223105
|
+
const response = await this.watch(url, messageHash, request, messageHash, messageHash);
|
|
223106
|
+
return this.parseOrder(response, market);
|
|
223107
|
+
}
|
|
223108
|
+
async cancelOrderWs(id, symbol = undefined, params = {}) {
|
|
223109
|
+
/**
|
|
223110
|
+
* @method
|
|
223111
|
+
* @name cex#cancelOrderWs
|
|
223112
|
+
* @see https://docs.cex.io/#ws-api-order-cancel
|
|
223113
|
+
* @description cancels an open order
|
|
223114
|
+
* @param {string} id order id
|
|
223115
|
+
* @param {string} symbol not used by cex cancelOrder ()
|
|
223116
|
+
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
223117
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
223118
|
+
*/
|
|
223119
|
+
await this.loadMarkets();
|
|
223120
|
+
await this.authenticate();
|
|
223121
|
+
let market = undefined;
|
|
223122
|
+
if (symbol !== undefined) {
|
|
223123
|
+
market = this.market(symbol);
|
|
223124
|
+
}
|
|
223125
|
+
const data = this.extend({
|
|
223126
|
+
'order_id': id,
|
|
223127
|
+
}, params);
|
|
223128
|
+
const messageHash = this.requestId();
|
|
223129
|
+
const url = this.urls['api']['ws'];
|
|
223130
|
+
const request = {
|
|
223131
|
+
'e': 'cancel-order',
|
|
223132
|
+
'oid': messageHash,
|
|
223133
|
+
'data': data,
|
|
223134
|
+
};
|
|
223135
|
+
const response = await this.watch(url, messageHash, request, messageHash, messageHash);
|
|
223136
|
+
return this.parseOrder(response, market);
|
|
223137
|
+
}
|
|
223138
|
+
async cancelOrdersWs(ids, symbol = undefined, params = {}) {
|
|
223139
|
+
/**
|
|
223140
|
+
* @method
|
|
223141
|
+
* @name cex#cancelOrdersWs
|
|
223142
|
+
* @description cancel multiple orders
|
|
223143
|
+
* @see https://docs.cex.io/#ws-api-mass-cancel-place
|
|
223144
|
+
* @param {string[]} ids order ids
|
|
223145
|
+
* @param {string} symbol not used by cex cancelOrders()
|
|
223146
|
+
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
223147
|
+
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
223148
|
+
*/
|
|
223149
|
+
if (symbol !== undefined) {
|
|
223150
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' cancelOrderWs does not allow filtering by symbol');
|
|
223151
|
+
}
|
|
223152
|
+
await this.loadMarkets();
|
|
223153
|
+
await this.authenticate();
|
|
223154
|
+
const messageHash = this.requestId();
|
|
223155
|
+
const data = this.extend({
|
|
223156
|
+
'cancel-orders': ids,
|
|
223157
|
+
}, params);
|
|
223158
|
+
const url = this.urls['api']['ws'];
|
|
223159
|
+
const request = {
|
|
223160
|
+
'e': 'mass-cancel-place-orders',
|
|
223161
|
+
'oid': messageHash,
|
|
223162
|
+
'data': data,
|
|
223163
|
+
};
|
|
223164
|
+
const response = await this.watch(url, messageHash, request, messageHash, messageHash);
|
|
223165
|
+
//
|
|
223166
|
+
// {
|
|
223167
|
+
// "cancel-orders": [{
|
|
223168
|
+
// "order_id": 69202557979,
|
|
223169
|
+
// "fremains": "0.15000000"
|
|
223170
|
+
// }],
|
|
223171
|
+
// "place-orders": [],
|
|
223172
|
+
// "placed-cancelled": []
|
|
223173
|
+
// }
|
|
223174
|
+
//
|
|
223175
|
+
const canceledOrders = this.safeValue(response, 'cancel-orders');
|
|
223176
|
+
return this.parseOrders(canceledOrders, undefined, undefined, undefined, params);
|
|
223177
|
+
}
|
|
223178
|
+
resolveData(client, message) {
|
|
223179
|
+
//
|
|
223180
|
+
// "e": "open-orders",
|
|
223181
|
+
// "data": [
|
|
223182
|
+
// {
|
|
223183
|
+
// "id": "2477098",
|
|
223184
|
+
// "time": "1435927928618",
|
|
223185
|
+
// "type": "buy",
|
|
223186
|
+
// "price": "241.9477",
|
|
223187
|
+
// "amount": "0.02000000",
|
|
223188
|
+
// "pending": "0.02000000"
|
|
223189
|
+
// },
|
|
223190
|
+
// ...
|
|
223191
|
+
// ],
|
|
223192
|
+
// "oid": "1435927928274_9_open-orders",
|
|
223193
|
+
// "ok": "ok"
|
|
223194
|
+
// }
|
|
223195
|
+
//
|
|
223196
|
+
const data = this.safeValue(message, 'data');
|
|
223197
|
+
const messageHash = this.safeString(message, 'oid');
|
|
223198
|
+
client.resolve(data, messageHash);
|
|
223199
|
+
}
|
|
222489
223200
|
handleConnected(client, message) {
|
|
222490
223201
|
//
|
|
222491
223202
|
// {
|
|
@@ -222503,7 +223214,25 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
222503
223214
|
// "ok": "error"
|
|
222504
223215
|
// }
|
|
222505
223216
|
//
|
|
222506
|
-
|
|
223217
|
+
try {
|
|
223218
|
+
const data = this.safeValue(message, 'data', {});
|
|
223219
|
+
const error = this.safeString(data, 'error');
|
|
223220
|
+
const event = this.safeString(message, 'e', '');
|
|
223221
|
+
const feedback = this.id + ' ' + event + ' ' + error;
|
|
223222
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], error, feedback);
|
|
223223
|
+
this.throwBroadlyMatchedException(this.exceptions['broad'], error, feedback);
|
|
223224
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(feedback);
|
|
223225
|
+
}
|
|
223226
|
+
catch (error) {
|
|
223227
|
+
const messageHash = this.safeString(message, 'oid');
|
|
223228
|
+
const future = this.safeValue(client['futures'], messageHash);
|
|
223229
|
+
if (future !== undefined) {
|
|
223230
|
+
client.reject(error, messageHash);
|
|
223231
|
+
}
|
|
223232
|
+
else {
|
|
223233
|
+
throw error;
|
|
223234
|
+
}
|
|
223235
|
+
}
|
|
222507
223236
|
}
|
|
222508
223237
|
handleMessage(client, message) {
|
|
222509
223238
|
const ok = this.safeString(message, 'ok');
|
|
@@ -222523,11 +223252,16 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
222523
223252
|
'get-balance': this.handleBalance,
|
|
222524
223253
|
'order-book-subscribe': this.handleOrderBookSnapshot,
|
|
222525
223254
|
'md_update': this.handleOrderBookUpdate,
|
|
222526
|
-
'open-orders': this.
|
|
223255
|
+
'open-orders': this.resolveData,
|
|
222527
223256
|
'order': this.handleOrderUpdate,
|
|
222528
223257
|
'history-update': this.handleTrade,
|
|
222529
223258
|
'history': this.handleTradesSnapshot,
|
|
222530
223259
|
'tx': this.handleTransaction,
|
|
223260
|
+
'place-order': this.resolveData,
|
|
223261
|
+
'cancel-replace-order': this.resolveData,
|
|
223262
|
+
'cancel-order': this.resolveData,
|
|
223263
|
+
'mass-cancel-place-orders': this.resolveData,
|
|
223264
|
+
'get-order': this.resolveData,
|
|
222531
223265
|
};
|
|
222532
223266
|
const handler = this.safeValue(handlers, event);
|
|
222533
223267
|
if (handler !== undefined) {
|
|
@@ -223441,8 +224175,8 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
|
|
|
223441
224175
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
223442
224176
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
223443
224177
|
*/
|
|
223444
|
-
symbols = this.marketSymbols(symbols, undefined, false);
|
|
223445
224178
|
await this.loadMarkets();
|
|
224179
|
+
symbols = this.marketSymbols(symbols, undefined, false);
|
|
223446
224180
|
const name = 'user';
|
|
223447
224181
|
const messageHash = 'multipleOrders::';
|
|
223448
224182
|
const authentication = this.authenticate();
|
|
@@ -263508,1083 +264242,6 @@ const stringToBytes = (type, str) => {
|
|
|
263508
264242
|
const bytes = (/* unused pure expression or super */ null && (stringToBytes));
|
|
263509
264243
|
|
|
263510
264244
|
|
|
263511
|
-
/***/ }),
|
|
263512
|
-
|
|
263513
|
-
/***/ 4224:
|
|
263514
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
263515
|
-
|
|
263516
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
263517
|
-
/* harmony export */ Z: () => (/* binding */ tidex)
|
|
263518
|
-
/* harmony export */ });
|
|
263519
|
-
/* harmony import */ var _abstract_tidex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6057);
|
|
263520
|
-
/* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
|
|
263521
|
-
/* harmony import */ var _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2194);
|
|
263522
|
-
/* harmony import */ var _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9292);
|
|
263523
|
-
/* harmony import */ var _static_dependencies_noble_hashes_sha512_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7110);
|
|
263524
|
-
|
|
263525
|
-
|
|
263526
|
-
|
|
263527
|
-
|
|
263528
|
-
|
|
263529
|
-
/**
|
|
263530
|
-
* @class tidex
|
|
263531
|
-
* @extends Exchange
|
|
263532
|
-
*/
|
|
263533
|
-
class tidex extends _abstract_tidex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
263534
|
-
describe() {
|
|
263535
|
-
return this.deepExtend(super.describe(), {
|
|
263536
|
-
'id': 'tidex',
|
|
263537
|
-
'name': 'Tidex',
|
|
263538
|
-
'countries': ['UK'],
|
|
263539
|
-
'rateLimit': 2000,
|
|
263540
|
-
'version': '3',
|
|
263541
|
-
'userAgent': this.userAgents['chrome'],
|
|
263542
|
-
'has': {
|
|
263543
|
-
'CORS': undefined,
|
|
263544
|
-
'spot': true,
|
|
263545
|
-
'margin': false,
|
|
263546
|
-
'swap': false,
|
|
263547
|
-
'future': false,
|
|
263548
|
-
'option': false,
|
|
263549
|
-
'addMargin': false,
|
|
263550
|
-
'cancelOrder': true,
|
|
263551
|
-
'createMarketOrder': false,
|
|
263552
|
-
'createOrder': true,
|
|
263553
|
-
'createReduceOnlyOrder': false,
|
|
263554
|
-
'fetchBalance': true,
|
|
263555
|
-
'fetchBorrowRateHistories': false,
|
|
263556
|
-
'fetchBorrowRateHistory': false,
|
|
263557
|
-
'fetchCrossBorrowRate': false,
|
|
263558
|
-
'fetchCrossBorrowRates': false,
|
|
263559
|
-
'fetchCurrencies': true,
|
|
263560
|
-
'fetchFundingHistory': false,
|
|
263561
|
-
'fetchFundingRate': false,
|
|
263562
|
-
'fetchFundingRateHistory': false,
|
|
263563
|
-
'fetchFundingRates': false,
|
|
263564
|
-
'fetchIndexOHLCV': false,
|
|
263565
|
-
'fetchIsolatedBorrowRate': false,
|
|
263566
|
-
'fetchIsolatedBorrowRates': false,
|
|
263567
|
-
'fetchLeverage': false,
|
|
263568
|
-
'fetchLeverageTiers': false,
|
|
263569
|
-
'fetchMarginMode': false,
|
|
263570
|
-
'fetchMarkets': true,
|
|
263571
|
-
'fetchMarkOHLCV': false,
|
|
263572
|
-
'fetchMyTrades': true,
|
|
263573
|
-
'fetchOpenInterestHistory': false,
|
|
263574
|
-
'fetchOpenOrders': true,
|
|
263575
|
-
'fetchOrder': true,
|
|
263576
|
-
'fetchOrderBook': true,
|
|
263577
|
-
'fetchOrderBooks': true,
|
|
263578
|
-
'fetchPosition': false,
|
|
263579
|
-
'fetchPositionMode': false,
|
|
263580
|
-
'fetchPositions': false,
|
|
263581
|
-
'fetchPositionsRisk': false,
|
|
263582
|
-
'fetchPremiumIndexOHLCV': false,
|
|
263583
|
-
'fetchTicker': true,
|
|
263584
|
-
'fetchTickers': true,
|
|
263585
|
-
'fetchTrades': true,
|
|
263586
|
-
'reduceMargin': false,
|
|
263587
|
-
'setLeverage': false,
|
|
263588
|
-
'setMarginMode': false,
|
|
263589
|
-
'setPositionMode': false,
|
|
263590
|
-
'withdraw': true,
|
|
263591
|
-
},
|
|
263592
|
-
'urls': {
|
|
263593
|
-
'logo': 'https://user-images.githubusercontent.com/1294454/30781780-03149dc4-a12e-11e7-82bb-313b269d24d4.jpg',
|
|
263594
|
-
'api': {
|
|
263595
|
-
'web': 'https://gate.tidex.com/api',
|
|
263596
|
-
'public': 'https://api.tidex.com/api/3',
|
|
263597
|
-
'private': 'https://api.tidex.com/tapi',
|
|
263598
|
-
},
|
|
263599
|
-
'www': 'https://tidex.com',
|
|
263600
|
-
'doc': 'https://tidex.com/exchange/public-api',
|
|
263601
|
-
'referral': 'https://tidex.com/exchange',
|
|
263602
|
-
'fees': [
|
|
263603
|
-
'https://tidex.com/exchange/assets-spec',
|
|
263604
|
-
'https://tidex.com/exchange/pairs-spec',
|
|
263605
|
-
],
|
|
263606
|
-
},
|
|
263607
|
-
'api': {
|
|
263608
|
-
'web': {
|
|
263609
|
-
'get': [
|
|
263610
|
-
'currency',
|
|
263611
|
-
'pairs',
|
|
263612
|
-
'tickers',
|
|
263613
|
-
'orders',
|
|
263614
|
-
'ordershistory',
|
|
263615
|
-
'trade-data',
|
|
263616
|
-
'trade-data/{id}',
|
|
263617
|
-
],
|
|
263618
|
-
},
|
|
263619
|
-
'public': {
|
|
263620
|
-
'get': [
|
|
263621
|
-
'info',
|
|
263622
|
-
'ticker/{pair}',
|
|
263623
|
-
'depth/{pair}',
|
|
263624
|
-
'trades/{pair}',
|
|
263625
|
-
],
|
|
263626
|
-
},
|
|
263627
|
-
'private': {
|
|
263628
|
-
'post': [
|
|
263629
|
-
'getInfoExt',
|
|
263630
|
-
'getInfo',
|
|
263631
|
-
'Trade',
|
|
263632
|
-
'ActiveOrders',
|
|
263633
|
-
'OrderInfo',
|
|
263634
|
-
'CancelOrder',
|
|
263635
|
-
'TradeHistory',
|
|
263636
|
-
'getDepositAddress',
|
|
263637
|
-
'createWithdraw',
|
|
263638
|
-
'getWithdraw',
|
|
263639
|
-
],
|
|
263640
|
-
},
|
|
263641
|
-
},
|
|
263642
|
-
'fees': {
|
|
263643
|
-
'trading': {
|
|
263644
|
-
'feeSide': 'get',
|
|
263645
|
-
'tierBased': false,
|
|
263646
|
-
'percentage': true,
|
|
263647
|
-
'taker': this.parseNumber('0.001'),
|
|
263648
|
-
'maker': this.parseNumber('0.001'),
|
|
263649
|
-
},
|
|
263650
|
-
},
|
|
263651
|
-
'commonCurrencies': {
|
|
263652
|
-
'DSH': 'DASH',
|
|
263653
|
-
'EMGO': 'MGO',
|
|
263654
|
-
'MGO': 'WMGO',
|
|
263655
|
-
},
|
|
263656
|
-
'precisionMode': _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__/* .TICK_SIZE */ .sh,
|
|
263657
|
-
'exceptions': {
|
|
263658
|
-
'exact': {
|
|
263659
|
-
'803': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
263660
|
-
'804': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
263661
|
-
'805': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
263662
|
-
'806': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
263663
|
-
'807': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
263664
|
-
'831': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
|
|
263665
|
-
'832': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
|
|
263666
|
-
'833': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound, // "Order with id X was not found." (cancelling non-existent, closed and cancelled order)
|
|
263667
|
-
},
|
|
263668
|
-
'broad': {
|
|
263669
|
-
'Invalid pair name': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
263670
|
-
'invalid api key': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
|
|
263671
|
-
'invalid sign': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
|
|
263672
|
-
'api key dont have trade permission': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
|
|
263673
|
-
'invalid parameter': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
263674
|
-
'invalid order': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
263675
|
-
'Requests too often': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.DDoSProtection,
|
|
263676
|
-
'not available': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeNotAvailable,
|
|
263677
|
-
'data unavailable': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeNotAvailable,
|
|
263678
|
-
'external service unavailable': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeNotAvailable,
|
|
263679
|
-
'IP restricted': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied, // {"success":0,"code":0,"error":"IP restricted (223.xxx.xxx.xxx)"}
|
|
263680
|
-
},
|
|
263681
|
-
},
|
|
263682
|
-
'options': {
|
|
263683
|
-
'fetchTickersMaxLength': 2048,
|
|
263684
|
-
},
|
|
263685
|
-
'orders': {}, // orders cache / emulation
|
|
263686
|
-
});
|
|
263687
|
-
}
|
|
263688
|
-
async fetchCurrencies(params = {}) {
|
|
263689
|
-
/**
|
|
263690
|
-
* @method
|
|
263691
|
-
* @name tidex#fetchCurrencies
|
|
263692
|
-
* @description fetches all available currencies on an exchange
|
|
263693
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
263694
|
-
* @returns {object} an associative dictionary of currencies
|
|
263695
|
-
*/
|
|
263696
|
-
const response = await this.webGetCurrency(params);
|
|
263697
|
-
//
|
|
263698
|
-
// [
|
|
263699
|
-
// {
|
|
263700
|
-
// "id":2,
|
|
263701
|
-
// "symbol":"BTC",
|
|
263702
|
-
// "type":2,
|
|
263703
|
-
// "name":"Bitcoin",
|
|
263704
|
-
// "amountPoint":8,
|
|
263705
|
-
// "depositEnable":true,
|
|
263706
|
-
// "depositMinAmount":0.0005,
|
|
263707
|
-
// "withdrawEnable":true,
|
|
263708
|
-
// "withdrawFee":0.0004,
|
|
263709
|
-
// "withdrawMinAmount":0.0005,
|
|
263710
|
-
// "settings":{
|
|
263711
|
-
// "Blockchain":"https://blockchair.com/bitcoin/",
|
|
263712
|
-
// "TxUrl":"https://blockchair.com/bitcoin/transaction/{0}",
|
|
263713
|
-
// "AddrUrl":"https://blockchair.com/bitcoin/address/{0}",
|
|
263714
|
-
// "ConfirmationCount":3,
|
|
263715
|
-
// "NeedMemo":false
|
|
263716
|
-
// },
|
|
263717
|
-
// "visible":true,
|
|
263718
|
-
// "isDelisted":false
|
|
263719
|
-
// }
|
|
263720
|
-
// ]
|
|
263721
|
-
//
|
|
263722
|
-
const result = {};
|
|
263723
|
-
for (let i = 0; i < response.length; i++) {
|
|
263724
|
-
const currency = response[i];
|
|
263725
|
-
const id = this.safeString(currency, 'symbol');
|
|
263726
|
-
const code = this.safeCurrencyCode(id);
|
|
263727
|
-
const visible = this.safeValue(currency, 'visible');
|
|
263728
|
-
let active = visible === true;
|
|
263729
|
-
const withdrawEnable = this.safeValue(currency, 'withdrawEnable', true);
|
|
263730
|
-
const depositEnable = this.safeValue(currency, 'depositEnable', true);
|
|
263731
|
-
if (!withdrawEnable || !depositEnable) {
|
|
263732
|
-
active = false;
|
|
263733
|
-
}
|
|
263734
|
-
const name = this.safeString(currency, 'name');
|
|
263735
|
-
const fee = this.safeNumber(currency, 'withdrawFee');
|
|
263736
|
-
result[code] = {
|
|
263737
|
-
'id': id,
|
|
263738
|
-
'code': code,
|
|
263739
|
-
'name': name,
|
|
263740
|
-
'active': active,
|
|
263741
|
-
'deposit': depositEnable,
|
|
263742
|
-
'withdraw': withdrawEnable,
|
|
263743
|
-
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'amountPoint'))),
|
|
263744
|
-
'funding': {
|
|
263745
|
-
'withdraw': {
|
|
263746
|
-
'active': withdrawEnable,
|
|
263747
|
-
'fee': fee,
|
|
263748
|
-
},
|
|
263749
|
-
'deposit': {
|
|
263750
|
-
'active': depositEnable,
|
|
263751
|
-
'fee': this.parseNumber('0'),
|
|
263752
|
-
},
|
|
263753
|
-
},
|
|
263754
|
-
'limits': {
|
|
263755
|
-
'amount': {
|
|
263756
|
-
'min': undefined,
|
|
263757
|
-
'max': undefined,
|
|
263758
|
-
},
|
|
263759
|
-
'withdraw': {
|
|
263760
|
-
'min': this.safeNumber(currency, 'withdrawMinAmount'),
|
|
263761
|
-
'max': undefined,
|
|
263762
|
-
},
|
|
263763
|
-
'deposit': {
|
|
263764
|
-
'min': this.safeNumber(currency, 'depositMinAmount'),
|
|
263765
|
-
'max': undefined,
|
|
263766
|
-
},
|
|
263767
|
-
},
|
|
263768
|
-
'info': currency,
|
|
263769
|
-
};
|
|
263770
|
-
}
|
|
263771
|
-
return result;
|
|
263772
|
-
}
|
|
263773
|
-
async fetchMarkets(params = {}) {
|
|
263774
|
-
/**
|
|
263775
|
-
* @method
|
|
263776
|
-
* @name tidex#fetchMarkets
|
|
263777
|
-
* @description retrieves data on all markets for tidex
|
|
263778
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
263779
|
-
* @returns {object[]} an array of objects representing market data
|
|
263780
|
-
*/
|
|
263781
|
-
const response = await this.publicGetInfo(params);
|
|
263782
|
-
//
|
|
263783
|
-
// {
|
|
263784
|
-
// "server_time":1615861869,
|
|
263785
|
-
// "pairs":{
|
|
263786
|
-
// "ltc_btc":{
|
|
263787
|
-
// "decimal_places":8,
|
|
263788
|
-
// "min_price":0.00000001,
|
|
263789
|
-
// "max_price":3.0,
|
|
263790
|
-
// "min_amount":0.001,
|
|
263791
|
-
// "max_amount":1000000.0,
|
|
263792
|
-
// "min_total":0.0001,
|
|
263793
|
-
// "hidden":0,
|
|
263794
|
-
// "fee":0.1,
|
|
263795
|
-
// },
|
|
263796
|
-
// },
|
|
263797
|
-
// }
|
|
263798
|
-
//
|
|
263799
|
-
const markets = response['pairs'];
|
|
263800
|
-
const keys = Object.keys(markets);
|
|
263801
|
-
const result = [];
|
|
263802
|
-
for (let i = 0; i < keys.length; i++) {
|
|
263803
|
-
const id = keys[i];
|
|
263804
|
-
const market = markets[id];
|
|
263805
|
-
const [baseId, quoteId] = id.split('_');
|
|
263806
|
-
const base = this.safeCurrencyCode(baseId);
|
|
263807
|
-
const quote = this.safeCurrencyCode(quoteId);
|
|
263808
|
-
const hidden = this.safeInteger(market, 'hidden');
|
|
263809
|
-
let takerFeeString = this.safeString(market, 'fee');
|
|
263810
|
-
takerFeeString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv(takerFeeString, '100');
|
|
263811
|
-
result.push({
|
|
263812
|
-
'id': id,
|
|
263813
|
-
'symbol': base + '/' + quote,
|
|
263814
|
-
'base': base,
|
|
263815
|
-
'quote': quote,
|
|
263816
|
-
'settle': undefined,
|
|
263817
|
-
'baseId': baseId,
|
|
263818
|
-
'quoteId': quoteId,
|
|
263819
|
-
'settleId': undefined,
|
|
263820
|
-
'type': 'spot',
|
|
263821
|
-
'spot': true,
|
|
263822
|
-
'margin': false,
|
|
263823
|
-
'swap': false,
|
|
263824
|
-
'future': false,
|
|
263825
|
-
'option': false,
|
|
263826
|
-
'active': (hidden === 0),
|
|
263827
|
-
'contract': false,
|
|
263828
|
-
'linear': undefined,
|
|
263829
|
-
'inverse': undefined,
|
|
263830
|
-
'taker': this.parseNumber(takerFeeString),
|
|
263831
|
-
'contractSize': undefined,
|
|
263832
|
-
'expiry': undefined,
|
|
263833
|
-
'expiryDatetime': undefined,
|
|
263834
|
-
'strike': undefined,
|
|
263835
|
-
'optionType': undefined,
|
|
263836
|
-
'precision': {
|
|
263837
|
-
'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'decimal_places'))),
|
|
263838
|
-
'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'decimal_places'))),
|
|
263839
|
-
},
|
|
263840
|
-
'limits': {
|
|
263841
|
-
'leverage': {
|
|
263842
|
-
'min': undefined,
|
|
263843
|
-
'max': undefined,
|
|
263844
|
-
},
|
|
263845
|
-
'amount': {
|
|
263846
|
-
'min': this.safeNumber(market, 'min_amount'),
|
|
263847
|
-
'max': this.safeNumber(market, 'max_amount'),
|
|
263848
|
-
},
|
|
263849
|
-
'price': {
|
|
263850
|
-
'min': this.safeNumber(market, 'min_price'),
|
|
263851
|
-
'max': this.safeNumber(market, 'max_price'),
|
|
263852
|
-
},
|
|
263853
|
-
'cost': {
|
|
263854
|
-
'min': this.safeNumber(market, 'min_total'),
|
|
263855
|
-
'max': undefined,
|
|
263856
|
-
},
|
|
263857
|
-
},
|
|
263858
|
-
'created': undefined,
|
|
263859
|
-
'info': market,
|
|
263860
|
-
});
|
|
263861
|
-
}
|
|
263862
|
-
return result;
|
|
263863
|
-
}
|
|
263864
|
-
parseBalance(response) {
|
|
263865
|
-
const balances = this.safeValue(response, 'return');
|
|
263866
|
-
const timestamp = this.safeTimestamp(balances, 'server_time');
|
|
263867
|
-
const result = {
|
|
263868
|
-
'info': response,
|
|
263869
|
-
'timestamp': timestamp,
|
|
263870
|
-
'datetime': this.iso8601(timestamp),
|
|
263871
|
-
};
|
|
263872
|
-
const funds = this.safeValue(balances, 'funds', {});
|
|
263873
|
-
const currencyIds = Object.keys(funds);
|
|
263874
|
-
for (let i = 0; i < currencyIds.length; i++) {
|
|
263875
|
-
const currencyId = currencyIds[i];
|
|
263876
|
-
const code = this.safeCurrencyCode(currencyId);
|
|
263877
|
-
const balance = this.safeValue(funds, currencyId, {});
|
|
263878
|
-
const account = this.account();
|
|
263879
|
-
account['free'] = this.safeString(balance, 'value');
|
|
263880
|
-
account['used'] = this.safeString(balance, 'inOrders');
|
|
263881
|
-
result[code] = account;
|
|
263882
|
-
}
|
|
263883
|
-
return this.safeBalance(result);
|
|
263884
|
-
}
|
|
263885
|
-
async fetchBalance(params = {}) {
|
|
263886
|
-
/**
|
|
263887
|
-
* @method
|
|
263888
|
-
* @name tidex#fetchBalance
|
|
263889
|
-
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
263890
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
263891
|
-
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
263892
|
-
*/
|
|
263893
|
-
await this.loadMarkets();
|
|
263894
|
-
const response = await this.privatePostGetInfoExt(params);
|
|
263895
|
-
//
|
|
263896
|
-
// {
|
|
263897
|
-
// "success":1,
|
|
263898
|
-
// "return":{
|
|
263899
|
-
// "funds":{
|
|
263900
|
-
// "btc":{"value":0.0000499885629956,"inOrders":0.0},
|
|
263901
|
-
// "eth":{"value":0.000000030741708,"inOrders":0.0},
|
|
263902
|
-
// "tdx":{"value":0.0000000155385356,"inOrders":0.0}
|
|
263903
|
-
// },
|
|
263904
|
-
// "rights":{
|
|
263905
|
-
// "info":true,
|
|
263906
|
-
// "trade":true,
|
|
263907
|
-
// "withdraw":false
|
|
263908
|
-
// },
|
|
263909
|
-
// "transaction_count":0,
|
|
263910
|
-
// "open_orders":0,
|
|
263911
|
-
// "server_time":1619436907
|
|
263912
|
-
// },
|
|
263913
|
-
// "stat":{
|
|
263914
|
-
// "isSuccess":true,
|
|
263915
|
-
// "serverTime":"00:00:00.0001157",
|
|
263916
|
-
// "time":"00:00:00.0101364",
|
|
263917
|
-
// "errors":null
|
|
263918
|
-
// }
|
|
263919
|
-
// }
|
|
263920
|
-
//
|
|
263921
|
-
return this.parseBalance(response);
|
|
263922
|
-
}
|
|
263923
|
-
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
263924
|
-
/**
|
|
263925
|
-
* @method
|
|
263926
|
-
* @name tidex#fetchOrderBook
|
|
263927
|
-
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
263928
|
-
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
263929
|
-
* @param {int} [limit] the maximum amount of order book entries to return
|
|
263930
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
263931
|
-
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
263932
|
-
*/
|
|
263933
|
-
await this.loadMarkets();
|
|
263934
|
-
const market = this.market(symbol);
|
|
263935
|
-
const request = {
|
|
263936
|
-
'pair': market['id'],
|
|
263937
|
-
};
|
|
263938
|
-
if (limit !== undefined) {
|
|
263939
|
-
request['limit'] = limit; // default = 150, max = 2000
|
|
263940
|
-
}
|
|
263941
|
-
const response = await this.publicGetDepthPair(this.extend(request, params));
|
|
263942
|
-
const market_id_in_reponse = (market['id'] in response);
|
|
263943
|
-
if (!market_id_in_reponse) {
|
|
263944
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' ' + market['symbol'] + ' order book is empty or not available');
|
|
263945
|
-
}
|
|
263946
|
-
const orderbook = response[market['id']];
|
|
263947
|
-
return this.parseOrderBook(orderbook, symbol);
|
|
263948
|
-
}
|
|
263949
|
-
async fetchOrderBooks(symbols = undefined, limit = undefined, params = {}) {
|
|
263950
|
-
/**
|
|
263951
|
-
* @method
|
|
263952
|
-
* @name tidex#fetchOrderBooks
|
|
263953
|
-
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data for multiple markets
|
|
263954
|
-
* @param {string[]|undefined} symbols list of unified market symbols, all symbols fetched if undefined, default is undefined
|
|
263955
|
-
* @param {int} [limit] max number of entries per orderbook to return, default is undefined
|
|
263956
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
263957
|
-
* @returns {object} a dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbol
|
|
263958
|
-
*/
|
|
263959
|
-
await this.loadMarkets();
|
|
263960
|
-
let ids = undefined;
|
|
263961
|
-
if (symbols === undefined) {
|
|
263962
|
-
ids = this.ids.join('-');
|
|
263963
|
-
// max URL length is 2083 symbols, including http schema, hostname, tld, etc...
|
|
263964
|
-
if (ids.length > 2048) {
|
|
263965
|
-
const numIds = this.ids.length;
|
|
263966
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' fetchOrderBooks() has ' + numIds.toString() + ' symbols exceeding max URL length, you are required to specify a list of symbols in the first argument to fetchOrderBooks');
|
|
263967
|
-
}
|
|
263968
|
-
}
|
|
263969
|
-
else {
|
|
263970
|
-
ids = this.marketIds(symbols);
|
|
263971
|
-
ids = ids.join('-');
|
|
263972
|
-
}
|
|
263973
|
-
const request = {
|
|
263974
|
-
'pair': ids,
|
|
263975
|
-
};
|
|
263976
|
-
if (limit !== undefined) {
|
|
263977
|
-
request['limit'] = limit; // default = 150, max = 2000
|
|
263978
|
-
}
|
|
263979
|
-
const response = await this.publicGetDepthPair(this.extend(request, params));
|
|
263980
|
-
const result = {};
|
|
263981
|
-
ids = Object.keys(response);
|
|
263982
|
-
for (let i = 0; i < ids.length; i++) {
|
|
263983
|
-
const id = ids[i];
|
|
263984
|
-
const symbol = this.safeSymbol(id);
|
|
263985
|
-
result[symbol] = this.parseOrderBook(response[id], symbol);
|
|
263986
|
-
}
|
|
263987
|
-
return result;
|
|
263988
|
-
}
|
|
263989
|
-
parseTicker(ticker, market = undefined) {
|
|
263990
|
-
//
|
|
263991
|
-
// {
|
|
263992
|
-
// "high": 0.03497582,
|
|
263993
|
-
// "low": 0.03248474,
|
|
263994
|
-
// "avg": 0.03373028,
|
|
263995
|
-
// "vol": 120.11485715062999,
|
|
263996
|
-
// "vol_cur": 3572.24914074,
|
|
263997
|
-
// "last": 0.0337611,
|
|
263998
|
-
// "buy": 0.0337442,
|
|
263999
|
-
// "sell": 0.03377798,
|
|
264000
|
-
// "updated": 1537522009
|
|
264001
|
-
// }
|
|
264002
|
-
//
|
|
264003
|
-
const timestamp = this.safeTimestamp(ticker, 'updated');
|
|
264004
|
-
market = this.safeMarket(undefined, market);
|
|
264005
|
-
const last = this.safeString(ticker, 'last');
|
|
264006
|
-
return this.safeTicker({
|
|
264007
|
-
'symbol': market['symbol'],
|
|
264008
|
-
'timestamp': timestamp,
|
|
264009
|
-
'datetime': this.iso8601(timestamp),
|
|
264010
|
-
'high': this.safeString(ticker, 'high'),
|
|
264011
|
-
'low': this.safeString(ticker, 'low'),
|
|
264012
|
-
'bid': this.safeString(ticker, 'buy'),
|
|
264013
|
-
'bidVolume': undefined,
|
|
264014
|
-
'ask': this.safeString(ticker, 'sell'),
|
|
264015
|
-
'askVolume': undefined,
|
|
264016
|
-
'vwap': undefined,
|
|
264017
|
-
'open': undefined,
|
|
264018
|
-
'close': last,
|
|
264019
|
-
'last': last,
|
|
264020
|
-
'previousClose': undefined,
|
|
264021
|
-
'change': undefined,
|
|
264022
|
-
'percentage': undefined,
|
|
264023
|
-
'average': this.safeString(ticker, 'avg'),
|
|
264024
|
-
'baseVolume': this.safeString(ticker, 'vol_cur'),
|
|
264025
|
-
'quoteVolume': this.safeString(ticker, 'vol'),
|
|
264026
|
-
'info': ticker,
|
|
264027
|
-
}, market);
|
|
264028
|
-
}
|
|
264029
|
-
async fetchTickers(symbols = undefined, params = {}) {
|
|
264030
|
-
/**
|
|
264031
|
-
* @method
|
|
264032
|
-
* @name tidex#fetchTickers
|
|
264033
|
-
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
264034
|
-
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
264035
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
264036
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
264037
|
-
*/
|
|
264038
|
-
await this.loadMarkets();
|
|
264039
|
-
symbols = this.marketSymbols(symbols);
|
|
264040
|
-
let ids = undefined;
|
|
264041
|
-
if (symbols === undefined) {
|
|
264042
|
-
const numIds = this.ids.length;
|
|
264043
|
-
ids = this.ids.join('-');
|
|
264044
|
-
// max URL length is 2048 symbols, including http schema, hostname, tld, etc...
|
|
264045
|
-
if (ids.length > this.options['fetchTickersMaxLength']) {
|
|
264046
|
-
const maxLength = this.safeInteger(this.options, 'fetchTickersMaxLength', 2048);
|
|
264047
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchTickers() has ' + numIds.toString() + ' markets exceeding max URL length for this endpoint (' + maxLength.toString() + ' characters), please, specify a list of symbols of interest in the first argument to fetchTickers');
|
|
264048
|
-
}
|
|
264049
|
-
}
|
|
264050
|
-
else {
|
|
264051
|
-
const newIds = this.marketIds(symbols);
|
|
264052
|
-
ids = newIds.join('-');
|
|
264053
|
-
}
|
|
264054
|
-
const request = {
|
|
264055
|
-
'pair': ids,
|
|
264056
|
-
};
|
|
264057
|
-
const response = await this.publicGetTickerPair(this.extend(request, params));
|
|
264058
|
-
const result = {};
|
|
264059
|
-
const keys = Object.keys(response);
|
|
264060
|
-
for (let i = 0; i < keys.length; i++) {
|
|
264061
|
-
const id = keys[i];
|
|
264062
|
-
const market = this.safeMarket(id);
|
|
264063
|
-
const symbol = market['symbol'];
|
|
264064
|
-
result[symbol] = this.parseTicker(response[id], market);
|
|
264065
|
-
}
|
|
264066
|
-
return this.filterByArrayTickers(result, 'symbol', symbols);
|
|
264067
|
-
}
|
|
264068
|
-
async fetchTicker(symbol, params = {}) {
|
|
264069
|
-
/**
|
|
264070
|
-
* @method
|
|
264071
|
-
* @name tidex#fetchTicker
|
|
264072
|
-
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
264073
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
264074
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
264075
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
264076
|
-
*/
|
|
264077
|
-
const tickers = await this.fetchTickers([symbol], params);
|
|
264078
|
-
return tickers[symbol];
|
|
264079
|
-
}
|
|
264080
|
-
parseTrade(trade, market = undefined) {
|
|
264081
|
-
const timestamp = this.safeTimestamp(trade, 'timestamp');
|
|
264082
|
-
let side = this.safeString(trade, 'type');
|
|
264083
|
-
if (side === 'ask') {
|
|
264084
|
-
side = 'sell';
|
|
264085
|
-
}
|
|
264086
|
-
else if (side === 'bid') {
|
|
264087
|
-
side = 'buy';
|
|
264088
|
-
}
|
|
264089
|
-
const priceString = this.safeString2(trade, 'rate', 'price');
|
|
264090
|
-
const id = this.safeString2(trade, 'trade_id', 'tid');
|
|
264091
|
-
const orderId = this.safeString(trade, 'order_id');
|
|
264092
|
-
const marketId = this.safeString(trade, 'pair');
|
|
264093
|
-
const symbol = this.safeSymbol(marketId, market);
|
|
264094
|
-
const amountString = this.safeString(trade, 'amount');
|
|
264095
|
-
const price = this.parseNumber(priceString);
|
|
264096
|
-
const amount = this.parseNumber(amountString);
|
|
264097
|
-
const cost = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(priceString, amountString));
|
|
264098
|
-
const type = 'limit'; // all trades are still limit trades
|
|
264099
|
-
let takerOrMaker = undefined;
|
|
264100
|
-
let fee = undefined;
|
|
264101
|
-
const feeCost = this.safeNumber(trade, 'commission');
|
|
264102
|
-
if (feeCost !== undefined) {
|
|
264103
|
-
const feeCurrencyId = this.safeString(trade, 'commissionCurrency');
|
|
264104
|
-
const feeCurrencyCode = this.safeCurrencyCode(feeCurrencyId);
|
|
264105
|
-
fee = {
|
|
264106
|
-
'cost': feeCost,
|
|
264107
|
-
'currency': feeCurrencyCode,
|
|
264108
|
-
};
|
|
264109
|
-
}
|
|
264110
|
-
const isYourOrder = this.safeValue(trade, 'is_your_order');
|
|
264111
|
-
if (isYourOrder !== undefined) {
|
|
264112
|
-
takerOrMaker = 'taker';
|
|
264113
|
-
if (isYourOrder) {
|
|
264114
|
-
takerOrMaker = 'maker';
|
|
264115
|
-
}
|
|
264116
|
-
if (fee === undefined) {
|
|
264117
|
-
fee = this.calculateFee(symbol, type, side, amount, price, takerOrMaker);
|
|
264118
|
-
}
|
|
264119
|
-
}
|
|
264120
|
-
return {
|
|
264121
|
-
'id': id,
|
|
264122
|
-
'order': orderId,
|
|
264123
|
-
'timestamp': timestamp,
|
|
264124
|
-
'datetime': this.iso8601(timestamp),
|
|
264125
|
-
'symbol': symbol,
|
|
264126
|
-
'type': type,
|
|
264127
|
-
'side': side,
|
|
264128
|
-
'takerOrMaker': takerOrMaker,
|
|
264129
|
-
'price': price,
|
|
264130
|
-
'amount': amount,
|
|
264131
|
-
'cost': cost,
|
|
264132
|
-
'fee': fee,
|
|
264133
|
-
'info': trade,
|
|
264134
|
-
};
|
|
264135
|
-
}
|
|
264136
|
-
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
264137
|
-
/**
|
|
264138
|
-
* @method
|
|
264139
|
-
* @name tidex#fetchTrades
|
|
264140
|
-
* @description get the list of most recent trades for a particular symbol
|
|
264141
|
-
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
264142
|
-
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
264143
|
-
* @param {int} [limit] the maximum amount of trades to fetch
|
|
264144
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
264145
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
264146
|
-
*/
|
|
264147
|
-
await this.loadMarkets();
|
|
264148
|
-
const market = this.market(symbol);
|
|
264149
|
-
const request = {
|
|
264150
|
-
'pair': market['id'],
|
|
264151
|
-
};
|
|
264152
|
-
if (limit !== undefined) {
|
|
264153
|
-
request['limit'] = limit;
|
|
264154
|
-
}
|
|
264155
|
-
const response = await this.publicGetTradesPair(this.extend(request, params));
|
|
264156
|
-
if (Array.isArray(response)) {
|
|
264157
|
-
const numElements = response.length;
|
|
264158
|
-
if (numElements === 0) {
|
|
264159
|
-
return [];
|
|
264160
|
-
}
|
|
264161
|
-
}
|
|
264162
|
-
return this.parseTrades(response[market['id']], market, since, limit);
|
|
264163
|
-
}
|
|
264164
|
-
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
264165
|
-
/**
|
|
264166
|
-
* @method
|
|
264167
|
-
* @name tidex#createOrder
|
|
264168
|
-
* @description create a trade order
|
|
264169
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
264170
|
-
* @param {string} type 'market' or 'limit'
|
|
264171
|
-
* @param {string} side 'buy' or 'sell'
|
|
264172
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
264173
|
-
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
264174
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
264175
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
264176
|
-
*/
|
|
264177
|
-
if (type === 'market') {
|
|
264178
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' createOrder() allows limit orders only');
|
|
264179
|
-
}
|
|
264180
|
-
const amountString = amount.toString();
|
|
264181
|
-
const priceString = price.toString();
|
|
264182
|
-
await this.loadMarkets();
|
|
264183
|
-
const market = this.market(symbol);
|
|
264184
|
-
const request = {
|
|
264185
|
-
'pair': market['id'],
|
|
264186
|
-
'type': side,
|
|
264187
|
-
'amount': this.amountToPrecision(symbol, amount),
|
|
264188
|
-
'rate': this.priceToPrecision(symbol, price),
|
|
264189
|
-
};
|
|
264190
|
-
const response = await this.privatePostTrade(this.extend(request, params));
|
|
264191
|
-
let id = undefined;
|
|
264192
|
-
let status = 'open';
|
|
264193
|
-
let filledString = '0.0';
|
|
264194
|
-
let remainingString = amountString;
|
|
264195
|
-
const returnResult = this.safeValue(response, 'return');
|
|
264196
|
-
if (returnResult !== undefined) {
|
|
264197
|
-
id = this.safeString(returnResult, 'order_id');
|
|
264198
|
-
if (id === '0') {
|
|
264199
|
-
id = this.safeString(returnResult, 'init_order_id');
|
|
264200
|
-
status = 'closed';
|
|
264201
|
-
}
|
|
264202
|
-
filledString = this.safeString(returnResult, 'received', filledString);
|
|
264203
|
-
remainingString = this.safeString(returnResult, 'remains', amountString);
|
|
264204
|
-
}
|
|
264205
|
-
const timestamp = this.milliseconds();
|
|
264206
|
-
return this.safeOrder({
|
|
264207
|
-
'id': id,
|
|
264208
|
-
'timestamp': timestamp,
|
|
264209
|
-
'datetime': this.iso8601(timestamp),
|
|
264210
|
-
'lastTradeTimestamp': undefined,
|
|
264211
|
-
'status': status,
|
|
264212
|
-
'symbol': symbol,
|
|
264213
|
-
'type': type,
|
|
264214
|
-
'side': side,
|
|
264215
|
-
'price': priceString,
|
|
264216
|
-
'cost': undefined,
|
|
264217
|
-
'amount': amountString,
|
|
264218
|
-
'remaining': remainingString,
|
|
264219
|
-
'filled': filledString,
|
|
264220
|
-
'fee': undefined,
|
|
264221
|
-
// 'trades': this.parseTrades (order['trades'], market),
|
|
264222
|
-
'info': response,
|
|
264223
|
-
'clientOrderId': undefined,
|
|
264224
|
-
'average': undefined,
|
|
264225
|
-
'trades': undefined,
|
|
264226
|
-
}, market);
|
|
264227
|
-
}
|
|
264228
|
-
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
264229
|
-
/**
|
|
264230
|
-
* @method
|
|
264231
|
-
* @name tidex#cancelOrder
|
|
264232
|
-
* @description cancels an open order
|
|
264233
|
-
* @param {string} id order id
|
|
264234
|
-
* @param {string} symbol not used by tidex cancelOrder ()
|
|
264235
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
264236
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
264237
|
-
*/
|
|
264238
|
-
await this.loadMarkets();
|
|
264239
|
-
const request = {
|
|
264240
|
-
'order_id': parseInt(id),
|
|
264241
|
-
};
|
|
264242
|
-
return await this.privatePostCancelOrder(this.extend(request, params));
|
|
264243
|
-
}
|
|
264244
|
-
parseOrderStatus(status) {
|
|
264245
|
-
const statuses = {
|
|
264246
|
-
'0': 'open',
|
|
264247
|
-
'1': 'closed',
|
|
264248
|
-
'2': 'canceled',
|
|
264249
|
-
'3': 'canceled', // or partially-filled and still open? https://github.com/ccxt/ccxt/issues/1594
|
|
264250
|
-
};
|
|
264251
|
-
return this.safeString(statuses, status, status);
|
|
264252
|
-
}
|
|
264253
|
-
parseOrder(order, market = undefined) {
|
|
264254
|
-
const id = this.safeString(order, 'id');
|
|
264255
|
-
const status = this.parseOrderStatus(this.safeString(order, 'status'));
|
|
264256
|
-
const timestamp = this.safeTimestamp(order, 'timestamp_created');
|
|
264257
|
-
const marketId = this.safeString(order, 'pair');
|
|
264258
|
-
const symbol = this.safeSymbol(marketId, market);
|
|
264259
|
-
let remaining;
|
|
264260
|
-
let amount;
|
|
264261
|
-
const price = this.safeString(order, 'rate');
|
|
264262
|
-
if ('start_amount' in order) {
|
|
264263
|
-
amount = this.safeString(order, 'start_amount');
|
|
264264
|
-
remaining = this.safeString(order, 'amount');
|
|
264265
|
-
}
|
|
264266
|
-
else {
|
|
264267
|
-
remaining = this.safeString(order, 'amount');
|
|
264268
|
-
}
|
|
264269
|
-
const fee = undefined;
|
|
264270
|
-
return this.safeOrder({
|
|
264271
|
-
'info': order,
|
|
264272
|
-
'id': id,
|
|
264273
|
-
'clientOrderId': undefined,
|
|
264274
|
-
'symbol': symbol,
|
|
264275
|
-
'timestamp': timestamp,
|
|
264276
|
-
'datetime': this.iso8601(timestamp),
|
|
264277
|
-
'lastTradeTimestamp': undefined,
|
|
264278
|
-
'type': 'limit',
|
|
264279
|
-
'timeInForce': undefined,
|
|
264280
|
-
'postOnly': undefined,
|
|
264281
|
-
'side': this.safeString(order, 'type'),
|
|
264282
|
-
'price': price,
|
|
264283
|
-
'stopPrice': undefined,
|
|
264284
|
-
'triggerPrice': undefined,
|
|
264285
|
-
'cost': undefined,
|
|
264286
|
-
'amount': amount,
|
|
264287
|
-
'remaining': remaining,
|
|
264288
|
-
'filled': undefined,
|
|
264289
|
-
'status': status,
|
|
264290
|
-
'fee': fee,
|
|
264291
|
-
'average': undefined,
|
|
264292
|
-
'trades': undefined,
|
|
264293
|
-
}, market);
|
|
264294
|
-
}
|
|
264295
|
-
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
264296
|
-
/**
|
|
264297
|
-
* @method
|
|
264298
|
-
* @name tidex#fetchOrder
|
|
264299
|
-
* @description fetches information on an order made by the user
|
|
264300
|
-
* @param {string} symbol not used by tidex fetchOrder
|
|
264301
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
264302
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
264303
|
-
*/
|
|
264304
|
-
await this.loadMarkets();
|
|
264305
|
-
const request = {
|
|
264306
|
-
'order_id': parseInt(id),
|
|
264307
|
-
};
|
|
264308
|
-
const response = await this.privatePostOrderInfo(this.extend(request, params));
|
|
264309
|
-
id = id.toString();
|
|
264310
|
-
const result = this.safeValue(response, 'return', {});
|
|
264311
|
-
const order = this.safeValue(result, id);
|
|
264312
|
-
return this.parseOrder(this.extend({ 'id': id }, order));
|
|
264313
|
-
}
|
|
264314
|
-
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
264315
|
-
/**
|
|
264316
|
-
* @method
|
|
264317
|
-
* @name tidex#fetchOpenOrders
|
|
264318
|
-
* @description fetch all unfilled currently open orders
|
|
264319
|
-
* @param {string} symbol unified market symbol
|
|
264320
|
-
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
264321
|
-
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
264322
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
264323
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
264324
|
-
*/
|
|
264325
|
-
await this.loadMarkets();
|
|
264326
|
-
const request = {};
|
|
264327
|
-
let market = undefined;
|
|
264328
|
-
if (symbol !== undefined) {
|
|
264329
|
-
market = this.market(symbol);
|
|
264330
|
-
request['pair'] = market['id'];
|
|
264331
|
-
}
|
|
264332
|
-
const response = await this.privatePostActiveOrders(this.extend(request, params));
|
|
264333
|
-
//
|
|
264334
|
-
// {
|
|
264335
|
-
// "success":1,
|
|
264336
|
-
// "return":{
|
|
264337
|
-
// "1255468911":{
|
|
264338
|
-
// "status":0,
|
|
264339
|
-
// "pair":"spike_usdt",
|
|
264340
|
-
// "type":"sell",
|
|
264341
|
-
// "amount":35028.44256388,
|
|
264342
|
-
// "rate":0.00199989,
|
|
264343
|
-
// "timestamp_created":1602684432
|
|
264344
|
-
// }
|
|
264345
|
-
// },
|
|
264346
|
-
// "stat":{
|
|
264347
|
-
// "isSuccess":true,
|
|
264348
|
-
// "serverTime":"00:00:00.0000826",
|
|
264349
|
-
// "time":"00:00:00.0091423",
|
|
264350
|
-
// "errors":null
|
|
264351
|
-
// }
|
|
264352
|
-
// }
|
|
264353
|
-
//
|
|
264354
|
-
// it can only return 'open' orders (i.e. no way to fetch 'closed' orders)
|
|
264355
|
-
const orders = this.safeValue(response, 'return', []);
|
|
264356
|
-
return this.parseOrders(orders, market, since, limit);
|
|
264357
|
-
}
|
|
264358
|
-
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
264359
|
-
/**
|
|
264360
|
-
* @method
|
|
264361
|
-
* @name tidex#fetchMyTrades
|
|
264362
|
-
* @description fetch all trades made by the user
|
|
264363
|
-
* @param {string} symbol unified market symbol
|
|
264364
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
264365
|
-
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
264366
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
264367
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
264368
|
-
*/
|
|
264369
|
-
await this.loadMarkets();
|
|
264370
|
-
let market = undefined;
|
|
264371
|
-
// some derived classes use camelcase notation for request fields
|
|
264372
|
-
const request = {
|
|
264373
|
-
// 'from': 123456789, // trade ID, from which the display starts numerical 0 (test result: liqui ignores this field)
|
|
264374
|
-
// 'count': 1000, // the number of trades for display numerical, default = 1000
|
|
264375
|
-
// 'from_id': trade ID, from which the display starts numerical 0
|
|
264376
|
-
// 'end_id': trade ID on which the display ends numerical ∞
|
|
264377
|
-
// 'order': 'ASC', // sorting, default = DESC (test result: liqui ignores this field, most recent trade always goes last)
|
|
264378
|
-
// 'since': 1234567890, // UTC start time, default = 0 (test result: liqui ignores this field)
|
|
264379
|
-
// 'end': 1234567890, // UTC end time, default = ∞ (test result: liqui ignores this field)
|
|
264380
|
-
// 'pair': 'eth_btc', // default = all markets
|
|
264381
|
-
};
|
|
264382
|
-
if (symbol !== undefined) {
|
|
264383
|
-
market = this.market(symbol);
|
|
264384
|
-
request['pair'] = market['id'];
|
|
264385
|
-
}
|
|
264386
|
-
if (limit !== undefined) {
|
|
264387
|
-
request['count'] = limit;
|
|
264388
|
-
}
|
|
264389
|
-
if (since !== undefined) {
|
|
264390
|
-
request['since'] = this.parseToInt(since / 1000);
|
|
264391
|
-
}
|
|
264392
|
-
const response = await this.privatePostTradeHistory(this.extend(request, params));
|
|
264393
|
-
const trades = this.safeValue(response, 'return', []);
|
|
264394
|
-
return this.parseTrades(trades, market, since, limit);
|
|
264395
|
-
}
|
|
264396
|
-
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
264397
|
-
/**
|
|
264398
|
-
* @method
|
|
264399
|
-
* @name tidex#withdraw
|
|
264400
|
-
* @description make a withdrawal
|
|
264401
|
-
* @param {string} code unified currency code
|
|
264402
|
-
* @param {float} amount the amount to withdraw
|
|
264403
|
-
* @param {string} address the address to withdraw to
|
|
264404
|
-
* @param {string} tag
|
|
264405
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
264406
|
-
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
264407
|
-
*/
|
|
264408
|
-
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
264409
|
-
this.checkAddress(address);
|
|
264410
|
-
await this.loadMarkets();
|
|
264411
|
-
const currency = this.currency(code);
|
|
264412
|
-
const request = {
|
|
264413
|
-
'asset': currency['id'],
|
|
264414
|
-
'amount': parseFloat(amount),
|
|
264415
|
-
'address': address,
|
|
264416
|
-
};
|
|
264417
|
-
if (tag !== undefined) {
|
|
264418
|
-
request['memo'] = tag;
|
|
264419
|
-
}
|
|
264420
|
-
const response = await this.privatePostCreateWithdraw(this.extend(request, params));
|
|
264421
|
-
//
|
|
264422
|
-
// {
|
|
264423
|
-
// "success":1,
|
|
264424
|
-
// "return":{
|
|
264425
|
-
// "withdraw_id":1111,
|
|
264426
|
-
// "withdraw_info":{
|
|
264427
|
-
// "id":1111,
|
|
264428
|
-
// "asset_id":1,
|
|
264429
|
-
// "asset":"BTC",
|
|
264430
|
-
// "amount":0.0093,
|
|
264431
|
-
// "fee":0.0007,
|
|
264432
|
-
// "create_time":1575128018,
|
|
264433
|
-
// "status":"Created",
|
|
264434
|
-
// "data":{
|
|
264435
|
-
// "address":"1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY",
|
|
264436
|
-
// "memo":"memo",
|
|
264437
|
-
// "tx":null,
|
|
264438
|
-
// "error":null
|
|
264439
|
-
// },
|
|
264440
|
-
// "in_blockchain":false
|
|
264441
|
-
// }
|
|
264442
|
-
// }
|
|
264443
|
-
// }
|
|
264444
|
-
//
|
|
264445
|
-
const result = this.safeValue(response, 'return', {});
|
|
264446
|
-
const withdrawInfo = this.safeValue(result, 'withdraw_info', {});
|
|
264447
|
-
return this.parseTransaction(withdrawInfo, currency);
|
|
264448
|
-
}
|
|
264449
|
-
parseTransaction(transaction, currency = undefined) {
|
|
264450
|
-
//
|
|
264451
|
-
// {
|
|
264452
|
-
// "id":1111,
|
|
264453
|
-
// "asset_id":1,
|
|
264454
|
-
// "asset":"BTC",
|
|
264455
|
-
// "amount":0.0093,
|
|
264456
|
-
// "fee":0.0007,
|
|
264457
|
-
// "create_time":1575128018,
|
|
264458
|
-
// "status":"Created",
|
|
264459
|
-
// "data":{
|
|
264460
|
-
// "address":"1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY",
|
|
264461
|
-
// "memo":"memo",
|
|
264462
|
-
// "tx":null,
|
|
264463
|
-
// "error":null
|
|
264464
|
-
// },
|
|
264465
|
-
// "in_blockchain":false
|
|
264466
|
-
// }
|
|
264467
|
-
//
|
|
264468
|
-
currency = this.safeCurrency(undefined, currency);
|
|
264469
|
-
return {
|
|
264470
|
-
'id': this.safeString(transaction, 'id'),
|
|
264471
|
-
'txid': undefined,
|
|
264472
|
-
'timestamp': undefined,
|
|
264473
|
-
'datetime': undefined,
|
|
264474
|
-
'network': undefined,
|
|
264475
|
-
'addressFrom': undefined,
|
|
264476
|
-
'address': undefined,
|
|
264477
|
-
'addressTo': undefined,
|
|
264478
|
-
'amount': undefined,
|
|
264479
|
-
'type': undefined,
|
|
264480
|
-
'currency': currency['code'],
|
|
264481
|
-
'status': undefined,
|
|
264482
|
-
'updated': undefined,
|
|
264483
|
-
'tagFrom': undefined,
|
|
264484
|
-
'tag': undefined,
|
|
264485
|
-
'tagTo': undefined,
|
|
264486
|
-
'comment': undefined,
|
|
264487
|
-
'internal': undefined,
|
|
264488
|
-
'fee': undefined,
|
|
264489
|
-
'info': transaction,
|
|
264490
|
-
};
|
|
264491
|
-
}
|
|
264492
|
-
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
264493
|
-
let url = this.urls['api'][api];
|
|
264494
|
-
const query = this.omit(params, this.extractParams(path));
|
|
264495
|
-
if (api === 'private') {
|
|
264496
|
-
this.checkRequiredCredentials();
|
|
264497
|
-
const nonce = this.nonce();
|
|
264498
|
-
body = this.urlencode(this.extend({
|
|
264499
|
-
'nonce': nonce,
|
|
264500
|
-
'method': path,
|
|
264501
|
-
}, query));
|
|
264502
|
-
const signature = this.hmac(this.encode(body), this.encode(this.secret), _static_dependencies_noble_hashes_sha512_js__WEBPACK_IMPORTED_MODULE_4__/* .sha512 */ .o);
|
|
264503
|
-
headers = {
|
|
264504
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
|
264505
|
-
'Key': this.apiKey,
|
|
264506
|
-
'Sign': signature,
|
|
264507
|
-
};
|
|
264508
|
-
}
|
|
264509
|
-
else if (api === 'public') {
|
|
264510
|
-
url += '/' + this.implodeParams(path, params);
|
|
264511
|
-
if (Object.keys(query).length) {
|
|
264512
|
-
url += '?' + this.urlencode(query);
|
|
264513
|
-
}
|
|
264514
|
-
}
|
|
264515
|
-
else {
|
|
264516
|
-
url += '/' + this.implodeParams(path, params);
|
|
264517
|
-
if (method === 'GET') {
|
|
264518
|
-
if (Object.keys(query).length) {
|
|
264519
|
-
url += '?' + this.urlencode(query);
|
|
264520
|
-
}
|
|
264521
|
-
}
|
|
264522
|
-
else {
|
|
264523
|
-
if (Object.keys(query).length) {
|
|
264524
|
-
body = this.json(query);
|
|
264525
|
-
headers = {
|
|
264526
|
-
'Content-Type': 'application/json',
|
|
264527
|
-
};
|
|
264528
|
-
}
|
|
264529
|
-
}
|
|
264530
|
-
}
|
|
264531
|
-
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
264532
|
-
}
|
|
264533
|
-
handleErrors(httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
264534
|
-
if (response === undefined) {
|
|
264535
|
-
return undefined; // fallback to default error handler
|
|
264536
|
-
}
|
|
264537
|
-
if ('success' in response) {
|
|
264538
|
-
//
|
|
264539
|
-
// 1 - The exchange only returns the integer 'success' key from their private API
|
|
264540
|
-
//
|
|
264541
|
-
// { "success": 1, ... } httpCode === 200
|
|
264542
|
-
// { "success": 0, ... } httpCode === 200
|
|
264543
|
-
//
|
|
264544
|
-
// 2 - However, derived exchanges can return non-integers
|
|
264545
|
-
//
|
|
264546
|
-
// It can be a numeric string
|
|
264547
|
-
// { "sucesss": "1", ... }
|
|
264548
|
-
// { "sucesss": "0", ... }, httpCode >= 200 (can be 403, 502, etc)
|
|
264549
|
-
//
|
|
264550
|
-
// Or just a string
|
|
264551
|
-
// { "success": "true", ... }
|
|
264552
|
-
// { "success": "false", ... }, httpCode >= 200
|
|
264553
|
-
//
|
|
264554
|
-
// Or a boolean
|
|
264555
|
-
// { "success": true, ... }
|
|
264556
|
-
// { "success": false, ... }, httpCode >= 200
|
|
264557
|
-
//
|
|
264558
|
-
// 3 - Oversimplified, Python PEP8 forbids comparison operator (===) of different types
|
|
264559
|
-
//
|
|
264560
|
-
// 4 - We do not want to copy-paste and duplicate the code of this handler to other exchanges derived from Liqui
|
|
264561
|
-
//
|
|
264562
|
-
// To cover points 1, 2, 3 and 4 combined this handler should work like this:
|
|
264563
|
-
//
|
|
264564
|
-
let success = this.safeValue(response, 'success', false);
|
|
264565
|
-
if (typeof success === 'string') {
|
|
264566
|
-
if ((success === 'true') || (success === '1')) {
|
|
264567
|
-
success = true;
|
|
264568
|
-
}
|
|
264569
|
-
else {
|
|
264570
|
-
success = false;
|
|
264571
|
-
}
|
|
264572
|
-
}
|
|
264573
|
-
if (!success) {
|
|
264574
|
-
const code = this.safeString(response, 'code');
|
|
264575
|
-
const message = this.safeString(response, 'error');
|
|
264576
|
-
const feedback = this.id + ' ' + body;
|
|
264577
|
-
this.throwExactlyMatchedException(this.exceptions['exact'], code, feedback);
|
|
264578
|
-
this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);
|
|
264579
|
-
this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);
|
|
264580
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(feedback); // unknown message
|
|
264581
|
-
}
|
|
264582
|
-
}
|
|
264583
|
-
return undefined;
|
|
264584
|
-
}
|
|
264585
|
-
}
|
|
264586
|
-
|
|
264587
|
-
|
|
264588
264245
|
/***/ }),
|
|
264589
264246
|
|
|
264590
264247
|
/***/ 1067:
|
|
@@ -288222,39 +287879,39 @@ var __webpack_exports__ = {};
|
|
|
288222
287879
|
(() => {
|
|
288223
287880
|
__webpack_require__.r(__webpack_exports__);
|
|
288224
287881
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
288225
|
-
/* harmony export */ AccountNotEnabled: () => (/* reexport safe */
|
|
288226
|
-
/* harmony export */ AccountSuspended: () => (/* reexport safe */
|
|
288227
|
-
/* harmony export */ AddressPending: () => (/* reexport safe */
|
|
288228
|
-
/* harmony export */ ArgumentsRequired: () => (/* reexport safe */
|
|
288229
|
-
/* harmony export */ AuthenticationError: () => (/* reexport safe */
|
|
288230
|
-
/* harmony export */ BadRequest: () => (/* reexport safe */
|
|
288231
|
-
/* harmony export */ BadResponse: () => (/* reexport safe */
|
|
288232
|
-
/* harmony export */ BadSymbol: () => (/* reexport safe */
|
|
288233
|
-
/* harmony export */ BaseError: () => (/* reexport safe */
|
|
288234
|
-
/* harmony export */ CancelPending: () => (/* reexport safe */
|
|
288235
|
-
/* harmony export */ DDoSProtection: () => (/* reexport safe */
|
|
288236
|
-
/* harmony export */ DuplicateOrderId: () => (/* reexport safe */
|
|
287882
|
+
/* harmony export */ AccountNotEnabled: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.AccountNotEnabled),
|
|
287883
|
+
/* harmony export */ AccountSuspended: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.AccountSuspended),
|
|
287884
|
+
/* harmony export */ AddressPending: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.AddressPending),
|
|
287885
|
+
/* harmony export */ ArgumentsRequired: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.ArgumentsRequired),
|
|
287886
|
+
/* harmony export */ AuthenticationError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.AuthenticationError),
|
|
287887
|
+
/* harmony export */ BadRequest: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.BadRequest),
|
|
287888
|
+
/* harmony export */ BadResponse: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.BadResponse),
|
|
287889
|
+
/* harmony export */ BadSymbol: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.BadSymbol),
|
|
287890
|
+
/* harmony export */ BaseError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.BaseError),
|
|
287891
|
+
/* harmony export */ CancelPending: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.CancelPending),
|
|
287892
|
+
/* harmony export */ DDoSProtection: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.DDoSProtection),
|
|
287893
|
+
/* harmony export */ DuplicateOrderId: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.DuplicateOrderId),
|
|
288237
287894
|
/* harmony export */ Exchange: () => (/* reexport safe */ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__.e),
|
|
288238
|
-
/* harmony export */ ExchangeError: () => (/* reexport safe */
|
|
288239
|
-
/* harmony export */ ExchangeNotAvailable: () => (/* reexport safe */
|
|
288240
|
-
/* harmony export */ InsufficientFunds: () => (/* reexport safe */
|
|
288241
|
-
/* harmony export */ InvalidAddress: () => (/* reexport safe */
|
|
288242
|
-
/* harmony export */ InvalidNonce: () => (/* reexport safe */
|
|
288243
|
-
/* harmony export */ InvalidOrder: () => (/* reexport safe */
|
|
288244
|
-
/* harmony export */ MarginModeAlreadySet: () => (/* reexport safe */
|
|
288245
|
-
/* harmony export */ NetworkError: () => (/* reexport safe */
|
|
288246
|
-
/* harmony export */ NoChange: () => (/* reexport safe */
|
|
288247
|
-
/* harmony export */ NotSupported: () => (/* reexport safe */
|
|
288248
|
-
/* harmony export */ NullResponse: () => (/* reexport safe */
|
|
288249
|
-
/* harmony export */ OnMaintenance: () => (/* reexport safe */
|
|
288250
|
-
/* harmony export */ OrderImmediatelyFillable: () => (/* reexport safe */
|
|
288251
|
-
/* harmony export */ OrderNotCached: () => (/* reexport safe */
|
|
288252
|
-
/* harmony export */ OrderNotFillable: () => (/* reexport safe */
|
|
288253
|
-
/* harmony export */ OrderNotFound: () => (/* reexport safe */
|
|
288254
|
-
/* harmony export */ PermissionDenied: () => (/* reexport safe */
|
|
288255
|
-
/* harmony export */ Precise: () => (/* reexport safe */
|
|
288256
|
-
/* harmony export */ RateLimitExceeded: () => (/* reexport safe */
|
|
288257
|
-
/* harmony export */ RequestTimeout: () => (/* reexport safe */
|
|
287895
|
+
/* harmony export */ ExchangeError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.ExchangeError),
|
|
287896
|
+
/* harmony export */ ExchangeNotAvailable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.ExchangeNotAvailable),
|
|
287897
|
+
/* harmony export */ InsufficientFunds: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.InsufficientFunds),
|
|
287898
|
+
/* harmony export */ InvalidAddress: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.InvalidAddress),
|
|
287899
|
+
/* harmony export */ InvalidNonce: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.InvalidNonce),
|
|
287900
|
+
/* harmony export */ InvalidOrder: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.InvalidOrder),
|
|
287901
|
+
/* harmony export */ MarginModeAlreadySet: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.MarginModeAlreadySet),
|
|
287902
|
+
/* harmony export */ NetworkError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.NetworkError),
|
|
287903
|
+
/* harmony export */ NoChange: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.NoChange),
|
|
287904
|
+
/* harmony export */ NotSupported: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.NotSupported),
|
|
287905
|
+
/* harmony export */ NullResponse: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.NullResponse),
|
|
287906
|
+
/* harmony export */ OnMaintenance: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.OnMaintenance),
|
|
287907
|
+
/* harmony export */ OrderImmediatelyFillable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.OrderImmediatelyFillable),
|
|
287908
|
+
/* harmony export */ OrderNotCached: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.OrderNotCached),
|
|
287909
|
+
/* harmony export */ OrderNotFillable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.OrderNotFillable),
|
|
287910
|
+
/* harmony export */ OrderNotFound: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.OrderNotFound),
|
|
287911
|
+
/* harmony export */ PermissionDenied: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.PermissionDenied),
|
|
287912
|
+
/* harmony export */ Precise: () => (/* reexport safe */ _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_158__.O),
|
|
287913
|
+
/* harmony export */ RateLimitExceeded: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.RateLimitExceeded),
|
|
287914
|
+
/* harmony export */ RequestTimeout: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__.RequestTimeout),
|
|
288258
287915
|
/* harmony export */ ace: () => (/* reexport safe */ _src_ace_js__WEBPACK_IMPORTED_MODULE_1__.Z),
|
|
288259
287916
|
/* harmony export */ alpaca: () => (/* reexport safe */ _src_alpaca_js__WEBPACK_IMPORTED_MODULE_2__.Z),
|
|
288260
287917
|
/* harmony export */ ascendex: () => (/* reexport safe */ _src_ascendex_js__WEBPACK_IMPORTED_MODULE_3__.Z),
|
|
@@ -288309,11 +287966,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
288309
287966
|
/* harmony export */ delta: () => (/* reexport safe */ _src_delta_js__WEBPACK_IMPORTED_MODULE_51__.Z),
|
|
288310
287967
|
/* harmony export */ deribit: () => (/* reexport safe */ _src_deribit_js__WEBPACK_IMPORTED_MODULE_52__.Z),
|
|
288311
287968
|
/* harmony export */ digifinex: () => (/* reexport safe */ _src_digifinex_js__WEBPACK_IMPORTED_MODULE_53__.Z),
|
|
288312
|
-
/* harmony export */ errors: () => (/* reexport module object */
|
|
287969
|
+
/* harmony export */ errors: () => (/* reexport module object */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__),
|
|
288313
287970
|
/* harmony export */ exchanges: () => (/* binding */ exchanges),
|
|
288314
287971
|
/* harmony export */ exmo: () => (/* reexport safe */ _src_exmo_js__WEBPACK_IMPORTED_MODULE_54__.Z),
|
|
288315
287972
|
/* harmony export */ fmfwio: () => (/* reexport safe */ _src_fmfwio_js__WEBPACK_IMPORTED_MODULE_55__.Z),
|
|
288316
|
-
/* harmony export */ functions: () => (/* reexport module object */
|
|
287973
|
+
/* harmony export */ functions: () => (/* reexport module object */ _src_base_functions_js__WEBPACK_IMPORTED_MODULE_159__),
|
|
288317
287974
|
/* harmony export */ gate: () => (/* reexport safe */ _src_gate_js__WEBPACK_IMPORTED_MODULE_56__.Z),
|
|
288318
287975
|
/* harmony export */ gateio: () => (/* reexport safe */ _src_gateio_js__WEBPACK_IMPORTED_MODULE_57__.Z),
|
|
288319
287976
|
/* harmony export */ gemini: () => (/* reexport safe */ _src_gemini_js__WEBPACK_IMPORTED_MODULE_58__.Z),
|
|
@@ -288349,23 +288006,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
288349
288006
|
/* harmony export */ poloniexfutures: () => (/* reexport safe */ _src_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_88__.Z),
|
|
288350
288007
|
/* harmony export */ pro: () => (/* binding */ pro),
|
|
288351
288008
|
/* harmony export */ probit: () => (/* reexport safe */ _src_probit_js__WEBPACK_IMPORTED_MODULE_89__.Z),
|
|
288352
|
-
/* harmony export */
|
|
288353
|
-
/* harmony export */
|
|
288354
|
-
/* harmony export */
|
|
288355
|
-
/* harmony export */ upbit: () => (/* reexport safe */ _src_upbit_js__WEBPACK_IMPORTED_MODULE_93__.Z),
|
|
288009
|
+
/* harmony export */ timex: () => (/* reexport safe */ _src_timex_js__WEBPACK_IMPORTED_MODULE_90__.Z),
|
|
288010
|
+
/* harmony export */ tokocrypto: () => (/* reexport safe */ _src_tokocrypto_js__WEBPACK_IMPORTED_MODULE_91__.Z),
|
|
288011
|
+
/* harmony export */ upbit: () => (/* reexport safe */ _src_upbit_js__WEBPACK_IMPORTED_MODULE_92__.Z),
|
|
288356
288012
|
/* harmony export */ version: () => (/* binding */ version),
|
|
288357
|
-
/* harmony export */ wavesexchange: () => (/* reexport safe */
|
|
288358
|
-
/* harmony export */ wazirx: () => (/* reexport safe */
|
|
288359
|
-
/* harmony export */ whitebit: () => (/* reexport safe */
|
|
288360
|
-
/* harmony export */ woo: () => (/* reexport safe */
|
|
288361
|
-
/* harmony export */ yobit: () => (/* reexport safe */
|
|
288362
|
-
/* harmony export */ zaif: () => (/* reexport safe */
|
|
288363
|
-
/* harmony export */ zonda: () => (/* reexport safe */
|
|
288013
|
+
/* harmony export */ wavesexchange: () => (/* reexport safe */ _src_wavesexchange_js__WEBPACK_IMPORTED_MODULE_93__.Z),
|
|
288014
|
+
/* harmony export */ wazirx: () => (/* reexport safe */ _src_wazirx_js__WEBPACK_IMPORTED_MODULE_94__.Z),
|
|
288015
|
+
/* harmony export */ whitebit: () => (/* reexport safe */ _src_whitebit_js__WEBPACK_IMPORTED_MODULE_95__.Z),
|
|
288016
|
+
/* harmony export */ woo: () => (/* reexport safe */ _src_woo_js__WEBPACK_IMPORTED_MODULE_96__.Z),
|
|
288017
|
+
/* harmony export */ yobit: () => (/* reexport safe */ _src_yobit_js__WEBPACK_IMPORTED_MODULE_97__.Z),
|
|
288018
|
+
/* harmony export */ zaif: () => (/* reexport safe */ _src_zaif_js__WEBPACK_IMPORTED_MODULE_98__.Z),
|
|
288019
|
+
/* harmony export */ zonda: () => (/* reexport safe */ _src_zonda_js__WEBPACK_IMPORTED_MODULE_99__.Z)
|
|
288364
288020
|
/* harmony export */ });
|
|
288365
288021
|
/* harmony import */ var _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3043);
|
|
288366
|
-
/* harmony import */ var
|
|
288367
|
-
/* harmony import */ var
|
|
288368
|
-
/* harmony import */ var
|
|
288022
|
+
/* harmony import */ var _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_158__ = __webpack_require__(2194);
|
|
288023
|
+
/* harmony import */ var _src_base_functions_js__WEBPACK_IMPORTED_MODULE_159__ = __webpack_require__(7100);
|
|
288024
|
+
/* harmony import */ var _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__ = __webpack_require__(6689);
|
|
288369
288025
|
/* harmony import */ var _src_ace_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9869);
|
|
288370
288026
|
/* harmony import */ var _src_alpaca_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5660);
|
|
288371
288027
|
/* harmony import */ var _src_ascendex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9612);
|
|
@@ -288455,75 +288111,74 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
288455
288111
|
/* harmony import */ var _src_poloniex_js__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(8891);
|
|
288456
288112
|
/* harmony import */ var _src_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(6877);
|
|
288457
288113
|
/* harmony import */ var _src_probit_js__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(3657);
|
|
288458
|
-
/* harmony import */ var
|
|
288459
|
-
/* harmony import */ var
|
|
288460
|
-
/* harmony import */ var
|
|
288461
|
-
/* harmony import */ var
|
|
288462
|
-
/* harmony import */ var
|
|
288463
|
-
/* harmony import */ var
|
|
288464
|
-
/* harmony import */ var
|
|
288465
|
-
/* harmony import */ var
|
|
288466
|
-
/* harmony import */ var
|
|
288467
|
-
/* harmony import */ var
|
|
288468
|
-
/* harmony import */ var
|
|
288469
|
-
/* harmony import */ var
|
|
288470
|
-
/* harmony import */ var
|
|
288471
|
-
/* harmony import */ var
|
|
288472
|
-
/* harmony import */ var
|
|
288473
|
-
/* harmony import */ var
|
|
288474
|
-
/* harmony import */ var
|
|
288475
|
-
/* harmony import */ var
|
|
288476
|
-
/* harmony import */ var
|
|
288477
|
-
/* harmony import */ var
|
|
288478
|
-
/* harmony import */ var
|
|
288479
|
-
/* harmony import */ var
|
|
288480
|
-
/* harmony import */ var
|
|
288481
|
-
/* harmony import */ var
|
|
288482
|
-
/* harmony import */ var
|
|
288483
|
-
/* harmony import */ var
|
|
288484
|
-
/* harmony import */ var
|
|
288485
|
-
/* harmony import */ var
|
|
288486
|
-
/* harmony import */ var
|
|
288487
|
-
/* harmony import */ var
|
|
288488
|
-
/* harmony import */ var
|
|
288489
|
-
/* harmony import */ var
|
|
288490
|
-
/* harmony import */ var
|
|
288491
|
-
/* harmony import */ var
|
|
288492
|
-
/* harmony import */ var
|
|
288493
|
-
/* harmony import */ var
|
|
288494
|
-
/* harmony import */ var
|
|
288495
|
-
/* harmony import */ var
|
|
288496
|
-
/* harmony import */ var
|
|
288497
|
-
/* harmony import */ var
|
|
288498
|
-
/* harmony import */ var
|
|
288499
|
-
/* harmony import */ var
|
|
288500
|
-
/* harmony import */ var
|
|
288501
|
-
/* harmony import */ var
|
|
288502
|
-
/* harmony import */ var
|
|
288503
|
-
/* harmony import */ var
|
|
288504
|
-
/* harmony import */ var
|
|
288505
|
-
/* harmony import */ var
|
|
288506
|
-
/* harmony import */ var
|
|
288507
|
-
/* harmony import */ var
|
|
288508
|
-
/* harmony import */ var
|
|
288509
|
-
/* harmony import */ var
|
|
288510
|
-
/* harmony import */ var
|
|
288511
|
-
/* harmony import */ var
|
|
288512
|
-
/* harmony import */ var
|
|
288513
|
-
/* harmony import */ var
|
|
288514
|
-
/* harmony import */ var
|
|
288515
|
-
/* harmony import */ var
|
|
288516
|
-
/* harmony import */ var
|
|
288517
|
-
/* harmony import */ var
|
|
288518
|
-
/* harmony import */ var
|
|
288519
|
-
/* harmony import */ var
|
|
288520
|
-
/* harmony import */ var
|
|
288521
|
-
/* harmony import */ var
|
|
288522
|
-
/* harmony import */ var
|
|
288523
|
-
/* harmony import */ var
|
|
288524
|
-
/* harmony import */ var
|
|
288525
|
-
/* harmony import */ var
|
|
288526
|
-
/* harmony import */ var _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_158__ = __webpack_require__(3910);
|
|
288114
|
+
/* harmony import */ var _src_timex_js__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(1067);
|
|
288115
|
+
/* harmony import */ var _src_tokocrypto_js__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(5261);
|
|
288116
|
+
/* harmony import */ var _src_upbit_js__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(7584);
|
|
288117
|
+
/* harmony import */ var _src_wavesexchange_js__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(3853);
|
|
288118
|
+
/* harmony import */ var _src_wazirx_js__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(6536);
|
|
288119
|
+
/* harmony import */ var _src_whitebit_js__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(5467);
|
|
288120
|
+
/* harmony import */ var _src_woo_js__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(517);
|
|
288121
|
+
/* harmony import */ var _src_yobit_js__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(3850);
|
|
288122
|
+
/* harmony import */ var _src_zaif_js__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(5934);
|
|
288123
|
+
/* harmony import */ var _src_zonda_js__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(5140);
|
|
288124
|
+
/* harmony import */ var _src_pro_alpaca_js__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(2467);
|
|
288125
|
+
/* harmony import */ var _src_pro_ascendex_js__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(2383);
|
|
288126
|
+
/* harmony import */ var _src_pro_bequant_js__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(8848);
|
|
288127
|
+
/* harmony import */ var _src_pro_binance_js__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(8764);
|
|
288128
|
+
/* harmony import */ var _src_pro_binancecoinm_js__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(5078);
|
|
288129
|
+
/* harmony import */ var _src_pro_binanceus_js__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(1326);
|
|
288130
|
+
/* harmony import */ var _src_pro_binanceusdm_js__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(1230);
|
|
288131
|
+
/* harmony import */ var _src_pro_bingx_js__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(6955);
|
|
288132
|
+
/* harmony import */ var _src_pro_bitcoincom_js__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(453);
|
|
288133
|
+
/* harmony import */ var _src_pro_bitfinex_js__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(9772);
|
|
288134
|
+
/* harmony import */ var _src_pro_bitfinex2_js__WEBPACK_IMPORTED_MODULE_110__ = __webpack_require__(588);
|
|
288135
|
+
/* harmony import */ var _src_pro_bitget_js__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(1885);
|
|
288136
|
+
/* harmony import */ var _src_pro_bitmart_js__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(7504);
|
|
288137
|
+
/* harmony import */ var _src_pro_bitmex_js__WEBPACK_IMPORTED_MODULE_113__ = __webpack_require__(2302);
|
|
288138
|
+
/* harmony import */ var _src_pro_bitopro_js__WEBPACK_IMPORTED_MODULE_114__ = __webpack_require__(2191);
|
|
288139
|
+
/* harmony import */ var _src_pro_bitpanda_js__WEBPACK_IMPORTED_MODULE_115__ = __webpack_require__(1297);
|
|
288140
|
+
/* harmony import */ var _src_pro_bitrue_js__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(3005);
|
|
288141
|
+
/* harmony import */ var _src_pro_bitstamp_js__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(2317);
|
|
288142
|
+
/* harmony import */ var _src_pro_bittrex_js__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(2883);
|
|
288143
|
+
/* harmony import */ var _src_pro_bitvavo_js__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(6977);
|
|
288144
|
+
/* harmony import */ var _src_pro_blockchaincom_js__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(2519);
|
|
288145
|
+
/* harmony import */ var _src_pro_bybit_js__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(5030);
|
|
288146
|
+
/* harmony import */ var _src_pro_cex_js__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(5272);
|
|
288147
|
+
/* harmony import */ var _src_pro_coinbase_js__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(3414);
|
|
288148
|
+
/* harmony import */ var _src_pro_coinbaseprime_js__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(3848);
|
|
288149
|
+
/* harmony import */ var _src_pro_coinbasepro_js__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(8368);
|
|
288150
|
+
/* harmony import */ var _src_pro_coinex_js__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(204);
|
|
288151
|
+
/* harmony import */ var _src_pro_cryptocom_js__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(6820);
|
|
288152
|
+
/* harmony import */ var _src_pro_currencycom_js__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(2952);
|
|
288153
|
+
/* harmony import */ var _src_pro_deribit_js__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(1788);
|
|
288154
|
+
/* harmony import */ var _src_pro_exmo_js__WEBPACK_IMPORTED_MODULE_130__ = __webpack_require__(9004);
|
|
288155
|
+
/* harmony import */ var _src_pro_gate_js__WEBPACK_IMPORTED_MODULE_131__ = __webpack_require__(8335);
|
|
288156
|
+
/* harmony import */ var _src_pro_gateio_js__WEBPACK_IMPORTED_MODULE_132__ = __webpack_require__(1465);
|
|
288157
|
+
/* harmony import */ var _src_pro_gemini_js__WEBPACK_IMPORTED_MODULE_133__ = __webpack_require__(9488);
|
|
288158
|
+
/* harmony import */ var _src_pro_hitbtc_js__WEBPACK_IMPORTED_MODULE_134__ = __webpack_require__(5189);
|
|
288159
|
+
/* harmony import */ var _src_pro_hollaex_js__WEBPACK_IMPORTED_MODULE_135__ = __webpack_require__(8559);
|
|
288160
|
+
/* harmony import */ var _src_pro_htx_js__WEBPACK_IMPORTED_MODULE_136__ = __webpack_require__(7474);
|
|
288161
|
+
/* harmony import */ var _src_pro_huobi_js__WEBPACK_IMPORTED_MODULE_137__ = __webpack_require__(8384);
|
|
288162
|
+
/* harmony import */ var _src_pro_huobijp_js__WEBPACK_IMPORTED_MODULE_138__ = __webpack_require__(9021);
|
|
288163
|
+
/* harmony import */ var _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_139__ = __webpack_require__(3484);
|
|
288164
|
+
/* harmony import */ var _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_140__ = __webpack_require__(1311);
|
|
288165
|
+
/* harmony import */ var _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_141__ = __webpack_require__(736);
|
|
288166
|
+
/* harmony import */ var _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_142__ = __webpack_require__(449);
|
|
288167
|
+
/* harmony import */ var _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_143__ = __webpack_require__(2387);
|
|
288168
|
+
/* harmony import */ var _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_144__ = __webpack_require__(7181);
|
|
288169
|
+
/* harmony import */ var _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_145__ = __webpack_require__(627);
|
|
288170
|
+
/* harmony import */ var _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_146__ = __webpack_require__(6484);
|
|
288171
|
+
/* harmony import */ var _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_147__ = __webpack_require__(8080);
|
|
288172
|
+
/* harmony import */ var _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_148__ = __webpack_require__(7105);
|
|
288173
|
+
/* harmony import */ var _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_149__ = __webpack_require__(2214);
|
|
288174
|
+
/* harmony import */ var _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_150__ = __webpack_require__(4360);
|
|
288175
|
+
/* harmony import */ var _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_151__ = __webpack_require__(7924);
|
|
288176
|
+
/* harmony import */ var _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_152__ = __webpack_require__(3541);
|
|
288177
|
+
/* harmony import */ var _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_153__ = __webpack_require__(9782);
|
|
288178
|
+
/* harmony import */ var _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_154__ = __webpack_require__(7614);
|
|
288179
|
+
/* harmony import */ var _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_155__ = __webpack_require__(4828);
|
|
288180
|
+
/* harmony import */ var _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_156__ = __webpack_require__(5630);
|
|
288181
|
+
/* harmony import */ var _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_157__ = __webpack_require__(3910);
|
|
288527
288182
|
/*
|
|
288528
288183
|
|
|
288529
288184
|
MIT License
|
|
@@ -288558,7 +288213,7 @@ SOFTWARE.
|
|
|
288558
288213
|
|
|
288559
288214
|
//-----------------------------------------------------------------------------
|
|
288560
288215
|
// this is updated by vss.js when building
|
|
288561
|
-
const version = '4.1.
|
|
288216
|
+
const version = '4.1.75';
|
|
288562
288217
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
288563
288218
|
//-----------------------------------------------------------------------------
|
|
288564
288219
|
|
|
@@ -288658,7 +288313,6 @@ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion
|
|
|
288658
288313
|
|
|
288659
288314
|
|
|
288660
288315
|
|
|
288661
|
-
|
|
288662
288316
|
|
|
288663
288317
|
|
|
288664
288318
|
// pro exchanges
|
|
@@ -288810,77 +288464,76 @@ const exchanges = {
|
|
|
288810
288464
|
'poloniex': _src_poloniex_js__WEBPACK_IMPORTED_MODULE_87__/* ["default"] */ .Z,
|
|
288811
288465
|
'poloniexfutures': _src_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_88__/* ["default"] */ .Z,
|
|
288812
288466
|
'probit': _src_probit_js__WEBPACK_IMPORTED_MODULE_89__/* ["default"] */ .Z,
|
|
288813
|
-
'
|
|
288814
|
-
'
|
|
288815
|
-
'
|
|
288816
|
-
'
|
|
288817
|
-
'
|
|
288818
|
-
'
|
|
288819
|
-
'
|
|
288820
|
-
'
|
|
288821
|
-
'
|
|
288822
|
-
'
|
|
288823
|
-
'zonda': _src_zonda_js__WEBPACK_IMPORTED_MODULE_100__/* ["default"] */ .Z,
|
|
288467
|
+
'timex': _src_timex_js__WEBPACK_IMPORTED_MODULE_90__/* ["default"] */ .Z,
|
|
288468
|
+
'tokocrypto': _src_tokocrypto_js__WEBPACK_IMPORTED_MODULE_91__/* ["default"] */ .Z,
|
|
288469
|
+
'upbit': _src_upbit_js__WEBPACK_IMPORTED_MODULE_92__/* ["default"] */ .Z,
|
|
288470
|
+
'wavesexchange': _src_wavesexchange_js__WEBPACK_IMPORTED_MODULE_93__/* ["default"] */ .Z,
|
|
288471
|
+
'wazirx': _src_wazirx_js__WEBPACK_IMPORTED_MODULE_94__/* ["default"] */ .Z,
|
|
288472
|
+
'whitebit': _src_whitebit_js__WEBPACK_IMPORTED_MODULE_95__/* ["default"] */ .Z,
|
|
288473
|
+
'woo': _src_woo_js__WEBPACK_IMPORTED_MODULE_96__/* ["default"] */ .Z,
|
|
288474
|
+
'yobit': _src_yobit_js__WEBPACK_IMPORTED_MODULE_97__/* ["default"] */ .Z,
|
|
288475
|
+
'zaif': _src_zaif_js__WEBPACK_IMPORTED_MODULE_98__/* ["default"] */ .Z,
|
|
288476
|
+
'zonda': _src_zonda_js__WEBPACK_IMPORTED_MODULE_99__/* ["default"] */ .Z,
|
|
288824
288477
|
};
|
|
288825
288478
|
const pro = {
|
|
288826
|
-
'alpaca':
|
|
288827
|
-
'ascendex':
|
|
288828
|
-
'bequant':
|
|
288829
|
-
'binance':
|
|
288830
|
-
'binancecoinm':
|
|
288831
|
-
'binanceus':
|
|
288832
|
-
'binanceusdm':
|
|
288833
|
-
'bingx':
|
|
288834
|
-
'bitcoincom':
|
|
288835
|
-
'bitfinex':
|
|
288836
|
-
'bitfinex2':
|
|
288837
|
-
'bitget':
|
|
288838
|
-
'bitmart':
|
|
288839
|
-
'bitmex':
|
|
288840
|
-
'bitopro':
|
|
288841
|
-
'bitpanda':
|
|
288842
|
-
'bitrue':
|
|
288843
|
-
'bitstamp':
|
|
288844
|
-
'bittrex':
|
|
288845
|
-
'bitvavo':
|
|
288846
|
-
'blockchaincom':
|
|
288847
|
-
'bybit':
|
|
288848
|
-
'cex':
|
|
288849
|
-
'coinbase':
|
|
288850
|
-
'coinbaseprime':
|
|
288851
|
-
'coinbasepro':
|
|
288852
|
-
'coinex':
|
|
288853
|
-
'cryptocom':
|
|
288854
|
-
'currencycom':
|
|
288855
|
-
'deribit':
|
|
288856
|
-
'exmo':
|
|
288857
|
-
'gate':
|
|
288858
|
-
'gateio':
|
|
288859
|
-
'gemini':
|
|
288860
|
-
'hitbtc':
|
|
288861
|
-
'hollaex':
|
|
288862
|
-
'htx':
|
|
288863
|
-
'huobi':
|
|
288864
|
-
'huobijp':
|
|
288865
|
-
'idex':
|
|
288866
|
-
'independentreserve':
|
|
288867
|
-
'kraken':
|
|
288868
|
-
'krakenfutures':
|
|
288869
|
-
'kucoin':
|
|
288870
|
-
'kucoinfutures':
|
|
288871
|
-
'luno':
|
|
288872
|
-
'mexc':
|
|
288873
|
-
'ndax':
|
|
288874
|
-
'okcoin':
|
|
288875
|
-
'okx':
|
|
288876
|
-
'phemex':
|
|
288877
|
-
'poloniex':
|
|
288878
|
-
'poloniexfutures':
|
|
288879
|
-
'probit':
|
|
288880
|
-
'upbit':
|
|
288881
|
-
'wazirx':
|
|
288882
|
-
'whitebit':
|
|
288883
|
-
'woo':
|
|
288479
|
+
'alpaca': _src_pro_alpaca_js__WEBPACK_IMPORTED_MODULE_100__/* ["default"] */ .Z,
|
|
288480
|
+
'ascendex': _src_pro_ascendex_js__WEBPACK_IMPORTED_MODULE_101__/* ["default"] */ .Z,
|
|
288481
|
+
'bequant': _src_pro_bequant_js__WEBPACK_IMPORTED_MODULE_102__/* ["default"] */ .Z,
|
|
288482
|
+
'binance': _src_pro_binance_js__WEBPACK_IMPORTED_MODULE_103__/* ["default"] */ .Z,
|
|
288483
|
+
'binancecoinm': _src_pro_binancecoinm_js__WEBPACK_IMPORTED_MODULE_104__/* ["default"] */ .Z,
|
|
288484
|
+
'binanceus': _src_pro_binanceus_js__WEBPACK_IMPORTED_MODULE_105__/* ["default"] */ .Z,
|
|
288485
|
+
'binanceusdm': _src_pro_binanceusdm_js__WEBPACK_IMPORTED_MODULE_106__/* ["default"] */ .Z,
|
|
288486
|
+
'bingx': _src_pro_bingx_js__WEBPACK_IMPORTED_MODULE_107__/* ["default"] */ .Z,
|
|
288487
|
+
'bitcoincom': _src_pro_bitcoincom_js__WEBPACK_IMPORTED_MODULE_108__/* ["default"] */ .Z,
|
|
288488
|
+
'bitfinex': _src_pro_bitfinex_js__WEBPACK_IMPORTED_MODULE_109__/* ["default"] */ .Z,
|
|
288489
|
+
'bitfinex2': _src_pro_bitfinex2_js__WEBPACK_IMPORTED_MODULE_110__/* ["default"] */ .Z,
|
|
288490
|
+
'bitget': _src_pro_bitget_js__WEBPACK_IMPORTED_MODULE_111__/* ["default"] */ .Z,
|
|
288491
|
+
'bitmart': _src_pro_bitmart_js__WEBPACK_IMPORTED_MODULE_112__/* ["default"] */ .Z,
|
|
288492
|
+
'bitmex': _src_pro_bitmex_js__WEBPACK_IMPORTED_MODULE_113__/* ["default"] */ .Z,
|
|
288493
|
+
'bitopro': _src_pro_bitopro_js__WEBPACK_IMPORTED_MODULE_114__/* ["default"] */ .Z,
|
|
288494
|
+
'bitpanda': _src_pro_bitpanda_js__WEBPACK_IMPORTED_MODULE_115__/* ["default"] */ .Z,
|
|
288495
|
+
'bitrue': _src_pro_bitrue_js__WEBPACK_IMPORTED_MODULE_116__/* ["default"] */ .Z,
|
|
288496
|
+
'bitstamp': _src_pro_bitstamp_js__WEBPACK_IMPORTED_MODULE_117__/* ["default"] */ .Z,
|
|
288497
|
+
'bittrex': _src_pro_bittrex_js__WEBPACK_IMPORTED_MODULE_118__/* ["default"] */ .Z,
|
|
288498
|
+
'bitvavo': _src_pro_bitvavo_js__WEBPACK_IMPORTED_MODULE_119__/* ["default"] */ .Z,
|
|
288499
|
+
'blockchaincom': _src_pro_blockchaincom_js__WEBPACK_IMPORTED_MODULE_120__/* ["default"] */ .Z,
|
|
288500
|
+
'bybit': _src_pro_bybit_js__WEBPACK_IMPORTED_MODULE_121__/* ["default"] */ .Z,
|
|
288501
|
+
'cex': _src_pro_cex_js__WEBPACK_IMPORTED_MODULE_122__/* ["default"] */ .Z,
|
|
288502
|
+
'coinbase': _src_pro_coinbase_js__WEBPACK_IMPORTED_MODULE_123__/* ["default"] */ .Z,
|
|
288503
|
+
'coinbaseprime': _src_pro_coinbaseprime_js__WEBPACK_IMPORTED_MODULE_124__/* ["default"] */ .Z,
|
|
288504
|
+
'coinbasepro': _src_pro_coinbasepro_js__WEBPACK_IMPORTED_MODULE_125__/* ["default"] */ .Z,
|
|
288505
|
+
'coinex': _src_pro_coinex_js__WEBPACK_IMPORTED_MODULE_126__/* ["default"] */ .Z,
|
|
288506
|
+
'cryptocom': _src_pro_cryptocom_js__WEBPACK_IMPORTED_MODULE_127__/* ["default"] */ .Z,
|
|
288507
|
+
'currencycom': _src_pro_currencycom_js__WEBPACK_IMPORTED_MODULE_128__/* ["default"] */ .Z,
|
|
288508
|
+
'deribit': _src_pro_deribit_js__WEBPACK_IMPORTED_MODULE_129__/* ["default"] */ .Z,
|
|
288509
|
+
'exmo': _src_pro_exmo_js__WEBPACK_IMPORTED_MODULE_130__/* ["default"] */ .Z,
|
|
288510
|
+
'gate': _src_pro_gate_js__WEBPACK_IMPORTED_MODULE_131__/* ["default"] */ .Z,
|
|
288511
|
+
'gateio': _src_pro_gateio_js__WEBPACK_IMPORTED_MODULE_132__/* ["default"] */ .Z,
|
|
288512
|
+
'gemini': _src_pro_gemini_js__WEBPACK_IMPORTED_MODULE_133__/* ["default"] */ .Z,
|
|
288513
|
+
'hitbtc': _src_pro_hitbtc_js__WEBPACK_IMPORTED_MODULE_134__/* ["default"] */ .Z,
|
|
288514
|
+
'hollaex': _src_pro_hollaex_js__WEBPACK_IMPORTED_MODULE_135__/* ["default"] */ .Z,
|
|
288515
|
+
'htx': _src_pro_htx_js__WEBPACK_IMPORTED_MODULE_136__/* ["default"] */ .Z,
|
|
288516
|
+
'huobi': _src_pro_huobi_js__WEBPACK_IMPORTED_MODULE_137__/* ["default"] */ .Z,
|
|
288517
|
+
'huobijp': _src_pro_huobijp_js__WEBPACK_IMPORTED_MODULE_138__/* ["default"] */ .Z,
|
|
288518
|
+
'idex': _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_139__/* ["default"] */ .Z,
|
|
288519
|
+
'independentreserve': _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_140__/* ["default"] */ .Z,
|
|
288520
|
+
'kraken': _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_141__/* ["default"] */ .Z,
|
|
288521
|
+
'krakenfutures': _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_142__/* ["default"] */ .Z,
|
|
288522
|
+
'kucoin': _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_143__/* ["default"] */ .Z,
|
|
288523
|
+
'kucoinfutures': _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_144__/* ["default"] */ .Z,
|
|
288524
|
+
'luno': _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_145__/* ["default"] */ .Z,
|
|
288525
|
+
'mexc': _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_146__/* ["default"] */ .Z,
|
|
288526
|
+
'ndax': _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_147__/* ["default"] */ .Z,
|
|
288527
|
+
'okcoin': _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_148__/* ["default"] */ .Z,
|
|
288528
|
+
'okx': _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_149__/* ["default"] */ .Z,
|
|
288529
|
+
'phemex': _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_150__/* ["default"] */ .Z,
|
|
288530
|
+
'poloniex': _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_151__/* ["default"] */ .Z,
|
|
288531
|
+
'poloniexfutures': _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_152__/* ["default"] */ .Z,
|
|
288532
|
+
'probit': _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_153__/* ["default"] */ .Z,
|
|
288533
|
+
'upbit': _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_154__/* ["default"] */ .Z,
|
|
288534
|
+
'wazirx': _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_155__/* ["default"] */ .Z,
|
|
288535
|
+
'whitebit': _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_156__/* ["default"] */ .Z,
|
|
288536
|
+
'woo': _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_157__/* ["default"] */ .Z,
|
|
288884
288537
|
};
|
|
288885
288538
|
for (const exchange in pro) {
|
|
288886
288539
|
// const ccxtExchange = exchanges[exchange]
|
|
@@ -288893,7 +288546,7 @@ for (const exchange in pro) {
|
|
|
288893
288546
|
pro.exchanges = Object.keys(pro);
|
|
288894
288547
|
pro['Exchange'] = _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e; // now the same for rest and ts
|
|
288895
288548
|
//-----------------------------------------------------------------------------
|
|
288896
|
-
const ccxt = Object.assign({ version, Exchange: _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e, Precise:
|
|
288549
|
+
const ccxt = Object.assign({ version, Exchange: _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e, Precise: _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_158__/* .Precise */ .O, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, _src_base_functions_js__WEBPACK_IMPORTED_MODULE_159__, _src_base_errors_js__WEBPACK_IMPORTED_MODULE_160__);
|
|
288897
288550
|
|
|
288898
288551
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ccxt);
|
|
288899
288552
|
//-----------------------------------------------------------------------------
|