ccxt 4.2.21 → 4.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/ccxt.browser.js +352 -42
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/bigone.js +1 -0
- package/dist/cjs/src/binance.js +14 -3
- package/dist/cjs/src/bitget.js +11 -1
- package/dist/cjs/src/bitrue.js +1 -0
- package/dist/cjs/src/bybit.js +57 -9
- package/dist/cjs/src/coinbasepro.js +1 -0
- package/dist/cjs/src/coinex.js +37 -12
- package/dist/cjs/src/deribit.js +164 -0
- package/dist/cjs/src/okcoin.js +3 -0
- package/dist/cjs/src/phemex.js +5 -2
- package/dist/cjs/src/poloniex.js +1 -0
- package/dist/cjs/src/pro/bequant.js +6 -1
- package/dist/cjs/src/pro/binance.js +7 -4
- package/dist/cjs/src/pro/binancecoinm.js +6 -1
- package/dist/cjs/src/pro/binanceus.js +6 -1
- package/dist/cjs/src/pro/bitcoincom.js +6 -1
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bitrue.js +6 -1
- package/dist/cjs/src/pro/okx.js +13 -3
- package/dist/cjs/src/woo.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/binance.d.ts +3 -0
- package/js/src/abstract/binancecoinm.d.ts +3 -0
- package/js/src/abstract/binanceus.d.ts +4 -0
- package/js/src/abstract/binanceusdm.d.ts +3 -0
- package/js/src/bigone.js +1 -0
- package/js/src/binance.js +14 -3
- package/js/src/bitget.js +11 -1
- package/js/src/bitrue.js +1 -0
- package/js/src/bybit.d.ts +2 -1
- package/js/src/bybit.js +57 -9
- package/js/src/coinbasepro.js +1 -0
- package/js/src/coinex.d.ts +1 -0
- package/js/src/coinex.js +37 -12
- package/js/src/deribit.d.ts +6 -1
- package/js/src/deribit.js +164 -0
- package/js/src/okcoin.js +3 -0
- package/js/src/phemex.js +5 -2
- package/js/src/poloniex.js +1 -0
- package/js/src/pro/bequant.js +6 -1
- package/js/src/pro/binance.js +7 -4
- package/js/src/pro/binancecoinm.js +6 -1
- package/js/src/pro/binanceus.js +6 -1
- package/js/src/pro/bitcoincom.js +6 -1
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bitrue.js +6 -1
- package/js/src/pro/okx.js +13 -3
- package/js/src/woo.js +1 -1
- package/jsdoc2md.js +38 -16
- package/package.json +4 -1
- package/skip-tests.json +4 -0
package/dist/ccxt.browser.js
CHANGED
|
@@ -15573,6 +15573,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
15573
15573
|
'fetchCurrencies': true,
|
|
15574
15574
|
'fetchDepositAddress': true,
|
|
15575
15575
|
'fetchDeposits': true,
|
|
15576
|
+
'fetchFundingRate': false,
|
|
15576
15577
|
'fetchMarkets': true,
|
|
15577
15578
|
'fetchMyTrades': true,
|
|
15578
15579
|
'fetchOHLCV': true,
|
|
@@ -18064,6 +18065,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
18064
18065
|
'convert/exchangeInfo': 50,
|
|
18065
18066
|
'convert/assetInfo': 10,
|
|
18066
18067
|
'convert/orderStatus': 0.6667,
|
|
18068
|
+
'convert/limit/queryOpenOrders': 20.001,
|
|
18067
18069
|
'account/status': 0.1,
|
|
18068
18070
|
'account/apiTradingStatus': 0.1,
|
|
18069
18071
|
'account/apiRestrictions/ipRestriction': 0.1,
|
|
@@ -18335,6 +18337,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
18335
18337
|
'loan/vip/repay': 40.002,
|
|
18336
18338
|
'convert/getQuote': 1.3334,
|
|
18337
18339
|
'convert/acceptQuote': 3.3335,
|
|
18340
|
+
'convert/limit/placeOrder': 3.3335,
|
|
18341
|
+
'convert/limit/cancelOrder': 1.3334,
|
|
18338
18342
|
'portfolio/auto-collection': 150,
|
|
18339
18343
|
'portfolio/asset-collection': 6,
|
|
18340
18344
|
'portfolio/bnb-transfer': 150,
|
|
@@ -25721,12 +25725,20 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
25721
25725
|
/**
|
|
25722
25726
|
* @method
|
|
25723
25727
|
* @name binance#fetchPositions
|
|
25728
|
+
* @see https://binance-docs.github.io/apidocs/futures/en/#position-information-v2-user_data
|
|
25729
|
+
* @see https://binance-docs.github.io/apidocs/delivery/en/#position-information-user_data
|
|
25730
|
+
* @see https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data
|
|
25731
|
+
* @see https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data
|
|
25732
|
+
* @see https://binance-docs.github.io/apidocs/voptions/en/#option-position-information-user_data
|
|
25724
25733
|
* @description fetch all open positions
|
|
25725
|
-
* @param {string[]
|
|
25734
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
25726
25735
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
25736
|
+
* @param {string} [method] method name to call, "positionRisk", "account" or "option", default is "positionRisk"
|
|
25727
25737
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
25728
25738
|
*/
|
|
25729
|
-
const
|
|
25739
|
+
const defaultValue = this.safeString(this.options, 'fetchPositions', 'positionRisk');
|
|
25740
|
+
let defaultMethod = undefined;
|
|
25741
|
+
[defaultMethod, params] = this.handleOptionAndParams(params, 'fetchPositions', 'method', defaultValue);
|
|
25730
25742
|
if (defaultMethod === 'positionRisk') {
|
|
25731
25743
|
return await this.fetchPositionsRisk(symbols, params);
|
|
25732
25744
|
}
|
|
@@ -25737,7 +25749,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
25737
25749
|
return await this.fetchOptionPositions(symbols, params);
|
|
25738
25750
|
}
|
|
25739
25751
|
else {
|
|
25740
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + '.options["fetchPositions"] = "' + defaultMethod + '" is invalid, please choose between "account", "positionRisk" and "option"');
|
|
25752
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + '.options["fetchPositions"]/params["method"] = "' + defaultMethod + '" is invalid, please choose between "account", "positionRisk" and "option"');
|
|
25741
25753
|
}
|
|
25742
25754
|
}
|
|
25743
25755
|
async fetchAccountPositions(symbols = undefined, params = {}) {
|
|
@@ -41576,6 +41588,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41576
41588
|
'cancelOrders': true,
|
|
41577
41589
|
'closeAllPositions': true,
|
|
41578
41590
|
'closePosition': true,
|
|
41591
|
+
'createDepositAddress': false,
|
|
41579
41592
|
'createMarketBuyOrderWithCost': true,
|
|
41580
41593
|
'createMarketOrderWithCost': false,
|
|
41581
41594
|
'createMarketSellOrderWithCost': false,
|
|
@@ -41585,8 +41598,13 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41585
41598
|
'createReduceOnlyOrder': false,
|
|
41586
41599
|
'createStopLossOrder': true,
|
|
41587
41600
|
'createTakeProfitOrder': true,
|
|
41601
|
+
'createPostOnlyOrder': true,
|
|
41602
|
+
'createStopOrder': true,
|
|
41603
|
+
'createStopLimitOrder': true,
|
|
41604
|
+
'createStopMarketOrder': true,
|
|
41588
41605
|
'createTrailingPercentOrder': true,
|
|
41589
41606
|
'createTriggerOrder': true,
|
|
41607
|
+
'signIn': false,
|
|
41590
41608
|
'editOrder': true,
|
|
41591
41609
|
'fetchAccounts': false,
|
|
41592
41610
|
'fetchBalance': true,
|
|
@@ -41604,7 +41622,10 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41604
41622
|
'fetchDeposits': true,
|
|
41605
41623
|
'fetchDepositWithdrawFee': 'emulated',
|
|
41606
41624
|
'fetchDepositWithdrawFees': true,
|
|
41625
|
+
'fetchDepositsWithdrawals': false,
|
|
41607
41626
|
'fetchFundingHistory': true,
|
|
41627
|
+
'fetchWithdrawAddresses': false,
|
|
41628
|
+
'fetchTransactions': false,
|
|
41608
41629
|
'fetchFundingRate': true,
|
|
41609
41630
|
'fetchFundingRateHistory': true,
|
|
41610
41631
|
'fetchFundingRates': false,
|
|
@@ -41615,7 +41636,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41615
41636
|
'fetchLeverage': true,
|
|
41616
41637
|
'fetchLeverageTiers': false,
|
|
41617
41638
|
'fetchLiquidations': false,
|
|
41618
|
-
'fetchMarginMode':
|
|
41639
|
+
'fetchMarginMode': false,
|
|
41619
41640
|
'fetchMarketLeverageTiers': true,
|
|
41620
41641
|
'fetchMarkets': true,
|
|
41621
41642
|
'fetchMarkOHLCV': true,
|
|
@@ -41628,6 +41649,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41628
41649
|
'fetchOrder': true,
|
|
41629
41650
|
'fetchOrderBook': true,
|
|
41630
41651
|
'fetchOrders': false,
|
|
41652
|
+
'createTrailingAmountOrder': false,
|
|
41631
41653
|
'fetchOrderTrades': false,
|
|
41632
41654
|
'fetchPosition': true,
|
|
41633
41655
|
'fetchPositionMode': false,
|
|
@@ -60120,6 +60142,7 @@ class bitrue extends _abstract_bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
60120
60142
|
'fetchDepositsWithdrawals': false,
|
|
60121
60143
|
'fetchDepositWithdrawFee': 'emulated',
|
|
60122
60144
|
'fetchDepositWithdrawFees': true,
|
|
60145
|
+
'fetchFundingRate': false,
|
|
60123
60146
|
'fetchIsolatedBorrowRate': false,
|
|
60124
60147
|
'fetchIsolatedBorrowRates': false,
|
|
60125
60148
|
'fetchMarginMode': false,
|
|
@@ -77061,7 +77084,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
77061
77084
|
'closeAllPositions': false,
|
|
77062
77085
|
'closePosition': false,
|
|
77063
77086
|
'createMarketBuyOrderWithCost': true,
|
|
77064
|
-
'createMarketSellOrderWithCost':
|
|
77087
|
+
'createMarketSellOrderWithCost': true,
|
|
77065
77088
|
'createOrder': true,
|
|
77066
77089
|
'createOrders': true,
|
|
77067
77090
|
'createOrderWithTakeProfitAndStopLoss': true,
|
|
@@ -80491,8 +80514,30 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
80491
80514
|
if (!market['spot']) {
|
|
80492
80515
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot orders only');
|
|
80493
80516
|
}
|
|
80494
|
-
|
|
80495
|
-
|
|
80517
|
+
return await this.createOrder(symbol, 'market', 'buy', cost, 1, params);
|
|
80518
|
+
}
|
|
80519
|
+
async createMarketSellOrderWithCost(symbol, cost, params = {}) {
|
|
80520
|
+
/**
|
|
80521
|
+
* @method
|
|
80522
|
+
* @name bybit#createMarkeSellOrderWithCost
|
|
80523
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/create-order
|
|
80524
|
+
* @description create a market sell order by providing the symbol and cost
|
|
80525
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
80526
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
80527
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
80528
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
80529
|
+
*/
|
|
80530
|
+
await this.loadMarkets();
|
|
80531
|
+
const types = await this.isUnifiedEnabled();
|
|
80532
|
+
const enableUnifiedAccount = types[1];
|
|
80533
|
+
if (!enableUnifiedAccount) {
|
|
80534
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' createMarketSellOrderWithCost() supports UTA accounts only');
|
|
80535
|
+
}
|
|
80536
|
+
const market = this.market(symbol);
|
|
80537
|
+
if (!market['spot']) {
|
|
80538
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' createMarketSellOrderWithCost() supports spot orders only');
|
|
80539
|
+
}
|
|
80540
|
+
return await this.createOrder(symbol, 'market', 'sell', cost, 1, params);
|
|
80496
80541
|
}
|
|
80497
80542
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
80498
80543
|
/**
|
|
@@ -80536,7 +80581,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
80536
80581
|
}
|
|
80537
80582
|
const trailingAmount = this.safeString2(params, 'trailingAmount', 'trailingStop');
|
|
80538
80583
|
const isTrailingAmountOrder = trailingAmount !== undefined;
|
|
80539
|
-
const orderRequest = this.createOrderRequest(symbol, type, side, amount, price, params);
|
|
80584
|
+
const orderRequest = this.createOrderRequest(symbol, type, side, amount, price, params, enableUnifiedAccount);
|
|
80540
80585
|
let response = undefined;
|
|
80541
80586
|
if (isTrailingAmountOrder) {
|
|
80542
80587
|
response = await this.privatePostV5PositionTradingStop(orderRequest);
|
|
@@ -80559,7 +80604,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
80559
80604
|
const order = this.safeValue(response, 'result', {});
|
|
80560
80605
|
return this.parseOrder(order, market);
|
|
80561
80606
|
}
|
|
80562
|
-
createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
80607
|
+
createOrderRequest(symbol, type, side, amount, price = undefined, params = {}, isUTA = true) {
|
|
80563
80608
|
const market = this.market(symbol);
|
|
80564
80609
|
symbol = market['symbol'];
|
|
80565
80610
|
const lowerCaseType = type.toLowerCase();
|
|
@@ -80603,12 +80648,36 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
80603
80648
|
else if (market['option']) {
|
|
80604
80649
|
request['category'] = 'option';
|
|
80605
80650
|
}
|
|
80606
|
-
|
|
80651
|
+
const cost = this.safeString(params, 'cost');
|
|
80652
|
+
params = this.omit(params, 'cost');
|
|
80653
|
+
// if the cost is inferable, let's keep the old logic and ignore marketUnit, to minimize the impact of the changes
|
|
80654
|
+
const isMarketBuyAndCostInferable = (lowerCaseType === 'market') && (side === 'buy') && ((price !== undefined) || (cost !== undefined));
|
|
80655
|
+
if (market['spot'] && (type === 'market') && isUTA && !isMarketBuyAndCostInferable) {
|
|
80656
|
+
// UTA account can specify the cost of the order on both sides
|
|
80657
|
+
if ((cost !== undefined) || (price !== undefined)) {
|
|
80658
|
+
request['marketUnit'] = 'quoteCoin';
|
|
80659
|
+
let orderCost = undefined;
|
|
80660
|
+
if (cost !== undefined) {
|
|
80661
|
+
orderCost = cost;
|
|
80662
|
+
}
|
|
80663
|
+
else {
|
|
80664
|
+
const amountString = this.numberToString(amount);
|
|
80665
|
+
const priceString = this.numberToString(price);
|
|
80666
|
+
const quoteAmount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(amountString, priceString);
|
|
80667
|
+
orderCost = quoteAmount;
|
|
80668
|
+
}
|
|
80669
|
+
request['qty'] = this.costToPrecision(symbol, orderCost);
|
|
80670
|
+
}
|
|
80671
|
+
else {
|
|
80672
|
+
request['marketUnit'] = 'baseCoin';
|
|
80673
|
+
request['qty'] = this.amountToPrecision(symbol, amount);
|
|
80674
|
+
}
|
|
80675
|
+
}
|
|
80676
|
+
else if (market['spot'] && (type === 'market') && (side === 'buy')) {
|
|
80677
|
+
// classic accounts
|
|
80607
80678
|
// for market buy it requires the amount of quote currency to spend
|
|
80608
80679
|
let createMarketBuyOrderRequiresPrice = true;
|
|
80609
80680
|
[createMarketBuyOrderRequiresPrice, params] = this.handleOptionAndParams(params, 'createOrder', 'createMarketBuyOrderRequiresPrice', true);
|
|
80610
|
-
const cost = this.safeNumber(params, 'cost');
|
|
80611
|
-
params = this.omit(params, 'cost');
|
|
80612
80681
|
if (createMarketBuyOrderRequiresPrice) {
|
|
80613
80682
|
if ((price === undefined) && (cost === undefined)) {
|
|
80614
80683
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument');
|
|
@@ -80735,6 +80804,8 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
80735
80804
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
80736
80805
|
*/
|
|
80737
80806
|
await this.loadMarkets();
|
|
80807
|
+
const accounts = await this.isUnifiedEnabled();
|
|
80808
|
+
const isUta = accounts[1];
|
|
80738
80809
|
const ordersRequests = [];
|
|
80739
80810
|
const orderSymbols = [];
|
|
80740
80811
|
for (let i = 0; i < orders.length; i++) {
|
|
@@ -80746,7 +80817,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
80746
80817
|
const amount = this.safeValue(rawOrder, 'amount');
|
|
80747
80818
|
const price = this.safeValue(rawOrder, 'price');
|
|
80748
80819
|
const orderParams = this.safeValue(rawOrder, 'params', {});
|
|
80749
|
-
const orderRequest = this.createOrderRequest(marketId, type, side, amount, price, orderParams);
|
|
80820
|
+
const orderRequest = this.createOrderRequest(marketId, type, side, amount, price, orderParams, isUta);
|
|
80750
80821
|
ordersRequests.push(orderRequest);
|
|
80751
80822
|
}
|
|
80752
80823
|
const symbols = this.marketSymbols(orderSymbols, undefined, false, true, true);
|
|
@@ -89813,6 +89884,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
89813
89884
|
'fetchDeposits': true,
|
|
89814
89885
|
'fetchDepositsWithdrawals': true,
|
|
89815
89886
|
'fetchLedger': true,
|
|
89887
|
+
'fetchFundingRate': false,
|
|
89816
89888
|
'fetchMarginMode': false,
|
|
89817
89889
|
'fetchMarkets': true,
|
|
89818
89890
|
'fetchMyTrades': true,
|
|
@@ -94077,8 +94149,9 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
94077
94149
|
*/
|
|
94078
94150
|
let marketType = undefined;
|
|
94079
94151
|
[marketType, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
|
|
94080
|
-
|
|
94081
|
-
|
|
94152
|
+
let marginMode = undefined;
|
|
94153
|
+
[marginMode, params] = this.handleMarginModeAndParams('fetchBalance', params);
|
|
94154
|
+
marketType = (marginMode !== undefined) ? 'margin' : marketType;
|
|
94082
94155
|
params = this.omit(params, 'margin');
|
|
94083
94156
|
if (marketType === 'margin') {
|
|
94084
94157
|
return await this.fetchMarginBalance(params);
|
|
@@ -94608,8 +94681,9 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
94608
94681
|
}
|
|
94609
94682
|
}
|
|
94610
94683
|
const accountId = this.safeInteger(params, 'account_id');
|
|
94611
|
-
|
|
94612
|
-
|
|
94684
|
+
let marginMode = undefined;
|
|
94685
|
+
[marginMode, params] = this.handleMarginModeAndParams('createOrder', params);
|
|
94686
|
+
if (marginMode !== undefined) {
|
|
94613
94687
|
if (accountId === undefined) {
|
|
94614
94688
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' createOrder() requires an account_id parameter for margin orders');
|
|
94615
94689
|
}
|
|
@@ -95128,9 +95202,10 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
95128
95202
|
'market': market['id'],
|
|
95129
95203
|
};
|
|
95130
95204
|
const accountId = this.safeInteger(params, 'account_id');
|
|
95131
|
-
|
|
95205
|
+
let marginMode = undefined;
|
|
95206
|
+
[marginMode, params] = this.handleMarginModeAndParams('cancelOrder', params);
|
|
95132
95207
|
const clientOrderId = this.safeString2(params, 'client_id', 'clientOrderId');
|
|
95133
|
-
if (
|
|
95208
|
+
if (marginMode !== undefined) {
|
|
95134
95209
|
if (accountId === undefined) {
|
|
95135
95210
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' cancelOrder() requires an account_id parameter for margin orders');
|
|
95136
95211
|
}
|
|
@@ -95502,8 +95577,9 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
95502
95577
|
}
|
|
95503
95578
|
const [marketType, query] = this.handleMarketTypeAndParams('fetchOrdersByStatus', market, params);
|
|
95504
95579
|
const accountId = this.safeInteger(params, 'account_id');
|
|
95505
|
-
|
|
95506
|
-
|
|
95580
|
+
let marginMode = undefined;
|
|
95581
|
+
[marginMode, params] = this.handleMarginModeAndParams('fetchOrdersByStatus', params);
|
|
95582
|
+
if (marginMode !== undefined) {
|
|
95507
95583
|
if (accountId === undefined) {
|
|
95508
95584
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' fetchOpenOrders() and fetchClosedOrders() require an account_id parameter for margin orders');
|
|
95509
95585
|
}
|
|
@@ -95906,8 +95982,9 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
95906
95982
|
}
|
|
95907
95983
|
const swap = (type === 'swap');
|
|
95908
95984
|
const accountId = this.safeInteger(params, 'account_id');
|
|
95909
|
-
|
|
95910
|
-
|
|
95985
|
+
let marginMode = undefined;
|
|
95986
|
+
[marginMode, params] = this.handleMarginModeAndParams('fetchMyTrades', params);
|
|
95987
|
+
if (marginMode !== undefined) {
|
|
95911
95988
|
if (accountId === undefined) {
|
|
95912
95989
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' fetchMyTrades() requires an account_id parameter for margin trades');
|
|
95913
95990
|
}
|
|
@@ -97232,9 +97309,10 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
97232
97309
|
request['limit'] = 100;
|
|
97233
97310
|
}
|
|
97234
97311
|
params = this.omit(params, 'page');
|
|
97235
|
-
|
|
97312
|
+
let marginMode = undefined;
|
|
97313
|
+
[marginMode, params] = this.handleMarginModeAndParams('fetchTransfers', params);
|
|
97236
97314
|
let response = undefined;
|
|
97237
|
-
if (
|
|
97315
|
+
if (marginMode !== undefined) {
|
|
97238
97316
|
response = await this.privateGetMarginTransferHistory(this.extend(request, params));
|
|
97239
97317
|
}
|
|
97240
97318
|
else {
|
|
@@ -97815,6 +97893,25 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
97815
97893
|
}
|
|
97816
97894
|
return depositWithdrawFees;
|
|
97817
97895
|
}
|
|
97896
|
+
handleMarginModeAndParams(methodName, params = {}, defaultValue = undefined) {
|
|
97897
|
+
/**
|
|
97898
|
+
* @ignore
|
|
97899
|
+
* @method
|
|
97900
|
+
* @description marginMode specified by params["marginMode"], this.options["marginMode"], this.options["defaultMarginMode"], params["margin"] = true or this.options["defaultType"] = 'margin'
|
|
97901
|
+
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
97902
|
+
* @returns {Array} the marginMode in lowercase
|
|
97903
|
+
*/
|
|
97904
|
+
const defaultType = this.safeString(this.options, 'defaultType');
|
|
97905
|
+
const isMargin = this.safeValue(params, 'margin', false);
|
|
97906
|
+
let marginMode = undefined;
|
|
97907
|
+
[marginMode, params] = super.handleMarginModeAndParams(methodName, params, defaultValue);
|
|
97908
|
+
if (marginMode === undefined) {
|
|
97909
|
+
if ((defaultType === 'margin') || (isMargin === true)) {
|
|
97910
|
+
marginMode = 'isolated';
|
|
97911
|
+
}
|
|
97912
|
+
}
|
|
97913
|
+
return [marginMode, params];
|
|
97914
|
+
}
|
|
97818
97915
|
nonce() {
|
|
97819
97916
|
return this.milliseconds();
|
|
97820
97917
|
}
|
|
@@ -113668,6 +113765,170 @@ class deribit extends _abstract_deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
113668
113765
|
},
|
|
113669
113766
|
});
|
|
113670
113767
|
}
|
|
113768
|
+
convertExpireDate(date) {
|
|
113769
|
+
// parse YYMMDD to timestamp
|
|
113770
|
+
const year = date.slice(0, 2);
|
|
113771
|
+
const month = date.slice(2, 4);
|
|
113772
|
+
const day = date.slice(4, 6);
|
|
113773
|
+
const reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z';
|
|
113774
|
+
return reconstructedDate;
|
|
113775
|
+
}
|
|
113776
|
+
convertMarketIdExpireDate(date) {
|
|
113777
|
+
// parse 19JAN24 to 240119
|
|
113778
|
+
const monthMappping = {
|
|
113779
|
+
'JAN': '01',
|
|
113780
|
+
'FEB': '02',
|
|
113781
|
+
'MAR': '03',
|
|
113782
|
+
'APR': '04',
|
|
113783
|
+
'MAY': '05',
|
|
113784
|
+
'JUN': '06',
|
|
113785
|
+
'JUL': '07',
|
|
113786
|
+
'AUG': '08',
|
|
113787
|
+
'SEP': '09',
|
|
113788
|
+
'OCT': '10',
|
|
113789
|
+
'NOV': '11',
|
|
113790
|
+
'DEC': '12',
|
|
113791
|
+
};
|
|
113792
|
+
const year = date.slice(0, 2);
|
|
113793
|
+
const monthName = date.slice(2, 5);
|
|
113794
|
+
const month = this.safeString(monthMappping, monthName);
|
|
113795
|
+
const day = date.slice(5, 7);
|
|
113796
|
+
const reconstructedDate = day + month + year;
|
|
113797
|
+
return reconstructedDate;
|
|
113798
|
+
}
|
|
113799
|
+
convertExpireDateToMarketIdDate(date) {
|
|
113800
|
+
// parse 240119 to 19JAN24
|
|
113801
|
+
const year = date.slice(0, 2);
|
|
113802
|
+
const monthRaw = date.slice(2, 4);
|
|
113803
|
+
let month = undefined;
|
|
113804
|
+
const day = date.slice(4, 6);
|
|
113805
|
+
if (monthRaw === '01') {
|
|
113806
|
+
month = 'JAN';
|
|
113807
|
+
}
|
|
113808
|
+
else if (monthRaw === '02') {
|
|
113809
|
+
month = 'FEB';
|
|
113810
|
+
}
|
|
113811
|
+
else if (monthRaw === '03') {
|
|
113812
|
+
month = 'MAR';
|
|
113813
|
+
}
|
|
113814
|
+
else if (monthRaw === '04') {
|
|
113815
|
+
month = 'APR';
|
|
113816
|
+
}
|
|
113817
|
+
else if (monthRaw === '05') {
|
|
113818
|
+
month = 'MAY';
|
|
113819
|
+
}
|
|
113820
|
+
else if (monthRaw === '06') {
|
|
113821
|
+
month = 'JUN';
|
|
113822
|
+
}
|
|
113823
|
+
else if (monthRaw === '07') {
|
|
113824
|
+
month = 'JUL';
|
|
113825
|
+
}
|
|
113826
|
+
else if (monthRaw === '08') {
|
|
113827
|
+
month = 'AUG';
|
|
113828
|
+
}
|
|
113829
|
+
else if (monthRaw === '09') {
|
|
113830
|
+
month = 'SEP';
|
|
113831
|
+
}
|
|
113832
|
+
else if (monthRaw === '10') {
|
|
113833
|
+
month = 'OCT';
|
|
113834
|
+
}
|
|
113835
|
+
else if (monthRaw === '11') {
|
|
113836
|
+
month = 'NOV';
|
|
113837
|
+
}
|
|
113838
|
+
else if (monthRaw === '12') {
|
|
113839
|
+
month = 'DEC';
|
|
113840
|
+
}
|
|
113841
|
+
const reconstructedDate = day + month + year;
|
|
113842
|
+
return reconstructedDate;
|
|
113843
|
+
}
|
|
113844
|
+
createExpiredOptionMarket(symbol) {
|
|
113845
|
+
// support expired option contracts
|
|
113846
|
+
let quote = 'USD';
|
|
113847
|
+
let settle = undefined;
|
|
113848
|
+
const optionParts = symbol.split('-');
|
|
113849
|
+
const symbolBase = symbol.split('/');
|
|
113850
|
+
let base = undefined;
|
|
113851
|
+
let expiry = undefined;
|
|
113852
|
+
if (symbol.indexOf('/') > -1) {
|
|
113853
|
+
base = this.safeString(symbolBase, 0);
|
|
113854
|
+
expiry = this.safeString(optionParts, 1);
|
|
113855
|
+
if (symbol.indexOf('USDC') > -1) {
|
|
113856
|
+
base = base + '_USDC';
|
|
113857
|
+
}
|
|
113858
|
+
}
|
|
113859
|
+
else {
|
|
113860
|
+
base = this.safeString(optionParts, 0);
|
|
113861
|
+
expiry = this.convertMarketIdExpireDate(this.safeString(optionParts, 1));
|
|
113862
|
+
}
|
|
113863
|
+
if (symbol.indexOf('USDC') > -1) {
|
|
113864
|
+
quote = 'USDC';
|
|
113865
|
+
settle = 'USDC';
|
|
113866
|
+
}
|
|
113867
|
+
else {
|
|
113868
|
+
settle = base;
|
|
113869
|
+
}
|
|
113870
|
+
let splitBase = base;
|
|
113871
|
+
if (base.indexOf('_') > -1) {
|
|
113872
|
+
const splitSymbol = base.split('_');
|
|
113873
|
+
splitBase = this.safeString(splitSymbol, 0);
|
|
113874
|
+
}
|
|
113875
|
+
const strike = this.safeString(optionParts, 2);
|
|
113876
|
+
const optionType = this.safeString(optionParts, 3);
|
|
113877
|
+
const datetime = this.convertExpireDate(expiry);
|
|
113878
|
+
const timestamp = this.parse8601(datetime);
|
|
113879
|
+
return {
|
|
113880
|
+
'id': base + '-' + this.convertExpireDateToMarketIdDate(expiry) + '-' + strike + '-' + optionType,
|
|
113881
|
+
'symbol': splitBase + '/' + quote + ':' + settle + '-' + expiry + '-' + strike + '-' + optionType,
|
|
113882
|
+
'base': base,
|
|
113883
|
+
'quote': quote,
|
|
113884
|
+
'settle': settle,
|
|
113885
|
+
'baseId': base,
|
|
113886
|
+
'quoteId': quote,
|
|
113887
|
+
'settleId': settle,
|
|
113888
|
+
'active': false,
|
|
113889
|
+
'type': 'option',
|
|
113890
|
+
'linear': undefined,
|
|
113891
|
+
'inverse': undefined,
|
|
113892
|
+
'spot': false,
|
|
113893
|
+
'swap': false,
|
|
113894
|
+
'future': false,
|
|
113895
|
+
'option': true,
|
|
113896
|
+
'margin': false,
|
|
113897
|
+
'contract': true,
|
|
113898
|
+
'contractSize': undefined,
|
|
113899
|
+
'expiry': timestamp,
|
|
113900
|
+
'expiryDatetime': datetime,
|
|
113901
|
+
'optionType': (optionType === 'C') ? 'call' : 'put',
|
|
113902
|
+
'strike': this.parseNumber(strike),
|
|
113903
|
+
'precision': {
|
|
113904
|
+
'amount': undefined,
|
|
113905
|
+
'price': undefined,
|
|
113906
|
+
},
|
|
113907
|
+
'limits': {
|
|
113908
|
+
'amount': {
|
|
113909
|
+
'min': undefined,
|
|
113910
|
+
'max': undefined,
|
|
113911
|
+
},
|
|
113912
|
+
'price': {
|
|
113913
|
+
'min': undefined,
|
|
113914
|
+
'max': undefined,
|
|
113915
|
+
},
|
|
113916
|
+
'cost': {
|
|
113917
|
+
'min': undefined,
|
|
113918
|
+
'max': undefined,
|
|
113919
|
+
},
|
|
113920
|
+
},
|
|
113921
|
+
'info': undefined,
|
|
113922
|
+
};
|
|
113923
|
+
}
|
|
113924
|
+
safeMarket(marketId = undefined, market = undefined, delimiter = undefined, marketType = undefined) {
|
|
113925
|
+
const isOption = (marketId !== undefined) && ((marketId.endsWith('-C')) || (marketId.endsWith('-P')));
|
|
113926
|
+
if (isOption && !(marketId in this.markets_by_id)) {
|
|
113927
|
+
// handle expired option contracts
|
|
113928
|
+
return this.createExpiredOptionMarket(marketId);
|
|
113929
|
+
}
|
|
113930
|
+
return super.safeMarket(marketId, market, delimiter, marketType);
|
|
113931
|
+
}
|
|
113671
113932
|
async fetchTime(params = {}) {
|
|
113672
113933
|
/**
|
|
113673
113934
|
* @method
|
|
@@ -185601,6 +185862,9 @@ class okcoin extends _abstract_okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
185601
185862
|
'fetchCurrencies': true,
|
|
185602
185863
|
'fetchDepositAddress': true,
|
|
185603
185864
|
'fetchDeposits': true,
|
|
185865
|
+
'fetchFundingHistory': false,
|
|
185866
|
+
'fetchFundingRate': false,
|
|
185867
|
+
'fetchFundingRateHistory': false,
|
|
185604
185868
|
'fetchLedger': true,
|
|
185605
185869
|
'fetchMarkets': true,
|
|
185606
185870
|
'fetchMyTrades': true,
|
|
@@ -201788,16 +202052,19 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
201788
202052
|
* @method
|
|
201789
202053
|
* @name phemex#fetchBalance
|
|
201790
202054
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
202055
|
+
* @see https://phemex-docs.github.io/#query-wallets
|
|
201791
202056
|
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#query-account-positions
|
|
202057
|
+
* @see https://phemex-docs.github.io/#query-trading-account-and-positions
|
|
201792
202058
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
201793
202059
|
* @param {string} [params.type] spot or swap
|
|
202060
|
+
* @param {string} [params.code] *swap only* currency code of the balance to query (USD, USDT, etc), default is USDT
|
|
201794
202061
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
201795
202062
|
*/
|
|
201796
202063
|
await this.loadMarkets();
|
|
201797
202064
|
let type = undefined;
|
|
201798
202065
|
[type, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
|
|
201799
202066
|
const code = this.safeString(params, 'code');
|
|
201800
|
-
params = this.omit(params, ['
|
|
202067
|
+
params = this.omit(params, ['code']);
|
|
201801
202068
|
let response = undefined;
|
|
201802
202069
|
const request = {};
|
|
201803
202070
|
if ((type !== 'spot') && (type !== 'swap')) {
|
|
@@ -201805,7 +202072,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
201805
202072
|
}
|
|
201806
202073
|
if (type === 'swap') {
|
|
201807
202074
|
let settle = undefined;
|
|
201808
|
-
[settle, params] = this.handleOptionAndParams(params, 'fetchBalance', 'settle');
|
|
202075
|
+
[settle, params] = this.handleOptionAndParams(params, 'fetchBalance', 'settle', 'USDT');
|
|
201809
202076
|
if (code !== undefined || settle !== undefined) {
|
|
201810
202077
|
let coin = undefined;
|
|
201811
202078
|
if (code !== undefined) {
|
|
@@ -204664,6 +204931,7 @@ class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
204664
204931
|
'fetchOrder': true,
|
|
204665
204932
|
'fetchOrderBook': true,
|
|
204666
204933
|
'fetchOrderBooks': false,
|
|
204934
|
+
'fetchFundingRate': false,
|
|
204667
204935
|
'fetchOrderTrades': true,
|
|
204668
204936
|
'fetchPosition': false,
|
|
204669
204937
|
'fetchPositionMode': false,
|
|
@@ -210465,12 +210733,18 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
210465
210733
|
/* harmony export */ Z: () => (/* binding */ bequant)
|
|
210466
210734
|
/* harmony export */ });
|
|
210467
210735
|
/* harmony import */ var _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5189);
|
|
210736
|
+
/* harmony import */ var _bequant_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2049);
|
|
210468
210737
|
// ---------------------------------------------------------------------------
|
|
210469
210738
|
|
|
210739
|
+
|
|
210470
210740
|
// ---------------------------------------------------------------------------
|
|
210471
210741
|
class bequant extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
210472
210742
|
describe() {
|
|
210473
|
-
|
|
210743
|
+
// eslint-disable-next-line new-cap
|
|
210744
|
+
const restInstance = new _bequant_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z();
|
|
210745
|
+
const restDescribe = restInstance.describe();
|
|
210746
|
+
const extended = this.deepExtend(super.describe(), restDescribe);
|
|
210747
|
+
return this.deepExtend(extended, {
|
|
210474
210748
|
'id': 'bequant',
|
|
210475
210749
|
'name': 'Bequant',
|
|
210476
210750
|
'countries': ['MT'],
|
|
@@ -210554,7 +210828,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
210554
210828
|
'ws': {
|
|
210555
210829
|
'spot': 'wss://testnet.binance.vision/ws',
|
|
210556
210830
|
'margin': 'wss://testnet.binance.vision/ws',
|
|
210557
|
-
'future': 'wss://
|
|
210831
|
+
'future': 'wss://fstream.binancefuture.com/ws',
|
|
210558
210832
|
'delivery': 'wss://dstream.binancefuture.com/ws',
|
|
210559
210833
|
'ws': 'wss://testnet.binance.vision/ws-api/v3',
|
|
210560
210834
|
},
|
|
@@ -212487,12 +212761,13 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
212487
212761
|
/**
|
|
212488
212762
|
* @method
|
|
212489
212763
|
* @name binance#watchOrders
|
|
212490
|
-
* @see https://binance-docs.github.io/apidocs/spot/en/#payload-order-update
|
|
212491
212764
|
* @description watches information on multiple orders made by the user
|
|
212492
|
-
* @
|
|
212765
|
+
* @see https://binance-docs.github.io/apidocs/spot/en/#payload-order-update
|
|
212766
|
+
* @param {string} symbol unified market symbol of the market the orders were made in
|
|
212493
212767
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
212494
212768
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
212495
212769
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
212770
|
+
* @param {string|undefined} [params.marginMode] 'cross' or 'isolated', for spot margin
|
|
212496
212771
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
212497
212772
|
*/
|
|
212498
212773
|
await this.loadMarkets();
|
|
@@ -212515,8 +212790,10 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
212515
212790
|
}
|
|
212516
212791
|
params = this.extend(params, { 'type': type, 'symbol': symbol }); // needed inside authenticate for isolated margin
|
|
212517
212792
|
await this.authenticate(params);
|
|
212793
|
+
let marginMode = undefined;
|
|
212794
|
+
[marginMode, params] = this.handleMarginModeAndParams('watchOrders', params);
|
|
212518
212795
|
let urlType = type;
|
|
212519
|
-
if (type === 'margin') {
|
|
212796
|
+
if ((type === 'margin') || ((type === 'spot') && (marginMode !== undefined))) {
|
|
212520
212797
|
urlType = 'spot'; // spot-margin shares the same stream as regular spot
|
|
212521
212798
|
}
|
|
212522
212799
|
const url = this.urls['api']['ws'][urlType] + '/' + this.options[type]['listenKey'];
|
|
@@ -213318,12 +213595,18 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
213318
213595
|
/* harmony export */ Z: () => (/* binding */ binancecoinm)
|
|
213319
213596
|
/* harmony export */ });
|
|
213320
213597
|
/* harmony import */ var _binance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8764);
|
|
213598
|
+
/* harmony import */ var _binancecoinm_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9212);
|
|
213321
213599
|
// ---------------------------------------------------------------------------
|
|
213322
213600
|
|
|
213601
|
+
|
|
213323
213602
|
// ---------------------------------------------------------------------------
|
|
213324
213603
|
class binancecoinm extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
213325
213604
|
describe() {
|
|
213326
|
-
|
|
213605
|
+
// eslint-disable-next-line new-cap
|
|
213606
|
+
const restInstance = new _binancecoinm_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z();
|
|
213607
|
+
const restDescribe = restInstance.describe();
|
|
213608
|
+
const extended = this.deepExtend(super.describe(), restDescribe);
|
|
213609
|
+
return this.deepExtend(extended, {
|
|
213327
213610
|
'id': 'binancecoinm',
|
|
213328
213611
|
'name': 'Binance COIN-M',
|
|
213329
213612
|
'urls': {
|
|
@@ -213347,12 +213630,18 @@ class binancecoinm extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
213347
213630
|
/* harmony export */ Z: () => (/* binding */ binanceus)
|
|
213348
213631
|
/* harmony export */ });
|
|
213349
213632
|
/* harmony import */ var _binance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8764);
|
|
213633
|
+
/* harmony import */ var _binanceus_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2723);
|
|
213350
213634
|
// ---------------------------------------------------------------------------
|
|
213351
213635
|
|
|
213636
|
+
|
|
213352
213637
|
// ---------------------------------------------------------------------------
|
|
213353
213638
|
class binanceus extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
213354
213639
|
describe() {
|
|
213355
|
-
|
|
213640
|
+
// eslint-disable-next-line new-cap
|
|
213641
|
+
const restInstance = new _binanceus_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z();
|
|
213642
|
+
const restDescribe = restInstance.describe();
|
|
213643
|
+
const extended = this.deepExtend(super.describe(), restDescribe);
|
|
213644
|
+
return this.deepExtend(extended, {
|
|
213356
213645
|
'id': 'binanceus',
|
|
213357
213646
|
'name': 'Binance US',
|
|
213358
213647
|
'countries': ['US'],
|
|
@@ -214396,12 +214685,18 @@ class bingx extends _bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
214396
214685
|
/* harmony export */ Z: () => (/* binding */ bitcoincom)
|
|
214397
214686
|
/* harmony export */ });
|
|
214398
214687
|
/* harmony import */ var _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5189);
|
|
214688
|
+
/* harmony import */ var _bequant_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2049);
|
|
214399
214689
|
// ---------------------------------------------------------------------------
|
|
214400
214690
|
|
|
214691
|
+
|
|
214401
214692
|
// ---------------------------------------------------------------------------
|
|
214402
214693
|
class bitcoincom extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
214403
214694
|
describe() {
|
|
214404
|
-
|
|
214695
|
+
// eslint-disable-next-line new-cap
|
|
214696
|
+
const restInstance = new _bequant_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z();
|
|
214697
|
+
const restDescribe = restInstance.describe();
|
|
214698
|
+
const extended = this.deepExtend(super.describe(), restDescribe);
|
|
214699
|
+
return this.deepExtend(extended, {
|
|
214405
214700
|
'id': 'bitcoincom',
|
|
214406
214701
|
'name': 'bitcoin.com',
|
|
214407
214702
|
'countries': ['KN'],
|
|
@@ -217530,7 +217825,7 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
217530
217825
|
'price': this.safeString(order, 'price'),
|
|
217531
217826
|
'stopPrice': triggerPrice,
|
|
217532
217827
|
'triggerPrice': triggerPrice,
|
|
217533
|
-
'amount': this.
|
|
217828
|
+
'amount': this.safeString(order, 'baseVolume'),
|
|
217534
217829
|
'cost': this.safeStringN(order, ['notional', 'notionalUsd', 'quoteSize']),
|
|
217535
217830
|
'average': this.omitZero(this.safeString2(order, 'priceAvg', 'fillPrice')),
|
|
217536
217831
|
'filled': this.safeString2(order, 'accBaseVolume', 'baseVolume'),
|
|
@@ -221814,7 +222109,12 @@ class bitrue extends _bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
221814
222109
|
const symbol = market['symbol'];
|
|
221815
222110
|
const timestamp = this.safeInteger(message, 'ts');
|
|
221816
222111
|
const tick = this.safeValue(message, 'tick', {});
|
|
221817
|
-
|
|
222112
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
222113
|
+
if (orderbook === undefined) {
|
|
222114
|
+
orderbook = this.orderBook();
|
|
222115
|
+
}
|
|
222116
|
+
const snapshot = this.parseOrderBook(tick, symbol, timestamp, 'buys', 'asks');
|
|
222117
|
+
orderbook.reset(snapshot);
|
|
221818
222118
|
this.orderbooks[symbol] = orderbook;
|
|
221819
222119
|
const messageHash = 'orderbook:' + symbol;
|
|
221820
222120
|
client.resolve(orderbook, messageHash);
|
|
@@ -252063,17 +252363,20 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
252063
252363
|
/**
|
|
252064
252364
|
* @method
|
|
252065
252365
|
* @name okx#watchOrders
|
|
252066
|
-
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-order-channel
|
|
252067
252366
|
* @description watches information on multiple orders made by the user
|
|
252068
|
-
* @
|
|
252367
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-order-channel
|
|
252368
|
+
* @param {string} [symbol] unified market symbol of the market the orders were made in
|
|
252069
252369
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
252070
252370
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
252071
252371
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
252072
252372
|
* @param {bool} [params.stop] true if fetching trigger or conditional orders
|
|
252373
|
+
* @param {string} [params.type] 'spot', 'swap', 'future', 'option', 'ANY', 'SPOT', 'MARGIN', 'SWAP', 'FUTURES' or 'OPTION'
|
|
252374
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for automatically setting the type to spot margin
|
|
252073
252375
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
252074
252376
|
*/
|
|
252075
252377
|
let type = undefined;
|
|
252076
252378
|
// By default, receive order updates from any instrument type
|
|
252379
|
+
[type, params] = this.handleOptionAndParams(params, 'watchOrders', 'defaultType');
|
|
252077
252380
|
[type, params] = this.handleOptionAndParams(params, 'watchOrders', 'type', 'ANY');
|
|
252078
252381
|
const isStop = this.safeValue2(params, 'stop', 'trigger', false);
|
|
252079
252382
|
params = this.omit(params, ['stop', 'trigger']);
|
|
@@ -252088,7 +252391,14 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
252088
252391
|
if (type === 'future') {
|
|
252089
252392
|
type = 'futures';
|
|
252090
252393
|
}
|
|
252091
|
-
|
|
252394
|
+
let uppercaseType = type.toUpperCase();
|
|
252395
|
+
let marginMode = undefined;
|
|
252396
|
+
[marginMode, params] = this.handleMarginModeAndParams('watchOrders', params);
|
|
252397
|
+
if (uppercaseType === 'SPOT') {
|
|
252398
|
+
if (marginMode !== undefined) {
|
|
252399
|
+
uppercaseType = 'MARGIN';
|
|
252400
|
+
}
|
|
252401
|
+
}
|
|
252092
252402
|
const request = {
|
|
252093
252403
|
'instType': uppercaseType,
|
|
252094
252404
|
};
|
|
@@ -284038,7 +284348,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
284038
284348
|
'fetchClosedOrder': false,
|
|
284039
284349
|
'fetchClosedOrders': false,
|
|
284040
284350
|
'fetchCurrencies': true,
|
|
284041
|
-
'fetchDepositAddress':
|
|
284351
|
+
'fetchDepositAddress': true,
|
|
284042
284352
|
'fetchDeposits': true,
|
|
284043
284353
|
'fetchDepositsWithdrawals': true,
|
|
284044
284354
|
'fetchFundingHistory': true,
|
|
@@ -296271,7 +296581,7 @@ SOFTWARE.
|
|
|
296271
296581
|
|
|
296272
296582
|
//-----------------------------------------------------------------------------
|
|
296273
296583
|
// this is updated by vss.js when building
|
|
296274
|
-
const version = '4.2.
|
|
296584
|
+
const version = '4.2.22';
|
|
296275
296585
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
296276
296586
|
//-----------------------------------------------------------------------------
|
|
296277
296587
|
|