ccxt 4.1.53 → 4.1.55

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.
Files changed (185) hide show
  1. package/README.md +8 -7
  2. package/dist/ccxt.browser.js +2329 -818
  3. package/dist/ccxt.browser.min.js +10 -10
  4. package/dist/cjs/ccxt.js +4 -1
  5. package/dist/cjs/src/abstract/p2b.js +9 -0
  6. package/dist/cjs/src/ace.js +2 -2
  7. package/dist/cjs/src/alpaca.js +1 -1
  8. package/dist/cjs/src/base/Exchange.js +25 -62
  9. package/dist/cjs/src/base/errors.js +1 -1
  10. package/dist/cjs/src/bigone.js +1 -6
  11. package/dist/cjs/src/binance.js +10 -3
  12. package/dist/cjs/src/bingx.js +1 -1
  13. package/dist/cjs/src/bitget.js +670 -405
  14. package/dist/cjs/src/bitmart.js +29 -62
  15. package/dist/cjs/src/bitmex.js +2 -2
  16. package/dist/cjs/src/bittrex.js +1 -3
  17. package/dist/cjs/src/coinbase.js +53 -3
  18. package/dist/cjs/src/coinex.js +23 -33
  19. package/dist/cjs/src/coinone.js +2 -2
  20. package/dist/cjs/src/digifinex.js +2 -2
  21. package/dist/cjs/src/idex.js +2 -2
  22. package/dist/cjs/src/kuna.js +6 -0
  23. package/dist/cjs/src/p2b.js +1246 -0
  24. package/dist/cjs/src/phemex.js +8 -8
  25. package/dist/cjs/src/poloniex.js +3 -2
  26. package/dist/cjs/src/poloniexfutures.js +1 -1
  27. package/dist/cjs/src/pro/hitbtc.js +1 -1
  28. package/dist/cjs/src/tidex.js +2 -2
  29. package/dist/cjs/src/timex.js +1 -1
  30. package/dist/cjs/src/whitebit.js +2 -2
  31. package/js/ccxt.d.ts +5 -2
  32. package/js/ccxt.js +4 -2
  33. package/js/src/abstract/binance.d.ts +1 -0
  34. package/js/src/abstract/binancecoinm.d.ts +1 -0
  35. package/js/src/abstract/binanceus.d.ts +1 -0
  36. package/js/src/abstract/binanceusdm.d.ts +1 -0
  37. package/js/src/abstract/bitget.d.ts +495 -254
  38. package/js/src/abstract/coinbase.d.ts +2 -0
  39. package/js/src/abstract/p2b.d.ts +25 -0
  40. package/js/src/abstract/p2b.js +11 -0
  41. package/js/src/ace.d.ts +7 -7
  42. package/js/src/ace.js +2 -2
  43. package/js/src/alpaca.d.ts +4 -4
  44. package/js/src/alpaca.js +1 -1
  45. package/js/src/ascendex.d.ts +26 -26
  46. package/js/src/base/Exchange.d.ts +48 -48
  47. package/js/src/base/Exchange.js +25 -62
  48. package/js/src/base/Precise.d.ts +13 -12
  49. package/js/src/base/errorHierarchy.d.ts +10 -9
  50. package/js/src/base/errorHierarchy.js +10 -9
  51. package/js/src/base/errors.d.ts +1 -1
  52. package/js/src/base/errors.js +1 -1
  53. package/js/src/base/functions/type.d.ts +18 -18
  54. package/js/src/base/types.d.ts +27 -23
  55. package/js/src/bigone.d.ts +9 -9
  56. package/js/src/bigone.js +1 -6
  57. package/js/src/binance.d.ts +57 -100
  58. package/js/src/binance.js +10 -3
  59. package/js/src/binancecoinm.d.ts +2 -2
  60. package/js/src/binanceusdm.d.ts +2 -2
  61. package/js/src/bingx.d.ts +22 -22
  62. package/js/src/bingx.js +1 -1
  63. package/js/src/bit2c.d.ts +7 -7
  64. package/js/src/bitbank.d.ts +7 -7
  65. package/js/src/bitbns.d.ts +6 -6
  66. package/js/src/bitfinex.d.ts +12 -12
  67. package/js/src/bitfinex2.d.ts +19 -19
  68. package/js/src/bitflyer.d.ts +8 -8
  69. package/js/src/bitforex.d.ts +5 -5
  70. package/js/src/bitget.d.ts +44 -44
  71. package/js/src/bitget.js +670 -405
  72. package/js/src/bithumb.d.ts +8 -8
  73. package/js/src/bitmart.d.ts +41 -36
  74. package/js/src/bitmart.js +29 -62
  75. package/js/src/bitmex.d.ts +21 -21
  76. package/js/src/bitmex.js +2 -2
  77. package/js/src/bitopro.d.ts +10 -10
  78. package/js/src/bitpanda.d.ts +10 -10
  79. package/js/src/bitrue.d.ts +11 -11
  80. package/js/src/bitso.d.ts +9 -9
  81. package/js/src/bitstamp.d.ts +13 -13
  82. package/js/src/bittrex.d.ts +14 -14
  83. package/js/src/bittrex.js +1 -3
  84. package/js/src/bitvavo.d.ts +9 -9
  85. package/js/src/bl3p.d.ts +3 -3
  86. package/js/src/blockchaincom.d.ts +6 -6
  87. package/js/src/btcalpha.d.ts +8 -8
  88. package/js/src/btcbox.d.ts +4 -4
  89. package/js/src/btcmarkets.d.ts +7 -7
  90. package/js/src/btcturk.d.ts +7 -7
  91. package/js/src/bybit.d.ts +36 -79
  92. package/js/src/cex.d.ts +6 -6
  93. package/js/src/coinbase.d.ts +16 -15
  94. package/js/src/coinbase.js +53 -3
  95. package/js/src/coinbasepro.d.ts +10 -10
  96. package/js/src/coincheck.d.ts +5 -5
  97. package/js/src/coinex.d.ts +52 -46
  98. package/js/src/coinex.js +23 -33
  99. package/js/src/coinlist.d.ts +14 -14
  100. package/js/src/coinmate.d.ts +5 -5
  101. package/js/src/coinone.d.ts +5 -5
  102. package/js/src/coinone.js +2 -2
  103. package/js/src/coinsph.d.ts +13 -13
  104. package/js/src/coinspot.d.ts +4 -4
  105. package/js/src/cryptocom.d.ts +19 -19
  106. package/js/src/currencycom.d.ts +14 -14
  107. package/js/src/delta.d.ts +29 -72
  108. package/js/src/deribit.d.ts +21 -21
  109. package/js/src/digifinex.d.ts +39 -39
  110. package/js/src/digifinex.js +2 -2
  111. package/js/src/exmo.d.ts +15 -15
  112. package/js/src/gate.d.ts +46 -89
  113. package/js/src/gemini.d.ts +8 -8
  114. package/js/src/hitbtc.d.ts +28 -28
  115. package/js/src/hollaex.d.ts +13 -13
  116. package/js/src/htx.d.ts +38 -38
  117. package/js/src/huobijp.d.ts +10 -10
  118. package/js/src/idex.d.ts +7 -7
  119. package/js/src/idex.js +2 -2
  120. package/js/src/independentreserve.d.ts +4 -4
  121. package/js/src/indodax.d.ts +7 -7
  122. package/js/src/kraken.d.ts +17 -17
  123. package/js/src/krakenfutures.d.ts +15 -15
  124. package/js/src/kucoin.d.ts +24 -24
  125. package/js/src/kucoinfutures.d.ts +16 -16
  126. package/js/src/kuna.d.ts +11 -11
  127. package/js/src/kuna.js +2 -2
  128. package/js/src/latoken.d.ts +11 -11
  129. package/js/src/lbank.d.ts +11 -11
  130. package/js/src/luno.d.ts +7 -7
  131. package/js/src/lykke.d.ts +6 -6
  132. package/js/src/mercado.d.ts +6 -6
  133. package/js/src/mexc.d.ts +25 -25
  134. package/js/src/ndax.d.ts +10 -10
  135. package/js/src/novadax.d.ts +13 -13
  136. package/js/src/oceanex.d.ts +8 -8
  137. package/js/src/okcoin.d.ts +16 -16
  138. package/js/src/okx.d.ts +50 -93
  139. package/js/src/p2b.d.ts +35 -0
  140. package/js/src/p2b.js +1246 -0
  141. package/js/src/paymium.d.ts +10 -10
  142. package/js/src/phemex.d.ts +34 -34
  143. package/js/src/phemex.js +8 -8
  144. package/js/src/poloniex.d.ts +14 -14
  145. package/js/src/poloniex.js +3 -2
  146. package/js/src/poloniexfutures.d.ts +10 -10
  147. package/js/src/poloniexfutures.js +1 -1
  148. package/js/src/pro/binance.d.ts +5 -5
  149. package/js/src/pro/bitget.d.ts +3 -3
  150. package/js/src/pro/bitpanda.d.ts +3 -3
  151. package/js/src/pro/bybit.d.ts +4 -4
  152. package/js/src/pro/cex.d.ts +2 -2
  153. package/js/src/pro/coinbasepro.d.ts +4 -4
  154. package/js/src/pro/coinex.d.ts +2 -2
  155. package/js/src/pro/cryptocom.d.ts +3 -3
  156. package/js/src/pro/currencycom.d.ts +1 -1
  157. package/js/src/pro/gate.d.ts +4 -4
  158. package/js/src/pro/hitbtc.d.ts +2 -2
  159. package/js/src/pro/hitbtc.js +1 -1
  160. package/js/src/pro/htx.d.ts +2 -2
  161. package/js/src/pro/kraken.d.ts +1 -1
  162. package/js/src/pro/krakenfutures.d.ts +3 -3
  163. package/js/src/pro/kucoin.d.ts +2 -2
  164. package/js/src/pro/okx.d.ts +4 -4
  165. package/js/src/pro/poloniex.d.ts +2 -2
  166. package/js/src/pro/poloniexfutures.d.ts +1 -1
  167. package/js/src/pro/wazirx.d.ts +2 -2
  168. package/js/src/pro/woo.d.ts +2 -2
  169. package/js/src/probit.d.ts +13 -13
  170. package/js/src/tidex.d.ts +7 -7
  171. package/js/src/tidex.js +2 -2
  172. package/js/src/timex.d.ts +13 -13
  173. package/js/src/timex.js +1 -1
  174. package/js/src/tokocrypto.d.ts +8 -8
  175. package/js/src/upbit.d.ts +21 -21
  176. package/js/src/wavesexchange.d.ts +10 -10
  177. package/js/src/wazirx.d.ts +7 -7
  178. package/js/src/whitebit.d.ts +17 -17
  179. package/js/src/whitebit.js +2 -2
  180. package/js/src/woo.d.ts +23 -23
  181. package/js/src/yobit.d.ts +6 -6
  182. package/js/src/zaif.d.ts +6 -6
  183. package/js/src/zonda.d.ts +16 -16
  184. package/package.json +11 -6
  185. package/skip-tests.json +7 -0
