ccxt 4.1.16 → 4.1.17
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 +138 -86
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ascendex.js +1 -1
- package/dist/cjs/src/bingx.js +8 -3
- package/dist/cjs/src/bitget.js +109 -69
- package/dist/cjs/src/bybit.js +9 -2
- package/dist/cjs/src/gate.js +2 -2
- package/dist/cjs/src/kraken.js +1 -1
- package/dist/cjs/src/okx.js +3 -3
- package/dist/cjs/src/pro/hollaex.js +1 -1
- package/dist/cjs/src/pro/mexc.js +1 -1
- package/dist/cjs/src/whitebit.js +1 -1
- package/dist/cjs/src/woo.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/ascendex.js +1 -1
- package/js/src/bingx.js +8 -3
- package/js/src/bitget.js +109 -69
- package/js/src/bybit.js +9 -2
- package/js/src/gate.js +2 -2
- package/js/src/kraken.js +1 -1
- package/js/src/okx.js +3 -3
- package/js/src/pro/hollaex.js +1 -1
- package/js/src/pro/mexc.js +1 -1
- package/js/src/whitebit.js +1 -1
- package/js/src/woo.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -214,13 +214,13 @@ console.log(version, Object.keys(exchanges));
|
|
|
214
214
|
|
|
215
215
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
|
216
216
|
|
|
217
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.
|
|
218
|
-
* unpkg: https://unpkg.com/ccxt@4.1.
|
|
217
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.17/dist/ccxt.browser.js
|
|
218
|
+
* unpkg: https://unpkg.com/ccxt@4.1.17/dist/ccxt.browser.js
|
|
219
219
|
|
|
220
220
|
CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
|
|
221
221
|
|
|
222
222
|
```HTML
|
|
223
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.
|
|
223
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.17/dist/ccxt.browser.js"></script>
|
|
224
224
|
```
|
|
225
225
|
|
|
226
226
|
Creates a global `ccxt` object:
|
package/dist/ccxt.browser.js
CHANGED
|
@@ -6127,7 +6127,7 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
6127
6127
|
* @param {object} [params] extra parameters specific to the ascendex api endpoint
|
|
6128
6128
|
* @returns {object} a [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#reduce-margin-structure}
|
|
6129
6129
|
*/
|
|
6130
|
-
return await this.modifyMarginHelper(symbol, amount, 'reduce', params);
|
|
6130
|
+
return await this.modifyMarginHelper(symbol, -amount, 'reduce', params);
|
|
6131
6131
|
}
|
|
6132
6132
|
async addMargin(symbol, amount, params = {}) {
|
|
6133
6133
|
/**
|
|
@@ -26543,14 +26543,19 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
26543
26543
|
if (time === 0) {
|
|
26544
26544
|
time = undefined;
|
|
26545
26545
|
}
|
|
26546
|
-
const isBuyerMaker = this.safeValue2(trade, 'buyerMaker', 'isBuyerMaker');
|
|
26547
|
-
const side = this.safeStringLower2(trade, 'side', 'S');
|
|
26548
26546
|
const cost = this.safeString(trade, 'quoteQty');
|
|
26549
26547
|
const type = (cost === undefined) ? 'spot' : 'swap';
|
|
26550
26548
|
const currencyId = this.safeString2(trade, 'currency', 'N');
|
|
26551
26549
|
const currencyCode = this.safeCurrencyCode(currencyId);
|
|
26552
26550
|
const m = this.safeValue(trade, 'm', false);
|
|
26553
26551
|
const marketId = this.safeString(trade, 's');
|
|
26552
|
+
const isBuyerMaker = this.safeValue2(trade, 'buyerMaker', 'isBuyerMaker');
|
|
26553
|
+
let takeOrMaker = (isBuyerMaker || m) ? 'maker' : 'taker';
|
|
26554
|
+
let side = this.safeStringLower2(trade, 'side', 'S');
|
|
26555
|
+
if (side === undefined) {
|
|
26556
|
+
side = (isBuyerMaker || m) ? 'sell' : 'buy';
|
|
26557
|
+
takeOrMaker = 'taker';
|
|
26558
|
+
}
|
|
26554
26559
|
return this.safeTrade({
|
|
26555
26560
|
'id': this.safeStringN(trade, ['id', 't']),
|
|
26556
26561
|
'info': trade,
|
|
@@ -26560,7 +26565,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
26560
26565
|
'order': this.safeString2(trade, 'orderId', 'i'),
|
|
26561
26566
|
'type': this.safeStringLower(trade, 'o'),
|
|
26562
26567
|
'side': this.parseOrderSide(side),
|
|
26563
|
-
'takerOrMaker':
|
|
26568
|
+
'takerOrMaker': takeOrMaker,
|
|
26564
26569
|
'price': this.safeString2(trade, 'price', 'p'),
|
|
26565
26570
|
'amount': this.safeStringN(trade, ['qty', 'amount', 'q']),
|
|
26566
26571
|
'cost': cost,
|
|
@@ -40322,7 +40327,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
40322
40327
|
'startTime': since,
|
|
40323
40328
|
'endTime': this.milliseconds(),
|
|
40324
40329
|
};
|
|
40325
|
-
[request, params] = this.handleUntilOption('endTime',
|
|
40330
|
+
[request, params] = this.handleUntilOption('endTime', request, params);
|
|
40326
40331
|
if (limit !== undefined) {
|
|
40327
40332
|
request['pageSize'] = limit;
|
|
40328
40333
|
}
|
|
@@ -41589,6 +41594,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41589
41594
|
* @see https://bitgetlimited.github.io/apidoc/en/mix/#place-stop-order
|
|
41590
41595
|
* @see https://bitgetlimited.github.io/apidoc/en/mix/#place-position-tpsl
|
|
41591
41596
|
* @see https://bitgetlimited.github.io/apidoc/en/mix/#place-plan-order
|
|
41597
|
+
* @see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-place-order
|
|
41598
|
+
* @see https://bitgetlimited.github.io/apidoc/en/margin/#cross-place-order
|
|
41592
41599
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
41593
41600
|
* @param {string} type 'market' or 'limit'
|
|
41594
41601
|
* @param {string} side 'buy' or 'sell' or 'open_long' or 'open_short' or 'close_long' or 'close_short'
|
|
@@ -41603,13 +41610,23 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41603
41610
|
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered (perpetual swap markets only)
|
|
41604
41611
|
* @param {float} [params.stopLoss.triggerPrice] *swap only* stop loss trigger price
|
|
41605
41612
|
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
41613
|
+
* @param {string} [params.marginMode] 'isolated' or 'cross' for spot margin trading
|
|
41614
|
+
* @param {string} [params.loanType] *spot margin only* 'normal', 'autoLoan', 'autoRepay', or 'autoLoanAndRepay' default is 'normal'
|
|
41606
41615
|
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
41607
41616
|
*/
|
|
41608
41617
|
await this.loadMarkets();
|
|
41609
41618
|
const market = this.market(symbol);
|
|
41610
|
-
|
|
41619
|
+
let marketType = undefined;
|
|
41620
|
+
let marginMode = undefined;
|
|
41621
|
+
let response = undefined;
|
|
41622
|
+
[marketType, params] = this.handleMarketTypeAndParams('createOrder', market, params);
|
|
41623
|
+
[marginMode, params] = this.handleMarginModeAndParams('createOrder', params);
|
|
41624
|
+
const marketId = market['id'];
|
|
41625
|
+
const parts = marketId.split('_');
|
|
41626
|
+
const marginMarketId = this.safeStringUpper(parts, 0);
|
|
41627
|
+
const symbolRequest = (marginMode !== undefined) ? marginMarketId : marketId;
|
|
41611
41628
|
const request = {
|
|
41612
|
-
'symbol':
|
|
41629
|
+
'symbol': symbolRequest,
|
|
41613
41630
|
'orderType': type,
|
|
41614
41631
|
};
|
|
41615
41632
|
const isMarketOrder = type === 'market';
|
|
@@ -41631,12 +41648,10 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41631
41648
|
if ((type === 'limit') && (triggerPrice === undefined)) {
|
|
41632
41649
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
41633
41650
|
}
|
|
41651
|
+
// default triggerType to market price for unification
|
|
41652
|
+
const triggerType = this.safeString(params, 'triggerType', 'market_price');
|
|
41653
|
+
const reduceOnly = this.safeValue(params, 'reduceOnly', false);
|
|
41634
41654
|
const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
|
|
41635
|
-
let method = this.getSupportedMapping(marketType, {
|
|
41636
|
-
'spot': 'privateSpotPostTradeOrders',
|
|
41637
|
-
'swap': 'privateMixPostOrderPlaceOrder',
|
|
41638
|
-
'future': 'privateMixPostOrderPlaceOrder',
|
|
41639
|
-
});
|
|
41640
41655
|
const exchangeSpecificTifParam = this.safeStringN(params, ['force', 'timeInForceValue', 'timeInForce']);
|
|
41641
41656
|
let postOnly = undefined;
|
|
41642
41657
|
[postOnly, params] = this.handlePostOnly(isMarketOrder, exchangeSpecificTifParam === 'post_only', params);
|
|
@@ -41644,55 +41659,33 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41644
41659
|
const timeInForce = this.safeStringLower(params, 'timeInForce', defaultTimeInForce);
|
|
41645
41660
|
let timeInForceKey = 'timeInForceValue';
|
|
41646
41661
|
if (marketType === 'spot') {
|
|
41647
|
-
if (
|
|
41648
|
-
|
|
41649
|
-
}
|
|
41650
|
-
timeInForceKey = 'force';
|
|
41651
|
-
let quantityKey = 'quantity';
|
|
41652
|
-
let quantity = undefined;
|
|
41653
|
-
const createMarketBuyOrderRequiresPrice = this.safeValue(this.options, 'createMarketBuyOrderRequiresPrice', true);
|
|
41654
|
-
if (createMarketBuyOrderRequiresPrice && isMarketOrder && (side === 'buy')) {
|
|
41655
|
-
if (price === undefined) {
|
|
41656
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' createOrder() requires price argument for market buy orders on spot markets to calculate the total amount to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option to false and pass in the cost to spend into the amount parameter');
|
|
41657
|
-
}
|
|
41658
|
-
else {
|
|
41659
|
-
const amountString = this.numberToString(amount);
|
|
41660
|
-
const priceString = this.numberToString(price);
|
|
41661
|
-
const cost = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMul */ .O.stringMul(amountString, priceString));
|
|
41662
|
-
quantity = this.priceToPrecision(symbol, cost);
|
|
41663
|
-
}
|
|
41664
|
-
}
|
|
41665
|
-
else {
|
|
41666
|
-
quantity = this.amountToPrecision(symbol, amount);
|
|
41667
|
-
}
|
|
41668
|
-
if (clientOrderId !== undefined) {
|
|
41669
|
-
request['clientOrderId'] = clientOrderId;
|
|
41670
|
-
}
|
|
41671
|
-
request['side'] = side;
|
|
41672
|
-
if (triggerPrice !== undefined) {
|
|
41673
|
-
quantityKey = 'size';
|
|
41674
|
-
timeInForceKey = 'timeInForceValue';
|
|
41675
|
-
// default triggerType to market price for unification
|
|
41676
|
-
const triggerType = this.safeString(params, 'triggerType', 'market_price');
|
|
41677
|
-
request['triggerType'] = triggerType;
|
|
41678
|
-
request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
41679
|
-
if (price !== undefined) {
|
|
41680
|
-
request['executePrice'] = this.priceToPrecision(symbol, price);
|
|
41681
|
-
}
|
|
41682
|
-
method = 'privateSpotPostPlanPlacePlan';
|
|
41662
|
+
if (marginMode !== undefined) {
|
|
41663
|
+
timeInForceKey = 'timeInForce';
|
|
41683
41664
|
}
|
|
41684
|
-
if (
|
|
41685
|
-
|
|
41665
|
+
else if (triggerPrice === undefined) {
|
|
41666
|
+
timeInForceKey = 'force';
|
|
41686
41667
|
}
|
|
41687
41668
|
}
|
|
41688
|
-
|
|
41669
|
+
if (postOnly) {
|
|
41670
|
+
request[timeInForceKey] = 'post_only';
|
|
41671
|
+
}
|
|
41672
|
+
else if (timeInForce === 'gtc') {
|
|
41673
|
+
const gtcRequest = (marginMode !== undefined) ? 'gtc' : 'normal';
|
|
41674
|
+
request[timeInForceKey] = gtcRequest;
|
|
41675
|
+
}
|
|
41676
|
+
else if (timeInForce === 'fok') {
|
|
41677
|
+
request[timeInForceKey] = 'fok';
|
|
41678
|
+
}
|
|
41679
|
+
else if (timeInForce === 'ioc') {
|
|
41680
|
+
request[timeInForceKey] = 'ioc';
|
|
41681
|
+
}
|
|
41682
|
+
params = this.omit(params, ['stopPrice', 'triggerType', 'stopLossPrice', 'takeProfitPrice', 'stopLoss', 'takeProfit', 'postOnly', 'reduceOnly']);
|
|
41683
|
+
if ((marketType === 'swap') || (marketType === 'future')) {
|
|
41689
41684
|
request['marginCoin'] = market['settleId'];
|
|
41690
41685
|
if (clientOrderId !== undefined) {
|
|
41691
41686
|
request['clientOid'] = clientOrderId;
|
|
41692
41687
|
}
|
|
41693
41688
|
if (isTriggerOrder || isStopLossOrTakeProfitTrigger) {
|
|
41694
|
-
// default triggerType to market price for unification
|
|
41695
|
-
const triggerType = this.safeString(params, 'triggerType', 'market_price');
|
|
41696
41689
|
request['triggerType'] = triggerType;
|
|
41697
41690
|
}
|
|
41698
41691
|
if (isStopLossOrTakeProfitTrigger) {
|
|
@@ -41702,7 +41695,6 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41702
41695
|
request['holdSide'] = (side === 'buy') ? 'long' : 'short';
|
|
41703
41696
|
}
|
|
41704
41697
|
else {
|
|
41705
|
-
const reduceOnly = this.safeValue(params, 'reduceOnly', false);
|
|
41706
41698
|
request['size'] = this.amountToPrecision(symbol, amount);
|
|
41707
41699
|
if (reduceOnly) {
|
|
41708
41700
|
request['side'] = (side === 'buy') ? 'close_short' : 'close_long';
|
|
@@ -41724,7 +41716,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41724
41716
|
if (price !== undefined) {
|
|
41725
41717
|
request['executePrice'] = this.priceToPrecision(symbol, price);
|
|
41726
41718
|
}
|
|
41727
|
-
|
|
41719
|
+
response = await this.privateMixPostPlanPlacePlan(this.extend(request, params));
|
|
41728
41720
|
}
|
|
41729
41721
|
else if (isStopLossOrTakeProfitTrigger) {
|
|
41730
41722
|
if (isStopLossTriggerOrder) {
|
|
@@ -41735,9 +41727,9 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41735
41727
|
request['triggerPrice'] = this.priceToPrecision(symbol, takeProfitTriggerPrice);
|
|
41736
41728
|
request['planType'] = 'pos_profit';
|
|
41737
41729
|
}
|
|
41738
|
-
|
|
41730
|
+
response = await this.privateMixPostPlanPlacePositionsTPSL(this.extend(request, params));
|
|
41739
41731
|
}
|
|
41740
|
-
else
|
|
41732
|
+
else {
|
|
41741
41733
|
if (isStopLoss) {
|
|
41742
41734
|
const slTriggerPrice = this.safeValue2(stopLoss, 'triggerPrice', 'stopPrice');
|
|
41743
41735
|
request['presetStopLossPrice'] = this.priceToPrecision(symbol, slTriggerPrice);
|
|
@@ -41746,22 +41738,75 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41746
41738
|
const tpTriggerPrice = this.safeValue2(takeProfit, 'triggerPrice', 'stopPrice');
|
|
41747
41739
|
request['presetTakeProfitPrice'] = this.priceToPrecision(symbol, tpTriggerPrice);
|
|
41748
41740
|
}
|
|
41741
|
+
response = await this.privateMixPostOrderPlaceOrder(this.extend(request, params));
|
|
41749
41742
|
}
|
|
41750
41743
|
}
|
|
41751
|
-
if (
|
|
41752
|
-
|
|
41753
|
-
|
|
41754
|
-
|
|
41755
|
-
|
|
41756
|
-
|
|
41757
|
-
|
|
41758
|
-
|
|
41744
|
+
else if (marketType === 'spot') {
|
|
41745
|
+
if (isStopLossOrTakeProfitTrigger || isStopLossOrTakeProfit) {
|
|
41746
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' createOrder() does not support stop loss/take profit orders on spot markets, only swap markets');
|
|
41747
|
+
}
|
|
41748
|
+
let quantity = undefined;
|
|
41749
|
+
const createMarketBuyOrderRequiresPrice = this.safeValue(this.options, 'createMarketBuyOrderRequiresPrice', true);
|
|
41750
|
+
if (createMarketBuyOrderRequiresPrice && isMarketOrder && (side === 'buy')) {
|
|
41751
|
+
if (price === undefined) {
|
|
41752
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' createOrder() requires price argument for market buy orders on spot markets to calculate the total amount to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option to false and pass in the cost to spend into the amount parameter');
|
|
41753
|
+
}
|
|
41754
|
+
else {
|
|
41755
|
+
const amountString = this.numberToString(amount);
|
|
41756
|
+
const priceString = this.numberToString(price);
|
|
41757
|
+
const cost = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMul */ .O.stringMul(amountString, priceString));
|
|
41758
|
+
quantity = this.priceToPrecision(symbol, cost);
|
|
41759
|
+
}
|
|
41760
|
+
}
|
|
41761
|
+
else {
|
|
41762
|
+
quantity = this.amountToPrecision(symbol, amount);
|
|
41763
|
+
}
|
|
41764
|
+
request['side'] = side;
|
|
41765
|
+
if (triggerPrice !== undefined) {
|
|
41766
|
+
if (quantity !== undefined) {
|
|
41767
|
+
request['size'] = quantity;
|
|
41768
|
+
}
|
|
41769
|
+
request['triggerType'] = triggerType;
|
|
41770
|
+
request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
41771
|
+
if (price !== undefined) {
|
|
41772
|
+
request['executePrice'] = this.priceToPrecision(symbol, price);
|
|
41773
|
+
}
|
|
41774
|
+
if (clientOrderId !== undefined) {
|
|
41775
|
+
request['clientOrderId'] = clientOrderId;
|
|
41776
|
+
}
|
|
41777
|
+
response = await this.privateSpotPostPlanPlacePlan(this.extend(request, params));
|
|
41778
|
+
}
|
|
41779
|
+
else if (marginMode !== undefined) {
|
|
41780
|
+
request['loanType'] = 'normal';
|
|
41781
|
+
if (clientOrderId !== undefined) {
|
|
41782
|
+
request['clientOid'] = clientOrderId;
|
|
41783
|
+
}
|
|
41784
|
+
if (createMarketBuyOrderRequiresPrice && isMarketOrder && (side === 'buy')) {
|
|
41785
|
+
request['quoteAmount'] = quantity;
|
|
41786
|
+
}
|
|
41787
|
+
else {
|
|
41788
|
+
request['baseQuantity'] = quantity;
|
|
41789
|
+
}
|
|
41790
|
+
if (marginMode === 'isolated') {
|
|
41791
|
+
response = await this.privateMarginPostIsolatedOrderPlaceOrder(this.extend(request, params));
|
|
41792
|
+
}
|
|
41793
|
+
else if (marginMode === 'cross') {
|
|
41794
|
+
response = await this.privateMarginPostCrossOrderPlaceOrder(this.extend(request, params));
|
|
41795
|
+
}
|
|
41796
|
+
}
|
|
41797
|
+
else {
|
|
41798
|
+
if (clientOrderId !== undefined) {
|
|
41799
|
+
request['clientOrderId'] = clientOrderId;
|
|
41800
|
+
}
|
|
41801
|
+
if (quantity !== undefined) {
|
|
41802
|
+
request['quantity'] = quantity;
|
|
41803
|
+
}
|
|
41804
|
+
response = await this.privateSpotPostTradeOrders(this.extend(request, params));
|
|
41805
|
+
}
|
|
41759
41806
|
}
|
|
41760
|
-
else
|
|
41761
|
-
|
|
41807
|
+
else {
|
|
41808
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' createOrder() does not support ' + marketType + ' orders');
|
|
41762
41809
|
}
|
|
41763
|
-
const omitted = this.omit(query, ['stopPrice', 'triggerType', 'stopLossPrice', 'takeProfitPrice', 'stopLoss', 'takeProfit', 'postOnly', 'reduceOnly']);
|
|
41764
|
-
const response = await this[method](this.extend(request, omitted));
|
|
41765
41810
|
//
|
|
41766
41811
|
// {
|
|
41767
41812
|
// "code": "00000",
|
|
@@ -41773,7 +41818,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41773
41818
|
// }
|
|
41774
41819
|
// }
|
|
41775
41820
|
//
|
|
41776
|
-
const data = this.safeValue(response, 'data');
|
|
41821
|
+
const data = this.safeValue(response, 'data', {});
|
|
41777
41822
|
return this.parseOrder(data, market);
|
|
41778
41823
|
}
|
|
41779
41824
|
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
@@ -42628,7 +42673,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
42628
42673
|
if (since !== undefined) {
|
|
42629
42674
|
request['before'] = since;
|
|
42630
42675
|
}
|
|
42631
|
-
[request, params] = this.handleUntilOption('after',
|
|
42676
|
+
[request, params] = this.handleUntilOption('after', request, params);
|
|
42632
42677
|
const response = await this.privateSpotPostAccountBills(this.extend(request, params));
|
|
42633
42678
|
//
|
|
42634
42679
|
// {
|
|
@@ -42745,7 +42790,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
42745
42790
|
else if (orderId === undefined) {
|
|
42746
42791
|
request['startTime'] = 0;
|
|
42747
42792
|
}
|
|
42748
|
-
[request, params] = this.handleUntilOption('endTime',
|
|
42793
|
+
[request, params] = this.handleUntilOption('endTime', request, params);
|
|
42749
42794
|
if (!('endTime' in request) && (orderId === undefined)) {
|
|
42750
42795
|
request['endTime'] = this.milliseconds();
|
|
42751
42796
|
}
|
|
@@ -43659,7 +43704,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
43659
43704
|
if (limit !== undefined) {
|
|
43660
43705
|
request['limit'] = limit;
|
|
43661
43706
|
}
|
|
43662
|
-
[request, params] = this.handleUntilOption('after',
|
|
43707
|
+
[request, params] = this.handleUntilOption('after', request, params);
|
|
43663
43708
|
const response = await this.privateSpotGetAccountTransferRecords(this.extend(request, params));
|
|
43664
43709
|
//
|
|
43665
43710
|
// {
|
|
@@ -76036,9 +76081,16 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
76036
76081
|
let fee = undefined;
|
|
76037
76082
|
const feeCostString = this.safeString(order, 'cumExecFee');
|
|
76038
76083
|
if (feeCostString !== undefined) {
|
|
76084
|
+
let feeCurrency = undefined;
|
|
76085
|
+
if (market['spot']) {
|
|
76086
|
+
feeCurrency = (side === 'buy') ? market['quote'] : market['base'];
|
|
76087
|
+
}
|
|
76088
|
+
else {
|
|
76089
|
+
feeCurrency = market['settle'];
|
|
76090
|
+
}
|
|
76039
76091
|
fee = {
|
|
76040
76092
|
'cost': feeCostString,
|
|
76041
|
-
'currency':
|
|
76093
|
+
'currency': feeCurrency,
|
|
76042
76094
|
};
|
|
76043
76095
|
}
|
|
76044
76096
|
let clientOrderId = this.safeString(order, 'orderLinkId');
|
|
@@ -76124,7 +76176,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
76124
76176
|
const result = await this.fetchOrders(symbol, undefined, undefined, this.extend(request, params));
|
|
76125
76177
|
const length = result.length;
|
|
76126
76178
|
if (length === 0) {
|
|
76127
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.OrderNotFound('Order ' + id + ' does not exist.');
|
|
76179
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.OrderNotFound('Order ' + id.toString() + ' does not exist.');
|
|
76128
76180
|
}
|
|
76129
76181
|
if (length > 1) {
|
|
76130
76182
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' returned more than one order');
|
|
@@ -117068,7 +117120,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
117068
117120
|
'max': undefined,
|
|
117069
117121
|
},
|
|
117070
117122
|
},
|
|
117071
|
-
'created': this.
|
|
117123
|
+
'created': this.safeTimestamp(market, 'create_time'),
|
|
117072
117124
|
'info': market,
|
|
117073
117125
|
});
|
|
117074
117126
|
}
|
|
@@ -121499,7 +121551,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
121499
121551
|
// lsr_taker: '9.3765153315902'
|
|
121500
121552
|
// }
|
|
121501
121553
|
//
|
|
121502
|
-
const timestamp = this.
|
|
121554
|
+
const timestamp = this.safeTimestamp(interest, 'time');
|
|
121503
121555
|
return {
|
|
121504
121556
|
'symbol': this.safeString(market, 'symbol'),
|
|
121505
121557
|
'openInterestAmount': this.safeNumber(interest, 'open_interest'),
|
|
@@ -143915,7 +143967,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
143915
143967
|
else {
|
|
143916
143968
|
direction = 'in';
|
|
143917
143969
|
}
|
|
143918
|
-
const timestamp = this.
|
|
143970
|
+
const timestamp = this.safeTimestamp(item, 'time');
|
|
143919
143971
|
return {
|
|
143920
143972
|
'info': item,
|
|
143921
143973
|
'id': id,
|
|
@@ -182368,7 +182420,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
182368
182420
|
market = this.market(symbol);
|
|
182369
182421
|
request['instId'] = market['id'];
|
|
182370
182422
|
}
|
|
182371
|
-
[request, params] = this.handleUntilOption('end',
|
|
182423
|
+
[request, params] = this.handleUntilOption('end', request, params);
|
|
182372
182424
|
const [type, query] = this.handleMarketTypeAndParams('fetchMyTrades', market, params);
|
|
182373
182425
|
request['instType'] = this.convertToInstrumentType(type);
|
|
182374
182426
|
if (limit !== undefined) {
|
|
@@ -182487,7 +182539,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
182487
182539
|
currency = this.currency(code);
|
|
182488
182540
|
request['ccy'] = currency['id'];
|
|
182489
182541
|
}
|
|
182490
|
-
[request, params] = this.handleUntilOption('end',
|
|
182542
|
+
[request, params] = this.handleUntilOption('end', request, params);
|
|
182491
182543
|
const response = await this[method](this.extend(request, query));
|
|
182492
182544
|
//
|
|
182493
182545
|
// privateGetAccountBills, privateGetAccountBillsArchive
|
|
@@ -182930,7 +182982,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
182930
182982
|
if (limit !== undefined) {
|
|
182931
182983
|
request['limit'] = limit; // default 100, max 100
|
|
182932
182984
|
}
|
|
182933
|
-
[request, params] = this.handleUntilOption('after',
|
|
182985
|
+
[request, params] = this.handleUntilOption('after', request, params);
|
|
182934
182986
|
const response = await this.privateGetAssetDepositHistory(this.extend(request, params));
|
|
182935
182987
|
//
|
|
182936
182988
|
// {
|
|
@@ -222327,7 +222379,7 @@ class hollaex extends _hollaex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
222327
222379
|
const messageHash = this.safeString(message, 'topic');
|
|
222328
222380
|
const data = this.safeValue(message, 'data');
|
|
222329
222381
|
const keys = Object.keys(data);
|
|
222330
|
-
const timestamp = this.
|
|
222382
|
+
const timestamp = this.safeTimestamp(message, 'time');
|
|
222331
222383
|
this.balance['info'] = data;
|
|
222332
222384
|
this.balance['timestamp'] = timestamp;
|
|
222333
222385
|
this.balance['datetime'] = this.iso8601(timestamp);
|
|
@@ -231535,7 +231587,7 @@ class mexc extends _mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
231535
231587
|
// }
|
|
231536
231588
|
//
|
|
231537
231589
|
return [
|
|
231538
|
-
this.
|
|
231590
|
+
this.safeTimestamp(ohlcv, 't'),
|
|
231539
231591
|
this.safeNumber(ohlcv, 'o'),
|
|
231540
231592
|
this.safeNumber(ohlcv, 'h'),
|
|
231541
231593
|
this.safeNumber(ohlcv, 'l'),
|
|
@@ -264319,7 +264371,7 @@ class whitebit extends _abstract_whitebit_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
264319
264371
|
// ]
|
|
264320
264372
|
// }
|
|
264321
264373
|
//
|
|
264322
|
-
const timestamp = this.
|
|
264374
|
+
const timestamp = this.safeTimestamp(response, 'timestamp');
|
|
264323
264375
|
return this.parseOrderBook(response, symbol, timestamp);
|
|
264324
264376
|
}
|
|
264325
264377
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
@@ -266142,7 +266194,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
266142
266194
|
'max': undefined,
|
|
266143
266195
|
},
|
|
266144
266196
|
},
|
|
266145
|
-
'created': this.
|
|
266197
|
+
'created': this.safeTimestamp(market, 'created_time'),
|
|
266146
266198
|
'info': market,
|
|
266147
266199
|
});
|
|
266148
266200
|
}
|
|
@@ -277895,7 +277947,7 @@ SOFTWARE.
|
|
|
277895
277947
|
|
|
277896
277948
|
//-----------------------------------------------------------------------------
|
|
277897
277949
|
// this is updated by vss.js when building
|
|
277898
|
-
const version = '4.1.
|
|
277950
|
+
const version = '4.1.17';
|
|
277899
277951
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
|
|
277900
277952
|
//-----------------------------------------------------------------------------
|
|
277901
277953
|
|