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/js/src/bybit.js CHANGED
@@ -3836,7 +3836,10 @@ export default class bybit extends Exchange {
3836
3836
  if (!market['spot']) {
3837
3837
  throw new NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot orders only');
3838
3838
  }
3839
- return await this.createOrder(symbol, 'market', 'buy', cost, 1, params);
3839
+ const req = {
3840
+ 'cost': cost,
3841
+ };
3842
+ return await this.createOrder(symbol, 'market', 'buy', -1, undefined, this.extend(req, params));
3840
3843
  }
3841
3844
  /**
3842
3845
  * @method
@@ -3859,7 +3862,10 @@ export default class bybit extends Exchange {
3859
3862
  if (!market['spot']) {
3860
3863
  throw new NotSupported(this.id + ' createMarketSellOrderWithCost() supports spot orders only');
3861
3864
  }
3862
- return await this.createOrder(symbol, 'market', 'sell', cost, 1, params);
3865
+ const req = {
3866
+ 'cost': cost,
3867
+ };
3868
+ return await this.createOrder(symbol, 'market', 'sell', -1, undefined, this.extend(req, params));
3863
3869
  }
3864
3870
  /**
3865
3871
  * @method
@@ -4098,7 +4104,7 @@ export default class bybit extends Exchange {
4098
4104
  throw new InvalidOrder(this.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument');
4099
4105
  }
4100
4106
  else {
4101
- const quoteAmount = Precise.stringMul(amountString, priceString);
4107
+ const quoteAmount = Precise.stringMul(this.numberToString(amount), priceString);
4102
4108
  const costRequest = (cost !== undefined) ? cost : quoteAmount;
4103
4109
  request['qty'] = this.getCost(symbol, costRequest);
4104
4110
  }
@@ -555,7 +555,7 @@ export default class coinbase extends Exchange {
555
555
  * @method
556
556
  * @name coinbase#closePosition
557
557
  * @description *futures only* closes open positions for a market
558
- * @see https://coinbase-api.github.io/docs/#/en-us/swapV2/trade-api.html#One-Click%20Close%20All%20Positions
558
+ * @see https://docs.cdp.coinbase.com/coinbase-app/trade/reference/retailbrokerageapi_closeposition
559
559
  * @param {string} symbol Unified CCXT market symbol
560
560
  * @param {string} [side] not used by coinbase
561
561
  * @param {object} [params] extra parameters specific to the coinbase api endpoint
@@ -4600,7 +4600,7 @@ export default class coinbase extends Exchange {
4600
4600
  * @method
4601
4601
  * @name coinbase#closePosition
4602
4602
  * @description *futures only* closes open positions for a market
4603
- * @see https://coinbase-api.github.io/docs/#/en-us/swapV2/trade-api.html#One-Click%20Close%20All%20Positions
4603
+ * @see https://docs.cdp.coinbase.com/coinbase-app/trade/reference/retailbrokerageapi_closeposition
4604
4604
  * @param {string} symbol Unified CCXT market symbol
4605
4605
  * @param {string} [side] not used by coinbase
4606
4606
  * @param {object} [params] extra parameters specific to the coinbase api endpoint
@@ -4611,9 +4611,6 @@ export default class coinbase extends Exchange {
4611
4611
  async closePosition(symbol, side = undefined, params = {}) {
4612
4612
  await this.loadMarkets();
4613
4613
  const market = this.market(symbol);
4614
- if (!market['future']) {
4615
- throw new NotSupported(this.id + ' closePosition() only supported for futures markets');
4616
- }
4617
4614
  const clientOrderId = this.safeString2(params, 'client_order_id', 'clientOrderId');
4618
4615
  params = this.omit(params, 'clientOrderId');
4619
4616
  const request = {
@@ -152,6 +152,23 @@ export default class cryptocom extends Exchange {
152
152
  */
153
153
  createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
