ccxt 4.5.31 → 4.5.32
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 +6 -5
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +6 -1
- package/dist/cjs/src/abstract/aster.js +11 -0
- package/dist/cjs/src/aster.js +3802 -0
- package/dist/cjs/src/backpack.js +1 -1
- package/dist/cjs/src/base/Exchange.js +19 -1
- package/dist/cjs/src/bigone.js +1 -1
- package/dist/cjs/src/binance.js +1 -0
- package/dist/cjs/src/bingx.js +73 -0
- package/dist/cjs/src/cryptomus.js +1 -1
- package/dist/cjs/src/okx.js +14 -5
- package/dist/cjs/src/pro/aster.js +1046 -0
- package/dist/cjs/src/pro/dydx.js +1 -1
- package/js/ccxt.d.ts +8 -2
- package/js/ccxt.js +6 -2
- package/js/src/abstract/aster.d.ts +88 -0
- package/js/src/abstract/aster.js +11 -0
- package/js/src/abstract/binance.d.ts +1 -0
- package/js/src/abstract/binancecoinm.d.ts +1 -0
- package/js/src/abstract/binanceus.d.ts +1 -0
- package/js/src/abstract/binanceusdm.d.ts +1 -0
- package/js/src/aster.d.ts +563 -0
- package/js/src/aster.js +3801 -0
- package/js/src/backpack.js +1 -1
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +19 -0
- package/js/src/bigone.js +1 -1
- package/js/src/binance.js +1 -0
- package/js/src/bingx.d.ts +12 -1
- package/js/src/bingx.js +73 -0
- package/js/src/cryptomus.js +1 -1
- package/js/src/okx.js +14 -5
- package/js/src/pro/aster.d.ts +273 -0
- package/js/src/pro/aster.js +1045 -0
- package/js/src/pro/dydx.js +1 -1
- package/package.json +1 -1
package/js/src/backpack.js
CHANGED
|
@@ -522,7 +522,7 @@ export default class backpack extends Exchange {
|
|
|
522
522
|
// "depositEnabled": true,
|
|
523
523
|
// "displayName": "Jito",
|
|
524
524
|
// "maximumWithdrawal": null,
|
|
525
|
-
// "minimumDeposit": "0.
|
|
525
|
+
// "minimumDeposit": "0.28",
|
|
526
526
|
// "minimumWithdrawal": "0.58",
|
|
527
527
|
// "withdrawEnabled": true,
|
|
528
528
|
// "withdrawalFee": "0.29"
|
|
@@ -392,6 +392,7 @@ export default class Exchange {
|
|
|
392
392
|
fixStringifiedJsonMembers(content: string): string;
|
|
393
393
|
ethAbiEncode(types: any, args: any): Uint8Array;
|
|
394
394
|
ethEncodeStructuredData(domain: any, messageTypes: any, messageData: any): Uint8Array;
|
|
395
|
+
ethGetAddressFromPrivateKey(privateKey: string): string;
|
|
395
396
|
retrieveStarkAccount(signature: any, accountClassHash: any, accountProxyClassHash: any): {
|
|
396
397
|
privateKey: string;
|
|
397
398
|
publicKey: string;
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -23,6 +23,8 @@ import { axolotl } from './functions/crypto.js';
|
|
|
23
23
|
import { totp } from './functions/totp.js';
|
|
24
24
|
import ethers from '../static_dependencies/ethers/index.js';
|
|
25
25
|
import { TypedDataEncoder } from '../static_dependencies/ethers/hash/index.js';
|
|
26
|
+
import { secp256k1 } from '../static_dependencies/noble-curves/secp256k1.js';
|
|
27
|
+
import { keccak_256 } from '../static_dependencies/noble-hashes/sha3.js';
|
|
26
28
|
import { SecureRandom } from '../static_dependencies/jsencrypt/lib/jsbn/rng.js';
|
|
27
29
|
import { getStarkKey, ethSigToPrivate, sign as starknetCurveSign } from '../static_dependencies/scure-starknet/index.js';
|
|
28
30
|
import init, * as zklink from '../static_dependencies/zklink/zklink-sdk-web.js';
|
|
@@ -1304,6 +1306,23 @@ export default class Exchange {
|
|
|
1304
1306
|
ethEncodeStructuredData(domain, messageTypes, messageData) {
|
|
1305
1307
|
return this.base16ToBinary(TypedDataEncoder.encode(domain, messageTypes, messageData).slice(-132));
|
|
1306
1308
|
}
|
|
1309
|
+
ethGetAddressFromPrivateKey(privateKey) {
|
|
1310
|
+
// Accepts a "0x"-prefixed hexstring private key and returns the corresponding Ethereum address
|
|
1311
|
+
// Removes the "0x" prefix if present
|
|
1312
|
+
const cleanPrivateKey = this.remove0xPrefix(privateKey);
|
|
1313
|
+
// Get the public key from the private key using secp256k1 curve
|
|
1314
|
+
const publicKeyBytes = secp256k1.getPublicKey(cleanPrivateKey);
|
|
1315
|
+
// For Ethereum, we need to use the uncompressed public key (without the first byte which indicates compression)
|
|
1316
|
+
// secp256k1.getPublicKey returns compressed key, we need uncompressed
|
|
1317
|
+
const publicKeyUncompressed = secp256k1.ProjectivePoint.fromHex(publicKeyBytes).toRawBytes(false).slice(1); // Remove 0x04 prefix
|
|
1318
|
+
// Hash the public key with Keccak256
|
|
1319
|
+
const publicKeyHash = keccak_256(publicKeyUncompressed);
|
|
1320
|
+
// Take the last 20 bytes (40 hex chars)
|
|
1321
|
+
const addressBytes = publicKeyHash.slice(-20);
|
|
1322
|
+
// Convert to hex and add 0x prefix
|
|
1323
|
+
const addressHex = '0x' + this.binaryToBase16(addressBytes);
|
|
1324
|
+
return addressHex;
|
|
1325
|
+
}
|
|
1307
1326
|
retrieveStarkAccount(signature, accountClassHash, accountProxyClassHash) {
|
|
1308
1327
|
const privateKey = ethSigToPrivate(signature);
|
|
1309
1328
|
const publicKey = getStarkKey(privateKey);
|
package/js/src/bigone.js
CHANGED
|
@@ -857,7 +857,7 @@ export default class bigone extends Exchange {
|
|
|
857
857
|
'close': close,
|
|
858
858
|
'last': close,
|
|
859
859
|
'previousClose': undefined,
|
|
860
|
-
'change': this.
|
|
860
|
+
'change': this.safeString(ticker, 'daily_change'),
|
|
861
861
|
'percentage': undefined,
|
|
862
862
|
'average': undefined,
|
|
863
863
|
'baseVolume': this.safeString2(ticker, 'volume', 'volume24h'),
|
package/js/src/binance.js
CHANGED
package/js/src/bingx.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bingx.js';
|
|
2
|
-
import type { TransferEntry, Int, OrderSide, OHLCV, FundingRateHistory, Order, OrderType, OrderRequest, Str, Trade, Balances, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position, Dict, Leverage, MarginMode, Num, MarginModification, Currencies, int, TradingFeeInterface, FundingRate, FundingRates, DepositAddress } from './base/types.js';
|
|
2
|
+
import type { LeverageTier, TransferEntry, Int, OrderSide, OHLCV, FundingRateHistory, Order, OrderType, OrderRequest, Str, Trade, Balances, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position, Dict, Leverage, MarginMode, Num, MarginModification, Currencies, int, TradingFeeInterface, FundingRate, FundingRates, DepositAddress } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bingx
|
|
5
5
|
* @augments Exchange
|
|
@@ -766,6 +766,17 @@ export default class bingx extends Exchange {
|
|
|
766
766
|
fetchTradingFee(symbol: string, params?: {}): Promise<TradingFeeInterface>;
|
|
767
767
|
parseTradingFee(fee: Dict, market?: Market): TradingFeeInterface;
|
|
768
768
|
customEncode(params: any): any;
|
|
769
|
+
/**
|
|
770
|
+
* @method
|
|
771
|
+
* @name bingx#fetchMarketLeverageTiers
|
|
772
|
+
* @description retrieve information on the maximum leverage, for different trade sizes for a single market
|
|
773
|
+
* @see https://bingx-api.github.io/docs-v3/#/en/Swap/Trades%20Endpoints/Position%20and%20Maintenance%20Margin%20Ratio
|
|
774
|
+
* @param {string} symbol unified market symbol
|
|
775
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
776
|
+
* @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/?id=leverage-tiers-structure}
|
|
777
|
+
*/
|
|
778
|
+
fetchMarketLeverageTiers(symbol: string, params?: {}): Promise<LeverageTier[]>;
|
|
779
|
+
parseMarketLeverageTiers(info: any, market?: Market): LeverageTier[];
|
|
769
780
|
sign(path: any, section?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
770
781
|
url: string;
|
|
771
782
|
method: string;
|
package/js/src/bingx.js
CHANGED
|
@@ -85,6 +85,7 @@ export default class bingx extends Exchange {
|
|
|
85
85
|
'fetchLiquidations': false,
|
|
86
86
|
'fetchMarginAdjustmentHistory': false,
|
|
87
87
|
'fetchMarginMode': true,
|
|
88
|
+
'fetchMarketLeverageTiers': true,
|
|
88
89
|
'fetchMarkets': true,
|
|
89
90
|
'fetchMarkOHLCV': true,
|
|
90
91
|
'fetchMarkPrice': true,
|
|
@@ -6661,6 +6662,78 @@ export default class bingx extends Exchange {
|
|
|
6661
6662
|
}
|
|
6662
6663
|
return result;
|
|
6663
6664
|
}
|
|
6665
|
+
/**
|
|
6666
|
+
* @method
|
|
6667
|
+
* @name bingx#fetchMarketLeverageTiers
|
|
6668
|
+
* @description retrieve information on the maximum leverage, for different trade sizes for a single market
|
|
6669
|
+
* @see https://bingx-api.github.io/docs-v3/#/en/Swap/Trades%20Endpoints/Position%20and%20Maintenance%20Margin%20Ratio
|
|
6670
|
+
* @param {string} symbol unified market symbol
|
|
6671
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6672
|
+
* @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/?id=leverage-tiers-structure}
|
|
6673
|
+
*/
|
|
6674
|
+
async fetchMarketLeverageTiers(symbol, params = {}) {
|
|
6675
|
+
await this.loadMarkets();
|
|
6676
|
+
const market = this.market(symbol);
|
|
6677
|
+
if (!market['swap']) {
|
|
6678
|
+
throw new BadRequest(this.id + ' fetchMarketLeverageTiers() supports swap markets only');
|
|
6679
|
+
}
|
|
6680
|
+
const request = {
|
|
6681
|
+
'symbol': market['id'],
|
|
6682
|
+
};
|
|
6683
|
+
const response = await this.swapV1PrivateGetMaintMarginRatio(this.extend(request, params));
|
|
6684
|
+
//
|
|
6685
|
+
// {
|
|
6686
|
+
// "code": 0,
|
|
6687
|
+
// "msg": "",
|
|
6688
|
+
// "timestamp": 1767789967284,
|
|
6689
|
+
// "data": [
|
|
6690
|
+
// {
|
|
6691
|
+
// "tier": "Tier 1",
|
|
6692
|
+
// "symbol": "ETH-USDT",
|
|
6693
|
+
// "minPositionVal": "0",
|
|
6694
|
+
// "maxPositionVal": "900000",
|
|
6695
|
+
// "maintMarginRatio": "0.003300",
|
|
6696
|
+
// "maintAmount": "0.000000"
|
|
6697
|
+
// }
|
|
6698
|
+
// ]
|
|
6699
|
+
// }
|
|
6700
|
+
//
|
|
6701
|
+
const data = this.safeList(response, 'data', []);
|
|
6702
|
+
return this.parseMarketLeverageTiers(data, market);
|
|
6703
|
+
}
|
|
6704
|
+
parseMarketLeverageTiers(info, market = undefined) {
|
|
6705
|
+
//
|
|
6706
|
+
// [
|
|
6707
|
+
// {
|
|
6708
|
+
// "tier": "Tier 1",
|
|
6709
|
+
// "symbol": "ETH-USDT",
|
|
6710
|
+
// "minPositionVal": "0",
|
|
6711
|
+
// "maxPositionVal": "900000",
|
|
6712
|
+
// "maintMarginRatio": "0.003300",
|
|
6713
|
+
// "maintAmount": "0.000000"
|
|
6714
|
+
// }
|
|
6715
|
+
// ]
|
|
6716
|
+
//
|
|
6717
|
+
const tiers = [];
|
|
6718
|
+
for (let i = 0; i < info.length; i++) {
|
|
6719
|
+
const tier = this.safeDict(info, i);
|
|
6720
|
+
const tierString = this.safeString(tier, 'tier');
|
|
6721
|
+
const tierParts = tierString.split(' ');
|
|
6722
|
+
const marketId = this.safeString(tier, 'symbol');
|
|
6723
|
+
market = this.safeMarket(marketId, market, undefined, 'swap');
|
|
6724
|
+
tiers.push({
|
|
6725
|
+
'tier': this.safeNumber(tierParts, 1),
|
|
6726
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
6727
|
+
'currency': this.safeString(market, 'settle'),
|
|
6728
|
+
'minNotional': this.safeNumber(tier, 'minPositionVal'),
|
|
6729
|
+
'maxNotional': this.safeNumber(tier, 'maxPositionVal'),
|
|
6730
|
+
'maintenanceMarginRate': this.safeNumber(tier, 'maintMarginRatio'),
|
|
6731
|
+
'maxLeverage': undefined,
|
|
6732
|
+
'info': tier,
|
|
6733
|
+
});
|
|
6734
|
+
}
|
|
6735
|
+
return tiers;
|
|
6736
|
+
}
|
|
6664
6737
|
sign(path, section = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
6665
6738
|
let type = section[0];
|
|
6666
6739
|
let version = section[1];
|
package/js/src/cryptomus.js
CHANGED
|
@@ -80,7 +80,7 @@ export default class cryptomus extends Exchange {
|
|
|
80
80
|
'fetchConvertTradeHistory': false,
|
|
81
81
|
'fetchCrossBorrowRate': false,
|
|
82
82
|
'fetchCrossBorrowRates': false,
|
|
83
|
-
'fetchCurrencies':
|
|
83
|
+
'fetchCurrencies': false,
|
|
84
84
|
'fetchDepositAddress': false,
|
|
85
85
|
'fetchDeposits': false,
|
|
86
86
|
'fetchDepositsWithdrawals': false,
|
package/js/src/okx.js
CHANGED
|
@@ -3011,6 +3011,9 @@ export default class okx extends Exchange {
|
|
|
3011
3011
|
}
|
|
3012
3012
|
createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
3013
3013
|
const market = this.market(symbol);
|
|
3014
|
+
const takeProfitPrice = this.safeValue2(params, 'takeProfitPrice', 'tpTriggerPx');
|
|
3015
|
+
const stopLossPrice = this.safeValue2(params, 'stopLossPrice', 'slTriggerPx');
|
|
3016
|
+
const conditional = (stopLossPrice !== undefined) || (takeProfitPrice !== undefined) || (type === 'conditional');
|
|
3014
3017
|
let request = {
|
|
3015
3018
|
'instId': market['id'],
|
|
3016
3019
|
// 'ccy': currency['id'], // only applicable to cross MARGIN orders in single-currency margin
|
|
@@ -3021,7 +3024,7 @@ export default class okx extends Exchange {
|
|
|
3021
3024
|
'ordType': type,
|
|
3022
3025
|
// 'ordType': type, // privatePostTradeOrder: market, limit, post_only, fok, ioc, optimal_limit_ioc
|
|
3023
3026
|
// 'ordType': type, // privatePostTradeOrderAlgo: conditional, oco, trigger, move_order_stop, iceberg, twap
|
|
3024
|
-
'sz': this.amountToPrecision(symbol, amount),
|
|
3027
|
+
// 'sz': this.amountToPrecision (symbol, amount),
|
|
3025
3028
|
// 'px': this.priceToPrecision (symbol, price), // limit orders only
|
|
3026
3029
|
// 'reduceOnly': false,
|
|
3027
3030
|
//
|
|
@@ -3037,14 +3040,20 @@ export default class okx extends Exchange {
|
|
|
3037
3040
|
// 'slTriggerPxType': 'last', // Conditional default is last, mark or index (conditional orders)
|
|
3038
3041
|
// 'slOrdPx': 10, // Order price for Stop-Loss orders, if -1 will be executed at market price (conditional orders)
|
|
3039
3042
|
};
|
|
3043
|
+
const isConditionalOrOCO = conditional || (type === 'oco');
|
|
3044
|
+
const closeFraction = this.safeString(params, 'closeFraction');
|
|
3045
|
+
const shouldOmitSize = isConditionalOrOCO && closeFraction !== undefined;
|
|
3046
|
+
if (!shouldOmitSize) {
|
|
3047
|
+
request['sz'] = this.amountToPrecision(symbol, amount);
|
|
3048
|
+
}
|
|
3040
3049
|
const spot = market['spot'];
|
|
3041
3050
|
const contract = market['contract'];
|
|
3042
3051
|
const triggerPrice = this.safeValueN(params, ['triggerPrice', 'stopPrice', 'triggerPx']);
|
|
3043
3052
|
const timeInForce = this.safeString(params, 'timeInForce', 'GTC');
|
|
3044
|
-
const takeProfitPrice = this.safeValue2(params, 'takeProfitPrice', 'tpTriggerPx');
|
|
3053
|
+
// const takeProfitPrice = this.safeValue2 (params, 'takeProfitPrice', 'tpTriggerPx');
|
|
3045
3054
|
const tpOrdPx = this.safeValue(params, 'tpOrdPx', price);
|
|
3046
3055
|
const tpTriggerPxType = this.safeString(params, 'tpTriggerPxType', 'last');
|
|
3047
|
-
const stopLossPrice = this.safeValue2(params, 'stopLossPrice', 'slTriggerPx');
|
|
3056
|
+
// const stopLossPrice = this.safeValue2 (params, 'stopLossPrice', 'slTriggerPx');
|
|
3048
3057
|
const slOrdPx = this.safeValue(params, 'slOrdPx', price);
|
|
3049
3058
|
const slTriggerPxType = this.safeString(params, 'slTriggerPxType', 'last');
|
|
3050
3059
|
const clientOrderId = this.safeString2(params, 'clOrdId', 'clientOrderId');
|
|
@@ -3057,7 +3066,7 @@ export default class okx extends Exchange {
|
|
|
3057
3066
|
const trailingPrice = this.safeString2(params, 'trailingPrice', 'callbackSpread');
|
|
3058
3067
|
const isTrailingPriceOrder = trailingPrice !== undefined;
|
|
3059
3068
|
const trigger = (triggerPrice !== undefined) || (type === 'trigger');
|
|
3060
|
-
const isReduceOnly = this.safeValue(params, 'reduceOnly', false);
|
|
3069
|
+
const isReduceOnly = this.safeValue(params, 'reduceOnly', false) || (closeFraction !== undefined);
|
|
3061
3070
|
const defaultMarginMode = this.safeString2(this.options, 'defaultMarginMode', 'marginMode', 'cross');
|
|
3062
3071
|
let marginMode = this.safeString2(params, 'marginMode', 'tdMode'); // cross or isolated, tdMode not ommited so as to be extended into the request
|
|
3063
3072
|
let margin = false;
|
|
@@ -3112,7 +3121,7 @@ export default class okx extends Exchange {
|
|
|
3112
3121
|
params = this.omit(params, ['currency', 'ccy', 'marginMode', 'timeInForce', 'stopPrice', 'triggerPrice', 'clientOrderId', 'stopLossPrice', 'takeProfitPrice', 'slOrdPx', 'tpOrdPx', 'margin', 'stopLoss', 'takeProfit', 'trailingPercent']);
|
|
3113
3122
|
const ioc = (timeInForce === 'IOC') || (type === 'ioc');
|
|
3114
3123
|
const fok = (timeInForce === 'FOK') || (type === 'fok');
|
|
3115
|
-
const conditional = (stopLossPrice !== undefined) || (takeProfitPrice !== undefined) || (type === 'conditional');
|
|
3124
|
+
// const conditional = (stopLossPrice !== undefined) || (takeProfitPrice !== undefined) || (type === 'conditional');
|
|
3116
3125
|
const marketIOC = (isMarketOrder && ioc) || (type === 'optimal_limit_ioc');
|
|
3117
3126
|
const defaultTgtCcy = this.safeString(this.options, 'tgtCcy', 'base_ccy');
|
|
3118
3127
|
const tgtCcy = this.safeString(params, 'tgtCcy', defaultTgtCcy);
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import asterRest from '../aster.js';
|
|
2
|
+
import type { Strings, Tickers, Dict, Ticker, Int, Market, Trade, OrderBook, OHLCV } from '../base/types.js';
|
|
3
|
+
import Client from '../base/ws/Client.js';
|
|
4
|
+
export default class aster extends asterRest {
|
|
5
|
+
describe(): any;
|
|
6
|
+
getAccountTypeFromSubscriptions(subscriptions: string[]): string;
|
|
7
|
+
/**
|
|
8
|
+
* @method
|
|
9
|
+
* @name aster#watchTicker
|
|
10
|
+
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
11
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#full-ticker-per-symbol
|
|
12
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#individual-symbol-ticker-streams
|
|
13
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
14
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
15
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
16
|
+
*/
|
|
17
|
+
watchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
18
|
+
/**
|
|
19
|
+
* @method
|
|
20
|
+
* @name aster#unWatchTicker
|
|
21
|
+
* @description unWatches a price ticker
|
|
22
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#full-ticker-per-symbol
|
|
23
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#individual-symbol-ticker-streams
|
|
24
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
25
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
26
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
27
|
+
*/
|
|
28
|
+
unWatchTicker(symbol: string, params?: {}): Promise<any>;
|
|
29
|
+
/**
|
|
30
|
+
* @method
|
|
31
|
+
* @name aster#watchTickers
|
|
32
|
+
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
33
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#full-ticker-per-symbol
|
|
34
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#individual-symbol-ticker-streams
|
|
35
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
36
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
37
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
38
|
+
*/
|
|
39
|
+
watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
40
|
+
/**
|
|
41
|
+
* @method
|
|
42
|
+
* @name aster#unWatchTickers
|
|
43
|
+
* @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
44
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#full-ticker-per-symbol
|
|
45
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#individual-symbol-ticker-streams
|
|
46
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
47
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
48
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
49
|
+
*/
|
|
50
|
+
unWatchTickers(symbols?: Strings, params?: {}): Promise<any>;
|
|
51
|
+
/**
|
|
52
|
+
* @method
|
|
53
|
+
* @name aster#watchMarkPrice
|
|
54
|
+
* @description watches a mark price for a specific market
|
|
55
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#mark-price-stream
|
|
56
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
57
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
58
|
+
* @param {boolean} [params.use1sFreq] *default is true* if set to true, the mark price will be updated every second, otherwise every 3 seconds
|
|
59
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
60
|
+
*/
|
|
61
|
+
watchMarkPrice(symbol: string, params?: {}): Promise<Ticker>;
|
|
62
|
+
/**
|
|
63
|
+
* @method
|
|
64
|
+
* @name aster#unWatchMarkPrice
|
|
65
|
+
* @description unWatches a mark price for a specific market
|
|
66
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#mark-price-stream
|
|
67
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
68
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
69
|
+
* @param {boolean} [params.use1sFreq] *default is true* if set to true, the mark price will be updated every second, otherwise every 3 seconds
|
|
70
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
71
|
+
*/
|
|
72
|
+
unWatchMarkPrice(symbol: string, params?: {}): Promise<any>;
|
|
73
|
+
/**
|
|
74
|
+
* @method
|
|
75
|
+
* @name aster#watchMarkPrices
|
|
76
|
+
* @description watches the mark price for all markets
|
|
77
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#mark-price-stream
|
|
78
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
79
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
80
|
+
* @param {boolean} [params.use1sFreq] *default is true* if set to true, the mark price will be updated every second, otherwise every 3 seconds
|
|
81
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
82
|
+
*/
|
|
83
|
+
watchMarkPrices(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
84
|
+
/**
|
|
85
|
+
* @method
|
|
86
|
+
* @name aster#unWatchMarkPrices
|
|
87
|
+
* @description watches the mark price for all markets
|
|
88
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#mark-price-stream
|
|
89
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
90
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
91
|
+
* @param {boolean} [params.use1sFreq] *default is true* if set to true, the mark price will be updated every second, otherwise every 3 seconds
|
|
92
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
93
|
+
*/
|
|
94
|
+
unWatchMarkPrices(symbols?: Strings, params?: {}): Promise<any>;
|
|
95
|
+
handleTicker(client: Client, message: any): void;
|
|
96
|
+
parseWsTicker(message: any, marketType: any): Ticker;
|
|
97
|
+
/**
|
|
98
|
+
* @method
|
|
99
|
+
* @name aster#watchBidsAsks
|
|
100
|
+
* @description watches best bid & ask for symbols
|
|
101
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#best-order-book-information-by-symbol
|
|
102
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#individual-symbol-book-ticker-streams
|
|
103
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
104
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
105
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
106
|
+
*/
|
|
107
|
+
watchBidsAsks(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
108
|
+
/**
|
|
109
|
+
* @method
|
|
110
|
+
* @name aster#unWatchBidsAsks
|
|
111
|
+
* @description unWatches best bid & ask for symbols
|
|
112
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#best-order-book-information-by-symbol
|
|
113
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#individual-symbol-book-ticker-streams
|
|
114
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
115
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
116
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
117
|
+
*/
|
|
118
|
+
unWatchBidsAsks(symbols?: Strings, params?: {}): Promise<any>;
|
|
119
|
+
handleBidAsk(client: Client, message: any): void;
|
|
120
|
+
parseWsBidAsk(message: any, market?: any): Ticker;
|
|
121
|
+
/**
|
|
122
|
+
* @method
|
|
123
|
+
* @name aster#watchTrades
|
|
124
|
+
* @description watches information on multiple trades made in a market
|
|
125
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#collection-transaction-flow
|
|
126
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#aggregate-trade-streams
|
|
127
|
+
* @param {string} symbol unified market symbol of the market trades were made in
|
|
128
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
129
|
+
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
130
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
131
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
132
|
+
*/
|
|
133
|
+
watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
134
|
+
/**
|
|
135
|
+
* @method
|
|
136
|
+
* @name aster#unWatchTrades
|
|
137
|
+
* @description unsubscribe from the trades channel
|
|
138
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#collection-transaction-flow
|
|
139
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#aggregate-trade-streams
|
|
140
|
+
* @param {string} symbol unified market symbol of the market trades were made in
|
|
141
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
142
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
143
|
+
*/
|
|
144
|
+
unWatchTrades(symbol: string, params?: {}): Promise<any>;
|
|
145
|
+
/**
|
|
146
|
+
* @method
|
|
147
|
+
* @name aster#watchTradesForSymbols
|
|
148
|
+
* @description get the list of most recent trades for a list of symbols
|
|
149
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#collection-transaction-flow
|
|
150
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#aggregate-trade-streams
|
|
151
|
+
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
152
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
153
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
154
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
155
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
156
|
+
*/
|
|
157
|
+
watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
158
|
+
/**
|
|
159
|
+
* @method
|
|
160
|
+
* @name aster#unWatchTradesForSymbols
|
|
161
|
+
* @description unsubscribe from the trades channel
|
|
162
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#collection-transaction-flow
|
|
163
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#aggregate-trade-streams
|
|
164
|
+
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
165
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
166
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
167
|
+
*/
|
|
168
|
+
unWatchTradesForSymbols(symbols: string[], params?: {}): Promise<any>;
|
|
169
|
+
handleTrade(client: Client, message: any): void;
|
|
170
|
+
parseWsTrade(trade: Dict, market?: Market): Trade;
|
|
171
|
+
/**
|
|
172
|
+
* @method
|
|
173
|
+
* @name aster#watchOrderBook
|
|
174
|
+
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
175
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#limited-depth-information
|
|
176
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#partial-book-depth-streams
|
|
177
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
178
|
+
* @param {int} [limit] the maximum amount of order book entries to return.
|
|
179
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
180
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
181
|
+
*/
|
|
182
|
+
watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
183
|
+
/**
|
|
184
|
+
* @method
|
|
185
|
+
* @name aster#unWatchOrderBook
|
|
186
|
+
* @description unsubscribe from the orderbook channel
|
|
187
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#limited-depth-information
|
|
188
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#partial-book-depth-streams
|
|
189
|
+
* @param {string} symbol symbol of the market to unwatch the trades for
|
|
190
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
191
|
+
* @param {int} [params.limit] orderbook limit, default is undefined
|
|
192
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
193
|
+
*/
|
|
194
|
+
unWatchOrderBook(symbol: string, params?: {}): Promise<any>;
|
|
195
|
+
/**
|
|
196
|
+
* @method
|
|
197
|
+
* @name aster#watchOrderBookForSymbols
|
|
198
|
+
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
199
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#limited-depth-information
|
|
200
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#partial-book-depth-streams
|
|
201
|
+
* @param {string[]} symbols unified array of symbols
|
|
202
|
+
* @param {int} [limit] the maximum amount of order book entries to return.
|
|
203
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
204
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
205
|
+
*/
|
|
206
|
+
watchOrderBookForSymbols(symbols: string[], limit?: Int, params?: {}): Promise<OrderBook>;
|
|
207
|
+
/**
|
|
208
|
+
* @method
|
|
209
|
+
* @name aster#unWatchOrderBookForSymbols
|
|
210
|
+
* @description unsubscribe from the orderbook channel
|
|
211
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#limited-depth-information
|
|
212
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#partial-book-depth-streams
|
|
213
|
+
* @param {string[]} symbols unified symbol of the market to unwatch the trades for
|
|
214
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
215
|
+
* @param {int} [params.limit] orderbook limit, default is undefined
|
|
216
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
217
|
+
*/
|
|
218
|
+
unWatchOrderBookForSymbols(symbols: string[], params?: {}): Promise<any>;
|
|
219
|
+
handleOrderBook(client: Client, message: any): void;
|
|
220
|
+
/**
|
|
221
|
+
* @method
|
|
222
|
+
* @name aster#watchOHLCV
|
|
223
|
+
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
224
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#k-line-streams
|
|
225
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#klinecandlestick-streams
|
|
226
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
227
|
+
* @param {string} timeframe the length of time each candle represents
|
|
228
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
229
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
230
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
231
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
232
|
+
*/
|
|
233
|
+
watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
234
|
+
/**
|
|
235
|
+
* @method
|
|
236
|
+
* @name aster#unWatchOHLCV
|
|
237
|
+
* @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
238
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#k-line-streams
|
|
239
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#klinecandlestick-streams
|
|
240
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
241
|
+
* @param {string} timeframe the length of time each candle represents
|
|
242
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
243
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
244
|
+
*/
|
|
245
|
+
unWatchOHLCV(symbol: string, timeframe?: string, params?: {}): Promise<any>;
|
|
246
|
+
/**
|
|
247
|
+
* @method
|
|
248
|
+
* @name aster#watchOHLCVForSymbols
|
|
249
|
+
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
250
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#k-line-streams
|
|
251
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#klinecandlestick-streams
|
|
252
|
+
* @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
|
|
253
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
254
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
255
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
256
|
+
* @returns {object} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
257
|
+
*/
|
|
258
|
+
watchOHLCVForSymbols(symbolsAndTimeframes: string[][], since?: Int, limit?: Int, params?: {}): Promise<import("../base/types.js").Dictionary<import("../base/types.js").Dictionary<OHLCV[]>>>;
|
|
259
|
+
/**
|
|
260
|
+
* @method
|
|
261
|
+
* @name aster#unWatchOHLCVForSymbols
|
|
262
|
+
* @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
263
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#k-line-streams
|
|
264
|
+
* @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#klinecandlestick-streams
|
|
265
|
+
* @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
|
|
266
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
267
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
268
|
+
*/
|
|
269
|
+
unWatchOHLCVForSymbols(symbolsAndTimeframes: string[][], params?: {}): Promise<any>;
|
|
270
|
+
handleOHLCV(client: Client, message: any): void;
|
|
271
|
+
parseWsOHLCV(ohlcv: any, market?: any): OHLCV;
|
|
272
|
+
handleMessage(client: Client, message: any): void;
|
|
273
|
+
}
|