ccxt 4.2.42 → 4.2.44

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.
@@ -8975,6 +8975,15 @@ class Exchange {
8975
8975
  async setPositionMode(hedged, symbol = undefined, params = {}) {
8976
8976
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' setPositionMode() is not supported yet');
8977
8977
  }
8978
+ async addMargin(symbol, amount, params = {}) {
8979
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' addMargin() is not supported yet');
8980
+ }
8981
+ async reduceMargin(symbol, amount, params = {}) {
8982
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' reduceMargin() is not supported yet');
8983
+ }
8984
+ async setMargin(symbol, amount, params = {}) {
8985
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' setMargin() is not supported yet');
8986
+ }
8978
8987
  async setMarginMode(marginMode, symbol = undefined, params = {}) {
8979
8988
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' setMarginMode() is not supported yet');
8980
8989
  }
@@ -10164,6 +10173,9 @@ class Exchange {
10164
10173
  * @param {string} currencyCode unified currency code, but this argument is not required by default, unless there is an exchange (like huobi) that needs an override of the method to be able to pass currencyCode argument additionally
10165
10174
  * @returns {string|undefined} exchange-specific network id
10166
10175
  */
10176
+ if (networkCode === undefined) {
10177
+ return undefined;
10178
+ }
10167
10179
  const networkIdsByCodes = this.safeValue(this.options, 'networks', {});
10168
10180
  let networkId = this.safeString(networkIdsByCodes, networkCode);
10169
10181
  // for example, if 'ETH' is passed for networkCode, but 'ETH' key not defined in `options->networks` object
@@ -10207,6 +10219,9 @@ class Exchange {
10207
10219
  * @param {string|undefined} currencyCode unified currency code, but this argument is not required by default, unless there is an exchange (like huobi) that needs an override of the method to be able to pass currencyCode argument additionally
10208
10220
  * @returns {string|undefined} unified network code
10209
10221
  */
10222
+ if (networkId === undefined) {
10223
+ return undefined;
10224
+ }
10210
10225
  const networkCodesByIds = this.safeDict(this.options, 'networksById', {});
10211
10226
  let networkCode = this.safeString(networkCodesByIds, networkId, networkId);
10212
10227
  // replace mainnet network-codes (i.e. ERC20->ETH)
@@ -20640,9 +20655,11 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
20640
20655
  const networkList = this.safeList(entry, 'networkList', []);
20641
20656
  const fees = {};
20642
20657
  let fee = undefined;
20658
+ const networks = {};
20643
20659
  for (let j = 0; j < networkList.length; j++) {
20644
20660
  const networkItem = networkList[j];
20645
20661
  const network = this.safeString(networkItem, 'network');
20662
+ const networkCode = this.networkIdToCode(network);
20646
20663
  // const name = this.safeString (networkItem, 'name');
20647
20664
  const withdrawFee = this.safeNumber(networkItem, 'withdrawFee');
20648
20665
  const depositEnable = this.safeBool(networkItem, 'depositEnable');
@@ -20660,6 +20677,26 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
20660
20677
  if (!_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringEq(precisionTick, '0')) {
20661
20678
  minPrecision = (minPrecision === undefined) ? precisionTick : _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMin(minPrecision, precisionTick);
20662
20679
  }
20680
+ networks[networkCode] = {
20681
+ 'info': networkItem,
20682
+ 'id': network,
20683
+ 'network': networkCode,
20684
+ 'active': depositEnable && withdrawEnable,
20685
+ 'deposit': depositEnable,
20686
+ 'withdraw': withdrawEnable,
20687
+ 'fee': this.parseNumber(fee),
20688
+ 'precision': minPrecision,
20689
+ 'limits': {
20690
+ 'withdraw': {
20691
+ 'min': this.safeNumber(networkItem, 'withdrawMin'),
20692
+ 'max': this.safeNumber(networkItem, 'withdrawMax'),
20693
+ },
20694
+ 'deposit': {
20695
+ 'min': undefined,
20696
+ 'max': undefined,
20697
+ },
20698
+ },
20699
+ };
20663
20700
  }
20664
20701
  const trading = this.safeBool(entry, 'trading');
20665
20702
  const active = (isWithdrawEnabled && isDepositEnabled && trading);
@@ -20676,7 +20713,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
20676
20713
  'active': active,
20677
20714
  'deposit': isDepositEnabled,
20678
20715
  'withdraw': isWithdrawEnabled,
20679
- 'networks': networkList,
20716
+ 'networks': networks,
20680
20717
  'fee': fee,
20681
20718
  'fees': fees,
20682
20719
  'limits': this.limits,
@@ -23089,7 +23126,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23089
23126
  // "msg": "Quantity greater than max quantity."
23090
23127
  // }
23091
23128
  //
23092
- // createOrder, fetchOpenOrders, fetchOrder, cancelOrder: portfolio margin linear swap and future
23129
+ // createOrder, fetchOpenOrders, fetchOrder, cancelOrder, fetchOrders: portfolio margin linear swap and future
23093
23130
  //
23094
23131
  // {
23095
23132
  // "symbol": "BTCUSDT",
@@ -23112,7 +23149,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23112
23149
  // "status": "NEW"
23113
23150
  // }
23114
23151
  //
23115
- // createOrder, fetchOpenOrders, fetchOrder, cancelOrder: portfolio margin inverse swap and future
23152
+ // createOrder, fetchOpenOrders, fetchOrder, cancelOrder, fetchOrders: portfolio margin inverse swap and future
23116
23153
  //
23117
23154
  // {
23118
23155
  // "symbol": "ETHUSD_PERP",
@@ -23197,7 +23234,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23197
23234
  // "type": "LIMIT"
23198
23235
  // }
23199
23236
  //
23200
- // fetchOpenOrders, fetchOrder: portfolio margin spot margin
23237
+ // fetchOpenOrders, fetchOrder, fetchOrders: portfolio margin spot margin
23201
23238
  //
23202
23239
  // {
23203
23240
  // "symbol": "BTCUSDT",
@@ -23247,6 +23284,32 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23247
23284
  // "selfTradePreventionMode": "NONE"
23248
23285
  // }
23249
23286
  //
23287
+ // fetchOrders: portfolio margin linear and inverse swap conditional
23288
+ //
23289
+ // {
23290
+ // "newClientStrategyId": "x-xcKtGhcuaf166172ed504cd1bc0396",
23291
+ // "strategyId": 3733211,
23292
+ // "strategyStatus": "CANCELLED",
23293
+ // "strategyType": "STOP",
23294
+ // "origQty": "0.010",
23295
+ // "price": "35000",
23296
+ // "orderId": 0,
23297
+ // "reduceOnly": false,
23298
+ // "side": "BUY",
23299
+ // "positionSide": "BOTH",
23300
+ // "stopPrice": "50000",
23301
+ // "symbol": "BTCUSDT",
23302
+ // "type": "LIMIT",
23303
+ // "bookTime": 1707270098774,
23304
+ // "updateTime": 1707270119261,
23305
+ // "timeInForce": "GTC",
23306
+ // "triggerTime": 0,
23307
+ // "workingType": "CONTRACT_PRICE",
23308
+ // "priceProtect": false,
23309
+ // "goodTillDate": 0,
23310
+ // "selfTradePreventionMode": "NONE"
23311
+ // }
23312
+ //
23250
23313
  const code = this.safeString(order, 'code');
23251
23314
  if (code !== undefined) {
23252
23315
  // cancelOrders/createOrders might have a partial success
@@ -23305,7 +23368,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23305
23368
  }
23306
23369
  return this.safeOrder({
23307
23370
  'info': order,
23308
- 'id': this.safeString2(order, 'orderId', 'strategyId'),
23371
+ 'id': this.safeString2(order, 'strategyId', 'orderId'),
23309
23372
  'clientOrderId': this.safeString2(order, 'clientOrderId', 'newClientStrategyId'),
23310
23373
  'timestamp': timestamp,
23311
23374
  'datetime': this.iso8601(timestamp),
@@ -23940,13 +24003,20 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23940
24003
  * @see https://binance-docs.github.io/apidocs/delivery/en/#all-orders-user_data
23941
24004
  * @see https://binance-docs.github.io/apidocs/voptions/en/#query-option-order-history-trade
23942
24005
  * @see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-all-orders-user_data
24006
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-um-orders-user_data
24007
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-cm-orders-user_data
24008
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-um-conditional-orders-user_data
24009
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-cm-conditional-orders-user_data
24010
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-margin-account-orders-user_data
23943
24011
  * @param {string} symbol unified market symbol of the market orders were made in
23944
24012
  * @param {int} [since] the earliest time in ms to fetch orders for
23945
24013
  * @param {int} [limit] the maximum number of order structures to retrieve
23946
24014
  * @param {object} [params] extra parameters specific to the exchange API endpoint
23947
24015
  * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
23948
24016
  * @param {int} [params.until] the latest time in ms to fetch orders for
23949
- * @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)
24017
+ * @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)
24018
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
24019
+ * @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
23950
24020
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
23951
24021
  */
23952
24022
  if (symbol === undefined) {
@@ -23959,17 +24029,18 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23959
24029
  return await this.fetchPaginatedCallDynamic('fetchOrders', symbol, since, limit, params);
23960
24030
  }
23961
24031
  const market = this.market(symbol);
23962
- const defaultType = this.safeString2(this.options, 'fetchOrders', 'defaultType', 'spot');
24032
+ const defaultType = this.safeString2(this.options, 'fetchOrders', 'defaultType', market['type']);
23963
24033
  const type = this.safeString(params, 'type', defaultType);
23964
- const [marginMode, query] = this.handleMarginModeAndParams('fetchOrders', params);
23965
- const request = {
24034
+ let marginMode = undefined;
24035
+ [marginMode, params] = this.handleMarginModeAndParams('fetchOrders', params);
24036
+ let isPortfolioMargin = undefined;
24037
+ [isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchOrders', 'papi', 'portfolioMargin', false);
24038
+ const isConditional = this.safeBool2(params, 'stop', 'conditional');
24039
+ params = this.omit(params, ['stop', 'conditional', 'type']);
24040
+ let request = {
23966
24041
  'symbol': market['id'],
23967
24042
  };
23968
- const until = this.safeInteger(params, 'until');
23969
- if (until !== undefined) {
23970
- params = this.omit(params, 'until');
23971
- request['endTime'] = until;
23972
- }
24043
+ [request, params] = this.handleUntilOption('endTime', request, params);
23973
24044
  if (since !== undefined) {
23974
24045
  request['startTime'] = since;
23975
24046
  }
@@ -23978,22 +24049,47 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23978
24049
  }
23979
24050
  let response = undefined;
23980
24051
  if (market['option']) {
23981
- response = await this.eapiPrivateGetHistoryOrders(this.extend(request, query));
24052
+ response = await this.eapiPrivateGetHistoryOrders(this.extend(request, params));
23982
24053
  }
23983
24054
  else if (market['linear']) {
23984
- response = await this.fapiPrivateGetAllOrders(this.extend(request, query));
24055
+ if (isPortfolioMargin) {
24056
+ if (isConditional) {
24057
+ response = await this.papiGetUmConditionalAllOrders(this.extend(request, params));
24058
+ }
24059
+ else {
24060
+ response = await this.papiGetUmAllOrders(this.extend(request, params));
24061
+ }
24062
+ }
24063
+ else {
24064
+ response = await this.fapiPrivateGetAllOrders(this.extend(request, params));
24065
+ }
23985
24066
  }
23986
24067
  else if (market['inverse']) {
23987
- response = await this.dapiPrivateGetAllOrders(this.extend(request, query));
23988
- }
23989
- else if (type === 'margin' || marginMode !== undefined) {
23990
- if (marginMode === 'isolated') {
23991
- request['isIsolated'] = true;
24068
+ if (isPortfolioMargin) {
24069
+ if (isConditional) {
24070
+ response = await this.papiGetCmConditionalAllOrders(this.extend(request, params));
24071
+ }
24072
+ else {
24073
+ response = await this.papiGetCmAllOrders(this.extend(request, params));
24074
+ }
24075
+ }
24076
+ else {
24077
+ response = await this.dapiPrivateGetAllOrders(this.extend(request, params));
23992
24078
  }
23993
- response = await this.sapiGetMarginAllOrders(this.extend(request, query));
23994
24079
  }
23995
24080
  else {
23996
- response = await this.privateGetAllOrders(this.extend(request, query));
24081
+ if (isPortfolioMargin) {
24082
+ response = await this.papiGetMarginAllOrders(this.extend(request, params));
24083
+ }
24084
+ else if (type === 'margin' || marginMode !== undefined) {
24085
+ if (marginMode === 'isolated') {
24086
+ request['isIsolated'] = true;
24087
+ }
24088
+ response = await this.sapiGetMarginAllOrders(this.extend(request, params));
24089
+ }
24090
+ else {
24091
+ response = await this.privateGetAllOrders(this.extend(request, params));
24092
+ }
23997
24093
  }
23998
24094
  //
23999
24095
  // spot
@@ -24069,6 +24165,112 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24069
24165
  // }
24070
24166
  // ]
24071
24167
  //
24168
+ // inverse portfolio margin
24169
+ //
24170
+ // [
24171
+ // {
24172
+ // "orderId": 71328442983,
24173
+ // "symbol": "ETHUSD_PERP",
24174
+ // "pair": "ETHUSD",
24175
+ // "status": "CANCELED",
24176
+ // "clientOrderId": "x-xcKtGhcu4b3e3d8515dd4dc5ba9ccc",
24177
+ // "price": "2000",
24178
+ // "avgPrice": "0.00",
24179
+ // "origQty": "1",
24180
+ // "executedQty": "0",
24181
+ // "cumBase": "0",
24182
+ // "timeInForce": "GTC",
24183
+ // "type": "LIMIT",
24184
+ // "reduceOnly": false,
24185
+ // "side": "BUY",
24186
+ // "origType": "LIMIT",
24187
+ // "time": 1707197843046,
24188
+ // "updateTime": 1707197941373,
24189
+ // "positionSide": "BOTH"
24190
+ // },
24191
+ // ]
24192
+ //
24193
+ // linear portfolio margin
24194
+ //
24195
+ // [
24196
+ // {
24197
+ // "orderId": 259235347005,
24198
+ // "symbol": "BTCUSDT",
24199
+ // "status": "CANCELED",
24200
+ // "clientOrderId": "x-xcKtGhcu402881c9103f42bdb4183b",
24201
+ // "price": "35000",
24202
+ // "avgPrice": "0.00000",
24203
+ // "origQty": "0.010",
24204
+ // "executedQty": "0",
24205
+ // "cumQuote": "0",
24206
+ // "timeInForce": "GTC",
24207
+ // "type": "LIMIT",
24208
+ // "reduceOnly": false,
24209
+ // "side": "BUY",
24210
+ // "origType": "LIMIT",
24211
+ // "time": 1707194702167,
24212
+ // "updateTime": 1707197804748,
24213
+ // "positionSide": "BOTH",
24214
+ // "selfTradePreventionMode": "NONE",
24215
+ // "goodTillDate": 0
24216
+ // },
24217
+ // ]
24218
+ //
24219
+ // conditional portfolio margin
24220
+ //
24221
+ // [
24222
+ // {
24223
+ // "newClientStrategyId": "x-xcKtGhcuaf166172ed504cd1bc0396",
24224
+ // "strategyId": 3733211,
24225
+ // "strategyStatus": "CANCELLED",
24226
+ // "strategyType": "STOP",
24227
+ // "origQty": "0.010",
24228
+ // "price": "35000",
24229
+ // "orderId": 0,
24230
+ // "reduceOnly": false,
24231
+ // "side": "BUY",
24232
+ // "positionSide": "BOTH",
24233
+ // "stopPrice": "50000",
24234
+ // "symbol": "BTCUSDT",
24235
+ // "type": "LIMIT",
24236
+ // "bookTime": 1707270098774,
24237
+ // "updateTime": 1707270119261,
24238
+ // "timeInForce": "GTC",
24239
+ // "triggerTime": 0,
24240
+ // "workingType": "CONTRACT_PRICE",
24241
+ // "priceProtect": false,
24242
+ // "goodTillDate": 0,
24243
+ // "selfTradePreventionMode": "NONE"
24244
+ // },
24245
+ // ]
24246
+ //
24247
+ // spot margin portfolio margin
24248
+ //
24249
+ // [
24250
+ // {
24251
+ // "symbol": "BTCUSDT",
24252
+ // "orderId": 24684460474,
24253
+ // "clientOrderId": "x-R4BD3S82e9ef29d8346440f0b28b86",
24254
+ // "price": "35000.00000000",
24255
+ // "origQty": "0.00100000",
24256
+ // "executedQty": "0.00000000",
24257
+ // "cummulativeQuoteQty": "0.00000000",
24258
+ // "status": "CANCELED",
24259
+ // "timeInForce": "GTC",
24260
+ // "type": "LIMIT",
24261
+ // "side": "BUY",
24262
+ // "stopPrice": "0.00000000",
24263
+ // "icebergQty": "0.00000000",
24264
+ // "time": 1707113538870,
24265
+ // "updateTime": 1707113797688,
24266
+ // "isWorking": true,
24267
+ // "accountId": 200180970,
24268
+ // "selfTradePreventionMode": "EXPIRE_MAKER",
24269
+ // "preventedMatchId": null,
24270
+ // "preventedQuantity": null
24271
+ // },
24272
+ // ]
24273
+ //
24072
24274
  return this.parseOrders(response, market, since, limit);
24073
24275
  }
24074
24276
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -24193,15 +24395,26 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24193
24395
  * @see https://binance-docs.github.io/apidocs/delivery/en/#all-orders-user_data
24194
24396
  * @see https://binance-docs.github.io/apidocs/voptions/en/#query-option-order-history-trade
24195
24397
  * @see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-all-orders-user_data
24398
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-um-orders-user_data
24399
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-cm-orders-user_data
24400
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-um-conditional-orders-user_data
24401
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-cm-conditional-orders-user_data
24402
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-margin-account-orders-user_data
24196
24403
  * @param {string} symbol unified market symbol of the market orders were made in
24197
24404
  * @param {int} [since] the earliest time in ms to fetch orders for
24198
24405
  * @param {int} [limit] the maximum number of order structures to retrieve
24199
24406
  * @param {object} [params] extra parameters specific to the exchange API endpoint
24200
- * @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)
24407
+ * @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)
24408
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
24409
+ * @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
24201
24410
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
24202
24411
  */
24203
- const orders = await this.fetchOrders(symbol, since, limit, params);
24204
- return this.filterBy(orders, 'status', 'closed');
24412
+ if (symbol === undefined) {
24413
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
24414
+ }
24415
+ const orders = await this.fetchOrders(symbol, since, undefined, params);
24416
+ const filteredOrders = this.filterBy(orders, 'status', 'closed');
24417
+ return this.filterBySinceLimit(filteredOrders, since, limit);
24205
24418
  }
