ccxt 4.4.41 → 4.4.42
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 +4 -4
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +1 -1
- package/dist/cjs/src/alpaca.js +0 -1
- package/dist/cjs/src/ascendex.js +0 -1
- package/dist/cjs/src/base/Exchange.js +21 -16
- package/dist/cjs/src/bigone.js +0 -1
- package/dist/cjs/src/binance.js +3 -0
- package/dist/cjs/src/bingx.js +3 -0
- package/dist/cjs/src/bitfinex.js +123 -0
- package/dist/cjs/src/blofin.js +16 -7
- package/dist/cjs/src/cex.js +1 -1
- package/dist/cjs/src/coinbase.js +8 -9
- package/dist/cjs/src/coinbaseexchange.js +5 -6
- package/dist/cjs/src/coinbaseinternational.js +7 -8
- package/dist/cjs/src/coincatch.js +0 -1
- package/dist/cjs/src/coincheck.js +0 -1
- package/dist/cjs/src/coinex.js +91 -6
- package/dist/cjs/src/coinlist.js +3 -4
- package/dist/cjs/src/coinmate.js +1 -3
- package/dist/cjs/src/coinmetro.js +4 -5
- package/dist/cjs/src/coinone.js +0 -1
- package/dist/cjs/src/coinsph.js +7 -8
- package/dist/cjs/src/cryptocom.js +3 -0
- package/dist/cjs/src/currencycom.js +3 -4
- package/dist/cjs/src/defx.js +6 -7
- package/dist/cjs/src/deribit.js +1 -3
- package/dist/cjs/src/digifinex.js +0 -1
- package/dist/cjs/src/ellipx.js +0 -2
- package/dist/cjs/src/exmo.js +1 -2
- package/dist/cjs/src/gate.js +1 -2
- package/dist/cjs/src/gemini.js +4 -5
- package/dist/cjs/src/hashkey.js +79 -83
- package/dist/cjs/src/hitbtc.js +49 -5
- package/dist/cjs/src/hollaex.js +4 -6
- package/dist/cjs/src/htx.js +1 -3
- package/dist/cjs/src/huobijp.js +0 -1
- package/dist/cjs/src/idex.js +8 -8
- package/dist/cjs/src/independentreserve.js +0 -1
- package/dist/cjs/src/indodax.js +0 -1
- package/dist/cjs/src/kraken.js +63 -3
- package/dist/cjs/src/krakenfutures.js +75 -3
- package/dist/cjs/src/kucoin.js +1 -3
- package/dist/cjs/src/kucoinfutures.js +10 -9
- package/dist/cjs/src/kuna.js +1 -3
- package/dist/cjs/src/latoken.js +1 -3
- package/dist/cjs/src/lbank.js +0 -1
- package/dist/cjs/src/luno.js +0 -1
- package/dist/cjs/src/lykke.js +0 -1
- package/dist/cjs/src/mercado.js +0 -1
- package/dist/cjs/src/mexc.js +3 -4
- package/dist/cjs/src/ndax.js +1 -1
- package/dist/cjs/src/novadax.js +4 -6
- package/dist/cjs/src/oceanex.js +0 -1
- package/dist/cjs/src/okcoin.js +1 -3
- package/dist/cjs/src/okx.js +1 -3
- package/dist/cjs/src/onetrading.js +1 -3
- package/dist/cjs/src/p2b.js +1 -1
- package/dist/cjs/src/paradex.js +5 -7
- package/dist/cjs/src/phemex.js +8 -10
- package/dist/cjs/src/poloniex.js +1 -3
- package/dist/cjs/src/poloniexfutures.js +6 -6
- package/dist/cjs/src/probit.js +0 -1
- package/dist/cjs/src/timex.js +0 -1
- package/dist/cjs/src/tokocrypto.js +11 -14
- package/dist/cjs/src/tradeogre.js +1 -1
- package/dist/cjs/src/upbit.js +0 -1
- package/dist/cjs/src/wavesexchange.js +4 -5
- package/dist/cjs/src/whitebit.js +8 -9
- package/dist/cjs/src/woo.js +99 -13
- package/dist/cjs/src/woofipro.js +96 -15
- package/dist/cjs/src/xt.js +3 -2
- package/dist/cjs/src/yobit.js +0 -1
- package/dist/cjs/src/zaif.js +0 -1
- package/dist/cjs/src/zonda.js +1 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/binance.d.ts +3 -0
- package/js/src/abstract/binancecoinm.d.ts +3 -0
- package/js/src/abstract/binanceus.d.ts +3 -0
- package/js/src/abstract/binanceusdm.d.ts +3 -0
- package/js/src/ace.js +1 -1
- package/js/src/alpaca.js +0 -1
- package/js/src/ascendex.js +0 -1
- package/js/src/base/Exchange.d.ts +6 -6
- package/js/src/base/Exchange.js +21 -16
- package/js/src/bigone.js +0 -1
- package/js/src/binance.js +3 -0
- package/js/src/bingx.js +3 -0
- package/js/src/bitfinex.d.ts +11 -1
- package/js/src/bitfinex.js +123 -0
- package/js/src/blofin.d.ts +1 -1
- package/js/src/blofin.js +16 -7
- package/js/src/cex.js +1 -1
- package/js/src/coinbase.js +8 -9
- package/js/src/coinbaseexchange.js +5 -6
- package/js/src/coinbaseinternational.d.ts +1 -1
- package/js/src/coinbaseinternational.js +7 -8
- package/js/src/coincatch.js +0 -1
- package/js/src/coincheck.js +0 -1
- package/js/src/coinex.js +91 -6
- package/js/src/coinlist.js +3 -4
- package/js/src/coinmate.js +1 -3
- package/js/src/coinmetro.js +4 -5
- package/js/src/coinone.js +0 -1
- package/js/src/coinsph.js +7 -8
- package/js/src/cryptocom.js +3 -0
- package/js/src/currencycom.js +3 -4
- package/js/src/defx.js +6 -7
- package/js/src/deribit.js +1 -3
- package/js/src/digifinex.js +0 -1
- package/js/src/ellipx.js +0 -2
- package/js/src/exmo.d.ts +1 -1
- package/js/src/exmo.js +1 -2
- package/js/src/gate.d.ts +1 -1
- package/js/src/gate.js +1 -2
- package/js/src/gemini.js +4 -5
- package/js/src/hashkey.js +79 -83
- package/js/src/hitbtc.d.ts +11 -1
- package/js/src/hitbtc.js +49 -5
- package/js/src/hollaex.js +4 -6
- package/js/src/htx.js +1 -3
- package/js/src/huobijp.js +0 -1
- package/js/src/idex.js +8 -8
- package/js/src/independentreserve.js +0 -1
- package/js/src/indodax.js +0 -1
- package/js/src/kraken.d.ts +2 -2
- package/js/src/kraken.js +63 -3
- package/js/src/krakenfutures.d.ts +2 -2
- package/js/src/krakenfutures.js +75 -3
- package/js/src/kucoin.js +1 -3
- package/js/src/kucoinfutures.d.ts +5 -4
- package/js/src/kucoinfutures.js +10 -9
- package/js/src/kuna.js +1 -3
- package/js/src/latoken.js +1 -3
- package/js/src/lbank.js +0 -1
- package/js/src/luno.js +0 -1
- package/js/src/lykke.js +0 -1
- package/js/src/mercado.js +0 -1
- package/js/src/mexc.js +3 -4
- package/js/src/ndax.js +1 -1
- package/js/src/novadax.js +4 -6
- package/js/src/oceanex.js +0 -1
- package/js/src/okcoin.js +1 -3
- package/js/src/okx.js +1 -3
- package/js/src/onetrading.js +1 -3
- package/js/src/p2b.js +1 -1
- package/js/src/paradex.d.ts +1 -1
- package/js/src/paradex.js +5 -7
- package/js/src/phemex.js +8 -10
- package/js/src/poloniex.js +1 -3
- package/js/src/poloniexfutures.js +6 -6
- package/js/src/probit.js +0 -1
- package/js/src/timex.js +0 -1
- package/js/src/tokocrypto.js +11 -14
- package/js/src/tradeogre.js +1 -1
- package/js/src/upbit.js +0 -1
- package/js/src/wavesexchange.d.ts +1 -1
- package/js/src/wavesexchange.js +4 -5
- package/js/src/whitebit.js +8 -9
- package/js/src/woo.d.ts +1 -1
- package/js/src/woo.js +99 -13
- package/js/src/woofipro.js +96 -15
- package/js/src/xt.d.ts +2 -1
- package/js/src/xt.js +3 -2
- package/js/src/yobit.js +0 -1
- package/js/src/zaif.js +0 -1
- package/js/src/zonda.js +1 -2
- package/package.json +1 -1
|
@@ -1681,7 +1681,7 @@ export default class coinbaseinternational extends Exchange {
|
|
|
1681
1681
|
* @param {float} amount how much you want to trade in units of the base currency, quote currency for 'market' 'buy' orders
|
|
1682
1682
|
* @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders
|
|
1683
1683
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1684
|
-
* @param {float} [params.stopPrice]
|
|
1684
|
+
* @param {float} [params.stopPrice] alias for triggerPrice
|
|
1685
1685
|
* @param {float} [params.triggerPrice] price to trigger stop orders
|
|
1686
1686
|
* @param {float} [params.stopLossPrice] price to trigger stop-loss orders
|
|
1687
1687
|
* @param {bool} [params.postOnly] true or false
|
|
@@ -1694,7 +1694,7 @@ export default class coinbaseinternational extends Exchange {
|
|
|
1694
1694
|
await this.loadMarkets();
|
|
1695
1695
|
const market = this.market(symbol);
|
|
1696
1696
|
let typeId = type.toUpperCase();
|
|
1697
|
-
const
|
|
1697
|
+
const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'stop_price']);
|
|
1698
1698
|
const clientOrderIdprefix = this.safeString(this.options, 'brokerId', 'nfqkvdjp');
|
|
1699
1699
|
let clientOrderId = clientOrderIdprefix + '-' + this.uuid();
|
|
1700
1700
|
clientOrderId = clientOrderId.slice(0, 17);
|
|
@@ -1704,14 +1704,14 @@ export default class coinbaseinternational extends Exchange {
|
|
|
1704
1704
|
'instrument': market['id'],
|
|
1705
1705
|
'size': this.amountToPrecision(market['symbol'], amount),
|
|
1706
1706
|
};
|
|
1707
|
-
if (
|
|
1707
|
+
if (triggerPrice !== undefined) {
|
|
1708
1708
|
if (type === 'limit') {
|
|
1709
1709
|
typeId = 'STOP_LIMIT';
|
|
1710
1710
|
}
|
|
1711
1711
|
else {
|
|
1712
1712
|
typeId = 'STOP';
|
|
1713
1713
|
}
|
|
1714
|
-
request['stop_price'] =
|
|
1714
|
+
request['stop_price'] = triggerPrice;
|
|
1715
1715
|
}
|
|
1716
1716
|
request['type'] = typeId;
|
|
1717
1717
|
if (type === 'limit') {
|
|
@@ -1814,7 +1814,6 @@ export default class coinbaseinternational extends Exchange {
|
|
|
1814
1814
|
'postOnly': undefined,
|
|
1815
1815
|
'side': this.safeStringLower(order, 'side'),
|
|
1816
1816
|
'price': this.safeString(order, 'price'),
|
|
1817
|
-
'stopPrice': this.safeString(order, 'stop_price'),
|
|
1818
1817
|
'triggerPrice': this.safeString(order, 'stop_price'),
|
|
1819
1818
|
'amount': this.safeString(order, 'size'),
|
|
1820
1819
|
'filled': this.safeString(order, 'exec_qty'),
|
|
@@ -1956,9 +1955,9 @@ export default class coinbaseinternational extends Exchange {
|
|
|
1956
1955
|
if (price !== undefined) {
|
|
1957
1956
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
1958
1957
|
}
|
|
1959
|
-
const
|
|
1960
|
-
if (
|
|
1961
|
-
request['stop_price'] =
|
|
1958
|
+
const triggerPrice = this.safeNumberN(params, ['stopPrice', 'stop_price', 'triggerPrice']);
|
|
1959
|
+
if (triggerPrice !== undefined) {
|
|
1960
|
+
request['stop_price'] = triggerPrice;
|
|
1962
1961
|
}
|
|
1963
1962
|
const clientOrderId = this.safeString2(params, 'client_order_id', 'clientOrderId');
|
|
1964
1963
|
if (clientOrderId === undefined) {
|
package/js/src/coincatch.js
CHANGED
|
@@ -4152,7 +4152,6 @@ export default class coincatch extends Exchange {
|
|
|
4152
4152
|
'amount': amount,
|
|
4153
4153
|
'filled': this.safeString2(order, 'fillQuantity', 'filledQty'),
|
|
4154
4154
|
'remaining': undefined,
|
|
4155
|
-
'stopPrice': undefined,
|
|
4156
4155
|
'triggerPrice': triggerPrice,
|
|
4157
4156
|
'takeProfitPrice': takeProfitPrice,
|
|
4158
4157
|
'stopLossPrice': stopLossPrice,
|
package/js/src/coincheck.js
CHANGED
package/js/src/coinex.js
CHANGED
|
@@ -503,6 +503,92 @@ export default class coinex extends Exchange {
|
|
|
503
503
|
// CSC, AE, BASE, AIPG, AKASH, POLKADOTASSETHUB ?, ALEO, STX, ALGO, ALPH, BLAST, AR, ARCH, ARDR, ARK, ARRR, MANTA, NTRN, LUNA, AURORA, AVAIL, ASC20, AVA, AYA, AZERO, BAN, BAND, BB, RUNES, BEAM, BELLSCOIN, BITCI, NEAR, AGORIC, BLOCX, BNC, BOBA, BRISE, KRC20, CANTO, CAPS, CCD, CELO, CFX, CHI, CKB, CLORE, CLV, CORE, CSPR, CTXC, DAG, DCR, DERO, DESO, DEFI, DGB, DNX, DOCK, DOGECHAIN, DYDX, DYMENSION, EGLD, ELA, ELF, ENJIN, EOSIO, ERG, ETN_SC, EVMOS, EWC, SGB, FACT, FB, FET, FIO, FIRO, NEO3, FLOW, FLARE, FLUX, LINEA, FREN, FSN, FB_BRC20, GLMR, GRIN, GRS, HACASH, HBAR, HERB, HIVE, MAPO, HMND, HNS, ZKSYNC, HTR, HUAHUA, MERLIN, ICP, ICX, INJ, IOST, IOTA, IOTX, IRIS, IRON, ONE, JOYSTREAM, KAI, KAR, KAS, KAVA, KCN, KDA, KLAY, KLY, KMD, KSM, KUB, KUJIRA, LAT, LBC, LUNC, LUKSO, MARS, METIS, MINA, MANTLE, MOB, MODE, MONA, MOVR, MTL, NEOX, NEXA, NIBI, NIMIQ, NMC, ONOMY, NRG, WAVES, NULS, OAS, OCTA, OLT, ONT, OORT, ORAI, OSMO, P3D, COMPOSABLE, PIVX, RON, POKT, POLYMESH, PRE_MARKET, PYI, QKC, QTUM, QUBIC, RSK, ROSE, ROUTE, RTM, THORCHAIN, RVN, RADIANT, SAGA, SALVIUM, SATOX, SC, SCP, _NULL, SCRT, SDN, RGBPP, SELF, SMH, SPACE, STARGAZE, STC, STEEM, STRATISEVM, STRD, STARKNET, SXP, SYS, TAIKO, TAO, TARA, TENET, THETA, TT, VENOM, VECHAIN, TOMO, VITE, VLX, VSYS, VTC, WAN, WAXP, WEMIX, XCH, XDC, XEC, XELIS, NEM, XHV, XLM, XNA, NANO, XPLA, XPR, XPRT, XRD, XTZ, XVG, XYM, ZANO, ZEC, ZEN, ZEPH, ZETA
|
|
504
504
|
},
|
|
505
505
|
},
|
|
506
|
+
'features': {
|
|
507
|
+
'spot': {
|
|
508
|
+
'sandbox': false,
|
|
509
|
+
'createOrder': {
|
|
510
|
+
'marginMode': true,
|
|
511
|
+
'triggerPrice': true,
|
|
512
|
+
'triggerPriceType': undefined,
|
|
513
|
+
'triggerDirection': false,
|
|
514
|
+
'stopLossPrice': false,
|
|
515
|
+
'takeProfitPrice': false,
|
|
516
|
+
'attachedStopLossTakeProfit': undefined,
|
|
517
|
+
'timeInForce': {
|
|
518
|
+
'IOC': true,
|
|
519
|
+
'FOK': true,
|
|
520
|
+
'PO': true,
|
|
521
|
+
'GTD': false,
|
|
522
|
+
},
|
|
523
|
+
'hedged': false,
|
|
524
|
+
'trailing': false,
|
|
525
|
+
// exchange-supported features
|
|
526
|
+
// 'marketBuyRequiresPrice': true,
|
|
527
|
+
// 'marketBuyByCost': true,
|
|
528
|
+
// 'selfTradePrevention': true,
|
|
529
|
+
// 'iceberg': true,
|
|
530
|
+
},
|
|
531
|
+
'createOrders': {
|
|
532
|
+
'max': 5,
|
|
533
|
+
},
|
|
534
|
+
'fetchMyTrades': {
|
|
535
|
+
'marginMode': true,
|
|
536
|
+
'limit': 1000,
|
|
537
|
+
'daysBack': undefined,
|
|
538
|
+
'untilDays': 100000,
|
|
539
|
+
},
|
|
540
|
+
'fetchOrder': {
|
|
541
|
+
'marginMode': false,
|
|
542
|
+
'trigger': false,
|
|
543
|
+
'trailing': false,
|
|
544
|
+
},
|
|
545
|
+
'fetchOpenOrders': {
|
|
546
|
+
'marginMode': true,
|
|
547
|
+
'limit': 1000,
|
|
548
|
+
'trigger': true,
|
|
549
|
+
'trailing': false,
|
|
550
|
+
},
|
|
551
|
+
'fetchOrders': undefined,
|
|
552
|
+
'fetchClosedOrders': {
|
|
553
|
+
'marginMode': true,
|
|
554
|
+
'limit': 1000,
|
|
555
|
+
'daysBackClosed': undefined,
|
|
556
|
+
'daysBackCanceled': undefined,
|
|
557
|
+
'untilDays': undefined,
|
|
558
|
+
'trigger': true,
|
|
559
|
+
'trailing': false,
|
|
560
|
+
},
|
|
561
|
+
'fetchOHLCV': {
|
|
562
|
+
'limit': 1000,
|
|
563
|
+
},
|
|
564
|
+
},
|
|
565
|
+
'forDerivatives': {
|
|
566
|
+
'extends': 'spot',
|
|
567
|
+
'createOrder': {
|
|
568
|
+
'marginMode': true,
|
|
569
|
+
'stopLossPrice': true,
|
|
570
|
+
'takeProfitPrice': true,
|
|
571
|
+
},
|
|
572
|
+
'fetchOpenOrders': {
|
|
573
|
+
'marginMode': false,
|
|
574
|
+
},
|
|
575
|
+
'fetchClosedOrders': {
|
|
576
|
+
'marginMode': false,
|
|
577
|
+
},
|
|
578
|
+
},
|
|
579
|
+
'swap': {
|
|
580
|
+
'linear': {
|
|
581
|
+
'extends': 'forDerivatives',
|
|
582
|
+
},
|
|
583
|
+
'inverse': {
|
|
584
|
+
'extends': 'forDerivatives',
|
|
585
|
+
},
|
|
586
|
+
},
|
|
587
|
+
'future': {
|
|
588
|
+
'linear': undefined,
|
|
589
|
+
'inverse': undefined,
|
|
590
|
+
},
|
|
591
|
+
},
|
|
506
592
|
'commonCurrencies': {
|
|
507
593
|
'ACM': 'Actinium',
|
|
508
594
|
},
|
|
@@ -2007,7 +2093,6 @@ export default class coinex extends Exchange {
|
|
|
2007
2093
|
'reduceOnly': undefined,
|
|
2008
2094
|
'side': side,
|
|
2009
2095
|
'price': this.safeString(order, 'price'),
|
|
2010
|
-
'stopPrice': this.safeString(order, 'trigger_price'),
|
|
2011
2096
|
'triggerPrice': this.safeString(order, 'trigger_price'),
|
|
2012
2097
|
'takeProfitPrice': this.safeNumber(order, 'take_profit_price'),
|
|
2013
2098
|
'stopLossPrice': this.safeNumber(order, 'stop_loss_price'),
|
|
@@ -2048,7 +2133,7 @@ export default class coinex extends Exchange {
|
|
|
2048
2133
|
const market = this.market(symbol);
|
|
2049
2134
|
const swap = market['swap'];
|
|
2050
2135
|
const clientOrderId = this.safeString2(params, 'client_id', 'clientOrderId');
|
|
2051
|
-
const
|
|
2136
|
+
const triggerPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
|
|
2052
2137
|
const stopLossPrice = this.safeString(params, 'stopLossPrice');
|
|
2053
2138
|
const takeProfitPrice = this.safeString(params, 'takeProfitPrice');
|
|
2054
2139
|
const option = this.safeString(params, 'option');
|
|
@@ -2107,8 +2192,8 @@ export default class coinex extends Exchange {
|
|
|
2107
2192
|
}
|
|
2108
2193
|
else {
|
|
2109
2194
|
request['amount'] = this.amountToPrecision(symbol, amount);
|
|
2110
|
-
if (
|
|
2111
|
-
request['trigger_price'] = this.priceToPrecision(symbol,
|
|
2195
|
+
if (triggerPrice !== undefined) {
|
|
2196
|
+
request['trigger_price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
2112
2197
|
request['trigger_price_type'] = this.safeString(params, 'stop_type', 'latest_price');
|
|
2113
2198
|
}
|
|
2114
2199
|
}
|
|
@@ -2146,8 +2231,8 @@ export default class coinex extends Exchange {
|
|
|
2146
2231
|
else {
|
|
2147
2232
|
request['amount'] = this.amountToPrecision(symbol, amount);
|
|
2148
2233
|
}
|
|
2149
|
-
if (
|
|
2150
|
-
request['trigger_price'] = this.priceToPrecision(symbol,
|
|
2234
|
+
if (triggerPrice !== undefined) {
|
|
2235
|
+
request['trigger_price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
2151
2236
|
}
|
|
2152
2237
|
}
|
|
2153
2238
|
params = this.omit(params, ['reduceOnly', 'timeInForce', 'postOnly', 'stopPrice', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice']);
|
package/js/src/coinlist.js
CHANGED
|
@@ -1531,7 +1531,7 @@ export default class coinlist extends Exchange {
|
|
|
1531
1531
|
}
|
|
1532
1532
|
}
|
|
1533
1533
|
else if ((type === 'stop_market') || (type === 'stop_limit') || (type === 'take_market') || (type === 'take_limit')) {
|
|
1534
|
-
throw new ArgumentsRequired(this.id + ' createOrder() requires a
|
|
1534
|
+
throw new ArgumentsRequired(this.id + ' createOrder() requires a triggerPrice parameter for stop-loss and take-profit orders');
|
|
1535
1535
|
}
|
|
1536
1536
|
const clientOrderId = this.safeString2(params, 'clientOrderId', 'client_id');
|
|
1537
1537
|
if (clientOrderId !== undefined) {
|
|
@@ -1675,7 +1675,7 @@ export default class coinlist extends Exchange {
|
|
|
1675
1675
|
const type = this.parseOrderType(this.safeString(order, 'type'));
|
|
1676
1676
|
const side = this.safeString(order, 'side');
|
|
1677
1677
|
const price = this.safeString(order, 'price');
|
|
1678
|
-
const
|
|
1678
|
+
const triggerPrice = this.safeString(order, 'stop_price');
|
|
1679
1679
|
const average = this.safeString(order, 'average_fill_price'); // from documentation
|
|
1680
1680
|
const amount = this.safeString(order, 'size');
|
|
1681
1681
|
const filled = this.safeString(order, 'size_filled');
|
|
@@ -1701,8 +1701,7 @@ export default class coinlist extends Exchange {
|
|
|
1701
1701
|
'timeInForce': 'GTC',
|
|
1702
1702
|
'side': side,
|
|
1703
1703
|
'price': price,
|
|
1704
|
-
'
|
|
1705
|
-
'triggerPrice': stopPrice,
|
|
1704
|
+
'triggerPrice': triggerPrice,
|
|
1706
1705
|
'average': average,
|
|
1707
1706
|
'amount': amount,
|
|
1708
1707
|
'cost': undefined,
|
package/js/src/coinmate.js
CHANGED
|
@@ -948,7 +948,6 @@ export default class coinmate extends Exchange {
|
|
|
948
948
|
const marketId = this.safeString(order, 'currencyPair');
|
|
949
949
|
const symbol = this.safeSymbol(marketId, market, '_');
|
|
950
950
|
const clientOrderId = this.safeString(order, 'clientOrderId');
|
|
951
|
-
const stopPrice = this.safeNumber(order, 'stopPrice');
|
|
952
951
|
return this.safeOrder({
|
|
953
952
|
'id': id,
|
|
954
953
|
'clientOrderId': clientOrderId,
|
|
@@ -961,8 +960,7 @@ export default class coinmate extends Exchange {
|
|
|
961
960
|
'postOnly': undefined,
|
|
962
961
|
'side': side,
|
|
963
962
|
'price': priceString,
|
|
964
|
-
'
|
|
965
|
-
'triggerPrice': stopPrice,
|
|
963
|
+
'triggerPrice': this.safeNumber(order, 'stopPrice'),
|
|
966
964
|
'amount': amountString,
|
|
967
965
|
'cost': undefined,
|
|
968
966
|
'average': averageString,
|
package/js/src/coinmetro.js
CHANGED
|
@@ -1238,10 +1238,10 @@ export default class coinmetro extends Exchange {
|
|
|
1238
1238
|
params = this.omit(params, 'timeInForce');
|
|
1239
1239
|
request['timeInForce'] = this.encodeOrderTimeInForce(timeInForce);
|
|
1240
1240
|
}
|
|
1241
|
-
const
|
|
1242
|
-
if (
|
|
1241
|
+
const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
|
|
1242
|
+
if (triggerPrice !== undefined) {
|
|
1243
1243
|
params = this.omit(params, ['triggerPrice']);
|
|
1244
|
-
request['stopPrice'] = this.priceToPrecision(symbol,
|
|
1244
|
+
request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
1245
1245
|
}
|
|
1246
1246
|
const userData = this.safeValue(params, 'userData', {});
|
|
1247
1247
|
const comment = this.safeString2(params, 'clientOrderId', 'comment');
|
|
@@ -1767,7 +1767,6 @@ export default class coinmetro extends Exchange {
|
|
|
1767
1767
|
}
|
|
1768
1768
|
const trades = this.safeValue(order, 'fills', []);
|
|
1769
1769
|
const userData = this.safeValue(order, 'userData', {});
|
|
1770
|
-
const triggerPrice = this.safeString(order, 'stopPrice');
|
|
1771
1770
|
const clientOrderId = this.safeString(userData, 'comment');
|
|
1772
1771
|
const takeProfitPrice = this.safeString(userData, 'takeProfit');
|
|
1773
1772
|
const stopLossPrice = this.safeString(userData, 'stopLoss');
|
|
@@ -1783,7 +1782,7 @@ export default class coinmetro extends Exchange {
|
|
|
1783
1782
|
'timeInForce': this.parseOrderTimeInForce(this.safeInteger(order, 'timeInForce')),
|
|
1784
1783
|
'side': side,
|
|
1785
1784
|
'price': price,
|
|
1786
|
-
'triggerPrice':
|
|
1785
|
+
'triggerPrice': this.safeString(order, 'stopPrice'),
|
|
1787
1786
|
'takeProfitPrice': takeProfitPrice,
|
|
1788
1787
|
'stopLossPrice': stopLossPrice,
|
|
1789
1788
|
'average': undefined,
|
package/js/src/coinone.js
CHANGED
|
@@ -933,7 +933,6 @@ export default class coinone extends Exchange {
|
|
|
933
933
|
'postOnly': undefined,
|
|
934
934
|
'side': side,
|
|
935
935
|
'price': this.safeString(order, 'price'),
|
|
936
|
-
'stopPrice': undefined,
|
|
937
936
|
'triggerPrice': undefined,
|
|
938
937
|
'cost': undefined,
|
|
939
938
|
'average': this.safeString(order, 'averageExecutedPrice'),
|
package/js/src/coinsph.js
CHANGED
|
@@ -1176,11 +1176,11 @@ export default class coinsph extends Exchange {
|
|
|
1176
1176
|
}
|
|
1177
1177
|
}
|
|
1178
1178
|
if (orderType === 'STOP_LOSS' || orderType === 'STOP_LOSS_LIMIT' || orderType === 'TAKE_PROFIT' || orderType === 'TAKE_PROFIT_LIMIT') {
|
|
1179
|
-
const
|
|
1180
|
-
if (
|
|
1179
|
+
const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
|
|
1180
|
+
if (triggerPrice === undefined) {
|
|
1181
1181
|
throw new InvalidOrder(this.id + ' createOrder () requires a triggerPrice or stopPrice param for stop_loss, take_profit, stop_loss_limit, and take_profit_limit orders');
|
|
1182
1182
|
}
|
|
1183
|
-
request['stopPrice'] = this.priceToPrecision(symbol,
|
|
1183
|
+
request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
1184
1184
|
}
|
|
1185
1185
|
request['newOrderRespType'] = newOrderRespType;
|
|
1186
1186
|
params = this.omit(params, 'price', 'stopPrice', 'triggerPrice', 'quantity', 'quoteOrderQty');
|
|
@@ -1418,9 +1418,9 @@ export default class coinsph extends Exchange {
|
|
|
1418
1418
|
market = this.safeMarket(marketId, market);
|
|
1419
1419
|
const timestamp = this.safeInteger2(order, 'time', 'transactTime');
|
|
1420
1420
|
const trades = this.safeValue(order, 'fills', undefined);
|
|
1421
|
-
let
|
|
1422
|
-
if (Precise.stringEq(
|
|
1423
|
-
|
|
1421
|
+
let triggerPrice = this.safeString(order, 'stopPrice');
|
|
1422
|
+
if (Precise.stringEq(triggerPrice, '0')) {
|
|
1423
|
+
triggerPrice = undefined;
|
|
1424
1424
|
}
|
|
1425
1425
|
return this.safeOrder({
|
|
1426
1426
|
'id': id,
|
|
@@ -1434,8 +1434,7 @@ export default class coinsph extends Exchange {
|
|
|
1434
1434
|
'timeInForce': this.parseOrderTimeInForce(this.safeString(order, 'timeInForce')),
|
|
1435
1435
|
'side': this.parseOrderSide(this.safeString(order, 'side')),
|
|
1436
1436
|
'price': this.safeString(order, 'price'),
|
|
1437
|
-
'
|
|
1438
|
-
'triggerPrice': stopPrice,
|
|
1437
|
+
'triggerPrice': triggerPrice,
|
|
1439
1438
|
'average': undefined,
|
|
1440
1439
|
'amount': this.safeString(order, 'origQty'),
|
|
1441
1440
|
'cost': this.safeString(order, 'cummulativeQuoteQty'),
|
package/js/src/cryptocom.js
CHANGED
|
@@ -492,6 +492,9 @@ export default class cryptocom extends Exchange {
|
|
|
492
492
|
'40801': RequestTimeout,
|
|
493
493
|
'42901': RateLimitExceeded,
|
|
494
494
|
'43005': InvalidOrder,
|
|
495
|
+
'43003': InvalidOrder,
|
|
496
|
+
'43004': InvalidOrder,
|
|
497
|
+
'43012': BadRequest,
|
|
495
498
|
'50001': ExchangeError,
|
|
496
499
|
'9010001': OnMaintenance, // {"code":9010001,"message":"SYSTEM_MAINTENANCE","details":"Crypto.com Exchange is currently under maintenance. Please refer to https://status.crypto.com for more details."}
|
|
497
500
|
},
|
package/js/src/currencycom.js
CHANGED
|
@@ -1209,7 +1209,6 @@ export default class currencycom extends Exchange {
|
|
|
1209
1209
|
'timeInForce': timeInForce,
|
|
1210
1210
|
'side': side,
|
|
1211
1211
|
'price': price,
|
|
1212
|
-
'stopPrice': undefined,
|
|
1213
1212
|
'triggerPrice': undefined,
|
|
1214
1213
|
'amount': amount,
|
|
1215
1214
|
'cost': undefined,
|
|
@@ -1311,11 +1310,11 @@ export default class currencycom extends Exchange {
|
|
|
1311
1310
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
1312
1311
|
}
|
|
1313
1312
|
else if (type === 'market') {
|
|
1314
|
-
const
|
|
1313
|
+
const triggerPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
|
|
1315
1314
|
params = this.omit(params, ['triggerPrice', 'stopPrice']);
|
|
1316
|
-
if (
|
|
1315
|
+
if (triggerPrice !== undefined) {
|
|
1317
1316
|
request['type'] = 'STOP';
|
|
1318
|
-
request['price'] = this.priceToPrecision(symbol,
|
|
1317
|
+
request['price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
1319
1318
|
}
|
|
1320
1319
|
}
|
|
1321
1320
|
}
|
package/js/src/defx.js
CHANGED
|
@@ -1173,7 +1173,7 @@ export default class defx extends Exchange {
|
|
|
1173
1173
|
'type': orderType,
|
|
1174
1174
|
};
|
|
1175
1175
|
const takeProfitPrice = this.safeString(params, 'takeProfitPrice');
|
|
1176
|
-
const
|
|
1176
|
+
const triggerPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
|
|
1177
1177
|
const isMarket = orderType === 'MARKET';
|
|
1178
1178
|
const isLimit = orderType === 'LIMIT';
|
|
1179
1179
|
const timeInForce = this.safeStringUpper(params, 'timeInForce');
|
|
@@ -1193,7 +1193,7 @@ export default class defx extends Exchange {
|
|
|
1193
1193
|
if (clientOrderId !== undefined) {
|
|
1194
1194
|
request['newClientOrderId'] = clientOrderId;
|
|
1195
1195
|
}
|
|
1196
|
-
if (
|
|
1196
|
+
if (triggerPrice !== undefined || takeProfitPrice !== undefined) {
|
|
1197
1197
|
request['workingType'] = 'MARK_PRICE';
|
|
1198
1198
|
if (takeProfitPrice !== undefined) {
|
|
1199
1199
|
request['stopPrice'] = this.priceToPrecision(symbol, takeProfitPrice);
|
|
@@ -1205,7 +1205,7 @@ export default class defx extends Exchange {
|
|
|
1205
1205
|
}
|
|
1206
1206
|
}
|
|
1207
1207
|
else {
|
|
1208
|
-
request['stopPrice'] = this.priceToPrecision(symbol,
|
|
1208
|
+
request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
1209
1209
|
if (isMarket) {
|
|
1210
1210
|
request['type'] = 'STOP_MARKET';
|
|
1211
1211
|
}
|
|
@@ -1298,13 +1298,13 @@ export default class defx extends Exchange {
|
|
|
1298
1298
|
const average = this.omitZero(this.safeString(order, 'avgPrice'));
|
|
1299
1299
|
const timeInForce = this.safeStringLower(order, 'timeInForce');
|
|
1300
1300
|
let takeProfitPrice = undefined;
|
|
1301
|
-
let
|
|
1301
|
+
let triggerPrice = undefined;
|
|
1302
1302
|
if (orderType !== undefined) {
|
|
1303
1303
|
if (orderType.indexOf('take_profit') >= 0) {
|
|
1304
1304
|
takeProfitPrice = this.safeString(order, 'stopPrice');
|
|
1305
1305
|
}
|
|
1306
1306
|
else {
|
|
1307
|
-
|
|
1307
|
+
triggerPrice = this.safeString(order, 'stopPrice');
|
|
1308
1308
|
}
|
|
1309
1309
|
}
|
|
1310
1310
|
const timestamp = this.parse8601(this.safeString(order, 'createdAt'));
|
|
@@ -1324,8 +1324,7 @@ export default class defx extends Exchange {
|
|
|
1324
1324
|
'reduceOnly': this.safeBool(order, 'reduceOnly'),
|
|
1325
1325
|
'side': side,
|
|
1326
1326
|
'price': price,
|
|
1327
|
-
'
|
|
1328
|
-
'triggerPrice': stopPrice,
|
|
1327
|
+
'triggerPrice': triggerPrice,
|
|
1329
1328
|
'takeProfitPrice': takeProfitPrice,
|
|
1330
1329
|
'stopLossPrice': undefined,
|
|
1331
1330
|
'average': average,
|
package/js/src/deribit.js
CHANGED
|
@@ -1815,7 +1815,6 @@ export default class deribit extends Exchange {
|
|
|
1815
1815
|
// injected in createOrder
|
|
1816
1816
|
const trades = this.safeValue(order, 'trades');
|
|
1817
1817
|
const timeInForce = this.parseTimeInForce(this.safeString(order, 'time_in_force'));
|
|
1818
|
-
const stopPrice = this.safeValue(order, 'stop_price');
|
|
1819
1818
|
const postOnly = this.safeValue(order, 'post_only');
|
|
1820
1819
|
return this.safeOrder({
|
|
1821
1820
|
'info': order,
|
|
@@ -1830,8 +1829,7 @@ export default class deribit extends Exchange {
|
|
|
1830
1829
|
'postOnly': postOnly,
|
|
1831
1830
|
'side': side,
|
|
1832
1831
|
'price': priceString,
|
|
1833
|
-
'
|
|
1834
|
-
'triggerPrice': stopPrice,
|
|
1832
|
+
'triggerPrice': this.safeValue(order, 'stop_price'),
|
|
1835
1833
|
'amount': amount,
|
|
1836
1834
|
'cost': cost,
|
|
1837
1835
|
'average': averageString,
|
package/js/src/digifinex.js
CHANGED
|
@@ -2152,7 +2152,6 @@ export default class digifinex extends Exchange {
|
|
|
2152
2152
|
'postOnly': undefined,
|
|
2153
2153
|
'side': side,
|
|
2154
2154
|
'price': this.safeNumber(order, 'price'),
|
|
2155
|
-
'stopPrice': undefined,
|
|
2156
2155
|
'triggerPrice': undefined,
|
|
2157
2156
|
'amount': this.safeNumber2(order, 'amount', 'size'),
|
|
2158
2157
|
'filled': this.safeNumber2(order, 'executed_amount', 'filled_qty'),
|
package/js/src/ellipx.js
CHANGED
|
@@ -1301,7 +1301,6 @@ export default class ellipx extends Exchange {
|
|
|
1301
1301
|
'postOnly': postOnly,
|
|
1302
1302
|
'side': side,
|
|
1303
1303
|
'price': price,
|
|
1304
|
-
'stopPrice': undefined,
|
|
1305
1304
|
'triggerPrice': undefined,
|
|
1306
1305
|
'average': undefined,
|
|
1307
1306
|
'cost': cost,
|
|
@@ -1361,7 +1360,6 @@ export default class ellipx extends Exchange {
|
|
|
1361
1360
|
'postOnly': undefined,
|
|
1362
1361
|
'side': undefined,
|
|
1363
1362
|
'price': undefined,
|
|
1364
|
-
'stopPrice': undefined,
|
|
1365
1363
|
'triggerPrice': undefined,
|
|
1366
1364
|
'average': undefined,
|
|
1367
1365
|
'cost': undefined,
|
package/js/src/exmo.d.ts
CHANGED
|
@@ -229,7 +229,7 @@ export default class exmo extends Exchange {
|
|
|
229
229
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
230
230
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
231
231
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
232
|
-
* @param {float} [params.
|
|
232
|
+
* @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
|
|
233
233
|
* @param {string} [params.timeInForce] *spot only* 'fok', 'ioc' or 'post_only'
|
|
234
234
|
* @param {boolean} [params.postOnly] *spot only* true for post only orders
|
|
235
235
|
* @param {float} [params.cost] *spot only* *market orders only* the cost of the order in the quote currency for market orders
|
package/js/src/exmo.js
CHANGED
|
@@ -1471,7 +1471,7 @@ export default class exmo extends Exchange {
|
|
|
1471
1471
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
1472
1472
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1473
1473
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1474
|
-
* @param {float} [params.
|
|
1474
|
+
* @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
|
|
1475
1475
|
* @param {string} [params.timeInForce] *spot only* 'fok', 'ioc' or 'post_only'
|
|
1476
1476
|
* @param {boolean} [params.postOnly] *spot only* true for post only orders
|
|
1477
1477
|
* @param {float} [params.cost] *spot only* *market orders only* the cost of the order in the quote currency for market orders
|
|
@@ -2008,7 +2008,6 @@ export default class exmo extends Exchange {
|
|
|
2008
2008
|
'postOnly': undefined,
|
|
2009
2009
|
'side': side,
|
|
2010
2010
|
'price': price,
|
|
2011
|
-
'stopPrice': triggerPrice,
|
|
2012
2011
|
'triggerPrice': triggerPrice,
|
|
2013
2012
|
'cost': cost,
|
|
2014
2013
|
'amount': amount,
|
package/js/src/gate.d.ts
CHANGED
|
@@ -427,7 +427,7 @@ export default class gate extends Exchange {
|
|
|
427
427
|
* @param {float} amount the amount of currency to trade
|
|
428
428
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
429
429
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
430
|
-
* @param {float} [params.
|
|
430
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
431
431
|
* @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
|
|
432
432
|
* @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
|
|
433
433
|
* @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
|
package/js/src/gate.js
CHANGED
|
@@ -4085,7 +4085,7 @@ export default class gate extends Exchange {
|
|
|
4085
4085
|
* @param {float} amount the amount of currency to trade
|
|
4086
4086
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
4087
4087
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4088
|
-
* @param {float} [params.
|
|
4088
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
4089
4089
|
* @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
|
|
4090
4090
|
* @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
|
|
4091
4091
|
* @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
|
|
@@ -4925,7 +4925,6 @@ export default class gate extends Exchange {
|
|
|
4925
4925
|
'reduceOnly': this.safeValue(order, 'is_reduce_only'),
|
|
4926
4926
|
'side': side,
|
|
4927
4927
|
'price': price,
|
|
4928
|
-
'stopPrice': triggerPrice,
|
|
4929
4928
|
'triggerPrice': triggerPrice,
|
|
4930
4929
|
'average': average,
|
|
4931
4930
|
'amount': Precise.stringAbs(amount),
|
package/js/src/gemini.js
CHANGED
|
@@ -1347,7 +1347,6 @@ export default class gemini extends Exchange {
|
|
|
1347
1347
|
'postOnly': postOnly,
|
|
1348
1348
|
'side': side,
|
|
1349
1349
|
'price': price,
|
|
1350
|
-
'stopPrice': undefined,
|
|
1351
1350
|
'triggerPrice': undefined,
|
|
1352
1351
|
'average': average,
|
|
1353
1352
|
'cost': undefined,
|
|
@@ -1481,13 +1480,13 @@ export default class gemini extends Exchange {
|
|
|
1481
1480
|
};
|
|
1482
1481
|
type = this.safeString(params, 'type', type);
|
|
1483
1482
|
params = this.omit(params, 'type');
|
|
1484
|
-
const
|
|
1483
|
+
const triggerPrice = this.safeStringN(params, ['stop_price', 'stopPrice']);
|
|
1485
1484
|
params = this.omit(params, ['stop_price', 'stopPrice', 'type']);
|
|
1486
1485
|
if (type === 'stopLimit') {
|
|
1487
|
-
throw new ArgumentsRequired(this.id + ' createOrder() requires a
|
|
1486
|
+
throw new ArgumentsRequired(this.id + ' createOrder() requires a triggerPrice parameter or a stop_price parameter for ' + type + ' orders');
|
|
1488
1487
|
}
|
|
1489
|
-
if (
|
|
1490
|
-
request['stop_price'] = this.priceToPrecision(symbol,
|
|
1488
|
+
if (triggerPrice !== undefined) {
|
|
1489
|
+
request['stop_price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
1491
1490
|
request['type'] = 'exchange stop limit';
|
|
1492
1491
|
}
|
|
1493
1492
|
else {
|