ccxt 4.4.74 → 4.4.77

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 (65) hide show
  1. package/README.md +3 -3
  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 +16 -9
  5. package/dist/cjs/src/binance.js +43 -219
  6. package/dist/cjs/src/bitget.js +1 -1
  7. package/dist/cjs/src/bitopro.js +37 -0
  8. package/dist/cjs/src/bitrue.js +48 -0
  9. package/dist/cjs/src/coinex.js +3 -0
  10. package/dist/cjs/src/coinlist.js +90 -1
  11. package/dist/cjs/src/okx.js +47 -33
  12. package/dist/cjs/src/paradex.js +3 -12
  13. package/dist/cjs/src/pro/hyperliquid.js +1 -1
  14. package/dist/cjs/src/upbit.js +64 -46
  15. package/dist/cjs/src/xt.js +122 -4
  16. package/js/ccxt.d.ts +1 -1
  17. package/js/ccxt.js +1 -1
  18. package/js/src/abstract/coinlist.d.ts +3 -0
  19. package/js/src/abstract/myokx.d.ts +4 -0
  20. package/js/src/abstract/okx.d.ts +4 -0
  21. package/js/src/abstract/upbit.d.ts +15 -1
  22. package/js/src/abstract/xt.d.ts +3 -0
  23. package/js/src/base/Exchange.d.ts +1 -0
  24. package/js/src/base/Exchange.js +16 -9
  25. package/js/src/binance.d.ts +2 -0
  26. package/js/src/binance.js +43 -219
  27. package/js/src/bitget.js +1 -1
  28. package/js/src/bitopro.js +37 -0
  29. package/js/src/bitrue.js +48 -0
  30. package/js/src/coinex.js +3 -0
  31. package/js/src/coinlist.d.ts +12 -1
  32. package/js/src/coinlist.js +90 -1
  33. package/js/src/okx.js +47 -33
  34. package/js/src/paradex.js +3 -12
  35. package/js/src/pro/hyperliquid.js +1 -1
  36. package/js/src/upbit.js +64 -46
  37. package/js/src/xt.d.ts +19 -0
  38. package/js/src/xt.js +122 -4
  39. package/package.json +1 -1
  40. package/js/src/abstract/bitcoincom.d.ts +0 -118
  41. package/js/src/abstract/bitcoincom.js +0 -11
  42. package/js/src/abstract/bitfinex1.d.ts +0 -72
  43. package/js/src/abstract/bitfinex1.js +0 -11
  44. package/js/src/abstract/bitpanda.d.ts +0 -26
  45. package/js/src/abstract/bitpanda.js +0 -5
  46. package/js/src/abstract/poloniexfutures.d.ts +0 -51
  47. package/js/src/abstract/poloniexfutures.js +0 -11
  48. package/js/src/abstract/wazirx.d.ts +0 -33
  49. package/js/src/abstract/wazirx.js +0 -11
  50. package/js/src/bitcoincom.d.ts +0 -4
  51. package/js/src/bitcoincom.js +0 -18
  52. package/js/src/bitpanda.d.ts +0 -4
  53. package/js/src/bitpanda.js +0 -17
  54. package/js/src/poloniexfutures.d.ts +0 -321
  55. package/js/src/poloniexfutures.js +0 -1941
  56. package/js/src/pro/bitcoincom.d.ts +0 -4
  57. package/js/src/pro/bitcoincom.js +0 -34
  58. package/js/src/pro/bitpanda.d.ts +0 -4
  59. package/js/src/pro/bitpanda.js +0 -17
  60. package/js/src/pro/poloniexfutures.d.ts +0 -108
  61. package/js/src/pro/poloniexfutures.js +0 -1042
  62. package/js/src/pro/wazirx.d.ts +0 -102
  63. package/js/src/pro/wazirx.js +0 -784
  64. package/js/src/static_dependencies/starknet/utils/json.d.ts +0 -24
  65. package/js/src/static_dependencies/starknet/utils/json.js +0 -43
