ccxt 4.4.88 → 4.4.90

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 (85) hide show
  1. package/README.md +61 -19
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/base/Exchange.js +6 -3
  5. package/dist/cjs/src/base/functions/encode.js +1 -1
  6. package/dist/cjs/src/base/functions/generic.js +6 -0
  7. package/dist/cjs/src/base/functions.js +1 -0
  8. package/dist/cjs/src/binance.js +1 -1
  9. package/dist/cjs/src/bingx.js +60 -32
  10. package/dist/cjs/src/bitget.js +493 -154
  11. package/dist/cjs/src/bitrue.js +72 -66
  12. package/dist/cjs/src/bitvavo.js +34 -0
  13. package/dist/cjs/src/btcalpha.js +35 -0
  14. package/dist/cjs/src/btcbox.js +35 -0
  15. package/dist/cjs/src/btcmarkets.js +35 -0
  16. package/dist/cjs/src/btcturk.js +35 -0
  17. package/dist/cjs/src/bybit.js +9 -3
  18. package/dist/cjs/src/coinbase.js +1 -4
  19. package/dist/cjs/src/cryptocom.js +54 -0
  20. package/dist/cjs/src/delta.js +2 -2
  21. package/dist/cjs/src/digifinex.js +40 -109
  22. package/dist/cjs/src/gate.js +12 -5
  23. package/dist/cjs/src/hashkey.js +15 -28
  24. package/dist/cjs/src/hollaex.js +28 -24
  25. package/dist/cjs/src/kraken.js +30 -53
  26. package/dist/cjs/src/luno.js +92 -0
  27. package/dist/cjs/src/okx.js +2 -1
  28. package/dist/cjs/src/phemex.js +16 -8
  29. package/dist/cjs/src/pro/coinbase.js +2 -0
  30. package/dist/cjs/src/pro/cryptocom.js +27 -0
  31. package/dist/cjs/src/pro/kraken.js +3 -11
  32. package/dist/cjs/src/tradeogre.js +3 -3
  33. package/dist/cjs/src/xt.js +1 -1
  34. package/js/ccxt.d.ts +1 -1
  35. package/js/ccxt.js +1 -1
  36. package/js/src/abstract/bitget.d.ts +58 -0
  37. package/js/src/abstract/cryptocom.d.ts +2 -0
  38. package/js/src/abstract/luno.d.ts +1 -0
  39. package/js/src/base/Exchange.d.ts +4 -1
  40. package/js/src/base/Exchange.js +6 -3
  41. package/js/src/base/functions/encode.d.ts +1 -1
  42. package/js/src/base/functions/encode.js +1 -1
  43. package/js/src/base/functions/generic.d.ts +2 -1
  44. package/js/src/base/functions/generic.js +6 -1
  45. package/js/src/binance.js +1 -1
  46. package/js/src/bingx.d.ts +9 -5
  47. package/js/src/bingx.js +60 -32
  48. package/js/src/bitget.d.ts +4 -1
  49. package/js/src/bitget.js +493 -154
  50. package/js/src/bitrue.js +72 -66
  51. package/js/src/bitvavo.js +34 -0
  52. package/js/src/btcalpha.js +35 -0
  53. package/js/src/btcbox.js +35 -0
  54. package/js/src/btcmarkets.js +35 -0
  55. package/js/src/btcturk.js +35 -0
  56. package/js/src/bybit.js +9 -3
  57. package/js/src/coinbase.d.ts +1 -1
  58. package/js/src/coinbase.js +1 -4
  59. package/js/src/cryptocom.d.ts +17 -0
  60. package/js/src/cryptocom.js +54 -0
  61. package/js/src/delta.js +2 -2
  62. package/js/src/digifinex.js +40 -109
  63. package/js/src/gate.d.ts +1 -1
  64. package/js/src/gate.js +12 -5
  65. package/js/src/hashkey.d.ts +0 -1
  66. package/js/src/hashkey.js +15 -28
  67. package/js/src/hollaex.d.ts +1 -2
  68. package/js/src/hollaex.js +29 -25
  69. package/js/src/kraken.d.ts +0 -1
  70. package/js/src/kraken.js +30 -53
  71. package/js/src/luno.d.ts +9 -1
  72. package/js/src/luno.js +92 -0
  73. package/js/src/okx.js +2 -1
  74. package/js/src/phemex.d.ts +1 -0
  75. package/js/src/phemex.js +16 -8
  76. package/js/src/pro/coinbase.js +2 -0
  77. package/js/src/pro/cryptocom.d.ts +16 -0
  78. package/js/src/pro/cryptocom.js +27 -0
  79. package/js/src/pro/kraken.js +3 -11
  80. package/js/src/tradeogre.js +3 -3
  81. package/js/src/xt.js +1 -1
  82. package/package.json +4 -7
  83. package/examples/README.md +0 -316
  84. package/examples/js/README.md +0 -15
  85. package/examples/js/cli.js +0 -559
