ccxt 4.3.14 → 4.3.16
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/LICENSE.txt +1 -1
- package/README.md +3 -3
- package/dist/cjs/ccxt.js +2 -1
- package/dist/cjs/src/alpaca.js +1 -0
- package/dist/cjs/src/ascendex.js +1 -0
- package/dist/cjs/src/base/Exchange.js +30 -21
- package/dist/cjs/src/base/errors.js +8 -1
- package/dist/cjs/src/base/functions/misc.js +2 -2
- package/dist/cjs/src/base/ws/Client.js +2 -1
- package/dist/cjs/src/base/ws/WsClient.js +4 -0
- package/dist/cjs/src/binance.js +4 -3
- package/dist/cjs/src/bingx.js +2 -0
- package/dist/cjs/src/bitmex.js +1 -0
- package/dist/cjs/src/bybit.js +7 -6
- package/dist/cjs/src/coinbaseinternational.js +1 -0
- package/dist/cjs/src/coinex.js +36 -35
- package/dist/cjs/src/coinmetro.js +1 -0
- package/dist/cjs/src/cryptocom.js +3 -1
- package/dist/cjs/src/currencycom.js +1 -0
- package/dist/cjs/src/deribit.js +1 -0
- package/dist/cjs/src/gate.js +1 -0
- package/dist/cjs/src/gemini.js +1 -0
- package/dist/cjs/src/hitbtc.js +2 -0
- package/dist/cjs/src/hollaex.js +1 -0
- package/dist/cjs/src/hyperliquid.js +5 -0
- package/dist/cjs/src/idex.js +1 -0
- package/dist/cjs/src/krakenfutures.js +1 -0
- package/dist/cjs/src/luno.js +2 -0
- package/dist/cjs/src/ndax.js +1 -0
- package/dist/cjs/src/okx.js +1 -0
- package/dist/cjs/src/phemex.js +2 -1
- package/dist/cjs/src/poloniex.js +1 -0
- package/dist/cjs/src/pro/hitbtc.js +1 -1
- package/dist/cjs/src/pro/independentreserve.js +3 -3
- package/dist/cjs/src/pro/poloniex.js +3 -3
- package/dist/cjs/src/probit.js +1 -0
- package/dist/cjs/src/wavesexchange.js +1 -0
- package/dist/cjs/src/woo.js +1 -0
- package/dist/cjs/src/zaif.js +1 -1
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +3 -3
- package/js/src/abstract/luno.d.ts +2 -0
- package/js/src/alpaca.d.ts +1 -1
- package/js/src/alpaca.js +1 -0
- package/js/src/ascendex.js +1 -0
- package/js/src/base/Exchange.d.ts +5 -4
- package/js/src/base/Exchange.js +30 -21
- package/js/src/base/errorHierarchy.d.ts +1 -0
- package/js/src/base/errorHierarchy.js +1 -0
- package/js/src/base/errors.d.ts +41 -37
- package/js/src/base/errors.js +8 -2
- package/js/src/base/functions/misc.d.ts +5 -4
- package/js/src/base/functions/misc.js +2 -2
- package/js/src/base/functions/number.d.ts +5 -5
- package/js/src/base/ws/Client.d.ts +8 -7
- package/js/src/base/ws/Client.js +2 -1
- package/js/src/base/ws/WsClient.d.ts +1 -1
- package/js/src/base/ws/WsClient.js +4 -0
- package/js/src/binance.js +5 -4
- package/js/src/bingx.d.ts +1 -1
- package/js/src/bingx.js +2 -0
- package/js/src/bitmex.js +1 -0
- package/js/src/bybit.js +7 -6
- package/js/src/coinbaseinternational.js +1 -0
- package/js/src/coinex.js +36 -35
- package/js/src/coinmetro.js +1 -0
- package/js/src/cryptocom.js +3 -1
- package/js/src/currencycom.js +1 -0
- package/js/src/deribit.js +1 -0
- package/js/src/gate.js +1 -0
- package/js/src/gemini.js +1 -0
- package/js/src/hitbtc.js +2 -0
- package/js/src/hollaex.js +1 -0
- package/js/src/hyperliquid.js +5 -0
- package/js/src/idex.js +1 -0
- package/js/src/krakenfutures.js +1 -0
- package/js/src/luno.js +2 -0
- package/js/src/ndax.js +1 -0
- package/js/src/okx.js +1 -0
- package/js/src/phemex.js +2 -1
- package/js/src/poloniex.js +1 -0
- package/js/src/pro/hitbtc.js +1 -1
- package/js/src/pro/independentreserve.js +3 -3
- package/js/src/pro/poloniex.js +3 -3
- package/js/src/probit.js +1 -0
- package/js/src/upbit.d.ts +1 -1
- package/js/src/wavesexchange.js +1 -0
- package/js/src/woo.d.ts +1 -1
- package/js/src/woo.js +1 -0
- package/js/src/zaif.js +1 -1
- package/js/src/zonda.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/src/phemex.js
CHANGED
|
@@ -79,6 +79,7 @@ class phemex extends phemex$1 {
|
|
|
79
79
|
'fetchTransfers': true,
|
|
80
80
|
'fetchWithdrawals': true,
|
|
81
81
|
'reduceMargin': false,
|
|
82
|
+
'sandbox': true,
|
|
82
83
|
'setLeverage': true,
|
|
83
84
|
'setMargin': true,
|
|
84
85
|
'setMarginMode': true,
|
|
@@ -2380,7 +2381,7 @@ class phemex extends phemex$1 {
|
|
|
2380
2381
|
lastTradeTimestamp = undefined;
|
|
2381
2382
|
}
|
|
2382
2383
|
const timeInForce = this.parseTimeInForce(this.safeString(order, 'timeInForce'));
|
|
2383
|
-
const stopPrice = this.omitZero(this.
|
|
2384
|
+
const stopPrice = this.omitZero(this.safeString2(order, 'stopPx', 'stopPxRp'));
|
|
2384
2385
|
const postOnly = (timeInForce === 'PO');
|
|
2385
2386
|
let reduceOnly = this.safeValue(order, 'reduceOnly');
|
|
2386
2387
|
const execInst = this.safeString(order, 'execInst');
|
package/dist/cjs/src/poloniex.js
CHANGED
|
@@ -1195,7 +1195,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
1195
1195
|
// "id": 1700233093414
|
|
1196
1196
|
// }
|
|
1197
1197
|
//
|
|
1198
|
-
const messageHash = this.
|
|
1198
|
+
const messageHash = this.safeString(message, 'id');
|
|
1199
1199
|
const result = this.safeValue(message, 'result', {});
|
|
1200
1200
|
if (Array.isArray(result)) {
|
|
1201
1201
|
const parsedOrders = [];
|
|
@@ -132,9 +132,9 @@ class independentreserve extends independentreserve$1 {
|
|
|
132
132
|
if (limit === undefined) {
|
|
133
133
|
limit = 100;
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
const url = this.urls['api']['ws'] + '/orderbook/' +
|
|
137
|
-
const messageHash = 'orderbook:' + symbol + ':' +
|
|
135
|
+
const limitString = this.numberToString(limit);
|
|
136
|
+
const url = this.urls['api']['ws'] + '/orderbook/' + limitString + '?subscribe=' + market['base'] + '-' + market['quote'];
|
|
137
|
+
const messageHash = 'orderbook:' + symbol + ':' + limitString;
|
|
138
138
|
const subscription = {
|
|
139
139
|
'receivedSnapshot': false,
|
|
140
140
|
};
|
|
@@ -314,7 +314,7 @@ class poloniex extends poloniex$1 {
|
|
|
314
314
|
// }]
|
|
315
315
|
// }
|
|
316
316
|
//
|
|
317
|
-
const messageHash = this.
|
|
317
|
+
const messageHash = this.safeString(message, 'id');
|
|
318
318
|
const data = this.safeValue(message, 'data', []);
|
|
319
319
|
const orders = [];
|
|
320
320
|
for (let i = 0; i < data.length; i++) {
|
|
@@ -652,8 +652,8 @@ class poloniex extends poloniex$1 {
|
|
|
652
652
|
'type': this.safeStringLower(trade, 'type'),
|
|
653
653
|
'side': this.safeStringLower2(trade, 'takerSide', 'side'),
|
|
654
654
|
'takerOrMaker': takerMaker,
|
|
655
|
-
'price': this.omitZero(this.
|
|
656
|
-
'amount': this.omitZero(this.
|
|
655
|
+
'price': this.omitZero(this.safeString2(trade, 'tradePrice', 'price')),
|
|
656
|
+
'amount': this.omitZero(this.safeString2(trade, 'filledQuantity', 'quantity')),
|
|
657
657
|
'cost': this.safeString2(trade, 'amount', 'filledAmount'),
|
|
658
658
|
'fee': {
|
|
659
659
|
'rate': undefined,
|
package/dist/cjs/src/probit.js
CHANGED
package/dist/cjs/src/woo.js
CHANGED
package/dist/cjs/src/zaif.js
CHANGED
|
@@ -675,7 +675,7 @@ class zaif extends zaif$1 {
|
|
|
675
675
|
};
|
|
676
676
|
}
|
|
677
677
|
customNonce() {
|
|
678
|
-
const num = (this.milliseconds() / 1000)
|
|
678
|
+
const num = this.numberToString(this.milliseconds() / 1000);
|
|
679
679
|
const nonce = parseFloat(num);
|
|
680
680
|
return nonce.toFixed(8);
|
|
681
681
|
}
|
package/js/ccxt.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { Precise } from './src/base/Precise.js';
|
|
|
3
3
|
import * as functions from './src/base/functions.js';
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain, Conversion } from './src/base/types.js';
|
|
6
|
-
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.3.
|
|
6
|
+
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
|
|
7
|
+
declare const version = "4.3.15";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
|
@@ -519,5 +519,5 @@ declare const ccxt: {
|
|
|
519
519
|
zaif: typeof zaif;
|
|
520
520
|
zonda: typeof zonda;
|
|
521
521
|
} & typeof functions & typeof errors;
|
|
522
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain, Conversion, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
522
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain, Conversion, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
523
523
|
export default ccxt;
|
package/js/ccxt.js
CHANGED
|
@@ -35,10 +35,10 @@ import { Exchange } from './src/base/Exchange.js';
|
|
|
35
35
|
import { Precise } from './src/base/Precise.js';
|
|
36
36
|
import * as functions from './src/base/functions.js';
|
|
37
37
|
import * as errors from './src/base/errors.js';
|
|
38
|
-
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
|
|
38
|
+
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.3.
|
|
41
|
+
const version = '4.3.16';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -392,6 +392,6 @@ pro.exchanges = Object.keys(pro);
|
|
|
392
392
|
pro['Exchange'] = Exchange; // now the same for rest and ts
|
|
393
393
|
//-----------------------------------------------------------------------------
|
|
394
394
|
const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
|
|
395
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
395
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
396
396
|
export default ccxt;
|
|
397
397
|
//-----------------------------------------------------------------------------
|
|
@@ -30,8 +30,10 @@ interface Exchange {
|
|
|
30
30
|
privatePostWithdrawals(params?: {}): Promise<implicitReturnType>;
|
|
31
31
|
privatePostSend(params?: {}): Promise<implicitReturnType>;
|
|
32
32
|
privatePostOauth2Grant(params?: {}): Promise<implicitReturnType>;
|
|
33
|
+
privatePostBeneficiaries(params?: {}): Promise<implicitReturnType>;
|
|
33
34
|
privatePutAccountsIdName(params?: {}): Promise<implicitReturnType>;
|
|
34
35
|
privateDeleteWithdrawalsId(params?: {}): Promise<implicitReturnType>;
|
|
36
|
+
privateDeleteBeneficiariesId(params?: {}): Promise<implicitReturnType>;
|
|
35
37
|
}
|
|
36
38
|
declare abstract class Exchange extends _Exchange {
|
|
37
39
|
}
|
package/js/src/alpaca.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export default class alpaca extends Exchange {
|
|
|
25
25
|
parseTimeInForce(timeInForce: any): string;
|
|
26
26
|
parseTrade(trade: any, market?: Market): Trade;
|
|
27
27
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
28
|
-
url:
|
|
28
|
+
url: string;
|
|
29
29
|
method: string;
|
|
30
30
|
body: any;
|
|
31
31
|
headers: any;
|
package/js/src/alpaca.js
CHANGED
package/js/src/ascendex.js
CHANGED
|
@@ -205,8 +205,8 @@ export default class Exchange {
|
|
|
205
205
|
safeInteger: (o: any, k: IndexType, $default?: number) => number;
|
|
206
206
|
sum: (...xs: any[]) => any;
|
|
207
207
|
omitZero: typeof functions.omitZero;
|
|
208
|
-
implodeParams: (string:
|
|
209
|
-
extractParams: (string:
|
|
208
|
+
implodeParams: (string: string, params: any[] | Dictionary<any>) => string;
|
|
209
|
+
extractParams: (string: string) => string[];
|
|
210
210
|
json: (data: any, params?: any) => string;
|
|
211
211
|
vwap: typeof functions.vwap;
|
|
212
212
|
merge: (target: Dictionary<any>, ...args: any) => Dictionary<any>;
|
|
@@ -289,6 +289,7 @@ export default class Exchange {
|
|
|
289
289
|
publicAPI: boolean;
|
|
290
290
|
privateAPI: boolean;
|
|
291
291
|
CORS: any;
|
|
292
|
+
sandbox: any;
|
|
292
293
|
spot: any;
|
|
293
294
|
margin: any;
|
|
294
295
|
swap: any;
|
|
@@ -993,7 +994,7 @@ export default class Exchange {
|
|
|
993
994
|
amountToPrecision(symbol: string, amount: any): any;
|
|
994
995
|
feeToPrecision(symbol: string, fee: any): any;
|
|
995
996
|
currencyToPrecision(code: string, fee: any, networkCode?: any): any;
|
|
996
|
-
forceString(value: any):
|
|
997
|
+
forceString(value: any): string;
|
|
997
998
|
isTickPrecision(): boolean;
|
|
998
999
|
isDecimalPrecision(): boolean;
|
|
999
1000
|
isSignificantPrecision(): boolean;
|
|
@@ -1002,7 +1003,7 @@ export default class Exchange {
|
|
|
1002
1003
|
parsePrecision(precision?: string): string;
|
|
1003
1004
|
integerPrecisionToAmount(precision: Str): string;
|
|
1004
1005
|
loadTimeDifference(params?: {}): Promise<any>;
|
|
1005
|
-
implodeHostname(url: string):
|
|
1006
|
+
implodeHostname(url: string): string;
|
|
1006
1007
|
fetchMarketLeverageTiers(symbol: string, params?: {}): Promise<any>;
|
|
1007
1008
|
createPostOnlyOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
1008
1009
|
createPostOnlyOrderWs(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -351,6 +351,7 @@ export default class Exchange {
|
|
|
351
351
|
'publicAPI': true,
|
|
352
352
|
'privateAPI': true,
|
|
353
353
|
'CORS': undefined,
|
|
354
|
+
'sandbox': undefined,
|
|
354
355
|
'spot': undefined,
|
|
355
356
|
'margin': undefined,
|
|
356
357
|
'swap': undefined,
|
|
@@ -3045,15 +3046,15 @@ export default class Exchange {
|
|
|
3045
3046
|
// timestamp and symbol operations don't belong in safeTicker
|
|
3046
3047
|
// they should be done in the derived classes
|
|
3047
3048
|
return this.extend(ticker, {
|
|
3048
|
-
'bid': this.parseNumber(this.omitZero(this.
|
|
3049
|
+
'bid': this.parseNumber(this.omitZero(this.safeString(ticker, 'bid'))),
|
|
3049
3050
|
'bidVolume': this.safeNumber(ticker, 'bidVolume'),
|
|
3050
|
-
'ask': this.parseNumber(this.omitZero(this.
|
|
3051
|
+
'ask': this.parseNumber(this.omitZero(this.safeString(ticker, 'ask'))),
|
|
3051
3052
|
'askVolume': this.safeNumber(ticker, 'askVolume'),
|
|
3052
3053
|
'high': this.parseNumber(this.omitZero(this.safeString(ticker, 'high'))),
|
|
3053
|
-
'low': this.parseNumber(this.omitZero(this.
|
|
3054
|
-
'open': this.parseNumber(this.omitZero(
|
|
3055
|
-
'close': this.parseNumber(this.omitZero(
|
|
3056
|
-
'last': this.parseNumber(this.omitZero(
|
|
3054
|
+
'low': this.parseNumber(this.omitZero(this.safeString(ticker, 'low'))),
|
|
3055
|
+
'open': this.parseNumber(this.omitZero(open)),
|
|
3056
|
+
'close': this.parseNumber(this.omitZero(close)),
|
|
3057
|
+
'last': this.parseNumber(this.omitZero(last)),
|
|
3057
3058
|
'change': this.parseNumber(change),
|
|
3058
3059
|
'percentage': this.parseNumber(percentage),
|
|
3059
3060
|
'average': this.parseNumber(average),
|
|
@@ -5835,24 +5836,26 @@ export default class Exchange {
|
|
|
5835
5836
|
let maxRetries = undefined;
|
|
5836
5837
|
[maxRetries, params] = this.handleOptionAndParams(params, method, 'maxRetries', 3);
|
|
5837
5838
|
let errors = 0;
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
catch (e) {
|
|
5847
|
-
if (e instanceof RateLimitExceeded) {
|
|
5848
|
-
throw e; // if we are rate limited, we should not retry and fail fast
|
|
5839
|
+
while (errors <= maxRetries) {
|
|
5840
|
+
try {
|
|
5841
|
+
if (timeframe && method !== 'fetchFundingRateHistory') {
|
|
5842
|
+
return await this[method](symbol, timeframe, since, limit, params);
|
|
5843
|
+
}
|
|
5844
|
+
else {
|
|
5845
|
+
return await this[method](symbol, since, limit, params);
|
|
5846
|
+
}
|
|
5849
5847
|
}
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5848
|
+
catch (e) {
|
|
5849
|
+
if (e instanceof RateLimitExceeded) {
|
|
5850
|
+
throw e; // if we are rate limited, we should not retry and fail fast
|
|
5851
|
+
}
|
|
5852
|
+
errors += 1;
|
|
5853
|
+
if (errors > maxRetries) {
|
|
5854
|
+
throw e;
|
|
5855
|
+
}
|
|
5853
5856
|
}
|
|
5854
5857
|
}
|
|
5855
|
-
return
|
|
5858
|
+
return [];
|
|
5856
5859
|
}
|
|
5857
5860
|
async fetchPaginatedCallDeterministic(method, symbol = undefined, since = undefined, limit = undefined, timeframe = undefined, params = {}, maxEntriesPerRequest = undefined) {
|
|
5858
5861
|
let maxCalls = undefined;
|
|
@@ -5866,6 +5869,9 @@ export default class Exchange {
|
|
|
5866
5869
|
if (since !== undefined) {
|
|
5867
5870
|
currentSince = Math.max(currentSince, since);
|
|
5868
5871
|
}
|
|
5872
|
+
else {
|
|
5873
|
+
currentSince = Math.max(currentSince, 1241440531000); // avoid timestamps older than 2009
|
|
5874
|
+
}
|
|
5869
5875
|
const until = this.safeInteger2(params, 'until', 'till'); // do not omit it here
|
|
5870
5876
|
if (until !== undefined) {
|
|
5871
5877
|
const requiredCalls = Math.ceil((until - since) / step);
|
|
@@ -5877,6 +5883,9 @@ export default class Exchange {
|
|
|
5877
5883
|
if ((until !== undefined) && (currentSince >= until)) {
|
|
5878
5884
|
break;
|
|
5879
5885
|
}
|
|
5886
|
+
if (currentSince >= current) {
|
|
5887
|
+
break;
|
|
5888
|
+
}
|
|
5880
5889
|
tasks.push(this.safeDeterministicCall(method, symbol, currentSince, maxEntriesPerRequest, timeframe, params));
|
|
5881
5890
|
currentSince = this.sum(currentSince, step) - 1;
|
|
5882
5891
|
}
|
package/js/src/base/errors.d.ts
CHANGED
|
@@ -1,112 +1,115 @@
|
|
|
1
1
|
declare class BaseError extends Error {
|
|
2
|
-
constructor(message:
|
|
2
|
+
constructor(message: string);
|
|
3
3
|
}
|
|
4
4
|
declare class ExchangeError extends BaseError {
|
|
5
|
-
constructor(message:
|
|
5
|
+
constructor(message: string);
|
|
6
6
|
}
|
|
7
7
|
declare class AuthenticationError extends ExchangeError {
|
|
8
|
-
constructor(message:
|
|
8
|
+
constructor(message: string);
|
|
9
9
|
}
|
|
10
10
|
declare class PermissionDenied extends AuthenticationError {
|
|
11
|
-
constructor(message:
|
|
11
|
+
constructor(message: string);
|
|
12
12
|
}
|
|
13
13
|
declare class AccountNotEnabled extends PermissionDenied {
|
|
14
|
-
constructor(message:
|
|
14
|
+
constructor(message: string);
|
|
15
15
|
}
|
|
16
16
|
declare class AccountSuspended extends AuthenticationError {
|
|
17
|
-
constructor(message:
|
|
17
|
+
constructor(message: string);
|
|
18
18
|
}
|
|
19
19
|
declare class ArgumentsRequired extends ExchangeError {
|
|
20
|
-
constructor(message:
|
|
20
|
+
constructor(message: string);
|
|
21
21
|
}
|
|
22
22
|
declare class BadRequest extends ExchangeError {
|
|
23
|
-
constructor(message:
|
|
23
|
+
constructor(message: string);
|
|
24
24
|
}
|
|
25
25
|
declare class BadSymbol extends BadRequest {
|
|
26
|
-
constructor(message:
|
|
26
|
+
constructor(message: string);
|
|
27
27
|
}
|
|
28
28
|
declare class OperationRejected extends ExchangeError {
|
|
29
|
-
constructor(message:
|
|
29
|
+
constructor(message: string);
|
|
30
30
|
}
|
|
31
31
|
declare class NoChange extends OperationRejected {
|
|
32
|
-
constructor(message:
|
|
32
|
+
constructor(message: string);
|
|
33
33
|
}
|
|
34
34
|
declare class MarginModeAlreadySet extends NoChange {
|
|
35
|
-
constructor(message:
|
|
35
|
+
constructor(message: string);
|
|
36
|
+
}
|
|
37
|
+
declare class MarketClosed extends OperationRejected {
|
|
38
|
+
constructor(message: string);
|
|
36
39
|
}
|
|
37
40
|
declare class BadResponse extends ExchangeError {
|
|
38
|
-
constructor(message:
|
|
41
|
+
constructor(message: string);
|
|
39
42
|
}
|
|
40
43
|
declare class NullResponse extends BadResponse {
|
|
41
|
-
constructor(message:
|
|
44
|
+
constructor(message: string);
|
|
42
45
|
}
|
|
43
46
|
declare class InsufficientFunds extends ExchangeError {
|
|
44
|
-
constructor(message:
|
|
47
|
+
constructor(message: string);
|
|
45
48
|
}
|
|
46
49
|
declare class InvalidAddress extends ExchangeError {
|
|
47
|
-
constructor(message:
|
|
50
|
+
constructor(message: string);
|
|
48
51
|
}
|
|
49
52
|
declare class AddressPending extends InvalidAddress {
|
|
50
|
-
constructor(message:
|
|
53
|
+
constructor(message: string);
|
|
51
54
|
}
|
|
52
55
|
declare class InvalidOrder extends ExchangeError {
|
|
53
|
-
constructor(message:
|
|
56
|
+
constructor(message: string);
|
|
54
57
|
}
|
|
55
58
|
declare class OrderNotFound extends InvalidOrder {
|
|
56
|
-
constructor(message:
|
|
59
|
+
constructor(message: string);
|
|
57
60
|
}
|
|
58
61
|
declare class OrderNotCached extends InvalidOrder {
|
|
59
|
-
constructor(message:
|
|
62
|
+
constructor(message: string);
|
|
60
63
|
}
|
|
61
64
|
declare class CancelPending extends InvalidOrder {
|
|
62
|
-
constructor(message:
|
|
65
|
+
constructor(message: string);
|
|
63
66
|
}
|
|
64
67
|
declare class OrderImmediatelyFillable extends InvalidOrder {
|
|
65
|
-
constructor(message:
|
|
68
|
+
constructor(message: string);
|
|
66
69
|
}
|
|
67
70
|
declare class OrderNotFillable extends InvalidOrder {
|
|
68
|
-
constructor(message:
|
|
71
|
+
constructor(message: string);
|
|
69
72
|
}
|
|
70
73
|
declare class DuplicateOrderId extends InvalidOrder {
|
|
71
|
-
constructor(message:
|
|
74
|
+
constructor(message: string);
|
|
72
75
|
}
|
|
73
76
|
declare class ContractUnavailable extends InvalidOrder {
|
|
74
|
-
constructor(message:
|
|
77
|
+
constructor(message: string);
|
|
75
78
|
}
|
|
76
79
|
declare class NotSupported extends ExchangeError {
|
|
77
|
-
constructor(message:
|
|
80
|
+
constructor(message: string);
|
|
78
81
|
}
|
|
79
82
|
declare class ProxyError extends ExchangeError {
|
|
80
|
-
constructor(message:
|
|
83
|
+
constructor(message: string);
|
|
81
84
|
}
|
|
82
85
|
declare class ExchangeClosedByUser extends ExchangeError {
|
|
83
|
-
constructor(message:
|
|
86
|
+
constructor(message: string);
|
|
84
87
|
}
|
|
85
88
|
declare class OperationFailed extends BaseError {
|
|
86
|
-
constructor(message:
|
|
89
|
+
constructor(message: string);
|
|
87
90
|
}
|
|
88
91
|
declare class NetworkError extends OperationFailed {
|
|
89
|
-
constructor(message:
|
|
92
|
+
constructor(message: string);
|
|
90
93
|
}
|
|
91
94
|
declare class DDoSProtection extends NetworkError {
|
|
92
|
-
constructor(message:
|
|
95
|
+
constructor(message: string);
|
|
93
96
|
}
|
|
94
97
|
declare class RateLimitExceeded extends NetworkError {
|
|
95
|
-
constructor(message:
|
|
98
|
+
constructor(message: string);
|
|
96
99
|
}
|
|
97
100
|
declare class ExchangeNotAvailable extends NetworkError {
|
|
98
|
-
constructor(message:
|
|
101
|
+
constructor(message: string);
|
|
99
102
|
}
|
|
100
103
|
declare class OnMaintenance extends ExchangeNotAvailable {
|
|
101
|
-
constructor(message:
|
|
104
|
+
constructor(message: string);
|
|
102
105
|
}
|
|
103
106
|
declare class InvalidNonce extends NetworkError {
|
|
104
|
-
constructor(message:
|
|
107
|
+
constructor(message: string);
|
|
105
108
|
}
|
|
106
109
|
declare class RequestTimeout extends NetworkError {
|
|
107
|
-
constructor(message:
|
|
110
|
+
constructor(message: string);
|
|
108
111
|
}
|
|
109
|
-
export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
|
|
112
|
+
export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
|
|
110
113
|
declare const _default: {
|
|
111
114
|
BaseError: typeof BaseError;
|
|
112
115
|
ExchangeError: typeof ExchangeError;
|
|
@@ -120,6 +123,7 @@ declare const _default: {
|
|
|
120
123
|
OperationRejected: typeof OperationRejected;
|
|
121
124
|
NoChange: typeof NoChange;
|
|
122
125
|
MarginModeAlreadySet: typeof MarginModeAlreadySet;
|
|
126
|
+
MarketClosed: typeof MarketClosed;
|
|
123
127
|
BadResponse: typeof BadResponse;
|
|
124
128
|
NullResponse: typeof NullResponse;
|
|
125
129
|
InsufficientFunds: typeof InsufficientFunds;
|
package/js/src/base/errors.js
CHANGED
|
@@ -77,6 +77,12 @@ class MarginModeAlreadySet extends NoChange {
|
|
|
77
77
|
this.name = 'MarginModeAlreadySet';
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
+
class MarketClosed extends OperationRejected {
|
|
81
|
+
constructor(message) {
|
|
82
|
+
super(message);
|
|
83
|
+
this.name = 'MarketClosed';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
80
86
|
class BadResponse extends ExchangeError {
|
|
81
87
|
constructor(message) {
|
|
82
88
|
super(message);
|
|
@@ -221,5 +227,5 @@ class RequestTimeout extends NetworkError {
|
|
|
221
227
|
this.name = 'RequestTimeout';
|
|
222
228
|
}
|
|
223
229
|
}
|
|
224
|
-
export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
|
|
225
|
-
export default { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
|
|
230
|
+
export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
|
|
231
|
+
export default { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { Dictionary, Num } from '../types.js';
|
|
1
2
|
declare const parseTimeframe: (timeframe: string) => number;
|
|
2
|
-
declare const roundTimeframe: (timeframe:
|
|
3
|
-
declare const extractParams: (string:
|
|
4
|
-
declare const implodeParams: (string:
|
|
5
|
-
declare function vwap(baseVolume:
|
|
3
|
+
declare const roundTimeframe: (timeframe: string, timestamp: number, direction?: number) => number;
|
|
4
|
+
declare const extractParams: (string: string) => string[];
|
|
5
|
+
declare const implodeParams: (string: string, params: Dictionary<any> | any[]) => string;
|
|
6
|
+
declare function vwap(baseVolume: number, quoteVolume: number): Num;
|
|
6
7
|
declare function aggregate(bidasks: any): number[][];
|
|
7
8
|
export { aggregate, parseTimeframe, roundTimeframe, implodeParams, extractParams, vwap, };
|
|
@@ -82,10 +82,10 @@ function aggregate(bidasks) {
|
|
|
82
82
|
for (let i = 0; i < bidasks.length; i++) {
|
|
83
83
|
const [price, volume] = bidasks[i];
|
|
84
84
|
if (volume > 0) {
|
|
85
|
-
result[price] = (result[price] || 0) + volume;
|
|
85
|
+
result[price] = (result[price] || 0) + volume; // TODO: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{}'.ts(7053)
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
return Object.keys(result).map((price) => [parseFloat(price), parseFloat(result[price])]);
|
|
88
|
+
return Object.keys(result).map((price) => [parseFloat(price), parseFloat(result[price])]); // TODO: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}', No index signature with a parameter of type 'string' was found on type '{}'.ts(7053)
|
|
89
89
|
}
|
|
90
90
|
export { aggregate, parseTimeframe, roundTimeframe, implodeParams, extractParams, vwap, };
|
|
91
91
|
/* ------------------------------------------------------------------------ */
|
|
@@ -18,10 +18,10 @@ declare const precisionConstants: {
|
|
|
18
18
|
NO_PADDING: number;
|
|
19
19
|
PAD_WITH_ZERO: number;
|
|
20
20
|
};
|
|
21
|
-
declare function numberToString(x: any):
|
|
22
|
-
declare const truncate_to_string: (num:
|
|
23
|
-
declare const truncate: (num:
|
|
24
|
-
declare function precisionFromString(str:
|
|
21
|
+
declare function numberToString(x: any): string | undefined;
|
|
22
|
+
declare const truncate_to_string: (num: number | string, precision?: number) => string;
|
|
23
|
+
declare const truncate: (num: number | string, precision?: number) => number;
|
|
24
|
+
declare function precisionFromString(str: string): number;
|
|
25
25
|
declare const decimalToPrecision: (x: any, roundingMode: any, numPrecisionDigits: any, countingMode?: number, paddingMode?: number) => any;
|
|
26
|
-
declare function omitZero(stringNumber:
|
|
26
|
+
declare function omitZero(stringNumber: string): string;
|
|
27
27
|
export { numberToString, precisionFromString, decimalToPrecision, truncate_to_string, truncate, omitZero, precisionConstants, ROUND, TRUNCATE, ROUND_UP, ROUND_DOWN, DECIMAL_PLACES, SIGNIFICANT_DIGITS, TICK_SIZE, NO_PADDING, PAD_WITH_ZERO, };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Future } from './Future.js';
|
|
2
|
+
import { Dictionary, Str } from '../types.js';
|
|
2
3
|
export default class Client {
|
|
3
4
|
connected: Promise<any>;
|
|
4
5
|
disconnected: ReturnType<typeof Future>;
|
|
5
|
-
futures:
|
|
6
|
-
rejections:
|
|
6
|
+
futures: Dictionary<any>;
|
|
7
|
+
rejections: Dictionary<any>;
|
|
7
8
|
keepAlive: number;
|
|
8
9
|
connection: any;
|
|
9
10
|
connectionTimeout: any;
|
|
@@ -23,12 +24,12 @@ export default class Client {
|
|
|
23
24
|
onErrorCallback: any;
|
|
24
25
|
onCloseCallback: any;
|
|
25
26
|
ping: any;
|
|
26
|
-
subscriptions:
|
|
27
|
+
subscriptions: Dictionary<any>;
|
|
27
28
|
throttle: any;
|
|
28
|
-
constructor(url:
|
|
29
|
-
future(messageHash:
|
|
30
|
-
resolve(result: any, messageHash:
|
|
31
|
-
reject(result: any, messageHash?:
|
|
29
|
+
constructor(url: string, onMessageCallback: Function | undefined, onErrorCallback: Function | undefined, onCloseCallback: Function | undefined, onConnectedCallback: Function | undefined, config?: {});
|
|
30
|
+
future(messageHash: string): any;
|
|
31
|
+
resolve(result: any, messageHash: Str): any;
|
|
32
|
+
reject(result: any, messageHash?: Str): any;
|
|
32
33
|
log(...args: any[]): void;
|
|
33
34
|
connect(backoffDelay?: number): void;
|
|
34
35
|
isOpen(): boolean;
|