ccxt 4.1.55 → 4.1.57
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/.git-templates/hooks/pre-push +2 -2
- package/CONTRIBUTING.md +1 -1
- package/README.md +6 -6
- package/build.sh +30 -8
- package/dist/ccxt.browser.js +5592 -4907
- package/dist/ccxt.browser.min.js +13 -13
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +17 -13
- package/dist/cjs/src/alpaca.js +6 -6
- package/dist/cjs/src/ascendex.js +35 -29
- package/dist/cjs/src/base/Exchange.js +39 -26
- package/dist/cjs/src/base/Precise.js +1 -3
- package/dist/cjs/src/bigone.js +24 -20
- package/dist/cjs/src/binance.js +97 -76
- package/dist/cjs/src/bingx.js +63 -44
- package/dist/cjs/src/bit2c.js +18 -15
- package/dist/cjs/src/bitbank.js +17 -15
- package/dist/cjs/src/bitbns.js +28 -18
- package/dist/cjs/src/bitfinex.js +23 -21
- package/dist/cjs/src/bitfinex2.js +32 -28
- package/dist/cjs/src/bitflyer.js +28 -20
- package/dist/cjs/src/bitforex.js +25 -18
- package/dist/cjs/src/bitget.js +184 -147
- package/dist/cjs/src/bithumb.js +23 -16
- package/dist/cjs/src/bitmart.js +129 -94
- package/dist/cjs/src/bitmex.js +104 -64
- package/dist/cjs/src/bitopro.js +38 -26
- package/dist/cjs/src/bitpanda.js +24 -23
- package/dist/cjs/src/bitrue.js +33 -24
- package/dist/cjs/src/bitso.js +24 -23
- package/dist/cjs/src/bitstamp.js +24 -23
- package/dist/cjs/src/bittrex.js +30 -29
- package/dist/cjs/src/bitvavo.js +38 -30
- package/dist/cjs/src/bl3p.js +11 -10
- package/dist/cjs/src/blockchaincom.js +20 -20
- package/dist/cjs/src/btcalpha.js +18 -17
- package/dist/cjs/src/btcbox.js +13 -12
- package/dist/cjs/src/btcmarkets.js +20 -19
- package/dist/cjs/src/btcturk.js +14 -13
- package/dist/cjs/src/bybit.js +84 -54
- package/dist/cjs/src/cex.js +16 -14
- package/dist/cjs/src/coinbase.js +29 -27
- package/dist/cjs/src/coinbasepro.js +27 -25
- package/dist/cjs/src/coincheck.js +15 -14
- package/dist/cjs/src/coinex.js +101 -78
- package/dist/cjs/src/coinlist.js +28 -27
- package/dist/cjs/src/coinmate.js +20 -17
- package/dist/cjs/src/coinone.js +21 -16
- package/dist/cjs/src/coinsph.js +37 -28
- package/dist/cjs/src/coinspot.js +12 -11
- package/dist/cjs/src/cryptocom.js +40 -202
- package/dist/cjs/src/currencycom.js +32 -25
- package/dist/cjs/src/delta.js +34 -28
- package/dist/cjs/src/deribit.js +39 -36
- package/dist/cjs/src/digifinex.js +64 -44
- package/dist/cjs/src/exmo.js +29 -27
- package/dist/cjs/src/gate.js +67 -53
- package/dist/cjs/src/gemini.js +23 -20
- package/dist/cjs/src/hitbtc.js +65 -56
- package/dist/cjs/src/hollaex.js +30 -27
- package/dist/cjs/src/htx.js +135 -143
- package/dist/cjs/src/huobijp.js +22 -20
- package/dist/cjs/src/idex.js +22 -21
- package/dist/cjs/src/independentreserve.js +15 -14
- package/dist/cjs/src/indodax.js +30 -26
- package/dist/cjs/src/kraken.js +29 -27
- package/dist/cjs/src/krakenfutures.js +29 -22
- package/dist/cjs/src/kucoin.js +48 -43
- package/dist/cjs/src/kucoinfutures.js +33 -28
- package/dist/cjs/src/kuna.js +25 -24
- package/dist/cjs/src/latoken.js +24 -22
- package/dist/cjs/src/lbank.js +45 -30
- package/dist/cjs/src/luno.js +22 -19
- package/dist/cjs/src/lykke.js +19 -17
- package/dist/cjs/src/mercado.js +30 -19
- package/dist/cjs/src/mexc.js +60 -49
- package/dist/cjs/src/ndax.js +23 -22
- package/dist/cjs/src/novadax.js +23 -22
- package/dist/cjs/src/oceanex.js +22 -19
- package/dist/cjs/src/okcoin.js +29 -23
- package/dist/cjs/src/okx.js +92 -84
- package/dist/cjs/src/p2b.js +80 -83
- package/dist/cjs/src/paymium.js +10 -10
- package/dist/cjs/src/phemex.js +63 -40
- package/dist/cjs/src/poloniex.js +22 -22
- package/dist/cjs/src/poloniexfutures.js +23 -19
- package/dist/cjs/src/pro/alpaca.js +5 -5
- package/dist/cjs/src/pro/ascendex.js +4 -4
- package/dist/cjs/src/pro/binance.js +16 -16
- package/dist/cjs/src/pro/bingx.js +1 -1
- package/dist/cjs/src/pro/bitfinex.js +4 -4
- package/dist/cjs/src/pro/bitfinex2.js +6 -6
- package/dist/cjs/src/pro/bitget.js +7 -7
- package/dist/cjs/src/pro/bitmart.js +7 -5
- package/dist/cjs/src/pro/bitmex.js +6 -6
- package/dist/cjs/src/pro/bitopro.js +4 -4
- package/dist/cjs/src/pro/bitpanda.js +6 -6
- package/dist/cjs/src/pro/bitrue.js +2 -2
- package/dist/cjs/src/pro/bitstamp.js +6 -4
- package/dist/cjs/src/pro/bittrex.js +6 -6
- package/dist/cjs/src/pro/bitvavo.js +11 -7
- package/dist/cjs/src/pro/blockchaincom.js +8 -8
- package/dist/cjs/src/pro/bybit.js +7 -7
- package/dist/cjs/src/pro/cex.js +13 -9
- package/dist/cjs/src/pro/coinbase.js +5 -5
- package/dist/cjs/src/pro/coinbasepro.js +11 -10
- package/dist/cjs/src/pro/coinex.js +7 -9
- package/dist/cjs/src/pro/cryptocom.js +9 -9
- package/dist/cjs/src/pro/currencycom.js +4 -4
- package/dist/cjs/src/pro/deribit.js +6 -6
- package/dist/cjs/src/pro/exmo.js +12 -14
- package/dist/cjs/src/pro/gate.js +7 -7
- package/dist/cjs/src/pro/gemini.js +3 -3
- package/dist/cjs/src/pro/hitbtc.js +263 -4
- package/dist/cjs/src/pro/hollaex.js +5 -5
- package/dist/cjs/src/pro/htx.js +6 -6
- package/dist/cjs/src/pro/huobijp.js +3 -3
- package/dist/cjs/src/pro/idex.js +4 -4
- package/dist/cjs/src/pro/independentreserve.js +2 -2
- package/dist/cjs/src/pro/kraken.js +10 -10
- package/dist/cjs/src/pro/krakenfutures.js +41 -17
- package/dist/cjs/src/pro/kucoin.js +7 -7
- package/dist/cjs/src/pro/kucoinfutures.js +8 -6
- package/dist/cjs/src/pro/luno.js +2 -2
- package/dist/cjs/src/pro/mexc.js +6 -6
- package/dist/cjs/src/pro/ndax.js +3 -3
- package/dist/cjs/src/pro/okcoin.js +5 -5
- package/dist/cjs/src/pro/okx.js +12 -12
- package/dist/cjs/src/pro/phemex.js +6 -6
- package/dist/cjs/src/pro/poloniex.js +7 -7
- package/dist/cjs/src/pro/poloniexfutures.js +5 -5
- package/dist/cjs/src/pro/probit.js +6 -6
- package/dist/cjs/src/pro/upbit.js +3 -3
- package/dist/cjs/src/pro/wazirx.js +8 -8
- package/dist/cjs/src/pro/whitebit.js +12 -8
- package/dist/cjs/src/pro/woo.js +1 -1
- package/dist/cjs/src/probit.js +28 -23
- package/dist/cjs/src/tidex.js +16 -15
- package/dist/cjs/src/timex.js +19 -18
- package/dist/cjs/src/tokocrypto.js +27 -22
- package/dist/cjs/src/upbit.js +19 -19
- package/dist/cjs/src/wavesexchange.js +22 -19
- package/dist/cjs/src/wazirx.js +24 -17
- package/dist/cjs/src/whitebit.js +33 -27
- package/dist/cjs/src/woo.js +44 -34
- package/dist/cjs/src/yobit.js +25 -20
- package/dist/cjs/src/zaif.js +9 -9
- package/dist/cjs/src/zonda.js +18 -17
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitbank.d.ts +1 -0
- package/js/src/abstract/bybit.d.ts +1 -0
- package/js/src/abstract/cryptocom.d.ts +0 -20
- package/js/src/abstract/htx.d.ts +3 -0
- package/js/src/abstract/huobi.d.ts +3 -0
- package/js/src/abstract/huobipro.d.ts +3 -0
- package/js/src/abstract/okex.d.ts +3 -1
- package/js/src/abstract/okex5.d.ts +3 -1
- package/js/src/abstract/okx.d.ts +3 -1
- package/js/src/ace.js +18 -14
- package/js/src/alpaca.js +6 -6
- package/js/src/ascendex.js +35 -29
- package/js/src/base/Exchange.d.ts +37 -34
- package/js/src/base/Exchange.js +39 -26
- package/js/src/base/Precise.d.ts +4 -4
- package/js/src/base/Precise.js +1 -3
- package/js/src/base/functions/type.d.ts +25 -25
- package/js/src/base/types.d.ts +21 -14
- package/js/src/bigone.js +25 -21
- package/js/src/binance.d.ts +2 -2
- package/js/src/binance.js +97 -76
- package/js/src/bingx.js +63 -44
- package/js/src/bit2c.js +19 -16
- package/js/src/bitbank.js +17 -15
- package/js/src/bitbns.js +28 -18
- package/js/src/bitfinex.js +23 -21
- package/js/src/bitfinex2.js +32 -28
- package/js/src/bitflyer.js +28 -20
- package/js/src/bitforex.js +26 -19
- package/js/src/bitget.d.ts +25 -3
- package/js/src/bitget.js +184 -147
- package/js/src/bithumb.js +23 -16
- package/js/src/bitmart.d.ts +1 -1
- package/js/src/bitmart.js +129 -94
- package/js/src/bitmex.d.ts +2 -2
- package/js/src/bitmex.js +104 -64
- package/js/src/bitopro.js +38 -26
- package/js/src/bitpanda.js +24 -23
- package/js/src/bitrue.js +33 -24
- package/js/src/bitso.js +24 -23
- package/js/src/bitstamp.d.ts +2 -2
- package/js/src/bitstamp.js +24 -23
- package/js/src/bittrex.js +30 -29
- package/js/src/bitvavo.js +38 -30
- package/js/src/bl3p.js +11 -10
- package/js/src/blockchaincom.js +20 -20
- package/js/src/btcalpha.js +18 -17
- package/js/src/btcbox.js +13 -12
- package/js/src/btcmarkets.js +20 -19
- package/js/src/btcturk.js +14 -13
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +84 -54
- package/js/src/cex.js +16 -14
- package/js/src/coinbase.js +29 -27
- package/js/src/coinbasepro.js +27 -25
- package/js/src/coincheck.js +15 -14
- package/js/src/coinex.d.ts +1 -1
- package/js/src/coinex.js +101 -78
- package/js/src/coinlist.js +28 -27
- package/js/src/coinmate.js +21 -18
- package/js/src/coinone.js +21 -16
- package/js/src/coinsph.js +37 -28
- package/js/src/coinspot.js +12 -11
- package/js/src/cryptocom.d.ts +0 -23
- package/js/src/cryptocom.js +40 -202
- package/js/src/currencycom.js +32 -25
- package/js/src/delta.js +35 -29
- package/js/src/deribit.js +39 -36
- package/js/src/digifinex.d.ts +2 -2
- package/js/src/digifinex.js +65 -45
- package/js/src/exmo.js +29 -27
- package/js/src/gate.d.ts +1 -1
- package/js/src/gate.js +67 -53
- package/js/src/gemini.js +23 -20
- package/js/src/hitbtc.d.ts +1 -0
- package/js/src/hitbtc.js +65 -56
- package/js/src/hollaex.js +30 -27
- package/js/src/htx.d.ts +11 -3
- package/js/src/htx.js +135 -143
- package/js/src/huobijp.js +23 -21
- package/js/src/idex.js +22 -21
- package/js/src/independentreserve.js +15 -14
- package/js/src/indodax.js +30 -26
- package/js/src/kraken.js +29 -27
- package/js/src/krakenfutures.js +29 -22
- package/js/src/kucoin.d.ts +1 -1
- package/js/src/kucoin.js +48 -43
- package/js/src/kucoinfutures.js +33 -28
- package/js/src/kuna.js +25 -24
- package/js/src/latoken.js +25 -23
- package/js/src/lbank.js +46 -31
- package/js/src/luno.js +22 -19
- package/js/src/lykke.js +19 -17
- package/js/src/mercado.js +30 -19
- package/js/src/mexc.d.ts +1 -1
- package/js/src/mexc.js +60 -49
- package/js/src/ndax.js +23 -22
- package/js/src/novadax.js +23 -22
- package/js/src/oceanex.js +22 -19
- package/js/src/okcoin.js +29 -23
- package/js/src/okx.d.ts +2 -2
- package/js/src/okx.js +92 -84
- package/js/src/p2b.d.ts +8 -7
- package/js/src/p2b.js +80 -82
- package/js/src/paymium.js +10 -10
- package/js/src/phemex.js +63 -40
- package/js/src/poloniex.js +22 -22
- package/js/src/poloniexfutures.js +23 -19
- package/js/src/pro/alpaca.js +5 -5
- package/js/src/pro/ascendex.js +4 -4
- package/js/src/pro/binance.js +16 -16
- package/js/src/pro/bingx.js +1 -1
- package/js/src/pro/bitfinex.js +4 -4
- package/js/src/pro/bitfinex2.d.ts +1 -1
- package/js/src/pro/bitfinex2.js +6 -6
- package/js/src/pro/bitget.js +7 -7
- package/js/src/pro/bitmart.js +7 -5
- package/js/src/pro/bitmex.js +6 -6
- package/js/src/pro/bitopro.js +4 -4
- package/js/src/pro/bitpanda.js +6 -6
- package/js/src/pro/bitrue.js +2 -2
- package/js/src/pro/bitstamp.js +7 -5
- package/js/src/pro/bittrex.js +6 -6
- package/js/src/pro/bitvavo.js +12 -8
- package/js/src/pro/blockchaincom.js +8 -8
- package/js/src/pro/bybit.js +7 -7
- package/js/src/pro/cex.js +14 -10
- package/js/src/pro/coinbase.js +5 -5
- package/js/src/pro/coinbasepro.js +12 -11
- package/js/src/pro/coinex.js +7 -9
- package/js/src/pro/cryptocom.js +9 -9
- package/js/src/pro/currencycom.js +4 -4
- package/js/src/pro/deribit.js +6 -6
- package/js/src/pro/exmo.js +12 -14
- package/js/src/pro/gate.js +7 -7
- package/js/src/pro/gemini.js +3 -3
- package/js/src/pro/hitbtc.d.ts +8 -1
- package/js/src/pro/hitbtc.js +264 -5
- package/js/src/pro/hollaex.js +5 -5
- package/js/src/pro/htx.js +6 -6
- package/js/src/pro/huobijp.js +3 -3
- package/js/src/pro/idex.js +4 -4
- package/js/src/pro/independentreserve.js +2 -2
- package/js/src/pro/kraken.js +10 -10
- package/js/src/pro/krakenfutures.d.ts +1 -0
- package/js/src/pro/krakenfutures.js +42 -18
- package/js/src/pro/kucoin.js +7 -7
- package/js/src/pro/kucoinfutures.js +8 -6
- package/js/src/pro/luno.js +2 -2
- package/js/src/pro/mexc.js +6 -6
- package/js/src/pro/ndax.js +3 -3
- package/js/src/pro/okcoin.js +5 -5
- package/js/src/pro/okx.js +12 -12
- package/js/src/pro/phemex.js +6 -6
- package/js/src/pro/poloniex.js +7 -7
- package/js/src/pro/poloniexfutures.js +5 -5
- package/js/src/pro/probit.js +6 -6
- package/js/src/pro/upbit.js +3 -3
- package/js/src/pro/wazirx.js +8 -8
- package/js/src/pro/whitebit.js +13 -9
- package/js/src/pro/woo.js +1 -1
- package/js/src/probit.js +29 -24
- package/js/src/tidex.js +16 -15
- package/js/src/timex.js +19 -18
- package/js/src/tokocrypto.js +28 -23
- package/js/src/upbit.js +19 -19
- package/js/src/wavesexchange.js +23 -20
- package/js/src/wazirx.js +25 -18
- package/js/src/whitebit.js +33 -27
- package/js/src/woo.js +45 -35
- package/js/src/yobit.js +25 -20
- package/js/src/zaif.js +9 -9
- package/js/src/zonda.js +18 -17
- package/package.json +2 -2
- package/js/src/bitstamp1.d.ts +0 -28
- package/js/src/bitstamp1.js +0 -430
- package/js/src/lbank2.d.ts +0 -90
- package/js/src/lbank2.js +0 -2779
package/js/src/pro/hitbtc.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import hitbtcRest from '../hitbtc.js';
|
|
9
9
|
import { ArrayCache, ArrayCacheBySymbolById, ArrayCacheByTimestamp } from '../base/ws/Cache.js';
|
|
10
10
|
import { sha256 } from '../static_dependencies/noble-hashes/sha256.js';
|
|
11
|
-
import { AuthenticationError } from '../base/errors.js';
|
|
11
|
+
import { AuthenticationError, ExchangeError, NotSupported } from '../base/errors.js';
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
13
13
|
export default class hitbtc extends hitbtcRest {
|
|
14
14
|
describe() {
|
|
@@ -23,6 +23,10 @@ export default class hitbtc extends hitbtcRest {
|
|
|
23
23
|
'watchOrders': true,
|
|
24
24
|
'watchOHLCV': true,
|
|
25
25
|
'watchMyTrades': false,
|
|
26
|
+
'createOrderWs': true,
|
|
27
|
+
'cancelOrderWs': true,
|
|
28
|
+
'fetchOpenOrdersWs': true,
|
|
29
|
+
'cancelAllOrdersWs': true,
|
|
26
30
|
},
|
|
27
31
|
'urls': {
|
|
28
32
|
'api': {
|
|
@@ -153,6 +157,25 @@ export default class hitbtc extends hitbtcRest {
|
|
|
153
157
|
};
|
|
154
158
|
return await this.watch(url, messageHash, subscribe, messageHash);
|
|
155
159
|
}
|
|
160
|
+
async tradeRequest(name, params = {}) {
|
|
161
|
+
/**
|
|
162
|
+
* @ignore
|
|
163
|
+
* @method
|
|
164
|
+
* @param {string} name websocket endpoint name
|
|
165
|
+
* @param {string} [symbol] unified CCXT symbol
|
|
166
|
+
* @param {object} [params] extra parameters specific to the hitbtc api
|
|
167
|
+
*/
|
|
168
|
+
await this.loadMarkets();
|
|
169
|
+
await this.authenticate();
|
|
170
|
+
const url = this.urls['api']['ws']['private'];
|
|
171
|
+
const messageHash = this.nonce();
|
|
172
|
+
const subscribe = {
|
|
173
|
+
'method': name,
|
|
174
|
+
'params': params,
|
|
175
|
+
'id': messageHash,
|
|
176
|
+
};
|
|
177
|
+
return await this.watch(url, messageHash, subscribe, messageHash);
|
|
178
|
+
}
|
|
156
179
|
async watchOrderBook(symbol, limit = undefined, params = {}) {
|
|
157
180
|
/**
|
|
158
181
|
* @method
|
|
@@ -462,7 +485,7 @@ export default class hitbtc extends hitbtcRest {
|
|
|
462
485
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
463
486
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
464
487
|
* @param {object} [params] extra parameters specific to the hitbtc api endpoint
|
|
465
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
488
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
466
489
|
*/
|
|
467
490
|
await this.loadMarkets();
|
|
468
491
|
const market = this.market(symbol);
|
|
@@ -898,6 +921,15 @@ export default class hitbtc extends hitbtcRest {
|
|
|
898
921
|
const trade = this.parseWsOrderTrade(order, market);
|
|
899
922
|
trades = [trade];
|
|
900
923
|
}
|
|
924
|
+
const rawStatus = this.safeString(order, 'status');
|
|
925
|
+
const report_type = this.safeString(order, 'report_type');
|
|
926
|
+
let parsedStatus = undefined;
|
|
927
|
+
if (report_type === 'canceled') {
|
|
928
|
+
parsedStatus = this.parseOrderStatus(report_type);
|
|
929
|
+
}
|
|
930
|
+
else {
|
|
931
|
+
parsedStatus = this.parseOrderStatus(rawStatus);
|
|
932
|
+
}
|
|
901
933
|
return this.safeOrder({
|
|
902
934
|
'info': order,
|
|
903
935
|
'id': this.safeString(order, 'id'),
|
|
@@ -916,7 +948,7 @@ export default class hitbtc extends hitbtcRest {
|
|
|
916
948
|
'filled': undefined,
|
|
917
949
|
'remaining': undefined,
|
|
918
950
|
'cost': undefined,
|
|
919
|
-
'status':
|
|
951
|
+
'status': parsedStatus,
|
|
920
952
|
'average': undefined,
|
|
921
953
|
'trades': trades,
|
|
922
954
|
'fee': undefined,
|
|
@@ -951,6 +983,152 @@ export default class hitbtc extends hitbtcRest {
|
|
|
951
983
|
};
|
|
952
984
|
return await this.subscribePrivate(name, undefined, this.extend(request, params));
|
|
953
985
|
}
|
|
986
|
+
async createOrderWs(symbol, type, side, amount, price = undefined, params = {}) {
|
|
987
|
+
/**
|
|
988
|
+
* @method
|
|
989
|
+
* @name hitbtc#createOrder
|
|
990
|
+
* @description create a trade order
|
|
991
|
+
* @see https://api.hitbtc.com/#create-new-spot-order
|
|
992
|
+
* @see https://api.hitbtc.com/#create-margin-order
|
|
993
|
+
* @see https://api.hitbtc.com/#create-futures-order
|
|
994
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
995
|
+
* @param {string} type 'market' or 'limit'
|
|
996
|
+
* @param {string} side 'buy' or 'sell'
|
|
997
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
998
|
+
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
999
|
+
* @param {object} [params] extra parameters specific to the hitbtc api endpoint
|
|
1000
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported for spot-margin, swap supports both, default is 'cross'
|
|
1001
|
+
* @param {bool} [params.margin] true for creating a margin order
|
|
1002
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
1003
|
+
* @param {bool} [params.postOnly] if true, the order will only be posted to the order book and not executed immediately
|
|
1004
|
+
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", "Day", "GTD"
|
|
1005
|
+
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1006
|
+
*/
|
|
1007
|
+
await this.loadMarkets();
|
|
1008
|
+
const market = this.market(symbol);
|
|
1009
|
+
let request = undefined;
|
|
1010
|
+
let marketType = undefined;
|
|
1011
|
+
[marketType, params] = this.handleMarketTypeAndParams('createOrder', market, params);
|
|
1012
|
+
let marginMode = undefined;
|
|
1013
|
+
[marginMode, params] = this.handleMarginModeAndParams('createOrder', params);
|
|
1014
|
+
[request, params] = this.createOrderRequest(market, marketType, type, side, amount, price, marginMode, params);
|
|
1015
|
+
request = this.extend(request, params);
|
|
1016
|
+
if (marketType === 'swap') {
|
|
1017
|
+
return await this.tradeRequest('futures_new_order', request);
|
|
1018
|
+
}
|
|
1019
|
+
else if ((marketType === 'margin') || (marginMode !== undefined)) {
|
|
1020
|
+
return await this.tradeRequest('margin_new_order', request);
|
|
1021
|
+
}
|
|
1022
|
+
else {
|
|
1023
|
+
return await this.tradeRequest('spot_new_order', request);
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
async cancelOrderWs(id, symbol = undefined, params = {}) {
|
|
1027
|
+
/**
|
|
1028
|
+
* @method
|
|
1029
|
+
* @name hitbtc#cancelOrderWs
|
|
1030
|
+
* @see https://api.hitbtc.com/#cancel-spot-order-2
|
|
1031
|
+
* @see https://api.hitbtc.com/#cancel-futures-order-2
|
|
1032
|
+
* @see https://api.hitbtc.com/#cancel-margin-order-2
|
|
1033
|
+
* @description cancels an open order
|
|
1034
|
+
* @param {string} id order id
|
|
1035
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
1036
|
+
* @param {object} [params] extra parameters specific to the hitbtc api endpoint
|
|
1037
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported
|
|
1038
|
+
* @param {bool} [params.margin] true for canceling a margin order
|
|
1039
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1040
|
+
*/
|
|
1041
|
+
await this.loadMarkets();
|
|
1042
|
+
let market = undefined;
|
|
1043
|
+
let request = {
|
|
1044
|
+
'client_order_id': id,
|
|
1045
|
+
};
|
|
1046
|
+
if (symbol !== undefined) {
|
|
1047
|
+
market = this.market(symbol);
|
|
1048
|
+
}
|
|
1049
|
+
let marketType = undefined;
|
|
1050
|
+
[marketType, params] = this.handleMarketTypeAndParams('cancelOrderWs', market, params);
|
|
1051
|
+
const [marginMode, query] = this.handleMarginModeAndParams('cancelOrderWs', params);
|
|
1052
|
+
request = this.extend(request, query);
|
|
1053
|
+
if (marketType === 'swap') {
|
|
1054
|
+
return await this.tradeRequest('futures_cancel_order', request);
|
|
1055
|
+
}
|
|
1056
|
+
else if ((marketType === 'margin') || (marginMode !== undefined)) {
|
|
1057
|
+
return await this.tradeRequest('margin_cancel_order', request);
|
|
1058
|
+
}
|
|
1059
|
+
else {
|
|
1060
|
+
return await this.tradeRequest('spot_cancel_order', request);
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
async cancelAllOrdersWs(symbol = undefined, params = {}) {
|
|
1064
|
+
/**
|
|
1065
|
+
* @method
|
|
1066
|
+
* @name hitbtc#cancelAllOrdersWs
|
|
1067
|
+
* @see https://api.hitbtc.com/#cancel-spot-orders
|
|
1068
|
+
* @see https://api.hitbtc.com/#cancel-futures-order-3
|
|
1069
|
+
* @description cancel all open orders
|
|
1070
|
+
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
1071
|
+
* @param {object} [params] extra parameters specific to the hitbtc api endpoint
|
|
1072
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported
|
|
1073
|
+
* @param {bool} [params.margin] true for canceling margin orders
|
|
1074
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1075
|
+
*/
|
|
1076
|
+
await this.loadMarkets();
|
|
1077
|
+
let market = undefined;
|
|
1078
|
+
if (symbol !== undefined) {
|
|
1079
|
+
market = this.market(symbol);
|
|
1080
|
+
}
|
|
1081
|
+
let marketType = undefined;
|
|
1082
|
+
[marketType, params] = this.handleMarketTypeAndParams('cancelAllOrdersWs', market, params);
|
|
1083
|
+
let marginMode = undefined;
|
|
1084
|
+
[marginMode, params] = this.handleMarginModeAndParams('cancelAllOrdersWs', params);
|
|
1085
|
+
if (marketType === 'swap') {
|
|
1086
|
+
return await this.tradeRequest('futures_cancel_orders', params);
|
|
1087
|
+
}
|
|
1088
|
+
else if ((marketType === 'margin') || (marginMode !== undefined)) {
|
|
1089
|
+
throw new NotSupported(this.id + ' cancelAllOrdersWs is not supported for margin orders');
|
|
1090
|
+
}
|
|
1091
|
+
else {
|
|
1092
|
+
return await this.tradeRequest('spot_cancel_orders', params);
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
async fetchOpenOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1096
|
+
/**
|
|
1097
|
+
* @method
|
|
1098
|
+
* @name hitbtc#fetchOpenOrdersWs
|
|
1099
|
+
* @see https://api.hitbtc.com/#get-active-futures-orders-2
|
|
1100
|
+
* @see https://api.hitbtc.com/#get-margin-orders
|
|
1101
|
+
* @see https://api.hitbtc.com/#get-active-spot-orders
|
|
1102
|
+
* @description fetch all unfilled currently open orders
|
|
1103
|
+
* @param {string} symbol unified market symbol
|
|
1104
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1105
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1106
|
+
* @param {object} [params] extra parameters specific to the hitbtc api endpoint
|
|
1107
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported
|
|
1108
|
+
* @param {bool} [params.margin] true for fetching open margin orders
|
|
1109
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1110
|
+
*/
|
|
1111
|
+
await this.loadMarkets();
|
|
1112
|
+
let market = undefined;
|
|
1113
|
+
const request = {};
|
|
1114
|
+
if (symbol !== undefined) {
|
|
1115
|
+
market = this.market(symbol);
|
|
1116
|
+
request['symbol'] = market['id'];
|
|
1117
|
+
}
|
|
1118
|
+
let marketType = undefined;
|
|
1119
|
+
[marketType, params] = this.handleMarketTypeAndParams('fetchOpenOrdersWs', market, params);
|
|
1120
|
+
let marginMode = undefined;
|
|
1121
|
+
[marginMode, params] = this.handleMarginModeAndParams('fetchOpenOrdersWs', params);
|
|
1122
|
+
if (marketType === 'swap') {
|
|
1123
|
+
return await this.tradeRequest('futures_get_orders', request);
|
|
1124
|
+
}
|
|
1125
|
+
else if ((marketType === 'margin') || (marginMode !== undefined)) {
|
|
1126
|
+
return await this.tradeRequest('margin_get_orders', request);
|
|
1127
|
+
}
|
|
1128
|
+
else {
|
|
1129
|
+
return await this.tradeRequest('spot_get_orders', request);
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
954
1132
|
handleBalance(client, message) {
|
|
955
1133
|
//
|
|
956
1134
|
// {
|
|
@@ -979,7 +1157,52 @@ export default class hitbtc extends hitbtcRest {
|
|
|
979
1157
|
//
|
|
980
1158
|
return message;
|
|
981
1159
|
}
|
|
1160
|
+
handleOrderRequest(client, message) {
|
|
1161
|
+
//
|
|
1162
|
+
// createOrderWs, cancelOrderWs
|
|
1163
|
+
//
|
|
1164
|
+
// {
|
|
1165
|
+
// "jsonrpc": "2.0",
|
|
1166
|
+
// "result": {
|
|
1167
|
+
// "id": 1130310696965,
|
|
1168
|
+
// "client_order_id": "OPC2oyHSkEBqIpPtniLqeW-597hUL3Yo",
|
|
1169
|
+
// "symbol": "ADAUSDT",
|
|
1170
|
+
// "side": "buy",
|
|
1171
|
+
// "status": "new",
|
|
1172
|
+
// "type": "limit",
|
|
1173
|
+
// "time_in_force": "GTC",
|
|
1174
|
+
// "quantity": "4",
|
|
1175
|
+
// "quantity_cumulative": "0",
|
|
1176
|
+
// "price": "0.3300000",
|
|
1177
|
+
// "post_only": false,
|
|
1178
|
+
// "created_at": "2023-11-17T14:58:15.903Z",
|
|
1179
|
+
// "updated_at": "2023-11-17T14:58:15.903Z",
|
|
1180
|
+
// "original_client_order_id": "d6b645556af740b1bd1683400fd9cbce", // spot_replace_order only
|
|
1181
|
+
// "report_type": "new"
|
|
1182
|
+
// "margin_mode": "isolated", // margin and future only
|
|
1183
|
+
// "reduce_only": false, // margin and future only
|
|
1184
|
+
// },
|
|
1185
|
+
// "id": 1700233093414
|
|
1186
|
+
// }
|
|
1187
|
+
//
|
|
1188
|
+
const messageHash = this.safeInteger(message, 'id');
|
|
1189
|
+
const result = this.safeValue(message, 'result', {});
|
|
1190
|
+
if (Array.isArray(result)) {
|
|
1191
|
+
const parsedOrders = [];
|
|
1192
|
+
for (let i = 0; i < result.length; i++) {
|
|
1193
|
+
const parsedOrder = this.parseWsOrder(result[i]);
|
|
1194
|
+
parsedOrders.push(parsedOrder);
|
|
1195
|
+
}
|
|
1196
|
+
client.resolve(parsedOrders, messageHash);
|
|
1197
|
+
}
|
|
1198
|
+
else {
|
|
1199
|
+
const parsedOrder = this.parseWsOrder(result);
|
|
1200
|
+
client.resolve(parsedOrder, messageHash);
|
|
1201
|
+
}
|
|
1202
|
+
return message;
|
|
1203
|
+
}
|
|
982
1204
|
handleMessage(client, message) {
|
|
1205
|
+
this.handleError(client, message);
|
|
983
1206
|
let channel = this.safeString2(message, 'ch', 'method');
|
|
984
1207
|
if (channel !== undefined) {
|
|
985
1208
|
const splitChannel = channel.split('/');
|
|
@@ -1004,10 +1227,22 @@ export default class hitbtc extends hitbtcRest {
|
|
|
1004
1227
|
}
|
|
1005
1228
|
}
|
|
1006
1229
|
else {
|
|
1007
|
-
const
|
|
1008
|
-
|
|
1230
|
+
const result = this.safeValue(message, 'result');
|
|
1231
|
+
const clientOrderId = this.safeString(result, 'client_order_id');
|
|
1232
|
+
if (clientOrderId !== undefined) {
|
|
1233
|
+
this.handleOrderRequest(client, message);
|
|
1234
|
+
}
|
|
1235
|
+
if ((result === true) && !('id' in message)) {
|
|
1009
1236
|
this.handleAuthenticate(client, message);
|
|
1010
1237
|
}
|
|
1238
|
+
if (Array.isArray(result)) {
|
|
1239
|
+
// to do improve this, not very reliable right now
|
|
1240
|
+
const first = this.safeValue(result, 0, {});
|
|
1241
|
+
const arrayLength = result.length;
|
|
1242
|
+
if ((arrayLength === 0) || ('client_order_id' in first)) {
|
|
1243
|
+
this.handleOrderRequest(client, message);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1011
1246
|
}
|
|
1012
1247
|
}
|
|
1013
1248
|
handleAuthenticate(client, message) {
|
|
@@ -1032,4 +1267,28 @@ export default class hitbtc extends hitbtcRest {
|
|
|
1032
1267
|
}
|
|
1033
1268
|
return message;
|
|
1034
1269
|
}
|
|
1270
|
+
handleError(client, message) {
|
|
1271
|
+
//
|
|
1272
|
+
// {
|
|
1273
|
+
// jsonrpc: '2.0',
|
|
1274
|
+
// error: {
|
|
1275
|
+
// code: 20001,
|
|
1276
|
+
// message: 'Insufficient funds',
|
|
1277
|
+
// description: 'Check that the funds are sufficient, given commissions'
|
|
1278
|
+
// },
|
|
1279
|
+
// id: 1700228604325
|
|
1280
|
+
// }
|
|
1281
|
+
//
|
|
1282
|
+
const error = this.safeValue(message, 'error');
|
|
1283
|
+
if (error !== undefined) {
|
|
1284
|
+
const code = this.safeValue(error, 'code');
|
|
1285
|
+
const errorMessage = this.safeString(error, 'message');
|
|
1286
|
+
const description = this.safeString(error, 'description');
|
|
1287
|
+
const feedback = this.id + ' ' + description;
|
|
1288
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], code, feedback);
|
|
1289
|
+
this.throwBroadlyMatchedException(this.exceptions['broad'], errorMessage, feedback);
|
|
1290
|
+
throw new ExchangeError(feedback); // unknown message
|
|
1291
|
+
}
|
|
1292
|
+
return undefined;
|
|
1293
|
+
}
|
|
1035
1294
|
}
|
package/js/src/pro/hollaex.js
CHANGED
|
@@ -61,7 +61,7 @@ export default class hollaex extends hollaexRest {
|
|
|
61
61
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
62
62
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
63
63
|
* @param {object} [params] extra parameters specific to the hollaex api endpoint
|
|
64
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
64
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
65
65
|
*/
|
|
66
66
|
await this.loadMarkets();
|
|
67
67
|
const market = this.market(symbol);
|
|
@@ -120,7 +120,7 @@ export default class hollaex extends hollaexRest {
|
|
|
120
120
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
121
121
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
122
122
|
* @param {object} [params] extra parameters specific to the hollaex api endpoint
|
|
123
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
123
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
124
124
|
*/
|
|
125
125
|
await this.loadMarkets();
|
|
126
126
|
const market = this.market(symbol);
|
|
@@ -176,7 +176,7 @@ export default class hollaex extends hollaexRest {
|
|
|
176
176
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
177
177
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
178
178
|
* @param {object} [params] extra parameters specific to the hollaex api endpoint
|
|
179
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
179
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
180
180
|
*/
|
|
181
181
|
await this.loadMarkets();
|
|
182
182
|
let messageHash = 'usertrade';
|
|
@@ -256,7 +256,7 @@ export default class hollaex extends hollaexRest {
|
|
|
256
256
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
257
257
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
258
258
|
* @param {object} [params] extra parameters specific to the hollaex api endpoint
|
|
259
|
-
* @returns {object[]} a list of [order structures]{@link https://
|
|
259
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
260
260
|
*/
|
|
261
261
|
await this.loadMarkets();
|
|
262
262
|
let messageHash = 'order';
|
|
@@ -374,7 +374,7 @@ export default class hollaex extends hollaexRest {
|
|
|
374
374
|
* @name hollaex#watchBalance
|
|
375
375
|
* @description watch balance and get the amount of funds available for trading or funds locked in orders
|
|
376
376
|
* @param {object} [params] extra parameters specific to the hollaex api endpoint
|
|
377
|
-
* @returns {object} a [balance structure]{@link https://
|
|
377
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
378
378
|
*/
|
|
379
379
|
const messageHash = 'wallet';
|
|
380
380
|
return await this.watchPrivate(messageHash, params);
|
package/js/src/pro/htx.js
CHANGED
|
@@ -124,7 +124,7 @@ export default class htx extends htxRest {
|
|
|
124
124
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
125
125
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
126
126
|
* @param {object} [params] extra parameters specific to the huobi api endpoint
|
|
127
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
127
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
128
128
|
*/
|
|
129
129
|
await this.loadMarkets();
|
|
130
130
|
const market = this.market(symbol);
|
|
@@ -194,7 +194,7 @@ export default class htx extends htxRest {
|
|
|
194
194
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
195
195
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
196
196
|
* @param {object} [params] extra parameters specific to the huobi api endpoint
|
|
197
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
197
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
198
198
|
*/
|
|
199
199
|
await this.loadMarkets();
|
|
200
200
|
const market = this.market(symbol);
|
|
@@ -319,7 +319,7 @@ export default class htx extends htxRest {
|
|
|
319
319
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
320
320
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
321
321
|
* @param {object} [params] extra parameters specific to the huobi api endpoint
|
|
322
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
322
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
323
323
|
*/
|
|
324
324
|
await this.loadMarkets();
|
|
325
325
|
const market = this.market(symbol);
|
|
@@ -649,7 +649,7 @@ export default class htx extends htxRest {
|
|
|
649
649
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
650
650
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
651
651
|
* @param {object} [params] extra parameters specific to the huobi api endpoint
|
|
652
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
652
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
653
653
|
*/
|
|
654
654
|
this.checkRequiredCredentials();
|
|
655
655
|
await this.loadMarkets();
|
|
@@ -752,7 +752,7 @@ export default class htx extends htxRest {
|
|
|
752
752
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
753
753
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
754
754
|
* @param {object} [params] extra parameters specific to the huobi api endpoint
|
|
755
|
-
* @returns {object[]} a list of [order structures]{@link https://
|
|
755
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
756
756
|
*/
|
|
757
757
|
await this.loadMarkets();
|
|
758
758
|
let type = undefined;
|
|
@@ -1317,7 +1317,7 @@ export default class htx extends htxRest {
|
|
|
1317
1317
|
* @name huobi#watchBalance
|
|
1318
1318
|
* @description watch balance and get the amount of funds available for trading or funds locked in orders
|
|
1319
1319
|
* @param {object} [params] extra parameters specific to the huobi api endpoint
|
|
1320
|
-
* @returns {object} a [balance structure]{@link https://
|
|
1320
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1321
1321
|
*/
|
|
1322
1322
|
let type = undefined;
|
|
1323
1323
|
[type, params] = this.handleMarketTypeAndParams('watchBalance', undefined, params);
|
package/js/src/pro/huobijp.js
CHANGED
|
@@ -53,7 +53,7 @@ export default class huobijp extends huobijpRest {
|
|
|
53
53
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
54
54
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
55
55
|
* @param {object} [params] extra parameters specific to the huobijp api endpoint
|
|
56
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
56
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
57
57
|
*/
|
|
58
58
|
await this.loadMarkets();
|
|
59
59
|
const market = this.market(symbol);
|
|
@@ -117,7 +117,7 @@ export default class huobijp extends huobijpRest {
|
|
|
117
117
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
118
118
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
119
119
|
* @param {object} [params] extra parameters specific to the huobijp api endpoint
|
|
120
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
120
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
121
121
|
*/
|
|
122
122
|
await this.loadMarkets();
|
|
123
123
|
const market = this.market(symbol);
|
|
@@ -267,7 +267,7 @@ export default class huobijp extends huobijpRest {
|
|
|
267
267
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
268
268
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
269
269
|
* @param {object} [params] extra parameters specific to the huobijp api endpoint
|
|
270
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
270
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
271
271
|
*/
|
|
272
272
|
if ((limit !== undefined) && (limit !== 150)) {
|
|
273
273
|
throw new ExchangeError(this.id + ' watchOrderBook accepts limit = 150 only');
|
package/js/src/pro/idex.js
CHANGED
|
@@ -73,7 +73,7 @@ export default class idex extends idexRest {
|
|
|
73
73
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
74
74
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
75
75
|
* @param {object} [params] extra parameters specific to the idex api endpoint
|
|
76
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
76
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
77
77
|
*/
|
|
78
78
|
await this.loadMarkets();
|
|
79
79
|
const market = this.market(symbol);
|
|
@@ -147,7 +147,7 @@ export default class idex extends idexRest {
|
|
|
147
147
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
148
148
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
149
149
|
* @param {object} [params] extra parameters specific to the idex api endpoint
|
|
150
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
150
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
151
151
|
*/
|
|
152
152
|
await this.loadMarkets();
|
|
153
153
|
const market = this.market(symbol);
|
|
@@ -410,7 +410,7 @@ export default class idex extends idexRest {
|
|
|
410
410
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
411
411
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
412
412
|
* @param {object} [params] extra parameters specific to the idex api endpoint
|
|
413
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
413
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
414
414
|
*/
|
|
415
415
|
await this.loadMarkets();
|
|
416
416
|
const market = this.market(symbol);
|
|
@@ -514,7 +514,7 @@ export default class idex extends idexRest {
|
|
|
514
514
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
515
515
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
516
516
|
* @param {object} [params] extra parameters specific to the idex api endpoint
|
|
517
|
-
* @returns {object[]} a list of [order structures]{@link https://
|
|
517
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
518
518
|
*/
|
|
519
519
|
await this.loadMarkets();
|
|
520
520
|
const name = 'orders';
|
|
@@ -44,7 +44,7 @@ export default class independentreserve extends independentreserveRest {
|
|
|
44
44
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
45
45
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
46
46
|
* @param {object} [params] extra parameters specific to the independentreserve api endpoint
|
|
47
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
47
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
48
48
|
*/
|
|
49
49
|
await this.loadMarkets();
|
|
50
50
|
const market = this.market(symbol);
|
|
@@ -127,7 +127,7 @@ export default class independentreserve extends independentreserveRest {
|
|
|
127
127
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
128
128
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
129
129
|
* @param {object} [params] extra parameters specific to the independentreserve api endpoint
|
|
130
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
130
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
131
131
|
*/
|
|
132
132
|
await this.loadMarkets();
|
|
133
133
|
const market = this.market(symbol);
|
package/js/src/pro/kraken.js
CHANGED
|
@@ -118,7 +118,7 @@ export default class kraken extends krakenRest {
|
|
|
118
118
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
119
119
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
120
120
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
121
|
-
* @returns {object} an [order structure]{@link https://
|
|
121
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
122
122
|
*/
|
|
123
123
|
await this.loadMarkets();
|
|
124
124
|
const token = await this.authenticate();
|
|
@@ -175,7 +175,7 @@ export default class kraken extends krakenRest {
|
|
|
175
175
|
* @param {float} amount how much of the currency you want to trade in units of the base currency
|
|
176
176
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
177
177
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
178
|
-
* @returns {object} an [order structure]{@link https://
|
|
178
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
179
179
|
*/
|
|
180
180
|
await this.loadMarkets();
|
|
181
181
|
const token = await this.authenticate();
|
|
@@ -203,7 +203,7 @@ export default class kraken extends krakenRest {
|
|
|
203
203
|
* @param {string[]} ids order ids
|
|
204
204
|
* @param {string} symbol unified market symbol, default is undefined
|
|
205
205
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
206
|
-
* @returns {object} an list of [order structures]{@link https://
|
|
206
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
207
207
|
*/
|
|
208
208
|
await this.loadMarkets();
|
|
209
209
|
const token = await this.authenticate();
|
|
@@ -227,7 +227,7 @@ export default class kraken extends krakenRest {
|
|
|
227
227
|
* @param {string} id order id
|
|
228
228
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
229
229
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
230
|
-
* @returns {object} An [order structure]{@link https://
|
|
230
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
231
231
|
*/
|
|
232
232
|
await this.loadMarkets();
|
|
233
233
|
const token = await this.authenticate();
|
|
@@ -264,7 +264,7 @@ export default class kraken extends krakenRest {
|
|
|
264
264
|
* @description cancel all open orders
|
|
265
265
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
266
266
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
267
|
-
* @returns {object[]} a list of [order structures]{@link https://
|
|
267
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
268
268
|
*/
|
|
269
269
|
if (symbol !== undefined) {
|
|
270
270
|
throw new NotSupported(this.id + ' cancelAllOrdersWs () does not support cancelling orders in a specific market.');
|
|
@@ -469,7 +469,7 @@ export default class kraken extends krakenRest {
|
|
|
469
469
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
470
470
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
471
471
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
472
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
472
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
473
473
|
*/
|
|
474
474
|
return await this.watchPublic('ticker', symbol, params);
|
|
475
475
|
}
|
|
@@ -482,7 +482,7 @@ export default class kraken extends krakenRest {
|
|
|
482
482
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
483
483
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
484
484
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
485
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
485
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
486
486
|
*/
|
|
487
487
|
await this.loadMarkets();
|
|
488
488
|
symbol = this.symbol(symbol);
|
|
@@ -501,7 +501,7 @@ export default class kraken extends krakenRest {
|
|
|
501
501
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
502
502
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
503
503
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
504
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
504
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
505
505
|
*/
|
|
506
506
|
const name = 'book';
|
|
507
507
|
const request = {};
|
|
@@ -833,7 +833,7 @@ export default class kraken extends krakenRest {
|
|
|
833
833
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
834
834
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
835
835
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
836
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
836
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
837
837
|
*/
|
|
838
838
|
return await this.watchPrivate('ownTrades', symbol, since, limit, params);
|
|
839
839
|
}
|
|
@@ -995,7 +995,7 @@ export default class kraken extends krakenRest {
|
|
|
995
995
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
996
996
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
997
997
|
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
998
|
-
* @returns {object[]} a list of [order structures]{@link https://
|
|
998
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
999
999
|
*/
|
|
1000
1000
|
return await this.watchPrivate('openOrders', symbol, since, limit, params);
|
|
1001
1001
|
}
|
|
@@ -29,6 +29,7 @@ export default class krakenfutures extends krakenfuturesRest {
|
|
|
29
29
|
handleBalance(client: Client, message: any): void;
|
|
30
30
|
handleMyTrades(client: Client, message: any): void;
|
|
31
31
|
parseWsMyTrade(trade: any, market?: any): import("../base/types.js").Trade;
|
|
32
|
+
handleErrorMessage(client: Client, message: any): void;
|
|
32
33
|
handleMessage(client: any, message: any): any;
|
|
33
34
|
handleAuthenticate(client: Client, message: any): any;
|
|
34
35
|
}
|