ccxt 4.4.69 → 4.4.71
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 -8
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +1 -6
- package/dist/cjs/src/abstract/poloniexfutures.js +1 -1
- package/dist/cjs/src/base/Exchange.js +22 -1
- package/dist/cjs/src/binance.js +107 -102
- package/dist/cjs/src/bingx.js +64 -42
- package/dist/cjs/src/bitget.js +50 -340
- package/dist/cjs/src/bitmart.js +15 -1
- package/dist/cjs/src/bitopro.js +1 -0
- package/dist/cjs/src/bitrue.js +1 -0
- package/dist/cjs/src/bybit.js +7 -0
- package/dist/cjs/src/cex.js +1 -0
- package/dist/cjs/src/coinbase.js +24 -4
- package/dist/cjs/src/coinbaseexchange.js +1 -0
- package/dist/cjs/src/deribit.js +1 -0
- package/dist/cjs/src/hashkey.js +4 -2
- package/dist/cjs/src/hyperliquid.js +18 -7
- package/dist/cjs/src/kraken.js +83 -6
- package/dist/cjs/src/kucoin.js +4 -2
- package/dist/cjs/src/mexc.js +8 -4
- package/dist/cjs/src/okx.js +62 -46
- package/dist/cjs/src/poloniex.js +1311 -81
- package/dist/cjs/src/poloniexfutures.js +1 -1
- package/dist/cjs/src/pro/binance.js +94 -94
- package/dist/cjs/src/pro/bingx.js +63 -52
- package/dist/cjs/src/pro/bitget.js +40 -7
- package/dist/cjs/src/pro/bybit.js +86 -38
- package/dist/cjs/src/pro/poloniexfutures.js +1 -1
- package/dist/cjs/src/tradeogre.js +22 -4
- package/dist/cjs/src/whitebit.js +4 -2
- package/js/ccxt.d.ts +3 -9
- package/js/ccxt.js +2 -6
- package/js/src/abstract/bingx.d.ts +1 -0
- package/js/src/abstract/bitmart.d.ts +1 -0
- package/js/src/abstract/bybit.d.ts +4 -0
- package/js/src/abstract/myokx.d.ts +3 -0
- package/js/src/abstract/okx.d.ts +3 -0
- package/js/src/abstract/poloniex.d.ts +36 -0
- package/js/src/abstract/poloniexfutures.js +6 -0
- package/js/src/abstract/tradeogre.d.ts +1 -1
- package/js/src/base/Exchange.d.ts +11 -2
- package/js/src/base/Exchange.js +22 -1
- package/js/src/base/types.d.ts +33 -2
- package/js/src/binance.d.ts +98 -97
- package/js/src/binance.js +107 -102
- package/js/src/bingx.js +64 -42
- package/js/src/bitget.d.ts +0 -1
- package/js/src/bitget.js +50 -340
- package/js/src/bitmart.d.ts +1 -0
- package/js/src/bitmart.js +15 -1
- package/js/src/bitopro.js +1 -0
- package/js/src/bitrue.js +1 -0
- package/js/src/bybit.js +7 -0
- package/js/src/cex.js +1 -0
- package/js/src/coinbase.js +24 -4
- package/js/src/coinbaseexchange.js +1 -0
- package/js/src/deribit.js +1 -0
- package/js/src/hashkey.js +4 -2
- package/js/src/hyperliquid.js +18 -7
- package/js/src/kraken.d.ts +1 -0
- package/js/src/kraken.js +83 -6
- package/js/src/kucoin.js +4 -2
- package/js/src/mexc.js +8 -4
- package/js/src/okx.d.ts +1 -0
- package/js/src/okx.js +62 -46
- package/js/src/poloniex.d.ts +109 -1
- package/js/src/poloniex.js +1311 -81
- package/js/src/poloniexfutures.js +6 -0
- package/js/src/pro/binance.d.ts +94 -94
- package/js/src/pro/binance.js +94 -94
- package/js/src/pro/bingx.js +63 -52
- package/js/src/pro/bitget.js +40 -7
- package/js/src/pro/bybit.d.ts +1 -0
- package/js/src/pro/bybit.js +86 -38
- package/js/src/pro/poloniexfutures.js +6 -0
- package/js/src/tradeogre.d.ts +1 -0
- package/js/src/tradeogre.js +22 -4
- package/js/src/whitebit.js +4 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as functions from './functions.js';
|
|
2
2
|
import WsClient from './ws/WsClient.js';
|
|
3
3
|
import { OrderBook as WsOrderBook, IndexedOrderBook, CountedOrderBook } from './ws/OrderBook.js';
|
|
4
|
-
import type { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRate, DepositWithdrawFeeNetwork, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CancellationRequest, IsolatedBorrowRate, IsolatedBorrowRates, CrossBorrowRates, CrossBorrowRate, Dict, FundingRates, LeverageTiers, Bool, int, DepositAddress, LongShortRatio, OrderBooks, OpenInterests } from './types.js';
|
|
4
|
+
import type { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRate, DepositWithdrawFeeNetwork, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CancellationRequest, IsolatedBorrowRate, IsolatedBorrowRates, CrossBorrowRates, CrossBorrowRate, Dict, FundingRates, LeverageTiers, Bool, int, DepositAddress, LongShortRatio, OrderBooks, OpenInterests, ConstructorArgs } from './types.js';
|
|
5
5
|
export type { Market, Trade, Fee, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, Bool, OrderType, OrderSide, Position, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, CrossBorrowRate, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, Conversion, DepositAddress, LongShortRatio } from './types.js';
|
|
6
6
|
import { ArrayCache, ArrayCacheByTimestamp } from './ws/Cache.js';
|
|
7
7
|
import { OrderBook as Ob } from './ws/OrderBook.js';
|
|
@@ -310,7 +310,7 @@ export default class Exchange {
|
|
|
310
310
|
crc32: typeof functions.crc32;
|
|
311
311
|
packb: typeof functions.packb;
|
|
312
312
|
urlencodeBase64: (payload: string | Uint8Array) => string;
|
|
313
|
-
constructor(userConfig?:
|
|
313
|
+
constructor(userConfig?: ConstructorArgs);
|
|
314
314
|
encodeURIComponent(...args: any[]): string;
|
|
315
315
|
checkRequiredVersion(requiredVersion: any, error?: boolean): boolean;
|
|
316
316
|
throttle(cost?: any): any;
|
|
@@ -609,6 +609,15 @@ export default class Exchange {
|
|
|
609
609
|
handleParamInteger2(params: object, paramName1: string, paramName2: string, defaultValue?: Int): [Int, object];
|
|
610
610
|
handleParamBool(params: object, paramName: string, defaultValue?: Bool): [Bool, object];
|
|
611
611
|
handleParamBool2(params: object, paramName1: string, paramName2: string, defaultValue?: Bool): [Bool, object];
|
|
612
|
+
/**
|
|
613
|
+
* @param {object} params - extra parameters
|
|
614
|
+
* @param {object} request - existing dictionary of request
|
|
615
|
+
* @param {string} exchangeSpecificKey - the key for chain id to be set in request
|
|
616
|
+
* @param {object} currencyCode - (optional) existing dictionary of request
|
|
617
|
+
* @param {boolean} isRequired - (optional) whether that param is required to be present
|
|
618
|
+
* @returns {object[]} - returns [request, params] where request is the modified request object and params is the modified params object
|
|
619
|
+
*/
|
|
620
|
+
handleRequestNetwork(params: Dict, request: Dict, exchangeSpecificKey: string, currencyCode?: Str, isRequired?: boolean): Dict[];
|
|
612
621
|
resolvePath(path: any, params: any): any[];
|
|
613
622
|
getListFromObjectValues(objects: any, key: IndexType): any[];
|
|
614
623
|
getSymbolsForMarketType(marketType?: Str, subType?: Str, symbolWithActiveStatus?: boolean, symbolWithUnknownStatus?: boolean): any[];
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -338,6 +338,9 @@ export default class Exchange {
|
|
|
338
338
|
}
|
|
339
339
|
this.newUpdates = (this.options.newUpdates !== undefined) ? this.options.newUpdates : true;
|
|
340
340
|
this.afterConstruct();
|
|
341
|
+
if (this.safeBool(userConfig, 'sandbox') || this.safeBool(userConfig, 'testnet')) {
|
|
342
|
+
this.setSandboxMode(true);
|
|
343
|
+
}
|
|
341
344
|
}
|
|
342
345
|
encodeURIComponent(...args) {
|
|
343
346
|
// @ts-expect-error
|
|
@@ -1568,7 +1571,6 @@ export default class Exchange {
|
|
|
1568
1571
|
},
|
|
1569
1572
|
'commonCurrencies': {
|
|
1570
1573
|
'XBT': 'BTC',
|
|
1571
|
-
'BCC': 'BCH',
|
|
1572
1574
|
'BCHSV': 'BSV',
|
|
1573
1575
|
},
|
|
1574
1576
|
'precisionMode': TICK_SIZE,
|
|
@@ -4129,6 +4131,25 @@ export default class Exchange {
|
|
|
4129
4131
|
}
|
|
4130
4132
|
return [value, params];
|
|
4131
4133
|
}
|
|
4134
|
+
/**
|
|
4135
|
+
* @param {object} params - extra parameters
|
|
4136
|
+
* @param {object} request - existing dictionary of request
|
|
4137
|
+
* @param {string} exchangeSpecificKey - the key for chain id to be set in request
|
|
4138
|
+
* @param {object} currencyCode - (optional) existing dictionary of request
|
|
4139
|
+
* @param {boolean} isRequired - (optional) whether that param is required to be present
|
|
4140
|
+
* @returns {object[]} - returns [request, params] where request is the modified request object and params is the modified params object
|
|
4141
|
+
*/
|
|
4142
|
+
handleRequestNetwork(params, request, exchangeSpecificKey, currencyCode = undefined, isRequired = false) {
|
|
4143
|
+
let networkCode = undefined;
|
|
4144
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
4145
|
+
if (networkCode !== undefined) {
|
|
4146
|
+
request[exchangeSpecificKey] = this.networkCodeToId(networkCode, currencyCode);
|
|
4147
|
+
}
|
|
4148
|
+
else if (isRequired) {
|
|
4149
|
+
throw new ArgumentsRequired(this.id + ' - "network" param is required for this request');
|
|
4150
|
+
}
|
|
4151
|
+
return [request, params];
|
|
4152
|
+
}
|
|
4132
4153
|
resolvePath(path, params) {
|
|
4133
4154
|
return [
|
|
4134
4155
|
this.implodeParams(path, params),
|
package/js/src/base/types.d.ts
CHANGED
|
@@ -542,9 +542,9 @@ export interface MarginModes extends Dictionary<MarginMode> {
|
|
|
542
542
|
}
|
|
543
543
|
export interface OptionChain extends Dictionary<Option> {
|
|
544
544
|
}
|
|
545
|
-
export interface IsolatedBorrowRates extends Dictionary<
|
|
545
|
+
export interface IsolatedBorrowRates extends Dictionary<IsolatedBorrowRate> {
|
|
546
546
|
}
|
|
547
|
-
export interface CrossBorrowRates extends Dictionary<
|
|
547
|
+
export interface CrossBorrowRates extends Dictionary<CrossBorrowRate> {
|
|
548
548
|
}
|
|
549
549
|
export interface LeverageTiers extends Dictionary<LeverageTier[]> {
|
|
550
550
|
}
|
|
@@ -555,3 +555,34 @@ export declare type OHLCVC = [Num, Num, Num, Num, Num, Num, Num];
|
|
|
555
555
|
export declare type implicitReturnType = any;
|
|
556
556
|
export declare type Market = MarketInterface | undefined;
|
|
557
557
|
export declare type Currency = CurrencyInterface | undefined;
|
|
558
|
+
interface BaseConstructorArgs {
|
|
559
|
+
apiKey?: string;
|
|
560
|
+
secret?: string;
|
|
561
|
+
password?: string;
|
|
562
|
+
privateKey?: string;
|
|
563
|
+
walletAddress?: string;
|
|
564
|
+
uid?: string;
|
|
565
|
+
verbose?: boolean;
|
|
566
|
+
sandbox?: boolean;
|
|
567
|
+
testnet?: boolean;
|
|
568
|
+
options?: Dict;
|
|
569
|
+
enableRateLimit?: boolean;
|
|
570
|
+
httpsProxy?: string;
|
|
571
|
+
socksProxy?: string;
|
|
572
|
+
wssProxy?: string;
|
|
573
|
+
proxy?: string;
|
|
574
|
+
rateLimit?: number;
|
|
575
|
+
commonCurrencies?: Dict;
|
|
576
|
+
userAgent?: string;
|
|
577
|
+
userAgents?: Dict;
|
|
578
|
+
timeout?: number;
|
|
579
|
+
markets?: Dict;
|
|
580
|
+
currencies?: Dict;
|
|
581
|
+
hostname?: string;
|
|
582
|
+
urls?: Dict;
|
|
583
|
+
headers?: Dict;
|
|
584
|
+
}
|
|
585
|
+
export declare type ConstructorArgs = Partial<BaseConstructorArgs> & {
|
|
586
|
+
[key: string]: any;
|
|
587
|
+
};
|
|
588
|
+
export {};
|