ccxt 4.2.37 → 4.2.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/dist/ccxt.browser.js +2591 -405
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +4 -1
- package/dist/cjs/src/abstract/blofin.js +9 -0
- package/dist/cjs/src/blofin.js +2103 -0
- package/dist/cjs/src/pro/kucoin.js +93 -40
- package/js/ccxt.d.ts +5 -2
- package/js/ccxt.js +4 -2
- package/js/src/abstract/blofin.d.ts +36 -0
- package/js/src/abstract/blofin.js +11 -0
- package/js/src/blofin.d.ts +124 -0
- package/js/src/blofin.js +2104 -0
- package/js/src/pro/kucoin.js +93 -40
- package/package.json +1 -1
package/dist/ccxt.browser.js
CHANGED
|
@@ -400,6 +400,22 @@ class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchang
|
|
|
400
400
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange);
|
|
401
401
|
|
|
402
402
|
|
|
403
|
+
/***/ }),
|
|
404
|
+
|
|
405
|
+
/***/ 6065:
|
|
406
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
407
|
+
|
|
408
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
409
|
+
/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
410
|
+
/* harmony export */ });
|
|
411
|
+
/* harmony import */ var _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3043);
|
|
412
|
+
// -------------------------------------------------------------------------------
|
|
413
|
+
|
|
414
|
+
class Exchange extends _base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e {
|
|
415
|
+
}
|
|
416
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Exchange);
|
|
417
|
+
|
|
418
|
+
|
|
403
419
|
/***/ }),
|
|
404
420
|
|
|
405
421
|
/***/ 5489:
|
|
@@ -75480,6 +75496,2119 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
|
|
|
75480
75496
|
}
|
|
75481
75497
|
|
|
75482
75498
|
|
|
75499
|
+
/***/ }),
|
|
75500
|
+
|
|
75501
|
+
/***/ 687:
|
|
75502
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
75503
|
+
|
|
75504
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
75505
|
+
/* harmony export */ Z: () => (/* binding */ blofin)
|
|
75506
|
+
/* harmony export */ });
|
|
75507
|
+
/* harmony import */ var _abstract_blofin_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6065);
|
|
75508
|
+
/* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
|
|
75509
|
+
/* harmony import */ var _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2194);
|
|
75510
|
+
/* harmony import */ var _base_functions_number_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9292);
|
|
75511
|
+
/* harmony import */ var _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1372);
|
|
75512
|
+
// ---------------------------------------------------------------------------
|
|
75513
|
+
|
|
75514
|
+
|
|
75515
|
+
|
|
75516
|
+
|
|
75517
|
+
|
|
75518
|
+
// ---------------------------------------------------------------------------
|
|
75519
|
+
/**
|
|
75520
|
+
* @class blofin
|
|
75521
|
+
* @augments Exchange
|
|
75522
|
+
*/
|
|
75523
|
+
class blofin extends _abstract_blofin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
75524
|
+
describe() {
|
|
75525
|
+
return this.deepExtend(super.describe(), {
|
|
75526
|
+
'id': 'blofin',
|
|
75527
|
+
'name': 'BloFin',
|
|
75528
|
+
'countries': ['US'],
|
|
75529
|
+
'version': 'v1',
|
|
75530
|
+
'rateLimit': 100,
|
|
75531
|
+
'has': {
|
|
75532
|
+
'CORS': undefined,
|
|
75533
|
+
'spot': false,
|
|
75534
|
+
'margin': false,
|
|
75535
|
+
'swap': true,
|
|
75536
|
+
'future': false,
|
|
75537
|
+
'option': false,
|
|
75538
|
+
'addMargin': false,
|
|
75539
|
+
'borrowMargin': false,
|
|
75540
|
+
'cancelAllOrders': false,
|
|
75541
|
+
'cancelOrder': true,
|
|
75542
|
+
'cancelOrders': true,
|
|
75543
|
+
'closeAllPositions': false,
|
|
75544
|
+
'closePosition': true,
|
|
75545
|
+
'createDepositAddress': false,
|
|
75546
|
+
'createMarketBuyOrderWithCost': false,
|
|
75547
|
+
'createMarketSellOrderWithCost': false,
|
|
75548
|
+
'createOrder': true,
|
|
75549
|
+
'createOrders': true,
|
|
75550
|
+
'createOrderWithTakeProfitAndStopLoss': true,
|
|
75551
|
+
'createPostOnlyOrder': false,
|
|
75552
|
+
'createReduceOnlyOrder': false,
|
|
75553
|
+
'createStopLimitOrder': false,
|
|
75554
|
+
'createStopLossOrder': true,
|
|
75555
|
+
'createStopMarketOrder': false,
|
|
75556
|
+
'createStopOrder': false,
|
|
75557
|
+
'createTakeProfitOrder': true,
|
|
75558
|
+
'editOrder': false,
|
|
75559
|
+
'fetchAccounts': false,
|
|
75560
|
+
'fetchBalance': true,
|
|
75561
|
+
'fetchBidsAsks': undefined,
|
|
75562
|
+
'fetchBorrowInterest': false,
|
|
75563
|
+
'fetchBorrowRateHistories': false,
|
|
75564
|
+
'fetchBorrowRateHistory': false,
|
|
75565
|
+
'fetchCanceledOrders': false,
|
|
75566
|
+
'fetchClosedOrder': false,
|
|
75567
|
+
'fetchClosedOrders': false,
|
|
75568
|
+
'fetchCrossBorrowRate': false,
|
|
75569
|
+
'fetchCrossBorrowRates': false,
|
|
75570
|
+
'fetchCurrencies': false,
|
|
75571
|
+
'fetchDeposit': false,
|
|
75572
|
+
'fetchDepositAddress': false,
|
|
75573
|
+
'fetchDepositAddresses': false,
|
|
75574
|
+
'fetchDepositAddressesByNetwork': false,
|
|
75575
|
+
'fetchDeposits': true,
|
|
75576
|
+
'fetchDepositsWithdrawals': false,
|
|
75577
|
+
'fetchDepositWithdrawFee': 'emulated',
|
|
75578
|
+
'fetchDepositWithdrawFees': false,
|
|
75579
|
+
'fetchFundingHistory': true,
|
|
75580
|
+
'fetchFundingRate': true,
|
|
75581
|
+
'fetchFundingRateHistory': true,
|
|
75582
|
+
'fetchFundingRates': false,
|
|
75583
|
+
'fetchGreeks': false,
|
|
75584
|
+
'fetchIndexOHLCV': false,
|
|
75585
|
+
'fetchIsolatedBorrowRate': false,
|
|
75586
|
+
'fetchIsolatedBorrowRates': false,
|
|
75587
|
+
'fetchL3OrderBook': false,
|
|
75588
|
+
'fetchLedger': true,
|
|
75589
|
+
'fetchLedgerEntry': undefined,
|
|
75590
|
+
'fetchLeverage': true,
|
|
75591
|
+
'fetchLeverageTiers': false,
|
|
75592
|
+
'fetchMarketLeverageTiers': false,
|
|
75593
|
+
'fetchMarkets': true,
|
|
75594
|
+
'fetchMarkOHLCV': false,
|
|
75595
|
+
'fetchMySettlementHistory': false,
|
|
75596
|
+
'fetchMyTrades': true,
|
|
75597
|
+
'fetchOHLCV': true,
|
|
75598
|
+
'fetchOpenInterest': false,
|
|
75599
|
+
'fetchOpenInterestHistory': false,
|
|
75600
|
+
'fetchOpenOrder': undefined,
|
|
75601
|
+
'fetchOpenOrders': true,
|
|
75602
|
+
'fetchOrder': true,
|
|
75603
|
+
'fetchOrderBook': true,
|
|
75604
|
+
'fetchOrderBooks': false,
|
|
75605
|
+
'fetchOrders': false,
|
|
75606
|
+
'fetchOrderTrades': true,
|
|
75607
|
+
'fetchPermissions': undefined,
|
|
75608
|
+
'fetchPosition': true,
|
|
75609
|
+
'fetchPositions': true,
|
|
75610
|
+
'fetchPositionsForSymbol': false,
|
|
75611
|
+
'fetchPositionsRisk': false,
|
|
75612
|
+
'fetchPremiumIndexOHLCV': false,
|
|
75613
|
+
'fetchSettlementHistory': false,
|
|
75614
|
+
'fetchStatus': false,
|
|
75615
|
+
'fetchTicker': true,
|
|
75616
|
+
'fetchTickers': true,
|
|
75617
|
+
'fetchTime': false,
|
|
75618
|
+
'fetchTrades': true,
|
|
75619
|
+
'fetchTradingFee': false,
|
|
75620
|
+
'fetchTradingFees': false,
|
|
75621
|
+
'fetchTradingLimits': false,
|
|
75622
|
+
'fetchTransactionFee': false,
|
|
75623
|
+
'fetchTransactionFees': false,
|
|
75624
|
+
'fetchTransactions': false,
|
|
75625
|
+
'fetchTransfer': false,
|
|
75626
|
+
'fetchTransfers': false,
|
|
75627
|
+
'fetchUnderlyingAssets': false,
|
|
75628
|
+
'fetchVolatilityHistory': false,
|
|
75629
|
+
'fetchWithdrawal': false,
|
|
75630
|
+
'fetchWithdrawals': true,
|
|
75631
|
+
'fetchWithdrawalWhitelist': false,
|
|
75632
|
+
'reduceMargin': false,
|
|
75633
|
+
'repayCrossMargin': false,
|
|
75634
|
+
'setLeverage': true,
|
|
75635
|
+
'setMargin': false,
|
|
75636
|
+
'setMarginMode': false,
|
|
75637
|
+
'setPositionMode': false,
|
|
75638
|
+
'signIn': false,
|
|
75639
|
+
'transfer': true,
|
|
75640
|
+
'withdraw': false,
|
|
75641
|
+
},
|
|
75642
|
+
'timeframes': {
|
|
75643
|
+
'1m': '1m',
|
|
75644
|
+
'3m': '3m',
|
|
75645
|
+
'5m': '5m',
|
|
75646
|
+
'15m': '15m',
|
|
75647
|
+
'30m': '30m',
|
|
75648
|
+
'1h': '1H',
|
|
75649
|
+
'2h': '2H',
|
|
75650
|
+
'4h': '4H',
|
|
75651
|
+
'6h': '6H',
|
|
75652
|
+
'12h': '12H',
|
|
75653
|
+
'1d': '1D',
|
|
75654
|
+
'1w': '1W',
|
|
75655
|
+
'1M': '1M',
|
|
75656
|
+
'3M': '3M',
|
|
75657
|
+
},
|
|
75658
|
+
'hostname': 'www.blofin.com',
|
|
75659
|
+
'urls': {
|
|
75660
|
+
'logo': 'https://github.com/ccxt/ccxt/assets/43336371/255a7b29-341f-4d20-8342-fbfae4932807',
|
|
75661
|
+
'api': {
|
|
75662
|
+
'rest': 'https://openapi.blofin.com',
|
|
75663
|
+
},
|
|
75664
|
+
'referral': {
|
|
75665
|
+
'url': 'https://blofin.com/register?referral_code=jBd8U1',
|
|
75666
|
+
'discount': 0.05,
|
|
75667
|
+
},
|
|
75668
|
+
'www': 'https://www.blofin.com',
|
|
75669
|
+
'doc': 'https://blofin.com/docs',
|
|
75670
|
+
},
|
|
75671
|
+
'api': {
|
|
75672
|
+
'public': {
|
|
75673
|
+
'get': {
|
|
75674
|
+
'market/instruments': 1,
|
|
75675
|
+
'market/tickers': 1,
|
|
75676
|
+
'market/books': 1,
|
|
75677
|
+
'market/trades': 1,
|
|
75678
|
+
'market/candles': 1,
|
|
75679
|
+
'market/mark-price': 1,
|
|
75680
|
+
'market/funding-rate': 1,
|
|
75681
|
+
'market/funding-rate-history': 1,
|
|
75682
|
+
},
|
|
75683
|
+
},
|
|
75684
|
+
'private': {
|
|
75685
|
+
'get': {
|
|
75686
|
+
'asset/balances': 1,
|
|
75687
|
+
'trade/orders-pending': 1,
|
|
75688
|
+
'trade/fills-history': 1,
|
|
75689
|
+
'asset/deposit-history': 1,
|
|
75690
|
+
'asset/withdrawal-history': 1,
|
|
75691
|
+
'asset/bills': 1,
|
|
75692
|
+
'account/balance': 1,
|
|
75693
|
+
'account/positions': 1,
|
|
75694
|
+
'account/leverage-info': 1,
|
|
75695
|
+
'trade/orders-tpsl-pending': 1,
|
|
75696
|
+
'trade/orders-history': 1,
|
|
75697
|
+
'trade/orders-tpsl-history': 1,
|
|
75698
|
+
},
|
|
75699
|
+
'post': {
|
|
75700
|
+
'trade/order': 1,
|
|
75701
|
+
'trade/cancel-order': 1,
|
|
75702
|
+
'account/set-leverage': 1,
|
|
75703
|
+
'trade/batch-orders': 1,
|
|
75704
|
+
'trade/order-tpsl': 1,
|
|
75705
|
+
'trade/cancel-batch-orders': 1,
|
|
75706
|
+
'trade/cancel-tpsl': 1,
|
|
75707
|
+
'trade/close-position': 1,
|
|
75708
|
+
'asset/transfer': 1,
|
|
75709
|
+
},
|
|
75710
|
+
},
|
|
75711
|
+
},
|
|
75712
|
+
'fees': {
|
|
75713
|
+
'swap': {
|
|
75714
|
+
'taker': this.parseNumber('0.00060'),
|
|
75715
|
+
'maker': this.parseNumber('0.00020'),
|
|
75716
|
+
},
|
|
75717
|
+
},
|
|
75718
|
+
'requiredCredentials': {
|
|
75719
|
+
'apiKey': true,
|
|
75720
|
+
'secret': true,
|
|
75721
|
+
'password': true,
|
|
75722
|
+
},
|
|
75723
|
+
'exceptions': {
|
|
75724
|
+
'exact': {
|
|
75725
|
+
'400': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
75726
|
+
'401': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.AuthenticationError,
|
|
75727
|
+
'500': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError,
|
|
75728
|
+
'404': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
75729
|
+
'405': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
75730
|
+
'406': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
75731
|
+
'429': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.RateLimitExceeded,
|
|
75732
|
+
'152001': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
75733
|
+
'152002': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
75734
|
+
'152003': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
75735
|
+
'152004': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
75736
|
+
'152005': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
75737
|
+
'152006': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75738
|
+
'152007': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75739
|
+
'152008': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75740
|
+
'152009': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75741
|
+
'150003': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75742
|
+
'150004': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75743
|
+
'542': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75744
|
+
'102002': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75745
|
+
'102005': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75746
|
+
'102014': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75747
|
+
'102015': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75748
|
+
'102022': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75749
|
+
'102037': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75750
|
+
'102038': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75751
|
+
'102039': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75752
|
+
'102040': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75753
|
+
'102047': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75754
|
+
'102048': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75755
|
+
'102049': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75756
|
+
'102050': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75757
|
+
'102051': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75758
|
+
'102052': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75759
|
+
'102053': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75760
|
+
'102054': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75761
|
+
'102055': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
75762
|
+
'102064': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
75763
|
+
'102065': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
75764
|
+
'102068': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
75765
|
+
'103013': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError,
|
|
75766
|
+
'Order failed. Insufficient USDT margin in account': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InsufficientFunds, // Insufficient USDT margin in account
|
|
75767
|
+
},
|
|
75768
|
+
'broad': {
|
|
75769
|
+
'Internal Server Error': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeNotAvailable,
|
|
75770
|
+
'server error': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeNotAvailable, // {"code":500,"data":{},"detailMsg":"","error_code":"500","error_message":"server error 1236805249","msg":"server error 1236805249"}
|
|
75771
|
+
},
|
|
75772
|
+
},
|
|
75773
|
+
'httpExceptions': {
|
|
75774
|
+
'429': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeNotAvailable, // https://github.com/ccxt/ccxt/issues/9612
|
|
75775
|
+
},
|
|
75776
|
+
'precisionMode': _base_functions_number_js__WEBPACK_IMPORTED_MODULE_2__/* .TICK_SIZE */ .sh,
|
|
75777
|
+
'options': {
|
|
75778
|
+
'brokerId': 'ec6dd3a7dd982d0b',
|
|
75779
|
+
'accountsByType': {
|
|
75780
|
+
'swap': 'futures',
|
|
75781
|
+
'future': 'futures',
|
|
75782
|
+
},
|
|
75783
|
+
'accountsById': {
|
|
75784
|
+
'futures': 'swap',
|
|
75785
|
+
},
|
|
75786
|
+
'sandboxMode': false,
|
|
75787
|
+
'defaultNetwork': 'ERC20',
|
|
75788
|
+
'defaultNetworks': {
|
|
75789
|
+
'ETH': 'ERC20',
|
|
75790
|
+
'BTC': 'BTC',
|
|
75791
|
+
'USDT': 'TRC20',
|
|
75792
|
+
},
|
|
75793
|
+
'networks': {
|
|
75794
|
+
'BTC': 'Bitcoin',
|
|
75795
|
+
'BEP20': 'BSC',
|
|
75796
|
+
'ERC20': 'ERC20',
|
|
75797
|
+
'TRC20': 'TRC20',
|
|
75798
|
+
},
|
|
75799
|
+
'fetchOpenInterestHistory': {
|
|
75800
|
+
'timeframes': {
|
|
75801
|
+
'5m': '5m',
|
|
75802
|
+
'1h': '1H',
|
|
75803
|
+
'8h': '8H',
|
|
75804
|
+
'1d': '1D',
|
|
75805
|
+
'5M': '5m',
|
|
75806
|
+
'1H': '1H',
|
|
75807
|
+
'8H': '8H',
|
|
75808
|
+
'1D': '1D',
|
|
75809
|
+
},
|
|
75810
|
+
},
|
|
75811
|
+
'fetchOHLCV': {
|
|
75812
|
+
// 'type': 'Candles', // Candles or HistoryCandles, IndexCandles, MarkPriceCandles
|
|
75813
|
+
'timezone': 'UTC', // UTC, HK
|
|
75814
|
+
},
|
|
75815
|
+
'fetchPositions': {
|
|
75816
|
+
'method': 'privateGetAccountPositions', // privateGetAccountPositions or privateGetAccountPositionsHistory
|
|
75817
|
+
},
|
|
75818
|
+
'createOrder': 'privatePostTradeOrder',
|
|
75819
|
+
'createMarketBuyOrderRequiresPrice': false,
|
|
75820
|
+
'fetchMarkets': ['swap'],
|
|
75821
|
+
'defaultType': 'swap',
|
|
75822
|
+
'fetchLedger': {
|
|
75823
|
+
'method': 'privateGetAssetBills',
|
|
75824
|
+
},
|
|
75825
|
+
'fetchOpenOrders': {
|
|
75826
|
+
'method': 'privateGetTradeOrdersPending',
|
|
75827
|
+
},
|
|
75828
|
+
'cancelOrders': {
|
|
75829
|
+
'method': 'privatePostTradeCancelBatchOrders',
|
|
75830
|
+
},
|
|
75831
|
+
'fetchCanceledOrders': {
|
|
75832
|
+
'method': 'privateGetTradeOrdersHistory', // privateGetTradeOrdersTpslHistory
|
|
75833
|
+
},
|
|
75834
|
+
'fetchClosedOrders': {
|
|
75835
|
+
'method': 'privateGetTradeOrdersHistory', // privateGetTradeOrdersTpslHistory
|
|
75836
|
+
},
|
|
75837
|
+
'withdraw': {
|
|
75838
|
+
// a funding password credential is required by the exchange for the
|
|
75839
|
+
// withdraw call (not to be confused with the api password credential)
|
|
75840
|
+
'password': undefined,
|
|
75841
|
+
'pwd': undefined, // password or pwd both work
|
|
75842
|
+
},
|
|
75843
|
+
'exchangeType': {
|
|
75844
|
+
'spot': 'SPOT',
|
|
75845
|
+
'swap': 'SWAP',
|
|
75846
|
+
'SPOT': 'SPOT',
|
|
75847
|
+
'SWAP': 'SWAP',
|
|
75848
|
+
},
|
|
75849
|
+
},
|
|
75850
|
+
});
|
|
75851
|
+
}
|
|
75852
|
+
async fetchMarkets(params = {}) {
|
|
75853
|
+
/**
|
|
75854
|
+
* @method
|
|
75855
|
+
* @name blofin#fetchMarkets
|
|
75856
|
+
* @description retrieves data on all markets for blofin
|
|
75857
|
+
* @see https://blofin.com/docs#get-instruments
|
|
75858
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
75859
|
+
* @returns {object[]} an array of objects representing market data
|
|
75860
|
+
*/
|
|
75861
|
+
const response = await this.publicGetMarketInstruments(params);
|
|
75862
|
+
const data = this.safeList(response, 'data', []);
|
|
75863
|
+
return this.parseMarkets(data);
|
|
75864
|
+
}
|
|
75865
|
+
parseMarket(market) {
|
|
75866
|
+
const id = this.safeString(market, 'instId');
|
|
75867
|
+
const type = this.safeStringLower(market, 'instType');
|
|
75868
|
+
const spot = (type === 'spot');
|
|
75869
|
+
const future = (type === 'future');
|
|
75870
|
+
const swap = (type === 'swap');
|
|
75871
|
+
const option = (type === 'option');
|
|
75872
|
+
const contract = swap || future;
|
|
75873
|
+
const baseId = this.safeString(market, 'baseCurrency');
|
|
75874
|
+
const quoteId = this.safeString(market, 'quoteCurrency');
|
|
75875
|
+
const settleId = this.safeString(market, 'quoteCurrency');
|
|
75876
|
+
const settle = this.safeCurrencyCode(settleId);
|
|
75877
|
+
const base = this.safeCurrencyCode(baseId);
|
|
75878
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
75879
|
+
let symbol = base + '/' + quote;
|
|
75880
|
+
if (swap) {
|
|
75881
|
+
symbol = symbol + ':' + settle;
|
|
75882
|
+
}
|
|
75883
|
+
const expiry = undefined;
|
|
75884
|
+
const strikePrice = undefined;
|
|
75885
|
+
const optionType = undefined;
|
|
75886
|
+
const tickSize = this.safeString(market, 'tickSize');
|
|
75887
|
+
const fees = this.safeValue2(this.fees, type, 'trading', {});
|
|
75888
|
+
const taker = this.safeNumber(fees, 'taker');
|
|
75889
|
+
const maker = this.safeNumber(fees, 'maker');
|
|
75890
|
+
let maxLeverage = this.safeString(market, 'maxLeverage', '100');
|
|
75891
|
+
maxLeverage = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMax(maxLeverage, '1');
|
|
75892
|
+
const isActive = (this.safeString(market, 'state') === 'live');
|
|
75893
|
+
return this.safeMarketStructure({
|
|
75894
|
+
'id': id,
|
|
75895
|
+
'symbol': symbol,
|
|
75896
|
+
'base': base,
|
|
75897
|
+
'quote': quote,
|
|
75898
|
+
'baseId': baseId,
|
|
75899
|
+
'quoteId': quoteId,
|
|
75900
|
+
'settle': settle,
|
|
75901
|
+
'settleId': settleId,
|
|
75902
|
+
'type': type,
|
|
75903
|
+
'spot': spot,
|
|
75904
|
+
'option': option,
|
|
75905
|
+
'margin': spot && (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringGt(maxLeverage, '1')),
|
|
75906
|
+
'swap': swap,
|
|
75907
|
+
'future': future,
|
|
75908
|
+
'active': isActive,
|
|
75909
|
+
'taker': taker,
|
|
75910
|
+
'maker': maker,
|
|
75911
|
+
'contract': contract,
|
|
75912
|
+
'linear': contract ? (quoteId === settleId) : undefined,
|
|
75913
|
+
'inverse': contract ? (baseId === settleId) : undefined,
|
|
75914
|
+
'contractSize': contract ? this.safeNumber(market, 'contractValue') : undefined,
|
|
75915
|
+
'expiry': expiry,
|
|
75916
|
+
'expiryDatetime': expiry,
|
|
75917
|
+
'strike': strikePrice,
|
|
75918
|
+
'optionType': optionType,
|
|
75919
|
+
'created': this.safeInteger(market, 'listTime'),
|
|
75920
|
+
'precision': {
|
|
75921
|
+
'amount': this.safeNumber(market, 'lotSize'),
|
|
75922
|
+
'price': this.parseNumber(tickSize),
|
|
75923
|
+
},
|
|
75924
|
+
'limits': {
|
|
75925
|
+
'leverage': {
|
|
75926
|
+
'min': this.parseNumber('1'),
|
|
75927
|
+
'max': this.parseNumber(maxLeverage),
|
|
75928
|
+
},
|
|
75929
|
+
'amount': {
|
|
75930
|
+
'min': this.safeNumber(market, 'minSize'),
|
|
75931
|
+
'max': undefined,
|
|
75932
|
+
},
|
|
75933
|
+
'price': {
|
|
75934
|
+
'min': undefined,
|
|
75935
|
+
'max': undefined,
|
|
75936
|
+
},
|
|
75937
|
+
'cost': {
|
|
75938
|
+
'min': undefined,
|
|
75939
|
+
'max': undefined,
|
|
75940
|
+
},
|
|
75941
|
+
},
|
|
75942
|
+
'info': market,
|
|
75943
|
+
});
|
|
75944
|
+
}
|
|
75945
|
+
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
75946
|
+
/**
|
|
75947
|
+
* @method
|
|
75948
|
+
* @name blofin#fetchOrderBook
|
|
75949
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
75950
|
+
* @see https://blofin.com/docs#get-order-book
|
|
75951
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
75952
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
75953
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
75954
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
75955
|
+
*/
|
|
75956
|
+
await this.loadMarkets();
|
|
75957
|
+
const market = this.market(symbol);
|
|
75958
|
+
const request = {
|
|
75959
|
+
'instId': market['id'],
|
|
75960
|
+
};
|
|
75961
|
+
limit = (limit === undefined) ? 50 : limit;
|
|
75962
|
+
if (limit !== undefined) {
|
|
75963
|
+
request['size'] = limit; // max 100
|
|
75964
|
+
}
|
|
75965
|
+
const response = await this.publicGetMarketBooks(this.extend(request, params));
|
|
75966
|
+
//
|
|
75967
|
+
// {
|
|
75968
|
+
// "code": "0",
|
|
75969
|
+
// "msg": "",
|
|
75970
|
+
// "data": [
|
|
75971
|
+
// {
|
|
75972
|
+
// "asks": [
|
|
75973
|
+
// ["0.07228","4.211619","0","2"], // price, amount, liquidated orders, total open orders
|
|
75974
|
+
// ["0.0723","299.880364","0","2"],
|
|
75975
|
+
// ["0.07231","3.72832","0","1"],
|
|
75976
|
+
// ],
|
|
75977
|
+
// "bids": [
|
|
75978
|
+
// ["0.07221","18.5","0","1"],
|
|
75979
|
+
// ["0.0722","18.5","0","1"],
|
|
75980
|
+
// ["0.07219","0.505407","0","1"],
|
|
75981
|
+
// ],
|
|
75982
|
+
// "ts": "1621438475342"
|
|
75983
|
+
// }
|
|
75984
|
+
// ]
|
|
75985
|
+
// }
|
|
75986
|
+
//
|
|
75987
|
+
const data = this.safeList(response, 'data', []);
|
|
75988
|
+
const first = this.safeValue(data, 0, {});
|
|
75989
|
+
const timestamp = this.safeInteger(first, 'ts');
|
|
75990
|
+
return this.parseOrderBook(first, symbol, timestamp);
|
|
75991
|
+
}
|
|
75992
|
+
parseTicker(ticker, market = undefined) {
|
|
75993
|
+
const timestamp = this.safeInteger(ticker, 'ts');
|
|
75994
|
+
const marketId = this.safeString(ticker, 'instId');
|
|
75995
|
+
market = this.safeMarket(marketId, market, '-');
|
|
75996
|
+
const symbol = market['symbol'];
|
|
75997
|
+
const last = this.safeString(ticker, 'last');
|
|
75998
|
+
const open = this.safeString(ticker, 'open24h');
|
|
75999
|
+
const spot = this.safeValue(market, 'spot', false);
|
|
76000
|
+
const quoteVolume = spot ? this.safeString(ticker, 'volCurrency24h') : undefined;
|
|
76001
|
+
const baseVolume = this.safeString(ticker, 'vol24h');
|
|
76002
|
+
const high = this.safeString(ticker, 'high24h');
|
|
76003
|
+
const low = this.safeString(ticker, 'low24h');
|
|
76004
|
+
return this.safeTicker({
|
|
76005
|
+
'symbol': symbol,
|
|
76006
|
+
'timestamp': timestamp,
|
|
76007
|
+
'datetime': this.iso8601(timestamp),
|
|
76008
|
+
'high': high,
|
|
76009
|
+
'low': low,
|
|
76010
|
+
'bid': this.safeString(ticker, 'bidPrice'),
|
|
76011
|
+
'bidVolume': this.safeString(ticker, 'bidSize'),
|
|
76012
|
+
'ask': this.safeString(ticker, 'askPrice'),
|
|
76013
|
+
'askVolume': this.safeString(ticker, 'askSize'),
|
|
76014
|
+
'vwap': undefined,
|
|
76015
|
+
'open': open,
|
|
76016
|
+
'close': last,
|
|
76017
|
+
'last': last,
|
|
76018
|
+
'previousClose': undefined,
|
|
76019
|
+
'change': undefined,
|
|
76020
|
+
'percentage': undefined,
|
|
76021
|
+
'average': undefined,
|
|
76022
|
+
'baseVolume': baseVolume,
|
|
76023
|
+
'quoteVolume': quoteVolume,
|
|
76024
|
+
'info': ticker,
|
|
76025
|
+
}, market);
|
|
76026
|
+
}
|
|
76027
|
+
async fetchTicker(symbol, params = {}) {
|
|
76028
|
+
/**
|
|
76029
|
+
* @method
|
|
76030
|
+
* @name blofin#fetchTicker
|
|
76031
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
76032
|
+
* @see https://blofin.com/docs#get-tickers
|
|
76033
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
76034
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76035
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
76036
|
+
*/
|
|
76037
|
+
await this.loadMarkets();
|
|
76038
|
+
const market = this.market(symbol);
|
|
76039
|
+
const request = {
|
|
76040
|
+
'instId': market['id'],
|
|
76041
|
+
};
|
|
76042
|
+
const response = await this.publicGetMarketTickers(this.extend(request, params));
|
|
76043
|
+
const data = this.safeList(response, 'data', []);
|
|
76044
|
+
const first = this.safeValue(data, 0, {});
|
|
76045
|
+
return this.parseTicker(first, market);
|
|
76046
|
+
}
|
|
76047
|
+
async fetchTickers(symbols = undefined, params = {}) {
|
|
76048
|
+
/**
|
|
76049
|
+
* @method
|
|
76050
|
+
* @name blofin#fetchTickers
|
|
76051
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
76052
|
+
* @see https://blofin.com/docs#get-tickers
|
|
76053
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
76054
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76055
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
76056
|
+
*/
|
|
76057
|
+
await this.loadMarkets();
|
|
76058
|
+
symbols = this.marketSymbols(symbols);
|
|
76059
|
+
const response = await this.publicGetMarketTickers(params);
|
|
76060
|
+
const tickers = this.safeList(response, 'data', []);
|
|
76061
|
+
return this.parseTickers(tickers, symbols);
|
|
76062
|
+
}
|
|
76063
|
+
parseTrade(trade, market = undefined) {
|
|
76064
|
+
//
|
|
76065
|
+
// fetch trades
|
|
76066
|
+
// {
|
|
76067
|
+
// "tradeId": "3263934920",
|
|
76068
|
+
// "instId": "LTC-USDT",
|
|
76069
|
+
// "price": "67.87",
|
|
76070
|
+
// "size": "1",
|
|
76071
|
+
// "side": "buy",
|
|
76072
|
+
// "ts": "1707232020854"
|
|
76073
|
+
// }
|
|
76074
|
+
// my trades
|
|
76075
|
+
// {
|
|
76076
|
+
// "instId": "LTC-USDT",
|
|
76077
|
+
// "tradeId": "1440847",
|
|
76078
|
+
// "orderId": "2075705202",
|
|
76079
|
+
// "fillPrice": "67.850000000000000000",
|
|
76080
|
+
// "fillSize": "1.000000000000000000",
|
|
76081
|
+
// "fillPnl": "0.000000000000000000",
|
|
76082
|
+
// "side": "buy",
|
|
76083
|
+
// "positionSide": "net",
|
|
76084
|
+
// "fee": "0.040710000000000000",
|
|
76085
|
+
// "ts": "1707224678878",
|
|
76086
|
+
// "brokerId": ""
|
|
76087
|
+
// }
|
|
76088
|
+
//
|
|
76089
|
+
const id = this.safeString(trade, 'tradeId');
|
|
76090
|
+
const marketId = this.safeString(trade, 'instId');
|
|
76091
|
+
market = this.safeMarket(marketId, market, '-');
|
|
76092
|
+
const symbol = market['symbol'];
|
|
76093
|
+
const timestamp = this.safeInteger(trade, 'ts');
|
|
76094
|
+
const price = this.safeString2(trade, 'price', 'fillPrice');
|
|
76095
|
+
const amount = this.safeString2(trade, 'size', 'fillSize');
|
|
76096
|
+
const side = this.safeString(trade, 'side');
|
|
76097
|
+
const orderId = this.safeString(trade, 'orderId');
|
|
76098
|
+
const feeCost = this.safeString(trade, 'fee');
|
|
76099
|
+
let fee = undefined;
|
|
76100
|
+
if (feeCost !== undefined) {
|
|
76101
|
+
fee = {
|
|
76102
|
+
'cost': feeCost,
|
|
76103
|
+
'currency': market['settle'],
|
|
76104
|
+
};
|
|
76105
|
+
}
|
|
76106
|
+
return this.safeTrade({
|
|
76107
|
+
'info': trade,
|
|
76108
|
+
'timestamp': timestamp,
|
|
76109
|
+
'datetime': this.iso8601(timestamp),
|
|
76110
|
+
'symbol': symbol,
|
|
76111
|
+
'id': id,
|
|
76112
|
+
'order': orderId,
|
|
76113
|
+
'type': undefined,
|
|
76114
|
+
'takerOrMaker': undefined,
|
|
76115
|
+
'side': side,
|
|
76116
|
+
'price': price,
|
|
76117
|
+
'amount': amount,
|
|
76118
|
+
'cost': undefined,
|
|
76119
|
+
'fee': fee,
|
|
76120
|
+
}, market);
|
|
76121
|
+
}
|
|
76122
|
+
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
76123
|
+
/**
|
|
76124
|
+
* @method
|
|
76125
|
+
* @name blofin#fetchTrades
|
|
76126
|
+
* @description get the list of most recent trades for a particular symbol
|
|
76127
|
+
* @see https://blofin.com/docs#get-trades
|
|
76128
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
76129
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
76130
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
76131
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76132
|
+
* @param {boolean} [params.paginate] *only applies to publicGetMarketHistoryTrades* default false, when true will automatically paginate by calling this endpoint multiple times
|
|
76133
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
76134
|
+
*/
|
|
76135
|
+
await this.loadMarkets();
|
|
76136
|
+
let paginate = false;
|
|
76137
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchTrades', 'paginate');
|
|
76138
|
+
if (paginate) {
|
|
76139
|
+
return await this.fetchPaginatedCallCursor('fetchTrades', symbol, since, limit, params, 'tradeId', 'after', undefined, 100);
|
|
76140
|
+
}
|
|
76141
|
+
const market = this.market(symbol);
|
|
76142
|
+
const request = {
|
|
76143
|
+
'instId': market['id'],
|
|
76144
|
+
};
|
|
76145
|
+
let response = undefined;
|
|
76146
|
+
if (limit !== undefined) {
|
|
76147
|
+
request['limit'] = limit; // default 100
|
|
76148
|
+
}
|
|
76149
|
+
let method = undefined;
|
|
76150
|
+
[method, params] = this.handleOptionAndParams(params, 'fetchTrades', 'method', 'publicGetMarketTrades');
|
|
76151
|
+
if (method === 'publicGetMarketTrades') {
|
|
76152
|
+
response = await this.publicGetMarketTrades(this.extend(request, params));
|
|
76153
|
+
}
|
|
76154
|
+
const data = this.safeList(response, 'data', []);
|
|
76155
|
+
return this.parseTrades(data, market, since, limit);
|
|
76156
|
+
}
|
|
76157
|
+
parseOHLCV(ohlcv, market = undefined) {
|
|
76158
|
+
//
|
|
76159
|
+
// [
|
|
76160
|
+
// "1678928760000", // timestamp
|
|
76161
|
+
// "24341.4", // open
|
|
76162
|
+
// "24344", // high
|
|
76163
|
+
// "24313.2", // low
|
|
76164
|
+
// "24323", // close
|
|
76165
|
+
// "628", // contract volume
|
|
76166
|
+
// "2.5819", // base volume
|
|
76167
|
+
// "62800", // quote volume
|
|
76168
|
+
// "0" // candlestick state
|
|
76169
|
+
// ]
|
|
76170
|
+
//
|
|
76171
|
+
return [
|
|
76172
|
+
this.safeInteger(ohlcv, 0),
|
|
76173
|
+
this.safeNumber(ohlcv, 1),
|
|
76174
|
+
this.safeNumber(ohlcv, 2),
|
|
76175
|
+
this.safeNumber(ohlcv, 3),
|
|
76176
|
+
this.safeNumber(ohlcv, 4),
|
|
76177
|
+
this.safeNumber(ohlcv, 6),
|
|
76178
|
+
];
|
|
76179
|
+
}
|
|
76180
|
+
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
76181
|
+
/**
|
|
76182
|
+
* @method
|
|
76183
|
+
* @name blofin#fetchOHLCV
|
|
76184
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
76185
|
+
* @see https://blofin.com/docs#get-candlesticks
|
|
76186
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
76187
|
+
* @param {string} timeframe the length of time each candle represents
|
|
76188
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
76189
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
76190
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76191
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
76192
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
76193
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
76194
|
+
*/
|
|
76195
|
+
await this.loadMarkets();
|
|
76196
|
+
const market = this.market(symbol);
|
|
76197
|
+
let paginate = false;
|
|
76198
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
|
|
76199
|
+
if (paginate) {
|
|
76200
|
+
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 100);
|
|
76201
|
+
}
|
|
76202
|
+
if (limit === undefined) {
|
|
76203
|
+
limit = 100; // default 100, max 100
|
|
76204
|
+
}
|
|
76205
|
+
const request = {
|
|
76206
|
+
'instId': market['id'],
|
|
76207
|
+
'bar': this.safeString(this.timeframes, timeframe, timeframe),
|
|
76208
|
+
'limit': limit,
|
|
76209
|
+
};
|
|
76210
|
+
const until = this.safeInteger(params, 'until');
|
|
76211
|
+
if (until !== undefined) {
|
|
76212
|
+
request['after'] = until;
|
|
76213
|
+
params = this.omit(params, 'until');
|
|
76214
|
+
}
|
|
76215
|
+
let response = undefined;
|
|
76216
|
+
response = await this.publicGetMarketCandles(this.extend(request, params));
|
|
76217
|
+
const data = this.safeList(response, 'data', []);
|
|
76218
|
+
return this.parseOHLCVs(data, market, timeframe, since, limit);
|
|
76219
|
+
}
|
|
76220
|
+
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
76221
|
+
/**
|
|
76222
|
+
* @method
|
|
76223
|
+
* @name blofin#fetchFundingRateHistory
|
|
76224
|
+
* @description fetches historical funding rate prices
|
|
76225
|
+
* @see https://blofin.com/docs#get-funding-rate-history
|
|
76226
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
76227
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
76228
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
76229
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76230
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
76231
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
76232
|
+
*/
|
|
76233
|
+
if (symbol === undefined) {
|
|
76234
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
76235
|
+
}
|
|
76236
|
+
await this.loadMarkets();
|
|
76237
|
+
let paginate = false;
|
|
76238
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
|
|
76239
|
+
if (paginate) {
|
|
76240
|
+
return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params);
|
|
76241
|
+
}
|
|
76242
|
+
const market = this.market(symbol);
|
|
76243
|
+
const request = {
|
|
76244
|
+
'instId': market['id'],
|
|
76245
|
+
};
|
|
76246
|
+
if (since !== undefined) {
|
|
76247
|
+
request['before'] = Math.max(since - 1, 0);
|
|
76248
|
+
}
|
|
76249
|
+
if (limit !== undefined) {
|
|
76250
|
+
request['limit'] = limit;
|
|
76251
|
+
}
|
|
76252
|
+
const response = await this.publicGetMarketFundingRateHistory(this.extend(request, params));
|
|
76253
|
+
const rates = [];
|
|
76254
|
+
const data = this.safeList(response, 'data', []);
|
|
76255
|
+
for (let i = 0; i < data.length; i++) {
|
|
76256
|
+
const rate = data[i];
|
|
76257
|
+
const timestamp = this.safeInteger(rate, 'fundingTime');
|
|
76258
|
+
rates.push({
|
|
76259
|
+
'info': rate,
|
|
76260
|
+
'symbol': market['symbol'],
|
|
76261
|
+
'fundingRate': this.safeNumber(rate, 'fundingRate'),
|
|
76262
|
+
'timestamp': timestamp,
|
|
76263
|
+
'datetime': this.iso8601(timestamp),
|
|
76264
|
+
});
|
|
76265
|
+
}
|
|
76266
|
+
const sorted = this.sortBy(rates, 'timestamp');
|
|
76267
|
+
return this.filterBySymbolSinceLimit(sorted, market['symbol'], since, limit);
|
|
76268
|
+
}
|
|
76269
|
+
parseFundingRate(contract, market = undefined) {
|
|
76270
|
+
//
|
|
76271
|
+
// {
|
|
76272
|
+
// "fundingRate": "0.00027815",
|
|
76273
|
+
// "fundingTime": "1634256000000",
|
|
76274
|
+
// "instId": "BTC-USD-SWAP",
|
|
76275
|
+
// "instType": "SWAP",
|
|
76276
|
+
// "nextFundingRate": "0.00017",
|
|
76277
|
+
// "nextFundingTime": "1634284800000"
|
|
76278
|
+
// }
|
|
76279
|
+
//
|
|
76280
|
+
// in the response above nextFundingRate is actually two funding rates from now
|
|
76281
|
+
//
|
|
76282
|
+
const nextFundingRateTimestamp = this.safeInteger(contract, 'nextFundingTime');
|
|
76283
|
+
const marketId = this.safeString(contract, 'instId');
|
|
76284
|
+
const symbol = this.safeSymbol(marketId, market);
|
|
76285
|
+
const nextFundingRate = this.safeNumber(contract, 'nextFundingRate');
|
|
76286
|
+
const fundingTime = this.safeInteger(contract, 'fundingTime');
|
|
76287
|
+
// > The current interest is 0.
|
|
76288
|
+
return {
|
|
76289
|
+
'info': contract,
|
|
76290
|
+
'symbol': symbol,
|
|
76291
|
+
'markPrice': undefined,
|
|
76292
|
+
'indexPrice': undefined,
|
|
76293
|
+
'interestRate': this.parseNumber('0'),
|
|
76294
|
+
'estimatedSettlePrice': undefined,
|
|
76295
|
+
'timestamp': undefined,
|
|
76296
|
+
'datetime': undefined,
|
|
76297
|
+
'fundingRate': this.safeNumber(contract, 'fundingRate'),
|
|
76298
|
+
'fundingTimestamp': fundingTime,
|
|
76299
|
+
'fundingDatetime': this.iso8601(fundingTime),
|
|
76300
|
+
'nextFundingRate': nextFundingRate,
|
|
76301
|
+
'nextFundingTimestamp': nextFundingRateTimestamp,
|
|
76302
|
+
'nextFundingDatetime': this.iso8601(nextFundingRateTimestamp),
|
|
76303
|
+
'previousFundingRate': undefined,
|
|
76304
|
+
'previousFundingTimestamp': undefined,
|
|
76305
|
+
'previousFundingDatetime': undefined,
|
|
76306
|
+
};
|
|
76307
|
+
}
|
|
76308
|
+
async fetchFundingRate(symbol, params = {}) {
|
|
76309
|
+
/**
|
|
76310
|
+
* @method
|
|
76311
|
+
* @name blofin#fetchFundingRate
|
|
76312
|
+
* @description fetch the current funding rate
|
|
76313
|
+
* @see https://blofin.com/docs#get-funding-rate
|
|
76314
|
+
* @param {string} symbol unified market symbol
|
|
76315
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76316
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
76317
|
+
*/
|
|
76318
|
+
await this.loadMarkets();
|
|
76319
|
+
const market = this.market(symbol);
|
|
76320
|
+
if (!market['swap']) {
|
|
76321
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(this.id + ' fetchFundingRate() is only valid for swap markets');
|
|
76322
|
+
}
|
|
76323
|
+
const request = {
|
|
76324
|
+
'instId': market['id'],
|
|
76325
|
+
};
|
|
76326
|
+
const response = await this.publicGetMarketFundingRate(this.extend(request, params));
|
|
76327
|
+
//
|
|
76328
|
+
// {
|
|
76329
|
+
// "code": "0",
|
|
76330
|
+
// "data": [
|
|
76331
|
+
// {
|
|
76332
|
+
// "fundingRate": "0.00027815",
|
|
76333
|
+
// "fundingTime": "1634256000000",
|
|
76334
|
+
// "instId": "BTC-USD-SWAP",
|
|
76335
|
+
// "instType": "SWAP",
|
|
76336
|
+
// "nextFundingRate": "0.00017",
|
|
76337
|
+
// "nextFundingTime": "1634284800000"
|
|
76338
|
+
// }
|
|
76339
|
+
// ],
|
|
76340
|
+
// "msg": ""
|
|
76341
|
+
// }
|
|
76342
|
+
//
|
|
76343
|
+
const data = this.safeList(response, 'data', []);
|
|
76344
|
+
const entry = this.safeDict(data, 0, {});
|
|
76345
|
+
return this.parseFundingRate(entry, market);
|
|
76346
|
+
}
|
|
76347
|
+
parseBalanceByType(type, response) {
|
|
76348
|
+
if (type) {
|
|
76349
|
+
return this.parseFundingBalance(response);
|
|
76350
|
+
}
|
|
76351
|
+
else {
|
|
76352
|
+
return this.parseTradingBalance(response);
|
|
76353
|
+
}
|
|
76354
|
+
}
|
|
76355
|
+
parseTradingBalance(response) {
|
|
76356
|
+
//
|
|
76357
|
+
// {
|
|
76358
|
+
// "code": "0",
|
|
76359
|
+
// "msg": "success",
|
|
76360
|
+
// "data": {
|
|
76361
|
+
// "ts": "1697021343571",
|
|
76362
|
+
// "totalEquity": "10011254.077985990315787910",
|
|
76363
|
+
// "isolatedEquity": "861.763132108800000000",
|
|
76364
|
+
// "details": [
|
|
76365
|
+
// {
|
|
76366
|
+
// "currency": "USDT",
|
|
76367
|
+
// "equity": "10014042.988958415234430699548",
|
|
76368
|
+
// "balance": "10013119.885958415234430699",
|
|
76369
|
+
// "ts": "1697021343571",
|
|
76370
|
+
// "isolatedEquity": "862.003200000000000000048",
|
|
76371
|
+
// "available": "9996399.4708691159703362725",
|
|
76372
|
+
// "availableEquity": "9996399.4708691159703362725",
|
|
76373
|
+
// "frozen": "15805.149672632597427761",
|
|
76374
|
+
// "orderFrozen": "14920.994472632597427761",
|
|
76375
|
+
// "equityUsd": "10011254.077985990315787910",
|
|
76376
|
+
// "isolatedUnrealizedPnl": "-22.151999999999999999952",
|
|
76377
|
+
// "bonus": "0"
|
|
76378
|
+
// }
|
|
76379
|
+
// ]
|
|
76380
|
+
// }
|
|
76381
|
+
// }
|
|
76382
|
+
//
|
|
76383
|
+
const result = { 'info': response };
|
|
76384
|
+
const data = this.safeDict(response, 'data', {});
|
|
76385
|
+
const timestamp = this.safeInteger(data, 'ts');
|
|
76386
|
+
const details = this.safeList(data, 'details', []);
|
|
76387
|
+
for (let i = 0; i < details.length; i++) {
|
|
76388
|
+
const balance = details[i];
|
|
76389
|
+
const currencyId = this.safeString(balance, 'currency');
|
|
76390
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
76391
|
+
const account = this.account();
|
|
76392
|
+
// it may be incorrect to use total, free and used for swap accounts
|
|
76393
|
+
const eq = this.safeString(balance, 'equity');
|
|
76394
|
+
const availEq = this.safeString(balance, 'available');
|
|
76395
|
+
if ((eq === undefined) || (availEq === undefined)) {
|
|
76396
|
+
account['free'] = this.safeString(balance, 'availableEquity');
|
|
76397
|
+
account['used'] = this.safeString(balance, 'frozen');
|
|
76398
|
+
}
|
|
76399
|
+
else {
|
|
76400
|
+
account['total'] = eq;
|
|
76401
|
+
account['free'] = availEq;
|
|
76402
|
+
}
|
|
76403
|
+
result[code] = account;
|
|
76404
|
+
}
|
|
76405
|
+
result['timestamp'] = timestamp;
|
|
76406
|
+
result['datetime'] = this.iso8601(timestamp);
|
|
76407
|
+
return this.safeBalance(result);
|
|
76408
|
+
}
|
|
76409
|
+
parseFundingBalance(response) {
|
|
76410
|
+
//
|
|
76411
|
+
// {
|
|
76412
|
+
// "code": "0",
|
|
76413
|
+
// "msg": "success",
|
|
76414
|
+
// "data": [
|
|
76415
|
+
// {
|
|
76416
|
+
// "currency": "USDT",
|
|
76417
|
+
// "balance": "10012514.919418081548717298",
|
|
76418
|
+
// "available": "9872132.414278782284622898",
|
|
76419
|
+
// "frozen": "138556.471805965930761067",
|
|
76420
|
+
// "bonus": "0"
|
|
76421
|
+
// }
|
|
76422
|
+
// ]
|
|
76423
|
+
// }
|
|
76424
|
+
//
|
|
76425
|
+
const result = { 'info': response };
|
|
76426
|
+
const data = this.safeList(response, 'data', []);
|
|
76427
|
+
for (let i = 0; i < data.length; i++) {
|
|
76428
|
+
const balance = data[i];
|
|
76429
|
+
const currencyId = this.safeString(balance, 'currency');
|
|
76430
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
76431
|
+
const account = this.account();
|
|
76432
|
+
// it may be incorrect to use total, free and used for swap accounts
|
|
76433
|
+
account['total'] = this.safeString(balance, 'balance');
|
|
76434
|
+
account['free'] = this.safeString(balance, 'available');
|
|
76435
|
+
account['used'] = this.safeString(balance, 'frozen');
|
|
76436
|
+
result[code] = account;
|
|
76437
|
+
}
|
|
76438
|
+
return this.safeBalance(result);
|
|
76439
|
+
}
|
|
76440
|
+
parseTradingFee(fee, market = undefined) {
|
|
76441
|
+
return {
|
|
76442
|
+
'info': fee,
|
|
76443
|
+
'symbol': this.safeSymbol(undefined, market),
|
|
76444
|
+
// blofin returns the fees as negative values opposed to other exchanges, so the sign needs to be flipped
|
|
76445
|
+
'maker': this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringNeg(this.safeString2(fee, 'maker', 'makerU'))),
|
|
76446
|
+
'taker': this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringNeg(this.safeString2(fee, 'taker', 'takerU'))),
|
|
76447
|
+
};
|
|
76448
|
+
}
|
|
76449
|
+
async fetchBalance(params = {}) {
|
|
76450
|
+
/**
|
|
76451
|
+
* @method
|
|
76452
|
+
* @name blofin#fetchBalance
|
|
76453
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
76454
|
+
* @see https://blofin.com/docs#get-balance
|
|
76455
|
+
* @see https://blofin.com/docs#get-futures-account-balance
|
|
76456
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76457
|
+
* @param {string} [params.accountType] the type of account to fetch the balance for, either 'funding' or 'futures' or 'copy_trading' or 'earn'
|
|
76458
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
76459
|
+
*/
|
|
76460
|
+
await this.loadMarkets();
|
|
76461
|
+
const accountType = this.safeString2(params, 'accountType', 'type');
|
|
76462
|
+
params = this.omit(params, ['accountType', 'type']);
|
|
76463
|
+
const request = {};
|
|
76464
|
+
let response = undefined;
|
|
76465
|
+
if (accountType !== undefined) {
|
|
76466
|
+
const parsedAccountType = this.safeString(this.options, 'accountsByType', accountType);
|
|
76467
|
+
request['accountType'] = parsedAccountType;
|
|
76468
|
+
response = await this.privateGetAssetBalances(this.extend(request, params));
|
|
76469
|
+
}
|
|
76470
|
+
else {
|
|
76471
|
+
response = await this.privateGetAccountBalance(this.extend(request, params));
|
|
76472
|
+
}
|
|
76473
|
+
return this.parseBalanceByType(accountType, response);
|
|
76474
|
+
}
|
|
76475
|
+
createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
76476
|
+
const market = this.market(symbol);
|
|
76477
|
+
const request = {
|
|
76478
|
+
'instId': market['id'],
|
|
76479
|
+
'side': side,
|
|
76480
|
+
'orderType': type,
|
|
76481
|
+
'size': this.amountToPrecision(symbol, amount),
|
|
76482
|
+
'brokerId': this.safeString(this.options, 'brokerId', 'ec6dd3a7dd982d0b'),
|
|
76483
|
+
};
|
|
76484
|
+
let marginMode = undefined;
|
|
76485
|
+
[marginMode, params] = this.handleMarginModeAndParams('createOrder', params, 'cross');
|
|
76486
|
+
request['marginMode'] = marginMode;
|
|
76487
|
+
const timeInForce = this.safeString(params, 'timeInForce', 'GTC');
|
|
76488
|
+
const isMarketOrder = type === 'market';
|
|
76489
|
+
params = this.omit(params, ['timeInForce']);
|
|
76490
|
+
const ioc = (timeInForce === 'IOC') || (type === 'ioc');
|
|
76491
|
+
const marketIOC = (isMarketOrder && ioc);
|
|
76492
|
+
if (isMarketOrder || marketIOC) {
|
|
76493
|
+
request['orderType'] = 'market';
|
|
76494
|
+
}
|
|
76495
|
+
else {
|
|
76496
|
+
request['price'] = this.priceToPrecision(symbol, price);
|
|
76497
|
+
}
|
|
76498
|
+
let postOnly = false;
|
|
76499
|
+
[postOnly, params] = this.handlePostOnly(isMarketOrder, type === 'post_only', params);
|
|
76500
|
+
if (postOnly) {
|
|
76501
|
+
request['type'] = 'post_only';
|
|
76502
|
+
}
|
|
76503
|
+
const stopLoss = this.safeValue(params, 'stopLoss');
|
|
76504
|
+
const takeProfit = this.safeValue(params, 'takeProfit');
|
|
76505
|
+
params = this.omit(params, ['stopLoss', 'takeProfit']);
|
|
76506
|
+
const isStopLoss = stopLoss !== undefined;
|
|
76507
|
+
const isTakeProfit = takeProfit !== undefined;
|
|
76508
|
+
if (isStopLoss || isTakeProfit) {
|
|
76509
|
+
if (isStopLoss) {
|
|
76510
|
+
const slTriggerPrice = this.safeString2(stopLoss, 'triggerPrice', 'stopPrice');
|
|
76511
|
+
request['slTriggerPrice'] = this.priceToPrecision(symbol, slTriggerPrice);
|
|
76512
|
+
const slOrderPrice = this.safeString(stopLoss, 'price', '-1');
|
|
76513
|
+
request['slOrderPrice'] = this.priceToPrecision(symbol, slOrderPrice);
|
|
76514
|
+
}
|
|
76515
|
+
if (isTakeProfit) {
|
|
76516
|
+
const tpTriggerPrice = this.safeString2(takeProfit, 'triggerPrice', 'stopPrice');
|
|
76517
|
+
request['tpTriggerPrice'] = this.priceToPrecision(symbol, tpTriggerPrice);
|
|
76518
|
+
const tpPrice = this.safeString(takeProfit, 'price', '-1');
|
|
76519
|
+
request['tpOrderPrice'] = this.priceToPrecision(symbol, tpPrice);
|
|
76520
|
+
}
|
|
76521
|
+
}
|
|
76522
|
+
return this.extend(request, params);
|
|
76523
|
+
}
|
|
76524
|
+
parseOrderStatus(status) {
|
|
76525
|
+
const statuses = {
|
|
76526
|
+
'canceled': 'canceled',
|
|
76527
|
+
'order_failed': 'canceled',
|
|
76528
|
+
'live': 'open',
|
|
76529
|
+
'partially_filled': 'open',
|
|
76530
|
+
'filled': 'closed',
|
|
76531
|
+
'effective': 'closed',
|
|
76532
|
+
};
|
|
76533
|
+
return this.safeString(statuses, status, status);
|
|
76534
|
+
}
|
|
76535
|
+
parseOrder(order, market = undefined) {
|
|
76536
|
+
//
|
|
76537
|
+
// {
|
|
76538
|
+
// "orderId": "2075628533",
|
|
76539
|
+
// "clientOrderId": "",
|
|
76540
|
+
// "instId": "LTC-USDT",
|
|
76541
|
+
// "marginMode": "cross",
|
|
76542
|
+
// "positionSide": "net",
|
|
76543
|
+
// "side": "buy",
|
|
76544
|
+
// "orderType": "market",
|
|
76545
|
+
// "price": "0.000000000000000000",
|
|
76546
|
+
// "size": "1.000000000000000000",
|
|
76547
|
+
// "reduceOnly": "true",
|
|
76548
|
+
// "leverage": "3",
|
|
76549
|
+
// "state": "filled",
|
|
76550
|
+
// "filledSize": "1.000000000000000000",
|
|
76551
|
+
// "pnl": "-0.050000000000000000",
|
|
76552
|
+
// "averagePrice": "68.110000000000000000",
|
|
76553
|
+
// "fee": "0.040866000000000000",
|
|
76554
|
+
// "createTime": "1706891359010",
|
|
76555
|
+
// "updateTime": "1706891359098",
|
|
76556
|
+
// "orderCategory": "normal",
|
|
76557
|
+
// "tpTriggerPrice": null,
|
|
76558
|
+
// "tpOrderPrice": null,
|
|
76559
|
+
// "slTriggerPrice": null,
|
|
76560
|
+
// "slOrderPrice": null,
|
|
76561
|
+
// "cancelSource": "not_canceled",
|
|
76562
|
+
// "cancelSourceReason": null,
|
|
76563
|
+
// "brokerId": "ec6dd3a7dd982d0b"
|
|
76564
|
+
// }
|
|
76565
|
+
//
|
|
76566
|
+
const id = this.safeString2(order, 'tpslId', 'orderId');
|
|
76567
|
+
const timestamp = this.safeInteger(order, 'createTime');
|
|
76568
|
+
const lastUpdateTimestamp = this.safeInteger(order, 'updateTime');
|
|
76569
|
+
const lastTradeTimestamp = this.safeInteger(order, 'fillTime');
|
|
76570
|
+
const side = this.safeString(order, 'side');
|
|
76571
|
+
let type = this.safeString(order, 'orderType');
|
|
76572
|
+
let postOnly = undefined;
|
|
76573
|
+
let timeInForce = undefined;
|
|
76574
|
+
if (type === 'post_only') {
|
|
76575
|
+
postOnly = true;
|
|
76576
|
+
type = 'limit';
|
|
76577
|
+
}
|
|
76578
|
+
else if (type === 'fok') {
|
|
76579
|
+
timeInForce = 'FOK';
|
|
76580
|
+
type = 'limit';
|
|
76581
|
+
}
|
|
76582
|
+
else if (type === 'ioc') {
|
|
76583
|
+
timeInForce = 'IOC';
|
|
76584
|
+
type = 'limit';
|
|
76585
|
+
}
|
|
76586
|
+
const marketId = this.safeString(order, 'instId');
|
|
76587
|
+
market = this.safeMarket(marketId, market);
|
|
76588
|
+
const symbol = this.safeSymbol(marketId, market, '-');
|
|
76589
|
+
const filled = this.safeString(order, 'filledSize');
|
|
76590
|
+
const price = this.safeString2(order, 'px', 'price');
|
|
76591
|
+
const average = this.safeString(order, 'averagePrice');
|
|
76592
|
+
const status = this.parseOrderStatus(this.safeString(order, 'state'));
|
|
76593
|
+
const feeCostString = this.safeString(order, 'fee');
|
|
76594
|
+
const amount = this.safeString(order, 'size');
|
|
76595
|
+
const leverage = this.safeString(order, 'leverage', '1');
|
|
76596
|
+
const contractSize = this.safeString(market, 'contractSize');
|
|
76597
|
+
const baseAmount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(contractSize, filled);
|
|
76598
|
+
let cost = undefined;
|
|
76599
|
+
if (average !== undefined) {
|
|
76600
|
+
cost = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(average, baseAmount);
|
|
76601
|
+
cost = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv(cost, leverage);
|
|
76602
|
+
}
|
|
76603
|
+
// spot market buy: "sz" can refer either to base currency units or to quote currency units
|
|
76604
|
+
let fee = undefined;
|
|
76605
|
+
if (feeCostString !== undefined) {
|
|
76606
|
+
const feeCostSigned = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAbs(feeCostString);
|
|
76607
|
+
const feeCurrencyId = this.safeString(order, 'feeCcy', 'USDT');
|
|
76608
|
+
const feeCurrencyCode = this.safeCurrencyCode(feeCurrencyId);
|
|
76609
|
+
fee = {
|
|
76610
|
+
'cost': this.parseNumber(feeCostSigned),
|
|
76611
|
+
'currency': feeCurrencyCode,
|
|
76612
|
+
};
|
|
76613
|
+
}
|
|
76614
|
+
let clientOrderId = this.safeString(order, 'clientOrderId');
|
|
76615
|
+
if ((clientOrderId !== undefined) && (clientOrderId.length < 1)) {
|
|
76616
|
+
clientOrderId = undefined; // fix empty clientOrderId string
|
|
76617
|
+
}
|
|
76618
|
+
const stopLossTriggerPrice = this.safeNumber(order, 'slTriggerPrice');
|
|
76619
|
+
const stopLossPrice = this.safeNumber(order, 'slOrderPrice');
|
|
76620
|
+
const takeProfitTriggerPrice = this.safeNumber(order, 'tpTriggerPrice');
|
|
76621
|
+
const takeProfitPrice = this.safeNumber(order, 'tpOrderPrice');
|
|
76622
|
+
const reduceOnlyRaw = this.safeString(order, 'reduceOnly');
|
|
76623
|
+
const reduceOnly = (reduceOnlyRaw === 'true');
|
|
76624
|
+
return this.safeOrder({
|
|
76625
|
+
'info': order,
|
|
76626
|
+
'id': id,
|
|
76627
|
+
'clientOrderId': clientOrderId,
|
|
76628
|
+
'timestamp': timestamp,
|
|
76629
|
+
'datetime': this.iso8601(timestamp),
|
|
76630
|
+
'lastTradeTimestamp': lastTradeTimestamp,
|
|
76631
|
+
'lastUpdateTimestamp': lastUpdateTimestamp,
|
|
76632
|
+
'symbol': symbol,
|
|
76633
|
+
'type': type,
|
|
76634
|
+
'timeInForce': timeInForce,
|
|
76635
|
+
'postOnly': postOnly,
|
|
76636
|
+
'side': side,
|
|
76637
|
+
'price': price,
|
|
76638
|
+
'stopLossTriggerPrice': stopLossTriggerPrice,
|
|
76639
|
+
'takeProfitTriggerPrice': takeProfitTriggerPrice,
|
|
76640
|
+
'stopLossPrice': stopLossPrice,
|
|
76641
|
+
'takeProfitPrice': takeProfitPrice,
|
|
76642
|
+
'average': average,
|
|
76643
|
+
'cost': cost,
|
|
76644
|
+
'amount': amount,
|
|
76645
|
+
'filled': filled,
|
|
76646
|
+
'remaining': undefined,
|
|
76647
|
+
'status': status,
|
|
76648
|
+
'fee': fee,
|
|
76649
|
+
'trades': undefined,
|
|
76650
|
+
'reduceOnly': reduceOnly,
|
|
76651
|
+
}, market);
|
|
76652
|
+
}
|
|
76653
|
+
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
76654
|
+
/**
|
|
76655
|
+
* @method
|
|
76656
|
+
* @name blofin#createOrder
|
|
76657
|
+
* @description create a trade order
|
|
76658
|
+
* @see https://blofin.com/docs#place-order
|
|
76659
|
+
* @see https://blofin.com/docs#place-tpsl-order
|
|
76660
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
76661
|
+
* @param {string} type 'market' or 'limit' or 'post_only' or 'ioc' or 'fok'
|
|
76662
|
+
* @param {string} side 'buy' or 'sell'
|
|
76663
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
76664
|
+
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
76665
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76666
|
+
* @param {bool} [params.reduceOnly] a mark to reduce the position size for margin, swap and future orders
|
|
76667
|
+
* @param {bool} [params.postOnly] true to place a post only order
|
|
76668
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', default is 'cross'
|
|
76669
|
+
* @param {float} [params.stopLossPrice] stop loss trigger price (will use privatePostTradeOrderTpsl)
|
|
76670
|
+
* @param {float} [params.takeProfitPrice] take profit trigger price (will use privatePostTradeOrderTpsl)
|
|
76671
|
+
* @param {string} [param.positionSide] *stopLossPrice/takeProfitPrice orders only* 'long' or 'short' or 'net' default is 'net'
|
|
76672
|
+
* @param {string} [params.clientOrderId] a unique id for the order
|
|
76673
|
+
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
|
76674
|
+
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
76675
|
+
* @param {float} [params.takeProfit.price] take profit order price (if not provided the order will be a market order)
|
|
76676
|
+
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
|
76677
|
+
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
76678
|
+
* @param {float} [params.stopLoss.price] stop loss order price (if not provided the order will be a market order)
|
|
76679
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
76680
|
+
*/
|
|
76681
|
+
await this.loadMarkets();
|
|
76682
|
+
const market = this.market(symbol);
|
|
76683
|
+
const tpsl = this.safeBool(params, 'tpsl', false);
|
|
76684
|
+
params = this.omit(params, 'tpsl');
|
|
76685
|
+
let method = undefined;
|
|
76686
|
+
[method, params] = this.handleOptionAndParams(params, 'createOrder', 'method', 'privatePostTradeOrder');
|
|
76687
|
+
const isStopLossPriceDefined = this.safeString(params, 'stopLossPrice') !== undefined;
|
|
76688
|
+
const isTakeProfitPriceDefined = this.safeString(params, 'takeProfitPrice') !== undefined;
|
|
76689
|
+
const isType2Order = (isStopLossPriceDefined || isTakeProfitPriceDefined);
|
|
76690
|
+
let response = undefined;
|
|
76691
|
+
if (tpsl || (method === 'privatePostTradeOrderTpsl') || isType2Order) {
|
|
76692
|
+
const tpslRequest = this.createTpslOrderRequest(symbol, type, side, amount, price, params);
|
|
76693
|
+
response = await this.privatePostTradeOrderTpsl(tpslRequest);
|
|
76694
|
+
}
|
|
76695
|
+
else {
|
|
76696
|
+
const request = this.createOrderRequest(symbol, type, side, amount, price, params);
|
|
76697
|
+
response = await this.privatePostTradeOrder(request);
|
|
76698
|
+
}
|
|
76699
|
+
const data = this.safeList(response, 'data', []);
|
|
76700
|
+
const first = this.safeDict(data, 0);
|
|
76701
|
+
const order = this.parseOrder(first, market);
|
|
76702
|
+
order['type'] = type;
|
|
76703
|
+
order['side'] = side;
|
|
76704
|
+
return order;
|
|
76705
|
+
}
|
|
76706
|
+
createTpslOrderRequest(symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
76707
|
+
const market = this.market(symbol);
|
|
76708
|
+
const positionSide = this.safeString(params, 'positionSide', 'net');
|
|
76709
|
+
const request = {
|
|
76710
|
+
'instId': market['id'],
|
|
76711
|
+
'side': side,
|
|
76712
|
+
'positionSide': positionSide,
|
|
76713
|
+
'brokerId': this.safeString(this.options, 'brokerId', 'ec6dd3a7dd982d0b'),
|
|
76714
|
+
};
|
|
76715
|
+
if (amount !== undefined) {
|
|
76716
|
+
request['size'] = this.amountToPrecision(symbol, amount);
|
|
76717
|
+
}
|
|
76718
|
+
const marginMode = this.safeString(params, 'marginMode', 'cross'); // cross or isolated
|
|
76719
|
+
if (marginMode !== 'cross' && marginMode !== 'isolated') {
|
|
76720
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' createTpslOrder() requires a marginMode parameter that must be either cross or isolated');
|
|
76721
|
+
}
|
|
76722
|
+
const stopLossPrice = this.safeString(params, 'stopLossPrice');
|
|
76723
|
+
const takeProfitPrice = this.safeString(params, 'takeProfitPrice');
|
|
76724
|
+
if (stopLossPrice !== undefined) {
|
|
76725
|
+
request['slTriggerPrice'] = this.priceToPrecision(symbol, stopLossPrice);
|
|
76726
|
+
if (type === 'market') {
|
|
76727
|
+
request['slOrderPrice'] = '-1';
|
|
76728
|
+
}
|
|
76729
|
+
else {
|
|
76730
|
+
request['slOrderPrice'] = this.priceToPrecision(symbol, price);
|
|
76731
|
+
}
|
|
76732
|
+
}
|
|
76733
|
+
else if (takeProfitPrice !== undefined) {
|
|
76734
|
+
request['tpTriggerPrice'] = this.priceToPrecision(symbol, takeProfitPrice);
|
|
76735
|
+
if (type === 'market') {
|
|
76736
|
+
request['tpOrderPrice'] = '-1';
|
|
76737
|
+
}
|
|
76738
|
+
else {
|
|
76739
|
+
request['tpOrderPrice'] = this.priceToPrecision(symbol, price);
|
|
76740
|
+
}
|
|
76741
|
+
}
|
|
76742
|
+
request['marginMode'] = marginMode;
|
|
76743
|
+
params = this.omit(params, ['stopLossPrice', 'takeProfitPrice']);
|
|
76744
|
+
return this.extend(request, params);
|
|
76745
|
+
}
|
|
76746
|
+
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
76747
|
+
/**
|
|
76748
|
+
* @method
|
|
76749
|
+
* @name blofin#cancelOrder
|
|
76750
|
+
* @description cancels an open order
|
|
76751
|
+
* @see https://blofin.com/docs#cancel-order
|
|
76752
|
+
* @see https://blofin.com/docs#cancel-tpsl-order
|
|
76753
|
+
* @param {string} id order id
|
|
76754
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
76755
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76756
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
76757
|
+
*/
|
|
76758
|
+
if (symbol === undefined) {
|
|
76759
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
76760
|
+
}
|
|
76761
|
+
await this.loadMarkets();
|
|
76762
|
+
const market = this.market(symbol);
|
|
76763
|
+
const request = {
|
|
76764
|
+
'instId': market['id'],
|
|
76765
|
+
};
|
|
76766
|
+
const clientOrderId = this.safeString(params, 'clientOrderId');
|
|
76767
|
+
if (clientOrderId !== undefined) {
|
|
76768
|
+
request['clientOrderId'] = clientOrderId;
|
|
76769
|
+
}
|
|
76770
|
+
else {
|
|
76771
|
+
request['orderId'] = id;
|
|
76772
|
+
}
|
|
76773
|
+
const query = this.omit(params, ['orderId', 'clientOrderId']);
|
|
76774
|
+
const response = await this.privatePostTradeCancelOrder(this.extend(request, query));
|
|
76775
|
+
const data = this.safeList(response, 'data', []);
|
|
76776
|
+
const order = this.safeDict(data, 0);
|
|
76777
|
+
return this.parseOrder(order, market);
|
|
76778
|
+
}
|
|
76779
|
+
async createOrders(orders, params = {}) {
|
|
76780
|
+
/**
|
|
76781
|
+
* @method
|
|
76782
|
+
* @name blofin#createOrders
|
|
76783
|
+
* @description create a list of trade orders
|
|
76784
|
+
* @see https://blofin.com/docs#place-multiple-orders
|
|
76785
|
+
* @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
|
76786
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
76787
|
+
*/
|
|
76788
|
+
await this.loadMarkets();
|
|
76789
|
+
const ordersRequests = [];
|
|
76790
|
+
for (let i = 0; i < orders.length; i++) {
|
|
76791
|
+
const rawOrder = orders[i];
|
|
76792
|
+
const marketId = this.safeString(rawOrder, 'symbol');
|
|
76793
|
+
const type = this.safeString(rawOrder, 'type');
|
|
76794
|
+
const side = this.safeString(rawOrder, 'side');
|
|
76795
|
+
const amount = this.safeValue(rawOrder, 'amount');
|
|
76796
|
+
const price = this.safeValue(rawOrder, 'price');
|
|
76797
|
+
const orderParams = this.safeValue(rawOrder, 'params', {});
|
|
76798
|
+
const extendedParams = this.extend(orderParams, params); // the request does not accept extra params since it's a list, so we're extending each order with the common params
|
|
76799
|
+
const orderRequest = this.createOrderRequest(marketId, type, side, amount, price, extendedParams);
|
|
76800
|
+
ordersRequests.push(orderRequest);
|
|
76801
|
+
}
|
|
76802
|
+
const response = await this.privatePostTradeBatchOrders(ordersRequests);
|
|
76803
|
+
const data = this.safeList(response, 'data', []);
|
|
76804
|
+
return this.parseOrders(data);
|
|
76805
|
+
}
|
|
76806
|
+
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
76807
|
+
/**
|
|
76808
|
+
* @method
|
|
76809
|
+
* @name blofin#fetchOpenOrders
|
|
76810
|
+
* @description Fetch orders that are still open
|
|
76811
|
+
* @see https://blofin.com/docs#get-active-orders
|
|
76812
|
+
* @see https://blofin.com/docs#get-active-tpsl-orders
|
|
76813
|
+
* @param {string} symbol unified market symbol
|
|
76814
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
76815
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
76816
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76817
|
+
* @param {bool} [params.stop] True if fetching trigger or conditional orders
|
|
76818
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
76819
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
76820
|
+
*/
|
|
76821
|
+
await this.loadMarkets();
|
|
76822
|
+
let paginate = false;
|
|
76823
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'paginate');
|
|
76824
|
+
if (paginate) {
|
|
76825
|
+
return await this.fetchPaginatedCallDynamic('fetchOpenOrders', symbol, since, limit, params);
|
|
76826
|
+
}
|
|
76827
|
+
const request = {};
|
|
76828
|
+
let market = undefined;
|
|
76829
|
+
if (symbol !== undefined) {
|
|
76830
|
+
market = this.market(symbol);
|
|
76831
|
+
request['instId'] = market['id'];
|
|
76832
|
+
}
|
|
76833
|
+
if (limit !== undefined) {
|
|
76834
|
+
request['limit'] = limit; // default 100, max 100
|
|
76835
|
+
}
|
|
76836
|
+
const isStop = this.safeValueN(params, ['stop', 'trigger', 'tpsl', 'TPSL'], false);
|
|
76837
|
+
let method = undefined;
|
|
76838
|
+
[method, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'method', 'privateGetTradeOrdersPending');
|
|
76839
|
+
const query = this.omit(params, ['method', 'stop', 'trigger', 'tpsl', 'TPSL']);
|
|
76840
|
+
let response = undefined;
|
|
76841
|
+
if (isStop || (method === 'privateGetTradeOrdersTpslPending')) {
|
|
76842
|
+
response = await this.privateGetTradeOrdersTpslPending(this.extend(request, query));
|
|
76843
|
+
}
|
|
76844
|
+
else {
|
|
76845
|
+
response = await this.privateGetTradeOrdersPending(this.extend(request, query));
|
|
76846
|
+
}
|
|
76847
|
+
const data = this.safeList(response, 'data', []);
|
|
76848
|
+
return this.parseOrders(data, market, since, limit);
|
|
76849
|
+
}
|
|
76850
|
+
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
76851
|
+
/**
|
|
76852
|
+
* @method
|
|
76853
|
+
* @name blofin#fetchMyTrades
|
|
76854
|
+
* @description fetch all trades made by the user
|
|
76855
|
+
* @see https://blofin.com/docs#get-trade-history
|
|
76856
|
+
* @param {string} symbol unified market symbol
|
|
76857
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
76858
|
+
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
76859
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76860
|
+
* @param {int} [params.until] Timestamp in ms of the latest time to retrieve trades for
|
|
76861
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
76862
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
76863
|
+
*/
|
|
76864
|
+
await this.loadMarkets();
|
|
76865
|
+
let paginate = false;
|
|
76866
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
76867
|
+
if (paginate) {
|
|
76868
|
+
return await this.fetchPaginatedCallDynamic('fetchMyTrades', symbol, since, limit, params);
|
|
76869
|
+
}
|
|
76870
|
+
let request = {};
|
|
76871
|
+
let market = undefined;
|
|
76872
|
+
if (symbol !== undefined) {
|
|
76873
|
+
market = this.market(symbol);
|
|
76874
|
+
request['instId'] = market['id'];
|
|
76875
|
+
}
|
|
76876
|
+
[request, params] = this.handleUntilOption('end', request, params);
|
|
76877
|
+
if (limit !== undefined) {
|
|
76878
|
+
request['limit'] = limit; // default 100, max 100
|
|
76879
|
+
}
|
|
76880
|
+
const response = await this.privateGetTradeFillsHistory(this.extend(request, params));
|
|
76881
|
+
const data = this.safeList(response, 'data', []);
|
|
76882
|
+
return this.parseTrades(data, market, since, limit);
|
|
76883
|
+
}
|
|
76884
|
+
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
76885
|
+
/**
|
|
76886
|
+
* @method
|
|
76887
|
+
* @name blofin#fetchDeposits
|
|
76888
|
+
* @description fetch all deposits made to an account
|
|
76889
|
+
* @see https://blofin.com/docs#get-deposite-history
|
|
76890
|
+
* @param {string} code unified currency code
|
|
76891
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
76892
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
76893
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76894
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
76895
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
76896
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
76897
|
+
*/
|
|
76898
|
+
await this.loadMarkets();
|
|
76899
|
+
let paginate = false;
|
|
76900
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
|
|
76901
|
+
if (paginate) {
|
|
76902
|
+
return await this.fetchPaginatedCallDynamic('fetchDeposits', code, since, limit, params);
|
|
76903
|
+
}
|
|
76904
|
+
let request = {};
|
|
76905
|
+
let currency = undefined;
|
|
76906
|
+
if (code !== undefined) {
|
|
76907
|
+
currency = this.currency(code);
|
|
76908
|
+
request['currency'] = currency['id'];
|
|
76909
|
+
}
|
|
76910
|
+
if (since !== undefined) {
|
|
76911
|
+
request['before'] = Math.max(since - 1, 0);
|
|
76912
|
+
}
|
|
76913
|
+
if (limit !== undefined) {
|
|
76914
|
+
request['limit'] = limit; // default 100, max 100
|
|
76915
|
+
}
|
|
76916
|
+
[request, params] = this.handleUntilOption('after', request, params);
|
|
76917
|
+
const response = await this.privateGetAssetDepositHistory(this.extend(request, params));
|
|
76918
|
+
const data = this.safeList(response, 'data', []);
|
|
76919
|
+
return this.parseTransactions(data, currency, since, limit, params);
|
|
76920
|
+
}
|
|
76921
|
+
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
76922
|
+
/**
|
|
76923
|
+
* @method
|
|
76924
|
+
* @name blofin#fetchWithdrawals
|
|
76925
|
+
* @description fetch all withdrawals made from an account
|
|
76926
|
+
* @see https://blofin.com/docs#get-withdraw-history
|
|
76927
|
+
* @param {string} code unified currency code
|
|
76928
|
+
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
76929
|
+
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
76930
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76931
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
76932
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
76933
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
76934
|
+
*/
|
|
76935
|
+
await this.loadMarkets();
|
|
76936
|
+
let paginate = false;
|
|
76937
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
|
|
76938
|
+
if (paginate) {
|
|
76939
|
+
return await this.fetchPaginatedCallDynamic('fetchWithdrawals', code, since, limit, params);
|
|
76940
|
+
}
|
|
76941
|
+
let request = {};
|
|
76942
|
+
let currency = undefined;
|
|
76943
|
+
if (code !== undefined) {
|
|
76944
|
+
currency = this.currency(code);
|
|
76945
|
+
request['currency'] = currency['id'];
|
|
76946
|
+
}
|
|
76947
|
+
if (since !== undefined) {
|
|
76948
|
+
request['before'] = Math.max(since - 1, 0);
|
|
76949
|
+
}
|
|
76950
|
+
if (limit !== undefined) {
|
|
76951
|
+
request['limit'] = limit; // default 100, max 100
|
|
76952
|
+
}
|
|
76953
|
+
[request, params] = this.handleUntilOption('after', request, params);
|
|
76954
|
+
const response = await this.privateGetAssetWithdrawalHistory(this.extend(request, params));
|
|
76955
|
+
const data = this.safeList(response, 'data', []);
|
|
76956
|
+
return this.parseTransactions(data, currency, since, limit, params);
|
|
76957
|
+
}
|
|
76958
|
+
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
76959
|
+
/**
|
|
76960
|
+
* @method
|
|
76961
|
+
* @name blofin#fetchLedger
|
|
76962
|
+
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
76963
|
+
* @see https://blofin.com/docs#get-funds-transfer-history
|
|
76964
|
+
* @param {string} code unified currency code, default is undefined
|
|
76965
|
+
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
76966
|
+
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
76967
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76968
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated'
|
|
76969
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
76970
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
76971
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
76972
|
+
*/
|
|
76973
|
+
await this.loadMarkets();
|
|
76974
|
+
let paginate = false;
|
|
76975
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
|
|
76976
|
+
if (paginate) {
|
|
76977
|
+
return await this.fetchPaginatedCallDynamic('fetchLedger', code, since, limit, params);
|
|
76978
|
+
}
|
|
76979
|
+
let request = {};
|
|
76980
|
+
if (limit !== undefined) {
|
|
76981
|
+
request['limit'] = limit;
|
|
76982
|
+
}
|
|
76983
|
+
let currency = undefined;
|
|
76984
|
+
if (code !== undefined) {
|
|
76985
|
+
currency = this.currency(code);
|
|
76986
|
+
request['currency'] = currency['id'];
|
|
76987
|
+
}
|
|
76988
|
+
[request, params] = this.handleUntilOption('end', request, params);
|
|
76989
|
+
let response = undefined;
|
|
76990
|
+
response = await this.privateGetAssetBills(this.extend(request, params));
|
|
76991
|
+
const data = this.safeList(response, 'data', []);
|
|
76992
|
+
return this.parseLedger(data, currency, since, limit);
|
|
76993
|
+
}
|
|
76994
|
+
parseTransaction(transaction, currency = undefined) {
|
|
76995
|
+
//
|
|
76996
|
+
//
|
|
76997
|
+
// fetchDeposits
|
|
76998
|
+
//
|
|
76999
|
+
// {
|
|
77000
|
+
// "currency": "USDT",
|
|
77001
|
+
// "chain": "TRC20",
|
|
77002
|
+
// "address": "TGfJLtnsh3B9EqekFEBZ1nR14QanBUf5Bi",
|
|
77003
|
+
// "txId": "892f4e0c32268b29b2e541ef30d32a30bbf10f902adcc4b1428319ed7c3758fd",
|
|
77004
|
+
// "type": "0",
|
|
77005
|
+
// "amount": "86.975843",
|
|
77006
|
+
// "state": "1",
|
|
77007
|
+
// "ts": "1703163304153",
|
|
77008
|
+
// "tag": null,
|
|
77009
|
+
// "confirm": "16",
|
|
77010
|
+
// "depositId": "36c8e2a7ea184a219de72215a696acaf"
|
|
77011
|
+
// }
|
|
77012
|
+
// fetchWithdrawals
|
|
77013
|
+
// {
|
|
77014
|
+
// "currency": "USDT",
|
|
77015
|
+
// "chain": "TRC20",
|
|
77016
|
+
// "address": "TYgB3sVXHPEDQUu288EG1uMFh9Pk2swLgW",
|
|
77017
|
+
// "txId": "1fd5ac52df414d7ea66194cadd9a5b4d2422c2b9720037f66d98207f9858fd96",
|
|
77018
|
+
// "type": "0",
|
|
77019
|
+
// "amount": "9",
|
|
77020
|
+
// "fee": "1",
|
|
77021
|
+
// "feeCurrency": "USDT",
|
|
77022
|
+
// "state": "3",
|
|
77023
|
+
// "clientId": null,
|
|
77024
|
+
// "ts": "1707217439351",
|
|
77025
|
+
// "tag": null,
|
|
77026
|
+
// "memo": null,
|
|
77027
|
+
// "withdrawId": "e0768698cfdf4aee8e54654c3775914b"
|
|
77028
|
+
// }
|
|
77029
|
+
//
|
|
77030
|
+
let type = undefined;
|
|
77031
|
+
let id = undefined;
|
|
77032
|
+
const withdrawalId = this.safeString(transaction, 'withdrawId');
|
|
77033
|
+
const depositId = this.safeString(transaction, 'depositId');
|
|
77034
|
+
const addressTo = this.safeString(transaction, 'address');
|
|
77035
|
+
const address = addressTo;
|
|
77036
|
+
const tagTo = this.safeString(transaction, 'tag');
|
|
77037
|
+
if (withdrawalId !== undefined) {
|
|
77038
|
+
type = 'withdrawal';
|
|
77039
|
+
id = withdrawalId;
|
|
77040
|
+
}
|
|
77041
|
+
else {
|
|
77042
|
+
id = depositId;
|
|
77043
|
+
type = 'deposit';
|
|
77044
|
+
}
|
|
77045
|
+
const currencyId = this.safeString(transaction, 'currency');
|
|
77046
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
77047
|
+
const amount = this.safeNumber(transaction, 'amount');
|
|
77048
|
+
const status = this.parseTransactionStatus(this.safeString(transaction, 'state'));
|
|
77049
|
+
const txid = this.safeString(transaction, 'txId');
|
|
77050
|
+
const timestamp = this.safeInteger(transaction, 'ts');
|
|
77051
|
+
const feeCurrencyId = this.safeString(transaction, 'feeCurrency');
|
|
77052
|
+
const feeCode = this.safeCurrencyCode(feeCurrencyId);
|
|
77053
|
+
const feeCost = this.safeNumber(transaction, 'fee');
|
|
77054
|
+
return {
|
|
77055
|
+
'info': transaction,
|
|
77056
|
+
'id': id,
|
|
77057
|
+
'currency': code,
|
|
77058
|
+
'amount': amount,
|
|
77059
|
+
'network': undefined,
|
|
77060
|
+
'addressFrom': undefined,
|
|
77061
|
+
'addressTo': addressTo,
|
|
77062
|
+
'address': address,
|
|
77063
|
+
'tagFrom': undefined,
|
|
77064
|
+
'tagTo': tagTo,
|
|
77065
|
+
'tag': tagTo,
|
|
77066
|
+
'status': status,
|
|
77067
|
+
'type': type,
|
|
77068
|
+
'updated': undefined,
|
|
77069
|
+
'txid': txid,
|
|
77070
|
+
'timestamp': timestamp,
|
|
77071
|
+
'datetime': this.iso8601(timestamp),
|
|
77072
|
+
'internal': undefined,
|
|
77073
|
+
'comment': undefined,
|
|
77074
|
+
'fee': {
|
|
77075
|
+
'currency': feeCode,
|
|
77076
|
+
'cost': feeCost,
|
|
77077
|
+
},
|
|
77078
|
+
};
|
|
77079
|
+
}
|
|
77080
|
+
parseTransactionStatus(status) {
|
|
77081
|
+
const statuses = {
|
|
77082
|
+
'0': 'pending',
|
|
77083
|
+
'1': 'ok',
|
|
77084
|
+
'2': 'failed',
|
|
77085
|
+
'3': 'pending',
|
|
77086
|
+
};
|
|
77087
|
+
return this.safeString(statuses, status, status);
|
|
77088
|
+
}
|
|
77089
|
+
parseLedgerEntryType(type) {
|
|
77090
|
+
const types = {
|
|
77091
|
+
'1': 'transfer',
|
|
77092
|
+
'2': 'trade',
|
|
77093
|
+
'3': 'trade',
|
|
77094
|
+
'4': 'rebate',
|
|
77095
|
+
'5': 'trade',
|
|
77096
|
+
'6': 'transfer',
|
|
77097
|
+
'7': 'trade',
|
|
77098
|
+
'8': 'fee',
|
|
77099
|
+
'9': 'trade',
|
|
77100
|
+
'10': 'trade',
|
|
77101
|
+
'11': 'trade', // system token conversion
|
|
77102
|
+
};
|
|
77103
|
+
return this.safeString(types, type, type);
|
|
77104
|
+
}
|
|
77105
|
+
parseLedgerEntry(item, currency = undefined) {
|
|
77106
|
+
const id = this.safeString(item, 'transferId');
|
|
77107
|
+
const referenceId = this.safeString(item, 'clientId');
|
|
77108
|
+
const fromAccount = this.safeString(item, 'fromAccount');
|
|
77109
|
+
const toAccount = this.safeString(item, 'toAccount');
|
|
77110
|
+
const type = this.parseLedgerEntryType(this.safeString(item, 'type'));
|
|
77111
|
+
const code = this.safeCurrencyCode(this.safeString(item, 'currency'), currency);
|
|
77112
|
+
const amountString = this.safeString(item, 'amount');
|
|
77113
|
+
const amount = this.parseNumber(amountString);
|
|
77114
|
+
const timestamp = this.safeInteger(item, 'ts');
|
|
77115
|
+
const status = 'ok';
|
|
77116
|
+
return {
|
|
77117
|
+
'id': id,
|
|
77118
|
+
'info': item,
|
|
77119
|
+
'timestamp': timestamp,
|
|
77120
|
+
'datetime': this.iso8601(timestamp),
|
|
77121
|
+
'fromAccount': fromAccount,
|
|
77122
|
+
'toAccount': toAccount,
|
|
77123
|
+
'type': type,
|
|
77124
|
+
'currency': code,
|
|
77125
|
+
'amount': amount,
|
|
77126
|
+
'clientId': referenceId,
|
|
77127
|
+
'status': status,
|
|
77128
|
+
};
|
|
77129
|
+
}
|
|
77130
|
+
parseIds(ids) {
|
|
77131
|
+
/**
|
|
77132
|
+
* @ignore
|
|
77133
|
+
* @method
|
|
77134
|
+
* @name blofin#parseIds
|
|
77135
|
+
* @param {string[]|string} ids order ids
|
|
77136
|
+
* @returns {string[]} list of order ids
|
|
77137
|
+
*/
|
|
77138
|
+
if (typeof ids === 'string') {
|
|
77139
|
+
return ids.split(',');
|
|
77140
|
+
}
|
|
77141
|
+
else {
|
|
77142
|
+
return ids;
|
|
77143
|
+
}
|
|
77144
|
+
}
|
|
77145
|
+
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
77146
|
+
/**
|
|
77147
|
+
* @method
|
|
77148
|
+
* @name blofin#cancelOrders
|
|
77149
|
+
* @description cancel multiple orders
|
|
77150
|
+
* @see https://blofin.com/docs#cancel-multiple-orders
|
|
77151
|
+
* @param {string[]} ids order ids
|
|
77152
|
+
* @param {string} symbol unified market symbol
|
|
77153
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
77154
|
+
* @param {boolean} [params.trigger] whether the order is a stop/trigger order
|
|
77155
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
77156
|
+
*/
|
|
77157
|
+
// TODO : the original endpoint signature differs, according to that you can skip individual symbol and assign ids in batch. At this moment, `params` is not being used too.
|
|
77158
|
+
if (symbol === undefined) {
|
|
77159
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
|
|
77160
|
+
}
|
|
77161
|
+
await this.loadMarkets();
|
|
77162
|
+
const market = this.market(symbol);
|
|
77163
|
+
const request = [];
|
|
77164
|
+
const options = this.safeValue(this.options, 'cancelOrders', {});
|
|
77165
|
+
const defaultMethod = this.safeString(options, 'method', 'privatePostTradeCancelBatchOrders');
|
|
77166
|
+
let method = this.safeString(params, 'method', defaultMethod);
|
|
77167
|
+
const clientOrderIds = this.parseIds(this.safeValue(params, 'clientOrderId'));
|
|
77168
|
+
const tpslIds = this.parseIds(this.safeValue(params, 'tpslId'));
|
|
77169
|
+
const stop = this.safeBoolN(params, ['stop', 'trigger', 'tpsl']);
|
|
77170
|
+
if (stop) {
|
|
77171
|
+
method = 'privatePostTradeCancelTpsl';
|
|
77172
|
+
}
|
|
77173
|
+
if (clientOrderIds === undefined) {
|
|
77174
|
+
ids = this.parseIds(ids);
|
|
77175
|
+
if (tpslIds !== undefined) {
|
|
77176
|
+
for (let i = 0; i < tpslIds.length; i++) {
|
|
77177
|
+
request.push({
|
|
77178
|
+
'tpslId': tpslIds[i],
|
|
77179
|
+
'instId': market['id'],
|
|
77180
|
+
});
|
|
77181
|
+
}
|
|
77182
|
+
}
|
|
77183
|
+
for (let i = 0; i < ids.length; i++) {
|
|
77184
|
+
if (stop) {
|
|
77185
|
+
request.push({
|
|
77186
|
+
'tpslId': ids[i],
|
|
77187
|
+
'instId': market['id'],
|
|
77188
|
+
});
|
|
77189
|
+
}
|
|
77190
|
+
else {
|
|
77191
|
+
request.push({
|
|
77192
|
+
'orderId': ids[i],
|
|
77193
|
+
'instId': market['id'],
|
|
77194
|
+
});
|
|
77195
|
+
}
|
|
77196
|
+
}
|
|
77197
|
+
}
|
|
77198
|
+
else {
|
|
77199
|
+
for (let i = 0; i < clientOrderIds.length; i++) {
|
|
77200
|
+
request.push({
|
|
77201
|
+
'instId': market['id'],
|
|
77202
|
+
'clientOrderId': clientOrderIds[i],
|
|
77203
|
+
});
|
|
77204
|
+
}
|
|
77205
|
+
}
|
|
77206
|
+
let response = undefined;
|
|
77207
|
+
if (method === 'privatePostTradeCancelTpsl') {
|
|
77208
|
+
response = await this.privatePostTradeCancelTpsl(request); // * dont extend with params, otherwise ARRAY will be turned into OBJECT
|
|
77209
|
+
}
|
|
77210
|
+
else {
|
|
77211
|
+
response = await this.privatePostTradeCancelBatchOrders(request); // * dont extend with params, otherwise ARRAY will be turned into OBJECT
|
|
77212
|
+
}
|
|
77213
|
+
const ordersData = this.safeList(response, 'data', []);
|
|
77214
|
+
return this.parseOrders(ordersData, market, undefined, undefined, params);
|
|
77215
|
+
}
|
|
77216
|
+
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
77217
|
+
/**
|
|
77218
|
+
* @method
|
|
77219
|
+
* @name blofin#transfer
|
|
77220
|
+
* @description transfer currency internally between wallets on the same account
|
|
77221
|
+
* @see https://blofin.com/docs#funds-transfer
|
|
77222
|
+
* @param {string} code unified currency code
|
|
77223
|
+
* @param {float} amount amount to transfer
|
|
77224
|
+
* @param {string} fromAccount account to transfer from (funding, swap, copy_trading, earn)
|
|
77225
|
+
* @param {string} toAccount account to transfer to (funding, swap, copy_trading, earn)
|
|
77226
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
77227
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
77228
|
+
*/
|
|
77229
|
+
await this.loadMarkets();
|
|
77230
|
+
const currency = this.currency(code);
|
|
77231
|
+
const accountsByType = this.safeValue(this.options, 'accountsByType', {});
|
|
77232
|
+
const fromId = this.safeString(accountsByType, fromAccount, fromAccount);
|
|
77233
|
+
const toId = this.safeString(accountsByType, toAccount, toAccount);
|
|
77234
|
+
const request = {
|
|
77235
|
+
'currency': currency['id'],
|
|
77236
|
+
'amount': this.currencyToPrecision(code, amount),
|
|
77237
|
+
'fromAccount': fromId,
|
|
77238
|
+
'toAccount': toId,
|
|
77239
|
+
};
|
|
77240
|
+
const response = await this.privatePostAssetTransfer(this.extend(request, params));
|
|
77241
|
+
const data = this.safeDict(response, 'data', {});
|
|
77242
|
+
return this.parseTransfer(data, currency);
|
|
77243
|
+
}
|
|
77244
|
+
parseTransfer(transfer, currency = undefined) {
|
|
77245
|
+
const id = this.safeString(transfer, 'transferId');
|
|
77246
|
+
return {
|
|
77247
|
+
'info': transfer,
|
|
77248
|
+
'id': id,
|
|
77249
|
+
'timestamp': undefined,
|
|
77250
|
+
'datetime': undefined,
|
|
77251
|
+
'currency': undefined,
|
|
77252
|
+
'amount': undefined,
|
|
77253
|
+
'fromAccount': undefined,
|
|
77254
|
+
'toAccount': undefined,
|
|
77255
|
+
'status': undefined,
|
|
77256
|
+
};
|
|
77257
|
+
}
|
|
77258
|
+
async fetchPosition(symbol, params = {}) {
|
|
77259
|
+
/**
|
|
77260
|
+
* @method
|
|
77261
|
+
* @name blofin#fetchPosition
|
|
77262
|
+
* @description fetch data on a single open contract trade position
|
|
77263
|
+
* @see https://blofin.com/docs#get-positions
|
|
77264
|
+
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
77265
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
77266
|
+
* @param {string} [params.instType] MARGIN, SWAP, FUTURES, OPTION
|
|
77267
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
77268
|
+
*/
|
|
77269
|
+
await this.loadMarkets();
|
|
77270
|
+
const market = this.market(symbol);
|
|
77271
|
+
const request = {
|
|
77272
|
+
'instId': market['id'],
|
|
77273
|
+
};
|
|
77274
|
+
const response = await this.privateGetAccountPositions(this.extend(request, params));
|
|
77275
|
+
const data = this.safeList(response, 'data', []);
|
|
77276
|
+
const position = this.safeDict(data, 0);
|
|
77277
|
+
if (position === undefined) {
|
|
77278
|
+
return undefined;
|
|
77279
|
+
}
|
|
77280
|
+
return this.parsePosition(position, market);
|
|
77281
|
+
}
|
|
77282
|
+
async fetchPositions(symbols = undefined, params = {}) {
|
|
77283
|
+
/**
|
|
77284
|
+
* @method
|
|
77285
|
+
* @name blofin#fetchPosition
|
|
77286
|
+
* @description fetch data on a single open contract trade position
|
|
77287
|
+
* @see https://blofin.com/docs#get-positions
|
|
77288
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
77289
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
77290
|
+
* @param {string} [params.instType] MARGIN, SWAP, FUTURES, OPTION
|
|
77291
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
77292
|
+
*/
|
|
77293
|
+
await this.loadMarkets();
|
|
77294
|
+
symbols = this.marketSymbols(symbols);
|
|
77295
|
+
const response = await this.privateGetAccountPositions(params);
|
|
77296
|
+
const data = this.safeList(response, 'data', []);
|
|
77297
|
+
const result = this.parsePositions(data);
|
|
77298
|
+
return this.filterByArrayPositions(result, 'symbol', symbols, false);
|
|
77299
|
+
}
|
|
77300
|
+
parsePosition(position, market = undefined) {
|
|
77301
|
+
const marketId = this.safeString(position, 'instId');
|
|
77302
|
+
market = this.safeMarket(marketId, market);
|
|
77303
|
+
const symbol = market['symbol'];
|
|
77304
|
+
const pos = this.safeString(position, 'positions');
|
|
77305
|
+
const contractsAbs = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAbs(pos);
|
|
77306
|
+
let side = this.safeString(position, 'positionSide');
|
|
77307
|
+
const hedged = side !== 'net';
|
|
77308
|
+
const contracts = this.parseNumber(contractsAbs);
|
|
77309
|
+
if (pos !== undefined) {
|
|
77310
|
+
if (side === 'net') {
|
|
77311
|
+
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringGt(pos, '0')) {
|
|
77312
|
+
side = 'long';
|
|
77313
|
+
}
|
|
77314
|
+
else if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(pos, '0')) {
|
|
77315
|
+
side = 'short';
|
|
77316
|
+
}
|
|
77317
|
+
else {
|
|
77318
|
+
side = undefined;
|
|
77319
|
+
}
|
|
77320
|
+
}
|
|
77321
|
+
}
|
|
77322
|
+
const contractSize = this.safeNumber(market, 'contractSize');
|
|
77323
|
+
const contractSizeString = this.numberToString(contractSize);
|
|
77324
|
+
const markPriceString = this.safeString(position, 'markPrice');
|
|
77325
|
+
let notionalString = this.safeString(position, 'notionalUsd');
|
|
77326
|
+
if (market['inverse']) {
|
|
77327
|
+
notionalString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(contractsAbs, contractSizeString), markPriceString);
|
|
77328
|
+
}
|
|
77329
|
+
const notional = this.parseNumber(notionalString);
|
|
77330
|
+
const marginMode = this.safeString(position, 'marginMode');
|
|
77331
|
+
let initialMarginString = undefined;
|
|
77332
|
+
const entryPriceString = this.safeString(position, 'averagePrice');
|
|
77333
|
+
const unrealizedPnlString = this.safeString(position, 'unrealizedPnl');
|
|
77334
|
+
const leverageString = this.safeString(position, 'leverage');
|
|
77335
|
+
let initialMarginPercentage = undefined;
|
|
77336
|
+
let collateralString = undefined;
|
|
77337
|
+
if (marginMode === 'cross') {
|
|
77338
|
+
initialMarginString = this.safeString(position, 'initialMargin');
|
|
77339
|
+
collateralString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(initialMarginString, unrealizedPnlString);
|
|
77340
|
+
}
|
|
77341
|
+
else if (marginMode === 'isolated') {
|
|
77342
|
+
initialMarginPercentage = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv('1', leverageString);
|
|
77343
|
+
collateralString = this.safeString(position, 'margin');
|
|
77344
|
+
}
|
|
77345
|
+
const maintenanceMarginString = this.safeString(position, 'maintenanceMargin');
|
|
77346
|
+
const maintenanceMargin = this.parseNumber(maintenanceMarginString);
|
|
77347
|
+
const maintenanceMarginPercentageString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv(maintenanceMarginString, notionalString);
|
|
77348
|
+
if (initialMarginPercentage === undefined) {
|
|
77349
|
+
initialMarginPercentage = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv(initialMarginString, notionalString, 4));
|
|
77350
|
+
}
|
|
77351
|
+
else if (initialMarginString === undefined) {
|
|
77352
|
+
initialMarginString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(initialMarginPercentage, notionalString);
|
|
77353
|
+
}
|
|
77354
|
+
const rounder = '0.00005'; // round to closest 0.01%
|
|
77355
|
+
const maintenanceMarginPercentage = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(maintenanceMarginPercentageString, rounder), '1', 4));
|
|
77356
|
+
const liquidationPrice = this.safeNumber(position, 'liquidationPrice');
|
|
77357
|
+
const percentageString = this.safeString(position, 'unrealizedPnlRatio');
|
|
77358
|
+
const percentage = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(percentageString, '100'));
|
|
77359
|
+
const timestamp = this.safeInteger(position, 'updateTime');
|
|
77360
|
+
const marginRatio = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv(maintenanceMarginString, collateralString, 4));
|
|
77361
|
+
return this.safePosition({
|
|
77362
|
+
'info': position,
|
|
77363
|
+
'id': undefined,
|
|
77364
|
+
'symbol': symbol,
|
|
77365
|
+
'notional': notional,
|
|
77366
|
+
'marginMode': marginMode,
|
|
77367
|
+
'liquidationPrice': liquidationPrice,
|
|
77368
|
+
'entryPrice': this.parseNumber(entryPriceString),
|
|
77369
|
+
'unrealizedPnl': this.parseNumber(unrealizedPnlString),
|
|
77370
|
+
'percentage': percentage,
|
|
77371
|
+
'contracts': contracts,
|
|
77372
|
+
'contractSize': contractSize,
|
|
77373
|
+
'markPrice': this.parseNumber(markPriceString),
|
|
77374
|
+
'lastPrice': undefined,
|
|
77375
|
+
'side': side,
|
|
77376
|
+
'hedged': hedged,
|
|
77377
|
+
'timestamp': timestamp,
|
|
77378
|
+
'datetime': this.iso8601(timestamp),
|
|
77379
|
+
'lastUpdateTimestamp': undefined,
|
|
77380
|
+
'maintenanceMargin': maintenanceMargin,
|
|
77381
|
+
'maintenanceMarginPercentage': maintenanceMarginPercentage,
|
|
77382
|
+
'collateral': this.parseNumber(collateralString),
|
|
77383
|
+
'initialMargin': this.parseNumber(initialMarginString),
|
|
77384
|
+
'initialMarginPercentage': this.parseNumber(initialMarginPercentage),
|
|
77385
|
+
'leverage': this.parseNumber(leverageString),
|
|
77386
|
+
'marginRatio': marginRatio,
|
|
77387
|
+
'stopLossPrice': undefined,
|
|
77388
|
+
'takeProfitPrice': undefined,
|
|
77389
|
+
});
|
|
77390
|
+
}
|
|
77391
|
+
async fetchLeverage(symbol, params = {}) {
|
|
77392
|
+
/**
|
|
77393
|
+
* @method
|
|
77394
|
+
* @name blofin#fetchLeverage
|
|
77395
|
+
* @description fetch the set leverage for a market
|
|
77396
|
+
* @see https://blofin.com/docs#set-leverage
|
|
77397
|
+
* @param {string} symbol unified market symbol
|
|
77398
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
77399
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated'
|
|
77400
|
+
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
77401
|
+
*/
|
|
77402
|
+
await this.loadMarkets();
|
|
77403
|
+
let marginMode = undefined;
|
|
77404
|
+
[marginMode, params] = this.handleMarginModeAndParams('fetchLeverage', params);
|
|
77405
|
+
if (marginMode === undefined) {
|
|
77406
|
+
marginMode = this.safeString(params, 'marginMode', 'cross'); // cross as default marginMode
|
|
77407
|
+
}
|
|
77408
|
+
if ((marginMode !== 'cross') && (marginMode !== 'isolated')) {
|
|
77409
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' fetchLeverage() requires a marginMode parameter that must be either cross or isolated');
|
|
77410
|
+
}
|
|
77411
|
+
const market = this.market(symbol);
|
|
77412
|
+
const request = {
|
|
77413
|
+
'instId': market['id'],
|
|
77414
|
+
'marginMode': marginMode,
|
|
77415
|
+
};
|
|
77416
|
+
const response = await this.privateGetAccountLeverageInfo(this.extend(request, params));
|
|
77417
|
+
return response;
|
|
77418
|
+
}
|
|
77419
|
+
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
77420
|
+
/**
|
|
77421
|
+
* @method
|
|
77422
|
+
* @name blofin#setLeverage
|
|
77423
|
+
* @description set the level of leverage for a market
|
|
77424
|
+
* @see https://blofin.com/docs#set-leverage
|
|
77425
|
+
* @param {int} leverage the rate of leverage
|
|
77426
|
+
* @param {string} symbol unified market symbol
|
|
77427
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
77428
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated'
|
|
77429
|
+
* @returns {object} response from the exchange
|
|
77430
|
+
*/
|
|
77431
|
+
if (symbol === undefined) {
|
|
77432
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
77433
|
+
}
|
|
77434
|
+
// WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
|
|
77435
|
+
// AND DECREASE LIQUIDATION PRICE FOR OPEN ISOLATED SHORT POSITIONS
|
|
77436
|
+
if ((leverage < 1) || (leverage > 125)) {
|
|
77437
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' setLeverage() leverage should be between 1 and 125');
|
|
77438
|
+
}
|
|
77439
|
+
await this.loadMarkets();
|
|
77440
|
+
const market = this.market(symbol);
|
|
77441
|
+
let marginMode = undefined;
|
|
77442
|
+
[marginMode, params] = this.handleMarginModeAndParams('setLeverage', params, 'cross');
|
|
77443
|
+
if ((marginMode !== 'cross') && (marginMode !== 'isolated')) {
|
|
77444
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' setLeverage() requires a marginMode parameter that must be either cross or isolated');
|
|
77445
|
+
}
|
|
77446
|
+
const request = {
|
|
77447
|
+
'leverage': leverage,
|
|
77448
|
+
'marginMode': marginMode,
|
|
77449
|
+
'instId': market['id'],
|
|
77450
|
+
};
|
|
77451
|
+
const response = await this.privatePostAccountSetLeverage(this.extend(request, params));
|
|
77452
|
+
return response;
|
|
77453
|
+
}
|
|
77454
|
+
async closePosition(symbol, side = undefined, params = {}) {
|
|
77455
|
+
/**
|
|
77456
|
+
* @method
|
|
77457
|
+
* @name blofin#closePosition
|
|
77458
|
+
* @description closes open positions for a market
|
|
77459
|
+
* @see https://blofin.com/docs#close-positions
|
|
77460
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
77461
|
+
* @param {string} [side] 'buy' or 'sell', leave as undefined in net mode
|
|
77462
|
+
* @param {object} [params] extra parameters specific to the blofin api endpoint
|
|
77463
|
+
* @param {string} [params.clientOrderId] a unique identifier for the order
|
|
77464
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', default is 'cross;
|
|
77465
|
+
* @param {string} [params.code] *required in the case of closing cross MARGIN position for Single-currency margin* margin currency
|
|
77466
|
+
*
|
|
77467
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
77468
|
+
* @param {boolean} [params.autoCxl] whether any pending orders for closing out needs to be automatically canceled when close position via a market order. false or true, the default is false
|
|
77469
|
+
* @param {string} [params.tag] order tag a combination of case-sensitive alphanumerics, all numbers, or all letters of up to 16 characters
|
|
77470
|
+
* @returns {object[]} [A list of position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
77471
|
+
*/
|
|
77472
|
+
await this.loadMarkets();
|
|
77473
|
+
const market = this.market(symbol);
|
|
77474
|
+
const clientOrderId = this.safeString(params, 'clientOrderId');
|
|
77475
|
+
let marginMode = undefined;
|
|
77476
|
+
[marginMode, params] = this.handleMarginModeAndParams('closePosition', params, 'cross');
|
|
77477
|
+
const request = {
|
|
77478
|
+
'instId': market['id'],
|
|
77479
|
+
'marginMode': marginMode,
|
|
77480
|
+
};
|
|
77481
|
+
if (clientOrderId !== undefined) {
|
|
77482
|
+
request['clientOrderId'] = clientOrderId;
|
|
77483
|
+
}
|
|
77484
|
+
const response = await this.privatePostTradeClosePosition(this.extend(request, params));
|
|
77485
|
+
return this.safeValue(response, 'data');
|
|
77486
|
+
}
|
|
77487
|
+
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
77488
|
+
/**
|
|
77489
|
+
* @method
|
|
77490
|
+
* @name blofin#fetchClosedOrders
|
|
77491
|
+
* @description fetches information on multiple closed orders made by the user
|
|
77492
|
+
* @see https://blofin.com/docs#get-order-history
|
|
77493
|
+
* @see https://blofin.com/docs#get-tpsl-order-history
|
|
77494
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
77495
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
77496
|
+
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
77497
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
77498
|
+
* @param {bool} [params.stop] True if fetching trigger or conditional orders
|
|
77499
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
77500
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
77501
|
+
*/
|
|
77502
|
+
await this.loadMarkets();
|
|
77503
|
+
let paginate = false;
|
|
77504
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchClosedOrders', 'paginate');
|
|
77505
|
+
if (paginate) {
|
|
77506
|
+
return await this.fetchPaginatedCallDynamic('fetchClosedOrders', symbol, since, limit, params);
|
|
77507
|
+
}
|
|
77508
|
+
const request = {};
|
|
77509
|
+
let market = undefined;
|
|
77510
|
+
if (symbol !== undefined) {
|
|
77511
|
+
market = this.market(symbol);
|
|
77512
|
+
request['instId'] = market['id'];
|
|
77513
|
+
}
|
|
77514
|
+
if (limit !== undefined) {
|
|
77515
|
+
request['limit'] = limit; // default 100, max 100
|
|
77516
|
+
}
|
|
77517
|
+
if (since !== undefined) {
|
|
77518
|
+
request['begin'] = since;
|
|
77519
|
+
}
|
|
77520
|
+
const isStop = this.safeValueN(params, ['stop', 'trigger', 'tpsl', 'TPSL'], false);
|
|
77521
|
+
let method = undefined;
|
|
77522
|
+
[method, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'method', 'privateGetTradeOrdersHistory');
|
|
77523
|
+
const query = this.omit(params, ['method', 'stop', 'trigger', 'tpsl', 'TPSL']);
|
|
77524
|
+
let response = undefined;
|
|
77525
|
+
if ((isStop) || (method === 'privateGetTradeOrdersTpslHistory')) {
|
|
77526
|
+
response = await this.privateGetTradeOrdersTpslHistory(this.extend(request, query));
|
|
77527
|
+
}
|
|
77528
|
+
else {
|
|
77529
|
+
response = await this.privateGetTradeOrdersHistory(this.extend(request, query));
|
|
77530
|
+
}
|
|
77531
|
+
const data = this.safeList(response, 'data', []);
|
|
77532
|
+
return this.parseOrders(data, market, since, limit);
|
|
77533
|
+
}
|
|
77534
|
+
handleErrors(httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
77535
|
+
if (response === undefined) {
|
|
77536
|
+
return undefined; // fallback to default error handler
|
|
77537
|
+
}
|
|
77538
|
+
//
|
|
77539
|
+
// {"code":"152002","msg":"Parameter bar error."}
|
|
77540
|
+
//
|
|
77541
|
+
const code = this.safeString(response, 'code');
|
|
77542
|
+
const message = this.safeString(response, 'msg');
|
|
77543
|
+
const feedback = this.id + ' ' + body;
|
|
77544
|
+
if (code !== undefined && code !== '0') {
|
|
77545
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);
|
|
77546
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], code, feedback);
|
|
77547
|
+
this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);
|
|
77548
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(feedback); // unknown message
|
|
77549
|
+
}
|
|
77550
|
+
//
|
|
77551
|
+
// {
|
|
77552
|
+
// orderId: null,
|
|
77553
|
+
// clientOrderId: '',
|
|
77554
|
+
// msg: 'Order failed. Insufficient USDT margin in account',
|
|
77555
|
+
// code: '103003'
|
|
77556
|
+
// }
|
|
77557
|
+
//
|
|
77558
|
+
const data = this.safeList(response, 'data');
|
|
77559
|
+
const first = this.safeDict(data, 0);
|
|
77560
|
+
const insideMsg = this.safeString(first, 'msg');
|
|
77561
|
+
const insideCode = this.safeString(first, 'code');
|
|
77562
|
+
if (insideCode !== undefined && insideCode !== '0') {
|
|
77563
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], insideCode, feedback);
|
|
77564
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], insideMsg, feedback);
|
|
77565
|
+
this.throwBroadlyMatchedException(this.exceptions['broad'], insideMsg, feedback);
|
|
77566
|
+
}
|
|
77567
|
+
return undefined;
|
|
77568
|
+
}
|
|
77569
|
+
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
77570
|
+
let request = '/api/' + this.version + '/' + this.implodeParams(path, params);
|
|
77571
|
+
const query = this.omit(params, this.extractParams(path));
|
|
77572
|
+
let url = this.implodeHostname(this.urls['api']['rest']) + request;
|
|
77573
|
+
// const type = this.getPathAuthenticationType (path);
|
|
77574
|
+
if (api === 'public') {
|
|
77575
|
+
if (!this.isEmpty(query)) {
|
|
77576
|
+
url += '?' + this.urlencode(query);
|
|
77577
|
+
}
|
|
77578
|
+
}
|
|
77579
|
+
else if (api === 'private') {
|
|
77580
|
+
this.checkRequiredCredentials();
|
|
77581
|
+
const timestamp = this.milliseconds().toString();
|
|
77582
|
+
headers = {
|
|
77583
|
+
'ACCESS-KEY': this.apiKey,
|
|
77584
|
+
'ACCESS-PASSPHRASE': this.password,
|
|
77585
|
+
'ACCESS-TIMESTAMP': timestamp,
|
|
77586
|
+
'ACCESS-NONCE': timestamp,
|
|
77587
|
+
};
|
|
77588
|
+
let sign_body = '';
|
|
77589
|
+
if (method === 'GET') {
|
|
77590
|
+
if (!this.isEmpty(query)) {
|
|
77591
|
+
const urlencodedQuery = '?' + this.urlencode(query);
|
|
77592
|
+
url += urlencodedQuery;
|
|
77593
|
+
request += urlencodedQuery;
|
|
77594
|
+
}
|
|
77595
|
+
}
|
|
77596
|
+
else {
|
|
77597
|
+
if (!this.isEmpty(query)) {
|
|
77598
|
+
body = this.json(query);
|
|
77599
|
+
sign_body = body;
|
|
77600
|
+
}
|
|
77601
|
+
headers['Content-Type'] = 'application/json';
|
|
77602
|
+
}
|
|
77603
|
+
const auth = request + method + timestamp + timestamp + sign_body;
|
|
77604
|
+
const signature = this.stringToBase64(this.hmac(this.encode(auth), this.encode(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__/* .sha256 */ .J));
|
|
77605
|
+
headers['ACCESS-SIGN'] = signature;
|
|
77606
|
+
}
|
|
77607
|
+
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
77608
|
+
}
|
|
77609
|
+
}
|
|
77610
|
+
|
|
77611
|
+
|
|
75483
77612
|
/***/ }),
|
|
75484
77613
|
|
|
75485
77614
|
/***/ 6246:
|
|
@@ -250441,6 +252570,7 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
250441
252570
|
'watchOrderBook': {
|
|
250442
252571
|
'snapshotDelay': 5,
|
|
250443
252572
|
'snapshotMaxRetries': 3,
|
|
252573
|
+
'method': '/market/level2', // '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50'
|
|
250444
252574
|
},
|
|
250445
252575
|
},
|
|
250446
252576
|
'streaming': {
|
|
@@ -250842,10 +252972,15 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
250842
252972
|
/**
|
|
250843
252973
|
* @method
|
|
250844
252974
|
* @name kucoin#watchOrderBook
|
|
252975
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level1-bbo-market-data
|
|
252976
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level2-market-data
|
|
252977
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level2-5-best-ask-bid-orders
|
|
252978
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level2-50-best-ask-bid-orders
|
|
250845
252979
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
250846
252980
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
250847
252981
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
250848
252982
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
252983
|
+
* @param {string} [params.method] either '/market/level2' or '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50' default is '/market/level2'
|
|
250849
252984
|
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
250850
252985
|
*/
|
|
250851
252986
|
//
|
|
@@ -250869,10 +253004,15 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
250869
253004
|
/**
|
|
250870
253005
|
* @method
|
|
250871
253006
|
* @name kucoin#watchOrderBookForSymbols
|
|
253007
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level1-bbo-market-data
|
|
253008
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level2-market-data
|
|
253009
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level2-5-best-ask-bid-orders
|
|
253010
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level2-50-best-ask-bid-orders
|
|
250872
253011
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
250873
253012
|
* @param {string[]} symbols unified array of symbols
|
|
250874
253013
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
250875
253014
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
253015
|
+
* @param {string} [params.method] either '/market/level2' or '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50' default is '/market/level2'
|
|
250876
253016
|
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
250877
253017
|
*/
|
|
250878
253018
|
const symbolsLength = symbols.length;
|
|
@@ -250880,28 +253020,36 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
250880
253020
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' watchOrderBookForSymbols() requires a non-empty array of symbols');
|
|
250881
253021
|
}
|
|
250882
253022
|
if (limit !== undefined) {
|
|
250883
|
-
if ((limit !== 20) && (limit !== 100)) {
|
|
250884
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + " watchOrderBook 'limit' argument must be undefined, 20 or 100");
|
|
253023
|
+
if ((limit !== 20) && (limit !== 100) && (limit !== 50) && (limit !== 5)) {
|
|
253024
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + " watchOrderBook 'limit' argument must be undefined, 5, 20, 50 or 100");
|
|
250885
253025
|
}
|
|
250886
253026
|
}
|
|
250887
253027
|
await this.loadMarkets();
|
|
250888
253028
|
symbols = this.marketSymbols(symbols);
|
|
250889
253029
|
const marketIds = this.marketIds(symbols);
|
|
250890
253030
|
const url = await this.negotiate(false);
|
|
250891
|
-
|
|
253031
|
+
let method = undefined;
|
|
253032
|
+
[method, params] = this.handleOptionAndParams(params, 'watchOrderBook', 'method', '/market/level2');
|
|
253033
|
+
if ((limit === 5) || (limit === 50)) {
|
|
253034
|
+
method = '/spotMarket/level2Depth' + limit.toString();
|
|
253035
|
+
}
|
|
253036
|
+
const topic = method + ':' + marketIds.join(',');
|
|
250892
253037
|
const messageHashes = [];
|
|
250893
253038
|
const subscriptionHashes = [];
|
|
250894
253039
|
for (let i = 0; i < symbols.length; i++) {
|
|
250895
253040
|
const symbol = symbols[i];
|
|
250896
253041
|
messageHashes.push('orderbook:' + symbol);
|
|
250897
253042
|
const marketId = marketIds[i];
|
|
250898
|
-
subscriptionHashes.push('
|
|
253043
|
+
subscriptionHashes.push(method + ':' + marketId);
|
|
253044
|
+
}
|
|
253045
|
+
let subscription = {};
|
|
253046
|
+
if (method === '/market/level2') { // other streams return the entire orderbook, so we don't need to fetch the snapshot through REST
|
|
253047
|
+
subscription = {
|
|
253048
|
+
'method': this.handleOrderBookSubscription,
|
|
253049
|
+
'symbols': symbols,
|
|
253050
|
+
'limit': limit,
|
|
253051
|
+
};
|
|
250899
253052
|
}
|
|
250900
|
-
const subscription = {
|
|
250901
|
-
'method': this.handleOrderBookSubscription,
|
|
250902
|
-
'symbols': symbols,
|
|
250903
|
-
'limit': limit,
|
|
250904
|
-
};
|
|
250905
253053
|
const orderbook = await this.subscribeMultiple(url, messageHashes, topic, subscriptionHashes, params, subscription);
|
|
250906
253054
|
return orderbook.limit();
|
|
250907
253055
|
}
|
|
@@ -250925,41 +253073,74 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
250925
253073
|
// }
|
|
250926
253074
|
// }
|
|
250927
253075
|
//
|
|
253076
|
+
// {
|
|
253077
|
+
// "topic": "/spotMarket/level2Depth5:BTC-USDT",
|
|
253078
|
+
// "type": "message",
|
|
253079
|
+
// "data": {
|
|
253080
|
+
// "asks": [
|
|
253081
|
+
// [
|
|
253082
|
+
// "42815.6",
|
|
253083
|
+
// "1.24016245"
|
|
253084
|
+
// ]
|
|
253085
|
+
// ],
|
|
253086
|
+
// "bids": [
|
|
253087
|
+
// [
|
|
253088
|
+
// "42815.5",
|
|
253089
|
+
// "0.08652716"
|
|
253090
|
+
// ]
|
|
253091
|
+
// ],
|
|
253092
|
+
// "timestamp": 1707204474018
|
|
253093
|
+
// },
|
|
253094
|
+
// "subject": "level2"
|
|
253095
|
+
// }
|
|
253096
|
+
//
|
|
250928
253097
|
const data = this.safeValue(message, 'data');
|
|
250929
|
-
const
|
|
253098
|
+
const subject = this.safeString(message, 'subject');
|
|
253099
|
+
const topic = this.safeString(message, 'topic');
|
|
253100
|
+
const topicParts = topic.split(':');
|
|
253101
|
+
const topicSymbol = this.safeString(topicParts, 1);
|
|
253102
|
+
const topicChannel = this.safeString(topicParts, 0);
|
|
253103
|
+
const marketId = this.safeString(data, 'symbol', topicSymbol);
|
|
250930
253104
|
const symbol = this.safeSymbol(marketId, undefined, '-');
|
|
250931
253105
|
const messageHash = 'orderbook:' + symbol;
|
|
250932
|
-
|
|
250933
|
-
|
|
250934
|
-
|
|
250935
|
-
|
|
250936
|
-
const cacheLength = storedOrderBook.cache.length;
|
|
250937
|
-
const topic = this.safeString(message, 'topic');
|
|
250938
|
-
const topicParts = topic.split(':');
|
|
250939
|
-
const topicSymbol = this.safeString(topicParts, 1);
|
|
250940
|
-
const topicChannel = this.safeString(topicParts, 0);
|
|
250941
|
-
const subscriptions = Object.keys(client.subscriptions);
|
|
250942
|
-
let subscription = undefined;
|
|
250943
|
-
for (let i = 0; i < subscriptions.length; i++) {
|
|
250944
|
-
const key = subscriptions[i];
|
|
250945
|
-
if ((key.indexOf(topicSymbol) >= 0) && (key.indexOf(topicChannel) >= 0)) {
|
|
250946
|
-
subscription = client.subscriptions[key];
|
|
250947
|
-
break;
|
|
250948
|
-
}
|
|
253106
|
+
let orderbook = this.safeDict(this.orderbooks, symbol);
|
|
253107
|
+
if (subject === 'level2') {
|
|
253108
|
+
if (orderbook === undefined) {
|
|
253109
|
+
orderbook = this.orderBook();
|
|
250949
253110
|
}
|
|
250950
|
-
|
|
250951
|
-
|
|
250952
|
-
if (cacheLength === snapshotDelay) {
|
|
250953
|
-
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
|
|
253111
|
+
else {
|
|
253112
|
+
orderbook.reset();
|
|
250954
253113
|
}
|
|
250955
|
-
|
|
250956
|
-
return;
|
|
253114
|
+
orderbook['symbol'] = symbol;
|
|
250957
253115
|
}
|
|
250958
|
-
else
|
|
250959
|
-
|
|
253116
|
+
else {
|
|
253117
|
+
const nonce = this.safeInteger(orderbook, 'nonce');
|
|
253118
|
+
const deltaEnd = this.safeInteger2(data, 'sequenceEnd', 'timestamp');
|
|
253119
|
+
if (nonce === undefined) {
|
|
253120
|
+
const cacheLength = orderbook.cache.length;
|
|
253121
|
+
const subscriptions = Object.keys(client.subscriptions);
|
|
253122
|
+
let subscription = undefined;
|
|
253123
|
+
for (let i = 0; i < subscriptions.length; i++) {
|
|
253124
|
+
const key = subscriptions[i];
|
|
253125
|
+
if ((key.indexOf(topicSymbol) >= 0) && (key.indexOf(topicChannel) >= 0)) {
|
|
253126
|
+
subscription = client.subscriptions[key];
|
|
253127
|
+
break;
|
|
253128
|
+
}
|
|
253129
|
+
}
|
|
253130
|
+
const limit = this.safeInteger(subscription, 'limit');
|
|
253131
|
+
const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 5);
|
|
253132
|
+
if (cacheLength === snapshotDelay) {
|
|
253133
|
+
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
|
|
253134
|
+
}
|
|
253135
|
+
orderbook.cache.push(data);
|
|
253136
|
+
return;
|
|
253137
|
+
}
|
|
253138
|
+
else if (nonce >= deltaEnd) {
|
|
253139
|
+
return;
|
|
253140
|
+
}
|
|
250960
253141
|
}
|
|
250961
|
-
this.handleDelta(
|
|
250962
|
-
client.resolve(
|
|
253142
|
+
this.handleDelta(orderbook, data);
|
|
253143
|
+
client.resolve(orderbook, messageHash);
|
|
250963
253144
|
}
|
|
250964
253145
|
getCacheIndex(orderbook, cache) {
|
|
250965
253146
|
const firstDelta = this.safeValue(cache, 0);
|
|
@@ -250979,11 +253160,11 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
250979
253160
|
return cache.length;
|
|
250980
253161
|
}
|
|
250981
253162
|
handleDelta(orderbook, delta) {
|
|
250982
|
-
|
|
250983
|
-
|
|
253163
|
+
const timestamp = this.safeInteger2(delta, 'time', 'timestamp');
|
|
253164
|
+
orderbook['nonce'] = this.safeInteger(delta, 'sequenceEnd', timestamp);
|
|
250984
253165
|
orderbook['timestamp'] = timestamp;
|
|
250985
253166
|
orderbook['datetime'] = this.iso8601(timestamp);
|
|
250986
|
-
const changes = this.safeValue(delta, 'changes');
|
|
253167
|
+
const changes = this.safeValue(delta, 'changes', delta);
|
|
250987
253168
|
const bids = this.safeValue(changes, 'bids', []);
|
|
250988
253169
|
const asks = this.safeValue(changes, 'asks', []);
|
|
250989
253170
|
const storedBids = orderbook['bids'];
|
|
@@ -251397,6 +253578,7 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
251397
253578
|
}
|
|
251398
253579
|
const subject = this.safeString(message, 'subject');
|
|
251399
253580
|
const methods = {
|
|
253581
|
+
'level2': this.handleOrderBook,
|
|
251400
253582
|
'trade.l2update': this.handleOrderBook,
|
|
251401
253583
|
'trade.ticker': this.handleTicker,
|
|
251402
253584
|
'trade.snapshot': this.handleTicker,
|
|
@@ -301613,39 +303795,39 @@ var __webpack_exports__ = {};
|
|
|
301613
303795
|
(() => {
|
|
301614
303796
|
__webpack_require__.r(__webpack_exports__);
|
|
301615
303797
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
301616
|
-
/* harmony export */ AccountNotEnabled: () => (/* reexport safe */
|
|
301617
|
-
/* harmony export */ AccountSuspended: () => (/* reexport safe */
|
|
301618
|
-
/* harmony export */ AddressPending: () => (/* reexport safe */
|
|
301619
|
-
/* harmony export */ ArgumentsRequired: () => (/* reexport safe */
|
|
301620
|
-
/* harmony export */ AuthenticationError: () => (/* reexport safe */
|
|
301621
|
-
/* harmony export */ BadRequest: () => (/* reexport safe */
|
|
301622
|
-
/* harmony export */ BadResponse: () => (/* reexport safe */
|
|
301623
|
-
/* harmony export */ BadSymbol: () => (/* reexport safe */
|
|
301624
|
-
/* harmony export */ BaseError: () => (/* reexport safe */
|
|
301625
|
-
/* harmony export */ CancelPending: () => (/* reexport safe */
|
|
301626
|
-
/* harmony export */ DDoSProtection: () => (/* reexport safe */
|
|
301627
|
-
/* harmony export */ DuplicateOrderId: () => (/* reexport safe */
|
|
303798
|
+
/* harmony export */ AccountNotEnabled: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.AccountNotEnabled),
|
|
303799
|
+
/* harmony export */ AccountSuspended: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.AccountSuspended),
|
|
303800
|
+
/* harmony export */ AddressPending: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.AddressPending),
|
|
303801
|
+
/* harmony export */ ArgumentsRequired: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.ArgumentsRequired),
|
|
303802
|
+
/* harmony export */ AuthenticationError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.AuthenticationError),
|
|
303803
|
+
/* harmony export */ BadRequest: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.BadRequest),
|
|
303804
|
+
/* harmony export */ BadResponse: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.BadResponse),
|
|
303805
|
+
/* harmony export */ BadSymbol: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.BadSymbol),
|
|
303806
|
+
/* harmony export */ BaseError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.BaseError),
|
|
303807
|
+
/* harmony export */ CancelPending: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.CancelPending),
|
|
303808
|
+
/* harmony export */ DDoSProtection: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.DDoSProtection),
|
|
303809
|
+
/* harmony export */ DuplicateOrderId: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.DuplicateOrderId),
|
|
301628
303810
|
/* harmony export */ Exchange: () => (/* reexport safe */ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__.e),
|
|
301629
|
-
/* harmony export */ ExchangeError: () => (/* reexport safe */
|
|
301630
|
-
/* harmony export */ ExchangeNotAvailable: () => (/* reexport safe */
|
|
301631
|
-
/* harmony export */ InsufficientFunds: () => (/* reexport safe */
|
|
301632
|
-
/* harmony export */ InvalidAddress: () => (/* reexport safe */
|
|
301633
|
-
/* harmony export */ InvalidNonce: () => (/* reexport safe */
|
|
301634
|
-
/* harmony export */ InvalidOrder: () => (/* reexport safe */
|
|
301635
|
-
/* harmony export */ MarginModeAlreadySet: () => (/* reexport safe */
|
|
301636
|
-
/* harmony export */ NetworkError: () => (/* reexport safe */
|
|
301637
|
-
/* harmony export */ NoChange: () => (/* reexport safe */
|
|
301638
|
-
/* harmony export */ NotSupported: () => (/* reexport safe */
|
|
301639
|
-
/* harmony export */ NullResponse: () => (/* reexport safe */
|
|
301640
|
-
/* harmony export */ OnMaintenance: () => (/* reexport safe */
|
|
301641
|
-
/* harmony export */ OrderImmediatelyFillable: () => (/* reexport safe */
|
|
301642
|
-
/* harmony export */ OrderNotCached: () => (/* reexport safe */
|
|
301643
|
-
/* harmony export */ OrderNotFillable: () => (/* reexport safe */
|
|
301644
|
-
/* harmony export */ OrderNotFound: () => (/* reexport safe */
|
|
301645
|
-
/* harmony export */ PermissionDenied: () => (/* reexport safe */
|
|
301646
|
-
/* harmony export */ Precise: () => (/* reexport safe */
|
|
301647
|
-
/* harmony export */ RateLimitExceeded: () => (/* reexport safe */
|
|
301648
|
-
/* harmony export */ RequestTimeout: () => (/* reexport safe */
|
|
303811
|
+
/* harmony export */ ExchangeError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.ExchangeError),
|
|
303812
|
+
/* harmony export */ ExchangeNotAvailable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.ExchangeNotAvailable),
|
|
303813
|
+
/* harmony export */ InsufficientFunds: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.InsufficientFunds),
|
|
303814
|
+
/* harmony export */ InvalidAddress: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.InvalidAddress),
|
|
303815
|
+
/* harmony export */ InvalidNonce: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.InvalidNonce),
|
|
303816
|
+
/* harmony export */ InvalidOrder: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.InvalidOrder),
|
|
303817
|
+
/* harmony export */ MarginModeAlreadySet: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.MarginModeAlreadySet),
|
|
303818
|
+
/* harmony export */ NetworkError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.NetworkError),
|
|
303819
|
+
/* harmony export */ NoChange: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.NoChange),
|
|
303820
|
+
/* harmony export */ NotSupported: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.NotSupported),
|
|
303821
|
+
/* harmony export */ NullResponse: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.NullResponse),
|
|
303822
|
+
/* harmony export */ OnMaintenance: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.OnMaintenance),
|
|
303823
|
+
/* harmony export */ OrderImmediatelyFillable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.OrderImmediatelyFillable),
|
|
303824
|
+
/* harmony export */ OrderNotCached: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.OrderNotCached),
|
|
303825
|
+
/* harmony export */ OrderNotFillable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.OrderNotFillable),
|
|
303826
|
+
/* harmony export */ OrderNotFound: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.OrderNotFound),
|
|
303827
|
+
/* harmony export */ PermissionDenied: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.PermissionDenied),
|
|
303828
|
+
/* harmony export */ Precise: () => (/* reexport safe */ _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_163__.O),
|
|
303829
|
+
/* harmony export */ RateLimitExceeded: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.RateLimitExceeded),
|
|
303830
|
+
/* harmony export */ RequestTimeout: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__.RequestTimeout),
|
|
301649
303831
|
/* harmony export */ ace: () => (/* reexport safe */ _src_ace_js__WEBPACK_IMPORTED_MODULE_1__.Z),
|
|
301650
303832
|
/* harmony export */ alpaca: () => (/* reexport safe */ _src_alpaca_js__WEBPACK_IMPORTED_MODULE_2__.Z),
|
|
301651
303833
|
/* harmony export */ ascendex: () => (/* reexport safe */ _src_ascendex_js__WEBPACK_IMPORTED_MODULE_3__.Z),
|
|
@@ -301678,85 +303860,86 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
301678
303860
|
/* harmony export */ bitvavo: () => (/* reexport safe */ _src_bitvavo_js__WEBPACK_IMPORTED_MODULE_30__.Z),
|
|
301679
303861
|
/* harmony export */ bl3p: () => (/* reexport safe */ _src_bl3p_js__WEBPACK_IMPORTED_MODULE_31__.Z),
|
|
301680
303862
|
/* harmony export */ blockchaincom: () => (/* reexport safe */ _src_blockchaincom_js__WEBPACK_IMPORTED_MODULE_32__.Z),
|
|
301681
|
-
/* harmony export */
|
|
301682
|
-
/* harmony export */
|
|
301683
|
-
/* harmony export */
|
|
301684
|
-
/* harmony export */
|
|
301685
|
-
/* harmony export */
|
|
301686
|
-
/* harmony export */
|
|
301687
|
-
/* harmony export */
|
|
301688
|
-
/* harmony export */
|
|
301689
|
-
/* harmony export */
|
|
301690
|
-
/* harmony export */
|
|
301691
|
-
/* harmony export */
|
|
301692
|
-
/* harmony export */
|
|
301693
|
-
/* harmony export */
|
|
301694
|
-
/* harmony export */
|
|
301695
|
-
/* harmony export */
|
|
301696
|
-
/* harmony export */
|
|
301697
|
-
/* harmony export */
|
|
301698
|
-
/* harmony export */
|
|
303863
|
+
/* harmony export */ blofin: () => (/* reexport safe */ _src_blofin_js__WEBPACK_IMPORTED_MODULE_33__.Z),
|
|
303864
|
+
/* harmony export */ btcalpha: () => (/* reexport safe */ _src_btcalpha_js__WEBPACK_IMPORTED_MODULE_34__.Z),
|
|
303865
|
+
/* harmony export */ btcbox: () => (/* reexport safe */ _src_btcbox_js__WEBPACK_IMPORTED_MODULE_35__.Z),
|
|
303866
|
+
/* harmony export */ btcmarkets: () => (/* reexport safe */ _src_btcmarkets_js__WEBPACK_IMPORTED_MODULE_36__.Z),
|
|
303867
|
+
/* harmony export */ btcturk: () => (/* reexport safe */ _src_btcturk_js__WEBPACK_IMPORTED_MODULE_37__.Z),
|
|
303868
|
+
/* harmony export */ bybit: () => (/* reexport safe */ _src_bybit_js__WEBPACK_IMPORTED_MODULE_38__.Z),
|
|
303869
|
+
/* harmony export */ cex: () => (/* reexport safe */ _src_cex_js__WEBPACK_IMPORTED_MODULE_39__.Z),
|
|
303870
|
+
/* harmony export */ coinbase: () => (/* reexport safe */ _src_coinbase_js__WEBPACK_IMPORTED_MODULE_40__.Z),
|
|
303871
|
+
/* harmony export */ coinbasepro: () => (/* reexport safe */ _src_coinbasepro_js__WEBPACK_IMPORTED_MODULE_41__.Z),
|
|
303872
|
+
/* harmony export */ coincheck: () => (/* reexport safe */ _src_coincheck_js__WEBPACK_IMPORTED_MODULE_42__.Z),
|
|
303873
|
+
/* harmony export */ coinex: () => (/* reexport safe */ _src_coinex_js__WEBPACK_IMPORTED_MODULE_43__.Z),
|
|
303874
|
+
/* harmony export */ coinlist: () => (/* reexport safe */ _src_coinlist_js__WEBPACK_IMPORTED_MODULE_44__.Z),
|
|
303875
|
+
/* harmony export */ coinmate: () => (/* reexport safe */ _src_coinmate_js__WEBPACK_IMPORTED_MODULE_45__.Z),
|
|
303876
|
+
/* harmony export */ coinmetro: () => (/* reexport safe */ _src_coinmetro_js__WEBPACK_IMPORTED_MODULE_46__.Z),
|
|
303877
|
+
/* harmony export */ coinone: () => (/* reexport safe */ _src_coinone_js__WEBPACK_IMPORTED_MODULE_47__.Z),
|
|
303878
|
+
/* harmony export */ coinsph: () => (/* reexport safe */ _src_coinsph_js__WEBPACK_IMPORTED_MODULE_48__.Z),
|
|
303879
|
+
/* harmony export */ coinspot: () => (/* reexport safe */ _src_coinspot_js__WEBPACK_IMPORTED_MODULE_49__.Z),
|
|
303880
|
+
/* harmony export */ cryptocom: () => (/* reexport safe */ _src_cryptocom_js__WEBPACK_IMPORTED_MODULE_50__.Z),
|
|
303881
|
+
/* harmony export */ currencycom: () => (/* reexport safe */ _src_currencycom_js__WEBPACK_IMPORTED_MODULE_51__.Z),
|
|
301699
303882
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
301700
|
-
/* harmony export */ delta: () => (/* reexport safe */
|
|
301701
|
-
/* harmony export */ deribit: () => (/* reexport safe */
|
|
301702
|
-
/* harmony export */ digifinex: () => (/* reexport safe */
|
|
301703
|
-
/* harmony export */ errors: () => (/* reexport module object */
|
|
303883
|
+
/* harmony export */ delta: () => (/* reexport safe */ _src_delta_js__WEBPACK_IMPORTED_MODULE_52__.Z),
|
|
303884
|
+
/* harmony export */ deribit: () => (/* reexport safe */ _src_deribit_js__WEBPACK_IMPORTED_MODULE_53__.Z),
|
|
303885
|
+
/* harmony export */ digifinex: () => (/* reexport safe */ _src_digifinex_js__WEBPACK_IMPORTED_MODULE_54__.Z),
|
|
303886
|
+
/* harmony export */ errors: () => (/* reexport module object */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__),
|
|
301704
303887
|
/* harmony export */ exchanges: () => (/* binding */ exchanges),
|
|
301705
|
-
/* harmony export */ exmo: () => (/* reexport safe */
|
|
301706
|
-
/* harmony export */ fmfwio: () => (/* reexport safe */
|
|
301707
|
-
/* harmony export */ functions: () => (/* reexport module object */
|
|
301708
|
-
/* harmony export */ gate: () => (/* reexport safe */
|
|
301709
|
-
/* harmony export */ gateio: () => (/* reexport safe */
|
|
301710
|
-
/* harmony export */ gemini: () => (/* reexport safe */
|
|
301711
|
-
/* harmony export */ hitbtc: () => (/* reexport safe */
|
|
301712
|
-
/* harmony export */ hitbtc3: () => (/* reexport safe */
|
|
301713
|
-
/* harmony export */ hollaex: () => (/* reexport safe */
|
|
301714
|
-
/* harmony export */ htx: () => (/* reexport safe */
|
|
301715
|
-
/* harmony export */ huobi: () => (/* reexport safe */
|
|
301716
|
-
/* harmony export */ huobijp: () => (/* reexport safe */
|
|
301717
|
-
/* harmony export */ idex: () => (/* reexport safe */
|
|
301718
|
-
/* harmony export */ independentreserve: () => (/* reexport safe */
|
|
301719
|
-
/* harmony export */ indodax: () => (/* reexport safe */
|
|
301720
|
-
/* harmony export */ kraken: () => (/* reexport safe */
|
|
301721
|
-
/* harmony export */ krakenfutures: () => (/* reexport safe */
|
|
301722
|
-
/* harmony export */ kucoin: () => (/* reexport safe */
|
|
301723
|
-
/* harmony export */ kucoinfutures: () => (/* reexport safe */
|
|
301724
|
-
/* harmony export */ kuna: () => (/* reexport safe */
|
|
301725
|
-
/* harmony export */ latoken: () => (/* reexport safe */
|
|
301726
|
-
/* harmony export */ lbank: () => (/* reexport safe */
|
|
301727
|
-
/* harmony export */ luno: () => (/* reexport safe */
|
|
301728
|
-
/* harmony export */ lykke: () => (/* reexport safe */
|
|
301729
|
-
/* harmony export */ mercado: () => (/* reexport safe */
|
|
301730
|
-
/* harmony export */ mexc: () => (/* reexport safe */
|
|
301731
|
-
/* harmony export */ ndax: () => (/* reexport safe */
|
|
301732
|
-
/* harmony export */ novadax: () => (/* reexport safe */
|
|
301733
|
-
/* harmony export */ oceanex: () => (/* reexport safe */
|
|
301734
|
-
/* harmony export */ okcoin: () => (/* reexport safe */
|
|
301735
|
-
/* harmony export */ okx: () => (/* reexport safe */
|
|
301736
|
-
/* harmony export */ onetrading: () => (/* reexport safe */
|
|
301737
|
-
/* harmony export */ p2b: () => (/* reexport safe */
|
|
301738
|
-
/* harmony export */ paymium: () => (/* reexport safe */
|
|
301739
|
-
/* harmony export */ phemex: () => (/* reexport safe */
|
|
301740
|
-
/* harmony export */ poloniex: () => (/* reexport safe */
|
|
301741
|
-
/* harmony export */ poloniexfutures: () => (/* reexport safe */
|
|
303888
|
+
/* harmony export */ exmo: () => (/* reexport safe */ _src_exmo_js__WEBPACK_IMPORTED_MODULE_55__.Z),
|
|
303889
|
+
/* harmony export */ fmfwio: () => (/* reexport safe */ _src_fmfwio_js__WEBPACK_IMPORTED_MODULE_56__.Z),
|
|
303890
|
+
/* harmony export */ functions: () => (/* reexport module object */ _src_base_functions_js__WEBPACK_IMPORTED_MODULE_164__),
|
|
303891
|
+
/* harmony export */ gate: () => (/* reexport safe */ _src_gate_js__WEBPACK_IMPORTED_MODULE_57__.Z),
|
|
303892
|
+
/* harmony export */ gateio: () => (/* reexport safe */ _src_gateio_js__WEBPACK_IMPORTED_MODULE_58__.Z),
|
|
303893
|
+
/* harmony export */ gemini: () => (/* reexport safe */ _src_gemini_js__WEBPACK_IMPORTED_MODULE_59__.Z),
|
|
303894
|
+
/* harmony export */ hitbtc: () => (/* reexport safe */ _src_hitbtc_js__WEBPACK_IMPORTED_MODULE_60__.Z),
|
|
303895
|
+
/* harmony export */ hitbtc3: () => (/* reexport safe */ _src_hitbtc3_js__WEBPACK_IMPORTED_MODULE_61__.Z),
|
|
303896
|
+
/* harmony export */ hollaex: () => (/* reexport safe */ _src_hollaex_js__WEBPACK_IMPORTED_MODULE_62__.Z),
|
|
303897
|
+
/* harmony export */ htx: () => (/* reexport safe */ _src_htx_js__WEBPACK_IMPORTED_MODULE_63__.Z),
|
|
303898
|
+
/* harmony export */ huobi: () => (/* reexport safe */ _src_huobi_js__WEBPACK_IMPORTED_MODULE_64__.Z),
|
|
303899
|
+
/* harmony export */ huobijp: () => (/* reexport safe */ _src_huobijp_js__WEBPACK_IMPORTED_MODULE_65__.Z),
|
|
303900
|
+
/* harmony export */ idex: () => (/* reexport safe */ _src_idex_js__WEBPACK_IMPORTED_MODULE_66__.Z),
|
|
303901
|
+
/* harmony export */ independentreserve: () => (/* reexport safe */ _src_independentreserve_js__WEBPACK_IMPORTED_MODULE_67__.Z),
|
|
303902
|
+
/* harmony export */ indodax: () => (/* reexport safe */ _src_indodax_js__WEBPACK_IMPORTED_MODULE_68__.Z),
|
|
303903
|
+
/* harmony export */ kraken: () => (/* reexport safe */ _src_kraken_js__WEBPACK_IMPORTED_MODULE_69__.Z),
|
|
303904
|
+
/* harmony export */ krakenfutures: () => (/* reexport safe */ _src_krakenfutures_js__WEBPACK_IMPORTED_MODULE_70__.Z),
|
|
303905
|
+
/* harmony export */ kucoin: () => (/* reexport safe */ _src_kucoin_js__WEBPACK_IMPORTED_MODULE_71__.Z),
|
|
303906
|
+
/* harmony export */ kucoinfutures: () => (/* reexport safe */ _src_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_72__.Z),
|
|
303907
|
+
/* harmony export */ kuna: () => (/* reexport safe */ _src_kuna_js__WEBPACK_IMPORTED_MODULE_73__.Z),
|
|
303908
|
+
/* harmony export */ latoken: () => (/* reexport safe */ _src_latoken_js__WEBPACK_IMPORTED_MODULE_74__.Z),
|
|
303909
|
+
/* harmony export */ lbank: () => (/* reexport safe */ _src_lbank_js__WEBPACK_IMPORTED_MODULE_75__.Z),
|
|
303910
|
+
/* harmony export */ luno: () => (/* reexport safe */ _src_luno_js__WEBPACK_IMPORTED_MODULE_76__.Z),
|
|
303911
|
+
/* harmony export */ lykke: () => (/* reexport safe */ _src_lykke_js__WEBPACK_IMPORTED_MODULE_77__.Z),
|
|
303912
|
+
/* harmony export */ mercado: () => (/* reexport safe */ _src_mercado_js__WEBPACK_IMPORTED_MODULE_78__.Z),
|
|
303913
|
+
/* harmony export */ mexc: () => (/* reexport safe */ _src_mexc_js__WEBPACK_IMPORTED_MODULE_79__.Z),
|
|
303914
|
+
/* harmony export */ ndax: () => (/* reexport safe */ _src_ndax_js__WEBPACK_IMPORTED_MODULE_80__.Z),
|
|
303915
|
+
/* harmony export */ novadax: () => (/* reexport safe */ _src_novadax_js__WEBPACK_IMPORTED_MODULE_81__.Z),
|
|
303916
|
+
/* harmony export */ oceanex: () => (/* reexport safe */ _src_oceanex_js__WEBPACK_IMPORTED_MODULE_82__.Z),
|
|
303917
|
+
/* harmony export */ okcoin: () => (/* reexport safe */ _src_okcoin_js__WEBPACK_IMPORTED_MODULE_83__.Z),
|
|
303918
|
+
/* harmony export */ okx: () => (/* reexport safe */ _src_okx_js__WEBPACK_IMPORTED_MODULE_84__.Z),
|
|
303919
|
+
/* harmony export */ onetrading: () => (/* reexport safe */ _src_onetrading_js__WEBPACK_IMPORTED_MODULE_85__.Z),
|
|
303920
|
+
/* harmony export */ p2b: () => (/* reexport safe */ _src_p2b_js__WEBPACK_IMPORTED_MODULE_86__.Z),
|
|
303921
|
+
/* harmony export */ paymium: () => (/* reexport safe */ _src_paymium_js__WEBPACK_IMPORTED_MODULE_87__.Z),
|
|
303922
|
+
/* harmony export */ phemex: () => (/* reexport safe */ _src_phemex_js__WEBPACK_IMPORTED_MODULE_88__.Z),
|
|
303923
|
+
/* harmony export */ poloniex: () => (/* reexport safe */ _src_poloniex_js__WEBPACK_IMPORTED_MODULE_89__.Z),
|
|
303924
|
+
/* harmony export */ poloniexfutures: () => (/* reexport safe */ _src_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_90__.Z),
|
|
301742
303925
|
/* harmony export */ pro: () => (/* binding */ pro),
|
|
301743
|
-
/* harmony export */ probit: () => (/* reexport safe */
|
|
301744
|
-
/* harmony export */ timex: () => (/* reexport safe */
|
|
301745
|
-
/* harmony export */ tokocrypto: () => (/* reexport safe */
|
|
301746
|
-
/* harmony export */ upbit: () => (/* reexport safe */
|
|
303926
|
+
/* harmony export */ probit: () => (/* reexport safe */ _src_probit_js__WEBPACK_IMPORTED_MODULE_91__.Z),
|
|
303927
|
+
/* harmony export */ timex: () => (/* reexport safe */ _src_timex_js__WEBPACK_IMPORTED_MODULE_92__.Z),
|
|
303928
|
+
/* harmony export */ tokocrypto: () => (/* reexport safe */ _src_tokocrypto_js__WEBPACK_IMPORTED_MODULE_93__.Z),
|
|
303929
|
+
/* harmony export */ upbit: () => (/* reexport safe */ _src_upbit_js__WEBPACK_IMPORTED_MODULE_94__.Z),
|
|
301747
303930
|
/* harmony export */ version: () => (/* binding */ version),
|
|
301748
|
-
/* harmony export */ wavesexchange: () => (/* reexport safe */
|
|
301749
|
-
/* harmony export */ wazirx: () => (/* reexport safe */
|
|
301750
|
-
/* harmony export */ whitebit: () => (/* reexport safe */
|
|
301751
|
-
/* harmony export */ woo: () => (/* reexport safe */
|
|
301752
|
-
/* harmony export */ yobit: () => (/* reexport safe */
|
|
301753
|
-
/* harmony export */ zaif: () => (/* reexport safe */
|
|
301754
|
-
/* harmony export */ zonda: () => (/* reexport safe */
|
|
303931
|
+
/* harmony export */ wavesexchange: () => (/* reexport safe */ _src_wavesexchange_js__WEBPACK_IMPORTED_MODULE_95__.Z),
|
|
303932
|
+
/* harmony export */ wazirx: () => (/* reexport safe */ _src_wazirx_js__WEBPACK_IMPORTED_MODULE_96__.Z),
|
|
303933
|
+
/* harmony export */ whitebit: () => (/* reexport safe */ _src_whitebit_js__WEBPACK_IMPORTED_MODULE_97__.Z),
|
|
303934
|
+
/* harmony export */ woo: () => (/* reexport safe */ _src_woo_js__WEBPACK_IMPORTED_MODULE_98__.Z),
|
|
303935
|
+
/* harmony export */ yobit: () => (/* reexport safe */ _src_yobit_js__WEBPACK_IMPORTED_MODULE_99__.Z),
|
|
303936
|
+
/* harmony export */ zaif: () => (/* reexport safe */ _src_zaif_js__WEBPACK_IMPORTED_MODULE_100__.Z),
|
|
303937
|
+
/* harmony export */ zonda: () => (/* reexport safe */ _src_zonda_js__WEBPACK_IMPORTED_MODULE_101__.Z)
|
|
301755
303938
|
/* harmony export */ });
|
|
301756
303939
|
/* harmony import */ var _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3043);
|
|
301757
|
-
/* harmony import */ var
|
|
301758
|
-
/* harmony import */ var
|
|
301759
|
-
/* harmony import */ var
|
|
303940
|
+
/* harmony import */ var _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_163__ = __webpack_require__(2194);
|
|
303941
|
+
/* harmony import */ var _src_base_functions_js__WEBPACK_IMPORTED_MODULE_164__ = __webpack_require__(7100);
|
|
303942
|
+
/* harmony import */ var _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__ = __webpack_require__(6689);
|
|
301760
303943
|
/* harmony import */ var _src_ace_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9869);
|
|
301761
303944
|
/* harmony import */ var _src_alpaca_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5660);
|
|
301762
303945
|
/* harmony import */ var _src_ascendex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9612);
|
|
@@ -301789,135 +303972,136 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
301789
303972
|
/* harmony import */ var _src_bitvavo_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(9943);
|
|
301790
303973
|
/* harmony import */ var _src_bl3p_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(9476);
|
|
301791
303974
|
/* harmony import */ var _src_blockchaincom_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(182);
|
|
301792
|
-
/* harmony import */ var
|
|
301793
|
-
/* harmony import */ var
|
|
301794
|
-
/* harmony import */ var
|
|
301795
|
-
/* harmony import */ var
|
|
301796
|
-
/* harmony import */ var
|
|
301797
|
-
/* harmony import */ var
|
|
301798
|
-
/* harmony import */ var
|
|
301799
|
-
/* harmony import */ var
|
|
301800
|
-
/* harmony import */ var
|
|
301801
|
-
/* harmony import */ var
|
|
301802
|
-
/* harmony import */ var
|
|
301803
|
-
/* harmony import */ var
|
|
301804
|
-
/* harmony import */ var
|
|
301805
|
-
/* harmony import */ var
|
|
301806
|
-
/* harmony import */ var
|
|
301807
|
-
/* harmony import */ var
|
|
301808
|
-
/* harmony import */ var
|
|
301809
|
-
/* harmony import */ var
|
|
301810
|
-
/* harmony import */ var
|
|
301811
|
-
/* harmony import */ var
|
|
301812
|
-
/* harmony import */ var
|
|
301813
|
-
/* harmony import */ var
|
|
301814
|
-
/* harmony import */ var
|
|
301815
|
-
/* harmony import */ var
|
|
301816
|
-
/* harmony import */ var
|
|
301817
|
-
/* harmony import */ var
|
|
301818
|
-
/* harmony import */ var
|
|
301819
|
-
/* harmony import */ var
|
|
301820
|
-
/* harmony import */ var
|
|
301821
|
-
/* harmony import */ var
|
|
301822
|
-
/* harmony import */ var
|
|
301823
|
-
/* harmony import */ var
|
|
301824
|
-
/* harmony import */ var
|
|
301825
|
-
/* harmony import */ var
|
|
301826
|
-
/* harmony import */ var
|
|
301827
|
-
/* harmony import */ var
|
|
301828
|
-
/* harmony import */ var
|
|
301829
|
-
/* harmony import */ var
|
|
301830
|
-
/* harmony import */ var
|
|
301831
|
-
/* harmony import */ var
|
|
301832
|
-
/* harmony import */ var
|
|
301833
|
-
/* harmony import */ var
|
|
301834
|
-
/* harmony import */ var
|
|
301835
|
-
/* harmony import */ var
|
|
301836
|
-
/* harmony import */ var
|
|
301837
|
-
/* harmony import */ var
|
|
301838
|
-
/* harmony import */ var
|
|
301839
|
-
/* harmony import */ var
|
|
301840
|
-
/* harmony import */ var
|
|
301841
|
-
/* harmony import */ var
|
|
301842
|
-
/* harmony import */ var
|
|
301843
|
-
/* harmony import */ var
|
|
301844
|
-
/* harmony import */ var
|
|
301845
|
-
/* harmony import */ var
|
|
301846
|
-
/* harmony import */ var
|
|
301847
|
-
/* harmony import */ var
|
|
301848
|
-
/* harmony import */ var
|
|
301849
|
-
/* harmony import */ var
|
|
301850
|
-
/* harmony import */ var
|
|
301851
|
-
/* harmony import */ var
|
|
301852
|
-
/* harmony import */ var
|
|
301853
|
-
/* harmony import */ var
|
|
301854
|
-
/* harmony import */ var
|
|
301855
|
-
/* harmony import */ var
|
|
301856
|
-
/* harmony import */ var
|
|
301857
|
-
/* harmony import */ var
|
|
301858
|
-
/* harmony import */ var
|
|
301859
|
-
/* harmony import */ var
|
|
301860
|
-
/* harmony import */ var
|
|
301861
|
-
/* harmony import */ var
|
|
301862
|
-
/* harmony import */ var
|
|
301863
|
-
/* harmony import */ var
|
|
301864
|
-
/* harmony import */ var
|
|
301865
|
-
/* harmony import */ var
|
|
301866
|
-
/* harmony import */ var
|
|
301867
|
-
/* harmony import */ var
|
|
301868
|
-
/* harmony import */ var
|
|
301869
|
-
/* harmony import */ var
|
|
301870
|
-
/* harmony import */ var
|
|
301871
|
-
/* harmony import */ var
|
|
301872
|
-
/* harmony import */ var
|
|
301873
|
-
/* harmony import */ var
|
|
301874
|
-
/* harmony import */ var
|
|
301875
|
-
/* harmony import */ var
|
|
301876
|
-
/* harmony import */ var
|
|
301877
|
-
/* harmony import */ var
|
|
301878
|
-
/* harmony import */ var
|
|
301879
|
-
/* harmony import */ var
|
|
301880
|
-
/* harmony import */ var
|
|
301881
|
-
/* harmony import */ var
|
|
301882
|
-
/* harmony import */ var
|
|
301883
|
-
/* harmony import */ var
|
|
301884
|
-
/* harmony import */ var
|
|
301885
|
-
/* harmony import */ var
|
|
301886
|
-
/* harmony import */ var
|
|
301887
|
-
/* harmony import */ var
|
|
301888
|
-
/* harmony import */ var
|
|
301889
|
-
/* harmony import */ var
|
|
301890
|
-
/* harmony import */ var
|
|
301891
|
-
/* harmony import */ var
|
|
301892
|
-
/* harmony import */ var
|
|
301893
|
-
/* harmony import */ var
|
|
301894
|
-
/* harmony import */ var
|
|
301895
|
-
/* harmony import */ var
|
|
301896
|
-
/* harmony import */ var
|
|
301897
|
-
/* harmony import */ var
|
|
301898
|
-
/* harmony import */ var
|
|
301899
|
-
/* harmony import */ var
|
|
301900
|
-
/* harmony import */ var
|
|
301901
|
-
/* harmony import */ var
|
|
301902
|
-
/* harmony import */ var
|
|
301903
|
-
/* harmony import */ var
|
|
301904
|
-
/* harmony import */ var
|
|
301905
|
-
/* harmony import */ var
|
|
301906
|
-
/* harmony import */ var
|
|
301907
|
-
/* harmony import */ var
|
|
301908
|
-
/* harmony import */ var
|
|
301909
|
-
/* harmony import */ var
|
|
301910
|
-
/* harmony import */ var
|
|
301911
|
-
/* harmony import */ var
|
|
301912
|
-
/* harmony import */ var
|
|
301913
|
-
/* harmony import */ var
|
|
301914
|
-
/* harmony import */ var
|
|
301915
|
-
/* harmony import */ var
|
|
301916
|
-
/* harmony import */ var
|
|
301917
|
-
/* harmony import */ var
|
|
301918
|
-
/* harmony import */ var
|
|
301919
|
-
/* harmony import */ var
|
|
301920
|
-
/* harmony import */ var
|
|
303975
|
+
/* harmony import */ var _src_blofin_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(687);
|
|
303976
|
+
/* harmony import */ var _src_btcalpha_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(6246);
|
|
303977
|
+
/* harmony import */ var _src_btcbox_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(7796);
|
|
303978
|
+
/* harmony import */ var _src_btcmarkets_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(1776);
|
|
303979
|
+
/* harmony import */ var _src_btcturk_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(6304);
|
|
303980
|
+
/* harmony import */ var _src_bybit_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(3527);
|
|
303981
|
+
/* harmony import */ var _src_cex_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(6445);
|
|
303982
|
+
/* harmony import */ var _src_coinbase_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(437);
|
|
303983
|
+
/* harmony import */ var _src_coinbasepro_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(8856);
|
|
303984
|
+
/* harmony import */ var _src_coincheck_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(2117);
|
|
303985
|
+
/* harmony import */ var _src_coinex_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(332);
|
|
303986
|
+
/* harmony import */ var _src_coinlist_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(3623);
|
|
303987
|
+
/* harmony import */ var _src_coinmate_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(9816);
|
|
303988
|
+
/* harmony import */ var _src_coinmetro_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(4759);
|
|
303989
|
+
/* harmony import */ var _src_coinone_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(7811);
|
|
303990
|
+
/* harmony import */ var _src_coinsph_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(5782);
|
|
303991
|
+
/* harmony import */ var _src_coinspot_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(7794);
|
|
303992
|
+
/* harmony import */ var _src_cryptocom_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(9129);
|
|
303993
|
+
/* harmony import */ var _src_currencycom_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(3214);
|
|
303994
|
+
/* harmony import */ var _src_delta_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(1753);
|
|
303995
|
+
/* harmony import */ var _src_deribit_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(24);
|
|
303996
|
+
/* harmony import */ var _src_digifinex_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(8846);
|
|
303997
|
+
/* harmony import */ var _src_exmo_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(1729);
|
|
303998
|
+
/* harmony import */ var _src_fmfwio_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(5788);
|
|
303999
|
+
/* harmony import */ var _src_gate_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(7290);
|
|
304000
|
+
/* harmony import */ var _src_gateio_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(7036);
|
|
304001
|
+
/* harmony import */ var _src_gemini_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(6743);
|
|
304002
|
+
/* harmony import */ var _src_hitbtc_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(4714);
|
|
304003
|
+
/* harmony import */ var _src_hitbtc3_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(4815);
|
|
304004
|
+
/* harmony import */ var _src_hollaex_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(8422);
|
|
304005
|
+
/* harmony import */ var _src_htx_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(5939);
|
|
304006
|
+
/* harmony import */ var _src_huobi_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(8146);
|
|
304007
|
+
/* harmony import */ var _src_huobijp_js__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(7034);
|
|
304008
|
+
/* harmony import */ var _src_idex_js__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(8232);
|
|
304009
|
+
/* harmony import */ var _src_independentreserve_js__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(9570);
|
|
304010
|
+
/* harmony import */ var _src_indodax_js__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(1605);
|
|
304011
|
+
/* harmony import */ var _src_kraken_js__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(9922);
|
|
304012
|
+
/* harmony import */ var _src_krakenfutures_js__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(4470);
|
|
304013
|
+
/* harmony import */ var _src_kucoin_js__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(3583);
|
|
304014
|
+
/* harmony import */ var _src_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(1924);
|
|
304015
|
+
/* harmony import */ var _src_kuna_js__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(7732);
|
|
304016
|
+
/* harmony import */ var _src_latoken_js__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(2545);
|
|
304017
|
+
/* harmony import */ var _src_lbank_js__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(3944);
|
|
304018
|
+
/* harmony import */ var _src_luno_js__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(1758);
|
|
304019
|
+
/* harmony import */ var _src_lykke_js__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(3803);
|
|
304020
|
+
/* harmony import */ var _src_mercado_js__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(9013);
|
|
304021
|
+
/* harmony import */ var _src_mexc_js__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(6641);
|
|
304022
|
+
/* harmony import */ var _src_ndax_js__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(4531);
|
|
304023
|
+
/* harmony import */ var _src_novadax_js__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(2449);
|
|
304024
|
+
/* harmony import */ var _src_oceanex_js__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(6749);
|
|
304025
|
+
/* harmony import */ var _src_okcoin_js__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(3007);
|
|
304026
|
+
/* harmony import */ var _src_okx_js__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(4042);
|
|
304027
|
+
/* harmony import */ var _src_onetrading_js__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(6481);
|
|
304028
|
+
/* harmony import */ var _src_p2b_js__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(2466);
|
|
304029
|
+
/* harmony import */ var _src_paymium_js__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(7082);
|
|
304030
|
+
/* harmony import */ var _src_phemex_js__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(79);
|
|
304031
|
+
/* harmony import */ var _src_poloniex_js__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(8891);
|
|
304032
|
+
/* harmony import */ var _src_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(6877);
|
|
304033
|
+
/* harmony import */ var _src_probit_js__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(3657);
|
|
304034
|
+
/* harmony import */ var _src_timex_js__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(1067);
|
|
304035
|
+
/* harmony import */ var _src_tokocrypto_js__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(5261);
|
|
304036
|
+
/* harmony import */ var _src_upbit_js__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(7584);
|
|
304037
|
+
/* harmony import */ var _src_wavesexchange_js__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(3853);
|
|
304038
|
+
/* harmony import */ var _src_wazirx_js__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(6536);
|
|
304039
|
+
/* harmony import */ var _src_whitebit_js__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(5467);
|
|
304040
|
+
/* harmony import */ var _src_woo_js__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(517);
|
|
304041
|
+
/* harmony import */ var _src_yobit_js__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(3850);
|
|
304042
|
+
/* harmony import */ var _src_zaif_js__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(5934);
|
|
304043
|
+
/* harmony import */ var _src_zonda_js__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(5140);
|
|
304044
|
+
/* harmony import */ var _src_pro_alpaca_js__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(2467);
|
|
304045
|
+
/* harmony import */ var _src_pro_ascendex_js__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(2383);
|
|
304046
|
+
/* harmony import */ var _src_pro_bequant_js__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(8848);
|
|
304047
|
+
/* harmony import */ var _src_pro_binance_js__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(8764);
|
|
304048
|
+
/* harmony import */ var _src_pro_binancecoinm_js__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(5078);
|
|
304049
|
+
/* harmony import */ var _src_pro_binanceus_js__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(1326);
|
|
304050
|
+
/* harmony import */ var _src_pro_binanceusdm_js__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(1230);
|
|
304051
|
+
/* harmony import */ var _src_pro_bingx_js__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(6955);
|
|
304052
|
+
/* harmony import */ var _src_pro_bitcoincom_js__WEBPACK_IMPORTED_MODULE_110__ = __webpack_require__(453);
|
|
304053
|
+
/* harmony import */ var _src_pro_bitfinex_js__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(9772);
|
|
304054
|
+
/* harmony import */ var _src_pro_bitfinex2_js__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(588);
|
|
304055
|
+
/* harmony import */ var _src_pro_bitget_js__WEBPACK_IMPORTED_MODULE_113__ = __webpack_require__(1885);
|
|
304056
|
+
/* harmony import */ var _src_pro_bitmart_js__WEBPACK_IMPORTED_MODULE_114__ = __webpack_require__(7504);
|
|
304057
|
+
/* harmony import */ var _src_pro_bitmex_js__WEBPACK_IMPORTED_MODULE_115__ = __webpack_require__(2302);
|
|
304058
|
+
/* harmony import */ var _src_pro_bitopro_js__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(2191);
|
|
304059
|
+
/* harmony import */ var _src_pro_bitpanda_js__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(1297);
|
|
304060
|
+
/* harmony import */ var _src_pro_bitrue_js__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(3005);
|
|
304061
|
+
/* harmony import */ var _src_pro_bitstamp_js__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(2317);
|
|
304062
|
+
/* harmony import */ var _src_pro_bitvavo_js__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(6977);
|
|
304063
|
+
/* harmony import */ var _src_pro_blockchaincom_js__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(2519);
|
|
304064
|
+
/* harmony import */ var _src_pro_bybit_js__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(5030);
|
|
304065
|
+
/* harmony import */ var _src_pro_cex_js__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(5272);
|
|
304066
|
+
/* harmony import */ var _src_pro_coinbase_js__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(3414);
|
|
304067
|
+
/* harmony import */ var _src_pro_coinbasepro_js__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(8368);
|
|
304068
|
+
/* harmony import */ var _src_pro_coincheck_js__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(7891);
|
|
304069
|
+
/* harmony import */ var _src_pro_coinex_js__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(204);
|
|
304070
|
+
/* harmony import */ var _src_pro_coinone_js__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(5208);
|
|
304071
|
+
/* harmony import */ var _src_pro_cryptocom_js__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(6820);
|
|
304072
|
+
/* harmony import */ var _src_pro_currencycom_js__WEBPACK_IMPORTED_MODULE_130__ = __webpack_require__(2952);
|
|
304073
|
+
/* harmony import */ var _src_pro_deribit_js__WEBPACK_IMPORTED_MODULE_131__ = __webpack_require__(1788);
|
|
304074
|
+
/* harmony import */ var _src_pro_exmo_js__WEBPACK_IMPORTED_MODULE_132__ = __webpack_require__(9004);
|
|
304075
|
+
/* harmony import */ var _src_pro_gate_js__WEBPACK_IMPORTED_MODULE_133__ = __webpack_require__(8335);
|
|
304076
|
+
/* harmony import */ var _src_pro_gateio_js__WEBPACK_IMPORTED_MODULE_134__ = __webpack_require__(1465);
|
|
304077
|
+
/* harmony import */ var _src_pro_gemini_js__WEBPACK_IMPORTED_MODULE_135__ = __webpack_require__(9488);
|
|
304078
|
+
/* harmony import */ var _src_pro_hitbtc_js__WEBPACK_IMPORTED_MODULE_136__ = __webpack_require__(5189);
|
|
304079
|
+
/* harmony import */ var _src_pro_hollaex_js__WEBPACK_IMPORTED_MODULE_137__ = __webpack_require__(8559);
|
|
304080
|
+
/* harmony import */ var _src_pro_htx_js__WEBPACK_IMPORTED_MODULE_138__ = __webpack_require__(7474);
|
|
304081
|
+
/* harmony import */ var _src_pro_huobi_js__WEBPACK_IMPORTED_MODULE_139__ = __webpack_require__(8384);
|
|
304082
|
+
/* harmony import */ var _src_pro_huobijp_js__WEBPACK_IMPORTED_MODULE_140__ = __webpack_require__(9021);
|
|
304083
|
+
/* harmony import */ var _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_141__ = __webpack_require__(3484);
|
|
304084
|
+
/* harmony import */ var _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_142__ = __webpack_require__(1311);
|
|
304085
|
+
/* harmony import */ var _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_143__ = __webpack_require__(736);
|
|
304086
|
+
/* harmony import */ var _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_144__ = __webpack_require__(449);
|
|
304087
|
+
/* harmony import */ var _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_145__ = __webpack_require__(2387);
|
|
304088
|
+
/* harmony import */ var _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_146__ = __webpack_require__(7181);
|
|
304089
|
+
/* harmony import */ var _src_pro_lbank_js__WEBPACK_IMPORTED_MODULE_147__ = __webpack_require__(1267);
|
|
304090
|
+
/* harmony import */ var _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_148__ = __webpack_require__(627);
|
|
304091
|
+
/* harmony import */ var _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_149__ = __webpack_require__(6484);
|
|
304092
|
+
/* harmony import */ var _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_150__ = __webpack_require__(8080);
|
|
304093
|
+
/* harmony import */ var _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_151__ = __webpack_require__(7105);
|
|
304094
|
+
/* harmony import */ var _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_152__ = __webpack_require__(2214);
|
|
304095
|
+
/* harmony import */ var _src_pro_onetrading_js__WEBPACK_IMPORTED_MODULE_153__ = __webpack_require__(9419);
|
|
304096
|
+
/* harmony import */ var _src_pro_p2b_js__WEBPACK_IMPORTED_MODULE_154__ = __webpack_require__(8516);
|
|
304097
|
+
/* harmony import */ var _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_155__ = __webpack_require__(4360);
|
|
304098
|
+
/* harmony import */ var _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_156__ = __webpack_require__(7924);
|
|
304099
|
+
/* harmony import */ var _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_157__ = __webpack_require__(3541);
|
|
304100
|
+
/* harmony import */ var _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_158__ = __webpack_require__(9782);
|
|
304101
|
+
/* harmony import */ var _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_159__ = __webpack_require__(7614);
|
|
304102
|
+
/* harmony import */ var _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_160__ = __webpack_require__(4828);
|
|
304103
|
+
/* harmony import */ var _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_161__ = __webpack_require__(5630);
|
|
304104
|
+
/* harmony import */ var _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_162__ = __webpack_require__(3910);
|
|
301921
304105
|
/*
|
|
301922
304106
|
|
|
301923
304107
|
MIT License
|
|
@@ -301952,7 +304136,7 @@ SOFTWARE.
|
|
|
301952
304136
|
|
|
301953
304137
|
//-----------------------------------------------------------------------------
|
|
301954
304138
|
// this is updated by vss.js when building
|
|
301955
|
-
const version = '4.2.
|
|
304139
|
+
const version = '4.2.38';
|
|
301956
304140
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
301957
304141
|
//-----------------------------------------------------------------------------
|
|
301958
304142
|
|
|
@@ -302053,6 +304237,7 @@ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion
|
|
|
302053
304237
|
|
|
302054
304238
|
|
|
302055
304239
|
|
|
304240
|
+
|
|
302056
304241
|
|
|
302057
304242
|
|
|
302058
304243
|
// pro exchanges
|
|
@@ -302150,137 +304335,138 @@ const exchanges = {
|
|
|
302150
304335
|
'bitvavo': _src_bitvavo_js__WEBPACK_IMPORTED_MODULE_30__/* ["default"] */ .Z,
|
|
302151
304336
|
'bl3p': _src_bl3p_js__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z,
|
|
302152
304337
|
'blockchaincom': _src_blockchaincom_js__WEBPACK_IMPORTED_MODULE_32__/* ["default"] */ .Z,
|
|
302153
|
-
'
|
|
302154
|
-
'
|
|
302155
|
-
'
|
|
302156
|
-
'
|
|
302157
|
-
'
|
|
302158
|
-
'
|
|
302159
|
-
'
|
|
302160
|
-
'
|
|
302161
|
-
'
|
|
302162
|
-
'
|
|
302163
|
-
'
|
|
302164
|
-
'
|
|
302165
|
-
'
|
|
302166
|
-
'
|
|
302167
|
-
'
|
|
302168
|
-
'
|
|
302169
|
-
'
|
|
302170
|
-
'
|
|
302171
|
-
'
|
|
302172
|
-
'
|
|
302173
|
-
'
|
|
302174
|
-
'
|
|
302175
|
-
'
|
|
302176
|
-
'
|
|
302177
|
-
'
|
|
302178
|
-
'
|
|
302179
|
-
'
|
|
302180
|
-
'
|
|
302181
|
-
'
|
|
302182
|
-
'
|
|
302183
|
-
'
|
|
302184
|
-
'
|
|
302185
|
-
'
|
|
302186
|
-
'
|
|
302187
|
-
'
|
|
302188
|
-
'
|
|
302189
|
-
'
|
|
302190
|
-
'
|
|
302191
|
-
'
|
|
302192
|
-
'
|
|
302193
|
-
'
|
|
302194
|
-
'
|
|
302195
|
-
'
|
|
302196
|
-
'
|
|
302197
|
-
'
|
|
302198
|
-
'
|
|
302199
|
-
'
|
|
302200
|
-
'
|
|
302201
|
-
'
|
|
302202
|
-
'
|
|
302203
|
-
'
|
|
302204
|
-
'
|
|
302205
|
-
'
|
|
302206
|
-
'
|
|
302207
|
-
'
|
|
302208
|
-
'
|
|
302209
|
-
'
|
|
302210
|
-
'
|
|
302211
|
-
'
|
|
302212
|
-
'
|
|
302213
|
-
'
|
|
302214
|
-
'
|
|
302215
|
-
'
|
|
302216
|
-
'
|
|
302217
|
-
'
|
|
302218
|
-
'
|
|
302219
|
-
'
|
|
302220
|
-
'
|
|
304338
|
+
'blofin': _src_blofin_js__WEBPACK_IMPORTED_MODULE_33__/* ["default"] */ .Z,
|
|
304339
|
+
'btcalpha': _src_btcalpha_js__WEBPACK_IMPORTED_MODULE_34__/* ["default"] */ .Z,
|
|
304340
|
+
'btcbox': _src_btcbox_js__WEBPACK_IMPORTED_MODULE_35__/* ["default"] */ .Z,
|
|
304341
|
+
'btcmarkets': _src_btcmarkets_js__WEBPACK_IMPORTED_MODULE_36__/* ["default"] */ .Z,
|
|
304342
|
+
'btcturk': _src_btcturk_js__WEBPACK_IMPORTED_MODULE_37__/* ["default"] */ .Z,
|
|
304343
|
+
'bybit': _src_bybit_js__WEBPACK_IMPORTED_MODULE_38__/* ["default"] */ .Z,
|
|
304344
|
+
'cex': _src_cex_js__WEBPACK_IMPORTED_MODULE_39__/* ["default"] */ .Z,
|
|
304345
|
+
'coinbase': _src_coinbase_js__WEBPACK_IMPORTED_MODULE_40__/* ["default"] */ .Z,
|
|
304346
|
+
'coinbasepro': _src_coinbasepro_js__WEBPACK_IMPORTED_MODULE_41__/* ["default"] */ .Z,
|
|
304347
|
+
'coincheck': _src_coincheck_js__WEBPACK_IMPORTED_MODULE_42__/* ["default"] */ .Z,
|
|
304348
|
+
'coinex': _src_coinex_js__WEBPACK_IMPORTED_MODULE_43__/* ["default"] */ .Z,
|
|
304349
|
+
'coinlist': _src_coinlist_js__WEBPACK_IMPORTED_MODULE_44__/* ["default"] */ .Z,
|
|
304350
|
+
'coinmate': _src_coinmate_js__WEBPACK_IMPORTED_MODULE_45__/* ["default"] */ .Z,
|
|
304351
|
+
'coinmetro': _src_coinmetro_js__WEBPACK_IMPORTED_MODULE_46__/* ["default"] */ .Z,
|
|
304352
|
+
'coinone': _src_coinone_js__WEBPACK_IMPORTED_MODULE_47__/* ["default"] */ .Z,
|
|
304353
|
+
'coinsph': _src_coinsph_js__WEBPACK_IMPORTED_MODULE_48__/* ["default"] */ .Z,
|
|
304354
|
+
'coinspot': _src_coinspot_js__WEBPACK_IMPORTED_MODULE_49__/* ["default"] */ .Z,
|
|
304355
|
+
'cryptocom': _src_cryptocom_js__WEBPACK_IMPORTED_MODULE_50__/* ["default"] */ .Z,
|
|
304356
|
+
'currencycom': _src_currencycom_js__WEBPACK_IMPORTED_MODULE_51__/* ["default"] */ .Z,
|
|
304357
|
+
'delta': _src_delta_js__WEBPACK_IMPORTED_MODULE_52__/* ["default"] */ .Z,
|
|
304358
|
+
'deribit': _src_deribit_js__WEBPACK_IMPORTED_MODULE_53__/* ["default"] */ .Z,
|
|
304359
|
+
'digifinex': _src_digifinex_js__WEBPACK_IMPORTED_MODULE_54__/* ["default"] */ .Z,
|
|
304360
|
+
'exmo': _src_exmo_js__WEBPACK_IMPORTED_MODULE_55__/* ["default"] */ .Z,
|
|
304361
|
+
'fmfwio': _src_fmfwio_js__WEBPACK_IMPORTED_MODULE_56__/* ["default"] */ .Z,
|
|
304362
|
+
'gate': _src_gate_js__WEBPACK_IMPORTED_MODULE_57__/* ["default"] */ .Z,
|
|
304363
|
+
'gateio': _src_gateio_js__WEBPACK_IMPORTED_MODULE_58__/* ["default"] */ .Z,
|
|
304364
|
+
'gemini': _src_gemini_js__WEBPACK_IMPORTED_MODULE_59__/* ["default"] */ .Z,
|
|
304365
|
+
'hitbtc': _src_hitbtc_js__WEBPACK_IMPORTED_MODULE_60__/* ["default"] */ .Z,
|
|
304366
|
+
'hitbtc3': _src_hitbtc3_js__WEBPACK_IMPORTED_MODULE_61__/* ["default"] */ .Z,
|
|
304367
|
+
'hollaex': _src_hollaex_js__WEBPACK_IMPORTED_MODULE_62__/* ["default"] */ .Z,
|
|
304368
|
+
'htx': _src_htx_js__WEBPACK_IMPORTED_MODULE_63__/* ["default"] */ .Z,
|
|
304369
|
+
'huobi': _src_huobi_js__WEBPACK_IMPORTED_MODULE_64__/* ["default"] */ .Z,
|
|
304370
|
+
'huobijp': _src_huobijp_js__WEBPACK_IMPORTED_MODULE_65__/* ["default"] */ .Z,
|
|
304371
|
+
'idex': _src_idex_js__WEBPACK_IMPORTED_MODULE_66__/* ["default"] */ .Z,
|
|
304372
|
+
'independentreserve': _src_independentreserve_js__WEBPACK_IMPORTED_MODULE_67__/* ["default"] */ .Z,
|
|
304373
|
+
'indodax': _src_indodax_js__WEBPACK_IMPORTED_MODULE_68__/* ["default"] */ .Z,
|
|
304374
|
+
'kraken': _src_kraken_js__WEBPACK_IMPORTED_MODULE_69__/* ["default"] */ .Z,
|
|
304375
|
+
'krakenfutures': _src_krakenfutures_js__WEBPACK_IMPORTED_MODULE_70__/* ["default"] */ .Z,
|
|
304376
|
+
'kucoin': _src_kucoin_js__WEBPACK_IMPORTED_MODULE_71__/* ["default"] */ .Z,
|
|
304377
|
+
'kucoinfutures': _src_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_72__/* ["default"] */ .Z,
|
|
304378
|
+
'kuna': _src_kuna_js__WEBPACK_IMPORTED_MODULE_73__/* ["default"] */ .Z,
|
|
304379
|
+
'latoken': _src_latoken_js__WEBPACK_IMPORTED_MODULE_74__/* ["default"] */ .Z,
|
|
304380
|
+
'lbank': _src_lbank_js__WEBPACK_IMPORTED_MODULE_75__/* ["default"] */ .Z,
|
|
304381
|
+
'luno': _src_luno_js__WEBPACK_IMPORTED_MODULE_76__/* ["default"] */ .Z,
|
|
304382
|
+
'lykke': _src_lykke_js__WEBPACK_IMPORTED_MODULE_77__/* ["default"] */ .Z,
|
|
304383
|
+
'mercado': _src_mercado_js__WEBPACK_IMPORTED_MODULE_78__/* ["default"] */ .Z,
|
|
304384
|
+
'mexc': _src_mexc_js__WEBPACK_IMPORTED_MODULE_79__/* ["default"] */ .Z,
|
|
304385
|
+
'ndax': _src_ndax_js__WEBPACK_IMPORTED_MODULE_80__/* ["default"] */ .Z,
|
|
304386
|
+
'novadax': _src_novadax_js__WEBPACK_IMPORTED_MODULE_81__/* ["default"] */ .Z,
|
|
304387
|
+
'oceanex': _src_oceanex_js__WEBPACK_IMPORTED_MODULE_82__/* ["default"] */ .Z,
|
|
304388
|
+
'okcoin': _src_okcoin_js__WEBPACK_IMPORTED_MODULE_83__/* ["default"] */ .Z,
|
|
304389
|
+
'okx': _src_okx_js__WEBPACK_IMPORTED_MODULE_84__/* ["default"] */ .Z,
|
|
304390
|
+
'onetrading': _src_onetrading_js__WEBPACK_IMPORTED_MODULE_85__/* ["default"] */ .Z,
|
|
304391
|
+
'p2b': _src_p2b_js__WEBPACK_IMPORTED_MODULE_86__/* ["default"] */ .Z,
|
|
304392
|
+
'paymium': _src_paymium_js__WEBPACK_IMPORTED_MODULE_87__/* ["default"] */ .Z,
|
|
304393
|
+
'phemex': _src_phemex_js__WEBPACK_IMPORTED_MODULE_88__/* ["default"] */ .Z,
|
|
304394
|
+
'poloniex': _src_poloniex_js__WEBPACK_IMPORTED_MODULE_89__/* ["default"] */ .Z,
|
|
304395
|
+
'poloniexfutures': _src_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_90__/* ["default"] */ .Z,
|
|
304396
|
+
'probit': _src_probit_js__WEBPACK_IMPORTED_MODULE_91__/* ["default"] */ .Z,
|
|
304397
|
+
'timex': _src_timex_js__WEBPACK_IMPORTED_MODULE_92__/* ["default"] */ .Z,
|
|
304398
|
+
'tokocrypto': _src_tokocrypto_js__WEBPACK_IMPORTED_MODULE_93__/* ["default"] */ .Z,
|
|
304399
|
+
'upbit': _src_upbit_js__WEBPACK_IMPORTED_MODULE_94__/* ["default"] */ .Z,
|
|
304400
|
+
'wavesexchange': _src_wavesexchange_js__WEBPACK_IMPORTED_MODULE_95__/* ["default"] */ .Z,
|
|
304401
|
+
'wazirx': _src_wazirx_js__WEBPACK_IMPORTED_MODULE_96__/* ["default"] */ .Z,
|
|
304402
|
+
'whitebit': _src_whitebit_js__WEBPACK_IMPORTED_MODULE_97__/* ["default"] */ .Z,
|
|
304403
|
+
'woo': _src_woo_js__WEBPACK_IMPORTED_MODULE_98__/* ["default"] */ .Z,
|
|
304404
|
+
'yobit': _src_yobit_js__WEBPACK_IMPORTED_MODULE_99__/* ["default"] */ .Z,
|
|
304405
|
+
'zaif': _src_zaif_js__WEBPACK_IMPORTED_MODULE_100__/* ["default"] */ .Z,
|
|
304406
|
+
'zonda': _src_zonda_js__WEBPACK_IMPORTED_MODULE_101__/* ["default"] */ .Z,
|
|
302221
304407
|
};
|
|
302222
304408
|
const pro = {
|
|
302223
|
-
'alpaca':
|
|
302224
|
-
'ascendex':
|
|
302225
|
-
'bequant':
|
|
302226
|
-
'binance':
|
|
302227
|
-
'binancecoinm':
|
|
302228
|
-
'binanceus':
|
|
302229
|
-
'binanceusdm':
|
|
302230
|
-
'bingx':
|
|
302231
|
-
'bitcoincom':
|
|
302232
|
-
'bitfinex':
|
|
302233
|
-
'bitfinex2':
|
|
302234
|
-
'bitget':
|
|
302235
|
-
'bitmart':
|
|
302236
|
-
'bitmex':
|
|
302237
|
-
'bitopro':
|
|
302238
|
-
'bitpanda':
|
|
302239
|
-
'bitrue':
|
|
302240
|
-
'bitstamp':
|
|
302241
|
-
'bitvavo':
|
|
302242
|
-
'blockchaincom':
|
|
302243
|
-
'bybit':
|
|
302244
|
-
'cex':
|
|
302245
|
-
'coinbase':
|
|
302246
|
-
'coinbasepro':
|
|
302247
|
-
'coincheck':
|
|
302248
|
-
'coinex':
|
|
302249
|
-
'coinone':
|
|
302250
|
-
'cryptocom':
|
|
302251
|
-
'currencycom':
|
|
302252
|
-
'deribit':
|
|
302253
|
-
'exmo':
|
|
302254
|
-
'gate':
|
|
302255
|
-
'gateio':
|
|
302256
|
-
'gemini':
|
|
302257
|
-
'hitbtc':
|
|
302258
|
-
'hollaex':
|
|
302259
|
-
'htx':
|
|
302260
|
-
'huobi':
|
|
302261
|
-
'huobijp':
|
|
302262
|
-
'idex':
|
|
302263
|
-
'independentreserve':
|
|
302264
|
-
'kraken':
|
|
302265
|
-
'krakenfutures':
|
|
302266
|
-
'kucoin':
|
|
302267
|
-
'kucoinfutures':
|
|
302268
|
-
'lbank':
|
|
302269
|
-
'luno':
|
|
302270
|
-
'mexc':
|
|
302271
|
-
'ndax':
|
|
302272
|
-
'okcoin':
|
|
302273
|
-
'okx':
|
|
302274
|
-
'onetrading':
|
|
302275
|
-
'p2b':
|
|
302276
|
-
'phemex':
|
|
302277
|
-
'poloniex':
|
|
302278
|
-
'poloniexfutures':
|
|
302279
|
-
'probit':
|
|
302280
|
-
'upbit':
|
|
302281
|
-
'wazirx':
|
|
302282
|
-
'whitebit':
|
|
302283
|
-
'woo':
|
|
304409
|
+
'alpaca': _src_pro_alpaca_js__WEBPACK_IMPORTED_MODULE_102__/* ["default"] */ .Z,
|
|
304410
|
+
'ascendex': _src_pro_ascendex_js__WEBPACK_IMPORTED_MODULE_103__/* ["default"] */ .Z,
|
|
304411
|
+
'bequant': _src_pro_bequant_js__WEBPACK_IMPORTED_MODULE_104__/* ["default"] */ .Z,
|
|
304412
|
+
'binance': _src_pro_binance_js__WEBPACK_IMPORTED_MODULE_105__/* ["default"] */ .Z,
|
|
304413
|
+
'binancecoinm': _src_pro_binancecoinm_js__WEBPACK_IMPORTED_MODULE_106__/* ["default"] */ .Z,
|
|
304414
|
+
'binanceus': _src_pro_binanceus_js__WEBPACK_IMPORTED_MODULE_107__/* ["default"] */ .Z,
|
|
304415
|
+
'binanceusdm': _src_pro_binanceusdm_js__WEBPACK_IMPORTED_MODULE_108__/* ["default"] */ .Z,
|
|
304416
|
+
'bingx': _src_pro_bingx_js__WEBPACK_IMPORTED_MODULE_109__/* ["default"] */ .Z,
|
|
304417
|
+
'bitcoincom': _src_pro_bitcoincom_js__WEBPACK_IMPORTED_MODULE_110__/* ["default"] */ .Z,
|
|
304418
|
+
'bitfinex': _src_pro_bitfinex_js__WEBPACK_IMPORTED_MODULE_111__/* ["default"] */ .Z,
|
|
304419
|
+
'bitfinex2': _src_pro_bitfinex2_js__WEBPACK_IMPORTED_MODULE_112__/* ["default"] */ .Z,
|
|
304420
|
+
'bitget': _src_pro_bitget_js__WEBPACK_IMPORTED_MODULE_113__/* ["default"] */ .Z,
|
|
304421
|
+
'bitmart': _src_pro_bitmart_js__WEBPACK_IMPORTED_MODULE_114__/* ["default"] */ .Z,
|
|
304422
|
+
'bitmex': _src_pro_bitmex_js__WEBPACK_IMPORTED_MODULE_115__/* ["default"] */ .Z,
|
|
304423
|
+
'bitopro': _src_pro_bitopro_js__WEBPACK_IMPORTED_MODULE_116__/* ["default"] */ .Z,
|
|
304424
|
+
'bitpanda': _src_pro_bitpanda_js__WEBPACK_IMPORTED_MODULE_117__/* ["default"] */ .Z,
|
|
304425
|
+
'bitrue': _src_pro_bitrue_js__WEBPACK_IMPORTED_MODULE_118__/* ["default"] */ .Z,
|
|
304426
|
+
'bitstamp': _src_pro_bitstamp_js__WEBPACK_IMPORTED_MODULE_119__/* ["default"] */ .Z,
|
|
304427
|
+
'bitvavo': _src_pro_bitvavo_js__WEBPACK_IMPORTED_MODULE_120__/* ["default"] */ .Z,
|
|
304428
|
+
'blockchaincom': _src_pro_blockchaincom_js__WEBPACK_IMPORTED_MODULE_121__/* ["default"] */ .Z,
|
|
304429
|
+
'bybit': _src_pro_bybit_js__WEBPACK_IMPORTED_MODULE_122__/* ["default"] */ .Z,
|
|
304430
|
+
'cex': _src_pro_cex_js__WEBPACK_IMPORTED_MODULE_123__/* ["default"] */ .Z,
|
|
304431
|
+
'coinbase': _src_pro_coinbase_js__WEBPACK_IMPORTED_MODULE_124__/* ["default"] */ .Z,
|
|
304432
|
+
'coinbasepro': _src_pro_coinbasepro_js__WEBPACK_IMPORTED_MODULE_125__/* ["default"] */ .Z,
|
|
304433
|
+
'coincheck': _src_pro_coincheck_js__WEBPACK_IMPORTED_MODULE_126__/* ["default"] */ .Z,
|
|
304434
|
+
'coinex': _src_pro_coinex_js__WEBPACK_IMPORTED_MODULE_127__/* ["default"] */ .Z,
|
|
304435
|
+
'coinone': _src_pro_coinone_js__WEBPACK_IMPORTED_MODULE_128__/* ["default"] */ .Z,
|
|
304436
|
+
'cryptocom': _src_pro_cryptocom_js__WEBPACK_IMPORTED_MODULE_129__/* ["default"] */ .Z,
|
|
304437
|
+
'currencycom': _src_pro_currencycom_js__WEBPACK_IMPORTED_MODULE_130__/* ["default"] */ .Z,
|
|
304438
|
+
'deribit': _src_pro_deribit_js__WEBPACK_IMPORTED_MODULE_131__/* ["default"] */ .Z,
|
|
304439
|
+
'exmo': _src_pro_exmo_js__WEBPACK_IMPORTED_MODULE_132__/* ["default"] */ .Z,
|
|
304440
|
+
'gate': _src_pro_gate_js__WEBPACK_IMPORTED_MODULE_133__/* ["default"] */ .Z,
|
|
304441
|
+
'gateio': _src_pro_gateio_js__WEBPACK_IMPORTED_MODULE_134__/* ["default"] */ .Z,
|
|
304442
|
+
'gemini': _src_pro_gemini_js__WEBPACK_IMPORTED_MODULE_135__/* ["default"] */ .Z,
|
|
304443
|
+
'hitbtc': _src_pro_hitbtc_js__WEBPACK_IMPORTED_MODULE_136__/* ["default"] */ .Z,
|
|
304444
|
+
'hollaex': _src_pro_hollaex_js__WEBPACK_IMPORTED_MODULE_137__/* ["default"] */ .Z,
|
|
304445
|
+
'htx': _src_pro_htx_js__WEBPACK_IMPORTED_MODULE_138__/* ["default"] */ .Z,
|
|
304446
|
+
'huobi': _src_pro_huobi_js__WEBPACK_IMPORTED_MODULE_139__/* ["default"] */ .Z,
|
|
304447
|
+
'huobijp': _src_pro_huobijp_js__WEBPACK_IMPORTED_MODULE_140__/* ["default"] */ .Z,
|
|
304448
|
+
'idex': _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_141__/* ["default"] */ .Z,
|
|
304449
|
+
'independentreserve': _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_142__/* ["default"] */ .Z,
|
|
304450
|
+
'kraken': _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_143__/* ["default"] */ .Z,
|
|
304451
|
+
'krakenfutures': _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_144__/* ["default"] */ .Z,
|
|
304452
|
+
'kucoin': _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_145__/* ["default"] */ .Z,
|
|
304453
|
+
'kucoinfutures': _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_146__/* ["default"] */ .Z,
|
|
304454
|
+
'lbank': _src_pro_lbank_js__WEBPACK_IMPORTED_MODULE_147__/* ["default"] */ .Z,
|
|
304455
|
+
'luno': _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_148__/* ["default"] */ .Z,
|
|
304456
|
+
'mexc': _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_149__/* ["default"] */ .Z,
|
|
304457
|
+
'ndax': _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_150__/* ["default"] */ .Z,
|
|
304458
|
+
'okcoin': _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_151__/* ["default"] */ .Z,
|
|
304459
|
+
'okx': _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_152__/* ["default"] */ .Z,
|
|
304460
|
+
'onetrading': _src_pro_onetrading_js__WEBPACK_IMPORTED_MODULE_153__/* ["default"] */ .Z,
|
|
304461
|
+
'p2b': _src_pro_p2b_js__WEBPACK_IMPORTED_MODULE_154__/* ["default"] */ .Z,
|
|
304462
|
+
'phemex': _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_155__/* ["default"] */ .Z,
|
|
304463
|
+
'poloniex': _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_156__/* ["default"] */ .Z,
|
|
304464
|
+
'poloniexfutures': _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_157__/* ["default"] */ .Z,
|
|
304465
|
+
'probit': _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_158__/* ["default"] */ .Z,
|
|
304466
|
+
'upbit': _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_159__/* ["default"] */ .Z,
|
|
304467
|
+
'wazirx': _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_160__/* ["default"] */ .Z,
|
|
304468
|
+
'whitebit': _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_161__/* ["default"] */ .Z,
|
|
304469
|
+
'woo': _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_162__/* ["default"] */ .Z,
|
|
302284
304470
|
};
|
|
302285
304471
|
for (const exchange in pro) {
|
|
302286
304472
|
// const ccxtExchange = exchanges[exchange]
|
|
@@ -302293,7 +304479,7 @@ for (const exchange in pro) {
|
|
|
302293
304479
|
pro.exchanges = Object.keys(pro);
|
|
302294
304480
|
pro['Exchange'] = _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e; // now the same for rest and ts
|
|
302295
304481
|
//-----------------------------------------------------------------------------
|
|
302296
|
-
const ccxt = Object.assign({ version, Exchange: _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e, Precise:
|
|
304482
|
+
const ccxt = Object.assign({ version, Exchange: _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e, Precise: _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_163__/* .Precise */ .O, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, _src_base_functions_js__WEBPACK_IMPORTED_MODULE_164__, _src_base_errors_js__WEBPACK_IMPORTED_MODULE_165__);
|
|
302297
304483
|
|
|
302298
304484
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ccxt);
|
|
302299
304485
|
//-----------------------------------------------------------------------------
|