ccxt 4.4.31 → 4.4.33

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 (111) hide show
  1. package/README.md +9 -3
  2. package/dist/ccxt.browser.min.js +4 -4
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/base/Exchange.js +89 -0
  5. package/dist/cjs/src/binance.js +154 -0
  6. package/dist/cjs/src/bitvavo.js +0 -4
  7. package/dist/cjs/src/bybit.js +138 -6
  8. package/dist/cjs/src/cex.js +4 -3
  9. package/dist/cjs/src/coinbase.js +2 -22
  10. package/dist/cjs/src/coinbaseexchange.js +2 -1
  11. package/dist/cjs/src/coincatch.js +3 -3
  12. package/dist/cjs/src/coinex.js +2 -1
  13. package/dist/cjs/src/deribit.js +2 -2
  14. package/dist/cjs/src/gate.js +19 -3
  15. package/dist/cjs/src/hitbtc.js +3 -3
  16. package/dist/cjs/src/htx.js +1 -1
  17. package/dist/cjs/src/hyperliquid.js +14 -2
  18. package/dist/cjs/src/indodax.js +1 -1
  19. package/dist/cjs/src/kraken.js +5 -2
  20. package/dist/cjs/src/krakenfutures.js +2 -0
  21. package/dist/cjs/src/kucoin.js +5 -3
  22. package/dist/cjs/src/kucoinfutures.js +99 -28
  23. package/dist/cjs/src/lbank.js +1 -0
  24. package/dist/cjs/src/okx.js +94 -3
  25. package/dist/cjs/src/phemex.js +31 -30
  26. package/dist/cjs/src/pro/binance.js +8 -8
  27. package/dist/cjs/src/pro/bitget.js +4 -4
  28. package/dist/cjs/src/pro/bitmart.js +2 -2
  29. package/dist/cjs/src/pro/bitmex.js +2 -2
  30. package/dist/cjs/src/pro/bitvavo.js +46 -48
  31. package/dist/cjs/src/pro/blofin.js +2 -2
  32. package/dist/cjs/src/pro/bybit.js +2 -2
  33. package/dist/cjs/src/pro/coincatch.js +1 -1
  34. package/dist/cjs/src/pro/cryptocom.js +4 -4
  35. package/dist/cjs/src/pro/gate.js +4 -4
  36. package/dist/cjs/src/pro/hashkey.js +3 -3
  37. package/dist/cjs/src/pro/mexc.js +1 -2
  38. package/dist/cjs/src/pro/okx.js +11 -1
  39. package/dist/cjs/src/wavesexchange.js +1 -0
  40. package/dist/cjs/src/woofipro.js +2 -2
  41. package/js/ccxt.d.ts +1 -1
  42. package/js/ccxt.js +1 -1
  43. package/js/src/abstract/coinbaseexchange.d.ts +1 -0
  44. package/js/src/abstract/kraken.d.ts +1 -0
  45. package/js/src/base/Exchange.d.ts +3 -0
  46. package/js/src/base/Exchange.js +89 -0
  47. package/js/src/binance.d.ts +1 -0
  48. package/js/src/binance.js +154 -0
  49. package/js/src/bitvavo.js +0 -4
  50. package/js/src/bybit.js +139 -7
  51. package/js/src/cex.d.ts +1 -1
  52. package/js/src/cex.js +5 -4
  53. package/js/src/coinbase.js +2 -22
  54. package/js/src/coinbaseexchange.js +2 -1
  55. package/js/src/coincatch.d.ts +1 -1
  56. package/js/src/coincatch.js +3 -3
  57. package/js/src/coinex.d.ts +1 -1
  58. package/js/src/coinex.js +2 -1
  59. package/js/src/deribit.d.ts +2 -2
  60. package/js/src/deribit.js +2 -2
  61. package/js/src/gate.d.ts +3 -1
  62. package/js/src/gate.js +19 -3
  63. package/js/src/hitbtc.d.ts +3 -3
  64. package/js/src/hitbtc.js +3 -3
  65. package/js/src/htx.d.ts +1 -1
  66. package/js/src/htx.js +1 -1
  67. package/js/src/hyperliquid.d.ts +2 -1
  68. package/js/src/hyperliquid.js +14 -2
  69. package/js/src/indodax.js +1 -1
  70. package/js/src/kraken.d.ts +4 -2
  71. package/js/src/kraken.js +5 -2
  72. package/js/src/krakenfutures.d.ts +2 -0
  73. package/js/src/krakenfutures.js +2 -0
  74. package/js/src/kucoin.d.ts +3 -3
  75. package/js/src/kucoin.js +5 -3
  76. package/js/src/kucoinfutures.d.ts +9 -5
  77. package/js/src/kucoinfutures.js +99 -28
  78. package/js/src/lbank.js +1 -0
  79. package/js/src/okx.d.ts +2 -2
  80. package/js/src/okx.js +94 -3
  81. package/js/src/phemex.d.ts +4 -0
  82. package/js/src/phemex.js +31 -30
  83. package/js/src/pro/binance.d.ts +8 -8
  84. package/js/src/pro/binance.js +8 -8
  85. package/js/src/pro/bitget.d.ts +3 -3
  86. package/js/src/pro/bitget.js +4 -4
  87. package/js/src/pro/bitmart.d.ts +2 -2
  88. package/js/src/pro/bitmart.js +2 -2
  89. package/js/src/pro/bitmex.d.ts +2 -2
  90. package/js/src/pro/bitmex.js +2 -2
  91. package/js/src/pro/bitvavo.d.ts +1 -1
  92. package/js/src/pro/bitvavo.js +46 -48
  93. package/js/src/pro/blofin.d.ts +2 -2
  94. package/js/src/pro/blofin.js +2 -2
  95. package/js/src/pro/bybit.d.ts +2 -2
  96. package/js/src/pro/bybit.js +2 -2
  97. package/js/src/pro/coincatch.d.ts +1 -1
  98. package/js/src/pro/coincatch.js +1 -1
  99. package/js/src/pro/cryptocom.d.ts +4 -4
  100. package/js/src/pro/cryptocom.js +4 -4
  101. package/js/src/pro/gate.d.ts +4 -4
  102. package/js/src/pro/gate.js +4 -4
  103. package/js/src/pro/hashkey.d.ts +3 -3
  104. package/js/src/pro/hashkey.js +3 -3
  105. package/js/src/pro/mexc.js +1 -2
  106. package/js/src/pro/okx.js +11 -1
  107. package/js/src/wavesexchange.d.ts +1 -0
  108. package/js/src/wavesexchange.js +1 -0
  109. package/js/src/woofipro.d.ts +2 -2
  110. package/js/src/woofipro.js +2 -2
  111. package/package.json +1 -1
