ccxt 4.4.39 → 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/ascendex.js +9 -9
- package/dist/cjs/src/base/Exchange.js +12 -18
- 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 +1 -1
- 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 +1 -1
- package/dist/cjs/src/hyperliquid.js +1 -1
- package/dist/cjs/src/kraken.js +1 -1
- package/dist/cjs/src/kucoin.js +24 -24
- package/dist/cjs/src/luno.js +1 -1
- package/dist/cjs/src/mexc.js +138 -2
- package/dist/cjs/src/ndax.js +1 -1
- package/dist/cjs/src/okcoin.js +18 -18
- package/dist/cjs/src/okx.js +21 -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/vertex.js +11 -11
- package/dist/cjs/src/woo.js +33 -33
- 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/ascendex.d.ts +2 -2
- package/js/src/ascendex.js +9 -9
- package/js/src/base/Exchange.js +12 -18
- 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 +1 -1
- package/js/src/digifinex.js +1 -1
- 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 +1 -1
- package/js/src/htx.js +1 -1
- 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 +24 -24
- package/js/src/luno.d.ts +1 -1
- package/js/src/luno.js +1 -1
- package/js/src/mexc.d.ts +1 -2
- package/js/src/mexc.js +138 -2
- 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 +3 -3
- package/js/src/okx.js +21 -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/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 +33 -33
- 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/js/src/ascendex.js
CHANGED
|
@@ -1397,7 +1397,7 @@ export default class ascendex extends Exchange {
|
|
|
1397
1397
|
'currency': feeCurrencyCode,
|
|
1398
1398
|
};
|
|
1399
1399
|
}
|
|
1400
|
-
const
|
|
1400
|
+
const triggerPrice = this.omitZero(this.safeString(order, 'stopPrice'));
|
|
1401
1401
|
let reduceOnly = undefined;
|
|
1402
1402
|
const execInst = this.safeString(order, 'execInst');
|
|
1403
1403
|
if (execInst === 'reduceOnly') {
|
|
@@ -1421,8 +1421,8 @@ export default class ascendex extends Exchange {
|
|
|
1421
1421
|
'reduceOnly': reduceOnly,
|
|
1422
1422
|
'side': side,
|
|
1423
1423
|
'price': price,
|
|
1424
|
-
'stopPrice':
|
|
1425
|
-
'triggerPrice':
|
|
1424
|
+
'stopPrice': triggerPrice,
|
|
1425
|
+
'triggerPrice': triggerPrice,
|
|
1426
1426
|
'amount': amount,
|
|
1427
1427
|
'cost': undefined,
|
|
1428
1428
|
'average': average,
|
|
@@ -1498,7 +1498,7 @@ export default class ascendex extends Exchange {
|
|
|
1498
1498
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1499
1499
|
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
1500
1500
|
* @param {bool} [params.postOnly] true or false
|
|
1501
|
-
* @param {float} [params.
|
|
1501
|
+
* @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
|
|
1502
1502
|
* @returns {object} request to be sent to the exchange
|
|
1503
1503
|
*/
|
|
1504
1504
|
const market = this.market(symbol);
|
|
@@ -1530,7 +1530,7 @@ export default class ascendex extends Exchange {
|
|
|
1530
1530
|
const timeInForce = this.safeString(params, 'timeInForce');
|
|
1531
1531
|
const postOnly = this.isPostOnly(isMarketOrder, false, params);
|
|
1532
1532
|
const reduceOnly = this.safeBool(params, 'reduceOnly', false);
|
|
1533
|
-
const
|
|
1533
|
+
const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
|
|
1534
1534
|
if (isLimitOrder) {
|
|
1535
1535
|
request['orderPrice'] = this.priceToPrecision(symbol, price);
|
|
1536
1536
|
}
|
|
@@ -1543,8 +1543,8 @@ export default class ascendex extends Exchange {
|
|
|
1543
1543
|
if (postOnly) {
|
|
1544
1544
|
request['postOnly'] = true;
|
|
1545
1545
|
}
|
|
1546
|
-
if (
|
|
1547
|
-
request['stopPrice'] = this.priceToPrecision(symbol,
|
|
1546
|
+
if (triggerPrice !== undefined) {
|
|
1547
|
+
request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
1548
1548
|
if (isLimitOrder) {
|
|
1549
1549
|
request['orderType'] = 'stop_limit';
|
|
1550
1550
|
}
|
|
@@ -1586,7 +1586,7 @@ export default class ascendex extends Exchange {
|
|
|
1586
1586
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1587
1587
|
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
1588
1588
|
* @param {bool} [params.postOnly] true or false
|
|
1589
|
-
* @param {float} [params.
|
|
1589
|
+
* @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
|
|
1590
1590
|
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice that the attached take profit order will be triggered (perpetual swap markets only)
|
|
1591
1591
|
* @param {float} [params.takeProfit.triggerPrice] *swap only* take profit trigger price
|
|
1592
1592
|
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice that the attached stop loss order will be triggered (perpetual swap markets only)
|
|
@@ -1682,7 +1682,7 @@ export default class ascendex extends Exchange {
|
|
|
1682
1682
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1683
1683
|
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
1684
1684
|
* @param {bool} [params.postOnly] true or false
|
|
1685
|
-
* @param {float} [params.
|
|
1685
|
+
* @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
|
|
1686
1686
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1687
1687
|
*/
|
|
1688
1688
|
async createOrders(orders, params = {}) {
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -1822,31 +1822,25 @@ export default class Exchange {
|
|
|
1822
1822
|
let wssProxy = undefined;
|
|
1823
1823
|
let wsSocksProxy = undefined;
|
|
1824
1824
|
// ws proxy
|
|
1825
|
-
|
|
1825
|
+
const isWsProxyDefined = this.valueIsDefined(this.wsProxy);
|
|
1826
|
+
const is_ws_proxy_defined = this.valueIsDefined(this.ws_proxy);
|
|
1827
|
+
if (isWsProxyDefined || is_ws_proxy_defined) {
|
|
1826
1828
|
usedProxies.push('wsProxy');
|
|
1827
|
-
wsProxy = this.wsProxy;
|
|
1828
|
-
}
|
|
1829
|
-
if (this.valueIsDefined(this.ws_proxy)) {
|
|
1830
|
-
usedProxies.push('ws_proxy');
|
|
1831
|
-
wsProxy = this.ws_proxy;
|
|
1829
|
+
wsProxy = (isWsProxyDefined) ? this.wsProxy : this.ws_proxy;
|
|
1832
1830
|
}
|
|
1833
1831
|
// wss proxy
|
|
1834
|
-
|
|
1832
|
+
const isWssProxyDefined = this.valueIsDefined(this.wssProxy);
|
|
1833
|
+
const is_wss_proxy_defined = this.valueIsDefined(this.wss_proxy);
|
|
1834
|
+
if (isWssProxyDefined || is_wss_proxy_defined) {
|
|
1835
1835
|
usedProxies.push('wssProxy');
|
|
1836
|
-
wssProxy = this.wssProxy;
|
|
1837
|
-
}
|
|
1838
|
-
if (this.valueIsDefined(this.wss_proxy)) {
|
|
1839
|
-
usedProxies.push('wss_proxy');
|
|
1840
|
-
wssProxy = this.wss_proxy;
|
|
1836
|
+
wssProxy = (isWssProxyDefined) ? this.wssProxy : this.wss_proxy;
|
|
1841
1837
|
}
|
|
1842
1838
|
// ws socks proxy
|
|
1843
|
-
|
|
1839
|
+
const isWsSocksProxyDefined = this.valueIsDefined(this.wsSocksProxy);
|
|
1840
|
+
const is_ws_socks_proxy_defined = this.valueIsDefined(this.ws_socks_proxy);
|
|
1841
|
+
if (isWsSocksProxyDefined || is_ws_socks_proxy_defined) {
|
|
1844
1842
|
usedProxies.push('wsSocksProxy');
|
|
1845
|
-
wsSocksProxy = this.wsSocksProxy;
|
|
1846
|
-
}
|
|
1847
|
-
if (this.valueIsDefined(this.ws_socks_proxy)) {
|
|
1848
|
-
usedProxies.push('ws_socks_proxy');
|
|
1849
|
-
wsSocksProxy = this.ws_socks_proxy;
|
|
1843
|
+
wsSocksProxy = (isWsSocksProxyDefined) ? this.wsSocksProxy : this.ws_socks_proxy;
|
|
1850
1844
|
}
|
|
1851
1845
|
// check
|
|
1852
1846
|
const length = usedProxies.length;
|
package/js/src/binance.d.ts
CHANGED
|
@@ -429,7 +429,7 @@ export default class binance extends Exchange {
|
|
|
429
429
|
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
430
430
|
* @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)
|
|
431
431
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
432
|
-
* @param {boolean} [params.
|
|
432
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders
|
|
433
433
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
434
434
|
*/
|
|
435
435
|
fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
@@ -452,7 +452,7 @@ export default class binance extends Exchange {
|
|
|
452
452
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
453
453
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
454
454
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch open orders in the portfolio margin account
|
|
455
|
-
* @param {boolean} [params.
|
|
455
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account conditional orders
|
|
456
456
|
* @param {string} [params.subType] "linear" or "inverse"
|
|
457
457
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
458
458
|
*/
|
|
@@ -493,7 +493,7 @@ export default class binance extends Exchange {
|
|
|
493
493
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
494
494
|
* @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)
|
|
495
495
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
496
|
-
* @param {boolean} [params.
|
|
496
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders
|
|
497
497
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
498
498
|
*/
|
|
499
499
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
@@ -516,7 +516,7 @@ export default class binance extends Exchange {
|
|
|
516
516
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
517
517
|
* @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)
|
|
518
518
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
519
|
-
* @param {boolean} [params.
|
|
519
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders
|
|
520
520
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
521
521
|
*/
|
|
522
522
|
fetchCanceledOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
@@ -539,7 +539,7 @@ export default class binance extends Exchange {
|
|
|
539
539
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
540
540
|
* @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)
|
|
541
541
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
542
|
-
* @param {boolean} [params.
|
|
542
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders
|
|
543
543
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
544
544
|
*/
|
|
545
545
|
fetchCanceledAndClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
@@ -561,7 +561,7 @@ export default class binance extends Exchange {
|
|
|
561
561
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
562
562
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
563
563
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to cancel an order in a portfolio margin account
|
|
564
|
-
* @param {boolean} [params.
|
|
564
|
+
* @param {boolean} [params.trigger] set to true if you would like to cancel a portfolio margin account conditional order
|
|
565
565
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
566
566
|
*/
|
|
567
567
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
@@ -582,7 +582,7 @@ export default class binance extends Exchange {
|
|
|
582
582
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
583
583
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
584
584
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to cancel orders in a portfolio margin account
|
|
585
|
-
* @param {boolean} [params.
|
|
585
|
+
* @param {boolean} [params.trigger] set to true if you would like to cancel portfolio margin account conditional orders
|
|
586
586
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
587
587
|
*/
|
|
588
588
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
|
|
@@ -1143,7 +1143,7 @@ export default class binance extends Exchange {
|
|
|
1143
1143
|
* @param {string} id the identification number of the ledger entry
|
|
1144
1144
|
* @param {string} code unified currency code
|
|
1145
1145
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1146
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
1146
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
1147
1147
|
*/
|
|
1148
1148
|
fetchLedgerEntry(id: string, code?: Str, params?: {}): Promise<LedgerEntry>;
|
|
1149
1149
|
/**
|
|
@@ -1163,7 +1163,7 @@ export default class binance extends Exchange {
|
|
|
1163
1163
|
* @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)
|
|
1164
1164
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the ledger for a portfolio margin account
|
|
1165
1165
|
* @param {string} [params.subType] "linear" or "inverse"
|
|
1166
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
1166
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
1167
1167
|
*/
|
|
1168
1168
|
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
1169
1169
|
parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
|
package/js/src/binance.js
CHANGED
|
@@ -6252,16 +6252,10 @@ export default class binance extends Exchange {
|
|
|
6252
6252
|
let marginMode = undefined;
|
|
6253
6253
|
[marginMode, params] = this.handleMarginModeAndParams('createOrder', params);
|
|
6254
6254
|
const reduceOnly = this.safeBool(params, 'reduceOnly', false);
|
|
6255
|
-
if (
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
request['reduceOnly'] = reduceOnly;
|
|
6260
|
-
}
|
|
6261
|
-
else {
|
|
6262
|
-
if (reduceOnly) {
|
|
6263
|
-
request['sideEffectType'] = 'AUTO_REPAY';
|
|
6264
|
-
}
|
|
6255
|
+
if (reduceOnly) {
|
|
6256
|
+
if (marketType === 'margin' || (!market['contract'] && (marginMode !== undefined))) {
|
|
6257
|
+
params = this.omit(params, 'reduceOnly');
|
|
6258
|
+
request['sideEffectType'] = 'AUTO_REPAY';
|
|
6265
6259
|
}
|
|
6266
6260
|
}
|
|
6267
6261
|
const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
|
|
@@ -6711,7 +6705,7 @@ export default class binance extends Exchange {
|
|
|
6711
6705
|
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
6712
6706
|
* @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)
|
|
6713
6707
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
6714
|
-
* @param {boolean} [params.
|
|
6708
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders
|
|
6715
6709
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6716
6710
|
*/
|
|
6717
6711
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -6988,7 +6982,7 @@ export default class binance extends Exchange {
|
|
|
6988
6982
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6989
6983
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
6990
6984
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch open orders in the portfolio margin account
|
|
6991
|
-
* @param {boolean} [params.
|
|
6985
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account conditional orders
|
|
6992
6986
|
* @param {string} [params.subType] "linear" or "inverse"
|
|
6993
6987
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6994
6988
|
*/
|
|
@@ -7310,7 +7304,7 @@ export default class binance extends Exchange {
|
|
|
7310
7304
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7311
7305
|
* @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)
|
|
7312
7306
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7313
|
-
* @param {boolean} [params.
|
|
7307
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders
|
|
7314
7308
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7315
7309
|
*/
|
|
7316
7310
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -7340,7 +7334,7 @@ export default class binance extends Exchange {
|
|
|
7340
7334
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7341
7335
|
* @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)
|
|
7342
7336
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7343
|
-
* @param {boolean} [params.
|
|
7337
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders
|
|
7344
7338
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7345
7339
|
*/
|
|
7346
7340
|
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -7370,7 +7364,7 @@ export default class binance extends Exchange {
|
|
|
7370
7364
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7371
7365
|
* @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)
|
|
7372
7366
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7373
|
-
* @param {boolean} [params.
|
|
7367
|
+
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders
|
|
7374
7368
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7375
7369
|
*/
|
|
7376
7370
|
async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -7402,7 +7396,7 @@ export default class binance extends Exchange {
|
|
|
7402
7396
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
7403
7397
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7404
7398
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to cancel an order in a portfolio margin account
|
|
7405
|
-
* @param {boolean} [params.
|
|
7399
|
+
* @param {boolean} [params.trigger] set to true if you would like to cancel a portfolio margin account conditional order
|
|
7406
7400
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7407
7401
|
*/
|
|
7408
7402
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
@@ -7507,7 +7501,7 @@ export default class binance extends Exchange {
|
|
|
7507
7501
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7508
7502
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
7509
7503
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to cancel orders in a portfolio margin account
|
|
7510
|
-
* @param {boolean} [params.
|
|
7504
|
+
* @param {boolean} [params.trigger] set to true if you would like to cancel portfolio margin account conditional orders
|
|
7511
7505
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7512
7506
|
*/
|
|
7513
7507
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
@@ -11592,7 +11586,7 @@ export default class binance extends Exchange {
|
|
|
11592
11586
|
* @param {string} id the identification number of the ledger entry
|
|
11593
11587
|
* @param {string} code unified currency code
|
|
11594
11588
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11595
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
11589
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
11596
11590
|
*/
|
|
11597
11591
|
async fetchLedgerEntry(id, code = undefined, params = {}) {
|
|
11598
11592
|
await this.loadMarkets();
|
|
@@ -11639,7 +11633,7 @@ export default class binance extends Exchange {
|
|
|
11639
11633
|
* @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)
|
|
11640
11634
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the ledger for a portfolio margin account
|
|
11641
11635
|
* @param {string} [params.subType] "linear" or "inverse"
|
|
11642
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
11636
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
11643
11637
|
*/
|
|
11644
11638
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11645
11639
|
await this.loadMarkets();
|
package/js/src/bingx.d.ts
CHANGED
|
@@ -709,7 +709,7 @@ export default class bingx extends Exchange {
|
|
|
709
709
|
* @param {float} amount how much of the currency you want to trade in units of the base currency
|
|
710
710
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
711
711
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
712
|
-
* @param {string} [params.
|
|
712
|
+
* @param {string} [params.triggerPrice] Trigger price used for TAKE_STOP_LIMIT, TAKE_STOP_MARKET, TRIGGER_LIMIT, TRIGGER_MARKET order types.
|
|
713
713
|
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
|
714
714
|
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
715
715
|
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
package/js/src/bingx.js
CHANGED
|
@@ -3611,7 +3611,6 @@ export default class bingx extends Exchange {
|
|
|
3611
3611
|
'postOnly': undefined,
|
|
3612
3612
|
'side': this.parseOrderSide(side),
|
|
3613
3613
|
'price': this.safeString2(order, 'price', 'p'),
|
|
3614
|
-
'stopPrice': triggerPrice,
|
|
3615
3614
|
'triggerPrice': triggerPrice,
|
|
3616
3615
|
'stopLossPrice': stopLossPrice,
|
|
3617
3616
|
'takeProfitPrice': takeProfitPrice,
|
|
@@ -6157,7 +6156,7 @@ export default class bingx extends Exchange {
|
|
|
6157
6156
|
* @param {float} amount how much of the currency you want to trade in units of the base currency
|
|
6158
6157
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
6159
6158
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6160
|
-
* @param {string} [params.
|
|
6159
|
+
* @param {string} [params.triggerPrice] Trigger price used for TAKE_STOP_LIMIT, TAKE_STOP_MARKET, TRIGGER_LIMIT, TRIGGER_MARKET order types.
|
|
6161
6160
|
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
|
6162
6161
|
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
6163
6162
|
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
package/js/src/bit2c.js
CHANGED
package/js/src/bitbank.js
CHANGED
package/js/src/bitbns.js
CHANGED
|
@@ -567,7 +567,6 @@ export default class bitbns extends Exchange {
|
|
|
567
567
|
'postOnly': undefined,
|
|
568
568
|
'side': side,
|
|
569
569
|
'price': this.safeString(order, 'rate'),
|
|
570
|
-
'stopPrice': triggerPrice,
|
|
571
570
|
'triggerPrice': triggerPrice,
|
|
572
571
|
'amount': this.safeString(order, 'btc'),
|
|
573
572
|
'cost': undefined,
|
package/js/src/bitfinex.d.ts
CHANGED
|
@@ -148,7 +148,7 @@ export default class bitfinex extends Exchange {
|
|
|
148
148
|
* @param {float} amount the amount of currency to trade
|
|
149
149
|
* @param {float} [price] price of the order
|
|
150
150
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
151
|
-
* @param {float} [params.
|
|
151
|
+
* @param {float} [params.triggerPrice] the price that triggers a trigger order
|
|
152
152
|
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
153
153
|
* @param {boolean} [params.postOnly] set to true if you want to make a post only order
|
|
154
154
|
* @param {boolean} [params.reduceOnly] indicates that the order is to reduce the size of a position
|
|
@@ -369,7 +369,7 @@ export default class bitfinex extends Exchange {
|
|
|
369
369
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
370
370
|
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
371
371
|
* @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)
|
|
372
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
372
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
373
373
|
*/
|
|
374
374
|
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
375
375
|
/**
|
|
@@ -493,7 +493,7 @@ export default class bitfinex extends Exchange {
|
|
|
493
493
|
* @param {float} amount how much you want to trade in units of the base currency
|
|
494
494
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
495
495
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
496
|
-
* @param {float} [params.
|
|
496
|
+
* @param {float} [params.triggerPrice] the price that triggers a trigger order
|
|
497
497
|
* @param {boolean} [params.postOnly] set to true if you want to make a post only order
|
|
498
498
|
* @param {boolean} [params.reduceOnly] indicates that the order is to reduce the size of a position
|
|
499
499
|
* @param {int} [params.flags] additional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates)
|
package/js/src/bitfinex.js
CHANGED
|
@@ -1512,10 +1512,10 @@ export default class bitfinex extends Exchange {
|
|
|
1512
1512
|
}
|
|
1513
1513
|
}
|
|
1514
1514
|
let price = this.safeString(orderList, 16);
|
|
1515
|
-
let
|
|
1515
|
+
let triggerPrice = undefined;
|
|
1516
1516
|
if ((orderType === 'EXCHANGE STOP') || (orderType === 'EXCHANGE STOP LIMIT')) {
|
|
1517
1517
|
price = undefined;
|
|
1518
|
-
|
|
1518
|
+
triggerPrice = this.safeString(orderList, 16);
|
|
1519
1519
|
if (orderType === 'EXCHANGE STOP LIMIT') {
|
|
1520
1520
|
price = this.safeString(orderList, 19);
|
|
1521
1521
|
}
|
|
@@ -1541,8 +1541,7 @@ export default class bitfinex extends Exchange {
|
|
|
1541
1541
|
'postOnly': postOnly,
|
|
1542
1542
|
'side': side,
|
|
1543
1543
|
'price': price,
|
|
1544
|
-
'
|
|
1545
|
-
'triggerPrice': stopPrice,
|
|
1544
|
+
'triggerPrice': triggerPrice,
|
|
1546
1545
|
'amount': amount,
|
|
1547
1546
|
'cost': undefined,
|
|
1548
1547
|
'average': average,
|
|
@@ -1565,7 +1564,7 @@ export default class bitfinex extends Exchange {
|
|
|
1565
1564
|
* @param {float} amount how much you want to trade in units of the base currency
|
|
1566
1565
|
* @param {float} [price] the price of the order, in units of the quote currency, ignored in market orders
|
|
1567
1566
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1568
|
-
* @param {float} [params.
|
|
1567
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
1569
1568
|
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
1570
1569
|
* @param {bool} [params.postOnly]
|
|
1571
1570
|
* @param {bool} [params.reduceOnly] Ensures that the executed order does not flip the opened position.
|
|
@@ -1583,7 +1582,7 @@ export default class bitfinex extends Exchange {
|
|
|
1583
1582
|
'symbol': market['id'],
|
|
1584
1583
|
'amount': amountString,
|
|
1585
1584
|
};
|
|
1586
|
-
const
|
|
1585
|
+
const triggerPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
|
|
1587
1586
|
const trailingAmount = this.safeString(params, 'trailingAmount');
|
|
1588
1587
|
const timeInForce = this.safeString(params, 'timeInForce');
|
|
1589
1588
|
const postOnlyParam = this.safeBool(params, 'postOnly', false);
|
|
@@ -1594,9 +1593,9 @@ export default class bitfinex extends Exchange {
|
|
|
1594
1593
|
orderType = 'TRAILING STOP';
|
|
1595
1594
|
request['price_trailing'] = trailingAmount;
|
|
1596
1595
|
}
|
|
1597
|
-
else if (
|
|
1598
|
-
// request['price'] is taken as
|
|
1599
|
-
request['price'] = this.priceToPrecision(symbol,
|
|
1596
|
+
else if (triggerPrice !== undefined) {
|
|
1597
|
+
// request['price'] is taken as triggerPrice for stop orders
|
|
1598
|
+
request['price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
1600
1599
|
if (type === 'limit') {
|
|
1601
1600
|
orderType = 'STOP LIMIT';
|
|
1602
1601
|
request['price_aux_limit'] = this.priceToPrecision(symbol, price);
|
|
@@ -1614,7 +1613,7 @@ export default class bitfinex extends Exchange {
|
|
|
1614
1613
|
if ((ioc || fok) && (type === 'market')) {
|
|
1615
1614
|
throw new InvalidOrder(this.id + ' createOrder() does not allow market IOC and FOK orders');
|
|
1616
1615
|
}
|
|
1617
|
-
if ((type !== 'market') && (
|
|
1616
|
+
if ((type !== 'market') && (triggerPrice === undefined)) {
|
|
1618
1617
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
1619
1618
|
}
|
|
1620
1619
|
if (ioc) {
|
|
@@ -1658,7 +1657,7 @@ export default class bitfinex extends Exchange {
|
|
|
1658
1657
|
* @param {float} amount the amount of currency to trade
|
|
1659
1658
|
* @param {float} [price] price of the order
|
|
1660
1659
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1661
|
-
* @param {float} [params.
|
|
1660
|
+
* @param {float} [params.triggerPrice] the price that triggers a trigger order
|
|
1662
1661
|
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
1663
1662
|
* @param {boolean} [params.postOnly] set to true if you want to make a post only order
|
|
1664
1663
|
* @param {boolean} [params.reduceOnly] indicates that the order is to reduce the size of a position
|
|
@@ -2968,7 +2967,7 @@ export default class bitfinex extends Exchange {
|
|
|
2968
2967
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2969
2968
|
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
2970
2969
|
* @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)
|
|
2971
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
2970
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
2972
2971
|
*/
|
|
2973
2972
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2974
2973
|
await this.loadMarkets();
|
|
@@ -3660,7 +3659,7 @@ export default class bitfinex extends Exchange {
|
|
|
3660
3659
|
* @param {float} amount how much you want to trade in units of the base currency
|
|
3661
3660
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
3662
3661
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3663
|
-
* @param {float} [params.
|
|
3662
|
+
* @param {float} [params.triggerPrice] the price that triggers a trigger order
|
|
3664
3663
|
* @param {boolean} [params.postOnly] set to true if you want to make a post only order
|
|
3665
3664
|
* @param {boolean} [params.reduceOnly] indicates that the order is to reduce the size of a position
|
|
3666
3665
|
* @param {int} [params.flags] additional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates)
|
|
@@ -3680,7 +3679,7 @@ export default class bitfinex extends Exchange {
|
|
|
3680
3679
|
amountString = (side === 'buy') ? amountString : Precise.stringNeg(amountString);
|
|
3681
3680
|
request['amount'] = amountString;
|
|
3682
3681
|
}
|
|
3683
|
-
const
|
|
3682
|
+
const triggerPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
|
|
3684
3683
|
const trailingAmount = this.safeString(params, 'trailingAmount');
|
|
3685
3684
|
const timeInForce = this.safeString(params, 'timeInForce');
|
|
3686
3685
|
const postOnlyParam = this.safeBool(params, 'postOnly', false);
|
|
@@ -3689,15 +3688,15 @@ export default class bitfinex extends Exchange {
|
|
|
3689
3688
|
if (trailingAmount !== undefined) {
|
|
3690
3689
|
request['price_trailing'] = trailingAmount;
|
|
3691
3690
|
}
|
|
3692
|
-
else if (
|
|
3693
|
-
// request['price'] is taken as
|
|
3694
|
-
request['price'] = this.priceToPrecision(symbol,
|
|
3691
|
+
else if (triggerPrice !== undefined) {
|
|
3692
|
+
// request['price'] is taken as triggerPrice for stop orders
|
|
3693
|
+
request['price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
3695
3694
|
if (type === 'limit') {
|
|
3696
3695
|
request['price_aux_limit'] = this.priceToPrecision(symbol, price);
|
|
3697
3696
|
}
|
|
3698
3697
|
}
|
|
3699
3698
|
const postOnly = (postOnlyParam || (timeInForce === 'PO'));
|
|
3700
|
-
if ((type !== 'market') && (
|
|
3699
|
+
if ((type !== 'market') && (triggerPrice === undefined)) {
|
|
3701
3700
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
3702
3701
|
}
|
|
3703
3702
|
// flag values may be summed to combine flags
|
package/js/src/bitfinex1.js
CHANGED
|
@@ -1274,7 +1274,6 @@ export default class bitfinex1 extends Exchange {
|
|
|
1274
1274
|
'postOnly': undefined,
|
|
1275
1275
|
'side': side,
|
|
1276
1276
|
'price': this.safeString(order, 'price'),
|
|
1277
|
-
'stopPrice': undefined,
|
|
1278
1277
|
'triggerPrice': undefined,
|
|
1279
1278
|
'average': this.safeString(order, 'avg_execution_price'),
|
|
1280
1279
|
'amount': this.safeString(order, 'original_amount'),
|
package/js/src/bitflyer.js
CHANGED
package/js/src/bitget.d.ts
CHANGED
|
@@ -513,7 +513,7 @@ export default class bitget extends Exchange {
|
|
|
513
513
|
* @param {string} [params.symbol] *contract only* unified market symbol
|
|
514
514
|
* @param {string} [params.productType] *contract only* 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES'
|
|
515
515
|
* @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)
|
|
516
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
516
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
517
517
|
*/
|
|
518
518
|
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
519
519
|
parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
|
package/js/src/bitget.js
CHANGED
|
@@ -4245,7 +4245,6 @@ export default class bitget extends Exchange {
|
|
|
4245
4245
|
'timeInForce': timeInForce,
|
|
4246
4246
|
'postOnly': postOnly,
|
|
4247
4247
|
'reduceOnly': reduceOnly,
|
|
4248
|
-
'stopPrice': this.safeNumber(order, 'triggerPrice'),
|
|
4249
4248
|
'triggerPrice': this.safeNumber(order, 'triggerPrice'),
|
|
4250
4249
|
'takeProfitPrice': this.safeNumber2(order, 'presetStopSurplusPrice', 'stopSurplusTriggerPrice'),
|
|
4251
4250
|
'stopLossPrice': this.safeNumber2(order, 'presetStopLossPrice', 'stopLossTriggerPrice'),
|
|
@@ -6068,7 +6067,7 @@ export default class bitget extends Exchange {
|
|
|
6068
6067
|
* @param {string} [params.symbol] *contract only* unified market symbol
|
|
6069
6068
|
* @param {string} [params.productType] *contract only* 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES'
|
|
6070
6069
|
* @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)
|
|
6071
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
6070
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
6072
6071
|
*/
|
|
6073
6072
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6074
6073
|
await this.loadMarkets();
|
package/js/src/bithumb.js
CHANGED
package/js/src/bitmart.d.ts
CHANGED
|
@@ -274,7 +274,7 @@ export default class bitmart extends Exchange {
|
|
|
274
274
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
275
275
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
276
276
|
* @param {string} [params.clientOrderId] *spot only* the client order id of the order to cancel
|
|
277
|
-
* @param {boolean} [params.
|
|
277
|
+
* @param {boolean} [params.trigger] *swap only* whether the order is a trigger order
|
|
278
278
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
279
279
|
*/
|
|
280
280
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
|
package/js/src/bitmart.js
CHANGED
|
@@ -2559,7 +2559,6 @@ export default class bitmart extends Exchange {
|
|
|
2559
2559
|
'postOnly': postOnly,
|
|
2560
2560
|
'side': this.parseOrderSide(this.safeString(order, 'side')),
|
|
2561
2561
|
'price': this.omitZero(priceString),
|
|
2562
|
-
'stopPrice': trailingActivationPrice,
|
|
2563
2562
|
'triggerPrice': trailingActivationPrice,
|
|
2564
2563
|
'amount': this.omitZero(this.safeString(order, 'size')),
|
|
2565
2564
|
'cost': this.safeString2(order, 'filled_notional', 'filledNotional'),
|
|
@@ -3025,7 +3024,7 @@ export default class bitmart extends Exchange {
|
|
|
3025
3024
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
3026
3025
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3027
3026
|
* @param {string} [params.clientOrderId] *spot only* the client order id of the order to cancel
|
|
3028
|
-
* @param {boolean} [params.
|
|
3027
|
+
* @param {boolean} [params.trigger] *swap only* whether the order is a trigger order
|
|
3029
3028
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3030
3029
|
*/
|
|
3031
3030
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
@@ -3050,9 +3049,9 @@ export default class bitmart extends Exchange {
|
|
|
3050
3049
|
response = await this.privatePostSpotV3CancelOrder(this.extend(request, params));
|
|
3051
3050
|
}
|
|
3052
3051
|
else {
|
|
3053
|
-
const
|
|
3052
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
3054
3053
|
params = this.omit(params, ['stop', 'trigger']);
|
|
3055
|
-
if (!
|
|
3054
|
+
if (!trigger) {
|
|
3056
3055
|
response = await this.privatePostContractPrivateCancelOrder(this.extend(request, params));
|
|
3057
3056
|
}
|
|
3058
3057
|
else {
|
package/js/src/bitmex.d.ts
CHANGED
|
@@ -124,7 +124,7 @@ export default class bitmex extends Exchange {
|
|
|
124
124
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
125
125
|
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
126
126
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
127
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
127
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
128
128
|
*/
|
|
129
129
|
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
130
130
|
/**
|