24206
24419
  async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
24207
24420
  /**
@@ -24211,22 +24424,23 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24211
24424
  * @see https://binance-docs.github.io/apidocs/spot/en/#all-orders-user_data
24212
24425
  * @see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-all-orders-user_data
24213
24426
  * @see https://binance-docs.github.io/apidocs/voptions/en/#query-option-order-history-trade
24427
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-um-orders-user_data
24428
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-cm-orders-user_data
24429
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-um-conditional-orders-user_data
24430
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-cm-conditional-orders-user_data
24431
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-all-margin-account-orders-user_data
24214
24432
  * @param {string} symbol unified market symbol of the market the orders were made in
24215
24433
  * @param {int} [since] the earliest time in ms to fetch orders for
24216
24434
  * @param {int} [limit] the maximum number of order structures to retrieve
24217
24435
  * @param {object} [params] extra parameters specific to the exchange API endpoint
24218
- * @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)
24436
+ * @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)
24437
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
24438
+ * @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
24219
24439
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
24220
24440
  */
24221
24441
  if (symbol === undefined) {
24222
24442
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchCanceledOrders() requires a symbol argument');
24223
24443
  }
24224
- await this.loadMarkets();
24225
- const market = this.market(symbol);
24226
- if (market['swap'] || market['future']) {
24227
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchCanceledOrders() supports spot, margin and option markets only');
24228
- }
24229
- params = this.omit(params, 'type');
24230
24444
  const orders = await this.fetchOrders(symbol, since, undefined, params);