@@ -2275,7 +2275,7 @@ export default class coincatch extends Exchange {
2275
2275
  /**
2276
2276
  * @method
2277
2277
  * @ignore
2278
- * @name hashkey#createSpotOrderRequest
2278
+ * @name coincatch#createSpotOrderRequest
2279
2279
  * @description helper function to build request
2280
2280
  * @param {string} symbol unified symbol of the market to create an order in
2281
2281
  * @param {string} type 'market' or 'limit'
@@ -2455,7 +2455,7 @@ export default class coincatch extends Exchange {
2455
2455
  /**
2456
2456
  * @method
2457
2457
  * @ignore
2458
- * @name hashkey#createSwapOrderRequest
2458
+ * @name coincatch#createSwapOrderRequest
2459
2459
  * @description helper function to build request
2460
2460
  * @param {string} symbol unified symbol of the market to create an order in
2461
2461
  * @param {string} type 'market' or 'limit'
@@ -4622,7 +4622,7 @@ export default class coincatch extends Exchange {
4622
4622
  }
4623
4623
  /**
4624
4624
  * @method
4625
- * @name hashkey#setLeverage
4625
+ * @name coincatch#setLeverage
4626
4626
  * @description set the level of leverage for a market
4627
4627
  * @see https://hashkeyglobal-apidoc.readme.io/reference/change-futures-leverage-trade
4628
4628
  * @param {float} leverage the rate of leverage
@@ -279,7 +279,7 @@ export default class coinex extends Exchange {
279
279
  * @see https://docs.coinex.com/api/v2/spot/order/http/list-finished-stop-order
280
280
  * @see https://docs.coinex.com/api/v2/futures/order/http/list-finished-order
281
281
  * @see https://docs.coinex.com/api/v2/futures/order/http/list-finished-stop-order
282
- * @param status
282
+ * @param {string} status order status to fetch for
283
283
  * @param {string} symbol unified market symbol of the market orders were made in
284
284
  * @param {int} [since] the earliest time in ms to fetch orders for
285
285
  * @param {int} [limit] the maximum number of order structures to retrieve
package/js/src/coinex.js CHANGED
@@ -3393,7 +3393,7 @@ export default class coinex extends Exchange {
3393
3393
  * @see https://docs.coinex.com/api/v2/spot/order/http/list-finished-stop-order
3394
3394
  * @see https://docs.coinex.com/api/v2/futures/order/http/list-finished-order
3395
3395
  * @see https://docs.coinex.com/api/v2/futures/order/http/list-finished-stop-order
3396
- * @param status
3396
+ * @param {string} status order status to fetch for
3397
3397
  * @param {string} symbol unified market symbol of the market orders were made in
3398
3398
  * @param {int} [since] the earliest time in ms to fetch orders for
3399
3399
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -4773,6 +4773,7 @@ export default class coinex extends Exchange {
4773
4773
  'not_pass': 'failed',
4774
4774
  'cancel': 'canceled',
4775
4775
  'finish': 'ok',
4776
+ 'finished': 'ok',
4776
4777
  'fail': 'failed',
4777
4778
  };
4778
4779
  return this.safeString(statuses, status, status);
@@ -438,8 +438,8 @@ export default class deribit extends Exchange {
438
438
  * @description fetch the current funding rate
439
439
  * @see https://docs.deribit.com/#public-get_funding_rate_history
440
440
  * @param {string} symbol unified market symbol
441
- * @param since
442
- * @param limit
441
+ * @param {int} [since] the earliest time in ms to fetch funding rate history for
442
+ * @param {int} [limit] the maximum number of entries to retrieve
443
443
  * @param {object} [params] extra parameters specific to the exchange API endpoint
444
444
  * @param {int} [params.end_timestamp] fetch funding rate ending at this timestamp
445
445
  * @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)
package/js/src/deribit.js CHANGED
@@ -3061,8 +3061,8 @@ export default class deribit extends Exchange {
3061
3061
  * @description fetch the current funding rate
3062
3062
  * @see https://docs.deribit.com/#public-get_funding_rate_history
3063
3063
  * @param {string} symbol unified market symbol
3064
- * @param since
3065
- * @param limit
3064
+ * @param {int} [since] the earliest time in ms to fetch funding rate history for
3065
+ * @param {int} [limit] the maximum number of entries to retrieve
3066
3066
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3067
3067
  * @param {int} [params.end_timestamp] fetch funding rate ending at this timestamp
3068
3068
  * @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)
package/js/src/gate.d.ts CHANGED
@@ -8,9 +8,9 @@ export default class gate extends Exchange {
8
8
  describe(): any;
9
9
  setSandboxMode(enable: boolean): void;
10
10
  /**
11
- * @param {object} [params] extra parameters specific to the exchange API endpoint
12
11
  * @method
13
12
  * @name gate#isUnifiedEnabled
13
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
14
14
  * @description returns unifiedAccount so the user can check if the unified account is enabled
15
15
  * @see https://www.gate.io/docs/developers/apiv4/#get-account-detail
16
16
  * @returns {boolean} true or false if the enabled unified account is enabled or not and sets the unifiedAccount option if it is undefined
@@ -300,6 +300,8 @@ export default class gate extends Exchange {
300
300
  * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
301
301
  * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
302
302
  * @param {object} [params] extra parameters specific to the exchange API endpoint
303
+ * @param {int} [params.until] timestamp in ms of the latest funding rate to fetch
304
+ * @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)
303
305
  * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
304
306
  */
305
307
  fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
package/js/src/gate.js CHANGED
@@ -900,9 +900,9 @@ export default class gate extends Exchange {
900
900
  this.options['sandboxMode'] = enable;
901
901
  }
902
902
  /**
903
- * @param {object} [params] extra parameters specific to the exchange API endpoint
904
903
  * @method
905
904
  * @name gate#isUnifiedEnabled
905
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
906
906
  * @description returns unifiedAccount so the user can check if the unified account is enabled
907
907
  * @see https://www.gate.io/docs/developers/apiv4/#get-account-detail
908
908
  * @returns {boolean} true or false if the enabled unified account is enabled or not and sets the unifiedAccount option if it is undefined
@@ -3141,6 +3141,8 @@ export default class gate extends Exchange {
3141
3141
  * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
3142
3142
  * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
3143
3143
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3144
+ * @param {int} [params.until] timestamp in ms of the latest funding rate to fetch
3145
+ * @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)
3144
3146
  * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
3145
3147
  */
3146
3148
  async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -3148,15 +3150,29 @@ export default class gate extends Exchange {
3148
3150
  throw new ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
3149
3151
  }
3150
3152
  await this.loadMarkets();
3153
+ let paginate = false;
3154
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
3155
+ if (paginate) {
3156
+ return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params);
3157
+ }
3151
3158
  const market = this.market(symbol);
