ccxt 4.2.44 → 4.2.46

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 (92) hide show
  1. package/CHANGELOG.md +3099 -8415
  2. package/README.md +4 -4
  3. package/change.sh +4 -2
  4. package/dist/ccxt.browser.js +1242 -195
  5. package/dist/ccxt.browser.min.js +7 -7
  6. package/dist/cjs/ccxt.js +1 -1
  7. package/dist/cjs/src/base/Exchange.js +48 -0
  8. package/dist/cjs/src/base/ws/Cache.js +13 -5
  9. package/dist/cjs/src/base/ws/OrderBook.js +2 -2
  10. package/dist/cjs/src/binance.js +407 -21
  11. package/dist/cjs/src/bingx.js +43 -5
  12. package/dist/cjs/src/bitfinex2.js +1 -0
  13. package/dist/cjs/src/bithumb.js +5 -0
  14. package/dist/cjs/src/bitstamp.js +1 -1
  15. package/dist/cjs/src/btcturk.js +11 -0
  16. package/dist/cjs/src/bybit.js +96 -43
  17. package/dist/cjs/src/coinbase.js +228 -38
  18. package/dist/cjs/src/coincheck.js +11 -0
  19. package/dist/cjs/src/coinmate.js +114 -1
  20. package/dist/cjs/src/coinspot.js +7 -0
  21. package/dist/cjs/src/cryptocom.js +2 -2
  22. package/dist/cjs/src/deribit.js +1 -1
  23. package/dist/cjs/src/hitbtc.js +2 -0
  24. package/dist/cjs/src/idex.js +60 -1
  25. package/dist/cjs/src/latoken.js +3 -0
  26. package/dist/cjs/src/mercado.js +3 -0
  27. package/dist/cjs/src/oceanex.js +3 -0
  28. package/dist/cjs/src/okx.js +1 -0
  29. package/dist/cjs/src/pro/bitget.js +12 -8
  30. package/dist/cjs/src/pro/bitmart.js +11 -11
  31. package/dist/cjs/src/pro/bitmex.js +4 -4
  32. package/dist/cjs/src/pro/cex.js +2 -2
  33. package/dist/cjs/src/pro/gate.js +76 -42
  34. package/dist/cjs/src/pro/gemini.js +4 -3
  35. package/dist/cjs/src/pro/hitbtc.js +1 -0
  36. package/dist/cjs/src/probit.js +3 -3
  37. package/dist/cjs/src/timex.js +65 -0
  38. package/js/ccxt.d.ts +1 -1
  39. package/js/ccxt.js +1 -1
  40. package/js/src/abstract/bequant.d.ts +2 -0
  41. package/js/src/abstract/bitcoincom.d.ts +2 -0
  42. package/js/src/abstract/bithumb.d.ts +5 -0
  43. package/js/src/abstract/coinbase.d.ts +1 -0
  44. package/js/src/abstract/coinmate.d.ts +12 -0
  45. package/js/src/abstract/fmfwio.d.ts +2 -0
  46. package/js/src/abstract/hitbtc.d.ts +2 -0
  47. package/js/src/abstract/hitbtc3.d.ts +2 -0
  48. package/js/src/abstract/okx.d.ts +1 -0
  49. package/js/src/base/Exchange.d.ts +12 -6
  50. package/js/src/base/Exchange.js +48 -0
  51. package/js/src/base/ws/Cache.d.ts +5 -1
  52. package/js/src/base/ws/Cache.js +13 -5
  53. package/js/src/base/ws/OrderBook.d.ts +5 -1
  54. package/js/src/base/ws/OrderBook.js +3 -3
  55. package/js/src/binance.d.ts +2 -1
  56. package/js/src/binance.js +407 -21
  57. package/js/src/bingx.d.ts +2 -1
  58. package/js/src/bingx.js +43 -5
  59. package/js/src/bitfinex2.js +1 -0
  60. package/js/src/bithumb.js +5 -0
  61. package/js/src/bitstamp.js +1 -1
  62. package/js/src/btcturk.js +11 -0
  63. package/js/src/bybit.d.ts +4 -1
  64. package/js/src/bybit.js +96 -43
  65. package/js/src/coinbase.d.ts +10 -4
  66. package/js/src/coinbase.js +228 -38
  67. package/js/src/coincheck.js +11 -0
  68. package/js/src/coinmate.d.ts +3 -1
  69. package/js/src/coinmate.js +114 -1
  70. package/js/src/coinspot.js +7 -0
  71. package/js/src/cryptocom.js +2 -2
  72. package/js/src/deribit.js +1 -1
  73. package/js/src/hitbtc.js +2 -0
  74. package/js/src/idex.d.ts +14 -0
  75. package/js/src/idex.js +60 -1
  76. package/js/src/latoken.js +3 -0
  77. package/js/src/mercado.js +3 -0
  78. package/js/src/oceanex.js +3 -0
  79. package/js/src/okx.js +1 -0
  80. package/js/src/pro/bitget.js +12 -8
  81. package/js/src/pro/bitmart.js +11 -11
  82. package/js/src/pro/bitmex.js +4 -4
  83. package/js/src/pro/cex.js +2 -2
  84. package/js/src/pro/gate.d.ts +4 -0
  85. package/js/src/pro/gate.js +76 -42
  86. package/js/src/pro/gemini.js +4 -3
  87. package/js/src/pro/hitbtc.js +1 -0
  88. package/js/src/probit.js +3 -3
  89. package/js/src/timex.d.ts +14 -0
  90. package/js/src/timex.js +65 -0
  91. package/package.json +1 -1
  92. package/skip-tests.json +4 -0
