ccxt 4.5.30 → 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.
Files changed (73) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +18 -18
  3. package/dist/cjs/ccxt.js +6 -4
  4. package/dist/cjs/src/aster.js +3802 -0
  5. package/dist/cjs/src/backpack.js +1 -1
  6. package/dist/cjs/src/base/Exchange.js +35 -2
  7. package/dist/cjs/src/base/ws/WsClient.js +1 -0
  8. package/dist/cjs/src/bigone.js +1 -1
  9. package/dist/cjs/src/binance.js +1 -0
  10. package/dist/cjs/src/bingx.js +73 -0
  11. package/dist/cjs/src/cryptomus.js +1 -1
  12. package/dist/cjs/src/gate.js +52 -6
  13. package/dist/cjs/src/hyperliquid.js +9 -1
  14. package/dist/cjs/src/kucoin.js +63 -64
  15. package/dist/cjs/src/okx.js +14 -5
  16. package/dist/cjs/src/pro/apex.js +2 -2
  17. package/dist/cjs/src/pro/ascendex.js +1 -1
  18. package/dist/cjs/src/pro/aster.js +1046 -0
  19. package/dist/cjs/src/pro/bingx.js +1 -1
  20. package/dist/cjs/src/pro/bybit.js +1 -1
  21. package/dist/cjs/src/pro/cryptocom.js +1 -1
  22. package/dist/cjs/src/pro/dydx.js +1 -1
  23. package/dist/cjs/src/pro/htx.js +1 -1
  24. package/dist/cjs/src/pro/hyperliquid.js +1 -1
  25. package/dist/cjs/src/pro/p2b.js +1 -1
  26. package/dist/cjs/src/pro/toobit.js +1 -1
  27. package/js/ccxt.d.ts +8 -5
  28. package/js/ccxt.js +6 -4
  29. package/js/src/abstract/aster.d.ts +88 -0
  30. package/js/src/abstract/binance.d.ts +1 -0
  31. package/js/src/abstract/binancecoinm.d.ts +1 -0
  32. package/js/src/abstract/binanceus.d.ts +1 -0
  33. package/js/src/abstract/binanceusdm.d.ts +1 -0
  34. package/js/src/abstract/kucoin.d.ts +2 -0
  35. package/js/src/abstract/kucoinfutures.d.ts +2 -0
  36. package/js/src/aster.d.ts +563 -0
  37. package/js/src/aster.js +3801 -0
  38. package/js/src/backpack.js +1 -1
  39. package/js/src/base/Exchange.d.ts +4 -0
  40. package/js/src/base/Exchange.js +35 -1
  41. package/js/src/base/ws/WsClient.js +1 -0
  42. package/js/src/bigone.js +1 -1
  43. package/js/src/binance.d.ts +1 -1
  44. package/js/src/binance.js +1 -0
  45. package/js/src/bingx.d.ts +12 -1
  46. package/js/src/bingx.js +73 -0
  47. package/js/src/cryptomus.js +1 -1
  48. package/js/src/exmo.d.ts +1 -1
  49. package/js/src/gate.js +52 -6
  50. package/js/src/hyperliquid.d.ts +1 -0
  51. package/js/src/hyperliquid.js +9 -1
  52. package/js/src/kucoin.d.ts +5 -3
  53. package/js/src/kucoin.js +63 -64
  54. package/js/src/okx.js +14 -5
  55. package/js/src/pro/apex.js +2 -2
  56. package/js/src/pro/ascendex.js +1 -1
  57. package/js/src/pro/aster.d.ts +273 -0
  58. package/js/src/pro/aster.js +1045 -0
  59. package/js/src/pro/bingx.js +1 -1
  60. package/js/src/pro/bybit.js +1 -1
  61. package/js/src/pro/cryptocom.js +1 -1
  62. package/js/src/pro/dydx.js +1 -1
  63. package/js/src/pro/htx.js +1 -1
  64. package/js/src/pro/hyperliquid.js +1 -1
  65. package/js/src/pro/p2b.js +1 -1
  66. package/js/src/pro/toobit.js +1 -1
  67. package/package.json +1 -1
  68. package/dist/cjs/src/oceanex.js +0 -1125
  69. package/js/src/abstract/oceanex.d.ts +0 -30
  70. package/js/src/oceanex.d.ts +0 -231
  71. package/js/src/oceanex.js +0 -1124
  72. /package/dist/cjs/src/abstract/{oceanex.js → aster.js} +0 -0
  73. /package/js/src/abstract/{oceanex.js → aster.js} +0 -0
