ccxt 4.2.48 → 4.2.50
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/build.sh +7 -0
- package/dist/ccxt.browser.js +598 -48
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +5 -0
- package/dist/cjs/src/binance.js +9 -4
- package/dist/cjs/src/bitmart.js +30 -4
- package/dist/cjs/src/bitstamp.js +8 -0
- package/dist/cjs/src/bl3p.js +47 -0
- package/dist/cjs/src/btcalpha.js +4 -0
- package/dist/cjs/src/btcmarkets.js +4 -0
- package/dist/cjs/src/btcturk.js +4 -0
- package/dist/cjs/src/bybit.js +138 -6
- package/dist/cjs/src/independentreserve.js +48 -0
- package/dist/cjs/src/latoken.js +16 -0
- package/dist/cjs/src/luno.js +18 -0
- package/dist/cjs/src/lykke.js +19 -0
- package/dist/cjs/src/ndax.js +18 -0
- package/dist/cjs/src/pro/ascendex.js +22 -7
- package/dist/cjs/src/pro/bequant.js +3 -4
- package/dist/cjs/src/pro/binance.js +29 -2
- package/dist/cjs/src/pro/bitget.js +28 -7
- package/dist/cjs/src/pro/bitstamp.js +1 -1
- package/dist/cjs/src/pro/gemini.js +89 -1
- package/dist/cjs/src/pro/mexc.js +2 -1
- package/dist/cjs/src/pro/whitebit.js +9 -8
- package/dist/cjs/src/timex.js +35 -1
- package/dist/cjs/src/upbit.js +11 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitstamp.d.ts +8 -0
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +5 -0
- package/js/src/binance.js +9 -4
- package/js/src/bitmart.js +30 -4
- package/js/src/bitstamp.js +8 -0
- package/js/src/bl3p.d.ts +15 -1
- package/js/src/bl3p.js +47 -0
- package/js/src/btcalpha.js +4 -0
- package/js/src/btcmarkets.js +4 -0
- package/js/src/btcturk.js +4 -0
- package/js/src/bybit.d.ts +3 -1
- package/js/src/bybit.js +138 -6
- package/js/src/independentreserve.d.ts +15 -1
- package/js/src/independentreserve.js +48 -0
- package/js/src/latoken.js +16 -0
- package/js/src/luno.js +18 -0
- package/js/src/lykke.js +19 -0
- package/js/src/ndax.js +18 -0
- package/js/src/pro/ascendex.d.ts +1 -0
- package/js/src/pro/ascendex.js +22 -7
- package/js/src/pro/bequant.js +3 -4
- package/js/src/pro/binance.d.ts +1 -0
- package/js/src/pro/binance.js +29 -2
- package/js/src/pro/bitget.js +28 -7
- package/js/src/pro/bitstamp.js +1 -1
- package/js/src/pro/gemini.d.ts +3 -1
- package/js/src/pro/gemini.js +89 -1
- package/js/src/pro/mexc.js +2 -1
- package/js/src/pro/whitebit.js +9 -8
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
- package/js/src/timex.d.ts +1 -0
- package/js/src/timex.js +35 -1
- package/js/src/upbit.js +11 -2
- package/package.json +3 -1
- package/skip-tests.json +4 -3
package/js/src/bl3p.js
CHANGED
|
@@ -35,6 +35,7 @@ export default class bl3p extends Exchange {
|
|
|
35
35
|
'cancelOrder': true,
|
|
36
36
|
'closeAllPositions': false,
|
|
37
37
|
'closePosition': false,
|
|
38
|
+
'createDepositAddress': true,
|
|
38
39
|
'createOrder': true,
|
|
39
40
|
'createReduceOnlyOrder': false,
|
|
40
41
|
'createStopLimitOrder': false,
|
|
@@ -45,6 +46,9 @@ export default class bl3p extends Exchange {
|
|
|
45
46
|
'fetchBorrowRateHistory': false,
|
|
46
47
|
'fetchCrossBorrowRate': false,
|
|
47
48
|
'fetchCrossBorrowRates': false,
|
|
49
|
+
'fetchDepositAddress': false,
|
|
50
|
+
'fetchDepositAddresses': false,
|
|
51
|
+
'fetchDepositAddressesByNetwork': false,
|
|
48
52
|
'fetchFundingHistory': false,
|
|
49
53
|
'fetchFundingRate': false,
|
|
50
54
|
'fetchFundingRateHistory': false,
|
|
@@ -426,6 +430,49 @@ export default class bl3p extends Exchange {
|
|
|
426
430
|
};
|
|
427
431
|
return await this.privatePostMarketMoneyOrderCancel(this.extend(request, params));
|
|
428
432
|
}
|
|
433
|
+
async createDepositAddress(code, params = {}) {
|
|
434
|
+
/**
|
|
435
|
+
* @method
|
|
436
|
+
* @name bl3p#createDepositAddress
|
|
437
|
+
* @description create a currency deposit address
|
|
438
|
+
* @see https://github.com/BitonicNL/bl3p-api/blob/master/docs/authenticated_api/http.md#32---create-a-new-deposit-address
|
|
439
|
+
* @param {string} code unified currency code of the currency for the deposit address
|
|
440
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
441
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
442
|
+
*/
|
|
443
|
+
await this.loadMarkets();
|
|
444
|
+
const currency = this.currency(code);
|
|
445
|
+
const request = {
|
|
446
|
+
'currency': currency['id'],
|
|
447
|
+
};
|
|
448
|
+
const response = await this.privatePostGENMKTMoneyNewDepositAddress(this.extend(request, params));
|
|
449
|
+
//
|
|
450
|
+
// {
|
|
451
|
+
// "result": "success",
|
|
452
|
+
// "data": {
|
|
453
|
+
// "address": "36Udu9zi1uYicpXcJpoKfv3bewZeok5tpk"
|
|
454
|
+
// }
|
|
455
|
+
// }
|
|
456
|
+
//
|
|
457
|
+
const data = this.safeDict(response, 'data');
|
|
458
|
+
return this.parseDepositAddress(data, currency);
|
|
459
|
+
}
|
|
460
|
+
parseDepositAddress(depositAddress, currency = undefined) {
|
|
461
|
+
//
|
|
462
|
+
// {
|
|
463
|
+
// "address": "36Udu9zi1uYicpXcJpoKfv3bewZeok5tpk"
|
|
464
|
+
// }
|
|
465
|
+
//
|
|
466
|
+
const address = this.safeString(depositAddress, 'address');
|
|
467
|
+
this.checkAddress(address);
|
|
468
|
+
return {
|
|
469
|
+
'info': depositAddress,
|
|
470
|
+
'currency': this.safeString(currency, 'code'),
|
|
471
|
+
'address': address,
|
|
472
|
+
'tag': undefined,
|
|
473
|
+
'network': undefined,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
429
476
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
430
477
|
const request = this.implodeParams(path, params);
|
|
431
478
|
let url = this.urls['api']['rest'] + '/' + this.version + '/' + request;
|
package/js/src/btcalpha.js
CHANGED
|
@@ -33,6 +33,7 @@ export default class btcalpha extends Exchange {
|
|
|
33
33
|
'cancelOrder': true,
|
|
34
34
|
'closeAllPositions': false,
|
|
35
35
|
'closePosition': false,
|
|
36
|
+
'createDepositAddress': false,
|
|
36
37
|
'createOrder': true,
|
|
37
38
|
'createReduceOnlyOrder': false,
|
|
38
39
|
'createStopLimitOrder': false,
|
|
@@ -45,6 +46,9 @@ export default class btcalpha extends Exchange {
|
|
|
45
46
|
'fetchCrossBorrowRate': false,
|
|
46
47
|
'fetchCrossBorrowRates': false,
|
|
47
48
|
'fetchDeposit': false,
|
|
49
|
+
'fetchDepositAddress': false,
|
|
50
|
+
'fetchDepositAddresses': false,
|
|
51
|
+
'fetchDepositAddressesByNetwork': false,
|
|
48
52
|
'fetchDeposits': true,
|
|
49
53
|
'fetchFundingHistory': false,
|
|
50
54
|
'fetchFundingRate': false,
|
package/js/src/btcmarkets.js
CHANGED
|
@@ -35,6 +35,7 @@ export default class btcmarkets extends Exchange {
|
|
|
35
35
|
'cancelOrders': true,
|
|
36
36
|
'closeAllPositions': false,
|
|
37
37
|
'closePosition': false,
|
|
38
|
+
'createDepositAddress': false,
|
|
38
39
|
'createOrder': true,
|
|
39
40
|
'createReduceOnlyOrder': false,
|
|
40
41
|
'fetchBalance': true,
|
|
@@ -43,6 +44,9 @@ export default class btcmarkets extends Exchange {
|
|
|
43
44
|
'fetchClosedOrders': 'emulated',
|
|
44
45
|
'fetchCrossBorrowRate': false,
|
|
45
46
|
'fetchCrossBorrowRates': false,
|
|
47
|
+
'fetchDepositAddress': false,
|
|
48
|
+
'fetchDepositAddresses': false,
|
|
49
|
+
'fetchDepositAddressesByNetwork': false,
|
|
46
50
|
'fetchDeposits': true,
|
|
47
51
|
'fetchDepositsWithdrawals': true,
|
|
48
52
|
'fetchFundingHistory': false,
|
package/js/src/btcturk.js
CHANGED
|
@@ -34,6 +34,7 @@ export default class btcturk extends Exchange {
|
|
|
34
34
|
'cancelOrder': true,
|
|
35
35
|
'closeAllPositions': false,
|
|
36
36
|
'closePosition': false,
|
|
37
|
+
'createDepositAddress': false,
|
|
37
38
|
'createOrder': true,
|
|
38
39
|
'createReduceOnlyOrder': false,
|
|
39
40
|
'fetchBalance': true,
|
|
@@ -41,6 +42,9 @@ export default class btcturk extends Exchange {
|
|
|
41
42
|
'fetchBorrowRateHistory': false,
|
|
42
43
|
'fetchCrossBorrowRate': false,
|
|
43
44
|
'fetchCrossBorrowRates': false,
|
|
45
|
+
'fetchDepositAddress': false,
|
|
46
|
+
'fetchDepositAddresses': false,
|
|
47
|
+
'fetchDepositAddressesByNetwork': false,
|
|
44
48
|
'fetchFundingHistory': false,
|
|
45
49
|
'fetchFundingRate': false,
|
|
46
50
|
'fetchFundingRateHistory': false,
|
package/js/src/bybit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bybit.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, Trade, Order, OHLCV, FundingRateHistory, OpenInterest, OrderRequest, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Trade, Order, OHLCV, FundingRateHistory, OpenInterest, OrderRequest, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Liquidation } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bybit
|
|
5
5
|
* @augments Exchange
|
|
@@ -249,6 +249,8 @@ export default class bybit extends Exchange {
|
|
|
249
249
|
underlyingPrice: number;
|
|
250
250
|
info: any;
|
|
251
251
|
};
|
|
252
|
+
fetchMyLiquidations(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
|
|
253
|
+
parseLiquidation(liquidation: any, market?: Market): Liquidation;
|
|
252
254
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
253
255
|
url: string;
|
|
254
256
|
method: string;
|
package/js/src/bybit.js
CHANGED
|
@@ -84,6 +84,7 @@ export default class bybit extends Exchange {
|
|
|
84
84
|
'fetchMarketLeverageTiers': true,
|
|
85
85
|
'fetchMarkets': true,
|
|
86
86
|
'fetchMarkOHLCV': true,
|
|
87
|
+
'fetchMyLiquidations': true,
|
|
87
88
|
'fetchMySettlementHistory': true,
|
|
88
89
|
'fetchMyTrades': true,
|
|
89
90
|
'fetchOHLCV': true,
|
|
@@ -4579,7 +4580,7 @@ export default class bybit extends Exchange {
|
|
|
4579
4580
|
let paginate = false;
|
|
4580
4581
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOrders', 'paginate');
|
|
4581
4582
|
if (paginate) {
|
|
4582
|
-
return await this.fetchPaginatedCallCursor('fetchOrders', symbol, since, limit, params, 'nextPageCursor', '
|
|
4583
|
+
return await this.fetchPaginatedCallCursor('fetchOrders', symbol, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
|
|
4583
4584
|
}
|
|
4584
4585
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
4585
4586
|
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
@@ -4757,7 +4758,7 @@ export default class bybit extends Exchange {
|
|
|
4757
4758
|
let paginate = false;
|
|
4758
4759
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchCanceledAndClosedOrders', 'paginate');
|
|
4759
4760
|
if (paginate) {
|
|
4760
|
-
return await this.fetchPaginatedCallCursor('fetchCanceledAndClosedOrders', symbol, since, limit, params, 'nextPageCursor', '
|
|
4761
|
+
return await this.fetchPaginatedCallCursor('fetchCanceledAndClosedOrders', symbol, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
|
|
4761
4762
|
}
|
|
4762
4763
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
4763
4764
|
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
@@ -5129,7 +5130,7 @@ export default class bybit extends Exchange {
|
|
|
5129
5130
|
let paginate = false;
|
|
5130
5131
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
5131
5132
|
if (paginate) {
|
|
5132
|
-
return await this.fetchPaginatedCallCursor('fetchMyTrades', symbol, since, limit, params, 'nextPageCursor', '
|
|
5133
|
+
return await this.fetchPaginatedCallCursor('fetchMyTrades', symbol, since, limit, params, 'nextPageCursor', 'cursor', undefined, 100);
|
|
5133
5134
|
}
|
|
5134
5135
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
5135
5136
|
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
@@ -5331,7 +5332,7 @@ export default class bybit extends Exchange {
|
|
|
5331
5332
|
let paginate = false;
|
|
5332
5333
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
|
|
5333
5334
|
if (paginate) {
|
|
5334
|
-
return await this.fetchPaginatedCallCursor('fetchDeposits', code, since, limit, params, 'nextPageCursor', '
|
|
5335
|
+
return await this.fetchPaginatedCallCursor('fetchDeposits', code, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
|
|
5335
5336
|
}
|
|
5336
5337
|
let request = {
|
|
5337
5338
|
// 'coin': currency['id'],
|
|
@@ -5399,7 +5400,7 @@ export default class bybit extends Exchange {
|
|
|
5399
5400
|
let paginate = false;
|
|
5400
5401
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
|
|
5401
5402
|
if (paginate) {
|
|
5402
|
-
return await this.fetchPaginatedCallCursor('fetchWithdrawals', code, since, limit, params, 'nextPageCursor', '
|
|
5403
|
+
return await this.fetchPaginatedCallCursor('fetchWithdrawals', code, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
|
|
5403
5404
|
}
|
|
5404
5405
|
let request = {
|
|
5405
5406
|
// 'coin': currency['id'],
|
|
@@ -6919,7 +6920,7 @@ export default class bybit extends Exchange {
|
|
|
6919
6920
|
let paginate = false;
|
|
6920
6921
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchTransfers', 'paginate');
|
|
6921
6922
|
if (paginate) {
|
|
6922
|
-
return await this.fetchPaginatedCallCursor('fetchTransfers', code, since, limit, params, 'nextPageCursor', '
|
|
6923
|
+
return await this.fetchPaginatedCallCursor('fetchTransfers', code, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
|
|
6923
6924
|
}
|
|
6924
6925
|
let currency = undefined;
|
|
6925
6926
|
let request = {};
|
|
@@ -7754,6 +7755,137 @@ export default class bybit extends Exchange {
|
|
|
7754
7755
|
'info': greeks,
|
|
7755
7756
|
};
|
|
7756
7757
|
}
|
|
7758
|
+
async fetchMyLiquidations(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7759
|
+
/**
|
|
7760
|
+
* @method
|
|
7761
|
+
* @name bybit#fetchMyLiquidations
|
|
7762
|
+
* @description retrieves the users liquidated positions
|
|
7763
|
+
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
7764
|
+
* @param {string} [symbol] unified CCXT market symbol
|
|
7765
|
+
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
7766
|
+
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
7767
|
+
* @param {object} [params] exchange specific parameters for the exchange API endpoint
|
|
7768
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7769
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
7770
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
7771
|
+
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
7772
|
+
*/
|
|
7773
|
+
await this.loadMarkets();
|
|
7774
|
+
let paginate = false;
|
|
7775
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyLiquidations', 'paginate');
|
|
7776
|
+
if (paginate) {
|
|
7777
|
+
return await this.fetchPaginatedCallCursor('fetchMyLiquidations', symbol, since, limit, params, 'nextPageCursor', 'cursor', undefined, 100);
|
|
7778
|
+
}
|
|
7779
|
+
let request = {
|
|
7780
|
+
'execType': 'BustTrade',
|
|
7781
|
+
};
|
|
7782
|
+
let market = undefined;
|
|
7783
|
+
if (symbol !== undefined) {
|
|
7784
|
+
market = this.market(symbol);
|
|
7785
|
+
request['symbol'] = market['id'];
|
|
7786
|
+
}
|
|
7787
|
+
let type = undefined;
|
|
7788
|
+
[type, params] = this.getBybitType('fetchMyLiquidations', market, params);
|
|
7789
|
+
request['category'] = type;
|
|
7790
|
+
if (limit !== undefined) {
|
|
7791
|
+
request['limit'] = limit;
|
|
7792
|
+
}
|
|
7793
|
+
if (since !== undefined) {
|
|
7794
|
+
request['startTime'] = since;
|
|
7795
|
+
}
|
|
7796
|
+
[request, params] = this.handleUntilOption('endTime', request, params);
|
|
7797
|
+
const response = await this.privateGetV5ExecutionList(this.extend(request, params));
|
|
7798
|
+
//
|
|
7799
|
+
// {
|
|
7800
|
+
// "retCode": 0,
|
|
7801
|
+
// "retMsg": "OK",
|
|
7802
|
+
// "result": {
|
|
7803
|
+
// "nextPageCursor": "132766%3A2%2C132766%3A2",
|
|
7804
|
+
// "category": "linear",
|
|
7805
|
+
// "list": [
|
|
7806
|
+
// {
|
|
7807
|
+
// "symbol": "ETHPERP",
|
|
7808
|
+
// "orderType": "Market",
|
|
7809
|
+
// "underlyingPrice": "",
|
|
7810
|
+
// "orderLinkId": "",
|
|
7811
|
+
// "side": "Buy",
|
|
7812
|
+
// "indexPrice": "",
|
|
7813
|
+
// "orderId": "8c065341-7b52-4ca9-ac2c-37e31ac55c94",
|
|
7814
|
+
// "stopOrderType": "UNKNOWN",
|
|
7815
|
+
// "leavesQty": "0",
|
|
7816
|
+
// "execTime": "1672282722429",
|
|
7817
|
+
// "isMaker": false,
|
|
7818
|
+
// "execFee": "0.071409",
|
|
7819
|
+
// "feeRate": "0.0006",
|
|
7820
|
+
// "execId": "e0cbe81d-0f18-5866-9415-cf319b5dab3b",
|
|
7821
|
+
// "tradeIv": "",
|
|
7822
|
+
// "blockTradeId": "",
|
|
7823
|
+
// "markPrice": "1183.54",
|
|
7824
|
+
// "execPrice": "1190.15",
|
|
7825
|
+
// "markIv": "",
|
|
7826
|
+
// "orderQty": "0.1",
|
|
7827
|
+
// "orderPrice": "1236.9",
|
|
7828
|
+
// "execValue": "119.015",
|
|
7829
|
+
// "execType": "Trade",
|
|
7830
|
+
// "execQty": "0.1"
|
|
7831
|
+
// }
|
|
7832
|
+
// ]
|
|
7833
|
+
// },
|
|
7834
|
+
// "retExtInfo": {},
|
|
7835
|
+
// "time": 1672283754510
|
|
7836
|
+
// }
|
|
7837
|
+
//
|
|
7838
|
+
const liquidations = this.addPaginationCursorToResult(response);
|
|
7839
|
+
return this.parseLiquidations(liquidations, market, since, limit);
|
|
7840
|
+
}
|
|
7841
|
+
parseLiquidation(liquidation, market = undefined) {
|
|
7842
|
+
//
|
|
7843
|
+
// {
|
|
7844
|
+
// "symbol": "ETHPERP",
|
|
7845
|
+
// "orderType": "Market",
|
|
7846
|
+
// "underlyingPrice": "",
|
|
7847
|
+
// "orderLinkId": "",
|
|
7848
|
+
// "side": "Buy",
|
|
7849
|
+
// "indexPrice": "",
|
|
7850
|
+
// "orderId": "8c065341-7b52-4ca9-ac2c-37e31ac55c94",
|
|
7851
|
+
// "stopOrderType": "UNKNOWN",
|
|
7852
|
+
// "leavesQty": "0",
|
|
7853
|
+
// "execTime": "1672282722429",
|
|
7854
|
+
// "isMaker": false,
|
|
7855
|
+
// "execFee": "0.071409",
|
|
7856
|
+
// "feeRate": "0.0006",
|
|
7857
|
+
// "execId": "e0cbe81d-0f18-5866-9415-cf319b5dab3b",
|
|
7858
|
+
// "tradeIv": "",
|
|
7859
|
+
// "blockTradeId": "",
|
|
7860
|
+
// "markPrice": "1183.54",
|
|
7861
|
+
// "execPrice": "1190.15",
|
|
7862
|
+
// "markIv": "",
|
|
7863
|
+
// "orderQty": "0.1",
|
|
7864
|
+
// "orderPrice": "1236.9",
|
|
7865
|
+
// "execValue": "119.015",
|
|
7866
|
+
// "execType": "Trade",
|
|
7867
|
+
// "execQty": "0.1"
|
|
7868
|
+
// }
|
|
7869
|
+
//
|
|
7870
|
+
const marketId = this.safeString(liquidation, 'symbol');
|
|
7871
|
+
const timestamp = this.safeInteger(liquidation, 'execTime');
|
|
7872
|
+
const contractsString = this.safeString(liquidation, 'execQty');
|
|
7873
|
+
const contractSizeString = this.safeString(market, 'contractSize');
|
|
7874
|
+
const priceString = this.safeString(liquidation, 'execPrice');
|
|
7875
|
+
const baseValueString = Precise.stringMul(contractsString, contractSizeString);
|
|
7876
|
+
const quoteValueString = Precise.stringMul(baseValueString, priceString);
|
|
7877
|
+
return this.safeLiquidation({
|
|
7878
|
+
'info': liquidation,
|
|
7879
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
7880
|
+
'contracts': this.parseNumber(contractsString),
|
|
7881
|
+
'contractSize': this.parseNumber(contractSizeString),
|
|
7882
|
+
'price': this.parseNumber(priceString),
|
|
7883
|
+
'baseValue': this.parseNumber(baseValueString),
|
|
7884
|
+
'quoteValue': this.parseNumber(quoteValueString),
|
|
7885
|
+
'timestamp': timestamp,
|
|
7886
|
+
'datetime': this.iso8601(timestamp),
|
|
7887
|
+
});
|
|
7888
|
+
}
|
|
7757
7889
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
7758
7890
|
let url = this.implodeHostname(this.urls['api'][api]) + '/' + path;
|
|
7759
7891
|
if (api === 'public') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/independentreserve.js';
|
|
2
|
-
import type { Balances, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade } from './base/types.js';
|
|
2
|
+
import type { Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class independentreserve
|
|
5
5
|
* @augments Exchange
|
|
@@ -23,6 +23,20 @@ export default class independentreserve extends Exchange {
|
|
|
23
23
|
fetchTradingFees(params?: {}): Promise<{}>;
|
|
24
24
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
|
|
25
25
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
|
|
26
|
+
fetchDepositAddress(code: string, params?: {}): Promise<{
|
|
27
|
+
info: any;
|
|
28
|
+
currency: string;
|
|
29
|
+
address: string;
|
|
30
|
+
tag: string;
|
|
31
|
+
network: any;
|
|
32
|
+
}>;
|
|
33
|
+
parseDepositAddress(depositAddress: any, currency?: Currency): {
|
|
34
|
+
info: any;
|
|
35
|
+
currency: string;
|
|
36
|
+
address: string;
|
|
37
|
+
tag: string;
|
|
38
|
+
network: any;
|
|
39
|
+
};
|
|
26
40
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
27
41
|
url: string;
|
|
28
42
|
method: string;
|
|
@@ -44,6 +44,9 @@ export default class independentreserve extends Exchange {
|
|
|
44
44
|
'fetchClosedOrders': true,
|
|
45
45
|
'fetchCrossBorrowRate': false,
|
|
46
46
|
'fetchCrossBorrowRates': false,
|
|
47
|
+
'fetchDepositAddress': true,
|
|
48
|
+
'fetchDepositAddresses': false,
|
|
49
|
+
'fetchDepositAddressesByNetwork': false,
|
|
47
50
|
'fetchFundingHistory': false,
|
|
48
51
|
'fetchFundingRate': false,
|
|
49
52
|
'fetchFundingRateHistory': false,
|
|
@@ -723,6 +726,51 @@ export default class independentreserve extends Exchange {
|
|
|
723
726
|
};
|
|
724
727
|
return await this.privatePostCancelOrder(this.extend(request, params));
|
|
725
728
|
}
|
|
729
|
+
async fetchDepositAddress(code, params = {}) {
|
|
730
|
+
/**
|
|
731
|
+
* @method
|
|
732
|
+
* @name independentreserve#fetchDepositAddress
|
|
733
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
734
|
+
* @see https://www.independentreserve.com/features/api#GetDigitalCurrencyDepositAddress
|
|
735
|
+
* @param {string} code unified currency code
|
|
736
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
737
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
738
|
+
*/
|
|
739
|
+
await this.loadMarkets();
|
|
740
|
+
const currency = this.currency(code);
|
|
741
|
+
const request = {
|
|
742
|
+
'primaryCurrencyCode': currency['id'],
|
|
743
|
+
};
|
|
744
|
+
const response = await this.privatePostGetDigitalCurrencyDepositAddress(this.extend(request, params));
|
|
745
|
+
//
|
|
746
|
+
// {
|
|
747
|
+
// Tag: '3307446684',
|
|
748
|
+
// DepositAddress: 'GCCQH4HACMRAD56EZZZ4TOIDQQRVNADMJ35QOFWF4B2VQGODMA2WVQ22',
|
|
749
|
+
// LastCheckedTimestampUtc: '2024-02-20T11:13:35.6912985Z',
|
|
750
|
+
// NextUpdateTimestampUtc: '2024-02-20T11:14:56.5112394Z'
|
|
751
|
+
// }
|
|
752
|
+
//
|
|
753
|
+
return this.parseDepositAddress(response);
|
|
754
|
+
}
|
|
755
|
+
parseDepositAddress(depositAddress, currency = undefined) {
|
|
756
|
+
//
|
|
757
|
+
// {
|
|
758
|
+
// Tag: '3307446684',
|
|
759
|
+
// DepositAddress: 'GCCQH4HACMRAD56EZZZ4TOIDQQRVNADMJ35QOFWF4B2VQGODMA2WVQ22',
|
|
760
|
+
// LastCheckedTimestampUtc: '2024-02-20T11:13:35.6912985Z',
|
|
761
|
+
// NextUpdateTimestampUtc: '2024-02-20T11:14:56.5112394Z'
|
|
762
|
+
// }
|
|
763
|
+
//
|
|
764
|
+
const address = this.safeString(depositAddress, 'DepositAddress');
|
|
765
|
+
this.checkAddress(address);
|
|
766
|
+
return {
|
|
767
|
+
'info': depositAddress,
|
|
768
|
+
'currency': this.safeString(currency, 'code'),
|
|
769
|
+
'address': address,
|
|
770
|
+
'tag': this.safeString(depositAddress, 'Tag'),
|
|
771
|
+
'network': undefined,
|
|
772
|
+
};
|
|
773
|
+
}
|
|
726
774
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
727
775
|
let url = this.urls['api'][api] + '/' + path;
|
|
728
776
|
if (api === 'public') {
|
package/js/src/latoken.js
CHANGED
|
@@ -235,6 +235,7 @@ export default class latoken extends Exchange {
|
|
|
235
235
|
* @method
|
|
236
236
|
* @name latoken#fetchTime
|
|
237
237
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
238
|
+
* @see https://api.latoken.com/doc/v2/#tag/Time/operation/currentTime
|
|
238
239
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
239
240
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
240
241
|
*/
|
|
@@ -251,6 +252,7 @@ export default class latoken extends Exchange {
|
|
|
251
252
|
* @method
|
|
252
253
|
* @name latoken#fetchMarkets
|
|
253
254
|
* @description retrieves data on all markets for latoken
|
|
255
|
+
* @see https://api.latoken.com/doc/v2/#tag/Pair/operation/getActivePairs
|
|
254
256
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
255
257
|
* @returns {object[]} an array of objects representing market data
|
|
256
258
|
*/
|
|
@@ -487,6 +489,7 @@ export default class latoken extends Exchange {
|
|
|
487
489
|
* @method
|
|
488
490
|
* @name latoken#fetchBalance
|
|
489
491
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
492
|
+
* @see https://api.latoken.com/doc/v2/#tag/Account/operation/getBalancesByUser
|
|
490
493
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
491
494
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
492
495
|
*/
|
|
@@ -553,6 +556,7 @@ export default class latoken extends Exchange {
|
|
|
553
556
|
* @method
|
|
554
557
|
* @name latoken#fetchOrderBook
|
|
555
558
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
559
|
+
* @see https://api.latoken.com/doc/v2/#tag/Order-Book/operation/getOrderBook
|
|
556
560
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
557
561
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
558
562
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -638,6 +642,7 @@ export default class latoken extends Exchange {
|
|
|
638
642
|
* @method
|
|
639
643
|
* @name latoken#fetchTicker
|
|
640
644
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
645
|
+
* @see https://api.latoken.com/doc/v2/#tag/Ticker/operation/getTicker
|
|
641
646
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
642
647
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
643
648
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -676,6 +681,7 @@ export default class latoken extends Exchange {
|
|
|
676
681
|
* @method
|
|
677
682
|
* @name latoken#fetchTickers
|
|
678
683
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
684
|
+
* @see https://api.latoken.com/doc/v2/#tag/Ticker/operation/getAllTickers
|
|
679
685
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
680
686
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
681
687
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -798,6 +804,7 @@ export default class latoken extends Exchange {
|
|
|
798
804
|
* @method
|
|
799
805
|
* @name latoken#fetchTrades
|
|
800
806
|
* @description get the list of most recent trades for a particular symbol
|
|
807
|
+
* @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getTradesByPair
|
|
801
808
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
802
809
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
803
810
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -830,6 +837,8 @@ export default class latoken extends Exchange {
|
|
|
830
837
|
* @method
|
|
831
838
|
* @name latoken#fetchTradingFee
|
|
832
839
|
* @description fetch the trading fees for a market
|
|
840
|
+
* @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getFeeByPair
|
|
841
|
+
* @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getAuthFeeByPair
|
|
833
842
|
* @param {string} symbol unified market symbol
|
|
834
843
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
835
844
|
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
@@ -899,6 +908,8 @@ export default class latoken extends Exchange {
|
|
|
899
908
|
* @method
|
|
900
909
|
* @name latoken#fetchMyTrades
|
|
901
910
|
* @description fetch all trades made by the user
|
|
911
|
+
* @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getTradesByTrader
|
|
912
|
+
* @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getTradesByAssetAndTrader
|
|
902
913
|
* @param {string} symbol unified market symbol
|
|
903
914
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
904
915
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -1406,6 +1417,7 @@ export default class latoken extends Exchange {
|
|
|
1406
1417
|
* @name latoken#fetchTransactions
|
|
1407
1418
|
* @deprecated
|
|
1408
1419
|
* @description use fetchDepositsWithdrawals instead
|
|
1420
|
+
* @see https://api.latoken.com/doc/v2/#tag/Transaction/operation/getUserTransactions
|
|
1409
1421
|
* @param {string} code unified currency code for the currency of the transactions, default is undefined
|
|
1410
1422
|
* @param {int} [since] timestamp in ms of the earliest transaction, default is undefined
|
|
1411
1423
|
* @param {int} [limit] max number of transactions to return, default is undefined
|
|
@@ -1534,6 +1546,7 @@ export default class latoken extends Exchange {
|
|
|
1534
1546
|
* @method
|
|
1535
1547
|
* @name latoken#fetchTransfers
|
|
1536
1548
|
* @description fetch a history of internal transfers made on an account
|
|
1549
|
+
* @see https://api.latoken.com/doc/v2/#tag/Transfer/operation/getUsersTransfers
|
|
1537
1550
|
* @param {string} code unified currency code of the currency transferred
|
|
1538
1551
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
1539
1552
|
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
@@ -1582,6 +1595,9 @@ export default class latoken extends Exchange {
|
|
|
1582
1595
|
* @method
|
|
1583
1596
|
* @name latoken#transfer
|
|
1584
1597
|
* @description transfer currency internally between wallets on the same account
|
|
1598
|
+
* @see https://api.latoken.com/doc/v2/#tag/Transfer/operation/transferByEmail
|
|
1599
|
+
* @see https://api.latoken.com/doc/v2/#tag/Transfer/operation/transferById
|
|
1600
|
+
* @see https://api.latoken.com/doc/v2/#tag/Transfer/operation/transferByPhone
|
|
1585
1601
|
* @param {string} code unified currency code
|
|
1586
1602
|
* @param {float} amount amount to transfer
|
|
1587
1603
|
* @param {string} fromAccount account to transfer from
|