ccxt 4.0.86 → 4.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/ccxt.browser.js +247 -59
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binance.js +1 -0
- package/dist/cjs/src/bitget.js +2 -0
- package/dist/cjs/src/bybit.js +1 -0
- package/dist/cjs/src/cryptocom.js +1 -0
- package/dist/cjs/src/delta.js +1 -0
- package/dist/cjs/src/deribit.js +1 -0
- package/dist/cjs/src/exmo.js +148 -48
- package/dist/cjs/src/gate.js +39 -0
- package/dist/cjs/src/hitbtc.js +3 -0
- package/dist/cjs/src/okx.js +39 -0
- package/dist/cjs/src/pro/bitfinex2.js +5 -5
- package/dist/cjs/src/pro/blockchaincom.js +2 -2
- package/dist/cjs/src/pro/luno.js +3 -3
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitget.d.ts +2 -0
- package/js/src/binance.js +1 -0
- package/js/src/bitget.js +2 -0
- package/js/src/bybit.js +1 -0
- package/js/src/cryptocom.js +1 -0
- package/js/src/delta.js +1 -0
- package/js/src/deribit.js +1 -0
- package/js/src/exmo.js +149 -49
- package/js/src/gate.d.ts +1 -0
- package/js/src/gate.js +39 -0
- package/js/src/hitbtc.js +3 -0
- package/js/src/okx.d.ts +1 -0
- package/js/src/okx.js +39 -0
- package/js/src/pro/bitfinex2.js +5 -5
- package/js/src/pro/blockchaincom.js +2 -2
- package/js/src/pro/luno.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -215,13 +215,13 @@ console.log(version, Object.keys(exchanges));
|
|
|
215
215
|
|
|
216
216
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
|
217
217
|
|
|
218
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.0.
|
|
219
|
-
* unpkg: https://unpkg.com/ccxt@4.0.
|
|
218
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.0.88/dist/ccxt.browser.js
|
|
219
|
+
* unpkg: https://unpkg.com/ccxt@4.0.88/dist/ccxt.browser.js
|
|
220
220
|
|
|
221
221
|
CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
|
|
222
222
|
|
|
223
223
|
```HTML
|
|
224
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.0.
|
|
224
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.0.88/dist/ccxt.browser.js"></script>
|
|
225
225
|
```
|
|
226
226
|
|
|
227
227
|
Creates a global `ccxt` object:
|
package/dist/ccxt.browser.js
CHANGED
|
@@ -15648,6 +15648,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
15648
15648
|
'fetchTransactionFees': true,
|
|
15649
15649
|
'fetchTransactions': false,
|
|
15650
15650
|
'fetchTransfers': true,
|
|
15651
|
+
'fetchUnderlyingAssets': false,
|
|
15651
15652
|
'fetchVolatilityHistory': false,
|
|
15652
15653
|
'fetchWithdrawal': false,
|
|
15653
15654
|
'fetchWithdrawals': true,
|
|
@@ -37243,6 +37244,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
37243
37244
|
'market/candles': 1,
|
|
37244
37245
|
'market/depth': 1,
|
|
37245
37246
|
'market/spot-vip-level': 2,
|
|
37247
|
+
'market/merge-depth': 1,
|
|
37246
37248
|
'market/history-candles': 1,
|
|
37247
37249
|
'public/loan/coinInfos': 2,
|
|
37248
37250
|
'public/loan/hour-interest': 2, // 10 times/1s (IP) => 20/10 = 2
|
|
@@ -37270,6 +37272,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
37270
37272
|
'market/history-candles': 1,
|
|
37271
37273
|
'market/history-index-candles': 1,
|
|
37272
37274
|
'market/history-mark-candles': 1,
|
|
37275
|
+
'market/merge-depth': 1,
|
|
37273
37276
|
},
|
|
37274
37277
|
},
|
|
37275
37278
|
'margin': {
|
|
@@ -71431,6 +71434,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
71431
71434
|
'fetchTradingFees': true,
|
|
71432
71435
|
'fetchTransactions': false,
|
|
71433
71436
|
'fetchTransfers': true,
|
|
71437
|
+
'fetchUnderlyingAssets': false,
|
|
71434
71438
|
'fetchVolatilityHistory': true,
|
|
71435
71439
|
'fetchWithdrawals': true,
|
|
71436
71440
|
'setLeverage': true,
|
|
@@ -98274,6 +98278,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
98274
98278
|
'fetchTransactionFees': false,
|
|
98275
98279
|
'fetchTransactions': false,
|
|
98276
98280
|
'fetchTransfers': true,
|
|
98281
|
+
'fetchUnderlyingAssets': false,
|
|
98277
98282
|
'fetchVolatilityHistory': false,
|
|
98278
98283
|
'fetchWithdrawals': true,
|
|
98279
98284
|
'reduceMargin': false,
|
|
@@ -103314,6 +103319,7 @@ class delta extends _abstract_delta_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
103314
103319
|
'fetchTrades': true,
|
|
103315
103320
|
'fetchTransfer': undefined,
|
|
103316
103321
|
'fetchTransfers': undefined,
|
|
103322
|
+
'fetchUnderlyingAssets': false,
|
|
103317
103323
|
'fetchVolatilityHistory': false,
|
|
103318
103324
|
'fetchWithdrawal': undefined,
|
|
103319
103325
|
'fetchWithdrawals': undefined,
|
|
@@ -106412,6 +106418,7 @@ class deribit extends _abstract_deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
106412
106418
|
'fetchTransactions': false,
|
|
106413
106419
|
'fetchTransfer': false,
|
|
106414
106420
|
'fetchTransfers': true,
|
|
106421
|
+
'fetchUnderlyingAssets': false,
|
|
106415
106422
|
'fetchVolatilityHistory': true,
|
|
106416
106423
|
'fetchWithdrawal': false,
|
|
106417
106424
|
'fetchWithdrawals': true,
|
|
@@ -114376,18 +114383,35 @@ class exmo extends _abstract_exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
114376
114383
|
// "commission_percent": "0.2"
|
|
114377
114384
|
// }
|
|
114378
114385
|
//
|
|
114386
|
+
// fetchMyTrades (margin)
|
|
114387
|
+
//
|
|
114388
|
+
// {
|
|
114389
|
+
// "trade_id": "692861757015952517",
|
|
114390
|
+
// "trade_dt": "1693951853197811824",
|
|
114391
|
+
// "trade_type": "buy",
|
|
114392
|
+
// "pair": "ADA_USDT",
|
|
114393
|
+
// "quantity": "1.96607879",
|
|
114394
|
+
// "price": "0.2568",
|
|
114395
|
+
// "amount": "0.50488903"
|
|
114396
|
+
// }
|
|
114397
|
+
//
|
|
114379
114398
|
const timestamp = this.safeTimestamp(trade, 'date');
|
|
114380
114399
|
const id = this.safeString(trade, 'trade_id');
|
|
114381
114400
|
const orderId = this.safeString(trade, 'order_id');
|
|
114382
114401
|
const priceString = this.safeString(trade, 'price');
|
|
114383
114402
|
const amountString = this.safeString(trade, 'quantity');
|
|
114384
114403
|
const costString = this.safeString(trade, 'amount');
|
|
114385
|
-
const side = this.
|
|
114404
|
+
const side = this.safeString2(trade, 'type', 'trade_type');
|
|
114386
114405
|
const type = undefined;
|
|
114387
114406
|
const marketId = this.safeString(trade, 'pair');
|
|
114388
114407
|
market = this.safeMarket(marketId, market, '_');
|
|
114389
114408
|
const symbol = market['symbol'];
|
|
114390
|
-
const
|
|
114409
|
+
const isMaker = this.safeValue(trade, 'is_maker');
|
|
114410
|
+
let takerOrMakerDefault = undefined;
|
|
114411
|
+
if (isMaker !== undefined) {
|
|
114412
|
+
takerOrMakerDefault = isMaker ? 'maker' : 'taker';
|
|
114413
|
+
}
|
|
114414
|
+
const takerOrMaker = this.safeString(trade, 'exec_type', takerOrMakerDefault);
|
|
114391
114415
|
let fee = undefined;
|
|
114392
114416
|
const feeCostString = this.safeString(trade, 'commission_amount');
|
|
114393
114417
|
if (feeCostString !== undefined) {
|
|
@@ -114466,38 +114490,91 @@ class exmo extends _abstract_exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
114466
114490
|
* @method
|
|
114467
114491
|
* @name exmo#fetchMyTrades
|
|
114468
114492
|
* @description fetch all trades made by the user
|
|
114469
|
-
* @
|
|
114493
|
+
* @see https://documenter.getpostman.com/view/10287440/SzYXWKPi#b8d8d9af-4f46-46a1-939b-ad261d79f452 // spot
|
|
114494
|
+
* @see https://documenter.getpostman.com/view/10287440/SzYXWKPi#f4b1aaf8-399f-403b-ab5e-4926d967a106 // margin
|
|
114495
|
+
* @param {string} symbol a symbol is required but it can be a single string, or a non-empty array
|
|
114470
114496
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
114471
|
-
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
114497
|
+
* @param {int} [limit] *required for margin orders* the maximum number of trades structures to retrieve
|
|
114472
114498
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
114499
|
+
*
|
|
114500
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
114501
|
+
* @param {int} [params.offset] last deal offset, default = 0
|
|
114473
114502
|
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
|
|
114474
114503
|
*/
|
|
114475
|
-
|
|
114476
|
-
|
|
114477
|
-
|
|
114504
|
+
this.checkRequiredSymbol('fetchMyTrades', symbol);
|
|
114505
|
+
let marginMode = undefined;
|
|
114506
|
+
[marginMode, params] = this.handleMarginModeAndParams('fetchMyTrades', params);
|
|
114507
|
+
if (marginMode === 'cross') {
|
|
114508
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + 'only isolated margin is supported');
|
|
114478
114509
|
}
|
|
114479
114510
|
await this.loadMarkets();
|
|
114480
|
-
|
|
114481
|
-
|
|
114482
|
-
|
|
114483
|
-
|
|
114484
|
-
|
|
114485
|
-
|
|
114486
|
-
|
|
114487
|
-
|
|
114488
|
-
pair =
|
|
114511
|
+
const market = this.market(symbol);
|
|
114512
|
+
const pair = market['id'];
|
|
114513
|
+
const isSpot = marginMode !== 'isolated';
|
|
114514
|
+
if (limit === undefined) {
|
|
114515
|
+
limit = 100;
|
|
114516
|
+
}
|
|
114517
|
+
const request = {};
|
|
114518
|
+
if (isSpot) {
|
|
114519
|
+
request['pair'] = pair;
|
|
114489
114520
|
}
|
|
114490
114521
|
else {
|
|
114491
|
-
|
|
114492
|
-
pair = market['id'];
|
|
114522
|
+
request['pair_name'] = pair;
|
|
114493
114523
|
}
|
|
114494
|
-
const request = {
|
|
114495
|
-
'pair': pair,
|
|
114496
|
-
};
|
|
114497
114524
|
if (limit !== undefined) {
|
|
114498
114525
|
request['limit'] = limit;
|
|
114499
114526
|
}
|
|
114500
|
-
const
|
|
114527
|
+
const offset = this.safeInteger(params, 'offset', 0);
|
|
114528
|
+
request['offset'] = offset;
|
|
114529
|
+
let response = undefined;
|
|
114530
|
+
if (isSpot) {
|
|
114531
|
+
response = await this.privatePostUserTrades(this.extend(request, params));
|
|
114532
|
+
//
|
|
114533
|
+
// {
|
|
114534
|
+
// "BTC_USD": [
|
|
114535
|
+
// {
|
|
114536
|
+
// "trade_id": 20056872,
|
|
114537
|
+
// "client_id": 100500,
|
|
114538
|
+
// "date": 1435488248,
|
|
114539
|
+
// "type": "buy",
|
|
114540
|
+
// "pair": "BTC_USD",
|
|
114541
|
+
// "quantity": "1",
|
|
114542
|
+
// "price": "100",
|
|
114543
|
+
// "amount": "100",
|
|
114544
|
+
// "order_id": 7,
|
|
114545
|
+
// "parent_order_id": 117684023830293,
|
|
114546
|
+
// "exec_type": "taker",
|
|
114547
|
+
// "commission_amount": "0.02",
|
|
114548
|
+
// "commission_currency": "BTC",
|
|
114549
|
+
// "commission_percent": "0.2"
|
|
114550
|
+
// }
|
|
114551
|
+
// ],
|
|
114552
|
+
// ...
|
|
114553
|
+
// }
|
|
114554
|
+
//
|
|
114555
|
+
}
|
|
114556
|
+
else {
|
|
114557
|
+
const responseFromExchange = await this.privatePostMarginTrades(this.extend(request, params));
|
|
114558
|
+
//
|
|
114559
|
+
// {
|
|
114560
|
+
// "trades": {
|
|
114561
|
+
// "ADA_USDT": [
|
|
114562
|
+
// {
|
|
114563
|
+
// "trade_id": "692861757015952517",
|
|
114564
|
+
// "trade_dt": "1693951853197811824",
|
|
114565
|
+
// "trade_type": "buy",
|
|
114566
|
+
// "pair": "ADA_USDT",
|
|
114567
|
+
// "quantity": "1.96607879",
|
|
114568
|
+
// "price": "0.2568",
|
|
114569
|
+
// "amount": "0.50488903"
|
|
114570
|
+
// },
|
|
114571
|
+
// ]
|
|
114572
|
+
// ...
|
|
114573
|
+
// }
|
|
114574
|
+
// }
|
|
114575
|
+
//
|
|
114576
|
+
response = this.safeValue(responseFromExchange, 'trades');
|
|
114577
|
+
}
|
|
114501
114578
|
let result = [];
|
|
114502
114579
|
const marketIdsInner = Object.keys(response);
|
|
114503
114580
|
for (let i = 0; i < marketIdsInner.length; i++) {
|
|
@@ -114627,13 +114704,21 @@ class exmo extends _abstract_exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
114627
114704
|
* @method
|
|
114628
114705
|
* @name exmo#fetchOrderTrades
|
|
114629
114706
|
* @description fetch all the trades made from a single order
|
|
114707
|
+
* @see https://documenter.getpostman.com/view/10287440/SzYXWKPi#cf27781e-28e5-4b39-a52d-3110f5d22459 // spot
|
|
114708
|
+
* @see https://documenter.getpostman.com/view/10287440/SzYXWKPi#00810661-9119-46c5-aec5-55abe9cb42c7 // margin
|
|
114630
114709
|
* @param {string} id order id
|
|
114631
114710
|
* @param {string} symbol unified market symbol
|
|
114632
114711
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
114633
114712
|
* @param {int} [limit] the maximum number of trades to retrieve
|
|
114634
114713
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
114714
|
+
* @param {string} [params.marginMode] set to "isolated" to fetch trades for a margin order
|
|
114635
114715
|
* @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
|
|
114636
114716
|
*/
|
|
114717
|
+
let marginMode = undefined;
|
|
114718
|
+
[marginMode, params] = this.handleMarginModeAndParams('fetchOrderTrades', params);
|
|
114719
|
+
if (marginMode === 'cross') {
|
|
114720
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' only supports isolated margin');
|
|
114721
|
+
}
|
|
114637
114722
|
let market = undefined;
|
|
114638
114723
|
if (symbol !== undefined) {
|
|
114639
114724
|
market = this.market(symbol);
|
|
@@ -114641,32 +114726,54 @@ class exmo extends _abstract_exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
114641
114726
|
const request = {
|
|
114642
114727
|
'order_id': id.toString(),
|
|
114643
114728
|
};
|
|
114644
|
-
|
|
114645
|
-
|
|
114646
|
-
|
|
114647
|
-
|
|
114648
|
-
|
|
114649
|
-
|
|
114650
|
-
|
|
114651
|
-
|
|
114652
|
-
|
|
114653
|
-
|
|
114654
|
-
|
|
114655
|
-
|
|
114656
|
-
|
|
114657
|
-
|
|
114658
|
-
|
|
114659
|
-
|
|
114660
|
-
|
|
114661
|
-
|
|
114662
|
-
|
|
114663
|
-
|
|
114664
|
-
|
|
114665
|
-
|
|
114666
|
-
|
|
114667
|
-
|
|
114668
|
-
|
|
114669
|
-
|
|
114729
|
+
let response = undefined;
|
|
114730
|
+
if (marginMode === 'isolated') {
|
|
114731
|
+
response = await this.privatePostMarginUserOrderTrades(this.extend(request, params));
|
|
114732
|
+
//
|
|
114733
|
+
// {
|
|
114734
|
+
// "trades": [
|
|
114735
|
+
// {
|
|
114736
|
+
// "is_maker": false,
|
|
114737
|
+
// "order_id": "123",
|
|
114738
|
+
// "pair": "BTC_USD",
|
|
114739
|
+
// "price": "54122.25",
|
|
114740
|
+
// "quantity": "0.00069994",
|
|
114741
|
+
// "trade_dt": "1619069561718824428",
|
|
114742
|
+
// "trade_id": "692842802860135010",
|
|
114743
|
+
// "type": "sell"
|
|
114744
|
+
// }
|
|
114745
|
+
// ]
|
|
114746
|
+
// }
|
|
114747
|
+
//
|
|
114748
|
+
}
|
|
114749
|
+
else {
|
|
114750
|
+
response = await this.privatePostOrderTrades(this.extend(request, params));
|
|
114751
|
+
//
|
|
114752
|
+
// {
|
|
114753
|
+
// "type": "buy",
|
|
114754
|
+
// "in_currency": "BTC",
|
|
114755
|
+
// "in_amount": "1",
|
|
114756
|
+
// "out_currency": "USD",
|
|
114757
|
+
// "out_amount": "100",
|
|
114758
|
+
// "trades": [
|
|
114759
|
+
// {
|
|
114760
|
+
// "trade_id": 3,
|
|
114761
|
+
// "date": 1435488248,
|
|
114762
|
+
// "type": "buy",
|
|
114763
|
+
// "pair": "BTC_USD",
|
|
114764
|
+
// "order_id": 12345,
|
|
114765
|
+
// "quantity": 1,
|
|
114766
|
+
// "price": 100,
|
|
114767
|
+
// "amount": 100,
|
|
114768
|
+
// "exec_type": "taker",
|
|
114769
|
+
// "commission_amount": "0.02",
|
|
114770
|
+
// "commission_currency": "BTC",
|
|
114771
|
+
// "commission_percent": "0.2"
|
|
114772
|
+
// }
|
|
114773
|
+
// ]
|
|
114774
|
+
// }
|
|
114775
|
+
//
|
|
114776
|
+
}
|
|
114670
114777
|
const trades = this.safeValue(response, 'trades');
|
|
114671
114778
|
return this.parseTrades(trades, market, since, limit);
|
|
114672
114779
|
}
|
|
@@ -115560,6 +115667,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
115560
115667
|
'fetchTradingFee': true,
|
|
115561
115668
|
'fetchTradingFees': true,
|
|
115562
115669
|
'fetchTransactionFees': true,
|
|
115670
|
+
'fetchUnderlyingAssets': true,
|
|
115563
115671
|
'fetchVolatilityHistory': false,
|
|
115564
115672
|
'fetchWithdrawals': true,
|
|
115565
115673
|
'reduceMargin': true,
|
|
@@ -121652,6 +121760,44 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
121652
121760
|
request['dual_mode'] = hedged;
|
|
121653
121761
|
return await this.privateFuturesPostSettleDualMode(this.extend(request, query));
|
|
121654
121762
|
}
|
|
121763
|
+
async fetchUnderlyingAssets(params = {}) {
|
|
121764
|
+
/**
|
|
121765
|
+
* @method
|
|
121766
|
+
* @name gate#fetchUnderlyingAssets
|
|
121767
|
+
* @description fetches the market ids of underlying assets for a specific contract market type
|
|
121768
|
+
* @param {object} [params] exchange specific params
|
|
121769
|
+
* @param {string} [params.type] the contract market type, 'option', 'swap' or 'future', the default is 'option'
|
|
121770
|
+
* @returns {object[]} a list of [underlying assets]{@link https://github.com/ccxt/ccxt/wiki/Manual#underlying-assets-structure}
|
|
121771
|
+
*/
|
|
121772
|
+
await this.loadMarkets();
|
|
121773
|
+
let marketType = undefined;
|
|
121774
|
+
[marketType, params] = this.handleMarketTypeAndParams('fetchUnderlyingAssets', undefined, params);
|
|
121775
|
+
if ((marketType === undefined) || (marketType === 'spot')) {
|
|
121776
|
+
marketType = 'option';
|
|
121777
|
+
}
|
|
121778
|
+
if (marketType !== 'option') {
|
|
121779
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchUnderlyingAssets() supports option markets only');
|
|
121780
|
+
}
|
|
121781
|
+
const response = await this.publicOptionsGetUnderlyings(params);
|
|
121782
|
+
//
|
|
121783
|
+
// [
|
|
121784
|
+
// {
|
|
121785
|
+
// "index_time": "1646915796",
|
|
121786
|
+
// "name": "BTC_USDT",
|
|
121787
|
+
// "index_price": "39142.73"
|
|
121788
|
+
// }
|
|
121789
|
+
// ]
|
|
121790
|
+
//
|
|
121791
|
+
const underlyings = [];
|
|
121792
|
+
for (let i = 0; i < response.length; i++) {
|
|
121793
|
+
const underlying = response[i];
|
|
121794
|
+
const name = this.safeString(underlying, 'name');
|
|
121795
|
+
if (name !== undefined) {
|
|
121796
|
+
underlyings.push(name);
|
|
121797
|
+
}
|
|
121798
|
+
}
|
|
121799
|
+
return underlyings;
|
|
121800
|
+
}
|
|
121655
121801
|
handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
121656
121802
|
if (response === undefined) {
|
|
121657
121803
|
return undefined;
|
|
@@ -124735,6 +124881,9 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
124735
124881
|
if (taker !== undefined) {
|
|
124736
124882
|
takerOrMaker = taker ? 'taker' : 'maker';
|
|
124737
124883
|
}
|
|
124884
|
+
else {
|
|
124885
|
+
takerOrMaker = 'taker'; // the only case when `taker` field is missing, is public fetchTrades and it must be taker
|
|
124886
|
+
}
|
|
124738
124887
|
if (feeCostString !== undefined) {
|
|
124739
124888
|
const info = this.safeValue(market, 'info', {});
|
|
124740
124889
|
const feeCurrency = this.safeString(info, 'fee_currency');
|
|
@@ -177387,6 +177536,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
177387
177536
|
'fetchTransactions': false,
|
|
177388
177537
|
'fetchTransfer': true,
|
|
177389
177538
|
'fetchTransfers': true,
|
|
177539
|
+
'fetchUnderlyingAssets': true,
|
|
177390
177540
|
'fetchVolatilityHistory': false,
|
|
177391
177541
|
'fetchWithdrawal': true,
|
|
177392
177542
|
'fetchWithdrawals': true,
|
|
@@ -183980,6 +184130,44 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
183980
184130
|
}
|
|
183981
184131
|
return result;
|
|
183982
184132
|
}
|
|
184133
|
+
async fetchUnderlyingAssets(params = {}) {
|
|
184134
|
+
/**
|
|
184135
|
+
* @method
|
|
184136
|
+
* @name okx#fetchUnderlyingAssets
|
|
184137
|
+
* @description fetches the market ids of underlying assets for a specific contract market type
|
|
184138
|
+
* @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-underlying
|
|
184139
|
+
* @param {object} [params] exchange specific params
|
|
184140
|
+
* @param {string} [params.type] the contract market type, 'option', 'swap' or 'future', the default is 'option'
|
|
184141
|
+
* @returns {object[]} a list of [underlying assets]{@link https://github.com/ccxt/ccxt/wiki/Manual#underlying-assets-structure}
|
|
184142
|
+
*/
|
|
184143
|
+
await this.loadMarkets();
|
|
184144
|
+
let marketType = undefined;
|
|
184145
|
+
[marketType, params] = this.handleMarketTypeAndParams('fetchUnderlyingAssets', undefined, params);
|
|
184146
|
+
if ((marketType === undefined) || (marketType === 'spot')) {
|
|
184147
|
+
marketType = 'option';
|
|
184148
|
+
}
|
|
184149
|
+
if ((marketType !== 'option') && (marketType !== 'swap') && (marketType !== 'future')) {
|
|
184150
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' fetchUnderlyingAssets() supports contract markets only');
|
|
184151
|
+
}
|
|
184152
|
+
const request = {
|
|
184153
|
+
'instType': this.convertToInstrumentType(marketType),
|
|
184154
|
+
};
|
|
184155
|
+
const response = await this.publicGetPublicUnderlying(this.extend(request, params));
|
|
184156
|
+
//
|
|
184157
|
+
// {
|
|
184158
|
+
// "code": "0",
|
|
184159
|
+
// "data": [
|
|
184160
|
+
// [
|
|
184161
|
+
// "BTC-USD",
|
|
184162
|
+
// "ETH-USD"
|
|
184163
|
+
// ]
|
|
184164
|
+
// ],
|
|
184165
|
+
// "msg": ""
|
|
184166
|
+
// }
|
|
184167
|
+
//
|
|
184168
|
+
const underlyings = this.safeValue(response, 'data', []);
|
|
184169
|
+
return underlyings[0];
|
|
184170
|
+
}
|
|
183983
184171
|
handleErrors(httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
183984
184172
|
if (!response) {
|
|
183985
184173
|
return undefined; // fallback to default error handler
|
|
@@ -198434,13 +198622,13 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
198434
198622
|
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
198435
198623
|
this.myTrades = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__/* .ArrayCacheBySymbolById */ .hl(limit);
|
|
198436
198624
|
}
|
|
198437
|
-
const
|
|
198438
|
-
|
|
198439
|
-
this.myTrades =
|
|
198625
|
+
const tradesArray = this.myTrades;
|
|
198626
|
+
tradesArray.append(trade);
|
|
198627
|
+
this.myTrades = tradesArray;
|
|
198440
198628
|
// generic subscription
|
|
198441
|
-
client.resolve(
|
|
198629
|
+
client.resolve(tradesArray, name);
|
|
198442
198630
|
// specific subscription
|
|
198443
|
-
client.resolve(
|
|
198631
|
+
client.resolve(tradesArray, messageHash);
|
|
198444
198632
|
}
|
|
198445
198633
|
handleTrades(client, message, subscription) {
|
|
198446
198634
|
//
|
|
@@ -207659,8 +207847,8 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
207659
207847
|
};
|
|
207660
207848
|
}
|
|
207661
207849
|
handleDelta(bookside, delta) {
|
|
207662
|
-
const
|
|
207663
|
-
bookside.storeArray(
|
|
207850
|
+
const bookArray = this.parseCountedBidAsk(delta, 'px', 'qty', 'num');
|
|
207851
|
+
bookside.storeArray(bookArray);
|
|
207664
207852
|
}
|
|
207665
207853
|
handleDeltas(bookside, deltas) {
|
|
207666
207854
|
for (let i = 0; i < deltas.length; i++) {
|
|
@@ -227167,13 +227355,13 @@ class luno extends _luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
227167
227355
|
const asksOrderSide = orderbook['asks'];
|
|
227168
227356
|
const bidsOrderSide = orderbook['bids'];
|
|
227169
227357
|
if (createUpdate !== undefined) {
|
|
227170
|
-
const
|
|
227358
|
+
const bidAskArray = this.customParseBidAsk(createUpdate, 'price', 'volume', 'order_id');
|
|
227171
227359
|
const type = this.safeString(createUpdate, 'type');
|
|
227172
227360
|
if (type === 'ASK') {
|
|
227173
|
-
asksOrderSide.storeArray(
|
|
227361
|
+
asksOrderSide.storeArray(bidAskArray);
|
|
227174
227362
|
}
|
|
227175
227363
|
else if (type === 'BID') {
|
|
227176
|
-
bidsOrderSide.storeArray(
|
|
227364
|
+
bidsOrderSide.storeArray(bidAskArray);
|
|
227177
227365
|
}
|
|
227178
227366
|
}
|
|
227179
227367
|
const deleteUpdate = this.safeValue(message, 'delete_update');
|
|
@@ -273704,7 +273892,7 @@ SOFTWARE.
|
|
|
273704
273892
|
|
|
273705
273893
|
//-----------------------------------------------------------------------------
|
|
273706
273894
|
// this is updated by vss.js when building
|
|
273707
|
-
const version = '4.0.
|
|
273895
|
+
const version = '4.0.88';
|
|
273708
273896
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
|
|
273709
273897
|
//-----------------------------------------------------------------------------
|
|
273710
273898
|
|