ccxt 4.2.34 → 4.2.36
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 +520 -182
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +10 -2
- package/dist/cjs/src/base/ws/Client.js +5 -2
- package/dist/cjs/src/binance.js +335 -94
- package/dist/cjs/src/bitfinex.js +21 -0
- package/dist/cjs/src/bitfinex2.js +12 -1
- package/dist/cjs/src/bitget.js +28 -39
- package/dist/cjs/src/bithumb.js +14 -0
- package/dist/cjs/src/krakenfutures.js +25 -3
- package/dist/cjs/src/pro/binance.js +5 -5
- package/dist/cjs/src/woo.js +64 -35
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/base/Exchange.js +10 -2
- package/js/src/base/ws/Client.js +5 -2
- package/js/src/binance.js +335 -94
- package/js/src/bitfinex.js +21 -0
- package/js/src/bitfinex2.js +12 -1
- package/js/src/bitget.js +28 -39
- package/js/src/bithumb.js +14 -0
- package/js/src/krakenfutures.js +25 -3
- package/js/src/pro/binance.js +5 -5
- package/js/src/woo.js +64 -35
- package/package.json +1 -1
package/js/src/bitfinex.js
CHANGED
|
@@ -478,6 +478,7 @@ export default class bitfinex extends Exchange {
|
|
|
478
478
|
* @method
|
|
479
479
|
* @name bitfinex#fetchTradingFees
|
|
480
480
|
* @description fetch the trading fees for multiple markets
|
|
481
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-summary
|
|
481
482
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
482
483
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
483
484
|
*/
|
|
@@ -560,6 +561,8 @@ export default class bitfinex extends Exchange {
|
|
|
560
561
|
* @method
|
|
561
562
|
* @name bitfinex#fetchMarkets
|
|
562
563
|
* @description retrieves data on all markets for bitfinex
|
|
564
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-public-symbols
|
|
565
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-public-symbol-details
|
|
563
566
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
564
567
|
* @returns {object[]} an array of objects representing market data
|
|
565
568
|
*/
|
|
@@ -684,6 +687,7 @@ export default class bitfinex extends Exchange {
|
|
|
684
687
|
* @method
|
|
685
688
|
* @name bitfinex#fetchBalance
|
|
686
689
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
690
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-wallet-balances
|
|
687
691
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
688
692
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
689
693
|
*/
|
|
@@ -741,6 +745,7 @@ export default class bitfinex extends Exchange {
|
|
|
741
745
|
* @method
|
|
742
746
|
* @name bitfinex#transfer
|
|
743
747
|
* @description transfer currency internally between wallets on the same account
|
|
748
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-transfer-between-wallets
|
|
744
749
|
* @param {string} code unified currency code
|
|
745
750
|
* @param {float} amount amount to transfer
|
|
746
751
|
* @param {string} fromAccount account to transfer from
|
|
@@ -826,6 +831,7 @@ export default class bitfinex extends Exchange {
|
|
|
826
831
|
* @method
|
|
827
832
|
* @name bitfinex#fetchOrderBook
|
|
828
833
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
834
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-public-orderbook
|
|
829
835
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
830
836
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
831
837
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -868,6 +874,7 @@ export default class bitfinex extends Exchange {
|
|
|
868
874
|
* @method
|
|
869
875
|
* @name bitfinex#fetchTicker
|
|
870
876
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
877
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-public-ticker
|
|
871
878
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
872
879
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
873
880
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -984,6 +991,7 @@ export default class bitfinex extends Exchange {
|
|
|
984
991
|
* @method
|
|
985
992
|
* @name bitfinex#fetchTrades
|
|
986
993
|
* @description get the list of most recent trades for a particular symbol
|
|
994
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-public-trades
|
|
987
995
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
988
996
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
989
997
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -1019,6 +1027,7 @@ export default class bitfinex extends Exchange {
|
|
|
1019
1027
|
* @method
|
|
1020
1028
|
* @name bitfinex#fetchMyTrades
|
|
1021
1029
|
* @description fetch all trades made by the user
|
|
1030
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-past-trades
|
|
1022
1031
|
* @param {string} symbol unified market symbol
|
|
1023
1032
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1024
1033
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -1047,6 +1056,7 @@ export default class bitfinex extends Exchange {
|
|
|
1047
1056
|
* @method
|
|
1048
1057
|
* @name bitfinex#createOrder
|
|
1049
1058
|
* @description create a trade order
|
|
1059
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-new-order
|
|
1050
1060
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
1051
1061
|
* @param {string} type 'market' or 'limit'
|
|
1052
1062
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -1114,6 +1124,7 @@ export default class bitfinex extends Exchange {
|
|
|
1114
1124
|
* @method
|
|
1115
1125
|
* @name bitfinex#cancelOrder
|
|
1116
1126
|
* @description cancels an open order
|
|
1127
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-order
|
|
1117
1128
|
* @param {string} id order id
|
|
1118
1129
|
* @param {string} symbol not used by bitfinex cancelOrder ()
|
|
1119
1130
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1130,6 +1141,7 @@ export default class bitfinex extends Exchange {
|
|
|
1130
1141
|
* @method
|
|
1131
1142
|
* @name bitfinex#cancelAllOrders
|
|
1132
1143
|
* @description cancel all open orders
|
|
1144
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-all-orders
|
|
1133
1145
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
1134
1146
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1135
1147
|
* @returns {object} response from exchange
|
|
@@ -1214,6 +1226,7 @@ export default class bitfinex extends Exchange {
|
|
|
1214
1226
|
* @method
|
|
1215
1227
|
* @name bitfinex#fetchOpenOrders
|
|
1216
1228
|
* @description fetch all unfilled currently open orders
|
|
1229
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-active-orders
|
|
1217
1230
|
* @param {string} symbol unified market symbol
|
|
1218
1231
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1219
1232
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -1238,6 +1251,7 @@ export default class bitfinex extends Exchange {
|
|
|
1238
1251
|
* @method
|
|
1239
1252
|
* @name bitfinex#fetchClosedOrders
|
|
1240
1253
|
* @description fetches information on multiple closed orders made by the user
|
|
1254
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-orders-history
|
|
1241
1255
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1242
1256
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1243
1257
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -1263,6 +1277,7 @@ export default class bitfinex extends Exchange {
|
|
|
1263
1277
|
* @method
|
|
1264
1278
|
* @name bitfinex#fetchOrder
|
|
1265
1279
|
* @description fetches information on an order made by the user
|
|
1280
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-order-status
|
|
1266
1281
|
* @param {string} symbol not used by bitfinex fetchOrder
|
|
1267
1282
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1268
1283
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -1299,6 +1314,7 @@ export default class bitfinex extends Exchange {
|
|
|
1299
1314
|
* @method
|
|
1300
1315
|
* @name bitfinex#fetchOHLCV
|
|
1301
1316
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1317
|
+
* @see https://docs.bitfinex.com/reference/rest-public-candles#aggregate-funding-currency-candles
|
|
1302
1318
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1303
1319
|
* @param {string} timeframe the length of time each candle represents
|
|
1304
1320
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -1343,6 +1359,7 @@ export default class bitfinex extends Exchange {
|
|
|
1343
1359
|
* @method
|
|
1344
1360
|
* @name bitfinex#createDepositAddress
|
|
1345
1361
|
* @description create a currency deposit address
|
|
1362
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit
|
|
1346
1363
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
1347
1364
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1348
1365
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -1358,6 +1375,7 @@ export default class bitfinex extends Exchange {
|
|
|
1358
1375
|
* @method
|
|
1359
1376
|
* @name bitfinex#fetchDepositAddress
|
|
1360
1377
|
* @description fetch the deposit address for a currency associated with this account
|
|
1378
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit
|
|
1361
1379
|
* @param {string} code unified currency code
|
|
1362
1380
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1363
1381
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -1391,6 +1409,7 @@ export default class bitfinex extends Exchange {
|
|
|
1391
1409
|
* @method
|
|
1392
1410
|
* @name bitfinex#fetchDepositsWithdrawals
|
|
1393
1411
|
* @description fetch history of deposits and withdrawals
|
|
1412
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit-withdrawal-history
|
|
1394
1413
|
* @param {string} code unified currency code for the currency of the deposit/withdrawals
|
|
1395
1414
|
* @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
|
|
1396
1415
|
* @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
|
|
@@ -1527,6 +1546,7 @@ export default class bitfinex extends Exchange {
|
|
|
1527
1546
|
* @method
|
|
1528
1547
|
* @name bitfinex#withdraw
|
|
1529
1548
|
* @description make a withdrawal
|
|
1549
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-withdrawal
|
|
1530
1550
|
* @param {string} code unified currency code
|
|
1531
1551
|
* @param {float} amount the amount to withdraw
|
|
1532
1552
|
* @param {string} address the address to withdraw to
|
|
@@ -1577,6 +1597,7 @@ export default class bitfinex extends Exchange {
|
|
|
1577
1597
|
* @method
|
|
1578
1598
|
* @name bitfinex#fetchPositions
|
|
1579
1599
|
* @description fetch all open positions
|
|
1600
|
+
* @see https://docs.bitfinex.com/v1/reference/rest-auth-active-positions
|
|
1580
1601
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
1581
1602
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1582
1603
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
package/js/src/bitfinex2.js
CHANGED
|
@@ -28,11 +28,13 @@ export default class bitfinex2 extends Exchange {
|
|
|
28
28
|
'has': {
|
|
29
29
|
'CORS': undefined,
|
|
30
30
|
'spot': true,
|
|
31
|
-
'margin':
|
|
31
|
+
'margin': true,
|
|
32
32
|
'swap': true,
|
|
33
33
|
'future': undefined,
|
|
34
34
|
'option': undefined,
|
|
35
35
|
'addMargin': false,
|
|
36
|
+
'borrowCrossMargin': false,
|
|
37
|
+
'borrowIsolatedMargin': false,
|
|
36
38
|
'cancelAllOrders': true,
|
|
37
39
|
'cancelOrder': true,
|
|
38
40
|
'cancelOrders': true,
|
|
@@ -49,8 +51,13 @@ export default class bitfinex2 extends Exchange {
|
|
|
49
51
|
'createTriggerOrder': true,
|
|
50
52
|
'editOrder': true,
|
|
51
53
|
'fetchBalance': true,
|
|
54
|
+
'fetchBorrowInterest': false,
|
|
55
|
+
'fetchBorrowRateHistories': false,
|
|
56
|
+
'fetchBorrowRateHistory': false,
|
|
52
57
|
'fetchClosedOrder': true,
|
|
53
58
|
'fetchClosedOrders': true,
|
|
59
|
+
'fetchCrossBorrowRate': false,
|
|
60
|
+
'fetchCrossBorrowRates': false,
|
|
54
61
|
'fetchCurrencies': true,
|
|
55
62
|
'fetchDepositAddress': true,
|
|
56
63
|
'fetchDepositsWithdrawals': true,
|
|
@@ -59,6 +66,8 @@ export default class bitfinex2 extends Exchange {
|
|
|
59
66
|
'fetchFundingRateHistory': true,
|
|
60
67
|
'fetchFundingRates': true,
|
|
61
68
|
'fetchIndexOHLCV': false,
|
|
69
|
+
'fetchIsolatedBorrowRate': false,
|
|
70
|
+
'fetchIsolatedBorrowRates': false,
|
|
62
71
|
'fetchLedger': true,
|
|
63
72
|
'fetchLeverage': false,
|
|
64
73
|
'fetchLeverageTiers': false,
|
|
@@ -86,6 +95,8 @@ export default class bitfinex2 extends Exchange {
|
|
|
86
95
|
'fetchTransactionFees': undefined,
|
|
87
96
|
'fetchTransactions': 'emulated',
|
|
88
97
|
'reduceMargin': false,
|
|
98
|
+
'repayCrossMargin': false,
|
|
99
|
+
'repayIsolatedMargin': false,
|
|
89
100
|
'setLeverage': false,
|
|
90
101
|
'setMargin': true,
|
|
91
102
|
'setMarginMode': false,
|
package/js/src/bitget.js
CHANGED
|
@@ -3276,6 +3276,7 @@ export default class bitget extends Exchange {
|
|
|
3276
3276
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3277
3277
|
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
3278
3278
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
3279
|
+
* @param {string} [params.price] *swap only* "mark" (to fetch mark price candles) or "index" (to fetch index price candles)
|
|
3279
3280
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
3280
3281
|
*/
|
|
3281
3282
|
await this.loadMarkets();
|
|
@@ -3305,68 +3306,56 @@ export default class bitget extends Exchange {
|
|
|
3305
3306
|
if (limit !== undefined) {
|
|
3306
3307
|
request['limit'] = limit;
|
|
3307
3308
|
}
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
if (since !== undefined) {
|
|
3315
|
-
request['startTime'] = since;
|
|
3316
|
-
}
|
|
3317
|
-
if (until !== undefined) {
|
|
3318
|
-
request['endTime'] = until;
|
|
3309
|
+
if (since !== undefined) {
|
|
3310
|
+
request['startTime'] = since;
|
|
3311
|
+
}
|
|
3312
|
+
if (since !== undefined) {
|
|
3313
|
+
if (limit === undefined) {
|
|
3314
|
+
limit = 100; // exchange default
|
|
3319
3315
|
}
|
|
3316
|
+
const duration = this.parseTimeframe(timeframe) * 1000;
|
|
3317
|
+
request['endTime'] = this.sum(since, duration * (limit + 1)) - 1; // limit + 1)) - 1 is needed for when since is not the exact timestamp of a candle
|
|
3318
|
+
}
|
|
3319
|
+
else if (until !== undefined) {
|
|
3320
|
+
request['endTime'] = until;
|
|
3321
|
+
}
|
|
3322
|
+
else {
|
|
3323
|
+
request['endTime'] = this.milliseconds();
|
|
3320
3324
|
}
|
|
3321
3325
|
let response = undefined;
|
|
3326
|
+
const thirtyOneDaysAgo = this.milliseconds() - 2678400000;
|
|
3322
3327
|
if (market['spot']) {
|
|
3323
|
-
if (
|
|
3324
|
-
response = await this.publicSpotGetV2SpotMarketCandles(this.extend(request, params));
|
|
3325
|
-
}
|
|
3326
|
-
else if (method === 'publicSpotGetV2SpotMarketHistoryCandles') {
|
|
3327
|
-
if (since !== undefined) {
|
|
3328
|
-
if (limit === undefined) {
|
|
3329
|
-
limit = 100; // exchange default
|
|
3330
|
-
}
|
|
3331
|
-
const duration = this.parseTimeframe(timeframe) * 1000;
|
|
3332
|
-
request['endTime'] = this.sum(since, duration * limit);
|
|
3333
|
-
}
|
|
3334
|
-
else if (until !== undefined) {
|
|
3335
|
-
request['endTime'] = until;
|
|
3336
|
-
}
|
|
3337
|
-
else {
|
|
3338
|
-
request['endTime'] = this.milliseconds();
|
|
3339
|
-
}
|
|
3328
|
+
if ((since !== undefined) && (since < thirtyOneDaysAgo)) {
|
|
3340
3329
|
response = await this.publicSpotGetV2SpotMarketHistoryCandles(this.extend(request, params));
|
|
3341
3330
|
}
|
|
3331
|
+
else {
|
|
3332
|
+
response = await this.publicSpotGetV2SpotMarketCandles(this.extend(request, params));
|
|
3333
|
+
}
|
|
3342
3334
|
}
|
|
3343
3335
|
else {
|
|
3344
|
-
const swapOptions = this.safeValue(options, 'swap', {});
|
|
3345
|
-
const defaultSwapMethod = this.safeString(swapOptions, 'method', 'publicMixGetV2MixMarketCandles');
|
|
3346
|
-
const swapMethod = this.safeString(params, 'method', defaultSwapMethod);
|
|
3347
3336
|
const priceType = this.safeString(params, 'price');
|
|
3348
|
-
params = this.omit(params, ['
|
|
3337
|
+
params = this.omit(params, ['price']);
|
|
3349
3338
|
let productType = undefined;
|
|
3350
3339
|
[productType, params] = this.handleProductTypeAndParams(market, params);
|
|
3351
3340
|
request['productType'] = productType;
|
|
3352
|
-
if (
|
|
3341
|
+
if (priceType === 'mark') {
|
|
3353
3342
|
response = await this.publicMixGetV2MixMarketHistoryMarkCandles(this.extend(request, params));
|
|
3354
3343
|
}
|
|
3355
|
-
else if (
|
|
3344
|
+
else if (priceType === 'index') {
|
|
3356
3345
|
response = await this.publicMixGetV2MixMarketHistoryIndexCandles(this.extend(request, params));
|
|
3357
3346
|
}
|
|
3358
|
-
else if (
|
|
3359
|
-
response = await this.publicMixGetV2MixMarketCandles(this.extend(request, params));
|
|
3360
|
-
}
|
|
3361
|
-
else if (swapMethod === 'publicMixGetV2MixMarketHistoryCandles') {
|
|
3347
|
+
else if ((since !== undefined) && (since < thirtyOneDaysAgo)) {
|
|
3362
3348
|
response = await this.publicMixGetV2MixMarketHistoryCandles(this.extend(request, params));
|
|
3363
3349
|
}
|
|
3350
|
+
else {
|
|
3351
|
+
response = await this.publicMixGetV2MixMarketCandles(this.extend(request, params));
|
|
3352
|
+
}
|
|
3364
3353
|
}
|
|
3365
3354
|
if (response === '') {
|
|
3366
3355
|
return []; // happens when a new token is listed
|
|
3367
3356
|
}
|
|
3368
3357
|
// [ ["1645911960000","39406","39407","39374.5","39379","35.526","1399132.341"] ]
|
|
3369
|
-
const data = this.
|
|
3358
|
+
const data = this.safeList(response, 'data', response);
|
|
3370
3359
|
return this.parseOHLCVs(data, market, timeframe, since, limit);
|
|
3371
3360
|
}
|
|
3372
3361
|
async fetchBalance(params = {}) {
|
package/js/src/bithumb.js
CHANGED
|
@@ -191,6 +191,7 @@ export default class bithumb extends Exchange {
|
|
|
191
191
|
* @method
|
|
192
192
|
* @name bithumb#fetchMarkets
|
|
193
193
|
* @description retrieves data on all markets for bithumb
|
|
194
|
+
* @see https://apidocs.bithumb.com/reference/%ED%98%84%EC%9E%AC%EA%B0%80-%EC%A0%95%EB%B3%B4-%EC%A1%B0%ED%9A%8C-all
|
|
194
195
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
195
196
|
* @returns {object[]} an array of objects representing market data
|
|
196
197
|
*/
|
|
@@ -293,6 +294,7 @@ export default class bithumb extends Exchange {
|
|
|
293
294
|
* @method
|
|
294
295
|
* @name bithumb#fetchBalance
|
|
295
296
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
297
|
+
* @see https://apidocs.bithumb.com/reference/%EB%B3%B4%EC%9C%A0%EC%9E%90%EC%82%B0-%EC%A1%B0%ED%9A%8C
|
|
296
298
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
297
299
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
298
300
|
*/
|
|
@@ -308,6 +310,7 @@ export default class bithumb extends Exchange {
|
|
|
308
310
|
* @method
|
|
309
311
|
* @name bithumb#fetchOrderBook
|
|
310
312
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
313
|
+
* @see https://apidocs.bithumb.com/reference/%ED%98%B8%EA%B0%80-%EC%A0%95%EB%B3%B4-%EC%A1%B0%ED%9A%8C
|
|
311
314
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
312
315
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
313
316
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -400,6 +403,7 @@ export default class bithumb extends Exchange {
|
|
|
400
403
|
* @method
|
|
401
404
|
* @name bithumb#fetchTickers
|
|
402
405
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
406
|
+
* @see https://apidocs.bithumb.com/reference/%ED%98%84%EC%9E%AC%EA%B0%80-%EC%A0%95%EB%B3%B4-%EC%A1%B0%ED%9A%8C-all
|
|
403
407
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
404
408
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
405
409
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -457,6 +461,7 @@ export default class bithumb extends Exchange {
|
|
|
457
461
|
* @method
|
|
458
462
|
* @name bithumb#fetchTicker
|
|
459
463
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
464
|
+
* @see https://apidocs.bithumb.com/reference/%ED%98%84%EC%9E%AC%EA%B0%80-%EC%A0%95%EB%B3%B4-%EC%A1%B0%ED%9A%8C
|
|
460
465
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
461
466
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
462
467
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -515,6 +520,7 @@ export default class bithumb extends Exchange {
|
|
|
515
520
|
* @method
|
|
516
521
|
* @name bithumb#fetchOHLCV
|
|
517
522
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
523
|
+
* @see https://apidocs.bithumb.com/reference/candlestick-rest-api
|
|
518
524
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
519
525
|
* @param {string} timeframe the length of time each candle represents
|
|
520
526
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -639,6 +645,7 @@ export default class bithumb extends Exchange {
|
|
|
639
645
|
* @method
|
|
640
646
|
* @name bithumb#fetchTrades
|
|
641
647
|
* @description get the list of most recent trades for a particular symbol
|
|
648
|
+
* @see https://apidocs.bithumb.com/reference/%EC%B5%9C%EA%B7%BC-%EC%B2%B4%EA%B2%B0-%EB%82%B4%EC%97%AD
|
|
642
649
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
643
650
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
644
651
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -677,6 +684,9 @@ export default class bithumb extends Exchange {
|
|
|
677
684
|
* @method
|
|
678
685
|
* @name bithumb#createOrder
|
|
679
686
|
* @description create a trade order
|
|
687
|
+
* @see https://apidocs.bithumb.com/reference/%EC%A7%80%EC%A0%95%EA%B0%80-%EC%A3%BC%EB%AC%B8%ED%95%98%EA%B8%B0
|
|
688
|
+
* @see https://apidocs.bithumb.com/reference/%EC%8B%9C%EC%9E%A5%EA%B0%80-%EB%A7%A4%EC%88%98%ED%95%98%EA%B8%B0
|
|
689
|
+
* @see https://apidocs.bithumb.com/reference/%EC%8B%9C%EC%9E%A5%EA%B0%80-%EB%A7%A4%EB%8F%84%ED%95%98%EA%B8%B0
|
|
680
690
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
681
691
|
* @param {string} type 'market' or 'limit'
|
|
682
692
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -718,6 +728,7 @@ export default class bithumb extends Exchange {
|
|
|
718
728
|
* @method
|
|
719
729
|
* @name bithumb#fetchOrder
|
|
720
730
|
* @description fetches information on an order made by the user
|
|
731
|
+
* @see https://apidocs.bithumb.com/reference/%EA%B1%B0%EB%9E%98-%EC%A3%BC%EB%AC%B8%EB%82%B4%EC%97%AD-%EC%83%81%EC%84%B8-%EC%A1%B0%ED%9A%8C
|
|
721
732
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
722
733
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
723
734
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -876,6 +887,7 @@ export default class bithumb extends Exchange {
|
|
|
876
887
|
* @method
|
|
877
888
|
* @name bithumb#fetchOpenOrders
|
|
878
889
|
* @description fetch all unfilled currently open orders
|
|
890
|
+
* @see https://apidocs.bithumb.com/reference/%EA%B1%B0%EB%9E%98-%EC%A3%BC%EB%AC%B8%EB%82%B4%EC%97%AD-%EC%A1%B0%ED%9A%8C
|
|
879
891
|
* @param {string} symbol unified market symbol
|
|
880
892
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
881
893
|
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
@@ -924,6 +936,7 @@ export default class bithumb extends Exchange {
|
|
|
924
936
|
* @method
|
|
925
937
|
* @name bithumb#cancelOrder
|
|
926
938
|
* @description cancels an open order
|
|
939
|
+
* @see https://apidocs.bithumb.com/reference/%EC%A3%BC%EB%AC%B8-%EC%B7%A8%EC%86%8C%ED%95%98%EA%B8%B0
|
|
927
940
|
* @param {string} id order id
|
|
928
941
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
929
942
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -959,6 +972,7 @@ export default class bithumb extends Exchange {
|
|
|
959
972
|
* @method
|
|
960
973
|
* @name bithumb#withdraw
|
|
961
974
|
* @description make a withdrawal
|
|
975
|
+
* @see https://apidocs.bithumb.com/reference/%EC%BD%94%EC%9D%B8-%EC%B6%9C%EA%B8%88%ED%95%98%EA%B8%B0-%EA%B0%9C%EC%9D%B8
|
|
962
976
|
* @param {string} code unified currency code
|
|
963
977
|
* @param {float} amount the amount to withdraw
|
|
964
978
|
* @param {string} address the address to withdraw to
|
package/js/src/krakenfutures.js
CHANGED
|
@@ -154,10 +154,32 @@ export default class krakenfutures extends Exchange {
|
|
|
154
154
|
},
|
|
155
155
|
'fees': {
|
|
156
156
|
'trading': {
|
|
157
|
-
'tierBased':
|
|
157
|
+
'tierBased': true,
|
|
158
158
|
'percentage': true,
|
|
159
|
-
'
|
|
160
|
-
'
|
|
159
|
+
'taker': this.parseNumber('0.0005'),
|
|
160
|
+
'maker': this.parseNumber('0.0002'),
|
|
161
|
+
'tiers': {
|
|
162
|
+
'taker': [
|
|
163
|
+
[this.parseNumber('0'), this.parseNumber('0.0005')],
|
|
164
|
+
[this.parseNumber('100000'), this.parseNumber('0.0004')],
|
|
165
|
+
[this.parseNumber('1000000'), this.parseNumber('0.0003')],
|
|
166
|
+
[this.parseNumber('5000000'), this.parseNumber('0.00025')],
|
|
167
|
+
[this.parseNumber('10000000'), this.parseNumber('0.0002')],
|
|
168
|
+
[this.parseNumber('20000000'), this.parseNumber('0.00015')],
|
|
169
|
+
[this.parseNumber('50000000'), this.parseNumber('0.000125')],
|
|
170
|
+
[this.parseNumber('100000000'), this.parseNumber('0.0001')],
|
|
171
|
+
],
|
|
172
|
+
'maker': [
|
|
173
|
+
[this.parseNumber('0'), this.parseNumber('0.0002')],
|
|
174
|
+
[this.parseNumber('100000'), this.parseNumber('0.0015')],
|
|
175
|
+
[this.parseNumber('1000000'), this.parseNumber('0.000125')],
|
|
176
|
+
[this.parseNumber('5000000'), this.parseNumber('0.0001')],
|
|
177
|
+
[this.parseNumber('10000000'), this.parseNumber('0.000075')],
|
|
178
|
+
[this.parseNumber('20000000'), this.parseNumber('0.00005')],
|
|
179
|
+
[this.parseNumber('50000000'), this.parseNumber('0.000025')],
|
|
180
|
+
[this.parseNumber('100000000'), this.parseNumber('0')],
|
|
181
|
+
],
|
|
182
|
+
},
|
|
161
183
|
},
|
|
162
184
|
},
|
|
163
185
|
'exceptions': {
|
package/js/src/pro/binance.js
CHANGED
|
@@ -54,8 +54,8 @@ export default class binance extends binanceRest {
|
|
|
54
54
|
},
|
|
55
55
|
'api': {
|
|
56
56
|
'ws': {
|
|
57
|
-
'spot': 'wss://stream.binance.com/ws',
|
|
58
|
-
'margin': 'wss://stream.binance.com/ws',
|
|
57
|
+
'spot': 'wss://stream.binance.com:9443/ws',
|
|
58
|
+
'margin': 'wss://stream.binance.com:9443/ws',
|
|
59
59
|
'future': 'wss://fstream.binance.com/ws',
|
|
60
60
|
'delivery': 'wss://dstream.binance.com/ws',
|
|
61
61
|
'ws': 'wss://ws-api.binance.com:443/ws-api/v3',
|
|
@@ -2442,7 +2442,7 @@ export default class binance extends binanceRest {
|
|
|
2442
2442
|
return this.safePosition({
|
|
2443
2443
|
'info': position,
|
|
2444
2444
|
'id': undefined,
|
|
2445
|
-
'symbol': this.safeSymbol(marketId, undefined, undefined, '
|
|
2445
|
+
'symbol': this.safeSymbol(marketId, undefined, undefined, 'contract'),
|
|
2446
2446
|
'notional': undefined,
|
|
2447
2447
|
'marginMode': this.safeString(position, 'mt'),
|
|
2448
2448
|
'liquidationPrice': undefined,
|
|
@@ -2596,9 +2596,9 @@ export default class binance extends binanceRest {
|
|
|
2596
2596
|
const messageHash = 'myTrades';
|
|
2597
2597
|
const executionType = this.safeString(message, 'x');
|
|
2598
2598
|
if (executionType === 'TRADE') {
|
|
2599
|
-
const trade = this.
|
|
2599
|
+
const trade = this.parseWsTrade(message);
|
|
2600
2600
|
const orderId = this.safeString(trade, 'order');
|
|
2601
|
-
let tradeFee = this.safeValue(trade, 'fee');
|
|
2601
|
+
let tradeFee = this.safeValue(trade, 'fee', {});
|
|
2602
2602
|
tradeFee = this.extend({}, tradeFee);
|
|
2603
2603
|
const symbol = this.safeString(trade, 'symbol');
|
|
2604
2604
|
if (orderId !== undefined && tradeFee !== undefined && symbol !== undefined) {
|
package/js/src/woo.js
CHANGED
|
@@ -1546,11 +1546,12 @@ export default class woo extends Exchange {
|
|
|
1546
1546
|
* @method
|
|
1547
1547
|
* @name woo#fetchOHLCV
|
|
1548
1548
|
* @see https://docs.woo.org/#kline-public
|
|
1549
|
+
* @see https://docs.woo.org/#kline-historical-data-public
|
|
1549
1550
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1550
1551
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1551
1552
|
* @param {string} timeframe the length of time each candle represents
|
|
1552
1553
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
1553
|
-
* @param {int} [limit]
|
|
1554
|
+
* @param {int} [limit] max=1000, max=100 when since is defined and is less than (now - (999 * (timeframe in ms)))
|
|
1554
1555
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1555
1556
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
1556
1557
|
*/
|
|
@@ -1560,42 +1561,70 @@ export default class woo extends Exchange {
|
|
|
1560
1561
|
'symbol': market['id'],
|
|
1561
1562
|
'type': this.safeString(this.timeframes, timeframe, timeframe),
|
|
1562
1563
|
};
|
|
1563
|
-
|
|
1564
|
+
let useHistEndpoint = since !== undefined;
|
|
1565
|
+
if ((limit !== undefined) && (since !== undefined)) {
|
|
1566
|
+
const oneThousandCandles = this.parseTimeframe(timeframe) * 1000 * 999; // 999 because there will be delay between this and the request, causing the latest candle to be excluded sometimes
|
|
1567
|
+
const startWithLimit = this.milliseconds() - oneThousandCandles;
|
|
1568
|
+
useHistEndpoint = since < startWithLimit;
|
|
1569
|
+
}
|
|
1570
|
+
if (useHistEndpoint) {
|
|
1571
|
+
request['start_time'] = since;
|
|
1572
|
+
}
|
|
1573
|
+
else if (limit !== undefined) { // the hist endpoint does not accept limit
|
|
1564
1574
|
request['limit'] = Math.min(limit, 1000);
|
|
1565
1575
|
}
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1576
|
+
let response = undefined;
|
|
1577
|
+
if (!useHistEndpoint) {
|
|
1578
|
+
response = await this.v1PublicGetKline(this.extend(request, params));
|
|
1579
|
+
//
|
|
1580
|
+
// {
|
|
1581
|
+
// "success": true,
|
|
1582
|
+
// "rows": [
|
|
1583
|
+
// {
|
|
1584
|
+
// "open": "0.94238",
|
|
1585
|
+
// "close": "0.94271",
|
|
1586
|
+
// "low": "0.94238",
|
|
1587
|
+
// "high": "0.94296",
|
|
1588
|
+
// "volume": "73.55",
|
|
1589
|
+
// "amount": "69.32040520",
|
|
1590
|
+
// "symbol": "SPOT_WOO_USDT",
|
|
1591
|
+
// "type": "1m",
|
|
1592
|
+
// "start_timestamp": "1641584700000",
|
|
1593
|
+
// "end_timestamp": "1641584760000"
|
|
1594
|
+
// },
|
|
1595
|
+
// ...
|
|
1596
|
+
// ]
|
|
1597
|
+
// }
|
|
1598
|
+
//
|
|
1599
|
+
}
|
|
1600
|
+
else {
|
|
1601
|
+
response = await this.v1PubGetHistKline(this.extend(request, params));
|
|
1602
|
+
response = this.safeDict(response, 'data');
|
|
1603
|
+
//
|
|
1604
|
+
// {
|
|
1605
|
+
// "success": true,
|
|
1606
|
+
// "data": {
|
|
1607
|
+
// "rows": [
|
|
1608
|
+
// {
|
|
1609
|
+
// "symbol": "SPOT_BTC_USDT",
|
|
1610
|
+
// "open": 44181.40000000,
|
|
1611
|
+
// "close": 44174.29000000,
|
|
1612
|
+
// "high": 44193.44000000,
|
|
1613
|
+
// "low": 44148.34000000,
|
|
1614
|
+
// "volume": 110.11930100,
|
|
1615
|
+
// "amount": 4863796.24318878,
|
|
1616
|
+
// "type": "1m",
|
|
1617
|
+
// "start_timestamp": 1704153600000,
|
|
1618
|
+
// "end_timestamp": 1704153660000
|
|
1619
|
+
// },
|
|
1620
|
+
// ...
|
|
1621
|
+
// ]
|
|
1622
|
+
// }
|
|
1623
|
+
// }
|
|
1624
|
+
//
|
|
1625
|
+
}
|
|
1626
|
+
const rows = this.safeValue(response, 'rows', []);
|
|
1627
|
+
return this.parseOHLCVs(rows, market, timeframe, since, limit);
|
|
1599
1628
|
}
|
|
1600
1629
|
parseOHLCV(ohlcv, market = undefined) {
|
|
1601
1630
|
// example response in fetchOHLCV
|
package/package.json
CHANGED