ccxt 4.5.48 → 4.5.49

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 (43) hide show
  1. package/README.md +6 -5
  2. package/dist/ccxt.browser.min.js +10 -10
  3. package/dist/cjs/ccxt.js +6 -1
  4. package/dist/cjs/src/abstract/weex.js +11 -0
  5. package/dist/cjs/src/btcbox.js +1 -1
  6. package/dist/cjs/src/bullish.js +2 -1
  7. package/dist/cjs/src/kraken.js +1 -0
  8. package/dist/cjs/src/krakenfutures.js +10 -1
  9. package/dist/cjs/src/kucoin.js +5 -1
  10. package/dist/cjs/src/lighter.js +6 -3
  11. package/dist/cjs/src/mexc.js +7 -12
  12. package/dist/cjs/src/paradex.js +5 -2
  13. package/dist/cjs/src/pro/binance.js +1 -1
  14. package/dist/cjs/src/pro/cex.js +1 -1
  15. package/dist/cjs/src/pro/coinbase.js +1 -1
  16. package/dist/cjs/src/pro/lighter.js +338 -18
  17. package/dist/cjs/src/pro/weex.js +1906 -0
  18. package/dist/cjs/src/weex.js +3823 -0
  19. package/js/ccxt.d.ts +8 -2
  20. package/js/ccxt.js +6 -2
  21. package/js/src/abstract/weex.d.ts +83 -0
  22. package/js/src/abstract/weex.js +11 -0
  23. package/js/src/btcbox.js +1 -1
  24. package/js/src/bullish.js +2 -1
  25. package/js/src/kraken.js +1 -0
  26. package/js/src/krakenfutures.js +10 -1
  27. package/js/src/kucoin.d.ts +4 -0
  28. package/js/src/kucoin.js +5 -1
  29. package/js/src/lighter.d.ts +1 -0
  30. package/js/src/lighter.js +6 -3
  31. package/js/src/mexc.d.ts +2 -0
  32. package/js/src/mexc.js +7 -12
  33. package/js/src/paradex.js +5 -2
  34. package/js/src/pro/binance.js +1 -1
  35. package/js/src/pro/cex.js +1 -1
  36. package/js/src/pro/coinbase.js +1 -1
  37. package/js/src/pro/lighter.d.ts +37 -2
  38. package/js/src/pro/lighter.js +338 -18
  39. package/js/src/pro/weex.d.ts +330 -0
  40. package/js/src/pro/weex.js +1905 -0
  41. package/js/src/weex.d.ts +675 -0
  42. package/js/src/weex.js +3822 -0
  43. package/package.json +1 -1