3152
3159
  if (!market['swap']) {
3153
3160
  throw new BadSymbol(this.id + ' fetchFundingRateHistory() supports swap contracts only');
3154
3161
  }
3155
- const [request, query] = this.prepareRequest(market, undefined, params);
3162
+ let request = {};
3163
+ [request, params] = this.prepareRequest(market, undefined, params);
3156
3164
  if (limit !== undefined) {
3157
3165
  request['limit'] = limit;
3158
3166
  }
3159
- const response = await this.publicFuturesGetSettleFundingRate(this.extend(request, query));
3167
+ if (since !== undefined) {
3168
+ request['from'] = this.parseToInt(since / 1000);
3169
+ }
3170
+ const until = this.safeInteger(params, 'until');
3171
+ if (until !== undefined) {
3172
+ params = this.omit(params, 'until');
3173
+ request['to'] = this.parseToInt(until / 1000);
3174
+ }
3175
+ const response = await this.publicFuturesGetSettleFundingRate(this.extend(request, params));
3160
3176
  //
3161
3177
  // {
3162
3178
  // "r": "0.00063521",
@@ -158,7 +158,7 @@ export default class hitbtc extends Exchange {
158
158
  * @name hitbtc#fetchOrderBooks
159
159
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data for multiple markets
160
160
  * @see https://api.hitbtc.com/#order-books
161
- * @param {string[]|undefined} symbols list of unified market symbols, all symbols fetched if undefined, default is undefined
161
+ * @param {string[]} [symbols] list of unified market symbols, all symbols fetched if undefined, default is undefined
162
162
  * @param {int} [limit] max number of entries per orderbook to return, default is undefined
163
163
  * @param {object} [params] extra parameters specific to the exchange API endpoint
164
164
  * @returns {object} a dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbol
@@ -535,8 +535,8 @@ export default class hitbtc extends Exchange {
535
535
  * @name hitbtc#closePosition
536
536
  * @description closes open positions for a market
537
537
  * @see https://api.hitbtc.com/#close-all-futures-margin-positions
538
- * @param symbol
539
- * @param side
538
+ * @param {string} symbol unified ccxt market symbol
539
+ * @param {string} side 'buy' or 'sell'
540
540
  * @param {object} [params] extra parameters specific to the okx api endpoint
541
541
  * @param {string} [params.symbol] *required* unified market symbol
542
542
  * @param {string} [params.marginMode] 'cross' or 'isolated', default is 'cross'
package/js/src/hitbtc.js CHANGED
@@ -1559,7 +1559,7 @@ export default class hitbtc extends Exchange {
1559
1559
  * @name hitbtc#fetchOrderBooks
1560
1560
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data for multiple markets
1561
1561
  * @see https://api.hitbtc.com/#order-books
1562
- * @param {string[]|undefined} symbols list of unified market symbols, all symbols fetched if undefined, default is undefined
1562
+ * @param {string[]} [symbols] list of unified market symbols, all symbols fetched if undefined, default is undefined
1563
1563
  * @param {int} [limit] max number of entries per orderbook to return, default is undefined
1564
1564
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1565
1565
  * @returns {object} a dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbol
@@ -3580,8 +3580,8 @@ export default class hitbtc extends Exchange {
3580
3580
  * @name hitbtc#closePosition
3581
3581
  * @description closes open positions for a market
3582
3582
  * @see https://api.hitbtc.com/#close-all-futures-margin-positions
3583
- * @param symbol
3584
- * @param side
3583
+ * @param {string} symbol unified ccxt market symbol
3584
+ * @param {string} side 'buy' or 'sell'
3585
3585
  * @param {object} [params] extra parameters specific to the okx api endpoint
3586
3586
  * @param {string} [params.symbol] *required* unified market symbol
3587
3587
  * @param {string} [params.marginMode] 'cross' or 'isolated', default is 'cross'
package/js/src/htx.d.ts CHANGED
@@ -264,7 +264,7 @@ export default class htx extends Exchange {
264
264
  * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-accounts-of-the-current-user
265
265
  * @param {string} type 'spot', 'swap' or 'future
266
266
  * @param {string} [marginMode] 'cross' or 'isolated'
267
- * @param symbol
267
+ * @param {string} [symbol] unified ccxt market symbol
268
268
  * @param {object} [params] extra parameters specific to the exchange API endpoint
269
269
  * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
270
270
  */
package/js/src/htx.js CHANGED
@@ -3215,7 +3215,7 @@ export default class htx extends Exchange {
3215
3215
  * @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-accounts-of-the-current-user
3216
3216
  * @param {string} type 'spot', 'swap' or 'future
3217
3217
  * @param {string} [marginMode] 'cross' or 'isolated'
3218
- * @param symbol
3218
+ * @param {string} [symbol] unified ccxt market symbol
3219
3219
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3220
3220
  * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
3221
3221
  */
@@ -74,8 +74,9 @@ export default class hyperliquid extends Exchange {
74
74
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
75
75
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
76
76
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
77
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
77
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
78
78
  * @param {object} [params] extra parameters specific to the exchange API endpoint
79
+ * @param {string} [params.type] 'spot' or 'swap', by default fetches both
79
80
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
80
81
  */
81
82
  fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
@@ -730,15 +730,27 @@ export default class hyperliquid extends Exchange {
730
730
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
731
731
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
732
732
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
733
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
733
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
734
734
  * @param {object} [params] extra parameters specific to the exchange API endpoint
735
+ * @param {string} [params.type] 'spot' or 'swap', by default fetches both
735
736
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
736
737
  */
737
738
  async fetchTickers(symbols = undefined, params = {}) {
738
739
  await this.loadMarkets();
739
740
  symbols = this.marketSymbols(symbols);
740
741
  // at this stage, to get tickers data, we use fetchMarkets endpoints
741
- const response = await this.fetchMarkets(params);
742
+ let response = [];
743
+ const type = this.safeString(params, 'type');
744
+ params = this.omit(params, 'type');
745
+ if (type === 'spot') {
746
+ response = await this.fetchSpotMarkets(params);
747
+ }
748
+ else if (type === 'swap') {
749
+ response = await this.fetchSwapMarkets(params);
750
+ }
751
+ else {
752
+ response = await this.fetchMarkets(params);
753
+ }
742
754
  // same response as under "fetchMarkets"
743
755
  const result = {};
744
756
  for (let i = 0; i < response.length; i++) {
package/js/src/indodax.js CHANGED
@@ -23,7 +23,7 @@ export default class indodax extends Exchange {
23
23
  'countries': ['ID'],
24
24
  // 10 requests per second for making trades => 1000ms / 10 = 100ms
25
25
  // 180 requests per minute (public endpoints) = 2 requests per second => cost = (1000ms / rateLimit) / 2 = 5
26
- 'rateLimit': 100,
26
+ 'rateLimit': 50,
27
27
  'has': {
28
28
  'CORS': undefined,
29
29
  'spot': true,
@@ -253,8 +253,8 @@ export default class kraken extends Exchange {
253
253
  * @name kraken#fetchOrdersByIds
254
254
  * @description fetch orders by the list of order id
255
255
  * @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getClosedOrders
256
- * @param {string[]|undefined} ids list of order id
257
- * @param symbol
256
+ * @param {string[]} [ids] list of order id
257
+ * @param {string} [symbol] unified ccxt market symbol
258
258
  * @param {object} [params] extra parameters specific to the kraken api endpoint
259
259
  * @returns {object[]} a list of [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
260
260
  */
@@ -440,6 +440,8 @@ export default class kraken extends Exchange {
440
440
  parsePosition(position: Dict, market?: Market): import("./base/types.js").Position;
441
441
  parseAccountType(account: any): string;
442
442
  /**
443
+ * @method
444
+ * @name kraken#transferOut
443
445
  * @description transfer from spot wallet to futures wallet
444
446
  * @see https://docs.kraken.com/rest/#tag/User-Funding/operation/walletTransfer
445
447
  * @param {str} code Unified currency code
package/js/src/kraken.js CHANGED
@@ -182,6 +182,7 @@ export default class kraken extends Exchange {
182
182
  'AddOrder': 0,
183
183
  'AddOrderBatch': 0,
184
184
  'AddExport': 3,
185
+ 'AmendOrder': 0,
185
186
  'Balance': 3,
186
187
  'CancelAll': 3,
187
188
  'CancelAllOrdersAfter': 3,
@@ -2147,8 +2148,8 @@ export default class kraken extends Exchange {
2147
2148
  * @name kraken#fetchOrdersByIds
2148
2149
  * @description fetch orders by the list of order id
2149
2150
  * @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getClosedOrders
2150
- * @param {string[]|undefined} ids list of order id
2151
- * @param symbol
2151
+ * @param {string[]} [ids] list of order id
2152
+ * @param {string} [symbol] unified ccxt market symbol
2152
2153
  * @param {object} [params] extra parameters specific to the kraken api endpoint
2153
2154
  * @returns {object[]} a list of [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2154
2155
  */
@@ -3071,6 +3072,8 @@ export default class kraken extends Exchange {
3071
3072
  return this.safeString(accountByType, account, account);
3072
3073
  }
3073
3074
  /**
3075
+ * @method
3076
+ * @name kraken#transferOut
3074
3077
  * @description transfer from spot wallet to futures wallet
3075
3078
  * @see https://docs.kraken.com/rest/#tag/User-Funding/operation/walletTransfer
3076
3079
  * @param {str} code Unified currency code
@@ -297,6 +297,8 @@ export default class krakenfutures extends Exchange {
297
297
  parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
298
298
  parseAccount(account: any): any;
299
299
  /**
300
+ * @method
301
+ * @name krakenfutures#transferOut
300
302
  * @description transfer from futures wallet to spot wallet
301
303
  * @param {str} code Unified currency code
302
304
  * @param {float} amount Size of the transfer
@@ -2577,6 +2577,8 @@ export default class krakenfutures extends Exchange {
2577
2577
  }
2578
2578
  }
2579
2579
  /**
2580
+ * @method
2581
+ * @name krakenfutures#transferOut
2580
2582
  * @description transfer from futures wallet to spot wallet
2581
2583
  * @param {str} code Unified currency code
2582
2584
  * @param {float} amount Size of the transfer
@@ -42,9 +42,9 @@ export default class kucoin extends Exchange {
42
42
  */
43
43
  fetchMarkets(params?: {}): Promise<Market[]>;
44
44
  /**
45
- * @param force
46
45
  * @method
47
46
  * @name kucoin#loadMigrationStatus
47
+ * @param {boolean} force load account state for non hf
48
48
  * @description loads the migration status for the account (hf or not)
49
49
  * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/get-user-type
50
50
  */
@@ -742,8 +742,8 @@ export default class kucoin extends Exchange {
742
742
  * @name kucoin#setLeverage
743
743
  * @description set the level of leverage for a market
744
744
  * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/modify-leverage-multiplier
745
- * @param leverage
746
- * @param {string} symbol unified market symbol
745
+ * @param {int } [leverage] New leverage multiplier. Must be greater than 1 and up to two decimal places, and cannot be less than the user's current debt leverage or greater than the system's maximum leverage
746
+ * @param {string} [symbol] unified market symbol
747
747
  * @param {object} [params] extra parameters specific to the exchange API endpoint
748
748
  * @returns {object} response from the exchange
749
749
  */
package/js/src/kucoin.js CHANGED
@@ -574,6 +574,8 @@ export default class kucoin extends Exchange {
574
574
  '400303': PermissionDenied,
575
575
  '500000': ExchangeNotAvailable,
576
576
  '260220': InvalidAddress,
577
+ '600100': InsufficientFunds,
578
+ '600101': InvalidOrder,
577
579
  '900014': BadRequest, // {"code":"900014","msg":"Invalid chainId"}
578
580
  },
579
581
  'broad': {
@@ -1231,9 +1233,9 @@ export default class kucoin extends Exchange {
1231
1233
  return result;
1232
1234
  }
1233
1235
  /**
1234
- * @param force
1235
1236
  * @method
1236
1237
  * @name kucoin#loadMigrationStatus
1238
+ * @param {boolean} force load account state for non hf
1237
1239
  * @description loads the migration status for the account (hf or not)
1238
1240
  * @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/get-user-type
1239
1241
  */
@@ -4950,8 +4952,8 @@ export default class kucoin extends Exchange {
4950
4952
  * @name kucoin#setLeverage
4951
4953
  * @description set the level of leverage for a market
4952
4954
  * @see https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/modify-leverage-multiplier
4953
- * @param leverage
4954
- * @param {string} symbol unified market symbol
4955
+ * @param {int } [leverage] New leverage multiplier. Must be greater than 1 and up to two decimal places, and cannot be less than the user's current debt leverage or greater than the system's maximum leverage
4956
+ * @param {string} [symbol] unified market symbol
4955
4957
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4956
4958
  * @returns {object} response from the exchange
4957
4959
  */
@@ -154,8 +154,8 @@ export default class kucoinfutures extends kucoin {
154
154
  * @description fetches historical positions
155
155
  * @see https://www.kucoin.com/docs/rest/futures-trading/positions/get-positions-history
156
156
  * @param {string[]} [symbols] list of unified market symbols
157
- * @param since
158
- * @param limit
157
+ * @param {int} [since] the earliest time in ms to fetch position history for
158
+ * @param {int} [limit] the maximum number of entries to retrieve
159
159
  * @param {object} [params] extra parameters specific to the exchange API endpoint
160
160
  * @param {int} [params.until] closing end time
161
161
  * @param {int} [params.pageId] page id
@@ -167,7 +167,7 @@ export default class kucoinfutures extends kucoin {
167
167
  * @method
168
168
  * @name kucoinfutures#createOrder
169
169
  * @description Create an order on the exchange
170
- * @see https://docs.kucoin.com/futures/#place-an-order
170
+ * @see https://www.kucoin.com/docs/rest/futures-trading/orders/place-order
171
171
  * @see https://www.kucoin.com/docs/rest/futures-trading/orders/place-take-profit-and-stop-loss-order#http-request
172
172
  * @param {string} symbol Unified CCXT market symbol
173
173
  * @param {string} type 'limit' or 'market'
@@ -183,8 +183,9 @@ export default class kucoinfutures extends kucoin {
183
183
  * @param {bool} [params.reduceOnly] A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true.
184
184
  * @param {string} [params.timeInForce] GTC, GTT, IOC, or FOK, default is GTC, limit orders only
185
185
  * @param {string} [params.postOnly] Post only flag, invalid when timeInForce is IOC or FOK
186
+ * @param {float} [params.cost] the cost of the order in units of USDT
186
187
  * ----------------- Exchange Specific Parameters -----------------
187
- * @param {float} [params.leverage] Leverage size of the order
188
+ * @param {float} [params.leverage] Leverage size of the order (mandatory param in request, default is 1)
188
189
  * @param {string} [params.clientOid] client order id, defaults to uuid if not passed
189
190
  * @param {string} [params.remark] remark for the order, length cannot exceed 100 utf8 characters
190
191
  * @param {string} [params.stop] 'up' or 'down', the direction the stopPrice is triggered from, requires stopPrice. down: Triggers when the price reaches or goes below the stopPrice. up: Triggers when the price reaches or goes above the stopPrice.
@@ -355,6 +356,8 @@ export default class kucoinfutures extends kucoin {
355
356
  * @method
356
357
  * @name kucoinfutures#transfer
357
358
  * @description transfer currency internally between wallets on the same account
359
+ * @see https://www.kucoin.com/docs/rest/funding/transfer/transfer-to-main-or-trade-account
360
+ * @see https://www.kucoin.com/docs/rest/funding/transfer/transfer-to-futures-account
358
361
  * @param {string} code unified currency code
359
362
  * @param {float} amount amount to transfer
360
363
  * @param {string} fromAccount account to transfer from
@@ -365,6 +368,7 @@ export default class kucoinfutures extends kucoin {
365
368
  transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
366
369
  parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
367
370
  parseTransferStatus(status: Str): Str;
371
+ parseTransferType(transferType: Str): Str;
368
372
  /**
369
373
  * @method
370
374
  * @name kucoinfutures#fetchMyTrades
@@ -491,7 +495,7 @@ export default class kucoinfutures extends kucoin {
491
495
  setMarginMode(marginMode: string, symbol?: Str, params?: {}): Promise<MarginMode>;
492
496
  /**
493
497
  * @method
494
- * @name kucoin#fetchLeverage
498
+ * @name kucoinfutures#fetchLeverage
495
499
  * @description fetch the set leverage for a market
496
500
  * @see https://www.kucoin.com/docs/rest/futures-trading/positions/get-cross-margin-leverage
497
501
  * @param {string} symbol unified market symbol