package/dist/cjs/ccxt.js CHANGED
@@ -194,7 +194,7 @@ var xt$1 = require('./src/pro/xt.js');
194
194
 
195
195
  //-----------------------------------------------------------------------------
196
196
  // this is updated by vss.js when building
197
- const version = '4.4.88';
197
+ const version = '4.4.90';
198
198
  Exchange["default"].ccxtVersion = version;
199
199
  const exchanges = {
200
200
  'alpaca': alpaca,
@@ -51,7 +51,7 @@ function _interopNamespace(e) {
51
51
  }
52
52
 
53
53
  // ----------------------------------------------------------------------------
54
- const { isNode, selfIsDefined, deepExtend, extend, clone, flatten, unique, indexBy, sortBy, sortBy2, safeFloat2, groupBy, aggregate, uuid, unCamelCase, precisionFromString, Throttler, capitalize, now, decimalToPrecision, safeValue, safeValue2, safeString, safeString2, seconds, milliseconds, binaryToBase16, numberToBE, base16ToBinary, iso8601, omit, isJsonEncodedObject, safeInteger, sum, omitZero, implodeParams, extractParams, json, merge, binaryConcat, hash, ecdsa, arrayConcat, encode, urlencode, hmac, numberToString, roundTimeframe, parseTimeframe, safeInteger2, safeStringLower, parse8601, yyyymmdd, safeStringUpper, safeTimestamp, binaryConcatArray, uuidv1, numberToLE, ymdhms, stringToBase64, decode, uuid22, safeIntegerProduct2, safeIntegerProduct, safeStringLower2, yymmdd, base58ToBinary, binaryToBase58, safeTimestamp2, rawencode, keysort, inArray, isEmpty, ordered, filterBy, uuid16, safeFloat, base64ToBinary, safeStringUpper2, urlencodeWithArrayRepeat, microseconds, binaryToBase64, strip, toArray, safeFloatN, safeIntegerN, safeIntegerProductN, safeTimestampN, safeValueN, safeStringN, safeStringLowerN, safeStringUpperN, urlencodeNested, urlencodeBase64, parseDate, ymd, base64ToString, crc32, packb, TRUNCATE, ROUND, DECIMAL_PLACES, NO_PADDING, TICK_SIZE, SIGNIFICANT_DIGITS, sleep } = functions;
54
+ const { isNode, selfIsDefined, deepExtend, extend, clone, flatten, unique, indexBy, sortBy, sortBy2, safeFloat2, groupBy, aggregate, uuid, unCamelCase, precisionFromString, Throttler, capitalize, now, decimalToPrecision, safeValue, safeValue2, safeString, safeString2, seconds, milliseconds, binaryToBase16, numberToBE, base16ToBinary, iso8601, omit, isJsonEncodedObject, safeInteger, sum, omitZero, implodeParams, extractParams, json, merge, binaryConcat, hash, ecdsa, arrayConcat, encode, urlencode, hmac, numberToString, roundTimeframe, parseTimeframe, safeInteger2, safeStringLower, parse8601, yyyymmdd, safeStringUpper, safeTimestamp, binaryConcatArray, uuidv1, numberToLE, ymdhms, stringToBase64, decode, uuid22, safeIntegerProduct2, safeIntegerProduct, safeStringLower2, yymmdd, base58ToBinary, binaryToBase58, safeTimestamp2, rawencode, keysort, sort, inArray, isEmpty, ordered, filterBy, uuid16, safeFloat, base64ToBinary, safeStringUpper2, urlencodeWithArrayRepeat, microseconds, binaryToBase64, strip, toArray, safeFloatN, safeIntegerN, safeIntegerProductN, safeTimestampN, safeValueN, safeStringN, safeStringLowerN, safeStringUpperN, urlencodeNested, urlencodeBase64, parseDate, ymd, base64ToString, crc32, packb, TRUNCATE, ROUND, DECIMAL_PLACES, NO_PADDING, TICK_SIZE, SIGNIFICANT_DIGITS, sleep } = functions;
55
55
  // ----------------------------------------------------------------------------
56
56
  /**
57
57
  * @class Exchange
@@ -155,6 +155,7 @@ class Exchange {
155
155
  this.streaming = {};
156
156
  this.alias = false;
157
157
  this.deepExtend = deepExtend;
158
+ this.deepExtendSafe = deepExtend;
158
159
  this.isNode = isNode;
159
160
  this.keys = generic.keys;
160
161
  this.values = generic.values;
@@ -163,6 +164,7 @@ class Exchange {
163
164
  this.flatten = flatten;
164
165
  this.unique = unique;
165
166
  this.indexBy = indexBy;
167
+ this.indexBySafe = indexBy;
166
168
  this.roundTimeframe = roundTimeframe;
167
169
  this.sortBy = sortBy;
168
170
  this.sortBy2 = sortBy2;
@@ -226,6 +228,7 @@ class Exchange {
226
228
  this.safeTimestamp2 = safeTimestamp2;
227
229
  this.rawencode = rawencode;
228
230
  this.keysort = keysort;
231
+ this.sort = sort;
229
232
  this.inArray = inArray;
230
233
  this.safeStringLower2 = safeStringLower2;
231
234
  this.safeStringUpper2 = safeStringUpper2;
@@ -2787,7 +2790,7 @@ class Exchange {
2787
2790
  }
2788
2791
  setMarkets(markets, currencies = undefined) {
2789
2792
  const values = [];
2790
- this.markets_by_id = {};
2793
+ this.markets_by_id = this.createSafeDictionary();
2791
2794
  // handle marketId conflicts
2792
2795
  // we insert spot markets first
2793
2796
  const marketValues = this.sortBy(this.toArray(markets), 'spot', true, true);
@@ -2877,7 +2880,7 @@ class Exchange {
2877
2880
  const sortedCurrencies = this.sortBy(resultingCurrencies, 'code');
2878
2881
  this.currencies = this.deepExtend(this.currencies, this.indexBy(sortedCurrencies, 'code'));
2879
2882
  }
2880
- this.currencies_by_id = this.indexBy(this.currencies, 'id');
2883
+ this.currencies_by_id = this.indexBySafe(this.currencies, 'id');
2881
2884
  const currenciesSortedByCode = this.keysort(this.currencies);
2882
2885
  this.codes = Object.keys(currenciesSortedByCode);
2883
2886
  return this.markets;
@@ -12,7 +12,7 @@ var index$1 = require('../../static_dependencies/qs/index.cjs.js');
12
12
  const json = (data, params = undefined) => JSON.stringify(data), isJsonEncodedObject = (object) => ((typeof object === 'string') &&
13
13
  (object.length >= 2) &&
14
14
  ((object[0] === '{') || (object[0] === '['))), binaryToString = index.utf8.encode, stringToBinary = index.utf8.decode, stringToBase64 = (string) => index.base64.encode(index.utf8.decode(string)), base64ToString = (string) => index.utf8.encode(index.base64.decode(string)), base64ToBinary = index.base64.decode, binaryToBase64 = index.base64.encode, base16ToBinary = index.base16.decode, binaryToBase16 = index.base16.encode, base58ToBinary = index.base58.decode, binaryToBase58 = index.base58.encode, binaryConcat = utils.concatBytes, binaryConcatArray = (arr) => utils.concatBytes(...arr), urlencode = (object, sort = false) => index$1.stringify(object), urlencodeNested = (object) => index$1.stringify(object) // implemented only in python
15
- , urlencodeWithArrayRepeat = (object) => index$1.stringify(object, { arrayFormat: 'repeat' }), rawencode = (object) => index$1.stringify(object, { encode: false }), encode = index.utf8.decode // lol
15
+ , urlencodeWithArrayRepeat = (object) => index$1.stringify(object, { arrayFormat: 'repeat' }), rawencode = (object, sort = false) => index$1.stringify(object, { encode: false }), encode = index.utf8.decode // lol
16
16
  , decode = index.utf8.encode
17
17
  // Url-safe-base64 without equals signs, with + replaced by - and slashes replaced by underscores
18
18
  , urlencodeBase64 = (payload) => {
@@ -30,6 +30,11 @@ const keysort = (x, out = {}) => {
30
30
  }
31
31
  return out;
32
32
  };
33
+ const sort = (array) => {
34
+ const newArray = array.slice();
35
+ newArray.sort();
36
+ return newArray;
37
+ };
33
38
  /*
34
39
  Accepts a map/array of objects and a key name to be used as an index:
35
40
  array = [
@@ -185,6 +190,7 @@ exports.merge = merge;
185
190
  exports.omit = omit;
186
191
  exports.ordered = ordered;
187
192
  exports.pluck = pluck;
193
+ exports.sort = sort;
188
194
  exports.sortBy = sortBy;
189
195
  exports.sortBy2 = sortBy2;
190
196
  exports.sum = sum;
@@ -39,6 +39,7 @@ exports.merge = generic.merge;
39
39
  exports.omit = generic.omit;
40
40
  exports.ordered = generic.ordered;
41
41
  exports.pluck = generic.pluck;
42
+ exports.sort = generic.sort;
42
43
  exports.sortBy = generic.sortBy;
43
44
  exports.sortBy2 = generic.sortBy2;
44
45
  exports.sum = generic.sum;
@@ -10484,7 +10484,7 @@ class binance extends binance$1 {
10484
10484
  else {
10485
10485
  throw new errors.NotSupported(this.id + ' loadLeverageBrackets() supports linear and inverse contracts only');
10486
10486
  }
10487
- this.options['leverageBrackets'] = {};
10487
+ this.options['leverageBrackets'] = this.createSafeDictionary();
10488
10488
  for (let i = 0; i < response.length; i++) {
10489
10489
  const entry = response[i];
10490
10490
  const marketId = this.safeString(entry, 'symbol');
@@ -497,7 +497,9 @@ class bingx extends bingx$1 {
497
497
  '100419': errors.PermissionDenied,
498
498
  '100437': errors.BadRequest,
499
499
  '101204': errors.InsufficientFunds,
500
- '110425': errors.InvalidOrder, // {"code":110425,"msg":"Please ensure that the minimum nominal value of the order placed must be greater than 2u","data":{}}
500
+ '110425': errors.InvalidOrder,
501
+ 'Insufficient assets': errors.InsufficientFunds,
502
+ 'illegal transferType': errors.BadRequest, // {"transferErrorMsg":"illegal transferType"}
501
503
  },
502
504
  'broad': {},
503
505
  },
@@ -511,12 +513,14 @@ class bingx extends bingx$1 {
511
513
  'options': {
512
514
  'defaultType': 'spot',
513
515
  'accountsByType': {
514
- 'spot': 'FUND',
516
+ 'funding': 'FUND',
517
+ 'spot': 'SPOT',
515
518
  'swap': 'PFUTURES',
516
519
  'future': 'SFUTURES',
517
520
  },
518
521
  'accountsById': {
519
- 'FUND': 'spot',
522
+ 'FUND': 'funding',
523
+ 'SPOT': 'spot',
520
524
  'PFUTURES': 'swap',
521
525
  'SFUTURES': 'future',
522
526
  },
@@ -1557,7 +1561,7 @@ class bingx extends bingx$1 {
1557
1561
  // ]
1558
1562
  // }
1559
1563
  //
1560
- const data = this.safeList(response, 'data', []);
1564
+ const data = this.safeDict(response, 'data');
1561
1565
  return this.parseFundingRate(data, market);
1562
1566
  }
1563
1567
  /**
@@ -4855,11 +4859,11 @@ class bingx extends bingx$1 {
4855
4859
  * @method
4856
4860
  * @name bingx#transfer
4857
4861
  * @description transfer currency internally between wallets on the same account
4858
- * @see https://bingx-api.github.io/docs/#/spot/account-api.html#User%20Universal%20Transfer
4862
+ * @see https://bingx-api.github.io/docs/#/en-us/common/account-api.html#Asset%20Transfer
4859
4863
  * @param {string} code unified currency code
4860
4864
  * @param {float} amount amount to transfer
4861
- * @param {string} fromAccount account to transfer from
4862
- * @param {string} toAccount account to transfer to
4865
+ * @param {string} fromAccount account to transfer from (spot, swap, futures, or funding)
4866
+ * @param {string} toAccount account to transfer to (spot, swap, futures, or funding)
4863
4867
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4864
4868
  * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
4865
4869
  */
@@ -4876,9 +4880,10 @@ class bingx extends bingx$1 {
4876
4880
  };
4877
4881
  const response = await this.spotV3PrivateGetGetAssetTransfer(this.extend(request, params));
4878
4882
  //
4879
- // {
4880
- // "tranId":13526853623
4881
- // }
4883
+ // {
4884
+ // "tranId": 1933130865269936128,
4885
+ // "transferId": "1051450703949464903736"
4886
+ // }
4882
4887
  //
4883
4888
  return {
4884
4889
  'info': response,
@@ -4899,8 +4904,11 @@ class bingx extends bingx$1 {
4899
4904
  * @see https://bingx-api.github.io/docs/#/spot/account-api.html#Query%20User%20Universal%20Transfer%20History%20(USER_DATA)
4900
4905
  * @param {string} [code] unified currency code of the currency transferred
4901
4906
  * @param {int} [since] the earliest time in ms to fetch transfers for
4902
- * @param {int} [limit] the maximum number of transfers structures to retrieve
4907
+ * @param {int} [limit] the maximum number of transfers structures to retrieve (default 10, max 100)
4903
4908
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4909
+ * @param {string} params.fromAccount (mandatory) transfer from (spot, swap, futures, or funding)
4910
+ * @param {string} params.toAccount (mandatory) transfer to (spot, swap, futures, or funding)
4911
+ * @param {boolean} [params.paginate] whether to paginate the results (default false)
4904
4912
  * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
4905
4913
  */
4906
4914
  async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
@@ -4917,7 +4925,14 @@ class bingx extends bingx$1 {
4917
4925
  if (fromId === undefined || toId === undefined) {
4918
4926
  throw new errors.ExchangeError(this.id + ' fromAccount & toAccount parameter are required');
4919
4927
  }
4920
- const request = {
4928
+ params = this.omit(params, ['fromAccount', 'toAccount']);
4929
+ const maxLimit = 100;
4930
+ let paginate = false;
4931
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchTransfers', 'paginate', false);
4932
+ if (paginate) {
4933
+ return await this.fetchPaginatedCallDynamic('fetchTransfers', undefined, since, limit, params, maxLimit);
4934
+ }
4935
+ let request = {
4921
4936
  'type': fromId + '_' + toId,
4922
4937
  };
4923
4938
  if (since !== undefined) {
@@ -4926,18 +4941,19 @@ class bingx extends bingx$1 {
4926
4941
  if (limit !== undefined) {
4927
4942
  request['size'] = limit;
4928
4943
  }
4944
+ [request, params] = this.handleUntilOption('endTime', request, params);
4929
4945
  const response = await this.spotV3PrivateGetAssetTransfer(this.extend(request, params));
4930
4946
  //
4931
4947
  // {
4932
4948
  // "total": 3,
4933
4949
  // "rows": [
4934
4950
  // {
4935
- // "asset":"USDT",
4936
- // "amount":"-100.00000000000000000000",
4937
- // "type":"FUND_SFUTURES",
4938
- // "status":"CONFIRMED",
4939
- // "tranId":1067594500957016069,
4940
- // "timestamp":1658388859000
4951
+ // "asset": "USDT",
4952
+ // "amount": "100.00000000000000000000",
4953
+ // "type": "FUND_SFUTURES",
4954
+ // "status": "CONFIRMED",
4955
+ // "tranId": 1067594500957016069,
4956
+ // "timestamp": 1658388859000
4941
4957
  // },
4942
4958
  // ]
4943
4959
  // }
@@ -4954,7 +4970,7 @@ class bingx extends bingx$1 {
4954
4970
  const typeId = this.safeString(transfer, 'type');
4955
4971
  const typeIdSplit = typeId.split('_');
4956
4972
  const fromId = this.safeString(typeIdSplit, 0);
4957
- const toId = this.safeString(typeId, 1);
4973
+ const toId = this.safeString(typeIdSplit, 1);
4958
4974
  const fromAccount = this.safeString(accountsById, fromId, fromId);
4959
4975
  const toAccount = this.safeString(accountsById, toId, toId);
4960
4976
  return {
@@ -4966,9 +4982,15 @@ class bingx extends bingx$1 {
4966
4982
  'amount': this.safeNumber(transfer, 'amount'),
4967
4983
  'fromAccount': fromAccount,
4968
4984
  'toAccount': toAccount,
4969
- 'status': status,
4985
+ 'status': this.parseTransferStatus(status),
4970
4986
  };
4971
4987
  }
4988
+ parseTransferStatus(status) {
4989
+ const statuses = {
4990
+ 'CONFIRMED': 'ok',
4991
+ };
4992
+ return this.safeString(statuses, status, status);
4993
+ }
4972
4994
  /**
4973
4995
  * @method
4974
4996
  * @name bingx#fetchDepositAddressesByNetwork
@@ -5814,11 +5836,12 @@ class bingx extends bingx$1 {
5814
5836
  return this.parseTransaction(data);
5815
5837
  }
5816
5838
  parseParams(params) {
5817
- const sortedParams = this.keysort(params);
5818
- const keys = Object.keys(sortedParams);
5839
+ // const sortedParams = this.keysort (params);
5840
+ const rawKeys = Object.keys(params);
5841
+ const keys = this.sort(rawKeys);
5819
5842
  for (let i = 0; i < keys.length; i++) {
5820
5843
  const key = keys[i];
5821
- const value = sortedParams[key];
5844
+ const value = params[key];
5822
5845
  if (Array.isArray(value)) {
5823
5846
  let arrStr = '[';
5824
5847
  for (let j = 0; j < value.length; j++) {
@@ -5829,10 +5852,10 @@ class bingx extends bingx$1 {
5829
5852
  arrStr += arrayElement.toString();
5830
5853
  }
5831
5854
  arrStr += ']';
5832
- sortedParams[key] = arrStr;
5855
+ params[key] = arrStr;
5833
5856
  }
5834
5857
  }
5835
- return sortedParams;
5858
+ return params;
5836
5859
  }
5837
5860
  /**
5838
5861
  * @method
@@ -6455,13 +6478,14 @@ class bingx extends bingx$1 {
6455
6478
  };
6456
6479
  }
6457
6480
  customEncode(params) {
6458
- const sortedParams = this.keysort(params);
6459
- const keys = Object.keys(sortedParams);
6481
+ // const sortedParams = this.keysort (params);
6482
+ const rawKeys = Object.keys(params);
6483
+ const keys = this.sort(rawKeys);
6460
6484
  let adjustedValue = undefined;
6461
6485
  let result = undefined;
6462
6486
  for (let i = 0; i < keys.length; i++) {
6463
6487
  const key = keys[i];
6464
- let value = sortedParams[key];
6488
+ let value = params[key];
6465
6489
  if (Array.isArray(value)) {
6466
6490
  let arrStr = undefined;
6467
6491
  for (let j = 0; j < value.length; j++) {
@@ -6538,7 +6562,7 @@ class bingx extends bingx$1 {
6538
6562
  }
6539
6563
  else {
6540
6564
  parsedParams = this.parseParams(params);
6541
- encodeRequest = this.rawencode(parsedParams);
6565
+ encodeRequest = this.rawencode(parsedParams, true);
6542
6566
  }
6543
6567
  const signature = this.hmac(this.encode(encodeRequest), this.encode(this.secret), sha256.sha256);
6544
6568
  headers = {
@@ -6551,7 +6575,7 @@ class bingx extends bingx$1 {
6551
6575
  body = this.json(params);
6552
6576
  }
6553
6577
  else {
6554
- const query = this.urlencode(parsedParams);
6578
+ const query = this.urlencode(parsedParams, true);
6555
6579
  url += '?' + query + '&' + 'signature=' + signature;
6556
6580
  }
6557
6581
  }
@@ -6577,8 +6601,12 @@ class bingx extends bingx$1 {
6577
6601
  // }
6578
6602
  //
6579
6603
  const code = this.safeString(response, 'code');
6580
- const message = this.safeString(response, 'msg');
6581
- if (code !== undefined && code !== '0') {
6604
+ let message = this.safeString(response, 'msg');
6605
+ const transferErrorMsg = this.safeString(response, 'transferErrorMsg'); // handling with errors from transfer endpoint
6606
+ if ((transferErrorMsg !== undefined) || (code !== undefined && code !== '0')) {
6607
+ if (transferErrorMsg !== undefined) {
6608
+ message = transferErrorMsg;
6609
+ }
6582
6610
  const feedback = this.id + ' ' + body;
6583
6611
  this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);
6584
6612
  this.throwExactlyMatchedException(this.exceptions['exact'], code, feedback);