24231
24445
  const filteredOrders = this.filterBy(orders, 'status', 'canceled');
24232
24446
  return this.filterBySinceLimit(filteredOrders, since, limit);
@@ -25975,35 +26189,48 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
25975
26189
  * @see https://binance-docs.github.io/apidocs/spot/en/#trade-fee-user_data
25976
26190
  * @see https://binance-docs.github.io/apidocs/futures/en/#user-commission-rate-user_data
25977
26191
  * @see https://binance-docs.github.io/apidocs/delivery/en/#user-commission-rate-user_data
26192
+ * @see https://binance-docs.github.io/apidocs/pm/en/#get-user-commission-rate-for-um-user_data
26193
+ * @see https://binance-docs.github.io/apidocs/pm/en/#get-user-commission-rate-for-cm-user_data
25978
26194
  * @param {string} symbol unified market symbol
25979
26195
  * @param {object} [params] extra parameters specific to the exchange API endpoint
26196
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch trading fees in a portfolio margin account
25980
26197
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
25981
26198
  */
25982
26199
  await this.loadMarkets();
25983
26200
  const market = this.market(symbol);
25984
- const defaultType = this.safeString2(this.options, 'fetchTradingFee', 'defaultType', 'linear');
25985
- const type = this.safeString(params, 'type', defaultType);
25986
- params = this.omit(params, 'type');
26201
+ const type = market['type'];
25987
26202
  let subType = undefined;
25988
26203
  [subType, params] = this.handleSubTypeAndParams('fetchTradingFee', market, params);
