ccxt 4.2.47 → 4.2.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/ccxt.browser.js +304 -54
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binance.js +3 -1
- package/dist/cjs/src/idex.js +52 -1
- package/dist/cjs/src/indodax.js +120 -19
- package/dist/cjs/src/okx.js +32 -5
- package/dist/cjs/src/pro/hitbtc.js +6 -11
- package/dist/cjs/src/upbit.js +90 -16
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/indodax.d.ts +9 -8
- package/js/src/binance.js +3 -1
- package/js/src/idex.d.ts +7 -0
- package/js/src/idex.js +52 -1
- package/js/src/indodax.d.ts +3 -1
- package/js/src/indodax.js +120 -19
- package/js/src/okx.js +32 -5
- package/js/src/pro/hitbtc.js +6 -11
- package/js/src/upbit.d.ts +2 -0
- package/js/src/upbit.js +90 -16
- package/package.json +1 -1
|
@@ -220,7 +220,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
220
220
|
'symbols': [market['id']],
|
|
221
221
|
},
|
|
222
222
|
};
|
|
223
|
-
const orderbook = await this.subscribePublic(name,
|
|
223
|
+
const orderbook = await this.subscribePublic(name, 'orderbooks', [symbol], this.deepExtend(request, params));
|
|
224
224
|
return orderbook.limit();
|
|
225
225
|
}
|
|
226
226
|
handleOrderBook(client, message) {
|
|
@@ -249,13 +249,12 @@ class hitbtc extends hitbtc$1 {
|
|
|
249
249
|
//
|
|
250
250
|
const data = this.safeValue2(message, 'snapshot', 'update', {});
|
|
251
251
|
const marketIds = Object.keys(data);
|
|
252
|
-
const channel = this.safeString(message, 'ch');
|
|
253
252
|
for (let i = 0; i < marketIds.length; i++) {
|
|
254
253
|
const marketId = marketIds[i];
|
|
255
254
|
const market = this.safeMarket(marketId);
|
|
256
255
|
const symbol = market['symbol'];
|
|
257
256
|
const item = data[marketId];
|
|
258
|
-
const messageHash =
|
|
257
|
+
const messageHash = 'orderbooks::' + symbol;
|
|
259
258
|
if (!(symbol in this.orderbooks)) {
|
|
260
259
|
const subscription = this.safeValue(client.subscriptions, messageHash, {});
|
|
261
260
|
const limit = this.safeInteger(subscription, 'limit');
|
|
@@ -313,7 +312,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
313
312
|
'symbols': [market['id']],
|
|
314
313
|
},
|
|
315
314
|
};
|
|
316
|
-
const result = await this.subscribePublic(name, '
|
|
315
|
+
const result = await this.subscribePublic(name, 'tickers', [symbol], this.deepExtend(request, params));
|
|
317
316
|
return this.safeValue(result, symbol);
|
|
318
317
|
}
|
|
319
318
|
async watchTickers(symbols = undefined, params = {}) {
|
|
@@ -396,7 +395,6 @@ class hitbtc extends hitbtc$1 {
|
|
|
396
395
|
//
|
|
397
396
|
const data = this.safeValue(message, 'data', {});
|
|
398
397
|
const marketIds = Object.keys(data);
|
|
399
|
-
const channel = this.safeString(message, 'ch');
|
|
400
398
|
const newTickers = {};
|
|
401
399
|
for (let i = 0; i < marketIds.length; i++) {
|
|
402
400
|
const marketId = marketIds[i];
|
|
@@ -405,8 +403,6 @@ class hitbtc extends hitbtc$1 {
|
|
|
405
403
|
const ticker = this.parseWsTicker(data[marketId], market);
|
|
406
404
|
this.tickers[symbol] = ticker;
|
|
407
405
|
newTickers[symbol] = ticker;
|
|
408
|
-
const messageHash = channel + '::' + symbol;
|
|
409
|
-
client.resolve(newTickers, messageHash);
|
|
410
406
|
}
|
|
411
407
|
client.resolve(newTickers, 'tickers');
|
|
412
408
|
const messageHashes = this.findMessageHashes(client, 'tickers::');
|
|
@@ -422,7 +418,6 @@ class hitbtc extends hitbtc$1 {
|
|
|
422
418
|
client.resolve(tickers, messageHash);
|
|
423
419
|
}
|
|
424
420
|
}
|
|
425
|
-
client.resolve(this.tickers, channel);
|
|
426
421
|
return message;
|
|
427
422
|
}
|
|
428
423
|
parseWsTicker(ticker, market = undefined) {
|
|
@@ -503,7 +498,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
503
498
|
request['limit'] = limit;
|
|
504
499
|
}
|
|
505
500
|
const name = 'trades';
|
|
506
|
-
const trades = await this.subscribePublic(name,
|
|
501
|
+
const trades = await this.subscribePublic(name, 'trades', [symbol], this.deepExtend(request, params));
|
|
507
502
|
if (this.newUpdates) {
|
|
508
503
|
limit = trades.getLimit(symbol, limit);
|
|
509
504
|
}
|
|
@@ -632,7 +627,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
632
627
|
if (limit !== undefined) {
|
|
633
628
|
request['params']['limit'] = limit;
|
|
634
629
|
}
|
|
635
|
-
const ohlcv = await this.subscribePublic(name,
|
|
630
|
+
const ohlcv = await this.subscribePublic(name, 'candles', [symbol], this.deepExtend(request, params));
|
|
636
631
|
if (this.newUpdates) {
|
|
637
632
|
limit = ohlcv.getLimit(symbol, limit);
|
|
638
633
|
}
|
|
@@ -693,7 +688,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
693
688
|
for (let j = 0; j < ohlcvs.length; j++) {
|
|
694
689
|
stored.append(ohlcvs[j]);
|
|
695
690
|
}
|
|
696
|
-
const messageHash =
|
|
691
|
+
const messageHash = 'candles::' + symbol;
|
|
697
692
|
client.resolve(stored, messageHash);
|
|
698
693
|
}
|
|
699
694
|
return message;
|
package/dist/cjs/src/upbit.js
CHANGED
|
@@ -43,6 +43,7 @@ class upbit extends upbit$1 {
|
|
|
43
43
|
'fetchClosedOrders': true,
|
|
44
44
|
'fetchDepositAddress': true,
|
|
45
45
|
'fetchDepositAddresses': true,
|
|
46
|
+
'fetchDeposit': true,
|
|
46
47
|
'fetchDeposits': true,
|
|
47
48
|
'fetchFundingHistory': false,
|
|
48
49
|
'fetchFundingRate': false,
|
|
@@ -68,6 +69,7 @@ class upbit extends upbit$1 {
|
|
|
68
69
|
'fetchTradingFee': true,
|
|
69
70
|
'fetchTradingFees': false,
|
|
70
71
|
'fetchTransactions': false,
|
|
72
|
+
'fetchWithdrawal': true,
|
|
71
73
|
'fetchWithdrawals': true,
|
|
72
74
|
'transfer': false,
|
|
73
75
|
'withdraw': true,
|
|
@@ -1193,6 +1195,45 @@ class upbit extends upbit$1 {
|
|
|
1193
1195
|
//
|
|
1194
1196
|
return this.parseTransactions(response, currency, since, limit);
|
|
1195
1197
|
}
|
|
1198
|
+
async fetchDeposit(id, code = undefined, params = {}) {
|
|
1199
|
+
/**
|
|
1200
|
+
* @method
|
|
1201
|
+
* @name upbit#fetchDeposit
|
|
1202
|
+
* @description fetch information on a deposit
|
|
1203
|
+
* @see https://global-docs.upbit.com/reference/individual-deposit-inquiry
|
|
1204
|
+
* @param {string} id the unique id for the deposit
|
|
1205
|
+
* @param {string} [code] unified currency code of the currency deposited
|
|
1206
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1207
|
+
* @param {string} [params.txid] withdrawal transaction id, the id argument is reserved for uuid
|
|
1208
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1209
|
+
*/
|
|
1210
|
+
await this.loadMarkets();
|
|
1211
|
+
const request = {
|
|
1212
|
+
'uuid': id,
|
|
1213
|
+
};
|
|
1214
|
+
let currency = undefined;
|
|
1215
|
+
if (code !== undefined) {
|
|
1216
|
+
currency = this.currency(code);
|
|
1217
|
+
request['currency'] = currency['id'];
|
|
1218
|
+
}
|
|
1219
|
+
const response = await this.privateGetDeposit(this.extend(request, params));
|
|
1220
|
+
//
|
|
1221
|
+
// {
|
|
1222
|
+
// "type": "deposit",
|
|
1223
|
+
// "uuid": "7f54527e-2eee-4268-860e-fd8b9d7fe3c7",
|
|
1224
|
+
// "currency": "ADA",
|
|
1225
|
+
// "net_type": "ADA",
|
|
1226
|
+
// "txid": "99795bbfeca91eaa071068bb659b33eeb65d8aaff2551fdf7c78f345d188952b",
|
|
1227
|
+
// "state": "ACCEPTED",
|
|
1228
|
+
// "created_at": "2023-12-12T04:58:41Z",
|
|
1229
|
+
// "done_at": "2023-12-12T05:31:50Z",
|
|
1230
|
+
// "amount": "35.72344",
|
|
1231
|
+
// "fee": "0.0",
|
|
1232
|
+
// "transaction_type": "default"
|
|
1233
|
+
// }
|
|
1234
|
+
//
|
|
1235
|
+
return this.parseTransaction(response, currency);
|
|
1236
|
+
}
|
|
1196
1237
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1197
1238
|
/**
|
|
1198
1239
|
* @method
|
|
@@ -1237,13 +1278,52 @@ class upbit extends upbit$1 {
|
|
|
1237
1278
|
//
|
|
1238
1279
|
return this.parseTransactions(response, currency, since, limit);
|
|
1239
1280
|
}
|
|
1281
|
+
async fetchWithdrawal(id, code = undefined, params = {}) {
|
|
1282
|
+
/**
|
|
1283
|
+
* @method
|
|
1284
|
+
* @name upbit#fetchWithdrawal
|
|
1285
|
+
* @description fetch data on a currency withdrawal via the withdrawal id
|
|
1286
|
+
* @see https://global-docs.upbit.com/reference/individual-withdrawal-inquiry
|
|
1287
|
+
* @param {string} id the unique id for the withdrawal
|
|
1288
|
+
* @param {string} [code] unified currency code of the currency withdrawn
|
|
1289
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1290
|
+
* @param {string} [params.txid] withdrawal transaction id, the id argument is reserved for uuid
|
|
1291
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1292
|
+
*/
|
|
1293
|
+
await this.loadMarkets();
|
|
1294
|
+
const request = {
|
|
1295
|
+
'uuid': id,
|
|
1296
|
+
};
|
|
1297
|
+
let currency = undefined;
|
|
1298
|
+
if (code !== undefined) {
|
|
1299
|
+
currency = this.currency(code);
|
|
1300
|
+
request['currency'] = currency['id'];
|
|
1301
|
+
}
|
|
1302
|
+
const response = await this.privateGetWithdraw(this.extend(request, params));
|
|
1303
|
+
//
|
|
1304
|
+
// {
|
|
1305
|
+
// "type": "withdraw",
|
|
1306
|
+
// "uuid": "95ef274b-23a6-4de4-95b0-5cbef4ca658f",
|
|
1307
|
+
// "currency": "ADA",
|
|
1308
|
+
// "net_type": "ADA",
|
|
1309
|
+
// "txid": "b1528f149297a71671b86636f731f8fdb0ff53da0f1d8c19093d59df96f34583",
|
|
1310
|
+
// "state": "DONE",
|
|
1311
|
+
// "created_at": "2023-12-14T02:46:52Z",
|
|
1312
|
+
// "done_at": "2023-12-14T03:10:11Z",
|
|
1313
|
+
// "amount": "35.22344",
|
|
1314
|
+
// "fee": "0.5",
|
|
1315
|
+
// "transaction_type": "default"
|
|
1316
|
+
// }
|
|
1317
|
+
//
|
|
1318
|
+
return this.parseTransaction(response, currency);
|
|
1319
|
+
}
|
|
1240
1320
|
parseTransactionStatus(status) {
|
|
1241
1321
|
const statuses = {
|
|
1242
1322
|
'submitting': 'pending',
|
|
1243
1323
|
'submitted': 'pending',
|
|
1244
1324
|
'almost_accepted': 'pending',
|
|
1245
1325
|
'rejected': 'failed',
|
|
1246
|
-
'accepted': '
|
|
1326
|
+
'accepted': 'ok',
|
|
1247
1327
|
'processing': 'pending',
|
|
1248
1328
|
'done': 'ok',
|
|
1249
1329
|
'canceled': 'canceled', // 취소됨
|
|
@@ -1252,7 +1332,7 @@ class upbit extends upbit$1 {
|
|
|
1252
1332
|
}
|
|
1253
1333
|
parseTransaction(transaction, currency = undefined) {
|
|
1254
1334
|
//
|
|
1255
|
-
// fetchDeposits
|
|
1335
|
+
// fetchDeposits, fetchDeposit
|
|
1256
1336
|
//
|
|
1257
1337
|
// {
|
|
1258
1338
|
// "type": "deposit",
|
|
@@ -1266,7 +1346,7 @@ class upbit extends upbit$1 {
|
|
|
1266
1346
|
// "fee": "0.0"
|
|
1267
1347
|
// }
|
|
1268
1348
|
//
|
|
1269
|
-
// fetchWithdrawals
|
|
1349
|
+
// fetchWithdrawals, fetchWithdrawal
|
|
1270
1350
|
//
|
|
1271
1351
|
// {
|
|
1272
1352
|
// "type": "withdraw",
|
|
@@ -1281,27 +1361,21 @@ class upbit extends upbit$1 {
|
|
|
1281
1361
|
// "krw_amount": "80420.0"
|
|
1282
1362
|
// }
|
|
1283
1363
|
//
|
|
1284
|
-
const id = this.safeString(transaction, 'uuid');
|
|
1285
|
-
const amount = this.safeNumber(transaction, 'amount');
|
|
1286
1364
|
const address = undefined; // not present in the data structure received from the exchange
|
|
1287
1365
|
const tag = undefined; // not present in the data structure received from the exchange
|
|
1288
|
-
const txid = this.safeString(transaction, 'txid');
|
|
1289
1366
|
const updatedRaw = this.safeString(transaction, 'done_at');
|
|
1290
|
-
const updated = this.parse8601(updatedRaw);
|
|
1291
1367
|
const timestamp = this.parse8601(this.safeString(transaction, 'created_at', updatedRaw));
|
|
1292
1368
|
let type = this.safeString(transaction, 'type');
|
|
1293
1369
|
if (type === 'withdraw') {
|
|
1294
1370
|
type = 'withdrawal';
|
|
1295
1371
|
}
|
|
1296
1372
|
const currencyId = this.safeString(transaction, 'currency');
|
|
1297
|
-
const code = this.safeCurrencyCode(currencyId);
|
|
1298
|
-
const status = this.parseTransactionStatus(this.safeStringLower(transaction, 'state'));
|
|
1299
|
-
const feeCost = this.safeNumber(transaction, 'fee');
|
|
1373
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
1300
1374
|
return {
|
|
1301
1375
|
'info': transaction,
|
|
1302
|
-
'id':
|
|
1376
|
+
'id': this.safeString(transaction, 'uuid'),
|
|
1303
1377
|
'currency': code,
|
|
1304
|
-
'amount': amount,
|
|
1378
|
+
'amount': this.safeNumber(transaction, 'amount'),
|
|
1305
1379
|
'network': undefined,
|
|
1306
1380
|
'address': address,
|
|
1307
1381
|
'addressTo': undefined,
|
|
@@ -1309,17 +1383,17 @@ class upbit extends upbit$1 {
|
|
|
1309
1383
|
'tag': tag,
|
|
1310
1384
|
'tagTo': undefined,
|
|
1311
1385
|
'tagFrom': undefined,
|
|
1312
|
-
'status':
|
|
1386
|
+
'status': this.parseTransactionStatus(this.safeStringLower(transaction, 'state')),
|
|
1313
1387
|
'type': type,
|
|
1314
|
-
'updated':
|
|
1315
|
-
'txid': txid,
|
|
1388
|
+
'updated': this.parse8601(updatedRaw),
|
|
1389
|
+
'txid': this.safeString(transaction, 'txid'),
|
|
1316
1390
|
'timestamp': timestamp,
|
|
1317
1391
|
'datetime': this.iso8601(timestamp),
|
|
1318
1392
|
'internal': undefined,
|
|
1319
1393
|
'comment': undefined,
|
|
1320
1394
|
'fee': {
|
|
1321
1395
|
'currency': code,
|
|
1322
|
-
'cost':
|
|
1396
|
+
'cost': this.safeNumber(transaction, 'fee'),
|
|
1323
1397
|
},
|
|
1324
1398
|
};
|
|
1325
1399
|
}
|
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.47";
|
|
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.48';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { implicitReturnType } from '../base/types.js';
|
|
2
2
|
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
3
3
|
interface Exchange {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
publicGetApiServerTime(params?: {}): Promise<implicitReturnType>;
|
|
5
|
+
publicGetApiPairs(params?: {}): Promise<implicitReturnType>;
|
|
6
|
+
publicGetApiPriceIncrements(params?: {}): Promise<implicitReturnType>;
|
|
7
|
+
publicGetApiSummaries(params?: {}): Promise<implicitReturnType>;
|
|
8
|
+
publicGetApiTickerPair(params?: {}): Promise<implicitReturnType>;
|
|
9
|
+
publicGetApiTickerAll(params?: {}): Promise<implicitReturnType>;
|
|
10
|
+
publicGetApiTradesPair(params?: {}): Promise<implicitReturnType>;
|
|
11
|
+
publicGetApiDepthPair(params?: {}): Promise<implicitReturnType>;
|
|
12
|
+
publicGetTradingviewHistoryV2(params?: {}): Promise<implicitReturnType>;
|
|
12
13
|
privatePostGetInfo(params?: {}): Promise<implicitReturnType>;
|
|
13
14
|
privatePostTransHistory(params?: {}): Promise<implicitReturnType>;
|
|
14
15
|
privatePostTrade(params?: {}): Promise<implicitReturnType>;
|
package/js/src/binance.js
CHANGED
|
@@ -5774,12 +5774,14 @@ export default class binance extends Exchange {
|
|
|
5774
5774
|
const trailingDelta = this.safeString(params, 'trailingDelta');
|
|
5775
5775
|
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', this.numberToString(price));
|
|
5776
5776
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
|
|
5777
|
+
const priceMatch = this.safeString(params, 'priceMatch');
|
|
5777
5778
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
5778
5779
|
const isStopLoss = stopLossPrice !== undefined || trailingDelta !== undefined;
|
|
5779
5780
|
const isTakeProfit = takeProfitPrice !== undefined;
|
|
5780
5781
|
const isTriggerOrder = triggerPrice !== undefined;
|
|
5781
5782
|
const isConditional = isTriggerOrder || isTrailingPercentOrder || isStopLoss || isTakeProfit;
|
|
5782
5783
|
const isPortfolioMarginConditional = (isPortfolioMargin && isConditional);
|
|
5784
|
+
const isPriceMatch = priceMatch !== undefined;
|
|
5783
5785
|
let uppercaseType = type.toUpperCase();
|
|
5784
5786
|
let stopPrice = undefined;
|
|
5785
5787
|
if (isTrailingPercentOrder) {
|
|
@@ -5960,7 +5962,7 @@ export default class binance extends Exchange {
|
|
|
5960
5962
|
request['quantity'] = this.amountToPrecision(symbol, amount);
|
|
5961
5963
|
}
|
|
5962
5964
|
}
|
|
5963
|
-
if (priceIsRequired) {
|
|
5965
|
+
if (priceIsRequired && !isPriceMatch) {
|
|
5964
5966
|
if (price === undefined) {
|
|
5965
5967
|
throw new InvalidOrder(this.id + ' createOrder() requires a price argument for a ' + type + ' order');
|
|
5966
5968
|
}
|
package/js/src/idex.d.ts
CHANGED
|
@@ -36,6 +36,13 @@ export default class idex extends Exchange {
|
|
|
36
36
|
handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
|
|
37
37
|
fetchDeposit(id: string, code?: Str, params?: {}): Promise<Transaction>;
|
|
38
38
|
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
39
|
+
fetchStatus(params?: {}): Promise<{
|
|
40
|
+
status: string;
|
|
41
|
+
updated: any;
|
|
42
|
+
eta: any;
|
|
43
|
+
url: any;
|
|
44
|
+
info: any;
|
|
45
|
+
}>;
|
|
39
46
|
fetchTime(params?: {}): Promise<number>;
|
|
40
47
|
fetchWithdrawal(id: string, code?: Str, params?: {}): Promise<Transaction>;
|
|
41
48
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
package/js/src/idex.js
CHANGED
|
@@ -84,8 +84,10 @@ export default class idex extends Exchange {
|
|
|
84
84
|
'fetchPositions': false,
|
|
85
85
|
'fetchPositionsRisk': false,
|
|
86
86
|
'fetchPremiumIndexOHLCV': false,
|
|
87
|
+
'fetchStatus': true,
|
|
87
88
|
'fetchTicker': true,
|
|
88
89
|
'fetchTickers': true,
|
|
90
|
+
'fetchTime': true,
|
|
89
91
|
'fetchTrades': true,
|
|
90
92
|
'fetchTradingFee': false,
|
|
91
93
|
'fetchTradingFees': true,
|
|
@@ -199,6 +201,7 @@ export default class idex extends Exchange {
|
|
|
199
201
|
* @method
|
|
200
202
|
* @name idex#fetchMarkets
|
|
201
203
|
* @description retrieves data on all markets for idex
|
|
204
|
+
* @see https://api-docs-v3.idex.io/#get-markets
|
|
202
205
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
203
206
|
* @returns {object[]} an array of objects representing market data
|
|
204
207
|
*/
|
|
@@ -329,6 +332,7 @@ export default class idex extends Exchange {
|
|
|
329
332
|
* @method
|
|
330
333
|
* @name idex#fetchTicker
|
|
331
334
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
335
|
+
* @see https://api-docs-v3.idex.io/#get-tickers
|
|
332
336
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
333
337
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
334
338
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -365,6 +369,7 @@ export default class idex extends Exchange {
|
|
|
365
369
|
* @method
|
|
366
370
|
* @name idex#fetchTickers
|
|
367
371
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
372
|
+
* @see https://api-docs-v3.idex.io/#get-tickers
|
|
368
373
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
369
374
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
370
375
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -441,6 +446,7 @@ export default class idex extends Exchange {
|
|
|
441
446
|
* @method
|
|
442
447
|
* @name idex#fetchOHLCV
|
|
443
448
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
449
|
+
* @see https://api-docs-v3.idex.io/#get-candles
|
|
444
450
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
445
451
|
* @param {string} timeframe the length of time each candle represents
|
|
446
452
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -503,6 +509,7 @@ export default class idex extends Exchange {
|
|
|
503
509
|
* @method
|
|
504
510
|
* @name idex#fetchTrades
|
|
505
511
|
* @description get the list of most recent trades for a particular symbol
|
|
512
|
+
* @see https://api-docs-v3.idex.io/#get-trades
|
|
506
513
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
507
514
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
508
515
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -616,6 +623,7 @@ export default class idex extends Exchange {
|
|
|
616
623
|
* @method
|
|
617
624
|
* @name idex#fetchTradingFees
|
|
618
625
|
* @description fetch the trading fees for multiple markets
|
|
626
|
+
* @see https://api-docs-v3.idex.io/#get-api-account
|
|
619
627
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
620
628
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
621
629
|
*/
|
|
@@ -661,6 +669,7 @@ export default class idex extends Exchange {
|
|
|
661
669
|
* @method
|
|
662
670
|
* @name idex#fetchOrderBook
|
|
663
671
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
672
|
+
* @see https://api-docs-v3.idex.io/#get-order-books
|
|
664
673
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
665
674
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
666
675
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -724,6 +733,7 @@ export default class idex extends Exchange {
|
|
|
724
733
|
* @method
|
|
725
734
|
* @name idex#fetchCurrencies
|
|
726
735
|
* @description fetches all available currencies on an exchange
|
|
736
|
+
* @see https://api-docs-v3.idex.io/#get-assets
|
|
727
737
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
728
738
|
* @returns {object} an associative dictionary of currencies
|
|
729
739
|
*/
|
|
@@ -789,6 +799,7 @@ export default class idex extends Exchange {
|
|
|
789
799
|
* @method
|
|
790
800
|
* @name idex#fetchBalance
|
|
791
801
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
802
|
+
* @see https://api-docs-v3.idex.io/#get-balances
|
|
792
803
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
793
804
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
794
805
|
*/
|
|
@@ -833,6 +844,7 @@ export default class idex extends Exchange {
|
|
|
833
844
|
* @method
|
|
834
845
|
* @name idex#fetchMyTrades
|
|
835
846
|
* @description fetch all trades made by the user
|
|
847
|
+
* @see https://api-docs-v3.idex.io/#get-fills
|
|
836
848
|
* @param {string} symbol unified market symbol
|
|
837
849
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
838
850
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -901,6 +913,7 @@ export default class idex extends Exchange {
|
|
|
901
913
|
* @method
|
|
902
914
|
* @name idex#fetchOrder
|
|
903
915
|
* @description fetches information on an order made by the user
|
|
916
|
+
* @see https://api-docs-v3.idex.io/#get-orders
|
|
904
917
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
905
918
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
906
919
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -915,6 +928,7 @@ export default class idex extends Exchange {
|
|
|
915
928
|
* @method
|
|
916
929
|
* @name idex#fetchOpenOrders
|
|
917
930
|
* @description fetch all unfilled currently open orders
|
|
931
|
+
* @see https://api-docs-v3.idex.io/#get-orders
|
|
918
932
|
* @param {string} symbol unified market symbol
|
|
919
933
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
920
934
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -931,6 +945,7 @@ export default class idex extends Exchange {
|
|
|
931
945
|
* @method
|
|
932
946
|
* @name idex#fetchClosedOrders
|
|
933
947
|
* @description fetches information on multiple closed orders made by the user
|
|
948
|
+
* @see https://api-docs-v3.idex.io/#get-orders
|
|
934
949
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
935
950
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
936
951
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -1142,16 +1157,20 @@ export default class idex extends Exchange {
|
|
|
1142
1157
|
* @method
|
|
1143
1158
|
* @name idex#createOrder
|
|
1144
1159
|
* @description create a trade order, https://docs.idex.io/#create-order
|
|
1160
|
+
* @see https://api-docs-v3.idex.io/#create-order
|
|
1145
1161
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
1146
1162
|
* @param {string} type 'market' or 'limit'
|
|
1147
1163
|
* @param {string} side 'buy' or 'sell'
|
|
1148
1164
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
1149
1165
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
1150
1166
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1167
|
+
* @param {bool} [params.test] set to true to test an order, no order will be created but the request will be validated
|
|
1151
1168
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1152
1169
|
*/
|
|
1153
1170
|
this.checkRequiredCredentials();
|
|
1154
1171
|
await this.loadMarkets();
|
|
1172
|
+
const testOrder = this.safeBool(params, 'test', false);
|
|
1173
|
+
params = this.omit(params, 'test');
|
|
1155
1174
|
const market = this.market(symbol);
|
|
1156
1175
|
const nonce = this.uuidv1();
|
|
1157
1176
|
let typeEnum = undefined;
|
|
@@ -1332,7 +1351,13 @@ export default class idex extends Exchange {
|
|
|
1332
1351
|
// "avgExecutionPrice": "0.09905990"
|
|
1333
1352
|
// }
|
|
1334
1353
|
// we don't use extend here because it is a signed endpoint
|
|
1335
|
-
|
|
1354
|
+
let response = undefined;
|
|
1355
|
+
if (testOrder) {
|
|
1356
|
+
response = await this.privatePostOrdersTest(request);
|
|
1357
|
+
}
|
|
1358
|
+
else {
|
|
1359
|
+
response = await this.privatePostOrders(request);
|
|
1360
|
+
}
|
|
1336
1361
|
return this.parseOrder(response, market);
|
|
1337
1362
|
}
|
|
1338
1363
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
@@ -1340,6 +1365,7 @@ export default class idex extends Exchange {
|
|
|
1340
1365
|
* @method
|
|
1341
1366
|
* @name idex#withdraw
|
|
1342
1367
|
* @description make a withdrawal
|
|
1368
|
+
* @see https://api-docs-v3.idex.io/#withdraw-funds
|
|
1343
1369
|
* @param {string} code unified currency code
|
|
1344
1370
|
* @param {float} amount the amount to withdraw
|
|
1345
1371
|
* @param {string} address the address to withdraw to
|
|
@@ -1393,6 +1419,7 @@ export default class idex extends Exchange {
|
|
|
1393
1419
|
* @method
|
|
1394
1420
|
* @name idex#cancelAllOrders
|
|
1395
1421
|
* @description cancel all open orders
|
|
1422
|
+
* @see https://api-docs-v3.idex.io/#cancel-order
|
|
1396
1423
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
1397
1424
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1398
1425
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -1432,6 +1459,7 @@ export default class idex extends Exchange {
|
|
|
1432
1459
|
* @method
|
|
1433
1460
|
* @name idex#cancelOrder
|
|
1434
1461
|
* @description cancels an open order
|
|
1462
|
+
* @see https://api-docs-v3.idex.io/#cancel-order
|
|
1435
1463
|
* @param {string} id order id
|
|
1436
1464
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
1437
1465
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1483,6 +1511,7 @@ export default class idex extends Exchange {
|
|
|
1483
1511
|
* @method
|
|
1484
1512
|
* @name idex#fetchDeposit
|
|
1485
1513
|
* @description fetch information on a deposit
|
|
1514
|
+
* @see https://api-docs-v3.idex.io/#get-deposits
|
|
1486
1515
|
* @param {string} id deposit id
|
|
1487
1516
|
* @param {string} code not used by idex fetchDeposit ()
|
|
1488
1517
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1503,6 +1532,7 @@ export default class idex extends Exchange {
|
|
|
1503
1532
|
* @method
|
|
1504
1533
|
* @name idex#fetchDeposits
|
|
1505
1534
|
* @description fetch all deposits made to an account
|
|
1535
|
+
* @see https://api-docs-v3.idex.io/#get-deposits
|
|
1506
1536
|
* @param {string} code unified currency code
|
|
1507
1537
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
1508
1538
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
@@ -1514,11 +1544,30 @@ export default class idex extends Exchange {
|
|
|
1514
1544
|
}, params);
|
|
1515
1545
|
return await this.fetchTransactionsHelper(code, since, limit, params);
|
|
1516
1546
|
}
|
|
1547
|
+
async fetchStatus(params = {}) {
|
|
1548
|
+
/**
|
|
1549
|
+
* @method
|
|
1550
|
+
* @name idex#fetchStatus
|
|
1551
|
+
* @description the latest known information on the availability of the exchange API
|
|
1552
|
+
* @see https://api-docs-v3.idex.io/#get-ping
|
|
1553
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1554
|
+
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
1555
|
+
*/
|
|
1556
|
+
const response = await this.publicGetPing(params);
|
|
1557
|
+
return {
|
|
1558
|
+
'status': 'ok',
|
|
1559
|
+
'updated': undefined,
|
|
1560
|
+
'eta': undefined,
|
|
1561
|
+
'url': undefined,
|
|
1562
|
+
'info': response,
|
|
1563
|
+
};
|
|
1564
|
+
}
|
|
1517
1565
|
async fetchTime(params = {}) {
|
|
1518
1566
|
/**
|
|
1519
1567
|
* @method
|
|
1520
1568
|
* @name idex#fetchTime
|
|
1521
1569
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
1570
|
+
* @see https://api-docs-v3.idex.io/#get-time
|
|
1522
1571
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1523
1572
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
1524
1573
|
*/
|
|
@@ -1533,6 +1582,7 @@ export default class idex extends Exchange {
|
|
|
1533
1582
|
* @method
|
|
1534
1583
|
* @name idex#fetchWithdrawal
|
|
1535
1584
|
* @description fetch data on a currency withdrawal via the withdrawal id
|
|
1585
|
+
* @see https://api-docs-v3.idex.io/#get-withdrawals
|
|
1536
1586
|
* @param {string} id withdrawal id
|
|
1537
1587
|
* @param {string} code not used by idex.fetchWithdrawal
|
|
1538
1588
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1553,6 +1603,7 @@ export default class idex extends Exchange {
|
|
|
1553
1603
|
* @method
|
|
1554
1604
|
* @name idex#fetchWithdrawals
|
|
1555
1605
|
* @description fetch all withdrawals made from an account
|
|
1606
|
+
* @see https://api-docs-v3.idex.io/#get-withdrawals
|
|
1556
1607
|
* @param {string} code unified currency code
|
|
1557
1608
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
1558
1609
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
package/js/src/indodax.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/indodax.js';
|
|
2
|
-
import type { Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction } from './base/types.js';
|
|
2
|
+
import type { Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class indodax
|
|
5
5
|
* @augments Exchange
|
|
@@ -17,6 +17,8 @@ export default class indodax extends Exchange {
|
|
|
17
17
|
fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
18
18
|
parseTrade(trade: any, market?: Market): Trade;
|
|
19
19
|
fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
20
|
+
parseOHLCV(ohlcv: any, market?: Market): OHLCV;
|
|
21
|
+
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
20
22
|
parseOrderStatus(status: any): string;
|
|
21
23
|
parseOrder(order: any, market?: Market): Order;
|
|
22
24
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|