ccxt 4.4.73 → 4.4.75
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 +4 -4
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -11
- package/dist/cjs/src/ace.js +9 -6
- package/dist/cjs/src/alpaca.js +3 -0
- package/dist/cjs/src/ascendex.js +6 -0
- package/dist/cjs/src/base/Exchange.js +36 -14
- package/dist/cjs/src/bequant.js +1 -0
- package/dist/cjs/src/binanceusdm.js +1 -1
- package/dist/cjs/src/bit2c.js +30 -4
- package/dist/cjs/src/bitbank.js +32 -0
- package/dist/cjs/src/bitbns.js +1 -1
- package/dist/cjs/src/bitflyer.js +1 -0
- package/dist/cjs/src/bithumb.js +34 -0
- package/dist/cjs/src/bitmart.js +74 -7
- package/dist/cjs/src/bitopro.js +37 -0
- package/dist/cjs/src/blofin.js +1 -1
- package/dist/cjs/src/bybit.js +14 -1
- package/dist/cjs/src/coinlist.js +87 -11
- package/dist/cjs/src/deribit.js +29 -1
- package/dist/cjs/src/gate.js +12 -7
- package/dist/cjs/src/hitbtc.js +7 -1
- package/dist/cjs/src/okx.js +29 -25
- package/dist/cjs/src/pro/ascendex.js +1 -1
- package/dist/cjs/src/pro/bingx.js +10 -1
- package/dist/cjs/src/pro/bitget.js +10 -1
- package/dist/cjs/src/pro/bitmart.js +10 -1
- package/dist/cjs/src/pro/bitopro.js +5 -4
- package/dist/cjs/src/pro/onetrading.js +7 -7
- package/js/ccxt.d.ts +2 -14
- package/js/ccxt.js +2 -10
- package/js/src/abstract/bitmart.d.ts +2 -0
- package/js/src/abstract/coinlist.d.ts +3 -0
- package/js/src/ace.js +9 -6
- package/js/src/alpaca.js +3 -0
- package/js/src/ascendex.js +6 -0
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +36 -14
- package/js/src/bequant.js +1 -0
- package/js/src/binanceusdm.js +1 -1
- package/js/src/bit2c.js +30 -4
- package/js/src/bitbank.js +32 -0
- package/js/src/bitbns.js +1 -1
- package/js/src/bitflyer.js +1 -0
- package/js/src/bithumb.js +34 -0
- package/js/src/bitmart.d.ts +24 -0
- package/js/src/bitmart.js +74 -7
- package/js/src/bitopro.js +37 -0
- package/js/src/blofin.js +1 -1
- package/js/src/bybit.js +14 -1
- package/js/src/coinlist.js +87 -11
- package/js/src/deribit.js +29 -1
- package/js/src/gate.js +12 -7
- package/js/src/hitbtc.js +7 -1
- package/js/src/okx.js +29 -25
- package/js/src/pro/ascendex.js +1 -1
- package/js/src/pro/bingx.js +10 -1
- package/js/src/pro/bitget.js +10 -1
- package/js/src/pro/bitmart.js +10 -1
- package/js/src/pro/bitopro.js +5 -4
- package/js/src/pro/onetrading.d.ts +7 -7
- package/js/src/pro/onetrading.js +7 -7
- package/package.json +1 -1
- package/js/src/abstract/bitcoincom.d.ts +0 -118
- package/js/src/abstract/bitcoincom.js +0 -11
- package/js/src/abstract/bitfinex1.d.ts +0 -72
- package/js/src/abstract/bitfinex1.js +0 -11
- package/js/src/abstract/bitpanda.d.ts +0 -26
- package/js/src/abstract/bitpanda.js +0 -11
- package/js/src/abstract/poloniexfutures.d.ts +0 -51
- package/js/src/abstract/poloniexfutures.js +0 -11
- package/js/src/abstract/wazirx.d.ts +0 -33
- package/js/src/abstract/wazirx.js +0 -11
- package/js/src/bitcoincom.d.ts +0 -4
- package/js/src/bitcoincom.js +0 -18
- package/js/src/bitpanda.d.ts +0 -4
- package/js/src/bitpanda.js +0 -17
- package/js/src/poloniexfutures.d.ts +0 -321
- package/js/src/poloniexfutures.js +0 -1941
- package/js/src/pro/bitcoincom.d.ts +0 -4
- package/js/src/pro/bitcoincom.js +0 -34
- package/js/src/pro/bitpanda.d.ts +0 -4
- package/js/src/pro/bitpanda.js +0 -17
- package/js/src/pro/poloniexfutures.d.ts +0 -108
- package/js/src/pro/poloniexfutures.js +0 -1042
- package/js/src/pro/wazirx.d.ts +0 -102
- package/js/src/pro/wazirx.js +0 -784
- package/js/src/static_dependencies/starknet/utils/json.d.ts +0 -24
- package/js/src/static_dependencies/starknet/utils/json.js +0 -43
package/dist/cjs/src/bitmart.js
CHANGED
|
@@ -85,7 +85,7 @@ class bitmart extends bitmart$1 {
|
|
|
85
85
|
'fetchOrders': false,
|
|
86
86
|
'fetchOrderTrades': true,
|
|
87
87
|
'fetchPosition': true,
|
|
88
|
-
'fetchPositionMode':
|
|
88
|
+
'fetchPositionMode': true,
|
|
89
89
|
'fetchPositions': true,
|
|
90
90
|
'fetchStatus': true,
|
|
91
91
|
'fetchTicker': true,
|
|
@@ -107,6 +107,7 @@ class bitmart extends bitmart$1 {
|
|
|
107
107
|
'repayIsolatedMargin': true,
|
|
108
108
|
'setLeverage': true,
|
|
109
109
|
'setMarginMode': false,
|
|
110
|
+
'setPositionMode': true,
|
|
110
111
|
'transfer': true,
|
|
111
112
|
'withdraw': true,
|
|
112
113
|
},
|
|
@@ -212,6 +213,7 @@ class bitmart extends bitmart$1 {
|
|
|
212
213
|
'contract/private/affilate/rebate-list': 10,
|
|
213
214
|
'contract/private/affilate/trade-list': 10,
|
|
214
215
|
'contract/private/transaction-history': 10,
|
|
216
|
+
'contract/private/get-position-mode': 1,
|
|
215
217
|
},
|
|
216
218
|
'post': {
|
|
217
219
|
// sub-account endpoints
|
|
@@ -263,7 +265,8 @@ class bitmart extends bitmart$1 {
|
|
|
263
265
|
'contract/private/modify-limit-order': 2.5,
|
|
264
266
|
'contract/private/modify-tp-sl-order': 2.5,
|
|
265
267
|
'contract/private/submit-trail-order': 2.5,
|
|
266
|
-
'contract/private/cancel-trail-order': 1.5,
|
|
268
|
+
'contract/private/cancel-trail-order': 1.5,
|
|
269
|
+
'contract/private/set-position-mode': 1,
|
|
267
270
|
},
|
|
268
271
|
},
|
|
269
272
|
},
|
|
@@ -1194,7 +1197,7 @@ class bitmart extends bitmart$1 {
|
|
|
1194
1197
|
// {
|
|
1195
1198
|
// "message": "OK",
|
|
1196
1199
|
// "code": 1000,
|
|
1197
|
-
// "trace": "619294ecef584282b26a3be322b1e01f.66.
|
|
1200
|
+
// "trace": "619294ecef584282b26a3be322b1e01f.66.17403093228242229",
|
|
1198
1201
|
// "data": {
|
|
1199
1202
|
// "currencies": [
|
|
1200
1203
|
// {
|
|
@@ -4057,10 +4060,12 @@ class bitmart extends bitmart$1 {
|
|
|
4057
4060
|
const timestamp = this.safeInteger(transaction, 'apply_time');
|
|
4058
4061
|
let currencyId = this.safeString(transaction, 'currency');
|
|
4059
4062
|
let networkId = undefined;
|
|
4060
|
-
if (currencyId
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4063
|
+
if (currencyId !== undefined) {
|
|
4064
|
+
if (currencyId.indexOf('NFT') < 0) {
|
|
4065
|
+
const parts = currencyId.split('-');
|
|
4066
|
+
currencyId = this.safeString(parts, 0);
|
|
4067
|
+
networkId = this.safeString(parts, 1);
|
|
4068
|
+
}
|
|
4064
4069
|
}
|
|
4065
4070
|
const code = this.safeCurrencyCode(currencyId, currency);
|
|
4066
4071
|
const status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
|
|
@@ -5484,6 +5489,68 @@ class bitmart extends bitmart$1 {
|
|
|
5484
5489
|
}
|
|
5485
5490
|
return addresses;
|
|
5486
5491
|
}
|
|
5492
|
+
/**
|
|
5493
|
+
* @method
|
|
5494
|
+
* @name bitmart#setPositionMode
|
|
5495
|
+
* @description set hedged to true or false for a market
|
|
5496
|
+
* @see https://developer-pro.bitmart.com/en/futuresv2/#submit-leverage-signed
|
|
5497
|
+
* @param {bool} hedged set to true to use dualSidePosition
|
|
5498
|
+
* @param {string} symbol not used by bingx setPositionMode ()
|
|
5499
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5500
|
+
* @returns {object} response from the exchange
|
|
5501
|
+
*/
|
|
5502
|
+
async setPositionMode(hedged, symbol = undefined, params = {}) {
|
|
5503
|
+
await this.loadMarkets();
|
|
5504
|
+
let positionMode = undefined;
|
|
5505
|
+
if (hedged) {
|
|
5506
|
+
positionMode = 'hedge_mode';
|
|
5507
|
+
}
|
|
5508
|
+
else {
|
|
5509
|
+
positionMode = 'one_way_mode';
|
|
5510
|
+
}
|
|
5511
|
+
const request = {
|
|
5512
|
+
'position_mode': positionMode,
|
|
5513
|
+
};
|
|
5514
|
+
//
|
|
5515
|
+
// {
|
|
5516
|
+
// "code": 1000,
|
|
5517
|
+
// "trace": "0cc6f4c4-8b8c-4253-8e90-8d3195aa109c",
|
|
5518
|
+
// "message": "Ok",
|
|
5519
|
+
// "data": {
|
|
5520
|
+
// "position_mode":"one_way_mode"
|
|
5521
|
+
// }
|
|
5522
|
+
// }
|
|
5523
|
+
//
|
|
5524
|
+
return await this.privatePostContractPrivateSetPositionMode(this.extend(request, params));
|
|
5525
|
+
}
|
|
5526
|
+
/**
|
|
5527
|
+
* @method
|
|
5528
|
+
* @name bitmart#fetchPositionMode
|
|
5529
|
+
* @description fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
|
|
5530
|
+
* @see https://developer-pro.bitmart.com/en/futuresv2/#get-position-mode-keyed
|
|
5531
|
+
* @param {string} symbol not used
|
|
5532
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5533
|
+
* @returns {object} an object detailing whether the market is in hedged or one-way mode
|
|
5534
|
+
*/
|
|
5535
|
+
async fetchPositionMode(symbol = undefined, params = {}) {
|
|
5536
|
+
const response = await this.privateGetContractPrivateGetPositionMode(params);
|
|
5537
|
+
//
|
|
5538
|
+
// {
|
|
5539
|
+
// "code": 1000,
|
|
5540
|
+
// "trace": "0cc6f4c4-8b8c-4253-8e90-8d3195aa109c",
|
|
5541
|
+
// "message": "Ok",
|
|
5542
|
+
// "data": {
|
|
5543
|
+
// "position_mode":"one_way_mode"
|
|
5544
|
+
// }
|
|
5545
|
+
// }
|
|
5546
|
+
//
|
|
5547
|
+
const data = this.safeDict(response, 'data');
|
|
5548
|
+
const positionMode = this.safeString(data, 'position_mode');
|
|
5549
|
+
return {
|
|
5550
|
+
'info': response,
|
|
5551
|
+
'hedged': (positionMode === 'hedge_mode'),
|
|
5552
|
+
};
|
|
5553
|
+
}
|
|
5487
5554
|
nonce() {
|
|
5488
5555
|
return this.milliseconds() - this.options['timeDifference'];
|
|
5489
5556
|
}
|
package/dist/cjs/src/bitopro.js
CHANGED
|
@@ -28,19 +28,29 @@ class bitopro extends bitopro$1 {
|
|
|
28
28
|
'swap': false,
|
|
29
29
|
'future': false,
|
|
30
30
|
'option': false,
|
|
31
|
+
'addMargin': false,
|
|
32
|
+
'borrowCrossMargin': false,
|
|
33
|
+
'borrowIsolatedMargin': false,
|
|
34
|
+
'borrowMargin': false,
|
|
31
35
|
'cancelAllOrders': true,
|
|
32
36
|
'cancelOrder': true,
|
|
33
37
|
'cancelOrders': true,
|
|
34
38
|
'closeAllPositions': false,
|
|
35
39
|
'closePosition': false,
|
|
36
40
|
'createOrder': true,
|
|
41
|
+
'createOrderWithTakeProfitAndStopLoss': false,
|
|
42
|
+
'createOrderWithTakeProfitAndStopLossWs': false,
|
|
37
43
|
'createReduceOnlyOrder': false,
|
|
38
44
|
'createStopOrder': true,
|
|
39
45
|
'createTriggerOrder': true,
|
|
40
46
|
'editOrder': false,
|
|
41
47
|
'fetchBalance': true,
|
|
48
|
+
'fetchBorrowInterest': false,
|
|
49
|
+
'fetchBorrowRate': false,
|
|
42
50
|
'fetchBorrowRateHistories': false,
|
|
43
51
|
'fetchBorrowRateHistory': false,
|
|
52
|
+
'fetchBorrowRates': false,
|
|
53
|
+
'fetchBorrowRatesPerSymbol': false,
|
|
44
54
|
'fetchClosedOrders': true,
|
|
45
55
|
'fetchCrossBorrowRate': false,
|
|
46
56
|
'fetchCrossBorrowRates': false,
|
|
@@ -51,19 +61,39 @@ class bitopro extends bitopro$1 {
|
|
|
51
61
|
'fetchDepositWithdrawFee': 'emulated',
|
|
52
62
|
'fetchDepositWithdrawFees': true,
|
|
53
63
|
'fetchFundingHistory': false,
|
|
64
|
+
'fetchFundingInterval': false,
|
|
65
|
+
'fetchFundingIntervals': false,
|
|
54
66
|
'fetchFundingRate': false,
|
|
55
67
|
'fetchFundingRateHistory': false,
|
|
56
68
|
'fetchFundingRates': false,
|
|
69
|
+
'fetchGreeks': false,
|
|
57
70
|
'fetchIndexOHLCV': false,
|
|
58
71
|
'fetchIsolatedBorrowRate': false,
|
|
59
72
|
'fetchIsolatedBorrowRates': false,
|
|
73
|
+
'fetchIsolatedPositions': false,
|
|
74
|
+
'fetchLeverage': false,
|
|
75
|
+
'fetchLeverages': false,
|
|
76
|
+
'fetchLeverageTiers': false,
|
|
77
|
+
'fetchLiquidations': false,
|
|
78
|
+
'fetchLongShortRatio': false,
|
|
79
|
+
'fetchLongShortRatioHistory': false,
|
|
80
|
+
'fetchMarginAdjustmentHistory': false,
|
|
60
81
|
'fetchMarginMode': false,
|
|
82
|
+
'fetchMarginModes': false,
|
|
83
|
+
'fetchMarketLeverageTiers': false,
|
|
61
84
|
'fetchMarkets': true,
|
|
62
85
|
'fetchMarkOHLCV': false,
|
|
86
|
+
'fetchMarkPrices': false,
|
|
87
|
+
'fetchMyLiquidations': false,
|
|
88
|
+
'fetchMySettlementHistory': false,
|
|
63
89
|
'fetchMyTrades': true,
|
|
64
90
|
'fetchOHLCV': true,
|
|
91
|
+
'fetchOpenInterest': false,
|
|
65
92
|
'fetchOpenInterestHistory': false,
|
|
93
|
+
'fetchOpenInterests': false,
|
|
66
94
|
'fetchOpenOrders': true,
|
|
95
|
+
'fetchOption': false,
|
|
96
|
+
'fetchOptionChain': false,
|
|
67
97
|
'fetchOrder': true,
|
|
68
98
|
'fetchOrderBook': true,
|
|
69
99
|
'fetchOrders': false,
|
|
@@ -76,6 +106,7 @@ class bitopro extends bitopro$1 {
|
|
|
76
106
|
'fetchPositionsHistory': false,
|
|
77
107
|
'fetchPositionsRisk': false,
|
|
78
108
|
'fetchPremiumIndexOHLCV': false,
|
|
109
|
+
'fetchSettlementHistory': false,
|
|
79
110
|
'fetchTicker': true,
|
|
80
111
|
'fetchTickers': true,
|
|
81
112
|
'fetchTime': false,
|
|
@@ -86,10 +117,16 @@ class bitopro extends bitopro$1 {
|
|
|
86
117
|
'fetchTransactions': false,
|
|
87
118
|
'fetchTransfer': false,
|
|
88
119
|
'fetchTransfers': false,
|
|
120
|
+
'fetchVolatilityHistory': false,
|
|
89
121
|
'fetchWithdrawal': true,
|
|
90
122
|
'fetchWithdrawals': true,
|
|
123
|
+
'reduceMargin': false,
|
|
124
|
+
'repayCrossMargin': false,
|
|
125
|
+
'repayIsolatedMargin': false,
|
|
91
126
|
'setLeverage': false,
|
|
127
|
+
'setMargin': false,
|
|
92
128
|
'setMarginMode': false,
|
|
129
|
+
'setPositionMode': false,
|
|
93
130
|
'transfer': false,
|
|
94
131
|
'withdraw': true,
|
|
95
132
|
},
|
package/dist/cjs/src/blofin.js
CHANGED
|
@@ -57,7 +57,7 @@ class blofin extends blofin$1 {
|
|
|
57
57
|
'fetchBorrowRateHistory': false,
|
|
58
58
|
'fetchCanceledOrders': false,
|
|
59
59
|
'fetchClosedOrder': false,
|
|
60
|
-
'fetchClosedOrders':
|
|
60
|
+
'fetchClosedOrders': true,
|
|
61
61
|
'fetchCrossBorrowRate': false,
|
|
62
62
|
'fetchCrossBorrowRates': false,
|
|
63
63
|
'fetchCurrencies': false,
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -2442,6 +2442,7 @@ class bybit extends bybit$1 {
|
|
|
2442
2442
|
*/
|
|
2443
2443
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
2444
2444
|
await this.loadMarkets();
|
|
2445
|
+
let code = this.safeStringN(params, ['code', 'currency', 'baseCoin']);
|
|
2445
2446
|
let market = undefined;
|
|
2446
2447
|
let parsedSymbols = undefined;
|
|
2447
2448
|
if (symbols !== undefined) {
|
|
@@ -2467,6 +2468,15 @@ class bybit extends bybit$1 {
|
|
|
2467
2468
|
else if (market['type'] !== currentType) {
|
|
2468
2469
|
throw new errors.BadRequest(this.id + ' fetchTickers can only accept a list of symbols of the same type');
|
|
2469
2470
|
}
|
|
2471
|
+
if (market['option']) {
|
|
2472
|
+
if (code !== undefined && code !== market['base']) {
|
|
2473
|
+
throw new errors.BadRequest(this.id + ' fetchTickers the base currency must be the same for all symbols, this endpoint only supports one base currency at a time. Read more about it here: https://bybit-exchange.github.io/docs/v5/market/tickers');
|
|
2474
|
+
}
|
|
2475
|
+
if (code === undefined) {
|
|
2476
|
+
code = market['base'];
|
|
2477
|
+
}
|
|
2478
|
+
params = this.omit(params, ['code', 'currency']);
|
|
2479
|
+
}
|
|
2470
2480
|
parsedSymbols.push(market['symbol']);
|
|
2471
2481
|
}
|
|
2472
2482
|
}
|
|
@@ -2489,7 +2499,10 @@ class bybit extends bybit$1 {
|
|
|
2489
2499
|
}
|
|
2490
2500
|
else if (type === 'option') {
|
|
2491
2501
|
request['category'] = 'option';
|
|
2492
|
-
|
|
2502
|
+
if (code === undefined) {
|
|
2503
|
+
code = 'BTC';
|
|
2504
|
+
}
|
|
2505
|
+
request['baseCoin'] = code;
|
|
2493
2506
|
}
|
|
2494
2507
|
else if (type === 'swap' || type === 'future' || subType !== undefined) {
|
|
2495
2508
|
request['category'] = subType;
|
package/dist/cjs/src/coinlist.js
CHANGED
|
@@ -156,6 +156,7 @@ class coinlist extends coinlist$1 {
|
|
|
156
156
|
'v1/leaderboard': 1,
|
|
157
157
|
'v1/affiliate/{competition_code}': 1,
|
|
158
158
|
'v1/competition/{competition_id}': 1,
|
|
159
|
+
'v1/symbols/{symbol}/funding': 1,
|
|
159
160
|
},
|
|
160
161
|
},
|
|
161
162
|
'private': {
|
|
@@ -179,6 +180,7 @@ class coinlist extends coinlist$1 {
|
|
|
179
180
|
'v1/credits': 1,
|
|
180
181
|
'v1/positions': 1,
|
|
181
182
|
'v1/accounts/{trader_id}/competitions': 1,
|
|
183
|
+
'v1/closedPositions': 1,
|
|
182
184
|
},
|
|
183
185
|
'post': {
|
|
184
186
|
'v1/keys': 1,
|
|
@@ -197,6 +199,9 @@ class coinlist extends coinlist$1 {
|
|
|
197
199
|
'v1/orders/{order_id}': 1,
|
|
198
200
|
'v1/orders/bulk': 1, // not unified
|
|
199
201
|
},
|
|
202
|
+
'put': {
|
|
203
|
+
'v1/accounts/{trader_id}/alias': 1,
|
|
204
|
+
},
|
|
200
205
|
'delete': {
|
|
201
206
|
'v1/keys/{key}': 1,
|
|
202
207
|
'v1/orders': 1,
|
|
@@ -488,7 +493,7 @@ class coinlist extends coinlist$1 {
|
|
|
488
493
|
// {
|
|
489
494
|
// "symbols": [
|
|
490
495
|
// {
|
|
491
|
-
// "symbol": "CQT-USDT",
|
|
496
|
+
// "symbol": "CQT-USDT", // spot
|
|
492
497
|
// "base_currency": "CQT",
|
|
493
498
|
// "is_trader_geofenced": false,
|
|
494
499
|
// "list_time": "2021-06-15T00:00:00.000Z",
|
|
@@ -513,6 +518,62 @@ class coinlist extends coinlist$1 {
|
|
|
513
518
|
return this.parseMarkets(markets);
|
|
514
519
|
}
|
|
515
520
|
parseMarket(market) {
|
|
521
|
+
// perp
|
|
522
|
+
// {
|
|
523
|
+
// "symbol":"BTC-PERP",
|
|
524
|
+
// "base_currency":"BTC",
|
|
525
|
+
// "is_trader_geofenced":false,
|
|
526
|
+
// "expiry_name":null,
|
|
527
|
+
// "expiry_time":null,
|
|
528
|
+
// "list_time":"2024-09-16T00:00:00.000Z",
|
|
529
|
+
// "type":"perp-swap",
|
|
530
|
+
// "series_code":"BTC",
|
|
531
|
+
// "long_name":"Bitcoin",
|
|
532
|
+
// "asset_class":"CRYPTO",
|
|
533
|
+
// "minimum_price_increment":"0.01",
|
|
534
|
+
// "minimum_size_increment":"0.0001",
|
|
535
|
+
// "quote_currency":"USDT",
|
|
536
|
+
// "multiplier":"1",
|
|
537
|
+
// "contract_frequency":"FGHJKMNQUVXZ",
|
|
538
|
+
// "index_code":".BTC-USDT",
|
|
539
|
+
// "price_band_threshold_market":"0.05",
|
|
540
|
+
// "price_band_threshold_limit":"0.25",
|
|
541
|
+
// "maintenance_initial_ratio":"0.500000000000000000",
|
|
542
|
+
// "liquidation_initial_ratio":"0.500000000000000000",
|
|
543
|
+
// "last_price":"75881.36000000",
|
|
544
|
+
// "fair_price":"76256.00000000",
|
|
545
|
+
// "index_price":"77609.90000000",
|
|
546
|
+
// "mark_price":"76237.75000000",
|
|
547
|
+
// "mark_price_dollarizer":"0.99950000",
|
|
548
|
+
// "funding_interval":{
|
|
549
|
+
// "hours":"8"
|
|
550
|
+
// },
|
|
551
|
+
// "funding_rate_index_code":".BTC-USDT-FR8H",
|
|
552
|
+
// "initial_margin_base":"0.200000000000000000",
|
|
553
|
+
// "initial_margin_per_contract":"0.160000000000000000",
|
|
554
|
+
// "position_limit":"5.0000"
|
|
555
|
+
// }
|
|
556
|
+
// spot
|
|
557
|
+
// {
|
|
558
|
+
// "symbol": "CQT-USDT", // spot
|
|
559
|
+
// "base_currency": "CQT",
|
|
560
|
+
// "is_trader_geofenced": false,
|
|
561
|
+
// "list_time": "2021-06-15T00:00:00.000Z",
|
|
562
|
+
// "type": "spot",
|
|
563
|
+
// "series_code": "CQT-USDT-SPOT",
|
|
564
|
+
// "long_name": "Covalent",
|
|
565
|
+
// "asset_class": "CRYPTO",
|
|
566
|
+
// "minimum_price_increment": "0.0001",
|
|
567
|
+
// "minimum_size_increment": "0.0001",
|
|
568
|
+
// "quote_currency": "USDT",
|
|
569
|
+
// "index_code": null,
|
|
570
|
+
// "price_band_threshold_market": "0.05",
|
|
571
|
+
// "price_band_threshold_limit": "0.25",
|
|
572
|
+
// "last_price": "0.12160000",
|
|
573
|
+
// "fair_price": "0.12300000",
|
|
574
|
+
// "index_price": null
|
|
575
|
+
// }
|
|
576
|
+
const isSwap = this.safeString(market, 'type') === 'perp-swap';
|
|
516
577
|
const id = this.safeString(market, 'symbol');
|
|
517
578
|
const baseId = this.safeString(market, 'base_currency');
|
|
518
579
|
const quoteId = this.safeString(market, 'quote_currency');
|
|
@@ -521,26 +582,41 @@ class coinlist extends coinlist$1 {
|
|
|
521
582
|
const amountPrecision = this.safeString(market, 'minimum_size_increment');
|
|
522
583
|
const pricePrecision = this.safeString(market, 'minimum_price_increment');
|
|
523
584
|
const created = this.safeString(market, 'list_time');
|
|
585
|
+
let settledId = undefined;
|
|
586
|
+
let settled = undefined;
|
|
587
|
+
let linear = undefined;
|
|
588
|
+
let inverse = undefined;
|
|
589
|
+
let contractSize = undefined;
|
|
590
|
+
let symbol = base + '/' + quote;
|
|
591
|
+
if (isSwap) {
|
|
592
|
+
contractSize = this.parseNumber('1');
|
|
593
|
+
linear = true;
|
|
594
|
+
inverse = false;
|
|
595
|
+
settledId = quoteId;
|
|
596
|
+
settled = quote;
|
|
597
|
+
symbol = symbol + ':' + quote;
|
|
598
|
+
}
|
|
599
|
+
const type = isSwap ? 'swap' : 'spot';
|
|
524
600
|
return {
|
|
525
601
|
'id': id,
|
|
526
|
-
'symbol':
|
|
602
|
+
'symbol': symbol,
|
|
527
603
|
'base': base,
|
|
528
604
|
'quote': quote,
|
|
529
|
-
'settle':
|
|
605
|
+
'settle': settled,
|
|
530
606
|
'baseId': baseId,
|
|
531
607
|
'quoteId': quoteId,
|
|
532
|
-
'settleId':
|
|
533
|
-
'type':
|
|
534
|
-
'spot':
|
|
608
|
+
'settleId': settledId,
|
|
609
|
+
'type': type,
|
|
610
|
+
'spot': !isSwap,
|
|
535
611
|
'margin': false,
|
|
536
|
-
'swap':
|
|
612
|
+
'swap': isSwap,
|
|
537
613
|
'future': false,
|
|
538
614
|
'option': false,
|
|
539
615
|
'active': true,
|
|
540
|
-
'contract':
|
|
541
|
-
'linear':
|
|
542
|
-
'inverse':
|
|
543
|
-
'contractSize':
|
|
616
|
+
'contract': isSwap,
|
|
617
|
+
'linear': linear,
|
|
618
|
+
'inverse': inverse,
|
|
619
|
+
'contractSize': contractSize,
|
|
544
620
|
'expiry': undefined,
|
|
545
621
|
'expiryDatetime': undefined,
|
|
546
622
|
'strike': undefined,
|
package/dist/cjs/src/deribit.js
CHANGED
|
@@ -1333,8 +1333,21 @@ class deribit extends deribit$1 {
|
|
|
1333
1333
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
1334
1334
|
await this.loadMarkets();
|
|
1335
1335
|
symbols = this.marketSymbols(symbols);
|
|
1336
|
-
|
|
1336
|
+
let code = this.safeString2(params, 'code', 'currency');
|
|
1337
|
+
let type = undefined;
|
|
1337
1338
|
params = this.omit(params, ['code']);
|
|
1339
|
+
if (symbols !== undefined) {
|
|
1340
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
1341
|
+
const market = this.market(symbols[i]);
|
|
1342
|
+
if (code !== undefined && code !== market['base']) {
|
|
1343
|
+
throw new errors.BadRequest(this.id + ' fetchTickers the base currency must be the same for all symbols, this endpoint only supports one base currency at a time. Read more about it here: https://docs.deribit.com/#public-get_book_summary_by_currency');
|
|
1344
|
+
}
|
|
1345
|
+
if (code === undefined) {
|
|
1346
|
+
code = market['base'];
|
|
1347
|
+
type = market['type'];
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1338
1351
|
if (code === undefined) {
|
|
1339
1352
|
throw new errors.ArgumentsRequired(this.id + ' fetchTickers requires a currency/code (eg: BTC/ETH/USDT) parameter to fetch tickers for');
|
|
1340
1353
|
}
|
|
@@ -1342,6 +1355,21 @@ class deribit extends deribit$1 {
|
|
|
1342
1355
|
const request = {
|
|
1343
1356
|
'currency': currency['id'],
|
|
1344
1357
|
};
|
|
1358
|
+
if (type !== undefined) {
|
|
1359
|
+
let requestType = undefined;
|
|
1360
|
+
if (type === 'spot') {
|
|
1361
|
+
requestType = 'spot';
|
|
1362
|
+
}
|
|
1363
|
+
else if (type === 'future' || (type === 'contract')) {
|
|
1364
|
+
requestType = 'future';
|
|
1365
|
+
}
|
|
1366
|
+
else if (type === 'option') {
|
|
1367
|
+
requestType = 'option';
|
|
1368
|
+
}
|
|
1369
|
+
if (requestType !== undefined) {
|
|
1370
|
+
request['kind'] = requestType;
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1345
1373
|
const response = await this.publicGetGetBookSummaryByCurrency(this.extend(request, params));
|
|
1346
1374
|
//
|
|
1347
1375
|
// {
|
package/dist/cjs/src/gate.js
CHANGED
|
@@ -1482,6 +1482,11 @@ class gate extends gate$1 {
|
|
|
1482
1482
|
const takerPercent = this.safeString(market, 'taker_fee_rate');
|
|
1483
1483
|
const makerPercent = this.safeString(market, 'maker_fee_rate', takerPercent);
|
|
1484
1484
|
const isLinear = quote === settle;
|
|
1485
|
+
let contractSize = this.safeString(market, 'quanto_multiplier');
|
|
1486
|
+
// exception only for one market: https://api.gateio.ws/api/v4/futures/btc/contracts
|
|
1487
|
+
if (contractSize === '0') {
|
|
1488
|
+
contractSize = '1'; // 1 USD in WEB: https://i.imgur.com/MBBUI04.png
|
|
1489
|
+
}
|
|
1485
1490
|
return {
|
|
1486
1491
|
'id': id,
|
|
1487
1492
|
'symbol': symbol,
|
|
@@ -1503,7 +1508,7 @@ class gate extends gate$1 {
|
|
|
1503
1508
|
'inverse': !isLinear,
|
|
1504
1509
|
'taker': this.parseNumber(Precise["default"].stringDiv(takerPercent, '100')),
|
|
1505
1510
|
'maker': this.parseNumber(Precise["default"].stringDiv(makerPercent, '100')),
|
|
1506
|
-
'contractSize': this.
|
|
1511
|
+
'contractSize': this.parseNumber(contractSize),
|
|
1507
1512
|
'expiry': expiry,
|
|
1508
1513
|
'expiryDatetime': this.iso8601(expiry),
|
|
1509
1514
|
'strike': undefined,
|
|
@@ -1848,9 +1853,9 @@ class gate extends gate$1 {
|
|
|
1848
1853
|
const partFirst = this.safeString(parts, 0);
|
|
1849
1854
|
// if there's an underscore then the second part is always the chain name (except the _OLD suffix)
|
|
1850
1855
|
const currencyName = currencyId.endsWith('_OLD') ? currencyId : partFirst;
|
|
1851
|
-
const
|
|
1852
|
-
const
|
|
1853
|
-
const tradeDisabled =
|
|
1856
|
+
const withdrawDisabled = this.safeBool(entry, 'withdraw_disabled', false);
|
|
1857
|
+
const depositDisabled = this.safeBool(entry, 'deposit_disabled', false);
|
|
1858
|
+
const tradeDisabled = this.safeBool(entry, 'trade_disabled', false);
|
|
1854
1859
|
const precision = this.parseNumber('0.0001'); // temporary safe default, because no value provided from API
|
|
1855
1860
|
const code = this.safeCurrencyCode(currencyName);
|
|
1856
1861
|
// check leveraged tokens (e.g. BTC3S, ETH5L)
|
|
@@ -1880,8 +1885,8 @@ class gate extends gate$1 {
|
|
|
1880
1885
|
},
|
|
1881
1886
|
},
|
|
1882
1887
|
'active': !tradeDisabled,
|
|
1883
|
-
'deposit':
|
|
1884
|
-
'withdraw':
|
|
1888
|
+
'deposit': !depositDisabled,
|
|
1889
|
+
'withdraw': !withdrawDisabled,
|
|
1885
1890
|
'fee': undefined,
|
|
1886
1891
|
'precision': precision,
|
|
1887
1892
|
};
|
|
@@ -6758,7 +6763,7 @@ class gate extends gate$1 {
|
|
|
6758
6763
|
queryString = this.urlencode(query);
|
|
6759
6764
|
// https://github.com/ccxt/ccxt/issues/25570
|
|
6760
6765
|
if (queryString.indexOf('currencies=') >= 0 && queryString.indexOf('%2C') >= 0) {
|
|
6761
|
-
queryString = queryString.replaceAll('%
|
|
6766
|
+
queryString = queryString.replaceAll('%2C', ',');
|
|
6762
6767
|
}
|
|
6763
6768
|
url += '?' + queryString;
|
|
6764
6769
|
}
|
package/dist/cjs/src/hitbtc.js
CHANGED
|
@@ -28,7 +28,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
28
28
|
'margin': true,
|
|
29
29
|
'swap': true,
|
|
30
30
|
'future': false,
|
|
31
|
-
'option':
|
|
31
|
+
'option': false,
|
|
32
32
|
'addMargin': true,
|
|
33
33
|
'cancelAllOrders': true,
|
|
34
34
|
'cancelOrder': true,
|
|
@@ -60,6 +60,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
60
60
|
'fetchFundingRate': true,
|
|
61
61
|
'fetchFundingRateHistory': true,
|
|
62
62
|
'fetchFundingRates': true,
|
|
63
|
+
'fetchGreeks': false,
|
|
63
64
|
'fetchIndexOHLCV': true,
|
|
64
65
|
'fetchIsolatedBorrowRate': false,
|
|
65
66
|
'fetchIsolatedBorrowRates': false,
|
|
@@ -72,6 +73,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
72
73
|
'fetchMarkets': true,
|
|
73
74
|
'fetchMarkOHLCV': true,
|
|
74
75
|
'fetchMyLiquidations': false,
|
|
76
|
+
'fetchMySettlementHistory': false,
|
|
75
77
|
'fetchMyTrades': true,
|
|
76
78
|
'fetchOHLCV': true,
|
|
77
79
|
'fetchOpenInterest': true,
|
|
@@ -79,6 +81,8 @@ class hitbtc extends hitbtc$1 {
|
|
|
79
81
|
'fetchOpenInterests': true,
|
|
80
82
|
'fetchOpenOrder': true,
|
|
81
83
|
'fetchOpenOrders': true,
|
|
84
|
+
'fetchOption': false,
|
|
85
|
+
'fetchOptionChain': false,
|
|
82
86
|
'fetchOrder': true,
|
|
83
87
|
'fetchOrderBook': true,
|
|
84
88
|
'fetchOrderBooks': true,
|
|
@@ -87,12 +91,14 @@ class hitbtc extends hitbtc$1 {
|
|
|
87
91
|
'fetchPosition': true,
|
|
88
92
|
'fetchPositions': true,
|
|
89
93
|
'fetchPremiumIndexOHLCV': true,
|
|
94
|
+
'fetchSettlementHistory': false,
|
|
90
95
|
'fetchTicker': true,
|
|
91
96
|
'fetchTickers': true,
|
|
92
97
|
'fetchTrades': true,
|
|
93
98
|
'fetchTradingFee': true,
|
|
94
99
|
'fetchTradingFees': true,
|
|
95
100
|
'fetchTransactions': 'emulated',
|
|
101
|
+
'fetchVolatilityHistory': false,
|
|
96
102
|
'fetchWithdrawals': true,
|
|
97
103
|
'reduceMargin': true,
|
|
98
104
|
'sandbox': true,
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -1268,6 +1268,7 @@ class okx extends okx$1 {
|
|
|
1268
1268
|
},
|
|
1269
1269
|
'fetchOHLCV': {
|
|
1270
1270
|
'limit': 300,
|
|
1271
|
+
'historical': 100,
|
|
1271
1272
|
},
|
|
1272
1273
|
},
|
|
1273
1274
|
'spot': {
|
|
@@ -1820,33 +1821,32 @@ class okx extends okx$1 {
|
|
|
1820
1821
|
const chainsLength = chains.length;
|
|
1821
1822
|
for (let j = 0; j < chainsLength; j++) {
|
|
1822
1823
|
const chain = chains[j];
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
const chainPart = parts.join('-');
|
|
1828
|
-
const networkCode = this.networkIdToCode(chainPart, currency['code']);
|
|
1829
|
-
networks[networkCode] = {
|
|
1830
|
-
'id': networkId,
|
|
1831
|
-
'network': networkCode,
|
|
1832
|
-
'active': undefined,
|
|
1833
|
-
'deposit': this.safeBool(chain, 'canDep'),
|
|
1834
|
-
'withdraw': this.safeBool(chain, 'canWd'),
|
|
1835
|
-
'fee': this.safeNumber(chain, 'fee'),
|
|
1836
|
-
'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'wdTickSz'))),
|
|
1837
|
-
'limits': {
|
|
1838
|
-
'withdraw': {
|
|
1839
|
-
'min': this.safeNumber(chain, 'minWd'),
|
|
1840
|
-
'max': this.safeNumber(chain, 'maxWd'),
|
|
1841
|
-
},
|
|
1842
|
-
},
|
|
1843
|
-
'info': chain,
|
|
1844
|
-
};
|
|
1845
|
-
}
|
|
1846
|
-
else {
|
|
1847
|
-
// only happens for FIAT currency
|
|
1824
|
+
// allow empty string for rare fiat-currencies, e.g. TRY
|
|
1825
|
+
const networkId = this.safeString(chain, 'chain', ''); // USDT-BEP20, USDT-Avalance-C, etc
|
|
1826
|
+
if (networkId === '') {
|
|
1827
|
+
// only happens for fiat 'TRY' currency
|
|
1848
1828
|
type = 'fiat';
|
|
1849
1829
|
}
|
|
1830
|
+
const idParts = networkId.split('-');
|
|
1831
|
+
const parts = this.arraySlice(idParts, 1);
|
|
1832
|
+
const chainPart = parts.join('-');
|
|
1833
|
+
const networkCode = this.networkIdToCode(chainPart, currency['code']);
|
|
1834
|
+
networks[networkCode] = {
|
|
1835
|
+
'id': networkId,
|
|
1836
|
+
'network': networkCode,
|
|
1837
|
+
'active': undefined,
|
|
1838
|
+
'deposit': this.safeBool(chain, 'canDep'),
|
|
1839
|
+
'withdraw': this.safeBool(chain, 'canWd'),
|
|
1840
|
+
'fee': this.safeNumber(chain, 'fee'),
|
|
1841
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'wdTickSz'))),
|
|
1842
|
+
'limits': {
|
|
1843
|
+
'withdraw': {
|
|
1844
|
+
'min': this.safeNumber(chain, 'minWd'),
|
|
1845
|
+
'max': this.safeNumber(chain, 'maxWd'),
|
|
1846
|
+
},
|
|
1847
|
+
},
|
|
1848
|
+
'info': chain,
|
|
1849
|
+
};
|
|
1850
1850
|
}
|
|
1851
1851
|
const firstChain = this.safeDict(chains, 0, {});
|
|
1852
1852
|
result[code] = this.safeCurrencyStructure({
|
|
@@ -2406,6 +2406,9 @@ class okx extends okx$1 {
|
|
|
2406
2406
|
if (limit === undefined) {
|
|
2407
2407
|
limit = 100; // default 100, max 100
|
|
2408
2408
|
}
|
|
2409
|
+
else {
|
|
2410
|
+
limit = Math.min(limit, 300); // max 100
|
|
2411
|
+
}
|
|
2409
2412
|
const duration = this.parseTimeframe(timeframe);
|
|
2410
2413
|
let bar = this.safeString(this.timeframes, timeframe, timeframe);
|
|
2411
2414
|
if ((timezone === 'UTC') && (duration >= 21600)) { // if utc and timeframe >= 6h
|
|
@@ -2424,6 +2427,7 @@ class okx extends okx$1 {
|
|
|
2424
2427
|
const historyBorder = now - ((1440 - 1) * durationInMilliseconds);
|
|
2425
2428
|
if (since < historyBorder) {
|
|
2426
2429
|
defaultType = 'HistoryCandles';
|
|
2430
|
+
limit = Math.min(limit, 100); // max 100 for historical endpoint
|
|
2427
2431
|
}
|
|
2428
2432
|
const startTime = Math.max(since - 1, 0);
|
|
2429
2433
|
request['before'] = startTime;
|