@@ -3276,7 +3276,7 @@ class bitmart extends bitmart$1 {
3276
3276
  'info': info,
3277
3277
  };
3278
3278
  }
3279
- async fetchBorrowRate(code, params = {}) {
3279
+ async fetchIsolatedBorrowRate(symbol, params = {}) {
3280
3280
  /**
3281
3281
  * @method
3282
3282
  * @name bitmart#fetchBorrowRate
@@ -3288,17 +3288,8 @@ class bitmart extends bitmart$1 {
3288
3288
  */
3289
3289
  await this.loadMarkets();
3290
3290
  let market = undefined;
3291
- if (code in this.markets) {
3292
- market = this.market(code);
3293
- }
3294
- else {
3295
- const defaultSettle = this.safeString(this.options, 'defaultSettle', 'USDT');
3296
- if (code === 'USDT') {
3297
- market = this.market('BTC' + '/' + defaultSettle);
3298
- }
3299
- else {
3300
- market = this.market(code + '/' + defaultSettle);
3301
- }
3291
+ if (symbol !== undefined) {
3292
+ market = this.market(symbol);
3302
3293
  }
3303
3294
  const request = {
3304
3295
  'symbol': market['id'],
@@ -3338,10 +3329,10 @@ class bitmart extends bitmart$1 {
3338
3329
  //
3339
3330
  const data = this.safeValue(response, 'data', {});
3340
3331
  const symbols = this.safeValue(data, 'symbols', []);
3341
- const currency = (code === 'USDT') ? market['quote'] : market['base'];
3342
- return this.parseBorrowRate(symbols, currency);
3332
+ const borrowRate = this.safeValue(symbols, 0);
3333
+ return this.parseIsolatedBorrowRate(borrowRate, market);
3343
3334
  }
3344
- parseBorrowRate(info, currency = undefined) {
3335
+ parseIsolatedBorrowRate(info, market = undefined) {
3345
3336
  //
3346
3337
  // {
3347
3338
  // "symbol": "BTC_USDT",
@@ -3365,18 +3356,29 @@ class bitmart extends bitmart$1 {
3365
3356
  // }
3366
3357
  // }
3367
3358
  //
3368
- const timestamp = this.milliseconds();
3369
- const currencyData = (currency === 'USDT') ? this.safeValue(info[0], 'quote', {}) : this.safeValue(info[0], 'base', {});
3359
+ const marketId = this.safeString(info, 'symbol');
3360
+ const symbol = this.safeSymbol(marketId, market);
3361
+ const baseData = this.safeValue(info, 'base');
3362
+ const quoteData = this.safeValue(info, 'quote');
3363
+ const baseId = this.safeString(baseData, 'currency');
3364
+ const quoteId = this.safeString(quoteData, 'currency');
3365
+ const base = this.safeCurrencyCode(baseId);
3366
+ const quote = this.safeCurrencyCode(quoteId);
3367
+ const baseRate = this.safeNumber(baseData, 'hourly_interest');
3368
+ const quoteRate = this.safeNumber(quoteData, 'hourly_interest');
3370
3369
  return {
3371
- 'currency': this.safeCurrencyCode(currency),
3372
- 'rate': this.safeNumber(currencyData, 'hourly_interest'),
3370
+ 'symbol': symbol,
3371
+ 'base': base,
3372
+ 'baseRate': baseRate,
3373
+ 'quote': quote,
3374
+ 'quoteRate': quoteRate,
3373
3375
  'period': 3600000,
3374
- 'timestamp': timestamp,
3375
- 'datetime': this.iso8601(timestamp),
3376
+ 'timestamp': undefined,
3377
+ 'datetime': undefined,
3376
3378
  'info': info,
3377
3379
  };
3378
3380
  }
3379
- async fetchBorrowRates(params = {}) {
3381
+ async fetchIsolatedBorrowRates(params = {}) {
3380
3382
  /**
3381
3383
  * @method
3382
3384
  * @name bitmart#fetchBorrowRates
@@ -3421,47 +3423,12 @@ class bitmart extends bitmart$1 {
3421
3423
  //
3422
3424
  const data = this.safeValue(response, 'data', {});
3423
3425
  const symbols = this.safeValue(data, 'symbols', []);
3424
- return this.parseBorrowRates(symbols, undefined);
3425
- }
3426
- parseBorrowRates(info, codeKey) {
3427
- //
3428
- // {
3429
- // "symbol": "BTC_USDT",
3430
- // "max_leverage": "5",
3431
- // "symbol_enabled": true,
3432
- // "base": {
3433
- // "currency": "BTC",
3434
- // "daily_interest": "0.00055000",
3435
- // "hourly_interest": "0.00002291",
3436
- // "max_borrow_amount": "2.00000000",
3437
- // "min_borrow_amount": "0.00000001",
3438
- // "borrowable_amount": "0.00670810"
3439
- // },
3440
- // "quote": {
3441
- // "currency": "USDT",
3442
- // "daily_interest": "0.00055000",
3443
- // "hourly_interest": "0.00002291",
3444
- // "max_borrow_amount": "50000.00000000",
3445
- // "min_borrow_amount": "0.00000001",
3446
- // "borrowable_amount": "135.12575038"
3447
- // }
3448
- // }
3449
- //
3450
- const timestamp = this.milliseconds();
3451
- const rates = [];
3452
- for (let i = 0; i < info.length; i++) {
3453
- const entry = info[i];
3454
- const base = this.safeValue(entry, 'base', {});
3455
- rates.push({
3456
- 'currency': this.safeCurrencyCode(this.safeString(base, 'currency')),
3457
- 'rate': this.safeNumber(base, 'hourly_interest'),
3458
- 'period': 3600000,
3459
- 'timestamp': timestamp,
3460
- 'datetime': this.iso8601(timestamp),
3461
- 'info': entry,
3462
- });
3426
+ const result = [];
3427
+ for (let i = 0; i < symbols.length; i++) {
3428
+ const symbol = this.safeValue(symbols, i);
3429
+ result.push(this.parseIsolatedBorrowRate(symbol));
3463
3430
  }
3464
- return rates;
3431
+ return result;
3465
3432
  }
3466
3433
  async transfer(code, amount, fromAccount, toAccount, params = {}) {
3467
3434
  /**
@@ -48,8 +48,8 @@ class bitmex extends bitmex$1 {
48
48
  'fetchDepositAddresses': false,
49
49
  'fetchDepositAddressesByNetwork': false,
50
50
  'fetchDepositsWithdrawals': 'emulated',
51
- 'fetchDepositWithdrawalFee': 'emulated',
52
- 'fetchDepositWithdrawalFees': true,
51
+ 'fetchDepositWithdrawFee': 'emulated',
52
+ 'fetchDepositWithdrawFees': true,
53
53
  'fetchFundingHistory': false,
54
54
  'fetchFundingRate': false,
55
55
  'fetchFundingRateHistory': true,
@@ -1897,12 +1897,10 @@ class bittrex extends bittrex$1 {
1897
1897
  let market = undefined;
1898
1898
  if (symbol !== undefined) {
1899
1899
  market = this.market(symbol);
1900
- symbol = market['symbol'];
1901
1900
  request['marketSymbol'] = market['id'];
1902
1901
  }
1903
1902
  const response = await this.privateGetExecutions(this.extend(request, params));
1904
- const trades = this.parseTrades(response, market, since, limit);
1905
- return trades;
1903
+ return this.parseTrades(response, market, since, limit);
1906
1904
  }
1907
1905
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1908
1906
  /**
@@ -46,6 +46,7 @@ class coinbase extends coinbase$1 {
46
46
  'createStopLimitOrder': true,
47
47
  'createStopMarketOrder': false,
48
48
  'createStopOrder': true,
49
+ 'editOrder': true,
49
50
  'fetchAccounts': true,
50
51
  'fetchBalance': true,
51
52
  'fetchBidsAsks': true,
@@ -197,6 +198,8 @@ class coinbase extends coinbase$1 {
197
198
  'post': [
198
199
  'brokerage/orders',
199
200
  'brokerage/orders/batch_cancel',
201
+ 'brokerage/orders/edit',
202
+ 'brokerage/orders/edit_preview',
200
203
  ],
201
204
  },
202
205
  },
@@ -669,7 +672,7 @@ class coinbase extends coinbase$1 {
669
672
  };
670
673
  return this.safeString(statuses, status, status);
671
674
  }
672
- parseTransaction(transaction, market = undefined) {
675
+ parseTransaction(transaction, currency = undefined) {
673
676
  //
674
677
  // fiat deposit
675
678
  //
@@ -741,7 +744,7 @@ class coinbase extends coinbase$1 {
741
744
  const type = this.safeString(transaction, 'resource');
742
745
  const amount = this.safeNumber(subtotalObject, 'amount');
743
746
  const currencyId = this.safeString(subtotalObject, 'currency');
744
- const currency = this.safeCurrencyCode(currencyId);
747
+ const code = this.safeCurrencyCode(currencyId, currency);
745
748
  const feeCost = this.safeNumber(feeObject, 'amount');
746
749
  const feeCurrencyId = this.safeString(feeObject, 'currency');
747
750
  const feeCurrency = this.safeCurrencyCode(feeCurrencyId);
@@ -769,7 +772,7 @@ class coinbase extends coinbase$1 {
769
772
  'tagFrom': undefined,
770
773
  'type': type,
771
774
  'amount': amount,
772
- 'currency': currency,
775
+ 'currency': code,
773
776
  'status': status,
774
777
  'updated': updated,
775
778
  'fee': fee,
@@ -2360,6 +2363,53 @@ class coinbase extends coinbase$1 {
2360
2363
  }
2361
2364
  return this.parseOrders(orders, market);
2362
2365
  }
2366
+ async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
2367
+ /**
2368
+ * @method
2369
+ * @name coinbase#editOrder
2370
+ * @description edit a trade order
2371
+ * @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_editorder
2372
+ * @param {string} id cancel order id
2373
+ * @param {string} symbol unified symbol of the market to create an order in
2374
+ * @param {string} type 'market' or 'limit'
2375
+ * @param {string} side 'buy' or 'sell'
2376
+ * @param {float} amount how much of currency you want to trade in units of base currency
2377
+ * @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
2378
+ * @param {object} [params] extra parameters specific to the coinbase api endpoint
2379
+ * @param {boolean} [params.preview] default to false, wether to use the test/preview endpoint or not
2380
+ * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2381
+ */
2382
+ await this.loadMarkets();
2383
+ const market = this.market(symbol);
2384
+ const request = {
2385
+ 'order_id': id,
2386
+ };
2387
+ if (amount !== undefined) {
2388
+ request['size'] = this.amountToPrecision(symbol, amount);
2389
+ }
2390
+ if (price !== undefined) {
2391
+ request['price'] = this.priceToPrecision(symbol, price);
2392
+ }
2393
+ const preview = this.safeValue2(params, 'preview', 'test', false);
2394
+ let response = undefined;
2395
+ if (preview) {
2396
+ params = this.omit(params, ['preview', 'test']);
2397
+ response = await this.v3PrivatePostBrokerageOrdersEditPreview(this.extend(request, params));
2398
+ }
2399
+ else {
2400
+ response = await this.v3PrivatePostBrokerageOrdersEdit(this.extend(request, params));
2401
+ }
2402
+ //
2403
+ // {
2404
+ // "success": true,
2405
+ // "errors": {
2406
+ // "edit_failure_reason": "UNKNOWN_EDIT_ORDER_FAILURE_REASON",
2407
+ // "preview_failure_reason": "UNKNOWN_PREVIEW_FAILURE_REASON"
2408
+ // }
2409
+ // }
2410
+ //
2411
+ return this.parseOrder(response, market);
2412
+ }
2363
2413
  async fetchOrder(id, symbol = undefined, params = {}) {
2364
2414
  /**
2365
2415
  * @method
@@ -58,7 +58,7 @@ class coinex extends coinex$1 {
58
58
  'fetchDepositAddresses': false,
59
59
  'fetchDeposits': true,
60
60
  'fetchDepositWithdrawFees': true,
61
- 'fetchDepsoitWithdrawFee': 'emulated',
61
+ 'fetchDepositWithdrawFee': 'emulated',
62
62
  'fetchFundingHistory': true,
63
63
  'fetchFundingRate': true,
64
64
  'fetchFundingRateHistory': true,
@@ -4383,7 +4383,7 @@ class coinex extends coinex$1 {
4383
4383
  }
4384
4384
  return this.parseTransactions(data, currency, since, limit);
4385
4385
  }
4386
- parseBorrowRate(info, currency = undefined) {
4386
+ parseBorrowRate(info, market = undefined) {
4387
4387
  //
4388
4388
  // {
4389
4389
  // "market": "BTCUSDT",
@@ -4400,18 +4400,25 @@ class coinex extends coinex$1 {
4400
4400
  // }
4401
4401
  // },
4402
4402
  //
4403
- const timestamp = this.milliseconds();
4404
- const baseCurrencyData = this.safeValue(info, currency, {});
4403
+ const marketId = this.safeString(info, 'market');
4404
+ market = this.safeMarket(marketId, market, undefined, 'spot');
4405
+ const baseInfo = this.safeValue(info, market['baseId']);
4406
+ const baseRate = this.safeNumber(baseInfo, 'day_rate');
4407
+ const quoteInfo = this.safeValue(info, market['quoteId']);
4408
+ const quoteRate = this.safeNumber(quoteInfo, 'day_rate');
4405
4409
  return {
4406
- 'currency': this.safeCurrencyCode(currency),
4407
- 'rate': this.safeNumber(baseCurrencyData, 'day_rate'),
4410
+ 'symbol': market['symbol'],
4411
+ 'base': market['base'],
4412
+ 'baseRate': baseRate,
4413
+ 'quote': market['quote'],
4414
+ 'quoteRate': quoteRate,
4408
4415
  'period': 86400000,
4409
- 'timestamp': timestamp,
4410
- 'datetime': this.iso8601(timestamp),
4416
+ 'timestamp': undefined,
4417
+ 'datetime': undefined,
4411
4418
  'info': info,
4412
4419
  };
4413
4420
  }
4414
- async fetchBorrowRate(code, params = {}) {
4421
+ async fetchIsolatedBorrowRate(symbol, params = {}) {
4415
4422
  /**
4416
4423
  * @method
4417
4424
  * @name coinex#fetchBorrowRate
@@ -4422,16 +4429,11 @@ class coinex extends coinex$1 {
4422
4429
  */
4423
4430
  await this.loadMarkets();
4424
4431
  let market = undefined;
4425
- if (code in this.markets) {
4426
- market = this.market(code);
4427
- }
4428
- else {
4429
- const defaultSettle = this.safeString(this.options, 'defaultSettle', 'USDT');
4430
- market = this.market(code + '/' + defaultSettle);
4432
+ const request = {};
4433
+ if (symbol !== undefined) {
4434
+ market = this.market(symbol);
4435
+ request['market'] = market['id'];
4431
4436
  }
4432
- const request = {
4433
- 'market': market['id'],
4434
- };
4435
4437
  const response = await this.privateGetMarginConfig(this.extend(request, params));
4436
4438
  //
4437
4439
  // {
@@ -4454,9 +4456,9 @@ class coinex extends coinex$1 {
4454
4456
  // }
4455
4457
  //
4456
4458
  const data = this.safeValue(response, 'data', {});
4457
- return this.parseBorrowRate(data, market['base']);
4459
+ return this.parseBorrowRate(data, market);
4458
4460
  }
4459
- async fetchBorrowRates(params = {}) {
4461
+ async fetchIsolatedBorrowRates(params = {}) {
4460
4462
  /**
4461
4463
  * @method
4462
4464
  * @name coinex#fetchBorrowRates
@@ -4488,22 +4490,10 @@ class coinex extends coinex$1 {
4488
4490
  // "message": "Success"
4489
4491
  // }
4490
4492
  //
4491
- const timestamp = this.milliseconds();
4492
4493
  const data = this.safeValue(response, 'data', {});
4493
4494
  const rates = [];
4494
4495
  for (let i = 0; i < data.length; i++) {
4495
- const entry = data[i];
4496
- const symbol = this.safeString(entry, 'market');
4497
- const market = this.safeMarket(symbol, undefined, undefined, 'spot');
4498
- const currencyData = this.safeValue(entry, market['base']);
4499
- rates.push({
4500
- 'currency': market['base'],
4501
- 'rate': this.safeNumber(currencyData, 'day_rate'),
4502
- 'period': 86400000,
4503
- 'timestamp': timestamp,
4504
- 'datetime': this.iso8601(timestamp),
4505
- 'info': entry,
4506
- });
4496
+ rates.push(this.parseBorrowRate(data[i]));
4507
4497
  }
4508
4498
  return rates;
4509
4499
  }
@@ -625,10 +625,10 @@ class coinone extends coinone$1 {
625
625
  let base = undefined;
626
626
  let quote = undefined;
627
627
  if (baseId !== undefined) {
628
- base = this.safeCurrencyCode(baseId, this.safeString(market, 'base'));
628
+ base = this.safeCurrencyCode(baseId);
629
629
  }
630
630
  if (quoteId !== undefined) {
631
- quote = this.safeCurrencyCode(quoteId, this.safeString(market, 'quote'));
631
+ quote = this.safeCurrencyCode(quoteId);
632
632
  }
633
633
  let symbol = undefined;
634
634
  if ((base !== undefined) && (quote !== undefined)) {
@@ -3023,7 +3023,7 @@ class digifinex extends digifinex$1 {
3023
3023
  result = entry;
3024
3024
  }
3025
3025
  }
3026
- const currency = this.safeString(result, 'currency');
3026
+ const currency = this.currency(code);
3027
3027
  return this.parseBorrowRate(result, currency);
3028
3028
  }
3029
3029
  async fetchBorrowRates(params = {}) {
@@ -3090,7 +3090,7 @@ class digifinex extends digifinex$1 {
3090
3090
  const item = info[i];
3091
3091
  const currency = this.safeString(item, codeKey);
3092
3092
  const code = this.safeCurrencyCode(currency);
3093
- const borrowRate = this.parseBorrowRate(item, currency);
3093
+ const borrowRate = this.parseBorrowRate(item);
3094
3094
  result[code] = borrowRate;
3095
3095
  }
3096
3096
  return result;
@@ -1487,7 +1487,7 @@ class idex extends idex$1 {
1487
1487
  'depositId': id,
1488
1488
  };
1489
1489
  const response = await this.privateGetDeposits(this.extend(request, params));
1490
- return this.parseTransaction(response, code);
1490
+ return this.parseTransaction(response);
1491
1491
  }
1492
1492
  async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
1493
1493
  /**
@@ -1537,7 +1537,7 @@ class idex extends idex$1 {
1537
1537
  'withdrawalId': id,
1538
1538
  };
1539
1539
  const response = await this.privateGetWithdrawals(this.extend(request, params));
1540
- return this.parseTransaction(response, code);
1540
+ return this.parseTransaction(response);
1541
1541
  }
1542
1542
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
1543
1543
  /**
@@ -1461,6 +1461,9 @@ class kuna extends kuna$1 {
1461
1461
  const until = this.safeInteger(params, 'until');
1462
1462
  params = this.omit(params, 'until');
1463
1463
  let currency = undefined;
1464
+ if (code !== undefined) {
1465
+ currency = this.currency(code);
1466
+ }
1464
1467
  const request = {};
1465
1468
  if (code !== undefined) {
1466
1469
  request['currency'] = code;
@@ -1652,6 +1655,9 @@ class kuna extends kuna$1 {
1652
1655
  const until = this.safeInteger(params, 'until');
1653
1656
  params = this.omit(params, 'until');
1654
1657
  let currency = undefined;
1658
+ if (code !== undefined) {
1659
+ currency = this.currency(code);
1660
+ }
1655
1661
  const request = {};
1656
1662
  if (code !== undefined) {
1657
1663
  request['currency'] = code;