ccxt 4.1.3 → 4.1.5
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 +3 -3
- package/dist/ccxt.browser.js +206 -31
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +3 -0
- package/dist/cjs/src/coinex.js +1 -1
- package/dist/cjs/src/coinsph.js +1 -2
- package/dist/cjs/src/idex.js +1 -1
- package/dist/cjs/src/kraken.js +38 -6
- package/dist/cjs/src/kucoinfutures.js +1 -1
- package/dist/cjs/src/kuna.js +97 -10
- package/dist/cjs/src/okx.js +37 -0
- package/dist/cjs/src/pro/bitget.js +22 -6
- package/dist/cjs/src/whitebit.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/kuna.d.ts +34 -0
- package/js/src/base/Exchange.js +3 -0
- package/js/src/coinex.js +1 -1
- package/js/src/coinsph.js +1 -2
- package/js/src/idex.js +1 -1
- package/js/src/kraken.d.ts +1 -1
- package/js/src/kraken.js +38 -6
- package/js/src/kucoinfutures.js +1 -1
- package/js/src/kuna.d.ts +1 -0
- package/js/src/kuna.js +97 -10
- package/js/src/okx.js +37 -0
- package/js/src/pro/bitget.d.ts +5 -0
- package/js/src/pro/bitget.js +22 -6
- package/js/src/whitebit.js +1 -1
- package/package.json +1 -1
package/dist/ccxt.browser.js
CHANGED
|
@@ -8206,6 +8206,9 @@ class Exchange {
|
|
|
8206
8206
|
if (!tradesAreParsed) {
|
|
8207
8207
|
trades = this.parseTrades(rawTrades, market);
|
|
8208
8208
|
}
|
|
8209
|
+
else {
|
|
8210
|
+
trades = rawTrades;
|
|
8211
|
+
}
|
|
8209
8212
|
this.number = oldNumber;
|
|
8210
8213
|
let tradesLength = 0;
|
|
8211
8214
|
const isArray = Array.isArray(trades);
|
|
@@ -86610,7 +86613,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
86610
86613
|
// message: 'OK'
|
|
86611
86614
|
// }
|
|
86612
86615
|
//
|
|
86613
|
-
return this.
|
|
86616
|
+
return this.safeInteger(response, 'data');
|
|
86614
86617
|
}
|
|
86615
86618
|
async fetchOrderBook(symbol, limit = 20, params = {}) {
|
|
86616
86619
|
/**
|
|
@@ -94066,7 +94069,6 @@ class coinsph extends _abstract_coinsph_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
94066
94069
|
const quoteId = this.safeString(market, 'quoteAsset');
|
|
94067
94070
|
const base = this.safeCurrencyCode(baseId);
|
|
94068
94071
|
const quote = this.safeCurrencyCode(quoteId);
|
|
94069
|
-
const isActive = this.safeString(market, 'status') === 'TRADING';
|
|
94070
94072
|
const limits = this.indexBy(this.safeValue(market, 'filters'), 'filterType');
|
|
94071
94073
|
const amountLimits = this.safeValue(limits, 'LOT_SIZE', {});
|
|
94072
94074
|
const priceLimits = this.safeValue(limits, 'PRICE_FILTER', {});
|
|
@@ -94086,7 +94088,7 @@ class coinsph extends _abstract_coinsph_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
94086
94088
|
'swap': false,
|
|
94087
94089
|
'future': false,
|
|
94088
94090
|
'option': false,
|
|
94089
|
-
'active':
|
|
94091
|
+
'active': this.safeStringLower(market, 'status') === 'trading',
|
|
94090
94092
|
'contract': false,
|
|
94091
94093
|
'linear': undefined,
|
|
94092
94094
|
'inverse': undefined,
|
|
@@ -138402,7 +138404,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
138402
138404
|
//
|
|
138403
138405
|
// { serverTime: '1655258263236' }
|
|
138404
138406
|
//
|
|
138405
|
-
return this.
|
|
138407
|
+
return this.safeInteger(response, 'serverTime');
|
|
138406
138408
|
}
|
|
138407
138409
|
async fetchWithdrawal(id, code = undefined, params = {}) {
|
|
138408
138410
|
/**
|
|
@@ -140846,6 +140848,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
140846
140848
|
* @method
|
|
140847
140849
|
* @name kraken#fetchMarkets
|
|
140848
140850
|
* @description retrieves data on all markets for kraken
|
|
140851
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getTradableAssetPairs
|
|
140849
140852
|
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
140850
140853
|
* @returns {object[]} an array of objects representing market data
|
|
140851
140854
|
*/
|
|
@@ -141031,6 +141034,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
141031
141034
|
* @method
|
|
141032
141035
|
* @name kraken#fetchCurrencies
|
|
141033
141036
|
* @description fetches all available currencies on an exchange
|
|
141037
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getAssetInfo
|
|
141034
141038
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
141035
141039
|
* @returns {object} an associative dictionary of currencies
|
|
141036
141040
|
*/
|
|
@@ -141089,6 +141093,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
141089
141093
|
* @method
|
|
141090
141094
|
* @name kraken#fetchTradingFee
|
|
141091
141095
|
* @description fetch the trading fees for a market
|
|
141096
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradeVolume
|
|
141092
141097
|
* @param {string} symbol unified market symbol
|
|
141093
141098
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
141094
141099
|
* @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
|
|
@@ -141157,6 +141162,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
141157
141162
|
* @method
|
|
141158
141163
|
* @name kraken#fetchOrderBook
|
|
141159
141164
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
141165
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getOrderBook
|
|
141160
141166
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
141161
141167
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
141162
141168
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
@@ -141259,6 +141265,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
141259
141265
|
* @method
|
|
141260
141266
|
* @name kraken#fetchTickers
|
|
141261
141267
|
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
141268
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getTickerInformation
|
|
141262
141269
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
141263
141270
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
141264
141271
|
* @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -141295,6 +141302,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
141295
141302
|
* @method
|
|
141296
141303
|
* @name kraken#fetchTicker
|
|
141297
141304
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
141305
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getTickerInformation
|
|
141298
141306
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
141299
141307
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
141300
141308
|
* @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -141339,6 +141347,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
141339
141347
|
* @method
|
|
141340
141348
|
* @name kraken#fetchOHLCV
|
|
141341
141349
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
141350
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getOHLCData
|
|
141342
141351
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
141343
141352
|
* @param {string} timeframe the length of time each candle represents
|
|
141344
141353
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -141420,11 +141429,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
141420
141429
|
else {
|
|
141421
141430
|
direction = 'in';
|
|
141422
141431
|
}
|
|
141423
|
-
const
|
|
141424
|
-
let timestamp = undefined;
|
|
141425
|
-
if (time !== undefined) {
|
|
141426
|
-
timestamp = this.parseToInt(time * 1000);
|
|
141427
|
-
}
|
|
141432
|
+
const timestamp = this.safeIntegerProduct(item, 'time', 1000);
|
|
141428
141433
|
return {
|
|
141429
141434
|
'info': item,
|
|
141430
141435
|
'id': id,
|
|
@@ -141451,6 +141456,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
141451
141456
|
* @method
|
|
141452
141457
|
* @name kraken#fetchLedger
|
|
141453
141458
|
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
141459
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getLedgers
|
|
141454
141460
|
* @param {string} code unified currency code, default is undefined
|
|
141455
141461
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
141456
141462
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
@@ -141629,6 +141635,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
141629
141635
|
* @method
|
|
141630
141636
|
* @name kraken#fetchTrades
|
|
141631
141637
|
* @description get the list of most recent trades for a particular symbol
|
|
141638
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getRecentTrades
|
|
141632
141639
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
141633
141640
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
141634
141641
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -141702,6 +141709,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
141702
141709
|
* @method
|
|
141703
141710
|
* @name kraken#fetchBalance
|
|
141704
141711
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
141712
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getAccountBalance
|
|
141705
141713
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
141706
141714
|
* @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
|
|
141707
141715
|
*/
|
|
@@ -141945,6 +141953,16 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
141945
141953
|
}
|
|
141946
141954
|
const clientOrderId = this.safeString(order, 'userref');
|
|
141947
141955
|
const rawTrades = this.safeValue(order, 'trades');
|
|
141956
|
+
const trades = [];
|
|
141957
|
+
for (let i = 0; i < rawTrades.length; i++) {
|
|
141958
|
+
const rawTrade = rawTrades[i];
|
|
141959
|
+
if (typeof rawTrade === 'string') {
|
|
141960
|
+
trades.push(this.safeTrade({ 'id': rawTrade, 'orderId': id, 'symbol': symbol, 'info': {} }));
|
|
141961
|
+
}
|
|
141962
|
+
else {
|
|
141963
|
+
trades.push(rawTrade);
|
|
141964
|
+
}
|
|
141965
|
+
}
|
|
141948
141966
|
stopPrice = this.safeNumber(order, 'stopprice', stopPrice);
|
|
141949
141967
|
return this.safeOrder({
|
|
141950
141968
|
'id': id,
|
|
@@ -141968,7 +141986,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
141968
141986
|
'average': average,
|
|
141969
141987
|
'remaining': undefined,
|
|
141970
141988
|
'fee': fee,
|
|
141971
|
-
'trades':
|
|
141989
|
+
'trades': trades,
|
|
141972
141990
|
}, market);
|
|
141973
141991
|
}
|
|
141974
141992
|
orderRequest(method, symbol, type, request, price = undefined, params = {}) {
|
|
@@ -142104,6 +142122,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142104
142122
|
* @method
|
|
142105
142123
|
* @name kraken#fetchOrder
|
|
142106
142124
|
* @description fetches information on an order made by the user
|
|
142125
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getOrdersInfo
|
|
142107
142126
|
* @param {string} symbol not used by kraken fetchOrder
|
|
142108
142127
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
142109
142128
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
@@ -142173,6 +142192,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142173
142192
|
* @method
|
|
142174
142193
|
* @name kraken#fetchOrderTrades
|
|
142175
142194
|
* @description fetch all the trades made from a single order
|
|
142195
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradesInfo
|
|
142176
142196
|
* @param {string} id order id
|
|
142177
142197
|
* @param {string} symbol unified market symbol
|
|
142178
142198
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -142272,6 +142292,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142272
142292
|
* @method
|
|
142273
142293
|
* @name kraken#fetchMyTrades
|
|
142274
142294
|
* @description fetch all trades made by the user
|
|
142295
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradeHistory
|
|
142275
142296
|
* @param {string} symbol unified market symbol
|
|
142276
142297
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
142277
142298
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -142331,6 +142352,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142331
142352
|
* @method
|
|
142332
142353
|
* @name kraken#cancelOrder
|
|
142333
142354
|
* @description cancels an open order
|
|
142355
|
+
* @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelOrder
|
|
142334
142356
|
* @param {string} id order id
|
|
142335
142357
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
142336
142358
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
@@ -142361,6 +142383,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142361
142383
|
* @method
|
|
142362
142384
|
* @name kraken#cancelOrders
|
|
142363
142385
|
* @description cancel multiple orders
|
|
142386
|
+
* @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelOrderBatch
|
|
142364
142387
|
* @param {string[]} ids open orders transaction ID (txid) or user reference (userref)
|
|
142365
142388
|
* @param {string} symbol unified market symbol
|
|
142366
142389
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
@@ -142385,6 +142408,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142385
142408
|
* @method
|
|
142386
142409
|
* @name kraken#cancelAllOrders
|
|
142387
142410
|
* @description cancel all open orders
|
|
142411
|
+
* @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelAllOrders
|
|
142388
142412
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
142389
142413
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
142390
142414
|
* @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
@@ -142397,6 +142421,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142397
142421
|
* @method
|
|
142398
142422
|
* @name kraken#fetchOpenOrders
|
|
142399
142423
|
* @description fetch all unfilled currently open orders
|
|
142424
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getOpenOrders
|
|
142400
142425
|
* @param {string} symbol unified market symbol
|
|
142401
142426
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
142402
142427
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -142428,6 +142453,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142428
142453
|
* @method
|
|
142429
142454
|
* @name kraken#fetchClosedOrders
|
|
142430
142455
|
* @description fetches information on multiple closed orders made by the user
|
|
142456
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getClosedOrders
|
|
142431
142457
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
142432
142458
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
142433
142459
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
@@ -142625,6 +142651,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142625
142651
|
* @method
|
|
142626
142652
|
* @name kraken#fetchDeposits
|
|
142627
142653
|
* @description fetch all deposits made to an account
|
|
142654
|
+
* @see https://docs.kraken.com/rest/#tag/Funding/operation/getStatusRecentDeposits
|
|
142628
142655
|
* @param {string} code unified currency code
|
|
142629
142656
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
142630
142657
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
@@ -142661,6 +142688,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142661
142688
|
* @method
|
|
142662
142689
|
* @name kraken#fetchTime
|
|
142663
142690
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
142691
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getServerTime
|
|
142664
142692
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
142665
142693
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
142666
142694
|
*/
|
|
@@ -142683,6 +142711,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142683
142711
|
* @method
|
|
142684
142712
|
* @name kraken#fetchWithdrawals
|
|
142685
142713
|
* @description fetch all withdrawals made from an account
|
|
142714
|
+
* @see https://docs.kraken.com/rest/#tag/Funding/operation/getStatusRecentWithdrawals
|
|
142686
142715
|
* @param {string} code unified currency code
|
|
142687
142716
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
142688
142717
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
@@ -142719,6 +142748,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142719
142748
|
* @method
|
|
142720
142749
|
* @name kraken#createDepositAddress
|
|
142721
142750
|
* @description create a currency deposit address
|
|
142751
|
+
* @see https://docs.kraken.com/rest/#tag/Funding/operation/getDepositAddresses
|
|
142722
142752
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
142723
142753
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
142724
142754
|
* @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
|
|
@@ -142765,6 +142795,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142765
142795
|
* @method
|
|
142766
142796
|
* @name kraken#fetchDepositAddress
|
|
142767
142797
|
* @description fetch the deposit address for a currency associated with this account
|
|
142798
|
+
* @see https://docs.kraken.com/rest/#tag/Funding/operation/getDepositAddresses
|
|
142768
142799
|
* @param {string} code unified currency code
|
|
142769
142800
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
142770
142801
|
* @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
|
|
@@ -142846,6 +142877,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142846
142877
|
* @method
|
|
142847
142878
|
* @name kraken#withdraw
|
|
142848
142879
|
* @description make a withdrawal
|
|
142880
|
+
* @see https://docs.kraken.com/rest/#tag/Funding/operation/withdrawFunds
|
|
142849
142881
|
* @param {string} code unified currency code
|
|
142850
142882
|
* @param {float} amount the amount to withdraw
|
|
142851
142883
|
* @param {string} address the address to withdraw to
|
|
@@ -142882,6 +142914,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142882
142914
|
* @method
|
|
142883
142915
|
* @name kraken#fetchPositions
|
|
142884
142916
|
* @description fetch all open positions
|
|
142917
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getOpenPositions
|
|
142885
142918
|
* @param {string[]|undefined} symbols not used by kraken fetchPositions ()
|
|
142886
142919
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
142887
142920
|
* @returns {object[]} a list of [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
|
|
@@ -142953,6 +142986,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
142953
142986
|
async transferOut(code, amount, params = {}) {
|
|
142954
142987
|
/**
|
|
142955
142988
|
* @description transfer from spot wallet to futures wallet
|
|
142989
|
+
* @see https://docs.kraken.com/rest/#tag/User-Funding/operation/walletTransfer
|
|
142956
142990
|
* @param {str} code Unified currency code
|
|
142957
142991
|
* @param {float} amount Size of the transfer
|
|
142958
142992
|
* @param {dict} [params] Exchange specific parameters
|
|
@@ -150013,7 +150047,7 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
|
|
|
150013
150047
|
// data: 1637385119302,
|
|
150014
150048
|
// }
|
|
150015
150049
|
//
|
|
150016
|
-
return this.
|
|
150050
|
+
return this.safeInteger(response, 'data');
|
|
150017
150051
|
}
|
|
150018
150052
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
150019
150053
|
/**
|
|
@@ -151854,16 +151888,19 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
|
|
|
151854
151888
|
/* harmony import */ var _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4722);
|
|
151855
151889
|
/* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
|
|
151856
151890
|
/* harmony import */ var _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9292);
|
|
151857
|
-
/* harmony import */ var
|
|
151891
|
+
/* harmony import */ var _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1372);
|
|
151892
|
+
/* harmony import */ var _static_dependencies_noble_hashes_sha512_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7110);
|
|
151858
151893
|
// ---------------------------------------------------------------------------
|
|
151859
151894
|
|
|
151860
151895
|
|
|
151861
151896
|
|
|
151862
151897
|
|
|
151898
|
+
|
|
151863
151899
|
// ---------------------------------------------------------------------------
|
|
151864
151900
|
/**
|
|
151865
151901
|
* @class kuna
|
|
151866
151902
|
* @extends Exchange
|
|
151903
|
+
* @description Use the public-key as your apiKey
|
|
151867
151904
|
*/
|
|
151868
151905
|
class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
151869
151906
|
describe() {
|
|
@@ -151921,6 +151958,7 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
151921
151958
|
'api': {
|
|
151922
151959
|
'xreserve': 'https://api.xreserve.fund',
|
|
151923
151960
|
'v3': 'https://api.kuna.io',
|
|
151961
|
+
'v4': 'https://api.kuna.io',
|
|
151924
151962
|
'public': 'https://kuna.io',
|
|
151925
151963
|
'private': 'https://kuna.io', // v2
|
|
151926
151964
|
},
|
|
@@ -151939,6 +151977,54 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
151939
151977
|
'delegate-transfer': 1,
|
|
151940
151978
|
},
|
|
151941
151979
|
},
|
|
151980
|
+
'v4': {
|
|
151981
|
+
'private': {
|
|
151982
|
+
'get': {
|
|
151983
|
+
'me': 1,
|
|
151984
|
+
'getBalance': 1,
|
|
151985
|
+
'active': 1,
|
|
151986
|
+
'order/history': 1,
|
|
151987
|
+
'order/private/{id}/trades': 1,
|
|
151988
|
+
'order/details/{id}?withTrades={withTrades}': 1,
|
|
151989
|
+
'trade/history': 1,
|
|
151990
|
+
'transaction/{hash}': 1,
|
|
151991
|
+
'deposit/preRequest': 1,
|
|
151992
|
+
'deposit/crypto/address': 1,
|
|
151993
|
+
'deposit/crypto/getMerchantAddress': 1,
|
|
151994
|
+
'deposit/history': 1,
|
|
151995
|
+
'deposit/details/{depositId}': 1,
|
|
151996
|
+
'withdraw/preRequest': 1,
|
|
151997
|
+
'withdraw/history': 1,
|
|
151998
|
+
'withdraw/details/{withdrawId}': 1,
|
|
151999
|
+
'kuna-code/{id}': 1,
|
|
152000
|
+
'kuna-code/{code}/check': 1,
|
|
152001
|
+
'kuna-code/issued-by-me': 1,
|
|
152002
|
+
'kuna-code/redeemed-by-me': 1,
|
|
152003
|
+
},
|
|
152004
|
+
'post': {
|
|
152005
|
+
'order/create': 1,
|
|
152006
|
+
'order/cancel': 1,
|
|
152007
|
+
'order/cancel/multi': 1,
|
|
152008
|
+
'deposit/crypto/generateAddress': 1,
|
|
152009
|
+
'deposit/crypto/generateMerchantAddress': 1,
|
|
152010
|
+
'withdraw/create': 1,
|
|
152011
|
+
'kuna-code': 1,
|
|
152012
|
+
},
|
|
152013
|
+
'put': {
|
|
152014
|
+
'kuna-code/redeem': 1,
|
|
152015
|
+
},
|
|
152016
|
+
},
|
|
152017
|
+
'public': {
|
|
152018
|
+
'get': {
|
|
152019
|
+
'timestamp': 1,
|
|
152020
|
+
'fees': 1,
|
|
152021
|
+
'currencies?type={type}': 1,
|
|
152022
|
+
'markets/getAll': 1,
|
|
152023
|
+
'markets/tickers?pairs={pairs}': 1,
|
|
152024
|
+
'order/book/{pairs}': 1,
|
|
152025
|
+
},
|
|
152026
|
+
},
|
|
152027
|
+
},
|
|
151942
152028
|
'v3': {
|
|
151943
152029
|
'public': {
|
|
151944
152030
|
'get': {
|
|
@@ -152146,6 +152232,9 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
152146
152232
|
'2002': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
|
|
152147
152233
|
'2003': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
|
|
152148
152234
|
},
|
|
152235
|
+
'options': {
|
|
152236
|
+
// 'account': 'pro' // Only for pro accounts
|
|
152237
|
+
},
|
|
152149
152238
|
});
|
|
152150
152239
|
}
|
|
152151
152240
|
async fetchTime(params = {}) {
|
|
@@ -152702,20 +152791,53 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
152702
152791
|
let url = undefined;
|
|
152703
152792
|
if (Array.isArray(api)) {
|
|
152704
152793
|
const [version, access] = api;
|
|
152705
|
-
|
|
152706
|
-
|
|
152707
|
-
if (
|
|
152708
|
-
if (
|
|
152709
|
-
|
|
152794
|
+
if (version === 'v3') {
|
|
152795
|
+
url = this.urls['api'][version] + '/' + version + '/' + this.implodeParams(path, params);
|
|
152796
|
+
if (access === 'public') {
|
|
152797
|
+
if (method === 'GET') {
|
|
152798
|
+
if (Object.keys(params).length) {
|
|
152799
|
+
url += '?' + this.urlencode(params);
|
|
152800
|
+
}
|
|
152801
|
+
}
|
|
152802
|
+
else if ((method === 'POST') || (method === 'PUT')) {
|
|
152803
|
+
headers = { 'Content-Type': 'application/json' };
|
|
152804
|
+
body = this.json(params);
|
|
152710
152805
|
}
|
|
152711
152806
|
}
|
|
152712
|
-
else if (
|
|
152713
|
-
|
|
152714
|
-
body = this.json(params);
|
|
152807
|
+
else if (access === 'private') {
|
|
152808
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' private v3 API is not supported yet');
|
|
152715
152809
|
}
|
|
152716
152810
|
}
|
|
152717
|
-
else if (
|
|
152718
|
-
|
|
152811
|
+
else if (version === 'v4') {
|
|
152812
|
+
const splitPath = path.split('/');
|
|
152813
|
+
const splitPathLength = splitPath.length;
|
|
152814
|
+
let urlPath = '';
|
|
152815
|
+
if ((splitPathLength > 1) && (splitPath[0] !== 'kuna-code')) {
|
|
152816
|
+
let pathTail = '';
|
|
152817
|
+
for (let i = 1; i < splitPathLength; i++) {
|
|
152818
|
+
pathTail += splitPath[i];
|
|
152819
|
+
}
|
|
152820
|
+
urlPath = '/' + version + '/' + splitPath[0] + '/' + access + '/' + this.implodeParams(pathTail, params);
|
|
152821
|
+
}
|
|
152822
|
+
else {
|
|
152823
|
+
urlPath = '/' + version + '/' + access + '/' + this.implodeParams(path, params);
|
|
152824
|
+
}
|
|
152825
|
+
url = this.urls['api'][version] + urlPath;
|
|
152826
|
+
if (access === 'private') {
|
|
152827
|
+
const nonce = this.nonce();
|
|
152828
|
+
const auth = urlPath + nonce + this.json(params);
|
|
152829
|
+
headers = {
|
|
152830
|
+
'content-type': 'application/json',
|
|
152831
|
+
'accept': 'application/json',
|
|
152832
|
+
'nonce': nonce,
|
|
152833
|
+
'public-key': this.apiKey,
|
|
152834
|
+
'signature': this.hmac(this.encode(auth), this.encode(this.secret), _static_dependencies_noble_hashes_sha512_js__WEBPACK_IMPORTED_MODULE_3__/* .sha384 */ .iC, 'hex'),
|
|
152835
|
+
};
|
|
152836
|
+
const account = this.safeString(this.options, 'account');
|
|
152837
|
+
if (account === 'pro') {
|
|
152838
|
+
headers['account'] = 'pro';
|
|
152839
|
+
}
|
|
152840
|
+
}
|
|
152719
152841
|
}
|
|
152720
152842
|
}
|
|
152721
152843
|
else {
|
|
@@ -152738,7 +152860,7 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
152738
152860
|
'tonce': nonce,
|
|
152739
152861
|
}, params));
|
|
152740
152862
|
const auth = method + '|' + request + '|' + queryInner;
|
|
152741
|
-
const signed = this.hmac(this.encode(auth), this.encode(this.secret),
|
|
152863
|
+
const signed = this.hmac(this.encode(auth), this.encode(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__/* .sha256 */ .J);
|
|
152742
152864
|
const suffix = query + '&signature=' + signed;
|
|
152743
152865
|
if (method === 'GET') {
|
|
152744
152866
|
url += '?' + suffix;
|
|
@@ -176788,6 +176910,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
176788
176910
|
* @method
|
|
176789
176911
|
* @name okx#fetchStatus
|
|
176790
176912
|
* @description the latest known information on the availability of the exchange API
|
|
176913
|
+
* @see https://www.okx.com/docs-v5/en/#status-get-status
|
|
176791
176914
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
176792
176915
|
* @returns {object} a [status structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#exchange-status-structure}
|
|
176793
176916
|
*/
|
|
@@ -176836,6 +176959,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
176836
176959
|
* @method
|
|
176837
176960
|
* @name okx#fetchTime
|
|
176838
176961
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
176962
|
+
* @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-system-time
|
|
176839
176963
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
176840
176964
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
176841
176965
|
*/
|
|
@@ -176858,6 +176982,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
176858
176982
|
* @method
|
|
176859
176983
|
* @name okx#fetchAccounts
|
|
176860
176984
|
* @description fetch all the accounts associated with a profile
|
|
176985
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-account-configuration
|
|
176861
176986
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
176862
176987
|
* @returns {object} a dictionary of [account structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#account-structure} indexed by the account type
|
|
176863
176988
|
*/
|
|
@@ -177282,6 +177407,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
177282
177407
|
* @method
|
|
177283
177408
|
* @name okx#fetchOrderBook
|
|
177284
177409
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
177410
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-order-book
|
|
177285
177411
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
177286
177412
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
177287
177413
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
@@ -177383,6 +177509,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
177383
177509
|
* @method
|
|
177384
177510
|
* @name okx#fetchTicker
|
|
177385
177511
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
177512
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-ticker
|
|
177386
177513
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
177387
177514
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
177388
177515
|
* @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -177473,6 +177600,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
177473
177600
|
* @method
|
|
177474
177601
|
* @name okx#fetchTickers
|
|
177475
177602
|
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
177603
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-tickers
|
|
177476
177604
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
177477
177605
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
177478
177606
|
* @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -177785,6 +177913,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
177785
177913
|
* @method
|
|
177786
177914
|
* @name okx#fetchFundingRateHistory
|
|
177787
177915
|
* @description fetches historical funding rate prices
|
|
177916
|
+
* @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-funding-rate-history
|
|
177788
177917
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
177789
177918
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
177790
177919
|
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
|
|
@@ -177923,6 +178052,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
177923
178052
|
* @method
|
|
177924
178053
|
* @name okx#fetchTradingFee
|
|
177925
178054
|
* @description fetch the trading fees for a market
|
|
178055
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-fee-rates
|
|
177926
178056
|
* @param {string} symbol unified market symbol
|
|
177927
178057
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
177928
178058
|
* @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
|
|
@@ -177972,6 +178102,8 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
177972
178102
|
* @method
|
|
177973
178103
|
* @name okx#fetchBalance
|
|
177974
178104
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
178105
|
+
* @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-balance
|
|
178106
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance
|
|
177975
178107
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
177976
178108
|
* @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
|
|
177977
178109
|
*/
|
|
@@ -178507,6 +178639,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
178507
178639
|
* @method
|
|
178508
178640
|
* @name okx#cancelOrder
|
|
178509
178641
|
* @description cancels an open order
|
|
178642
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-order
|
|
178510
178643
|
* @param {string} id order id
|
|
178511
178644
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
178512
178645
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
@@ -178561,6 +178694,8 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
178561
178694
|
* @method
|
|
178562
178695
|
* @name okx#cancelOrders
|
|
178563
178696
|
* @description cancel multiple orders
|
|
178697
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-multiple-orders
|
|
178698
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-post-cancel-algo-order
|
|
178564
178699
|
* @param {string[]} ids order ids
|
|
178565
178700
|
* @param {string} symbol unified market symbol
|
|
178566
178701
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
@@ -178863,6 +178998,8 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
178863
178998
|
* @method
|
|
178864
178999
|
* @name okx#fetchOrder
|
|
178865
179000
|
* @description fetch an order by the id
|
|
179001
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-details
|
|
179002
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-details
|
|
178866
179003
|
* @param {string} id the order id
|
|
178867
179004
|
* @param {string} symbol unified market symbol
|
|
178868
179005
|
* @param {object} [params] extra and exchange specific parameters
|
|
@@ -179009,6 +179146,8 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
179009
179146
|
* @name okx#fetchOpenOrders
|
|
179010
179147
|
* @description Fetch orders that are still open
|
|
179011
179148
|
* @description fetch all unfilled currently open orders
|
|
179149
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-list
|
|
179150
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-list
|
|
179012
179151
|
* @param {string} symbol unified market symbol
|
|
179013
179152
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
179014
179153
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -179157,6 +179296,8 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
179157
179296
|
* @method
|
|
179158
179297
|
* @name okx#fetchCanceledOrders
|
|
179159
179298
|
* @description fetches information on multiple canceled orders made by the user
|
|
179299
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-history-last-7-days
|
|
179300
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-history
|
|
179160
179301
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
179161
179302
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
179162
179303
|
* @param {int} [limit] max number of orders to return, default is undefined
|
|
@@ -179331,6 +179472,8 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
179331
179472
|
* @method
|
|
179332
179473
|
* @name okx#fetchClosedOrders
|
|
179333
179474
|
* @description fetches information on multiple closed orders made by the user
|
|
179475
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-history-last-7-days
|
|
179476
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-history
|
|
179334
179477
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
179335
179478
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
179336
179479
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
@@ -179496,6 +179639,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
179496
179639
|
* @method
|
|
179497
179640
|
* @name okx#fetchMyTrades
|
|
179498
179641
|
* @description fetch all trades made by the user
|
|
179642
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-transaction-details-last-3-months
|
|
179499
179643
|
* @param {string} symbol unified market symbol
|
|
179500
179644
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
179501
179645
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -179556,6 +179700,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
179556
179700
|
* @method
|
|
179557
179701
|
* @name okx#fetchOrderTrades
|
|
179558
179702
|
* @description fetch all the trades made from a single order
|
|
179703
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-transaction-details-last-3-months
|
|
179559
179704
|
* @param {string} id order id
|
|
179560
179705
|
* @param {string} symbol unified market symbol
|
|
179561
179706
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -179874,6 +180019,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
179874
180019
|
* @method
|
|
179875
180020
|
* @name okx#fetchDepositAddressesByNetwork
|
|
179876
180021
|
* @description fetch a dictionary of addresses for a currency, indexed by network
|
|
180022
|
+
* @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
|
|
179877
180023
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
179878
180024
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
179879
180025
|
* @returns {object} a dictionary of [address structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure} indexed by the network
|
|
@@ -179915,6 +180061,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
179915
180061
|
* @method
|
|
179916
180062
|
* @name okx#fetchDepositAddress
|
|
179917
180063
|
* @description fetch the deposit address for a currency associated with this account
|
|
180064
|
+
* @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
|
|
179918
180065
|
* @param {string} code unified currency code
|
|
179919
180066
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
179920
180067
|
* @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
|
|
@@ -179955,6 +180102,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
179955
180102
|
* @method
|
|
179956
180103
|
* @name okx#withdraw
|
|
179957
180104
|
* @description make a withdrawal
|
|
180105
|
+
* @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-withdrawal
|
|
179958
180106
|
* @param {string} code unified currency code
|
|
179959
180107
|
* @param {float} amount the amount to withdraw
|
|
179960
180108
|
* @param {string} address the address to withdraw to
|
|
@@ -180899,6 +181047,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
180899
181047
|
* @method
|
|
180900
181048
|
* @name okx#fetchTransfers
|
|
180901
181049
|
* @description fetch a history of internal transfers made on an account
|
|
181050
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-3-months
|
|
180902
181051
|
* @param {string} code unified currency code of the currency transferred
|
|
180903
181052
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
180904
181053
|
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
@@ -181065,6 +181214,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
181065
181214
|
* @method
|
|
181066
181215
|
* @name okx#fetchFundingRate
|
|
181067
181216
|
* @description fetch the current funding rate
|
|
181217
|
+
* @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-funding-rate
|
|
181068
181218
|
* @param {string} symbol unified market symbol
|
|
181069
181219
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
181070
181220
|
* @returns {object} a [funding rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
|
|
@@ -181103,6 +181253,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
181103
181253
|
* @method
|
|
181104
181254
|
* @name okx#fetchFundingHistory
|
|
181105
181255
|
* @description fetch the history of funding payments paid and received on this account
|
|
181256
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-3-months
|
|
181106
181257
|
* @param {string} symbol unified market symbol
|
|
181107
181258
|
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
181108
181259
|
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
@@ -181323,6 +181474,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
181323
181474
|
* @method
|
|
181324
181475
|
* @name okx#setPositionMode
|
|
181325
181476
|
* @description set hedged to true or false for a market
|
|
181477
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-set-position-mode
|
|
181326
181478
|
* @param {bool} hedged set to true to use long_short_mode, false for net_mode
|
|
181327
181479
|
* @param {string} symbol not used by okx setPositionMode
|
|
181328
181480
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
@@ -181357,6 +181509,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
181357
181509
|
* @method
|
|
181358
181510
|
* @name okx#setMarginMode
|
|
181359
181511
|
* @description set margin mode to 'cross' or 'isolated'
|
|
181512
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-set-leverage
|
|
181360
181513
|
* @param {string} marginMode 'cross' or 'isolated'
|
|
181361
181514
|
* @param {string} symbol unified market symbol
|
|
181362
181515
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
@@ -181405,6 +181558,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
181405
181558
|
* @method
|
|
181406
181559
|
* @name okx#fetchBorrowRates
|
|
181407
181560
|
* @description fetch the borrow interest rates of all currencies
|
|
181561
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-interest-rate
|
|
181408
181562
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
181409
181563
|
* @returns {object} a list of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
|
|
181410
181564
|
*/
|
|
@@ -181444,6 +181598,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
181444
181598
|
* @method
|
|
181445
181599
|
* @name okx#fetchBorrowRate
|
|
181446
181600
|
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
181601
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-interest-rate
|
|
181447
181602
|
* @param {string} code unified currency code
|
|
181448
181603
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
181449
181604
|
* @returns {object} a [borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
|
|
@@ -181537,6 +181692,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
181537
181692
|
* @method
|
|
181538
181693
|
* @name okx#fetchBorrowRateHistories
|
|
181539
181694
|
* @description retrieves a history of a multiple currencies borrow interest rate at specific time slots, returns all currencies if no symbols passed, default is undefined
|
|
181695
|
+
* @see https://www.okx.com/docs-v5/en/#financial-product-savings-get-public-borrow-history-public
|
|
181540
181696
|
* @param {string[]|undefined} codes list of unified currency codes, default is undefined
|
|
181541
181697
|
* @param {int} [since] timestamp in ms of the earliest borrowRate, default is undefined
|
|
181542
181698
|
* @param {int} [limit] max number of borrow rate prices to return, default is undefined
|
|
@@ -181579,6 +181735,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
181579
181735
|
* @method
|
|
181580
181736
|
* @name okx#fetchBorrowRateHistory
|
|
181581
181737
|
* @description retrieves a history of a currencies borrow interest rate at specific time slots
|
|
181738
|
+
* @see https://www.okx.com/docs-v5/en/#financial-product-savings-get-public-borrow-history-public
|
|
181582
181739
|
* @param {string} code unified currency code
|
|
181583
181740
|
* @param {int} [since] timestamp for the earliest borrow rate
|
|
181584
181741
|
* @param {int} [limit] the maximum number of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure} to retrieve
|
|
@@ -181670,6 +181827,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
181670
181827
|
* @method
|
|
181671
181828
|
* @name okx#reduceMargin
|
|
181672
181829
|
* @description remove margin from a position
|
|
181830
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-increase-decrease-margin
|
|
181673
181831
|
* @param {string} symbol unified market symbol
|
|
181674
181832
|
* @param {float} amount the amount of margin to remove
|
|
181675
181833
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
@@ -181682,6 +181840,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
181682
181840
|
* @method
|
|
181683
181841
|
* @name okx#addMargin
|
|
181684
181842
|
* @description add margin
|
|
181843
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-increase-decrease-margin
|
|
181685
181844
|
* @param {string} symbol unified market symbol
|
|
181686
181845
|
* @param {float} amount amount of margin to add
|
|
181687
181846
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
@@ -197975,6 +198134,11 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
197975
198134
|
|
|
197976
198135
|
|
|
197977
198136
|
// ---------------------------------------------------------------------------
|
|
198137
|
+
/**
|
|
198138
|
+
* @class bitget
|
|
198139
|
+
* @extends Exchange
|
|
198140
|
+
* @description watching delivery future markets is not yet implemented (perpertual future / swap is implemented)
|
|
198141
|
+
*/
|
|
197978
198142
|
class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
197979
198143
|
describe() {
|
|
197980
198144
|
return this.deepExtend(super.describe(), {
|
|
@@ -198047,10 +198211,10 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
198047
198211
|
}
|
|
198048
198212
|
else {
|
|
198049
198213
|
if (!sandboxMode) {
|
|
198050
|
-
return market['id'].replace('_UMCBL', '');
|
|
198214
|
+
return market['id'].replace('_UMCBL', '').replace('_DMCBL', '').replace('_CMCBL', '');
|
|
198051
198215
|
}
|
|
198052
198216
|
else {
|
|
198053
|
-
return market['id'].replace('_SUMCBL', '');
|
|
198217
|
+
return market['id'].replace('_SUMCBL', '').replace('_SDMCBL', '').replace('_SCMCBL', '');
|
|
198054
198218
|
}
|
|
198055
198219
|
}
|
|
198056
198220
|
}
|
|
@@ -198062,15 +198226,24 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
198062
198226
|
const sandboxMode = this.safeValue(this.options, 'sandboxMode', false);
|
|
198063
198227
|
let marketId = this.safeString(arg, 'instId');
|
|
198064
198228
|
if (instType === 'sp') {
|
|
198065
|
-
marketId
|
|
198229
|
+
marketId = marketId + '_SPBL';
|
|
198066
198230
|
}
|
|
198067
198231
|
else {
|
|
198068
|
-
|
|
198069
|
-
|
|
198232
|
+
let extension = sandboxMode ? '_S' : '_';
|
|
198233
|
+
const splitByUSDT = marketId.split('USDT');
|
|
198234
|
+
const splitByPERP = marketId.split('PERP');
|
|
198235
|
+
const splitByUSDTLength = splitByUSDT.length;
|
|
198236
|
+
const splitByPERPLength = splitByPERP.length;
|
|
198237
|
+
if (splitByUSDTLength > 1) {
|
|
198238
|
+
extension += 'UMCBL';
|
|
198239
|
+
}
|
|
198240
|
+
else if (splitByPERPLength > 1) {
|
|
198241
|
+
extension += 'CMCBL';
|
|
198070
198242
|
}
|
|
198071
198243
|
else {
|
|
198072
|
-
|
|
198244
|
+
extension += 'DMCBL';
|
|
198073
198245
|
}
|
|
198246
|
+
marketId = marketId + extension;
|
|
198074
198247
|
}
|
|
198075
198248
|
return marketId;
|
|
198076
198249
|
}
|
|
@@ -198573,6 +198746,8 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
198573
198746
|
* @method
|
|
198574
198747
|
* @name bitget#watchTrades
|
|
198575
198748
|
* @description get the list of most recent trades for a particular symbol
|
|
198749
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#trades-channel
|
|
198750
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#trades-channel
|
|
198576
198751
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
198577
198752
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
198578
198753
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -260439,7 +260614,7 @@ class whitebit extends _abstract_whitebit_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
260439
260614
|
// ]
|
|
260440
260615
|
// }
|
|
260441
260616
|
//
|
|
260442
|
-
const timestamp = this.
|
|
260617
|
+
const timestamp = this.parseToInt(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMul */ .O.stringMul(this.safeString(response, 'timestamp'), '1000'));
|
|
260443
260618
|
return this.parseOrderBook(response, symbol, timestamp);
|
|
260444
260619
|
}
|
|
260445
260620
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
@@ -273993,7 +274168,7 @@ SOFTWARE.
|
|
|
273993
274168
|
|
|
273994
274169
|
//-----------------------------------------------------------------------------
|
|
273995
274170
|
// this is updated by vss.js when building
|
|
273996
|
-
const version = '4.1.
|
|
274171
|
+
const version = '4.1.5';
|
|
273997
274172
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
|
|
273998
274173
|
//-----------------------------------------------------------------------------
|
|
273999
274174
|
|