154
154
  createAdvancedOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): any;
155
+ /**
156
+ * @method
157
+ * @name cryptocom#editOrder
158
+ * @description edit a trade order
159
+ * @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-amend-order
160
+ * @param {string} id order id
161
+ * @param {string} symbol unified market symbol of the order to edit
162
+ * @param {string} [type] not used by cryptocom editOrder
163
+ * @param {string} [side] not used by cryptocom editOrder
164
+ * @param {float} amount (mandatory) how much of the currency you want to trade in units of the base currency
165
+ * @param {float} price (mandatory) the price for the order, in units of the quote currency, ignored in market orders
166
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
167
+ * @param {string} [params.clientOrderId] the original client order id of the order to edit, required if id is not provided
168
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
169
+ */
170
+ editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
171
+ editOrderRequest(id: string, symbol: string, amount: number, price?: Num, params?: {}): any;
155
172
  /**
156
173
  * @method
157
174
  * @name cryptocom#cancelAllOrders
@@ -45,6 +45,7 @@ export default class cryptocom extends Exchange {
45
45
  'createOrders': true,
46
46
  'createStopOrder': true,
47
47
  'createTriggerOrder': true,
48
+ 'editOrder': true,
48
49
  'fetchAccounts': true,
49
50
  'fetchBalance': true,
50
51
  'fetchBidsAsks': false,
@@ -137,6 +138,7 @@ export default class cryptocom extends Exchange {
137
138
  'derivatives': 'https://uat-api.3ona.co/v2',
138
139
  },
139
140
  'api': {
141
+ 'base': 'https://api.crypto.com',
140
142
  'v1': 'https://api.crypto.com/exchange/v1',
141
143
  'v2': 'https://api.crypto.com/v2',
142
144
  'derivatives': 'https://deriv-api.crypto.com/v1',
@@ -154,6 +156,13 @@ export default class cryptocom extends Exchange {
154
156
  'fees': 'https://crypto.com/exchange/document/fees-limits',
155
157
  },
156
158
  'api': {
159
+ 'base': {
160
+ 'public': {
161
+ 'get': {
162
+ 'v1/public/get-announcements': 1, // no description of rate limit
163
+ },
164
+ },
165
+ },
157
166
  'v1': {
158
167
  'public': {
159
168
  'get': {
@@ -180,6 +189,7 @@ export default class cryptocom extends Exchange {
180
189
  'private/user-balance-history': 10 / 3,
181
190
  'private/get-positions': 10 / 3,
182
191
  'private/create-order': 2 / 3,
192
+ 'private/amend-order': 4 / 3,
183
193
  'private/create-order-list': 10 / 3,
184
194
  'private/cancel-order': 2 / 3,
185
195
  'private/cancel-order-list': 10 / 3,
@@ -1636,6 +1646,50 @@ export default class cryptocom extends Exchange {
1636
1646
  params = this.omit(params, ['postOnly', 'clientOrderId', 'timeInForce', 'stopPrice', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice']);
1637
1647
  return this.extend(request, params);
1638
1648
  }
1649
+ /**
1650
+ * @method
1651
+ * @name cryptocom#editOrder
1652
+ * @description edit a trade order
1653
+ * @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-amend-order
1654
+ * @param {string} id order id
1655
+ * @param {string} symbol unified market symbol of the order to edit
1656
+ * @param {string} [type] not used by cryptocom editOrder
1657
+ * @param {string} [side] not used by cryptocom editOrder
1658
+ * @param {float} amount (mandatory) how much of the currency you want to trade in units of the base currency
1659
+ * @param {float} price (mandatory) the price for the order, in units of the quote currency, ignored in market orders
1660
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1661
+ * @param {string} [params.clientOrderId] the original client order id of the order to edit, required if id is not provided
1662
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1663
+ */
1664
+ async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
1665
+ await this.loadMarkets();
1666
+ const request = this.editOrderRequest(id, symbol, amount, price, params);
1667
+ const response = await this.v1PrivatePostPrivateAmendOrder(request);
1668
+ const result = this.safeDict(response, 'result', {});
1669
+ return this.parseOrder(result);
1670
+ }
1671
+ editOrderRequest(id, symbol, amount, price = undefined, params = {}) {
1672
+ const request = {};
1673
+ if (id !== undefined) {
1674
+ request['order_id'] = id;
1675
+ }
1676
+ else {
1677
+ const originalClientOrderId = this.safeString2(params, 'orig_client_oid', 'clientOrderId');
1678
+ if (originalClientOrderId === undefined) {
1679
+ throw new ArgumentsRequired(this.id + ' editOrder() requires an id argument or orig_client_oid parameter');
1680
+ }
1681
+ else {
1682
+ request['orig_client_oid'] = originalClientOrderId;
1683
+ params = this.omit(params, ['orig_client_oid', 'clientOrderId']);
1684
+ }
1685
+ }
1686
+ if ((amount === undefined) || (price === undefined)) {
1687
+ throw new ArgumentsRequired(this.id + ' editOrder() requires both amount and price arguments. If you do not want to change the amount or price, you should pass the original values');
1688
+ }
1689
+ request['new_quantity'] = this.amountToPrecision(symbol, amount);
1690
+ request['new_price'] = this.priceToPrecision(symbol, price);
1691
+ return this.extend(request, params);
1692
+ }
1639
1693
  /**
1640
1694
  * @method
1641
1695
  * @name cryptocom#cancelAllOrders
package/js/src/delta.js CHANGED
@@ -923,9 +923,9 @@ export default class delta extends Exchange {
923
923
  'inverse': spot ? undefined : !linear,
924
924
  'taker': this.safeNumber(market, 'taker_commission_rate'),
925
925
  'maker': this.safeNumber(market, 'maker_commission_rate'),
926
- 'contractSize': contractSize,
926
+ 'contractSize': spot ? undefined : contractSize,
927
927
  'expiry': expiry,
928
- 'expiryDatetime': expiryDatetime,
928
+ 'expiryDatetime': this.iso8601(expiry),
929
929
  'strike': this.parseNumber(strike),
930
930
  'optionType': optionType,
931
931
  'precision': {
@@ -449,6 +449,16 @@ export default class digifinex extends Exchange {
449
449
  'TRX': 'TRC20',
450
450
  'VECHAIN': 'Vechain', // VET
451
451
  },
452
+ 'networksById': {
453
+ 'TRC20': 'TRC20',
454
+ 'TRX': 'TRC20',
455
+ 'BEP20': 'BEP20',
456
+ 'BSC': 'BEP20',
457
+ 'ERC20': 'ERC20',
458
+ 'ETH': 'ERC20',
459
+ 'Polygon': 'POLYGON',
460
+ 'Crypto.com': 'CRONOS',
461
+ },
452
462
  },
453
463
  'commonCurrencies': {
454
464
  'BHT': 'Black House Test',
@@ -478,6 +488,7 @@ export default class digifinex extends Exchange {
478
488
  // "min_withdraw_amount":10,
479
489
  // "min_withdraw_fee":5,
480
490
  // "currency":"USDT",
491
+ // "withdraw_fee_currency":"USDT",
481
492
  // "withdraw_status":0,
482
493
  // "chain":"OMNI"
483
494
  // },
@@ -488,6 +499,7 @@ export default class digifinex extends Exchange {
488
499
  // "min_withdraw_amount":10,
489
500
  // "min_withdraw_fee":3,
490
501
  // "currency":"USDT",
502
+ // "withdraw_fee_currency":"USDT",
491
503
  // "withdraw_status":1,
492
504
  // "chain":"ERC20"
493
505
  // },
@@ -498,6 +510,7 @@ export default class digifinex extends Exchange {
498
510
  // "min_withdraw_amount":0,
499
511
  // "min_withdraw_fee":0,
500
512
  // "currency":"DGF13",
513
+ // "withdraw_fee_currency":"DGF13",
501
514
  // "withdraw_status":0,
502
515
  // "chain":""
503
516
  // },
@@ -505,128 +518,46 @@ export default class digifinex extends Exchange {
505
518
  // "code":200
506
519
  // }
507
520
  //
508
- const data = this.safeValue(response, 'data', []);
521
+ const data = this.safeList(response, 'data', []);
522
+ const groupedById = this.groupBy(data, 'currency');
523
+ const keys = Object.keys(groupedById);
509
524
  const result = {};
510
- for (let i = 0; i < data.length; i++) {
511
- const currency = data[i];
512
- const id = this.safeString(currency, 'currency');
525
+ for (let i = 0; i < keys.length; i++) {
526
+ const id = keys[i];
527
+ const networkEntries = groupedById[id];
513
528
  const code = this.safeCurrencyCode(id);
514
- const depositStatus = this.safeInteger(currency, 'deposit_status', 1);
515
- const withdrawStatus = this.safeInteger(currency, 'withdraw_status', 1);
516
- const deposit = depositStatus > 0;
517
- const withdraw = withdrawStatus > 0;
518
- const active = deposit && withdraw;
519
- const feeString = this.safeString(currency, 'min_withdraw_fee'); // withdraw_fee_rate was zero for all currencies, so this was the worst case scenario
520
- const minWithdrawString = this.safeString(currency, 'min_withdraw_amount');
521
- const minDepositString = this.safeString(currency, 'min_deposit_amount');
522
- const minDeposit = this.parseNumber(minDepositString);
523
- const minWithdraw = this.parseNumber(minWithdrawString);
524
- const fee = this.parseNumber(feeString);
525
- // define precision with temporary way
526
- const minFoundPrecision = Precise.stringMin(feeString, Precise.stringMin(minDepositString, minWithdrawString));
527
- const precision = this.parseNumber(minFoundPrecision);
528
- const networkId = this.safeString(currency, 'chain');
529
- let networkCode = undefined;
530
- if (networkId !== undefined) {
531
- networkCode = this.networkIdToCode(networkId);
532
- }
533
- const network = {
534
- 'info': currency,
535
- 'id': networkId,
536
- 'network': networkCode,
537
- 'active': active,
538
- 'fee': fee,
539
- 'precision': precision,
540
- 'deposit': deposit,
541
- 'withdraw': withdraw,
542
- 'limits': {
543
- 'amount': {
544
- 'min': undefined,
545
- 'max': undefined,
546
- },
547
- 'withdraw': {
548
- 'min': minWithdraw,
549
- 'max': undefined,
550
- },
551
- 'deposit': {
552
- 'min': minDeposit,
553
- 'max': undefined,
554
- },
555
- },
556
- };
557
- if (code in result) {
558
- let resultCodeInfo = result[code]['info'];
559
- if (Array.isArray(resultCodeInfo)) {
560
- resultCodeInfo.push(currency);
561
- }
562
- else {
563
- resultCodeInfo = [resultCodeInfo, currency];
564
- }
565
- if (withdraw) {
566
- result[code]['withdraw'] = true;
567
- result[code]['limits']['withdraw']['min'] = Math.min(result[code]['limits']['withdraw']['min'], minWithdraw);
568
- }
569
- if (deposit) {
570
- result[code]['deposit'] = true;
571
- result[code]['limits']['deposit']['min'] = Math.min(result[code]['limits']['deposit']['min'], minDeposit);
572
- }
573
- if (active) {
574
- result[code]['active'] = true;
575
- }
576
- }
577
- else {
578
- result[code] = {
579
- 'id': id,
580
- 'code': code,
581
- 'info': currency,
582
- 'type': undefined,
583
- 'name': undefined,
584
- 'active': active,
585
- 'deposit': deposit,
586
- 'withdraw': withdraw,
587
- 'fee': this.parseNumber(feeString),
529
+ const networks = {};
530
+ for (let j = 0; j < networkEntries.length; j++) {
531
+ const networkEntry = networkEntries[j];
532
+ const networkId = this.safeString(networkEntry, 'chain');
533
+ const networkCode = this.networkIdToCode(networkId);
534
+ networks[networkCode] = {
535
+ 'id': networkId,
536
+ 'network': networkCode,
537
+ 'active': undefined,
538
+ 'deposit': this.safeInteger(networkEntry, 'deposit_status') === 1,
539
+ 'withdraw': this.safeInteger(networkEntry, 'withdraw_status') === 1,
540
+ 'fee': this.safeNumber(networkEntry, 'min_withdraw_fee'),
588
541
  'precision': undefined,
589
542
  'limits': {
590
- 'amount': {
591
- 'min': undefined,
592
- 'max': undefined,
593
- },
594
543
  'withdraw': {
595
- 'min': minWithdraw,
544
+ 'min': this.safeNumber(networkEntry, 'min_withdraw_amount'),
596
545
  'max': undefined,
597
546
  },
598
547
  'deposit': {
599
- 'min': minDeposit,
548
+ 'min': this.safeNumber(networkEntry, 'min_deposit_amount'),
600
549
  'max': undefined,
601
550
  },
602
551
  },
603
- 'networks': {},
552
+ 'info': networkEntry,
604
553
  };
605
554
  }
606
- if (networkId !== undefined) {
607
- result[code]['networks'][networkId] = network;
608
- }
609
- else {
610
- result[code]['active'] = active;
611
- result[code]['fee'] = this.parseNumber(feeString);
612
- result[code]['deposit'] = deposit;
613
- result[code]['withdraw'] = withdraw;
614
- result[code]['limits'] = {
615
- 'amount': {
616
- 'min': undefined,
617
- 'max': undefined,
618
- },
619
- 'withdraw': {
620
- 'min': minWithdraw,
621
- 'max': undefined,
622
- },
623
- 'deposit': {
624
- 'min': minDeposit,
625
- 'max': undefined,
626
- },
627
- };
628
- }
629
- result[code]['precision'] = (result[code]['precision'] === undefined) ? precision : Math.max(result[code]['precision'], precision);
555
+ result[code] = this.safeCurrencyStructure({
556
+ 'id': id,
557
+ 'code': code,
558
+ 'info': networkEntries,
559
+ 'networks': networks,
560
+ });
630
561
  }
631
562
  return result;
632
563
  }
package/js/src/gate.d.ts CHANGED
@@ -91,7 +91,7 @@ export default class gate extends Exchange {
91
91
  max: any;
92
92
  };
93
93
  };
94
- created: any;
94
+ created: number;
95
95
  info: any;
96
96
  };
97
97
  fetchOptionMarkets(params?: {}): Promise<any[]>;
package/js/src/gate.js CHANGED
@@ -1258,17 +1258,21 @@ export default class gate extends Exchange {
1258
1258
  // {
1259
1259
  // "id": "QTUM_ETH",
1260
1260
  // "base": "QTUM",
1261
+ // "base_name": "Quantum",
1261
1262
  // "quote": "ETH",
1263
+ // "quote_name": "Ethereum",
1262
1264
  // "fee": "0.2",
1263
1265
  // "min_base_amount": "0.01",
1264
1266
  // "min_quote_amount": "0.001",
1267
+ // "max_quote_amount": "50000",
1265
1268
  // "amount_precision": 3,
1266
1269
  // "precision": 6,
1267
1270
  // "trade_status": "tradable",
1268
- // "sell_start": 0,
1269
- // "buy_start": 0
1271
+ // "sell_start": 1607313600,
1272
+ // "buy_start": 1700492400,
1273
+ // "type": "normal",
1274
+ // "trade_url": "https://www.gate.io/trade/QTUM_ETH",
1270
1275
  // }
1271
- // ]
1272
1276
  //
1273
1277
  // Margin
1274
1278
  //
@@ -1299,6 +1303,8 @@ export default class gate extends Exchange {
1299
1303
  const tradeStatus = this.safeString(market, 'trade_status');
1300
1304
  const leverage = this.safeNumber(market, 'leverage');
1301
1305
  const margin = leverage !== undefined;
1306
+ const buyStart = this.safeIntegerProduct(spotMarket, 'buy_start', 1000); // buy_start is the trading start time, while sell_start is offline orders start time
1307
+ const createdTs = (buyStart !== 0) ? buyStart : undefined;
1302
1308
  result.push({
1303
1309
  'id': id,
1304
1310
  'symbol': base + '/' + quote,
@@ -1348,7 +1354,7 @@ export default class gate extends Exchange {
1348
1354
  'max': margin ? this.safeNumber(market, 'max_quote_amount') : undefined,
1349
1355
  },
1350
1356
  },
1351
- 'created': undefined,
1357
+ 'created': createdTs,
1352
1358
  'info': market,
1353
1359
  });
1354
1360
  }
@@ -1418,6 +1424,7 @@ export default class gate extends Exchange {
1418
1424
  // "funding_next_apply": 1610035200,
1419
1425
  // "short_users": 977,
1420
1426
  // "config_change_time": 1609899548,
1427
+ // "create_time": 1609800048,
1421
1428
  // "trade_size": 28530850594,
1422
1429
  // "position_size": 5223816,
1423
1430
  // "long_users": 455,
@@ -1551,7 +1558,7 @@ export default class gate extends Exchange {
1551
1558
  'max': undefined,
1552
1559
  },
1553
1560
  },
1554
- 'created': undefined,
1561
+ 'created': this.safeIntegerProduct(market, 'create_time', 1000),
1555
1562
  'info': market,
1556
1563
  };
1557
1564
  }
@@ -50,7 +50,6 @@ export default class hashkey extends Exchange {
50
50
  * @returns {object} an associative dictionary of currencies
51
51
  */
