ccxt 4.1.26 → 4.1.28
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.
- package/README.md +5 -5
- package/dist/ccxt.browser.js +184 -26
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/bitopro.js +22 -1
- package/dist/cjs/src/kucoin.js +146 -22
- package/dist/cjs/src/kucoinfutures.js +11 -1
- package/dist/cjs/src/woo.js +4 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/kucoin.d.ts +2 -0
- package/js/src/abstract/kucoinfutures.d.ts +3 -0
- package/js/src/bitopro.js +22 -1
- package/js/src/kucoin.d.ts +3 -1
- package/js/src/kucoin.js +146 -22
- package/js/src/kucoinfutures.js +11 -1
- package/js/src/woo.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ Current feature list:
|
|
|
48
48
|
| [](https://m.mexc.com/auth/signup?inviteCode=1FQ1G) | mexc | [MEXC Global](https://m.mexc.com/auth/signup?inviteCode=1FQ1G) | [](https://mxcdevelop.github.io/apidocs/spot_v3_en/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
|
49
49
|
| [](https://www.okx.com/activities/ccxt-trade-and-earn?channelid=CCXT2023) | okx | [OKX](https://www.okx.com/activities/ccxt-trade-and-earn?channelid=CCXT2023) | [](https://www.okx.com/docs-v5/en/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://www.okx.com/activities/ccxt-trade-and-earn?channelid=CCXT2023) |
|
|
50
50
|
| [](https://wx.network) | wavesexchange | [Waves.Exchange](https://wx.network) | [](https://docs.wx.network) | [](https://github.com/ccxt/ccxt/wiki/Certification) | | |
|
|
51
|
-
| [](https://
|
|
51
|
+
| [](https://x.woo.org/register?ref=YWOWC96B) | woo | [WOO X](https://x.woo.org/register?ref=YWOWC96B) | [](https://docs.woo.org/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://x.woo.org/register?ref=YWOWC96B) |
|
|
52
52
|
|
|
53
53
|
## Supported Cryptocurrency Exchange Markets
|
|
54
54
|
|
|
@@ -149,7 +149,7 @@ The CCXT library currently supports the following 97 cryptocurrency exchange mar
|
|
|
149
149
|
| [](https://wx.network) | wavesexchange | [Waves.Exchange](https://wx.network) | [](https://docs.wx.network) | [](https://github.com/ccxt/ccxt/wiki/Certification) | |
|
|
150
150
|
| [](https://wazirx.com/invite/k7rrnks5) | wazirx | [WazirX](https://wazirx.com/invite/k7rrnks5) | [](https://docs.wazirx.com/#public-rest-api-for-wazirx) | | [](https://ccxt.pro) |
|
|
151
151
|
| [](https://whitebit.com/referral/d9bdf40e-28f2-4b52-b2f9-cd1415d82963) | whitebit | [WhiteBit](https://whitebit.com/referral/d9bdf40e-28f2-4b52-b2f9-cd1415d82963) | [](https://github.com/whitebit-exchange/api-docs) | | [](https://ccxt.pro) |
|
|
152
|
-
| [](https://
|
|
152
|
+
| [](https://x.woo.org/register?ref=YWOWC96B) | woo | [WOO X](https://x.woo.org/register?ref=YWOWC96B) | [](https://docs.woo.org/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
|
153
153
|
| [](https://www.yobit.net) | yobit | [YoBit](https://www.yobit.net) | [](https://www.yobit.net/en/api/) | | |
|
|
154
154
|
| [](https://zaif.jp) | zaif | [Zaif](https://zaif.jp) | [](https://techbureau-api-document.readthedocs.io/ja/latest/index.html) | | |
|
|
155
155
|
| [](https://auth.zondaglobal.com/ref/jHlbB4mIkdS1) | zonda | [Zonda](https://auth.zondaglobal.com/ref/jHlbB4mIkdS1) | [](https://docs.zonda.exchange/) | | |
|
|
@@ -210,13 +210,13 @@ console.log(version, Object.keys(exchanges));
|
|
|
210
210
|
|
|
211
211
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
|
212
212
|
|
|
213
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.
|
|
214
|
-
* unpkg: https://unpkg.com/ccxt@4.1.
|
|
213
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.28/dist/ccxt.browser.js
|
|
214
|
+
* unpkg: https://unpkg.com/ccxt@4.1.28/dist/ccxt.browser.js
|
|
215
215
|
|
|
216
216
|
CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
|
|
217
217
|
|
|
218
218
|
```HTML
|
|
219
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.
|
|
219
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.28/dist/ccxt.browser.js"></script>
|
|
220
220
|
```
|
|
221
221
|
|
|
222
222
|
Creates a global `ccxt` object:
|
package/dist/ccxt.browser.js
CHANGED
|
@@ -53515,6 +53515,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
53515
53515
|
* @method
|
|
53516
53516
|
* @name bitopro#fetchCurrencies
|
|
53517
53517
|
* @description fetches all available currencies on an exchange
|
|
53518
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_currency_info.md
|
|
53518
53519
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
53519
53520
|
* @returns {object} an associative dictionary of currencies
|
|
53520
53521
|
*/
|
|
@@ -53577,6 +53578,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
53577
53578
|
* @method
|
|
53578
53579
|
* @name bitopro#fetchMarkets
|
|
53579
53580
|
* @description retrieves data on all markets for bitopro
|
|
53581
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_trading_pair_info.md
|
|
53580
53582
|
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
53581
53583
|
* @returns {object[]} an array of objects representing market data
|
|
53582
53584
|
*/
|
|
@@ -53711,6 +53713,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
53711
53713
|
* @method
|
|
53712
53714
|
* @name bitopro#fetchTicker
|
|
53713
53715
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
53716
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_ticker_data.md
|
|
53714
53717
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
53715
53718
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
53716
53719
|
* @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -53742,6 +53745,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
53742
53745
|
* @method
|
|
53743
53746
|
* @name bitopro#fetchTickers
|
|
53744
53747
|
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
53748
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_ticker_data.md
|
|
53745
53749
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
53746
53750
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
53747
53751
|
* @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -53771,6 +53775,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
53771
53775
|
* @method
|
|
53772
53776
|
* @name bitopro#fetchOrderBook
|
|
53773
53777
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
53778
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_orderbook_data.md
|
|
53774
53779
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
53775
53780
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
53776
53781
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
@@ -53901,6 +53906,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
53901
53906
|
* @method
|
|
53902
53907
|
* @name bitopro#fetchTrades
|
|
53903
53908
|
* @description get the list of most recent trades for a particular symbol
|
|
53909
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_trades_data.md
|
|
53904
53910
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
53905
53911
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
53906
53912
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -53933,6 +53939,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
53933
53939
|
* @method
|
|
53934
53940
|
* @name bitopro#fetchTradingFees
|
|
53935
53941
|
* @description fetch the trading fees for multiple markets
|
|
53942
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_limitations_and_fees.md
|
|
53936
53943
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
53937
53944
|
* @returns {object} a dictionary of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure} indexed by market symbols
|
|
53938
53945
|
*/
|
|
@@ -54032,6 +54039,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54032
54039
|
* @method
|
|
54033
54040
|
* @name bitopro#fetchOHLCV
|
|
54034
54041
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
54042
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_ohlc_data.md
|
|
54035
54043
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
54036
54044
|
* @param {string} timeframe the length of time each candle represents
|
|
54037
54045
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -54154,6 +54162,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54154
54162
|
* @method
|
|
54155
54163
|
* @name bitopro#fetchBalance
|
|
54156
54164
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
54165
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_account_balance.md
|
|
54157
54166
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
54158
54167
|
* @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
|
|
54159
54168
|
*/
|
|
@@ -54281,6 +54290,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54281
54290
|
* @method
|
|
54282
54291
|
* @name bitopro#createOrder
|
|
54283
54292
|
* @description create a trade order
|
|
54293
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/create_an_order.md
|
|
54284
54294
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
54285
54295
|
* @param {string} type 'market' or 'limit'
|
|
54286
54296
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -54342,6 +54352,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54342
54352
|
* @method
|
|
54343
54353
|
* @name bitopro#cancelOrder
|
|
54344
54354
|
* @description cancels an open order
|
|
54355
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/cancel_an_order.md
|
|
54345
54356
|
* @param {string} id order id
|
|
54346
54357
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
54347
54358
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
@@ -54373,6 +54384,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54373
54384
|
* @method
|
|
54374
54385
|
* @name bitopro#cancelOrders
|
|
54375
54386
|
* @description cancel multiple orders
|
|
54387
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/cancel_batch_orders.md
|
|
54376
54388
|
* @param {string[]} ids order ids
|
|
54377
54389
|
* @param {string} symbol unified market symbol
|
|
54378
54390
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
@@ -54404,6 +54416,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54404
54416
|
* @method
|
|
54405
54417
|
* @name bitopro#cancelAllOrders
|
|
54406
54418
|
* @description cancel all open orders
|
|
54419
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/cancel_all_orders.md
|
|
54407
54420
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
54408
54421
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
54409
54422
|
* @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
@@ -54438,6 +54451,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54438
54451
|
* @method
|
|
54439
54452
|
* @name bitopro#fetchOrder
|
|
54440
54453
|
* @description fetches information on an order made by the user
|
|
54454
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_an_order_data.md
|
|
54441
54455
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
54442
54456
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
54443
54457
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
@@ -54482,6 +54496,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54482
54496
|
* @method
|
|
54483
54497
|
* @name bitopro#fetchOrders
|
|
54484
54498
|
* @description fetches information on multiple orders made by the user
|
|
54499
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_orders_data.md
|
|
54485
54500
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
54486
54501
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
54487
54502
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
@@ -54550,6 +54565,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54550
54565
|
* @method
|
|
54551
54566
|
* @name bitopro#fetchClosedOrders
|
|
54552
54567
|
* @description fetches information on multiple closed orders made by the user
|
|
54568
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_orders_data.md
|
|
54553
54569
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
54554
54570
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
54555
54571
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
@@ -54566,6 +54582,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54566
54582
|
* @method
|
|
54567
54583
|
* @name bitopro#fetchMyTrades
|
|
54568
54584
|
* @description fetch all trades made by the user
|
|
54585
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_trades_data.md
|
|
54569
54586
|
* @param {string} symbol unified market symbol
|
|
54570
54587
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
54571
54588
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -54703,6 +54720,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54703
54720
|
* @method
|
|
54704
54721
|
* @name bitopro#fetchDeposits
|
|
54705
54722
|
* @description fetch all deposits made to an account
|
|
54723
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_deposit_invoices_data.md
|
|
54706
54724
|
* @param {string} code unified currency code
|
|
54707
54725
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
54708
54726
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
@@ -54754,6 +54772,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54754
54772
|
* @method
|
|
54755
54773
|
* @name bitopro#fetchWithdrawals
|
|
54756
54774
|
* @description fetch all withdrawals made from an account
|
|
54775
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_withdraw_invoices_data.md
|
|
54757
54776
|
* @param {string} code unified currency code
|
|
54758
54777
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
54759
54778
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
@@ -54804,6 +54823,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54804
54823
|
* @method
|
|
54805
54824
|
* @name bitopro#fetchWithdrawal
|
|
54806
54825
|
* @description fetch data on a currency withdrawal via the withdrawal id
|
|
54826
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_an_withdraw_invoice_data.md
|
|
54807
54827
|
* @param {string} id withdrawal id
|
|
54808
54828
|
* @param {string} code unified currency code of the currency withdrawn, default is undefined
|
|
54809
54829
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
@@ -54843,6 +54863,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54843
54863
|
* @method
|
|
54844
54864
|
* @name bitopro#withdraw
|
|
54845
54865
|
* @description make a withdrawal
|
|
54866
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/create_an_withdraw_invoice.md
|
|
54846
54867
|
* @param {string} code unified currency code
|
|
54847
54868
|
* @param {float} amount the amount to withdraw
|
|
54848
54869
|
* @param {string} address the address to withdraw to
|
|
@@ -54918,7 +54939,7 @@ class bitopro extends _abstract_bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54918
54939
|
* @method
|
|
54919
54940
|
* @name bitopro#fetchDepositWithdrawFees
|
|
54920
54941
|
* @description fetch deposit and withdraw fees
|
|
54921
|
-
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/v3
|
|
54942
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_currency_info.md
|
|
54922
54943
|
* @param {string[]|undefined} codes list of unified currency codes
|
|
54923
54944
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
54924
54945
|
* @returns {object} a list of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
|
|
@@ -149597,6 +149618,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
149597
149618
|
'cancelOrder': true,
|
|
149598
149619
|
'createDepositAddress': true,
|
|
149599
149620
|
'createOrder': true,
|
|
149621
|
+
'createOrders': true,
|
|
149600
149622
|
'createPostOnlyOrder': true,
|
|
149601
149623
|
'createStopLimitOrder': true,
|
|
149602
149624
|
'createStopMarketOrder': true,
|
|
@@ -149779,12 +149801,14 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
149779
149801
|
'deposit-addresses': 1,
|
|
149780
149802
|
'withdrawals': 1,
|
|
149781
149803
|
'orders': 4,
|
|
149804
|
+
'orders/test': 4,
|
|
149782
149805
|
'orders/multi': 20,
|
|
149783
149806
|
'isolated/borrow': 2,
|
|
149784
149807
|
'isolated/repay/all': 2,
|
|
149785
149808
|
'isolated/repay/single': 2,
|
|
149786
149809
|
'margin/borrow': 1,
|
|
149787
149810
|
'margin/order': 1,
|
|
149811
|
+
'margin/order/test': 1,
|
|
149788
149812
|
'margin/repay/all': 1,
|
|
149789
149813
|
'margin/repay/single': 1,
|
|
149790
149814
|
'margin/lend': 1,
|
|
@@ -151384,6 +151408,8 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
151384
151408
|
* @see https://docs.kucoin.com/spot#place-a-new-order-2
|
|
151385
151409
|
* @see https://docs.kucoin.com/spot#place-a-margin-order
|
|
151386
151410
|
* @see https://docs.kucoin.com/spot-hf/#place-hf-order
|
|
151411
|
+
* @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-order-test
|
|
151412
|
+
* @see https://www.kucoin.com/docs/rest/margin-trading/orders/place-margin-order-test
|
|
151387
151413
|
* @param {string} symbol Unified CCXT market symbol
|
|
151388
151414
|
* @param {string} type 'limit' or 'market'
|
|
151389
151415
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -151413,9 +151439,140 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
151413
151439
|
* @param {string} [params.stp] '', // self trade prevention, CN, CO, CB or DC
|
|
151414
151440
|
* @param {bool} [params.autoBorrow] false, // The system will first borrow you funds at the optimal interest rate and then place an order for you
|
|
151415
151441
|
* @param {bool} [params.hf] false, // true for hf order
|
|
151442
|
+
* @param {bool} [params.test] set to true to test an order, no order will be created but the request will be validated
|
|
151416
151443
|
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
151417
151444
|
*/
|
|
151418
151445
|
await this.loadMarkets();
|
|
151446
|
+
const market = this.market(symbol);
|
|
151447
|
+
const testOrder = this.safeValue(params, 'test', false);
|
|
151448
|
+
params = this.omit(params, 'test');
|
|
151449
|
+
const isHf = this.safeValue(params, 'hf', false);
|
|
151450
|
+
const [triggerPrice, stopLossPrice, takeProfitPrice] = this.handleTriggerPrices(params);
|
|
151451
|
+
const tradeType = this.safeString(params, 'tradeType'); // keep it for backward compatibility
|
|
151452
|
+
const isTriggerOrder = (triggerPrice || stopLossPrice || takeProfitPrice);
|
|
151453
|
+
const marginResult = this.handleMarginModeAndParams('createOrder', params);
|
|
151454
|
+
const marginMode = this.safeString(marginResult, 0);
|
|
151455
|
+
const isMarginOrder = tradeType === 'MARGIN_TRADE' || marginMode !== undefined;
|
|
151456
|
+
// don't omit anything before calling createOrderRequest
|
|
151457
|
+
const orderRequest = this.createOrderRequest(symbol, type, side, amount, price, params);
|
|
151458
|
+
let response = undefined;
|
|
151459
|
+
if (testOrder) {
|
|
151460
|
+
if (isMarginOrder) {
|
|
151461
|
+
response = await this.privatePostMarginOrderTest(orderRequest);
|
|
151462
|
+
}
|
|
151463
|
+
else {
|
|
151464
|
+
response = await this.privatePostOrdersTest(orderRequest);
|
|
151465
|
+
}
|
|
151466
|
+
}
|
|
151467
|
+
else if (isHf) {
|
|
151468
|
+
response = await this.privatePostHfOrders(orderRequest);
|
|
151469
|
+
}
|
|
151470
|
+
else if (isTriggerOrder) {
|
|
151471
|
+
response = await this.privatePostStopOrder(orderRequest);
|
|
151472
|
+
}
|
|
151473
|
+
else if (isMarginOrder) {
|
|
151474
|
+
response = await this.privatePostMarginOrder(orderRequest);
|
|
151475
|
+
}
|
|
151476
|
+
else {
|
|
151477
|
+
response = await this.privatePostOrders(orderRequest);
|
|
151478
|
+
}
|
|
151479
|
+
//
|
|
151480
|
+
// {
|
|
151481
|
+
// code: '200000',
|
|
151482
|
+
// data: {
|
|
151483
|
+
// "orderId": "5bd6e9286d99522a52e458de"
|
|
151484
|
+
// }
|
|
151485
|
+
// }
|
|
151486
|
+
//
|
|
151487
|
+
const data = this.safeValue(response, 'data', {});
|
|
151488
|
+
return this.parseOrder(data, market);
|
|
151489
|
+
}
|
|
151490
|
+
async createOrders(orders, params = {}) {
|
|
151491
|
+
/**
|
|
151492
|
+
* @method
|
|
151493
|
+
* @name kucoin#createOrders
|
|
151494
|
+
* @description create a list of trade orders
|
|
151495
|
+
* @see https://www.kucoin.com/docs/rest/spot-trading/orders/place-multiple-orders
|
|
151496
|
+
* @see https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/place-multiple-hf-orders
|
|
151497
|
+
* @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
|
151498
|
+
* @param {object} [params] Extra parameters specific to the exchange API endpoint
|
|
151499
|
+
* @param {bool} [params.hf] false, // true for hf orders
|
|
151500
|
+
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
151501
|
+
*/
|
|
151502
|
+
await this.loadMarkets();
|
|
151503
|
+
const ordersRequests = [];
|
|
151504
|
+
let symbol = undefined;
|
|
151505
|
+
for (let i = 0; i < orders.length; i++) {
|
|
151506
|
+
const rawOrder = orders[i];
|
|
151507
|
+
const marketId = this.safeString(rawOrder, 'symbol');
|
|
151508
|
+
if (symbol === undefined) {
|
|
151509
|
+
symbol = marketId;
|
|
151510
|
+
}
|
|
151511
|
+
else {
|
|
151512
|
+
if (symbol !== marketId) {
|
|
151513
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' createOrders() requires all orders to have the same symbol');
|
|
151514
|
+
}
|
|
151515
|
+
}
|
|
151516
|
+
const type = this.safeString(rawOrder, 'type');
|
|
151517
|
+
if (type !== 'limit') {
|
|
151518
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' createOrders() only supports limit orders');
|
|
151519
|
+
}
|
|
151520
|
+
const side = this.safeString(rawOrder, 'side');
|
|
151521
|
+
const amount = this.safeValue(rawOrder, 'amount');
|
|
151522
|
+
const price = this.safeValue(rawOrder, 'price');
|
|
151523
|
+
const orderParams = this.safeValue(rawOrder, 'params', {});
|
|
151524
|
+
const orderRequest = this.createOrderRequest(marketId, type, side, amount, price, orderParams);
|
|
151525
|
+
ordersRequests.push(orderRequest);
|
|
151526
|
+
}
|
|
151527
|
+
const market = this.market(symbol);
|
|
151528
|
+
const request = {
|
|
151529
|
+
'symbol': market['id'],
|
|
151530
|
+
'orderList': ordersRequests,
|
|
151531
|
+
};
|
|
151532
|
+
const hf = this.safeValue(params, 'hf', false);
|
|
151533
|
+
params = this.omit(params, 'hf');
|
|
151534
|
+
let response = undefined;
|
|
151535
|
+
if (hf) {
|
|
151536
|
+
response = await this.privatePostHfOrdersMulti(this.extend(request, params));
|
|
151537
|
+
}
|
|
151538
|
+
else {
|
|
151539
|
+
response = await this.privatePostOrdersMulti(this.extend(request, params));
|
|
151540
|
+
}
|
|
151541
|
+
//
|
|
151542
|
+
// {
|
|
151543
|
+
// "code": "200000",
|
|
151544
|
+
// "data": {
|
|
151545
|
+
// "data": [
|
|
151546
|
+
// {
|
|
151547
|
+
// "symbol": "LTC-USDT",
|
|
151548
|
+
// "type": "limit",
|
|
151549
|
+
// "side": "sell",
|
|
151550
|
+
// "price": "90",
|
|
151551
|
+
// "size": "0.1",
|
|
151552
|
+
// "funds": null,
|
|
151553
|
+
// "stp": "",
|
|
151554
|
+
// "stop": "",
|
|
151555
|
+
// "stopPrice": null,
|
|
151556
|
+
// "timeInForce": "GTC",
|
|
151557
|
+
// "cancelAfter": 0,
|
|
151558
|
+
// "postOnly": false,
|
|
151559
|
+
// "hidden": false,
|
|
151560
|
+
// "iceberge": false,
|
|
151561
|
+
// "iceberg": false,
|
|
151562
|
+
// "visibleSize": null,
|
|
151563
|
+
// "channel": "API",
|
|
151564
|
+
// "id": "6539148443fcf500079d15e5",
|
|
151565
|
+
// "status": "success",
|
|
151566
|
+
// "failMsg": null,
|
|
151567
|
+
// "clientOid": "5c4c5398-8ab2-4b4e-af8a-e2d90ad2488f"
|
|
151568
|
+
// },
|
|
151569
|
+
// }
|
|
151570
|
+
//
|
|
151571
|
+
let data = this.safeValue(response, 'data', {});
|
|
151572
|
+
data = this.safeValue(data, 'data', []);
|
|
151573
|
+
return this.parseOrders(data);
|
|
151574
|
+
}
|
|
151575
|
+
createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
151419
151576
|
const market = this.market(symbol);
|
|
151420
151577
|
// required param, cannot be used twice
|
|
151421
151578
|
const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId', this.uuid());
|
|
@@ -151448,15 +151605,12 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
151448
151605
|
request['size'] = amountString;
|
|
151449
151606
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
151450
151607
|
}
|
|
151608
|
+
const tradeType = this.safeString(params, 'tradeType'); // keep it for backward compatibility
|
|
151451
151609
|
const [triggerPrice, stopLossPrice, takeProfitPrice] = this.handleTriggerPrices(params);
|
|
151610
|
+
const isTriggerOrder = (triggerPrice || stopLossPrice || takeProfitPrice);
|
|
151611
|
+
const isMarginOrder = tradeType === 'MARGIN_TRADE' || marginMode !== undefined;
|
|
151452
151612
|
params = this.omit(params, ['stopLossPrice', 'takeProfitPrice', 'triggerPrice', 'stopPrice']);
|
|
151453
|
-
|
|
151454
|
-
let method = 'privatePostOrders';
|
|
151455
|
-
const isHf = this.safeValue(params, 'hf', false);
|
|
151456
|
-
if (isHf) {
|
|
151457
|
-
method = 'privatePostHfOrders';
|
|
151458
|
-
}
|
|
151459
|
-
else if (triggerPrice || stopLossPrice || takeProfitPrice) {
|
|
151613
|
+
if (isTriggerOrder) {
|
|
151460
151614
|
if (triggerPrice) {
|
|
151461
151615
|
request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
151462
151616
|
}
|
|
@@ -151470,7 +151624,6 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
151470
151624
|
request['stopPrice'] = this.priceToPrecision(symbol, takeProfitPrice);
|
|
151471
151625
|
}
|
|
151472
151626
|
}
|
|
151473
|
-
method = 'privatePostStopOrder';
|
|
151474
151627
|
if (marginMode === 'isolated') {
|
|
151475
151628
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' createOrder does not support isolated margin for stop orders');
|
|
151476
151629
|
}
|
|
@@ -151478,8 +151631,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
151478
151631
|
request['tradeType'] = this.options['marginModes'][marginMode];
|
|
151479
151632
|
}
|
|
151480
151633
|
}
|
|
151481
|
-
else if (
|
|
151482
|
-
method = 'privatePostMarginOrder';
|
|
151634
|
+
else if (isMarginOrder) {
|
|
151483
151635
|
if (marginMode === 'isolated') {
|
|
151484
151636
|
request['marginModel'] = 'isolated';
|
|
151485
151637
|
}
|
|
@@ -151489,17 +151641,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
151489
151641
|
if (postOnly) {
|
|
151490
151642
|
request['postOnly'] = true;
|
|
151491
151643
|
}
|
|
151492
|
-
|
|
151493
|
-
//
|
|
151494
|
-
// {
|
|
151495
|
-
// code: '200000',
|
|
151496
|
-
// data: {
|
|
151497
|
-
// "orderId": "5bd6e9286d99522a52e458de"
|
|
151498
|
-
// }
|
|
151499
|
-
// }
|
|
151500
|
-
//
|
|
151501
|
-
const data = this.safeValue(response, 'data', {});
|
|
151502
|
-
return this.parseOrder(data, market);
|
|
151644
|
+
return this.extend(request, params);
|
|
151503
151645
|
}
|
|
151504
151646
|
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
151505
151647
|
/**
|
|
@@ -152029,6 +152171,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
152029
152171
|
const stop = responseStop !== undefined;
|
|
152030
152172
|
const stopTriggered = this.safeValue(order, 'stopTriggered', false);
|
|
152031
152173
|
const isActive = this.safeValue2(order, 'isActive', 'active');
|
|
152174
|
+
const responseStatus = this.safeString(order, 'status');
|
|
152032
152175
|
let status = undefined;
|
|
152033
152176
|
if (isActive !== undefined) {
|
|
152034
152177
|
if (isActive === true) {
|
|
@@ -152039,7 +152182,6 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
152039
152182
|
}
|
|
152040
152183
|
}
|
|
152041
152184
|
if (stop) {
|
|
152042
|
-
const responseStatus = this.safeString(order, 'status');
|
|
152043
152185
|
if (responseStatus === 'NEW') {
|
|
152044
152186
|
status = 'open';
|
|
152045
152187
|
}
|
|
@@ -152050,6 +152192,9 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
152050
152192
|
if (cancelExist) {
|
|
152051
152193
|
status = 'canceled';
|
|
152052
152194
|
}
|
|
152195
|
+
if (responseStatus === 'fail') {
|
|
152196
|
+
status = 'rejected';
|
|
152197
|
+
}
|
|
152053
152198
|
const stopPrice = this.safeNumber(order, 'stopPrice');
|
|
152054
152199
|
return this.safeOrder({
|
|
152055
152200
|
'info': order,
|
|
@@ -153970,6 +154115,7 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
|
|
|
153970
154115
|
'transfer-out': 1,
|
|
153971
154116
|
'transfer-in': 1,
|
|
153972
154117
|
'orders': 1.33,
|
|
154118
|
+
'orders/test': 1.33,
|
|
153973
154119
|
'position/margin/auto-deposit-status': 1,
|
|
153974
154120
|
'position/margin/deposit-margin': 1,
|
|
153975
154121
|
'position/risk-limit-level/change': 1,
|
|
@@ -154916,6 +155062,7 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
|
|
|
154916
155062
|
* @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.
|
|
154917
155063
|
* @param {string} [params.stopPriceType] TP, IP or MP, defaults to MP: Mark Price
|
|
154918
155064
|
* @param {bool} [params.closeOrder] set to true to close position
|
|
155065
|
+
* @param {bool} [params.test] set to true to use the test order endpoint (does not submit order, use to validate params)
|
|
154919
155066
|
* @param {bool} [params.forceHold] A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default.
|
|
154920
155067
|
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
154921
155068
|
*/
|
|
@@ -154992,7 +155139,15 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
|
|
|
154992
155139
|
}
|
|
154993
155140
|
}
|
|
154994
155141
|
params = this.omit(params, ['timeInForce', 'stopPrice', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice']); // Time in force only valid for limit orders, exchange error when gtc for market orders
|
|
154995
|
-
|
|
155142
|
+
let response = undefined;
|
|
155143
|
+
const testOrder = this.safeValue(params, 'test', false);
|
|
155144
|
+
params = this.omit(params, 'test');
|
|
155145
|
+
if (testOrder) {
|
|
155146
|
+
response = await this.futuresPrivatePostOrdersTest(this.extend(request, params));
|
|
155147
|
+
}
|
|
155148
|
+
else {
|
|
155149
|
+
response = await this.futuresPrivatePostOrders(this.extend(request, params));
|
|
155150
|
+
}
|
|
154996
155151
|
//
|
|
154997
155152
|
// {
|
|
154998
155153
|
// code: "200000",
|
|
@@ -266881,7 +267036,10 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
266881
267036
|
'fees': [
|
|
266882
267037
|
'https://support.woo.org/hc/en-001/articles/4404611795353--Trading-Fees',
|
|
266883
267038
|
],
|
|
266884
|
-
'referral':
|
|
267039
|
+
'referral': {
|
|
267040
|
+
'url': 'https://x.woo.org/register?ref=YWOWC96B',
|
|
267041
|
+
'discount': 0.35,
|
|
267042
|
+
},
|
|
266885
267043
|
},
|
|
266886
267044
|
'api': {
|
|
266887
267045
|
'v1': {
|
|
@@ -278913,7 +279071,7 @@ SOFTWARE.
|
|
|
278913
279071
|
|
|
278914
279072
|
//-----------------------------------------------------------------------------
|
|
278915
279073
|
// this is updated by vss.js when building
|
|
278916
|
-
const version = '4.1.
|
|
279074
|
+
const version = '4.1.28';
|
|
278917
279075
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
|
|
278918
279076
|
//-----------------------------------------------------------------------------
|
|
278919
279077
|
|