ccxt 4.3.57 → 4.3.59
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/alpaca.js +5 -1
- package/dist/cjs/src/base/Exchange.js +4 -4
- package/dist/cjs/src/base/errors.js +22 -22
- package/dist/cjs/src/bigone.js +21 -1
- package/dist/cjs/src/bingx.js +131 -26
- package/dist/cjs/src/bitmart.js +1 -0
- package/dist/cjs/src/btcbox.js +149 -7
- package/dist/cjs/src/bybit.js +2 -2
- package/dist/cjs/src/coinmate.js +28 -35
- package/dist/cjs/src/coinone.js +1 -1
- package/dist/cjs/src/deribit.js +15 -1
- package/dist/cjs/src/digifinex.js +32 -7
- package/dist/cjs/src/gate.js +24 -18
- package/dist/cjs/src/htx.js +10 -8
- package/dist/cjs/src/hyperliquid.js +107 -1
- package/dist/cjs/src/kucoin.js +3 -0
- package/dist/cjs/src/latoken.js +5 -1
- package/dist/cjs/src/mexc.js +11 -11
- package/dist/cjs/src/okx.js +3 -0
- package/dist/cjs/src/pro/binance.js +11 -13
- package/dist/cjs/src/pro/bingx.js +11 -8
- package/dist/cjs/src/pro/okx.js +3 -3
- package/dist/cjs/src/pro/xt.js +1108 -0
- package/dist/cjs/src/upbit.js +148 -49
- package/dist/cjs/src/woo.js +1 -1
- package/dist/cjs/src/xt.js +72 -7
- package/js/ccxt.d.ts +6 -3
- package/js/ccxt.js +5 -3
- package/js/src/abstract/bitmart.d.ts +1 -0
- package/js/src/abstract/btcbox.d.ts +1 -0
- package/js/src/abstract/kucoin.d.ts +1 -0
- package/js/src/abstract/kucoinfutures.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/alpaca.d.ts +1 -1
- package/js/src/alpaca.js +5 -1
- 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/bigone.d.ts +1 -1
- package/js/src/bigone.js +21 -1
- package/js/src/bingx.js +131 -26
- package/js/src/bitmart.js +1 -0
- package/js/src/btcbox.d.ts +4 -1
- package/js/src/btcbox.js +149 -7
- package/js/src/bybit.js +2 -2
- package/js/src/coinmate.js +28 -35
- package/js/src/coinone.js +1 -1
- 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 +24 -18
- package/js/src/htx.js +10 -8
- package/js/src/hyperliquid.d.ts +3 -1
- package/js/src/hyperliquid.js +107 -1
- package/js/src/kucoin.js +3 -0
- package/js/src/latoken.d.ts +1 -1
- package/js/src/latoken.js +5 -1
- package/js/src/mexc.js +11 -11
- package/js/src/okx.js +3 -0
- 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/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/okx.js +3 -3
- package/js/src/pro/xt.d.ts +31 -0
- package/js/src/pro/xt.js +1109 -0
- package/js/src/upbit.d.ts +0 -1
- package/js/src/upbit.js +148 -49
- package/js/src/woo.js +2 -2
- package/js/src/xt.js +72 -7
- package/package.json +1 -1
package/js/src/btcbox.js
CHANGED
|
@@ -66,7 +66,7 @@ export default class btcbox extends Exchange {
|
|
|
66
66
|
'fetchPositionsRisk': false,
|
|
67
67
|
'fetchPremiumIndexOHLCV': false,
|
|
68
68
|
'fetchTicker': true,
|
|
69
|
-
'fetchTickers':
|
|
69
|
+
'fetchTickers': true,
|
|
70
70
|
'fetchTrades': true,
|
|
71
71
|
'fetchTransfer': false,
|
|
72
72
|
'fetchTransfers': false,
|
|
@@ -95,6 +95,7 @@ export default class btcbox extends Exchange {
|
|
|
95
95
|
'depth',
|
|
96
96
|
'orders',
|
|
97
97
|
'ticker',
|
|
98
|
+
'tickers',
|
|
98
99
|
],
|
|
99
100
|
},
|
|
100
101
|
'private': {
|
|
@@ -108,12 +109,6 @@ export default class btcbox extends Exchange {
|
|
|
108
109
|
],
|
|
109
110
|
},
|
|
110
111
|
},
|
|
111
|
-
'markets': {
|
|
112
|
-
'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 }),
|
|
113
|
-
'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 }),
|
|
114
|
-
'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 }),
|
|
115
|
-
'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 }),
|
|
116
|
-
},
|
|
117
112
|
'precisionMode': TICK_SIZE,
|
|
118
113
|
'exceptions': {
|
|
119
114
|
'104': AuthenticationError,
|
|
@@ -129,6 +124,140 @@ export default class btcbox extends Exchange {
|
|
|
129
124
|
},
|
|
130
125
|
});
|
|
131
126
|
}
|
|
127
|
+
async fetchMarkets(params = {}) {
|
|
128
|
+
/**
|
|
129
|
+
* @method
|
|
130
|
+
* @name btcbox#fetchMarkets
|
|
131
|
+
* @description retrieves data on all markets for ace
|
|
132
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
133
|
+
* @returns {object[]} an array of objects representing market data
|
|
134
|
+
*/
|
|
135
|
+
const response = await this.publicGetTickers();
|
|
136
|
+
//
|
|
137
|
+
const marketIds = Object.keys(response);
|
|
138
|
+
const markets = [];
|
|
139
|
+
for (let i = 0; i < marketIds.length; i++) {
|
|
140
|
+
const marketId = marketIds[i];
|
|
141
|
+
const symbolParts = marketId.split('_');
|
|
142
|
+
const baseCurr = this.safeString(symbolParts, 0);
|
|
143
|
+
const quote = this.safeString(symbolParts, 1);
|
|
144
|
+
const quoteId = quote.toLowerCase();
|
|
145
|
+
const id = baseCurr.toLowerCase();
|
|
146
|
+
const res = response[marketId];
|
|
147
|
+
const symbol = baseCurr + '/' + quote;
|
|
148
|
+
const fee = (id === 'BTC') ? this.parseNumber('0.0005') : this.parseNumber('0.0010');
|
|
149
|
+
markets.push(this.safeMarketStructure({
|
|
150
|
+
'id': id,
|
|
151
|
+
'uppercaseId': undefined,
|
|
152
|
+
'symbol': symbol,
|
|
153
|
+
'base': baseCurr,
|
|
154
|
+
'baseId': id,
|
|
155
|
+
'quote': quote,
|
|
156
|
+
'quoteId': quoteId,
|
|
157
|
+
'settle': undefined,
|
|
158
|
+
'settleId': undefined,
|
|
159
|
+
'type': 'spot',
|
|
160
|
+
'spot': true,
|
|
161
|
+
'margin': false,
|
|
162
|
+
'swap': false,
|
|
163
|
+
'future': false,
|
|
164
|
+
'option': false,
|
|
165
|
+
'taker': fee,
|
|
166
|
+
'maker': fee,
|
|
167
|
+
'contract': false,
|
|
168
|
+
'linear': undefined,
|
|
169
|
+
'inverse': undefined,
|
|
170
|
+
'contractSize': undefined,
|
|
171
|
+
'expiry': undefined,
|
|
172
|
+
'expiryDatetime': undefined,
|
|
173
|
+
'strike': undefined,
|
|
174
|
+
'optionType': undefined,
|
|
175
|
+
'limits': {
|
|
176
|
+
'amount': {
|
|
177
|
+
'min': undefined,
|
|
178
|
+
'max': undefined,
|
|
179
|
+
},
|
|
180
|
+
'price': {
|
|
181
|
+
'min': undefined,
|
|
182
|
+
'max': undefined,
|
|
183
|
+
},
|
|
184
|
+
'cost': {
|
|
185
|
+
'min': undefined,
|
|
186
|
+
'max': undefined,
|
|
187
|
+
},
|
|
188
|
+
'leverage': {
|
|
189
|
+
'min': undefined,
|
|
190
|
+
'max': undefined,
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
'precision': {
|
|
194
|
+
'price': undefined,
|
|
195
|
+
'amount': undefined,
|
|
196
|
+
},
|
|
197
|
+
'active': undefined,
|
|
198
|
+
'created': undefined,
|
|
199
|
+
'info': res,
|
|
200
|
+
}));
|
|
201
|
+
}
|
|
202
|
+
return markets;
|
|
203
|
+
}
|
|
204
|
+
parseMarket(market) {
|
|
205
|
+
const baseId = this.safeString(market, 'base');
|
|
206
|
+
const base = this.safeCurrencyCode(baseId);
|
|
207
|
+
const quoteId = this.safeString(market, 'quote');
|
|
208
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
209
|
+
const symbol = base + '/' + quote;
|
|
210
|
+
return {
|
|
211
|
+
'id': this.safeString(market, 'symbol'),
|
|
212
|
+
'uppercaseId': undefined,
|
|
213
|
+
'symbol': symbol,
|
|
214
|
+
'base': base,
|
|
215
|
+
'baseId': baseId,
|
|
216
|
+
'quote': quote,
|
|
217
|
+
'quoteId': quoteId,
|
|
218
|
+
'settle': undefined,
|
|
219
|
+
'settleId': undefined,
|
|
220
|
+
'type': 'spot',
|
|
221
|
+
'spot': true,
|
|
222
|
+
'margin': false,
|
|
223
|
+
'swap': false,
|
|
224
|
+
'future': false,
|
|
225
|
+
'option': false,
|
|
226
|
+
'contract': false,
|
|
227
|
+
'linear': undefined,
|
|
228
|
+
'inverse': undefined,
|
|
229
|
+
'contractSize': undefined,
|
|
230
|
+
'expiry': undefined,
|
|
231
|
+
'expiryDatetime': undefined,
|
|
232
|
+
'strike': undefined,
|
|
233
|
+
'optionType': undefined,
|
|
234
|
+
'limits': {
|
|
235
|
+
'amount': {
|
|
236
|
+
'min': this.safeNumber(market, 'minLimitBaseAmount'),
|
|
237
|
+
'max': this.safeNumber(market, 'maxLimitBaseAmount'),
|
|
238
|
+
},
|
|
239
|
+
'price': {
|
|
240
|
+
'min': undefined,
|
|
241
|
+
'max': undefined,
|
|
242
|
+
},
|
|
243
|
+
'cost': {
|
|
244
|
+
'min': undefined,
|
|
245
|
+
'max': undefined,
|
|
246
|
+
},
|
|
247
|
+
'leverage': {
|
|
248
|
+
'min': undefined,
|
|
249
|
+
'max': undefined,
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
'precision': {
|
|
253
|
+
'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quotePrecision'))),
|
|
254
|
+
'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'basePrecision'))),
|
|
255
|
+
},
|
|
256
|
+
'active': undefined,
|
|
257
|
+
'created': undefined,
|
|
258
|
+
'info': market,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
132
261
|
parseBalance(response) {
|
|
133
262
|
const result = { 'info': response };
|
|
134
263
|
const codes = Object.keys(this.currencies);
|
|
@@ -227,6 +356,19 @@ export default class btcbox extends Exchange {
|
|
|
227
356
|
const response = await this.publicGetTicker(this.extend(request, params));
|
|
228
357
|
return this.parseTicker(response, market);
|
|
229
358
|
}
|
|
359
|
+
async fetchTickers(symbols = undefined, params = {}) {
|
|
360
|
+
/**
|
|
361
|
+
* @method
|
|
362
|
+
* @name btcbox#fetchTickers
|
|
363
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
364
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
365
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
366
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
367
|
+
*/
|
|
368
|
+
await this.loadMarkets();
|
|
369
|
+
const response = await this.publicGetTickers(params);
|
|
370
|
+
return this.parseTickers(response, symbols);
|
|
371
|
+
}
|
|
230
372
|
parseTrade(trade, market = undefined) {
|
|
231
373
|
//
|
|
232
374
|
// fetchTrades (public)
|
package/js/src/bybit.js
CHANGED
|
@@ -3335,13 +3335,13 @@ export default class bybit extends Exchange {
|
|
|
3335
3335
|
if (code !== undefined) {
|
|
3336
3336
|
if (code !== '0') {
|
|
3337
3337
|
const category = this.safeString(order, 'category');
|
|
3338
|
-
const
|
|
3338
|
+
const inferredMarketType = (category === 'spot') ? 'spot' : 'contract';
|
|
3339
3339
|
return this.safeOrder({
|
|
3340
3340
|
'info': order,
|
|
3341
3341
|
'status': 'rejected',
|
|
3342
3342
|
'id': this.safeString(order, 'orderId'),
|
|
3343
3343
|
'clientOrderId': this.safeString(order, 'orderLinkId'),
|
|
3344
|
-
'symbol': this.safeSymbol(this.safeString(order, 'symbol'), undefined, undefined,
|
|
3344
|
+
'symbol': this.safeSymbol(this.safeString(order, 'symbol'), undefined, undefined, inferredMarketType),
|
|
3345
3345
|
});
|
|
3346
3346
|
}
|
|
3347
3347
|
}
|
package/js/src/coinmate.js
CHANGED
|
@@ -21,7 +21,7 @@ export default class coinmate extends Exchange {
|
|
|
21
21
|
'id': 'coinmate',
|
|
22
22
|
'name': 'CoinMate',
|
|
23
23
|
'countries': ['GB', 'CZ', 'EU'],
|
|
24
|
-
'rateLimit':
|
|
24
|
+
'rateLimit': 600,
|
|
25
25
|
'has': {
|
|
26
26
|
'CORS': true,
|
|
27
27
|
'spot': true,
|
|
@@ -170,28 +170,28 @@ export default class coinmate extends Exchange {
|
|
|
170
170
|
'trading': {
|
|
171
171
|
'tierBased': true,
|
|
172
172
|
'percentage': true,
|
|
173
|
-
'
|
|
174
|
-
'
|
|
173
|
+
'taker': this.parseNumber('0.006'),
|
|
174
|
+
'maker': this.parseNumber('0.004'),
|
|
175
175
|
'tiers': {
|
|
176
176
|
'taker': [
|
|
177
|
-
[this.parseNumber('0'), this.parseNumber('0.
|
|
178
|
-
[this.parseNumber('10000'), this.parseNumber('0.
|
|
179
|
-
[this.parseNumber('100000'), this.parseNumber('0.
|
|
180
|
-
[this.parseNumber('250000'), this.parseNumber('0.
|
|
181
|
-
[this.parseNumber('500000'), this.parseNumber('0.
|
|
182
|
-
[this.parseNumber('1000000'), this.parseNumber('0.
|
|
183
|
-
[this.parseNumber('3000000'), this.parseNumber('0.
|
|
184
|
-
[this.parseNumber('15000000'), this.parseNumber('0.
|
|
177
|
+
[this.parseNumber('0'), this.parseNumber('0.006')],
|
|
178
|
+
[this.parseNumber('10000'), this.parseNumber('0.003')],
|
|
179
|
+
[this.parseNumber('100000'), this.parseNumber('0.0023')],
|
|
180
|
+
[this.parseNumber('250000'), this.parseNumber('0.0021')],
|
|
181
|
+
[this.parseNumber('500000'), this.parseNumber('0.0018')],
|
|
182
|
+
[this.parseNumber('1000000'), this.parseNumber('0.0015')],
|
|
183
|
+
[this.parseNumber('3000000'), this.parseNumber('0.0012')],
|
|
184
|
+
[this.parseNumber('15000000'), this.parseNumber('0.001')],
|
|
185
185
|
],
|
|
186
186
|
'maker': [
|
|
187
|
-
[this.parseNumber('0'), this.parseNumber('0.
|
|
188
|
-
[this.parseNumber('10000'), this.parseNumber('0.
|
|
189
|
-
[this.parseNumber('100000'), this.parseNumber('0.
|
|
190
|
-
[this.parseNumber('250000'), this.parseNumber('0.
|
|
187
|
+
[this.parseNumber('0'), this.parseNumber('0.004')],
|
|
188
|
+
[this.parseNumber('10000'), this.parseNumber('0.002')],
|
|
189
|
+
[this.parseNumber('100000'), this.parseNumber('0.0012')],
|
|
190
|
+
[this.parseNumber('250000'), this.parseNumber('0.0009')],
|
|
191
191
|
[this.parseNumber('500000'), this.parseNumber('0.0005')],
|
|
192
192
|
[this.parseNumber('1000000'), this.parseNumber('0.0003')],
|
|
193
193
|
[this.parseNumber('3000000'), this.parseNumber('0.0002')],
|
|
194
|
-
[this.parseNumber('15000000'), this.parseNumber('0')],
|
|
194
|
+
[this.parseNumber('15000000'), this.parseNumber('-0.0004')],
|
|
195
195
|
],
|
|
196
196
|
},
|
|
197
197
|
},
|
|
@@ -1096,26 +1096,19 @@ export default class coinmate extends Exchange {
|
|
|
1096
1096
|
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
1097
1097
|
}
|
|
1098
1098
|
handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
1099
|
-
if (response
|
|
1100
|
-
|
|
1101
|
-
// {"error":true,"errorMessage":"Minimum Order Size 0.01 ETH","data":null}
|
|
1102
|
-
if (response['error']) {
|
|
1103
|
-
const message = this.safeString(response, 'errorMessage');
|
|
1104
|
-
const feedback = this.id + ' ' + message;
|
|
1105
|
-
this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);
|
|
1106
|
-
this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);
|
|
1107
|
-
throw new ExchangeError(this.id + ' ' + this.json(response));
|
|
1108
|
-
}
|
|
1109
|
-
}
|
|
1099
|
+
if (response === undefined) {
|
|
1100
|
+
return undefined; // fallback to default error handler
|
|
1110
1101
|
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1102
|
+
//
|
|
1103
|
+
// {"error":true,"errorMessage":"Api internal error","data":null}
|
|
1104
|
+
// {"error":true,"errorMessage":"Access denied.","data":null}
|
|
1105
|
+
//
|
|
1106
|
+
const errorMessage = this.safeString(response, 'errorMessage');
|
|
1107
|
+
if (errorMessage !== undefined) {
|
|
1108
|
+
const feedback = this.id + ' ' + body;
|
|
1109
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], errorMessage, feedback);
|
|
1110
|
+
this.throwBroadlyMatchedException(this.exceptions['broad'], errorMessage, feedback);
|
|
1111
|
+
throw new ExchangeError(feedback); // unknown message
|
|
1119
1112
|
}
|
|
1120
1113
|
return undefined;
|
|
1121
1114
|
}
|
package/js/src/coinone.js
CHANGED
|
@@ -1173,7 +1173,7 @@ export default class coinone extends Exchange {
|
|
|
1173
1173
|
// {"result":"error","error_code":"108","error_msg":"Unknown CryptoCurrency"}
|
|
1174
1174
|
//
|
|
1175
1175
|
const errorCode = this.safeString(response, 'error_code');
|
|
1176
|
-
if (errorCode !== '0') {
|
|
1176
|
+
if (errorCode !== undefined && errorCode !== '0') {
|
|
1177
1177
|
const feedback = this.id + ' ' + body;
|
|
1178
1178
|
this.throwExactlyMatchedException(this.exceptions, errorCode, feedback);
|
|
1179
1179
|
throw new ExchangeError(feedback); // unknown message
|
package/js/src/deribit.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export default class deribit extends Exchange {
|
|
|
57
57
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
58
58
|
editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
|
|
59
59
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
60
|
-
cancelAllOrders(symbol?: Str, params?: {}): Promise<
|
|
60
|
+
cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
|
|
61
61
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
62
62
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
63
63
|
fetchOrderTrades(id: string, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
package/js/src/deribit.js
CHANGED
|
@@ -2128,7 +2128,21 @@ export default class deribit extends Exchange {
|
|
|
2128
2128
|
request['instrument_name'] = market['id'];
|
|
2129
2129
|
response = await this.privateGetCancelAllByInstrument(this.extend(request, params));
|
|
2130
2130
|
}
|
|
2131
|
-
|
|
2131
|
+
//
|
|
2132
|
+
// {
|
|
2133
|
+
// jsonrpc: '2.0',
|
|
2134
|
+
// result: '1',
|
|
2135
|
+
// usIn: '1720508354127369',
|
|
2136
|
+
// usOut: '1720508354133603',
|
|
2137
|
+
// usDiff: '6234',
|
|
2138
|
+
// testnet: true
|
|
2139
|
+
// }
|
|
2140
|
+
//
|
|
2141
|
+
return [
|
|
2142
|
+
this.safeOrder({
|
|
2143
|
+
'info': response,
|
|
2144
|
+
}),
|
|
2145
|
+
];
|
|
2132
2146
|
}
|
|
2133
2147
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2134
2148
|
/**
|
package/js/src/digifinex.d.ts
CHANGED
|
@@ -32,8 +32,9 @@ export default class digifinex extends Exchange {
|
|
|
32
32
|
createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
|
|
33
33
|
createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): any;
|
|
34
34
|
createMarketBuyOrderWithCost(symbol: string, cost: number, params?: {}): Promise<Order>;
|
|
35
|
-
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any
|
|
36
|
-
|
|
35
|
+
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<import("./base/types.js").Dictionary<any>>;
|
|
36
|
+
parseCancelOrders(response: any): any[];
|
|
37
|
+
cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<any[]>;
|
|
37
38
|
parseOrderStatus(status: Str): string;
|
|
38
39
|
parseOrder(order: Dict, market?: Market): Order;
|
|
39
40
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
package/js/src/digifinex.js
CHANGED
|
@@ -1935,8 +1935,38 @@ export default class digifinex extends Exchange {
|
|
|
1935
1935
|
if (numCanceledOrders !== 1) {
|
|
1936
1936
|
throw new OrderNotFound(this.id + ' cancelOrder() ' + id + ' not found');
|
|
1937
1937
|
}
|
|
1938
|
+
const orders = this.parseCancelOrders(response);
|
|
1939
|
+
return this.safeDict(orders, 0);
|
|
1938
1940
|
}
|
|
1939
|
-
|
|
1941
|
+
else {
|
|
1942
|
+
return this.safeOrder({
|
|
1943
|
+
'info': response,
|
|
1944
|
+
'orderId': this.safeString(response, 'data'),
|
|
1945
|
+
});
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
parseCancelOrders(response) {
|
|
1949
|
+
const success = this.safeList(response, 'success');
|
|
1950
|
+
const error = this.safeList(response, 'error');
|
|
1951
|
+
const result = [];
|
|
1952
|
+
for (let i = 0; i < success.length; i++) {
|
|
1953
|
+
const order = success[i];
|
|
1954
|
+
result.push(this.safeOrder({
|
|
1955
|
+
'info': order,
|
|
1956
|
+
'id': order,
|
|
1957
|
+
'status': 'canceled',
|
|
1958
|
+
}));
|
|
1959
|
+
}
|
|
1960
|
+
for (let i = 0; i < error.length; i++) {
|
|
1961
|
+
const order = error[i];
|
|
1962
|
+
result.push(this.safeOrder({
|
|
1963
|
+
'info': order,
|
|
1964
|
+
'id': this.safeString2(order, 'order-id', 'order_id'),
|
|
1965
|
+
'status': 'failed',
|
|
1966
|
+
'clientOrderId': this.safeString(order, 'client-order-id'),
|
|
1967
|
+
}));
|
|
1968
|
+
}
|
|
1969
|
+
return result;
|
|
1940
1970
|
}
|
|
1941
1971
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
1942
1972
|
/**
|
|
@@ -1969,12 +1999,7 @@ export default class digifinex extends Exchange {
|
|
|
1969
1999
|
// ]
|
|
1970
2000
|
// }
|
|
1971
2001
|
//
|
|
1972
|
-
|
|
1973
|
-
const numCanceledOrders = canceledOrders.length;
|
|
1974
|
-
if (numCanceledOrders < 1) {
|
|
1975
|
-
throw new OrderNotFound(this.id + ' cancelOrders() error');
|
|
1976
|
-
}
|
|
1977
|
-
return response;
|
|
2002
|
+
return this.parseCancelOrders(response);
|
|
1978
2003
|
}
|
|
1979
2004
|
parseOrderStatus(status) {
|
|
1980
2005
|
const statuses = {
|
package/js/src/gate.js
CHANGED
|
@@ -597,21 +597,21 @@ export default class gate extends Exchange {
|
|
|
597
597
|
// copied from gatev2
|
|
598
598
|
'commonCurrencies': {
|
|
599
599
|
'88MPH': 'MPH',
|
|
600
|
-
'AXIS': '
|
|
601
|
-
'BIFI': '
|
|
602
|
-
'BOX': '
|
|
603
|
-
'BYN': '
|
|
604
|
-
'EGG': '
|
|
605
|
-
'GTC': '
|
|
606
|
-
'GTC_HT': '
|
|
607
|
-
'GTC_BSC': '
|
|
608
|
-
'HIT': '
|
|
609
|
-
'MM': '
|
|
610
|
-
'MPH': '
|
|
611
|
-
'POINT': '
|
|
612
|
-
'RAI': '
|
|
613
|
-
'SBTC': '
|
|
614
|
-
'TNC': '
|
|
600
|
+
'AXIS': 'AXISDEFI',
|
|
601
|
+
'BIFI': 'BITCOINFILE',
|
|
602
|
+
'BOX': 'DEFIBOX',
|
|
603
|
+
'BYN': 'BEYONDFI',
|
|
604
|
+
'EGG': 'GOOSEFINANCE',
|
|
605
|
+
'GTC': 'GAMECOM',
|
|
606
|
+
'GTC_HT': 'GAMECOM_HT',
|
|
607
|
+
'GTC_BSC': 'GAMECOM_BSC',
|
|
608
|
+
'HIT': 'HITCHAIN',
|
|
609
|
+
'MM': 'MILLION',
|
|
610
|
+
'MPH': 'MORPHER',
|
|
611
|
+
'POINT': 'GATEPOINT',
|
|
612
|
+
'RAI': 'RAIREFLEXINDEX',
|
|
613
|
+
'SBTC': 'SUPERBITCOIN',
|
|
614
|
+
'TNC': 'TRINITYNETWORKCREDIT',
|
|
615
615
|
'VAI': 'VAIOT',
|
|
616
616
|
'TRAC': 'TRACO', // conflict with OriginTrail (TRAC)
|
|
617
617
|
},
|
|
@@ -4022,7 +4022,7 @@ export default class gate extends Exchange {
|
|
|
4022
4022
|
request['price'] = price; // set to 0 for market orders
|
|
4023
4023
|
}
|
|
4024
4024
|
else {
|
|
4025
|
-
request['price'] = this.priceToPrecision(symbol, price);
|
|
4025
|
+
request['price'] = (price === 0) ? '0' : this.priceToPrecision(symbol, price);
|
|
4026
4026
|
}
|
|
4027
4027
|
if (reduceOnly !== undefined) {
|
|
4028
4028
|
request['reduce_only'] = reduceOnly;
|
|
@@ -4113,8 +4113,8 @@ export default class gate extends Exchange {
|
|
|
4113
4113
|
request = {
|
|
4114
4114
|
'initial': {
|
|
4115
4115
|
'contract': market['id'],
|
|
4116
|
-
'size': amount,
|
|
4117
|
-
'price': this.priceToPrecision(symbol, price), // set to 0 to use market price
|
|
4116
|
+
'size': amount, // positive = buy, negative = sell, set to 0 to close the position
|
|
4117
|
+
// 'price': (price === 0) ? '0' : this.priceToPrecision (symbol, price), // set to 0 to use market price
|
|
4118
4118
|
// 'close': false, // set to true if trying to close the position
|
|
4119
4119
|
// 'tif': 'gtc', // gtc, ioc, if using market price, only ioc is supported
|
|
4120
4120
|
// 'text': clientOrderId, // web, api, app
|
|
@@ -4122,6 +4122,12 @@ export default class gate extends Exchange {
|
|
|
4122
4122
|
},
|
|
4123
4123
|
'settle': market['settleId'],
|
|
4124
4124
|
};
|
|
4125
|
+
if (type === 'market') {
|
|
4126
|
+
request['initial']['price'] = '0';
|
|
4127
|
+
}
|
|
4128
|
+
else {
|
|
4129
|
+
request['initial']['price'] = (price === 0) ? '0' : this.priceToPrecision(symbol, price);
|
|
4130
|
+
}
|
|
4125
4131
|
if (trigger === undefined) {
|
|
4126
4132
|
let rule = undefined;
|
|
4127
4133
|
let triggerOrderPrice = undefined;
|
package/js/src/htx.js
CHANGED
|
@@ -1221,17 +1221,17 @@ export default class htx extends Exchange {
|
|
|
1221
1221
|
// https://github.com/ccxt/ccxt/issues/6081
|
|
1222
1222
|
// https://github.com/ccxt/ccxt/issues/3365
|
|
1223
1223
|
// https://github.com/ccxt/ccxt/issues/2873
|
|
1224
|
-
'GET': '
|
|
1225
|
-
'GTC': '
|
|
1226
|
-
'HIT': '
|
|
1224
|
+
'GET': 'THEMIS',
|
|
1225
|
+
'GTC': 'GAMECOM',
|
|
1226
|
+
'HIT': 'HITCHAIN',
|
|
1227
1227
|
// https://github.com/ccxt/ccxt/issues/7399
|
|
1228
1228
|
// https://coinmarketcap.com/currencies/pnetwork/
|
|
1229
1229
|
// https://coinmarketcap.com/currencies/penta/markets/
|
|
1230
1230
|
// https://en.cryptonomist.ch/blog/eidoo/the-edo-to-pnt-upgrade-what-you-need-to-know-updated/
|
|
1231
|
-
'PNT': '
|
|
1232
|
-
'SBTC': '
|
|
1233
|
-
'SOUL': '
|
|
1234
|
-
'BIFI': '
|
|
1231
|
+
'PNT': 'PENTA',
|
|
1232
|
+
'SBTC': 'SUPERBITCOIN',
|
|
1233
|
+
'SOUL': 'SOULSAVER',
|
|
1234
|
+
'BIFI': 'BITCOINFILE', // conflict with Beefy.Finance https://github.com/ccxt/ccxt/issues/8706
|
|
1235
1235
|
},
|
|
1236
1236
|
});
|
|
1237
1237
|
}
|
|
@@ -3233,6 +3233,7 @@ export default class htx extends Exchange {
|
|
|
3233
3233
|
const instStatus = this.safeString(entry, 'instStatus');
|
|
3234
3234
|
const currencyActive = instStatus === 'normal';
|
|
3235
3235
|
let minPrecision = undefined;
|
|
3236
|
+
let minDeposit = undefined;
|
|
3236
3237
|
let minWithdraw = undefined;
|
|
3237
3238
|
let maxWithdraw = undefined;
|
|
3238
3239
|
let deposit = false;
|
|
@@ -3244,6 +3245,7 @@ export default class htx extends Exchange {
|
|
|
3244
3245
|
this.options['networkChainIdsByNames'][code][title] = uniqueChainId;
|
|
3245
3246
|
this.options['networkNamesByChainIds'][uniqueChainId] = title;
|
|
3246
3247
|
const networkCode = this.networkIdToCode(uniqueChainId);
|
|
3248
|
+
minDeposit = this.safeNumber(chainEntry, 'minDepositAmt');
|
|
3247
3249
|
minWithdraw = this.safeNumber(chainEntry, 'minWithdrawAmt');
|
|
3248
3250
|
maxWithdraw = this.safeNumber(chainEntry, 'maxWithdrawAmt');
|
|
3249
3251
|
const withdrawStatus = this.safeString(chainEntry, 'withdrawStatus');
|
|
@@ -3264,7 +3266,7 @@ export default class htx extends Exchange {
|
|
|
3264
3266
|
'network': networkCode,
|
|
3265
3267
|
'limits': {
|
|
3266
3268
|
'deposit': {
|
|
3267
|
-
'min':
|
|
3269
|
+
'min': minDeposit,
|
|
3268
3270
|
'max': undefined,
|
|
3269
3271
|
},
|
|
3270
3272
|
'withdraw': {
|
package/js/src/hyperliquid.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/hyperliquid.js';
|
|
2
|
-
import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, FundingRateHistory, Order, OrderType, OrderSide, Trade, Strings, Position, OrderRequest, Dict, Num, MarginModification, Currencies, CancellationRequest, int, Transaction, Currency } from './base/types.js';
|
|
2
|
+
import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, FundingRateHistory, Order, OrderType, OrderSide, Trade, Strings, Position, OrderRequest, Dict, Num, MarginModification, Currencies, CancellationRequest, int, Transaction, Currency, TradingFeeInterface } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class hyperliquid
|
|
5
5
|
* @augments Exchange
|
|
@@ -79,6 +79,8 @@ export default class hyperliquid extends Exchange {
|
|
|
79
79
|
transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
|
|
80
80
|
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
81
81
|
parseTransaction(transaction: Dict, currency?: Currency): Transaction;
|
|
82
|
+
fetchTradingFee(symbol: string, params?: {}): Promise<TradingFeeInterface>;
|
|
83
|
+
parseTradingFee(fee: Dict, market?: Market): TradingFeeInterface;
|
|
82
84
|
formatVaultAddress(address?: Str): string;
|
|
83
85
|
handlePublicAddress(methodName: string, params: Dict): any[];
|
|
84
86
|
coinToMarketId(coin: Str): string;
|