ccxt 4.2.46 → 4.2.47
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/CHANGELOG.md +2307 -0
- package/README.md +3 -3
- package/change.sh +1 -1
- package/dist/ccxt.browser.js +444 -7
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/bybit.js +185 -2
- package/dist/cjs/src/coinsph.js +32 -1
- package/dist/cjs/src/currencycom.js +22 -0
- package/dist/cjs/src/deribit.js +34 -1
- package/dist/cjs/src/exmo.js +22 -0
- package/dist/cjs/src/gemini.js +15 -0
- package/dist/cjs/src/hollaex.js +27 -1
- package/dist/cjs/src/indodax.js +106 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/hollaex.d.ts +3 -0
- package/js/src/bybit.d.ts +2 -0
- package/js/src/bybit.js +185 -2
- package/js/src/coinsph.js +32 -1
- package/js/src/currencycom.js +22 -0
- package/js/src/deribit.js +34 -1
- package/js/src/exmo.js +22 -0
- package/js/src/gemini.js +15 -0
- package/js/src/hollaex.js +27 -1
- package/js/src/indodax.d.ts +3 -0
- package/js/src/indodax.js +106 -1
- package/package.json +1 -1
- package/skip-tests.json +1 -1
package/dist/cjs/src/hollaex.js
CHANGED
|
@@ -134,6 +134,9 @@ class hollaex extends hollaex$1 {
|
|
|
134
134
|
'trades': 1,
|
|
135
135
|
'chart': 1,
|
|
136
136
|
'charts': 1,
|
|
137
|
+
'minicharts': 1,
|
|
138
|
+
'oracle/prices': 1,
|
|
139
|
+
'quick-trade': 1,
|
|
137
140
|
// TradingView
|
|
138
141
|
'udf/config': 1,
|
|
139
142
|
'udf/history': 1,
|
|
@@ -209,6 +212,7 @@ class hollaex extends hollaex$1 {
|
|
|
209
212
|
* @method
|
|
210
213
|
* @name hollaex#fetchMarkets
|
|
211
214
|
* @description retrieves data on all markets for hollaex
|
|
215
|
+
* @see https://apidocs.hollaex.com/#constants
|
|
212
216
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
213
217
|
* @returns {object[]} an array of objects representing market data
|
|
214
218
|
*/
|
|
@@ -411,6 +415,7 @@ class hollaex extends hollaex$1 {
|
|
|
411
415
|
* @method
|
|
412
416
|
* @name hollaex#fetchOrderBooks
|
|
413
417
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data for multiple markets
|
|
418
|
+
* @see https://apidocs.hollaex.com/#orderbooks
|
|
414
419
|
* @param {string[]|undefined} symbols not used by hollaex fetchOrderBooks ()
|
|
415
420
|
* @param {int} [limit] not used by hollaex fetchOrderBooks ()
|
|
416
421
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -434,6 +439,7 @@ class hollaex extends hollaex$1 {
|
|
|
434
439
|
* @method
|
|
435
440
|
* @name hollaex#fetchOrderBook
|
|
436
441
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
442
|
+
* @see https://apidocs.hollaex.com/#orderbook
|
|
437
443
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
438
444
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
439
445
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -444,7 +450,7 @@ class hollaex extends hollaex$1 {
|
|
|
444
450
|
const request = {
|
|
445
451
|
'symbol': market['id'],
|
|
446
452
|
};
|
|
447
|
-
const response = await this.
|
|
453
|
+
const response = await this.publicGetOrderbook(this.extend(request, params));
|
|
448
454
|
//
|
|
449
455
|
// {
|
|
450
456
|
// "btc-usdt": {
|
|
@@ -473,6 +479,7 @@ class hollaex extends hollaex$1 {
|
|
|
473
479
|
* @method
|
|
474
480
|
* @name hollaex#fetchTicker
|
|
475
481
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
482
|
+
* @see https://apidocs.hollaex.com/#ticker
|
|
476
483
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
477
484
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
478
485
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -501,6 +508,7 @@ class hollaex extends hollaex$1 {
|
|
|
501
508
|
* @method
|
|
502
509
|
* @name hollaex#fetchTickers
|
|
503
510
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
511
|
+
* @see https://apidocs.hollaex.com/#tickers
|
|
504
512
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
505
513
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
506
514
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -598,6 +606,7 @@ class hollaex extends hollaex$1 {
|
|
|
598
606
|
* @method
|
|
599
607
|
* @name hollaex#fetchTrades
|
|
600
608
|
* @description get the list of most recent trades for a particular symbol
|
|
609
|
+
* @see https://apidocs.hollaex.com/#trades
|
|
601
610
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
602
611
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
603
612
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -686,6 +695,7 @@ class hollaex extends hollaex$1 {
|
|
|
686
695
|
* @method
|
|
687
696
|
* @name hollaex#fetchTradingFees
|
|
688
697
|
* @description fetch the trading fees for multiple markets
|
|
698
|
+
* @see https://apidocs.hollaex.com/#tiers
|
|
689
699
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
690
700
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
691
701
|
*/
|
|
@@ -745,6 +755,7 @@ class hollaex extends hollaex$1 {
|
|
|
745
755
|
* @method
|
|
746
756
|
* @name hollaex#fetchOHLCV
|
|
747
757
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
758
|
+
* @see https://apidocs.hollaex.com/#chart
|
|
748
759
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
749
760
|
* @param {string} timeframe the length of time each candle represents
|
|
750
761
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -839,6 +850,7 @@ class hollaex extends hollaex$1 {
|
|
|
839
850
|
* @method
|
|
840
851
|
* @name hollaex#fetchBalance
|
|
841
852
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
853
|
+
* @see https://apidocs.hollaex.com/#get-balance
|
|
842
854
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
843
855
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
844
856
|
*/
|
|
@@ -863,6 +875,7 @@ class hollaex extends hollaex$1 {
|
|
|
863
875
|
* @method
|
|
864
876
|
* @name hollaex#fetchOpenOrder
|
|
865
877
|
* @description fetch an open order by it's id
|
|
878
|
+
* @see https://apidocs.hollaex.com/#get-order
|
|
866
879
|
* @param {string} id order id
|
|
867
880
|
* @param {string} symbol not used by hollaex fetchOpenOrder ()
|
|
868
881
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -904,6 +917,7 @@ class hollaex extends hollaex$1 {
|
|
|
904
917
|
* @method
|
|
905
918
|
* @name hollaex#fetchOpenOrders
|
|
906
919
|
* @description fetch all unfilled currently open orders
|
|
920
|
+
* @see https://apidocs.hollaex.com/#get-all-orders
|
|
907
921
|
* @param {string} symbol unified market symbol
|
|
908
922
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
909
923
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -920,6 +934,7 @@ class hollaex extends hollaex$1 {
|
|
|
920
934
|
* @method
|
|
921
935
|
* @name hollaex#fetchClosedOrders
|
|
922
936
|
* @description fetches information on multiple closed orders made by the user
|
|
937
|
+
* @see https://apidocs.hollaex.com/#get-all-orders
|
|
923
938
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
924
939
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
925
940
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -936,6 +951,7 @@ class hollaex extends hollaex$1 {
|
|
|
936
951
|
* @method
|
|
937
952
|
* @name hollaex#fetchOrder
|
|
938
953
|
* @description fetches information on an order made by the user
|
|
954
|
+
* @see https://apidocs.hollaex.com/#get-order
|
|
939
955
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
940
956
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
941
957
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -978,6 +994,7 @@ class hollaex extends hollaex$1 {
|
|
|
978
994
|
* @method
|
|
979
995
|
* @name hollaex#fetchOrders
|
|
980
996
|
* @description fetches information on multiple orders made by the user
|
|
997
|
+
* @see https://apidocs.hollaex.com/#get-all-orders
|
|
981
998
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
982
999
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
983
1000
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -1122,6 +1139,7 @@ class hollaex extends hollaex$1 {
|
|
|
1122
1139
|
* @method
|
|
1123
1140
|
* @name hollaex#createOrder
|
|
1124
1141
|
* @description create a trade order
|
|
1142
|
+
* @see https://apidocs.hollaex.com/#create-order
|
|
1125
1143
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
1126
1144
|
* @param {string} type 'market' or 'limit'
|
|
1127
1145
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -1190,6 +1208,7 @@ class hollaex extends hollaex$1 {
|
|
|
1190
1208
|
* @method
|
|
1191
1209
|
* @name hollaex#cancelOrder
|
|
1192
1210
|
* @description cancels an open order
|
|
1211
|
+
* @see https://apidocs.hollaex.com/#cancel-order
|
|
1193
1212
|
* @param {string} id order id
|
|
1194
1213
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
1195
1214
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1220,6 +1239,7 @@ class hollaex extends hollaex$1 {
|
|
|
1220
1239
|
* @method
|
|
1221
1240
|
* @name hollaex#cancelAllOrders
|
|
1222
1241
|
* @description cancel all open orders in a market
|
|
1242
|
+
* @see https://apidocs.hollaex.com/#cancel-all-orders
|
|
1223
1243
|
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
1224
1244
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1225
1245
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -1255,6 +1275,7 @@ class hollaex extends hollaex$1 {
|
|
|
1255
1275
|
* @method
|
|
1256
1276
|
* @name hollaex#fetchMyTrades
|
|
1257
1277
|
* @description fetch all trades made by the user
|
|
1278
|
+
* @see https://apidocs.hollaex.com/#get-trades
|
|
1258
1279
|
* @param {string} symbol unified market symbol
|
|
1259
1280
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1260
1281
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -1336,6 +1357,7 @@ class hollaex extends hollaex$1 {
|
|
|
1336
1357
|
* @method
|
|
1337
1358
|
* @name hollaex#fetchDepositAddresses
|
|
1338
1359
|
* @description fetch deposit addresses for multiple currencies and chain types
|
|
1360
|
+
* @see https://apidocs.hollaex.com/#get-user
|
|
1339
1361
|
* @param {string[]|undefined} codes list of unified currency codes, default is undefined
|
|
1340
1362
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1341
1363
|
* @returns {object} a list of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -1398,6 +1420,7 @@ class hollaex extends hollaex$1 {
|
|
|
1398
1420
|
* @method
|
|
1399
1421
|
* @name hollaex#fetchDeposits
|
|
1400
1422
|
* @description fetch all deposits made to an account
|
|
1423
|
+
* @see https://apidocs.hollaex.com/#get-deposits
|
|
1401
1424
|
* @param {string} code unified currency code
|
|
1402
1425
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
1403
1426
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
@@ -1457,6 +1480,7 @@ class hollaex extends hollaex$1 {
|
|
|
1457
1480
|
* @method
|
|
1458
1481
|
* @name hollaex#fetchWithdrawal
|
|
1459
1482
|
* @description fetch data on a currency withdrawal via the withdrawal id
|
|
1483
|
+
* @see https://apidocs.hollaex.com/#get-withdrawals
|
|
1460
1484
|
* @param {string} id withdrawal id
|
|
1461
1485
|
* @param {string} code unified currency code of the currency withdrawn, default is undefined
|
|
1462
1486
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1504,6 +1528,7 @@ class hollaex extends hollaex$1 {
|
|
|
1504
1528
|
* @method
|
|
1505
1529
|
* @name hollaex#fetchWithdrawals
|
|
1506
1530
|
* @description fetch all withdrawals made from an account
|
|
1531
|
+
* @see https://apidocs.hollaex.com/#get-withdrawals
|
|
1507
1532
|
* @param {string} code unified currency code
|
|
1508
1533
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
1509
1534
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
@@ -1664,6 +1689,7 @@ class hollaex extends hollaex$1 {
|
|
|
1664
1689
|
* @method
|
|
1665
1690
|
* @name hollaex#withdraw
|
|
1666
1691
|
* @description make a withdrawal
|
|
1692
|
+
* @see https://apidocs.hollaex.com/#withdrawal
|
|
1667
1693
|
* @param {string} code unified currency code
|
|
1668
1694
|
* @param {float} amount the amount to withdraw
|
|
1669
1695
|
* @param {string} address the address to withdraw to
|
package/dist/cjs/src/indodax.js
CHANGED
|
@@ -46,6 +46,9 @@ class indodax extends indodax$1 {
|
|
|
46
46
|
'fetchCrossBorrowRate': false,
|
|
47
47
|
'fetchCrossBorrowRates': false,
|
|
48
48
|
'fetchDeposit': false,
|
|
49
|
+
'fetchDepositAddress': 'emulated',
|
|
50
|
+
'fetchDepositAddresses': true,
|
|
51
|
+
'fetchDepositAddressesByNetwork': false,
|
|
49
52
|
'fetchDeposits': false,
|
|
50
53
|
'fetchDepositsWithdrawals': true,
|
|
51
54
|
'fetchFundingHistory': false,
|
|
@@ -157,7 +160,25 @@ class indodax extends indodax$1 {
|
|
|
157
160
|
'options': {
|
|
158
161
|
'recvWindow': 5 * 1000,
|
|
159
162
|
'timeDifference': 0,
|
|
160
|
-
'adjustForTimeDifference': false,
|
|
163
|
+
'adjustForTimeDifference': false,
|
|
164
|
+
'networks': {
|
|
165
|
+
'XLM': 'Stellar Token',
|
|
166
|
+
'BSC': 'bep20',
|
|
167
|
+
'TRC20': 'trc20',
|
|
168
|
+
'MATIC': 'polygon',
|
|
169
|
+
// 'BEP2': 'bep2',
|
|
170
|
+
// 'ARB': 'arb',
|
|
171
|
+
// 'ERC20': 'erc20',
|
|
172
|
+
// 'KIP7': 'kip7',
|
|
173
|
+
// 'MAINNET': 'mainnet', // TODO: does mainnet just mean the default?
|
|
174
|
+
// 'OEP4': 'oep4',
|
|
175
|
+
// 'OP': 'op',
|
|
176
|
+
// 'SPL': 'spl',
|
|
177
|
+
// 'TRC10': 'trc10',
|
|
178
|
+
// 'ZRC2': 'zrc2'
|
|
179
|
+
// 'ETH': 'eth'
|
|
180
|
+
// 'BASE': 'base'
|
|
181
|
+
},
|
|
161
182
|
},
|
|
162
183
|
'commonCurrencies': {
|
|
163
184
|
'STR': 'XLM',
|
|
@@ -1016,6 +1037,90 @@ class indodax extends indodax$1 {
|
|
|
1016
1037
|
};
|
|
1017
1038
|
return this.safeString(statuses, status, status);
|
|
1018
1039
|
}
|
|
1040
|
+
async fetchDepositAddresses(codes = undefined, params = {}) {
|
|
1041
|
+
/**
|
|
1042
|
+
* @method
|
|
1043
|
+
* @name indodax#fetchDepositAddresses
|
|
1044
|
+
* @description fetch deposit addresses for multiple currencies and chain types
|
|
1045
|
+
* @param {string[]} [codes] list of unified currency codes, default is undefined
|
|
1046
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1047
|
+
* @returns {object} a list of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
1048
|
+
*/
|
|
1049
|
+
await this.loadMarkets();
|
|
1050
|
+
const response = await this.privatePostGetInfo(params);
|
|
1051
|
+
//
|
|
1052
|
+
// {
|
|
1053
|
+
// success: '1',
|
|
1054
|
+
// return: {
|
|
1055
|
+
// server_time: '1708031570',
|
|
1056
|
+
// balance: {
|
|
1057
|
+
// idr: '29952',
|
|
1058
|
+
// ...
|
|
1059
|
+
// },
|
|
1060
|
+
// balance_hold: {
|
|
1061
|
+
// idr: '0',
|
|
1062
|
+
// ...
|
|
1063
|
+
// },
|
|
1064
|
+
// address: {
|
|
1065
|
+
// btc: '1KMntgzvU7iTSgMBWc11nVuJjAyfW3qJyk',
|
|
1066
|
+
// ...
|
|
1067
|
+
// },
|
|
1068
|
+
// memo_is_required: {
|
|
1069
|
+
// btc: { mainnet: false },
|
|
1070
|
+
// ...
|
|
1071
|
+
// },
|
|
1072
|
+
// network: {
|
|
1073
|
+
// btc: 'mainnet',
|
|
1074
|
+
// ...
|
|
1075
|
+
// },
|
|
1076
|
+
// user_id: '276011',
|
|
1077
|
+
// name: '',
|
|
1078
|
+
// email: 'testbitcoincoid@mailforspam.com',
|
|
1079
|
+
// profile_picture: null,
|
|
1080
|
+
// verification_status: 'unverified',
|
|
1081
|
+
// gauth_enable: true,
|
|
1082
|
+
// withdraw_status: '0'
|
|
1083
|
+
// }
|
|
1084
|
+
// }
|
|
1085
|
+
//
|
|
1086
|
+
const data = this.safeDict(response, 'return');
|
|
1087
|
+
const addresses = this.safeDict(data, 'address', {});
|
|
1088
|
+
const networks = this.safeDict(data, 'network', {});
|
|
1089
|
+
const addressKeys = Object.keys(addresses);
|
|
1090
|
+
const result = {
|
|
1091
|
+
'info': data,
|
|
1092
|
+
};
|
|
1093
|
+
for (let i = 0; i < addressKeys.length; i++) {
|
|
1094
|
+
const marketId = addressKeys[i];
|
|
1095
|
+
const code = this.safeCurrencyCode(marketId);
|
|
1096
|
+
const address = this.safeString(addresses, marketId);
|
|
1097
|
+
if ((address !== undefined) && ((codes === undefined) || (this.inArray(code, codes)))) {
|
|
1098
|
+
this.checkAddress(address);
|
|
1099
|
+
let network = undefined;
|
|
1100
|
+
if (marketId in networks) {
|
|
1101
|
+
const networkId = this.safeString(networks, marketId);
|
|
1102
|
+
if (networkId.indexOf(',') >= 0) {
|
|
1103
|
+
network = [];
|
|
1104
|
+
const networkIds = networkId.split(',');
|
|
1105
|
+
for (let j = 0; j < networkIds.length; j++) {
|
|
1106
|
+
network.push(this.networkIdToCode(networkIds[j]).toUpperCase());
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
else {
|
|
1110
|
+
network = this.networkIdToCode(networkId).toUpperCase();
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
result[code] = {
|
|
1114
|
+
'info': {},
|
|
1115
|
+
'currency': code,
|
|
1116
|
+
'address': address,
|
|
1117
|
+
'network': network,
|
|
1118
|
+
'tag': undefined,
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
return result;
|
|
1123
|
+
}
|
|
1019
1124
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
1020
1125
|
let url = this.urls['api'][api];
|
|
1021
1126
|
if (api === 'public') {
|
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 type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks } 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.2.
|
|
7
|
+
declare const version = "4.2.46";
|
|
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.2.
|
|
41
|
+
const version = '4.2.47';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -12,6 +12,9 @@ interface Exchange {
|
|
|
12
12
|
publicGetTrades(params?: {}): Promise<implicitReturnType>;
|
|
13
13
|
publicGetChart(params?: {}): Promise<implicitReturnType>;
|
|
14
14
|
publicGetCharts(params?: {}): Promise<implicitReturnType>;
|
|
15
|
+
publicGetMinicharts(params?: {}): Promise<implicitReturnType>;
|
|
16
|
+
publicGetOraclePrices(params?: {}): Promise<implicitReturnType>;
|
|
17
|
+
publicGetQuickTrade(params?: {}): Promise<implicitReturnType>;
|
|
15
18
|
publicGetUdfConfig(params?: {}): Promise<implicitReturnType>;
|
|
16
19
|
publicGetUdfHistory(params?: {}): Promise<implicitReturnType>;
|
|
17
20
|
publicGetUdfSymbols(params?: {}): Promise<implicitReturnType>;
|
package/js/src/bybit.d.ts
CHANGED
|
@@ -69,8 +69,10 @@ export default class bybit extends Exchange {
|
|
|
69
69
|
cancelAllUsdcOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
70
70
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
71
71
|
fetchUsdcOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
72
|
+
fetchOrderClassic(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
72
73
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
73
74
|
fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
75
|
+
fetchOrdersClassic(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
74
76
|
fetchClosedOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
75
77
|
fetchOpenOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
76
78
|
fetchCanceledAndClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
package/js/src/bybit.js
CHANGED
|
@@ -4482,11 +4482,194 @@ export default class bybit extends Exchange {
|
|
|
4482
4482
|
const data = this.safeValue(result, 'dataList', []);
|
|
4483
4483
|
return this.parseOrders(data, market, since, limit);
|
|
4484
4484
|
}
|
|
4485
|
+
async fetchOrderClassic(id, symbol = undefined, params = {}) {
|
|
4486
|
+
/**
|
|
4487
|
+
* @method
|
|
4488
|
+
* @name bybit#fetchOrderClassic
|
|
4489
|
+
* @description fetches information on an order made by the user *classic accounts only*
|
|
4490
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4491
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
4492
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4493
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4494
|
+
*/
|
|
4495
|
+
if (symbol === undefined) {
|
|
4496
|
+
throw new ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
4497
|
+
}
|
|
4498
|
+
await this.loadMarkets();
|
|
4499
|
+
const market = this.market(symbol);
|
|
4500
|
+
if (market['spot']) {
|
|
4501
|
+
throw new NotSupported(this.id + ' fetchOrder() is not supported for spot markets');
|
|
4502
|
+
}
|
|
4503
|
+
const request = {
|
|
4504
|
+
'orderId': id,
|
|
4505
|
+
};
|
|
4506
|
+
const result = await this.fetchOrders(symbol, undefined, undefined, this.extend(request, params));
|
|
4507
|
+
const length = result.length;
|
|
4508
|
+
if (length === 0) {
|
|
4509
|
+
const isTrigger = this.safeBoolN(params, ['trigger', 'stop'], false);
|
|
4510
|
+
const extra = isTrigger ? '' : 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = true';
|
|
4511
|
+
throw new OrderNotFound('Order ' + id.toString() + ' was not found.' + extra);
|
|
4512
|
+
}
|
|
4513
|
+
if (length > 1) {
|
|
4514
|
+
throw new InvalidOrder(this.id + ' returned more than one order');
|
|
4515
|
+
}
|
|
4516
|
+
return this.safeValue(result, 0);
|
|
4517
|
+
}
|
|
4485
4518
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
4486
|
-
|
|
4519
|
+
/**
|
|
4520
|
+
* @method
|
|
4521
|
+
* @name bybit#fetchOrderClassic
|
|
4522
|
+
* @description *classic accounts only/ spot not supported* fetches information on an order made by the user *classic accounts only*
|
|
4523
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4524
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
4525
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4526
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4527
|
+
*/
|
|
4528
|
+
const res = await this.isUnifiedEnabled();
|
|
4529
|
+
const enableUnifiedAccount = this.safeBool(res, 1);
|
|
4530
|
+
if (enableUnifiedAccount) {
|
|
4531
|
+
throw new NotSupported(this.id + ' fetchOrder() is not supported after the 5/02 update for UTA accounts, please use fetchOpenOrder or fetchClosedOrder');
|
|
4532
|
+
}
|
|
4533
|
+
return await this.fetchOrderClassic(id, symbol, params);
|
|
4487
4534
|
}
|
|
4488
4535
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4489
|
-
|
|
4536
|
+
const res = await this.isUnifiedEnabled();
|
|
4537
|
+
/**
|
|
4538
|
+
* @method
|
|
4539
|
+
* @name bybit#fetchOrders
|
|
4540
|
+
* @description *classic accounts only/ spot not supported* fetches information on multiple orders made by the user *classic accounts only/ spot not supported*
|
|
4541
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4542
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4543
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4544
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4545
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4546
|
+
* @param {boolean} [params.stop] true if stop order
|
|
4547
|
+
* @param {string} [params.type] market type, ['swap', 'option']
|
|
4548
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4549
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4550
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4551
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4552
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4553
|
+
*/
|
|
4554
|
+
const enableUnifiedAccount = this.safeBool(res, 1);
|
|
4555
|
+
if (enableUnifiedAccount) {
|
|
4556
|
+
throw new NotSupported(this.id + ' fetchOrders() is not supported after the 5/02 update for UTA accounts, please use fetchOpenOrders, fetchClosedOrders or fetchCanceledOrders');
|
|
4557
|
+
}
|
|
4558
|
+
return await this.fetchOrdersClassic(symbol, since, limit, params);
|
|
4559
|
+
}
|
|
4560
|
+
async fetchOrdersClassic(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4561
|
+
/**
|
|
4562
|
+
* @method
|
|
4563
|
+
* @name bybit#fetchOrders
|
|
4564
|
+
* @description fetches information on multiple orders made by the user *classic accounts only*
|
|
4565
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4566
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4567
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4568
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4569
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4570
|
+
* @param {boolean} [params.stop] true if stop order
|
|
4571
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4572
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4573
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4574
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4575
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4576
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4577
|
+
*/
|
|
4578
|
+
await this.loadMarkets();
|
|
4579
|
+
let paginate = false;
|
|
4580
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOrders', 'paginate');
|
|
4581
|
+
if (paginate) {
|
|
4582
|
+
return await this.fetchPaginatedCallCursor('fetchOrders', symbol, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
|
|
4583
|
+
}
|
|
4584
|
+
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
4585
|
+
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
4586
|
+
const request = {};
|
|
4587
|
+
let market = undefined;
|
|
4588
|
+
let isUsdcSettled = false;
|
|
4589
|
+
if (symbol !== undefined) {
|
|
4590
|
+
market = this.market(symbol);
|
|
4591
|
+
isUsdcSettled = market['settle'] === 'USDC';
|
|
4592
|
+
request['symbol'] = market['id'];
|
|
4593
|
+
}
|
|
4594
|
+
let type = undefined;
|
|
4595
|
+
[type, params] = this.getBybitType('fetchOrders', market, params);
|
|
4596
|
+
if (((type === 'option') || isUsdcSettled) && !isUnifiedAccount) {
|
|
4597
|
+
return await this.fetchUsdcOrders(symbol, since, limit, params);
|
|
4598
|
+
}
|
|
4599
|
+
if (type === 'spot') {
|
|
4600
|
+
throw new NotSupported(this.id + ' fetchOrders() is not supported for spot markets');
|
|
4601
|
+
}
|
|
4602
|
+
request['category'] = type;
|
|
4603
|
+
const isStop = this.safeBoolN(params, ['trigger', 'stop'], false);
|
|
4604
|
+
params = this.omit(params, ['trigger', 'stop']);
|
|
4605
|
+
if (isStop) {
|
|
4606
|
+
request['orderFilter'] = 'StopOrder';
|
|
4607
|
+
}
|
|
4608
|
+
if (limit !== undefined) {
|
|
4609
|
+
request['limit'] = limit;
|
|
4610
|
+
}
|
|
4611
|
+
if (since !== undefined) {
|
|
4612
|
+
request['startTime'] = since;
|
|
4613
|
+
}
|
|
4614
|
+
const until = this.safeInteger2(params, 'until', 'till'); // unified in milliseconds
|
|
4615
|
+
const endTime = this.safeInteger(params, 'endTime', until); // exchange-specific in milliseconds
|
|
4616
|
+
params = this.omit(params, ['endTime', 'till', 'until']);
|
|
4617
|
+
if (endTime !== undefined) {
|
|
4618
|
+
request['endTime'] = endTime;
|
|
4619
|
+
}
|
|
4620
|
+
const response = await this.privateGetV5OrderHistory(this.extend(request, params));
|
|
4621
|
+
//
|
|
4622
|
+
// {
|
|
4623
|
+
// "retCode": 0,
|
|
4624
|
+
// "retMsg": "OK",
|
|
4625
|
+
// "result": {
|
|
4626
|
+
// "nextPageCursor": "03234de9-1332-41eb-b805-4a9f42c136a3%3A1672220109387%2C03234de9-1332-41eb-b805-4a9f42c136a3%3A1672220109387",
|
|
4627
|
+
// "category": "linear",
|
|
4628
|
+
// "list": [
|
|
4629
|
+
// {
|
|
4630
|
+
// "symbol": "BTCUSDT",
|
|
4631
|
+
// "orderType": "Limit",
|
|
4632
|
+
// "orderLinkId": "test-001",
|
|
4633
|
+
// "orderId": "03234de9-1332-41eb-b805-4a9f42c136a3",
|
|
4634
|
+
// "cancelType": "CancelByUser",
|
|
4635
|
+
// "avgPrice": "0",
|
|
4636
|
+
// "stopOrderType": "UNKNOWN",
|
|
4637
|
+
// "lastPriceOnCreated": "16656.5",
|
|
4638
|
+
// "orderStatus": "Cancelled",
|
|
4639
|
+
// "takeProfit": "",
|
|
4640
|
+
// "cumExecValue": "0",
|
|
4641
|
+
// "triggerDirection": 0,
|
|
4642
|
+
// "blockTradeId": "",
|
|
4643
|
+
// "rejectReason": "EC_PerCancelRequest",
|
|
4644
|
+
// "isLeverage": "",
|
|
4645
|
+
// "price": "18000",
|
|
4646
|
+
// "orderIv": "",
|
|
4647
|
+
// "createdTime": "1672220109387",
|
|
4648
|
+
// "tpTriggerBy": "UNKNOWN",
|
|
4649
|
+
// "positionIdx": 0,
|
|
4650
|
+
// "timeInForce": "GoodTillCancel",
|
|
4651
|
+
// "leavesValue": "0",
|
|
4652
|
+
// "updatedTime": "1672220114123",
|
|
4653
|
+
// "side": "Sell",
|
|
4654
|
+
// "triggerPrice": "",
|
|
4655
|
+
// "cumExecFee": "0",
|
|
4656
|
+
// "slTriggerBy": "UNKNOWN",
|
|
4657
|
+
// "leavesQty": "0",
|
|
4658
|
+
// "closeOnTrigger": false,
|
|
4659
|
+
// "cumExecQty": "0",
|
|
4660
|
+
// "reduceOnly": false,
|
|
4661
|
+
// "qty": "0.1",
|
|
4662
|
+
// "stopLoss": "",
|
|
4663
|
+
// "triggerBy": "UNKNOWN"
|
|
4664
|
+
// }
|
|
4665
|
+
// ]
|
|
4666
|
+
// },
|
|
4667
|
+
// "retExtInfo": {},
|
|
4668
|
+
// "time": 1672221263862
|
|
4669
|
+
// }
|
|
4670
|
+
//
|
|
4671
|
+
const data = this.addPaginationCursorToResult(response);
|
|
4672
|
+
return this.parseOrders(data, market, since, limit);
|
|
4490
4673
|
}
|
|
4491
4674
|
async fetchClosedOrder(id, symbol = undefined, params = {}) {
|
|
4492
4675
|
/**
|