ccxt 4.1.36 → 4.1.38
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.js +1767 -446
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +19 -0
- package/dist/cjs/src/base/errors.js +6 -6
- package/dist/cjs/src/binance.js +2 -2
- package/dist/cjs/src/bingx.js +106 -0
- package/dist/cjs/src/bitforex.js +26 -1
- package/dist/cjs/src/bitget.js +2 -2
- package/dist/cjs/src/bitmart.js +2 -2
- package/dist/cjs/src/bitmex.js +3 -3
- package/dist/cjs/src/bybit.js +1 -0
- package/dist/cjs/src/deribit.js +2 -2
- package/dist/cjs/src/digifinex.js +204 -52
- package/dist/cjs/src/gate.js +2 -2
- package/dist/cjs/src/hollaex.js +7 -7
- package/dist/cjs/src/huobi.js +20 -4
- package/dist/cjs/src/kucoinfutures.js +0 -3
- package/dist/cjs/src/kuna.js +1284 -350
- package/dist/cjs/src/latoken.js +2 -2
- package/dist/cjs/src/pro/bitget.js +50 -7
- package/dist/cjs/src/wazirx.js +23 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bybit.d.ts +1 -0
- package/js/src/abstract/kuna.d.ts +29 -27
- package/js/src/ace.d.ts +7 -7
- package/js/src/alpaca.d.ts +7 -7
- package/js/src/ascendex.d.ts +3 -3
- package/js/src/base/Exchange.d.ts +3 -2
- package/js/src/base/Exchange.js +19 -0
- package/js/src/base/errorHierarchy.d.ts +1 -1
- package/js/src/base/errorHierarchy.js +1 -1
- package/js/src/base/errors.d.ts +3 -3
- package/js/src/base/errors.js +6 -6
- package/js/src/bigone.d.ts +10 -10
- package/js/src/binance.d.ts +48 -15
- package/js/src/binance.js +2 -2
- package/js/src/bingx.d.ts +10 -8
- package/js/src/bingx.js +106 -0
- package/js/src/bit2c.d.ts +5 -5
- package/js/src/bitbank.d.ts +7 -7
- package/js/src/bitbns.d.ts +6 -6
- package/js/src/bitfinex.d.ts +9 -9
- package/js/src/bitfinex2.d.ts +1 -1
- package/js/src/bitforex.d.ts +8 -8
- package/js/src/bitforex.js +26 -1
- package/js/src/bitget.d.ts +2 -12
- package/js/src/bitget.js +2 -2
- package/js/src/bithumb.d.ts +7 -7
- package/js/src/bitmart.d.ts +11 -21
- package/js/src/bitmart.js +2 -2
- package/js/src/bitmex.d.ts +2 -12
- package/js/src/bitmex.js +3 -3
- package/js/src/bitopro.d.ts +9 -9
- package/js/src/bitpanda.d.ts +8 -8
- package/js/src/bitrue.d.ts +9 -9
- package/js/src/bitso.d.ts +7 -7
- package/js/src/bitstamp.d.ts +7 -7
- package/js/src/bittrex.d.ts +9 -9
- package/js/src/bitvavo.d.ts +1 -1
- package/js/src/blockchaincom.d.ts +8 -8
- package/js/src/btcalpha.d.ts +9 -9
- package/js/src/btcbox.d.ts +8 -8
- package/js/src/btcmarkets.d.ts +3 -3
- package/js/src/btctradeua.d.ts +3 -3
- package/js/src/btcturk.d.ts +6 -6
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +1 -0
- package/js/src/cex.d.ts +3 -3
- package/js/src/coinbase.d.ts +1 -1
- package/js/src/coinbasepro.d.ts +1 -1
- package/js/src/coinex.d.ts +11 -11
- package/js/src/coinfalcon.d.ts +6 -6
- package/js/src/coinmate.d.ts +6 -6
- package/js/src/coinone.d.ts +5 -5
- package/js/src/coinsph.d.ts +10 -10
- package/js/src/cryptocom.d.ts +1 -1
- package/js/src/currencycom.d.ts +8 -8
- package/js/src/delta.d.ts +10 -10
- package/js/src/deribit.d.ts +9 -19
- package/js/src/deribit.js +2 -2
- package/js/src/digifinex.d.ts +10 -8
- package/js/src/digifinex.js +204 -52
- package/js/src/exmo.d.ts +3 -3
- package/js/src/gate.d.ts +2 -12
- package/js/src/gate.js +2 -2
- package/js/src/gemini.d.ts +6 -6
- package/js/src/hitbtc.d.ts +1 -1
- package/js/src/hollaex.d.ts +12 -12
- package/js/src/hollaex.js +7 -7
- package/js/src/huobi.d.ts +2 -12
- package/js/src/huobi.js +20 -4
- package/js/src/huobijp.d.ts +3 -3
- package/js/src/idex.d.ts +3 -3
- package/js/src/independentreserve.d.ts +6 -6
- package/js/src/kraken.d.ts +8 -8
- package/js/src/krakenfutures.d.ts +8 -8
- package/js/src/kucoin.d.ts +1 -1
- package/js/src/kucoinfutures.d.ts +4 -5
- package/js/src/kucoinfutures.js +0 -3
- package/js/src/kuna.d.ts +155 -7
- package/js/src/kuna.js +1290 -351
- package/js/src/latoken.d.ts +7 -7
- package/js/src/latoken.js +2 -2
- package/js/src/lbank.d.ts +3 -3
- package/js/src/lbank2.d.ts +10 -10
- package/js/src/luno.d.ts +8 -8
- package/js/src/lykke.d.ts +6 -6
- package/js/src/mercado.d.ts +9 -9
- package/js/src/mexc.d.ts +17 -17
- package/js/src/ndax.d.ts +9 -9
- package/js/src/novadax.d.ts +10 -10
- package/js/src/oceanex.d.ts +3 -3
- package/js/src/okcoin.d.ts +9 -9
- package/js/src/okx.d.ts +1 -1
- package/js/src/phemex.d.ts +13 -13
- package/js/src/poloniex.d.ts +9 -9
- package/js/src/poloniexfutures.d.ts +8 -8
- package/js/src/pro/bingx.d.ts +2 -2
- package/js/src/pro/bitget.d.ts +3 -3
- package/js/src/pro/bitget.js +50 -7
- package/js/src/pro/bybit.d.ts +3 -3
- package/js/src/pro/hitbtc.d.ts +2 -2
- package/js/src/pro/mexc.d.ts +2 -2
- package/js/src/pro/poloniex.d.ts +2 -2
- package/js/src/pro/wazirx.d.ts +2 -2
- package/js/src/probit.d.ts +9 -9
- package/js/src/tidex.d.ts +5 -5
- package/js/src/timex.d.ts +9 -9
- package/js/src/tokocrypto.d.ts +10 -10
- package/js/src/upbit.d.ts +11 -11
- package/js/src/wavesexchange.d.ts +9 -9
- package/js/src/wazirx.d.ts +8 -8
- package/js/src/wazirx.js +23 -1
- package/js/src/whitebit.d.ts +3 -3
- package/js/src/woo.d.ts +8 -8
- package/js/src/yobit.d.ts +6 -6
- package/js/src/zaif.d.ts +5 -5
- package/js/src/zonda.d.ts +6 -6
- package/package.json +1 -1
- package/skip-tests.json +6 -1
package/dist/ccxt.browser.js
CHANGED
|
@@ -8710,6 +8710,25 @@ class Exchange {
|
|
|
8710
8710
|
'cost': this.parseNumber(cost),
|
|
8711
8711
|
};
|
|
8712
8712
|
}
|
|
8713
|
+
safeLiquidation(liquidation, market = undefined) {
|
|
8714
|
+
const contracts = this.safeString(liquidation, 'contracts');
|
|
8715
|
+
const contractSize = this.safeString(market, 'contractSize');
|
|
8716
|
+
const price = this.safeString(liquidation, 'price');
|
|
8717
|
+
let baseValue = this.safeString(liquidation, 'baseValue');
|
|
8718
|
+
let quoteValue = this.safeString(liquidation, 'quoteValue');
|
|
8719
|
+
if ((baseValue === undefined) && (contracts !== undefined) && (contractSize !== undefined) && (price !== undefined)) {
|
|
8720
|
+
baseValue = _Precise_js__WEBPACK_IMPORTED_MODULE_8__/* .Precise.stringMul */ .O.stringMul(contracts, contractSize);
|
|
8721
|
+
}
|
|
8722
|
+
if ((quoteValue === undefined) && (baseValue !== undefined) && (price !== undefined)) {
|
|
8723
|
+
quoteValue = _Precise_js__WEBPACK_IMPORTED_MODULE_8__/* .Precise.stringMul */ .O.stringMul(baseValue, price);
|
|
8724
|
+
}
|
|
8725
|
+
liquidation['contracts'] = this.parseNumber(contracts);
|
|
8726
|
+
liquidation['contractSize'] = this.parseNumber(contractSize);
|
|
8727
|
+
liquidation['price'] = this.parseNumber(price);
|
|
8728
|
+
liquidation['baseValue'] = this.parseNumber(baseValue);
|
|
8729
|
+
liquidation['quoteValue'] = this.parseNumber(quoteValue);
|
|
8730
|
+
return liquidation;
|
|
8731
|
+
}
|
|
8713
8732
|
safeTrade(trade, market = undefined) {
|
|
8714
8733
|
const amount = this.safeString(trade, 'amount');
|
|
8715
8734
|
const price = this.safeString(trade, 'price');
|
|
@@ -11525,12 +11544,6 @@ class ExchangeError extends Error {
|
|
|
11525
11544
|
this.name = 'ExchangeError';
|
|
11526
11545
|
}
|
|
11527
11546
|
}
|
|
11528
|
-
class OperationFailed extends ExchangeError {
|
|
11529
|
-
constructor(message) {
|
|
11530
|
-
super(message);
|
|
11531
|
-
this.name = 'OperationFailed';
|
|
11532
|
-
}
|
|
11533
|
-
}
|
|
11534
11547
|
class AuthenticationError extends ExchangeError {
|
|
11535
11548
|
constructor(message) {
|
|
11536
11549
|
super(message);
|
|
@@ -11718,6 +11731,12 @@ class RequestTimeout extends NetworkError {
|
|
|
11718
11731
|
this.name = 'RequestTimeout';
|
|
11719
11732
|
}
|
|
11720
11733
|
}
|
|
11734
|
+
class OperationFailed extends NetworkError {
|
|
11735
|
+
constructor(message) {
|
|
11736
|
+
super(message);
|
|
11737
|
+
this.name = 'OperationFailed';
|
|
11738
|
+
}
|
|
11739
|
+
}
|
|
11721
11740
|
/* ------------------------------------------------------------------------ */
|
|
11722
11741
|
// export default subclass (
|
|
11723
11742
|
// // Root class
|
|
@@ -25797,7 +25816,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
25797
25816
|
//
|
|
25798
25817
|
const marketId = this.safeString(liquidation, 'symbol');
|
|
25799
25818
|
const timestamp = this.safeInteger2(liquidation, 'updatedTime', 'updateTime');
|
|
25800
|
-
return {
|
|
25819
|
+
return this.safeLiquidation({
|
|
25801
25820
|
'info': liquidation,
|
|
25802
25821
|
'symbol': this.safeSymbol(marketId, market),
|
|
25803
25822
|
'contracts': this.safeNumber(liquidation, 'executedQty'),
|
|
@@ -25807,7 +25826,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
25807
25826
|
'quoteValue': this.safeNumber(liquidation, 'cumQuote'),
|
|
25808
25827
|
'timestamp': timestamp,
|
|
25809
25828
|
'datetime': this.iso8601(timestamp),
|
|
25810
|
-
};
|
|
25829
|
+
});
|
|
25811
25830
|
}
|
|
25812
25831
|
}
|
|
25813
25832
|
|
|
@@ -26040,7 +26059,9 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
26040
26059
|
'fetchFundingRate': true,
|
|
26041
26060
|
'fetchFundingRateHistory': true,
|
|
26042
26061
|
'fetchLeverage': true,
|
|
26062
|
+
'fetchLiquidations': false,
|
|
26043
26063
|
'fetchMarkets': true,
|
|
26064
|
+
'fetchMyLiquidations': true,
|
|
26044
26065
|
'fetchOHLCV': true,
|
|
26045
26066
|
'fetchOpenInterest': true,
|
|
26046
26067
|
'fetchOpenOrders': true,
|
|
@@ -29077,6 +29098,110 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
29077
29098
|
}
|
|
29078
29099
|
return sortedParams;
|
|
29079
29100
|
}
|
|
29101
|
+
async fetchMyLiquidations(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
29102
|
+
/**
|
|
29103
|
+
* @method
|
|
29104
|
+
* @name bingx#fetchMyLiquidations
|
|
29105
|
+
* @description retrieves the users liquidated positions
|
|
29106
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#User's%20Force%20Orders
|
|
29107
|
+
* @param {string} [symbol] unified CCXT market symbol
|
|
29108
|
+
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
29109
|
+
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
29110
|
+
* @param {object} [params] exchange specific parameters for the bingx api endpoint
|
|
29111
|
+
* @param {int} [params.until] timestamp in ms of the latest liquidation
|
|
29112
|
+
* @returns {object} an array of [liquidation structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure}
|
|
29113
|
+
*/
|
|
29114
|
+
await this.loadMarkets();
|
|
29115
|
+
let request = {
|
|
29116
|
+
'autoCloseType': 'LIQUIDATION',
|
|
29117
|
+
};
|
|
29118
|
+
[request, params] = this.handleUntilOption('endTime', request, params);
|
|
29119
|
+
let market = undefined;
|
|
29120
|
+
if (symbol !== undefined) {
|
|
29121
|
+
market = this.market(symbol);
|
|
29122
|
+
request['symbol'] = symbol;
|
|
29123
|
+
}
|
|
29124
|
+
if (since !== undefined) {
|
|
29125
|
+
request['startTime'] = since;
|
|
29126
|
+
}
|
|
29127
|
+
if (limit !== undefined) {
|
|
29128
|
+
request['limit'] = limit;
|
|
29129
|
+
}
|
|
29130
|
+
const response = await this.swapV2PrivateGetTradeForceOrders(this.extend(request, params));
|
|
29131
|
+
//
|
|
29132
|
+
// {
|
|
29133
|
+
// "code": 0,
|
|
29134
|
+
// "msg": "",
|
|
29135
|
+
// "data": {
|
|
29136
|
+
// "orders": [
|
|
29137
|
+
// {
|
|
29138
|
+
// "time": "int64",
|
|
29139
|
+
// "symbol": "string",
|
|
29140
|
+
// "side": "string",
|
|
29141
|
+
// "type": "string",
|
|
29142
|
+
// "positionSide": "string",
|
|
29143
|
+
// "cumQuote": "string",
|
|
29144
|
+
// "status": "string",
|
|
29145
|
+
// "stopPrice": "string",
|
|
29146
|
+
// "price": "string",
|
|
29147
|
+
// "origQty": "string",
|
|
29148
|
+
// "avgPrice": "string",
|
|
29149
|
+
// "executedQty": "string",
|
|
29150
|
+
// "orderId": "int64",
|
|
29151
|
+
// "profit": "string",
|
|
29152
|
+
// "commission": "string",
|
|
29153
|
+
// "workingType": "string",
|
|
29154
|
+
// "updateTime": "int64"
|
|
29155
|
+
// },
|
|
29156
|
+
// ]
|
|
29157
|
+
// }
|
|
29158
|
+
// }
|
|
29159
|
+
//
|
|
29160
|
+
const data = this.safeValue(response, 'data', {});
|
|
29161
|
+
const liquidations = this.safeValue(data, 'orders', []);
|
|
29162
|
+
return this.parseLiquidations(liquidations, market, since, limit);
|
|
29163
|
+
}
|
|
29164
|
+
parseLiquidation(liquidation, market = undefined) {
|
|
29165
|
+
//
|
|
29166
|
+
// {
|
|
29167
|
+
// "time": "int64",
|
|
29168
|
+
// "symbol": "string",
|
|
29169
|
+
// "side": "string",
|
|
29170
|
+
// "type": "string",
|
|
29171
|
+
// "positionSide": "string",
|
|
29172
|
+
// "cumQuote": "string",
|
|
29173
|
+
// "status": "string",
|
|
29174
|
+
// "stopPrice": "string",
|
|
29175
|
+
// "price": "string",
|
|
29176
|
+
// "origQty": "string",
|
|
29177
|
+
// "avgPrice": "string",
|
|
29178
|
+
// "executedQty": "string",
|
|
29179
|
+
// "orderId": "int64",
|
|
29180
|
+
// "profit": "string",
|
|
29181
|
+
// "commission": "string",
|
|
29182
|
+
// "workingType": "string",
|
|
29183
|
+
// "updateTime": "int64"
|
|
29184
|
+
// }
|
|
29185
|
+
//
|
|
29186
|
+
const marketId = this.safeString(liquidation, 'symbol');
|
|
29187
|
+
const timestamp = this.safeInteger(liquidation, 'time');
|
|
29188
|
+
const contractsString = this.safeString(liquidation, 'executedQty');
|
|
29189
|
+
const contractSizeString = this.safeString(market, 'contractSize');
|
|
29190
|
+
const priceString = this.safeString(liquidation, 'avgPrice');
|
|
29191
|
+
const baseValueString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMul */ .O.stringMul(contractsString, contractSizeString);
|
|
29192
|
+
const quoteValueString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMul */ .O.stringMul(baseValueString, priceString);
|
|
29193
|
+
return this.safeLiquidation({
|
|
29194
|
+
'info': liquidation,
|
|
29195
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
29196
|
+
'contracts': this.parseNumber(contractsString),
|
|
29197
|
+
'contractSize': this.parseNumber(contractSizeString),
|
|
29198
|
+
'price': this.parseNumber(priceString),
|
|
29199
|
+
'baseValue': this.parseNumber(baseValueString),
|
|
29200
|
+
'quoteValue': this.parseNumber(quoteValueString),
|
|
29201
|
+
'timestamp': timestamp,
|
|
29202
|
+
'datetime': this.iso8601(timestamp),
|
|
29203
|
+
});
|
|
29204
|
+
}
|
|
29080
29205
|
sign(path, section = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
29081
29206
|
const type = section[0];
|
|
29082
29207
|
const version = section[1];
|
|
@@ -38114,29 +38239,48 @@ class bitforex extends _abstract_bitforex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
38114
38239
|
'CORS': undefined,
|
|
38115
38240
|
'spot': true,
|
|
38116
38241
|
'margin': false,
|
|
38117
|
-
'swap':
|
|
38242
|
+
'swap': false,
|
|
38118
38243
|
'future': false,
|
|
38119
38244
|
'option': false,
|
|
38245
|
+
'addMargin': false,
|
|
38246
|
+
'borrowMargin': false,
|
|
38120
38247
|
'cancelOrder': true,
|
|
38121
38248
|
'createOrder': true,
|
|
38249
|
+
'createReduceOnlyOrder': false,
|
|
38122
38250
|
'createStopLimitOrder': false,
|
|
38123
38251
|
'createStopMarketOrder': false,
|
|
38124
38252
|
'createStopOrder': false,
|
|
38125
38253
|
'fetchBalance': true,
|
|
38254
|
+
'fetchBorrowInterest': false,
|
|
38126
38255
|
'fetchBorrowRate': false,
|
|
38127
38256
|
'fetchBorrowRateHistories': false,
|
|
38128
38257
|
'fetchBorrowRateHistory': false,
|
|
38129
38258
|
'fetchBorrowRates': false,
|
|
38130
38259
|
'fetchBorrowRatesPerSymbol': false,
|
|
38131
38260
|
'fetchClosedOrders': true,
|
|
38261
|
+
'fetchFundingHistory': false,
|
|
38262
|
+
'fetchFundingRate': false,
|
|
38263
|
+
'fetchFundingRateHistory': false,
|
|
38264
|
+
'fetchFundingRates': false,
|
|
38265
|
+
'fetchIndexOHLCV': false,
|
|
38266
|
+
'fetchIsolatedPositions': false,
|
|
38267
|
+
'fetchLeverage': false,
|
|
38268
|
+
'fetchLeverageTiers': false,
|
|
38132
38269
|
'fetchMarginMode': false,
|
|
38270
|
+
'fetchMarketLeverageTiers': false,
|
|
38133
38271
|
'fetchMarkets': true,
|
|
38272
|
+
'fetchMarkOHLCV': false,
|
|
38134
38273
|
'fetchMyTrades': true,
|
|
38135
38274
|
'fetchOHLCV': true,
|
|
38275
|
+
'fetchOpenInterestHistory': false,
|
|
38136
38276
|
'fetchOpenOrders': true,
|
|
38137
38277
|
'fetchOrder': true,
|
|
38138
38278
|
'fetchOrderBook': true,
|
|
38279
|
+
'fetchPosition': false,
|
|
38139
38280
|
'fetchPositionMode': false,
|
|
38281
|
+
'fetchPositions': false,
|
|
38282
|
+
'fetchPositionsRisk': false,
|
|
38283
|
+
'fetchPremiumIndexOHLCV': false,
|
|
38140
38284
|
'fetchTicker': true,
|
|
38141
38285
|
'fetchTickers': false,
|
|
38142
38286
|
'fetchTrades': true,
|
|
@@ -38145,6 +38289,12 @@ class bitforex extends _abstract_bitforex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
38145
38289
|
'fetchTransfers': false,
|
|
38146
38290
|
'fetchWithdrawal': false,
|
|
38147
38291
|
'fetchWithdrawals': false,
|
|
38292
|
+
'reduceMargin': false,
|
|
38293
|
+
'repayMargin': false,
|
|
38294
|
+
'setLeverage': false,
|
|
38295
|
+
'setMargin': false,
|
|
38296
|
+
'setMarginMode': false,
|
|
38297
|
+
'setPositionMode': false,
|
|
38148
38298
|
'transfer': false,
|
|
38149
38299
|
'withdraw': false,
|
|
38150
38300
|
},
|
|
@@ -45237,7 +45387,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
45237
45387
|
const liquidationFee = this.safeString(liquidation, 'LiqFee');
|
|
45238
45388
|
const totalDebt = this.safeString(liquidation, 'totalDebt');
|
|
45239
45389
|
const quoteValueString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringAdd */ .O.stringAdd(liquidationFee, totalDebt);
|
|
45240
|
-
return {
|
|
45390
|
+
return this.safeLiquidation({
|
|
45241
45391
|
'info': liquidation,
|
|
45242
45392
|
'symbol': this.safeSymbol(marketId, market),
|
|
45243
45393
|
'contracts': undefined,
|
|
@@ -45247,7 +45397,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
45247
45397
|
'quoteValue': this.parseNumber(quoteValueString),
|
|
45248
45398
|
'timestamp': timestamp,
|
|
45249
45399
|
'datetime': this.iso8601(timestamp),
|
|
45250
|
-
};
|
|
45400
|
+
});
|
|
45251
45401
|
}
|
|
45252
45402
|
async fetchBorrowRate(code, params = {}) {
|
|
45253
45403
|
/**
|
|
@@ -50830,7 +50980,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
50830
50980
|
const priceString = this.safeString(liquidation, 'deal_avg_price');
|
|
50831
50981
|
const baseValueString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMul */ .O.stringMul(contractsString, contractSizeString);
|
|
50832
50982
|
const quoteValueString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMul */ .O.stringMul(baseValueString, priceString);
|
|
50833
|
-
return {
|
|
50983
|
+
return this.safeLiquidation({
|
|
50834
50984
|
'info': liquidation,
|
|
50835
50985
|
'symbol': this.safeSymbol(marketId, market),
|
|
50836
50986
|
'contracts': this.parseNumber(contractsString),
|
|
@@ -50840,7 +50990,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
50840
50990
|
'quoteValue': this.parseNumber(quoteValueString),
|
|
50841
50991
|
'timestamp': timestamp,
|
|
50842
50992
|
'datetime': this.iso8601(timestamp),
|
|
50843
|
-
};
|
|
50993
|
+
});
|
|
50844
50994
|
}
|
|
50845
50995
|
nonce() {
|
|
50846
50996
|
return this.milliseconds();
|
|
@@ -51852,7 +52002,7 @@ class bitmex extends _abstract_bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
51852
52002
|
*/
|
|
51853
52003
|
// Bitmex barfs if you set 'open': false in the filter...
|
|
51854
52004
|
const orders = await this.fetchOrders(symbol, since, limit, params);
|
|
51855
|
-
return this.
|
|
52005
|
+
return this.filterByArray(orders, 'status', ['closed', 'canceled'], false);
|
|
51856
52006
|
}
|
|
51857
52007
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
51858
52008
|
/**
|
|
@@ -53623,7 +53773,7 @@ class bitmex extends _abstract_bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
53623
53773
|
// }
|
|
53624
53774
|
//
|
|
53625
53775
|
const marketId = this.safeString(liquidation, 'symbol');
|
|
53626
|
-
return {
|
|
53776
|
+
return this.safeLiquidation({
|
|
53627
53777
|
'info': liquidation,
|
|
53628
53778
|
'symbol': this.safeSymbol(marketId, market),
|
|
53629
53779
|
'contracts': undefined,
|
|
@@ -53633,7 +53783,7 @@ class bitmex extends _abstract_bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
53633
53783
|
'quoteValue': undefined,
|
|
53634
53784
|
'timestamp': undefined,
|
|
53635
53785
|
'datetime': undefined,
|
|
53636
|
-
};
|
|
53786
|
+
});
|
|
53637
53787
|
}
|
|
53638
53788
|
handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
53639
53789
|
if (response === undefined) {
|
|
@@ -74514,6 +74664,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
74514
74664
|
'v5/user/query-api': 5,
|
|
74515
74665
|
'v5/user/get-member-type': 5,
|
|
74516
74666
|
'v5/user/aff-customer-info': 5,
|
|
74667
|
+
'v5/user/del-submember': 5,
|
|
74517
74668
|
// spot leverage token
|
|
74518
74669
|
'v5/spot-lever-token/order-record': 1,
|
|
74519
74670
|
// spot margin trade
|
|
@@ -110982,7 +111133,7 @@ class deribit extends _abstract_deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
110982
111133
|
// }
|
|
110983
111134
|
//
|
|
110984
111135
|
const timestamp = this.safeInteger(liquidation, 'timestamp');
|
|
110985
|
-
return {
|
|
111136
|
+
return this.safeLiquidation({
|
|
110986
111137
|
'info': liquidation,
|
|
110987
111138
|
'symbol': this.safeSymbol(undefined, market),
|
|
110988
111139
|
'contracts': undefined,
|
|
@@ -110992,7 +111143,7 @@ class deribit extends _abstract_deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
110992
111143
|
'quoteValue': undefined,
|
|
110993
111144
|
'timestamp': timestamp,
|
|
110994
111145
|
'datetime': this.iso8601(timestamp),
|
|
110995
|
-
};
|
|
111146
|
+
});
|
|
110996
111147
|
}
|
|
110997
111148
|
nonce() {
|
|
110998
111149
|
return this.milliseconds();
|
|
@@ -111095,6 +111246,7 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
111095
111246
|
'cancelOrder': true,
|
|
111096
111247
|
'cancelOrders': true,
|
|
111097
111248
|
'createOrder': true,
|
|
111249
|
+
'createOrders': true,
|
|
111098
111250
|
'createPostOnlyOrder': true,
|
|
111099
111251
|
'createReduceOnlyOrder': true,
|
|
111100
111252
|
'createStopLimitOrder': false,
|
|
@@ -111352,6 +111504,7 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
111352
111504
|
'options': {
|
|
111353
111505
|
'defaultType': 'spot',
|
|
111354
111506
|
'types': ['spot', 'margin', 'otc'],
|
|
111507
|
+
'createMarketBuyOrderRequiresPrice': true,
|
|
111355
111508
|
'accountsByType': {
|
|
111356
111509
|
'spot': '1',
|
|
111357
111510
|
'margin': '2',
|
|
@@ -112615,28 +112768,173 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
112615
112768
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
112616
112769
|
* @param {string} type 'market' or 'limit'
|
|
112617
112770
|
* @param {string} side 'buy' or 'sell'
|
|
112618
|
-
* @param {float} amount how much
|
|
112771
|
+
* @param {float} amount how much you want to trade in units of the base currency, spot market orders use the quote currency, swap requires the number of contracts
|
|
112619
112772
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
112620
112773
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
112621
112774
|
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
112622
112775
|
* @param {bool} [params.postOnly] true or false
|
|
112623
112776
|
* @param {bool} [params.reduceOnly] true or false
|
|
112777
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
112624
112778
|
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
112625
112779
|
*/
|
|
112626
112780
|
await this.loadMarkets();
|
|
112627
112781
|
const market = this.market(symbol);
|
|
112628
|
-
|
|
112782
|
+
const marginResult = this.handleMarginModeAndParams('createOrder', params);
|
|
112783
|
+
const marginMode = marginResult[0];
|
|
112784
|
+
const request = this.createOrderRequest(symbol, type, side, amount, price, params);
|
|
112785
|
+
let response = undefined;
|
|
112786
|
+
if (market['swap']) {
|
|
112787
|
+
response = await this.privateSwapPostTradeOrderPlace(request);
|
|
112788
|
+
}
|
|
112789
|
+
else {
|
|
112790
|
+
if (marginMode !== undefined) {
|
|
112791
|
+
response = await this.privateSpotPostMarginOrderNew(request);
|
|
112792
|
+
}
|
|
112793
|
+
else {
|
|
112794
|
+
response = await this.privateSpotPostSpotOrderNew(request);
|
|
112795
|
+
}
|
|
112796
|
+
}
|
|
112797
|
+
//
|
|
112798
|
+
// spot and margin
|
|
112799
|
+
//
|
|
112800
|
+
// {
|
|
112801
|
+
// "code": 0,
|
|
112802
|
+
// "order_id": "198361cecdc65f9c8c9bb2fa68faec40"
|
|
112803
|
+
// }
|
|
112804
|
+
//
|
|
112805
|
+
// swap
|
|
112806
|
+
//
|
|
112807
|
+
// {
|
|
112808
|
+
// "code": 0,
|
|
112809
|
+
// "data": "1590873693003714560"
|
|
112810
|
+
// }
|
|
112811
|
+
//
|
|
112812
|
+
const order = this.parseOrder(response, market);
|
|
112813
|
+
order['symbol'] = market['symbol'];
|
|
112814
|
+
order['type'] = type;
|
|
112815
|
+
order['side'] = side;
|
|
112816
|
+
order['amount'] = amount;
|
|
112817
|
+
order['price'] = price;
|
|
112818
|
+
return order;
|
|
112819
|
+
}
|
|
112820
|
+
async createOrders(orders, params = {}) {
|
|
112821
|
+
/**
|
|
112822
|
+
* @method
|
|
112823
|
+
* @name digifinex#createOrders
|
|
112824
|
+
* @description create a list of trade orders (all orders should be of the same symbol)
|
|
112825
|
+
* @see https://docs.digifinex.com/en-ww/spot/v3/rest.html#create-multiple-order
|
|
112826
|
+
* @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#batchorder
|
|
112827
|
+
* @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
|
112828
|
+
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
112829
|
+
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
112830
|
+
*/
|
|
112831
|
+
await this.loadMarkets();
|
|
112832
|
+
const ordersRequests = [];
|
|
112833
|
+
let symbol = undefined;
|
|
112834
|
+
let marginMode = undefined;
|
|
112835
|
+
for (let i = 0; i < orders.length; i++) {
|
|
112836
|
+
const rawOrder = orders[i];
|
|
112837
|
+
const marketId = this.safeString(rawOrder, 'symbol');
|
|
112838
|
+
if (symbol === undefined) {
|
|
112839
|
+
symbol = marketId;
|
|
112840
|
+
}
|
|
112841
|
+
else {
|
|
112842
|
+
if (symbol !== marketId) {
|
|
112843
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' createOrders() requires all orders to have the same symbol');
|
|
112844
|
+
}
|
|
112845
|
+
}
|
|
112846
|
+
const type = this.safeString(rawOrder, 'type');
|
|
112847
|
+
const side = this.safeString(rawOrder, 'side');
|
|
112848
|
+
const amount = this.safeValue(rawOrder, 'amount');
|
|
112849
|
+
const price = this.safeValue(rawOrder, 'price');
|
|
112850
|
+
const orderParams = this.safeValue(rawOrder, 'params', {});
|
|
112851
|
+
const marginResult = this.handleMarginModeAndParams('createOrders', params);
|
|
112852
|
+
const currentMarginMode = marginResult[0];
|
|
112853
|
+
if (currentMarginMode !== undefined) {
|
|
112854
|
+
if (marginMode === undefined) {
|
|
112855
|
+
marginMode = currentMarginMode;
|
|
112856
|
+
}
|
|
112857
|
+
else {
|
|
112858
|
+
if (marginMode !== currentMarginMode) {
|
|
112859
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' createOrders() requires all orders to have the same margin mode (isolated or cross)');
|
|
112860
|
+
}
|
|
112861
|
+
}
|
|
112862
|
+
}
|
|
112863
|
+
const orderRequest = this.createOrderRequest(marketId, type, side, amount, price, orderParams);
|
|
112864
|
+
ordersRequests.push(orderRequest);
|
|
112865
|
+
}
|
|
112866
|
+
const market = this.market(symbol);
|
|
112867
|
+
const request = {};
|
|
112868
|
+
let response = undefined;
|
|
112869
|
+
if (market['swap']) {
|
|
112870
|
+
response = await this.privateSwapPostTradeBatchOrder(ordersRequests);
|
|
112871
|
+
}
|
|
112872
|
+
else {
|
|
112873
|
+
request['market'] = (marginMode !== undefined) ? 'margin' : 'spot';
|
|
112874
|
+
request['symbol'] = market['id'];
|
|
112875
|
+
request['list'] = this.json(ordersRequests);
|
|
112876
|
+
response = await this.privateSpotPostMarketOrderBatchNew(request);
|
|
112877
|
+
}
|
|
112878
|
+
//
|
|
112879
|
+
// spot
|
|
112880
|
+
//
|
|
112881
|
+
// {
|
|
112882
|
+
// "code": 0,
|
|
112883
|
+
// "order_ids": [
|
|
112884
|
+
// "064290fbe2d26e7b28d7e6c0a5cf70a5",
|
|
112885
|
+
// "24c8f9b73d81e4d9d8d7e3280281c258"
|
|
112886
|
+
// ]
|
|
112887
|
+
// }
|
|
112888
|
+
//
|
|
112889
|
+
// swap
|
|
112890
|
+
//
|
|
112891
|
+
// {
|
|
112892
|
+
// "code": 0,
|
|
112893
|
+
// "data": [
|
|
112894
|
+
// "1720297963537829888",
|
|
112895
|
+
// "1720297963537829889"
|
|
112896
|
+
// ]
|
|
112897
|
+
// }
|
|
112898
|
+
//
|
|
112899
|
+
let data = [];
|
|
112900
|
+
if (market['swap']) {
|
|
112901
|
+
data = this.safeValue(response, 'data', []);
|
|
112902
|
+
}
|
|
112903
|
+
else {
|
|
112904
|
+
data = this.safeValue(response, 'order_ids', []);
|
|
112905
|
+
}
|
|
112906
|
+
const result = [];
|
|
112907
|
+
for (let i = 0; i < orders.length; i++) {
|
|
112908
|
+
const rawOrder = orders[i];
|
|
112909
|
+
const individualOrder = {};
|
|
112910
|
+
individualOrder['order_id'] = data[i];
|
|
112911
|
+
individualOrder['instrument_id'] = market['id'];
|
|
112912
|
+
individualOrder['amount'] = this.safeNumber(rawOrder, 'amount');
|
|
112913
|
+
individualOrder['price'] = this.safeNumber(rawOrder, 'price');
|
|
112914
|
+
result.push(individualOrder);
|
|
112915
|
+
}
|
|
112916
|
+
return this.parseOrders(result, market);
|
|
112917
|
+
}
|
|
112918
|
+
createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
112919
|
+
/**
|
|
112920
|
+
* @method
|
|
112921
|
+
* @ignore
|
|
112922
|
+
* @name digifinex#createOrderRequest
|
|
112923
|
+
* @description helper function to build request
|
|
112924
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
112925
|
+
* @param {string} type 'market' or 'limit'
|
|
112926
|
+
* @param {string} side 'buy' or 'sell'
|
|
112927
|
+
* @param {float} amount how much you want to trade in units of the base currency, spot market orders use the quote currency, swap requires the number of contracts
|
|
112928
|
+
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
112929
|
+
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
112930
|
+
* @returns {object} request to be sent to the exchange
|
|
112931
|
+
*/
|
|
112932
|
+
const market = this.market(symbol);
|
|
112629
112933
|
let marketType = undefined;
|
|
112630
112934
|
let marginMode = undefined;
|
|
112631
|
-
[marketType, params] = this.handleMarketTypeAndParams('
|
|
112632
|
-
|
|
112633
|
-
'spot': 'privateSpotPostSpotOrderNew',
|
|
112634
|
-
'margin': 'privateSpotPostMarginOrderNew',
|
|
112635
|
-
'swap': 'privateSwapPostTradeOrderPlace',
|
|
112636
|
-
});
|
|
112637
|
-
[marginMode, params] = this.handleMarginModeAndParams('createOrder', params);
|
|
112935
|
+
[marketType, params] = this.handleMarketTypeAndParams('createOrderRequest', market, params);
|
|
112936
|
+
[marginMode, params] = this.handleMarginModeAndParams('createOrderRequest', params);
|
|
112638
112937
|
if (marginMode !== undefined) {
|
|
112639
|
-
method = 'privateSpotPostMarginOrderNew';
|
|
112640
112938
|
marketType = 'margin';
|
|
112641
112939
|
}
|
|
112642
112940
|
const request = {};
|
|
@@ -112693,40 +112991,34 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
112693
112991
|
}
|
|
112694
112992
|
request['type'] = side + suffix;
|
|
112695
112993
|
// limit orders require the amount in the base currency, market orders require the amount in the quote currency
|
|
112696
|
-
|
|
112994
|
+
let quantity = undefined;
|
|
112995
|
+
const createMarketBuyOrderRequiresPrice = this.safeValue(this.options, 'createMarketBuyOrderRequiresPrice', true);
|
|
112996
|
+
if (createMarketBuyOrderRequiresPrice && isMarketOrder && (side === 'buy')) {
|
|
112997
|
+
if (price === undefined) {
|
|
112998
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder(this.id + ' createOrder() requires a price argument for market buy orders on spot markets to calculate the total amount to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option to false and pass in the cost to spend into the amount parameter');
|
|
112999
|
+
}
|
|
113000
|
+
else {
|
|
113001
|
+
const amountString = this.numberToString(amount);
|
|
113002
|
+
const priceString = this.numberToString(price);
|
|
113003
|
+
const cost = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMul */ .O.stringMul(amountString, priceString));
|
|
113004
|
+
quantity = this.priceToPrecision(symbol, cost);
|
|
113005
|
+
}
|
|
113006
|
+
}
|
|
113007
|
+
else {
|
|
113008
|
+
quantity = this.amountToPrecision(symbol, amount);
|
|
113009
|
+
}
|
|
113010
|
+
request['amount'] = quantity;
|
|
112697
113011
|
}
|
|
112698
113012
|
if (postOnly) {
|
|
112699
113013
|
if (postOnlyParsed) {
|
|
112700
|
-
request['
|
|
113014
|
+
request['post_only'] = postOnlyParsed;
|
|
112701
113015
|
}
|
|
112702
113016
|
else {
|
|
112703
|
-
request['
|
|
113017
|
+
request['post_only'] = postOnly;
|
|
112704
113018
|
}
|
|
112705
113019
|
}
|
|
112706
|
-
|
|
112707
|
-
|
|
112708
|
-
//
|
|
112709
|
-
// spot and margin
|
|
112710
|
-
//
|
|
112711
|
-
// {
|
|
112712
|
-
// "code": 0,
|
|
112713
|
-
// "order_id": "198361cecdc65f9c8c9bb2fa68faec40"
|
|
112714
|
-
// }
|
|
112715
|
-
//
|
|
112716
|
-
// swap
|
|
112717
|
-
//
|
|
112718
|
-
// {
|
|
112719
|
-
// "code": 0,
|
|
112720
|
-
// "data": "1590873693003714560"
|
|
112721
|
-
// }
|
|
112722
|
-
//
|
|
112723
|
-
const order = this.parseOrder(response, market);
|
|
112724
|
-
order['symbol'] = symbol;
|
|
112725
|
-
order['type'] = type;
|
|
112726
|
-
order['side'] = side;
|
|
112727
|
-
order['amount'] = amount;
|
|
112728
|
-
order['price'] = price;
|
|
112729
|
-
return order;
|
|
113020
|
+
params = this.omit(params, ['postOnly']);
|
|
113021
|
+
return this.extend(request, params);
|
|
112730
113022
|
}
|
|
112731
113023
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
112732
113024
|
/**
|
|
@@ -112863,6 +113155,15 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
112863
113155
|
// "data": "1590873693003714560"
|
|
112864
113156
|
// }
|
|
112865
113157
|
//
|
|
113158
|
+
// spot and swap: createOrders
|
|
113159
|
+
//
|
|
113160
|
+
// {
|
|
113161
|
+
// "order_id": "d64d92a5e0a120f792f385485bc3d95b",
|
|
113162
|
+
// "instrument_id": "BTC_USDT",
|
|
113163
|
+
// "amount": 0.0001,
|
|
113164
|
+
// "price": 27000
|
|
113165
|
+
// }
|
|
113166
|
+
//
|
|
112866
113167
|
// spot: fetchOrder, fetchOpenOrders, fetchOrders
|
|
112867
113168
|
//
|
|
112868
113169
|
// {
|
|
@@ -112908,24 +113209,26 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
112908
113209
|
let type = undefined;
|
|
112909
113210
|
let side = this.safeString(order, 'type');
|
|
112910
113211
|
const marketId = this.safeString2(order, 'symbol', 'instrument_id');
|
|
112911
|
-
const symbol = this.safeSymbol(marketId, market
|
|
113212
|
+
const symbol = this.safeSymbol(marketId, market);
|
|
112912
113213
|
market = this.market(symbol);
|
|
112913
113214
|
if (market['type'] === 'swap') {
|
|
112914
113215
|
const orderType = this.safeInteger(order, 'order_type');
|
|
112915
|
-
if (
|
|
112916
|
-
|
|
112917
|
-
|
|
112918
|
-
|
|
112919
|
-
|
|
112920
|
-
|
|
112921
|
-
|
|
112922
|
-
|
|
112923
|
-
|
|
112924
|
-
|
|
112925
|
-
|
|
112926
|
-
|
|
112927
|
-
|
|
112928
|
-
|
|
113216
|
+
if (orderType !== undefined) {
|
|
113217
|
+
if ((orderType === 9) || (orderType === 10) || (orderType === 11) || (orderType === 12) || (orderType === 15)) {
|
|
113218
|
+
timeInForce = 'FOK';
|
|
113219
|
+
}
|
|
113220
|
+
else if ((orderType === 1) || (orderType === 2) || (orderType === 3) || (orderType === 4) || (orderType === 13)) {
|
|
113221
|
+
timeInForce = 'IOC';
|
|
113222
|
+
}
|
|
113223
|
+
else if ((orderType === 6) || (orderType === 7) || (orderType === 8) || (orderType === 14)) {
|
|
113224
|
+
timeInForce = 'GTC';
|
|
113225
|
+
}
|
|
113226
|
+
if ((orderType === 0) || (orderType === 1) || (orderType === 4) || (orderType === 5) || (orderType === 9) || (orderType === 10)) {
|
|
113227
|
+
type = 'limit';
|
|
113228
|
+
}
|
|
113229
|
+
else {
|
|
113230
|
+
type = 'market';
|
|
113231
|
+
}
|
|
112929
113232
|
}
|
|
112930
113233
|
if (side === '1') {
|
|
112931
113234
|
side = 'open long';
|
|
@@ -124495,7 +124798,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
124495
124798
|
if (quoteValueString === undefined) {
|
|
124496
124799
|
quoteValueString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMul */ .O.stringMul(baseValueString, priceString);
|
|
124497
124800
|
}
|
|
124498
|
-
return {
|
|
124801
|
+
return this.safeLiquidation({
|
|
124499
124802
|
'info': liquidation,
|
|
124500
124803
|
'symbol': this.safeSymbol(marketId, market),
|
|
124501
124804
|
'contracts': this.parseNumber(contractsString),
|
|
@@ -124505,7 +124808,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
124505
124808
|
'quoteValue': this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringAbs */ .O.stringAbs(quoteValueString)),
|
|
124506
124809
|
'timestamp': timestamp,
|
|
124507
124810
|
'datetime': this.iso8601(timestamp),
|
|
124508
|
-
};
|
|
124811
|
+
});
|
|
124509
124812
|
}
|
|
124510
124813
|
handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
124511
124814
|
if (response === undefined) {
|
|
@@ -130332,7 +130635,7 @@ class hollaex extends _abstract_hollaex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
130332
130635
|
//
|
|
130333
130636
|
return this.parseOHLCVs(response, market, timeframe, since, limit);
|
|
130334
130637
|
}
|
|
130335
|
-
parseOHLCV(
|
|
130638
|
+
parseOHLCV(ohlcv, market = undefined) {
|
|
130336
130639
|
//
|
|
130337
130640
|
// {
|
|
130338
130641
|
// "time":"2020-03-02T20:00:00.000Z",
|
|
@@ -130345,12 +130648,12 @@ class hollaex extends _abstract_hollaex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
130345
130648
|
// }
|
|
130346
130649
|
//
|
|
130347
130650
|
return [
|
|
130348
|
-
this.parse8601(this.safeString(
|
|
130349
|
-
this.safeNumber(
|
|
130350
|
-
this.safeNumber(
|
|
130351
|
-
this.safeNumber(
|
|
130352
|
-
this.safeNumber(
|
|
130353
|
-
this.safeNumber(
|
|
130651
|
+
this.parse8601(this.safeString(ohlcv, 'time')),
|
|
130652
|
+
this.safeNumber(ohlcv, 'open'),
|
|
130653
|
+
this.safeNumber(ohlcv, 'high'),
|
|
130654
|
+
this.safeNumber(ohlcv, 'low'),
|
|
130655
|
+
this.safeNumber(ohlcv, 'close'),
|
|
130656
|
+
this.safeNumber(ohlcv, 'volume'),
|
|
130354
130657
|
];
|
|
130355
130658
|
}
|
|
130356
130659
|
parseBalance(response) {
|
|
@@ -136247,6 +136550,7 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
136247
136550
|
* @param {string} [params.offset] *contract only* 'open', 'close', or 'both', required in hedge mode
|
|
136248
136551
|
* @param {bool} [params.postOnly] *contract only* true or false
|
|
136249
136552
|
* @param {int} [params.leverRate] *contract only* required for all contract orders except tpsl, leverage greater than 20x requires prior approval of high-leverage agreement
|
|
136553
|
+
* @param {string} [params.timeInForce] supports 'IOC' and 'FOK'
|
|
136250
136554
|
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
136251
136555
|
*/
|
|
136252
136556
|
await this.loadMarkets();
|
|
@@ -136319,6 +136623,13 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
136319
136623
|
if (postOnly) {
|
|
136320
136624
|
orderType = 'limit-maker';
|
|
136321
136625
|
}
|
|
136626
|
+
const timeInForce = this.safeString(params, 'timeInForce', 'GTC');
|
|
136627
|
+
if (timeInForce === 'FOK') {
|
|
136628
|
+
orderType = orderType + '-fok';
|
|
136629
|
+
}
|
|
136630
|
+
else if (timeInForce === 'IOC') {
|
|
136631
|
+
orderType = 'ioc';
|
|
136632
|
+
}
|
|
136322
136633
|
request['type'] = side + '-' + orderType;
|
|
136323
136634
|
const clientOrderId = this.safeString2(params, 'clientOrderId', 'client-order-id'); // must be 64 chars max and unique within 24 hours
|
|
136324
136635
|
if (clientOrderId === undefined) {
|
|
@@ -136366,7 +136677,7 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
136366
136677
|
if (orderType in limitOrderTypes) {
|
|
136367
136678
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
136368
136679
|
}
|
|
136369
|
-
params = this.omit(params, ['stopPrice', 'stop-price', 'clientOrderId', 'client-order-id', 'operator']);
|
|
136680
|
+
params = this.omit(params, ['stopPrice', 'stop-price', 'clientOrderId', 'client-order-id', 'operator', 'timeInForce']);
|
|
136370
136681
|
const response = await this.spotPrivatePostV1OrderOrdersPlace(this.extend(request, params));
|
|
136371
136682
|
//
|
|
136372
136683
|
// spot
|
|
@@ -136411,6 +136722,7 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
136411
136722
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
136412
136723
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
136413
136724
|
* @param {object} params extra parameters specific to the huobi api endpoint
|
|
136725
|
+
* @param {string} [params.timeInForce] supports 'IOC' and 'FOK'
|
|
136414
136726
|
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
136415
136727
|
*/
|
|
136416
136728
|
const market = this.market(symbol);
|
|
@@ -136424,6 +136736,13 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
136424
136736
|
if (postOnly) {
|
|
136425
136737
|
type = 'post_only';
|
|
136426
136738
|
}
|
|
136739
|
+
const timeInForce = this.safeString(params, 'timeInForce', 'GTC');
|
|
136740
|
+
if (timeInForce === 'FOK') {
|
|
136741
|
+
type = 'fok';
|
|
136742
|
+
}
|
|
136743
|
+
else if (timeInForce === 'IOC') {
|
|
136744
|
+
type = 'ioc';
|
|
136745
|
+
}
|
|
136427
136746
|
const triggerPrice = this.safeNumber2(params, 'stopPrice', 'trigger_price');
|
|
136428
136747
|
const stopLossTriggerPrice = this.safeNumber2(params, 'stopLossPrice', 'sl_trigger_price');
|
|
136429
136748
|
const takeProfitTriggerPrice = this.safeNumber2(params, 'takeProfitPrice', 'tp_trigger_price');
|
|
@@ -136476,7 +136795,7 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
136476
136795
|
request['lever_rate'] = leverRate;
|
|
136477
136796
|
request['order_price_type'] = type;
|
|
136478
136797
|
}
|
|
136479
|
-
params = this.omit(params, ['reduceOnly', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'triggerType', 'leverRate']);
|
|
136798
|
+
params = this.omit(params, ['reduceOnly', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'triggerType', 'leverRate', 'timeInForce']);
|
|
136480
136799
|
const broker = this.safeValue(this.options, 'broker', {});
|
|
136481
136800
|
const brokerId = this.safeString(broker, 'id');
|
|
136482
136801
|
request['channel_code'] = brokerId;
|
|
@@ -139918,7 +140237,7 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
139918
140237
|
//
|
|
139919
140238
|
const marketId = this.safeString(liquidation, 'contract_code');
|
|
139920
140239
|
const timestamp = this.safeInteger(liquidation, 'created_at');
|
|
139921
|
-
return {
|
|
140240
|
+
return this.safeLiquidation({
|
|
139922
140241
|
'info': liquidation,
|
|
139923
140242
|
'symbol': this.safeSymbol(marketId, market),
|
|
139924
140243
|
'contracts': this.safeNumber(liquidation, 'volume'),
|
|
@@ -139928,7 +140247,7 @@ class huobi extends _abstract_huobi_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
139928
140247
|
'quoteValue': this.safeNumber(liquidation, 'trade_turnover'),
|
|
139929
140248
|
'timestamp': timestamp,
|
|
139930
140249
|
'datetime': this.iso8601(timestamp),
|
|
139931
|
-
};
|
|
140250
|
+
});
|
|
139932
140251
|
}
|
|
139933
140252
|
}
|
|
139934
140253
|
|
|
@@ -155657,9 +155976,6 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
|
|
|
155657
155976
|
//
|
|
155658
155977
|
return this.parseTicker(response['data'], market);
|
|
155659
155978
|
}
|
|
155660
|
-
async fetchTickers(symbols = undefined, params = {}) {
|
|
155661
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchTickers() is not supported yet');
|
|
155662
|
-
}
|
|
155663
155979
|
parseTicker(ticker, market = undefined) {
|
|
155664
155980
|
//
|
|
155665
155981
|
// {
|
|
@@ -157327,14 +157643,16 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
|
|
|
157327
157643
|
/* harmony import */ var _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4722);
|
|
157328
157644
|
/* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
|
|
157329
157645
|
/* harmony import */ var _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9292);
|
|
157330
|
-
/* harmony import */ var
|
|
157331
|
-
/* harmony import */ var
|
|
157646
|
+
/* harmony import */ var _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1372);
|
|
157647
|
+
/* harmony import */ var _static_dependencies_noble_hashes_sha512_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7110);
|
|
157648
|
+
/* harmony import */ var _ccxt_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2194);
|
|
157332
157649
|
// ---------------------------------------------------------------------------
|
|
157333
157650
|
|
|
157334
157651
|
|
|
157335
157652
|
|
|
157336
157653
|
|
|
157337
157654
|
|
|
157655
|
+
|
|
157338
157656
|
// ---------------------------------------------------------------------------
|
|
157339
157657
|
/**
|
|
157340
157658
|
* @class kuna
|
|
@@ -157348,35 +157666,63 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
157348
157666
|
'name': 'Kuna',
|
|
157349
157667
|
'countries': ['UA'],
|
|
157350
157668
|
'rateLimit': 1000,
|
|
157351
|
-
'version': '
|
|
157669
|
+
'version': 'v4',
|
|
157352
157670
|
'has': {
|
|
157353
157671
|
'CORS': undefined,
|
|
157354
157672
|
'spot': true,
|
|
157355
|
-
'margin':
|
|
157673
|
+
'margin': false,
|
|
157356
157674
|
'swap': false,
|
|
157357
157675
|
'future': false,
|
|
157358
157676
|
'option': false,
|
|
157677
|
+
'addMargin': false,
|
|
157678
|
+
'borrowMargin': false,
|
|
157359
157679
|
'cancelOrder': true,
|
|
157680
|
+
'cancelOrders': true,
|
|
157681
|
+
'createDepositAddress': true,
|
|
157360
157682
|
'createOrder': true,
|
|
157683
|
+
'createPostOnlyOrder': false,
|
|
157684
|
+
'createReduceOnlyOrder': false,
|
|
157685
|
+
'createStopLimitOrder': true,
|
|
157686
|
+
'createStopMarketOrder': false,
|
|
157687
|
+
'createStopOrder': true,
|
|
157361
157688
|
'fetchBalance': true,
|
|
157689
|
+
'fetchBorrowInterest': false,
|
|
157690
|
+
'fetchBorrowRate': false,
|
|
157691
|
+
'fetchBorrowRateHistories': false,
|
|
157692
|
+
'fetchBorrowRateHistory': false,
|
|
157693
|
+
'fetchBorrowRates': false,
|
|
157694
|
+
'fetchBorrowRatesPerSymbol': false,
|
|
157695
|
+
'fetchClosedOrders': true,
|
|
157696
|
+
'fetchCurrencies': true,
|
|
157697
|
+
'fetchDeposit': true,
|
|
157698
|
+
'fetchDepositAddress': true,
|
|
157699
|
+
'fetchDeposits': true,
|
|
157700
|
+
'fetchDepositsWithdrawals': false,
|
|
157362
157701
|
'fetchFundingHistory': false,
|
|
157363
157702
|
'fetchFundingRate': false,
|
|
157364
157703
|
'fetchFundingRateHistory': false,
|
|
157365
157704
|
'fetchFundingRates': false,
|
|
157366
157705
|
'fetchIndexOHLCV': false,
|
|
157706
|
+
'fetchIsolatedPositions': false,
|
|
157367
157707
|
'fetchL3OrderBook': true,
|
|
157368
157708
|
'fetchLeverage': false,
|
|
157709
|
+
'fetchLeverageTiers': false,
|
|
157369
157710
|
'fetchMarginMode': false,
|
|
157711
|
+
'fetchMarketLeverageTiers': false,
|
|
157370
157712
|
'fetchMarkets': true,
|
|
157371
157713
|
'fetchMarkOHLCV': false,
|
|
157372
157714
|
'fetchMyTrades': true,
|
|
157373
157715
|
'fetchOHLCV': 'emulated',
|
|
157716
|
+
'fetchOpenInterest': false,
|
|
157374
157717
|
'fetchOpenInterestHistory': false,
|
|
157375
157718
|
'fetchOpenOrders': true,
|
|
157376
157719
|
'fetchOrder': true,
|
|
157377
157720
|
'fetchOrderBook': true,
|
|
157721
|
+
'fetchOrdersByStatus': true,
|
|
157722
|
+
'fetchPosition': false,
|
|
157378
157723
|
'fetchPositionMode': false,
|
|
157379
157724
|
'fetchPositions': false,
|
|
157725
|
+
'fetchPositionsBySymbol': false,
|
|
157380
157726
|
'fetchPositionsRisk': false,
|
|
157381
157727
|
'fetchPremiumIndexOHLCV': false,
|
|
157382
157728
|
'fetchTicker': true,
|
|
@@ -157385,9 +157731,20 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
157385
157731
|
'fetchTrades': true,
|
|
157386
157732
|
'fetchTradingFee': false,
|
|
157387
157733
|
'fetchTradingFees': false,
|
|
157734
|
+
'fetchTransactions': false,
|
|
157735
|
+
'fetchTransfers': false,
|
|
157736
|
+
'fetchWithdrawAddresses': false,
|
|
157737
|
+
'fetchWithdrawal': true,
|
|
157738
|
+
'fetchWithdrawals': true,
|
|
157388
157739
|
'reduceMargin': false,
|
|
157740
|
+
'repayMargin': false,
|
|
157389
157741
|
'setLeverage': false,
|
|
157742
|
+
'setMargin': false,
|
|
157743
|
+
'setMarginMode': false,
|
|
157390
157744
|
'setPositionMode': false,
|
|
157745
|
+
'signIn': false,
|
|
157746
|
+
'transfer': false,
|
|
157747
|
+
'withdraw': true,
|
|
157391
157748
|
},
|
|
157392
157749
|
'timeframes': undefined,
|
|
157393
157750
|
'urls': {
|
|
@@ -157419,34 +157776,34 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
157419
157776
|
'v4': {
|
|
157420
157777
|
'private': {
|
|
157421
157778
|
'get': {
|
|
157422
|
-
'me': 1,
|
|
157423
|
-
'getBalance': 1,
|
|
157424
|
-
'active': 1,
|
|
157425
|
-
'order/history': 1,
|
|
157779
|
+
'private/me': 1,
|
|
157780
|
+
'private/getBalance': 1,
|
|
157781
|
+
'order/private/active': 1,
|
|
157782
|
+
'order/private/history': 1,
|
|
157426
157783
|
'order/private/{id}/trades': 1,
|
|
157427
|
-
'order/details/{id}
|
|
157428
|
-
'trade/history': 1,
|
|
157429
|
-
'transaction/{hash}': 1,
|
|
157430
|
-
'deposit/preRequest': 1,
|
|
157431
|
-
'deposit/crypto/address': 1,
|
|
157432
|
-
'deposit/crypto/getMerchantAddress': 1,
|
|
157433
|
-
'deposit/history': 1,
|
|
157434
|
-
'deposit/details/{depositId}': 1,
|
|
157435
|
-
'withdraw/preRequest': 1,
|
|
157436
|
-
'withdraw/history': 1,
|
|
157437
|
-
'withdraw/details/{withdrawId}': 1,
|
|
157784
|
+
'order/private/details/{id}': 1,
|
|
157785
|
+
'trade/private/history': 1,
|
|
157786
|
+
'transaction/private/{hash}': 1,
|
|
157787
|
+
'deposit/private/preRequest': 1,
|
|
157788
|
+
'deposit/private/crypto/address': 1,
|
|
157789
|
+
'deposit/private/crypto/getMerchantAddress': 1,
|
|
157790
|
+
'deposit/private/history': 1,
|
|
157791
|
+
'deposit/private/details/{depositId}': 1,
|
|
157792
|
+
'withdraw/private/preRequest': 1,
|
|
157793
|
+
'withdraw/private/history': 1,
|
|
157794
|
+
'withdraw/private/details/{withdrawId}': 1,
|
|
157438
157795
|
'kuna-code/{id}': 1,
|
|
157439
157796
|
'kuna-code/{code}/check': 1,
|
|
157440
157797
|
'kuna-code/issued-by-me': 1,
|
|
157441
157798
|
'kuna-code/redeemed-by-me': 1,
|
|
157442
157799
|
},
|
|
157443
157800
|
'post': {
|
|
157444
|
-
'order/create': 1,
|
|
157445
|
-
'order/cancel': 1,
|
|
157446
|
-
'order/cancel/multi': 1,
|
|
157447
|
-
'deposit/crypto/generateAddress': 1,
|
|
157448
|
-
'deposit/crypto/generateMerchantAddress': 1,
|
|
157449
|
-
'withdraw/create': 1,
|
|
157801
|
+
'order/private/create': 1,
|
|
157802
|
+
'order/private/cancel': 1,
|
|
157803
|
+
'order/private/cancel/multi': 1,
|
|
157804
|
+
'deposit/private/crypto/generateAddress': 1,
|
|
157805
|
+
'deposit/private/crypto/generateMerchantAddress': 1,
|
|
157806
|
+
'withdraw/private/create': 1,
|
|
157450
157807
|
'kuna-code': 1,
|
|
157451
157808
|
},
|
|
157452
157809
|
'put': {
|
|
@@ -157455,12 +157812,14 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
157455
157812
|
},
|
|
157456
157813
|
'public': {
|
|
157457
157814
|
'get': {
|
|
157458
|
-
'timestamp': 1,
|
|
157459
|
-
'fees': 1,
|
|
157460
|
-
'currencies?type={type}': 1,
|
|
157461
|
-
'
|
|
157462
|
-
'markets/
|
|
157463
|
-
'
|
|
157815
|
+
'public/timestamp': 1,
|
|
157816
|
+
'public/fees': 1,
|
|
157817
|
+
'public/currencies?type={type}': 1,
|
|
157818
|
+
'public/currencies': 1,
|
|
157819
|
+
'markets/public/getAll': 1,
|
|
157820
|
+
'markets/public/tickers?pairs={pairs}': 1,
|
|
157821
|
+
'order/public/book/{pairs}': 1,
|
|
157822
|
+
'trade/public/book/{pairs}': 1,
|
|
157464
157823
|
},
|
|
157465
157824
|
},
|
|
157466
157825
|
},
|
|
@@ -157668,6 +158027,12 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
157668
158027
|
},
|
|
157669
158028
|
'precisionMode': _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__/* .TICK_SIZE */ .sh,
|
|
157670
158029
|
'exceptions': {
|
|
158030
|
+
'ARGUMENT_VALIDATION_ERROR': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
158031
|
+
'PAYMENT_METHOD_NOT_SUPPORTED': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
158032
|
+
'NOT_FOUND': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
|
|
158033
|
+
'INVALID:ORDER_SIZE': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
158034
|
+
'WrongRequestException': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
158035
|
+
'INSUFFICIENT_FUNDS': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
|
|
157671
158036
|
'2002': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
|
|
157672
158037
|
'2003': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
|
|
157673
158038
|
},
|
|
@@ -157681,109 +158046,206 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
157681
158046
|
* @method
|
|
157682
158047
|
* @name kuna#fetchTime
|
|
157683
158048
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
158049
|
+
* @see https://docs.kuna.io/docs/get-time-on-the-server
|
|
157684
158050
|
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
157685
158051
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
157686
158052
|
*/
|
|
157687
|
-
const response = await this.
|
|
158053
|
+
const response = await this.v4PublicGetPublicTimestamp(params);
|
|
157688
158054
|
//
|
|
157689
|
-
//
|
|
158055
|
+
// {
|
|
158056
|
+
// "data": {
|
|
158057
|
+
// "timestamp": 1686740531,
|
|
158058
|
+
// "timestamp_miliseconds": 1686740531725,
|
|
158059
|
+
// }
|
|
158060
|
+
// }
|
|
157690
158061
|
//
|
|
157691
|
-
|
|
158062
|
+
const data = this.safeValue(response, 'data', {});
|
|
158063
|
+
return this.safeInteger(data, 'timestamp_miliseconds');
|
|
158064
|
+
}
|
|
158065
|
+
async fetchCurrencies(params = {}) {
|
|
158066
|
+
/**
|
|
158067
|
+
* @method
|
|
158068
|
+
* @name kuna#fetchCurrencies
|
|
158069
|
+
* @description fetches all available currencies on an exchange
|
|
158070
|
+
* @see https://docs.kuna.io/docs/get-information-about-available-currencies
|
|
158071
|
+
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
158072
|
+
* @returns {object} an associative dictionary of currencies
|
|
158073
|
+
*/
|
|
158074
|
+
const response = await this.v4PublicGetPublicCurrencies(params);
|
|
158075
|
+
//
|
|
158076
|
+
// {
|
|
158077
|
+
// "data": [
|
|
158078
|
+
// {
|
|
158079
|
+
// "code": "BTC",
|
|
158080
|
+
// "name": "Bitcoin",
|
|
158081
|
+
// "payload": {
|
|
158082
|
+
// "chart": "https://kuna-pro.kuna.io/bitcoin-chart",
|
|
158083
|
+
// "icons": {
|
|
158084
|
+
// "svg": "https://kuna-pro.kuna.io/icon-btc-svg",
|
|
158085
|
+
// "png2x": "https://kuna-pro.kuna.io/icon-btc-png2x",
|
|
158086
|
+
// "png3x": "https://kuna-pro.kuna.io/icon-btc-png3x",
|
|
158087
|
+
// "svgXL": "https://kuna-pro.kuna.io/icon-btc-svg"
|
|
158088
|
+
// },
|
|
158089
|
+
// "pngChart": "https://kuna-pro.kuna.io/png-bitcoin-chart"
|
|
158090
|
+
// },
|
|
158091
|
+
// "position": 1,
|
|
158092
|
+
// "precision": 8,
|
|
158093
|
+
// "tradePrecision": 6,
|
|
158094
|
+
// "type": "Crypto"
|
|
158095
|
+
// }
|
|
158096
|
+
// ]
|
|
158097
|
+
// }
|
|
158098
|
+
//
|
|
158099
|
+
const data = this.safeValue(response, 'data', []);
|
|
158100
|
+
return this.parseCurrencies(data);
|
|
158101
|
+
}
|
|
158102
|
+
parseCurrencies(currencies, params = {}) {
|
|
158103
|
+
currencies = this.toArray(currencies);
|
|
158104
|
+
const result = {};
|
|
158105
|
+
for (let i = 0; i < currencies.length; i++) {
|
|
158106
|
+
const currency = this.parseCurrency(currencies[i]);
|
|
158107
|
+
result[currency['code']] = currency;
|
|
158108
|
+
}
|
|
158109
|
+
return result;
|
|
158110
|
+
}
|
|
158111
|
+
parseCurrency(currency) {
|
|
158112
|
+
//
|
|
158113
|
+
// {
|
|
158114
|
+
// "code": "BTC",
|
|
158115
|
+
// "name": "Bitcoin",
|
|
158116
|
+
// "payload": {
|
|
158117
|
+
// "chart": "https://kuna-pro.kuna.io/bitcoin-chart",
|
|
158118
|
+
// "icons": {
|
|
158119
|
+
// "svg": "https://kuna-pro.kuna.io/icon-btc-svg",
|
|
158120
|
+
// "png2x": "https://kuna-pro.kuna.io/icon-btc-png2x",
|
|
158121
|
+
// "png3x": "https://kuna-pro.kuna.io/icon-btc-png3x",
|
|
158122
|
+
// "svgXL": "https://kuna-pro.kuna.io/icon-btc-svg"
|
|
158123
|
+
// },
|
|
158124
|
+
// "pngChart": "https://kuna-pro.kuna.io/png-bitcoin-chart"
|
|
158125
|
+
// },
|
|
158126
|
+
// "position": 1,
|
|
158127
|
+
// "precision": 8,
|
|
158128
|
+
// "tradePrecision": 6,
|
|
158129
|
+
// "type": "Crypto"
|
|
158130
|
+
// }
|
|
158131
|
+
//
|
|
158132
|
+
const currencyId = this.safeString(currency, 'code');
|
|
158133
|
+
const precision = this.safeString(currency, 'precision');
|
|
158134
|
+
const tradePrecision = this.safeString(currency, 'tradePrecision');
|
|
158135
|
+
return {
|
|
158136
|
+
'info': currency,
|
|
158137
|
+
'id': currencyId,
|
|
158138
|
+
'code': this.safeCurrencyCode(currencyId),
|
|
158139
|
+
'type': undefined,
|
|
158140
|
+
'margin': undefined,
|
|
158141
|
+
'name': this.safeString(currency, 'name'),
|
|
158142
|
+
'active': undefined,
|
|
158143
|
+
'deposit': undefined,
|
|
158144
|
+
'withdraw': undefined,
|
|
158145
|
+
'fee': undefined,
|
|
158146
|
+
'precision': _ccxt_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMin */ .O.stringMin(precision, tradePrecision),
|
|
158147
|
+
'limits': {
|
|
158148
|
+
'amount': {
|
|
158149
|
+
'min': undefined,
|
|
158150
|
+
'max': undefined,
|
|
158151
|
+
},
|
|
158152
|
+
'withdraw': {
|
|
158153
|
+
'min': undefined,
|
|
158154
|
+
'max': undefined,
|
|
158155
|
+
},
|
|
158156
|
+
},
|
|
158157
|
+
'networks': {},
|
|
158158
|
+
};
|
|
157692
158159
|
}
|
|
157693
158160
|
async fetchMarkets(params = {}) {
|
|
157694
158161
|
/**
|
|
157695
158162
|
* @method
|
|
157696
158163
|
* @name kuna#fetchMarkets
|
|
157697
158164
|
* @description retrieves data on all markets for kuna
|
|
158165
|
+
* @see https://docs.kuna.io/docs/get-all-traded-markets
|
|
157698
158166
|
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
157699
158167
|
* @returns {object[]} an array of objects representing market data
|
|
157700
158168
|
*/
|
|
157701
|
-
const
|
|
157702
|
-
const markets = [];
|
|
157703
|
-
const response = await this.publicGetTickers(params);
|
|
158169
|
+
const response = await this.v4PublicGetMarketsPublicGetAll(params);
|
|
157704
158170
|
//
|
|
157705
158171
|
// {
|
|
157706
|
-
//
|
|
157707
|
-
//
|
|
157708
|
-
//
|
|
157709
|
-
//
|
|
157710
|
-
//
|
|
157711
|
-
//
|
|
157712
|
-
//
|
|
157713
|
-
//
|
|
157714
|
-
//
|
|
157715
|
-
//
|
|
158172
|
+
// "data": [
|
|
158173
|
+
// {
|
|
158174
|
+
// "pair": "BTC_USDT", // Traded pair of assets
|
|
158175
|
+
// "baseAsset": { // The base asset of the traded pair, the one to sell or buy as a result of the trade
|
|
158176
|
+
// "code": "BTC",
|
|
158177
|
+
// "precision": 6 // Maximum amount of digits for the decimal part of a number
|
|
158178
|
+
// },
|
|
158179
|
+
// "quoteAsset": { // The quoted asset of the traded pair, the one to use to sell or buy the base asset
|
|
158180
|
+
// "code": "USDT",
|
|
158181
|
+
// "precision": 2 // Maximum amount of digits for the decimal part of a number
|
|
158182
|
+
// },
|
|
158183
|
+
// "tickerPriceChange": "-0.07" // Relative change compared with the last tick
|
|
157716
158184
|
// }
|
|
157717
|
-
//
|
|
158185
|
+
// ]
|
|
157718
158186
|
// }
|
|
157719
158187
|
//
|
|
157720
|
-
const
|
|
157721
|
-
|
|
157722
|
-
|
|
157723
|
-
|
|
157724
|
-
|
|
157725
|
-
|
|
157726
|
-
|
|
157727
|
-
|
|
157728
|
-
|
|
157729
|
-
|
|
157730
|
-
|
|
157731
|
-
|
|
157732
|
-
|
|
157733
|
-
|
|
157734
|
-
|
|
157735
|
-
|
|
157736
|
-
|
|
157737
|
-
|
|
157738
|
-
|
|
157739
|
-
|
|
157740
|
-
|
|
157741
|
-
|
|
157742
|
-
|
|
157743
|
-
|
|
157744
|
-
|
|
157745
|
-
|
|
157746
|
-
|
|
157747
|
-
|
|
157748
|
-
|
|
157749
|
-
|
|
157750
|
-
|
|
157751
|
-
|
|
157752
|
-
|
|
157753
|
-
|
|
157754
|
-
|
|
157755
|
-
|
|
157756
|
-
|
|
157757
|
-
|
|
157758
|
-
|
|
157759
|
-
|
|
157760
|
-
|
|
157761
|
-
|
|
157762
|
-
|
|
157763
|
-
|
|
157764
|
-
'
|
|
157765
|
-
|
|
157766
|
-
|
|
157767
|
-
|
|
157768
|
-
|
|
157769
|
-
|
|
157770
|
-
|
|
157771
|
-
|
|
157772
|
-
|
|
157773
|
-
|
|
157774
|
-
|
|
157775
|
-
|
|
157776
|
-
|
|
157777
|
-
|
|
157778
|
-
|
|
157779
|
-
|
|
157780
|
-
|
|
157781
|
-
},
|
|
157782
|
-
'created': undefined,
|
|
157783
|
-
'info': undefined,
|
|
157784
|
-
});
|
|
157785
|
-
}
|
|
157786
|
-
}
|
|
158188
|
+
const data = this.safeValue(response, 'data', []);
|
|
158189
|
+
const markets = [];
|
|
158190
|
+
for (let i = 0; i < data.length; i++) {
|
|
158191
|
+
const item = data[i];
|
|
158192
|
+
const marketId = this.safeString(item, 'pair');
|
|
158193
|
+
const baseAsset = this.safeValue(item, 'baseAsset');
|
|
158194
|
+
const quoteAsset = this.safeValue(item, 'quoteAsset');
|
|
158195
|
+
const baseId = this.safeString(baseAsset, 'code');
|
|
158196
|
+
const quoteId = this.safeString(quoteAsset, 'code');
|
|
158197
|
+
const base = this.safeCurrencyCode(baseId);
|
|
158198
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
158199
|
+
const basePrecision = this.safeString(baseAsset, 'precision');
|
|
158200
|
+
const quotePrecision = this.safeString(quoteAsset, 'precision');
|
|
158201
|
+
markets.push({
|
|
158202
|
+
'id': marketId,
|
|
158203
|
+
'symbol': base + '/' + quote,
|
|
158204
|
+
'base': base,
|
|
158205
|
+
'quote': quote,
|
|
158206
|
+
'settle': undefined,
|
|
158207
|
+
'baseId': baseId,
|
|
158208
|
+
'quoteId': quoteId,
|
|
158209
|
+
'settleId': undefined,
|
|
158210
|
+
'type': 'spot',
|
|
158211
|
+
'spot': true,
|
|
158212
|
+
'margin': false,
|
|
158213
|
+
'swap': false,
|
|
158214
|
+
'future': false,
|
|
158215
|
+
'option': false,
|
|
158216
|
+
'active': undefined,
|
|
158217
|
+
'contract': false,
|
|
158218
|
+
'linear': undefined,
|
|
158219
|
+
'inverse': undefined,
|
|
158220
|
+
'contractSize': undefined,
|
|
158221
|
+
'expiry': undefined,
|
|
158222
|
+
'expiryDatetime': undefined,
|
|
158223
|
+
'strike': undefined,
|
|
158224
|
+
'optionType': undefined,
|
|
158225
|
+
'precision': {
|
|
158226
|
+
'amount': this.parseNumber(this.parsePrecision(basePrecision)),
|
|
158227
|
+
'price': this.parseNumber(this.parsePrecision(quotePrecision)),
|
|
158228
|
+
},
|
|
158229
|
+
'limits': {
|
|
158230
|
+
'leverage': {
|
|
158231
|
+
'min': undefined,
|
|
158232
|
+
'max': undefined,
|
|
158233
|
+
},
|
|
158234
|
+
'amount': {
|
|
158235
|
+
'min': undefined,
|
|
158236
|
+
'max': undefined,
|
|
158237
|
+
},
|
|
158238
|
+
'price': {
|
|
158239
|
+
'min': undefined,
|
|
158240
|
+
'max': undefined,
|
|
158241
|
+
},
|
|
158242
|
+
'cost': {
|
|
158243
|
+
'min': undefined,
|
|
158244
|
+
'max': undefined,
|
|
158245
|
+
},
|
|
158246
|
+
},
|
|
158247
|
+
'info': item,
|
|
158248
|
+
});
|
|
157787
158249
|
}
|
|
157788
158250
|
return markets;
|
|
157789
158251
|
}
|
|
@@ -157792,78 +158254,137 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
157792
158254
|
* @method
|
|
157793
158255
|
* @name kuna#fetchOrderBook
|
|
157794
158256
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
158257
|
+
* @see https://docs.kuna.io/docs/get-public-orders-book
|
|
157795
158258
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
157796
|
-
* @param {int} [limit]
|
|
158259
|
+
* @param {int} [limit] 5, 10, 20, 50, 100, 500, or 1000 (default)
|
|
157797
158260
|
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
157798
158261
|
* @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
|
|
157799
158262
|
*/
|
|
157800
158263
|
await this.loadMarkets();
|
|
157801
158264
|
const market = this.market(symbol);
|
|
157802
158265
|
const request = {
|
|
157803
|
-
'
|
|
158266
|
+
'pairs': market['id'],
|
|
157804
158267
|
};
|
|
157805
158268
|
if (limit !== undefined) {
|
|
157806
|
-
request['
|
|
158269
|
+
request['level'] = limit;
|
|
157807
158270
|
}
|
|
157808
|
-
const
|
|
157809
|
-
|
|
157810
|
-
|
|
158271
|
+
const response = await this.v4PublicGetOrderPublicBookPairs(this.extend(request, params));
|
|
158272
|
+
//
|
|
158273
|
+
// {
|
|
158274
|
+
// "data": {
|
|
158275
|
+
// "asks": [ // An array of sell orders
|
|
158276
|
+
// [
|
|
158277
|
+
// "16950", // Sell price, level 1
|
|
158278
|
+
// "0.001" // Sell quantity, level 1
|
|
158279
|
+
// ],
|
|
158280
|
+
// [
|
|
158281
|
+
// "17000", // Sell price, level 2
|
|
158282
|
+
// "0.01" // Sell quantity, level 2
|
|
158283
|
+
// ]
|
|
158284
|
+
// ],
|
|
158285
|
+
// "bids": [ // An array of buy orders
|
|
158286
|
+
// [
|
|
158287
|
+
// "16700", // Sell price, level 1
|
|
158288
|
+
// "0.01" // Sell quantity, level 1
|
|
158289
|
+
// ],
|
|
158290
|
+
// [
|
|
158291
|
+
// "16000", // Sell price, level 2
|
|
158292
|
+
// "0.001" // Sell quantity, level 2
|
|
158293
|
+
// ]
|
|
158294
|
+
// ]
|
|
158295
|
+
// }
|
|
158296
|
+
// }
|
|
158297
|
+
//
|
|
158298
|
+
const data = this.safeValue(response, 'data', {});
|
|
158299
|
+
return this.parseOrderBook(data, market['symbol'], undefined, 'bids', 'asks', 0, 1);
|
|
157811
158300
|
}
|
|
157812
158301
|
parseTicker(ticker, market = undefined) {
|
|
157813
|
-
|
|
157814
|
-
|
|
157815
|
-
|
|
157816
|
-
|
|
158302
|
+
//
|
|
158303
|
+
// {
|
|
158304
|
+
// "pair": "BTC_USDT", // Traded pair
|
|
158305
|
+
// "percentagePriceChange": "-0.03490931899641581", // Relative price change, in percent
|
|
158306
|
+
// "price": "27900", // Current median price
|
|
158307
|
+
// "equivalentPrice": "", // TBD
|
|
158308
|
+
// "high": "29059.69", // Highest price
|
|
158309
|
+
// "low": "27900", // Lowest price
|
|
158310
|
+
// "baseVolume": "2.9008499999999993", // Traded volume as base
|
|
158311
|
+
// "quoteVolume": "82251.41477976", // Traded volume as quote
|
|
158312
|
+
// "bestBidPrice": "27926.91", // The best bid price now
|
|
158313
|
+
// "bestAskPrice": "27970.02", // The best ask price now
|
|
158314
|
+
// "priceChange": "-973.9700000000012" // Absolute price change
|
|
158315
|
+
// }
|
|
158316
|
+
//
|
|
158317
|
+
const marketId = this.safeString(ticker, 'pair');
|
|
157817
158318
|
return this.safeTicker({
|
|
157818
|
-
'
|
|
157819
|
-
'
|
|
157820
|
-
'
|
|
158319
|
+
'info': ticker,
|
|
158320
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
158321
|
+
'timestamp': undefined,
|
|
158322
|
+
'datetime': undefined,
|
|
157821
158323
|
'high': this.safeString(ticker, 'high'),
|
|
157822
158324
|
'low': this.safeString(ticker, 'low'),
|
|
157823
|
-
'bid': this.safeString(ticker, '
|
|
157824
|
-
'
|
|
157825
|
-
'ask': this.safeString(ticker, 'sell'),
|
|
157826
|
-
'askVolume': undefined,
|
|
158325
|
+
'bid': this.safeString(ticker, 'bestBidPrice'),
|
|
158326
|
+
'ask': this.safeString(ticker, 'bestAskPrice'),
|
|
157827
158327
|
'vwap': undefined,
|
|
157828
158328
|
'open': this.safeString(ticker, 'open'),
|
|
157829
|
-
'close':
|
|
157830
|
-
'last':
|
|
158329
|
+
'close': undefined,
|
|
158330
|
+
'last': undefined,
|
|
157831
158331
|
'previousClose': undefined,
|
|
157832
|
-
'change':
|
|
157833
|
-
'percentage':
|
|
158332
|
+
'change': this.safeString(ticker, 'priceChange'),
|
|
158333
|
+
'percentage': this.safeString(ticker, 'percentagePriceChange'),
|
|
157834
158334
|
'average': undefined,
|
|
157835
|
-
'baseVolume': this.safeString(ticker, '
|
|
157836
|
-
'quoteVolume':
|
|
157837
|
-
'info': ticker,
|
|
158335
|
+
'baseVolume': this.safeString(ticker, 'baseVolume'),
|
|
158336
|
+
'quoteVolume': this.safeString(ticker, 'quoteVolume'),
|
|
157838
158337
|
}, market);
|
|
157839
158338
|
}
|
|
157840
158339
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
157841
158340
|
/**
|
|
157842
158341
|
* @method
|
|
157843
158342
|
* @name kuna#fetchTickers
|
|
157844
|
-
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
157845
|
-
* @
|
|
158343
|
+
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market. The average is not returned in the response, but the median can be accessed via response['info']['price']
|
|
158344
|
+
* @see https://docs.kuna.io/docs/get-market-info-by-tickers
|
|
158345
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
157846
158346
|
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
157847
158347
|
* @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
157848
158348
|
*/
|
|
157849
158349
|
await this.loadMarkets();
|
|
157850
|
-
symbols
|
|
157851
|
-
|
|
157852
|
-
const ids = Object.keys(response);
|
|
157853
|
-
const result = {};
|
|
157854
|
-
for (let i = 0; i < ids.length; i++) {
|
|
157855
|
-
const id = ids[i];
|
|
157856
|
-
const market = this.safeMarket(id);
|
|
157857
|
-
const symbol = market['symbol'];
|
|
157858
|
-
result[symbol] = this.parseTicker(response[id], market);
|
|
158350
|
+
if (symbols === undefined) {
|
|
158351
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchTickers () requires a symbols argument');
|
|
157859
158352
|
}
|
|
157860
|
-
|
|
158353
|
+
symbols = this.marketSymbols(symbols);
|
|
158354
|
+
const marketIds = this.marketIds(symbols);
|
|
158355
|
+
const request = {
|
|
158356
|
+
'pairs': marketIds.join(','),
|
|
158357
|
+
};
|
|
158358
|
+
const response = await this.v4PublicGetMarketsPublicTickersPairsPairs(this.extend(request, params));
|
|
158359
|
+
//
|
|
158360
|
+
// {
|
|
158361
|
+
// "data": [
|
|
158362
|
+
// {
|
|
158363
|
+
// "pair": "BTC_USDT", // Traded pair
|
|
158364
|
+
// "percentagePriceChange": "-0.03490931899641581", // Relative price change, in percent
|
|
158365
|
+
// "price": "27900", // Current median price
|
|
158366
|
+
// "equivalentPrice": "", // TBD
|
|
158367
|
+
// "high": "29059.69", // Highest price
|
|
158368
|
+
// "low": "27900", // Lowest price
|
|
158369
|
+
// "baseVolume": "2.9008499999999993", // Traded volume as base
|
|
158370
|
+
// "quoteVolume": "82251.41477976", // Traded volume as quote
|
|
158371
|
+
// "bestBidPrice": "27926.91", // The best bid price now
|
|
158372
|
+
// "bestAskPrice": "27970.02", // The best ask price now
|
|
158373
|
+
// "priceChange": "-973.9700000000012" // Absolute price change
|
|
158374
|
+
// }
|
|
158375
|
+
// ...
|
|
158376
|
+
// ]
|
|
158377
|
+
// }
|
|
158378
|
+
//
|
|
158379
|
+
const data = this.safeValue(response, 'data', []);
|
|
158380
|
+
return this.parseTickers(data, symbols, params);
|
|
157861
158381
|
}
|
|
157862
158382
|
async fetchTicker(symbol, params = {}) {
|
|
157863
158383
|
/**
|
|
157864
158384
|
* @method
|
|
157865
158385
|
* @name kuna#fetchTicker
|
|
157866
158386
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
158387
|
+
* @see https://docs.kuna.io/docs/get-market-info-by-tickers
|
|
157867
158388
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
157868
158389
|
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
157869
158390
|
* @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -157871,13 +158392,36 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
157871
158392
|
await this.loadMarkets();
|
|
157872
158393
|
const market = this.market(symbol);
|
|
157873
158394
|
const request = {
|
|
157874
|
-
'
|
|
158395
|
+
'pairs': market['id'],
|
|
157875
158396
|
};
|
|
157876
|
-
const response = await this.
|
|
157877
|
-
|
|
158397
|
+
const response = await this.v4PublicGetMarketsPublicTickersPairsPairs(this.extend(request, params));
|
|
158398
|
+
//
|
|
158399
|
+
// {
|
|
158400
|
+
// "data": [
|
|
158401
|
+
// {
|
|
158402
|
+
// "pair": "BTC_USDT", // Traded pair
|
|
158403
|
+
// "percentagePriceChange": "-0.03490931899641581", // Relative price change, in percent
|
|
158404
|
+
// "price": "27900", // Current median price
|
|
158405
|
+
// "equivalentPrice": "", // TBD
|
|
158406
|
+
// "high": "29059.69", // Highest price
|
|
158407
|
+
// "low": "27900", // Lowest price
|
|
158408
|
+
// "baseVolume": "2.9008499999999993", // Traded volume as base
|
|
158409
|
+
// "quoteVolume": "82251.41477976", // Traded volume as quote
|
|
158410
|
+
// "bestBidPrice": "27926.91", // The best bid price now
|
|
158411
|
+
// "bestAskPrice": "27970.02", // The best ask price now
|
|
158412
|
+
// "priceChange": "-973.9700000000012" // Absolute price change
|
|
158413
|
+
// }
|
|
158414
|
+
// ...
|
|
158415
|
+
// ]
|
|
158416
|
+
// }
|
|
158417
|
+
//
|
|
158418
|
+
const data = this.safeValue(response, 'data', []);
|
|
158419
|
+
const ticker = this.safeValue(data, 0);
|
|
158420
|
+
return this.parseTicker(ticker, market);
|
|
157878
158421
|
}
|
|
157879
158422
|
async fetchL3OrderBook(symbol, limit = undefined, params = {}) {
|
|
157880
158423
|
/**
|
|
158424
|
+
* TODO: double check
|
|
157881
158425
|
* @method
|
|
157882
158426
|
* @name kuna#fetchL3OrderBook
|
|
157883
158427
|
* @description fetches level 3 information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
@@ -157893,136 +158437,115 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
157893
158437
|
* @method
|
|
157894
158438
|
* @name kuna#fetchTrades
|
|
157895
158439
|
* @description get the list of most recent trades for a particular symbol
|
|
158440
|
+
* @see https://docs.kuna.io/docs/get-public-trades-book
|
|
157896
158441
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
157897
158442
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
157898
|
-
* @param {int} [limit]
|
|
158443
|
+
* @param {int} [limit] between 1 and 100, 25 by default
|
|
157899
158444
|
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
157900
158445
|
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
|
|
157901
158446
|
*/
|
|
157902
158447
|
await this.loadMarkets();
|
|
157903
158448
|
const market = this.market(symbol);
|
|
157904
158449
|
const request = {
|
|
157905
|
-
'
|
|
158450
|
+
'pair': market['id'],
|
|
157906
158451
|
};
|
|
157907
|
-
|
|
158452
|
+
if (limit !== undefined) {
|
|
158453
|
+
request['limit'] = limit;
|
|
158454
|
+
}
|
|
158455
|
+
const response = await this.v4PublicGetTradePublicBookPairs(this.extend(request, params));
|
|
157908
158456
|
//
|
|
157909
|
-
//
|
|
157910
|
-
//
|
|
157911
|
-
//
|
|
157912
|
-
//
|
|
157913
|
-
//
|
|
157914
|
-
//
|
|
157915
|
-
//
|
|
157916
|
-
//
|
|
157917
|
-
//
|
|
157918
|
-
//
|
|
157919
|
-
//
|
|
157920
|
-
// ]
|
|
158457
|
+
// {
|
|
158458
|
+
// "data": {
|
|
158459
|
+
// "id": "3e5591ba-2778-4d85-8851-54284045ea44", // Unique identifier of a trade
|
|
158460
|
+
// "pair": "BTC_USDT", // Market pair that is being traded
|
|
158461
|
+
// "quoteQuantity": "11528.8118", // Qty of the quote asset, USDT in this example
|
|
158462
|
+
// "matchPrice": "18649", // Exchange price at the moment of execution
|
|
158463
|
+
// "matchQuantity": "0.6182", // Qty of the base asset, BTC in this example
|
|
158464
|
+
// "createdAt": "2022-09-23T14:30:41.486Z", // Date-time of trade execution, UTC
|
|
158465
|
+
// "side": "Ask" // Trade type: `Ask` or `Bid`. Bid for buying base asset, Ask for selling base asset (e.g. for BTC_USDT trading pair, BTC is the base asset).
|
|
158466
|
+
// }
|
|
158467
|
+
// }
|
|
157921
158468
|
//
|
|
157922
|
-
|
|
158469
|
+
const data = this.safeValue(response, 'data', {});
|
|
158470
|
+
return this.parseTrades(data, market, since, limit);
|
|
157923
158471
|
}
|
|
157924
158472
|
parseTrade(trade, market = undefined) {
|
|
157925
158473
|
//
|
|
157926
158474
|
// fetchTrades (public)
|
|
157927
158475
|
//
|
|
157928
|
-
//
|
|
157929
|
-
//
|
|
157930
|
-
//
|
|
157931
|
-
//
|
|
157932
|
-
//
|
|
157933
|
-
//
|
|
157934
|
-
//
|
|
157935
|
-
//
|
|
157936
|
-
//
|
|
157937
|
-
// }
|
|
158476
|
+
// {
|
|
158477
|
+
// "id": "3e5591ba-2778-4d85-8851-54284045ea44", // Unique identifier of a trade
|
|
158478
|
+
// "pair": "BTC_USDT", // Market pair that is being traded
|
|
158479
|
+
// "quoteQuantity": "11528.8118", // Qty of the quote asset, USDT in this example
|
|
158480
|
+
// "matchPrice": "18649", // Exchange price at the moment of execution
|
|
158481
|
+
// "matchQuantity": "0.6182", // Qty of the base asset, BTC in this example
|
|
158482
|
+
// "createdAt": "2022-09-23T14:30:41.486Z", // Date-time of trade execution, UTC
|
|
158483
|
+
// "side": "Ask" // Trade type: `Ask` or `Bid`. Bid for buying base asset, Ask for selling base asset (e.g. for BTC_USDT trading pair, BTC is the base asset).
|
|
158484
|
+
// }
|
|
157938
158485
|
//
|
|
157939
|
-
// fetchMyTrades (private)
|
|
158486
|
+
// fetchMyTrades, fetchOrder (private)
|
|
157940
158487
|
//
|
|
157941
|
-
//
|
|
157942
|
-
//
|
|
157943
|
-
//
|
|
157944
|
-
//
|
|
157945
|
-
//
|
|
157946
|
-
//
|
|
157947
|
-
//
|
|
157948
|
-
//
|
|
157949
|
-
//
|
|
157950
|
-
//
|
|
157951
|
-
//
|
|
158488
|
+
// {
|
|
158489
|
+
// id: "edb17459-c9bf-4148-9ae6-7367d7f55d71", // Unique identifier of a trade
|
|
158490
|
+
// orderId: "a80bec3f-4ffa-45c1-9d78-f6301e9748fe", // Unique identifier of an order associated with the trade
|
|
158491
|
+
// pair: "BTC_USDT", // Traded pair, base asset first, followed by quoted asset
|
|
158492
|
+
// quantity: "1.5862", // Traded quantity of base asset
|
|
158493
|
+
// price: "19087", // Price of the trade
|
|
158494
|
+
// isTaker: true, // Various fees for Makers and Takers; "Market" orders are always `true`
|
|
158495
|
+
// fee: "0.0039655", // Exchange commission fee
|
|
158496
|
+
// feeCurrency: "BTC", // Currency of the commission
|
|
158497
|
+
// isBuyer: true, // Buy or sell the base asset
|
|
158498
|
+
// quoteQuantity: "30275.7994", // Quote asset quantity spent to fulfill the base amount
|
|
158499
|
+
// createdAt: "2022-09-29T13:43:53.824Z", // Date-time of trade execution, UTC
|
|
158500
|
+
// }
|
|
157952
158501
|
//
|
|
157953
|
-
const
|
|
157954
|
-
|
|
157955
|
-
|
|
157956
|
-
|
|
157957
|
-
|
|
157958
|
-
|
|
157959
|
-
|
|
157960
|
-
const sideMap = {
|
|
157961
|
-
'ask': 'sell',
|
|
157962
|
-
'bid': 'buy',
|
|
157963
|
-
};
|
|
157964
|
-
side = this.safeString(sideMap, side, side);
|
|
158502
|
+
const datetime = this.safeString(trade, 'createdAt');
|
|
158503
|
+
const marketId = this.safeString(trade, 'pair');
|
|
158504
|
+
const isTaker = this.safeValue(trade, 'isMaker');
|
|
158505
|
+
let side = this.safeStringLower(trade, 'side');
|
|
158506
|
+
if (side === undefined) {
|
|
158507
|
+
const isBuyer = this.safeValue(trade, 'isBuyer');
|
|
158508
|
+
side = isBuyer ? 'buy' : 'sell';
|
|
157965
158509
|
}
|
|
157966
|
-
const priceString = this.safeString(trade, 'price');
|
|
157967
|
-
const amountString = this.safeString(trade, 'volume');
|
|
157968
|
-
const costString = this.safeNumber(trade, 'funds');
|
|
157969
|
-
const orderId = this.safeString(trade, 'order_id');
|
|
157970
|
-
const id = this.safeString(trade, 'id');
|
|
157971
158510
|
return this.safeTrade({
|
|
157972
|
-
'id': id,
|
|
157973
158511
|
'info': trade,
|
|
157974
|
-
'
|
|
157975
|
-
'
|
|
157976
|
-
'
|
|
158512
|
+
'id': this.safeString(trade, 'id'),
|
|
158513
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
158514
|
+
'timestamp': this.parse8601(datetime),
|
|
158515
|
+
'datetime': datetime,
|
|
157977
158516
|
'type': undefined,
|
|
157978
158517
|
'side': side,
|
|
157979
|
-
'order': orderId,
|
|
157980
|
-
'takerOrMaker':
|
|
157981
|
-
'price':
|
|
157982
|
-
'amount':
|
|
157983
|
-
'cost':
|
|
157984
|
-
'fee':
|
|
158518
|
+
'order': this.safeString(trade, 'orderId'),
|
|
158519
|
+
'takerOrMaker': isTaker ? 'taker' : 'maker',
|
|
158520
|
+
'price': this.safeString2(trade, 'matchPrice', 'price'),
|
|
158521
|
+
'amount': this.safeString2(trade, 'matchQuantity', 'quantity'),
|
|
158522
|
+
'cost': this.safeString(trade, 'quoteQuantity'),
|
|
158523
|
+
'fee': {
|
|
158524
|
+
'cost': this.safeString(trade, 'fee'),
|
|
158525
|
+
'currency': this.safeCurrencyCode(this.safeString(trade, 'feeCurrency')),
|
|
158526
|
+
'rate': undefined,
|
|
158527
|
+
},
|
|
157985
158528
|
}, market);
|
|
157986
158529
|
}
|
|
157987
|
-
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
157988
|
-
/**
|
|
157989
|
-
* @method
|
|
157990
|
-
* @name kuna#fetchOHLCV
|
|
157991
|
-
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
157992
|
-
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
157993
|
-
* @param {string} timeframe the length of time each candle represents
|
|
157994
|
-
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
157995
|
-
* @param {int} [limit] the maximum amount of candles to fetch
|
|
157996
|
-
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
157997
|
-
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
157998
|
-
*/
|
|
157999
|
-
await this.loadMarkets();
|
|
158000
|
-
const trades = await this.fetchTrades(symbol, since, limit, params);
|
|
158001
|
-
const ohlcvc = this.buildOHLCVC(trades, timeframe, since, limit);
|
|
158002
|
-
const result = [];
|
|
158003
|
-
for (let i = 0; i < ohlcvc.length; i++) {
|
|
158004
|
-
const ohlcv = ohlcvc[i];
|
|
158005
|
-
result.push([
|
|
158006
|
-
ohlcv[0],
|
|
158007
|
-
ohlcv[1],
|
|
158008
|
-
ohlcv[2],
|
|
158009
|
-
ohlcv[3],
|
|
158010
|
-
ohlcv[4],
|
|
158011
|
-
ohlcv[5],
|
|
158012
|
-
]);
|
|
158013
|
-
}
|
|
158014
|
-
return result;
|
|
158015
|
-
}
|
|
158016
158530
|
parseBalance(response) {
|
|
158017
|
-
|
|
158018
|
-
|
|
158019
|
-
|
|
158020
|
-
|
|
158531
|
+
//
|
|
158532
|
+
// [
|
|
158533
|
+
// {
|
|
158534
|
+
// "currency": "UAH",
|
|
158535
|
+
// "balance": "7134.6",
|
|
158536
|
+
// "lockBalance": "100"
|
|
158537
|
+
// }
|
|
158538
|
+
// ...
|
|
158539
|
+
// ]
|
|
158540
|
+
//
|
|
158541
|
+
const result = { 'info': response };
|
|
158542
|
+
for (let i = 0; i < response.length; i++) {
|
|
158543
|
+
const balance = response[i];
|
|
158021
158544
|
const currencyId = this.safeString(balance, 'currency');
|
|
158022
158545
|
const code = this.safeCurrencyCode(currencyId);
|
|
158023
158546
|
const account = this.account();
|
|
158024
158547
|
account['free'] = this.safeString(balance, 'balance');
|
|
158025
|
-
account['used'] = this.safeString(balance, '
|
|
158548
|
+
account['used'] = this.safeString(balance, 'lockBalance');
|
|
158026
158549
|
result[code] = account;
|
|
158027
158550
|
}
|
|
158028
158551
|
return this.safeBalance(result);
|
|
@@ -158036,35 +158559,79 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
158036
158559
|
* @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
|
|
158037
158560
|
*/
|
|
158038
158561
|
await this.loadMarkets();
|
|
158039
|
-
const response = await this.
|
|
158040
|
-
|
|
158562
|
+
const response = await this.v4PrivateGetPrivateGetBalance(params);
|
|
158563
|
+
//
|
|
158564
|
+
// {
|
|
158565
|
+
// "data": [{
|
|
158566
|
+
// "currency": "UAH", // Wallet currency
|
|
158567
|
+
// "balance": "7134.6", // Available balance, precision depends on the currency
|
|
158568
|
+
// "lockBalance": "100" // Minimum amount locked on the balance
|
|
158569
|
+
// }]
|
|
158570
|
+
// }
|
|
158571
|
+
//
|
|
158572
|
+
const data = this.safeValue(response, 'data', []);
|
|
158573
|
+
return this.parseBalance(data);
|
|
158041
158574
|
}
|
|
158042
158575
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
158043
158576
|
/**
|
|
158044
158577
|
* @method
|
|
158045
158578
|
* @name kuna#createOrder
|
|
158046
158579
|
* @description create a trade order
|
|
158580
|
+
* @see https://docs.kuna.io/docs/create-a-new-order-private
|
|
158047
158581
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
158048
158582
|
* @param {string} type 'market' or 'limit'
|
|
158049
158583
|
* @param {string} side 'buy' or 'sell'
|
|
158050
158584
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
158051
158585
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
158052
158586
|
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
158587
|
+
* @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
|
|
158588
|
+
*
|
|
158589
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
158590
|
+
* @param {string} [params.id] id must be a UUID format, if you do not specify id, it will be generated automatically.
|
|
158591
|
+
* @param {float} [params.quoteQuantity] the max quantity of the quote asset to use for selling/buying
|
|
158053
158592
|
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
158054
158593
|
*/
|
|
158055
158594
|
await this.loadMarkets();
|
|
158056
158595
|
const market = this.market(symbol);
|
|
158596
|
+
const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
|
|
158597
|
+
params = this.omit(params, ['triggerPrice', 'stopPrice']);
|
|
158598
|
+
const capitalizedType = this.capitalize(type);
|
|
158057
158599
|
const request = {
|
|
158058
|
-
'
|
|
158059
|
-
'side':
|
|
158060
|
-
'
|
|
158061
|
-
'
|
|
158600
|
+
'pair': market['id'],
|
|
158601
|
+
'orderSide': (side === 'buy') ? 'Bid' : 'Ask',
|
|
158602
|
+
'quantity': amount.toString(),
|
|
158603
|
+
'type': capitalizedType,
|
|
158062
158604
|
};
|
|
158063
|
-
if (
|
|
158064
|
-
request['price'] =
|
|
158605
|
+
if (capitalizedType === 'Limit') {
|
|
158606
|
+
request['price'] = this.priceToPrecision(market['symbol'], price);
|
|
158065
158607
|
}
|
|
158066
|
-
|
|
158067
|
-
|
|
158608
|
+
if (triggerPrice !== undefined) {
|
|
158609
|
+
if (capitalizedType === 'Market') {
|
|
158610
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' createOrder () cannot place trigger market orders, or trigger limit');
|
|
158611
|
+
}
|
|
158612
|
+
request['stopPrice'] = this.priceToPrecision(market['symbol'], triggerPrice);
|
|
158613
|
+
if (capitalizedType !== 'TakeProfitLimit') {
|
|
158614
|
+
request['type'] = 'StopLossLimit';
|
|
158615
|
+
}
|
|
158616
|
+
}
|
|
158617
|
+
const response = await this.v4PrivatePostOrderPrivateCreate(this.extend(request, params));
|
|
158618
|
+
//
|
|
158619
|
+
// {
|
|
158620
|
+
// "data": {
|
|
158621
|
+
// "id": "b0fcb54c-2278-4f16-a300-02765faad8b0", // ID of your newly created order
|
|
158622
|
+
// "type": "Limit", // Type of an order
|
|
158623
|
+
// "quantity": "0.06", // Original order quantity
|
|
158624
|
+
// "executedQuantity": "0", // Traded quantity in stock (>0 if traded)
|
|
158625
|
+
// "pair": "BTC_USDT", // Traded pair
|
|
158626
|
+
// "price": "26440.46", // Price of the trade
|
|
158627
|
+
// "status": "Open", // The status of the order
|
|
158628
|
+
// "createdAt": "2023-07-11T08:01:30.550Z", // Date-time of order creation, UTC
|
|
158629
|
+
// "updatedAt": "2023-07-11T08:01:30.550Z" // Date-time of the last update of the order, UTC
|
|
158630
|
+
// }
|
|
158631
|
+
// }
|
|
158632
|
+
//
|
|
158633
|
+
const data = this.safeValue(response, 'data', {});
|
|
158634
|
+
return this.parseOrder(data, market);
|
|
158068
158635
|
}
|
|
158069
158636
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
158070
158637
|
/**
|
|
@@ -158072,24 +158639,66 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
158072
158639
|
* @name kuna#cancelOrder
|
|
158073
158640
|
* @description cancels an open order
|
|
158074
158641
|
* @param {string} id order id
|
|
158075
|
-
* @param {string} symbol
|
|
158642
|
+
* @param {string} symbol unified market symbol
|
|
158076
158643
|
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
158077
158644
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
158078
158645
|
*/
|
|
158079
158646
|
await this.loadMarkets();
|
|
158080
158647
|
const request = {
|
|
158081
|
-
'
|
|
158648
|
+
'orderId': id,
|
|
158082
158649
|
};
|
|
158083
|
-
const response = await this.
|
|
158084
|
-
|
|
158085
|
-
|
|
158086
|
-
|
|
158087
|
-
|
|
158650
|
+
const response = await this.v4PrivatePostOrderPrivateCancel(this.extend(request, params));
|
|
158651
|
+
//
|
|
158652
|
+
// {
|
|
158653
|
+
// "data": {
|
|
158654
|
+
// "success": true
|
|
158655
|
+
// }
|
|
158656
|
+
// }
|
|
158657
|
+
//
|
|
158658
|
+
const data = this.safeValue(response, 'data', {});
|
|
158659
|
+
let market = undefined;
|
|
158660
|
+
if (symbol !== undefined) {
|
|
158661
|
+
market = this.market(symbol);
|
|
158088
158662
|
}
|
|
158663
|
+
const order = this.parseOrder(data, market);
|
|
158664
|
+
order['id'] = id;
|
|
158089
158665
|
return order;
|
|
158090
158666
|
}
|
|
158667
|
+
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
158668
|
+
/**
|
|
158669
|
+
* @method
|
|
158670
|
+
* @name kuna#cancelOrder
|
|
158671
|
+
* @description cancels an open order
|
|
158672
|
+
* @param {string} ids order ids
|
|
158673
|
+
* @param {string} symbol not used by kuna cancelOrder
|
|
158674
|
+
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
158675
|
+
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
158676
|
+
*/
|
|
158677
|
+
await this.loadMarkets();
|
|
158678
|
+
const request = {
|
|
158679
|
+
'orderIds': ids,
|
|
158680
|
+
};
|
|
158681
|
+
const response = await this.v4PrivatePostOrderPrivateCancelMulti(this.extend(request, params));
|
|
158682
|
+
//
|
|
158683
|
+
// {
|
|
158684
|
+
// "data": [
|
|
158685
|
+
// {
|
|
158686
|
+
// "id": "c7fc5b2b-bd9d-48c1-a458-a83412669fe2", // Unique identifier of a canceled order
|
|
158687
|
+
// "success": true // Status for this order
|
|
158688
|
+
// },
|
|
158689
|
+
// ...
|
|
158690
|
+
// ]
|
|
158691
|
+
// }
|
|
158692
|
+
//
|
|
158693
|
+
const data = this.safeValue(response, 'data', []);
|
|
158694
|
+
return this.parseOrders(data);
|
|
158695
|
+
}
|
|
158091
158696
|
parseOrderStatus(status) {
|
|
158092
158697
|
const statuses = {
|
|
158698
|
+
'Canceled': 'canceled',
|
|
158699
|
+
'Closed': 'filled',
|
|
158700
|
+
'Pending': 'open',
|
|
158701
|
+
'Open': 'open',
|
|
158093
158702
|
'done': 'closed',
|
|
158094
158703
|
'wait': 'open',
|
|
158095
158704
|
'cancel': 'canceled',
|
|
@@ -158097,36 +158706,81 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
158097
158706
|
return this.safeString(statuses, status, status);
|
|
158098
158707
|
}
|
|
158099
158708
|
parseOrder(order, market = undefined) {
|
|
158100
|
-
|
|
158101
|
-
|
|
158102
|
-
|
|
158103
|
-
|
|
158104
|
-
|
|
158105
|
-
|
|
158106
|
-
|
|
158709
|
+
//
|
|
158710
|
+
// createOrder, fetchOrder, fetchOpenOrders, fetchOrdersByStatus
|
|
158711
|
+
//
|
|
158712
|
+
// {
|
|
158713
|
+
// "id": "5992a049-8612-409d-8599-2c3d7298b106", // Unique identifier of an order
|
|
158714
|
+
// "type": "Limit", // Type of an order
|
|
158715
|
+
// "quantity": "5", // Original order quantity
|
|
158716
|
+
// "executedQuantity": "0", // Traded quantity in stock (>0 if traded)
|
|
158717
|
+
// "cumulativeQuoteQty": "0", // *absent on createOrder* Traded quantity in money (>0 if traded)
|
|
158718
|
+
// "cost": "0.05", // Total amount
|
|
158719
|
+
// "side": "Bid", // *absent on createOrder* Bid for buying base asset, Ask for selling base asset. FYI: For BTC_USDT trading pair, BTC is the base asset
|
|
158720
|
+
// "pair": "TRX_USDT", // Traded pair
|
|
158721
|
+
// "price": "0.01", // Price of the trade
|
|
158722
|
+
// "status": "Open", // The status of the order
|
|
158723
|
+
// "createdAt": "2023-07-11T07:04:20.131Z", // Date-time of order creation, UTC
|
|
158724
|
+
// "updatedAt": "2023-07-11T07:04:20.131Z" // Date-time of the last update of the order, UTC
|
|
158725
|
+
// "closedAt": "2023-05-08T08:53:58.333Z" // *absent on fetchOpenOrders/createOrder* Date-time of order finish time, UTC
|
|
158726
|
+
// "trades": [ // * fetchOrder only *
|
|
158727
|
+
// {
|
|
158728
|
+
// "id": "15ff497c-8d25-4155-8184-bb1f905cce1e", // Unique identifier of a trade
|
|
158729
|
+
// "orderId": "4b9b9705-e85f-4180-bdec-219fbf025fa3", // Unique identifier of an associated order
|
|
158730
|
+
// "pair": "BTC_USDT", // Traded pair
|
|
158731
|
+
// "quantity": "0.00054", // Traded quantity
|
|
158732
|
+
// "price": "27770", // Traded price
|
|
158733
|
+
// "isTaker": false, // Various fees for Makers and Takers; "Market" orders are always `true`
|
|
158734
|
+
// "fee": "0.000001350", // Exchange commission fee
|
|
158735
|
+
// "feeCurrency": "BTC", // Currency of the commission
|
|
158736
|
+
// "isBuyer": true, // Buy or sell the base asset
|
|
158737
|
+
// "quoteQuantity": "14.9958", // Quote asset quantity
|
|
158738
|
+
// "createdAt": "2023-05-08T08:53:58.332Z" // Date-time of trade execution, UTC
|
|
158739
|
+
// }
|
|
158740
|
+
// ]
|
|
158741
|
+
// }
|
|
158742
|
+
//
|
|
158743
|
+
// cancelOrder, cancelOrders
|
|
158744
|
+
//
|
|
158745
|
+
// {
|
|
158746
|
+
// "id": "c7fc5b2b-bd9d-48c1-a458-a83412669fe2", // Unique identifier of a canceled order *absent on cancelOrder*
|
|
158747
|
+
// "success": true // Status for this order
|
|
158748
|
+
// }
|
|
158749
|
+
//
|
|
158750
|
+
const marketId = this.safeString(order, 'pair');
|
|
158751
|
+
const datetime = this.safeString(order, 'createdAt');
|
|
158752
|
+
const triggerPrice = this.safeString(order, 'stopPrice');
|
|
158753
|
+
let side = this.safeString(order, 'side');
|
|
158754
|
+
if (side === 'Bid') {
|
|
158755
|
+
side = 'buy';
|
|
158756
|
+
}
|
|
158757
|
+
else if (side === 'Ask') {
|
|
158758
|
+
side = 'sell';
|
|
158759
|
+
}
|
|
158760
|
+
const trades = this.safeValue(order, 'trades', []);
|
|
158107
158761
|
return this.safeOrder({
|
|
158108
|
-
'
|
|
158762
|
+
'info': order,
|
|
158763
|
+
'id': this.safeString2(order, 'id', 'orderId'),
|
|
158109
158764
|
'clientOrderId': undefined,
|
|
158110
|
-
'
|
|
158111
|
-
'
|
|
158112
|
-
'
|
|
158113
|
-
'
|
|
158114
|
-
'
|
|
158115
|
-
'type': type,
|
|
158765
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
158766
|
+
'timestamp': this.parse8601(datetime),
|
|
158767
|
+
'datetime': datetime,
|
|
158768
|
+
'lastTradeTimestamp': this.parse8601(this.safeString(order, 'updatedAt')),
|
|
158769
|
+
'status': this.parseOrderStatus(this.safeString(order, 'status')),
|
|
158770
|
+
'type': this.safeStringLower(order, 'type'),
|
|
158116
158771
|
'timeInForce': undefined,
|
|
158117
158772
|
'postOnly': undefined,
|
|
158118
158773
|
'side': side,
|
|
158119
158774
|
'price': this.safeString(order, 'price'),
|
|
158120
|
-
'stopPrice':
|
|
158121
|
-
'triggerPrice':
|
|
158122
|
-
'amount': this.safeString(order, '
|
|
158123
|
-
'filled': this.safeString(order, '
|
|
158124
|
-
'remaining':
|
|
158125
|
-
'trades':
|
|
158126
|
-
'
|
|
158127
|
-
'info': order,
|
|
158128
|
-
'cost': undefined,
|
|
158775
|
+
'stopPrice': triggerPrice,
|
|
158776
|
+
'triggerPrice': triggerPrice,
|
|
158777
|
+
'amount': this.safeString(order, 'quantity'),
|
|
158778
|
+
'filled': this.safeString(order, 'executedQuantity'),
|
|
158779
|
+
'remaining': undefined,
|
|
158780
|
+
'trades': this.parseTrades(trades),
|
|
158781
|
+
'cost': this.safeString(order, 'cost'),
|
|
158129
158782
|
'average': undefined,
|
|
158783
|
+
'fee': undefined,
|
|
158130
158784
|
}, market);
|
|
158131
158785
|
}
|
|
158132
158786
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
@@ -158134,78 +158788,656 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
158134
158788
|
* @method
|
|
158135
158789
|
* @name kuna#fetchOrder
|
|
158136
158790
|
* @description fetches information on an order made by the user
|
|
158791
|
+
* @see https://docs.kuna.io/docs/get-order-details-by-id
|
|
158137
158792
|
* @param {string} symbol not used by kuna fetchOrder
|
|
158138
158793
|
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
158794
|
+
*
|
|
158795
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
158796
|
+
* @param {boolean} [params.withTrades] default == true, specify if the response should include trades associated with the order
|
|
158139
158797
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
158140
158798
|
*/
|
|
158141
158799
|
await this.loadMarkets();
|
|
158142
158800
|
const request = {
|
|
158143
|
-
'id':
|
|
158801
|
+
'id': id,
|
|
158802
|
+
'withTrades': true,
|
|
158144
158803
|
};
|
|
158145
|
-
const response = await this.
|
|
158146
|
-
|
|
158804
|
+
const response = await this.v4PrivateGetOrderPrivateDetailsId(this.extend(request, params));
|
|
158805
|
+
//
|
|
158806
|
+
// {
|
|
158807
|
+
// "data": {
|
|
158808
|
+
// "id": "4b9b9705-e85f-4180-bdec-219fbf025fa3",
|
|
158809
|
+
// "type": "Limit",
|
|
158810
|
+
// "quantity": "0.00054",
|
|
158811
|
+
// "executedQuantity": "0.00054",
|
|
158812
|
+
// "cumulativeQuoteQty": "14.99580",
|
|
158813
|
+
// "cost": "14.9958",
|
|
158814
|
+
// "side": "Bid",
|
|
158815
|
+
// "pair": "BTC_USDT",
|
|
158816
|
+
// "price": "27770",
|
|
158817
|
+
// "status": "Closed",
|
|
158818
|
+
// "createdAt": "2023-05-08T08:39:46.708Z",
|
|
158819
|
+
// "updatedAt": "2023-05-08T08:53:58.332Z",
|
|
158820
|
+
// "closedAt": "2023-05-08T08:53:58.333Z",
|
|
158821
|
+
// "trades": [
|
|
158822
|
+
// {
|
|
158823
|
+
// "id": "15ff497c-8d25-4155-8184-bb1f905cce1e", // Unique identifier of a trade
|
|
158824
|
+
// "orderId": "4b9b9705-e85f-4180-bdec-219fbf025fa3", // Unique identifier of an associated order
|
|
158825
|
+
// "pair": "BTC_USDT", // Traded pair
|
|
158826
|
+
// "quantity": "0.00054", // Traded quantity
|
|
158827
|
+
// "price": "27770", // Traded price
|
|
158828
|
+
// "isTaker": false, // Various fees for Makers and Takers; "Market" orders are always `true`
|
|
158829
|
+
// "fee": "0.000001350", // Exchange commission fee
|
|
158830
|
+
// "feeCurrency": "BTC", // Currency of the commission
|
|
158831
|
+
// "isBuyer": true, // Buy or sell the base asset
|
|
158832
|
+
// "quoteQuantity": "14.9958", // Quote asset quantity
|
|
158833
|
+
// "createdAt": "2023-05-08T08:53:58.332Z" // Date-time of trade execution, UTC
|
|
158834
|
+
// }
|
|
158835
|
+
// ]
|
|
158836
|
+
// }
|
|
158837
|
+
// }
|
|
158838
|
+
//
|
|
158839
|
+
const data = this.safeValue(response, 'data', {});
|
|
158840
|
+
return this.parseOrder(data);
|
|
158147
158841
|
}
|
|
158148
158842
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
158149
158843
|
/**
|
|
158150
158844
|
* @method
|
|
158151
158845
|
* @name kuna#fetchOpenOrders
|
|
158152
158846
|
* @description fetch all unfilled currently open orders
|
|
158847
|
+
* @see https://docs.kuna.io/docs/get-active-client-orders-private
|
|
158153
158848
|
* @param {string} symbol unified market symbol
|
|
158154
158849
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
158155
|
-
* @param {int} [limit] the maximum number of
|
|
158850
|
+
* @param {int} [limit] 1-100, the maximum number of open orders structures to retrieve
|
|
158156
158851
|
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
158852
|
+
* @param {int} [params.until] the latest timestamp (ms) to fetch orders for
|
|
158853
|
+
*
|
|
158854
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
158855
|
+
* @param {string} [params.sort] asc (oldest-on-top) or desc (newest-on-top)
|
|
158157
158856
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
158158
158857
|
*/
|
|
158159
|
-
|
|
158160
|
-
|
|
158858
|
+
await this.loadMarkets();
|
|
158859
|
+
const until = this.safeInteger(params, 'until');
|
|
158860
|
+
params = this.omit(params, ['until']);
|
|
158861
|
+
let market = undefined;
|
|
158862
|
+
const request = {};
|
|
158863
|
+
if (symbol !== undefined) {
|
|
158864
|
+
market = this.market(symbol);
|
|
158865
|
+
request['pairs'] = market['id'];
|
|
158866
|
+
}
|
|
158867
|
+
if (since !== undefined) {
|
|
158868
|
+
request['start'] = this.iso8601(since);
|
|
158161
158869
|
}
|
|
158870
|
+
if (limit !== undefined) {
|
|
158871
|
+
request['limit'] = limit;
|
|
158872
|
+
}
|
|
158873
|
+
if (until !== undefined) {
|
|
158874
|
+
request['end'] = this.iso8601(until);
|
|
158875
|
+
}
|
|
158876
|
+
const response = await this.v4PrivateGetOrderPrivateActive(this.extend(request, params));
|
|
158877
|
+
//
|
|
158878
|
+
// {
|
|
158879
|
+
// "data": [
|
|
158880
|
+
// {
|
|
158881
|
+
// "id": "5992a049-8612-409d-8599-2c3d7298b106", // Unique identifier of an order
|
|
158882
|
+
// "type": "Limit", // Type of an order
|
|
158883
|
+
// "quantity": "5", // Original order quantity
|
|
158884
|
+
// "executedQuantity": "0", // Traded quantity in stock (>0 if traded)
|
|
158885
|
+
// "cumulativeQuoteQty": "0", // Traded quantity in money (>0 if traded)
|
|
158886
|
+
// "cost": "0.05", // Total amount
|
|
158887
|
+
// "side": "Bid", // Bid for buying base asset, Ask for selling base asset. FYI: For BTC_USDT trading pair, BTC is the base asset
|
|
158888
|
+
// "pair": "TRX_USDT", // Traded pair
|
|
158889
|
+
// "price": "0.01", // Price of the trade
|
|
158890
|
+
// "status": "Open", // The status of the order
|
|
158891
|
+
// "createdAt": "2023-07-11T07:04:20.131Z", // Date-time of order creation, UTC
|
|
158892
|
+
// "updatedAt": "2023-07-11T07:04:20.131Z" // Date-time of the last update of the order, UTC
|
|
158893
|
+
// }
|
|
158894
|
+
// ...
|
|
158895
|
+
// ]
|
|
158896
|
+
// }
|
|
158897
|
+
//
|
|
158898
|
+
const data = this.safeValue(response, 'data', []);
|
|
158899
|
+
return this.parseOrders(data, market, since, limit);
|
|
158900
|
+
}
|
|
158901
|
+
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
158902
|
+
/**
|
|
158903
|
+
* @method
|
|
158904
|
+
* @name kuna#fetchClosedOrders
|
|
158905
|
+
* @description fetches information on multiple closed orders made by the user
|
|
158906
|
+
* @see https://docs.kuna.io/docs/get-private-orders-history
|
|
158907
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
158908
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
158909
|
+
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
158910
|
+
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
158911
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
158912
|
+
*
|
|
158913
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
158914
|
+
* @param {string} [params.sort] asc (oldest-on-top) or desc (newest-on-top)
|
|
158915
|
+
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
158916
|
+
*/
|
|
158917
|
+
return await this.fetchOrdersByStatus('closed', symbol, since, limit, params);
|
|
158918
|
+
}
|
|
158919
|
+
async fetchOrdersByStatus(status, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
158920
|
+
/**
|
|
158921
|
+
* @method
|
|
158922
|
+
* @name kuna#fetchOrdersByStatus
|
|
158923
|
+
* @description fetch a list of orders
|
|
158924
|
+
* @see https://docs.kuna.io/docs/get-private-orders-history
|
|
158925
|
+
* @param {string} status canceled, closed, expired, open, pending, rejected, or waitStop
|
|
158926
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
158927
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
158928
|
+
* @param {int} [limit] 1-100, the maximum number of open orders structures to retrieve
|
|
158929
|
+
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
158930
|
+
* @param {int} [params.until] the latest timestamp (ms) to fetch orders for
|
|
158931
|
+
*
|
|
158932
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
158933
|
+
* @param {string} [params.sort] asc (oldest-on-top) or desc (newest-on-top)
|
|
158934
|
+
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
158935
|
+
*/
|
|
158162
158936
|
await this.loadMarkets();
|
|
158163
|
-
|
|
158937
|
+
if (status === 'open') {
|
|
158938
|
+
return this.fetchOpenOrders(symbol, since, limit, params);
|
|
158939
|
+
}
|
|
158940
|
+
const until = this.safeInteger(params, 'until');
|
|
158941
|
+
params = this.omit(params, ['until']);
|
|
158942
|
+
let market = undefined;
|
|
158164
158943
|
const request = {
|
|
158165
|
-
'
|
|
158944
|
+
'status': this.capitalize(status),
|
|
158166
158945
|
};
|
|
158167
|
-
|
|
158168
|
-
|
|
158169
|
-
|
|
158170
|
-
|
|
158171
|
-
|
|
158946
|
+
if (symbol !== undefined) {
|
|
158947
|
+
market = this.market(symbol);
|
|
158948
|
+
request['pairs'] = market['id'];
|
|
158949
|
+
}
|
|
158950
|
+
if (since !== undefined) {
|
|
158951
|
+
request['start'] = this.iso8601(since);
|
|
158952
|
+
}
|
|
158953
|
+
if (limit !== undefined) {
|
|
158954
|
+
request['limit'] = limit;
|
|
158955
|
+
}
|
|
158956
|
+
if (until !== undefined) {
|
|
158957
|
+
request['end'] = this.iso8601(until);
|
|
158958
|
+
}
|
|
158959
|
+
const response = await this.v4PrivateGetOrderPrivateHistory(request);
|
|
158960
|
+
//
|
|
158961
|
+
// {
|
|
158962
|
+
// "data": [
|
|
158963
|
+
// {
|
|
158964
|
+
// "id": "4b9b9705-e85f-4180-bdec-219fbf025fa3", // Unique identifier of an order
|
|
158965
|
+
// "type": "Limit", // Type of an order
|
|
158966
|
+
// "quantity": "0.00054", // Original order quantity
|
|
158967
|
+
// "executedQuantity": "0.00054", // Traded quantity in stock (>0 if traded)
|
|
158968
|
+
// "cumulativeQuoteQty": "14.99580", // Traded quantity in money (>0 if traded)
|
|
158969
|
+
// "cost": "14.9958", // Total amount
|
|
158970
|
+
// "side": "Bid", // Bid for buying base asset, Ask for selling base asset. FYI: For BTC_USDT trading pair, BTC is the base asset
|
|
158971
|
+
// "pair": "BTC_USDT", // Traded pair
|
|
158972
|
+
// "price": "27770", // Price of the trade
|
|
158973
|
+
// "status": "Closed", // The status of the order
|
|
158974
|
+
// "createdAt": "2023-05-08T08:39:46.708Z", // Date-time of order creation, UTC
|
|
158975
|
+
// "updatedAt": "2023-05-08T08:53:58.332Z", // Date-time of the last update of the order, UTC
|
|
158976
|
+
// "closedAt": "2023-05-08T08:53:58.333Z" // Date-time of order finish time, UTC
|
|
158977
|
+
// },
|
|
158978
|
+
// ...
|
|
158979
|
+
// ]
|
|
158980
|
+
// }
|
|
158981
|
+
//
|
|
158982
|
+
const data = this.safeValue(response, 'data', []);
|
|
158983
|
+
return this.parseOrders(data, market, since, limit);
|
|
158172
158984
|
}
|
|
158173
158985
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
158174
158986
|
/**
|
|
158175
158987
|
* @method
|
|
158176
158988
|
* @name kuna#fetchMyTrades
|
|
158177
158989
|
* @description fetch all trades made by the user
|
|
158990
|
+
* @see https://docs.kuna.io/docs/get-private-trades-history
|
|
158178
158991
|
* @param {string} symbol unified market symbol
|
|
158179
|
-
* @param {int} [since]
|
|
158180
|
-
* @param {int} [limit]
|
|
158992
|
+
* @param {int} [since] not used by kuna fetchMyTrades
|
|
158993
|
+
* @param {int} [limit] not used by kuna fetchMyTrades
|
|
158181
158994
|
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
158995
|
+
*
|
|
158996
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
158997
|
+
* @param {string} [params.orderId] UUID of an order, to receive trades for this order only
|
|
158998
|
+
* @param {string} [params.sort] asc (oldest-on-top) or desc (newest-on-top)
|
|
158182
158999
|
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
|
|
158183
159000
|
*/
|
|
158184
|
-
|
|
158185
|
-
|
|
159001
|
+
await this.loadMarkets();
|
|
159002
|
+
let market = undefined;
|
|
159003
|
+
const request = {};
|
|
159004
|
+
if (symbol !== undefined) {
|
|
159005
|
+
market = this.market(symbol);
|
|
159006
|
+
request['pair'] = market['id'];
|
|
158186
159007
|
}
|
|
159008
|
+
const response = await this.v4PrivateGetTradePrivateHistory(this.extend(request, params));
|
|
159009
|
+
//
|
|
159010
|
+
// {
|
|
159011
|
+
// "data": [
|
|
159012
|
+
// {
|
|
159013
|
+
// id: "edb17459-c9bf-4148-9ae6-7367d7f55d71", // Unique identifier of a trade
|
|
159014
|
+
// orderId: "a80bec3f-4ffa-45c1-9d78-f6301e9748fe", // Unique identifier of an order associated with the trade
|
|
159015
|
+
// pair: "BTC_USDT", // Traded pair, base asset first, followed by quoted asset
|
|
159016
|
+
// quantity: "1.5862", // Traded quantity of base asset
|
|
159017
|
+
// price: "19087", // Price of the trade
|
|
159018
|
+
// isTaker: true, // Various fees for Makers and Takers; "Market" orders are always `true`
|
|
159019
|
+
// fee: "0.0039655", // Exchange commission fee
|
|
159020
|
+
// feeCurrency: "BTC", // Currency of the commission
|
|
159021
|
+
// isBuyer: true, // Buy or sell the base asset
|
|
159022
|
+
// quoteQuantity: "30275.7994", // Quote asset quantity spent to fulfill the base amount
|
|
159023
|
+
// createdAt: "2022-09-29T13:43:53.824Z", // Date-time of trade execution, UTC
|
|
159024
|
+
// },
|
|
159025
|
+
// ]
|
|
159026
|
+
// }
|
|
159027
|
+
//
|
|
159028
|
+
const data = this.safeValue(response, 'data');
|
|
159029
|
+
return this.parseTrades(data, market, since, limit);
|
|
159030
|
+
}
|
|
159031
|
+
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
159032
|
+
/**
|
|
159033
|
+
* @method
|
|
159034
|
+
* @name kuna#withdraw
|
|
159035
|
+
* @description make a withdrawal
|
|
159036
|
+
* @see https://docs.kuna.io/docs/create-a-withdraw
|
|
159037
|
+
* @param {string} code unified currency code
|
|
159038
|
+
* @param {float} amount the amount to withdraw
|
|
159039
|
+
* @param {string} address the address to withdraw to
|
|
159040
|
+
* @param {string} tag
|
|
159041
|
+
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
159042
|
+
* @param {string} [params.chain] the chain to withdraw to
|
|
159043
|
+
*
|
|
159044
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
159045
|
+
* @param {string} [params.id] id must be a uuid format, if you do not specify id, it will be generated automatically
|
|
159046
|
+
* @param {boolean} [params.withdrawAll] this field says that the amount should also include a fee
|
|
159047
|
+
* @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
|
|
159048
|
+
*/
|
|
159049
|
+
this.checkAddress(address);
|
|
159050
|
+
let chain = this.safeString2(params, 'chain', 'network');
|
|
159051
|
+
params = this.omit(params, ['chain', 'network']);
|
|
158187
159052
|
await this.loadMarkets();
|
|
158188
|
-
const
|
|
159053
|
+
const currency = this.currency(code);
|
|
159054
|
+
if (chain === undefined) {
|
|
159055
|
+
if (currency['code'].indexOf('USD') > 0) {
|
|
159056
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' withdraw () requires an extra parameter params["network"] to withdraw ' + currency['code']);
|
|
159057
|
+
}
|
|
159058
|
+
else {
|
|
159059
|
+
chain = currency['id'].toUpperCase();
|
|
159060
|
+
}
|
|
159061
|
+
}
|
|
159062
|
+
const networkId = this.networkCodeToId(chain);
|
|
158189
159063
|
const request = {
|
|
158190
|
-
'
|
|
159064
|
+
'currency': networkId,
|
|
159065
|
+
'amount': amount,
|
|
159066
|
+
'address': address,
|
|
159067
|
+
'paymentMethod': chain, // TODO: double check, Withdraw method for currency, should be taken from "Get info about withdrawal methods by currency name" endpoint (key field).
|
|
158191
159068
|
};
|
|
158192
|
-
|
|
159069
|
+
if (tag !== undefined) {
|
|
159070
|
+
request['paymentId'] = tag;
|
|
159071
|
+
}
|
|
159072
|
+
const response = await this.v4PrivatePostWithdrawPrivateCreate(this.extend(request, params));
|
|
158193
159073
|
//
|
|
158194
|
-
//
|
|
158195
|
-
//
|
|
158196
|
-
//
|
|
158197
|
-
//
|
|
158198
|
-
//
|
|
158199
|
-
//
|
|
158200
|
-
// "market":"dogeusdt",
|
|
158201
|
-
// "created_at":"2022-04-12T18:58:44Z",
|
|
158202
|
-
// "side":"ask",
|
|
158203
|
-
// "order_id":1665670371,
|
|
158204
|
-
// "trend":"buy"
|
|
158205
|
-
// },
|
|
158206
|
-
// ]
|
|
159074
|
+
// {
|
|
159075
|
+
// "data": {
|
|
159076
|
+
// "id": "edb17459-c9bf-4148-9ae6-7367d7f55d71", // unique identifier of a withdraw
|
|
159077
|
+
// "status": "waitingForConfirmation" // status of a withdraw, if you turn off withdrawal confirmation by email, it will return "processing" status, which means that the transaction is already being processed on our side
|
|
159078
|
+
// }
|
|
159079
|
+
// }
|
|
158207
159080
|
//
|
|
158208
|
-
|
|
159081
|
+
const data = this.safeValue(response, 'data', {});
|
|
159082
|
+
return this.parseTransaction(data, currency);
|
|
159083
|
+
}
|
|
159084
|
+
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
159085
|
+
/**
|
|
159086
|
+
* @method
|
|
159087
|
+
* @name kuna#fetchWithdrawals
|
|
159088
|
+
* @description fetch all withdrawals made to an account
|
|
159089
|
+
* @see https://docs.kuna.io/docs/get-withdraw-history
|
|
159090
|
+
* @param {string} code unified currency code
|
|
159091
|
+
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
159092
|
+
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
159093
|
+
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
159094
|
+
* @param {int} [params.until] the latest time in ms to fetch deposits for
|
|
159095
|
+
*
|
|
159096
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
159097
|
+
* @param {string} [params.status] Created, Canceled, PartiallyProcessed, Processing, Processed, WaitForConfirmation, Pending, AmlChecking
|
|
159098
|
+
* @param {string} [params.sortField] amount (sorting by time), createdAt (sorting by date)
|
|
159099
|
+
* @param {string} [params.sortOrder] asc (oldest-on-top), or desc (newest-on-top, default)
|
|
159100
|
+
* @param {int} [params.skip] 0 - ... Select the number of transactions to skip
|
|
159101
|
+
* @param {string} [params.address]
|
|
159102
|
+
* @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
|
|
159103
|
+
*/
|
|
159104
|
+
await this.loadMarkets();
|
|
159105
|
+
const until = this.safeInteger(params, 'until');
|
|
159106
|
+
params = this.omit(params, 'until');
|
|
159107
|
+
let currency = undefined;
|
|
159108
|
+
if (currency !== undefined) {
|
|
159109
|
+
currency = this.currency(code);
|
|
159110
|
+
}
|
|
159111
|
+
const request = {};
|
|
159112
|
+
if (code !== undefined) {
|
|
159113
|
+
request['currency'] = code;
|
|
159114
|
+
}
|
|
159115
|
+
if (since !== undefined) {
|
|
159116
|
+
request['dateFrom'] = this.iso8601(since);
|
|
159117
|
+
}
|
|
159118
|
+
if (limit !== undefined) {
|
|
159119
|
+
request['take'] = limit;
|
|
159120
|
+
}
|
|
159121
|
+
if (until !== undefined) {
|
|
159122
|
+
request['dateTo'] = this.iso8601(until);
|
|
159123
|
+
}
|
|
159124
|
+
const response = await this.v4PrivateGetWithdrawPrivateHistory(this.extend(request, params));
|
|
159125
|
+
//
|
|
159126
|
+
// {
|
|
159127
|
+
// "data": [
|
|
159128
|
+
// {
|
|
159129
|
+
// "id": "e9aa15b8-9c19-42eb-800a-026a7a153990", // Unique identifier of withdrawal
|
|
159130
|
+
// "amount": "10.75", // Amount deducted from your account
|
|
159131
|
+
// "asset": "USDT", // Withdrawal currency
|
|
159132
|
+
// "merchantId": "16214228-5c0c-5abc-be6a-c90259b21d4e", // Internal ID (not for use)
|
|
159133
|
+
// "paymentCode": "TRX", // Blockchain name
|
|
159134
|
+
// "status": "Processed", // Withdrawal status
|
|
159135
|
+
// "type": "Withdraw", // Transaction type
|
|
159136
|
+
// "reason": [], // Reason for manual transaction processing
|
|
159137
|
+
// "address": "TL3CWAwviQQYSnzHT4RotCWYnarnunQM46", // Withdrawal address
|
|
159138
|
+
// "memo": "", // Withdrawal memo
|
|
159139
|
+
// "txId": "5ecc4e559b528c57be6723ac960a38211fbd3101ef4b59008452b3bd88c84621", // Withdrawal transaction hash
|
|
159140
|
+
// "fee": "0.75", // Withdrawal fee
|
|
159141
|
+
// "processedAmount": "10", // Withdrawal amount
|
|
159142
|
+
// "createdAt": "2023-06-09T11:33:02.383Z", // Withdrawal creation date
|
|
159143
|
+
// "updatedAt": "2023-06-09T11:34:25.317Z" // Date of final withdrawal status
|
|
159144
|
+
// },
|
|
159145
|
+
// ...
|
|
159146
|
+
// ]
|
|
159147
|
+
// }
|
|
159148
|
+
//
|
|
159149
|
+
const data = this.safeValue(response, 'data', []);
|
|
159150
|
+
return this.parseTransactions(data, currency);
|
|
159151
|
+
}
|
|
159152
|
+
async fetchWithdrawal(id, code = undefined, params = {}) {
|
|
159153
|
+
/**
|
|
159154
|
+
* @method
|
|
159155
|
+
* @name kuna#fetchWithdrawal
|
|
159156
|
+
* @description fetch data on a currency withdrawal via the withdrawal id
|
|
159157
|
+
* @see https://docs.kuna.io/docs/get-withdraw-details-by-id
|
|
159158
|
+
* @param {string} id withdrawal id
|
|
159159
|
+
* @param {string} code not used by kuna.fetchWithdrawal
|
|
159160
|
+
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
159161
|
+
* @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
|
|
159162
|
+
*/
|
|
159163
|
+
await this.loadMarkets();
|
|
159164
|
+
const request = {
|
|
159165
|
+
'withdrawId': id,
|
|
159166
|
+
};
|
|
159167
|
+
const response = await this.v4PrivateGetWithdrawPrivateDetailsWithdrawId(this.extend(request, params));
|
|
159168
|
+
//
|
|
159169
|
+
// {
|
|
159170
|
+
// "data": {
|
|
159171
|
+
// "id": "e9aa15b8-9c19-42eb-800a-026a7a153990", // Unique identifier of withdrawal
|
|
159172
|
+
// "amount": "10.75", // Amount deducted from your account
|
|
159173
|
+
// "asset": "USDT", // Withdrawal currency
|
|
159174
|
+
// "merchantId": "16214228-5c0c-5abc-be6a-c90259b21d4e", // Internal ID (not for use)
|
|
159175
|
+
// "paymentCode": "TRX", // Blockchain name
|
|
159176
|
+
// "status": "Processed", // Withdrawal status
|
|
159177
|
+
// "type": "Withdraw", // Transaction type
|
|
159178
|
+
// "reason": [], // Reason for manual transaction processing
|
|
159179
|
+
// "address": "TL3CWAwviQQYSnzHT4RotCWYnarnunQM46", // Withdrawal address
|
|
159180
|
+
// "memo": "", // Withdrawal memo
|
|
159181
|
+
// "txId": "5ecc4e559b528c57be6723ac960a38211fbd3101ef4b59008452b3bd88c84621", // Withdrawal transaction hash
|
|
159182
|
+
// "fee": "0.75", // Withdrawal fee
|
|
159183
|
+
// "processedAmount": "10", // Withdrawal amount
|
|
159184
|
+
// "createdAt": "2023-06-09T11:33:02.383Z", // Withdrawal creation date
|
|
159185
|
+
// "updatedAt": "2023-06-09T11:34:25.317Z" // Date of final withdrawal status
|
|
159186
|
+
// }
|
|
159187
|
+
// }
|
|
159188
|
+
//
|
|
159189
|
+
const data = this.safeValue(response, 'data', {});
|
|
159190
|
+
return this.parseTransaction(data);
|
|
159191
|
+
}
|
|
159192
|
+
async createDepositAddress(code, params = {}) {
|
|
159193
|
+
/**
|
|
159194
|
+
* @method
|
|
159195
|
+
* @name kuna#createDepositAddress
|
|
159196
|
+
* @description create a currency deposit address
|
|
159197
|
+
* @see https://docs.kuna.io/docs/generate-a-constant-crypto-address-for-deposit
|
|
159198
|
+
* @param {string} code unified currency code of the currency for the deposit address
|
|
159199
|
+
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
159200
|
+
* @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
|
|
159201
|
+
*/
|
|
159202
|
+
await this.loadMarkets();
|
|
159203
|
+
const currency = this.currency(code);
|
|
159204
|
+
const request = {
|
|
159205
|
+
'source': currency['id'],
|
|
159206
|
+
};
|
|
159207
|
+
const response = await this.v4PrivatePostDepositPrivateCryptoGenerateAddress(this.extend(request, params));
|
|
159208
|
+
//
|
|
159209
|
+
// {
|
|
159210
|
+
// "data": {
|
|
159211
|
+
// "id": "1300c2b6-ree4-4f1e-2a9d-e0f7ed0991a7", // ID of your address
|
|
159212
|
+
// "source": "BTC", // Blockchain name for which you want to get the address to deposit into the account
|
|
159213
|
+
// "address": "bc1qm6xfv0qsaaanx0egn6hca5vgsd4r7ak9ttha2a" // Your deposit address
|
|
159214
|
+
// }
|
|
159215
|
+
// }
|
|
159216
|
+
//
|
|
159217
|
+
const data = this.safeValue(response, 'data', {});
|
|
159218
|
+
return this.parseDepositAddress(data, currency);
|
|
159219
|
+
}
|
|
159220
|
+
async fetchDepositAddress(code, params = {}) {
|
|
159221
|
+
/**
|
|
159222
|
+
* @method
|
|
159223
|
+
* @name kuna#fetchDepositAddress
|
|
159224
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
159225
|
+
* @see https://docs.kuna.io/docs/find-crypto-address-for-deposit
|
|
159226
|
+
* @param {string} code unified currency code
|
|
159227
|
+
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
159228
|
+
* @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
|
|
159229
|
+
*/
|
|
159230
|
+
await this.loadMarkets();
|
|
159231
|
+
const currency = this.currency(code);
|
|
159232
|
+
const request = {
|
|
159233
|
+
'source': currency['id'].toUpperCase(),
|
|
159234
|
+
};
|
|
159235
|
+
const response = await this.v4PrivateGetDepositPrivateCryptoAddress(this.extend(request, params));
|
|
159236
|
+
//
|
|
159237
|
+
// {
|
|
159238
|
+
// "data": {
|
|
159239
|
+
// "id": "c52b6646-fb91-4760-b147-a4f952e8652c", // ID of the address.
|
|
159240
|
+
// "source": "BTC", // Blockchain name for which you want to get the address to deposit into the account.
|
|
159241
|
+
// "address": "bc1qm6xfv0qsaaanx0egn6hca5vgsd4r7ak9ttha2a" // Your deposit address
|
|
159242
|
+
// }
|
|
159243
|
+
// }
|
|
159244
|
+
//
|
|
159245
|
+
const data = this.safeValue(response, 'data', {});
|
|
159246
|
+
return this.parseDepositAddress(data, currency);
|
|
159247
|
+
}
|
|
159248
|
+
parseDepositAddress(depositAddress, currency = undefined) {
|
|
159249
|
+
//
|
|
159250
|
+
// {
|
|
159251
|
+
// "id": "c52b6646-fb91-4760-b147-a4f952e8652c", // ID of the address.
|
|
159252
|
+
// "source": "BTC", // Blockchain name for which you want to get the address to deposit into the account.
|
|
159253
|
+
// "address": "bc1qm6xfv0qsaaanx0egn6hca5vgsd4r7ak9ttha2a" // Your deposit address
|
|
159254
|
+
// }
|
|
159255
|
+
//
|
|
159256
|
+
const currencyId = this.safeString(depositAddress, 'source');
|
|
159257
|
+
return {
|
|
159258
|
+
'info': this.safeString(depositAddress, ''),
|
|
159259
|
+
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
159260
|
+
'network': undefined,
|
|
159261
|
+
'address': this.safeString(depositAddress, 'address'),
|
|
159262
|
+
'tag': undefined,
|
|
159263
|
+
};
|
|
159264
|
+
}
|
|
159265
|
+
parseTransactionStatus(status) {
|
|
159266
|
+
const statuses = {
|
|
159267
|
+
'Created': 'pending',
|
|
159268
|
+
'Canceled': 'canceled',
|
|
159269
|
+
'PartiallyProcessed': 'pending',
|
|
159270
|
+
'Processing': 'pending',
|
|
159271
|
+
'Processed': 'ok',
|
|
159272
|
+
'WaitForConfirmation': 'pending',
|
|
159273
|
+
'Pending': 'pending',
|
|
159274
|
+
'AmlChecking': 'pending',
|
|
159275
|
+
};
|
|
159276
|
+
return this.safeString(statuses, status, status);
|
|
159277
|
+
}
|
|
159278
|
+
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
159279
|
+
/**
|
|
159280
|
+
* @method
|
|
159281
|
+
* @name kuna#fetchDeposits
|
|
159282
|
+
* @description fetch all deposits made to an account
|
|
159283
|
+
* @see https://docs.kuna.io/docs/get-deposit-history
|
|
159284
|
+
* @param {string} code unified currency code
|
|
159285
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
159286
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
159287
|
+
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
159288
|
+
* @param {int} [params.until] the latest time in ms to fetch deposits for
|
|
159289
|
+
*
|
|
159290
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
159291
|
+
* @param {string} [params.status] Created, Canceled, PartiallyProcessed, Processing, Processed, WaitForConfirmation, Pending, AmlChecking
|
|
159292
|
+
* @param {string} [params.sortField] amount (sorting by time), createdAt (sorting by date)
|
|
159293
|
+
* @param {string} [params.sortOrder] asc (oldest-on-top), or desc (newest-on-top, default)
|
|
159294
|
+
* @param {int} [params.skip] 0 - ... Select the number of transactions to skip
|
|
159295
|
+
* @param {string} [params.address]
|
|
159296
|
+
* @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
|
|
159297
|
+
*/
|
|
159298
|
+
await this.loadMarkets();
|
|
159299
|
+
const until = this.safeInteger(params, 'until');
|
|
159300
|
+
params = this.omit(params, 'until');
|
|
159301
|
+
let currency = undefined;
|
|
159302
|
+
if (currency !== undefined) {
|
|
159303
|
+
currency = this.currency(code);
|
|
159304
|
+
}
|
|
159305
|
+
const request = {};
|
|
159306
|
+
if (code !== undefined) {
|
|
159307
|
+
request['currency'] = code;
|
|
159308
|
+
}
|
|
159309
|
+
if (since !== undefined) {
|
|
159310
|
+
request['dateFrom'] = this.iso8601(since);
|
|
159311
|
+
}
|
|
159312
|
+
if (limit !== undefined) {
|
|
159313
|
+
request['take'] = limit;
|
|
159314
|
+
}
|
|
159315
|
+
if (until !== undefined) {
|
|
159316
|
+
request['dateTo'] = this.iso8601(until);
|
|
159317
|
+
}
|
|
159318
|
+
const response = await this.v4PrivateGetDepositPrivateHistory(this.extend(request, params));
|
|
159319
|
+
//
|
|
159320
|
+
// {
|
|
159321
|
+
// "data": [
|
|
159322
|
+
// {
|
|
159323
|
+
// "id": "a201cb3c-5830-57ac-ad2c-f6a588dd55eb", // Unique ID of deposit
|
|
159324
|
+
// "amount": "9.9", // Amount credited to your account
|
|
159325
|
+
// "asset": "USDT", // Deposit currency
|
|
159326
|
+
// "merchantId": "16214228-5c0c-5abc-be6a-c90259b21d4e", // Internal ID (not for use)
|
|
159327
|
+
// "paymentCode": "TRX", // Blockchain name
|
|
159328
|
+
// "status": "Processed", // Transactions status
|
|
159329
|
+
// "type": "Deposit", // Transaction type
|
|
159330
|
+
// "reason": [], // Reason for manual transaction processing
|
|
159331
|
+
// "address": "TNeBQz8RyGGiAYAR7r8G6QGxtTWDkpH4dV", // Deposit address
|
|
159332
|
+
// "memo": "", // Deposit memo
|
|
159333
|
+
// "txId": "8a0b0c5a2ac5679879b71b2fa63b0a5c39f90bc8ff6c41e708906b398ac3d4ef", // Deposit transaction hash
|
|
159334
|
+
// "fee": "0.1", // Deposit fee
|
|
159335
|
+
// "processedAmount": "10", // Amount of deposit
|
|
159336
|
+
// "createdAt": "2023-06-13T12:55:01.256Z", // Deposit receipt date
|
|
159337
|
+
// "updatedAt": "2023-06-13T12:55:01.696Z" // Deposit credit date
|
|
159338
|
+
// },
|
|
159339
|
+
// ...
|
|
159340
|
+
// ]
|
|
159341
|
+
// }
|
|
159342
|
+
//
|
|
159343
|
+
const data = this.safeValue(response, 'data', []);
|
|
159344
|
+
return this.parseTransactions(data, currency);
|
|
159345
|
+
}
|
|
159346
|
+
async fetchDeposit(id, code = undefined, params = {}) {
|
|
159347
|
+
/**
|
|
159348
|
+
* @method
|
|
159349
|
+
* @name kuna#fetchDeposit
|
|
159350
|
+
* @description fetch data on a currency deposit via the deposit id
|
|
159351
|
+
* @see https://docs.kuna.io/docs/get-deposit-details-by-id
|
|
159352
|
+
* @param {string} id deposit id
|
|
159353
|
+
* @param {string} code filter by currency code
|
|
159354
|
+
* @param {object} [params] extra parameters specific to the kuna api endpoint
|
|
159355
|
+
* @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
|
|
159356
|
+
*/
|
|
159357
|
+
await this.loadMarkets();
|
|
159358
|
+
let currency = undefined;
|
|
159359
|
+
if (code !== undefined) {
|
|
159360
|
+
currency = this.currency(code);
|
|
159361
|
+
}
|
|
159362
|
+
const request = {
|
|
159363
|
+
'depositId': id,
|
|
159364
|
+
};
|
|
159365
|
+
const response = await this.v4PrivateGetDepositPrivateDetailsDepositId(this.extend(request, params));
|
|
159366
|
+
//
|
|
159367
|
+
// {
|
|
159368
|
+
// "data": {
|
|
159369
|
+
// "id": "a201cb3c-5830-57ac-ad2c-f6a588dd55eb", // Unique ID of deposit
|
|
159370
|
+
// "amount": "9.9", // Amount credited to your account
|
|
159371
|
+
// "asset": "USDT", // Deposit currency
|
|
159372
|
+
// "merchantId": "16214228-5c0c-5abc-be6a-c90259b21d4e", // Internal ID (not for use)
|
|
159373
|
+
// "paymentCode": "TRX", // Blockchain name
|
|
159374
|
+
// "status": "Processed", // Transactions status
|
|
159375
|
+
// "type": "Deposit", // Transaction type
|
|
159376
|
+
// "reason": [], // Reason for manual transaction processing
|
|
159377
|
+
// "address": "TNeBQz8RyGGiAYAR7r8G6QGxtTWDkpH4dV", // Deposit address
|
|
159378
|
+
// "memo": "", // Deposit memo
|
|
159379
|
+
// "txId": "8a0b0c5a2ac5679879b71b2fa63b0a5c39f90bc8ff6c41e708906b398ac3d4ef", // Deposit transaction hash
|
|
159380
|
+
// "fee": "0.1", // Deposit fee
|
|
159381
|
+
// "processedAmount": "10", // Amount of deposit
|
|
159382
|
+
// "createdAt": "2023-06-13T12:55:01.256Z", // Deposit receipt date
|
|
159383
|
+
// "updatedAt": "2023-06-13T12:55:01.696Z" // Deposit credit date
|
|
159384
|
+
// }
|
|
159385
|
+
// }
|
|
159386
|
+
//
|
|
159387
|
+
const data = this.safeValue(response, 'data', {});
|
|
159388
|
+
return this.parseTransaction(data, currency);
|
|
159389
|
+
}
|
|
159390
|
+
parseTransaction(transaction, currency = undefined) {
|
|
159391
|
+
//
|
|
159392
|
+
// {
|
|
159393
|
+
// "id": "a201cb3c-5830-57ac-ad2c-f6a588dd55eb", // Unique ID of deposit
|
|
159394
|
+
// "amount": "9.9", // Amount credited to your account
|
|
159395
|
+
// "asset": "USDT", // Deposit currency
|
|
159396
|
+
// "merchantId": "16214228-5c0c-5abc-be6a-c90259b21d4e", // Internal ID (not for use)
|
|
159397
|
+
// "paymentCode": "TRX", // Blockchain name
|
|
159398
|
+
// "status": "Processed", // Transactions status
|
|
159399
|
+
// "type": "Deposit", // Transaction type
|
|
159400
|
+
// "reason": [], // Reason for manual transaction processing
|
|
159401
|
+
// "address": "TNeBQz8RyGGiAYAR7r8G6QGxtTWDkpH4dV", // Deposit address
|
|
159402
|
+
// "memo": "", // Deposit memo
|
|
159403
|
+
// "txId": "8a0b0c5a2ac5679879b71b2fa63b0a5c39f90bc8ff6c41e708906b398ac3d4ef", // Deposit transaction hash
|
|
159404
|
+
// "fee": "0.1", // Deposit fee
|
|
159405
|
+
// "processedAmount": "10", // Amount of deposit
|
|
159406
|
+
// "createdAt": "2023-06-13T12:55:01.256Z", // Deposit receipt date
|
|
159407
|
+
// "updatedAt": "2023-06-13T12:55:01.696Z" // Deposit credit date
|
|
159408
|
+
// }
|
|
159409
|
+
//
|
|
159410
|
+
const datetime = this.safeString(transaction, 'createdAt');
|
|
159411
|
+
const currencyId = this.safeString(transaction, 'asset');
|
|
159412
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
159413
|
+
const networkId = this.safeString(transaction, 'paymentCode');
|
|
159414
|
+
const type = this.safeStringLower(transaction, 'type');
|
|
159415
|
+
const address = this.safeString(transaction, 'address');
|
|
159416
|
+
const isDeposit = (type === 'deposit');
|
|
159417
|
+
return {
|
|
159418
|
+
'info': transaction,
|
|
159419
|
+
'id': this.safeString(transaction, 'id'),
|
|
159420
|
+
'txid': this.safeString(transaction, 'txId'),
|
|
159421
|
+
'currency': code,
|
|
159422
|
+
'timestamp': this.parse8601(datetime),
|
|
159423
|
+
'datetime': datetime,
|
|
159424
|
+
'network': this.networkIdToCode(networkId),
|
|
159425
|
+
'addressFrom': undefined,
|
|
159426
|
+
'address': address,
|
|
159427
|
+
'addressTo': address,
|
|
159428
|
+
'amount': this.safeNumber(transaction, 'amount'),
|
|
159429
|
+
'type': !isDeposit ? 'withdrawal' : type,
|
|
159430
|
+
'status': this.parseTransactionStatus(this.safeString(transaction, 'status')),
|
|
159431
|
+
'updated': this.parse8601(this.safeString(transaction, 'updatedAt')),
|
|
159432
|
+
'tagFrom': undefined,
|
|
159433
|
+
'tag': undefined,
|
|
159434
|
+
'tagTo': undefined,
|
|
159435
|
+
'comment': this.safeString(transaction, 'memo'),
|
|
159436
|
+
'fee': {
|
|
159437
|
+
'cost': this.safeString(transaction, 'fee'),
|
|
159438
|
+
'currency': code,
|
|
159439
|
+
},
|
|
159440
|
+
};
|
|
158209
159441
|
}
|
|
158210
159442
|
nonce() {
|
|
158211
159443
|
return this.milliseconds();
|
|
@@ -158230,11 +159462,12 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
158230
159462
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
158231
159463
|
let url = undefined;
|
|
158232
159464
|
if (Array.isArray(api)) {
|
|
159465
|
+
const isGet = method === 'GET';
|
|
158233
159466
|
const [version, access] = api;
|
|
158234
159467
|
if (version === 'v3') {
|
|
158235
159468
|
url = this.urls['api'][version] + '/' + version + '/' + this.implodeParams(path, params);
|
|
158236
159469
|
if (access === 'public') {
|
|
158237
|
-
if (
|
|
159470
|
+
if (isGet) {
|
|
158238
159471
|
if (Object.keys(params).length) {
|
|
158239
159472
|
url += '?' + this.urlencode(params);
|
|
158240
159473
|
}
|
|
@@ -158249,35 +159482,39 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
158249
159482
|
}
|
|
158250
159483
|
}
|
|
158251
159484
|
else if (version === 'v4') {
|
|
158252
|
-
const
|
|
158253
|
-
|
|
158254
|
-
|
|
158255
|
-
if (
|
|
158256
|
-
|
|
158257
|
-
|
|
158258
|
-
|
|
159485
|
+
const extractedParams = this.extractParams(path);
|
|
159486
|
+
let urlPath = '/' + version + '/' + this.implodeParams(path, params);
|
|
159487
|
+
params = this.omit(params, extractedParams);
|
|
159488
|
+
if (isGet) {
|
|
159489
|
+
const paramsList = Object.keys(params);
|
|
159490
|
+
const numParams = paramsList.length;
|
|
159491
|
+
if (numParams > 0) {
|
|
159492
|
+
urlPath += '?' + this.urlencode(params);
|
|
158259
159493
|
}
|
|
158260
|
-
urlPath = '/' + version + '/' + splitPath[0] + '/' + access + '/' + this.implodeParams(pathTail, params);
|
|
158261
|
-
}
|
|
158262
|
-
else {
|
|
158263
|
-
urlPath = '/' + version + '/' + access + '/' + this.implodeParams(path, params);
|
|
158264
159494
|
}
|
|
158265
|
-
url = this.urls['api'][version] + urlPath;
|
|
158266
159495
|
if (access === 'private') {
|
|
158267
|
-
const nonce = this.nonce();
|
|
158268
|
-
|
|
159496
|
+
const nonce = this.nonce().toString();
|
|
159497
|
+
let auth = urlPath + nonce;
|
|
159498
|
+
if (isGet) {
|
|
159499
|
+
auth = auth + this.json({});
|
|
159500
|
+
}
|
|
159501
|
+
else {
|
|
159502
|
+
auth = auth + this.json(params);
|
|
159503
|
+
body = params;
|
|
159504
|
+
}
|
|
158269
159505
|
headers = {
|
|
158270
|
-
'
|
|
159506
|
+
'Content-Type': 'application/json',
|
|
158271
159507
|
'accept': 'application/json',
|
|
158272
159508
|
'nonce': nonce,
|
|
158273
159509
|
'public-key': this.apiKey,
|
|
158274
|
-
'signature': this.hmac(this.encode(auth), this.encode(this.secret),
|
|
159510
|
+
'signature': this.hmac(this.encode(auth), this.encode(this.secret), _static_dependencies_noble_hashes_sha512_js__WEBPACK_IMPORTED_MODULE_4__/* .sha384 */ .iC, 'hex'),
|
|
158275
159511
|
};
|
|
158276
159512
|
const account = this.safeString(this.options, 'account');
|
|
158277
159513
|
if (account === 'pro') {
|
|
158278
159514
|
headers['account'] = 'pro';
|
|
158279
159515
|
}
|
|
158280
159516
|
}
|
|
159517
|
+
url = this.urls['api'][version] + urlPath;
|
|
158281
159518
|
}
|
|
158282
159519
|
}
|
|
158283
159520
|
else {
|
|
@@ -158300,7 +159537,7 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
158300
159537
|
'tonce': nonce,
|
|
158301
159538
|
}, params));
|
|
158302
159539
|
const auth = method + '|' + request + '|' + queryInner;
|
|
158303
|
-
const signed = this.hmac(this.encode(auth), this.encode(this.secret),
|
|
159540
|
+
const signed = this.hmac(this.encode(auth), this.encode(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_5__/* .sha256 */ .J);
|
|
158304
159541
|
const suffix = query + '&signature=' + signed;
|
|
158305
159542
|
if (method === 'GET') {
|
|
158306
159543
|
url += '?' + suffix;
|
|
@@ -158311,18 +159548,37 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
158311
159548
|
}
|
|
158312
159549
|
}
|
|
158313
159550
|
}
|
|
159551
|
+
if (body !== undefined) {
|
|
159552
|
+
body = JSON.stringify(body);
|
|
159553
|
+
}
|
|
158314
159554
|
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
158315
159555
|
}
|
|
158316
159556
|
handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
158317
|
-
|
|
159557
|
+
//
|
|
159558
|
+
// {
|
|
159559
|
+
// "errors": [
|
|
159560
|
+
// {
|
|
159561
|
+
// "extensions": {
|
|
159562
|
+
// "code": "IP_NOT_IN_WHITE_LIST"
|
|
159563
|
+
// },
|
|
159564
|
+
// "code": "IP_NOT_IN_WHITE_LIST"
|
|
159565
|
+
// }
|
|
159566
|
+
// ]
|
|
159567
|
+
// }
|
|
159568
|
+
//
|
|
159569
|
+
const errors = this.safeValue(response, 'errors');
|
|
159570
|
+
if ((response === undefined) && (errors === undefined)) {
|
|
158318
159571
|
return undefined;
|
|
158319
159572
|
}
|
|
158320
|
-
if (code === 400) {
|
|
158321
|
-
|
|
159573
|
+
if ((errors !== undefined) || (code === 400)) {
|
|
159574
|
+
let error = this.safeValue(errors, 0);
|
|
159575
|
+
if (error === undefined) {
|
|
159576
|
+
error = this.safeValue(response, 'error');
|
|
159577
|
+
}
|
|
158322
159578
|
const errorCode = this.safeString(error, 'code');
|
|
158323
159579
|
const feedback = this.id + ' ' + this.json(response);
|
|
158324
159580
|
this.throwExactlyMatchedException(this.exceptions, errorCode, feedback);
|
|
158325
|
-
|
|
159581
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(feedback);
|
|
158326
159582
|
}
|
|
158327
159583
|
return undefined;
|
|
158328
159584
|
}
|
|
@@ -158363,8 +159619,8 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
158363
159619
|
'CORS': undefined,
|
|
158364
159620
|
'spot': true,
|
|
158365
159621
|
'margin': false,
|
|
158366
|
-
'swap':
|
|
158367
|
-
'future':
|
|
159622
|
+
'swap': false,
|
|
159623
|
+
'future': false,
|
|
158368
159624
|
'option': false,
|
|
158369
159625
|
'cancelAllOrders': true,
|
|
158370
159626
|
'cancelOrder': true,
|
|
@@ -204744,6 +206000,9 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
204744
206000
|
/**
|
|
204745
206001
|
* @method
|
|
204746
206002
|
* @name bitget#watchOrders
|
|
206003
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#order-channel
|
|
206004
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#order-channel
|
|
206005
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#plan-order-channel
|
|
204747
206006
|
* @description watches information on multiple orders made by the user
|
|
204748
206007
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
204749
206008
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
@@ -204754,7 +206013,9 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
204754
206013
|
await this.loadMarkets();
|
|
204755
206014
|
let market = undefined;
|
|
204756
206015
|
let marketId = undefined;
|
|
204757
|
-
|
|
206016
|
+
const isStop = this.safeValue(params, 'stop', false);
|
|
206017
|
+
params = this.omit(params, 'stop');
|
|
206018
|
+
let messageHash = (isStop) ? 'triggerOrder' : 'order';
|
|
204758
206019
|
let subscriptionHash = 'order:trades';
|
|
204759
206020
|
if (symbol !== undefined) {
|
|
204760
206021
|
market = this.market(symbol);
|
|
@@ -204762,8 +206023,6 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
204762
206023
|
marketId = market['id'];
|
|
204763
206024
|
messageHash = messageHash + ':' + symbol;
|
|
204764
206025
|
}
|
|
204765
|
-
const isStop = this.safeValue(params, 'stop', false);
|
|
204766
|
-
params = this.omit(params, 'stop');
|
|
204767
206026
|
let type = undefined;
|
|
204768
206027
|
[type, params] = this.handleMarketTypeAndParams('watchOrders', market, params);
|
|
204769
206028
|
if ((type === 'spot') && (symbol === undefined)) {
|
|
@@ -204786,6 +206045,9 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
204786
206045
|
instType = 'SUMCBL';
|
|
204787
206046
|
}
|
|
204788
206047
|
}
|
|
206048
|
+
if (isStop) {
|
|
206049
|
+
subscriptionHash = subscriptionHash + ':stop'; // we don't want to re-use the same subscription hash for stop orders
|
|
206050
|
+
}
|
|
204789
206051
|
const instId = (type === 'spot') ? marketId : 'default'; // different from other streams here the 'rest' id is required for spot markets, contract markets require default here
|
|
204790
206052
|
const channel = isStop ? 'ordersAlgo' : 'orders';
|
|
204791
206053
|
const args = {
|
|
@@ -204827,7 +206089,42 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
204827
206089
|
// ]
|
|
204828
206090
|
// }
|
|
204829
206091
|
//
|
|
206092
|
+
// {
|
|
206093
|
+
// action: 'snapshot',
|
|
206094
|
+
// arg: { instType: 'umcbl', channel: 'ordersAlgo', instId: 'default' },
|
|
206095
|
+
// data: [
|
|
206096
|
+
// {
|
|
206097
|
+
// actualPx: '55.000000000',
|
|
206098
|
+
// actualSz: '0.000000000',
|
|
206099
|
+
// cOid: '1104372235724890112',
|
|
206100
|
+
// cTime: '1699028779917',
|
|
206101
|
+
// eps: 'web',
|
|
206102
|
+
// hM: 'double_hold',
|
|
206103
|
+
// id: '1104372235724890113',
|
|
206104
|
+
// instId: 'BTCUSDT_UMCBL',
|
|
206105
|
+
// key: '1104372235724890113',
|
|
206106
|
+
// ordPx: '55.000000000',
|
|
206107
|
+
// ordType: 'limit',
|
|
206108
|
+
// planType: 'pl',
|
|
206109
|
+
// posSide: 'long',
|
|
206110
|
+
// side: 'buy',
|
|
206111
|
+
// state: 'not_trigger',
|
|
206112
|
+
// sz: '3.557000000',
|
|
206113
|
+
// tS: 'open_long',
|
|
206114
|
+
// tgtCcy: 'USDT',
|
|
206115
|
+
// triggerPx: '55.000000000',
|
|
206116
|
+
// triggerPxType: 'last',
|
|
206117
|
+
// triggerTime: '1699028779917',
|
|
206118
|
+
// uTime: '1699028779917',
|
|
206119
|
+
// userId: '3704614084',
|
|
206120
|
+
// version: 1104372235586478100
|
|
206121
|
+
// }
|
|
206122
|
+
// ],
|
|
206123
|
+
// ts: 1699028780327
|
|
206124
|
+
// }
|
|
206125
|
+
//
|
|
204830
206126
|
const arg = this.safeValue(message, 'arg', {});
|
|
206127
|
+
const channel = this.safeString(arg, 'channel');
|
|
204831
206128
|
const instType = this.safeString(arg, 'instType');
|
|
204832
206129
|
const sandboxMode = this.safeValue(this.options, 'sandboxMode', false);
|
|
204833
206130
|
const isContractUpdate = (!sandboxMode) ? (instType === 'umcbl') : (instType === 'sumcbl');
|
|
@@ -204835,8 +206132,10 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
204835
206132
|
if (this.orders === undefined) {
|
|
204836
206133
|
const limit = this.safeInteger(this.options, 'ordersLimit', 1000);
|
|
204837
206134
|
this.orders = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCacheBySymbolById */ .hl(limit);
|
|
206135
|
+
this.triggerOrders = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCacheBySymbolById */ .hl(limit);
|
|
204838
206136
|
}
|
|
204839
|
-
const stored = this.orders;
|
|
206137
|
+
const stored = (channel === 'ordersAlgo') ? this.triggerOrders : this.orders;
|
|
206138
|
+
const messageHash = (channel === 'ordersAlgo') ? 'triggerOrder' : 'order';
|
|
204840
206139
|
const marketSymbols = {};
|
|
204841
206140
|
for (let i = 0; i < data.length; i++) {
|
|
204842
206141
|
const order = data[i];
|
|
@@ -204853,10 +206152,10 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
204853
206152
|
const keys = Object.keys(marketSymbols);
|
|
204854
206153
|
for (let i = 0; i < keys.length; i++) {
|
|
204855
206154
|
const symbol = keys[i];
|
|
204856
|
-
const
|
|
204857
|
-
client.resolve(stored,
|
|
206155
|
+
const innerMessageHash = messageHash + ':' + symbol;
|
|
206156
|
+
client.resolve(stored, innerMessageHash);
|
|
204858
206157
|
}
|
|
204859
|
-
client.resolve(stored,
|
|
206158
|
+
client.resolve(stored, messageHash);
|
|
204860
206159
|
}
|
|
204861
206160
|
parseWsOrder(order, market = undefined) {
|
|
204862
206161
|
//
|
|
@@ -264891,18 +266190,27 @@ class wazirx extends _abstract_wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
264891
266190
|
'has': {
|
|
264892
266191
|
'CORS': false,
|
|
264893
266192
|
'spot': true,
|
|
264894
|
-
'margin':
|
|
266193
|
+
'margin': false,
|
|
264895
266194
|
'swap': false,
|
|
264896
266195
|
'future': false,
|
|
264897
266196
|
'option': false,
|
|
266197
|
+
'addMargin': false,
|
|
266198
|
+
'borrowMargin': false,
|
|
264898
266199
|
'cancelAllOrders': true,
|
|
264899
266200
|
'cancelOrder': true,
|
|
264900
266201
|
'createOrder': true,
|
|
266202
|
+
'createReduceOnlyOrder': false,
|
|
264901
266203
|
'createStopLimitOrder': true,
|
|
264902
266204
|
'createStopMarketOrder': true,
|
|
264903
266205
|
'createStopOrder': true,
|
|
264904
266206
|
'fetchBalance': true,
|
|
264905
266207
|
'fetchBidsAsks': false,
|
|
266208
|
+
'fetchBorrowInterest': false,
|
|
266209
|
+
'fetchBorrowRate': false,
|
|
266210
|
+
'fetchBorrowRateHistories': false,
|
|
266211
|
+
'fetchBorrowRateHistory': false,
|
|
266212
|
+
'fetchBorrowRates': false,
|
|
266213
|
+
'fetchBorrowRatesPerSymbol': false,
|
|
264906
266214
|
'fetchClosedOrders': false,
|
|
264907
266215
|
'fetchCurrencies': false,
|
|
264908
266216
|
'fetchDepositAddress': false,
|
|
@@ -264914,7 +266222,11 @@ class wazirx extends _abstract_wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
264914
266222
|
'fetchFundingRateHistory': false,
|
|
264915
266223
|
'fetchFundingRates': false,
|
|
264916
266224
|
'fetchIndexOHLCV': false,
|
|
266225
|
+
'fetchIsolatedPositions': false,
|
|
266226
|
+
'fetchLeverage': false,
|
|
266227
|
+
'fetchLeverageTiers': false,
|
|
264917
266228
|
'fetchMarginMode': false,
|
|
266229
|
+
'fetchMarketLeverageTiers': false,
|
|
264918
266230
|
'fetchMarkets': true,
|
|
264919
266231
|
'fetchMarkOHLCV': false,
|
|
264920
266232
|
'fetchMyTrades': false,
|
|
@@ -264924,7 +266236,10 @@ class wazirx extends _abstract_wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
264924
266236
|
'fetchOrder': false,
|
|
264925
266237
|
'fetchOrderBook': true,
|
|
264926
266238
|
'fetchOrders': true,
|
|
266239
|
+
'fetchPosition': false,
|
|
264927
266240
|
'fetchPositionMode': false,
|
|
266241
|
+
'fetchPositions': false,
|
|
266242
|
+
'fetchPositionsRisk': false,
|
|
264928
266243
|
'fetchPremiumIndexOHLCV': false,
|
|
264929
266244
|
'fetchStatus': true,
|
|
264930
266245
|
'fetchTicker': true,
|
|
@@ -264937,6 +266252,12 @@ class wazirx extends _abstract_wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
264937
266252
|
'fetchTransactions': false,
|
|
264938
266253
|
'fetchTransfers': false,
|
|
264939
266254
|
'fetchWithdrawals': false,
|
|
266255
|
+
'reduceMargin': false,
|
|
266256
|
+
'repayMargin': false,
|
|
266257
|
+
'setLeverage': false,
|
|
266258
|
+
'setMargin': false,
|
|
266259
|
+
'setMarginMode': false,
|
|
266260
|
+
'setPositionMode': false,
|
|
264940
266261
|
'transfer': false,
|
|
264941
266262
|
'withdraw': false,
|
|
264942
266263
|
},
|
|
@@ -280256,7 +281577,7 @@ SOFTWARE.
|
|
|
280256
281577
|
|
|
280257
281578
|
//-----------------------------------------------------------------------------
|
|
280258
281579
|
// this is updated by vss.js when building
|
|
280259
|
-
const version = '4.1.
|
|
281580
|
+
const version = '4.1.38';
|
|
280260
281581
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
|
|
280261
281582
|
//-----------------------------------------------------------------------------
|
|
280262
281583
|
|