ccxt 4.3.58 → 4.3.60
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 +3 -3
- package/dist/cjs/ccxt.js +4 -2
- package/dist/cjs/src/base/Exchange.js +4 -4
- package/dist/cjs/src/base/errors.js +22 -22
- package/dist/cjs/src/binance.js +90 -1
- package/dist/cjs/src/bingx.js +467 -123
- package/dist/cjs/src/bitfinex.js +38 -4
- package/dist/cjs/src/bitmart.js +1 -0
- package/dist/cjs/src/bitso.js +4 -1
- package/dist/cjs/src/btcbox.js +149 -7
- package/dist/cjs/src/bybit.js +3 -5
- package/dist/cjs/src/cryptocom.js +14 -6
- package/dist/cjs/src/deribit.js +15 -1
- package/dist/cjs/src/digifinex.js +32 -7
- package/dist/cjs/src/gate.js +16 -17
- package/dist/cjs/src/htx.js +7 -7
- package/dist/cjs/src/hyperliquid.js +108 -2
- package/dist/cjs/src/kraken.js +1 -1
- package/dist/cjs/src/mexc.js +11 -11
- package/dist/cjs/src/okx.js +11 -2
- package/dist/cjs/src/pro/binance.js +11 -13
- package/dist/cjs/src/pro/bingx.js +11 -8
- package/dist/cjs/src/pro/cex.js +1 -1
- package/dist/cjs/src/pro/kucoin.js +35 -3
- package/dist/cjs/src/pro/phemex.js +1 -1
- package/dist/cjs/src/pro/xt.js +1112 -0
- package/dist/cjs/src/timex.js +18 -2
- package/dist/cjs/src/upbit.js +148 -49
- package/dist/cjs/src/xt.js +73 -8
- package/js/ccxt.d.ts +6 -3
- package/js/ccxt.js +5 -3
- package/js/src/abstract/bingx.d.ts +1 -1
- package/js/src/abstract/bitmart.d.ts +1 -0
- package/js/src/abstract/btcbox.d.ts +1 -0
- package/js/src/abstract/upbit.d.ts +3 -0
- package/js/src/abstract/xt.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +3 -3
- package/js/src/base/Exchange.js +5 -5
- package/js/src/base/errorHierarchy.d.ts +5 -5
- package/js/src/base/errorHierarchy.js +5 -5
- package/js/src/base/errors.d.ts +15 -15
- package/js/src/base/errors.js +22 -22
- package/js/src/binance.d.ts +1 -1
- package/js/src/binance.js +90 -1
- package/js/src/bingx.js +467 -123
- package/js/src/bitfinex.d.ts +2 -2
- package/js/src/bitfinex.js +38 -4
- package/js/src/bitmart.js +1 -0
- package/js/src/bitso.js +4 -1
- package/js/src/btcbox.d.ts +4 -1
- package/js/src/btcbox.js +149 -7
- package/js/src/bybit.js +3 -5
- package/js/src/cryptocom.js +14 -6
- package/js/src/deribit.d.ts +1 -1
- package/js/src/deribit.js +15 -1
- package/js/src/digifinex.d.ts +3 -2
- package/js/src/digifinex.js +32 -7
- package/js/src/gate.js +16 -17
- package/js/src/htx.js +7 -7
- package/js/src/hyperliquid.d.ts +3 -1
- package/js/src/hyperliquid.js +108 -2
- package/js/src/kraken.js +1 -1
- package/js/src/mexc.js +11 -11
- package/js/src/okx.js +11 -2
- package/js/src/pro/binance.js +11 -13
- package/js/src/pro/bingx.js +11 -8
- package/js/src/pro/bitmart.d.ts +3 -3
- package/js/src/pro/bitopro.d.ts +2 -2
- package/js/src/pro/cex.js +1 -1
- package/js/src/pro/coincheck.d.ts +2 -2
- package/js/src/pro/coinone.d.ts +2 -2
- package/js/src/pro/hyperliquid.d.ts +2 -2
- package/js/src/pro/kucoin.js +35 -3
- package/js/src/pro/phemex.js +1 -1
- package/js/src/pro/xt.d.ts +31 -0
- package/js/src/pro/xt.js +1113 -0
- package/js/src/timex.d.ts +2 -2
- package/js/src/timex.js +18 -2
- package/js/src/upbit.d.ts +0 -1
- package/js/src/upbit.js +148 -49
- package/js/src/xt.js +73 -8
- package/package.json +1 -1
package/dist/cjs/src/bitfinex.js
CHANGED
|
@@ -1155,7 +1155,33 @@ class bitfinex extends bitfinex$1 {
|
|
|
1155
1155
|
const request = {
|
|
1156
1156
|
'order_id': parseInt(id),
|
|
1157
1157
|
};
|
|
1158
|
-
|
|
1158
|
+
const response = await this.privatePostOrderCancel(this.extend(request, params));
|
|
1159
|
+
//
|
|
1160
|
+
// {
|
|
1161
|
+
// id: '161236928925',
|
|
1162
|
+
// cid: '1720172026812',
|
|
1163
|
+
// cid_date: '2024-07-05',
|
|
1164
|
+
// gid: null,
|
|
1165
|
+
// symbol: 'adaust',
|
|
1166
|
+
// exchange: 'bitfinex',
|
|
1167
|
+
// price: '0.33',
|
|
1168
|
+
// avg_execution_price: '0.0',
|
|
1169
|
+
// side: 'buy',
|
|
1170
|
+
// type: 'exchange limit',
|
|
1171
|
+
// timestamp: '1720172026.813',
|
|
1172
|
+
// is_live: true,
|
|
1173
|
+
// is_cancelled: false,
|
|
1174
|
+
// is_hidden: false,
|
|
1175
|
+
// oco_order: null,
|
|
1176
|
+
// was_forced: false,
|
|
1177
|
+
// original_amount: '10.0',
|
|
1178
|
+
// remaining_amount: '10.0',
|
|
1179
|
+
// executed_amount: '0.0',
|
|
1180
|
+
// src: 'api',
|
|
1181
|
+
// meta: {}
|
|
1182
|
+
// }
|
|
1183
|
+
//
|
|
1184
|
+
return this.parseOrder(response);
|
|
1159
1185
|
}
|
|
1160
1186
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
1161
1187
|
/**
|
|
@@ -1163,11 +1189,19 @@ class bitfinex extends bitfinex$1 {
|
|
|
1163
1189
|
* @name bitfinex#cancelAllOrders
|
|
1164
1190
|
* @description cancel all open orders
|
|
1165
1191
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-all-orders
|
|
1166
|
-
* @param {string} symbol
|
|
1192
|
+
* @param {string} symbol not used by bitfinex cancelAllOrders
|
|
1167
1193
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1168
1194
|
* @returns {object} response from exchange
|
|
1169
1195
|
*/
|
|
1170
|
-
|
|
1196
|
+
const response = await this.privatePostOrderCancelAll(params);
|
|
1197
|
+
//
|
|
1198
|
+
// { result: 'Submitting 1 order cancellations.' }
|
|
1199
|
+
//
|
|
1200
|
+
return [
|
|
1201
|
+
this.safeOrder({
|
|
1202
|
+
'info': response,
|
|
1203
|
+
}),
|
|
1204
|
+
];
|
|
1171
1205
|
}
|
|
1172
1206
|
parseOrder(order, market = undefined) {
|
|
1173
1207
|
//
|
|
@@ -1646,7 +1680,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
1646
1680
|
return response;
|
|
1647
1681
|
}
|
|
1648
1682
|
nonce() {
|
|
1649
|
-
return this.
|
|
1683
|
+
return this.microseconds();
|
|
1650
1684
|
}
|
|
1651
1685
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
1652
1686
|
let request = '/' + this.implodeParams(path, params);
|
package/dist/cjs/src/bitmart.js
CHANGED
package/dist/cjs/src/bitso.js
CHANGED
|
@@ -97,7 +97,10 @@ class bitso extends bitso$1 {
|
|
|
97
97
|
'urls': {
|
|
98
98
|
'logo': 'https://user-images.githubusercontent.com/51840849/87295554-11f98280-c50e-11ea-80d6-15b3bafa8cbf.jpg',
|
|
99
99
|
'api': {
|
|
100
|
-
'rest': 'https://
|
|
100
|
+
'rest': 'https://bitso.com/api',
|
|
101
|
+
},
|
|
102
|
+
'test': {
|
|
103
|
+
'rest': 'https://stage.bitso.com/api',
|
|
101
104
|
},
|
|
102
105
|
'www': 'https://bitso.com',
|
|
103
106
|
'doc': 'https://bitso.com/api_info',
|
package/dist/cjs/src/btcbox.js
CHANGED
|
@@ -63,7 +63,7 @@ class btcbox extends btcbox$1 {
|
|
|
63
63
|
'fetchPositionsRisk': false,
|
|
64
64
|
'fetchPremiumIndexOHLCV': false,
|
|
65
65
|
'fetchTicker': true,
|
|
66
|
-
'fetchTickers':
|
|
66
|
+
'fetchTickers': true,
|
|
67
67
|
'fetchTrades': true,
|
|
68
68
|
'fetchTransfer': false,
|
|
69
69
|
'fetchTransfers': false,
|
|
@@ -92,6 +92,7 @@ class btcbox extends btcbox$1 {
|
|
|
92
92
|
'depth',
|
|
93
93
|
'orders',
|
|
94
94
|
'ticker',
|
|
95
|
+
'tickers',
|
|
95
96
|
],
|
|
96
97
|
},
|
|
97
98
|
'private': {
|
|
@@ -105,12 +106,6 @@ class btcbox extends btcbox$1 {
|
|
|
105
106
|
],
|
|
106
107
|
},
|
|
107
108
|
},
|
|
108
|
-
'markets': {
|
|
109
|
-
'BTC/JPY': this.safeMarketStructure({ 'id': 'btc', 'symbol': 'BTC/JPY', 'base': 'BTC', 'quote': 'JPY', 'baseId': 'btc', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0005'), 'maker': this.parseNumber('0.0005'), 'type': 'spot', 'spot': true }),
|
|
110
|
-
'ETH/JPY': this.safeMarketStructure({ 'id': 'eth', 'symbol': 'ETH/JPY', 'base': 'ETH', 'quote': 'JPY', 'baseId': 'eth', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0010'), 'maker': this.parseNumber('0.0010'), 'type': 'spot', 'spot': true }),
|
|
111
|
-
'LTC/JPY': this.safeMarketStructure({ 'id': 'ltc', 'symbol': 'LTC/JPY', 'base': 'LTC', 'quote': 'JPY', 'baseId': 'ltc', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0010'), 'maker': this.parseNumber('0.0010'), 'type': 'spot', 'spot': true }),
|
|
112
|
-
'BCH/JPY': this.safeMarketStructure({ 'id': 'bch', 'symbol': 'BCH/JPY', 'base': 'BCH', 'quote': 'JPY', 'baseId': 'bch', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0010'), 'maker': this.parseNumber('0.0010'), 'type': 'spot', 'spot': true }),
|
|
113
|
-
},
|
|
114
109
|
'precisionMode': number.TICK_SIZE,
|
|
115
110
|
'exceptions': {
|
|
116
111
|
'104': errors.AuthenticationError,
|
|
@@ -126,6 +121,140 @@ class btcbox extends btcbox$1 {
|
|
|
126
121
|
},
|
|
127
122
|
});
|
|
128
123
|
}
|
|
124
|
+
async fetchMarkets(params = {}) {
|
|
125
|
+
/**
|
|
126
|
+
* @method
|
|
127
|
+
* @name btcbox#fetchMarkets
|
|
128
|
+
* @description retrieves data on all markets for ace
|
|
129
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
130
|
+
* @returns {object[]} an array of objects representing market data
|
|
131
|
+
*/
|
|
132
|
+
const response = await this.publicGetTickers();
|
|
133
|
+
//
|
|
134
|
+
const marketIds = Object.keys(response);
|
|
135
|
+
const markets = [];
|
|
136
|
+
for (let i = 0; i < marketIds.length; i++) {
|
|
137
|
+
const marketId = marketIds[i];
|
|
138
|
+
const symbolParts = marketId.split('_');
|
|
139
|
+
const baseCurr = this.safeString(symbolParts, 0);
|
|
140
|
+
const quote = this.safeString(symbolParts, 1);
|
|
141
|
+
const quoteId = quote.toLowerCase();
|
|
142
|
+
const id = baseCurr.toLowerCase();
|
|
143
|
+
const res = response[marketId];
|
|
144
|
+
const symbol = baseCurr + '/' + quote;
|
|
145
|
+
const fee = (id === 'BTC') ? this.parseNumber('0.0005') : this.parseNumber('0.0010');
|
|
146
|
+
markets.push(this.safeMarketStructure({
|
|
147
|
+
'id': id,
|
|
148
|
+
'uppercaseId': undefined,
|
|
149
|
+
'symbol': symbol,
|
|
150
|
+
'base': baseCurr,
|
|
151
|
+
'baseId': id,
|
|
152
|
+
'quote': quote,
|
|
153
|
+
'quoteId': quoteId,
|
|
154
|
+
'settle': undefined,
|
|
155
|
+
'settleId': undefined,
|
|
156
|
+
'type': 'spot',
|
|
157
|
+
'spot': true,
|
|
158
|
+
'margin': false,
|
|
159
|
+
'swap': false,
|
|
160
|
+
'future': false,
|
|
161
|
+
'option': false,
|
|
162
|
+
'taker': fee,
|
|
163
|
+
'maker': fee,
|
|
164
|
+
'contract': false,
|
|
165
|
+
'linear': undefined,
|
|
166
|
+
'inverse': undefined,
|
|
167
|
+
'contractSize': undefined,
|
|
168
|
+
'expiry': undefined,
|
|
169
|
+
'expiryDatetime': undefined,
|
|
170
|
+
'strike': undefined,
|
|
171
|
+
'optionType': undefined,
|
|
172
|
+
'limits': {
|
|
173
|
+
'amount': {
|
|
174
|
+
'min': undefined,
|
|
175
|
+
'max': undefined,
|
|
176
|
+
},
|
|
177
|
+
'price': {
|
|
178
|
+
'min': undefined,
|
|
179
|
+
'max': undefined,
|
|
180
|
+
},
|
|
181
|
+
'cost': {
|
|
182
|
+
'min': undefined,
|
|
183
|
+
'max': undefined,
|
|
184
|
+
},
|
|
185
|
+
'leverage': {
|
|
186
|
+
'min': undefined,
|
|
187
|
+
'max': undefined,
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
'precision': {
|
|
191
|
+
'price': undefined,
|
|
192
|
+
'amount': undefined,
|
|
193
|
+
},
|
|
194
|
+
'active': undefined,
|
|
195
|
+
'created': undefined,
|
|
196
|
+
'info': res,
|
|
197
|
+
}));
|
|
198
|
+
}
|
|
199
|
+
return markets;
|
|
200
|
+
}
|
|
201
|
+
parseMarket(market) {
|
|
202
|
+
const baseId = this.safeString(market, 'base');
|
|
203
|
+
const base = this.safeCurrencyCode(baseId);
|
|
204
|
+
const quoteId = this.safeString(market, 'quote');
|
|
205
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
206
|
+
const symbol = base + '/' + quote;
|
|
207
|
+
return {
|
|
208
|
+
'id': this.safeString(market, 'symbol'),
|
|
209
|
+
'uppercaseId': undefined,
|
|
210
|
+
'symbol': symbol,
|
|
211
|
+
'base': base,
|
|
212
|
+
'baseId': baseId,
|
|
213
|
+
'quote': quote,
|
|
214
|
+
'quoteId': quoteId,
|
|
215
|
+
'settle': undefined,
|
|
216
|
+
'settleId': undefined,
|
|
217
|
+
'type': 'spot',
|
|
218
|
+
'spot': true,
|
|
219
|
+
'margin': false,
|
|
220
|
+
'swap': false,
|
|
221
|
+
'future': false,
|
|
222
|
+
'option': false,
|
|
223
|
+
'contract': false,
|
|
224
|
+
'linear': undefined,
|
|
225
|
+
'inverse': undefined,
|
|
226
|
+
'contractSize': undefined,
|
|
227
|
+
'expiry': undefined,
|
|
228
|
+
'expiryDatetime': undefined,
|
|
229
|
+
'strike': undefined,
|
|
230
|
+
'optionType': undefined,
|
|
231
|
+
'limits': {
|
|
232
|
+
'amount': {
|
|
233
|
+
'min': this.safeNumber(market, 'minLimitBaseAmount'),
|
|
234
|
+
'max': this.safeNumber(market, 'maxLimitBaseAmount'),
|
|
235
|
+
},
|
|
236
|
+
'price': {
|
|
237
|
+
'min': undefined,
|
|
238
|
+
'max': undefined,
|
|
239
|
+
},
|
|
240
|
+
'cost': {
|
|
241
|
+
'min': undefined,
|
|
242
|
+
'max': undefined,
|
|
243
|
+
},
|
|
244
|
+
'leverage': {
|
|
245
|
+
'min': undefined,
|
|
246
|
+
'max': undefined,
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
'precision': {
|
|
250
|
+
'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quotePrecision'))),
|
|
251
|
+
'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'basePrecision'))),
|
|
252
|
+
},
|
|
253
|
+
'active': undefined,
|
|
254
|
+
'created': undefined,
|
|
255
|
+
'info': market,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
129
258
|
parseBalance(response) {
|
|
130
259
|
const result = { 'info': response };
|
|
131
260
|
const codes = Object.keys(this.currencies);
|
|
@@ -224,6 +353,19 @@ class btcbox extends btcbox$1 {
|
|
|
224
353
|
const response = await this.publicGetTicker(this.extend(request, params));
|
|
225
354
|
return this.parseTicker(response, market);
|
|
226
355
|
}
|
|
356
|
+
async fetchTickers(symbols = undefined, params = {}) {
|
|
357
|
+
/**
|
|
358
|
+
* @method
|
|
359
|
+
* @name btcbox#fetchTickers
|
|
360
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
361
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
362
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
363
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
364
|
+
*/
|
|
365
|
+
await this.loadMarkets();
|
|
366
|
+
const response = await this.publicGetTickers(params);
|
|
367
|
+
return this.parseTickers(response, symbols);
|
|
368
|
+
}
|
|
227
369
|
parseTrade(trade, market = undefined) {
|
|
228
370
|
//
|
|
229
371
|
// fetchTrades (public)
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -3332,13 +3332,13 @@ class bybit extends bybit$1 {
|
|
|
3332
3332
|
if (code !== undefined) {
|
|
3333
3333
|
if (code !== '0') {
|
|
3334
3334
|
const category = this.safeString(order, 'category');
|
|
3335
|
-
const
|
|
3335
|
+
const inferredMarketType = (category === 'spot') ? 'spot' : 'contract';
|
|
3336
3336
|
return this.safeOrder({
|
|
3337
3337
|
'info': order,
|
|
3338
3338
|
'status': 'rejected',
|
|
3339
3339
|
'id': this.safeString(order, 'orderId'),
|
|
3340
3340
|
'clientOrderId': this.safeString(order, 'orderLinkId'),
|
|
3341
|
-
'symbol': this.safeSymbol(this.safeString(order, 'symbol'), undefined, undefined,
|
|
3341
|
+
'symbol': this.safeSymbol(this.safeString(order, 'symbol'), undefined, undefined, inferredMarketType),
|
|
3342
3342
|
});
|
|
3343
3343
|
}
|
|
3344
3344
|
}
|
|
@@ -4446,10 +4446,8 @@ class bybit extends bybit$1 {
|
|
|
4446
4446
|
* @name bybit#cancelOrdersForSymbols
|
|
4447
4447
|
* @description cancel multiple orders for multiple symbols
|
|
4448
4448
|
* @see https://bybit-exchange.github.io/docs/v5/order/batch-cancel
|
|
4449
|
-
* @param {
|
|
4450
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
4449
|
+
* @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
4451
4450
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4452
|
-
* @param {string[]} [params.clientOrderIds] client order ids
|
|
4453
4451
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4454
4452
|
*/
|
|
4455
4453
|
await this.loadMarkets();
|
|
@@ -814,15 +814,23 @@ class cryptocom extends cryptocom$1 {
|
|
|
814
814
|
'instrument_name': market['id'],
|
|
815
815
|
'timeframe': this.safeString(this.timeframes, timeframe, timeframe),
|
|
816
816
|
};
|
|
817
|
-
if (since !== undefined) {
|
|
818
|
-
request['start_ts'] = since;
|
|
819
|
-
}
|
|
820
817
|
if (limit !== undefined) {
|
|
821
818
|
request['count'] = limit;
|
|
822
819
|
}
|
|
823
|
-
const
|
|
820
|
+
const now = this.microseconds();
|
|
821
|
+
const duration = this.parseTimeframe(timeframe);
|
|
822
|
+
const until = this.safeInteger(params, 'until', now);
|
|
824
823
|
params = this.omit(params, ['until']);
|
|
825
|
-
if (
|
|
824
|
+
if (since !== undefined) {
|
|
825
|
+
request['start_ts'] = since;
|
|
826
|
+
if (limit !== undefined) {
|
|
827
|
+
request['end_ts'] = this.sum(since, duration * (limit + 1) * 1000) - 1;
|
|
828
|
+
}
|
|
829
|
+
else {
|
|
830
|
+
request['end_ts'] = until;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
else {
|
|
826
834
|
request['end_ts'] = until;
|
|
827
835
|
}
|
|
828
836
|
const response = await this.v1PublicGetPublicGetCandlestick(this.extend(request, params));
|
|
@@ -1475,7 +1483,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
1475
1483
|
* @name cryptocom#cancelOrdersForSymbols
|
|
1476
1484
|
* @description cancel multiple orders for multiple symbols
|
|
1477
1485
|
* @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-cancel-order-list-list
|
|
1478
|
-
* @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol
|
|
1486
|
+
* @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
1479
1487
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1480
1488
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1481
1489
|
*/
|
package/dist/cjs/src/deribit.js
CHANGED
|
@@ -2125,7 +2125,21 @@ class deribit extends deribit$1 {
|
|
|
2125
2125
|
request['instrument_name'] = market['id'];
|
|
2126
2126
|
response = await this.privateGetCancelAllByInstrument(this.extend(request, params));
|
|
2127
2127
|
}
|
|
2128
|
-
|
|
2128
|
+
//
|
|
2129
|
+
// {
|
|
2130
|
+
// jsonrpc: '2.0',
|
|
2131
|
+
// result: '1',
|
|
2132
|
+
// usIn: '1720508354127369',
|
|
2133
|
+
// usOut: '1720508354133603',
|
|
2134
|
+
// usDiff: '6234',
|
|
2135
|
+
// testnet: true
|
|
2136
|
+
// }
|
|
2137
|
+
//
|
|
2138
|
+
return [
|
|
2139
|
+
this.safeOrder({
|
|
2140
|
+
'info': response,
|
|
2141
|
+
}),
|
|
2142
|
+
];
|
|
2129
2143
|
}
|
|
2130
2144
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2131
2145
|
/**
|
|
@@ -1932,8 +1932,38 @@ class digifinex extends digifinex$1 {
|
|
|
1932
1932
|
if (numCanceledOrders !== 1) {
|
|
1933
1933
|
throw new errors.OrderNotFound(this.id + ' cancelOrder() ' + id + ' not found');
|
|
1934
1934
|
}
|
|
1935
|
+
const orders = this.parseCancelOrders(response);
|
|
1936
|
+
return this.safeDict(orders, 0);
|
|
1935
1937
|
}
|
|
1936
|
-
|
|
1938
|
+
else {
|
|
1939
|
+
return this.safeOrder({
|
|
1940
|
+
'info': response,
|
|
1941
|
+
'orderId': this.safeString(response, 'data'),
|
|
1942
|
+
});
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
parseCancelOrders(response) {
|
|
1946
|
+
const success = this.safeList(response, 'success');
|
|
1947
|
+
const error = this.safeList(response, 'error');
|
|
1948
|
+
const result = [];
|
|
1949
|
+
for (let i = 0; i < success.length; i++) {
|
|
1950
|
+
const order = success[i];
|
|
1951
|
+
result.push(this.safeOrder({
|
|
1952
|
+
'info': order,
|
|
1953
|
+
'id': order,
|
|
1954
|
+
'status': 'canceled',
|
|
1955
|
+
}));
|
|
1956
|
+
}
|
|
1957
|
+
for (let i = 0; i < error.length; i++) {
|
|
1958
|
+
const order = error[i];
|
|
1959
|
+
result.push(this.safeOrder({
|
|
1960
|
+
'info': order,
|
|
1961
|
+
'id': this.safeString2(order, 'order-id', 'order_id'),
|
|
1962
|
+
'status': 'failed',
|
|
1963
|
+
'clientOrderId': this.safeString(order, 'client-order-id'),
|
|
1964
|
+
}));
|
|
1965
|
+
}
|
|
1966
|
+
return result;
|
|
1937
1967
|
}
|
|
1938
1968
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
1939
1969
|
/**
|
|
@@ -1966,12 +1996,7 @@ class digifinex extends digifinex$1 {
|
|
|
1966
1996
|
// ]
|
|
1967
1997
|
// }
|
|
1968
1998
|
//
|
|
1969
|
-
|
|
1970
|
-
const numCanceledOrders = canceledOrders.length;
|
|
1971
|
-
if (numCanceledOrders < 1) {
|
|
1972
|
-
throw new errors.OrderNotFound(this.id + ' cancelOrders() error');
|
|
1973
|
-
}
|
|
1974
|
-
return response;
|
|
1999
|
+
return this.parseCancelOrders(response);
|
|
1975
2000
|
}
|
|
1976
2001
|
parseOrderStatus(status) {
|
|
1977
2002
|
const statuses = {
|
package/dist/cjs/src/gate.js
CHANGED
|
@@ -594,21 +594,21 @@ class gate extends gate$1 {
|
|
|
594
594
|
// copied from gatev2
|
|
595
595
|
'commonCurrencies': {
|
|
596
596
|
'88MPH': 'MPH',
|
|
597
|
-
'AXIS': '
|
|
598
|
-
'BIFI': '
|
|
599
|
-
'BOX': '
|
|
600
|
-
'BYN': '
|
|
601
|
-
'EGG': '
|
|
602
|
-
'GTC': '
|
|
603
|
-
'GTC_HT': '
|
|
604
|
-
'GTC_BSC': '
|
|
605
|
-
'HIT': '
|
|
606
|
-
'MM': '
|
|
607
|
-
'MPH': '
|
|
608
|
-
'POINT': '
|
|
609
|
-
'RAI': '
|
|
610
|
-
'SBTC': '
|
|
611
|
-
'TNC': '
|
|
597
|
+
'AXIS': 'AXISDEFI',
|
|
598
|
+
'BIFI': 'BITCOINFILE',
|
|
599
|
+
'BOX': 'DEFIBOX',
|
|
600
|
+
'BYN': 'BEYONDFI',
|
|
601
|
+
'EGG': 'GOOSEFINANCE',
|
|
602
|
+
'GTC': 'GAMECOM',
|
|
603
|
+
'GTC_HT': 'GAMECOM_HT',
|
|
604
|
+
'GTC_BSC': 'GAMECOM_BSC',
|
|
605
|
+
'HIT': 'HITCHAIN',
|
|
606
|
+
'MM': 'MILLION',
|
|
607
|
+
'MPH': 'MORPHER',
|
|
608
|
+
'POINT': 'GATEPOINT',
|
|
609
|
+
'RAI': 'RAIREFLEXINDEX',
|
|
610
|
+
'SBTC': 'SUPERBITCOIN',
|
|
611
|
+
'TNC': 'TRINITYNETWORKCREDIT',
|
|
612
612
|
'VAI': 'VAIOT',
|
|
613
613
|
'TRAC': 'TRACO', // conflict with OriginTrail (TRAC)
|
|
614
614
|
},
|
|
@@ -5137,8 +5137,7 @@ class gate extends gate$1 {
|
|
|
5137
5137
|
* @name gate#cancelOrdersForSymbols
|
|
5138
5138
|
* @description cancel multiple orders for multiple symbols
|
|
5139
5139
|
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
|
|
5140
|
-
* @param {
|
|
5141
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
5140
|
+
* @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
5142
5141
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5143
5142
|
* @param {string[]} [params.clientOrderIds] client order ids
|
|
5144
5143
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
package/dist/cjs/src/htx.js
CHANGED
|
@@ -1218,17 +1218,17 @@ class htx extends htx$1 {
|
|
|
1218
1218
|
// https://github.com/ccxt/ccxt/issues/6081
|
|
1219
1219
|
// https://github.com/ccxt/ccxt/issues/3365
|
|
1220
1220
|
// https://github.com/ccxt/ccxt/issues/2873
|
|
1221
|
-
'GET': '
|
|
1222
|
-
'GTC': '
|
|
1223
|
-
'HIT': '
|
|
1221
|
+
'GET': 'THEMIS',
|
|
1222
|
+
'GTC': 'GAMECOM',
|
|
1223
|
+
'HIT': 'HITCHAIN',
|
|
1224
1224
|
// https://github.com/ccxt/ccxt/issues/7399
|
|
1225
1225
|
// https://coinmarketcap.com/currencies/pnetwork/
|
|
1226
1226
|
// https://coinmarketcap.com/currencies/penta/markets/
|
|
1227
1227
|
// https://en.cryptonomist.ch/blog/eidoo/the-edo-to-pnt-upgrade-what-you-need-to-know-updated/
|
|
1228
|
-
'PNT': '
|
|
1229
|
-
'SBTC': '
|
|
1230
|
-
'SOUL': '
|
|
1231
|
-
'BIFI': '
|
|
1228
|
+
'PNT': 'PENTA',
|
|
1229
|
+
'SBTC': 'SUPERBITCOIN',
|
|
1230
|
+
'SOUL': 'SOULSAVER',
|
|
1231
|
+
'BIFI': 'BITCOINFILE', // conflict with Beefy.Finance https://github.com/ccxt/ccxt/issues/8706
|
|
1232
1232
|
},
|
|
1233
1233
|
});
|
|
1234
1234
|
}
|
|
@@ -98,7 +98,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
98
98
|
'fetchTickers': false,
|
|
99
99
|
'fetchTime': false,
|
|
100
100
|
'fetchTrades': true,
|
|
101
|
-
'fetchTradingFee':
|
|
101
|
+
'fetchTradingFee': true,
|
|
102
102
|
'fetchTradingFees': false,
|
|
103
103
|
'fetchTransfer': false,
|
|
104
104
|
'fetchTransfers': false,
|
|
@@ -1315,7 +1315,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1315
1315
|
* @description cancel multiple orders for multiple symbols
|
|
1316
1316
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
|
|
1317
1317
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
|
|
1318
|
-
* @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol
|
|
1318
|
+
* @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
1319
1319
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1320
1320
|
* @param {string} [params.vaultAddress] the vault address
|
|
1321
1321
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -2516,6 +2516,112 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
2516
2516
|
'fee': undefined,
|
|
2517
2517
|
};
|
|
2518
2518
|
}
|
|
2519
|
+
async fetchTradingFee(symbol, params = {}) {
|
|
2520
|
+
/**
|
|
2521
|
+
* @method
|
|
2522
|
+
* @name hyperliquid#fetchTradingFee
|
|
2523
|
+
* @description fetch the trading fees for a market
|
|
2524
|
+
* @param {string} symbol unified market symbol
|
|
2525
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2526
|
+
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
2527
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
2528
|
+
*/
|
|
2529
|
+
await this.loadMarkets();
|
|
2530
|
+
let userAddress = undefined;
|
|
2531
|
+
[userAddress, params] = this.handlePublicAddress('fetchTradingFee', params);
|
|
2532
|
+
const market = this.market(symbol);
|
|
2533
|
+
const request = {
|
|
2534
|
+
'type': 'userFees',
|
|
2535
|
+
'user': userAddress,
|
|
2536
|
+
};
|
|
2537
|
+
const response = await this.publicPostInfo(this.extend(request, params));
|
|
2538
|
+
//
|
|
2539
|
+
// {
|
|
2540
|
+
// "dailyUserVlm": [
|
|
2541
|
+
// {
|
|
2542
|
+
// "date": "2024-07-08",
|
|
2543
|
+
// "userCross": "0.0",
|
|
2544
|
+
// "userAdd": "0.0",
|
|
2545
|
+
// "exchange": "90597185.23639999"
|
|
2546
|
+
// }
|
|
2547
|
+
// ],
|
|
2548
|
+
// "feeSchedule": {
|
|
2549
|
+
// "cross": "0.00035",
|
|
2550
|
+
// "add": "0.0001",
|
|
2551
|
+
// "tiers": {
|
|
2552
|
+
// "vip": [
|
|
2553
|
+
// {
|
|
2554
|
+
// "ntlCutoff": "5000000.0",
|
|
2555
|
+
// "cross": "0.0003",
|
|
2556
|
+
// "add": "0.00005"
|
|
2557
|
+
// }
|
|
2558
|
+
// ],
|
|
2559
|
+
// "mm": [
|
|
2560
|
+
// {
|
|
2561
|
+
// "makerFractionCutoff": "0.005",
|
|
2562
|
+
// "add": "-0.00001"
|
|
2563
|
+
// }
|
|
2564
|
+
// ]
|
|
2565
|
+
// },
|
|
2566
|
+
// "referralDiscount": "0.04"
|
|
2567
|
+
// },
|
|
2568
|
+
// "userCrossRate": "0.00035",
|
|
2569
|
+
// "userAddRate": "0.0001",
|
|
2570
|
+
// "activeReferralDiscount": "0.0"
|
|
2571
|
+
// }
|
|
2572
|
+
//
|
|
2573
|
+
const data = {
|
|
2574
|
+
'userCrossRate': this.safeString(response, 'userCrossRate'),
|
|
2575
|
+
'userAddRate': this.safeString(response, 'userAddRate'),
|
|
2576
|
+
};
|
|
2577
|
+
return this.parseTradingFee(data, market);
|
|
2578
|
+
}
|
|
2579
|
+
parseTradingFee(fee, market = undefined) {
|
|
2580
|
+
//
|
|
2581
|
+
// {
|
|
2582
|
+
// "dailyUserVlm": [
|
|
2583
|
+
// {
|
|
2584
|
+
// "date": "2024-07-08",
|
|
2585
|
+
// "userCross": "0.0",
|
|
2586
|
+
// "userAdd": "0.0",
|
|
2587
|
+
// "exchange": "90597185.23639999"
|
|
2588
|
+
// }
|
|
2589
|
+
// ],
|
|
2590
|
+
// "feeSchedule": {
|
|
2591
|
+
// "cross": "0.00035",
|
|
2592
|
+
// "add": "0.0001",
|
|
2593
|
+
// "tiers": {
|
|
2594
|
+
// "vip": [
|
|
2595
|
+
// {
|
|
2596
|
+
// "ntlCutoff": "5000000.0",
|
|
2597
|
+
// "cross": "0.0003",
|
|
2598
|
+
// "add": "0.00005"
|
|
2599
|
+
// }
|
|
2600
|
+
// ],
|
|
2601
|
+
// "mm": [
|
|
2602
|
+
// {
|
|
2603
|
+
// "makerFractionCutoff": "0.005",
|
|
2604
|
+
// "add": "-0.00001"
|
|
2605
|
+
// }
|
|
2606
|
+
// ]
|
|
2607
|
+
// },
|
|
2608
|
+
// "referralDiscount": "0.04"
|
|
2609
|
+
// },
|
|
2610
|
+
// "userCrossRate": "0.00035",
|
|
2611
|
+
// "userAddRate": "0.0001",
|
|
2612
|
+
// "activeReferralDiscount": "0.0"
|
|
2613
|
+
// }
|
|
2614
|
+
//
|
|
2615
|
+
const symbol = this.safeSymbol(undefined, market);
|
|
2616
|
+
return {
|
|
2617
|
+
'info': fee,
|
|
2618
|
+
'symbol': symbol,
|
|
2619
|
+
'maker': this.safeNumber(fee, 'userAddRate'),
|
|
2620
|
+
'taker': this.safeNumber(fee, 'userCrossRate'),
|
|
2621
|
+
'percentage': undefined,
|
|
2622
|
+
'tierBased': undefined,
|
|
2623
|
+
};
|
|
2624
|
+
}
|
|
2519
2625
|
formatVaultAddress(address = undefined) {
|
|
2520
2626
|
if (address === undefined) {
|
|
2521
2627
|
return undefined;
|
package/dist/cjs/src/kraken.js
CHANGED
|
@@ -1049,7 +1049,7 @@ class kraken extends kraken$1 {
|
|
|
1049
1049
|
else {
|
|
1050
1050
|
direction = 'in';
|
|
1051
1051
|
}
|
|
1052
|
-
const timestamp = this.
|
|
1052
|
+
const timestamp = this.safeIntegerProduct(item, 'time', 1000);
|
|
1053
1053
|
return {
|
|
1054
1054
|
'info': item,
|
|
1055
1055
|
'id': id,
|