ccxt 4.1.3 → 4.1.4
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 +81 -5
- 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/idex.js +1 -1
- package/dist/cjs/src/kraken.js +37 -1
- package/dist/cjs/src/kucoinfutures.js +1 -1
- package/dist/cjs/src/okx.js +37 -0
- package/dist/cjs/src/whitebit.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/base/Exchange.js +3 -0
- package/js/src/idex.js +1 -1
- package/js/src/kraken.js +37 -1
- package/js/src/kucoinfutures.js +1 -1
- package/js/src/okx.js +37 -0
- package/js/src/whitebit.js +1 -1
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -179,7 +179,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
179
179
|
|
|
180
180
|
//-----------------------------------------------------------------------------
|
|
181
181
|
// this is updated by vss.js when building
|
|
182
|
-
const version = '4.1.
|
|
182
|
+
const version = '4.1.4';
|
|
183
183
|
Exchange["default"].ccxtVersion = version;
|
|
184
184
|
const exchanges = {
|
|
185
185
|
'ace': ace,
|
|
@@ -1680,6 +1680,9 @@ class Exchange {
|
|
|
1680
1680
|
if (!tradesAreParsed) {
|
|
1681
1681
|
trades = this.parseTrades(rawTrades, market);
|
|
1682
1682
|
}
|
|
1683
|
+
else {
|
|
1684
|
+
trades = rawTrades;
|
|
1685
|
+
}
|
|
1683
1686
|
this.number = oldNumber;
|
|
1684
1687
|
let tradesLength = 0;
|
|
1685
1688
|
const isArray = Array.isArray(trades);
|
package/dist/cjs/src/idex.js
CHANGED
|
@@ -1516,7 +1516,7 @@ class idex extends idex$1 {
|
|
|
1516
1516
|
//
|
|
1517
1517
|
// { serverTime: '1655258263236' }
|
|
1518
1518
|
//
|
|
1519
|
-
return this.
|
|
1519
|
+
return this.safeInteger(response, 'serverTime');
|
|
1520
1520
|
}
|
|
1521
1521
|
async fetchWithdrawal(id, code = undefined, params = {}) {
|
|
1522
1522
|
/**
|
package/dist/cjs/src/kraken.js
CHANGED
|
@@ -355,6 +355,7 @@ class kraken extends kraken$1 {
|
|
|
355
355
|
* @method
|
|
356
356
|
* @name kraken#fetchMarkets
|
|
357
357
|
* @description retrieves data on all markets for kraken
|
|
358
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getTradableAssetPairs
|
|
358
359
|
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
359
360
|
* @returns {object[]} an array of objects representing market data
|
|
360
361
|
*/
|
|
@@ -540,6 +541,7 @@ class kraken extends kraken$1 {
|
|
|
540
541
|
* @method
|
|
541
542
|
* @name kraken#fetchCurrencies
|
|
542
543
|
* @description fetches all available currencies on an exchange
|
|
544
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getAssetInfo
|
|
543
545
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
544
546
|
* @returns {object} an associative dictionary of currencies
|
|
545
547
|
*/
|
|
@@ -598,6 +600,7 @@ class kraken extends kraken$1 {
|
|
|
598
600
|
* @method
|
|
599
601
|
* @name kraken#fetchTradingFee
|
|
600
602
|
* @description fetch the trading fees for a market
|
|
603
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradeVolume
|
|
601
604
|
* @param {string} symbol unified market symbol
|
|
602
605
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
603
606
|
* @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
|
|
@@ -666,6 +669,7 @@ class kraken extends kraken$1 {
|
|
|
666
669
|
* @method
|
|
667
670
|
* @name kraken#fetchOrderBook
|
|
668
671
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
672
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getOrderBook
|
|
669
673
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
670
674
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
671
675
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
@@ -768,6 +772,7 @@ class kraken extends kraken$1 {
|
|
|
768
772
|
* @method
|
|
769
773
|
* @name kraken#fetchTickers
|
|
770
774
|
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
775
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getTickerInformation
|
|
771
776
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
772
777
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
773
778
|
* @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -804,6 +809,7 @@ class kraken extends kraken$1 {
|
|
|
804
809
|
* @method
|
|
805
810
|
* @name kraken#fetchTicker
|
|
806
811
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
812
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getTickerInformation
|
|
807
813
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
808
814
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
809
815
|
* @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -848,6 +854,7 @@ class kraken extends kraken$1 {
|
|
|
848
854
|
* @method
|
|
849
855
|
* @name kraken#fetchOHLCV
|
|
850
856
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
857
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getOHLCData
|
|
851
858
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
852
859
|
* @param {string} timeframe the length of time each candle represents
|
|
853
860
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -960,6 +967,7 @@ class kraken extends kraken$1 {
|
|
|
960
967
|
* @method
|
|
961
968
|
* @name kraken#fetchLedger
|
|
962
969
|
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
970
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getLedgers
|
|
963
971
|
* @param {string} code unified currency code, default is undefined
|
|
964
972
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
965
973
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
@@ -1138,6 +1146,7 @@ class kraken extends kraken$1 {
|
|
|
1138
1146
|
* @method
|
|
1139
1147
|
* @name kraken#fetchTrades
|
|
1140
1148
|
* @description get the list of most recent trades for a particular symbol
|
|
1149
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getRecentTrades
|
|
1141
1150
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
1142
1151
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1143
1152
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -1211,6 +1220,7 @@ class kraken extends kraken$1 {
|
|
|
1211
1220
|
* @method
|
|
1212
1221
|
* @name kraken#fetchBalance
|
|
1213
1222
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
1223
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getAccountBalance
|
|
1214
1224
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
1215
1225
|
* @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
|
|
1216
1226
|
*/
|
|
@@ -1454,6 +1464,16 @@ class kraken extends kraken$1 {
|
|
|
1454
1464
|
}
|
|
1455
1465
|
const clientOrderId = this.safeString(order, 'userref');
|
|
1456
1466
|
const rawTrades = this.safeValue(order, 'trades');
|
|
1467
|
+
const trades = [];
|
|
1468
|
+
for (let i = 0; i < rawTrades.length; i++) {
|
|
1469
|
+
const rawTrade = rawTrades[i];
|
|
1470
|
+
if (typeof rawTrade === 'string') {
|
|
1471
|
+
trades.push(this.safeTrade({ 'id': rawTrade, 'orderId': id, 'symbol': symbol, 'info': {} }));
|
|
1472
|
+
}
|
|
1473
|
+
else {
|
|
1474
|
+
trades.push(rawTrade);
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1457
1477
|
stopPrice = this.safeNumber(order, 'stopprice', stopPrice);
|
|
1458
1478
|
return this.safeOrder({
|
|
1459
1479
|
'id': id,
|
|
@@ -1477,7 +1497,7 @@ class kraken extends kraken$1 {
|
|
|
1477
1497
|
'average': average,
|
|
1478
1498
|
'remaining': undefined,
|
|
1479
1499
|
'fee': fee,
|
|
1480
|
-
'trades':
|
|
1500
|
+
'trades': trades,
|
|
1481
1501
|
}, market);
|
|
1482
1502
|
}
|
|
1483
1503
|
orderRequest(method, symbol, type, request, price = undefined, params = {}) {
|
|
@@ -1613,6 +1633,7 @@ class kraken extends kraken$1 {
|
|
|
1613
1633
|
* @method
|
|
1614
1634
|
* @name kraken#fetchOrder
|
|
1615
1635
|
* @description fetches information on an order made by the user
|
|
1636
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getOrdersInfo
|
|
1616
1637
|
* @param {string} symbol not used by kraken fetchOrder
|
|
1617
1638
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
1618
1639
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
@@ -1682,6 +1703,7 @@ class kraken extends kraken$1 {
|
|
|
1682
1703
|
* @method
|
|
1683
1704
|
* @name kraken#fetchOrderTrades
|
|
1684
1705
|
* @description fetch all the trades made from a single order
|
|
1706
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradesInfo
|
|
1685
1707
|
* @param {string} id order id
|
|
1686
1708
|
* @param {string} symbol unified market symbol
|
|
1687
1709
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -1781,6 +1803,7 @@ class kraken extends kraken$1 {
|
|
|
1781
1803
|
* @method
|
|
1782
1804
|
* @name kraken#fetchMyTrades
|
|
1783
1805
|
* @description fetch all trades made by the user
|
|
1806
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradeHistory
|
|
1784
1807
|
* @param {string} symbol unified market symbol
|
|
1785
1808
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1786
1809
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -1840,6 +1863,7 @@ class kraken extends kraken$1 {
|
|
|
1840
1863
|
* @method
|
|
1841
1864
|
* @name kraken#cancelOrder
|
|
1842
1865
|
* @description cancels an open order
|
|
1866
|
+
* @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelOrder
|
|
1843
1867
|
* @param {string} id order id
|
|
1844
1868
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
1845
1869
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
@@ -1870,6 +1894,7 @@ class kraken extends kraken$1 {
|
|
|
1870
1894
|
* @method
|
|
1871
1895
|
* @name kraken#cancelOrders
|
|
1872
1896
|
* @description cancel multiple orders
|
|
1897
|
+
* @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelOrderBatch
|
|
1873
1898
|
* @param {string[]} ids open orders transaction ID (txid) or user reference (userref)
|
|
1874
1899
|
* @param {string} symbol unified market symbol
|
|
1875
1900
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
@@ -1894,6 +1919,7 @@ class kraken extends kraken$1 {
|
|
|
1894
1919
|
* @method
|
|
1895
1920
|
* @name kraken#cancelAllOrders
|
|
1896
1921
|
* @description cancel all open orders
|
|
1922
|
+
* @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelAllOrders
|
|
1897
1923
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
1898
1924
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
1899
1925
|
* @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
@@ -1906,6 +1932,7 @@ class kraken extends kraken$1 {
|
|
|
1906
1932
|
* @method
|
|
1907
1933
|
* @name kraken#fetchOpenOrders
|
|
1908
1934
|
* @description fetch all unfilled currently open orders
|
|
1935
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getOpenOrders
|
|
1909
1936
|
* @param {string} symbol unified market symbol
|
|
1910
1937
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1911
1938
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -1937,6 +1964,7 @@ class kraken extends kraken$1 {
|
|
|
1937
1964
|
* @method
|
|
1938
1965
|
* @name kraken#fetchClosedOrders
|
|
1939
1966
|
* @description fetches information on multiple closed orders made by the user
|
|
1967
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getClosedOrders
|
|
1940
1968
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1941
1969
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1942
1970
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
@@ -2134,6 +2162,7 @@ class kraken extends kraken$1 {
|
|
|
2134
2162
|
* @method
|
|
2135
2163
|
* @name kraken#fetchDeposits
|
|
2136
2164
|
* @description fetch all deposits made to an account
|
|
2165
|
+
* @see https://docs.kraken.com/rest/#tag/Funding/operation/getStatusRecentDeposits
|
|
2137
2166
|
* @param {string} code unified currency code
|
|
2138
2167
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
2139
2168
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
@@ -2170,6 +2199,7 @@ class kraken extends kraken$1 {
|
|
|
2170
2199
|
* @method
|
|
2171
2200
|
* @name kraken#fetchTime
|
|
2172
2201
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
2202
|
+
* @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getServerTime
|
|
2173
2203
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
2174
2204
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
2175
2205
|
*/
|
|
@@ -2192,6 +2222,7 @@ class kraken extends kraken$1 {
|
|
|
2192
2222
|
* @method
|
|
2193
2223
|
* @name kraken#fetchWithdrawals
|
|
2194
2224
|
* @description fetch all withdrawals made from an account
|
|
2225
|
+
* @see https://docs.kraken.com/rest/#tag/Funding/operation/getStatusRecentWithdrawals
|
|
2195
2226
|
* @param {string} code unified currency code
|
|
2196
2227
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
2197
2228
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
@@ -2228,6 +2259,7 @@ class kraken extends kraken$1 {
|
|
|
2228
2259
|
* @method
|
|
2229
2260
|
* @name kraken#createDepositAddress
|
|
2230
2261
|
* @description create a currency deposit address
|
|
2262
|
+
* @see https://docs.kraken.com/rest/#tag/Funding/operation/getDepositAddresses
|
|
2231
2263
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
2232
2264
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
2233
2265
|
* @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
|
|
@@ -2274,6 +2306,7 @@ class kraken extends kraken$1 {
|
|
|
2274
2306
|
* @method
|
|
2275
2307
|
* @name kraken#fetchDepositAddress
|
|
2276
2308
|
* @description fetch the deposit address for a currency associated with this account
|
|
2309
|
+
* @see https://docs.kraken.com/rest/#tag/Funding/operation/getDepositAddresses
|
|
2277
2310
|
* @param {string} code unified currency code
|
|
2278
2311
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
2279
2312
|
* @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
|
|
@@ -2355,6 +2388,7 @@ class kraken extends kraken$1 {
|
|
|
2355
2388
|
* @method
|
|
2356
2389
|
* @name kraken#withdraw
|
|
2357
2390
|
* @description make a withdrawal
|
|
2391
|
+
* @see https://docs.kraken.com/rest/#tag/Funding/operation/withdrawFunds
|
|
2358
2392
|
* @param {string} code unified currency code
|
|
2359
2393
|
* @param {float} amount the amount to withdraw
|
|
2360
2394
|
* @param {string} address the address to withdraw to
|
|
@@ -2391,6 +2425,7 @@ class kraken extends kraken$1 {
|
|
|
2391
2425
|
* @method
|
|
2392
2426
|
* @name kraken#fetchPositions
|
|
2393
2427
|
* @description fetch all open positions
|
|
2428
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getOpenPositions
|
|
2394
2429
|
* @param {string[]|undefined} symbols not used by kraken fetchPositions ()
|
|
2395
2430
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
2396
2431
|
* @returns {object[]} a list of [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
|
|
@@ -2462,6 +2497,7 @@ class kraken extends kraken$1 {
|
|
|
2462
2497
|
async transferOut(code, amount, params = {}) {
|
|
2463
2498
|
/**
|
|
2464
2499
|
* @description transfer from spot wallet to futures wallet
|
|
2500
|
+
* @see https://docs.kraken.com/rest/#tag/User-Funding/operation/walletTransfer
|
|
2465
2501
|
* @param {str} code Unified currency code
|
|
2466
2502
|
* @param {float} amount Size of the transfer
|
|
2467
2503
|
* @param {dict} [params] Exchange specific parameters
|
|
@@ -525,7 +525,7 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
525
525
|
// data: 1637385119302,
|
|
526
526
|
// }
|
|
527
527
|
//
|
|
528
|
-
return this.
|
|
528
|
+
return this.safeInteger(response, 'data');
|
|
529
529
|
}
|
|
530
530
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
531
531
|
/**
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -1131,6 +1131,7 @@ class okx extends okx$1 {
|
|
|
1131
1131
|
* @method
|
|
1132
1132
|
* @name okx#fetchStatus
|
|
1133
1133
|
* @description the latest known information on the availability of the exchange API
|
|
1134
|
+
* @see https://www.okx.com/docs-v5/en/#status-get-status
|
|
1134
1135
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
1135
1136
|
* @returns {object} a [status structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#exchange-status-structure}
|
|
1136
1137
|
*/
|
|
@@ -1179,6 +1180,7 @@ class okx extends okx$1 {
|
|
|
1179
1180
|
* @method
|
|
1180
1181
|
* @name okx#fetchTime
|
|
1181
1182
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
1183
|
+
* @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-system-time
|
|
1182
1184
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
1183
1185
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
1184
1186
|
*/
|
|
@@ -1201,6 +1203,7 @@ class okx extends okx$1 {
|
|
|
1201
1203
|
* @method
|
|
1202
1204
|
* @name okx#fetchAccounts
|
|
1203
1205
|
* @description fetch all the accounts associated with a profile
|
|
1206
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-account-configuration
|
|
1204
1207
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
1205
1208
|
* @returns {object} a dictionary of [account structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#account-structure} indexed by the account type
|
|
1206
1209
|
*/
|
|
@@ -1625,6 +1628,7 @@ class okx extends okx$1 {
|
|
|
1625
1628
|
* @method
|
|
1626
1629
|
* @name okx#fetchOrderBook
|
|
1627
1630
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
1631
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-order-book
|
|
1628
1632
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
1629
1633
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
1630
1634
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
@@ -1726,6 +1730,7 @@ class okx extends okx$1 {
|
|
|
1726
1730
|
* @method
|
|
1727
1731
|
* @name okx#fetchTicker
|
|
1728
1732
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1733
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-ticker
|
|
1729
1734
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1730
1735
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
1731
1736
|
* @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -1816,6 +1821,7 @@ class okx extends okx$1 {
|
|
|
1816
1821
|
* @method
|
|
1817
1822
|
* @name okx#fetchTickers
|
|
1818
1823
|
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
1824
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-tickers
|
|
1819
1825
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1820
1826
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
1821
1827
|
* @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -2128,6 +2134,7 @@ class okx extends okx$1 {
|
|
|
2128
2134
|
* @method
|
|
2129
2135
|
* @name okx#fetchFundingRateHistory
|
|
2130
2136
|
* @description fetches historical funding rate prices
|
|
2137
|
+
* @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-funding-rate-history
|
|
2131
2138
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
2132
2139
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
2133
2140
|
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
|
|
@@ -2266,6 +2273,7 @@ class okx extends okx$1 {
|
|
|
2266
2273
|
* @method
|
|
2267
2274
|
* @name okx#fetchTradingFee
|
|
2268
2275
|
* @description fetch the trading fees for a market
|
|
2276
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-fee-rates
|
|
2269
2277
|
* @param {string} symbol unified market symbol
|
|
2270
2278
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
2271
2279
|
* @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
|
|
@@ -2315,6 +2323,8 @@ class okx extends okx$1 {
|
|
|
2315
2323
|
* @method
|
|
2316
2324
|
* @name okx#fetchBalance
|
|
2317
2325
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
2326
|
+
* @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-balance
|
|
2327
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance
|
|
2318
2328
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
2319
2329
|
* @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
|
|
2320
2330
|
*/
|
|
@@ -2850,6 +2860,7 @@ class okx extends okx$1 {
|
|
|
2850
2860
|
* @method
|
|
2851
2861
|
* @name okx#cancelOrder
|
|
2852
2862
|
* @description cancels an open order
|
|
2863
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-order
|
|
2853
2864
|
* @param {string} id order id
|
|
2854
2865
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2855
2866
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
@@ -2904,6 +2915,8 @@ class okx extends okx$1 {
|
|
|
2904
2915
|
* @method
|
|
2905
2916
|
* @name okx#cancelOrders
|
|
2906
2917
|
* @description cancel multiple orders
|
|
2918
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-multiple-orders
|
|
2919
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-post-cancel-algo-order
|
|
2907
2920
|
* @param {string[]} ids order ids
|
|
2908
2921
|
* @param {string} symbol unified market symbol
|
|
2909
2922
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
@@ -3206,6 +3219,8 @@ class okx extends okx$1 {
|
|
|
3206
3219
|
* @method
|
|
3207
3220
|
* @name okx#fetchOrder
|
|
3208
3221
|
* @description fetch an order by the id
|
|
3222
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-details
|
|
3223
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-details
|
|
3209
3224
|
* @param {string} id the order id
|
|
3210
3225
|
* @param {string} symbol unified market symbol
|
|
3211
3226
|
* @param {object} [params] extra and exchange specific parameters
|
|
@@ -3352,6 +3367,8 @@ class okx extends okx$1 {
|
|
|
3352
3367
|
* @name okx#fetchOpenOrders
|
|
3353
3368
|
* @description Fetch orders that are still open
|
|
3354
3369
|
* @description fetch all unfilled currently open orders
|
|
3370
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-list
|
|
3371
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-list
|
|
3355
3372
|
* @param {string} symbol unified market symbol
|
|
3356
3373
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
3357
3374
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -3500,6 +3517,8 @@ class okx extends okx$1 {
|
|
|
3500
3517
|
* @method
|
|
3501
3518
|
* @name okx#fetchCanceledOrders
|
|
3502
3519
|
* @description fetches information on multiple canceled orders made by the user
|
|
3520
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-history-last-7-days
|
|
3521
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-history
|
|
3503
3522
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
3504
3523
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
3505
3524
|
* @param {int} [limit] max number of orders to return, default is undefined
|
|
@@ -3674,6 +3693,8 @@ class okx extends okx$1 {
|
|
|
3674
3693
|
* @method
|
|
3675
3694
|
* @name okx#fetchClosedOrders
|
|
3676
3695
|
* @description fetches information on multiple closed orders made by the user
|
|
3696
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-history-last-7-days
|
|
3697
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-history
|
|
3677
3698
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
3678
3699
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
3679
3700
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
@@ -3839,6 +3860,7 @@ class okx extends okx$1 {
|
|
|
3839
3860
|
* @method
|
|
3840
3861
|
* @name okx#fetchMyTrades
|
|
3841
3862
|
* @description fetch all trades made by the user
|
|
3863
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-transaction-details-last-3-months
|
|
3842
3864
|
* @param {string} symbol unified market symbol
|
|
3843
3865
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
3844
3866
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -3899,6 +3921,7 @@ class okx extends okx$1 {
|
|
|
3899
3921
|
* @method
|
|
3900
3922
|
* @name okx#fetchOrderTrades
|
|
3901
3923
|
* @description fetch all the trades made from a single order
|
|
3924
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-transaction-details-last-3-months
|
|
3902
3925
|
* @param {string} id order id
|
|
3903
3926
|
* @param {string} symbol unified market symbol
|
|
3904
3927
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -4217,6 +4240,7 @@ class okx extends okx$1 {
|
|
|
4217
4240
|
* @method
|
|
4218
4241
|
* @name okx#fetchDepositAddressesByNetwork
|
|
4219
4242
|
* @description fetch a dictionary of addresses for a currency, indexed by network
|
|
4243
|
+
* @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
|
|
4220
4244
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
4221
4245
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
4222
4246
|
* @returns {object} a dictionary of [address structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure} indexed by the network
|
|
@@ -4258,6 +4282,7 @@ class okx extends okx$1 {
|
|
|
4258
4282
|
* @method
|
|
4259
4283
|
* @name okx#fetchDepositAddress
|
|
4260
4284
|
* @description fetch the deposit address for a currency associated with this account
|
|
4285
|
+
* @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
|
|
4261
4286
|
* @param {string} code unified currency code
|
|
4262
4287
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
4263
4288
|
* @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
|
|
@@ -4298,6 +4323,7 @@ class okx extends okx$1 {
|
|
|
4298
4323
|
* @method
|
|
4299
4324
|
* @name okx#withdraw
|
|
4300
4325
|
* @description make a withdrawal
|
|
4326
|
+
* @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-withdrawal
|
|
4301
4327
|
* @param {string} code unified currency code
|
|
4302
4328
|
* @param {float} amount the amount to withdraw
|
|
4303
4329
|
* @param {string} address the address to withdraw to
|
|
@@ -5242,6 +5268,7 @@ class okx extends okx$1 {
|
|
|
5242
5268
|
* @method
|
|
5243
5269
|
* @name okx#fetchTransfers
|
|
5244
5270
|
* @description fetch a history of internal transfers made on an account
|
|
5271
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-3-months
|
|
5245
5272
|
* @param {string} code unified currency code of the currency transferred
|
|
5246
5273
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
5247
5274
|
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
@@ -5408,6 +5435,7 @@ class okx extends okx$1 {
|
|
|
5408
5435
|
* @method
|
|
5409
5436
|
* @name okx#fetchFundingRate
|
|
5410
5437
|
* @description fetch the current funding rate
|
|
5438
|
+
* @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-funding-rate
|
|
5411
5439
|
* @param {string} symbol unified market symbol
|
|
5412
5440
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
5413
5441
|
* @returns {object} a [funding rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
|
|
@@ -5446,6 +5474,7 @@ class okx extends okx$1 {
|
|
|
5446
5474
|
* @method
|
|
5447
5475
|
* @name okx#fetchFundingHistory
|
|
5448
5476
|
* @description fetch the history of funding payments paid and received on this account
|
|
5477
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-3-months
|
|
5449
5478
|
* @param {string} symbol unified market symbol
|
|
5450
5479
|
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
5451
5480
|
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
@@ -5666,6 +5695,7 @@ class okx extends okx$1 {
|
|
|
5666
5695
|
* @method
|
|
5667
5696
|
* @name okx#setPositionMode
|
|
5668
5697
|
* @description set hedged to true or false for a market
|
|
5698
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-set-position-mode
|
|
5669
5699
|
* @param {bool} hedged set to true to use long_short_mode, false for net_mode
|
|
5670
5700
|
* @param {string} symbol not used by okx setPositionMode
|
|
5671
5701
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
@@ -5700,6 +5730,7 @@ class okx extends okx$1 {
|
|
|
5700
5730
|
* @method
|
|
5701
5731
|
* @name okx#setMarginMode
|
|
5702
5732
|
* @description set margin mode to 'cross' or 'isolated'
|
|
5733
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-set-leverage
|
|
5703
5734
|
* @param {string} marginMode 'cross' or 'isolated'
|
|
5704
5735
|
* @param {string} symbol unified market symbol
|
|
5705
5736
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
@@ -5748,6 +5779,7 @@ class okx extends okx$1 {
|
|
|
5748
5779
|
* @method
|
|
5749
5780
|
* @name okx#fetchBorrowRates
|
|
5750
5781
|
* @description fetch the borrow interest rates of all currencies
|
|
5782
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-interest-rate
|
|
5751
5783
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
5752
5784
|
* @returns {object} a list of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
|
|
5753
5785
|
*/
|
|
@@ -5787,6 +5819,7 @@ class okx extends okx$1 {
|
|
|
5787
5819
|
* @method
|
|
5788
5820
|
* @name okx#fetchBorrowRate
|
|
5789
5821
|
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
5822
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-interest-rate
|
|
5790
5823
|
* @param {string} code unified currency code
|
|
5791
5824
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
5792
5825
|
* @returns {object} a [borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
|
|
@@ -5880,6 +5913,7 @@ class okx extends okx$1 {
|
|
|
5880
5913
|
* @method
|
|
5881
5914
|
* @name okx#fetchBorrowRateHistories
|
|
5882
5915
|
* @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
|
|
5916
|
+
* @see https://www.okx.com/docs-v5/en/#financial-product-savings-get-public-borrow-history-public
|
|
5883
5917
|
* @param {string[]|undefined} codes list of unified currency codes, default is undefined
|
|
5884
5918
|
* @param {int} [since] timestamp in ms of the earliest borrowRate, default is undefined
|
|
5885
5919
|
* @param {int} [limit] max number of borrow rate prices to return, default is undefined
|
|
@@ -5922,6 +5956,7 @@ class okx extends okx$1 {
|
|
|
5922
5956
|
* @method
|
|
5923
5957
|
* @name okx#fetchBorrowRateHistory
|
|
5924
5958
|
* @description retrieves a history of a currencies borrow interest rate at specific time slots
|
|
5959
|
+
* @see https://www.okx.com/docs-v5/en/#financial-product-savings-get-public-borrow-history-public
|
|
5925
5960
|
* @param {string} code unified currency code
|
|
5926
5961
|
* @param {int} [since] timestamp for the earliest borrow rate
|
|
5927
5962
|
* @param {int} [limit] the maximum number of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure} to retrieve
|
|
@@ -6013,6 +6048,7 @@ class okx extends okx$1 {
|
|
|
6013
6048
|
* @method
|
|
6014
6049
|
* @name okx#reduceMargin
|
|
6015
6050
|
* @description remove margin from a position
|
|
6051
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-increase-decrease-margin
|
|
6016
6052
|
* @param {string} symbol unified market symbol
|
|
6017
6053
|
* @param {float} amount the amount of margin to remove
|
|
6018
6054
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
@@ -6025,6 +6061,7 @@ class okx extends okx$1 {
|
|
|
6025
6061
|
* @method
|
|
6026
6062
|
* @name okx#addMargin
|
|
6027
6063
|
* @description add margin
|
|
6064
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-increase-decrease-margin
|
|
6028
6065
|
* @param {string} symbol unified market symbol
|
|
6029
6066
|
* @param {float} amount amount of margin to add
|
|
6030
6067
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
package/dist/cjs/src/whitebit.js
CHANGED
|
@@ -853,7 +853,7 @@ class whitebit extends whitebit$1 {
|
|
|
853
853
|
// ]
|
|
854
854
|
// }
|
|
855
855
|
//
|
|
856
|
-
const timestamp = this.
|
|
856
|
+
const timestamp = this.parseToInt(Precise["default"].stringMul(this.safeString(response, 'timestamp'), '1000'));
|
|
857
857
|
return this.parseOrderBook(response, symbol, timestamp);
|
|
858
858
|
}
|
|
859
859
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
package/js/ccxt.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
|
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.1.
|
|
7
|
+
declare const version = "4.1.3";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.1.
|
|
41
|
+
const version = '4.1.4';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -1674,6 +1674,9 @@ export default class Exchange {
|
|
|
1674
1674
|
if (!tradesAreParsed) {
|
|
1675
1675
|
trades = this.parseTrades(rawTrades, market);
|
|
1676
1676
|
}
|
|
1677
|
+
else {
|
|
1678
|
+
trades = rawTrades;
|
|
1679
|
+
}
|
|
1677
1680
|
this.number = oldNumber;
|
|
1678
1681
|
let tradesLength = 0;
|
|
1679
1682
|
const isArray = Array.isArray(trades);
|
package/js/src/idex.js
CHANGED
|
@@ -1519,7 +1519,7 @@ export default class idex extends Exchange {
|
|
|
1519
1519
|
//
|
|
1520
1520
|
// { serverTime: '1655258263236' }
|
|
1521
1521
|
//
|
|
1522
|
-
return this.
|
|
1522
|
+
return this.safeInteger(response, 'serverTime');
|
|
1523
1523
|
}
|
|
1524
1524
|
async fetchWithdrawal(id, code = undefined, params = {}) {
|
|
1525
1525
|
/**
|