ccxt 4.4.90 → 4.4.91
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 +5 -6
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -4
- package/dist/cjs/src/base/Exchange.js +9 -11
- package/dist/cjs/src/base/ws/Client.js +4 -34
- package/dist/cjs/src/binance.js +1 -1
- package/dist/cjs/src/bitmex.js +2 -1
- package/dist/cjs/src/cex.js +61 -0
- package/dist/cjs/src/cryptocom.js +21 -2
- package/dist/cjs/src/cryptomus.js +1 -1
- package/dist/cjs/src/exmo.js +14 -7
- package/dist/cjs/src/fmfwio.js +1 -1
- package/dist/cjs/src/gate.js +2 -2
- package/dist/cjs/src/hyperliquid.js +115 -59
- package/dist/cjs/src/kraken.js +29 -1
- package/dist/cjs/src/mexc.js +1 -0
- package/dist/cjs/src/modetrade.js +2 -2
- package/dist/cjs/src/paradex.js +1 -1
- package/dist/cjs/src/pro/bitstamp.js +1 -1
- package/dist/cjs/src/pro/bybit.js +6 -143
- package/dist/cjs/src/pro/kraken.js +251 -264
- package/dist/cjs/src/pro/mexc.js +0 -1
- package/js/ccxt.d.ts +2 -5
- package/js/ccxt.js +2 -4
- package/js/src/base/Exchange.d.ts +2 -1
- package/js/src/base/Exchange.js +10 -12
- package/js/src/base/ws/Client.d.ts +0 -2
- package/js/src/base/ws/Client.js +4 -34
- package/js/src/binance.js +1 -1
- package/js/src/bitmex.js +2 -1
- package/js/src/cex.js +61 -0
- package/js/src/cryptocom.js +21 -2
- package/js/src/cryptomus.js +1 -1
- package/js/src/exmo.js +14 -7
- package/js/src/fmfwio.js +2 -2
- package/js/src/gate.js +2 -2
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +115 -59
- package/js/src/kraken.js +29 -1
- package/js/src/mexc.js +1 -0
- package/js/src/modetrade.js +2 -2
- package/js/src/p2b.d.ts +1 -2
- package/js/src/paradex.js +1 -1
- package/js/src/pro/bitstamp.js +1 -1
- package/js/src/pro/bybit.d.ts +0 -1
- package/js/src/pro/bybit.js +6 -143
- package/js/src/pro/kraken.d.ts +17 -17
- package/js/src/pro/kraken.js +251 -264
- package/js/src/pro/mexc.js +0 -1
- package/js/src/tradeogre.d.ts +1 -2
- package/package.json +1 -1
- package/js/src/abstract/coinlist.d.ts +0 -60
- package/js/src/abstract/coinlist.js +0 -11
- package/js/src/coinlist.d.ts +0 -384
- package/js/src/coinlist.js +0 -2610
package/dist/cjs/src/pro/mexc.js
CHANGED
|
@@ -1108,7 +1108,6 @@ class mexc extends mexc$1 {
|
|
|
1108
1108
|
*/
|
|
1109
1109
|
async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1110
1110
|
await this.loadMarkets();
|
|
1111
|
-
params = this.omit(params, 'type');
|
|
1112
1111
|
let messageHash = 'orders';
|
|
1113
1112
|
let market = undefined;
|
|
1114
1113
|
if (symbol !== undefined) {
|
package/js/ccxt.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
|
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, LongShortRatio, OrderBooks, OpenInterests, ConstructorArgs } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.4.
|
|
7
|
+
declare const version = "4.4.90";
|
|
8
8
|
import alpaca from './src/alpaca.js';
|
|
9
9
|
import apex from './src/apex.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
|
@@ -46,7 +46,6 @@ import coinbaseinternational from './src/coinbaseinternational.js';
|
|
|
46
46
|
import coincatch from './src/coincatch.js';
|
|
47
47
|
import coincheck from './src/coincheck.js';
|
|
48
48
|
import coinex from './src/coinex.js';
|
|
49
|
-
import coinlist from './src/coinlist.js';
|
|
50
49
|
import coinmate from './src/coinmate.js';
|
|
51
50
|
import coinmetro from './src/coinmetro.js';
|
|
52
51
|
import coinone from './src/coinone.js';
|
|
@@ -226,7 +225,6 @@ declare const exchanges: {
|
|
|
226
225
|
coincatch: typeof coincatch;
|
|
227
226
|
coincheck: typeof coincheck;
|
|
228
227
|
coinex: typeof coinex;
|
|
229
|
-
coinlist: typeof coinlist;
|
|
230
228
|
coinmate: typeof coinmate;
|
|
231
229
|
coinmetro: typeof coinmetro;
|
|
232
230
|
coinone: typeof coinone;
|
|
@@ -489,7 +487,6 @@ declare const ccxt: {
|
|
|
489
487
|
coincatch: typeof coincatch;
|
|
490
488
|
coincheck: typeof coincheck;
|
|
491
489
|
coinex: typeof coinex;
|
|
492
|
-
coinlist: typeof coinlist;
|
|
493
490
|
coinmate: typeof coinmate;
|
|
494
491
|
coinmetro: typeof coinmetro;
|
|
495
492
|
coinone: typeof coinone;
|
|
@@ -555,5 +552,5 @@ declare const ccxt: {
|
|
|
555
552
|
zaif: typeof zaif;
|
|
556
553
|
zonda: typeof zonda;
|
|
557
554
|
} & typeof functions & typeof errors;
|
|
558
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, ConstructorArgs, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketMarginModes, MarketInterface, Trade, Order, OrderBook, OrderBooks, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, OpenInterests, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, LongShortRatio, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bittrade, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex,
|
|
555
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, ConstructorArgs, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketMarginModes, MarketInterface, Trade, Order, OrderBook, OrderBooks, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, OpenInterests, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, LongShortRatio, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bittrade, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, ellipx, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mercado, mexc, modetrade, myokx, ndax, novadax, oceanex, okcoin, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
|
|
559
556
|
export default ccxt;
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.4.
|
|
41
|
+
const version = '4.4.90';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import alpaca from './src/alpaca.js';
|
|
@@ -82,7 +82,6 @@ import coinbaseinternational from './src/coinbaseinternational.js';
|
|
|
82
82
|
import coincatch from './src/coincatch.js';
|
|
83
83
|
import coincheck from './src/coincheck.js';
|
|
84
84
|
import coinex from './src/coinex.js';
|
|
85
|
-
import coinlist from './src/coinlist.js';
|
|
86
85
|
import coinmate from './src/coinmate.js';
|
|
87
86
|
import coinmetro from './src/coinmetro.js';
|
|
88
87
|
import coinone from './src/coinone.js';
|
|
@@ -263,7 +262,6 @@ const exchanges = {
|
|
|
263
262
|
'coincatch': coincatch,
|
|
264
263
|
'coincheck': coincheck,
|
|
265
264
|
'coinex': coinex,
|
|
266
|
-
'coinlist': coinlist,
|
|
267
265
|
'coinmate': coinmate,
|
|
268
266
|
'coinmetro': coinmetro,
|
|
269
267
|
'coinone': coinone,
|
|
@@ -416,6 +414,6 @@ pro.exchanges = Object.keys(pro);
|
|
|
416
414
|
pro['Exchange'] = Exchange; // now the same for rest and ts
|
|
417
415
|
//-----------------------------------------------------------------------------
|
|
418
416
|
const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
|
|
419
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bittrade, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex,
|
|
417
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bittrade, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, ellipx, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mercado, mexc, modetrade, myokx, ndax, novadax, oceanex, okcoin, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
|
|
420
418
|
export default ccxt;
|
|
421
419
|
//-----------------------------------------------------------------------------
|
|
@@ -375,7 +375,7 @@ export default class Exchange {
|
|
|
375
375
|
onConnected(client: any, message?: any): void;
|
|
376
376
|
onError(client: any, error: any): void;
|
|
377
377
|
onClose(client: any, error: any): void;
|
|
378
|
-
close(): Promise<
|
|
378
|
+
close(): Promise<any[]>;
|
|
379
379
|
loadOrderBook(client: any, messageHash: string, symbol: string, limit?: Int, params?: {}): Promise<void>;
|
|
380
380
|
convertToBigInt(value: string): bigint;
|
|
381
381
|
stringToCharsArray(value: string): string[];
|
|
@@ -444,6 +444,7 @@ export default class Exchange {
|
|
|
444
444
|
watchMyLiquidations(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
|
|
445
445
|
watchMyLiquidationsForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
|
|
446
446
|
watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
447
|
+
unWatchOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
447
448
|
unWatchTrades(symbol: string, params?: {}): Promise<any>;
|
|
448
449
|
watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
449
450
|
unWatchTradesForSymbols(symbols: string[], params?: {}): Promise<any>;
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -11,7 +11,7 @@ const { isNode, selfIsDefined, deepExtend, extend, clone, flatten, unique, index
|
|
|
11
11
|
import { keys as keysFunc, values as valuesFunc, vwap as vwapFunc } from './functions.js';
|
|
12
12
|
// import exceptions from "./errors.js"
|
|
13
13
|
import { // eslint-disable-line object-curly-newline
|
|
14
|
-
ExchangeError, BadSymbol, NullResponse, InvalidAddress, InvalidOrder, NotSupported, OperationFailed, BadResponse, AuthenticationError, DDoSProtection, RequestTimeout, NetworkError, InvalidProxySettings, ExchangeNotAvailable, ArgumentsRequired, RateLimitExceeded, BadRequest,
|
|
14
|
+
ExchangeError, BadSymbol, NullResponse, InvalidAddress, InvalidOrder, NotSupported, OperationFailed, BadResponse, AuthenticationError, DDoSProtection, RequestTimeout, NetworkError, InvalidProxySettings, ExchangeNotAvailable, ArgumentsRequired, RateLimitExceeded, BadRequest, UnsubscribeError } from "./errors.js";
|
|
15
15
|
import { Precise } from './Precise.js';
|
|
16
16
|
//-----------------------------------------------------------------------------
|
|
17
17
|
import WsClient from './ws/WsClient.js';
|
|
@@ -1096,17 +1096,12 @@ export default class Exchange {
|
|
|
1096
1096
|
async close() {
|
|
1097
1097
|
const clients = Object.values(this.clients || {});
|
|
1098
1098
|
const closedClients = [];
|
|
1099
|
-
for (let i = 0; i < clients.length; i++) {
|
|
1100
|
-
const client = clients[i];
|
|
1101
|
-
client.error = new ExchangeClosedByUser(this.id + ' closedByUser');
|
|
1102
|
-
closedClients.push(client.close());
|
|
1103
|
-
}
|
|
1104
|
-
await Promise.all(closedClients);
|
|
1105
1099
|
for (let i = 0; i < clients.length; i++) {
|
|
1106
1100
|
const client = clients[i];
|
|
1107
1101
|
delete this.clients[client.url];
|
|
1102
|
+
closedClients.push(client.close());
|
|
1108
1103
|
}
|
|
1109
|
-
return;
|
|
1104
|
+
return Promise.all(closedClients);
|
|
1110
1105
|
}
|
|
1111
1106
|
async loadOrderBook(client, messageHash, symbol, limit = undefined, params = {}) {
|
|
1112
1107
|
if (!(symbol in this.orderbooks)) {
|
|
@@ -2092,6 +2087,9 @@ export default class Exchange {
|
|
|
2092
2087
|
async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
2093
2088
|
throw new NotSupported(this.id + ' watchTrades() is not supported yet');
|
|
2094
2089
|
}
|
|
2090
|
+
async unWatchOrders(symbol = undefined, params = {}) {
|
|
2091
|
+
throw new NotSupported(this.id + ' unWatchOrders() is not supported yet');
|
|
2092
|
+
}
|
|
2095
2093
|
async unWatchTrades(symbol, params = {}) {
|
|
2096
2094
|
throw new NotSupported(this.id + ' unWatchTrades() is not supported yet');
|
|
2097
2095
|
}
|
|
@@ -7156,7 +7154,7 @@ export default class Exchange {
|
|
|
7156
7154
|
const symbolAndTimeFrame = symbolsAndTimeFrames[i];
|
|
7157
7155
|
const symbol = this.safeString(symbolAndTimeFrame, 0);
|
|
7158
7156
|
const timeframe = this.safeString(symbolAndTimeFrame, 1);
|
|
7159
|
-
if (symbol in this.ohlcvs) {
|
|
7157
|
+
if ((this.ohlcvs !== undefined) && (symbol in this.ohlcvs)) {
|
|
7160
7158
|
if (timeframe in this.ohlcvs[symbol]) {
|
|
7161
7159
|
delete this.ohlcvs[symbol][timeframe];
|
|
7162
7160
|
}
|
|
@@ -7184,7 +7182,7 @@ export default class Exchange {
|
|
|
7184
7182
|
}
|
|
7185
7183
|
}
|
|
7186
7184
|
else {
|
|
7187
|
-
if (topic === 'myTrades') {
|
|
7185
|
+
if (topic === 'myTrades' && (this.myTrades !== undefined)) {
|
|
7188
7186
|
// don't reset this.myTrades directly here
|
|
7189
7187
|
// because in c# we need to use a different object (thread-safe dict)
|
|
7190
7188
|
const keys = Object.keys(this.myTrades);
|
|
@@ -7195,7 +7193,7 @@ export default class Exchange {
|
|
|
7195
7193
|
}
|
|
7196
7194
|
}
|
|
7197
7195
|
}
|
|
7198
|
-
else if (topic === 'orders') {
|
|
7196
|
+
else if (topic === 'orders' && (this.orders !== undefined)) {
|
|
7199
7197
|
const orderSymbols = Object.keys(this.orders);
|
|
7200
7198
|
for (let i = 0; i < orderSymbols.length; i++) {
|
|
7201
7199
|
const orderSymbol = orderSymbols[i];
|
|
@@ -7204,7 +7202,7 @@ export default class Exchange {
|
|
|
7204
7202
|
}
|
|
7205
7203
|
}
|
|
7206
7204
|
}
|
|
7207
|
-
else if (topic === 'ticker') {
|
|
7205
|
+
else if (topic === 'ticker' && (this.tickers !== undefined)) {
|
|
7208
7206
|
const tickerSymbols = Object.keys(this.tickers);
|
|
7209
7207
|
for (let i = 0; i < tickerSymbols.length; i++) {
|
|
7210
7208
|
const tickerSymbol = tickerSymbols[i];
|
package/js/src/base/ws/Client.js
CHANGED
|
@@ -11,7 +11,6 @@ import { isNode, isJsonEncodedObject, deepExtend, milliseconds, } from '../../ba
|
|
|
11
11
|
import { utf8 } from '../../static_dependencies/scure-base/index.js';
|
|
12
12
|
export default class Client {
|
|
13
13
|
constructor(url, onMessageCallback, onErrorCallback, onCloseCallback, onConnectedCallback, config = {}) {
|
|
14
|
-
this.useMessageQueue = false;
|
|
15
14
|
this.verbose = false;
|
|
16
15
|
const defaults = {
|
|
17
16
|
url,
|
|
@@ -25,8 +24,6 @@ export default class Client {
|
|
|
25
24
|
futures: {},
|
|
26
25
|
subscriptions: {},
|
|
27
26
|
rejections: {},
|
|
28
|
-
messageQueue: {},
|
|
29
|
-
useMessageQueue: false,
|
|
30
27
|
connected: undefined,
|
|
31
28
|
error: undefined,
|
|
32
29
|
connectionStarted: undefined,
|
|
@@ -57,15 +54,6 @@ export default class Client {
|
|
|
57
54
|
if (messageHash in this.rejections) {
|
|
58
55
|
future.reject(this.rejections[messageHash]);
|
|
59
56
|
delete this.rejections[messageHash];
|
|
60
|
-
delete this.messageQueue[messageHash];
|
|
61
|
-
return future;
|
|
62
|
-
}
|
|
63
|
-
if (this.useMessageQueue) {
|
|
64
|
-
const queue = this.messageQueue[messageHash];
|
|
65
|
-
if (queue && queue.length) {
|
|
66
|
-
future.resolve(queue.shift());
|
|
67
|
-
delete this.futures[messageHash];
|
|
68
|
-
}
|
|
69
57
|
}
|
|
70
58
|
return future;
|
|
71
59
|
}
|
|
@@ -73,27 +61,10 @@ export default class Client {
|
|
|
73
61
|
if (this.verbose && (messageHash === undefined)) {
|
|
74
62
|
this.log(new Date(), 'resolve received undefined messageHash');
|
|
75
63
|
}
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const queue = this.messageQueue[messageHash];
|
|
81
|
-
queue.push(result);
|
|
82
|
-
while (queue.length > 10) { // limit size to 10 messages in the queue
|
|
83
|
-
queue.shift();
|
|
84
|
-
}
|
|
85
|
-
if ((messageHash !== undefined) && (messageHash in this.futures)) {
|
|
86
|
-
const promise = this.futures[messageHash];
|
|
87
|
-
promise.resolve(queue.shift());
|
|
88
|
-
delete this.futures[messageHash];
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
if (messageHash in this.futures) {
|
|
93
|
-
const promise = this.futures[messageHash];
|
|
94
|
-
promise.resolve(result);
|
|
95
|
-
delete this.futures[messageHash];
|
|
96
|
-
}
|
|
64
|
+
if ((messageHash !== undefined) && (messageHash in this.futures)) {
|
|
65
|
+
const promise = this.futures[messageHash];
|
|
66
|
+
promise.resolve(result);
|
|
67
|
+
delete this.futures[messageHash];
|
|
97
68
|
}
|
|
98
69
|
return result;
|
|
99
70
|
}
|
|
@@ -134,7 +105,6 @@ export default class Client {
|
|
|
134
105
|
reset(error) {
|
|
135
106
|
this.clearConnectionTimeout();
|
|
136
107
|
this.clearPingInterval();
|
|
137
|
-
this.messageQueue = {};
|
|
138
108
|
this.reject(error);
|
|
139
109
|
}
|
|
140
110
|
onConnectionTimeout() {
|
package/js/src/binance.js
CHANGED
|
@@ -4000,7 +4000,7 @@ export default class binance extends Exchange {
|
|
|
4000
4000
|
//
|
|
4001
4001
|
// {
|
|
4002
4002
|
// "symbol": "BTCUSDT",
|
|
4003
|
-
// "markPrice": "11793.
|
|
4003
|
+
// "markPrice": "11793.63104561", // mark price
|
|
4004
4004
|
// "indexPrice": "11781.80495970", // index price
|
|
4005
4005
|
// "estimatedSettlePrice": "11781.16138815", // Estimated Settle Price, only useful in the last hour before the settlement starts
|
|
4006
4006
|
// "lastFundingRate": "0.00038246", // This is the lastest estimated funding rate
|
package/js/src/bitmex.js
CHANGED
|
@@ -38,6 +38,7 @@ export default class bitmex extends Exchange {
|
|
|
38
38
|
'swap': true,
|
|
39
39
|
'future': true,
|
|
40
40
|
'option': false,
|
|
41
|
+
'index': true,
|
|
41
42
|
'addMargin': undefined,
|
|
42
43
|
'cancelAllOrders': true,
|
|
43
44
|
'cancelAllOrdersAfter': true,
|
|
@@ -419,8 +420,8 @@ export default class bitmex extends Exchange {
|
|
|
419
420
|
// // "mediumPrecision": "8",
|
|
420
421
|
// // "shorterPrecision": "4",
|
|
421
422
|
// // "symbol": "₿",
|
|
422
|
-
// // "weight": "1",
|
|
423
423
|
// // "tickLog": "0",
|
|
424
|
+
// // "weight": "1",
|
|
424
425
|
// "enabled": true,
|
|
425
426
|
// "isMarginCurrency": true,
|
|
426
427
|
// "minDepositAmount": "10000",
|
package/js/src/cex.js
CHANGED
|
@@ -30,34 +30,95 @@ export default class cex extends Exchange {
|
|
|
30
30
|
'swap': false,
|
|
31
31
|
'future': false,
|
|
32
32
|
'option': false,
|
|
33
|
+
'addMargin': false,
|
|
34
|
+
'borrowCrossMargin': false,
|
|
35
|
+
'borrowIsolatedMargin': false,
|
|
36
|
+
'borrowMargin': false,
|
|
33
37
|
'cancelAllOrders': true,
|
|
34
38
|
'cancelOrder': true,
|
|
39
|
+
'closeAllPositions': false,
|
|
40
|
+
'closePosition': false,
|
|
35
41
|
'createOrder': true,
|
|
42
|
+
'createOrderWithTakeProfitAndStopLoss': false,
|
|
43
|
+
'createOrderWithTakeProfitAndStopLossWs': false,
|
|
44
|
+
'createPostOnlyOrder': false,
|
|
36
45
|
'createReduceOnlyOrder': false,
|
|
37
46
|
'createStopOrder': true,
|
|
38
47
|
'createTriggerOrder': true,
|
|
39
48
|
'fetchAccounts': true,
|
|
40
49
|
'fetchBalance': true,
|
|
50
|
+
'fetchBorrowInterest': false,
|
|
51
|
+
'fetchBorrowRate': false,
|
|
52
|
+
'fetchBorrowRateHistories': false,
|
|
53
|
+
'fetchBorrowRateHistory': false,
|
|
54
|
+
'fetchBorrowRates': false,
|
|
55
|
+
'fetchBorrowRatesPerSymbol': false,
|
|
41
56
|
'fetchClosedOrder': true,
|
|
42
57
|
'fetchClosedOrders': true,
|
|
58
|
+
'fetchCrossBorrowRate': false,
|
|
59
|
+
'fetchCrossBorrowRates': false,
|
|
43
60
|
'fetchCurrencies': true,
|
|
44
61
|
'fetchDepositAddress': true,
|
|
45
62
|
'fetchDepositsWithdrawals': true,
|
|
46
63
|
'fetchFundingHistory': false,
|
|
64
|
+
'fetchFundingInterval': false,
|
|
65
|
+
'fetchFundingIntervals': false,
|
|
47
66
|
'fetchFundingRate': false,
|
|
48
67
|
'fetchFundingRateHistory': false,
|
|
49
68
|
'fetchFundingRates': false,
|
|
69
|
+
'fetchGreeks': false,
|
|
70
|
+
'fetchIndexOHLCV': false,
|
|
71
|
+
'fetchIsolatedBorrowRate': false,
|
|
72
|
+
'fetchIsolatedBorrowRates': false,
|
|
73
|
+
'fetchIsolatedPositions': false,
|
|
50
74
|
'fetchLedger': true,
|
|
75
|
+
'fetchLeverage': false,
|
|
76
|
+
'fetchLeverages': false,
|
|
77
|
+
'fetchLeverageTiers': false,
|
|
78
|
+
'fetchLiquidations': false,
|
|
79
|
+
'fetchLongShortRatio': false,
|
|
80
|
+
'fetchLongShortRatioHistory': false,
|
|
81
|
+
'fetchMarginAdjustmentHistory': false,
|
|
82
|
+
'fetchMarginMode': false,
|
|
83
|
+
'fetchMarginModes': false,
|
|
84
|
+
'fetchMarketLeverageTiers': false,
|
|
51
85
|
'fetchMarkets': true,
|
|
86
|
+
'fetchMarkOHLCV': false,
|
|
87
|
+
'fetchMarkPrices': false,
|
|
88
|
+
'fetchMyLiquidations': false,
|
|
89
|
+
'fetchMySettlementHistory': false,
|
|
52
90
|
'fetchOHLCV': true,
|
|
91
|
+
'fetchOpenInterest': false,
|
|
92
|
+
'fetchOpenInterestHistory': false,
|
|
93
|
+
'fetchOpenInterests': false,
|
|
53
94
|
'fetchOpenOrder': true,
|
|
54
95
|
'fetchOpenOrders': true,
|
|
96
|
+
'fetchOption': false,
|
|
97
|
+
'fetchOptionChain': false,
|
|
55
98
|
'fetchOrderBook': true,
|
|
99
|
+
'fetchPosition': false,
|
|
100
|
+
'fetchPositionHistory': false,
|
|
101
|
+
'fetchPositionMode': false,
|
|
102
|
+
'fetchPositions': false,
|
|
103
|
+
'fetchPositionsForSymbol': false,
|
|
104
|
+
'fetchPositionsHistory': false,
|
|
105
|
+
'fetchPositionsRisk': false,
|
|
106
|
+
'fetchPremiumIndexOHLCV': false,
|
|
107
|
+
'fetchSettlementHistory': false,
|
|
56
108
|
'fetchTicker': true,
|
|
57
109
|
'fetchTickers': true,
|
|
58
110
|
'fetchTime': true,
|
|
59
111
|
'fetchTrades': true,
|
|
60
112
|
'fetchTradingFees': true,
|
|
113
|
+
'fetchVolatilityHistory': false,
|
|
114
|
+
'reduceMargin': false,
|
|
115
|
+
'repayCrossMargin': false,
|
|
116
|
+
'repayIsolatedMargin': false,
|
|
117
|
+
'repayMargin': false,
|
|
118
|
+
'setLeverage': false,
|
|
119
|
+
'setMargin': false,
|
|
120
|
+
'setMarginMode': false,
|
|
121
|
+
'setPositionMode': false,
|
|
61
122
|
'transfer': true,
|
|
62
123
|
},
|
|
63
124
|
'urls': {
|
package/js/src/cryptocom.js
CHANGED
|
@@ -534,7 +534,26 @@ export default class cryptocom extends Exchange {
|
|
|
534
534
|
if (!this.checkRequiredCredentials(false)) {
|
|
535
535
|
return undefined;
|
|
536
536
|
}
|
|
537
|
-
|
|
537
|
+
let skipFetchCurrencies = false;
|
|
538
|
+
[skipFetchCurrencies, params] = this.handleOptionAndParams(params, 'fetchCurrencies', 'skipFetchCurrencies', false);
|
|
539
|
+
if (skipFetchCurrencies) {
|
|
540
|
+
// sub-accounts can't access this endpoint
|
|
541
|
+
return undefined;
|
|
542
|
+
}
|
|
543
|
+
let response = {};
|
|
544
|
+
try {
|
|
545
|
+
response = await this.v1PrivatePostPrivateGetCurrencyNetworks(params);
|
|
546
|
+
}
|
|
547
|
+
catch (e) {
|
|
548
|
+
if (e instanceof ExchangeError) {
|
|
549
|
+
// sub-accounts can't access this endpoint
|
|
550
|
+
// {"code":"10001","msg":"SYS_ERROR"}
|
|
551
|
+
return undefined;
|
|
552
|
+
}
|
|
553
|
+
throw e;
|
|
554
|
+
// do nothing
|
|
555
|
+
// sub-accounts can't access this endpoint
|
|
556
|
+
}
|
|
538
557
|
//
|
|
539
558
|
// {
|
|
540
559
|
// "id": "1747502328559",
|
|
@@ -559,7 +578,7 @@ export default class cryptocom extends Exchange {
|
|
|
559
578
|
// "network_id": "CRONOS",
|
|
560
579
|
// "withdrawal_fee": "0.18000000",
|
|
561
580
|
// "withdraw_enabled": true,
|
|
562
|
-
// "min_withdrawal_amount": "0.
|
|
581
|
+
// "min_withdrawal_amount": "0.35",
|
|
563
582
|
// "deposit_enabled": true,
|
|
564
583
|
// "confirmation_required": "15"
|
|
565
584
|
// },
|
package/js/src/cryptomus.js
CHANGED
|
@@ -463,7 +463,7 @@ export default class cryptomus extends Exchange {
|
|
|
463
463
|
//
|
|
464
464
|
// {
|
|
465
465
|
// "currency_pair": "XMR_USDT",
|
|
466
|
-
// "last_price": "158.
|
|
466
|
+
// "last_price": "158.04829772",
|
|
467
467
|
// "base_volume": "0.35185785",
|
|
468
468
|
// "quote_volume": "55.523761128544"
|
|
469
469
|
// }
|
package/js/src/exmo.js
CHANGED
|
@@ -800,7 +800,8 @@ export default class exmo extends Exchange {
|
|
|
800
800
|
* @returns {object[]} an array of objects representing market data
|
|
801
801
|
*/
|
|
802
802
|
async fetchMarkets(params = {}) {
|
|
803
|
-
const
|
|
803
|
+
const promises = [];
|
|
804
|
+
promises.push(this.publicGetPairSettings(params));
|
|
804
805
|
//
|
|
805
806
|
// {
|
|
806
807
|
// "BTC_USD":{
|
|
@@ -817,8 +818,9 @@ export default class exmo extends Exchange {
|
|
|
817
818
|
// }
|
|
818
819
|
//
|
|
819
820
|
let marginPairsDict = {};
|
|
820
|
-
|
|
821
|
-
|
|
821
|
+
const fetchMargin = this.checkRequiredCredentials(false);
|
|
822
|
+
if (fetchMargin) {
|
|
823
|
+
promises.push(this.privatePostMarginPairList(params));
|
|
822
824
|
//
|
|
823
825
|
// {
|
|
824
826
|
// "pairs": [
|
|
@@ -848,15 +850,20 @@ export default class exmo extends Exchange {
|
|
|
848
850
|
// ]
|
|
849
851
|
// }
|
|
850
852
|
//
|
|
851
|
-
|
|
853
|
+
}
|
|
854
|
+
const responses = await Promise.all(promises);
|
|
855
|
+
const spotResponse = responses[0];
|
|
856
|
+
if (fetchMargin) {
|
|
857
|
+
const marginPairs = responses[1];
|
|
858
|
+
const pairs = this.safeList(marginPairs, 'pairs');
|
|
852
859
|
marginPairsDict = this.indexBy(pairs, 'name');
|
|
853
860
|
}
|
|
854
|
-
const keys = Object.keys(
|
|
861
|
+
const keys = Object.keys(spotResponse);
|
|
855
862
|
const result = [];
|
|
856
863
|
for (let i = 0; i < keys.length; i++) {
|
|
857
864
|
const id = keys[i];
|
|
858
|
-
const market =
|
|
859
|
-
const marginMarket = this.
|
|
865
|
+
const market = spotResponse[id];
|
|
866
|
+
const marginMarket = this.safeDict(marginPairsDict, id);
|
|
860
867
|
const symbol = id.replace('_', '/');
|
|
861
868
|
const [baseId, quoteId] = symbol.split('/');
|
|
862
869
|
const base = this.safeCurrencyCode(baseId);
|
package/js/src/fmfwio.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
5
|
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
6
|
|
|
7
|
-
//
|
|
7
|
+
// ----------------------------------------------------------------------------
|
|
8
8
|
import hitbtc from './hitbtc.js';
|
|
9
|
-
//
|
|
9
|
+
// ----------------------------------------------------------------------------
|
|
10
10
|
export default class fmfwio extends hitbtc {
|
|
11
11
|
describe() {
|
|
12
12
|
return this.deepExtend(super.describe(), {
|
package/js/src/gate.js
CHANGED
|
@@ -1235,7 +1235,7 @@ export default class gate extends Exchange {
|
|
|
1235
1235
|
this.fetchOptionMarkets(params),
|
|
1236
1236
|
];
|
|
1237
1237
|
if (!sandboxMode) {
|
|
1238
|
-
// gate
|
|
1238
|
+
// gate doesn't have a sandbox for spot markets
|
|
1239
1239
|
const mainnetOnly = [this.fetchSpotMarkets(params)];
|
|
1240
1240
|
rawPromises = this.arrayConcat(rawPromises, mainnetOnly);
|
|
1241
1241
|
}
|
|
@@ -1655,7 +1655,7 @@ export default class gate extends Exchange {
|
|
|
1655
1655
|
'contractSize': this.parseNumber('1'),
|
|
1656
1656
|
'expiry': expiry,
|
|
1657
1657
|
'expiryDatetime': this.iso8601(expiry),
|
|
1658
|
-
'strike': strike,
|
|
1658
|
+
'strike': this.parseNumber(strike),
|
|
1659
1659
|
'optionType': optionType,
|
|
1660
1660
|
'precision': {
|
|
1661
1661
|
'amount': this.parseNumber('1'),
|
package/js/src/hyperliquid.d.ts
CHANGED
|
@@ -204,6 +204,7 @@ export default class hyperliquid extends Exchange {
|
|
|
204
204
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
205
205
|
*/
|
|
206
206
|
createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
|
|
207
|
+
createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: string, price?: Str, params?: {}): Dict;
|
|
207
208
|
createOrdersRequest(orders: any, params?: {}): Dict;
|
|
208
209
|
/**
|
|
209
210
|
* @method
|