25989
- const isSpotOrMargin = (type === 'spot') || (type === 'margin');
26204
+ let isPortfolioMargin = undefined;
26205
+ [isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchTradingFee', 'papi', 'portfolioMargin', false);
25990
26206
  const isLinear = this.isLinear(type, subType);
25991
26207
  const isInverse = this.isInverse(type, subType);
25992
26208
  const request = {
25993
26209
  'symbol': market['id'],
25994
26210
  };
25995
26211
  let response = undefined;
25996
- if (isSpotOrMargin) {
25997
- response = await this.sapiGetAssetTradeFee(this.extend(request, params));
25998
- }
25999
- else if (isLinear) {
26000
- response = await this.fapiPrivateGetCommissionRate(this.extend(request, params));
26212
+ if (isLinear) {
26213
+ if (isPortfolioMargin) {
26214
+ response = await this.papiGetUmCommissionRate(this.extend(request, params));
26215
+ }
26216
+ else {
26217
+ response = await this.fapiPrivateGetCommissionRate(this.extend(request, params));
26218
+ }
26001
26219
  }
26002
26220
  else if (isInverse) {
26003
- response = await this.dapiPrivateGetCommissionRate(this.extend(request, params));
26221
+ if (isPortfolioMargin) {
26222
+ response = await this.papiGetCmCommissionRate(this.extend(request, params));
26223
+ }
26224
+ else {
26225
+ response = await this.dapiPrivateGetCommissionRate(this.extend(request, params));
26226
+ }
26227
+ }
26228
+ else {
26229
+ response = await this.sapiGetAssetTradeFee(this.extend(request, params));
26004
26230
  }
26005
26231
  //
26006
26232
  // spot
26233
+ //
26007
26234
  // [
26008
26235
  // {
26009
26236
  // "symbol": "BTCUSDT",
@@ -26013,6 +26240,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
26013
26240
  // ]
26014
26241
  //
26015
26242
  // swap
26243
+ //
26016
26244
  // {
26017
26245
  // "symbol": "BTCUSD_PERP",
26018
26246
  // "makerCommissionRate": "0.00015", // 0.015%
@@ -26023,7 +26251,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
26023
26251
  if (Array.isArray(data)) {
26024
26252
  data = this.safeDict(data, 0, {});
26025
26253
  }
26026
- return this.parseTradingFee(data);
26254
+ return this.parseTradingFee(data, market);
26027
26255
  }
26028
26256
  async fetchTradingFees(params = {}) {
26029
26257
  /**
@@ -30096,7 +30324,9 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
30096
30324
  },
30097
30325
  'broad': {},
30098
30326
  },
30099
- 'commonCurrencies': {},
30327
+ 'commonCurrencies': {
30328
+ 'SNOW': 'Snowman', // Snowman vs SnowSwap conflict
30329
+ },
30100
30330
  'options': {
30101
30331
  'defaultType': 'spot',
30102
30332
  'accountsByType': {
@@ -77314,7 +77544,8 @@ class blofin extends _abstract_blofin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
77314
77544
  const request = {};
77315
77545
  let response = undefined;
77316
77546
  if (accountType !== undefined) {
77317
- const parsedAccountType = this.safeString(this.options, 'accountsByType', accountType);
77547
+ const options = this.safeDict(this.options, 'accountsByType', {});
77548
+ const parsedAccountType = this.safeString(options, accountType, accountType);
77318
77549
  request['accountType'] = parsedAccountType;
77319
77550
  response = await this.privateGetAssetBalances(this.extend(request, params));
77320
77551
  }
@@ -94986,13 +95217,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
94986
95217
  payload = body;
94987
95218
  }
94988
95219
  }
94989
- let auth = undefined;
94990
- if (version === 'v3') {
94991
- auth = nonce + method + savedPath + payload;
94992
- }
94993
- else {
94994
- auth = nonce + method + fullPath + payload;
94995
- }
95220
+ const auth = nonce + method + savedPath + payload;
94996
95221
  const signature = this.hmac(this.encode(auth), this.encode(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__/* .sha256 */ .J);
94997
95222
  headers = {
94998
95223
  'CB-ACCESS-KEY': this.apiKey,
@@ -164107,6 +164332,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
164107
164332
  }
164108
164333
  createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
164109
164334
  const market = this.market(symbol);
164335
+ symbol = market['symbol'];
164110
164336
  type = this.safeString(params, 'orderType', type);
164111
164337
  const timeInForce = this.safeString(params, 'timeInForce');
164112
164338
  let postOnly = false;
@@ -164126,7 +164352,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
164126
164352
  const request = {
164127
164353
  'symbol': market['id'],
164128
164354
  'side': side,
164129
- 'size': amount,
164355
+ 'size': this.amountToPrecision(symbol, amount),
164130
164356
  };
164131
164357
  const clientOrderId = this.safeString2(params, 'clientOrderId', 'cliOrdId');
164132
164358
  if (clientOrderId !== undefined) {
@@ -164164,7 +164390,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
164164
164390
  }
164165
164391
  request['orderType'] = type;
164166
164392
  if (price !== undefined) {
164167
- request['limitPrice'] = price;
164393
+ request['limitPrice'] = this.priceToPrecision(symbol, price);
164168
164394
  }
164169
164395
  params = this.omit(params, ['clientOrderId', 'timeInForce', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice']);
164170
164396
  return this.extend(request, params);
@@ -169662,11 +169888,11 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
169662
169888
  }
169663
169889
  }
169664
169890
  let fee = undefined;
169665
- const feeCost = this.safeNumber(item, 'fee');
169891
+ const feeCost = this.safeString(item, 'fee');
169666
169892
  let feeCurrency = undefined;
169667
- if (feeCost !== 0) {
169893
+ if (feeCost !== '0') {
169668
169894
  feeCurrency = code;
169669
- fee = { 'cost': feeCost, 'currency': feeCurrency };
169895
+ fee = { 'cost': this.parseNumber(feeCost), 'currency': feeCurrency };
169670
169896
  }
169671
169897
  return {
169672
169898
  'id': id,
@@ -169780,8 +170006,12 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
169780
170006
  // }
169781
170007
  // }
169782
170008
  //
169783
- const data = this.safeValue(response, 'data');
169784
- const items = this.safeValue(data, 'items', data);
170009
+ const dataList = this.safeList(response, 'data');
170010
+ if (dataList !== undefined) {
170011
+ return this.parseLedger(dataList, currency, since, limit);
170012
+ }
170013
+ const data = this.safeDict(response, 'data');
170014
+ const items = this.safeList(data, 'items', []);
169785
170015
  return this.parseLedger(items, currency, since, limit);
169786
170016
  }
169787
170017
  calculateRateLimiterCost(api, method, path, params, config = {}) {
@@ -183201,247 +183431,353 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
183201
183431
  'defaultNetwork': 'ETH',
183202
183432
  'defaultNetworks': {
183203
183433
  'ETH': 'ETH',
183204
- 'USDT': 'TRC20',
183434
+ 'USDT': 'ERC20',
183435
+ 'USDC': 'ERC20',
183436
+ 'BTC': 'BTC',
183437
+ 'LTC': 'LTC',
183205
183438
  },
183206
183439
  'networks': {
183207
- 'BTC': 'BTC',
183208
- 'BCH': 'BCH',
183209
- 'TRC20': 'Tron(TRC20)',
183210
- 'ERC20': 'Ethereum(ERC20)',
183211
- 'BEP20': 'BNB Smart Chain(BEP20)',
183212
- 'OPTIMISM': 'Optimism(OP)',
183213
- 'SOL': 'Solana(SOL)',
183214
- 'CRC20': 'CRONOS',
183440
+ 'ABBC': 'ABBC',
183441
+ 'ACA': 'ACALA',
183442
+ 'ADA': 'Cardano(ADA)',
183443
+ 'AE': 'AE',
183215
183444
  'ALGO': 'Algorand(ALGO)',
183216
- 'XRP': 'XRP',
183217
- 'MATIC': 'Polygon(MATIC)',
183218
- 'AVAXX': 'AVAX_XCHAIN',
183219
- 'AVAXC': 'AvalancheCChain(AVAXCCHAIN)',
183220
- 'ARBONE': 'ArbitrumOne(ARB)',
183445
+ 'ALPH': 'Alephium(ALPH)',
183446
+ 'AME': 'AME',
183447
+ 'AOK': 'AOK',
183448
+ 'APT': 'APTOS(APT)',
183449
+ 'AR': 'AR',
183450
+ 'ARB': 'Arbitrum One(ARB)',
183221
183451
  'ARBNOVA': 'ARBNOVA',
183222
- 'FTM': 'FTM',
183223
- 'WAVES': 'WAVES',
183224
- 'CHZ': 'Chiliz Chain(CHZ)',
183225
- 'HRC20': 'HECO',
183226
- 'TRC10': 'TRC10',
183227
- 'DASH': 'DASH',
183228
- 'LTC': 'LTC',
183229
- // 'DOGECOIN': [ 'DOGE', 'DOGECHAIN' ], // todo after unification
183230
- 'XTZ': 'XTZ',
183231
- 'OMNI': 'OMNI',
183232
- 'APT': 'APTOS',
183233
- 'ONT': 'ONT',
183234
- 'BSV': 'BSV',
183235
- 'OKC': 'OKT',
183452
+ 'ARBONE': 'ArbitrumOne(ARB)',
183453
+ 'ARK': 'ARK',
183454
+ 'ASTR': 'ASTAR',
183455
+ 'ATOM': 'Cosmos(ATOM)',
183456
+ 'AVAXC': 'Avalanche C Chain(AVAX CCHAIN)',
183457
+ 'AVAXX': 'Avalanche X Chain(AVAX XCHAIN)',
183458
+ 'AZERO': 'Aleph Zero(AZERO)',
183459
+ 'BCH': 'Bitcoin Cash(BCH)',
183460
+ 'BDX': 'BDX',
183461
+ 'BEAM': 'BEAM',
183462
+ 'BEP2': 'BNB Beacon Chain(BEP2)',
183463
+ 'BEP20': 'BNB Smart Chain(BEP20)',
183464
+ 'BITCI': 'BITCI',
183465
+ 'BNC': 'BNC',
183466
+ 'BNCDOT': 'BNCPOLKA',
183467
+ 'BOBA': 'BOBA',
183468
+ 'BSC': 'BEP20(BSC)',
183469
+ 'BSV': 'Bitcoin SV(BSV)',
183470
+ 'BTC': 'Bitcoin(BTC)',
183471
+ 'BTM': 'BTM2',
183236
183472
  'CELO': 'CELO',
183237
- 'KLAY': 'KLAY',
183238
- 'BEP2': 'BEP2',
183473
+ 'CFX': 'CFX',
183474
+ 'CHZ': 'Chiliz Legacy Chain(CHZ)',
183475
+ 'CHZ2': 'Chiliz Chain(CHZ2)',
183476
+ 'CKB': 'CKB',
183477
+ 'CLORE': 'Clore.ai(CLORE)',
183478
+ 'CRC20': 'CRONOS',
183479
+ 'CSPR': 'CSPR',
183480
+ 'DASH': 'DASH',
183481
+ 'DC': 'Dogechain(DC)',
183482
+ 'DCR': 'DCR',
183483
+ 'DNX': 'Dynex(DNX)',
183484
+ 'DOGE': 'Dogecoin(DOGE)',
183485
+ 'DOT': 'Polkadot(DOT)',
183486
+ 'DYM': 'Dymension(DYM)',
183487
+ 'EDG': 'EDG',
183239
183488
  'EGLD': 'EGLD',
183240
183489
  'EOS': 'EOS',
183241
- 'ZIL': 'ZIL',
183490
+ 'ERC20': 'Ethereum(ERC20)',
183491
+ 'ETC': 'Ethereum Classic(ETC)',
183492
+ 'ETHF': 'ETF',
183242
183493
  'ETHW': 'ETHW',
183243
- 'IOTX': 'IOTX',
183494
+ 'EVER': 'EVER',
183495
+ 'FET': 'FET',
183496
+ 'FIL': 'FIL',
183497
+ 'FIO': 'FIO',
183498
+ 'FLOW': 'FLOW',
183499
+ 'FSN': 'FSN',
183500
+ 'FTM': 'Fantom(FTM)',
183501
+ 'FUSE': 'FUSE',
183502
+ 'GLMR': 'GLMR',
183503
+ 'GRIN': 'GRIN',
183504
+ 'HBAR': 'Hedera(HBAR)',
183505
+ 'HIVE': 'HIVE',
183506
+ 'HRC20': 'HECO',
183507
+ 'HYDRA': 'HYDRA',
183508
+ 'ICP': 'Internet Computer(ICP)',
183509
+ 'INDEX': 'Index Chain',
183510
+ 'IOST': 'IOST',
183244
183511
  'IOTA': 'IOTA',
183245
- 'SYS': 'SYS',
183246
- 'XCH': 'CHIA',
183247
- 'KMA': 'KMA',
183248
- 'ONE': 'ONE',
183249
- 'METIS': 'METIS',
183512
+ 'IOTX': 'IOTX',
183513
+ 'IRIS': 'IRIS',
183514
+ 'KAR': 'KAR',
183515
+ 'KAS': 'Kaspa(KAS)',
183250
183516
  'KAVA': 'KAVA',
183251
183517
  'KDA': 'KDA',
183252
- 'IOST': 'IOST',
183253
- 'XEC': 'XEC',
183254
- 'VET': 'VET',
183255
- 'XLM': 'XLM',
183518
+ 'KILT': 'KILT',
183519
+ 'KLAY': 'Klaytn(KLAY)',
183520
+ 'KMA': 'KMA',
183256
183521
  'KSM': 'KSM',
183257
- 'MOVR': 'MOVR',
183258
- 'XMR': 'XMR',
183259
183522
  'LAT': 'LAT',
183260
- 'ETC': 'ETC',
183261
- // 'TLOS': 'TELOS', // todo
183262
- // 'TELOSCOIN': 'TLOS', // todo
183263
- 'GLMR': 'GLMR',
183264
- 'DOT': 'DOT',
183265
- 'SC': 'SC',
183266
- 'ICP': 'ICP',
183267
- 'AOK': 'AOK',
183268
- 'ZEC': 'ZEC',
183269
- 'ACA': 'ACALA',
183270
- 'ASTR': 'ASTAR',
183271
- 'FIL': 'FIL',
183272
- 'NEAR': 'NEAR',
183273
- 'OSMO': 'OSMO',
183274
- 'SDN': 'SDN',
183275
- 'BITCI': 'BITCI',
183523
+ 'LAVA': 'Elysium(LAVA)',
183524
+ 'LTC': 'Litecoin(LTC)',
183525
+ 'LUNA': 'Terra(LUNA)',
183526
+ 'MASS': 'MASS',
183527
+ 'MATIC': 'Polygon(MATIC)',
183528
+ 'MCOIN': 'Mcoin Network',
183529
+ 'METIS': 'METIS',
183530
+ 'MINA': 'MINA',
183531
+ 'MNT': 'Mantle(MNT)',
183532
+ 'MOVR': 'MOVR',
183533
+ 'MTRG': 'Meter(MTRG)',
183534
+ 'NAS': 'NAS',
183535
+ 'NEAR': 'NEAR Protocol(NEAR)',
183536
+ 'NEBL': 'NEBL',
183537
+ 'NEM': 'NEM',
183276
183538
  'NEO': 'NEO',
183277
- 'ADA': 'ADA',
183278
- 'RVN': 'RVN',
183279
- 'BNC': 'BNC',
183280
- 'BNCDOT': 'BNCPOLKA',
183281
- 'ETHF': 'ETF',
183282
- 'STEEM': 'STEEM',
183283
- 'OASYS': 'OASYS',
183284
- 'BEAM': 'BEAM',
183285
- 'VSYS': 'VSYS',
183539
+ 'NEO3': 'NEO3',
183540
+ 'NEOXA': 'Neoxa Network',
183541
+ 'NULS': 'NULS',
183286
183542
  'OASIS': 'ROSE',
183287
- 'AR': 'AR',
183288
- 'AE': 'AE',
183543
+ 'OASYS': 'OASYS',
183544
+ 'OKC': 'OKT',
183545
+ 'OMN': 'Omega Network(OMN)',
183546
+ 'OMNI': 'OMNI',
183547
+ 'ONE': 'ONE',
183548
+ 'ONT': 'ONT',
183549
+ 'OPTIMISM': 'Optimism(OP)',
183550
+ 'OSMO': 'OSMO',
183551
+ 'PLCU': 'PLCU',
183552
+ 'POKT': 'POKT',
183553
+ 'QKC': 'QKC',
183289
183554
  'QTUM': 'QTUM',
183290
- 'ATOM': 'ATOM',
183291
- 'HBAR': 'HBAR',
183292
- 'CSPR': 'CSPR',
183293
- 'WEMIX': 'WEMIX',
183294
- 'SGB': 'SGB',
183295
- 'XPR': 'PROTON',
183296
- 'HYDRA': 'HYDRA',
183555
+ 'RAP20': 'RAP20 (Rangers Mainnet)',
183556
+ 'REI': 'REI',
183557
+ 'RSK': 'RBTC',
183558
+ 'RVN': 'Ravencoin(RVN)',
183559
+ 'SATOX': 'Satoxcoin(SATOX)',
183560
+ 'SC': 'SC',
183297
183561
  'SCRT': 'SCRT',
183562
+ 'SDN': 'SDN',
183563
+ 'SGB': 'SGB',
183564
+ 'SOL': 'Solana(SOL)',
183565
+ 'STAR': 'STAR',
183566
+ 'STARK': 'Starknet(STARK)',
183567
+ 'STEEM': 'STEEM',
183568
+ 'SYS': 'SYS',
183569
+ 'TAO': 'Bittensor(TAO)',
183570
+ 'TIA': 'Celestia(TIA)',
183298
183571
  'TOMO': 'TOMO',
183572
+ 'TON': 'Toncoin(TON)',
183573
+ 'TRC10': 'TRC10',
183574
+ 'TRC20': 'Tron(TRC20)',
183575
+ 'UGAS': 'UGAS(Ultrain)',
183576
+ 'VET': 'VeChain(VET)',
183577
+ 'VEX': 'Vexanium(VEX)',
183578
+ 'VSYS': 'VSYS',
183579
+ 'WAVES': 'WAVES',
183299
183580
  'WAX': 'WAX',
183300
- 'KAR': 'KAR',
183301
- 'KILT': 'KILT',
183581
+ 'WEMIX': 'WEMIX',
183582
+ 'XCH': 'Chia(XCH)',
183302
183583
  'XDC': 'XDC',
183303
- 'GRIN': 'GRIN',
183304
- 'PLCU': 'PLCU',
183305
- 'MINA': 'MINA',
183306
- 'ABBC': 'ABBC',
183307
- 'ZEN': 'ZEN',
183308
- 'FLOW': 'FLOW',
183309
- 'RSK': 'RBTC',
183310
- 'DCR': 'DCR',
183311
- 'HIVE': 'HIVE',
183312
- 'XYM': 'XYM',
183313
- 'CKB': 'CKB',
183584
+ 'XEC': 'XEC',
183585
+ 'XLM': 'Stellar(XLM)',
183586
+ 'XMR': 'Monero(XMR)',
183587
+ 'XNA': 'Neurai(XNA)',
183588
+ 'XPR': 'XPR Network',
183314
183589
  'XRD': 'XRD',
183590
+ 'XRP': 'Ripple(XRP)',
183591
+ 'XTZ': 'XTZ',
183315
183592
  'XVG': 'XVG',
183316
- 'BOBA': 'BOBA',
183317
- 'AZERO': 'AZERO',
183318
- 'ARK': 'ARK',
183319
- 'NULS': 'NULS',
183320
- 'POKT': 'POKT',
183321
- 'NEO3': 'NEO3',
183322
- 'FIO': 'FIO',
183323
- 'MASS': 'MASS',
183324
- 'AME': 'AME',
183325
- 'REI': 'REI',
183326
- 'IRIS': 'IRIS',
183593
+ 'XYM': 'XYM',
183594
+ 'ZEC': 'ZEC',
183595
+ 'ZEN': 'ZEN',
183596
+ 'ZIL': 'Zilliqa(ZIL)',
183327
183597
  'ZTG': 'ZTG',
183328
- 'EDG': 'EDG',
183329
- 'FUSE': 'FUSE',
183330
- 'EVER': 'EVER',
183331
- 'FET': 'FET',
183332
- 'CFX': 'CFX',
183333
- 'NEBL': 'NEBL',
183334
- 'STAR': 'STAR',
183335
- 'NEM': 'NEM',
183336
- 'BDX': 'BDX',
183337
- 'TON': 'TONCOIN',
183338
- 'NAS': 'NAS',
183339
- 'QKC': 'QKC',
183340
- 'BTM': 'BTM2',
183341
- 'FSN': 'FSN',
183342
183598
  // todo: uncomment below after concensus
183343
- // 'TERRACLASSIC': 'LUNC',
183344
- // 'TERRA': 'LUNA2',
183345
- // 'PHALA': 'Khala',
183346
- // 'NODLE': 'NODLE',
183347
- // 'KUJIRA': 'KUJI',
183348
- // 'HUAHUA': 'HUAHUA',
183349
- // 'FRUITS': 'FRTS',
183350
- // 'IOEX': 'IOEX',
183351
- // 'TOMAINFO': 'TON',
183599
+ // 'ALAYA': 'ATP',
183600
+ // 'ANDUSCHAIN': 'DEB',
183601
+ // 'ASSETMANTLE': 'MNTL',
183602
+ // 'AXE': 'AXE',
183352
183603
  // 'BITCOINHD': 'BHD',
183604
+ // 'BITCOINVAULT': 'BTCV',
183605
+ // 'BITKUB': 'KUB',
183606
+ // 'BITSHARES_OLD': 'BTS',
183607
+ // 'BITSHARES': 'NBS',
183608
+ // 'BYTZ': 'BYTZ',
183609
+ // 'CANTO': 'CANTO', // CANTOEVM
183353
183610
  // 'CENNZ': 'CENNZ',
183354
- // 'WAYKICHAIN': 'WICC',
183355
- // 'EMERALD': 'EMERALD', // sits on top of OASIS
183611
+ // 'CHAINX': 'PCX',
183612
+ // 'CONCODRIUM': 'CCD',
183356
183613
  // 'CONTENTVALUENETWORK': 'CVNT',
183357
- // 'ORIGYN': 'OGY',
183358
- // 'KASPA': 'KASPA',
183359
- // 'CANTO': 'CANTO', // CANTOEVM
183614
+ // 'CORTEX': 'CTXC',
183615
+ // 'CYPHERIUM': 'CPH',
183616
+ // 'DANGNN': 'DGC',
183360
183617
  // 'DARWINIASMARTCHAIN': 'Darwinia Smart Chain',
183361
- // 'KEKCHAIN': 'KEKCHAIN',
183362
- // 'ZENITH': 'ZENITH',
183618
+ // 'DHEALTH': 'DHP',
183619
+ // 'DOGECOIN': [ 'DOGE', 'DOGECHAIN' ], // todo after unification
183620
+ // 'DRAC': 'DRAC',
183621
+ // 'DRAKEN': 'DRK',
183363
183622
  // 'ECOCHAIN': 'ECOC',
183364
183623
  // 'ELECTRAPROTOCOL': 'XEP',
183365
- // 'KULUPU': 'KLP',
183366
- // 'KINTSUGI': 'KINT',
183367
- // 'PLEX': 'PLEX',
183368
- // 'CONCODRIUM': 'CCD',
183369
- // 'REBUS': 'REBUS', // REBUSEVM is different
183370
- // 'BITKUB': 'KUB',
183371
- // 'BITCOINVAULT': 'BTCV',
183372
- // 'PROXIMAX': 'XPX',
183373
- // 'PAC': 'PAC',
183374
- // 'CHAINX': 'PCX',
183375
- // 'DRAC': 'DRAC',
183376
- // 'WHITECOIN': 'XWC',
183377
- // 'TECHPAY': 'TPC',
183378
- // 'GXCHAIN': 'GXC',
183379
- // 'CYPHERIUM': 'CPH',
183380
- // 'LBRY': 'LBC',
183381
- // 'TONGTONG': 'TTC',
183382
- // 'LEDGIS': 'LED',
183383
- // 'PMG': 'PMG',
183384
- // 'PROOFOFMEMES': 'POM',
183385
- // 'SENTINEL': 'DVPN',
183386
- // 'METER': 'MTRG',
183387
- // 'YAS': 'YAS',
183388
- // 'ULTRAIN': 'UGAS',
183389
- // 'PASTEL': 'PSL',
183390
- // 'KONSTELLATION': 'DARC',
183391
- // 'ANDUSCHAIN': 'DEB',
183624
+ // 'EMERALD': 'EMERALD', // sits on top of OASIS
183625
+ // 'EVMOS': 'EVMOS', // EVMOSETH is different
183626
+ // 'EXOSAMA': 'SAMA',
183627
+ // 'FIBOS': 'FO',
183628
+ // 'FILECASH': 'FIC',
183392
183629
  // 'FIRMACHAIN': 'FCT',
183630
+ // 'FIRO': 'XZC',
183631
+ // 'FNCY': 'FNCY',
183632
+ // 'FRUITS': 'FRTS',
183633
+ // 'GLEEC': 'GLEEC',
183634
+ // 'GXCHAIN': 'GXC',
183393
183635
  // 'HANDSHAKE': 'HNS',
183394
- // 'DANGNN': 'DGC',
183395
- // 'SERO': 'SERO',
183396
183636
  // 'HPB': 'HPB',
183397
- // 'XDAI': 'XDAI',
183398
- // 'EXOSAMA': 'SAMA',
183399
- // 'DHEALTH': 'DHP',
183400
- // 'HUPAYX': 'HPX',
183401
- // 'GLEEC': 'GLEEC',
183402
- // 'FIBOS': 'FO',
183403
- // 'MDNA': 'DNA',
183404
183637
  // 'HSHARE': 'HC',
183405
- // 'BYTZ': 'BYTZ',
183406
- // 'DRAKEN': 'DRK',
183638
+ // 'HUAHUA': 'HUAHUA',
183639
+ // 'HUPAYX': 'HPX',
183640
+ // 'INDEXCHAIN': 'IDX',
183641
+ // 'INTCHAIN': 'INT',
183642
+ // 'INTEGRITEE': 'TEER',
183643
+ // 'INTERLAY': 'INTR',
183644
+ // 'IOEX': 'IOEX',
183645
+ // 'JUNO': 'JUNO',
183646
+ // 'KASPA': 'KASPA',
183647
+ // 'KEKCHAIN': 'KEKCHAIN',
183648
+ // 'KINTSUGI': 'KINT',
183649
+ // 'KOINOS': 'KOINOS',
183650
+ // 'KONSTELLATION': 'DARC',
183651
+ // 'KUJIRA': 'KUJI',
183652
+ // 'KULUPU': 'KLP',
183653
+ // 'LBRY': 'LBC',
183654
+ // 'LEDGIS': 'LED',
183655
+ // 'LIGHTNINGBITCOIN': 'LBTC',
183407
183656
  // 'LINE': 'LINE',
183657
+ // 'MDNA': 'DNA',
183408
183658
  // 'MDUKEY': 'MDU',
183409
- // 'KOINOS': 'KOINOS',
183659
+ // 'METAMUI': 'MMUI',
183660
+ // 'METAVERSE_ETP': 'ETP',
183661
+ // 'METER': 'MTRG',
183410
183662
  // 'MEVERSE': 'MEVerse',
183663
+ // 'NEWTON': 'NEW',
183664
+ // 'NODLE': 'NODLE',
183665
+ // 'ORIGYN': 'OGY',
183666
+ // 'PAC': 'PAC',
183667
+ // 'PASTEL': 'PSL',
183668
+ // 'PHALA': 'Khala',
183669
+ // 'PLEX': 'PLEX',
183670
+ // 'PMG': 'PMG',
183411
183671
  // 'POINT': 'POINT', // POINTEVM is different
183412
- // 'INDEXCHAIN': 'IDX',
183413
- // 'ULORD': 'UT',
183414
- // 'INTEGRITEE': 'TEER',
183415
- // 'XX': 'XX',
183416
- // 'CORTEX': 'CTXC',
183672
+ // 'PROOFOFMEMES': 'POM',
183673
+ // 'PROXIMAX': 'XPX',
183674
+ // 'RCHAIN': 'REV',
183675
+ // 'REBUS': 'REBUS', // REBUSEVM is different
183417
183676
  // 'RIZON': 'ATOLO',
183677
+ // 'SENTINEL': 'DVPN',
183678
+ // 'SERO': 'SERO',
183679
+ // 'TECHPAY': 'TPC',
183680
+ // 'TELOSCOIN': 'TLOS', // todo
183681
+ // 'TERRA': 'LUNA2',
183682
+ // 'TERRACLASSIC': 'LUNC',
183683
+ // 'TLOS': 'TELOS', // todo
183684
+ // 'TOMAINFO': 'TON',
183685
+ // 'TONGTONG': 'TTC',
183686
+ // 'TURTLECOIN': 'TRTL',
183687
+ // 'ULORD': 'UT',
183688
+ // 'ULTRAIN': 'UGAS',
183689
+ // 'UMEE': 'UMEE',
183418
183690
  // 'VDIMENSION': 'VOLLAR',
183419
- // 'JUNO': 'JUNO',
183420
183691
  // 'VEXANIUM': 'VEX',
183421
- // 'INTCHAIN': 'INT',
183422
- // 'METAMUI': 'MMUI',
183423
- // 'RCHAIN': 'REV',
183424
- // 'EVMOS': 'EVMOS', // EVMOSETH is different
183425
- // 'ZKSYNC': 'ZKSYNC',
183426
- // 'BITSHARES_OLD': 'BTS',
183427
- // 'BITSHARES': 'NBS',
183428
- // 'UMEE': 'UMEE',
183429
183692
  // 'VNT': 'VNT',
183430
- // 'TURTLECOIN': 'TRTL',
183431
- // 'METAVERSE_ETP': 'ETP',
183432
- // 'NEWTON': 'NEW',
183433
- // // 'BAJUN': '',
183434
- // 'INTERLAY': 'INTR',
183435
- // 'LIGHTNINGBITCOIN': 'LBTC',
183436
- // 'FIRO': 'XZC',
183437
- // 'ALAYA': 'ATP',
183438
- // 'AXE': 'AXE',
183439
- // 'FNCY': 'FNCY',
183693
+ // 'WAYKICHAIN': 'WICC',
183694
+ // 'WHITECOIN': 'XWC',
183440
183695
  // 'WITNET': 'WIT',
183441
- // 'FILECASH': 'FIC',
183442
- // 'ASSETMANTLE': 'MNTL',
183696
+ // 'XDAI': 'XDAI',
183697
+ // 'XX': 'XX',
183698
+ // 'YAS': 'YAS',
183699
+ // 'ZENITH': 'ZENITH',
183700
+ // 'ZKSYNC': 'ZKSYNC',
183701
+ // // 'BAJUN': '',
183443
183702
  // OKB <> OKT (for usdt it's exception) for OKC, PMEER, FLARE, STRD, ZEL, FUND, "NONE", CRING, FREETON, QTZ (probably unique network is meant), HT, BSC(RACAV1), BSC(RACAV2), AMBROSUS, BAJUN, NOM. their individual info is at https://www.mexc.com/api/platform/asset/spot/{COINNAME}
183444
183703
  },
183704
+ 'networksById': {
183705
+ 'Aleph Zero(AZERO)': 'AZERO',
183706
+ 'Alephium(ALPH)': 'ALPH',
183707
+ 'Algorand(ALGO)': 'ALGO',
183708
+ 'APTOS(APT)': 'APT',
183709
+ 'Arbitrum One(ARB)': 'ARB',
183710
+ 'Avalanche C Chain(AVAX CCHAIN)': 'AVAXC',
183711
+ 'Avalanche X Chain(AVAX XCHAIN)': 'AVAXX',
183712
+ 'BEP20(BSC)': 'BSC',
183713
+ 'Bitcoin Cash(BCH)': 'BCH',
183714
+ 'Bitcoin SV(BSV)': 'BSV',
183715
+ 'Bitcoin(BTC)': 'BTC',
183716
+ 'Bittensor(TAO)': 'TAO',
183717
+ 'BNB Beacon Chain(BEP2)': 'BEP2',
183718
+ 'BNB Smart Chain(BEP20-RACAV1)': 'BSC',
183719
+ 'BNB Smart Chain(BEP20-RACAV2)': 'BSC',
183720
+ 'BNB Smart Chain(BEP20)': 'BSC',
183721
+ 'Cardano(ADA)': 'ADA',
183722
+ 'Celestia(TIA)': 'TIA',
183723
+ 'Chia(XCH)': 'XCH',
183724
+ 'Chiliz Chain(CHZ2)': 'CHZ2',
183725
+ 'Chiliz Legacy Chain(CHZ)': 'CHZ',
183726
+ 'Clore.ai(CLORE)': 'CLORE',
183727
+ 'Cosmos(ATOM)': 'ATOM',
183728
+ 'Dogechain(DC)': 'DC',
183729
+ 'Dogecoin(DOGE)': 'DOGE',
183730
+ 'Dymension(DYM)': 'DYM',
183731
+ 'Dynex(DNX)': 'DNX',
183732
+ 'Elysium(LAVA)': 'LAVA',
183733
+ 'Ethereum Classic(ETC)': 'ETC',
183734
+ 'Ethereum(ERC20)': 'ERC20',
183735
+ 'Fantom(FTM)': 'FTM',
183736
+ 'Hedera(HBAR)': 'HBAR',
183737
+ 'Index Chain': 'INDEX',
183738
+ 'Internet Computer(ICP)': 'ICP',
183739
+ 'Kaspa(KAS)': 'KAS',
183740
+ 'Klaytn(KLAY)': 'KLAY',
183741
+ 'Litecoin(LTC)': 'LTC',
183742
+ 'Mantle(MNT)': 'MNT',
183743
+ 'Mcoin Network': 'MCOIN',
183744
+ 'Meter(MTRG)': 'MTRG',
183745
+ 'Monero(XMR)': 'XMR',
183746
+ 'NEAR Protocol(NEAR)': 'NEAR',
183747
+ 'Neoxa Network': 'NEOXA',
183748
+ 'Neurai(XNA)': 'XNA',
183749
+ 'Omega Network(OMN)': 'OMN',
183750
+ 'Optimism(OP)': 'OPTIMISM',
183751
+ 'Polkadot(DOT)': 'DOT',
183752
+ 'Polygon(MATIC)': 'MATIC',
183753
+ 'RAP20 (Rangers Mainnet)': 'RAP20',
183754
+ 'Ravencoin(RVN)': 'RVN',
183755
+ 'Ripple(XRP)': 'XRP',
183756
+ 'Satoxcoin(SATOX)': 'SATOX',
183757
+ 'Solana(SOL)': 'SOL',
183758
+ 'Starknet(STARK)': 'STARK',
183759
+ 'Stellar(XLM)': 'XLM',
183760
+ 'Terra(LUNA)': 'LUNA',
183761
+ 'Toncoin(TON)': 'TON',
183762
+ 'Tron(TRC20)': 'TRC20',
183763
+ 'UGAS(Ultrain)': 'UGAS',
183764
+ 'VeChain(VET)': 'VET',
183765
+ 'Vexanium(VEX)': 'VEX',
183766
+ 'XPR Network': 'XPR',
183767
+ 'Zilliqa(ZIL)': 'ZIL',
183768
+ // TODO: uncomment below after deciding unified name
183769
+ // 'PEPE COIN BSC':
183770
+ // 'SMART BLOCKCHAIN':
183771
+ // 'f(x)Core':
183772
+ // 'Syscoin Rollux':
183773
+ // 'Syscoin UTXO':
183774
+ // 'zkSync Era':
183775
+ // 'zkSync Lite':
183776
+ // 'Darwinia Smart Chain':
183777
+ // 'Arbitrum One(ARB-Bridged)':
183778
+ // 'Optimism(OP-Bridged)':
183779
+ // 'Polygon(MATIC-Bridged)':
183780
+ },
183445
183781
  'recvWindow': 5 * 1000,
183446
183782
  'maxTimeTillEnd': 90 * 86400 * 1000 - 1,
183447
183783
  'broker': 'CCXT',
@@ -183721,7 +184057,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
183721
184057
  for (let j = 0; j < chains.length; j++) {
183722
184058
  const chain = chains[j];
183723
184059
  const networkId = this.safeString(chain, 'network');
183724
- const network = this.safeNetwork(networkId);
184060
+ const network = this.networkIdToCode(networkId);
183725
184061
  const isDepositEnabled = this.safeBool(chain, 'depositEnable', false);
183726
184062
  const isWithdrawEnabled = this.safeBool(chain, 'withdrawEnable', false);
183727
184063
  const active = (isDepositEnabled && isWithdrawEnabled);
@@ -183794,26 +184130,6 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
183794
184130
  }
183795
184131
  return result;
183796
184132
  }
183797
- safeNetwork(networkId) {
183798
- if (networkId.indexOf('BSC') >= 0) {
183799
- return 'BEP20';
183800
- }
183801
- const parts = networkId.split(' ');
183802
- networkId = parts.join('');
183803
- networkId = networkId.replace('-20', '20');
183804
- const networksById = {
183805
- 'Ethereum(ERC20)': 'ERC20',
183806
- 'Algorand(ALGO)': 'ALGO',
183807
- 'ArbitrumOne(ARB)': 'ARBONE',
183808
- 'AvalancheCChain(AVAXCCHAIN)': 'AVAXC',
183809
- 'BNB Smart Chain(BEP20)': 'BEP20',
183810
- 'Polygon(MATIC)': 'MATIC',
183811
- 'Optimism(OP)': 'OPTIMISM',
183812
- 'Solana(SOL)': 'SOL',
183813
- 'Tron(TRC20)': 'TRC20',
183814
- };
183815
- return this.safeString(networksById, networkId, networkId);
183816
- }
183817
184133
  async fetchMarkets(params = {}) {
183818
184134
  /**
183819
184135
  * @method
@@ -187058,23 +187374,22 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
187058
187374
  }
187059
187375
  parseDepositAddress(depositAddress, currency = undefined) {
187060
187376
  //
187061
- // {"chain":"ERC-20","address":"0x55cbd73db24eafcca97369e3f2db74b2490586e6"},
187062
- // {"chain":"MATIC","address":"0x05aa3236f1970eae0f8feb17ec19435b39574d74"},
187063
- // {"chain":"TRC20","address":"TGaPfhW41EXD3sAfs1grLF6DKfugfqANNw"},
187064
- // {"chain":"SOL","address":"5FSpUKuh2gjw4mF89T2e7sEjzUA1SkRKjBChFqP43KhV"},
187065
- // {"chain":"ALGO","address":"B3XTZND2JJTSYR7R2TQVCUDT4QSSYVAIZYDPWVBX34DGAYATBU3AUV43VU"}
187066
- //
187377
+ // {
187378
+ // coin: "USDT",
187379
+ // network: "BNB Smart Chain(BEP20)",
187380
+ // address: "0x0d48003e0c27c5de62b97c9b4cdb31fdd29da619",
187381
+ // memo: null
187382
+ // }
187067
187383
  //
187068
187384
  const address = this.safeString(depositAddress, 'address');
187069
- const code = this.safeCurrencyCode(undefined, currency);
187070
- const networkId = this.safeString(depositAddress, 'chain');
187071
- const network = this.safeNetwork(networkId);
187385
+ const currencyId = this.safeString(depositAddress, 'coin');
187386
+ const networkId = this.safeString(depositAddress, 'network');
187072
187387
  this.checkAddress(address);
187073
187388
  return {
187074
- 'currency': code,
187389
+ 'currency': this.safeCurrencyCode(currencyId, currency),
187075
187390
  'address': address,
187076
- 'tag': undefined,
187077
- 'network': network,
187391
+ 'tag': this.safeString(depositAddress, 'memo'),
187392
+ 'network': this.networkIdToCode(networkId),
187078
187393
  'info': depositAddress,
187079
187394
  };
187080
187395
  }
@@ -187103,23 +187418,19 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
187103
187418
  }
187104
187419
  params = this.omit(params, 'network');
187105
187420
  const response = await this.spotPrivateGetCapitalDepositAddress(this.extend(request, params));
187106
- const result = [];
187107
- for (let i = 0; i < response.length; i++) {
187108
- const depositAddress = response[i];
187109
- const coin = this.safeString(depositAddress, 'coin');
187110
- const currencyInner = this.currency(coin);
187111
- const networkIdInner = this.safeString(depositAddress, 'network');
187112
- const network = this.safeNetwork(networkIdInner);
187113
- const address = this.safeString(depositAddress, 'address', undefined);
187114
- const tag = this.safeString2(depositAddress, 'tag', 'memo', undefined);
187115
- result.push({
187116
- 'currency': currencyInner['id'],
187117
- 'network': network,
187118
- 'address': address,
187119
- 'tag': tag,
187120
- });
187121
- }
187122
- return result;
187421
+ //
187422
+ // [
187423
+ // {
187424
+ // coin: "USDT",
187425
+ // network: "BNB Smart Chain(BEP20)",
187426
+ // address: "0x0d48003e0c27c5de62b97c9b4cdb31fdd29da619",
187427
+ // memo: null
187428
+ // }
187429
+ // ...
187430
+ // ]
187431
+ //
187432
+ const addressStructures = this.parseDepositAddresses(response, undefined, false);
187433
+ return this.indexBy(addressStructures, 'network');
187123
187434
  }
187124
187435
  async createDepositAddress(code, params = {}) {
187125
187436
  /**
@@ -187153,13 +187464,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
187153
187464
  // "address": "zzqqqqqqqqqq",
187154
187465
  // "memo": "MX10068"
187155
187466
  // }
187156
- return {
187157
- 'info': response,
187158
- 'currency': this.safeString(response, 'coin'),
187159
- 'network': this.safeString(response, 'network'),
187160
- 'address': this.safeString(response, 'address'),
187161
- 'tag': this.safeString(response, 'memo'),
187162
- };
187467
+ return this.parseDepositAddress(response, currency);
187163
187468
  }
187164
187469
  async fetchDepositAddress(code, params = {}) {
187165
187470
  /**
@@ -187169,23 +187474,30 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
187169
187474
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
187170
187475
  * @param {string} code unified currency code
187171
187476
  * @param {object} [params] extra parameters specific to the exchange API endpoint
187477
+ * @param {string} [params.network] the chain of currency, this only apply for multi-chain currency, and there is no need for single chain currency
187172
187478
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
187173
187479
  */
187174
- const rawNetwork = this.safeStringUpper(params, 'network');
187175
- params = this.omit(params, 'network');
187176
- const response = await this.fetchDepositAddressesByNetwork(code, params);
187177
- if (rawNetwork !== undefined) {
187178
- for (let i = 0; i < response.length; i++) {
187179
- const depositAddress = response[i];
187180
- const network = this.safeStringUpper(depositAddress, 'network');
187181
- if (rawNetwork === network) {
187182
- return depositAddress;
187183
- }
187480
+ const network = this.safeString(params, 'network');
187481
+ params = this.omit(params, ['network']);
187482
+ const addressStructures = await this.fetchDepositAddressesByNetwork(code, params);
187483
+ let result = undefined;
187484
+ if (network !== undefined) {
187485
+ result = this.safeDict(addressStructures, this.networkIdToCode(network, code));
187486
+ }
187487
+ else {
187488
+ const options = this.safeDict(this.options, 'defaultNetworks');
187489
+ const defaultNetworkForCurrency = this.safeString(options, code);
187490
+ if (defaultNetworkForCurrency !== undefined) {
187491
+ result = this.safeDict(addressStructures, defaultNetworkForCurrency);
187492
+ }
187493
+ else {
187494
+ const keys = Object.keys(addressStructures);
187495
+ const key = this.safeString(keys, 0);
187496
+ result = this.safeDict(addressStructures, key);
187184
187497
  }
187185
187498
  }
187186
- const result = this.safeValue(response, 0);
187187
187499
  if (result === undefined) {
187188
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidAddress(this.id + ' fetchDepositAddress() cannot find a deposit address for ' + code + ', consider creating one using the MEXC platform');
187500
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidAddress(this.id + ' fetchDepositAddress() cannot find a deposit address for ' + code + ', and network' + network + 'consider creating one using the MEXC platform');
187189
187501
  }
187190
187502
  return result;
187191
187503
  }
@@ -187357,7 +187669,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
187357
187669
  let network = undefined;
187358
187670
  const rawNetwork = this.safeString(transaction, 'network');
187359
187671
  if (rawNetwork !== undefined) {
187360
- network = this.safeNetwork(rawNetwork);
187672
+ network = this.networkIdToCode(rawNetwork);
187361
187673
  }
187362
187674
  const code = this.safeCurrencyCode(currencyId, currency);
187363
187675
  const status = this.parseTransactionStatusByType(this.safeString(transaction, 'status'), type);
@@ -221124,7 +221436,7 @@ class binanceus extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
221124
221436
  // eslint-disable-next-line new-cap
221125
221437
  const restInstance = new _binanceus_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z();
221126
221438
  const restDescribe = restInstance.describe();
221127
- const extended = this.deepExtend(super.describe(), restDescribe);
221439
+ const extended = this.deepExtend(restDescribe, super.describe());
221128
221440
  return this.deepExtend(extended, {
221129
221441
  'id': 'binanceus',
221130
221442
  'name': 'Binance US',
@@ -305272,7 +305584,7 @@ SOFTWARE.
305272
305584
 
305273
305585
  //-----------------------------------------------------------------------------
305274
305586
  // this is updated by vss.js when building
305275
- const version = '4.2.42';
305587
+ const version = '4.2.44';
305276
305588
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
305277
305589
  //-----------------------------------------------------------------------------
305278
305590