ccxt 4.2.70 → 4.2.71
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/build.sh +1 -1
- package/dist/ccxt.browser.js +785 -180
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +3 -1
- package/dist/cjs/src/bitget.js +14 -6
- package/dist/cjs/src/coinbase.js +108 -89
- package/dist/cjs/src/digifinex.js +2 -1
- package/dist/cjs/src/hyperliquid.js +1 -1
- package/dist/cjs/src/kraken.js +1 -0
- package/dist/cjs/src/mexc.js +9 -0
- package/dist/cjs/src/pro/hyperliquid.js +556 -0
- package/js/ccxt.d.ts +4 -1
- package/js/ccxt.js +3 -1
- package/js/src/abstract/coinbase.d.ts +2 -0
- package/js/src/base/types.d.ts +48 -48
- package/js/src/bitget.js +14 -6
- package/js/src/coinbase.d.ts +1 -1
- package/js/src/coinbase.js +108 -89
- package/js/src/digifinex.js +2 -1
- package/js/src/hyperliquid.js +1 -1
- package/js/src/kraken.js +1 -0
- package/js/src/mexc.js +9 -0
- package/js/src/pro/hyperliquid.d.ts +23 -0
- package/js/src/pro/hyperliquid.js +557 -0
- package/package.json +1 -1
- package/skip-tests.json +33 -58
package/dist/ccxt.browser.js
CHANGED
|
@@ -51217,11 +51217,13 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
51217
51217
|
* @description fetch all open positions
|
|
51218
51218
|
* @see https://www.bitget.com/api-doc/contract/position/get-all-position
|
|
51219
51219
|
* @see https://www.bitget.com/api-doc/contract/position/Get-History-Position
|
|
51220
|
-
* @param {string[]
|
|
51220
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
51221
51221
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
51222
51222
|
* @param {string} [params.marginCoin] the settle currency of the positions, needs to match the productType
|
|
51223
51223
|
* @param {string} [params.productType] 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES'
|
|
51224
51224
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
51225
|
+
* @param {boolean} [params.useHistoryEndpoint] default false, when true will use the historic endpoint to fetch positions
|
|
51226
|
+
* @param {string} [params.method] either (default) 'privateMixGetV2MixPositionAllPosition' or 'privateMixGetV2MixPositionHistoryPosition'
|
|
51225
51227
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
51226
51228
|
*/
|
|
51227
51229
|
await this.loadMarkets();
|
|
@@ -51230,8 +51232,14 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
51230
51232
|
if (paginate) {
|
|
51231
51233
|
return await this.fetchPaginatedCallCursor('fetchPositions', undefined, undefined, undefined, params, 'endId', 'idLessThan');
|
|
51232
51234
|
}
|
|
51233
|
-
|
|
51234
|
-
const
|
|
51235
|
+
let method = undefined;
|
|
51236
|
+
const useHistoryEndpoint = this.safeBool(params, 'useHistoryEndpoint', false);
|
|
51237
|
+
if (useHistoryEndpoint) {
|
|
51238
|
+
method = 'privateMixGetV2MixPositionHistoryPosition';
|
|
51239
|
+
}
|
|
51240
|
+
else {
|
|
51241
|
+
[method, params] = this.handleOptionAndParams(params, 'fetchPositions', 'method', 'privateMixGetV2MixPositionAllPosition');
|
|
51242
|
+
}
|
|
51235
51243
|
let market = undefined;
|
|
51236
51244
|
if (symbols !== undefined) {
|
|
51237
51245
|
const first = this.safeString(symbols, 0);
|
|
@@ -51347,11 +51355,11 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
51347
51355
|
//
|
|
51348
51356
|
let position = [];
|
|
51349
51357
|
if (!isHistory) {
|
|
51350
|
-
position = this.
|
|
51358
|
+
position = this.safeList(response, 'data', []);
|
|
51351
51359
|
}
|
|
51352
51360
|
else {
|
|
51353
|
-
const data = this.
|
|
51354
|
-
position = this.
|
|
51361
|
+
const data = this.safeDict(response, 'data', {});
|
|
51362
|
+
position = this.safeList(data, 'list', []);
|
|
51355
51363
|
}
|
|
51356
51364
|
const result = [];
|
|
51357
51365
|
for (let i = 0; i < position.length; i++) {
|
|
@@ -93276,6 +93284,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
93276
93284
|
'brokerage/intx/portfolio/{portfolio_uuid}': 1,
|
|
93277
93285
|
'brokerage/intx/positions/{portfolio_uuid}': 1,
|
|
93278
93286
|
'brokerage/intx/positions/{portfolio_uuid}/{symbol}': 1,
|
|
93287
|
+
'brokerage/payment_methods': 1,
|
|
93288
|
+
'brokerage/payment_methods/{payment_method_id}': 1,
|
|
93279
93289
|
},
|
|
93280
93290
|
'post': {
|
|
93281
93291
|
'brokerage/orders': 1,
|
|
@@ -93428,7 +93438,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
93428
93438
|
// }
|
|
93429
93439
|
// }
|
|
93430
93440
|
//
|
|
93431
|
-
response = this.
|
|
93441
|
+
response = this.safeDict(response, 'data', {});
|
|
93432
93442
|
}
|
|
93433
93443
|
else {
|
|
93434
93444
|
response = await this.v3PublicGetBrokerageTime(params);
|
|
@@ -93520,7 +93530,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
93520
93530
|
const accounts = this.safeList(response, 'data', []);
|
|
93521
93531
|
const length = accounts.length;
|
|
93522
93532
|
const lastIndex = length - 1;
|
|
93523
|
-
const last = this.
|
|
93533
|
+
const last = this.safeDict(accounts, lastIndex);
|
|
93524
93534
|
if ((cursor !== undefined) && (cursor !== '')) {
|
|
93525
93535
|
last['next_starting_after'] = cursor;
|
|
93526
93536
|
accounts[lastIndex] = last;
|
|
@@ -93571,7 +93581,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
93571
93581
|
const accounts = this.safeList(response, 'accounts', []);
|
|
93572
93582
|
const length = accounts.length;
|
|
93573
93583
|
const lastIndex = length - 1;
|
|
93574
|
-
const last = this.
|
|
93584
|
+
const last = this.safeDict(accounts, lastIndex);
|
|
93575
93585
|
const cursor = this.safeString(response, 'cursor');
|
|
93576
93586
|
if ((cursor !== undefined) && (cursor !== '')) {
|
|
93577
93587
|
last['cursor'] = cursor;
|
|
@@ -93635,9 +93645,9 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
93635
93645
|
// }
|
|
93636
93646
|
// }
|
|
93637
93647
|
//
|
|
93638
|
-
const active = this.
|
|
93648
|
+
const active = this.safeBool(account, 'active');
|
|
93639
93649
|
const currencyIdV3 = this.safeString(account, 'currency');
|
|
93640
|
-
const currency = this.
|
|
93650
|
+
const currency = this.safeDict(account, 'currency', {});
|
|
93641
93651
|
const currencyId = this.safeString(currency, 'code', currencyIdV3);
|
|
93642
93652
|
const typeV3 = this.safeString(account, 'name');
|
|
93643
93653
|
const typeV2 = this.safeString(account, 'type');
|
|
@@ -93714,7 +93724,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
93714
93724
|
// }
|
|
93715
93725
|
// }
|
|
93716
93726
|
//
|
|
93717
|
-
const data = this.
|
|
93727
|
+
const data = this.safeDict(response, 'data', {});
|
|
93718
93728
|
const tag = this.safeString(data, 'destination_tag');
|
|
93719
93729
|
const address = this.safeString(data, 'address');
|
|
93720
93730
|
return {
|
|
@@ -93928,24 +93938,24 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
93928
93938
|
let amountAndCurrencyObject = undefined;
|
|
93929
93939
|
let feeObject = undefined;
|
|
93930
93940
|
if (transactionType === 'send') {
|
|
93931
|
-
const network = this.
|
|
93932
|
-
amountAndCurrencyObject = this.
|
|
93933
|
-
feeObject = this.
|
|
93941
|
+
const network = this.safeDict(transaction, 'network', {});
|
|
93942
|
+
amountAndCurrencyObject = this.safeDict(network, 'transaction_amount', {});
|
|
93943
|
+
feeObject = this.safeDict(network, 'transaction_fee', {});
|
|
93934
93944
|
}
|
|
93935
93945
|
else {
|
|
93936
|
-
amountAndCurrencyObject = this.
|
|
93937
|
-
feeObject = this.
|
|
93946
|
+
amountAndCurrencyObject = this.safeDict(transaction, 'subtotal', {});
|
|
93947
|
+
feeObject = this.safeDict(transaction, 'fee', {});
|
|
93938
93948
|
}
|
|
93939
93949
|
let status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
|
|
93940
93950
|
if (status === undefined) {
|
|
93941
|
-
const committed = this.
|
|
93951
|
+
const committed = this.safeBool(transaction, 'committed');
|
|
93942
93952
|
status = committed ? 'ok' : 'pending';
|
|
93943
93953
|
}
|
|
93944
93954
|
const id = this.safeString(transaction, 'id');
|
|
93945
93955
|
const currencyId = this.safeString(amountAndCurrencyObject, 'currency');
|
|
93946
93956
|
const feeCurrencyId = this.safeString(feeObject, 'currency');
|
|
93947
|
-
const datetime = this.
|
|
93948
|
-
const toObject = this.
|
|
93957
|
+
const datetime = this.safeString(transaction, 'created_at');
|
|
93958
|
+
const toObject = this.safeDict(transaction, 'to', {});
|
|
93949
93959
|
const toAddress = this.safeString(toObject, 'address');
|
|
93950
93960
|
return {
|
|
93951
93961
|
'info': transaction,
|
|
@@ -93964,7 +93974,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
93964
93974
|
'amount': this.safeNumber(amountAndCurrencyObject, 'amount'),
|
|
93965
93975
|
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
93966
93976
|
'status': status,
|
|
93967
|
-
'updated': this.parse8601(this.
|
|
93977
|
+
'updated': this.parse8601(this.safeString(transaction, 'updated_at')),
|
|
93968
93978
|
'fee': {
|
|
93969
93979
|
'cost': this.safeNumber(feeObject, 'amount'),
|
|
93970
93980
|
'currency': this.safeCurrencyCode(feeCurrencyId),
|
|
@@ -94034,10 +94044,10 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94034
94044
|
// }
|
|
94035
94045
|
//
|
|
94036
94046
|
let symbol = undefined;
|
|
94037
|
-
const totalObject = this.
|
|
94038
|
-
const amountObject = this.
|
|
94039
|
-
const subtotalObject = this.
|
|
94040
|
-
const feeObject = this.
|
|
94047
|
+
const totalObject = this.safeDict(trade, 'total', {});
|
|
94048
|
+
const amountObject = this.safeDict(trade, 'amount', {});
|
|
94049
|
+
const subtotalObject = this.safeDict(trade, 'subtotal', {});
|
|
94050
|
+
const feeObject = this.safeDict(trade, 'fee', {});
|
|
94041
94051
|
const marketId = this.safeString(trade, 'product_id');
|
|
94042
94052
|
market = this.safeMarket(marketId, market, '-');
|
|
94043
94053
|
if (market !== undefined) {
|
|
@@ -94052,7 +94062,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94052
94062
|
symbol = base + '/' + quote;
|
|
94053
94063
|
}
|
|
94054
94064
|
}
|
|
94055
|
-
const sizeInQuote = this.
|
|
94065
|
+
const sizeInQuote = this.safeBool(trade, 'size_in_quote');
|
|
94056
94066
|
const v3Price = this.safeString(trade, 'price');
|
|
94057
94067
|
let v3Cost = undefined;
|
|
94058
94068
|
let v3Amount = this.safeString(trade, 'size');
|
|
@@ -94121,11 +94131,11 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94121
94131
|
}
|
|
94122
94132
|
async fetchMarketsV2(params = {}) {
|
|
94123
94133
|
const response = await this.fetchCurrenciesFromCache(params);
|
|
94124
|
-
const currencies = this.
|
|
94125
|
-
const exchangeRates = this.
|
|
94126
|
-
const data = this.
|
|
94134
|
+
const currencies = this.safeDict(response, 'currencies', {});
|
|
94135
|
+
const exchangeRates = this.safeDict(response, 'exchangeRates', {});
|
|
94136
|
+
const data = this.safeList(currencies, 'data', []);
|
|
94127
94137
|
const dataById = this.indexBy(data, 'id');
|
|
94128
|
-
const rates = this.
|
|
94138
|
+
const rates = this.safeDict(this.safeDict(exchangeRates, 'data', {}), 'rates', {});
|
|
94129
94139
|
const baseIds = Object.keys(rates);
|
|
94130
94140
|
const result = [];
|
|
94131
94141
|
for (let i = 0; i < baseIds.length; i++) {
|
|
@@ -94247,8 +94257,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94247
94257
|
// "coinbase_pro_fees": 0
|
|
94248
94258
|
// }
|
|
94249
94259
|
//
|
|
94250
|
-
const feeTier = this.
|
|
94251
|
-
const data = this.
|
|
94260
|
+
const feeTier = this.safeDict(fees, 'fee_tier', {});
|
|
94261
|
+
const data = this.safeList(response, 'products', []);
|
|
94252
94262
|
const result = [];
|
|
94253
94263
|
for (let i = 0; i < data.length; i++) {
|
|
94254
94264
|
const market = data[i];
|
|
@@ -94258,8 +94268,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94258
94268
|
const base = this.safeCurrencyCode(baseId);
|
|
94259
94269
|
const quote = this.safeCurrencyCode(quoteId);
|
|
94260
94270
|
const marketType = this.safeStringLower(market, 'product_type');
|
|
94261
|
-
const tradingDisabled = this.
|
|
94262
|
-
const stablePairs = this.
|
|
94271
|
+
const tradingDisabled = this.safeBool(market, 'trading_disabled');
|
|
94272
|
+
const stablePairs = this.safeList(this.options, 'stablePairs', []);
|
|
94263
94273
|
result.push({
|
|
94264
94274
|
'id': id,
|
|
94265
94275
|
'symbol': base + '/' + quote,
|
|
@@ -94315,7 +94325,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94315
94325
|
return result;
|
|
94316
94326
|
}
|
|
94317
94327
|
async fetchCurrenciesFromCache(params = {}) {
|
|
94318
|
-
const options = this.
|
|
94328
|
+
const options = this.safeDict(this.options, 'fetchCurrencies', {});
|
|
94319
94329
|
const timestamp = this.safeInteger(options, 'timestamp');
|
|
94320
94330
|
const expires = this.safeInteger(options, 'expires', 1000);
|
|
94321
94331
|
const now = this.milliseconds();
|
|
@@ -94371,7 +94381,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94371
94381
|
* @returns {object} an associative dictionary of currencies
|
|
94372
94382
|
*/
|
|
94373
94383
|
const response = await this.fetchCurrenciesFromCache(params);
|
|
94374
|
-
const currencies = this.
|
|
94384
|
+
const currencies = this.safeDict(response, 'currencies', {});
|
|
94375
94385
|
//
|
|
94376
94386
|
// fiat
|
|
94377
94387
|
//
|
|
@@ -94488,8 +94498,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94488
94498
|
// }
|
|
94489
94499
|
// }
|
|
94490
94500
|
//
|
|
94491
|
-
const data = this.
|
|
94492
|
-
const rates = this.
|
|
94501
|
+
const data = this.safeDict(response, 'data', {});
|
|
94502
|
+
const rates = this.safeDict(data, 'rates', {});
|
|
94493
94503
|
const quoteId = this.safeString(data, 'currency');
|
|
94494
94504
|
const result = {};
|
|
94495
94505
|
const baseIds = Object.keys(rates);
|
|
@@ -94548,7 +94558,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94548
94558
|
// "num_products": 549
|
|
94549
94559
|
// }
|
|
94550
94560
|
//
|
|
94551
|
-
const data = this.
|
|
94561
|
+
const data = this.safeList(response, 'products', []);
|
|
94552
94562
|
const result = {};
|
|
94553
94563
|
for (let i = 0; i < data.length; i++) {
|
|
94554
94564
|
const entry = data[i];
|
|
@@ -94596,9 +94606,9 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94596
94606
|
//
|
|
94597
94607
|
// {"data":{"base":"BTC","currency":"USD","amount":"48691.23"}}
|
|
94598
94608
|
//
|
|
94599
|
-
const spotData = this.
|
|
94600
|
-
const askData = this.
|
|
94601
|
-
const bidData = this.
|
|
94609
|
+
const spotData = this.safeDict(spot, 'data', {});
|
|
94610
|
+
const askData = this.safeDict(ask, 'data', {});
|
|
94611
|
+
const bidData = this.safeDict(bid, 'data', {});
|
|
94602
94612
|
const bidAskLast = {
|
|
94603
94613
|
'bid': this.safeNumber(bidData, 'amount'),
|
|
94604
94614
|
'ask': this.safeNumber(askData, 'amount'),
|
|
@@ -94632,7 +94642,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94632
94642
|
// "best_ask": "28208.62"
|
|
94633
94643
|
// }
|
|
94634
94644
|
//
|
|
94635
|
-
const data = this.
|
|
94645
|
+
const data = this.safeList(response, 'trades', []);
|
|
94636
94646
|
const ticker = this.parseTicker(data[0], market);
|
|
94637
94647
|
ticker['bid'] = this.safeNumber(response, 'best_bid');
|
|
94638
94648
|
ticker['ask'] = this.safeNumber(response, 'best_ask');
|
|
@@ -94724,8 +94734,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94724
94734
|
let bidVolume = undefined;
|
|
94725
94735
|
let askVolume = undefined;
|
|
94726
94736
|
if (('bids' in ticker)) {
|
|
94727
|
-
const bids = this.
|
|
94728
|
-
const asks = this.
|
|
94737
|
+
const bids = this.safeList(ticker, 'bids', []);
|
|
94738
|
+
const asks = this.safeList(ticker, 'asks', []);
|
|
94729
94739
|
bid = this.safeNumber(bids[0], 'price');
|
|
94730
94740
|
bidVolume = this.safeNumber(bids[0], 'size');
|
|
94731
94741
|
ask = this.safeNumber(asks[0], 'price');
|
|
@@ -94758,21 +94768,21 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94758
94768
|
}, market);
|
|
94759
94769
|
}
|
|
94760
94770
|
parseCustomBalance(response, params = {}) {
|
|
94761
|
-
const balances = this.
|
|
94762
|
-
const accounts = this.
|
|
94763
|
-
const v3Accounts = this.
|
|
94771
|
+
const balances = this.safeList2(response, 'data', 'accounts', []);
|
|
94772
|
+
const accounts = this.safeList(params, 'type', this.options['accounts']);
|
|
94773
|
+
const v3Accounts = this.safeList(params, 'type', this.options['v3Accounts']);
|
|
94764
94774
|
const result = { 'info': response };
|
|
94765
94775
|
for (let b = 0; b < balances.length; b++) {
|
|
94766
94776
|
const balance = balances[b];
|
|
94767
94777
|
const type = this.safeString(balance, 'type');
|
|
94768
94778
|
if (this.inArray(type, accounts)) {
|
|
94769
|
-
const value = this.
|
|
94779
|
+
const value = this.safeDict(balance, 'balance');
|
|
94770
94780
|
if (value !== undefined) {
|
|
94771
94781
|
const currencyId = this.safeString(value, 'currency');
|
|
94772
94782
|
const code = this.safeCurrencyCode(currencyId);
|
|
94773
94783
|
const total = this.safeString(value, 'amount');
|
|
94774
94784
|
const free = total;
|
|
94775
|
-
let account = this.
|
|
94785
|
+
let account = this.safeDict(result, code);
|
|
94776
94786
|
if (account === undefined) {
|
|
94777
94787
|
account = this.account();
|
|
94778
94788
|
account['free'] = free;
|
|
@@ -94786,15 +94796,15 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
94786
94796
|
}
|
|
94787
94797
|
}
|
|
94788
94798
|
else if (this.inArray(type, v3Accounts)) {
|
|
94789
|
-
const available = this.
|
|
94790
|
-
const hold = this.
|
|
94799
|
+
const available = this.safeDict(balance, 'available_balance');
|
|
94800
|
+
const hold = this.safeDict(balance, 'hold');
|
|
94791
94801
|
if (available !== undefined && hold !== undefined) {
|
|
94792
94802
|
const currencyId = this.safeString(available, 'currency');
|
|
94793
94803
|
const code = this.safeCurrencyCode(currencyId);
|
|
94794
94804
|
const used = this.safeString(hold, 'value');
|
|
94795
94805
|
const free = this.safeString(available, 'value');
|
|
94796
94806
|
const total = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(used, free);
|
|
94797
|
-
let account = this.
|
|
94807
|
+
let account = this.safeDict(result, code);
|
|
94798
94808
|
if (account === undefined) {
|
|
94799
94809
|
account = this.account();
|
|
94800
94810
|
account['free'] = free;
|
|
@@ -95202,7 +95212,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95202
95212
|
// }
|
|
95203
95213
|
// }
|
|
95204
95214
|
//
|
|
95205
|
-
const amountInfo = this.
|
|
95215
|
+
const amountInfo = this.safeDict(item, 'amount', {});
|
|
95206
95216
|
let amount = this.safeString(amountInfo, 'amount');
|
|
95207
95217
|
let direction = undefined;
|
|
95208
95218
|
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(amount, '0')) {
|
|
@@ -95224,9 +95234,9 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95224
95234
|
// let txid = undefined;
|
|
95225
95235
|
//
|
|
95226
95236
|
let fee = undefined;
|
|
95227
|
-
const networkInfo = this.
|
|
95237
|
+
const networkInfo = this.safeDict(item, 'network', {});
|
|
95228
95238
|
// txid = network['hash']; // txid does not belong to the unified ledger structure
|
|
95229
|
-
const feeInfo = this.
|
|
95239
|
+
const feeInfo = this.safeDict(networkInfo, 'transaction_fee');
|
|
95230
95240
|
if (feeInfo !== undefined) {
|
|
95231
95241
|
const feeCurrencyId = this.safeString(feeInfo, 'currency');
|
|
95232
95242
|
const feeCurrencyCode = this.safeCurrencyCode(feeCurrencyId, currency);
|
|
@@ -95236,7 +95246,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95236
95246
|
'currency': feeCurrencyCode,
|
|
95237
95247
|
};
|
|
95238
95248
|
}
|
|
95239
|
-
const timestamp = this.parse8601(this.
|
|
95249
|
+
const timestamp = this.parse8601(this.safeString(item, 'created_at'));
|
|
95240
95250
|
const id = this.safeString(item, 'id');
|
|
95241
95251
|
const type = this.parseLedgerEntryType(this.safeString(item, 'type'));
|
|
95242
95252
|
const status = this.parseLedgerEntryStatus(this.safeString(item, 'status'));
|
|
@@ -95368,7 +95378,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95368
95378
|
const isStopLoss = stopLossPrice !== undefined;
|
|
95369
95379
|
const isTakeProfit = takeProfitPrice !== undefined;
|
|
95370
95380
|
const timeInForce = this.safeString(params, 'timeInForce');
|
|
95371
|
-
const postOnly = (timeInForce === 'PO') ? true : this.
|
|
95381
|
+
const postOnly = (timeInForce === 'PO') ? true : this.safeBool2(params, 'postOnly', 'post_only', false);
|
|
95372
95382
|
const endTime = this.safeString(params, 'end_time');
|
|
95373
95383
|
let stopDirection = this.safeString(params, 'stop_direction');
|
|
95374
95384
|
if (type === 'limit') {
|
|
@@ -95438,6 +95448,14 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95438
95448
|
},
|
|
95439
95449
|
};
|
|
95440
95450
|
}
|
|
95451
|
+
else if (timeInForce === 'IOC') {
|
|
95452
|
+
request['order_configuration'] = {
|
|
95453
|
+
'sor_limit_ioc': {
|
|
95454
|
+
'base_size': this.amountToPrecision(symbol, amount),
|
|
95455
|
+
'limit_price': this.priceToPrecision(symbol, price),
|
|
95456
|
+
},
|
|
95457
|
+
};
|
|
95458
|
+
}
|
|
95441
95459
|
else {
|
|
95442
95460
|
request['order_configuration'] = {
|
|
95443
95461
|
'limit_limit_gtc': {
|
|
@@ -95491,7 +95509,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95491
95509
|
}
|
|
95492
95510
|
}
|
|
95493
95511
|
params = this.omit(params, ['timeInForce', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'stopPrice', 'stop_price', 'stopDirection', 'stop_direction', 'clientOrderId', 'postOnly', 'post_only', 'end_time']);
|
|
95494
|
-
const preview = this.
|
|
95512
|
+
const preview = this.safeBool2(params, 'preview', 'test', false);
|
|
95495
95513
|
let response = undefined;
|
|
95496
95514
|
if (preview) {
|
|
95497
95515
|
params = this.omit(params, ['preview', 'test']);
|
|
@@ -95538,9 +95556,9 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95538
95556
|
// }
|
|
95539
95557
|
// }
|
|
95540
95558
|
//
|
|
95541
|
-
const success = this.
|
|
95559
|
+
const success = this.safeBool(response, 'success');
|
|
95542
95560
|
if (success !== true) {
|
|
95543
|
-
const errorResponse = this.
|
|
95561
|
+
const errorResponse = this.safeDict(response, 'error_response');
|
|
95544
95562
|
const errorTitle = this.safeString(errorResponse, 'error');
|
|
95545
95563
|
const errorMessage = this.safeString(errorResponse, 'message');
|
|
95546
95564
|
if (errorResponse !== undefined) {
|
|
@@ -95549,7 +95567,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95549
95567
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(errorMessage);
|
|
95550
95568
|
}
|
|
95551
95569
|
}
|
|
95552
|
-
const data = this.
|
|
95570
|
+
const data = this.safeDict(response, 'success_response', {});
|
|
95553
95571
|
return this.parseOrder(data, market);
|
|
95554
95572
|
}
|
|
95555
95573
|
parseOrder(order, market = undefined) {
|
|
@@ -95620,29 +95638,39 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95620
95638
|
if (symbol !== undefined) {
|
|
95621
95639
|
market = this.market(symbol);
|
|
95622
95640
|
}
|
|
95623
|
-
const orderConfiguration = this.
|
|
95624
|
-
const limitGTC = this.
|
|
95625
|
-
const limitGTD = this.
|
|
95626
|
-
const
|
|
95627
|
-
const
|
|
95628
|
-
const
|
|
95629
|
-
const
|
|
95641
|
+
const orderConfiguration = this.safeDict(order, 'order_configuration', {});
|
|
95642
|
+
const limitGTC = this.safeDict(orderConfiguration, 'limit_limit_gtc');
|
|
95643
|
+
const limitGTD = this.safeDict(orderConfiguration, 'limit_limit_gtd');
|
|
95644
|
+
const limitIOC = this.safeDict(orderConfiguration, 'sor_limit_ioc');
|
|
95645
|
+
const stopLimitGTC = this.safeDict(orderConfiguration, 'stop_limit_stop_limit_gtc');
|
|
95646
|
+
const stopLimitGTD = this.safeDict(orderConfiguration, 'stop_limit_stop_limit_gtd');
|
|
95647
|
+
const marketIOC = this.safeDict(orderConfiguration, 'market_market_ioc');
|
|
95648
|
+
const isLimit = ((limitGTC !== undefined) || (limitGTD !== undefined) || (limitIOC !== undefined));
|
|
95630
95649
|
const isStop = ((stopLimitGTC !== undefined) || (stopLimitGTD !== undefined));
|
|
95631
95650
|
let price = undefined;
|
|
95632
95651
|
let amount = undefined;
|
|
95633
95652
|
let postOnly = undefined;
|
|
95634
95653
|
let triggerPrice = undefined;
|
|
95635
95654
|
if (isLimit) {
|
|
95636
|
-
|
|
95655
|
+
let target = undefined;
|
|
95656
|
+
if (limitGTC !== undefined) {
|
|
95657
|
+
target = limitGTC;
|
|
95658
|
+
}
|
|
95659
|
+
else if (limitGTD !== undefined) {
|
|
95660
|
+
target = limitGTD;
|
|
95661
|
+
}
|
|
95662
|
+
else {
|
|
95663
|
+
target = limitIOC;
|
|
95664
|
+
}
|
|
95637
95665
|
price = this.safeString(target, 'limit_price');
|
|
95638
95666
|
amount = this.safeString(target, 'base_size');
|
|
95639
|
-
postOnly = this.
|
|
95667
|
+
postOnly = this.safeBool(target, 'post_only');
|
|
95640
95668
|
}
|
|
95641
95669
|
else if (isStop) {
|
|
95642
95670
|
const stopTarget = (stopLimitGTC !== undefined) ? stopLimitGTC : stopLimitGTD;
|
|
95643
95671
|
price = this.safeString(stopTarget, 'limit_price');
|
|
95644
95672
|
amount = this.safeString(stopTarget, 'base_size');
|
|
95645
|
-
postOnly = this.
|
|
95673
|
+
postOnly = this.safeBool(stopTarget, 'post_only');
|
|
95646
95674
|
triggerPrice = this.safeString(stopTarget, 'stop_price');
|
|
95647
95675
|
}
|
|
95648
95676
|
else {
|
|
@@ -95728,7 +95756,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95728
95756
|
*/
|
|
95729
95757
|
await this.loadMarkets();
|
|
95730
95758
|
const orders = await this.cancelOrders([id], symbol, params);
|
|
95731
|
-
return this.
|
|
95759
|
+
return this.safeDict(orders, 0, {});
|
|
95732
95760
|
}
|
|
95733
95761
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
95734
95762
|
/**
|
|
@@ -95761,9 +95789,9 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95761
95789
|
// ]
|
|
95762
95790
|
// }
|
|
95763
95791
|
//
|
|
95764
|
-
const orders = this.
|
|
95792
|
+
const orders = this.safeList(response, 'results', []);
|
|
95765
95793
|
for (let i = 0; i < orders.length; i++) {
|
|
95766
|
-
const success = this.
|
|
95794
|
+
const success = this.safeBool(orders[i], 'success');
|
|
95767
95795
|
if (success !== true) {
|
|
95768
95796
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' cancelOrders() has failed, check your arguments and parameters');
|
|
95769
95797
|
}
|
|
@@ -95797,7 +95825,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95797
95825
|
if (price !== undefined) {
|
|
95798
95826
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
95799
95827
|
}
|
|
95800
|
-
const preview = this.
|
|
95828
|
+
const preview = this.safeBool2(params, 'preview', 'test', false);
|
|
95801
95829
|
let response = undefined;
|
|
95802
95830
|
if (preview) {
|
|
95803
95831
|
params = this.omit(params, ['preview', 'test']);
|
|
@@ -95876,7 +95904,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95876
95904
|
// }
|
|
95877
95905
|
// }
|
|
95878
95906
|
//
|
|
95879
|
-
const order = this.
|
|
95907
|
+
const order = this.safeDict(response, 'order', {});
|
|
95880
95908
|
return this.parseOrder(order, market);
|
|
95881
95909
|
}
|
|
95882
95910
|
async fetchOrders(symbol = undefined, since = undefined, limit = 100, params = {}) {
|
|
@@ -95913,7 +95941,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95913
95941
|
if (since !== undefined) {
|
|
95914
95942
|
request['start_date'] = this.iso8601(since);
|
|
95915
95943
|
}
|
|
95916
|
-
const until = this.
|
|
95944
|
+
const until = this.safeIntegerN(params, ['until', 'till']);
|
|
95917
95945
|
if (until !== undefined) {
|
|
95918
95946
|
params = this.omit(params, ['until', 'till']);
|
|
95919
95947
|
request['end_date'] = this.iso8601(until);
|
|
@@ -95961,8 +95989,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95961
95989
|
// "cursor": ""
|
|
95962
95990
|
// }
|
|
95963
95991
|
//
|
|
95964
|
-
const orders = this.
|
|
95965
|
-
const first = this.
|
|
95992
|
+
const orders = this.safeList(response, 'orders', []);
|
|
95993
|
+
const first = this.safeDict(orders, 0);
|
|
95966
95994
|
const cursor = this.safeString(response, 'cursor');
|
|
95967
95995
|
if ((cursor !== undefined) && (cursor !== '')) {
|
|
95968
95996
|
first['cursor'] = cursor;
|
|
@@ -95989,7 +96017,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
95989
96017
|
if (since !== undefined) {
|
|
95990
96018
|
request['start_date'] = this.iso8601(since);
|
|
95991
96019
|
}
|
|
95992
|
-
const until = this.
|
|
96020
|
+
const until = this.safeIntegerN(params, ['until', 'till']);
|
|
95993
96021
|
if (until !== undefined) {
|
|
95994
96022
|
params = this.omit(params, ['until', 'till']);
|
|
95995
96023
|
request['end_date'] = this.iso8601(until);
|
|
@@ -96037,8 +96065,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
96037
96065
|
// "cursor": ""
|
|
96038
96066
|
// }
|
|
96039
96067
|
//
|
|
96040
|
-
const orders = this.
|
|
96041
|
-
const first = this.
|
|
96068
|
+
const orders = this.safeList(response, 'orders', []);
|
|
96069
|
+
const first = this.safeDict(orders, 0);
|
|
96042
96070
|
const cursor = this.safeString(response, 'cursor');
|
|
96043
96071
|
if ((cursor !== undefined) && (cursor !== '')) {
|
|
96044
96072
|
first['cursor'] = cursor;
|
|
@@ -96132,7 +96160,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
96132
96160
|
'product_id': market['id'],
|
|
96133
96161
|
'granularity': this.safeString(this.timeframes, timeframe, timeframe),
|
|
96134
96162
|
};
|
|
96135
|
-
const until = this.
|
|
96163
|
+
const until = this.safeIntegerN(params, ['until', 'till', 'end']);
|
|
96136
96164
|
params = this.omit(params, ['until', 'till']);
|
|
96137
96165
|
const duration = this.parseTimeframe(timeframe);
|
|
96138
96166
|
const requestedDuration = limit * duration;
|
|
@@ -96166,7 +96194,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
96166
96194
|
// ]
|
|
96167
96195
|
// }
|
|
96168
96196
|
//
|
|
96169
|
-
const candles = this.
|
|
96197
|
+
const candles = this.safeList(response, 'candles', []);
|
|
96170
96198
|
return this.parseOHLCVs(candles, market, timeframe, since, limit);
|
|
96171
96199
|
}
|
|
96172
96200
|
parseOHLCV(ohlcv, market = undefined) {
|
|
@@ -96239,7 +96267,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
96239
96267
|
// ]
|
|
96240
96268
|
// }
|
|
96241
96269
|
//
|
|
96242
|
-
const trades = this.
|
|
96270
|
+
const trades = this.safeList(response, 'trades', []);
|
|
96243
96271
|
return this.parseTrades(trades, market, since, limit);
|
|
96244
96272
|
}
|
|
96245
96273
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -96276,7 +96304,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
96276
96304
|
if (since !== undefined) {
|
|
96277
96305
|
request['start_sequence_timestamp'] = this.iso8601(since);
|
|
96278
96306
|
}
|
|
96279
|
-
const until = this.
|
|
96307
|
+
const until = this.safeIntegerN(params, ['until', 'till']);
|
|
96280
96308
|
if (until !== undefined) {
|
|
96281
96309
|
params = this.omit(params, ['until', 'till']);
|
|
96282
96310
|
request['end_sequence_timestamp'] = this.iso8601(until);
|
|
@@ -96305,8 +96333,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
96305
96333
|
// "cursor": ""
|
|
96306
96334
|
// }
|
|
96307
96335
|
//
|
|
96308
|
-
const trades = this.
|
|
96309
|
-
const first = this.
|
|
96336
|
+
const trades = this.safeList(response, 'fills', []);
|
|
96337
|
+
const first = this.safeDict(trades, 0);
|
|
96310
96338
|
const cursor = this.safeString(response, 'cursor');
|
|
96311
96339
|
if ((cursor !== undefined) && (cursor !== '')) {
|
|
96312
96340
|
first['cursor'] = cursor;
|
|
@@ -96398,7 +96426,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
96398
96426
|
// ]
|
|
96399
96427
|
// }
|
|
96400
96428
|
//
|
|
96401
|
-
const tickers = this.
|
|
96429
|
+
const tickers = this.safeList(response, 'pricebooks', []);
|
|
96402
96430
|
return this.parseTickers(tickers, symbols);
|
|
96403
96431
|
}
|
|
96404
96432
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
@@ -96492,7 +96520,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
96492
96520
|
// }
|
|
96493
96521
|
// }
|
|
96494
96522
|
//
|
|
96495
|
-
const data = this.
|
|
96523
|
+
const data = this.safeDict(response, 'data', {});
|
|
96496
96524
|
return this.parseTransaction(data, currency);
|
|
96497
96525
|
}
|
|
96498
96526
|
async fetchDepositAddressesByNetwork(code, params = {}) {
|
|
@@ -96765,7 +96793,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
96765
96793
|
// }
|
|
96766
96794
|
// }
|
|
96767
96795
|
//
|
|
96768
|
-
const data = this.
|
|
96796
|
+
const data = this.safeDict(response, 'data', {});
|
|
96769
96797
|
return this.parseTransaction(data);
|
|
96770
96798
|
}
|
|
96771
96799
|
sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
@@ -96865,7 +96893,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
96865
96893
|
this.throwBroadlyMatchedException(this.exceptions['broad'], errorMessage, feedback);
|
|
96866
96894
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(feedback);
|
|
96867
96895
|
}
|
|
96868
|
-
const errors = this.
|
|
96896
|
+
const errors = this.safeList(response, 'errors');
|
|
96869
96897
|
if (errors !== undefined) {
|
|
96870
96898
|
if (Array.isArray(errors)) {
|
|
96871
96899
|
const numErrors = errors.length;
|
|
@@ -96881,8 +96909,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
96881
96909
|
}
|
|
96882
96910
|
}
|
|
96883
96911
|
const advancedTrade = this.options['advanced'];
|
|
96884
|
-
|
|
96885
|
-
if ((data === undefined) && (!advancedTrade)) {
|
|
96912
|
+
if (!('data' in response) && (!advancedTrade)) {
|
|
96886
96913
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' failed due to a malformed response ' + this.json(response));
|
|
96887
96914
|
}
|
|
96888
96915
|
return undefined;
|
|
@@ -127783,7 +127810,8 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
127783
127810
|
else if (limit !== undefined) {
|
|
127784
127811
|
const endTime = this.seconds();
|
|
127785
127812
|
const duration = this.parseTimeframe(timeframe);
|
|
127786
|
-
|
|
127813
|
+
const auxLimit = limit; // in c# -limit is mutating the arg
|
|
127814
|
+
request['start_time'] = this.sum(endTime, -auxLimit * duration);
|
|
127787
127815
|
}
|
|
127788
127816
|
response = await this.publicSpotGetKline(this.extend(request, params));
|
|
127789
127817
|
}
|
|
@@ -159290,7 +159318,7 @@ class hyperliquid extends _abstract_hyperliquid_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
159290
159318
|
'version': 'v1',
|
|
159291
159319
|
'rateLimit': 50,
|
|
159292
159320
|
'certified': false,
|
|
159293
|
-
'pro':
|
|
159321
|
+
'pro': true,
|
|
159294
159322
|
'has': {
|
|
159295
159323
|
'CORS': undefined,
|
|
159296
159324
|
'spot': false,
|
|
@@ -166606,6 +166634,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
166606
166634
|
const lastTrade = trades[length - 1];
|
|
166607
166635
|
const lastTradeId = this.safeString(result, 'last');
|
|
166608
166636
|
lastTrade.push(lastTradeId);
|
|
166637
|
+
trades[length - 1] = lastTrade;
|
|
166609
166638
|
return this.parseTrades(trades, market, since, limit);
|
|
166610
166639
|
}
|
|
166611
166640
|
parseBalance(response) {
|
|
@@ -188069,6 +188098,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
188069
188098
|
'createMarketSellOrderWithCost': false,
|
|
188070
188099
|
'createOrder': true,
|
|
188071
188100
|
'createOrders': true,
|
|
188101
|
+
'createPostOnlyOrder': true,
|
|
188072
188102
|
'createReduceOnlyOrder': true,
|
|
188073
188103
|
'deposit': undefined,
|
|
188074
188104
|
'editOrder': undefined,
|
|
@@ -190235,6 +190265,14 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
190235
190265
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
190236
190266
|
* @param {string} [params.marginMode] only 'isolated' is supported for spot-margin trading
|
|
190237
190267
|
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
190268
|
+
* @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
|
|
190269
|
+
* @param {bool} [params.reduceOnly] *contract only* indicates if this order is to reduce the size of a position
|
|
190270
|
+
*
|
|
190271
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
190272
|
+
* @param {int} [params.leverage] *contract only* leverage is necessary on isolated margin
|
|
190273
|
+
* @param {long} [params.positionId] *contract only* it is recommended to fill in this parameter when closing a position
|
|
190274
|
+
* @param {string} [params.externalOid] *contract only* external order ID
|
|
190275
|
+
* @param {int} [params.positionMode] *contract only* 1:hedge, 2:one-way, default: the user's current config
|
|
190238
190276
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
190239
190277
|
*/
|
|
190240
190278
|
await this.loadMarkets();
|
|
@@ -255780,6 +255818,570 @@ class huobijp extends _huobijp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
255780
255818
|
}
|
|
255781
255819
|
|
|
255782
255820
|
|
|
255821
|
+
/***/ }),
|
|
255822
|
+
|
|
255823
|
+
/***/ 8354:
|
|
255824
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
255825
|
+
|
|
255826
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
255827
|
+
/* harmony export */ Z: () => (/* binding */ hyperliquid)
|
|
255828
|
+
/* harmony export */ });
|
|
255829
|
+
/* harmony import */ var _hyperliquid_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5959);
|
|
255830
|
+
/* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
|
|
255831
|
+
/* harmony import */ var _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3020);
|
|
255832
|
+
// ---------------------------------------------------------------------------
|
|
255833
|
+
|
|
255834
|
+
|
|
255835
|
+
|
|
255836
|
+
// ---------------------------------------------------------------------------
|
|
255837
|
+
class hyperliquid extends _hyperliquid_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
255838
|
+
describe() {
|
|
255839
|
+
return this.deepExtend(super.describe(), {
|
|
255840
|
+
'has': {
|
|
255841
|
+
'ws': true,
|
|
255842
|
+
'watchBalance': false,
|
|
255843
|
+
'watchMyTrades': true,
|
|
255844
|
+
'watchOHLCV': true,
|
|
255845
|
+
'watchOrderBook': true,
|
|
255846
|
+
'watchOrders': true,
|
|
255847
|
+
'watchTicker': false,
|
|
255848
|
+
'watchTickers': false,
|
|
255849
|
+
'watchTrades': true,
|
|
255850
|
+
'watchPosition': false,
|
|
255851
|
+
},
|
|
255852
|
+
'urls': {
|
|
255853
|
+
'api': {
|
|
255854
|
+
'ws': {
|
|
255855
|
+
'public': 'wss://api.hyperliquid.xyz/ws',
|
|
255856
|
+
},
|
|
255857
|
+
},
|
|
255858
|
+
'test': {
|
|
255859
|
+
'ws': {
|
|
255860
|
+
'public': 'wss://api.hyperliquid-testnet.xyz/ws',
|
|
255861
|
+
},
|
|
255862
|
+
},
|
|
255863
|
+
},
|
|
255864
|
+
'options': {},
|
|
255865
|
+
'streaming': {
|
|
255866
|
+
'ping': this.ping,
|
|
255867
|
+
'keepAlive': 20000,
|
|
255868
|
+
},
|
|
255869
|
+
'exceptions': {
|
|
255870
|
+
'ws': {
|
|
255871
|
+
'exact': {},
|
|
255872
|
+
},
|
|
255873
|
+
},
|
|
255874
|
+
});
|
|
255875
|
+
}
|
|
255876
|
+
async watchOrderBook(symbol, limit = undefined, params = {}) {
|
|
255877
|
+
/**
|
|
255878
|
+
* @method
|
|
255879
|
+
* @name hyperliquid#watchOrderBook
|
|
255880
|
+
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
255881
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
255882
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
255883
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
255884
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
255885
|
+
*/
|
|
255886
|
+
await this.loadMarkets();
|
|
255887
|
+
const market = this.market(symbol);
|
|
255888
|
+
symbol = market['symbol'];
|
|
255889
|
+
const messageHash = 'orderbook:' + symbol;
|
|
255890
|
+
const url = this.urls['api']['ws']['public'];
|
|
255891
|
+
const request = {
|
|
255892
|
+
'method': 'subscribe',
|
|
255893
|
+
'subscription': {
|
|
255894
|
+
'type': 'l2Book',
|
|
255895
|
+
'coin': market['base'],
|
|
255896
|
+
},
|
|
255897
|
+
};
|
|
255898
|
+
const message = this.extend(request, params);
|
|
255899
|
+
const orderbook = await this.watch(url, messageHash, message, messageHash);
|
|
255900
|
+
return orderbook.limit();
|
|
255901
|
+
}
|
|
255902
|
+
handleOrderBook(client, message) {
|
|
255903
|
+
//
|
|
255904
|
+
// {
|
|
255905
|
+
// "channel": "l2Book",
|
|
255906
|
+
// "data": {
|
|
255907
|
+
// "coin": "BTC",
|
|
255908
|
+
// "time": 1710131872708,
|
|
255909
|
+
// "levels": [
|
|
255910
|
+
// [
|
|
255911
|
+
// {
|
|
255912
|
+
// "px": "68674.0",
|
|
255913
|
+
// "sz": "0.97139",
|
|
255914
|
+
// "n": 4
|
|
255915
|
+
// }
|
|
255916
|
+
// ],
|
|
255917
|
+
// [
|
|
255918
|
+
// {
|
|
255919
|
+
// "px": "68675.0",
|
|
255920
|
+
// "sz": "0.04396",
|
|
255921
|
+
// "n": 1
|
|
255922
|
+
// }
|
|
255923
|
+
// ]
|
|
255924
|
+
// ]
|
|
255925
|
+
// }
|
|
255926
|
+
// }
|
|
255927
|
+
//
|
|
255928
|
+
const entry = this.safeDict(message, 'data', {});
|
|
255929
|
+
const coin = this.safeString(entry, 'coin');
|
|
255930
|
+
const marketId = coin + '/USDC:USDC';
|
|
255931
|
+
const market = this.market(marketId);
|
|
255932
|
+
const symbol = market['symbol'];
|
|
255933
|
+
const rawData = this.safeList(entry, 'levels', []);
|
|
255934
|
+
const data = {
|
|
255935
|
+
'bids': this.safeList(rawData, 0, []),
|
|
255936
|
+
'asks': this.safeList(rawData, 1, []),
|
|
255937
|
+
};
|
|
255938
|
+
const timestamp = this.safeInteger(entry, 'time');
|
|
255939
|
+
const snapshot = this.parseOrderBook(data, symbol, timestamp, 'bids', 'asks', 'px', 'sz');
|
|
255940
|
+
if (!(symbol in this.orderbooks)) {
|
|
255941
|
+
const ob = this.orderBook(snapshot);
|
|
255942
|
+
this.orderbooks[symbol] = ob;
|
|
255943
|
+
}
|
|
255944
|
+
const orderbook = this.orderbooks[symbol];
|
|
255945
|
+
orderbook.reset(snapshot);
|
|
255946
|
+
const messageHash = 'orderbook:' + symbol;
|
|
255947
|
+
client.resolve(orderbook, messageHash);
|
|
255948
|
+
}
|
|
255949
|
+
async watchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
255950
|
+
/**
|
|
255951
|
+
* @method
|
|
255952
|
+
* @name hyperliquid#watchMyTrades
|
|
255953
|
+
* @description watches information on multiple trades made by the user
|
|
255954
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
255955
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
255956
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
255957
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
255958
|
+
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
255959
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
255960
|
+
*/
|
|
255961
|
+
let userAddress = undefined;
|
|
255962
|
+
[userAddress, params] = this.handlePublicAddress('watchMyTrades', params);
|
|
255963
|
+
await this.loadMarkets();
|
|
255964
|
+
let messageHash = 'myTrades';
|
|
255965
|
+
if (symbol !== undefined) {
|
|
255966
|
+
symbol = this.symbol(symbol);
|
|
255967
|
+
messageHash += ':' + symbol;
|
|
255968
|
+
}
|
|
255969
|
+
const url = this.urls['api']['ws']['public'];
|
|
255970
|
+
const request = {
|
|
255971
|
+
'method': 'subscribe',
|
|
255972
|
+
'subscription': {
|
|
255973
|
+
'type': 'userFills',
|
|
255974
|
+
'user': userAddress,
|
|
255975
|
+
},
|
|
255976
|
+
};
|
|
255977
|
+
const message = this.extend(request, params);
|
|
255978
|
+
const trades = await this.watch(url, messageHash, message, messageHash);
|
|
255979
|
+
if (this.newUpdates) {
|
|
255980
|
+
limit = trades.getLimit(symbol, limit);
|
|
255981
|
+
}
|
|
255982
|
+
return this.filterBySymbolSinceLimit(trades, symbol, since, limit, true);
|
|
255983
|
+
}
|
|
255984
|
+
handleMyTrades(client, message) {
|
|
255985
|
+
//
|
|
255986
|
+
// {
|
|
255987
|
+
// "channel": "userFills",
|
|
255988
|
+
// "data": {
|
|
255989
|
+
// "isSnapshot": true,
|
|
255990
|
+
// "user": "0x15f43d1f2dee81424afd891943262aa90f22cc2a",
|
|
255991
|
+
// "fills": [
|
|
255992
|
+
// {
|
|
255993
|
+
// "coin": "BTC",
|
|
255994
|
+
// "px": "72528.0",
|
|
255995
|
+
// "sz": "0.11693",
|
|
255996
|
+
// "side": "A",
|
|
255997
|
+
// "time": 1710208712815,
|
|
255998
|
+
// "startPosition": "0.11693",
|
|
255999
|
+
// "dir": "Close Long",
|
|
256000
|
+
// "closedPnl": "-0.81851",
|
|
256001
|
+
// "hash": "0xc5adaf35f8402750c218040b0a7bc301130051521273b6f398b3caad3e1f3f5f",
|
|
256002
|
+
// "oid": 7484888874,
|
|
256003
|
+
// "crossed": true,
|
|
256004
|
+
// "fee": "2.968244",
|
|
256005
|
+
// "liquidationMarkPx": null,
|
|
256006
|
+
// "tid": 567547935839686,
|
|
256007
|
+
// "cloid": null
|
|
256008
|
+
// }
|
|
256009
|
+
// ]
|
|
256010
|
+
// }
|
|
256011
|
+
// }
|
|
256012
|
+
//
|
|
256013
|
+
const entry = this.safeDict(message, 'data', {});
|
|
256014
|
+
if (this.myTrades === undefined) {
|
|
256015
|
+
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
256016
|
+
this.myTrades = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__/* .ArrayCacheBySymbolById */ .hl(limit);
|
|
256017
|
+
}
|
|
256018
|
+
const trades = this.myTrades;
|
|
256019
|
+
const symbols = {};
|
|
256020
|
+
const data = this.safeList(entry, 'fills', []);
|
|
256021
|
+
const dataLength = data.length;
|
|
256022
|
+
if (dataLength === 0) {
|
|
256023
|
+
return;
|
|
256024
|
+
}
|
|
256025
|
+
for (let i = 0; i < data.length; i++) {
|
|
256026
|
+
const rawTrade = data[i];
|
|
256027
|
+
const parsed = this.parseWsTrade(rawTrade);
|
|
256028
|
+
const symbol = parsed['symbol'];
|
|
256029
|
+
symbols[symbol] = true;
|
|
256030
|
+
trades.append(parsed);
|
|
256031
|
+
}
|
|
256032
|
+
const keys = Object.keys(symbols);
|
|
256033
|
+
for (let i = 0; i < keys.length; i++) {
|
|
256034
|
+
const currentMessageHash = 'myTrades:' + keys[i];
|
|
256035
|
+
client.resolve(trades, currentMessageHash);
|
|
256036
|
+
}
|
|
256037
|
+
// non-symbol specific
|
|
256038
|
+
const messageHash = 'myTrades';
|
|
256039
|
+
client.resolve(trades, messageHash);
|
|
256040
|
+
}
|
|
256041
|
+
async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
256042
|
+
/**
|
|
256043
|
+
* @method
|
|
256044
|
+
* @name hyperliquid#watchTrades
|
|
256045
|
+
* @description watches information on multiple trades made in a market
|
|
256046
|
+
* @param {string} symbol unified market symbol of the market trades were made in
|
|
256047
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
256048
|
+
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
256049
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
256050
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
256051
|
+
*/
|
|
256052
|
+
await this.loadMarkets();
|
|
256053
|
+
const market = this.market(symbol);
|
|
256054
|
+
symbol = market['symbol'];
|
|
256055
|
+
const messageHash = 'trade:' + symbol;
|
|
256056
|
+
const url = this.urls['api']['ws']['public'];
|
|
256057
|
+
const request = {
|
|
256058
|
+
'method': 'subscribe',
|
|
256059
|
+
'subscription': {
|
|
256060
|
+
'type': 'trades',
|
|
256061
|
+
'coin': market['base'],
|
|
256062
|
+
},
|
|
256063
|
+
};
|
|
256064
|
+
const message = this.extend(request, params);
|
|
256065
|
+
const trades = await this.watch(url, messageHash, message, messageHash);
|
|
256066
|
+
if (this.newUpdates) {
|
|
256067
|
+
limit = trades.getLimit(symbol, limit);
|
|
256068
|
+
}
|
|
256069
|
+
return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
|
|
256070
|
+
}
|
|
256071
|
+
handleTrades(client, message) {
|
|
256072
|
+
//
|
|
256073
|
+
// {
|
|
256074
|
+
// "channel": "trades",
|
|
256075
|
+
// "data": [
|
|
256076
|
+
// {
|
|
256077
|
+
// "coin": "BTC",
|
|
256078
|
+
// "side": "A",
|
|
256079
|
+
// "px": "68517.0",
|
|
256080
|
+
// "sz": "0.005",
|
|
256081
|
+
// "time": 1710125266669,
|
|
256082
|
+
// "hash": "0xc872699f116e012186620407fc08a802015e0097c5cce74710697f7272e6e959",
|
|
256083
|
+
// "tid": 981894269203506
|
|
256084
|
+
// }
|
|
256085
|
+
// ]
|
|
256086
|
+
// }
|
|
256087
|
+
//
|
|
256088
|
+
const entry = this.safeList(message, 'data', []);
|
|
256089
|
+
const first = this.safeDict(entry, 0, {});
|
|
256090
|
+
const coin = this.safeString(first, 'coin');
|
|
256091
|
+
const marketId = coin + '/USDC:USDC';
|
|
256092
|
+
const market = this.market(marketId);
|
|
256093
|
+
const symbol = market['symbol'];
|
|
256094
|
+
if (!(symbol in this.trades)) {
|
|
256095
|
+
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
256096
|
+
const stored = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__/* .ArrayCache */ .ZL(limit);
|
|
256097
|
+
this.trades[symbol] = stored;
|
|
256098
|
+
}
|
|
256099
|
+
const trades = this.trades[symbol];
|
|
256100
|
+
for (let i = 0; i < entry.length; i++) {
|
|
256101
|
+
const data = this.safeDict(entry, i);
|
|
256102
|
+
const trade = this.parseWsTrade(data);
|
|
256103
|
+
trades.append(trade);
|
|
256104
|
+
}
|
|
256105
|
+
const messageHash = 'trade:' + symbol;
|
|
256106
|
+
client.resolve(trades, messageHash);
|
|
256107
|
+
}
|
|
256108
|
+
parseWsTrade(trade, market = undefined) {
|
|
256109
|
+
//
|
|
256110
|
+
// fetchMyTrades
|
|
256111
|
+
//
|
|
256112
|
+
// {
|
|
256113
|
+
// "coin": "BTC",
|
|
256114
|
+
// "px": "72528.0",
|
|
256115
|
+
// "sz": "0.11693",
|
|
256116
|
+
// "side": "A",
|
|
256117
|
+
// "time": 1710208712815,
|
|
256118
|
+
// "startPosition": "0.11693",
|
|
256119
|
+
// "dir": "Close Long",
|
|
256120
|
+
// "closedPnl": "-0.81851",
|
|
256121
|
+
// "hash": "0xc5adaf35f8402750c218040b0a7bc301130051521273b6f398b3caad3e1f3f5f",
|
|
256122
|
+
// "oid": 7484888874,
|
|
256123
|
+
// "crossed": true,
|
|
256124
|
+
// "fee": "2.968244",
|
|
256125
|
+
// "liquidationMarkPx": null,
|
|
256126
|
+
// "tid": 567547935839686,
|
|
256127
|
+
// "cloid": null
|
|
256128
|
+
// }
|
|
256129
|
+
//
|
|
256130
|
+
// fetchTrades
|
|
256131
|
+
//
|
|
256132
|
+
// {
|
|
256133
|
+
// "coin": "BTC",
|
|
256134
|
+
// "side": "A",
|
|
256135
|
+
// "px": "68517.0",
|
|
256136
|
+
// "sz": "0.005",
|
|
256137
|
+
// "time": 1710125266669,
|
|
256138
|
+
// "hash": "0xc872699f116e012186620407fc08a802015e0097c5cce74710697f7272e6e959",
|
|
256139
|
+
// "tid": 981894269203506
|
|
256140
|
+
// }
|
|
256141
|
+
//
|
|
256142
|
+
const timestamp = this.safeInteger(trade, 'time');
|
|
256143
|
+
const price = this.safeString(trade, 'px');
|
|
256144
|
+
const amount = this.safeString(trade, 'sz');
|
|
256145
|
+
const coin = this.safeString(trade, 'coin');
|
|
256146
|
+
const marketId = coin + '/USDC:USDC';
|
|
256147
|
+
market = this.safeMarket(marketId, undefined);
|
|
256148
|
+
const symbol = market['symbol'];
|
|
256149
|
+
const id = this.safeString(trade, 'tid');
|
|
256150
|
+
let side = this.safeString(trade, 'side');
|
|
256151
|
+
if (side !== undefined) {
|
|
256152
|
+
side = (side === 'A') ? 'sell' : 'buy';
|
|
256153
|
+
}
|
|
256154
|
+
const fee = this.safeString(trade, 'fee');
|
|
256155
|
+
return this.safeTrade({
|
|
256156
|
+
'info': trade,
|
|
256157
|
+
'timestamp': timestamp,
|
|
256158
|
+
'datetime': this.iso8601(timestamp),
|
|
256159
|
+
'symbol': symbol,
|
|
256160
|
+
'id': id,
|
|
256161
|
+
'order': undefined,
|
|
256162
|
+
'type': undefined,
|
|
256163
|
+
'side': side,
|
|
256164
|
+
'takerOrMaker': undefined,
|
|
256165
|
+
'price': price,
|
|
256166
|
+
'amount': amount,
|
|
256167
|
+
'cost': undefined,
|
|
256168
|
+
'fee': { 'cost': fee, 'currency': 'USDC' },
|
|
256169
|
+
}, market);
|
|
256170
|
+
}
|
|
256171
|
+
async watchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
256172
|
+
/**
|
|
256173
|
+
* @method
|
|
256174
|
+
* @name hyperliquid#watchOHLCV
|
|
256175
|
+
* @description watches historical candlestick data containing the open, high, low, close price, and the volume of a market
|
|
256176
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
256177
|
+
* @param {string} timeframe the length of time each candle represents
|
|
256178
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
256179
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
256180
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
256181
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
256182
|
+
*/
|
|
256183
|
+
await this.loadMarkets();
|
|
256184
|
+
const market = this.market(symbol);
|
|
256185
|
+
symbol = market['symbol'];
|
|
256186
|
+
const url = this.urls['api']['ws']['public'];
|
|
256187
|
+
const request = {
|
|
256188
|
+
'method': 'subscribe',
|
|
256189
|
+
'subscription': {
|
|
256190
|
+
'type': 'candle',
|
|
256191
|
+
'coin': market['base'],
|
|
256192
|
+
'interval': timeframe,
|
|
256193
|
+
},
|
|
256194
|
+
};
|
|
256195
|
+
const messageHash = 'candles:' + timeframe + ':' + symbol;
|
|
256196
|
+
const message = this.extend(request, params);
|
|
256197
|
+
const ohlcv = await this.watch(url, messageHash, message, messageHash);
|
|
256198
|
+
if (this.newUpdates) {
|
|
256199
|
+
limit = ohlcv.getLimit(symbol, limit);
|
|
256200
|
+
}
|
|
256201
|
+
return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
|
|
256202
|
+
}
|
|
256203
|
+
handleOHLCV(client, message) {
|
|
256204
|
+
//
|
|
256205
|
+
// {
|
|
256206
|
+
// channel: 'candle',
|
|
256207
|
+
// data: {
|
|
256208
|
+
// t: 1710146280000,
|
|
256209
|
+
// T: 1710146339999,
|
|
256210
|
+
// s: 'BTC',
|
|
256211
|
+
// i: '1m',
|
|
256212
|
+
// o: '71400.0',
|
|
256213
|
+
// c: '71411.0',
|
|
256214
|
+
// h: '71422.0',
|
|
256215
|
+
// l: '71389.0',
|
|
256216
|
+
// v: '1.20407',
|
|
256217
|
+
// n: 20
|
|
256218
|
+
// }
|
|
256219
|
+
// }
|
|
256220
|
+
//
|
|
256221
|
+
const data = this.safeDict(message, 'data', {});
|
|
256222
|
+
const base = this.safeString(data, 's');
|
|
256223
|
+
const symbol = base + '/USDC:USDC';
|
|
256224
|
+
const timeframe = this.safeString(data, 'i');
|
|
256225
|
+
if (!(symbol in this.ohlcvs)) {
|
|
256226
|
+
this.ohlcvs[symbol] = {};
|
|
256227
|
+
}
|
|
256228
|
+
if (!(timeframe in this.ohlcvs[symbol])) {
|
|
256229
|
+
const limit = this.safeInteger(this.options, 'OHLCVLimit', 1000);
|
|
256230
|
+
const stored = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__/* .ArrayCacheByTimestamp */ .Py(limit);
|
|
256231
|
+
this.ohlcvs[symbol][timeframe] = stored;
|
|
256232
|
+
}
|
|
256233
|
+
const ohlcv = this.ohlcvs[symbol][timeframe];
|
|
256234
|
+
const parsed = this.parseOHLCV(data);
|
|
256235
|
+
ohlcv.append(parsed);
|
|
256236
|
+
const messageHash = 'candles:' + timeframe + ':' + symbol;
|
|
256237
|
+
client.resolve(ohlcv, messageHash);
|
|
256238
|
+
}
|
|
256239
|
+
async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
256240
|
+
/**
|
|
256241
|
+
* @method
|
|
256242
|
+
* @name hyperliquid#watchOrders
|
|
256243
|
+
* @description watches information on multiple orders made by the user
|
|
256244
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
256245
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
256246
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
256247
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
256248
|
+
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
256249
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
256250
|
+
*/
|
|
256251
|
+
await this.loadMarkets();
|
|
256252
|
+
let userAddress = undefined;
|
|
256253
|
+
[userAddress, params] = this.handlePublicAddress('watchOrders', params);
|
|
256254
|
+
let market = undefined;
|
|
256255
|
+
let messageHash = 'order';
|
|
256256
|
+
if (symbol !== undefined) {
|
|
256257
|
+
market = this.market(symbol);
|
|
256258
|
+
symbol = market['symbol'];
|
|
256259
|
+
messageHash = messageHash + ':' + symbol;
|
|
256260
|
+
}
|
|
256261
|
+
const url = this.urls['api']['ws']['public'];
|
|
256262
|
+
const request = {
|
|
256263
|
+
'method': 'subscribe',
|
|
256264
|
+
'subscription': {
|
|
256265
|
+
'type': 'orderUpdates',
|
|
256266
|
+
'user': userAddress,
|
|
256267
|
+
},
|
|
256268
|
+
};
|
|
256269
|
+
const message = this.extend(request, params);
|
|
256270
|
+
const orders = await this.watch(url, messageHash, message, messageHash);
|
|
256271
|
+
if (this.newUpdates) {
|
|
256272
|
+
limit = orders.getLimit(symbol, limit);
|
|
256273
|
+
}
|
|
256274
|
+
return this.filterBySymbolSinceLimit(orders, symbol, since, limit, true);
|
|
256275
|
+
}
|
|
256276
|
+
handleOrder(client, message) {
|
|
256277
|
+
//
|
|
256278
|
+
// {
|
|
256279
|
+
// channel: 'orderUpdates',
|
|
256280
|
+
// data: [
|
|
256281
|
+
// {
|
|
256282
|
+
// order: {
|
|
256283
|
+
// coin: 'BTC',
|
|
256284
|
+
// side: 'B',
|
|
256285
|
+
// limitPx: '30000.0',
|
|
256286
|
+
// sz: '0.001',
|
|
256287
|
+
// oid: 7456484275,
|
|
256288
|
+
// timestamp: 1710163596492,
|
|
256289
|
+
// origSz: '0.001'
|
|
256290
|
+
// },
|
|
256291
|
+
// status: 'open',
|
|
256292
|
+
// statusTimestamp: 1710163596492
|
|
256293
|
+
// }
|
|
256294
|
+
// ]
|
|
256295
|
+
// }
|
|
256296
|
+
//
|
|
256297
|
+
const data = this.safeList(message, 'data', []);
|
|
256298
|
+
if (this.orders === undefined) {
|
|
256299
|
+
const limit = this.safeInteger(this.options, 'ordersLimit', 1000);
|
|
256300
|
+
this.orders = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__/* .ArrayCacheBySymbolById */ .hl(limit);
|
|
256301
|
+
}
|
|
256302
|
+
const dataLength = data.length;
|
|
256303
|
+
if (dataLength === 0) {
|
|
256304
|
+
return;
|
|
256305
|
+
}
|
|
256306
|
+
const stored = this.orders;
|
|
256307
|
+
const messageHash = 'order';
|
|
256308
|
+
const marketSymbols = {};
|
|
256309
|
+
for (let i = 0; i < data.length; i++) {
|
|
256310
|
+
const rawOrder = data[i];
|
|
256311
|
+
const order = this.parseOrder(rawOrder);
|
|
256312
|
+
stored.append(order);
|
|
256313
|
+
const symbol = this.safeString(order, 'symbol');
|
|
256314
|
+
marketSymbols[symbol] = true;
|
|
256315
|
+
}
|
|
256316
|
+
const keys = Object.keys(marketSymbols);
|
|
256317
|
+
for (let i = 0; i < keys.length; i++) {
|
|
256318
|
+
const symbol = keys[i];
|
|
256319
|
+
const innerMessageHash = messageHash + ':' + symbol;
|
|
256320
|
+
client.resolve(stored, innerMessageHash);
|
|
256321
|
+
}
|
|
256322
|
+
client.resolve(stored, messageHash);
|
|
256323
|
+
}
|
|
256324
|
+
handleErrorMessage(client, message) {
|
|
256325
|
+
//
|
|
256326
|
+
// {
|
|
256327
|
+
// "channel": "error",
|
|
256328
|
+
// "data": "Error parsing JSON into valid websocket request: { \"type\": \"allMids\" }"
|
|
256329
|
+
// }
|
|
256330
|
+
//
|
|
256331
|
+
const channel = this.safeString(message, 'channel', '');
|
|
256332
|
+
const ret_msg = this.safeString(message, 'data', '');
|
|
256333
|
+
if (channel === 'error') {
|
|
256334
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' ' + ret_msg);
|
|
256335
|
+
}
|
|
256336
|
+
else {
|
|
256337
|
+
return false;
|
|
256338
|
+
}
|
|
256339
|
+
}
|
|
256340
|
+
handleMessage(client, message) {
|
|
256341
|
+
if (this.handleErrorMessage(client, message)) {
|
|
256342
|
+
return;
|
|
256343
|
+
}
|
|
256344
|
+
const topic = this.safeString(message, 'channel', '');
|
|
256345
|
+
const methods = {
|
|
256346
|
+
'pong': this.handlePong,
|
|
256347
|
+
'trades': this.handleTrades,
|
|
256348
|
+
'l2Book': this.handleOrderBook,
|
|
256349
|
+
'candle': this.handleOHLCV,
|
|
256350
|
+
'orderUpdates': this.handleOrder,
|
|
256351
|
+
'userFills': this.handleMyTrades,
|
|
256352
|
+
};
|
|
256353
|
+
const exacMethod = this.safeValue(methods, topic);
|
|
256354
|
+
if (exacMethod !== undefined) {
|
|
256355
|
+
exacMethod.call(this, client, message);
|
|
256356
|
+
return;
|
|
256357
|
+
}
|
|
256358
|
+
const keys = Object.keys(methods);
|
|
256359
|
+
for (let i = 0; i < keys.length; i++) {
|
|
256360
|
+
const key = keys[i];
|
|
256361
|
+
if (topic.indexOf(keys[i]) >= 0) {
|
|
256362
|
+
const method = methods[key];
|
|
256363
|
+
method.call(this, client, message);
|
|
256364
|
+
return;
|
|
256365
|
+
}
|
|
256366
|
+
}
|
|
256367
|
+
}
|
|
256368
|
+
ping(client) {
|
|
256369
|
+
return {
|
|
256370
|
+
'method': 'ping',
|
|
256371
|
+
};
|
|
256372
|
+
}
|
|
256373
|
+
handlePong(client, message) {
|
|
256374
|
+
//
|
|
256375
|
+
// {
|
|
256376
|
+
// "channel": "pong"
|
|
256377
|
+
// }
|
|
256378
|
+
//
|
|
256379
|
+
client.lastPong = this.safeInteger(message, 'pong');
|
|
256380
|
+
return message;
|
|
256381
|
+
}
|
|
256382
|
+
}
|
|
256383
|
+
|
|
256384
|
+
|
|
255783
256385
|
/***/ }),
|
|
255784
256386
|
|
|
255785
256387
|
/***/ 3484:
|
|
@@ -316935,39 +317537,39 @@ var __webpack_exports__ = {};
|
|
|
316935
317537
|
(() => {
|
|
316936
317538
|
__webpack_require__.r(__webpack_exports__);
|
|
316937
317539
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
316938
|
-
/* harmony export */ AccountNotEnabled: () => (/* reexport safe */
|
|
316939
|
-
/* harmony export */ AccountSuspended: () => (/* reexport safe */
|
|
316940
|
-
/* harmony export */ AddressPending: () => (/* reexport safe */
|
|
316941
|
-
/* harmony export */ ArgumentsRequired: () => (/* reexport safe */
|
|
316942
|
-
/* harmony export */ AuthenticationError: () => (/* reexport safe */
|
|
316943
|
-
/* harmony export */ BadRequest: () => (/* reexport safe */
|
|
316944
|
-
/* harmony export */ BadResponse: () => (/* reexport safe */
|
|
316945
|
-
/* harmony export */ BadSymbol: () => (/* reexport safe */
|
|
316946
|
-
/* harmony export */ BaseError: () => (/* reexport safe */
|
|
316947
|
-
/* harmony export */ CancelPending: () => (/* reexport safe */
|
|
316948
|
-
/* harmony export */ DDoSProtection: () => (/* reexport safe */
|
|
316949
|
-
/* harmony export */ DuplicateOrderId: () => (/* reexport safe */
|
|
317540
|
+
/* harmony export */ AccountNotEnabled: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.AccountNotEnabled),
|
|
317541
|
+
/* harmony export */ AccountSuspended: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.AccountSuspended),
|
|
317542
|
+
/* harmony export */ AddressPending: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.AddressPending),
|
|
317543
|
+
/* harmony export */ ArgumentsRequired: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.ArgumentsRequired),
|
|
317544
|
+
/* harmony export */ AuthenticationError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.AuthenticationError),
|
|
317545
|
+
/* harmony export */ BadRequest: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.BadRequest),
|
|
317546
|
+
/* harmony export */ BadResponse: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.BadResponse),
|
|
317547
|
+
/* harmony export */ BadSymbol: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.BadSymbol),
|
|
317548
|
+
/* harmony export */ BaseError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.BaseError),
|
|
317549
|
+
/* harmony export */ CancelPending: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.CancelPending),
|
|
317550
|
+
/* harmony export */ DDoSProtection: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.DDoSProtection),
|
|
317551
|
+
/* harmony export */ DuplicateOrderId: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.DuplicateOrderId),
|
|
316950
317552
|
/* harmony export */ Exchange: () => (/* reexport safe */ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__.e),
|
|
316951
|
-
/* harmony export */ ExchangeError: () => (/* reexport safe */
|
|
316952
|
-
/* harmony export */ ExchangeNotAvailable: () => (/* reexport safe */
|
|
316953
|
-
/* harmony export */ InsufficientFunds: () => (/* reexport safe */
|
|
316954
|
-
/* harmony export */ InvalidAddress: () => (/* reexport safe */
|
|
316955
|
-
/* harmony export */ InvalidNonce: () => (/* reexport safe */
|
|
316956
|
-
/* harmony export */ InvalidOrder: () => (/* reexport safe */
|
|
316957
|
-
/* harmony export */ MarginModeAlreadySet: () => (/* reexport safe */
|
|
316958
|
-
/* harmony export */ NetworkError: () => (/* reexport safe */
|
|
316959
|
-
/* harmony export */ NoChange: () => (/* reexport safe */
|
|
316960
|
-
/* harmony export */ NotSupported: () => (/* reexport safe */
|
|
316961
|
-
/* harmony export */ NullResponse: () => (/* reexport safe */
|
|
316962
|
-
/* harmony export */ OnMaintenance: () => (/* reexport safe */
|
|
316963
|
-
/* harmony export */ OrderImmediatelyFillable: () => (/* reexport safe */
|
|
316964
|
-
/* harmony export */ OrderNotCached: () => (/* reexport safe */
|
|
316965
|
-
/* harmony export */ OrderNotFillable: () => (/* reexport safe */
|
|
316966
|
-
/* harmony export */ OrderNotFound: () => (/* reexport safe */
|
|
316967
|
-
/* harmony export */ PermissionDenied: () => (/* reexport safe */
|
|
316968
|
-
/* harmony export */ Precise: () => (/* reexport safe */
|
|
316969
|
-
/* harmony export */ RateLimitExceeded: () => (/* reexport safe */
|
|
316970
|
-
/* harmony export */ RequestTimeout: () => (/* reexport safe */
|
|
317553
|
+
/* harmony export */ ExchangeError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.ExchangeError),
|
|
317554
|
+
/* harmony export */ ExchangeNotAvailable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.ExchangeNotAvailable),
|
|
317555
|
+
/* harmony export */ InsufficientFunds: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.InsufficientFunds),
|
|
317556
|
+
/* harmony export */ InvalidAddress: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.InvalidAddress),
|
|
317557
|
+
/* harmony export */ InvalidNonce: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.InvalidNonce),
|
|
317558
|
+
/* harmony export */ InvalidOrder: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.InvalidOrder),
|
|
317559
|
+
/* harmony export */ MarginModeAlreadySet: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.MarginModeAlreadySet),
|
|
317560
|
+
/* harmony export */ NetworkError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.NetworkError),
|
|
317561
|
+
/* harmony export */ NoChange: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.NoChange),
|
|
317562
|
+
/* harmony export */ NotSupported: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.NotSupported),
|
|
317563
|
+
/* harmony export */ NullResponse: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.NullResponse),
|
|
317564
|
+
/* harmony export */ OnMaintenance: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.OnMaintenance),
|
|
317565
|
+
/* harmony export */ OrderImmediatelyFillable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.OrderImmediatelyFillable),
|
|
317566
|
+
/* harmony export */ OrderNotCached: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.OrderNotCached),
|
|
317567
|
+
/* harmony export */ OrderNotFillable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.OrderNotFillable),
|
|
317568
|
+
/* harmony export */ OrderNotFound: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.OrderNotFound),
|
|
317569
|
+
/* harmony export */ PermissionDenied: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.PermissionDenied),
|
|
317570
|
+
/* harmony export */ Precise: () => (/* reexport safe */ _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_164__.O),
|
|
317571
|
+
/* harmony export */ RateLimitExceeded: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.RateLimitExceeded),
|
|
317572
|
+
/* harmony export */ RequestTimeout: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__.RequestTimeout),
|
|
316971
317573
|
/* harmony export */ ace: () => (/* reexport safe */ _src_ace_js__WEBPACK_IMPORTED_MODULE_1__.Z),
|
|
316972
317574
|
/* harmony export */ alpaca: () => (/* reexport safe */ _src_alpaca_js__WEBPACK_IMPORTED_MODULE_2__.Z),
|
|
316973
317575
|
/* harmony export */ ascendex: () => (/* reexport safe */ _src_ascendex_js__WEBPACK_IMPORTED_MODULE_3__.Z),
|
|
@@ -317022,11 +317624,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
317022
317624
|
/* harmony export */ delta: () => (/* reexport safe */ _src_delta_js__WEBPACK_IMPORTED_MODULE_51__.Z),
|
|
317023
317625
|
/* harmony export */ deribit: () => (/* reexport safe */ _src_deribit_js__WEBPACK_IMPORTED_MODULE_52__.Z),
|
|
317024
317626
|
/* harmony export */ digifinex: () => (/* reexport safe */ _src_digifinex_js__WEBPACK_IMPORTED_MODULE_53__.Z),
|
|
317025
|
-
/* harmony export */ errors: () => (/* reexport module object */
|
|
317627
|
+
/* harmony export */ errors: () => (/* reexport module object */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__),
|
|
317026
317628
|
/* harmony export */ exchanges: () => (/* binding */ exchanges),
|
|
317027
317629
|
/* harmony export */ exmo: () => (/* reexport safe */ _src_exmo_js__WEBPACK_IMPORTED_MODULE_54__.Z),
|
|
317028
317630
|
/* harmony export */ fmfwio: () => (/* reexport safe */ _src_fmfwio_js__WEBPACK_IMPORTED_MODULE_55__.Z),
|
|
317029
|
-
/* harmony export */ functions: () => (/* reexport module object */
|
|
317631
|
+
/* harmony export */ functions: () => (/* reexport module object */ _src_base_functions_js__WEBPACK_IMPORTED_MODULE_165__),
|
|
317030
317632
|
/* harmony export */ gate: () => (/* reexport safe */ _src_gate_js__WEBPACK_IMPORTED_MODULE_56__.Z),
|
|
317031
317633
|
/* harmony export */ gateio: () => (/* reexport safe */ _src_gateio_js__WEBPACK_IMPORTED_MODULE_57__.Z),
|
|
317032
317634
|
/* harmony export */ gemini: () => (/* reexport safe */ _src_gemini_js__WEBPACK_IMPORTED_MODULE_58__.Z),
|
|
@@ -317077,9 +317679,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
317077
317679
|
/* harmony export */ zonda: () => (/* reexport safe */ _src_zonda_js__WEBPACK_IMPORTED_MODULE_101__.Z)
|
|
317078
317680
|
/* harmony export */ });
|
|
317079
317681
|
/* harmony import */ var _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3043);
|
|
317080
|
-
/* harmony import */ var
|
|
317081
|
-
/* harmony import */ var
|
|
317082
|
-
/* harmony import */ var
|
|
317682
|
+
/* harmony import */ var _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_164__ = __webpack_require__(2194);
|
|
317683
|
+
/* harmony import */ var _src_base_functions_js__WEBPACK_IMPORTED_MODULE_165__ = __webpack_require__(7100);
|
|
317684
|
+
/* harmony import */ var _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__ = __webpack_require__(6689);
|
|
317083
317685
|
/* harmony import */ var _src_ace_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9869);
|
|
317084
317686
|
/* harmony import */ var _src_alpaca_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5660);
|
|
317085
317687
|
/* harmony import */ var _src_ascendex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9612);
|
|
@@ -317220,28 +317822,29 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
317220
317822
|
/* harmony import */ var _src_pro_htx_js__WEBPACK_IMPORTED_MODULE_138__ = __webpack_require__(7474);
|
|
317221
317823
|
/* harmony import */ var _src_pro_huobi_js__WEBPACK_IMPORTED_MODULE_139__ = __webpack_require__(8384);
|
|
317222
317824
|
/* harmony import */ var _src_pro_huobijp_js__WEBPACK_IMPORTED_MODULE_140__ = __webpack_require__(9021);
|
|
317223
|
-
/* harmony import */ var
|
|
317224
|
-
/* harmony import */ var
|
|
317225
|
-
/* harmony import */ var
|
|
317226
|
-
/* harmony import */ var
|
|
317227
|
-
/* harmony import */ var
|
|
317228
|
-
/* harmony import */ var
|
|
317229
|
-
/* harmony import */ var
|
|
317230
|
-
/* harmony import */ var
|
|
317231
|
-
/* harmony import */ var
|
|
317232
|
-
/* harmony import */ var
|
|
317233
|
-
/* harmony import */ var
|
|
317234
|
-
/* harmony import */ var
|
|
317235
|
-
/* harmony import */ var
|
|
317236
|
-
/* harmony import */ var
|
|
317237
|
-
/* harmony import */ var
|
|
317238
|
-
/* harmony import */ var
|
|
317239
|
-
/* harmony import */ var
|
|
317240
|
-
/* harmony import */ var
|
|
317241
|
-
/* harmony import */ var
|
|
317242
|
-
/* harmony import */ var
|
|
317243
|
-
/* harmony import */ var
|
|
317244
|
-
/* harmony import */ var
|
|
317825
|
+
/* harmony import */ var _src_pro_hyperliquid_js__WEBPACK_IMPORTED_MODULE_141__ = __webpack_require__(8354);
|
|
317826
|
+
/* harmony import */ var _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_142__ = __webpack_require__(3484);
|
|
317827
|
+
/* harmony import */ var _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_143__ = __webpack_require__(1311);
|
|
317828
|
+
/* harmony import */ var _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_144__ = __webpack_require__(736);
|
|
317829
|
+
/* harmony import */ var _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_145__ = __webpack_require__(449);
|
|
317830
|
+
/* harmony import */ var _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_146__ = __webpack_require__(2387);
|
|
317831
|
+
/* harmony import */ var _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_147__ = __webpack_require__(7181);
|
|
317832
|
+
/* harmony import */ var _src_pro_lbank_js__WEBPACK_IMPORTED_MODULE_148__ = __webpack_require__(1267);
|
|
317833
|
+
/* harmony import */ var _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_149__ = __webpack_require__(627);
|
|
317834
|
+
/* harmony import */ var _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_150__ = __webpack_require__(6484);
|
|
317835
|
+
/* harmony import */ var _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_151__ = __webpack_require__(8080);
|
|
317836
|
+
/* harmony import */ var _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_152__ = __webpack_require__(7105);
|
|
317837
|
+
/* harmony import */ var _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_153__ = __webpack_require__(2214);
|
|
317838
|
+
/* harmony import */ var _src_pro_onetrading_js__WEBPACK_IMPORTED_MODULE_154__ = __webpack_require__(9419);
|
|
317839
|
+
/* harmony import */ var _src_pro_p2b_js__WEBPACK_IMPORTED_MODULE_155__ = __webpack_require__(8516);
|
|
317840
|
+
/* harmony import */ var _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_156__ = __webpack_require__(4360);
|
|
317841
|
+
/* harmony import */ var _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_157__ = __webpack_require__(7924);
|
|
317842
|
+
/* harmony import */ var _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_158__ = __webpack_require__(3541);
|
|
317843
|
+
/* harmony import */ var _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_159__ = __webpack_require__(9782);
|
|
317844
|
+
/* harmony import */ var _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_160__ = __webpack_require__(7614);
|
|
317845
|
+
/* harmony import */ var _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_161__ = __webpack_require__(4828);
|
|
317846
|
+
/* harmony import */ var _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_162__ = __webpack_require__(5630);
|
|
317847
|
+
/* harmony import */ var _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_163__ = __webpack_require__(3910);
|
|
317245
317848
|
/*
|
|
317246
317849
|
|
|
317247
317850
|
MIT License
|
|
@@ -317276,7 +317879,7 @@ SOFTWARE.
|
|
|
317276
317879
|
|
|
317277
317880
|
//-----------------------------------------------------------------------------
|
|
317278
317881
|
// this is updated by vss.js when building
|
|
317279
|
-
const version = '4.2.
|
|
317882
|
+
const version = '4.2.71';
|
|
317280
317883
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
317281
317884
|
//-----------------------------------------------------------------------------
|
|
317282
317885
|
|
|
@@ -317440,6 +318043,7 @@ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion
|
|
|
317440
318043
|
|
|
317441
318044
|
|
|
317442
318045
|
|
|
318046
|
+
|
|
317443
318047
|
|
|
317444
318048
|
|
|
317445
318049
|
const exchanges = {
|
|
@@ -317585,28 +318189,29 @@ const pro = {
|
|
|
317585
318189
|
'htx': _src_pro_htx_js__WEBPACK_IMPORTED_MODULE_138__/* ["default"] */ .Z,
|
|
317586
318190
|
'huobi': _src_pro_huobi_js__WEBPACK_IMPORTED_MODULE_139__/* ["default"] */ .Z,
|
|
317587
318191
|
'huobijp': _src_pro_huobijp_js__WEBPACK_IMPORTED_MODULE_140__/* ["default"] */ .Z,
|
|
317588
|
-
'
|
|
317589
|
-
'
|
|
317590
|
-
'
|
|
317591
|
-
'
|
|
317592
|
-
'
|
|
317593
|
-
'
|
|
317594
|
-
'
|
|
317595
|
-
'
|
|
317596
|
-
'
|
|
317597
|
-
'
|
|
317598
|
-
'
|
|
317599
|
-
'
|
|
317600
|
-
'
|
|
317601
|
-
'
|
|
317602
|
-
'
|
|
317603
|
-
'
|
|
317604
|
-
'
|
|
317605
|
-
'
|
|
317606
|
-
'
|
|
317607
|
-
'
|
|
317608
|
-
'
|
|
317609
|
-
'
|
|
318192
|
+
'hyperliquid': _src_pro_hyperliquid_js__WEBPACK_IMPORTED_MODULE_141__/* ["default"] */ .Z,
|
|
318193
|
+
'idex': _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_142__/* ["default"] */ .Z,
|
|
318194
|
+
'independentreserve': _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_143__/* ["default"] */ .Z,
|
|
318195
|
+
'kraken': _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_144__/* ["default"] */ .Z,
|
|
318196
|
+
'krakenfutures': _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_145__/* ["default"] */ .Z,
|
|
318197
|
+
'kucoin': _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_146__/* ["default"] */ .Z,
|
|
318198
|
+
'kucoinfutures': _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_147__/* ["default"] */ .Z,
|
|
318199
|
+
'lbank': _src_pro_lbank_js__WEBPACK_IMPORTED_MODULE_148__/* ["default"] */ .Z,
|
|
318200
|
+
'luno': _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_149__/* ["default"] */ .Z,
|
|
318201
|
+
'mexc': _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_150__/* ["default"] */ .Z,
|
|
318202
|
+
'ndax': _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_151__/* ["default"] */ .Z,
|
|
318203
|
+
'okcoin': _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_152__/* ["default"] */ .Z,
|
|
318204
|
+
'okx': _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_153__/* ["default"] */ .Z,
|
|
318205
|
+
'onetrading': _src_pro_onetrading_js__WEBPACK_IMPORTED_MODULE_154__/* ["default"] */ .Z,
|
|
318206
|
+
'p2b': _src_pro_p2b_js__WEBPACK_IMPORTED_MODULE_155__/* ["default"] */ .Z,
|
|
318207
|
+
'phemex': _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_156__/* ["default"] */ .Z,
|
|
318208
|
+
'poloniex': _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_157__/* ["default"] */ .Z,
|
|
318209
|
+
'poloniexfutures': _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_158__/* ["default"] */ .Z,
|
|
318210
|
+
'probit': _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_159__/* ["default"] */ .Z,
|
|
318211
|
+
'upbit': _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_160__/* ["default"] */ .Z,
|
|
318212
|
+
'wazirx': _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_161__/* ["default"] */ .Z,
|
|
318213
|
+
'whitebit': _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_162__/* ["default"] */ .Z,
|
|
318214
|
+
'woo': _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_163__/* ["default"] */ .Z,
|
|
317610
318215
|
};
|
|
317611
318216
|
for (const exchange in pro) {
|
|
317612
318217
|
// const ccxtExchange = exchanges[exchange]
|
|
@@ -317619,7 +318224,7 @@ for (const exchange in pro) {
|
|
|
317619
318224
|
pro.exchanges = Object.keys(pro);
|
|
317620
318225
|
pro['Exchange'] = _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e; // now the same for rest and ts
|
|
317621
318226
|
//-----------------------------------------------------------------------------
|
|
317622
|
-
const ccxt = Object.assign({ version, Exchange: _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e, Precise:
|
|
318227
|
+
const ccxt = Object.assign({ version, Exchange: _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e, Precise: _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_164__/* .Precise */ .O, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, _src_base_functions_js__WEBPACK_IMPORTED_MODULE_165__, _src_base_errors_js__WEBPACK_IMPORTED_MODULE_166__);
|
|
317623
318228
|
|
|
317624
318229
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ccxt);
|
|
317625
318230
|
//-----------------------------------------------------------------------------
|