@@ -0,0 +1,563 @@
1
+ import Exchange from './abstract/aster.js';
2
+ import type { Balances, Currencies, Currency, Dict, FundingRate, FundingRateHistory, FundingRates, int, Int, LedgerEntry, Leverage, Leverages, MarginMode, MarginModes, MarginModification, Market, Num, OHLCV, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry } from './base/types.js';
3
+ /**
4
+ * @class aster
5
+ * @augments Exchange
6
+ */
7
+ export default class aster extends Exchange {
8
+ describe(): any;
9
+ isInverse(type: string, subType?: Str): boolean;
10
+ isLinear(type: string, subType?: Str): boolean;
11
+ /**
12
+ * @method
13
+ * @name aster#fetchCurrencies
14
+ * @description fetches all available currencies on an exchange
15
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#trading-specification-information
16
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#exchange-information
17
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
18
+ * @returns {object} an associative dictionary of currencies
19
+ */
20
+ fetchCurrencies(params?: {}): Promise<Currencies>;
21
+ /**
22
+ * @method
23
+ * @name aster#fetchMarkets
24
+ * @description retrieves data on all markets for bigone
25
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#trading-specification-information
26
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#exchange-information
27
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
28
+ * @returns {object[]} an array of objects representing market data
29
+ */
30
+ fetchMarkets(params?: {}): Promise<Market[]>;
31
+ /**
32
+ * @method
33
+ * @name aster#fetchTime
34
+ * @description fetches the current integer timestamp in milliseconds from the exchange server
35
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#check-server-time
36
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
37
+ * @returns {int} the current integer timestamp in milliseconds from the exchange server
38
+ */
39
+ fetchTime(params?: {}): Promise<Int>;
40
+ parseOHLCV(ohlcv: any, market?: Market): OHLCV;
41
+ /**
42
+ * @method
43
+ * @name aster#fetchOHLCV
44
+ * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
45
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#k-line-data
46
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#klinecandlestick-data
47
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
48
+ * @param {string} timeframe the length of time each candle represents
49
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
50
+ * @param {int} [limit] the maximum amount of candles to fetch
51
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
52
+ * @param {string} [params.price] "mark" or "index" for mark price and index price candles
53
+ * @param {int} [params.until] the latest time in ms to fetch orders for
54
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
55
+ */
56
+ fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
57
+ parseTrade(trade: Dict, market?: Market): Trade;
58
+ /**
59
+ * @method
60
+ * @name aster#fetchTrades
61
+ * @description get the list of most recent trades for a particular symbol
62
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#recent-trades-list
63
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#recent-trades-list
64
+ * @param {string} symbol unified symbol of the market to fetch trades for
65
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
66
+ * @param {int} [limit] the maximum amount of trades to fetch
67
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
68
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
69
+ */
70
+ fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
71
+ /**
72
+ * @method
73
+ * @name aster#fetchMyTrades
74
+ * @description fetch all trades made by the user
75
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#account-trade-history-user_data
76
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#account-trade-list-user_data
77
+ * @param {string} [symbol] unified market symbol
78
+ * @param {int} [since] the earliest time in ms to fetch trades for
79
+ * @param {int} [limit] the maximum number of trades structures to retrieve
80
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
81
+ * @param {int} [params.until] timestamp in ms for the ending date filter, default is undefined
82
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
83
+ */
84
+ fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
85
+ /**
86
+ * @method
87
+ * @name aster#fetchOrderBook
88
+ * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
89
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#depth-information
90
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#order-book
91
+ * @param {string} symbol unified symbol of the market to fetch the order book for
92
+ * @param {int} [limit] the maximum amount of order book entries to return
93
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
94
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
95
+ */
96
+ fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
97
+ /**
98
+ * @method
99
+ * @name aster#fetchFundingRateHistory
100
+ * @description fetches historical funding rate prices
101
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#get-funding-rate-history
102
+ * @param {string} symbol unified symbol of the market to fetch the funding rate history for
103
+ * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
104
+ * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
105
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
106
+ * @param {int} [params.until] timestamp in ms of the latest funding rate
107
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
108
+ */
109
+ fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
110
+ parseTicker(ticker: Dict, market?: Market): Ticker;
111
+ /**
112
+ * @method
113
+ * @name aster#fetchTicker
114
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
115
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#24h-price-change
116
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#24hr-ticker-price-change-statistics
117
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
118
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
119
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
120
+ */
121
+ fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
122
+ /**
123
+ * @method
124
+ * @name aster#fetchTickers
125
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
126
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#24h-price-change
127
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#24hr-ticker-price-change-statistics
128
+ * @param {string[]} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
129
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
130
+ * @param {string} [params.subType] "linear" or "inverse"
131
+ * @param {string} [params.type] 'spot', 'option', use params["subType"] for swap and future markets
132
+ * @returns {object} an array of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
133
+ */
134
+ fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
135
+ parseFundingRate(contract: any, market?: Market): FundingRate;
136
+ /**
137
+ * @method
138
+ * @name aster#fetchFundingRate
139
+ * @description fetch the current funding rate
140
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#mark-price
141
+ * @param {string} symbol unified market symbol
142
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
143
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
144
+ */
145
+ fetchFundingRate(symbol: string, params?: {}): Promise<FundingRate>;
146
+ /**
147
+ * @method
148
+ * @name aster#fetchFundingRates
149
+ * @description fetch the current funding rate for multiple symbols
150
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#24hr-ticker-price-change-statistics
151
+ * @param {string[]} [symbols] list of unified market symbols
152
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
153
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
154
+ */
155
+ fetchFundingRates(symbols?: Strings, params?: {}): Promise<FundingRates>;
156
+ /**
157
+ * @method
158
+ * @name aster#fetchFundingIntervals
159
+ * @description fetch the funding rate interval for multiple markets
160
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#get-funding-rate-config
161
+ * @param {string[]} [symbols] list of unified market symbols
162
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
163
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
164
+ */
165
+ fetchFundingIntervals(symbols?: Strings, params?: {}): Promise<FundingRates>;
166
+ parseBalance(response: any): Balances;
167
+ /**
168
+ * @method
169
+ * @name aster#fetchBalance
170
+ * @description query for balance and get the amount of funds available for trading or funds locked in orders
171
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#account-information-v4-user_data
172
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#account-information-user_data
173
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
174
+ * @param {string} [params.subType] "linear" or "inverse"
175
+ * @param {string} [params.type] 'spot', 'option', use params["subType"] for swap and future markets
176
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
177
+ */
178
+ fetchBalance(params?: {}): Promise<Balances>;
179
+ /**
180
+ * @method
181
+ * @name aster#setMarginMode
182
+ * @description set margin mode to 'cross' or 'isolated'
183
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#change-margin-type-trade
184
+ * @param {string} marginMode 'cross' or 'isolated'
185
+ * @param {string} symbol unified market symbol
186
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
187
+ * @returns {object} response from the exchange
188
+ */
189
+ setMarginMode(marginMode: string, symbol?: Str, params?: {}): Promise<any>;
190
+ /**
191
+ * @method
192
+ * @name aster#fetchPositionMode
193
+ * @description fetchs the position mode, hedged or one way, hedged for aster is set identically for all linear markets or all inverse markets
194
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#get-current-position-modeuser_data
195
+ * @param {string} symbol unified symbol of the market to fetch the order book for
196
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
197
+ * @returns {object} an object detailing whether the market is in hedged or one-way mode
198
+ */
199
+ fetchPositionMode(symbol?: Str, params?: {}): Promise<{
200
+ info: any;
201
+ hedged: boolean;
202
+ }>;
203
+ /**
204
+ * @method
205
+ * @name aster#setPositionMode
206
+ * @description set hedged to true or false for a market
207
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#change-position-modetrade
208
+ * @param {bool} hedged set to true to use dualSidePosition
209
+ * @param {string} symbol not used by bingx setPositionMode ()
210
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
211
+ * @returns {object} response from the exchange
212
+ */
213
+ setPositionMode(hedged: boolean, symbol?: Str, params?: {}): Promise<any>;
214
+ parseTradingFee(fee: Dict, market?: Market): TradingFeeInterface;
215
+ /**
216
+ * @method
217
+ * @name aster#fetchTradingFee
218
+ * @description fetch the trading fees for a market
219
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#get-symbol-fees
220
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#user-commission-rate-user_data
221
+ * @param {string} symbol unified market symbol
222
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
223
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
224
+ */
225
+ fetchTradingFee(symbol: string, params?: {}): Promise<TradingFeeInterface>;
226
+ parseOrderStatus(status: Str): string;
227
+ parseOrderType(type: Str): string;
228
+ parseOrder(order: Dict, market?: Market): Order;
229
+ /**
230
+ * @method
231
+ * @name aster#fetchOrder
232
+ * @description fetches information on an order made by the user
233
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#query-order-user_data
234
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#query-order-user_data
235
+ * @param {string} id the order id
236
+ * @param {string} symbol unified symbol of the market the order was made in
237
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
238
+ * @param {string} [params.clientOrderId] a unique id for the order
239
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
240
+ */
241
+ fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
242
+ /**
243
+ * @method
244
+ * @name aster#fetchOpenOrder
245
+ * @description fetch an open order by the id
246
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#query-current-open-order-user_data
247
+ * @param {string} id order id
248
+ * @param {string} symbol unified market symbol
249
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
250
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
251
+ */
252
+ fetchOpenOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
253
+ /**
254
+ * @method
255
+ * @name aster#fetchOrders
256
+ * @description fetches information on multiple orders made by the user
257
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#query-all-orders-user_data
258
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#all-orders-user_data
259
+ * @param {string} symbol unified market symbol of the market orders were made in
260
+ * @param {int} [since] the earliest time in ms to fetch orders for
261
+ * @param {int} [limit] the maximum number of order structures to retrieve
262
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
263
+ * @param {int} [params.until] the latest time in ms to fetch orders for
264
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
265
+ */
266
+ fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
267
+ /**
268
+ * @method
269
+ * @name aster#fetchOpenOrders
270
+ * @description fetch all unfilled currently open orders
271
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#current-open-orders-user_data
272
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#current-all-open-orders-user_data
273
+ * @param {string} symbol unified market symbol
274
+ * @param {int} [since] the earliest time in ms to fetch open orders for
275
+ * @param {int} [limit] the maximum number of open orders structures to retrieve
276
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
277
+ * @param {string} [params.subType] "linear" or "inverse"
278
+ * @param {string} [params.type] 'spot', 'option', use params["subType"] for swap and future markets
279
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
280
+ */
281
+ fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
282
+ /**
283
+ * @method
284
+ * @name aster#createOrder
285
+ * @description create a trade order
286
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#place-order-trade
287
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#new-order--trade
288
+ * @param {string} symbol unified symbol of the market to create an order in
289
+ * @param {string} type 'market' or 'limit' or 'STOP' or 'STOP_MARKET' or 'TAKE_PROFIT' or 'TAKE_PROFIT_MARKET' or 'TRAILING_STOP_MARKET'
290
+ * @param {string} side 'buy' or 'sell'
291
+ * @param {float} amount how much of you want to trade in units of the base currency
292
+ * @param {float} [price] the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
293
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
294
+ * @param {string} [params.reduceOnly] for swap and future reduceOnly is a string 'true' or 'false' that cant be sent with close position set to true or in hedge mode. For spot margin and option reduceOnly is a boolean.
295
+ * @param {boolean} [params.test] whether to use the test endpoint or not, default is false
296
+ * @param {float} [params.trailingPercent] the percent to trail away from the current market price
297
+ * @param {float} [params.trailingTriggerPrice] the price to trigger a trailing order, default uses the price argument
298
+ * @param {string} [params.positionSide] "BOTH" for one-way mode, "LONG" for buy side of hedged mode, "SHORT" for sell side of hedged mode
299
+ * @param {float} [params.triggerPrice] the price that a trigger order is triggered at
300
+ * @param {float} [params.stopLossPrice] the price that a stop loss order is triggered at
301
+ * @param {float} [params.takeProfitPrice] the price that a take profit order is triggered at
302
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
303
+ */
304
+ createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
305
+ /**
306
+ * @method
307
+ * @name aster#createOrders
308
+ * @description create a list of trade orders
309
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#place-multiple-orders--trade
310
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
311
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
312
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
313
+ */
314
+ createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
315
+ createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): any;
316
+ /**
317
+ * @method
318
+ * @name aster#cancelAllOrders
319
+ * @description cancel all open orders in a market
320
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#cancel-all-open-orders-trade
321
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#cancel-all-open-orders-trade
322
+ * @param {string} symbol unified market symbol of the market to cancel orders in
323
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
324
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
325
+ */
326
+ cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
327
+ /**
328
+ * @method
329
+ * @name aster#cancelOrder
330
+ * @description cancels an open order
331
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#cancel-order-trade
332
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#cancel-order-trade
333
+ * @param {string} id order id
334
+ * @param {string} symbol unified symbol of the market the order was made in
335
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
336
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
337
+ */
338
+ cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
339
+ /**
340
+ * @method
341
+ * @name aster#cancelOrders
342
+ * @description cancel multiple orders
343
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#cancel-multiple-orders-trade
344
+ * @param {string[]} ids order ids
345
+ * @param {string} [symbol] unified market symbol
346
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
347
+ *
348
+ * EXCHANGE SPECIFIC PARAMETERS
349
+ * @param {string[]} [params.origClientOrderIdList] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
350
+ * @param {int[]} [params.recvWindow]
351
+ * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
352
+ */
353
+ cancelOrders(ids: string[], symbol?: Str, params?: {}): Promise<Order[]>;
354
+ /**
355
+ * @method
356
+ * @name aster#setLeverage
357
+ * @description set the level of leverage for a market
358
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#change-initial-leverage-trade
359
+ * @param {float} leverage the rate of leverage
360
+ * @param {string} symbol unified market symbol
361
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
362
+ * @returns {object} response from the exchange
363
+ */
364
+ setLeverage(leverage: int, symbol?: Str, params?: {}): Promise<any>;
365
+ /**
366
+ * @method
367
+ * @name aster#fetchLeverages
368
+ * @description fetch the set leverage for all markets
369
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#position-information-v2-user_data
370
+ * @param {string[]} [symbols] a list of unified market symbols
371
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
372
+ * @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
373
+ */
374
+ fetchLeverages(symbols?: Strings, params?: {}): Promise<Leverages>;
375
+ parseLeverage(leverage: Dict, market?: Market): Leverage;
376
+ /**
377
+ * @method
378
+ * @name aster#fetchMarginModes
379
+ * @description fetches margin mode of the user
380
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#position-information-v2-user_data
381
+ * @param {string[]} symbols unified market symbols
382
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
383
+ * @returns {object} a list of [margin mode structures]{@link https://docs.ccxt.com/#/?id=margin-mode-structure}
384
+ */
385
+ fetchMarginModes(symbols?: Strings, params?: {}): Promise<MarginModes>;
386
+ parseMarginMode(marginMode: Dict, market?: any): MarginMode;
387
+ /**
388
+ * @method
389
+ * @name aster#fetchMarginAdjustmentHistory
390
+ * @description fetches the history of margin added or reduced from contract isolated positions
391
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#get-position-margin-change-history-trade
392
+ * @param {string} symbol unified market symbol
393
+ * @param {string} [type] "add" or "reduce"
394
+ * @param {int} [since] timestamp in ms of the earliest change to fetch
395
+ * @param {int} [limit] the maximum amount of changes to fetch
396
+ * @param {object} params extra parameters specific to the exchange api endpoint
397
+ * @param {int} [params.until] timestamp in ms of the latest change to fetch
398
+ * @returns {object[]} a list of [margin structures]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
399
+ */
400
+ fetchMarginAdjustmentHistory(symbol?: Str, type?: Str, since?: Num, limit?: Num, params?: {}): Promise<MarginModification[]>;
401
+ parseMarginModification(data: Dict, market?: Market): MarginModification;
402
+ modifyMarginHelper(symbol: string, amount: any, addOrReduce: any, params?: {}): Promise<any>;
403
+ /**
404
+ * @method
405
+ * @name aster#reduceMargin
406
+ * @description remove margin from a position
407
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#modify-isolated-position-margin-trade
408
+ * @param {string} symbol unified market symbol
409
+ * @param {float} amount the amount of margin to remove
410
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
411
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
412
+ */
413
+ reduceMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
414
+ /**
415
+ * @method
416
+ * @name aster#addMargin
417
+ * @description add margin
418
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#modify-isolated-position-margin-trade
419
+ * @param {string} symbol unified market symbol
420
+ * @param {float} amount amount of margin to add
421
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
422
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
423
+ */
424
+ addMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
425
+ parseIncome(income: any, market?: Market): {
426
+ info: any;
427
+ symbol: string;
428
+ code: string;
429
+ timestamp: number;
430
+ datetime: string;
431
+ id: string;
432
+ amount: number;
433
+ };
434
+ /**
435
+ * @method
436
+ * @name aster#fetchFundingHistory
437
+ * @description fetch the history of funding payments paid and received on this account
438
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#get-income-historyuser_data
439
+ * @param {string} symbol unified market symbol
440
+ * @param {int} [since] the earliest time in ms to fetch funding history for
441
+ * @param {int} [limit] the maximum number of funding history structures to retrieve
442
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
443
+ * @param {int} [params.until] timestamp in ms of the latest funding history entry
444
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the funding history for a portfolio margin account
445
+ * @param {string} [params.subType] "linear" or "inverse"
446
+ * @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
447
+ */
448
+ fetchFundingHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").FundingHistory[]>;
449
+ parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
450
+ parseLedgerEntryType(type: any): string;
451
+ /**
452
+ * @method
453
+ * @name aster#fetchLedger
454
+ * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
455
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#get-income-historyuser_data
456
+ * @param {string} [code] unified currency code
457
+ * @param {int} [since] timestamp in ms of the earliest ledger entry
458
+ * @param {int} [limit] max number of ledger entries to return
459
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
460
+ * @param {int} [params.until] timestamp in ms of the latest ledger entry
461
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
462
+ */
463
+ fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
464
+ parsePositionRisk(position: any, market?: Market): Position;
465
+ /**
466
+ * @method
467
+ * @name aster#fetchPositionsRisk
468
+ * @description fetch positions risk
469
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#position-information-v2-user_data
470
+ * @param {string[]|undefined} symbols list of unified market symbols
471
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
472
+ * @returns {object} data on the positions risk
473
+ */
474
+ fetchPositionsRisk(symbols?: Strings, params?: {}): Promise<Position[]>;
475
+ /**
476
+ * @method
477
+ * @name aster#fetchPositions
478
+ * @description fetch all open positions
479
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#position-information-v2-user_data
480
+ * @param {string[]} [symbols] list of unified market symbols
481
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
482
+ * @param {string} [params.method] method name to call, "positionRisk", "account" or "option", default is "positionRisk"
483
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
484
+ */
485
+ fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
486
+ parseAccountPositions(account: any, filterClosed?: boolean): any[];
487
+ parseAccountPosition(position: any, market?: Market): {
488
+ info: any;
489
+ id: any;
490
+ symbol: string;
491
+ timestamp: number;
492
+ datetime: string;
493
+ initialMargin: number;
494
+ initialMarginPercentage: number;
495
+ maintenanceMargin: number;
496
+ maintenanceMarginPercentage: number;
497
+ entryPrice: number;
498
+ notional: number;
499
+ leverage: number;
500
+ unrealizedPnl: number;
501
+ contracts: number;
502
+ contractSize: any;
503
+ marginRatio: any;
504
+ liquidationPrice: any;
505
+ markPrice: any;
506
+ collateral: number;
507
+ marginMode: any;
508
+ side: any;
509
+ hedged: boolean;
510
+ percentage: any;
511
+ };
512
+ /**
513
+ * @method
514
+ * @name aster#fetchAccountPositions
515
+ * @ignore
516
+ * @description fetch account positions
517
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#position-information-v2-user_data
518
+ * @param {string[]} [symbols] list of unified market symbols
519
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
520
+ * @returns {object} data on account positions
521
+ */
522
+ fetchAccountPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
523
+ loadLeverageBrackets(reload?: boolean, params?: {}): Promise<any>;
524
+ keccakMessage(message: any): string;
525
+ signMessage(message: any, privateKey: any): string;
526
+ signWithdrawPayload(withdrawPayload: any, network: any): string;
527
+ /**
528
+ * @method
529
+ * @name aster#withdraw
530
+ * @description make a withdrawal
531
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#withdraw-user_data
532
+ * @param {string} code unified currency code
533
+ * @param {float} amount the amount to withdraw
534
+ * @param {string} address the address to withdraw to
535
+ * @param {string} tag
536
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
537
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
538
+ */
539
+ withdraw(code: string, amount: number, address: string, tag?: Str, params?: {}): Promise<Transaction>;
540
+ /**
541
+ * @method
542
+ * @name aster#transfer
543
+ * @description transfer currency internally between wallets on the same account
544
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#transfer-asset-to-other-address-trade
545
+ * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#transfer-between-futures-and-spot-user_data
546
+ * @param {string} code unified currency code
547
+ * @param {float} amount amount to transfer
548
+ * @param {string} fromAccount account to transfer from
549
+ * @param {string} toAccount account to transfer to
550
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
551
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
552
+ */
553
+ transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
554
+ hashMessage(binaryMessage: any): string;
555
+ signHash(hash: any, privateKey: any): string;
556
+ sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
557
+ url: string;
558
+ method: string;
559
+ body: any;
560
+ headers: any;
561
+ };
562
+ handleErrors(httpCode: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
563
+ }