52
52
  fetchCurrencies(params?: {}): Promise<Currencies>;
53
- parseCurrencyType(type: any): string;
54
53
  /**
55
54
  * @method
56
55
  * @name hashkey#fetchOrderBook
package/js/src/hashkey.js CHANGED
@@ -1137,48 +1137,44 @@ export default class hashkey extends Exchange {
1137
1137
  const currecy = coins[i];
1138
1138
  const currencyId = this.safeString(currecy, 'coinId');
1139
1139
  const code = this.safeCurrencyCode(currencyId);
1140
- const allowWithdraw = this.safeBool(currecy, 'allowWithdraw');
1141
- const allowDeposit = this.safeBool(currecy, 'allowDeposit');
1142
1140
  const networks = this.safeList(currecy, 'chainTypes');
1143
- const networksById = this.safeDict(this.options, 'networksById');
1144
1141
  const parsedNetworks = {};
1145
1142
  for (let j = 0; j < networks.length; j++) {
1146
1143
  const network = networks[j];
1147
1144
  const networkId = this.safeString(network, 'chainType');
1148
- const networkName = this.safeString(networksById, networkId, networkId);
1149
- const maxWithdrawQuantity = this.omitZero(this.safeString(network, 'maxWithdrawQuantity'));
1150
- const networkDeposit = this.safeBool(network, 'allowDeposit');
1151
- const networkWithdraw = this.safeBool(network, 'allowWithdraw');
1152
- parsedNetworks[networkName] = {
1145
+ const networkCode = this.networkCodeToId(networkId);
1146
+ parsedNetworks[networkCode] = {
1153
1147
  'id': networkId,
1154
- 'network': networkName,
1148
+ 'network': networkCode,
1155
1149
  'limits': {
1156
1150
  'withdraw': {
1157
1151
  'min': this.safeNumber(network, 'minWithdrawQuantity'),
1158
- 'max': this.parseNumber(maxWithdrawQuantity),
1152
+ 'max': this.parseNumber(this.omitZero(this.safeString(network, 'maxWithdrawQuantity'))),
1159
1153
  },
1160
1154
  'deposit': {
1161
1155
  'min': this.safeNumber(network, 'minDepositQuantity'),
1162
1156
  'max': undefined,
1163
1157
  },
1164
1158
  },
1165
- 'active': networkDeposit && networkWithdraw,
1166
- 'deposit': networkDeposit,
1167
- 'withdraw': networkWithdraw,
1159
+ 'active': undefined,
1160
+ 'deposit': this.safeBool(network, 'allowDeposit'),
1161
+ 'withdraw': this.safeBool(network, 'allowWithdraw'),
1168
1162
  'fee': this.safeNumber(network, 'withdrawFee'),
1169
1163
  'precision': undefined,
1170
1164
  'info': network,
1171
1165
  };
1172
1166
  }
1173
- result[code] = {
1167
+ const rawType = this.safeString(currecy, 'tokenType');
1168
+ const type = (rawType === 'REAL_MONEY') ? 'fiat' : 'crypto';
1169
+ result[code] = this.safeCurrencyStructure({
1174
1170
  'id': currencyId,
1175
1171
  'code': code,
1176
1172
  'precision': undefined,
1177
- 'type': this.parseCurrencyType(this.safeString(currecy, 'tokenType')),
1173
+ 'type': type,
1178
1174
  'name': this.safeString(currecy, 'coinFullName'),
1179
- 'active': allowWithdraw && allowDeposit,
1180
- 'deposit': allowDeposit,
1181
- 'withdraw': allowWithdraw,
1175
+ 'active': undefined,
1176
+ 'deposit': this.safeBool(currecy, 'allowDeposit'),
1177
+ 'withdraw': this.safeBool(currecy, 'allowWithdraw'),
1182
1178
  'fee': undefined,
1183
1179
  'limits': {
1184
1180
  'deposit': {
@@ -1192,19 +1188,10 @@ export default class hashkey extends Exchange {
1192
1188
  },
1193
1189
  'networks': parsedNetworks,
1194
1190
  'info': currecy,
1195
- };
1191
+ });
1196
1192
  }
1197
1193
  return result;
1198
1194
  }
1199
- parseCurrencyType(type) {
1200
- const types = {
1201
- 'CHAIN_TOKEN': 'crypto',
1202
- 'ERC20_TOKEN': 'crypto',
1203
- 'BSC_TOKEN': 'crypto',
1204
- 'REAL_MONEY': 'fiat',
1205
- };
1206
- return this.safeString(types, type);
1207
- }
1208
1195
  /**
1209
1196
  * @method
1210
1197
  * @name hashkey#fetchOrderBook
@@ -98,7 +98,7 @@ export default class hollaex extends Exchange {
98
98
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
99
99
  * @param {string} timeframe the length of time each candle represents
100
100
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
101
- * @param {int} [limit] the maximum amount of candles to fetch
101
+ * @param {int} [limit] the maximum amount of candles to fetch (max 500)
102
102
  * @param {object} [params] extra parameters specific to the exchange API endpoint
103
103
  * @param {int} [params.until] timestamp in ms of the latest candle to fetch
104
104
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
@@ -295,7 +295,6 @@ export default class hollaex extends Exchange {
295
295
  * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
296
296
  */
297
297
  fetchDepositWithdrawFees(codes?: Strings, params?: {}): Promise<any>;
298
- normalizeNumberIfNeeded(number: any): any;
299
298
  sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
300
299
  url: any;
301
300
  method: string;