ccxt 4.1.85 → 4.1.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/ccxt.browser.js +724 -388
- 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 +2 -2
- package/dist/cjs/src/ascendex.js +2 -2
- package/dist/cjs/src/base/Exchange.js +50 -20
- package/dist/cjs/src/bigone.js +1 -1
- package/dist/cjs/src/binance.js +2 -2
- package/dist/cjs/src/bingx.js +1 -1
- package/dist/cjs/src/bit2c.js +1 -1
- package/dist/cjs/src/bitbank.js +1 -1
- package/dist/cjs/src/bitbns.js +1 -1
- package/dist/cjs/src/bitfinex.js +1 -1
- package/dist/cjs/src/bitfinex2.js +1 -1
- package/dist/cjs/src/bitflyer.js +1 -1
- package/dist/cjs/src/bitforex.js +1 -1
- package/dist/cjs/src/bitget.js +2 -3
- package/dist/cjs/src/bithumb.js +1 -1
- package/dist/cjs/src/bitmart.js +1 -1
- package/dist/cjs/src/bitmex.js +2 -2
- package/dist/cjs/src/bitopro.js +1 -1
- package/dist/cjs/src/bitpanda.js +1 -1
- package/dist/cjs/src/bitrue.js +1 -1
- package/dist/cjs/src/bitso.js +1 -1
- package/dist/cjs/src/bitstamp.js +1 -1
- package/dist/cjs/src/bittrex.js +1 -1
- package/dist/cjs/src/bitvavo.js +1 -1
- package/dist/cjs/src/bl3p.js +1 -1
- package/dist/cjs/src/blockchaincom.js +1 -1
- package/dist/cjs/src/btcalpha.js +1 -1
- package/dist/cjs/src/btcbox.js +1 -1
- package/dist/cjs/src/btcmarkets.js +1 -1
- package/dist/cjs/src/btcturk.js +1 -1
- package/dist/cjs/src/bybit.js +3 -5
- package/dist/cjs/src/cex.js +1 -1
- package/dist/cjs/src/coinbase.js +1 -1
- package/dist/cjs/src/coinbasepro.js +1 -1
- package/dist/cjs/src/coincheck.js +1 -1
- package/dist/cjs/src/coinex.js +2 -2
- package/dist/cjs/src/coinlist.js +1 -1
- package/dist/cjs/src/coinmate.js +1 -1
- package/dist/cjs/src/coinone.js +1 -1
- package/dist/cjs/src/coinsph.js +1 -1
- package/dist/cjs/src/coinspot.js +1 -1
- package/dist/cjs/src/cryptocom.js +3 -3
- package/dist/cjs/src/currencycom.js +1 -1
- package/dist/cjs/src/delta.js +1 -1
- package/dist/cjs/src/deribit.js +1 -1
- package/dist/cjs/src/digifinex.js +160 -112
- package/dist/cjs/src/exmo.js +1 -1
- package/dist/cjs/src/gate.js +1 -1
- package/dist/cjs/src/gemini.js +1 -1
- package/dist/cjs/src/hitbtc.js +2 -2
- package/dist/cjs/src/hitbtc3.js +1 -1
- package/dist/cjs/src/hollaex.js +1 -1
- package/dist/cjs/src/htx.js +2 -2
- package/dist/cjs/src/huobijp.js +1 -1
- package/dist/cjs/src/idex.js +1 -1
- package/dist/cjs/src/independentreserve.js +1 -1
- package/dist/cjs/src/indodax.js +1 -1
- package/dist/cjs/src/kraken.js +2 -2
- package/dist/cjs/src/krakenfutures.js +3 -3
- package/dist/cjs/src/kucoin.js +2 -6
- package/dist/cjs/src/kuna.js +1 -1
- package/dist/cjs/src/latoken.js +2 -2
- package/dist/cjs/src/lbank.js +1 -1
- package/dist/cjs/src/luno.js +1 -1
- package/dist/cjs/src/lykke.js +1 -1
- package/dist/cjs/src/mercado.js +1 -1
- package/dist/cjs/src/mexc.js +102 -53
- package/dist/cjs/src/ndax.js +1 -1
- package/dist/cjs/src/novadax.js +1 -1
- package/dist/cjs/src/oceanex.js +1 -1
- package/dist/cjs/src/okcoin.js +1 -1
- package/dist/cjs/src/okx.js +4 -4
- package/dist/cjs/src/p2b.js +1 -3
- package/dist/cjs/src/paymium.js +1 -1
- package/dist/cjs/src/phemex.js +1 -1
- package/dist/cjs/src/poloniex.js +51 -51
- package/dist/cjs/src/poloniexfutures.js +1 -1
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bitmex.js +206 -0
- package/dist/cjs/src/pro/krakenfutures.js +6 -6
- package/dist/cjs/src/pro/mexc.js +1 -1
- package/dist/cjs/src/pro/poloniex.js +1 -1
- package/dist/cjs/src/pro/poloniexfutures.js +3 -3
- package/dist/cjs/src/probit.js +27 -19
- package/dist/cjs/src/static_dependencies/jsencrypt/JSEncrypt.js +1 -1
- package/dist/cjs/src/static_dependencies/jsencrypt/JSEncryptRSAKey.js +3 -3
- package/dist/cjs/src/timex.js +1 -1
- package/dist/cjs/src/tokocrypto.js +8 -4
- package/dist/cjs/src/upbit.js +1 -1
- package/dist/cjs/src/wavesexchange.js +1 -1
- package/dist/cjs/src/wazirx.js +1 -1
- package/dist/cjs/src/whitebit.js +1 -1
- package/dist/cjs/src/woo.js +1 -1
- package/dist/cjs/src/yobit.js +1 -1
- package/dist/cjs/src/zaif.js +1 -1
- package/dist/cjs/src/zonda.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/ace.d.ts +1 -1
- package/js/src/ace.js +1 -1
- package/js/src/alpaca.d.ts +1 -1
- package/js/src/alpaca.js +2 -2
- package/js/src/ascendex.d.ts +1 -1
- package/js/src/ascendex.js +2 -2
- package/js/src/base/Exchange.d.ts +4 -0
- package/js/src/base/Exchange.js +50 -20
- package/js/src/base/types.d.ts +1 -0
- package/js/src/bigone.d.ts +1 -1
- package/js/src/bigone.js +1 -1
- package/js/src/binance.d.ts +1 -1
- package/js/src/binance.js +2 -2
- package/js/src/bingx.js +1 -1
- package/js/src/bit2c.d.ts +1 -1
- package/js/src/bit2c.js +1 -1
- package/js/src/bitbank.d.ts +1 -1
- package/js/src/bitbank.js +1 -1
- package/js/src/bitbns.d.ts +1 -1
- package/js/src/bitbns.js +1 -1
- package/js/src/bitfinex.d.ts +1 -1
- package/js/src/bitfinex.js +1 -1
- package/js/src/bitfinex2.d.ts +1 -1
- package/js/src/bitfinex2.js +1 -1
- package/js/src/bitflyer.d.ts +1 -1
- package/js/src/bitflyer.js +1 -1
- package/js/src/bitforex.d.ts +1 -1
- package/js/src/bitforex.js +1 -1
- package/js/src/bitget.d.ts +1 -1
- package/js/src/bitget.js +2 -3
- package/js/src/bithumb.d.ts +1 -1
- package/js/src/bithumb.js +1 -1
- package/js/src/bitmart.d.ts +1 -1
- package/js/src/bitmart.js +1 -1
- package/js/src/bitmex.d.ts +1 -1
- package/js/src/bitmex.js +2 -2
- package/js/src/bitopro.d.ts +1 -1
- package/js/src/bitopro.js +1 -1
- package/js/src/bitpanda.d.ts +1 -1
- package/js/src/bitpanda.js +1 -1
- package/js/src/bitrue.d.ts +1 -1
- package/js/src/bitrue.js +1 -1
- package/js/src/bitso.d.ts +1 -1
- package/js/src/bitso.js +1 -1
- package/js/src/bitstamp.d.ts +1 -1
- package/js/src/bitstamp.js +1 -1
- package/js/src/bittrex.d.ts +1 -1
- package/js/src/bittrex.js +1 -1
- package/js/src/bitvavo.d.ts +1 -1
- package/js/src/bitvavo.js +1 -1
- package/js/src/bl3p.d.ts +1 -1
- package/js/src/bl3p.js +1 -1
- package/js/src/blockchaincom.d.ts +1 -1
- package/js/src/blockchaincom.js +1 -1
- package/js/src/btcalpha.d.ts +1 -1
- package/js/src/btcalpha.js +1 -1
- package/js/src/btcbox.d.ts +1 -1
- package/js/src/btcbox.js +1 -1
- package/js/src/btcmarkets.d.ts +1 -1
- package/js/src/btcmarkets.js +1 -1
- package/js/src/btcturk.d.ts +1 -1
- package/js/src/btcturk.js +1 -1
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +3 -5
- 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 +1 -1
- package/js/src/coinbasepro.d.ts +1 -1
- package/js/src/coinbasepro.js +1 -1
- package/js/src/coincheck.d.ts +1 -1
- package/js/src/coincheck.js +1 -1
- package/js/src/coinex.d.ts +1 -1
- package/js/src/coinex.js +2 -2
- package/js/src/coinlist.d.ts +1 -1
- package/js/src/coinlist.js +1 -1
- package/js/src/coinmate.d.ts +1 -1
- package/js/src/coinmate.js +1 -1
- package/js/src/coinone.d.ts +1 -1
- package/js/src/coinone.js +1 -1
- package/js/src/coinsph.d.ts +1 -1
- package/js/src/coinsph.js +1 -1
- package/js/src/coinspot.d.ts +1 -1
- package/js/src/coinspot.js +1 -1
- package/js/src/cryptocom.d.ts +1 -1
- package/js/src/cryptocom.js +3 -3
- package/js/src/currencycom.d.ts +1 -1
- package/js/src/currencycom.js +1 -1
- package/js/src/delta.d.ts +1 -1
- package/js/src/delta.js +1 -1
- package/js/src/deribit.d.ts +1 -1
- package/js/src/deribit.js +1 -1
- package/js/src/digifinex.d.ts +1 -1
- package/js/src/digifinex.js +160 -112
- package/js/src/exmo.d.ts +1 -1
- package/js/src/exmo.js +1 -1
- package/js/src/gate.d.ts +1 -1
- package/js/src/gate.js +1 -1
- package/js/src/gemini.d.ts +1 -1
- package/js/src/gemini.js +1 -1
- package/js/src/hitbtc.d.ts +1 -1
- package/js/src/hitbtc.js +2 -2
- package/js/src/hitbtc3.d.ts +1 -1
- package/js/src/hitbtc3.js +1 -1
- package/js/src/hollaex.d.ts +1 -1
- package/js/src/hollaex.js +1 -1
- package/js/src/htx.d.ts +1 -1
- package/js/src/htx.js +2 -2
- package/js/src/huobijp.d.ts +1 -1
- package/js/src/huobijp.js +1 -1
- package/js/src/idex.d.ts +1 -1
- package/js/src/idex.js +1 -1
- package/js/src/independentreserve.d.ts +1 -1
- package/js/src/independentreserve.js +1 -1
- package/js/src/indodax.d.ts +1 -1
- package/js/src/indodax.js +1 -1
- package/js/src/kraken.d.ts +1 -1
- package/js/src/kraken.js +2 -2
- package/js/src/krakenfutures.d.ts +1 -1
- package/js/src/krakenfutures.js +3 -3
- package/js/src/kucoin.d.ts +1 -1
- package/js/src/kucoin.js +2 -6
- package/js/src/kuna.d.ts +1 -1
- package/js/src/kuna.js +1 -1
- package/js/src/latoken.d.ts +1 -1
- package/js/src/latoken.js +2 -2
- package/js/src/lbank.d.ts +1 -1
- package/js/src/lbank.js +1 -1
- package/js/src/luno.d.ts +1 -1
- package/js/src/luno.js +1 -1
- package/js/src/lykke.d.ts +1 -1
- package/js/src/lykke.js +1 -1
- package/js/src/mercado.d.ts +1 -1
- package/js/src/mercado.js +1 -1
- package/js/src/mexc.d.ts +1 -1
- package/js/src/mexc.js +102 -53
- package/js/src/ndax.d.ts +1 -1
- package/js/src/ndax.js +1 -1
- package/js/src/novadax.d.ts +1 -1
- package/js/src/novadax.js +1 -1
- package/js/src/oceanex.d.ts +1 -1
- package/js/src/oceanex.js +1 -1
- package/js/src/okcoin.d.ts +1 -1
- package/js/src/okcoin.js +1 -1
- package/js/src/okx.d.ts +1 -1
- package/js/src/okx.js +4 -4
- package/js/src/p2b.d.ts +1 -1
- package/js/src/p2b.js +1 -3
- package/js/src/paymium.d.ts +1 -1
- package/js/src/paymium.js +1 -1
- package/js/src/phemex.d.ts +1 -1
- package/js/src/phemex.js +1 -1
- package/js/src/poloniex.d.ts +1 -1
- package/js/src/poloniex.js +51 -51
- package/js/src/poloniexfutures.d.ts +1 -1
- package/js/src/poloniexfutures.js +1 -1
- package/js/src/pro/bitget.d.ts +1 -1
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bitmex.d.ts +3 -1
- package/js/src/pro/bitmex.js +207 -1
- package/js/src/pro/krakenfutures.js +6 -6
- package/js/src/pro/mexc.js +1 -1
- package/js/src/pro/poloniex.js +1 -1
- package/js/src/pro/poloniexfutures.js +3 -3
- package/js/src/probit.d.ts +1 -1
- package/js/src/probit.js +27 -19
- package/js/src/static_dependencies/jsencrypt/JSEncrypt.d.ts +1 -1
- package/js/src/static_dependencies/jsencrypt/JSEncrypt.js +1 -1
- package/js/src/static_dependencies/jsencrypt/JSEncryptRSAKey.d.ts +3 -3
- package/js/src/static_dependencies/jsencrypt/JSEncryptRSAKey.js +3 -3
- package/js/src/timex.d.ts +1 -1
- package/js/src/timex.js +1 -1
- package/js/src/tokocrypto.d.ts +1 -1
- package/js/src/tokocrypto.js +8 -4
- package/js/src/upbit.d.ts +1 -1
- package/js/src/upbit.js +1 -1
- package/js/src/wavesexchange.d.ts +1 -1
- package/js/src/wavesexchange.js +1 -1
- package/js/src/wazirx.d.ts +1 -1
- package/js/src/wazirx.js +1 -1
- package/js/src/whitebit.d.ts +1 -1
- package/js/src/whitebit.js +1 -1
- package/js/src/woo.d.ts +1 -1
- package/js/src/woo.js +1 -1
- package/js/src/yobit.d.ts +1 -1
- package/js/src/yobit.js +1 -1
- package/js/src/zaif.d.ts +1 -1
- package/js/src/zaif.js +1 -1
- package/js/src/zonda.d.ts +1 -1
- package/js/src/zonda.js +1 -1
- package/package.json +4 -3
- package/skip-tests.json +4 -0
package/dist/cjs/src/poloniex.js
CHANGED
|
@@ -10,7 +10,7 @@ var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
|
|
|
10
10
|
// ---------------------------------------------------------------------------
|
|
11
11
|
/**
|
|
12
12
|
* @class poloniex
|
|
13
|
-
* @
|
|
13
|
+
* @augments Exchange
|
|
14
14
|
*/
|
|
15
15
|
class poloniex extends poloniex$1 {
|
|
16
16
|
describe() {
|
|
@@ -1236,20 +1236,20 @@ class poloniex extends poloniex$1 {
|
|
|
1236
1236
|
}
|
|
1237
1237
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
1238
1238
|
/**
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1239
|
+
* @method
|
|
1240
|
+
* @name poloniex#createOrder
|
|
1241
|
+
* @description create a trade order
|
|
1242
|
+
* @see https://docs.poloniex.com/#authenticated-endpoints-orders-create-order
|
|
1243
|
+
* @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-create-order // trigger orders
|
|
1244
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
1245
|
+
* @param {string} type 'market' or 'limit'
|
|
1246
|
+
* @param {string} side 'buy' or 'sell'
|
|
1247
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
1248
|
+
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
1249
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1250
|
+
* @param {float} [params.triggerPrice] *spot only* The price at which a trigger order is triggered at
|
|
1251
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1252
|
+
*/
|
|
1253
1253
|
await this.loadMarkets();
|
|
1254
1254
|
const market = this.market(symbol);
|
|
1255
1255
|
if (!market['spot']) {
|
|
@@ -1319,21 +1319,21 @@ class poloniex extends poloniex$1 {
|
|
|
1319
1319
|
}
|
|
1320
1320
|
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
1321
1321
|
/**
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1322
|
+
* @method
|
|
1323
|
+
* @name poloniex#editOrder
|
|
1324
|
+
* @description edit a trade order
|
|
1325
|
+
* @see https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-replace-order
|
|
1326
|
+
* @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-cancel-replace-order
|
|
1327
|
+
* @param {string} id order id
|
|
1328
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
1329
|
+
* @param {string} type 'market' or 'limit'
|
|
1330
|
+
* @param {string} side 'buy' or 'sell'
|
|
1331
|
+
* @param {float} [amount] how much of the currency you want to trade in units of the base currency
|
|
1332
|
+
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
1333
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1334
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
1335
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1336
|
+
*/
|
|
1337
1337
|
await this.loadMarkets();
|
|
1338
1338
|
const market = this.market(symbol);
|
|
1339
1339
|
if (!market['spot']) {
|
|
@@ -1405,16 +1405,16 @@ class poloniex extends poloniex$1 {
|
|
|
1405
1405
|
}
|
|
1406
1406
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
1407
1407
|
/**
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1408
|
+
* @method
|
|
1409
|
+
* @name poloniex#cancelAllOrders
|
|
1410
|
+
* @description cancel all open orders
|
|
1411
|
+
* @see https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-all-orders
|
|
1412
|
+
* @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-cancel-all-orders // trigger orders
|
|
1413
|
+
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
1414
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1415
|
+
* @param {boolean} [params.trigger] true if canceling trigger orders
|
|
1416
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1417
|
+
*/
|
|
1418
1418
|
await this.loadMarkets();
|
|
1419
1419
|
const request = {
|
|
1420
1420
|
// 'accountTypes': 'SPOT',
|
|
@@ -1457,17 +1457,17 @@ class poloniex extends poloniex$1 {
|
|
|
1457
1457
|
}
|
|
1458
1458
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
1459
1459
|
/**
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1460
|
+
* @method
|
|
1461
|
+
* @name poloniex#fetchOrder
|
|
1462
|
+
* @description fetch an order by it's id
|
|
1463
|
+
* @see https://docs.poloniex.com/#authenticated-endpoints-orders-order-details
|
|
1464
|
+
* @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-open-orders // trigger orders
|
|
1465
|
+
* @param {string} id order id
|
|
1466
|
+
* @param {string} symbol unified market symbol, default is undefined
|
|
1467
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1468
|
+
* @param {boolean} [params.trigger] true if fetching a trigger order
|
|
1469
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1470
|
+
*/
|
|
1471
1471
|
await this.loadMarkets();
|
|
1472
1472
|
id = id.toString();
|
|
1473
1473
|
const request = {
|
|
@@ -10,7 +10,7 @@ var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
|
|
|
10
10
|
// ---------------------------------------------------------------------------
|
|
11
11
|
/**
|
|
12
12
|
* @class poloniexfutures
|
|
13
|
-
* @
|
|
13
|
+
* @augments Exchange
|
|
14
14
|
*/
|
|
15
15
|
class poloniexfutures extends poloniexfutures$1 {
|
|
16
16
|
describe() {
|
|
@@ -10,7 +10,7 @@ var sha256 = require('../static_dependencies/noble-hashes/sha256.js');
|
|
|
10
10
|
// ---------------------------------------------------------------------------
|
|
11
11
|
/**
|
|
12
12
|
* @class bitget
|
|
13
|
-
* @
|
|
13
|
+
* @augments Exchange
|
|
14
14
|
* @description watching delivery future markets is not yet implemented (perpertual future / swap is implemented)
|
|
15
15
|
*/
|
|
16
16
|
class bitget extends bitget$1 {
|
|
@@ -18,6 +18,7 @@ class bitmex extends bitmex$1 {
|
|
|
18
18
|
'watchOrderBook': true,
|
|
19
19
|
'watchOrderBookForSymbols': true,
|
|
20
20
|
'watchOrders': true,
|
|
21
|
+
'watchPostions': true,
|
|
21
22
|
'watchTicker': true,
|
|
22
23
|
'watchTickers': false,
|
|
23
24
|
'watchTrades': true,
|
|
@@ -591,6 +592,210 @@ class bitmex extends bitmex$1 {
|
|
|
591
592
|
}
|
|
592
593
|
}
|
|
593
594
|
}
|
|
595
|
+
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
596
|
+
/**
|
|
597
|
+
* @method
|
|
598
|
+
* @name bitmex#watchPositions
|
|
599
|
+
* @see https://www.bitmex.com/app/wsAPI
|
|
600
|
+
* @description watch all open positions
|
|
601
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
602
|
+
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
603
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
604
|
+
*/
|
|
605
|
+
await this.loadMarkets();
|
|
606
|
+
await this.authenticate();
|
|
607
|
+
const subscriptionHash = 'position';
|
|
608
|
+
let messageHash = 'positions';
|
|
609
|
+
if (!this.isEmpty(symbols)) {
|
|
610
|
+
messageHash = '::' + symbols.join(',');
|
|
611
|
+
}
|
|
612
|
+
const url = this.urls['api']['ws'];
|
|
613
|
+
const request = {
|
|
614
|
+
'op': 'subscribe',
|
|
615
|
+
'args': [
|
|
616
|
+
subscriptionHash,
|
|
617
|
+
],
|
|
618
|
+
};
|
|
619
|
+
const newPositions = await this.watch(url, messageHash, request, subscriptionHash);
|
|
620
|
+
if (this.newUpdates) {
|
|
621
|
+
return newPositions;
|
|
622
|
+
}
|
|
623
|
+
return this.filterBySymbolsSinceLimit(this.positions, symbols, since, limit, true);
|
|
624
|
+
}
|
|
625
|
+
handlePositions(client, message) {
|
|
626
|
+
//
|
|
627
|
+
// partial
|
|
628
|
+
// {
|
|
629
|
+
// table: 'position',
|
|
630
|
+
// action: 'partial',
|
|
631
|
+
// keys: [ 'account', 'symbol' ],
|
|
632
|
+
// types: {
|
|
633
|
+
// account: 'long',
|
|
634
|
+
// symbol: 'symbol',
|
|
635
|
+
// currency: 'symbol',
|
|
636
|
+
// underlying: 'symbol',
|
|
637
|
+
// quoteCurrency: 'symbol',
|
|
638
|
+
// commission: 'float',
|
|
639
|
+
// initMarginReq: 'float',
|
|
640
|
+
// maintMarginReq: 'float',
|
|
641
|
+
// riskLimit: 'long',
|
|
642
|
+
// leverage: 'float',
|
|
643
|
+
// crossMargin: 'boolean',
|
|
644
|
+
// deleveragePercentile: 'float',
|
|
645
|
+
// rebalancedPnl: 'long',
|
|
646
|
+
// prevRealisedPnl: 'long',
|
|
647
|
+
// prevUnrealisedPnl: 'long',
|
|
648
|
+
// openingQty: 'long',
|
|
649
|
+
// openOrderBuyQty: 'long',
|
|
650
|
+
// openOrderBuyCost: 'long',
|
|
651
|
+
// openOrderBuyPremium: 'long',
|
|
652
|
+
// openOrderSellQty: 'long',
|
|
653
|
+
// openOrderSellCost: 'long',
|
|
654
|
+
// openOrderSellPremium: 'long',
|
|
655
|
+
// currentQty: 'long',
|
|
656
|
+
// currentCost: 'long',
|
|
657
|
+
// currentComm: 'long',
|
|
658
|
+
// realisedCost: 'long',
|
|
659
|
+
// unrealisedCost: 'long',
|
|
660
|
+
// grossOpenPremium: 'long',
|
|
661
|
+
// isOpen: 'boolean',
|
|
662
|
+
// markPrice: 'float',
|
|
663
|
+
// markValue: 'long',
|
|
664
|
+
// riskValue: 'long',
|
|
665
|
+
// homeNotional: 'float',
|
|
666
|
+
// foreignNotional: 'float',
|
|
667
|
+
// posState: 'symbol',
|
|
668
|
+
// posCost: 'long',
|
|
669
|
+
// posCross: 'long',
|
|
670
|
+
// posComm: 'long',
|
|
671
|
+
// posLoss: 'long',
|
|
672
|
+
// posMargin: 'long',
|
|
673
|
+
// posMaint: 'long',
|
|
674
|
+
// initMargin: 'long',
|
|
675
|
+
// maintMargin: 'long',
|
|
676
|
+
// realisedPnl: 'long',
|
|
677
|
+
// unrealisedPnl: 'long',
|
|
678
|
+
// unrealisedPnlPcnt: 'float',
|
|
679
|
+
// unrealisedRoePcnt: 'float',
|
|
680
|
+
// avgCostPrice: 'float',
|
|
681
|
+
// avgEntryPrice: 'float',
|
|
682
|
+
// breakEvenPrice: 'float',
|
|
683
|
+
// marginCallPrice: 'float',
|
|
684
|
+
// liquidationPrice: 'float',
|
|
685
|
+
// bankruptPrice: 'float',
|
|
686
|
+
// timestamp: 'timestamp'
|
|
687
|
+
// },
|
|
688
|
+
// filter: { account: 412475 },
|
|
689
|
+
// data: [
|
|
690
|
+
// {
|
|
691
|
+
// account: 412475,
|
|
692
|
+
// symbol: 'XBTUSD',
|
|
693
|
+
// currency: 'XBt',
|
|
694
|
+
// underlying: 'XBT',
|
|
695
|
+
// quoteCurrency: 'USD',
|
|
696
|
+
// commission: 0.00075,
|
|
697
|
+
// initMarginReq: 0.01,
|
|
698
|
+
// maintMarginReq: 0.0035,
|
|
699
|
+
// riskLimit: 20000000000,
|
|
700
|
+
// leverage: 100,
|
|
701
|
+
// crossMargin: true,
|
|
702
|
+
// deleveragePercentile: 1,
|
|
703
|
+
// rebalancedPnl: 0,
|
|
704
|
+
// prevRealisedPnl: 0,
|
|
705
|
+
// prevUnrealisedPnl: 0,
|
|
706
|
+
// openingQty: 400,
|
|
707
|
+
// openOrderBuyQty: 0,
|
|
708
|
+
// openOrderBuyCost: 0,
|
|
709
|
+
// openOrderBuyPremium: 0,
|
|
710
|
+
// openOrderSellQty: 0,
|
|
711
|
+
// openOrderSellCost: 0,
|
|
712
|
+
// openOrderSellPremium: 0,
|
|
713
|
+
// currentQty: 400,
|
|
714
|
+
// currentCost: -912269,
|
|
715
|
+
// currentComm: 684,
|
|
716
|
+
// realisedCost: 0,
|
|
717
|
+
// unrealisedCost: -912269,
|
|
718
|
+
// grossOpenPremium: 0,
|
|
719
|
+
// isOpen: true,
|
|
720
|
+
// markPrice: 43772,
|
|
721
|
+
// markValue: -913828,
|
|
722
|
+
// riskValue: 913828,
|
|
723
|
+
// homeNotional: 0.00913828,
|
|
724
|
+
// foreignNotional: -400,
|
|
725
|
+
// posCost: -912269,
|
|
726
|
+
// posCross: 1559,
|
|
727
|
+
// posComm: 694,
|
|
728
|
+
// posLoss: 0,
|
|
729
|
+
// posMargin: 11376,
|
|
730
|
+
// posMaint: 3887,
|
|
731
|
+
// initMargin: 0,
|
|
732
|
+
// maintMargin: 9817,
|
|
733
|
+
// realisedPnl: -684,
|
|
734
|
+
// unrealisedPnl: -1559,
|
|
735
|
+
// unrealisedPnlPcnt: -0.0017,
|
|
736
|
+
// unrealisedRoePcnt: -0.1709,
|
|
737
|
+
// avgCostPrice: 43846.7643,
|
|
738
|
+
// avgEntryPrice: 43846.7643,
|
|
739
|
+
// breakEvenPrice: 43880,
|
|
740
|
+
// marginCallPrice: 20976,
|
|
741
|
+
// liquidationPrice: 20976,
|
|
742
|
+
// bankruptPrice: 20941,
|
|
743
|
+
// timestamp: '2023-12-07T00:09:00.709Z'
|
|
744
|
+
// }
|
|
745
|
+
// ]
|
|
746
|
+
// }
|
|
747
|
+
// update
|
|
748
|
+
// {
|
|
749
|
+
// table: 'position',
|
|
750
|
+
// action: 'update',
|
|
751
|
+
// data: [
|
|
752
|
+
// {
|
|
753
|
+
// account: 412475,
|
|
754
|
+
// symbol: 'XBTUSD',
|
|
755
|
+
// currency: 'XBt',
|
|
756
|
+
// currentQty: 400,
|
|
757
|
+
// markPrice: 43772.75,
|
|
758
|
+
// markValue: -913812,
|
|
759
|
+
// riskValue: 913812,
|
|
760
|
+
// homeNotional: 0.00913812,
|
|
761
|
+
// posCross: 1543,
|
|
762
|
+
// posComm: 693,
|
|
763
|
+
// posMargin: 11359,
|
|
764
|
+
// posMaint: 3886,
|
|
765
|
+
// maintMargin: 9816,
|
|
766
|
+
// unrealisedPnl: -1543,
|
|
767
|
+
// unrealisedRoePcnt: -0.1691,
|
|
768
|
+
// liquidationPrice: 20976,
|
|
769
|
+
// timestamp: '2023-12-07T00:09:10.760Z'
|
|
770
|
+
// }
|
|
771
|
+
// ]
|
|
772
|
+
// }
|
|
773
|
+
//
|
|
774
|
+
if (this.positions === undefined) {
|
|
775
|
+
this.positions = new Cache.ArrayCacheBySymbolBySide();
|
|
776
|
+
}
|
|
777
|
+
const cache = this.positions;
|
|
778
|
+
const rawPositions = this.safeValue(message, 'data', []);
|
|
779
|
+
const newPositions = [];
|
|
780
|
+
for (let i = 0; i < rawPositions.length; i++) {
|
|
781
|
+
const rawPosition = rawPositions[i];
|
|
782
|
+
const position = this.parsePosition(rawPosition);
|
|
783
|
+
newPositions.push(position);
|
|
784
|
+
cache.append(position);
|
|
785
|
+
}
|
|
786
|
+
const messageHashes = this.findMessageHashes(client, 'positions::');
|
|
787
|
+
for (let i = 0; i < messageHashes.length; i++) {
|
|
788
|
+
const messageHash = messageHashes[i];
|
|
789
|
+
const parts = messageHash.split('::');
|
|
790
|
+
const symbolsString = parts[1];
|
|
791
|
+
const symbols = symbolsString.split(',');
|
|
792
|
+
const positions = this.filterByArray(newPositions, 'symbol', symbols, false);
|
|
793
|
+
if (!this.isEmpty(positions)) {
|
|
794
|
+
client.resolve(positions, messageHash);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
client.resolve(newPositions, 'positions');
|
|
798
|
+
}
|
|
594
799
|
async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
595
800
|
/**
|
|
596
801
|
* @method
|
|
@@ -1373,6 +1578,7 @@ class bitmex extends bitmex$1 {
|
|
|
1373
1578
|
'order': this.handleOrders,
|
|
1374
1579
|
'execution': this.handleMyTrades,
|
|
1375
1580
|
'margin': this.handleBalance,
|
|
1581
|
+
'position': this.handlePositions,
|
|
1376
1582
|
};
|
|
1377
1583
|
const method = this.safeValue(methods, table);
|
|
1378
1584
|
if (method === undefined) {
|
|
@@ -96,10 +96,10 @@ class krakenfutures extends krakenfutures$1 {
|
|
|
96
96
|
* @ignore
|
|
97
97
|
* @method
|
|
98
98
|
* @description Connects to a websocket channel
|
|
99
|
-
* @param {
|
|
99
|
+
* @param {string} name name of the channel
|
|
100
100
|
* @param {string[]} symbols CCXT market symbols
|
|
101
|
-
* @param {
|
|
102
|
-
* @returns {
|
|
101
|
+
* @param {object} [params] extra parameters specific to the krakenfutures api
|
|
102
|
+
* @returns {object} data from the websocket stream
|
|
103
103
|
*/
|
|
104
104
|
await this.loadMarkets();
|
|
105
105
|
const url = this.urls['api']['ws'];
|
|
@@ -130,10 +130,10 @@ class krakenfutures extends krakenfutures$1 {
|
|
|
130
130
|
* @ignore
|
|
131
131
|
* @method
|
|
132
132
|
* @description Connects to a websocket channel
|
|
133
|
-
* @param {
|
|
133
|
+
* @param {string} name name of the channel
|
|
134
134
|
* @param {string[]} symbols CCXT market symbols
|
|
135
|
-
* @param {
|
|
136
|
-
* @returns {
|
|
135
|
+
* @param {object} [params] extra parameters specific to the krakenfutures api
|
|
136
|
+
* @returns {object} data from the websocket stream
|
|
137
137
|
*/
|
|
138
138
|
await this.loadMarkets();
|
|
139
139
|
await this.authenticate();
|
package/dist/cjs/src/pro/mexc.js
CHANGED
|
@@ -739,7 +739,7 @@ class mexc extends mexc$1 {
|
|
|
739
739
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
740
740
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
741
741
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
742
|
-
* @
|
|
742
|
+
* @param {string|undefined} params.type the type of orders to retrieve, can be 'spot' or 'margin'
|
|
743
743
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
744
744
|
*/
|
|
745
745
|
await this.loadMarkets();
|
|
@@ -201,7 +201,7 @@ class poloniex extends poloniex$1 {
|
|
|
201
201
|
* @param {string} [params.stpMode] self-trade prevention, defaults to expire_taker, none: enable self-trade; expire_taker: taker order will be canceled when self-trade happens
|
|
202
202
|
* @param {string} [params.slippageTolerance] used to control the maximum slippage ratio, the value range is greater than 0 and less than 1
|
|
203
203
|
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
204
|
-
|
|
204
|
+
*/
|
|
205
205
|
await this.loadMarkets();
|
|
206
206
|
await this.authenticate();
|
|
207
207
|
const market = this.market(symbol);
|
|
@@ -126,9 +126,9 @@ class poloniexfutures extends poloniexfutures$1 {
|
|
|
126
126
|
* @param {string} name name of the channel and suscriptionHash
|
|
127
127
|
* @param {bool} isPrivate true for the authenticated url, false for the public url
|
|
128
128
|
* @param {string} symbol is required for all public channels, not required for private channels (except position)
|
|
129
|
-
* @param {
|
|
130
|
-
* @param {
|
|
131
|
-
* @returns {
|
|
129
|
+
* @param {object} subscription subscription parameters
|
|
130
|
+
* @param {object} [params] extra parameters specific to the poloniex api
|
|
131
|
+
* @returns {object} data from the websocket stream
|
|
132
132
|
*/
|
|
133
133
|
const url = await this.negotiate(isPrivate);
|
|
134
134
|
if (symbol !== undefined) {
|
package/dist/cjs/src/probit.js
CHANGED
|
@@ -9,7 +9,7 @@ var number = require('./base/functions/number.js');
|
|
|
9
9
|
// ---------------------------------------------------------------------------
|
|
10
10
|
/**
|
|
11
11
|
* @class probit
|
|
12
|
-
* @
|
|
12
|
+
* @augments Exchange
|
|
13
13
|
*/
|
|
14
14
|
class probit extends probit$1 {
|
|
15
15
|
describe() {
|
|
@@ -28,7 +28,10 @@ class probit extends probit$1 {
|
|
|
28
28
|
'option': false,
|
|
29
29
|
'addMargin': false,
|
|
30
30
|
'cancelOrder': true,
|
|
31
|
+
'createMarketBuyOrderWithCost': true,
|
|
31
32
|
'createMarketOrder': true,
|
|
33
|
+
'createMarketOrderWithCost': false,
|
|
34
|
+
'createMarketSellOrderWithCost': false,
|
|
32
35
|
'createOrder': true,
|
|
33
36
|
'createReduceOnlyOrder': false,
|
|
34
37
|
'createStopLimitOrder': false,
|
|
@@ -315,6 +318,7 @@ class probit extends probit$1 {
|
|
|
315
318
|
'precision': {
|
|
316
319
|
'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'quantity_precision'))),
|
|
317
320
|
'price': this.safeNumber(market, 'price_increment'),
|
|
321
|
+
'cost': this.parseNumber(this.parsePrecision(this.safeString(market, 'cost_precision'))),
|
|
318
322
|
},
|
|
319
323
|
'limits': {
|
|
320
324
|
'leverage': {
|
|
@@ -1187,14 +1191,15 @@ class probit extends probit$1 {
|
|
|
1187
1191
|
/**
|
|
1188
1192
|
* @method
|
|
1189
1193
|
* @name probit#createOrder
|
|
1190
|
-
* @see https://docs-en.probit.com/reference/order-1
|
|
1191
1194
|
* @description create a trade order
|
|
1195
|
+
* @see https://docs-en.probit.com/reference/order-1
|
|
1192
1196
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
1193
1197
|
* @param {string} type 'market' or 'limit'
|
|
1194
1198
|
* @param {string} side 'buy' or 'sell'
|
|
1195
|
-
* @param {float} amount how much
|
|
1199
|
+
* @param {float} amount how much you want to trade in units of the base currency
|
|
1196
1200
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
1197
1201
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1202
|
+
* @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount for market buy orders
|
|
1198
1203
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1199
1204
|
*/
|
|
1200
1205
|
await this.loadMarkets();
|
|
@@ -1212,7 +1217,7 @@ class probit extends probit$1 {
|
|
|
1212
1217
|
if (clientOrderId !== undefined) {
|
|
1213
1218
|
request['client_order_id'] = clientOrderId;
|
|
1214
1219
|
}
|
|
1215
|
-
let
|
|
1220
|
+
let quoteAmount = undefined;
|
|
1216
1221
|
if (type === 'limit') {
|
|
1217
1222
|
request['limit_price'] = this.priceToPrecision(symbol, price);
|
|
1218
1223
|
request['quantity'] = this.amountToPrecision(symbol, amount);
|
|
@@ -1220,25 +1225,28 @@ class probit extends probit$1 {
|
|
|
1220
1225
|
else if (type === 'market') {
|
|
1221
1226
|
// for market buy it requires the amount of quote currency to spend
|
|
1222
1227
|
if (side === 'buy') {
|
|
1223
|
-
let
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1228
|
+
let createMarketBuyOrderRequiresPrice = true;
|
|
1229
|
+
[createMarketBuyOrderRequiresPrice, params] = this.handleOptionAndParams(params, 'createOrder', 'createMarketBuyOrderRequiresPrice', true);
|
|
1230
|
+
const cost = this.safeString(params, 'cost');
|
|
1231
|
+
params = this.omit(params, 'cost');
|
|
1232
|
+
if (cost !== undefined) {
|
|
1233
|
+
quoteAmount = this.costToPrecision(symbol, cost);
|
|
1234
|
+
}
|
|
1235
|
+
else if (createMarketBuyOrderRequiresPrice) {
|
|
1236
|
+
if (price === undefined) {
|
|
1237
|
+
throw new errors.InvalidOrder(this.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument');
|
|
1232
1238
|
}
|
|
1233
|
-
else
|
|
1234
|
-
|
|
1239
|
+
else {
|
|
1240
|
+
const amountString = this.numberToString(amount);
|
|
1241
|
+
const priceString = this.numberToString(price);
|
|
1242
|
+
const costRequest = Precise["default"].stringMul(amountString, priceString);
|
|
1243
|
+
quoteAmount = this.costToPrecision(symbol, costRequest);
|
|
1235
1244
|
}
|
|
1236
1245
|
}
|
|
1237
1246
|
else {
|
|
1238
|
-
|
|
1247
|
+
quoteAmount = this.costToPrecision(symbol, amount);
|
|
1239
1248
|
}
|
|
1240
|
-
|
|
1241
|
-
request['cost'] = costToPrecision;
|
|
1249
|
+
request['cost'] = quoteAmount;
|
|
1242
1250
|
}
|
|
1243
1251
|
else {
|
|
1244
1252
|
request['quantity'] = this.amountToPrecision(symbol, amount);
|
|
@@ -1273,7 +1281,7 @@ class probit extends probit$1 {
|
|
|
1273
1281
|
// returned by the exchange on market buys
|
|
1274
1282
|
if ((type === 'market') && (side === 'buy')) {
|
|
1275
1283
|
order['amount'] = undefined;
|
|
1276
|
-
order['cost'] = this.parseNumber(
|
|
1284
|
+
order['cost'] = this.parseNumber(quoteAmount);
|
|
1277
1285
|
order['remaining'] = undefined;
|
|
1278
1286
|
}
|
|
1279
1287
|
return order;
|
|
@@ -10,7 +10,7 @@ const version = typeof process !== 'undefined'
|
|
|
10
10
|
: undefined;
|
|
11
11
|
/**
|
|
12
12
|
*
|
|
13
|
-
* @param {
|
|
13
|
+
* @param {object} [options = {}] - An object to customize JSEncrypt behaviour
|
|
14
14
|
* possible parameters are:
|
|
15
15
|
* - default_key_size {number} default: 1024 the key size in bit
|
|
16
16
|
* - default_public_exponent {string} default: '010001' the hexadecimal representation of the public exponent
|
|
@@ -253,7 +253,7 @@ class JSEncryptRSAKey extends rsa.RSAKey {
|
|
|
253
253
|
/**
|
|
254
254
|
* Check if the object contains the necessary parameters to populate the rsa modulus
|
|
255
255
|
* and public exponent parameters.
|
|
256
|
-
* @param {
|
|
256
|
+
* @param {object} [obj={}] - An object that may contain the two public key
|
|
257
257
|
* parameters
|
|
258
258
|
* @returns {boolean} true if the object contains both the modulus and the public exponent
|
|
259
259
|
* properties (n and e)
|
|
@@ -267,7 +267,7 @@ class JSEncryptRSAKey extends rsa.RSAKey {
|
|
|
267
267
|
}
|
|
268
268
|
/**
|
|
269
269
|
* Check if the object contains ALL the parameters of an RSA key.
|
|
270
|
-
* @param {
|
|
270
|
+
* @param {object} [obj={}] - An object that may contain nine rsa key
|
|
271
271
|
* parameters
|
|
272
272
|
* @returns {boolean} true if the object contains all the parameters needed
|
|
273
273
|
* @todo check for types of the parameters all the parameters but the public exponent
|
|
@@ -288,7 +288,7 @@ class JSEncryptRSAKey extends rsa.RSAKey {
|
|
|
288
288
|
/**
|
|
289
289
|
* Parse the properties of obj in the current rsa object. Obj should AT LEAST
|
|
290
290
|
* include the modulus and public exponent (n, e) parameters.
|
|
291
|
-
* @param {
|
|
291
|
+
* @param {object} obj - the object containing rsa parameters
|
|
292
292
|
* @private
|
|
293
293
|
*/
|
|
294
294
|
parsePropertiesFrom(obj) {
|
package/dist/cjs/src/timex.js
CHANGED
|
@@ -10,7 +10,7 @@ var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
|
|
|
10
10
|
// ---------------------------------------------------------------------------
|
|
11
11
|
/**
|
|
12
12
|
* @class tokocrypto
|
|
13
|
-
* @
|
|
13
|
+
* @augments Exchange
|
|
14
14
|
*/
|
|
15
15
|
class tokocrypto extends tokocrypto$1 {
|
|
16
16
|
describe() {
|
|
@@ -1015,16 +1015,21 @@ class tokocrypto extends tokocrypto$1 {
|
|
|
1015
1015
|
const data = this.safeValue(responseInner, 'data', {});
|
|
1016
1016
|
return this.parseTrades(data, market, since, limit);
|
|
1017
1017
|
}
|
|
1018
|
+
if (limit !== undefined) {
|
|
1019
|
+
request['limit'] = limit; // default = 500, maximum = 1000
|
|
1020
|
+
}
|
|
1018
1021
|
const defaultMethod = 'binanceGetTrades';
|
|
1019
1022
|
const method = this.safeString(this.options, 'fetchTradesMethod', defaultMethod);
|
|
1023
|
+
let response = undefined;
|
|
1020
1024
|
if ((method === 'binanceGetAggTrades') && (since !== undefined)) {
|
|
1021
1025
|
request['startTime'] = since;
|
|
1022
1026
|
// https://github.com/ccxt/ccxt/issues/6400
|
|
1023
1027
|
// https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#compressedaggregate-trades-list
|
|
1024
1028
|
request['endTime'] = this.sum(since, 3600000);
|
|
1029
|
+
response = await this.binanceGetAggTrades(this.extend(request, params));
|
|
1025
1030
|
}
|
|
1026
|
-
|
|
1027
|
-
|
|
1031
|
+
else {
|
|
1032
|
+
response = await this.binanceGetTrades(this.extend(request, params));
|
|
1028
1033
|
}
|
|
1029
1034
|
//
|
|
1030
1035
|
// Caveats:
|
|
@@ -1035,7 +1040,6 @@ class tokocrypto extends tokocrypto$1 {
|
|
|
1035
1040
|
// - 'tradeId' accepted and returned by this method is "aggregate" trade id
|
|
1036
1041
|
// which is different from actual trade id
|
|
1037
1042
|
// - setting both fromId and time window results in error
|
|
1038
|
-
const response = await this[method](this.extend(request, params));
|
|
1039
1043
|
//
|
|
1040
1044
|
// aggregate trades
|
|
1041
1045
|
//
|