@@ -0,0 +1,330 @@
1
+ import weexRest from '../weex.js';
2
+ import type { Balances, Dict, Int, Market, OHLCV, Order, OrderBook, Position, Str, Strings, Ticker, Tickers, Trade } from '../base/types.js';
3
+ import Client from '../base/ws/Client.js';
4
+ export default class weex extends weexRest {
5
+ describe(): any;
6
+ requestId(): string;
7
+ subscribePublic(messageHashes: any, channels: any, isContract?: boolean, params?: {}, subscription?: {}): Promise<any>;
8
+ subscribePrivate(messageHash: any, subscribeHash: any, channel: any, isContract?: boolean, params?: {}, subscription?: {}): Promise<any>;
9
+ authenticate(url: any): void;
10
+ /**
11
+ * @method
12
+ * @name weex#watchTicker
13
+ * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
14
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Tickers-Channel
15
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Tickers-Channel
16
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
17
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
18
+ * @param {string} [params.name] stream to use can be ticker or miniTicker
19
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure}
20
+ */
21
+ watchTicker(symbol: string, params?: {}): Promise<Ticker>;
22
+ /**
23
+ * @method
24
+ * @name weex#watchTickers
25
+ * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
26
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Tickers-Channel
27
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Tickers-Channel
28
+ * @param {string[]} symbols unified symbol of the market to fetch the ticker for
29
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
30
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure}
31
+ */
32
+ watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
33
+ /**
34
+ * @method
35
+ * @name weex#unWatchTicker
36
+ * @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
37
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Tickers-Channel
38
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Tickers-Channel
39
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
40
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
41
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure}
42
+ */
43
+ unWatchTicker(symbol: string, params?: {}): Promise<any>;
44
+ /**
45
+ * @method
46
+ * @name weex#unWatchTickers
47
+ * @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
48
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Tickers-Channel
49
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Tickers-Channel
50
+ * @param {string[]} symbols unified symbol of the market to fetch the ticker for
51
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
52
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure}
53
+ */
54
+ unWatchTickers(symbols?: Strings, params?: {}): Promise<any>;
55
+ handleTicker(client: Client, message: any): void;
56
+ parseWsTicker(ticker: Dict, market?: Market): Ticker;
57
+ /**
58
+ * @method
59
+ * @name weex#watchTrades
60
+ * @description get the list of most recent trades for a particular symbol
61
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Trades-Channel
62
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Trades-Channel
63
+ * @param {string} symbol unified symbol of the market to fetch trades for
64
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
65
+ * @param {int} [limit] the maximum amount of trades to fetch
66
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
67
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=public-trades}
68
+ */
69
+ watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
70
+ /**
71
+ * @method
72
+ * @name weex#watchTradesForSymbols
73
+ * @description get the list of most recent trades for a list of symbols
74
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Trades-Channel
75
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Trades-Channel
76
+ * @param {string[]} symbols unified symbol of the market to fetch trades for
77
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
78
+ * @param {int} [limit] the maximum amount of trades to fetch
79
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
80
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=public-trades}
81
+ */
82
+ watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
83
+ /**
84
+ * @method
85
+ * @name weex#unWatchTrades
86
+ * @description unsubscribes from the trades channel
87
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Trades-Channel
88
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Trades-Channel
89
+ * @param {string} symbol unified symbol of the market to fetch trades for
90
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
91
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=public-trades}
92
+ */
93
+ unWatchTrades(symbol: string, params?: {}): Promise<any>;
94
+ /**
95
+ * @method
96
+ * @name weex#unWatchTradesForSymbols
97
+ * @description unsubscribes from the trades channel
98
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Trades-Channel
99
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Trades-Channel
100
+ * @param {string[]} symbols unified symbol of the market to fetch trades for
101
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
102
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=public-trades}
103
+ */
104
+ unWatchTradesForSymbols(symbols: string[], params?: {}): Promise<any>;
105
+ handleTrade(client: Client, message: any): void;
106
+ parseWsTrade(trade: any, market?: any): Trade;
107
+ /**
108
+ * @method
109
+ * @name weex#watchOHLCV
110
+ * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
111
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Candlesticks-Channel
112
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Candlesticks-Channel
113
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
114
+ * @param {string} timeframe the length of time each candle represents
115
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
116
+ * @param {int} [limit] the maximum amount of candles to fetch
117
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
118
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
119
+ */
120
+ watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
121
+ /**
122
+ * @method
123
+ * @name weex#watchOHLCVForSymbols
124
+ * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
125
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Candlesticks-Channel
126
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Candlesticks-Channel
127
+ * @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
128
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
129
+ * @param {int} [limit] the maximum amount of candles to fetch
130
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
131
+ * @returns {object} A list of candles ordered as timestamp, open, high, low, close, volume
132
+ */
133
+ watchOHLCVForSymbols(symbolsAndTimeframes: string[][], since?: Int, limit?: Int, params?: {}): Promise<import("../base/types.js").Dictionary<import("../base/types.js").Dictionary<OHLCV[]>>>;
134
+ /**
135
+ * @method
136
+ * @name weex#unWatchOHLCV
137
+ * @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
138
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Candlesticks-Channel
139
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Candlesticks-Channel
140
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
141
+ * @param {string} timeframe the length of time each candle represents
142
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
143
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
144
+ */
145
+ unWatchOHLCV(symbol: string, timeframe?: string, params?: {}): Promise<any>;
146
+ /**
147
+ * @method
148
+ * @name weex#unWatchOHLCVForSymbols
149
+ * @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
150
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Candlesticks-Channel
151
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Candlesticks-Channel
152
+ * @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
153
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
154
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
155
+ */
156
+ unWatchOHLCVForSymbols(symbolsAndTimeframes: string[][], params?: {}): Promise<any>;
157
+ handleOHLCV(client: Client, message: any): void;
158
+ parseWsOHLCV(ohlcv: any, market?: any): OHLCV;
159
+ /**
160
+ * @method
161
+ * @name weex#watchOrderBook
162
+ * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
163
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Depth-Channel
164
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Depth-Channel
165
+ * @param {string} symbol unified symbol of the market to fetch the order book for
166
+ * @param {int} [limit] the maximum amount of order book entries to return
167
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
168
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
169
+ */
170
+ watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
171
+ /**
172
+ * @method
173
+ * @name weex#watchOrderBookForSymbols
174
+ * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
175
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Depth-Channel
176
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Depth-Channel
177
+ * @param {string[]} symbols unified array of symbols
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
+ watchOrderBookForSymbols(symbols: string[], limit?: Int, params?: {}): Promise<OrderBook>;
183
+ /**
184
+ * @method
185
+ * @name weex#unWatchOrderBook
186
+ * @description unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
187
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Depth-Channel
188
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Depth-Channel
189
+ * @param {string} symbol unified array of symbols
190
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
191
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
192
+ */
193
+ unWatchOrderBook(symbol: string, params?: {}): Promise<any>;
194
+ /**
195
+ * @method
196
+ * @name weex#unWatchOrderBookForSymbols
197
+ * @description unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
198
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/Depth-Channel
199
+ * @see https://www.weex.com/api-doc/contract/Websocket/public/Depth-Channel
200
+ * @param {string[]} symbols unified array of symbols
201
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
202
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
203
+ */
204
+ unWatchOrderBookForSymbols(symbols: string[], params?: {}): Promise<any>;
205
+ handleOrderBook(client: Client, message: any): void;
206
+ handleDelta(bookside: any, delta: any): void;
207
+ /**
208
+ * @method
209
+ * @name weex#watchBidsAsks
210
+ * @description watches best bid & ask for spot symbols
211
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/BookTicker-Channel
212
+ * @param {string[]} symbols unified symbol of the market to fetch the ticker for
213
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
214
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
215
+ */
216
+ watchBidsAsks(symbols?: Strings, params?: {}): Promise<Tickers>;
217
+ /**
218
+ * @method
219
+ * @name weex#unWatchBidsAsks
220
+ * @description unWatches best bid & ask for spot symbols
221
+ * @see https://www.weex.com/api-doc/spot/Websocket/public/BookTicker-Channel
222
+ * @param {string[]} symbols unified symbol of the market to fetch the ticker for
223
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
224
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
225
+ */
226
+ unWatchBidsAsks(symbols?: Strings, params?: {}): Promise<any>;
227
+ handleBidAsk(client: Client, message: any): void;
228
+ parseWsBidAsk(message: any, market?: any): Ticker;
229
+ /**
230
+ * @method
231
+ * @name weex#watchMyTrades
232
+ * @description watches information on multiple trades made by the user
233
+ * @see https://www.weex.com/api-doc/spot/Websocket/private/Fill-Channel
234
+ * @see https://www.weex.com/api-doc/contract/Websocket/private/Fill-Channel
235
+ * @param {string} symbol unified market symbol of the market trades were made in
236
+ * @param {int} [since] the earliest time in ms to fetch trades for
237
+ * @param {int} [limit] the maximum number of trade structures to retrieve
238
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
239
+ * @param {string} [params.type] spot or swap, default is spot if symbol is not provided
240
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=trade-structure}
241
+ */
242
+ watchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
243
+ /**
244
+ * @method
245
+ * @name weex#unWatchMyTrades
246
+ * @description unWatches information on multiple trades made by the user
247
+ * @see https://www.weex.com/api-doc/spot/Websocket/private/Fill-Channel
248
+ * @see https://www.weex.com/api-doc/contract/Websocket/private/Fill-Channel
249
+ * @param {string} [symbol] not used by the exchange
250
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
251
+ * @param {string} [params.type] spot or swap, default is spot
252
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
253
+ */
254
+ unWatchMyTrades(symbol?: Str, params?: {}): Promise<any>;
255
+ handleMyTrades(client: Client, message: any): void;
256
+ parseWsMyTrade(trade: any, market?: any): Trade;
257
+ /**
258
+ * @method
259
+ * @name weex#watchOrders
260
+ * @description watches information on multiple orders made by the user
261
+ * @see https://www.weex.com/api-doc/spot/Websocket/private/Order-Channel
262
+ * @see https://www.weex.com/api-doc/contract/Websocket/private/Order-Channel
263
+ * @param {string} symbol unified market symbol of the market orders were made in
264
+ * @param {int} [since] the earliest time in ms to fetch orders for
265
+ * @param {int} [limit] the maximum number of order structures to retrieve
266
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
267
+ * @param {string} [params.type] spot or swap, default is spot if symbol is not provided
268
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
269
+ */
270
+ watchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
271
+ /**
272
+ * @method
273
+ * @name weex#unWatchOrders
274
+ * @description unWatches information on multiple orders made by the user
275
+ * @see https://www.weex.com/api-doc/spot/Websocket/private/Order-Channel
276
+ * @see https://www.weex.com/api-doc/contract/Websocket/private/Order-Channel
277
+ * @param {string} [symbol] not used by the exchange
278
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
279
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
280
+ */
281
+ unWatchOrders(symbol?: Str, params?: {}): Promise<any>;
282
+ handleOrders(client: Client, message: any): void;
283
+ parseWsOrder(order: any, market?: any): Order;
284
+ /**
285
+ * @method
286
+ * @name weex#watchBalance
287
+ * @description query for balance and get the amount of funds available for trading or funds locked in orders
288
+ * @see https://www.weex.com/api-doc/spot/Websocket/private/Account-Channel
289
+ * @see https://www.weex.com/api-doc/contract/Websocket/private/Account-Channel
290
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
291
+ * @param {string} [params.type] 'spot' or 'swap', default is 'spot'
292
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/?id=balance-structure}
293
+ */
294
+ watchBalance(params?: {}): Promise<Balances>;
295
+ setBalanceCache(client: Client, type: any): void;
296
+ loadBalanceSnapshot(client: any, messageHash: any, type: any): Promise<void>;
297
+ handleBalance(client: Client, message: any): void;
298
+ /**
299
+ * @method
300
+ * @name weex#watchPositions
301
+ * @see https://www.weex.com/api-doc/contract/Websocket/private/Positions-Channel
302
+ * @description watch all open positions
303
+ * @param {string[]|undefined} symbols list of unified market symbols
304
+ * @param {int} [since] the earliest time in ms to fetch positions for
305
+ * @param {int} [limit] the maximum number of position structures to retrieve
306
+ * @param {object} params extra parameters specific to the exchange API endpoint
307
+ * @param {int} [params.accountNumber] account number to query orders for, required
308
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
309
+ */
310
+ watchPositions(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
311
+ setPositionsCache(client: Client, params?: Dict): void;
312
+ loadPositionsSnapshot(client: any, messageHash: any, params: any): Promise<void>;
313
+ /**
314
+ * @method
315
+ * @name weex#unWatchPositions
316
+ * @description unWatches all open positions
317
+ * @see https://www.weex.com/api-doc/contract/Websocket/private/Positions-Channel
318
+ * @param {string[]} [symbols] not used by the exchange, unsubscription from positions is global for all symbols
319
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
320
+ * @returns {object} status of the unwatch request
321
+ */
322
+ unWatchPositions(symbols?: Strings, params?: {}): Promise<any>;
323
+ handlePositions(client: any, message: any): void;
324
+ getMarketFromClientAndMessage(client: Client, message: any): import("../base/types.js").MarketInterface;
325
+ pong(client: Client, message: any): Promise<void>;
326
+ handlePing(client: Client, message: any): void;
327
+ handleSubscriptionStatus(client: Client, message: any): any;
328
+ handleErrorMessage(client: Client, message: any): boolean;
329
+ handleMessage(client: Client, message: any): void;
330
+ }