package/js/src/bitrue.js CHANGED
@@ -27,20 +27,32 @@ export default class bitrue extends Exchange {
27
27
  'swap': true,
28
28
  'future': false,
29
29
  'option': false,
30
+ 'addMargin': false,
31
+ 'borrowCrossMargin': false,
32
+ 'borrowIsolatedMargin': false,
33
+ 'borrowMargin': false,
30
34
  'cancelAllOrders': true,
31
35
  'cancelOrder': true,
36
+ 'closeAllPositions': false,
37
+ 'closePosition': false,
32
38
  'createMarketBuyOrderWithCost': true,
33
39
  'createMarketOrderWithCost': false,
34
40
  'createMarketSellOrderWithCost': false,
35
41
  'createOrder': true,
42
+ 'createOrderWithTakeProfitAndStopLoss': false,
43
+ 'createOrderWithTakeProfitAndStopLossWs': false,
36
44
  'createReduceOnlyOrder': true,
37
45
  'createStopLimitOrder': true,
38
46
  'createStopMarketOrder': true,
39
47
  'createStopOrder': true,
40
48
  'fetchBalance': true,
41
49
  'fetchBidsAsks': true,
50
+ 'fetchBorrowInterest': false,
51
+ 'fetchBorrowRate': false,
42
52
  'fetchBorrowRateHistories': false,
43
53
  'fetchBorrowRateHistory': false,
54
+ 'fetchBorrowRates': false,
55
+ 'fetchBorrowRatesPerSymbol': false,
44
56
  'fetchClosedOrders': true,
45
57
  'fetchCrossBorrowRate': false,
46
58
  'fetchCrossBorrowRates': false,
@@ -51,20 +63,50 @@ export default class bitrue extends Exchange {
51
63
  'fetchDepositWithdrawFee': 'emulated',
52
64
  'fetchDepositWithdrawFees': true,
53
65
  'fetchFundingHistory': false,
66
+ 'fetchFundingInterval': false,
67
+ 'fetchFundingIntervals': false,
54
68
  'fetchFundingRate': false,
55
69
  'fetchFundingRateHistory': false,
56
70
  'fetchFundingRates': false,
71
+ 'fetchGreeks': false,
72
+ 'fetchIndexOHLCV': false,
57
73
  'fetchIsolatedBorrowRate': false,
58
74
  'fetchIsolatedBorrowRates': false,
75
+ 'fetchIsolatedPositions': false,
76
+ 'fetchLeverage': false,
77
+ 'fetchLeverages': false,
78
+ 'fetchLeverageTiers': false,
79
+ 'fetchLiquidations': false,
80
+ 'fetchLongShortRatio': false,
81
+ 'fetchLongShortRatioHistory': false,
82
+ 'fetchMarginAdjustmentHistory': false,
59
83
  'fetchMarginMode': false,
84
+ 'fetchMarginModes': false,
85
+ 'fetchMarketLeverageTiers': false,
60
86
  'fetchMarkets': true,
87
+ 'fetchMarkOHLCV': false,
88
+ 'fetchMarkPrices': false,
89
+ 'fetchMyLiquidations': false,
90
+ 'fetchMySettlementHistory': false,
61
91
  'fetchMyTrades': true,
62
92
  'fetchOHLCV': true,
93
+ 'fetchOpenInterest': false,
94
+ 'fetchOpenInterestHistory': false,
95
+ 'fetchOpenInterests': false,
63
96
  'fetchOpenOrders': true,
97
+ 'fetchOption': false,
98
+ 'fetchOptionChain': false,
64
99
  'fetchOrder': true,
65
100
  'fetchOrderBook': true,
66
101
  'fetchOrders': false,
102
+ 'fetchPosition': false,
103
+ 'fetchPositionHistory': false,
67
104
  'fetchPositionMode': false,
105
+ 'fetchPositions': false,
106
+ 'fetchPositionsHistory': false,
107
+ 'fetchPositionsRisk': false,
108
+ 'fetchPremiumIndexOHLCV': false,
109
+ 'fetchSettlementHistory': false,
68
110
  'fetchStatus': true,
69
111
  'fetchTicker': true,
70
112
  'fetchTickers': true,
@@ -75,9 +117,15 @@ export default class bitrue extends Exchange {
75
117
  'fetchTransactionFees': false,
76
118
  'fetchTransactions': false,
77
119
  'fetchTransfers': true,
120
+ 'fetchVolatilityHistory': false,
78
121
  'fetchWithdrawals': true,
122
+ 'reduceMargin': false,
123
+ 'repayCrossMargin': false,
124
+ 'repayIsolatedMargin': false,
79
125
  'setLeverage': true,
80
126
  'setMargin': true,
127
+ 'setMarginMode': false,
128
+ 'setPositionMode': false,
81
129
  'transfer': true,
82
130
  'withdraw': true,
83
131
  },
package/js/src/coinex.js CHANGED
@@ -747,6 +747,9 @@ export default class coinex extends Exchange {
747
747
  for (let j = 0; j < chains.length; j++) {
748
748
  const chain = chains[j];
749
749
  const networkId = this.safeString(chain, 'chain');
750
+ if (networkId === undefined) {
751
+ continue;
752
+ }
750
753
  const precisionString = this.parsePrecision(this.safeString(chain, 'withdrawal_precision'));
751
754
  const feeString = this.safeString(chain, 'withdrawal_fee');
752
755
  const minNetworkDepositString = this.safeString(chain, 'min_deposit_amount');
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/coinlist.js';
2
- import type { Account, Balances, Currencies, Currency, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry, int, LedgerEntry } from './base/types.js';
2
+ import type { Account, Balances, Currencies, Currency, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry, int, LedgerEntry, FundingRate } from './base/types.js';
3
3
  /**
4
4
  * @class coinlist
5
5
  * @augments Exchange
@@ -363,6 +363,17 @@ export default class coinlist extends Exchange {
363
363
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
364
364
  parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
365
365
  parseLedgerEntryType(type: any): string;
366
+ /**
367
+ * @method
368
+ * @name coinlist#fetchFundingRate
369
+ * @description fetch the current funding rate
370
+ * @see https://trade-docs.coinlist.co/#coinlist-pro-api-Funding-Rates
371
+ * @param {string} symbol unified market symbol
372
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
373
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
374
+ */
375
+ fetchFundingRate(symbol: string, params?: {}): Promise<FundingRate>;
376
+ parseFundingRate(contract: any, market?: Market): FundingRate;
366
377
  sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
367
378
  url: string;
368
379
  method: string;
@@ -60,7 +60,7 @@ export default class coinlist extends Exchange {
60
60
  'fetchDepositWithdrawFee': false,
61
61
  'fetchDepositWithdrawFees': false,
62
62
  'fetchFundingHistory': false,
63
- 'fetchFundingRate': false,
63
+ 'fetchFundingRate': true,
64
64
  'fetchFundingRateHistory': false,
65
65
  'fetchFundingRates': false,
66
66
  'fetchIndexOHLCV': false,
@@ -152,6 +152,7 @@ export default class coinlist extends Exchange {
152
152
  'v1/leaderboard': 1,
153
153
  'v1/affiliate/{competition_code}': 1,
154
154
  'v1/competition/{competition_id}': 1,
155
+ 'v1/symbols/{symbol}/funding': 1,
155
156
  },
156
157
  },
157
158
  'private': {
@@ -175,6 +176,7 @@ export default class coinlist extends Exchange {
175
176
  'v1/credits': 1,
176
177
  'v1/positions': 1,
177
178
  'v1/accounts/{trader_id}/competitions': 1,
179
+ 'v1/closedPositions': 1,
178
180
  },
179
181
  'post': {
180
182
  'v1/keys': 1,
@@ -193,6 +195,9 @@ export default class coinlist extends Exchange {
193
195
  'v1/orders/{order_id}': 1,
194
196
  'v1/orders/bulk': 1, // not unified
195
197
  },
198
+ 'put': {
199
+ 'v1/accounts/{trader_id}/alias': 1,
200
+ },
196
201
  'delete': {
197
202
  'v1/keys/{key}': 1,
198
203
  'v1/orders': 1,
@@ -2451,6 +2456,90 @@ export default class coinlist extends Exchange {
2451
2456
  };
2452
2457
  return this.safeString(types, type, type);
2453
2458
  }
2459
+ /**
2460
+ * @method
2461
+ * @name coinlist#fetchFundingRate
2462
+ * @description fetch the current funding rate
2463
+ * @see https://trade-docs.coinlist.co/#coinlist-pro-api-Funding-Rates
2464
+ * @param {string} symbol unified market symbol
2465
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2466
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
2467
+ */
2468
+ async fetchFundingRate(symbol, params = {}) {
2469
+ await this.loadMarkets();
2470
+ const market = this.market(symbol);
2471
+ if (!market['swap']) {
2472
+ throw new BadSymbol(this.id + ' fetchFundingRate() supports swap contracts only');
2473
+ }
2474
+ const request = {
2475
+ 'symbol': market['id'],
2476
+ };
2477
+ const response = await this.publicGetV1SymbolsSymbolFunding(this.extend(request, params));
2478
+ //
2479
+ // {
2480
+ // "last": {
2481
+ // "funding_rate": "-0.00043841",
2482
+ // "funding_time": "2025-04-15T04:00:00.000Z"
2483
+ // },
2484
+ // "next": {
2485
+ // "funding_rate": "-0.00046952",
2486
+ // "funding_time": "2025-04-15T12:00:00.000Z"
2487
+ // },
2488
+ // "indicative": {
2489
+ // "funding_rate": "-0.00042517",
2490
+ // "funding_time": "2025-04-15T20:00:00.000Z"
2491
+ // },
2492
+ // "timestamp": "2025-04-15T07:01:15.219Z"
2493
+ // }
2494
+ //
2495
+ return this.parseFundingRate(response, market);
2496
+ }
2497
+ parseFundingRate(contract, market = undefined) {
2498
+ //
2499
+ // {
2500
+ // "last": {
2501
+ // "funding_rate": "-0.00043841",
2502
+ // "funding_time": "2025-04-15T04:00:00.000Z"
2503
+ // },
2504
+ // "next": {
2505
+ // "funding_rate": "-0.00046952",
2506
+ // "funding_time": "2025-04-15T12:00:00.000Z"
2507
+ // },
2508
+ // "indicative": {
2509
+ // "funding_rate": "-0.00042517",
2510
+ // "funding_time": "2025-04-15T20:00:00.000Z"
2511
+ // },
2512
+ // "timestamp": "2025-04-15T07:01:15.219Z"
2513
+ // }
2514
+ //
2515
+ const previous = this.safeDict(contract, 'last', {});
2516
+ const current = this.safeDict(contract, 'next', {});
2517
+ const next = this.safeDict(contract, 'indicative', {});
2518
+ const previousDatetime = this.safeString(previous, 'funding_time');
2519
+ const currentDatetime = this.safeString(current, 'funding_time');
2520
+ const nextDatetime = this.safeString(next, 'funding_time');
2521
+ const datetime = this.safeString(contract, 'timestamp');
2522
+ return {
2523
+ 'info': contract,
2524
+ 'symbol': this.safeSymbol(undefined, market),
2525
+ 'markPrice': undefined,
2526
+ 'indexPrice': undefined,
2527
+ 'interestRate': undefined,
2528
+ 'estimatedSettlePrice': undefined,
2529
+ 'timestamp': this.parse8601(datetime),
2530
+ 'datetime': datetime,
2531
+ 'fundingRate': this.safeNumber(current, 'funding_rate'),
2532
+ 'fundingTimestamp': this.parse8601(currentDatetime),
2533
+ 'fundingDatetime': currentDatetime,
2534
+ 'nextFundingRate': this.safeNumber(next, 'funding_rate'),
2535
+ 'nextFundingTimestamp': this.parse8601(nextDatetime),
2536
+ 'nextFundingDatetime': nextDatetime,
2537
+ 'previousFundingRate': this.safeNumber(previous, 'funding_rate'),
2538
+ 'previousFundingTimestamp': this.parse8601(previousDatetime),
2539
+ 'previousFundingDatetime': previousDatetime,
2540
+ 'interval': '8h',
2541
+ };
2542
+ }
2454
2543
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
2455
2544
  const request = this.omit(params, this.extractParams(path));
2456
2545
  const endpoint = '/' + this.implodeParams(path, params);
package/js/src/okx.js CHANGED
@@ -369,6 +369,7 @@ export default class okx extends Exchange {
369
369
  'asset/subaccount/managed-subaccount-bills': 5 / 3,
370
370
  'users/entrust-subaccount-list': 10,
371
371
  'account/subaccount/interest-limits': 4,
372
+ 'users/subaccount/apikey': 10,
372
373
  // grid trading
373
374
  'tradingBot/grid/orders-algo-pending': 1,
374
375
  'tradingBot/grid/orders-algo-history': 1,
@@ -501,6 +502,9 @@ export default class okx extends Exchange {
501
502
  'asset/subaccount/transfer': 10,
502
503
  'users/subaccount/set-transfer-out': 10,
503
504
  'account/subaccount/set-loan-allocation': 4,
505
+ 'users/subaccount/create-subaccount': 10,
506
+ 'users/subaccount/subaccount-apikey': 10,
507
+ 'users/subaccount/delete-apikey': 10,
504
508
  // grid trading
505
509
  'tradingBot/grid/order-algo': 1,
506
510
  'tradingBot/grid/amend-order-algo': 1,
@@ -911,6 +915,11 @@ export default class okx extends Exchange {
911
915
  '59506': ExchangeError,
912
916
  '59507': ExchangeError,
913
917
  '59508': AccountSuspended,
918
+ '59515': ExchangeError,
919
+ '59516': ExchangeError,
920
+ '59517': ExchangeError,
921
+ '59518': ExchangeError,
922
+ '59519': ExchangeError,
914
923
  '59642': BadRequest,
915
924
  '59643': ExchangeError,
916
925
  // WebSocket error Codes from 60000-63999
@@ -1593,8 +1602,8 @@ export default class okx extends Exchange {
1593
1602
  const swap = (type === 'swap');
1594
1603
  const option = (type === 'option');
1595
1604
  const contract = swap || future || option;
1596
- let baseId = this.safeString(market, 'baseCcy');
1597
- let quoteId = this.safeString(market, 'quoteCcy');
1605
+ let baseId = this.safeString(market, 'baseCcy', ''); // defaulting to '' because some weird preopen markets have empty baseId
1606
+ let quoteId = this.safeString(market, 'quoteCcy', '');
1598
1607
  const settleId = this.safeString(market, 'settleCcy');
1599
1608
  const settle = this.safeCurrencyCode(settleId);
1600
1609
  const underlying = this.safeString(market, 'uly');
@@ -1610,19 +1619,25 @@ export default class okx extends Exchange {
1610
1619
  let strikePrice = undefined;
1611
1620
  let optionType = undefined;
1612
1621
  if (contract) {
1613
- symbol = symbol + ':' + settle;
1622
+ if (settle !== undefined) {
1623
+ symbol = symbol + ':' + settle;
1624
+ }
1614
1625
  if (future) {
1615
1626
  expiry = this.safeInteger(market, 'expTime');
1616
- const ymd = this.yymmdd(expiry);
1617
- symbol = symbol + '-' + ymd;
1627
+ if (expiry !== undefined) {
1628
+ const ymd = this.yymmdd(expiry);
1629
+ symbol = symbol + '-' + ymd;
1630
+ }
1618
1631
  }
1619
1632
  else if (option) {
1620
1633
  expiry = this.safeInteger(market, 'expTime');
1621
1634
  strikePrice = this.safeString(market, 'stk');
1622
1635
  optionType = this.safeString(market, 'optType');
1623
- const ymd = this.yymmdd(expiry);
1624
- symbol = symbol + '-' + ymd + '-' + strikePrice + '-' + optionType;
1625
- optionType = (optionType === 'P') ? 'put' : 'call';
1636
+ if (expiry !== undefined) {
1637
+ const ymd = this.yymmdd(expiry);
1638
+ symbol = symbol + '-' + ymd + '-' + strikePrice + '-' + optionType;
1639
+ optionType = (optionType === 'P') ? 'put' : 'call';
1640
+ }
1626
1641
  }
1627
1642
  }
1628
1643
  const tickSize = this.safeString(market, 'tickSz');
@@ -1818,33 +1833,32 @@ export default class okx extends Exchange {
1818
1833
  const chainsLength = chains.length;
1819
1834
  for (let j = 0; j < chainsLength; j++) {
1820
1835
  const chain = chains[j];
1821
- const networkId = this.safeString(chain, 'chain'); // USDT-BEP20, USDT-Avalance-C, etc
1822
- if (networkId !== undefined) {
1823
- const idParts = networkId.split('-');
1824
- const parts = this.arraySlice(idParts, 1);
1825
- const chainPart = parts.join('-');
1826
- const networkCode = this.networkIdToCode(chainPart, currency['code']);
1827
- networks[networkCode] = {
1828
- 'id': networkId,
1829
- 'network': networkCode,
1830
- 'active': undefined,
1831
- 'deposit': this.safeBool(chain, 'canDep'),
1832
- 'withdraw': this.safeBool(chain, 'canWd'),
1833
- 'fee': this.safeNumber(chain, 'fee'),
1834
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'wdTickSz'))),
1835
- 'limits': {
1836
- 'withdraw': {
1837
- 'min': this.safeNumber(chain, 'minWd'),
1838
- 'max': this.safeNumber(chain, 'maxWd'),
1839
- },
1840
- },
1841
- 'info': chain,
1842
- };
1843
- }
1844
- else {
1845
- // only happens for FIAT currency
1836
+ // allow empty string for rare fiat-currencies, e.g. TRY
1837
+ const networkId = this.safeString(chain, 'chain', ''); // USDT-BEP20, USDT-Avalance-C, etc
1838
+ if (networkId === '') {
1839
+ // only happens for fiat 'TRY' currency
1846
1840
  type = 'fiat';
1847
1841
  }
1842
+ const idParts = networkId.split('-');
1843
+ const parts = this.arraySlice(idParts, 1);
1844
+ const chainPart = parts.join('-');
1845
+ const networkCode = this.networkIdToCode(chainPart, currency['code']);
1846
+ networks[networkCode] = {
1847
+ 'id': networkId,
1848
+ 'network': networkCode,
1849
+ 'active': undefined,
1850
+ 'deposit': this.safeBool(chain, 'canDep'),
1851
+ 'withdraw': this.safeBool(chain, 'canWd'),
1852
+ 'fee': this.safeNumber(chain, 'fee'),
1853
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'wdTickSz'))),
1854
+ 'limits': {
1855
+ 'withdraw': {
1856
+ 'min': this.safeNumber(chain, 'minWd'),
1857
+ 'max': this.safeNumber(chain, 'maxWd'),
1858
+ },
1859
+ },
1860
+ 'info': chain,
1861
+ };
1848
1862
  }
1849
1863
  const firstChain = this.safeDict(chains, 0, {});
1850
1864
  result[code] = this.safeCurrencyStructure({
package/js/src/paradex.js CHANGED
@@ -704,18 +704,9 @@ export default class paradex extends Exchange {
704
704
  async fetchTickers(symbols = undefined, params = {}) {
705
705
  await this.loadMarkets();
706
706
  symbols = this.marketSymbols(symbols);
707
- const request = {};
708
- if (symbols !== undefined) {
709
- if (Array.isArray(symbols)) {
710
- request['market'] = this.marketId(symbols[0]);
711
- }
712
- else {
713
- request['market'] = this.marketId(symbols);
714
- }
715
- }
716
- else {
717
- request['market'] = 'ALL';
718
- }
707
+ const request = {
708
+ 'market': 'ALL',
709
+ };
719
710
  const response = await this.publicGetMarketsSummary(this.extend(request, params));
720
711
  //
721
712
  // {
@@ -614,7 +614,7 @@ export default class hyperliquid extends hyperliquidRest {
614
614
  'datetime': this.iso8601(timestamp),
615
615
  'symbol': symbol,
616
616
  'id': id,
617
- 'order': undefined,
617
+ 'order': this.safeString(trade, 'oid'),
618
618
  'type': undefined,
619
619
  'side': side,
620
620
  'takerOrMaker': undefined,
package/js/src/upbit.js CHANGED
@@ -18,7 +18,7 @@ export default class upbit extends Exchange {
18
18
  'name': 'Upbit',
19
19
  'countries': ['KR'],
20
20
  'version': 'v1',
21
- 'rateLimit': 1000,
21
+ 'rateLimit': 50,
22
22
  'pro': true,
23
23
  // new metainfo interface
24
24
  'has': {
@@ -73,6 +73,7 @@ export default class upbit extends Exchange {
73
73
  'withdraw': true,
74
74
  },
75
75
  'timeframes': {
76
+ '1s': 'seconds',
76
77
  '1m': 'minutes',
77
78
  '3m': 'minutes',
78
79
  '5m': 'minutes',
@@ -84,6 +85,7 @@ export default class upbit extends Exchange {
84
85
  '1d': 'days',
85
86
  '1w': 'weeks',
86
87
  '1M': 'months',
88
+ '1y': 'years',
87
89
  },
88
90
  'hostname': 'api.upbit.com',
89
91
  'urls': {
@@ -97,54 +99,70 @@ export default class upbit extends Exchange {
97
99
  'fees': 'https://upbit.com/service_center/guide',
98
100
  },
99
101
  'api': {
102
+ // 'endpoint','API Cost'
103
+ // cost = 1000 / (rateLimit * RPS)
100
104
  'public': {
101
- 'get': [
102
- 'market/all',
103
- 'candles/{timeframe}',
104
- 'candles/{timeframe}/{unit}',
105
- 'candles/minutes/{unit}',
106
- 'candles/minutes/1',
107
- 'candles/minutes/3',
108
- 'candles/minutes/5',
109
- 'candles/minutes/10',
110
- 'candles/minutes/15',
111
- 'candles/minutes/30',
112
- 'candles/minutes/60',
113
- 'candles/minutes/240',
114
- 'candles/days',
115
- 'candles/weeks',
116
- 'candles/months',
117
- 'trades/ticks',
118
- 'ticker',
119
- 'orderbook',
120
- ],
105
+ 'get': {
106
+ 'market/all': 2,
107
+ 'candles/{timeframe}': 2,
108
+ 'candles/{timeframe}/{unit}': 2,
109
+ 'candles/seconds': 2,
110
+ 'candles/minutes/{unit}': 2,
111
+ 'candles/minutes/1': 2,
112
+ 'candles/minutes/3': 2,
113
+ 'candles/minutes/5': 2,
114
+ 'candles/minutes/10': 2,
115
+ 'candles/minutes/15': 2,
116
+ 'candles/minutes/30': 2,
117
+ 'candles/minutes/60': 2,
118
+ 'candles/minutes/240': 2,
119
+ 'candles/days': 2,
120
+ 'candles/weeks': 2,
121
+ 'candles/months': 2,
122
+ 'candles/years': 2,
123
+ 'trades/ticks': 2,
124
+ 'ticker': 2,
125
+ 'ticker/all': 2,
126
+ 'orderbook': 2,
127
+ 'orderbook/supported_levels': 2, // Upbit KR only
128
+ },
121
129
  },
122
130
  'private': {
123
- 'get': [
124
- 'accounts',
125
- 'orders/chance',
126
- 'order',
127
- 'orders',
128
- 'orders/closed',
129
- 'orders/open',
130
- 'orders/uuids',
131
- 'withdraws',
132
- 'withdraw',
133
- 'withdraws/chance',
134
- 'deposits',
135
- 'deposit',
136
- 'deposits/coin_addresses',
137
- 'deposits/coin_address',
138
- ],
139
- 'post': [
140
- 'orders',
141
- 'withdraws/coin',
142
- 'withdraws/krw',
143
- 'deposits/generate_coin_address',
144
- ],
145
- 'delete': [
146
- 'order',
147
- ],
131
+ 'get': {
132
+ 'accounts': 0.67,
133
+ 'orders/chance': 0.67,
134
+ 'order': 0.67,
135
+ 'orders/closed': 0.67,
136
+ 'orders/open': 0.67,
137
+ 'orders/uuids': 0.67,
138
+ 'withdraws': 0.67,
139
+ 'withdraw': 0.67,
140
+ 'withdraws/chance': 0.67,
141
+ 'withdraws/coin_addresses': 0.67,
142
+ 'deposits': 0.67,
143
+ 'deposits/chance/coin': 0.67,
144
+ 'deposit': 0.67,
145
+ 'deposits/coin_addresses': 0.67,
146
+ 'deposits/coin_address': 0.67,
147
+ 'travel_rule/vasps': 0.67,
148
+ 'status/wallet': 0.67,
149
+ 'api_keys': 0.67, // Upbit KR only
150
+ },
151
+ 'post': {
152
+ 'orders': 2.5,
153
+ 'orders/cancel_and_new': 2.5,
154
+ 'withdraws/coin': 0.67,
155
+ 'withdraws/krw': 0.67,
156
+ 'deposits/krw': 0.67,
157
+ 'deposits/generate_coin_address': 0.67,
158
+ 'travel_rule/deposit/uuid': 0.67,
159
+ 'travel_rule/deposit/txid': 0.67, // RPS: 30, but each deposit can only be queried once every 10 minutes
160
+ },
161
+ 'delete': {
162
+ 'order': 0.67,
163
+ 'orders/open': 40,
164
+ 'orders/uuids': 0.67,
165
+ },
148
166
  },
149
167
  },
150
168
  'fees': {
package/js/src/xt.d.ts CHANGED
@@ -539,6 +539,25 @@ export default class xt extends Exchange {
539
539
  * @returns {object} response from the exchange
540
540
  */
541
541
  setMarginMode(marginMode: string, symbol?: Str, params?: {}): Promise<any>;
542
+ /**
543
+ * @method
544
+ * @name xt#editOrder
545
+ * @description cancels an order and places a new order
546
+ * @see https://doc.xt.com/#orderorderUpdate
547
+ * @see https://doc.xt.com/#futures_orderupdate
548
+ * @see https://doc.xt.com/#futures_entrustupdateProfit
549
+ * @param {string} id order id
550
+ * @param {string} symbol unified symbol of the market to create an order in
551
+ * @param {string} type 'market' or 'limit'
552
+ * @param {string} side 'buy' or 'sell'
553
+ * @param {float} amount how much of the currency you want to trade in units of the base currency
554
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
555
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
556
+ * @param {float} [params.stopLoss] price to set a stop-loss on an open position
557
+ * @param {float} [params.takeProfit] price to set a take-profit on an open position
558
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
559
+ */
560
+ editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
542
561
  handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
543
562
  sign(path: any, api?: any[], method?: string, params?: {}, headers?: any, body?: any): {
544
563
  url: any;