ccxt 4.4.38 → 4.4.40
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.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/alpaca.js +73 -2
- package/dist/cjs/src/ascendex.js +9 -9
- package/dist/cjs/src/base/Exchange.js +38 -27
- package/dist/cjs/src/binance.js +13 -19
- package/dist/cjs/src/bingx.js +1 -2
- package/dist/cjs/src/bit2c.js +0 -1
- package/dist/cjs/src/bitbank.js +0 -1
- package/dist/cjs/src/bitbns.js +0 -1
- package/dist/cjs/src/bitfinex.js +17 -18
- package/dist/cjs/src/bitfinex1.js +0 -1
- package/dist/cjs/src/bitflyer.js +0 -1
- package/dist/cjs/src/bitget.js +1 -2
- package/dist/cjs/src/bithumb.js +0 -1
- package/dist/cjs/src/bitmart.js +3 -4
- package/dist/cjs/src/bitmex.js +5 -6
- package/dist/cjs/src/bitopro.js +4 -5
- package/dist/cjs/src/bitrue.js +5 -7
- package/dist/cjs/src/bitso.js +1 -2
- package/dist/cjs/src/bitstamp.js +1 -2
- package/dist/cjs/src/bitteam.js +1 -3
- package/dist/cjs/src/bitvavo.js +2 -4
- package/dist/cjs/src/blockchaincom.js +5 -5
- package/dist/cjs/src/blofin.js +10 -10
- package/dist/cjs/src/btcalpha.js +0 -1
- package/dist/cjs/src/btcbox.js +0 -1
- package/dist/cjs/src/btcmarkets.js +1 -3
- package/dist/cjs/src/bybit.js +2 -3
- package/dist/cjs/src/cex.js +1 -1
- package/dist/cjs/src/coinbase.js +77 -1
- package/dist/cjs/src/coinbaseexchange.js +1 -1
- package/dist/cjs/src/coinbaseinternational.js +62 -0
- package/dist/cjs/src/coincatch.js +1 -1
- package/dist/cjs/src/coinex.js +9 -9
- package/dist/cjs/src/coinlist.js +1 -1
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/cryptocom.js +91 -2
- package/dist/cjs/src/currencycom.js +1 -1
- package/dist/cjs/src/defx.js +1 -2
- package/dist/cjs/src/delta.js +1 -1
- package/dist/cjs/src/digifinex.js +59 -19
- package/dist/cjs/src/exmo.js +2 -2
- package/dist/cjs/src/gate.js +1 -1
- package/dist/cjs/src/hashkey.js +3 -5
- package/dist/cjs/src/htx.js +155 -33
- package/dist/cjs/src/hyperliquid.js +1 -1
- package/dist/cjs/src/kraken.js +1 -1
- package/dist/cjs/src/kucoin.js +25 -24
- package/dist/cjs/src/luno.js +1 -1
- package/dist/cjs/src/mexc.js +174 -27
- package/dist/cjs/src/ndax.js +1 -1
- package/dist/cjs/src/okcoin.js +18 -18
- package/dist/cjs/src/okx.js +22 -21
- package/dist/cjs/src/phemex.js +12 -8
- package/dist/cjs/src/poloniex.js +1 -1
- package/dist/cjs/src/poloniexfutures.js +6 -6
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bybit.js +13 -1
- package/dist/cjs/src/pro/coinex.js +2 -2
- package/dist/cjs/src/pro/gate.js +6 -6
- package/dist/cjs/src/pro/kucoin.js +3 -3
- package/dist/cjs/src/pro/okx.js +11 -11
- package/dist/cjs/src/pro/upbit.js +3 -3
- package/dist/cjs/src/pro/woo.js +1 -1
- package/dist/cjs/src/vertex.js +11 -11
- package/dist/cjs/src/woo.js +37 -37
- package/dist/cjs/src/woofipro.js +24 -24
- package/dist/cjs/src/xt.js +26 -26
- package/dist/cjs/src/zonda.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/digifinex.d.ts +1 -0
- package/js/src/abstract/mexc.d.ts +1 -0
- package/js/src/alpaca.d.ts +11 -1
- package/js/src/alpaca.js +73 -2
- package/js/src/ascendex.d.ts +2 -2
- package/js/src/ascendex.js +9 -9
- package/js/src/base/Exchange.js +38 -27
- package/js/src/binance.d.ts +9 -9
- package/js/src/binance.js +13 -19
- package/js/src/bingx.d.ts +1 -1
- package/js/src/bingx.js +1 -2
- package/js/src/bit2c.js +0 -1
- package/js/src/bitbank.js +0 -1
- package/js/src/bitbns.js +0 -1
- package/js/src/bitfinex.d.ts +3 -3
- package/js/src/bitfinex.js +17 -18
- package/js/src/bitfinex1.js +0 -1
- package/js/src/bitflyer.js +0 -1
- package/js/src/bitget.d.ts +1 -1
- package/js/src/bitget.js +1 -2
- package/js/src/bithumb.js +0 -1
- package/js/src/bitmart.d.ts +1 -1
- package/js/src/bitmart.js +3 -4
- package/js/src/bitmex.d.ts +1 -1
- package/js/src/bitmex.js +5 -6
- package/js/src/bitopro.js +4 -5
- package/js/src/bitrue.js +5 -7
- package/js/src/bitso.d.ts +1 -1
- package/js/src/bitso.js +1 -2
- package/js/src/bitstamp.d.ts +1 -1
- package/js/src/bitstamp.js +1 -2
- package/js/src/bitteam.js +1 -3
- package/js/src/bitvavo.d.ts +1 -1
- package/js/src/bitvavo.js +2 -4
- package/js/src/blockchaincom.js +5 -5
- package/js/src/blofin.d.ts +3 -3
- package/js/src/blofin.js +10 -10
- package/js/src/btcalpha.js +0 -1
- package/js/src/btcbox.js +0 -1
- package/js/src/btcmarkets.js +1 -3
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +2 -3
- package/js/src/cex.d.ts +1 -1
- package/js/src/cex.js +1 -1
- package/js/src/coinbase.d.ts +1 -1
- package/js/src/coinbase.js +77 -1
- package/js/src/coinbaseexchange.d.ts +1 -1
- package/js/src/coinbaseexchange.js +1 -1
- package/js/src/coinbaseinternational.js +62 -0
- package/js/src/coincatch.d.ts +1 -1
- package/js/src/coincatch.js +1 -1
- package/js/src/coinex.js +9 -9
- package/js/src/coinlist.d.ts +1 -1
- package/js/src/coinlist.js +1 -1
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/cryptocom.d.ts +2 -2
- package/js/src/cryptocom.js +91 -2
- package/js/src/currencycom.d.ts +1 -1
- package/js/src/currencycom.js +1 -1
- package/js/src/defx.d.ts +1 -2
- package/js/src/defx.js +1 -2
- package/js/src/delta.d.ts +1 -1
- package/js/src/delta.js +1 -1
- package/js/src/digifinex.d.ts +5 -3
- package/js/src/digifinex.js +59 -19
- package/js/src/exmo.js +2 -2
- package/js/src/gate.d.ts +1 -1
- package/js/src/gate.js +1 -1
- package/js/src/hashkey.d.ts +1 -1
- package/js/src/hashkey.js +3 -5
- package/js/src/htx.d.ts +6 -6
- package/js/src/htx.js +155 -33
- package/js/src/hyperliquid.d.ts +1 -1
- package/js/src/hyperliquid.js +1 -1
- package/js/src/kraken.d.ts +1 -1
- package/js/src/kraken.js +1 -1
- package/js/src/kucoin.d.ts +13 -13
- package/js/src/kucoin.js +25 -24
- package/js/src/luno.d.ts +1 -1
- package/js/src/luno.js +1 -1
- package/js/src/mexc.d.ts +8 -9
- package/js/src/mexc.js +174 -27
- package/js/src/ndax.d.ts +1 -1
- package/js/src/ndax.js +1 -1
- package/js/src/okcoin.d.ts +4 -4
- package/js/src/okcoin.js +18 -18
- package/js/src/okx.d.ts +4 -3
- package/js/src/okx.js +22 -21
- package/js/src/phemex.js +12 -8
- package/js/src/poloniex.d.ts +1 -1
- package/js/src/poloniex.js +1 -1
- package/js/src/poloniexfutures.d.ts +1 -1
- package/js/src/poloniexfutures.js +6 -6
- package/js/src/pro/bitget.d.ts +1 -1
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bybit.d.ts +1 -1
- package/js/src/pro/bybit.js +13 -1
- package/js/src/pro/coinex.js +2 -2
- package/js/src/pro/gate.d.ts +2 -2
- package/js/src/pro/gate.js +6 -6
- package/js/src/pro/kucoin.d.ts +1 -1
- package/js/src/pro/kucoin.js +3 -3
- package/js/src/pro/okx.d.ts +2 -2
- package/js/src/pro/okx.js +11 -11
- package/js/src/pro/upbit.d.ts +3 -3
- package/js/src/pro/upbit.js +3 -3
- package/js/src/pro/woo.js +1 -1
- package/js/src/vertex.d.ts +3 -3
- package/js/src/vertex.js +11 -11
- package/js/src/woo.d.ts +7 -7
- package/js/src/woo.js +37 -37
- package/js/src/woofipro.d.ts +1 -1
- package/js/src/woofipro.js +24 -24
- package/js/src/xt.d.ts +7 -7
- package/js/src/xt.js +26 -26
- package/js/src/zonda.d.ts +1 -1
- package/js/src/zonda.js +1 -1
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -200,7 +200,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
200
200
|
|
|
201
201
|
//-----------------------------------------------------------------------------
|
|
202
202
|
// this is updated by vss.js when building
|
|
203
|
-
const version = '4.4.
|
|
203
|
+
const version = '4.4.40';
|
|
204
204
|
Exchange["default"].ccxtVersion = version;
|
|
205
205
|
const exchanges = {
|
|
206
206
|
'ace': ace,
|
package/dist/cjs/src/alpaca.js
CHANGED
|
@@ -34,7 +34,7 @@ class alpaca extends alpaca$1 {
|
|
|
34
34
|
'test': {
|
|
35
35
|
'broker': 'https://broker-api.sandbox.{hostname}',
|
|
36
36
|
'trader': 'https://paper-api.{hostname}',
|
|
37
|
-
'market': 'https://data.
|
|
37
|
+
'market': 'https://data.{hostname}',
|
|
38
38
|
},
|
|
39
39
|
'doc': 'https://alpaca.markets/docs/',
|
|
40
40
|
'fees': 'https://docs.alpaca.markets/docs/crypto-fees',
|
|
@@ -54,7 +54,7 @@ class alpaca extends alpaca$1 {
|
|
|
54
54
|
'createStopOrder': true,
|
|
55
55
|
'createTriggerOrder': true,
|
|
56
56
|
'editOrder': true,
|
|
57
|
-
'fetchBalance':
|
|
57
|
+
'fetchBalance': true,
|
|
58
58
|
'fetchBidsAsks': false,
|
|
59
59
|
'fetchClosedOrders': true,
|
|
60
60
|
'fetchCurrencies': false,
|
|
@@ -1586,6 +1586,77 @@ class alpaca extends alpaca$1 {
|
|
|
1586
1586
|
};
|
|
1587
1587
|
return this.safeString(types, type, type);
|
|
1588
1588
|
}
|
|
1589
|
+
/**
|
|
1590
|
+
* @method
|
|
1591
|
+
* @name alpaca#fetchBalance
|
|
1592
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
1593
|
+
* @see https://docs.alpaca.markets/reference/getaccount-1
|
|
1594
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1595
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1596
|
+
*/
|
|
1597
|
+
async fetchBalance(params = {}) {
|
|
1598
|
+
await this.loadMarkets();
|
|
1599
|
+
const response = await this.traderPrivateGetV2Account(params);
|
|
1600
|
+
//
|
|
1601
|
+
// {
|
|
1602
|
+
// "id": "43a01bde-4eb1-64fssc26adb5",
|
|
1603
|
+
// "admin_configurations": {
|
|
1604
|
+
// "allow_instant_ach": true,
|
|
1605
|
+
// "max_margin_multiplier": "4"
|
|
1606
|
+
// },
|
|
1607
|
+
// "user_configurations": {
|
|
1608
|
+
// "fractional_trading": true,
|
|
1609
|
+
// "max_margin_multiplier": "4"
|
|
1610
|
+
// },
|
|
1611
|
+
// "account_number": "744873727",
|
|
1612
|
+
// "status": "ACTIVE",
|
|
1613
|
+
// "crypto_status": "ACTIVE",
|
|
1614
|
+
// "currency": "USD",
|
|
1615
|
+
// "buying_power": "5.92",
|
|
1616
|
+
// "regt_buying_power": "5.92",
|
|
1617
|
+
// "daytrading_buying_power": "0",
|
|
1618
|
+
// "effective_buying_power": "5.92",
|
|
1619
|
+
// "non_marginable_buying_power": "5.92",
|
|
1620
|
+
// "bod_dtbp": "0",
|
|
1621
|
+
// "cash": "5.92",
|
|
1622
|
+
// "accrued_fees": "0",
|
|
1623
|
+
// "portfolio_value": "48.6",
|
|
1624
|
+
// "pattern_day_trader": false,
|
|
1625
|
+
// "trading_blocked": false,
|
|
1626
|
+
// "transfers_blocked": false,
|
|
1627
|
+
// "account_blocked": false,
|
|
1628
|
+
// "created_at": "2022-06-13T14:59:18.318096Z",
|
|
1629
|
+
// "trade_suspended_by_user": false,
|
|
1630
|
+
// "multiplier": "1",
|
|
1631
|
+
// "shorting_enabled": false,
|
|
1632
|
+
// "equity": "48.6",
|
|
1633
|
+
// "last_equity": "48.8014266",
|
|
1634
|
+
// "long_market_value": "42.68",
|
|
1635
|
+
// "short_market_value": "0",
|
|
1636
|
+
// "position_market_value": "42.68",
|
|
1637
|
+
// "initial_margin": "0",
|
|
1638
|
+
// "maintenance_margin": "0",
|
|
1639
|
+
// "last_maintenance_margin": "0",
|
|
1640
|
+
// "sma": "5.92",
|
|
1641
|
+
// "daytrade_count": 0,
|
|
1642
|
+
// "balance_asof": "2024-12-10",
|
|
1643
|
+
// "crypto_tier": 1,
|
|
1644
|
+
// "intraday_adjustments": "0",
|
|
1645
|
+
// "pending_reg_taf_fees": "0"
|
|
1646
|
+
// }
|
|
1647
|
+
//
|
|
1648
|
+
return this.parseBalance(response);
|
|
1649
|
+
}
|
|
1650
|
+
parseBalance(response) {
|
|
1651
|
+
const result = { 'info': response };
|
|
1652
|
+
const account = this.account();
|
|
1653
|
+
const currencyId = this.safeString(response, 'currency');
|
|
1654
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
1655
|
+
account['free'] = this.safeString(response, 'cash');
|
|
1656
|
+
account['total'] = this.safeString(response, 'equity');
|
|
1657
|
+
result[code] = account;
|
|
1658
|
+
return this.safeBalance(result);
|
|
1659
|
+
}
|
|
1589
1660
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
1590
1661
|
let endpoint = '/' + this.implodeParams(path, params);
|
|
1591
1662
|
let url = this.implodeHostname(this.urls['api'][api[0]]);
|
package/dist/cjs/src/ascendex.js
CHANGED
|
@@ -1394,7 +1394,7 @@ class ascendex extends ascendex$1 {
|
|
|
1394
1394
|
'currency': feeCurrencyCode,
|
|
1395
1395
|
};
|
|
1396
1396
|
}
|
|
1397
|
-
const
|
|
1397
|
+
const triggerPrice = this.omitZero(this.safeString(order, 'stopPrice'));
|
|
1398
1398
|
let reduceOnly = undefined;
|
|
1399
1399
|
const execInst = this.safeString(order, 'execInst');
|
|
1400
1400
|
if (execInst === 'reduceOnly') {
|
|
@@ -1418,8 +1418,8 @@ class ascendex extends ascendex$1 {
|
|
|
1418
1418
|
'reduceOnly': reduceOnly,
|
|
1419
1419
|
'side': side,
|
|
1420
1420
|
'price': price,
|
|
1421
|
-
'stopPrice':
|
|
1422
|
-
'triggerPrice':
|
|
1421
|
+
'stopPrice': triggerPrice,
|
|
1422
|
+
'triggerPrice': triggerPrice,
|
|
1423
1423
|
'amount': amount,
|
|
1424
1424
|
'cost': undefined,
|
|
1425
1425
|
'average': average,
|
|
@@ -1495,7 +1495,7 @@ class ascendex extends ascendex$1 {
|
|
|
1495
1495
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1496
1496
|
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
1497
1497
|
* @param {bool} [params.postOnly] true or false
|
|
1498
|
-
* @param {float} [params.
|
|
1498
|
+
* @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
|
|
1499
1499
|
* @returns {object} request to be sent to the exchange
|
|
1500
1500
|
*/
|
|
1501
1501
|
const market = this.market(symbol);
|
|
@@ -1527,7 +1527,7 @@ class ascendex extends ascendex$1 {
|
|
|
1527
1527
|
const timeInForce = this.safeString(params, 'timeInForce');
|
|
1528
1528
|
const postOnly = this.isPostOnly(isMarketOrder, false, params);
|
|
1529
1529
|
const reduceOnly = this.safeBool(params, 'reduceOnly', false);
|
|
1530
|
-
const
|
|
1530
|
+
const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
|
|
1531
1531
|
if (isLimitOrder) {
|
|
1532
1532
|
request['orderPrice'] = this.priceToPrecision(symbol, price);
|
|
1533
1533
|
}
|
|
@@ -1540,8 +1540,8 @@ class ascendex extends ascendex$1 {
|
|
|
1540
1540
|
if (postOnly) {
|
|
1541
1541
|
request['postOnly'] = true;
|
|
1542
1542
|
}
|
|
1543
|
-
if (
|
|
1544
|
-
request['stopPrice'] = this.priceToPrecision(symbol,
|
|
1543
|
+
if (triggerPrice !== undefined) {
|
|
1544
|
+
request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
1545
1545
|
if (isLimitOrder) {
|
|
1546
1546
|
request['orderType'] = 'stop_limit';
|
|
1547
1547
|
}
|
|
@@ -1583,7 +1583,7 @@ class ascendex extends ascendex$1 {
|
|
|
1583
1583
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1584
1584
|
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
1585
1585
|
* @param {bool} [params.postOnly] true or false
|
|
1586
|
-
* @param {float} [params.
|
|
1586
|
+
* @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
|
|
1587
1587
|
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice that the attached take profit order will be triggered (perpetual swap markets only)
|
|
1588
1588
|
* @param {float} [params.takeProfit.triggerPrice] *swap only* take profit trigger price
|
|
1589
1589
|
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice that the attached stop loss order will be triggered (perpetual swap markets only)
|
|
@@ -1679,7 +1679,7 @@ class ascendex extends ascendex$1 {
|
|
|
1679
1679
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1680
1680
|
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
1681
1681
|
* @param {bool} [params.postOnly] true or false
|
|
1682
|
-
* @param {float} [params.
|
|
1682
|
+
* @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
|
|
1683
1683
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1684
1684
|
*/
|
|
1685
1685
|
async createOrders(orders, params = {}) {
|
|
@@ -1839,31 +1839,25 @@ class Exchange {
|
|
|
1839
1839
|
let wssProxy = undefined;
|
|
1840
1840
|
let wsSocksProxy = undefined;
|
|
1841
1841
|
// ws proxy
|
|
1842
|
-
|
|
1842
|
+
const isWsProxyDefined = this.valueIsDefined(this.wsProxy);
|
|
1843
|
+
const is_ws_proxy_defined = this.valueIsDefined(this.ws_proxy);
|
|
1844
|
+
if (isWsProxyDefined || is_ws_proxy_defined) {
|
|
1843
1845
|
usedProxies.push('wsProxy');
|
|
1844
|
-
wsProxy = this.wsProxy;
|
|
1845
|
-
}
|
|
1846
|
-
if (this.valueIsDefined(this.ws_proxy)) {
|
|
1847
|
-
usedProxies.push('ws_proxy');
|
|
1848
|
-
wsProxy = this.ws_proxy;
|
|
1846
|
+
wsProxy = (isWsProxyDefined) ? this.wsProxy : this.ws_proxy;
|
|
1849
1847
|
}
|
|
1850
1848
|
// wss proxy
|
|
1851
|
-
|
|
1849
|
+
const isWssProxyDefined = this.valueIsDefined(this.wssProxy);
|
|
1850
|
+
const is_wss_proxy_defined = this.valueIsDefined(this.wss_proxy);
|
|
1851
|
+
if (isWssProxyDefined || is_wss_proxy_defined) {
|
|
1852
1852
|
usedProxies.push('wssProxy');
|
|
1853
|
-
wssProxy = this.wssProxy;
|
|
1854
|
-
}
|
|
1855
|
-
if (this.valueIsDefined(this.wss_proxy)) {
|
|
1856
|
-
usedProxies.push('wss_proxy');
|
|
1857
|
-
wssProxy = this.wss_proxy;
|
|
1853
|
+
wssProxy = (isWssProxyDefined) ? this.wssProxy : this.wss_proxy;
|
|
1858
1854
|
}
|
|
1859
1855
|
// ws socks proxy
|
|
1860
|
-
|
|
1856
|
+
const isWsSocksProxyDefined = this.valueIsDefined(this.wsSocksProxy);
|
|
1857
|
+
const is_ws_socks_proxy_defined = this.valueIsDefined(this.ws_socks_proxy);
|
|
1858
|
+
if (isWsSocksProxyDefined || is_ws_socks_proxy_defined) {
|
|
1861
1859
|
usedProxies.push('wsSocksProxy');
|
|
1862
|
-
wsSocksProxy = this.wsSocksProxy;
|
|
1863
|
-
}
|
|
1864
|
-
if (this.valueIsDefined(this.ws_socks_proxy)) {
|
|
1865
|
-
usedProxies.push('ws_socks_proxy');
|
|
1866
|
-
wsSocksProxy = this.ws_socks_proxy;
|
|
1860
|
+
wsSocksProxy = (isWsSocksProxyDefined) ? this.wsSocksProxy : this.ws_socks_proxy;
|
|
1867
1861
|
}
|
|
1868
1862
|
// check
|
|
1869
1863
|
const length = usedProxies.length;
|
|
@@ -6813,8 +6807,10 @@ class Exchange {
|
|
|
6813
6807
|
const symbolAndTimeFrame = symbolsAndTimeFrames[i];
|
|
6814
6808
|
const symbol = this.safeString(symbolAndTimeFrame, 0);
|
|
6815
6809
|
const timeframe = this.safeString(symbolAndTimeFrame, 1);
|
|
6816
|
-
if (
|
|
6817
|
-
|
|
6810
|
+
if (symbol in this.ohlcvs) {
|
|
6811
|
+
if (timeframe in this.ohlcvs[symbol]) {
|
|
6812
|
+
delete this.ohlcvs[symbol][timeframe];
|
|
6813
|
+
}
|
|
6818
6814
|
}
|
|
6819
6815
|
}
|
|
6820
6816
|
}
|
|
@@ -6822,35 +6818,50 @@ class Exchange {
|
|
|
6822
6818
|
for (let i = 0; i < symbols.length; i++) {
|
|
6823
6819
|
const symbol = symbols[i];
|
|
6824
6820
|
if (topic === 'trades') {
|
|
6825
|
-
|
|
6821
|
+
if (symbol in this.trades) {
|
|
6822
|
+
delete this.trades[symbol];
|
|
6823
|
+
}
|
|
6826
6824
|
}
|
|
6827
6825
|
else if (topic === 'orderbook') {
|
|
6828
|
-
|
|
6826
|
+
if (symbol in this.orderbooks) {
|
|
6827
|
+
delete this.orderbooks[symbol];
|
|
6828
|
+
}
|
|
6829
6829
|
}
|
|
6830
6830
|
else if (topic === 'ticker') {
|
|
6831
|
-
|
|
6831
|
+
if (symbol in this.tickers) {
|
|
6832
|
+
delete this.tickers[symbol];
|
|
6833
|
+
}
|
|
6832
6834
|
}
|
|
6833
6835
|
}
|
|
6834
6836
|
}
|
|
6835
6837
|
else {
|
|
6836
6838
|
if (topic === 'myTrades') {
|
|
6837
6839
|
// don't reset this.myTrades directly here
|
|
6838
|
-
// because in c# we need to use a different object
|
|
6840
|
+
// because in c# we need to use a different object (thread-safe dict)
|
|
6839
6841
|
const keys = Object.keys(this.myTrades);
|
|
6840
6842
|
for (let i = 0; i < keys.length; i++) {
|
|
6841
|
-
|
|
6843
|
+
const key = keys[i];
|
|
6844
|
+
if (key in this.myTrades) {
|
|
6845
|
+
delete this.myTrades[key];
|
|
6846
|
+
}
|
|
6842
6847
|
}
|
|
6843
6848
|
}
|
|
6844
6849
|
else if (topic === 'orders') {
|
|
6845
6850
|
const orderSymbols = Object.keys(this.orders);
|
|
6846
6851
|
for (let i = 0; i < orderSymbols.length; i++) {
|
|
6847
|
-
|
|
6852
|
+
const orderSymbol = orderSymbols[i];
|
|
6853
|
+
if (orderSymbol in this.orders) {
|
|
6854
|
+
delete this.orders[orderSymbol];
|
|
6855
|
+
}
|
|
6848
6856
|
}
|
|
6849
6857
|
}
|
|
6850
6858
|
else if (topic === 'ticker') {
|
|
6851
6859
|
const tickerSymbols = Object.keys(this.tickers);
|
|
6852
6860
|
for (let i = 0; i < tickerSymbols.length; i++) {
|
|
6853
|
-
|
|
6861
|
+
const tickerSymbol = tickerSymbols[i];
|
|
6862
|
+
if (tickerSymbol in this.tickers) {
|
|
6863
|
+
delete this.tickers[tickerSymbol];
|
|
6864
|
+
}
|
|
6854
6865
|
}
|
|
6855
6866
|
}
|
|
6856
6867
|
}
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -6249,16 +6249,10 @@ class binance extends binance$1 {
|
|
|
6249
6249
|
let marginMode = undefined;
|
|
6250
6250
|
[marginMode, params] = this.handleMarginModeAndParams('createOrder', params);
|
|
6251
6251
|
const reduceOnly = this.safeBool(params, 'reduceOnly', false);
|
|
6252
|
-
if (
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
request['reduceOnly'] = reduceOnly;
|
|
6257
|
-
}
|
|
6258
|
-
else {
|
|
6259
|
-
if (reduceOnly) {
|
|
6260
|
-
request['sideEffectType'] = 'AUTO_REPAY';
|
|
6261
|
-
}
|
|
6252
|
+
if (reduceOnly) {
|
|
6253
|
+
if (marketType === 'margin' || (!market['contract'] && (marginMode !== undefined))) {
|
|
6254
|
+
params = this.omit(params, 'reduceOnly');
|
|
6255
|
+
request['sideEffectType'] = 'AUTO_REPAY';
|
|
6262
6256
|
}
|
|
6263
6257
|
}
|
|
6264
6258
|
const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
|
|
@@ -6708,7 +6702,7 @@ class binance extends binance$1 {
|
|
|
6708
6702
|
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
6709
6703
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
6710
6704
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
6711
|
-
* @param {boolean} [params.
|
|
6705
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders
|
|
6712
6706
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6713
6707
|
*/
|
|
6714
6708
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -6985,7 +6979,7 @@ class binance extends binance$1 {
|
|
|
6985
6979
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6986
6980
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
6987
6981
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch open orders in the portfolio margin account
|
|
6988
|
-
* @param {boolean} [params.
|
|
6982
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account conditional orders
|
|
6989
6983
|
* @param {string} [params.subType] "linear" or "inverse"
|
|
6990
6984
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6991
6985
|
*/
|
|
@@ -7307,7 +7301,7 @@ class binance extends binance$1 {
|
|
|
7307
7301
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7308
7302
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
7309
7303
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7310
|
-
* @param {boolean} [params.
|
|
7304
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders
|
|
7311
7305
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7312
7306
|
*/
|
|
7313
7307
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -7337,7 +7331,7 @@ class binance extends binance$1 {
|
|
|
7337
7331
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7338
7332
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
7339
7333
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7340
|
-
* @param {boolean} [params.
|
|
7334
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders
|
|
7341
7335
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7342
7336
|
*/
|
|
7343
7337
|
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -7367,7 +7361,7 @@ class binance extends binance$1 {
|
|
|
7367
7361
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7368
7362
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
7369
7363
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7370
|
-
* @param {boolean} [params.
|
|
7364
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders
|
|
7371
7365
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7372
7366
|
*/
|
|
7373
7367
|
async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -7399,7 +7393,7 @@ class binance extends binance$1 {
|
|
|
7399
7393
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
7400
7394
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7401
7395
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to cancel an order in a portfolio margin account
|
|
7402
|
-
* @param {boolean} [params.
|
|
7396
|
+
* @param {boolean} [params.trigger] set to true if you would like to cancel a portfolio margin account conditional order
|
|
7403
7397
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7404
7398
|
*/
|
|
7405
7399
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
@@ -7504,7 +7498,7 @@ class binance extends binance$1 {
|
|
|
7504
7498
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7505
7499
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
7506
7500
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to cancel orders in a portfolio margin account
|
|
7507
|
-
* @param {boolean} [params.
|
|
7501
|
+
* @param {boolean} [params.trigger] set to true if you would like to cancel portfolio margin account conditional orders
|
|
7508
7502
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7509
7503
|
*/
|
|
7510
7504
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
@@ -11589,7 +11583,7 @@ class binance extends binance$1 {
|
|
|
11589
11583
|
* @param {string} id the identification number of the ledger entry
|
|
11590
11584
|
* @param {string} code unified currency code
|
|
11591
11585
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11592
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
11586
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
11593
11587
|
*/
|
|
11594
11588
|
async fetchLedgerEntry(id, code = undefined, params = {}) {
|
|
11595
11589
|
await this.loadMarkets();
|
|
@@ -11636,7 +11630,7 @@ class binance extends binance$1 {
|
|
|
11636
11630
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
11637
11631
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the ledger for a portfolio margin account
|
|
11638
11632
|
* @param {string} [params.subType] "linear" or "inverse"
|
|
11639
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
11633
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
11640
11634
|
*/
|
|
11641
11635
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11642
11636
|
await this.loadMarkets();
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -3608,7 +3608,6 @@ class bingx extends bingx$1 {
|
|
|
3608
3608
|
'postOnly': undefined,
|
|
3609
3609
|
'side': this.parseOrderSide(side),
|
|
3610
3610
|
'price': this.safeString2(order, 'price', 'p'),
|
|
3611
|
-
'stopPrice': triggerPrice,
|
|
3612
3611
|
'triggerPrice': triggerPrice,
|
|
3613
3612
|
'stopLossPrice': stopLossPrice,
|
|
3614
3613
|
'takeProfitPrice': takeProfitPrice,
|
|
@@ -6154,7 +6153,7 @@ class bingx extends bingx$1 {
|
|
|
6154
6153
|
* @param {float} amount how much of the currency you want to trade in units of the base currency
|
|
6155
6154
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
6156
6155
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6157
|
-
* @param {string} [params.
|
|
6156
|
+
* @param {string} [params.triggerPrice] Trigger price used for TAKE_STOP_LIMIT, TAKE_STOP_MARKET, TRIGGER_LIMIT, TRIGGER_MARKET order types.
|
|
6158
6157
|
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
|
6159
6158
|
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
6160
6159
|
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
package/dist/cjs/src/bit2c.js
CHANGED
package/dist/cjs/src/bitbank.js
CHANGED
package/dist/cjs/src/bitbns.js
CHANGED
|
@@ -564,7 +564,6 @@ class bitbns extends bitbns$1 {
|
|
|
564
564
|
'postOnly': undefined,
|
|
565
565
|
'side': side,
|
|
566
566
|
'price': this.safeString(order, 'rate'),
|
|
567
|
-
'stopPrice': triggerPrice,
|
|
568
567
|
'triggerPrice': triggerPrice,
|
|
569
568
|
'amount': this.safeString(order, 'btc'),
|
|
570
569
|
'cost': undefined,
|
package/dist/cjs/src/bitfinex.js
CHANGED
|
@@ -1509,10 +1509,10 @@ class bitfinex extends bitfinex$1 {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
}
|
|
1511
1511
|
let price = this.safeString(orderList, 16);
|
|
1512
|
-
let
|
|
1512
|
+
let triggerPrice = undefined;
|
|
1513
1513
|
if ((orderType === 'EXCHANGE STOP') || (orderType === 'EXCHANGE STOP LIMIT')) {
|
|
1514
1514
|
price = undefined;
|
|
1515
|
-
|
|
1515
|
+
triggerPrice = this.safeString(orderList, 16);
|
|
1516
1516
|
if (orderType === 'EXCHANGE STOP LIMIT') {
|
|
1517
1517
|
price = this.safeString(orderList, 19);
|
|
1518
1518
|
}
|
|
@@ -1538,8 +1538,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
1538
1538
|
'postOnly': postOnly,
|
|
1539
1539
|
'side': side,
|
|
1540
1540
|
'price': price,
|
|
1541
|
-
'
|
|
1542
|
-
'triggerPrice': stopPrice,
|
|
1541
|
+
'triggerPrice': triggerPrice,
|
|
1543
1542
|
'amount': amount,
|
|
1544
1543
|
'cost': undefined,
|
|
1545
1544
|
'average': average,
|
|
@@ -1562,7 +1561,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
1562
1561
|
* @param {float} amount how much you want to trade in units of the base currency
|
|
1563
1562
|
* @param {float} [price] the price of the order, in units of the quote currency, ignored in market orders
|
|
1564
1563
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1565
|
-
* @param {float} [params.
|
|
1564
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
1566
1565
|
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
1567
1566
|
* @param {bool} [params.postOnly]
|
|
1568
1567
|
* @param {bool} [params.reduceOnly] Ensures that the executed order does not flip the opened position.
|
|
@@ -1580,7 +1579,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
1580
1579
|
'symbol': market['id'],
|
|
1581
1580
|
'amount': amountString,
|
|
1582
1581
|
};
|
|
1583
|
-
const
|
|
1582
|
+
const triggerPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
|
|
1584
1583
|
const trailingAmount = this.safeString(params, 'trailingAmount');
|
|
1585
1584
|
const timeInForce = this.safeString(params, 'timeInForce');
|
|
1586
1585
|
const postOnlyParam = this.safeBool(params, 'postOnly', false);
|
|
@@ -1591,9 +1590,9 @@ class bitfinex extends bitfinex$1 {
|
|
|
1591
1590
|
orderType = 'TRAILING STOP';
|
|
1592
1591
|
request['price_trailing'] = trailingAmount;
|
|
1593
1592
|
}
|
|
1594
|
-
else if (
|
|
1595
|
-
// request['price'] is taken as
|
|
1596
|
-
request['price'] = this.priceToPrecision(symbol,
|
|
1593
|
+
else if (triggerPrice !== undefined) {
|
|
1594
|
+
// request['price'] is taken as triggerPrice for stop orders
|
|
1595
|
+
request['price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
1597
1596
|
if (type === 'limit') {
|
|
1598
1597
|
orderType = 'STOP LIMIT';
|
|
1599
1598
|
request['price_aux_limit'] = this.priceToPrecision(symbol, price);
|
|
@@ -1611,7 +1610,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
1611
1610
|
if ((ioc || fok) && (type === 'market')) {
|
|
1612
1611
|
throw new errors.InvalidOrder(this.id + ' createOrder() does not allow market IOC and FOK orders');
|
|
1613
1612
|
}
|
|
1614
|
-
if ((type !== 'market') && (
|
|
1613
|
+
if ((type !== 'market') && (triggerPrice === undefined)) {
|
|
1615
1614
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
1616
1615
|
}
|
|
1617
1616
|
if (ioc) {
|
|
@@ -1655,7 +1654,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
1655
1654
|
* @param {float} amount the amount of currency to trade
|
|
1656
1655
|
* @param {float} [price] price of the order
|
|
1657
1656
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1658
|
-
* @param {float} [params.
|
|
1657
|
+
* @param {float} [params.triggerPrice] the price that triggers a trigger order
|
|
1659
1658
|
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
1660
1659
|
* @param {boolean} [params.postOnly] set to true if you want to make a post only order
|
|
1661
1660
|
* @param {boolean} [params.reduceOnly] indicates that the order is to reduce the size of a position
|
|
@@ -2965,7 +2964,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
2965
2964
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2966
2965
|
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
2967
2966
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
2968
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
2967
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
2969
2968
|
*/
|
|
2970
2969
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2971
2970
|
await this.loadMarkets();
|
|
@@ -3657,7 +3656,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
3657
3656
|
* @param {float} amount how much you want to trade in units of the base currency
|
|
3658
3657
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
3659
3658
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3660
|
-
* @param {float} [params.
|
|
3659
|
+
* @param {float} [params.triggerPrice] the price that triggers a trigger order
|
|
3661
3660
|
* @param {boolean} [params.postOnly] set to true if you want to make a post only order
|
|
3662
3661
|
* @param {boolean} [params.reduceOnly] indicates that the order is to reduce the size of a position
|
|
3663
3662
|
* @param {int} [params.flags] additional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates)
|
|
@@ -3677,7 +3676,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
3677
3676
|
amountString = (side === 'buy') ? amountString : Precise["default"].stringNeg(amountString);
|
|
3678
3677
|
request['amount'] = amountString;
|
|
3679
3678
|
}
|
|
3680
|
-
const
|
|
3679
|
+
const triggerPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
|
|
3681
3680
|
const trailingAmount = this.safeString(params, 'trailingAmount');
|
|
3682
3681
|
const timeInForce = this.safeString(params, 'timeInForce');
|
|
3683
3682
|
const postOnlyParam = this.safeBool(params, 'postOnly', false);
|
|
@@ -3686,15 +3685,15 @@ class bitfinex extends bitfinex$1 {
|
|
|
3686
3685
|
if (trailingAmount !== undefined) {
|
|
3687
3686
|
request['price_trailing'] = trailingAmount;
|
|
3688
3687
|
}
|
|
3689
|
-
else if (
|
|
3690
|
-
// request['price'] is taken as
|
|
3691
|
-
request['price'] = this.priceToPrecision(symbol,
|
|
3688
|
+
else if (triggerPrice !== undefined) {
|
|
3689
|
+
// request['price'] is taken as triggerPrice for stop orders
|
|
3690
|
+
request['price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
3692
3691
|
if (type === 'limit') {
|
|
3693
3692
|
request['price_aux_limit'] = this.priceToPrecision(symbol, price);
|
|
3694
3693
|
}
|
|
3695
3694
|
}
|
|
3696
3695
|
const postOnly = (postOnlyParam || (timeInForce === 'PO'));
|
|
3697
|
-
if ((type !== 'market') && (
|
|
3696
|
+
if ((type !== 'market') && (triggerPrice === undefined)) {
|
|
3698
3697
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
3699
3698
|
}
|
|
3700
3699
|
// flag values may be summed to combine flags
|
|
@@ -1271,7 +1271,6 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
1271
1271
|
'postOnly': undefined,
|
|
1272
1272
|
'side': side,
|
|
1273
1273
|
'price': this.safeString(order, 'price'),
|
|
1274
|
-
'stopPrice': undefined,
|
|
1275
1274
|
'triggerPrice': undefined,
|
|
1276
1275
|
'average': this.safeString(order, 'avg_execution_price'),
|
|
1277
1276
|
'amount': this.safeString(order, 'original_amount'),
|
package/dist/cjs/src/bitflyer.js
CHANGED
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -4242,7 +4242,6 @@ class bitget extends bitget$1 {
|
|
|
4242
4242
|
'timeInForce': timeInForce,
|
|
4243
4243
|
'postOnly': postOnly,
|
|
4244
4244
|
'reduceOnly': reduceOnly,
|
|
4245
|
-
'stopPrice': this.safeNumber(order, 'triggerPrice'),
|
|
4246
4245
|
'triggerPrice': this.safeNumber(order, 'triggerPrice'),
|
|
4247
4246
|
'takeProfitPrice': this.safeNumber2(order, 'presetStopSurplusPrice', 'stopSurplusTriggerPrice'),
|
|
4248
4247
|
'stopLossPrice': this.safeNumber2(order, 'presetStopLossPrice', 'stopLossTriggerPrice'),
|
|
@@ -6065,7 +6064,7 @@ class bitget extends bitget$1 {
|
|
|
6065
6064
|
* @param {string} [params.symbol] *contract only* unified market symbol
|
|
6066
6065
|
* @param {string} [params.productType] *contract only* 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES'
|
|
6067
6066
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
6068
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
6067
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
6069
6068
|
*/
|
|
6070
6069
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6071
6070
|
await this.loadMarkets();
|
package/dist/cjs/src/bithumb.js
CHANGED
package/dist/cjs/src/bitmart.js
CHANGED
|
@@ -2556,7 +2556,6 @@ class bitmart extends bitmart$1 {
|
|
|
2556
2556
|
'postOnly': postOnly,
|
|
2557
2557
|
'side': this.parseOrderSide(this.safeString(order, 'side')),
|
|
2558
2558
|
'price': this.omitZero(priceString),
|
|
2559
|
-
'stopPrice': trailingActivationPrice,
|
|
2560
2559
|
'triggerPrice': trailingActivationPrice,
|
|
2561
2560
|
'amount': this.omitZero(this.safeString(order, 'size')),
|
|
2562
2561
|
'cost': this.safeString2(order, 'filled_notional', 'filledNotional'),
|
|
@@ -3022,7 +3021,7 @@ class bitmart extends bitmart$1 {
|
|
|
3022
3021
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
3023
3022
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3024
3023
|
* @param {string} [params.clientOrderId] *spot only* the client order id of the order to cancel
|
|
3025
|
-
* @param {boolean} [params.
|
|
3024
|
+
* @param {boolean} [params.trigger] *swap only* whether the order is a trigger order
|
|
3026
3025
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3027
3026
|
*/
|
|
3028
3027
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
@@ -3047,9 +3046,9 @@ class bitmart extends bitmart$1 {
|
|
|
3047
3046
|
response = await this.privatePostSpotV3CancelOrder(this.extend(request, params));
|
|
3048
3047
|
}
|
|
3049
3048
|
else {
|
|
3050
|
-
const
|
|
3049
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
3051
3050
|
params = this.omit(params, ['stop', 'trigger']);
|
|
3052
|
-
if (!
|
|
3051
|
+
if (!trigger) {
|
|
3053
3052
|
response = await this.privatePostContractPrivateCancelOrder(this.extend(request, params));
|
|
3054
3053
|
}
|
|
3055
3054
|
else {
|