@@ -7096,6 +7096,7 @@ class Exchange {
7096
7096
  this.balance = {};
7097
7097
  this.orderbooks = {};
7098
7098
  this.tickers = {};
7099
+ this.bidsasks = {};
7099
7100
  this.orders = undefined;
7100
7101
  this.triggerOrders = undefined;
7101
7102
  this.transactions = {};
@@ -10463,12 +10464,46 @@ class Exchange {
10463
10464
  const market = this.market(symbol);
10464
10465
  return this.safeString(market, 'symbol', symbol);
10465
10466
  }
10467
+ handleParamString(params, paramName, defaultValue = undefined) {
10468
+ const value = this.safeString(params, paramName, defaultValue);
10469
+ if (value !== undefined) {
10470
+ params = this.omit(params, paramName);
10471
+ }
10472
+ return [value, params];
10473
+ }
10466
10474
  resolvePath(path, params) {
10467
10475
  return [
10468
10476
  this.implodeParams(path, params),
10469
10477
  this.omit(params, this.extractParams(path)),
10470
10478
  ];
10471
10479
  }
10480
+ getListFromObjectValues(objects, key) {
10481
+ const newArray = this.toArray(objects);
10482
+ const results = [];
10483
+ for (let i = 0; i < newArray.length; i++) {
10484
+ results.push(newArray[i][key]);
10485
+ }
10486
+ return results;
10487
+ }
10488
+ getSymbolsForMarketType(marketType = undefined, subType = undefined, symbolWithActiveStatus = true, symbolWithUnknownStatus = true) {
10489
+ let filteredMarkets = this.markets;
10490
+ if (marketType !== undefined) {
10491
+ filteredMarkets = this.filterBy(filteredMarkets, 'type', marketType);
10492
+ }
10493
+ if (subType !== undefined) {
10494
+ this.checkRequiredArgument('getSymbolsForMarketType', subType, 'subType', ['linear', 'inverse', 'quanto']);
10495
+ filteredMarkets = this.filterBy(filteredMarkets, 'subType', subType);
10496
+ }
10497
+ const activeStatuses = [];
10498
+ if (symbolWithActiveStatus) {
10499
+ activeStatuses.push(true);
10500
+ }
10501
+ if (symbolWithUnknownStatus) {
10502
+ activeStatuses.push(undefined);
10503
+ }
10504
+ filteredMarkets = this.filterByArray(filteredMarkets, 'active', activeStatuses, false);
10505
+ return this.getListFromObjectValues(filteredMarkets, 'symbol');
10506
+ }
10472
10507
  filterByArray(objects, key, values = undefined, indexed = true) {
10473
10508
  objects = this.toArray(objects);
10474
10509
  // return all of them if no values were passed
@@ -11394,6 +11429,19 @@ class Exchange {
11394
11429
  return depositAddress;
11395
11430
  }
11396
11431
  }
11432
+ else if (this.has['fetchDepositAddressesByNetwork']) {
11433
+ const network = this.safeString(params, 'network');
11434
+ params = this.omit(params, 'network');
11435
+ const addressStructures = await this.fetchDepositAddressesByNetwork(code, params);
11436
+ if (network !== undefined) {
11437
+ return this.safeDict(addressStructures, network);
11438
+ }
11439
+ else {
11440
+ const keys = Object.keys(addressStructures);
11441
+ const key = this.safeString(keys, 0);
11442
+ return this.safeDict(addressStructures, key);
11443
+ }
11444
+ }
11397
11445
  else {
11398
11446
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchDepositAddress() is not supported yet');
11399
11447
  }
@@ -14626,6 +14674,7 @@ class BaseCache extends Array {
14626
14674
  class ArrayCache extends BaseCache {
14627
14675
  constructor(maxSize = undefined) {
14628
14676
  super(maxSize);
14677
+ this.hashmap = {};
14629
14678
  Object.defineProperty(this, 'nestedNewUpdatesBySymbol', {
14630
14679
  __proto__: null,
14631
14680
  value: false,
@@ -14651,6 +14700,12 @@ class ArrayCache extends BaseCache {
14651
14700
  value: false,
14652
14701
  writable: true,
14653
14702
  });
14703
+ Object.defineProperty(this, 'hashmap', {
14704
+ __proto__: null,
14705
+ value: {},
14706
+ writable: true,
14707
+ enumerable: false,
14708
+ });
14654
14709
  }
14655
14710
  getLimit(symbol, limit) {
14656
14711
  let newUpdatesValue = undefined;
@@ -14730,6 +14785,7 @@ class ArrayCacheByTimestamp extends BaseCache {
14730
14785
  if (item[0] in this.hashmap) {
14731
14786
  const reference = this.hashmap[item[0]];
14732
14787
  if (reference !== item) {
14788
+ // eslint-disable-next-line
14733
14789
  for (const prop in item) {
14734
14790
  reference[prop] = item[prop];
14735
14791
  }
@@ -14755,11 +14811,11 @@ class ArrayCacheBySymbolById extends ArrayCache {
14755
14811
  constructor(maxSize = undefined) {
14756
14812
  super(maxSize);
14757
14813
  this.nestedNewUpdatesBySymbol = true;
14758
- Object.defineProperty(this, 'hashmap', {
14759
- __proto__: null,
14760
- value: {},
14761
- writable: true,
14762
- });
14814
+ // Object.defineProperty (this, 'hashmap', {
14815
+ // __proto__: null, // make it invisible
14816
+ // value: {},
14817
+ // writable: true,
14818
+ // })
14763
14819
  }
14764
14820
  append(item) {
14765
14821
  const byId = this.hashmap[item.symbol] = this.hashmap[item.symbol] || {};
@@ -15222,18 +15278,18 @@ Future.race = (futures) => wrapFuture(Promise.race(futures));
15222
15278
  /* harmony import */ var _base_functions_generic_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(927);
15223
15279
  /* harmony import */ var _OrderBookSide_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(416);
15224
15280
  /* eslint-disable max-classes-per-file */
15225
- // @ts-nocheck
15281
+ // @ts-nocheck
15226
15282
 
15227
15283
 
15228
15284
 
15229
- // ----------------------------------------------------------------------------
15230
- // overwrites absolute volumes at price levels
15231
15285
  class OrderBook {
15232
15286
  constructor(snapshot = {}, depth = undefined) {
15287
+ this.cache = []; // make prop visible so we use typed OrderBooks
15233
15288
  Object.defineProperty(this, 'cache', {
15234
15289
  __proto__: null,
15235
15290
  value: [],
15236
15291
  writable: true,
15292
+ enumerable: false,
15237
15293
  });
15238
15294
  depth = depth || Number.MAX_SAFE_INTEGER;
15239
15295
  const defaults = {
@@ -18102,7 +18158,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
18102
18158
  'fetchOHLCV': true,
18103
18159
  'fetchOpenInterest': true,
18104
18160
  'fetchOpenInterestHistory': true,
18105
- 'fetchOpenOrder': false,
18161
+ 'fetchOpenOrder': true,
18106
18162
  'fetchOpenOrders': true,
18107
18163
  'fetchOrder': true,
18108
18164
  'fetchOrderBook': true,
@@ -21161,25 +21217,38 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21161
21217
  account['debt'] = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(debt, interest);
21162
21218
  return account;
21163
21219
  }
21164
- parseBalanceCustom(response, type = undefined, marginMode = undefined) {
21220
+ parseBalanceCustom(response, type = undefined, marginMode = undefined, isPortfolioMargin = false) {
21165
21221
  const result = {
21166
21222
  'info': response,
21167
21223
  };
21168
21224
  let timestamp = undefined;
21169
21225
  const isolated = marginMode === 'isolated';
21170
21226
  const cross = (type === 'margin') || (marginMode === 'cross');
21171
- if (type === 'papi') {
21227
+ if (isPortfolioMargin) {
21172
21228
  for (let i = 0; i < response.length; i++) {
21173
21229
  const entry = response[i];
21174
21230
  const account = this.account();
21175
21231
  const currencyId = this.safeString(entry, 'asset');
21176
21232
  const code = this.safeCurrencyCode(currencyId);
21177
- const borrowed = this.safeString(entry, 'crossMarginBorrowed');
21178
- const interest = this.safeString(entry, 'crossMarginInterest');
21179
- account['free'] = this.safeString(entry, 'crossMarginFree');
21180
- account['used'] = this.safeString(entry, 'crossMarginLocked');
21181
- account['total'] = this.safeString(entry, 'crossMarginAsset');
21182
- account['debt'] = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(borrowed, interest);
21233
+ if (type === 'linear') {
21234
+ account['free'] = this.safeString(entry, 'umWalletBalance');
21235
+ account['used'] = this.safeString(entry, 'umUnrealizedPNL');
21236
+ }
21237
+ else if (type === 'inverse') {
21238
+ account['free'] = this.safeString(entry, 'cmWalletBalance');
21239
+ account['used'] = this.safeString(entry, 'cmUnrealizedPNL');
21240
+ }
21241
+ else if (cross) {
21242
+ const borrowed = this.safeString(entry, 'crossMarginBorrowed');
21243
+ const interest = this.safeString(entry, 'crossMarginInterest');
21244
+ account['debt'] = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(borrowed, interest);
21245
+ account['free'] = this.safeString(entry, 'crossMarginFree');
21246
+ account['used'] = this.safeString(entry, 'crossMarginLocked');
21247
+ account['total'] = this.safeString(entry, 'crossMarginAsset');
21248
+ }
21249
+ else {
21250
+ account['total'] = this.safeString(entry, 'totalWalletBalance');
21251
+ }
21183
21252
  result[code] = account;
21184
21253
  }
21185
21254
  }
@@ -21299,7 +21368,13 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21299
21368
  let response = undefined;
21300
21369
  const request = {};
21301
21370
  if (isPortfolioMargin || (type === 'papi')) {
21302
- type = 'papi';
21371
+ if (this.isLinear(type, subType)) {
21372
+ type = 'linear';
21373
+ }
21374
+ else if (this.isInverse(type, subType)) {
21375
+ type = 'inverse';
21376
+ }
21377
+ isPortfolioMargin = true;
21303
21378
  response = await this.papiGetBalance(this.extend(request, query));
21304
21379
  }
21305
21380
  else if (this.isLinear(type, subType)) {
@@ -21547,7 +21622,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21547
21622
  // },
21548
21623
  // ]
21549
21624
  //
21550
- return this.parseBalanceCustom(response, type, marginMode);
21625
+ return this.parseBalanceCustom(response, type, marginMode, isPortfolioMargin);
21551
21626
  }
21552
21627
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
21553
21628
  /**
@@ -23171,7 +23246,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23171
23246
  // "status": "NEW"
23172
23247
  // }
23173
23248
  //
23174
- // createOrder, fetchOpenOrders: portfolio margin linear swap and future conditional
23249
+ // createOrder, fetchOpenOrders, fetchOpenOrder: portfolio margin linear swap and future conditional
23175
23250
  //
23176
23251
  // {
23177
23252
  // "newClientStrategyId": "x-xcKtGhcu27f109953d6e4dc0974006",
@@ -23310,6 +23385,130 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23310
23385
  // "selfTradePreventionMode": "NONE"
23311
23386
  // }
23312
23387
  //
23388
+ // fetchOpenOrder: linear swap
23389
+ //
23390
+ // {
23391
+ // "orderId": 3697213934,
23392
+ // "symbol": "BTCUSDT",
23393
+ // "status": "NEW",
23394
+ // "clientOrderId": "x-xcKtGhcufb20c5a7761a4aa09aa156",
23395
+ // "price": "33000.00",
23396
+ // "avgPrice": "0.00000",
23397
+ // "origQty": "0.010",
23398
+ // "executedQty": "0.000",
23399
+ // "cumQuote": "0.00000",
23400
+ // "timeInForce": "GTC",
23401
+ // "type": "LIMIT",
23402
+ // "reduceOnly": false,
23403
+ // "closePosition": false,
23404
+ // "side": "BUY",
23405
+ // "positionSide": "BOTH",
23406
+ // "stopPrice": "0.00",
23407
+ // "workingType": "CONTRACT_PRICE",
23408
+ // "priceProtect": false,
23409
+ // "origType": "LIMIT",
23410
+ // "priceMatch": "NONE",
23411
+ // "selfTradePreventionMode": "NONE",
23412
+ // "goodTillDate": 0,
23413
+ // "time": 1707892893502,
23414
+ // "updateTime": 1707892893515
23415
+ // }
23416
+ //
23417
+ // fetchOpenOrder: inverse swap
23418
+ //
23419
+ // {
23420
+ // "orderId": 597368542,
23421
+ // "symbol": "BTCUSD_PERP",
23422
+ // "pair": "BTCUSD",
23423
+ // "status": "NEW",
23424
+ // "clientOrderId": "x-xcKtGhcubbde7ba93b1a4ab881eff3",
23425
+ // "price": "35000",
23426
+ // "avgPrice": "0",
23427
+ // "origQty": "1",
23428
+ // "executedQty": "0",
23429
+ // "cumBase": "0",
23430
+ // "timeInForce": "GTC",
23431
+ // "type": "LIMIT",
23432
+ // "reduceOnly": false,
23433
+ // "closePosition": false,
23434
+ // "side": "BUY",
23435
+ // "positionSide": "BOTH",
23436
+ // "stopPrice": "0",
23437
+ // "workingType": "CONTRACT_PRICE",
23438
+ // "priceProtect": false,
23439
+ // "origType": "LIMIT",
23440
+ // "time": 1707893453199,
23441
+ // "updateTime": 1707893453199
23442
+ // }
23443
+ //
23444
+ // fetchOpenOrder: linear portfolio margin
23445
+ //
23446
+ // {
23447
+ // "orderId": 264895013409,
23448
+ // "symbol": "BTCUSDT",
23449
+ // "status": "NEW",
23450
+ // "clientOrderId": "x-xcKtGhcu6278f1adbdf14f74ab432e",
23451
+ // "price": "35000",
23452
+ // "avgPrice": "0",
23453
+ // "origQty": "0.010",
23454
+ // "executedQty": "0",
23455
+ // "cumQuote": "0",
23456
+ // "timeInForce": "GTC",
23457
+ // "type": "LIMIT",
23458
+ // "reduceOnly": false,
23459
+ // "side": "BUY",
23460
+ // "positionSide": "LONG",
23461
+ // "origType": "LIMIT",
23462
+ // "time": 1707893839364,
23463
+ // "updateTime": 1707893839364,
23464
+ // "goodTillDate": 0,
23465
+ // "selfTradePreventionMode": "NONE"
23466
+ // }
23467
+ //
23468
+ // fetchOpenOrder: inverse portfolio margin
23469
+ //
23470
+ // {
23471
+ // "orderId": 71790316950,
23472
+ // "symbol": "ETHUSD_PERP",
23473
+ // "pair": "ETHUSD",
23474
+ // "status": "NEW",
23475
+ // "clientOrderId": "x-xcKtGhcuec11030474204ab08ba2c2",
23476
+ // "price": "2500",
23477
+ // "avgPrice": "0",
23478
+ // "origQty": "1",
23479
+ // "executedQty": "0",
23480
+ // "cumBase": "0",
23481
+ // "timeInForce": "GTC",
23482
+ // "type": "LIMIT",
23483
+ // "reduceOnly": false,
23484
+ // "side": "BUY",
23485
+ // "positionSide": "LONG",
23486
+ // "origType": "LIMIT",
23487
+ // "time": 1707894181694,
23488
+ // "updateTime": 1707894181694
23489
+ // }
23490
+ //
23491
+ // fetchOpenOrder: inverse portfolio margin conditional
23492
+ //
23493
+ // {
23494
+ // "newClientStrategyId": "x-xcKtGhcu2da9c765294b433994ffce",
23495
+ // "strategyId": 1423501,
23496
+ // "strategyStatus": "NEW",
23497
+ // "strategyType": "STOP",
23498
+ // "origQty": "1",
23499
+ // "price": "2500",
23500
+ // "reduceOnly": false,
23501
+ // "side": "BUY",
23502
+ // "positionSide": "LONG",
23503
+ // "stopPrice": "4000",
23504
+ // "symbol": "ETHUSD_PERP",
23505
+ // "bookTime": 1707894782679,
23506
+ // "updateTime": 1707894782679,
23507
+ // "timeInForce": "GTC",
23508
+ // "workingType": "CONTRACT_PRICE",
23509
+ // "priceProtect": false
23510
+ // }
23511
+ //
23313
23512
  const code = this.safeString(order, 'code');
23314
23513
  if (code !== undefined) {
23315
23514
  // cancelOrders/createOrders might have a partial success
@@ -24309,7 +24508,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24309
24508
  [marginMode, params] = this.handleMarginModeAndParams('fetchOpenOrders', params);
24310
24509
  let isPortfolioMargin = undefined;
24311
24510
  [isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchOpenOrders', 'papi', 'portfolioMargin', false);
24312
- const isConditional = this.safeBool2(params, 'stop', 'conditional');
24511
+ const isConditional = this.safeBoolN(params, ['stop', 'conditional', 'trigger']);
24313
24512
  if (symbol !== undefined) {
24314
24513
  market = this.market(symbol);
24315
24514
  request['symbol'] = market['id'];
@@ -24329,7 +24528,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24329
24528
  }
24330
24529
  let subType = undefined;
24331
24530
  [subType, params] = this.handleSubTypeAndParams('fetchOpenOrders', market, params);
24332
- params = this.omit(params, ['type', 'stop', 'conditional']);
24531
+ params = this.omit(params, ['type', 'stop', 'conditional', 'trigger']);
24333
24532
  let response = undefined;
24334
24533
  if (type === 'option') {
24335
24534
  if (since !== undefined) {
@@ -24385,6 +24584,223 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24385
24584
  }
24386
24585
  return this.parseOrders(response, market, since, limit);
24387
24586
  }
24587
+ async fetchOpenOrder(id, symbol = undefined, params = {}) {
24588
+ /**
24589
+ * @method
24590
+ * @name binance#fetchOpenOrder
24591
+ * @description fetch an open order by the id
24592
+ * @see https://binance-docs.github.io/apidocs/futures/en/#query-current-open-order-user_data
24593
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#query-current-open-order-user_data
24594
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-current-um-open-order-user_data
24595
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-current-cm-open-order-user_data
24596
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-current-um-open-conditional-order-user_data
24597
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-current-cm-open-conditional-order-user_data
24598
+ * @param {string} id order id
24599
+ * @param {string} symbol unified market symbol
24600
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
24601
+ * @param {string} [params.trigger] set to true if you would like to fetch portfolio margin account stop or conditional orders
24602
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
24603
+ */
24604
+ if (symbol === undefined) {
24605
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrder() requires a symbol argument');
24606
+ }
24607
+ await this.loadMarkets();
24608
+ const market = this.market(symbol);
24609
+ const request = {
24610
+ 'symbol': market['id'],
24611
+ };
24612
+ let isPortfolioMargin = undefined;
24613
+ [isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchOpenOrder', 'papi', 'portfolioMargin', false);
24614
+ const isConditional = this.safeBoolN(params, ['stop', 'conditional', 'trigger']);
24615
+ params = this.omit(params, ['stop', 'conditional', 'trigger']);
24616
+ const isPortfolioMarginConditional = (isPortfolioMargin && isConditional);
24617
+ const orderIdRequest = isPortfolioMarginConditional ? 'strategyId' : 'orderId';
24618
+ request[orderIdRequest] = id;
24619
+ let response = undefined;
24620
+ if (market['linear']) {
24621
+ if (isPortfolioMargin) {
24622
+ if (isConditional) {
24623
+ response = await this.papiGetUmConditionalOpenOrder(this.extend(request, params));
24624
+ }
24625
+ else {
24626
+ response = await this.papiGetUmOpenOrder(this.extend(request, params));
24627
+ }
24628
+ }
24629
+ else {
24630
+ response = await this.fapiPrivateGetOpenOrder(this.extend(request, params));
24631
+ }
24632
+ }
24633
+ else if (market['inverse']) {
24634
+ if (isPortfolioMargin) {
24635
+ if (isConditional) {
24636
+ response = await this.papiGetCmConditionalOpenOrder(this.extend(request, params));
24637
+ }
24638
+ else {
24639
+ response = await this.papiGetCmOpenOrder(this.extend(request, params));
24640
+ }
24641
+ }
24642
+ else {
24643
+ response = await this.dapiPrivateGetOpenOrder(this.extend(request, params));
24644
+ }
24645
+ }
24646
+ else {
24647
+ if (market['option']) {
24648
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchOpenOrder() does not support option markets');
24649
+ }
24650
+ else if (market['spot']) {
24651
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchOpenOrder() does not support spot markets');
24652
+ }
24653
+ }
24654
+ //
24655
+ // linear swap
24656
+ //
24657
+ // {
24658
+ // "orderId": 3697213934,
24659
+ // "symbol": "BTCUSDT",
24660
+ // "status": "NEW",
24661
+ // "clientOrderId": "x-xcKtGhcufb20c5a7761a4aa09aa156",
24662
+ // "price": "33000.00",
24663
+ // "avgPrice": "0.00000",
24664
+ // "origQty": "0.010",
24665
+ // "executedQty": "0.000",
24666
+ // "cumQuote": "0.00000",
24667
+ // "timeInForce": "GTC",
24668
+ // "type": "LIMIT",
24669
+ // "reduceOnly": false,
24670
+ // "closePosition": false,
24671
+ // "side": "BUY",
24672
+ // "positionSide": "BOTH",
24673
+ // "stopPrice": "0.00",
24674
+ // "workingType": "CONTRACT_PRICE",
24675
+ // "priceProtect": false,
24676
+ // "origType": "LIMIT",
24677
+ // "priceMatch": "NONE",
24678
+ // "selfTradePreventionMode": "NONE",
24679
+ // "goodTillDate": 0,
24680
+ // "time": 1707892893502,
24681
+ // "updateTime": 1707892893515
24682
+ // }
24683
+ //
24684
+ // inverse swap
24685
+ //
24686
+ // {
24687
+ // "orderId": 597368542,
24688
+ // "symbol": "BTCUSD_PERP",
24689
+ // "pair": "BTCUSD",
24690
+ // "status": "NEW",
24691
+ // "clientOrderId": "x-xcKtGhcubbde7ba93b1a4ab881eff3",
24692
+ // "price": "35000",
24693
+ // "avgPrice": "0",
24694
+ // "origQty": "1",
24695
+ // "executedQty": "0",
24696
+ // "cumBase": "0",
24697
+ // "timeInForce": "GTC",
24698
+ // "type": "LIMIT",
24699
+ // "reduceOnly": false,
24700
+ // "closePosition": false,
24701
+ // "side": "BUY",
24702
+ // "positionSide": "BOTH",
24703
+ // "stopPrice": "0",
24704
+ // "workingType": "CONTRACT_PRICE",
24705
+ // "priceProtect": false,
24706
+ // "origType": "LIMIT",
24707
+ // "time": 1707893453199,
24708
+ // "updateTime": 1707893453199
24709
+ // }
24710
+ //
24711
+ // linear portfolio margin
24712
+ //
24713
+ // {
24714
+ // "orderId": 264895013409,
24715
+ // "symbol": "BTCUSDT",
24716
+ // "status": "NEW",
24717
+ // "clientOrderId": "x-xcKtGhcu6278f1adbdf14f74ab432e",
24718
+ // "price": "35000",
24719
+ // "avgPrice": "0",
24720
+ // "origQty": "0.010",
24721
+ // "executedQty": "0",
24722
+ // "cumQuote": "0",
24723
+ // "timeInForce": "GTC",
24724
+ // "type": "LIMIT",
24725
+ // "reduceOnly": false,
24726
+ // "side": "BUY",
24727
+ // "positionSide": "LONG",
24728
+ // "origType": "LIMIT",
24729
+ // "time": 1707893839364,
24730
+ // "updateTime": 1707893839364,
24731
+ // "goodTillDate": 0,
24732
+ // "selfTradePreventionMode": "NONE"
24733
+ // }
24734
+ //
24735
+ // inverse portfolio margin
24736
+ //
24737
+ // {
24738
+ // "orderId": 71790316950,
24739
+ // "symbol": "ETHUSD_PERP",
24740
+ // "pair": "ETHUSD",
24741
+ // "status": "NEW",
24742
+ // "clientOrderId": "x-xcKtGhcuec11030474204ab08ba2c2",
24743
+ // "price": "2500",
24744
+ // "avgPrice": "0",
24745
+ // "origQty": "1",
24746
+ // "executedQty": "0",
24747
+ // "cumBase": "0",
24748
+ // "timeInForce": "GTC",
24749
+ // "type": "LIMIT",
24750
+ // "reduceOnly": false,
24751
+ // "side": "BUY",
24752
+ // "positionSide": "LONG",
24753
+ // "origType": "LIMIT",
24754
+ // "time": 1707894181694,
24755
+ // "updateTime": 1707894181694
24756
+ // }
24757
+ //
24758
+ // linear portfolio margin conditional
24759
+ //
24760
+ // {
24761
+ // "newClientStrategyId": "x-xcKtGhcu2205fde44418483ca21874",
24762
+ // "strategyId": 4084339,
24763
+ // "strategyStatus": "NEW",
24764
+ // "strategyType": "STOP",
24765
+ // "origQty": "0.010",
24766
+ // "price": "35000",
24767
+ // "reduceOnly": false,
24768
+ // "side": "BUY",
24769
+ // "positionSide": "LONG",
24770
+ // "stopPrice": "60000",
24771
+ // "symbol": "BTCUSDT",
24772
+ // "bookTime": 1707894490094,
24773
+ // "updateTime": 1707894490094,
24774
+ // "timeInForce": "GTC",
24775
+ // "workingType": "CONTRACT_PRICE",
24776
+ // "priceProtect": false,
24777
+ // "goodTillDate": 0,
24778
+ // "selfTradePreventionMode": "NONE"
24779
+ // }
24780
+ //
24781
+ // inverse portfolio margin conditional
24782
+ //
24783
+ // {
24784
+ // "newClientStrategyId": "x-xcKtGhcu2da9c765294b433994ffce",
24785
+ // "strategyId": 1423501,
24786
+ // "strategyStatus": "NEW",
24787
+ // "strategyType": "STOP",
24788
+ // "origQty": "1",
24789
+ // "price": "2500",
24790
+ // "reduceOnly": false,
24791
+ // "side": "BUY",
24792
+ // "positionSide": "LONG",
24793
+ // "stopPrice": "4000",
24794
+ // "symbol": "ETHUSD_PERP",
24795
+ // "bookTime": 1707894782679,
24796
+ // "updateTime": 1707894782679,
24797
+ // "timeInForce": "GTC",
24798
+ // "workingType": "CONTRACT_PRICE",
24799
+ // "priceProtect": false
24800
+ // }
24801
+ //
24802
+ return this.parseOrder(response, market);
24803
+ }
24388
24804
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
24389
24805
  /**
24390
24806
  * @method
@@ -27489,12 +27905,12 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
27489
27905
  /**
27490
27906
  * @method
27491
27907
  * @name binance#fetchPositions
27908
+ * @description fetch all open positions
27492
27909
  * @see https://binance-docs.github.io/apidocs/futures/en/#position-information-v2-user_data
27493
27910
  * @see https://binance-docs.github.io/apidocs/delivery/en/#position-information-user_data
27494
27911
  * @see https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data
27495
27912
  * @see https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data
27496
27913
  * @see https://binance-docs.github.io/apidocs/voptions/en/#option-position-information-user_data
27497
- * @description fetch all open positions
27498
27914
  * @param {string[]} [symbols] list of unified market symbols
27499
27915
  * @param {object} [params] extra parameters specific to the exchange API endpoint
27500
27916
  * @param {string} [method] method name to call, "positionRisk", "account" or "option", default is "positionRisk"
@@ -27718,7 +28134,10 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
27718
28134
  const result = [];
27719
28135
  for (let i = 0; i < response.length; i++) {
27720
28136
  const parsed = this.parsePositionRisk(response[i]);
27721
- result.push(parsed);
28137
+ const entryPrice = this.safeString(parsed, 'entryPrice');
28138
+ if ((entryPrice !== '0') && (entryPrice !== '0.0') && (entryPrice !== '0.00000000')) {
28139
+ result.push(parsed);
28140
+ }
27722
28141
  }
27723
28142
  symbols = this.marketSymbols(symbols);
27724
28143
  return this.filterByArrayPositions(result, 'symbol', symbols, false);
@@ -29298,12 +29717,16 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
29298
29717
  * @see https://binance-docs.github.io/apidocs/spot/en/#get-force-liquidation-record-user_data
29299
29718
  * @see https://binance-docs.github.io/apidocs/futures/en/#user-39-s-force-orders-user_data
29300
29719
  * @see https://binance-docs.github.io/apidocs/delivery/en/#user-39-s-force-orders-user_data
29720
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-user-39-s-margin-force-orders-user_data
29721
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-user-39-s-um-force-orders-user_data
29722
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-user-39-s-cm-force-orders-user_data
29301
29723
  * @param {string} [symbol] unified CCXT market symbol
29302
29724
  * @param {int} [since] the earliest time in ms to fetch liquidations for
29303
29725
  * @param {int} [limit] the maximum number of liquidation structures to retrieve
29304
29726
  * @param {object} [params] exchange specific parameters for the binance api endpoint
29305
29727
  * @param {int} [params.until] timestamp in ms of the latest liquidation
29306
29728
  * @param {boolean} [params.paginate] *spot only* default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
29729
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch liquidations in a portfolio margin account
29307
29730
  * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
29308
29731
  */
29309
29732
  await this.loadMarkets();
@@ -29320,13 +29743,17 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
29320
29743
  [type, params] = this.handleMarketTypeAndParams('fetchMyLiquidations', market, params);
29321
29744
  let subType = undefined;
29322
29745
  [subType, params] = this.handleSubTypeAndParams('fetchMyLiquidations', market, params, 'linear');
29746
+ let isPortfolioMargin = undefined;
29747
+ [isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchMyLiquidations', 'papi', 'portfolioMargin', false);
29323
29748
  let request = {};
29324
29749
  if (type !== 'spot') {
29325
29750
  request['autoCloseType'] = 'LIQUIDATION';
29326
29751
  }
29327
29752
  if (market !== undefined) {
29328
29753
  const symbolKey = market['spot'] ? 'isolatedSymbol' : 'symbol';
29329
- request[symbolKey] = market['id'];
29754
+ if (!isPortfolioMargin) {
29755
+ request[symbolKey] = market['id'];
29756
+ }
29330
29757
  }
29331
29758
  if (since !== undefined) {
29332
29759
  request['startTime'] = since;
@@ -29342,13 +29769,28 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
29342
29769
  [request, params] = this.handleUntilOption('endTime', request, params);
29343
29770
  let response = undefined;
29344
29771
  if (type === 'spot') {
29345
- response = await this.sapiGetMarginForceLiquidationRec(this.extend(request, params));
29772
+ if (isPortfolioMargin) {
29773
+ response = await this.papiGetMarginForceOrders(this.extend(request, params));
29774
+ }
29775
+ else {
29776
+ response = await this.sapiGetMarginForceLiquidationRec(this.extend(request, params));
29777
+ }
29346
29778
  }
29347
29779
  else if (subType === 'linear') {
29348
- response = await this.fapiPrivateGetForceOrders(this.extend(request, params));
29780
+ if (isPortfolioMargin) {
29781
+ response = await this.papiGetUmForceOrders(this.extend(request, params));
29782
+ }
29783
+ else {
29784
+ response = await this.fapiPrivateGetForceOrders(this.extend(request, params));
29785
+ }
29349
29786
  }
29350
29787
  else if (subType === 'inverse') {
29351
- response = await this.dapiPrivateGetForceOrders(this.extend(request, params));
29788
+ if (isPortfolioMargin) {
29789
+ response = await this.papiGetCmForceOrders(this.extend(request, params));
29790
+ }
29791
+ else {
29792
+ response = await this.dapiPrivateGetForceOrders(this.extend(request, params));
29793
+ }
29352
29794
  }
29353
29795
  else {
29354
29796
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchMyLiquidations() does not support ' + market['type'] + ' markets');
@@ -29430,7 +29872,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
29430
29872
  // },
29431
29873
  // ]
29432
29874
  //
29433
- const liquidations = this.safeValue(response, 'rows', response);
29875
+ const liquidations = this.safeList(response, 'rows', response);
29434
29876
  return this.parseLiquidations(liquidations, market, since, limit);
29435
29877
  }
29436
29878
  parseLiquidation(liquidation, market = undefined) {
@@ -29989,6 +30431,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
29989
30431
  'fetchClosedOrders': true,
29990
30432
  'fetchCurrencies': true,
29991
30433
  'fetchDepositAddress': true,
30434
+ 'fetchDepositAddressesByNetwork': true,
29992
30435
  'fetchDeposits': true,
29993
30436
  'fetchDepositWithdrawFee': 'emulated',
29994
30437
  'fetchDepositWithdrawFees': true,
@@ -30341,6 +30784,13 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
30341
30784
  },
30342
30785
  'recvWindow': 5 * 1000,
30343
30786
  'broker': 'CCXT',
30787
+ 'defaultNetworks': {
30788
+ 'ETH': 'ETH',
30789
+ 'USDT': 'ERC20',
30790
+ 'USDC': 'ERC20',
30791
+ 'BTC': 'BTC',
30792
+ 'LTC': 'LTC',
30793
+ },
30344
30794
  },
30345
30795
  });
30346
30796
  }
@@ -33024,15 +33474,15 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
33024
33474
  'status': status,
33025
33475
  };
33026
33476
  }
33027
- async fetchDepositAddress(code, params = {}) {
33477
+ async fetchDepositAddressesByNetwork(code, params = {}) {
33028
33478
  /**
33029
33479
  * @method
33030
- * @name bingx#fetchDepositAddress
33031
- * @description fetch the deposit address for a currency associated with this account
33032
- * @see https://bingx-api.github.io/docs/#/common/sub-account#Query%20Main%20Account%20Deposit%20Address
33480
+ * @name bingx#fetchDepositAddressesByNetwork
33481
+ * @description fetch the deposit addresses for a currency associated with this account
33482
+ * @see https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Query%20Main%20Account%20Deposit%20Address
33033
33483
  * @param {string} code unified currency code
33034
33484
  * @param {object} [params] extra parameters specific to the exchange API endpoint
33035
- * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
33485
+ * @returns {object} a dictionary [address structures]{@link https://docs.ccxt.com/#/?id=address-structure}, indexed by the network
33036
33486
  */
33037
33487
  await this.loadMarkets();
33038
33488
  const currency = this.currency(code);
@@ -33067,6 +33517,36 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
33067
33517
  const parsed = this.parseDepositAddresses(data, [currency['code']], false);
33068
33518
  return this.indexBy(parsed, 'network');
33069
33519
  }
33520
+ async fetchDepositAddress(code, params = {}) {
33521
+ /**
33522
+ * @method
33523
+ * @name bingx#fetchDepositAddress
33524
+ * @description fetch the deposit address for a currency associated with this account
33525
+ * @see https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Query%20Main%20Account%20Deposit%20Address
33526
+ * @param {string} code unified currency code
33527
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
33528
+ * @param {string} [params.network] The chain of currency. This only apply for multi-chain currency, and there is no need for single chain currency
33529
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
33530
+ */
33531
+ const network = this.safeString(params, 'network');
33532
+ params = this.omit(params, ['network']);
33533
+ const addressStructures = await this.fetchDepositAddressesByNetwork(code, params);
33534
+ if (network !== undefined) {
33535
+ return this.safeDict(addressStructures, network);
33536
+ }
33537
+ else {
33538
+ const options = this.safeDict(this.options, 'defaultNetworks');
33539
+ const defaultNetworkForCurrency = this.safeString(options, code);
33540
+ if (defaultNetworkForCurrency !== undefined) {
33541
+ return this.safeDict(addressStructures, defaultNetworkForCurrency);
33542
+ }
33543
+ else {
33544
+ const keys = Object.keys(addressStructures);
33545
+ const key = this.safeString(keys, 0);
33546
+ return this.safeDict(addressStructures, key);
33547
+ }
33548
+ }
33549
+ }
33070
33550
  parseDepositAddress(depositAddress, currency = undefined) {
33071
33551
  //
33072
33552
  // {
@@ -39448,6 +39928,7 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
39448
39928
  'EDO': 'PNT',
39449
39929
  'EUS': 'EURS',
39450
39930
  'EUT': 'EURT',
39931
+ 'HTX': 'HT',
39451
39932
  'IDX': 'ID',
39452
39933
  'IOT': 'IOTA',
39453
39934
  'IQX': 'IQ',
@@ -53118,6 +53599,11 @@ class bithumb extends _abstract_bithumb_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
53118
53599
  'orderbook/ALL_{quoteId}',
53119
53600
  'orderbook/{baseId}_{quoteId}',
53120
53601
  'transaction_history/{baseId}_{quoteId}',
53602
+ 'network-info',
53603
+ 'assetsstatus/multichain/ALL',
53604
+ 'assetsstatus/multichain/{currency}',
53605
+ 'withdraw/minimum/ALL',
53606
+ 'withdraw/minimum/{currency}',
53121
53607
  'assetsstatus/ALL',
53122
53608
  'assetsstatus/{baseId}',
53123
53609
  'candlestick/{baseId}_{quoteId}/{interval}',
@@ -69130,7 +69616,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
69130
69616
  for (let i = 0; i < ids.length; i++) {
69131
69617
  const id = ids[i];
69132
69618
  if (id.indexOf('_') < 0) {
69133
- const value = this.safeNumber(transaction, id);
69619
+ const value = this.safeInteger(transaction, id);
69134
69620
  if ((value !== undefined) && (value !== 0)) {
69135
69621
  return id;
69136
69622
  }
@@ -81645,6 +82131,7 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
81645
82131
  * @method
81646
82132
  * @name btcturk#fetchMarkets
81647
82133
  * @description retrieves data on all markets for btcturk
82134
+ * @see https://docs.btcturk.com/public-endpoints/exchange-info
81648
82135
  * @param {object} [params] extra parameters specific to the exchange API endpoint
81649
82136
  * @returns {object[]} an array of objects representing market data
81650
82137
  */
@@ -81794,6 +82281,7 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
81794
82281
  * @method
81795
82282
  * @name btcturk#fetchBalance
81796
82283
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
82284
+ * @see https://docs.btcturk.com/private-endpoints/account-balance
81797
82285
  * @param {object} [params] extra parameters specific to the exchange API endpoint
81798
82286
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
81799
82287
  */
@@ -81822,6 +82310,7 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
81822
82310
  * @method
81823
82311
  * @name btcturk#fetchOrderBook
81824
82312
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
82313
+ * @see https://docs.btcturk.com/public-endpoints/orderbook
81825
82314
  * @param {string} symbol unified symbol of the market to fetch the order book for
81826
82315
  * @param {int} [limit] the maximum amount of order book entries to return
81827
82316
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -81902,6 +82391,7 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
81902
82391
  * @method
81903
82392
  * @name btcturk#fetchTickers
81904
82393
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
82394
+ * @see https://docs.btcturk.com/public-endpoints/ticker
81905
82395
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
81906
82396
  * @param {object} [params] extra parameters specific to the exchange API endpoint
81907
82397
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -81916,6 +82406,7 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
81916
82406
  * @method
81917
82407
  * @name btcturk#fetchTicker
81918
82408
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
82409
+ * @see https://docs.btcturk.com/public-endpoints/ticker
81919
82410
  * @param {string} symbol unified symbol of the market to fetch the ticker for
81920
82411
  * @param {object} [params] extra parameters specific to the exchange API endpoint
81921
82412
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -81991,6 +82482,7 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
81991
82482
  * @method
81992
82483
  * @name btcturk#fetchTrades
81993
82484
  * @description get the list of most recent trades for a particular symbol
82485
+ * @see https://docs.btcturk.com/public-endpoints/trades
81994
82486
  * @param {string} symbol unified symbol of the market to fetch trades for
81995
82487
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
81996
82488
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -82154,6 +82646,7 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
82154
82646
  * @method
82155
82647
  * @name btcturk#createOrder
82156
82648
  * @description create a trade order
82649
+ * @see https://docs.btcturk.com/private-endpoints/submit-order
82157
82650
  * @param {string} symbol unified symbol of the market to create an order in
82158
82651
  * @param {string} type 'market' or 'limit'
82159
82652
  * @param {string} side 'buy' or 'sell'
@@ -82188,6 +82681,7 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
82188
82681
  * @method
82189
82682
  * @name btcturk#cancelOrder
82190
82683
  * @description cancels an open order
82684
+ * @see https://docs.btcturk.com/private-endpoints/cancel-order
82191
82685
  * @param {string} id order id
82192
82686
  * @param {string} symbol not used by btcturk cancelOrder ()
82193
82687
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -82203,6 +82697,7 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
82203
82697
  * @method
82204
82698
  * @name btcturk#fetchOpenOrders
82205
82699
  * @description fetch all unfilled currently open orders
82700
+ * @see https://docs.btcturk.com/private-endpoints/open-orders
82206
82701
  * @param {string} symbol unified market symbol
82207
82702
  * @param {int} [since] the earliest time in ms to fetch open orders for
82208
82703
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -82227,6 +82722,7 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
82227
82722
  * @method
82228
82723
  * @name btcturk#fetchOrders
82229
82724
  * @description fetches information on multiple orders made by the user
82725
+ * @see https://docs.btcturk.com/private-endpoints/all-orders
82230
82726
  * @param {string} symbol unified market symbol of the market orders were made in
82231
82727
  * @param {int} [since] the earliest time in ms to fetch orders for
82232
82728
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -82349,6 +82845,7 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
82349
82845
  * @method
82350
82846
  * @name btcturk#fetchMyTrades
82351
82847
  * @description fetch all trades made by the user
82848
+ * @see https://docs.btcturk.com/private-endpoints/user-transactions
82352
82849
  * @param {string} symbol unified market symbol
82353
82850
  * @param {int} [since] the earliest time in ms to fetch trades for
82354
82851
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -82497,7 +82994,9 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
82497
82994
  'fetchBorrowInterest': false,
82498
82995
  'fetchBorrowRateHistories': false,
82499
82996
  'fetchBorrowRateHistory': false,
82997
+ 'fetchCanceledAndClosedOrders': true,
82500
82998
  'fetchCanceledOrders': true,
82999
+ 'fetchClosedOrder': true,
82501
83000
  'fetchClosedOrders': true,
82502
83001
  'fetchCrossBorrowRate': true,
82503
83002
  'fetchCrossBorrowRates': false,
@@ -82525,10 +83024,11 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
82525
83024
  'fetchOHLCV': true,
82526
83025
  'fetchOpenInterest': true,
82527
83026
  'fetchOpenInterestHistory': true,
83027
+ 'fetchOpenOrder': true,
82528
83028
  'fetchOpenOrders': true,
82529
- 'fetchOrder': true,
83029
+ 'fetchOrder': false,
82530
83030
  'fetchOrderBook': true,
82531
- 'fetchOrders': true,
83031
+ 'fetchOrders': false,
82532
83032
  'fetchOrderTrades': true,
82533
83033
  'fetchPosition': true,
82534
83034
  'fetchPositions': true,
@@ -85882,35 +86382,6 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
85882
86382
  'trades': undefined,
85883
86383
  }, market);
85884
86384
  }
85885
- async fetchOrder(id, symbol = undefined, params = {}) {
85886
- /**
85887
- * @method
85888
- * @name bybit#fetchOrder
85889
- * @description fetches information on an order made by the user
85890
- * @see https://bybit-exchange.github.io/docs/v5/order/order-list
85891
- * @param {string} symbol unified symbol of the market the order was made in
85892
- * @param {object} [params] extra parameters specific to the exchange API endpoint
85893
- * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
85894
- */
85895
- if (symbol === undefined) {
85896
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
85897
- }
85898
- await this.loadMarkets();
85899
- const request = {
85900
- 'orderId': id,
85901
- };
85902
- const result = await this.fetchOrders(symbol, undefined, undefined, this.extend(request, params));
85903
- const length = result.length;
85904
- if (length === 0) {
85905
- const isTrigger = this.safeBoolN(params, ['trigger', 'stop'], false);
85906
- const extra = isTrigger ? '' : 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = true';
85907
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.OrderNotFound('Order ' + id.toString() + ' was not found.' + extra);
85908
- }
85909
- if (length > 1) {
85910
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' returned more than one order');
85911
- }
85912
- return this.safeValue(result, 0);
85913
- }
85914
86385
  async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
85915
86386
  /**
85916
86387
  * @method
@@ -86946,29 +87417,99 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
86946
87417
  const data = this.safeValue(result, 'dataList', []);
86947
87418
  return this.parseOrders(data, market, since, limit);
86948
87419
  }
87420
+ async fetchOrder(id, symbol = undefined, params = {}) {
87421
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' fetchOrder() is not supported after the 5/02 update, please use fetchOpenOrder or fetchClosedOrder');
87422
+ }
86949
87423
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
87424
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' fetchOrders() is not supported after the 5/02 update, please use fetchOpenOrders, fetchClosedOrders or fetchCanceledOrders');
87425
+ }
87426
+ async fetchClosedOrder(id, symbol = undefined, params = {}) {
86950
87427
  /**
86951
87428
  * @method
86952
- * @name bybit#fetchOrders
86953
- * @description fetches information on multiple orders made by the user
87429
+ * @name bybit#fetchClosedOrder
87430
+ * @description fetches information on a closed order made by the user
86954
87431
  * @see https://bybit-exchange.github.io/docs/v5/order/order-list
86955
- * @param {string} symbol unified market symbol of the market orders were made in
87432
+ * @param {string} id order id
87433
+ * @param {string} [symbol] unified symbol of the market the order was made in
87434
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
87435
+ * @param {boolean} [params.stop] set to true for fetching a closed stop order
87436
+ * @param {string} [params.type] market type, ['swap', 'option', 'spot']
87437
+ * @param {string} [params.subType] market subType, ['linear', 'inverse']
87438
+ * @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
87439
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
87440
+ */
87441
+ await this.loadMarkets();
87442
+ const request = {
87443
+ 'orderId': id,
87444
+ };
87445
+ const result = await this.fetchClosedOrders(symbol, undefined, undefined, this.extend(request, params));
87446
+ const length = result.length;
87447
+ if (length === 0) {
87448
+ const isTrigger = this.safeBoolN(params, ['trigger', 'stop'], false);
87449
+ const extra = isTrigger ? '' : 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = true';
87450
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.OrderNotFound('Order ' + id.toString() + ' was not found.' + extra);
87451
+ }
87452
+ if (length > 1) {
87453
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' returned more than one order');
87454
+ }
87455
+ return this.safeValue(result, 0);
87456
+ }
87457
+ async fetchOpenOrder(id, symbol = undefined, params = {}) {
87458
+ /**
87459
+ * @method
87460
+ * @name bybit#fetchOpenOrder
87461
+ * @description fetches information on an open order made by the user
87462
+ * @see https://bybit-exchange.github.io/docs/v5/order/open-order
87463
+ * @param {string} id order id
87464
+ * @param {string} [symbol] unified symbol of the market the order was made in
87465
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
87466
+ * @param {boolean} [params.stop] set to true for fetching an open stop order
87467
+ * @param {string} [params.type] market type, ['swap', 'option', 'spot']
87468
+ * @param {string} [params.subType] market subType, ['linear', 'inverse']
87469
+ * @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
87470
+ * @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
87471
+ * @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
87472
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
87473
+ */
87474
+ await this.loadMarkets();
87475
+ const request = {
87476
+ 'orderId': id,
87477
+ };
87478
+ const result = await this.fetchOpenOrders(symbol, undefined, undefined, this.extend(request, params));
87479
+ const length = result.length;
87480
+ if (length === 0) {
87481
+ const isTrigger = this.safeBoolN(params, ['trigger', 'stop'], false);
87482
+ const extra = isTrigger ? '' : 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = true';
87483
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.OrderNotFound('Order ' + id.toString() + ' was not found.' + extra);
87484
+ }
87485
+ if (length > 1) {
87486
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' returned more than one order');
87487
+ }
87488
+ return this.safeValue(result, 0);
87489
+ }
87490
+ async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
87491
+ /**
87492
+ * @method
87493
+ * @name bybit#fetchCanceledAndClosedOrders
87494
+ * @description fetches information on multiple canceled and closed orders made by the user
87495
+ * @see https://bybit-exchange.github.io/docs/v5/order/order-list
87496
+ * @param {string} [symbol] unified market symbol of the market orders were made in
86956
87497
  * @param {int} [since] the earliest time in ms to fetch orders for
86957
87498
  * @param {int} [limit] the maximum number of order structures to retrieve
86958
87499
  * @param {object} [params] extra parameters specific to the exchange API endpoint
86959
- * @param {boolean} [params.stop] true if stop order
87500
+ * @param {boolean} [params.stop] set to true for fetching stop orders
86960
87501
  * @param {string} [params.type] market type, ['swap', 'option', 'spot']
86961
87502
  * @param {string} [params.subType] market subType, ['linear', 'inverse']
86962
87503
  * @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
86963
87504
  * @param {int} [params.until] the latest time in ms to fetch entries for
86964
- * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
87505
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
86965
87506
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
86966
87507
  */
86967
87508
  await this.loadMarkets();
86968
87509
  let paginate = false;
86969
- [paginate, params] = this.handleOptionAndParams(params, 'fetchOrders', 'paginate');
87510
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchCanceledAndClosedOrders', 'paginate');
86970
87511
  if (paginate) {
86971
- return await this.fetchPaginatedCallCursor('fetchOrders', symbol, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
87512
+ return await this.fetchPaginatedCallCursor('fetchCanceledAndClosedOrders', symbol, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
86972
87513
  }
86973
87514
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
86974
87515
  const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
@@ -86981,7 +87522,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
86981
87522
  request['symbol'] = market['id'];
86982
87523
  }
86983
87524
  let type = undefined;
86984
- [type, params] = this.getBybitType('fetchOrders', market, params);
87525
+ [type, params] = this.getBybitType('fetchCanceledAndClosedOrders', market, params);
86985
87526
  if (((type === 'option') || isUsdcSettled) && !isUnifiedAccount) {
86986
87527
  return await this.fetchUsdcOrders(symbol, since, limit, params);
86987
87528
  }
@@ -87063,17 +87604,23 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
87063
87604
  * @name bybit#fetchClosedOrders
87064
87605
  * @description fetches information on multiple closed orders made by the user
87065
87606
  * @see https://bybit-exchange.github.io/docs/v5/order/order-list
87066
- * @param {string} symbol unified market symbol of the market orders were made in
87607
+ * @param {string} [symbol] unified market symbol of the market orders were made in
87067
87608
  * @param {int} [since] the earliest time in ms to fetch orders for
87068
87609
  * @param {int} [limit] the maximum number of order structures to retrieve
87069
87610
  * @param {object} [params] extra parameters specific to the exchange API endpoint
87611
+ * @param {boolean} [params.stop] set to true for fetching closed stop orders
87612
+ * @param {string} [params.type] market type, ['swap', 'option', 'spot']
87613
+ * @param {string} [params.subType] market subType, ['linear', 'inverse']
87614
+ * @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
87615
+ * @param {int} [params.until] the latest time in ms to fetch entries for
87616
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
87070
87617
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
87071
87618
  */
87072
87619
  await this.loadMarkets();
87073
87620
  const request = {
87074
87621
  'orderStatus': 'Filled',
87075
87622
  };
87076
- return await this.fetchOrders(symbol, since, limit, this.extend(request, params));
87623
+ return await this.fetchCanceledAndClosedOrders(symbol, since, limit, this.extend(request, params));
87077
87624
  }
87078
87625
  async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
87079
87626
  /**
@@ -87081,20 +87628,23 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
87081
87628
  * @name bybit#fetchCanceledOrders
87082
87629
  * @description fetches information on multiple canceled orders made by the user
87083
87630
  * @see https://bybit-exchange.github.io/docs/v5/order/order-list
87084
- * @param {string} symbol unified market symbol of the market orders were made in
87631
+ * @param {string} [symbol] unified market symbol of the market orders were made in
87085
87632
  * @param {int} [since] timestamp in ms of the earliest order, default is undefined
87086
87633
  * @param {int} [limit] max number of orders to return, default is undefined
87087
87634
  * @param {object} [params] extra parameters specific to the exchange API endpoint
87088
87635
  * @param {boolean} [params.stop] true if stop order
87089
87636
  * @param {string} [params.type] market type, ['swap', 'option', 'spot']
87090
87637
  * @param {string} [params.subType] market subType, ['linear', 'inverse']
87638
+ * @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
87639
+ * @param {int} [params.until] the latest time in ms to fetch entries for
87640
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
87091
87641
  * @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
87092
87642
  */
87093
87643
  await this.loadMarkets();
87094
87644
  const request = {
87095
87645
  'orderStatus': 'Cancelled',
87096
87646
  };
87097
- return await this.fetchOrders(symbol, since, limit, this.extend(request, params));
87647
+ return await this.fetchCanceledAndClosedOrders(symbol, since, limit, this.extend(request, params));
87098
87648
  }
87099
87649
  async fetchUsdcOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
87100
87650
  await this.loadMarkets();
@@ -91891,6 +92441,9 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
91891
92441
  'fetchCrossBorrowRate': false,
91892
92442
  'fetchCrossBorrowRates': false,
91893
92443
  'fetchCurrencies': true,
92444
+ 'fetchDepositAddress': 'emulated',
92445
+ 'fetchDepositAddresses': false,
92446
+ 'fetchDepositAddressesByNetwork': true,
91894
92447
  'fetchDeposits': true,
91895
92448
  'fetchFundingHistory': false,
91896
92449
  'fetchFundingRate': false,
@@ -91958,6 +92511,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
91958
92511
  'public': {
91959
92512
  'get': [
91960
92513
  'currencies',
92514
+ 'currencies/crypto',
91961
92515
  'time',
91962
92516
  'exchange-rates',
91963
92517
  'users/{user_id}',
@@ -92152,6 +92706,10 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
92152
92706
  'ACCOUNT_TYPE_CRYPTO',
92153
92707
  'ACCOUNT_TYPE_FIAT',
92154
92708
  ],
92709
+ 'networks': {
92710
+ 'ERC20': 'ethereum',
92711
+ 'XLM': 'stellar',
92712
+ },
92155
92713
  'createMarketBuyOrderRequiresPrice': true,
92156
92714
  'advanced': true,
92157
92715
  'fetchMarkets': 'fetchMarketsV3',
@@ -92507,10 +93065,10 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
92507
93065
  return this.parseTrades(buys['data'], undefined, since, limit);
92508
93066
  }
92509
93067
  async fetchTransactionsWithMethod(method, code = undefined, since = undefined, limit = undefined, params = {}) {
92510
- const request = await this.prepareAccountRequestWithCurrencyCode(code, limit, params);
93068
+ let request = undefined;
93069
+ [request, params] = await this.prepareAccountRequestWithCurrencyCode(code, limit, params);
92511
93070
  await this.loadMarkets();
92512
- const query = this.omit(params, ['account_id', 'accountId']);
92513
- const response = await this[method](this.extend(request, query));
93071
+ const response = await this[method](this.extend(request, params));
92514
93072
  return this.parseTransactions(response['data'], undefined, since, limit);
92515
93073
  }
92516
93074
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
@@ -93062,15 +93620,45 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93062
93620
  const expires = this.safeInteger(options, 'expires', 1000);
93063
93621
  const now = this.milliseconds();
93064
93622
  if ((timestamp === undefined) || ((now - timestamp) > expires)) {
93065
- const currencies = await this.v2PublicGetCurrencies(params);
93623
+ const promises = [
93624
+ this.v2PublicGetCurrencies(params),
93625
+ this.v2PublicGetCurrenciesCrypto(params),
93626
+ ];
93627
+ const promisesResult = await Promise.all(promises);
93628
+ const fiatResponse = this.safeDict(promisesResult, 0, {});
93629
+ //
93630
+ // [
93631
+ // "data": {
93632
+ // id: 'IMP',
93633
+ // name: 'Isle of Man Pound',
93634
+ // min_size: '0.01'
93635
+ // },
93636
+ // ...
93637
+ // ]
93638
+ //
93639
+ const cryptoResponse = this.safeDict(promisesResult, 1, {});
93640
+ //
93641
+ // {
93642
+ // asset_id: '9476e3be-b731-47fa-82be-347fabc573d9',
93643
+ // code: 'AERO',
93644
+ // name: 'Aerodrome Finance',
93645
+ // color: '#0433FF',
93646
+ // sort_index: '340',
93647
+ // exponent: '8',
93648
+ // type: 'crypto',
93649
+ // address_regex: '^(?:0x)?[0-9a-fA-F]{40}$'
93650
+ // }
93651
+ //
93652
+ const fiatData = this.safeList(fiatResponse, 'data', []);
93653
+ const cryptoData = this.safeList(cryptoResponse, 'data', []);
93066
93654
  const exchangeRates = await this.v2PublicGetExchangeRates(params);
93067
93655
  this.options['fetchCurrencies'] = this.extend(options, {
93068
- 'currencies': currencies,
93656
+ 'currencies': this.arrayConcat(fiatData, cryptoData),
93069
93657
  'exchangeRates': exchangeRates,
93070
93658
  'timestamp': now,
93071
93659
  });
93072
93660
  }
93073
- return this.safeValue(this.options, 'fetchCurrencies', {});
93661
+ return this.safeDict(this.options, 'fetchCurrencies', {});
93074
93662
  }
93075
93663
  async fetchCurrencies(params = {}) {
93076
93664
  /**
@@ -93085,18 +93673,27 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93085
93673
  const response = await this.fetchCurrenciesFromCache(params);
93086
93674
  const currencies = this.safeValue(response, 'currencies', {});
93087
93675
  //
93088
- // {
93089
- // "data":[
93090
- // {"id":"AED","name":"United Arab Emirates Dirham","min_size":"0.01000000"},
93091
- // {"id":"AFN","name":"Afghan Afghani","min_size":"0.01000000"},
93092
- // {"id":"ALL","name":"Albanian Lek","min_size":"0.01000000"},
93093
- // {"id":"AMD","name":"Armenian Dram","min_size":"0.01000000"},
93094
- // {"id":"ANG","name":"Netherlands Antillean Gulden","min_size":"0.01000000"},
93095
- // ...
93096
- // ],
93097
- // }
93676
+ // fiat
93677
+ //
93678
+ // {
93679
+ // id: 'IMP',
93680
+ // name: 'Isle of Man Pound',
93681
+ // min_size: '0.01'
93682
+ // },
93683
+ //
93684
+ // crypto
93685
+ //
93686
+ // {
93687
+ // asset_id: '9476e3be-b731-47fa-82be-347fabc573d9',
93688
+ // code: 'AERO',
93689
+ // name: 'Aerodrome Finance',
93690
+ // color: '#0433FF',
93691
+ // sort_index: '340',
93692
+ // exponent: '8',
93693
+ // type: 'crypto',
93694
+ // address_regex: '^(?:0x)?[0-9a-fA-F]{40}$'
93695
+ // }
93098
93696
  //
93099
- const exchangeRates = this.safeValue(response, 'exchangeRates', {});
93100
93697
  //
93101
93698
  // {
93102
93699
  // "data":{
@@ -93112,24 +93709,23 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93112
93709
  // }
93113
93710
  // }
93114
93711
  //
93115
- const data = this.safeValue(currencies, 'data', []);
93116
- const dataById = this.indexBy(data, 'id');
93117
- const rates = this.safeValue(this.safeValue(exchangeRates, 'data', {}), 'rates', {});
93118
- const keys = Object.keys(rates);
93119
93712
  const result = {};
93120
- for (let i = 0; i < keys.length; i++) {
93121
- const key = keys[i];
93122
- const type = (key in dataById) ? 'fiat' : 'crypto';
93123
- const currency = this.safeValue(dataById, key, {});
93124
- const id = this.safeString(currency, 'id', key);
93125
- const name = this.safeString(currency, 'name');
93713
+ const networks = {};
93714
+ const networksById = {};
93715
+ for (let i = 0; i < currencies.length; i++) {
93716
+ const currency = currencies[i];
93717
+ const assetId = this.safeString(currency, 'asset_id');
93718
+ const id = this.safeString2(currency, 'id', 'code');
93126
93719
  const code = this.safeCurrencyCode(id);
93720
+ const name = this.safeString(currency, 'name');
93721
+ this.options['networks'][code] = name.toLowerCase();
93722
+ this.options['networksById'][code] = name.toLowerCase();
93127
93723
  result[code] = {
93724
+ 'info': currency,
93128
93725
  'id': id,
93129
93726
  'code': code,
93130
- 'info': currency,
93131
- 'type': type,
93132
- 'name': name,
93727
+ 'type': (assetId !== undefined) ? 'crypto' : 'fiat',
93728
+ 'name': this.safeString(currency, 'name'),
93133
93729
  'active': true,
93134
93730
  'deposit': undefined,
93135
93731
  'withdraw': undefined,
@@ -93146,7 +93742,14 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93146
93742
  },
93147
93743
  },
93148
93744
  };
93745
+ if (assetId !== undefined) {
93746
+ const lowerCaseName = name.toLowerCase();
93747
+ networks[code] = lowerCaseName;
93748
+ networksById[lowerCaseName] = code;
93749
+ }
93149
93750
  }
93751
+ this.options['networks'] = this.extend(networks, this.options['networks']);
93752
+ this.options['networksById'] = this.extend(networksById, this.options['networksById']);
93150
93753
  return result;
93151
93754
  }
93152
93755
  async fetchTickers(symbols = undefined, params = {}) {
@@ -93518,17 +94121,18 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93518
94121
  * @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-accounts#list-accounts
93519
94122
  * @param {object} [params] extra parameters specific to the exchange API endpoint
93520
94123
  * @param {boolean} [params.v3] default false, set true to use v3 api endpoint
94124
+ * @param {object} [params.type] "spot" (default) or "swap"
93521
94125
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
93522
94126
  */
93523
94127
  await this.loadMarkets();
93524
- const request = {
93525
- 'limit': 250,
93526
- };
94128
+ const request = {};
93527
94129
  let response = undefined;
93528
94130
  const isV3 = this.safeBool(params, 'v3', false);
93529
- params = this.omit(params, 'v3');
94131
+ const type = this.safeString(params, 'type');
94132
+ params = this.omit(params, ['v3', 'type']);
93530
94133
  const method = this.safeString(this.options, 'fetchBalance', 'v3PrivateGetBrokerageAccounts');
93531
94134
  if ((isV3) || (method === 'v3PrivateGetBrokerageAccounts')) {
94135
+ request['limit'] = 250;
93532
94136
  response = await this.v3PrivateGetBrokerageAccounts(this.extend(request, params));
93533
94137
  }
93534
94138
  else {
@@ -93605,6 +94209,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93605
94209
  // "size": 9
93606
94210
  // }
93607
94211
  //
94212
+ params['type'] = type;
93608
94213
  return this.parseCustomBalance(response, params);
93609
94214
  }
93610
94215
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
@@ -93624,12 +94229,12 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93624
94229
  if (code !== undefined) {
93625
94230
  currency = this.currency(code);
93626
94231
  }
93627
- const request = await this.prepareAccountRequestWithCurrencyCode(code, limit, params);
93628
- const query = this.omit(params, ['account_id', 'accountId']);
94232
+ let request = undefined;
94233
+ [request, params] = await this.prepareAccountRequestWithCurrencyCode(code, limit, params);
93629
94234
  // for pagination use parameter 'starting_after'
93630
94235
  // the value for the next page can be obtained from the result of the previous call in the 'pagination' field
93631
94236
  // eg: instance.last_json_response.pagination.next_starting_after
93632
- const response = await this.v2PrivateGetAccountsAccountIdTransactions(this.extend(request, query));
94237
+ const response = await this.v2PrivateGetAccountsAccountIdTransactions(this.extend(request, params));
93633
94238
  return this.parseLedger(response['data'], currency, since, limit);
93634
94239
  }
93635
94240
  parseLedgerEntryStatus(status) {
@@ -93987,6 +94592,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93987
94592
  }
93988
94593
  async prepareAccountRequestWithCurrencyCode(code = undefined, limit = undefined, params = {}) {
93989
94594
  let accountId = this.safeString2(params, 'account_id', 'accountId');
94595
+ params = this.omit(params, ['account_id', 'accountId']);
93990
94596
  if (accountId === undefined) {
93991
94597
  if (code === undefined) {
93992
94598
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' prepareAccountRequestWithCurrencyCode() method requires an account_id (or accountId) parameter OR a currency code argument');
@@ -94002,7 +94608,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94002
94608
  if (limit !== undefined) {
94003
94609
  request['limit'] = limit;
94004
94610
  }
94005
- return request;
94611
+ return [request, params];
94006
94612
  }
94007
94613
  async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
94008
94614
  /**
@@ -95175,6 +95781,140 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
95175
95781
  const data = this.safeValue(response, 'data', {});
95176
95782
  return this.parseTransaction(data, currency);
95177
95783
  }
95784
+ async fetchDepositAddressesByNetwork(code, params = {}) {
95785
+ /**
95786
+ * @method
95787
+ * @name coinbase#fetchDepositAddress
95788
+ * @description fetch the deposit address for a currency associated with this account
95789
+ * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postcoinbaseaccountaddresses
95790
+ * @param {string} code unified currency code
95791
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
95792
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
95793
+ */
95794
+ await this.loadMarkets();
95795
+ const currency = this.currency(code);
95796
+ let request = undefined;
95797
+ [request, params] = await this.prepareAccountRequestWithCurrencyCode(currency['code']);
95798
+ const response = await this.v2PrivateGetAccountsAccountIdAddresses(this.extend(request, params));
95799
+ //
95800
+ // {
95801
+ // pagination: {
95802
+ // ending_before: null,
95803
+ // starting_after: null,
95804
+ // previous_ending_before: null,
95805
+ // next_starting_after: null,
95806
+ // limit: '25',
95807
+ // order: 'desc',
95808
+ // previous_uri: null,
95809
+ // next_uri: null
95810
+ // },
95811
+ // data: [
95812
+ // {
95813
+ // id: '64ceb5f1-5fa2-5310-a4ff-9fd46271003d',
95814
+ // address: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',
95815
+ // address_info: { address: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk' },
95816
+ // name: null,
95817
+ // created_at: '2023-05-29T21:12:12Z',
95818
+ // updated_at: '2023-05-29T21:12:12Z',
95819
+ // network: 'solana',
95820
+ // uri_scheme: 'solana',
95821
+ // resource: 'address',
95822
+ // resource_path: '/v2/accounts/a7b3d387-bfb8-5ce7-b8da-1f507e81cf25/addresses/64ceb5f1-5fa2-5310-a4ff-9fd46271003d',
95823
+ // warnings: [
95824
+ // {
95825
+ // type: 'correct_address_warning',
95826
+ // title: 'This is an ERC20 USDC address.',
95827
+ // details: 'Only send ERC20 USD Coin (USDC) to this address.',
95828
+ // image_url: 'https://www.coinbase.com/assets/addresses/global-receive-warning-a3d91807e61c717e5a38d270965003dcc025ca8a3cea40ec3d7835b7c86087fa.png',
95829
+ // options: [ { text: 'I understand', style: 'primary', id: 'dismiss' } ]
95830
+ // }
95831
+ // ],
95832
+ // qr_code_image_url: 'https://static-assets.coinbase.com/p2p/l2/asset_network_combinations/v5/usdc-solana.png',
95833
+ // address_label: 'USDC address (Solana)',
95834
+ // default_receive: true,
95835
+ // deposit_uri: 'solana:5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk?spl-token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
95836
+ // callback_url: null,
95837
+ // share_address_copy: {
95838
+ // line1: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',
95839
+ // line2: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.'
95840
+ // },
95841
+ // receive_subtitle: 'ERC-20',
95842
+ // inline_warning: {
95843
+ // text: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.',
95844
+ // tooltip: {
95845
+ // title: 'USDC (Solana)',
95846
+ // subtitle: 'This address can only receive USDC-SPL from Solana network.'
95847
+ // }
95848
+ // }
95849
+ // },
95850
+ // ...
95851
+ // ]
95852
+ // }
95853
+ //
95854
+ const data = this.safeList(response, 'data', []);
95855
+ const addressStructures = this.parseDepositAddresses(data, undefined, false);
95856
+ return this.indexBy(addressStructures, 'network');
95857
+ }
95858
+ parseDepositAddress(depositAddress, currency = undefined) {
95859
+ //
95860
+ // {
95861
+ // id: '64ceb5f1-5fa2-5310-a4ff-9fd46271003d',
95862
+ // address: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',
95863
+ // address_info: {
95864
+ // address: 'GCF74576I7AQ56SLMKBQAP255EGUOWCRVII3S44KEXVNJEOIFVBDMXVL',
95865
+ // destination_tag: '3722061866'
95866
+ // },
95867
+ // name: null,
95868
+ // created_at: '2023-05-29T21:12:12Z',
95869
+ // updated_at: '2023-05-29T21:12:12Z',
95870
+ // network: 'solana',
95871
+ // uri_scheme: 'solana',
95872
+ // resource: 'address',
95873
+ // resource_path: '/v2/accounts/a7b3d387-bfb8-5ce7-b8da-1f507e81cf25/addresses/64ceb5f1-5fa2-5310-a4ff-9fd46271003d',
95874
+ // warnings: [
95875
+ // {
95876
+ // type: 'correct_address_warning',
95877
+ // title: 'This is an ERC20 USDC address.',
95878
+ // details: 'Only send ERC20 USD Coin (USDC) to this address.',
95879
+ // image_url: 'https://www.coinbase.com/assets/addresses/global-receive-warning-a3d91807e61c717e5a38d270965003dcc025ca8a3cea40ec3d7835b7c86087fa.png',
95880
+ // options: [ { text: 'I understand', style: 'primary', id: 'dismiss' } ]
95881
+ // }
95882
+ // ],
95883
+ // qr_code_image_url: 'https://static-assets.coinbase.com/p2p/l2/asset_network_combinations/v5/usdc-solana.png',
95884
+ // address_label: 'USDC address (Solana)',
95885
+ // default_receive: true,
95886
+ // deposit_uri: 'solana:5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk?spl-token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
95887
+ // callback_url: null,
95888
+ // share_address_copy: {
95889
+ // line1: '5xjPKeAXpnhA2kHyinvdVeui6RXVdEa3B2J3SCAwiKnk',
95890
+ // line2: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.'
95891
+ // },
95892
+ // receive_subtitle: 'ERC-20',
95893
+ // inline_warning: {
95894
+ // text: 'This address can only receive USDC-SPL from Solana network. Don’t send USDC from other networks, other SPL tokens or NFTs, or it may result in a loss of funds.',
95895
+ // tooltip: {
95896
+ // title: 'USDC (Solana)',
95897
+ // subtitle: 'This address can only receive USDC-SPL from Solana network.'
95898
+ // }
95899
+ // }
95900
+ // }
95901
+ //
95902
+ const address = this.safeString(depositAddress, 'address');
95903
+ this.checkAddress(address);
95904
+ const networkId = this.safeString(depositAddress, 'network');
95905
+ const code = this.safeCurrencyCode(undefined, currency);
95906
+ const addressLabel = this.safeString(depositAddress, 'address_label');
95907
+ const splitAddressLabel = addressLabel.split(' ');
95908
+ const marketId = this.safeString(splitAddressLabel, 0);
95909
+ const addressInfo = this.safeDict(depositAddress, 'address_info');
95910
+ return {
95911
+ 'info': depositAddress,
95912
+ 'currency': this.safeCurrencyCode(marketId, currency),
95913
+ 'address': address,
95914
+ 'tag': this.safeString(addressInfo, 'destination_tag'),
95915
+ 'network': this.networkIdToCode(networkId, code),
95916
+ };
95917
+ }
95178
95918
  sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
95179
95919
  const version = api[0];
95180
95920
  const signed = api[1] === 'private';
@@ -97358,6 +98098,7 @@ class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["
97358
98098
  * @method
97359
98099
  * @name coincheck#fetchBalance
97360
98100
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
98101
+ * @see https://coincheck.com/documents/exchange/api#order-transactions-pagination
97361
98102
  * @param {object} [params] extra parameters specific to the exchange API endpoint
97362
98103
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
97363
98104
  */
@@ -97370,6 +98111,7 @@ class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["
97370
98111
  * @method
97371
98112
  * @name coincheck#fetchOpenOrders
97372
98113
  * @description fetch all unfilled currently open orders
98114
+ * @see https://coincheck.com/documents/exchange/api#order-opens
97373
98115
  * @param {string} symbol unified market symbol
97374
98116
  * @param {int} [since] the earliest time in ms to fetch open orders for
97375
98117
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -97445,6 +98187,7 @@ class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["
97445
98187
  * @method
97446
98188
  * @name coincheck#fetchOrderBook
97447
98189
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
98190
+ * @see https://coincheck.com/documents/exchange/api#order-book
97448
98191
  * @param {string} symbol unified symbol of the market to fetch the order book for
97449
98192
  * @param {int} [limit] the maximum amount of order book entries to return
97450
98193
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -97501,6 +98244,7 @@ class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["
97501
98244
  * @method
97502
98245
  * @name coincheck#fetchTicker
97503
98246
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
98247
+ * @see https://coincheck.com/documents/exchange/api#ticker
97504
98248
  * @param {string} symbol unified symbol of the market to fetch the ticker for
97505
98249
  * @param {object} [params] extra parameters specific to the exchange API endpoint
97506
98250
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -97614,6 +98358,7 @@ class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["
97614
98358
  * @method
97615
98359
  * @name coincheck#fetchMyTrades
97616
98360
  * @description fetch all trades made by the user
98361
+ * @see https://coincheck.com/documents/exchange/api#order-transactions-pagination
97617
98362
  * @param {string} symbol unified market symbol
97618
98363
  * @param {int} [since] the earliest time in ms to fetch trades for
97619
98364
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -97657,6 +98402,7 @@ class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["
97657
98402
  * @method
97658
98403
  * @name coincheck#fetchTrades
97659
98404
  * @description get the list of most recent trades for a particular symbol
98405
+ * @see https://coincheck.com/documents/exchange/api#public-trades
97660
98406
  * @param {string} symbol unified symbol of the market to fetch trades for
97661
98407
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
97662
98408
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -97690,6 +98436,7 @@ class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["
97690
98436
  * @method
97691
98437
  * @name coincheck#fetchTradingFees
97692
98438
  * @description fetch the trading fees for multiple markets
98439
+ * @see https://coincheck.com/documents/exchange/api#account-info
97693
98440
  * @param {object} [params] extra parameters specific to the exchange API endpoint
97694
98441
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
97695
98442
  */
@@ -97736,6 +98483,7 @@ class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["
97736
98483
  * @method
97737
98484
  * @name coincheck#createOrder
97738
98485
  * @description create a trade order
98486
+ * @see https://coincheck.com/documents/exchange/api#order-new
97739
98487
  * @param {string} symbol unified symbol of the market to create an order in
97740
98488
  * @param {string} type 'market' or 'limit'
97741
98489
  * @param {string} side 'buy' or 'sell'
@@ -97772,6 +98520,7 @@ class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["
97772
98520
  * @method
97773
98521
  * @name coincheck#cancelOrder
97774
98522
  * @description cancels an open order
98523
+ * @see https://coincheck.com/documents/exchange/api#order-cancel
97775
98524
  * @param {string} id order id
97776
98525
  * @param {string} symbol not used by coincheck cancelOrder ()
97777
98526
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -97787,6 +98536,7 @@ class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["
97787
98536
  * @method
97788
98537
  * @name coincheck#fetchDeposits
97789
98538
  * @description fetch all deposits made to an account
98539
+ * @see https://coincheck.com/documents/exchange/api#account-deposits
97790
98540
  * @param {string} code unified currency code
97791
98541
  * @param {int} [since] the earliest time in ms to fetch deposits for
97792
98542
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -97835,6 +98585,7 @@ class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["
97835
98585
  * @method
97836
98586
  * @name coincheck#fetchWithdrawals
97837
98587
  * @description fetch all withdrawals made from an account
98588
+ * @see https://coincheck.com/documents/exchange/api#withdraws
97838
98589
  * @param {string} code unified currency code
97839
98590
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
97840
98591
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -105908,6 +106659,7 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
105908
106659
  'fetchPositionsRisk': false,
105909
106660
  'fetchPremiumIndexOHLCV': false,
105910
106661
  'fetchTicker': true,
106662
+ 'fetchTickers': true,
105911
106663
  'fetchTrades': true,
105912
106664
  'fetchTradingFee': true,
105913
106665
  'fetchTradingFees': false,
@@ -105942,6 +106694,8 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
105942
106694
  'get': [
105943
106695
  'orderBook',
105944
106696
  'ticker',
106697
+ 'tickerAll',
106698
+ 'products',
105945
106699
  'transactions',
105946
106700
  'tradingPairs',
105947
106701
  ],
@@ -105990,6 +106744,16 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
105990
106744
  'unconfirmedEthereumDeposits',
105991
106745
  'unconfirmedLitecoinDeposits',
105992
106746
  'unconfirmedRippleDeposits',
106747
+ 'cancelAllOpenOrders',
106748
+ 'withdrawVirtualCurrency',
106749
+ 'virtualCurrencyDepositAddresses',
106750
+ 'unconfirmedVirtualCurrencyDeposits',
106751
+ 'adaWithdrawal',
106752
+ 'adaDepositAddresses',
106753
+ 'unconfirmedAdaDeposits',
106754
+ 'solWithdrawal',
106755
+ 'solDepositAddresses',
106756
+ 'unconfirmedSolDeposits',
105993
106757
  ],
105994
106758
  },
105995
106759
  },
@@ -106034,6 +106798,8 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106034
106798
  'XRP': 'privatePostRippleWithdrawal',
106035
106799
  'DASH': 'privatePostDashWithdrawal',
106036
106800
  'DAI': 'privatePostDaiWithdrawal',
106801
+ 'ADA': 'privatePostAdaWithdrawal',
106802
+ 'SOL': 'privatePostSolWithdrawal',
106037
106803
  },
106038
106804
  },
106039
106805
  },
@@ -106058,6 +106824,7 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106058
106824
  * @method
106059
106825
  * @name coinmate#fetchMarkets
106060
106826
  * @description retrieves data on all markets for coinmate
106827
+ * @see https://coinmate.docs.apiary.io/#reference/trading-pairs/get-trading-pairs/get
106061
106828
  * @param {object} [params] extra parameters specific to the exchange API endpoint
106062
106829
  * @returns {object[]} an array of objects representing market data
106063
106830
  */
@@ -106164,6 +106931,7 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106164
106931
  * @method
106165
106932
  * @name coinmate#fetchBalance
106166
106933
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
106934
+ * @see https://coinmate.docs.apiary.io/#reference/balance/get-balances/post
106167
106935
  * @param {object} [params] extra parameters specific to the exchange API endpoint
106168
106936
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
106169
106937
  */
@@ -106176,6 +106944,7 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106176
106944
  * @method
106177
106945
  * @name coinmate#fetchOrderBook
106178
106946
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
106947
+ * @see https://coinmate.docs.apiary.io/#reference/order-book/get-order-book/get
106179
106948
  * @param {string} symbol unified symbol of the market to fetch the order book for
106180
106949
  * @param {int} [limit] the maximum amount of order book entries to return
106181
106950
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -106197,6 +106966,7 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106197
106966
  * @method
106198
106967
  * @name coinmate#fetchTicker
106199
106968
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
106969
+ * @see https://coinmate.docs.apiary.io/#reference/ticker/get-ticker/get
106200
106970
  * @param {string} symbol unified symbol of the market to fetch the ticker for
106201
106971
  * @param {object} [params] extra parameters specific to the exchange API endpoint
106202
106972
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -106207,7 +106977,82 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106207
106977
  'currencyPair': market['id'],
106208
106978
  };
106209
106979
  const response = await this.publicGetTicker(this.extend(request, params));
106210
- const ticker = this.safeValue(response, 'data');
106980
+ //
106981
+ // {
106982
+ // "error": false,
106983
+ // "errorMessage": null,
106984
+ // "data": {
106985
+ // "last": 0.55105,
106986
+ // "high": 0.56439,
106987
+ // "low": 0.54358,
106988
+ // "amount": 37038.993381,
106989
+ // "bid": 0.54595,
106990
+ // "ask": 0.55324,
106991
+ // "change": 3.03659243,
106992
+ // "open": 0.53481,
106993
+ // "timestamp": 1708074779
106994
+ // }
106995
+ // }
106996
+ //
106997
+ const data = this.safeValue(response, 'data');
106998
+ return this.parseTicker(data, market);
106999
+ }
107000
+ async fetchTickers(symbols = undefined, params = {}) {
107001
+ /**
107002
+ * @method
107003
+ * @name coinmate#fetchTickers
107004
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
107005
+ * @see https://coinmate.docs.apiary.io/#reference/ticker/get-ticker-all/get
107006
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
107007
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
107008
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
107009
+ */
107010
+ await this.loadMarkets();
107011
+ symbols = this.marketSymbols(symbols);
107012
+ const response = await this.publicGetTickerAll(params);
107013
+ //
107014
+ // {
107015
+ // "error": false,
107016
+ // "errorMessage": null,
107017
+ // "data": {
107018
+ // "LTC_BTC": {
107019
+ // "last": "0.001337",
107020
+ // "high": "0.001348",
107021
+ // "low": "0.001332",
107022
+ // "amount": "34.75472959",
107023
+ // "bid": "0.001348",
107024
+ // "ask": "0.001356",
107025
+ // "change": "-0.74239050",
107026
+ // "open": "0.001347",
107027
+ // "timestamp": "1708074485"
107028
+ // }
107029
+ // }
107030
+ // }
107031
+ //
107032
+ const data = this.safeValue(response, 'data', {});
107033
+ const keys = Object.keys(data);
107034
+ const result = {};
107035
+ for (let i = 0; i < keys.length; i++) {
107036
+ const market = this.market(keys[i]);
107037
+ const ticker = this.parseTicker(this.safeValue(data, keys[i]), market);
107038
+ result[market['symbol']] = ticker;
107039
+ }
107040
+ return this.filterByArrayTickers(result, 'symbol', symbols);
107041
+ }
107042
+ parseTicker(ticker, market = undefined) {
107043
+ //
107044
+ // {
107045
+ // "last": "0.001337",
107046
+ // "high": "0.001348",
107047
+ // "low": "0.001332",
107048
+ // "amount": "34.75472959",
107049
+ // "bid": "0.001348",
107050
+ // "ask": "0.001356",
107051
+ // "change": "-0.74239050",
107052
+ // "open": "0.001347",
107053
+ // "timestamp": "1708074485"
107054
+ // }
107055
+ //
106211
107056
  const timestamp = this.safeTimestamp(ticker, 'timestamp');
106212
107057
  const last = this.safeNumber(ticker, 'last');
106213
107058
  return this.safeTicker({
@@ -106238,6 +107083,7 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106238
107083
  * @method
106239
107084
  * @name coinmate#fetchDepositsWithdrawals
106240
107085
  * @description fetch history of deposits and withdrawals
107086
+ * @see https://coinmate.docs.apiary.io/#reference/transfers/get-transfer-history/post
106241
107087
  * @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
106242
107088
  * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
106243
107089
  * @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
@@ -106350,6 +107196,12 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106350
107196
  * @method
106351
107197
  * @name coinmate#withdraw
106352
107198
  * @description make a withdrawal
107199
+ * @see https://coinmate.docs.apiary.io/#reference/bitcoin-withdrawal-and-deposit/withdraw-bitcoins/post
107200
+ * @see https://coinmate.docs.apiary.io/#reference/litecoin-withdrawal-and-deposit/withdraw-litecoins/post
107201
+ * @see https://coinmate.docs.apiary.io/#reference/ethereum-withdrawal-and-deposit/withdraw-ethereum/post
107202
+ * @see https://coinmate.docs.apiary.io/#reference/ripple-withdrawal-and-deposit/withdraw-ripple/post
107203
+ * @see https://coinmate.docs.apiary.io/#reference/cardano-withdrawal-and-deposit/withdraw-cardano/post
107204
+ * @see https://coinmate.docs.apiary.io/#reference/solana-withdrawal-and-deposit/withdraw-solana/post
106353
107205
  * @param {string} code unified currency code
106354
107206
  * @param {float} amount the amount to withdraw
106355
107207
  * @param {string} address the address to withdraw to
@@ -106403,6 +107255,7 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106403
107255
  * @method
106404
107256
  * @name coinmate#fetchMyTrades
106405
107257
  * @description fetch all trades made by the user
107258
+ * @see https://coinmate.docs.apiary.io/#reference/trade-history/get-trade-history/post
106406
107259
  * @param {string} symbol unified market symbol
106407
107260
  * @param {int} [since] the earliest time in ms to fetch trades for
106408
107261
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -106495,6 +107348,7 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106495
107348
  * @method
106496
107349
  * @name coinmate#fetchTrades
106497
107350
  * @description get the list of most recent trades for a particular symbol
107351
+ * @see https://coinmate.docs.apiary.io/#reference/transactions/transactions/get
106498
107352
  * @param {string} symbol unified symbol of the market to fetch trades for
106499
107353
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
106500
107354
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -106532,6 +107386,7 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106532
107386
  * @method
106533
107387
  * @name coinmate#fetchTradingFee
106534
107388
  * @description fetch the trading fees for a market
107389
+ * @see https://coinmate.docs.apiary.io/#reference/trader-fees/get-trading-fees/post
106535
107390
  * @param {string} symbol unified market symbol
106536
107391
  * @param {object} [params] extra parameters specific to the exchange API endpoint
106537
107392
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -106568,6 +107423,7 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106568
107423
  * @method
106569
107424
  * @name coinmate#fetchOpenOrders
106570
107425
  * @description fetch all unfilled currently open orders
107426
+ * @see https://coinmate.docs.apiary.io/#reference/order/get-open-orders/post
106571
107427
  * @param {string} symbol unified market symbol
106572
107428
  * @param {int} [since] the earliest time in ms to fetch open orders for
106573
107429
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -106583,6 +107439,7 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106583
107439
  * @method
106584
107440
  * @name coinmate#fetchOrders
106585
107441
  * @description fetches information on multiple orders made by the user
107442
+ * @see https://coinmate.docs.apiary.io/#reference/order/order-history/post
106586
107443
  * @param {string} symbol unified market symbol of the market orders were made in
106587
107444
  * @param {int} [since] the earliest time in ms to fetch orders for
106588
107445
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -106706,6 +107563,10 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106706
107563
  * @method
106707
107564
  * @name coinmate#createOrder
106708
107565
  * @description create a trade order
107566
+ * @see https://coinmate.docs.apiary.io/#reference/order/buy-limit-order/post
107567
+ * @see https://coinmate.docs.apiary.io/#reference/order/sell-limit-order/post
107568
+ * @see https://coinmate.docs.apiary.io/#reference/order/buy-instant-order/post
107569
+ * @see https://coinmate.docs.apiary.io/#reference/order/sell-instant-order/post
106709
107570
  * @param {string} symbol unified symbol of the market to create an order in
106710
107571
  * @param {string} type 'market' or 'limit'
106711
107572
  * @param {string} side 'buy' or 'sell'
@@ -106746,6 +107607,8 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106746
107607
  * @method
106747
107608
  * @name coinmate#fetchOrder
106748
107609
  * @description fetches information on an order made by the user
107610
+ * @see https://coinmate.docs.apiary.io/#reference/order/get-order-by-orderid/post
107611
+ * @see https://coinmate.docs.apiary.io/#reference/order/get-order-by-clientorderid/post
106749
107612
  * @param {string} symbol unified symbol of the market the order was made in
106750
107613
  * @param {object} [params] extra parameters specific to the exchange API endpoint
106751
107614
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -106767,6 +107630,7 @@ class coinmate extends _abstract_coinmate_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
106767
107630
  * @method
106768
107631
  * @name coinmate#cancelOrder
106769
107632
  * @description cancels an open order
107633
+ * @see https://coinmate.docs.apiary.io/#reference/order/cancel-order/post
106770
107634
  * @param {string} id order id
106771
107635
  * @param {string} symbol not used by coinmate cancelOrder ()
106772
107636
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -112083,6 +112947,7 @@ class coinspot extends _abstract_coinspot_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
112083
112947
  * @method
112084
112948
  * @name coinspot#fetchBalance
112085
112949
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
112950
+ * @see https://www.coinspot.com.au/api#listmybalance
112086
112951
  * @param {object} [params] extra parameters specific to the exchange API endpoint
112087
112952
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
112088
112953
  */
@@ -112112,6 +112977,7 @@ class coinspot extends _abstract_coinspot_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
112112
112977
  * @method
112113
112978
  * @name coinspot#fetchOrderBook
112114
112979
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
112980
+ * @see https://www.coinspot.com.au/api#listopenorders
112115
112981
  * @param {string} symbol unified symbol of the market to fetch the order book for
112116
112982
  * @param {int} [limit] the maximum amount of order book entries to return
112117
112983
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -112165,6 +113031,7 @@ class coinspot extends _abstract_coinspot_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
112165
113031
  * @method
112166
113032
  * @name coinspot#fetchTicker
112167
113033
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
113034
+ * @see https://www.coinspot.com.au/api#latestprices
112168
113035
  * @param {string} symbol unified symbol of the market to fetch the ticker for
112169
113036
  * @param {object} [params] extra parameters specific to the exchange API endpoint
112170
113037
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -112238,6 +113105,7 @@ class coinspot extends _abstract_coinspot_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
112238
113105
  * @method
112239
113106
  * @name coinspot#fetchTrades
112240
113107
  * @description get the list of most recent trades for a particular symbol
113108
+ * @see https://www.coinspot.com.au/api#orderhistory
112241
113109
  * @param {string} symbol unified symbol of the market to fetch trades for
112242
113110
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
112243
113111
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -112266,6 +113134,7 @@ class coinspot extends _abstract_coinspot_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
112266
113134
  * @method
112267
113135
  * @name coinspot#fetchMyTrades
112268
113136
  * @description fetch all trades made by the user
113137
+ * @see https://www.coinspot.com.au/api#rotransaction
112269
113138
  * @param {string} symbol unified market symbol
112270
113139
  * @param {int} [since] the earliest time in ms to fetch trades for
112271
113140
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -112421,6 +113290,8 @@ class coinspot extends _abstract_coinspot_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
112421
113290
  * @method
112422
113291
  * @name coinspot#cancelOrder
112423
113292
  * @description cancels an open order
113293
+ * @see https://www.coinspot.com.au/api#cancelbuyorder
113294
+ * @see https://www.coinspot.com.au/api#cancelsellorder
112424
113295
  * @param {string} id order id
112425
113296
  * @param {string} symbol not used by coinspot cancelOrder ()
112426
113297
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -114782,13 +115653,13 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
114782
115653
  * @method
114783
115654
  * @name cryptocom#fetchDepositWithdrawFees
114784
115655
  * @description fetch deposit and withdraw fees
114785
- * @see https://exchange-docs.crypto.com/spot/index.html#private-get-currency-networks
115656
+ * @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-currency-networks
114786
115657
  * @param {string[]|undefined} codes list of unified currency codes
114787
115658
  * @param {object} [params] extra parameters specific to the exchange API endpoint
114788
115659
  * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
114789
115660
  */
114790
115661
  await this.loadMarkets();
114791
- const response = await this.v2PrivatePostPrivateGetCurrencyNetworks(params);
115662
+ const response = await this.v1PrivatePostPrivateGetCurrencyNetworks(params);
114792
115663
  const data = this.safeValue(response, 'result');
114793
115664
  const currencyMap = this.safeValue(data, 'currency_map');
114794
115665
  return this.parseDepositWithdrawFees(currencyMap, codes, 'full_name');
@@ -122544,7 +123415,7 @@ class deribit extends _abstract_deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
122544
123415
  const amount = this.safeString(order, 'amount');
122545
123416
  let cost = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(filledString, averageString);
122546
123417
  if (market['inverse']) {
122547
- if (this.parseNumber(averageString) !== 0) {
123418
+ if (averageString !== '0') {
122548
123419
  cost = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv(amount, averageString);
122549
123420
  }
122550
123421
  }
@@ -140315,6 +141186,8 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
140315
141186
  'public/orderbook/{symbol}': 10,
140316
141187
  'public/candles': 10,
140317
141188
  'public/candles/{symbol}': 10,
141189
+ 'public/converted/candles': 10,
141190
+ 'public/converted/candles/{symbol}': 10,
140318
141191
  'public/futures/info': 10,
140319
141192
  'public/futures/info/{symbol}': 10,
140320
141193
  'public/futures/history/funding': 10,
@@ -156951,6 +157824,9 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
156951
157824
  'fetchCrossBorrowRates': false,
156952
157825
  'fetchCurrencies': true,
156953
157826
  'fetchDeposit': true,
157827
+ 'fetchDepositAddress': true,
157828
+ 'fetchDepositAddresses': false,
157829
+ 'fetchDepositAddressesByNetwork': false,
156954
157830
  'fetchDeposits': true,
156955
157831
  'fetchFundingHistory': false,
156956
157832
  'fetchFundingRate': false,
@@ -157010,7 +157886,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
157010
157886
  },
157011
157887
  'www': 'https://idex.io',
157012
157888
  'doc': [
157013
- 'https://docs.idex.io/',
157889
+ 'https://api-docs-v3.idex.io/',
157014
157890
  ],
157015
157891
  },
157016
157892
  'api': {
@@ -158598,6 +159474,62 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
158598
159474
  const authenticated = hasApiKey && hasSecret && hasWalletAddress && hasPrivateKey;
158599
159475
  return authenticated ? (defaultCost / 2) : defaultCost;
158600
159476
  }
159477
+ async fetchDepositAddress(code = undefined, params = {}) {
159478
+ /**
159479
+ * @method
159480
+ * @name idex#fetchDepositAddress
159481
+ * @description fetch the Polygon address of the wallet
159482
+ * @see https://api-docs-v3.idex.io/#get-wallets
159483
+ * @param {string} code not used by idex
159484
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
159485
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
159486
+ */
159487
+ const request = {};
159488
+ request['nonce'] = this.uuidv1();
159489
+ const response = await this.privateGetWallets(this.extend(request, params));
159490
+ //
159491
+ // [
159492
+ // {
159493
+ // address: "0x37A1827CA64C94A26028bDCb43FBDCB0bf6DAf5B",
159494
+ // totalPortfolioValueUsd: "0.00",
159495
+ // time: "1678342148086"
159496
+ // },
159497
+ // {
159498
+ // address: "0x0Ef3456E616552238B0c562d409507Ed6051A7b3",
159499
+ // totalPortfolioValueUsd: "15.90",
159500
+ // time: "1691697811659"
159501
+ // }
159502
+ // ]
159503
+ //
159504
+ return this.parseDepositAddress(response);
159505
+ }
159506
+ parseDepositAddress(depositAddress, currency = undefined) {
159507
+ //
159508
+ // [
159509
+ // {
159510
+ // address: "0x37A1827CA64C94A26028bDCb43FBDCB0bf6DAf5B",
159511
+ // totalPortfolioValueUsd: "0.00",
159512
+ // time: "1678342148086"
159513
+ // },
159514
+ // {
159515
+ // address: "0x0Ef3456E616552238B0c562d409507Ed6051A7b3",
159516
+ // totalPortfolioValueUsd: "15.90",
159517
+ // time: "1691697811659"
159518
+ // }
159519
+ // ]
159520
+ //
159521
+ const length = depositAddress.length;
159522
+ const entry = this.safeDict(depositAddress, length - 1);
159523
+ const address = this.safeString(entry, 'address');
159524
+ this.checkAddress(address);
159525
+ return {
159526
+ 'info': depositAddress,
159527
+ 'currency': undefined,
159528
+ 'address': address,
159529
+ 'tag': undefined,
159530
+ 'network': 'MATIC',
159531
+ };
159532
+ }
158601
159533
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
158602
159534
  const network = this.safeString(this.options, 'network', 'ETH');
158603
159535
  const version = this.safeString(this.options, 'version', 'v1');
@@ -175081,6 +176013,9 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
175081
176013
  'fetchCrossBorrowRate': false,
175082
176014
  'fetchCrossBorrowRates': false,
175083
176015
  'fetchCurrencies': true,
176016
+ 'fetchDepositAddress': false,
176017
+ 'fetchDepositAddresses': false,
176018
+ 'fetchDepositAddressesByNetwork': false,
175084
176019
  'fetchDepositsWithdrawals': true,
175085
176020
  'fetchDepositWithdrawFees': false,
175086
176021
  'fetchIsolatedBorrowRate': false,
@@ -182130,6 +183065,9 @@ class mercado extends _abstract_mercado_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
182130
183065
  'fetchBorrowRateHistory': false,
182131
183066
  'fetchCrossBorrowRate': false,
182132
183067
  'fetchCrossBorrowRates': false,
183068
+ 'fetchDepositAddress': false,
183069
+ 'fetchDepositAddresses': false,
183070
+ 'fetchDepositAddressesByNetwork': false,
182133
183071
  'fetchFundingHistory': false,
182134
183072
  'fetchFundingRate': false,
182135
183073
  'fetchFundingRateHistory': false,
@@ -192579,6 +193517,9 @@ class oceanex extends _abstract_oceanex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
192579
193517
  'fetchClosedOrders': true,
192580
193518
  'fetchCrossBorrowRate': false,
192581
193519
  'fetchCrossBorrowRates': false,
193520
+ 'fetchDepositAddress': false,
193521
+ 'fetchDepositAddresses': false,
193522
+ 'fetchDepositAddressesByNetwork': false,
192582
193523
  'fetchIsolatedBorrowRate': false,
192583
193524
  'fetchIsolatedBorrowRates': false,
192584
193525
  'fetchMarkets': true,
@@ -197078,6 +198019,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
197078
198019
  'account/quick-margin-borrow-repay': 4,
197079
198020
  'account/borrow-repay': 5 / 3,
197080
198021
  'account/simulated_margin': 10,
198022
+ 'account/position-builder': 10,
197081
198023
  'account/set-riskOffset-type': 2,
197082
198024
  'account/activate-option': 4,
197083
198025
  'account/set-auto-loan': 4,
@@ -225041,13 +225983,15 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
225041
225983
  const rawOrderBook = this.safeValue(data, 0);
225042
225984
  const timestamp = this.safeInteger(rawOrderBook, 'ts');
225043
225985
  const incrementalBook = channel === 'books';
225044
- let storedOrderBook = undefined;
225045
225986
  if (incrementalBook) {
225046
- storedOrderBook = this.safeValue(this.orderbooks, symbol);
225047
- if (storedOrderBook === undefined) {
225048
- storedOrderBook = this.countedOrderBook({});
225049
- storedOrderBook['symbol'] = symbol;
225987
+ // storedOrderBook = this.safeValue (this.orderbooks, symbol);
225988
+ if (!(symbol in this.orderbooks)) {
225989
+ // const ob = this.orderBook ({});
225990
+ const ob = this.countedOrderBook({});
225991
+ ob['symbol'] = symbol;
225992
+ this.orderbooks[symbol] = ob;
225050
225993
  }
225994
+ const storedOrderBook = this.orderbooks[symbol];
225051
225995
  const asks = this.safeValue(rawOrderBook, 'asks', []);
225052
225996
  const bids = this.safeValue(rawOrderBook, 'bids', []);
225053
225997
  this.handleDeltas(storedOrderBook['asks'], asks);
@@ -225082,10 +226026,12 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
225082
226026
  }
225083
226027
  }
225084
226028
  else {
225085
- storedOrderBook = this.parseOrderBook(rawOrderBook, symbol, timestamp);
226029
+ const orderbook = this.orderBook({});
226030
+ const parsedOrderbook = this.parseOrderBook(rawOrderBook, symbol, timestamp);
226031
+ orderbook.reset(parsedOrderbook);
226032
+ this.orderbooks[symbol] = orderbook;
225086
226033
  }
225087
- this.orderbooks[symbol] = storedOrderBook;
225088
- client.resolve(storedOrderBook, messageHash);
226034
+ client.resolve(this.orderbooks[symbol], messageHash);
225089
226035
  }
225090
226036
  handleDelta(bookside, delta) {
225091
226037
  const bidAsk = this.parseBidAsk(delta, 0, 1);
@@ -227585,13 +228531,13 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
227585
228531
  const update = datas[i];
227586
228532
  const marketId = this.safeString(update, 'symbol');
227587
228533
  const symbol = this.safeSymbol(marketId);
227588
- let orderbook = this.safeDict(this.orderbooks, symbol);
227589
- if (orderbook === undefined) {
227590
- orderbook = this.orderBook({}, limit);
227591
- orderbook['symbol'] = symbol;
227592
- this.orderbooks[symbol] = orderbook;
228534
+ if (!(symbol in this.orderbooks)) {
228535
+ const ob = this.orderBook({}, limit);
228536
+ ob['symbol'] = symbol;
228537
+ this.orderbooks[symbol] = ob;
227593
228538
  }
227594
- const type = this.safeValue(update, 'type');
228539
+ const orderbook = this.orderbooks[symbol];
228540
+ const type = this.safeString(update, 'type');
227595
228541
  if ((type === 'snapshot') || (!(channelName.indexOf('increase') >= 0))) {
227596
228542
  orderbook.reset({});
227597
228543
  }
@@ -227615,12 +228561,12 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
227615
228561
  const depths = data['depths'];
227616
228562
  const marketId = this.safeString(data, 'symbol');
227617
228563
  const symbol = this.safeSymbol(marketId);
227618
- let orderbook = this.safeDict(this.orderbooks, symbol);
227619
- if (orderbook === undefined) {
227620
- orderbook = this.orderBook({}, limit);
227621
- orderbook['symbol'] = symbol;
227622
- this.orderbooks[symbol] = orderbook;
228564
+ if (!(symbol in this.orderbooks)) {
228565
+ const ob = this.orderBook({}, limit);
228566
+ ob['symbol'] = symbol;
228567
+ this.orderbooks[symbol] = ob;
227623
228568
  }
228569
+ const orderbook = this.orderbooks[symbol];
227624
228570
  const way = this.safeNumber(data, 'way');
227625
228571
  const side = (way === 1) ? 'bids' : 'asks';
227626
228572
  if (way === 1) {
@@ -228199,11 +229145,11 @@ class bitmex extends _bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
228199
229145
  const market = this.safeMarket(marketId);
228200
229146
  const symbol = market['symbol'];
228201
229147
  const messageHash = table + ':' + marketId;
228202
- let ticker = this.safeDict(this.tickers, symbol, {});
229148
+ const ticker = this.safeDict(this.tickers, symbol, {});
228203
229149
  const info = this.safeDict(ticker, 'info', {});
228204
- ticker = this.parseTicker(this.extend(info, update), market);
228205
- tickers[symbol] = ticker;
228206
- this.tickers[symbol] = ticker;
229150
+ const parsedTicker = this.parseTicker(this.extend(info, update), market);
229151
+ tickers[symbol] = parsedTicker;
229152
+ this.tickers[symbol] = parsedTicker;
228207
229153
  client.resolve(ticker, messageHash);
228208
229154
  }
228209
229155
  client.resolve(tickers, 'instrument');
@@ -235199,7 +236145,7 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
235199
236145
  stored.append(parsed);
235200
236146
  }
235201
236147
  const messageHash = 'trades';
235202
- this.trades = stored;
236148
+ this.trades = stored; // trades don't have symbol
235203
236149
  client.resolve(this.trades, messageHash);
235204
236150
  }
235205
236151
  parseWsOldTrade(trade, market = undefined) {
@@ -235243,7 +236189,7 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
235243
236189
  // }
235244
236190
  //
235245
236191
  const data = this.safeValue(message, 'data', []);
235246
- const stored = this.trades;
236192
+ const stored = this.trades; // to do fix this, this.trades is not meant to be used like this
235247
236193
  for (let i = 0; i < data.length; i++) {
235248
236194
  const rawTrade = data[i];
235249
236195
  const parsed = this.parseWsOldTrade(rawTrade);
@@ -243214,6 +244160,7 @@ class gate extends _gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
243214
244160
  /**
243215
244161
  * @method
243216
244162
  * @name gate#watchTicker
244163
+ * @see https://www.gate.io/docs/developers/apiv4/ws/en/#tickers-channel
243217
244164
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
243218
244165
  * @param {string} symbol unified symbol of the market to fetch the ticker for
243219
244166
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -243222,45 +244169,21 @@ class gate extends _gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
243222
244169
  await this.loadMarkets();
243223
244170
  const market = this.market(symbol);
243224
244171
  symbol = market['symbol'];
243225
- const marketId = market['id'];
243226
- const url = this.getUrlByMarket(market);
243227
- const messageType = this.getTypeByMarket(market);
243228
- const [topic, query] = this.handleOptionAndParams(params, 'watchTicker', 'name', 'tickers');
243229
- const channel = messageType + '.' + topic;
243230
- const messageHash = 'ticker:' + symbol;
243231
- const payload = [marketId];
243232
- return await this.subscribePublic(url, messageHash, payload, channel, query);
244172
+ params['callerMethodName'] = 'watchTicker';
244173
+ const result = await this.watchTickers([symbol], params);
244174
+ return this.safeValue(result, symbol);
243233
244175
  }
243234
244176
  async watchTickers(symbols = undefined, params = {}) {
243235
244177
  /**
243236
244178
  * @method
243237
244179
  * @name gate#watchTickers
244180
+ * @see https://www.gate.io/docs/developers/apiv4/ws/en/#tickers-channel
243238
244181
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
243239
244182
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
243240
244183
  * @param {object} [params] extra parameters specific to the exchange API endpoint
243241
244184
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
243242
244185
  */
243243
- await this.loadMarkets();
243244
- symbols = this.marketSymbols(symbols);
243245
- if (symbols === undefined) {
243246
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' watchTickers requires symbols');
243247
- }
243248
- const market = this.market(symbols[0]);
243249
- const messageType = this.getTypeByMarket(market);
243250
- const marketIds = this.marketIds(symbols);
243251
- const [topic, query] = this.handleOptionAndParams(params, 'watchTicker', 'method', 'tickers');
243252
- const channel = messageType + '.' + topic;
243253
- const messageHash = 'tickers';
243254
- const url = this.getUrlByMarket(market);
243255
- const ticker = await this.subscribePublic(url, messageHash, marketIds, channel, query);
243256
- let result = {};
243257
- if (this.newUpdates) {
243258
- result[ticker['symbol']] = ticker;
243259
- }
243260
- else {
243261
- result = this.tickers;
243262
- }
243263
- return this.filterByArray(result, 'symbol', symbols, true);
244186
+ return await this.subscribeWatchTickersAndBidsAsks(symbols, 'watchTickers', this.extend({ 'method': 'tickers' }, params));
243264
244187
  }
243265
244188
  handleTicker(client, message) {
243266
244189
  //
@@ -243280,6 +244203,24 @@ class gate extends _gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
243280
244203
  // "low_24h": "42721.03"
243281
244204
  // }
243282
244205
  // }
244206
+ //
244207
+ this.handleTickerAndBidAsk('ticker', client, message);
244208
+ }
244209
+ async watchBidsAsks(symbols = undefined, params = {}) {
244210
+ /**
244211
+ * @method
244212
+ * @name gate#watchBidsAsks
244213
+ * @see https://www.gate.io/docs/developers/apiv4/ws/en/#best-bid-or-ask-price
244214
+ * @see https://www.gate.io/docs/developers/apiv4/ws/en/#order-book-channel
244215
+ * @description watches best bid & ask for symbols
244216
+ * @param {string[]} symbols unified symbol of the market to fetch the ticker for
244217
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
244218
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
244219
+ */
244220
+ return await this.subscribeWatchTickersAndBidsAsks(symbols, 'watchBidsAsks', this.extend({ 'method': 'book_ticker' }, params));
244221
+ }
244222
+ handleBidAsk(client, message) {
244223
+ //
243283
244224
  // {
243284
244225
  // "time": 1671363004,
243285
244226
  // "time_ms": 1671363004235,
@@ -243296,24 +244237,63 @@ class gate extends _gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
243296
244237
  // }
243297
244238
  // }
243298
244239
  //
244240
+ this.handleTickerAndBidAsk('bidask', client, message);
244241
+ }
244242
+ async subscribeWatchTickersAndBidsAsks(symbols = undefined, callerMethodName = undefined, params = {}) {
244243
+ await this.loadMarkets();
244244
+ [callerMethodName, params] = this.handleParamString(params, 'callerMethodName', callerMethodName);
244245
+ symbols = this.marketSymbols(symbols, undefined, false);
244246
+ const market = this.market(symbols[0]);
244247
+ const messageType = this.getTypeByMarket(market);
244248
+ const marketIds = this.marketIds(symbols);
244249
+ let channelName = undefined;
244250
+ [channelName, params] = this.handleOptionAndParams(params, callerMethodName, 'method');
244251
+ const url = this.getUrlByMarket(market);
244252
+ const channel = messageType + '.' + channelName;
244253
+ const isWatchTickers = callerMethodName.indexOf('watchTicker') >= 0;
244254
+ const prefix = isWatchTickers ? 'ticker' : 'bidask';
244255
+ const messageHashes = [];
244256
+ for (let i = 0; i < symbols.length; i++) {
244257
+ const symbol = symbols[i];
244258
+ messageHashes.push(prefix + ':' + symbol);
244259
+ }
244260
+ const tickerOrBidAsk = await this.subscribePublicMultiple(url, messageHashes, marketIds, channel, params);
244261
+ if (this.newUpdates) {
244262
+ const items = {};
244263
+ items[tickerOrBidAsk['symbol']] = tickerOrBidAsk;
244264
+ return items;
244265
+ }
244266
+ const result = isWatchTickers ? this.tickers : this.bidsasks;
244267
+ return this.filterByArray(result, 'symbol', symbols, true);
244268
+ }
244269
+ handleTickerAndBidAsk(objectName, client, message) {
243299
244270
  const channel = this.safeString(message, 'channel');
243300
244271
  const parts = channel.split('.');
243301
244272
  const rawMarketType = this.safeString(parts, 0);
243302
244273
  const marketType = (rawMarketType === 'futures') ? 'contract' : 'spot';
243303
- let result = this.safeValue(message, 'result');
243304
- if (!Array.isArray(result)) {
243305
- result = [result];
244274
+ let results = [];
244275
+ if (marketType === 'contract') {
244276
+ results = this.safeList(message, 'result', []);
243306
244277
  }
243307
- for (let i = 0; i < result.length; i++) {
243308
- const ticker = result[i];
243309
- const marketId = this.safeString(ticker, 's');
244278
+ else {
244279
+ const rawTicker = this.safeDict(message, 'result', {});
244280
+ results = [rawTicker];
244281
+ }
244282
+ const isTicker = (objectName === 'ticker'); // whether ticker or bid-ask
244283
+ for (let i = 0; i < results.length; i++) {
244284
+ const rawTicker = results[i];
244285
+ const marketId = this.safeString(rawTicker, 's');
243310
244286
  const market = this.safeMarket(marketId, undefined, '_', marketType);
243311
- const parsed = this.parseTicker(ticker, market);
243312
- const symbol = parsed['symbol'];
243313
- this.tickers[symbol] = parsed;
243314
- const messageHash = 'ticker:' + symbol;
243315
- client.resolve(parsed, messageHash);
243316
- client.resolve(parsed, 'tickers');
244287
+ const parsedItem = this.parseTicker(rawTicker, market);
244288
+ const symbol = parsedItem['symbol'];
244289
+ if (isTicker) {
244290
+ this.tickers[symbol] = parsedItem;
244291
+ }
244292
+ else {
244293
+ this.bidsasks[symbol] = parsedItem;
244294
+ }
244295
+ const messageHash = objectName + ':' + symbol;
244296
+ client.resolve(parsedItem, messageHash);
243317
244297
  }
243318
244298
  }
243319
244299
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
@@ -244114,7 +245094,7 @@ class gate extends _gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
244114
245094
  'orders': this.handleOrder,
244115
245095
  'positions': this.handlePositions,
244116
245096
  'tickers': this.handleTicker,
244117
- 'book_ticker': this.handleTicker,
245097
+ 'book_ticker': this.handleBidAsk,
244118
245098
  'trades': this.handleTrades,
244119
245099
  'order_book_update': this.handleOrderBook,
244120
245100
  'balances': this.handleBalance,
@@ -244749,10 +245729,11 @@ class gemini extends _gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
244749
245729
  const market = this.safeMarket(marketId.toLowerCase());
244750
245730
  const symbol = market['symbol'];
244751
245731
  const messageHash = 'orderbook:' + symbol;
244752
- let orderbook = this.safeDict(this.orderbooks, symbol);
244753
- if (orderbook === undefined) {
244754
- orderbook = this.orderBook();
245732
+ if (!(symbol in this.orderbooks)) {
245733
+ const ob = this.orderBook();
245734
+ this.orderbooks[symbol] = ob;
244755
245735
  }
245736
+ const orderbook = this.orderbooks[symbol];
244756
245737
  const bids = orderbook['bids'];
244757
245738
  const asks = orderbook['asks'];
244758
245739
  for (let i = 0; i < rawOrderBookChanges.length; i++) {
@@ -245544,6 +246525,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
245544
246525
  const messageHash = channel + '::' + symbol;
245545
246526
  client.resolve(newTickers, messageHash);
245546
246527
  }
246528
+ client.resolve(newTickers, 'tickers');
245547
246529
  const messageHashes = this.findMessageHashes(client, 'tickers::');
245548
246530
  for (let i = 0; i < messageHashes.length; i++) {
245549
246531
  const messageHash = messageHashes[i];
@@ -272111,12 +273093,12 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
272111
273093
  const currencyId = this.safeString(transaction, 'currency_id');
272112
273094
  const code = this.safeCurrencyCode(currencyId);
272113
273095
  const status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
272114
- const feeCost = this.safeNumber(transaction, 'fee');
273096
+ const feeCostString = this.safeString(transaction, 'fee');
272115
273097
  let fee = undefined;
272116
- if (feeCost !== undefined && feeCost !== 0) {
273098
+ if (feeCostString !== undefined && feeCostString !== '0') {
272117
273099
  fee = {
272118
273100
  'currency': code,
272119
- 'cost': feeCost,
273101
+ 'cost': this.parseNumber(feeCostString),
272120
273102
  };
272121
273103
  }
272122
273104
  return {
@@ -281370,6 +282352,9 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
281370
282352
  'fetchCrossBorrowRates': false,
281371
282353
  'fetchCurrencies': true,
281372
282354
  'fetchDeposit': false,
282355
+ 'fetchDepositAddress': true,
282356
+ 'fetchDepositAddresses': false,
282357
+ 'fetchDepositAddressesByNetwork': false,
281373
282358
  'fetchDeposits': true,
281374
282359
  'fetchFundingHistory': false,
281375
282360
  'fetchFundingRate': false,
@@ -282850,7 +283835,69 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
282850
283835
  'trades': rawTrades,
282851
283836
  }, market);
282852
283837
  }
283838
+ async fetchDepositAddress(code, params = {}) {
283839
+ /**
283840
+ * @method
283841
+ * @name timex#fetchDepositAddress
283842
+ * @description fetch the deposit address for a currency associated with this account, does not accept params["network"]
283843
+ * @param {string} code unified currency code
283844
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
283845
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
283846
+ */
283847
+ await this.loadMarkets();
283848
+ const currency = this.currency(code);
283849
+ const request = {
283850
+ 'symbol': currency['code'],
283851
+ };
283852
+ const response = await this.currenciesGetSSymbol(this.extend(request, params));
283853
+ //
283854
+ // {
283855
+ // id: '1',
283856
+ // currency: {
283857
+ // symbol: 'BTC',
283858
+ // name: 'Bitcoin',
283859
+ // address: '0x8370fbc6ddec1e18b4e41e72ed943e238458487c',
283860
+ // decimals: '8',
283861
+ // tradeDecimals: '20',
283862
+ // fiatSymbol: 'BTC',
283863
+ // depositEnabled: true,
283864
+ // withdrawalEnabled: true,
283865
+ // transferEnabled: true,
283866
+ // active: true
283867
+ // }
283868
+ // }
283869
+ //
283870
+ const data = this.safeDict(response, 'currency', {});
283871
+ return this.parseDepositAddress(data, currency);
283872
+ }
283873
+ parseDepositAddress(depositAddress, currency = undefined) {
283874
+ //
283875
+ // {
283876
+ // symbol: 'BTC',
283877
+ // name: 'Bitcoin',
283878
+ // address: '0x8370fbc6ddec1e18b4e41e72ed943e238458487c',
283879
+ // decimals: '8',
283880
+ // tradeDecimals: '20',
283881
+ // fiatSymbol: 'BTC',
283882
+ // depositEnabled: true,
283883
+ // withdrawalEnabled: true,
283884
+ // transferEnabled: true,
283885
+ // active: true
283886
+ // }
283887
+ //
283888
+ const currencyId = this.safeString(depositAddress, 'symbol');
283889
+ return {
283890
+ 'info': depositAddress,
283891
+ 'currency': this.safeCurrencyCode(currencyId, currency),
283892
+ 'address': this.safeString(depositAddress, 'address'),
283893
+ 'tag': undefined,
283894
+ 'network': undefined,
283895
+ };
283896
+ }
282853
283897
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
283898
+ const paramsToExtract = this.extractParams(path);
283899
+ path = this.implodeParams(path, params);
283900
+ params = this.omit(params, paramsToExtract);
282854
283901
  let url = this.urls['api']['rest'] + '/' + api + '/' + path;
282855
283902
  if (Object.keys(params).length) {
282856
283903
  url += '?' + this.urlencodeWithArrayRepeat(params);
@@ -305584,7 +306631,7 @@ SOFTWARE.
305584
306631
 
305585
306632
  //-----------------------------------------------------------------------------
305586
306633
  // this is updated by vss.js when building
305587
- const version = '4.2.44';
306634
+ const version = '4.2.46';
305588
306635
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
305589
306636
  //-----------------------------------------------------------------------------
305590
306637