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.
- package/README.md +6 -5
- package/dist/ccxt.browser.min.js +10 -10
- package/dist/cjs/ccxt.js +6 -1
- package/dist/cjs/src/abstract/weex.js +11 -0
- package/dist/cjs/src/btcbox.js +1 -1
- package/dist/cjs/src/bullish.js +2 -1
- package/dist/cjs/src/kraken.js +1 -0
- package/dist/cjs/src/krakenfutures.js +10 -1
- package/dist/cjs/src/kucoin.js +5 -1
- package/dist/cjs/src/lighter.js +6 -3
- package/dist/cjs/src/mexc.js +7 -12
- package/dist/cjs/src/paradex.js +5 -2
- package/dist/cjs/src/pro/binance.js +1 -1
- package/dist/cjs/src/pro/cex.js +1 -1
- package/dist/cjs/src/pro/coinbase.js +1 -1
- package/dist/cjs/src/pro/lighter.js +338 -18
- package/dist/cjs/src/pro/weex.js +1906 -0
- package/dist/cjs/src/weex.js +3823 -0
- package/js/ccxt.d.ts +8 -2
- package/js/ccxt.js +6 -2
- package/js/src/abstract/weex.d.ts +83 -0
- package/js/src/abstract/weex.js +11 -0
- package/js/src/btcbox.js +1 -1
- package/js/src/bullish.js +2 -1
- package/js/src/kraken.js +1 -0
- package/js/src/krakenfutures.js +10 -1
- package/js/src/kucoin.d.ts +4 -0
- package/js/src/kucoin.js +5 -1
- package/js/src/lighter.d.ts +1 -0
- package/js/src/lighter.js +6 -3
- package/js/src/mexc.d.ts +2 -0
- package/js/src/mexc.js +7 -12
- package/js/src/paradex.js +5 -2
- package/js/src/pro/binance.js +1 -1
- package/js/src/pro/cex.js +1 -1
- package/js/src/pro/coinbase.js +1 -1
- package/js/src/pro/lighter.d.ts +37 -2
- package/js/src/pro/lighter.js +338 -18
- package/js/src/pro/weex.d.ts +330 -0
- package/js/src/pro/weex.js +1905 -0
- package/js/src/weex.d.ts +675 -0
- package/js/src/weex.js +3822 -0
- package/package.json +1 -1
package/js/src/weex.d.ts
ADDED
|
@@ -0,0 +1,675 @@
|
|
|
1
|
+
import Exchange from './abstract/weex.js';
|
|
2
|
+
import type { Balances, Currencies, Currency, Dict, FundingRate, FundingRateHistory, FundingRates, LedgerEntry, Int, int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TransferEntry, Position, TradingFeeInterface, MarginMode, MarginModes, Leverage, Leverages, MarginModification } from './base/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* @class weex
|
|
5
|
+
* @augments Exchange
|
|
6
|
+
*/
|
|
7
|
+
export default class weex extends Exchange {
|
|
8
|
+
describe(): any;
|
|
9
|
+
nonce(): number;
|
|
10
|
+
/**
|
|
11
|
+
* @method
|
|
12
|
+
* @name weex#fetchStatus
|
|
13
|
+
* @description the latest known information on the availability of the exchange API
|
|
14
|
+
* @see https://www.weex.com/api-doc/spot/ConfigAPI/Ping
|
|
15
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
16
|
+
* @returns {object} a [status structure]{@link https://docs.ccxt.com/?id=exchange-status-structure}
|
|
17
|
+
*/
|
|
18
|
+
fetchStatus(params?: {}): Promise<{
|
|
19
|
+
status: string;
|
|
20
|
+
updated: any;
|
|
21
|
+
eta: any;
|
|
22
|
+
url: any;
|
|
23
|
+
info: any;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* @method
|
|
27
|
+
* @name weex#fetchTime
|
|
28
|
+
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
29
|
+
* @see https://www.weex.com/api-doc/spot/ConfigAPI/GetServerTime
|
|
30
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetServerTime
|
|
31
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
32
|
+
* @param {string} [params.type] 'spot' or 'swap', default is 'spot'
|
|
33
|
+
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
34
|
+
*/
|
|
35
|
+
fetchTime(params?: {}): Promise<Int>;
|
|
36
|
+
/**
|
|
37
|
+
* @method
|
|
38
|
+
* @name weex#fetchCurrencies
|
|
39
|
+
* @description fetches all available currencies on an exchange
|
|
40
|
+
* @see https://www.weex.com/api-doc/spot/ConfigAPI/CurrencyInfo
|
|
41
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
42
|
+
* @returns {object} an associative dictionary of currencies
|
|
43
|
+
*/
|
|
44
|
+
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
45
|
+
/**
|
|
46
|
+
* @method
|
|
47
|
+
* @name weex#fetchMarkets
|
|
48
|
+
* @description retrieves data on all markets for exchagne
|
|
49
|
+
* @see https://www.weex.com/api-doc/spot/ConfigAPI/GetProductInfo // spot
|
|
50
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetContractInfo // contract
|
|
51
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
52
|
+
* @returns {object[]} an array of objects representing market data
|
|
53
|
+
*/
|
|
54
|
+
fetchMarkets(params?: {}): Promise<Market[]>;
|
|
55
|
+
parseMarket(market: Dict): Market;
|
|
56
|
+
/**
|
|
57
|
+
* @method
|
|
58
|
+
* @name weex#fetchTickers
|
|
59
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
60
|
+
* @see https://www.weex.com/api-doc/spot/MarketDataAPI/GetAllTickerInfo // spot
|
|
61
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetTicker24h // contract
|
|
62
|
+
* @param {string} symbols unified symbol of the market to fetch the ticker for
|
|
63
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
64
|
+
* @param {string} [params.type] 'spot' or 'swap', default is 'spot' (used if symbols are not provided)
|
|
65
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure}
|
|
66
|
+
*/
|
|
67
|
+
fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
68
|
+
/**
|
|
69
|
+
* @method
|
|
70
|
+
* @name weex#fetchBidsAsks
|
|
71
|
+
* @description fetches the bid and ask price and volume for multiple markets
|
|
72
|
+
* @see https://www.weex.com/api-doc/spot/MarketDataAPI/GetBookTicker // spot
|
|
73
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetBookTicker // contract
|
|
74
|
+
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
|
|
75
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
76
|
+
* @param {string} [params.type] 'spot' or 'swap', default is 'spot' (used if symbols are not provided)
|
|
77
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/?id=ticker-structure}
|
|
78
|
+
*/
|
|
79
|
+
fetchBidsAsks(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
80
|
+
parseTicker(ticker: Dict, market?: Market): Ticker;
|
|
81
|
+
/**
|
|
82
|
+
* @method
|
|
83
|
+
* @name weex#fetchOrderBook
|
|
84
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
85
|
+
* @see https://www.weex.com/api-doc/spot/MarketDataAPI/GetDepthData // spot
|
|
86
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetDepthData // contract
|
|
87
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
88
|
+
* @param {int} [limit] the maximum amount of order book entries to return (default 15, max 200)
|
|
89
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
90
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
|
|
91
|
+
*/
|
|
92
|
+
fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
93
|
+
/**
|
|
94
|
+
* @method
|
|
95
|
+
* @name weex#fetchOHLCV
|
|
96
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
97
|
+
* @see https://www.weex.com/api-doc/spot/MarketDataAPI/GetKLineData // spot
|
|
98
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetKlines // contract last price
|
|
99
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetIndexPriceKlines // contract index price
|
|
100
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetMarkPriceKlines // contract mark price
|
|
101
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetHistoryKlines // contract historical klines
|
|
102
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
103
|
+
* @param {string} timeframe the length of time each candle represents
|
|
104
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
105
|
+
* @param {int} [limit] the maximum amount of candles to fetch (default 100, max 300)
|
|
106
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
107
|
+
* Check fetchSpotOHLCV() and fetchContractOHLCV() for more details on the extra parameters that can be used in params
|
|
108
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
109
|
+
*/
|
|
110
|
+
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
111
|
+
/**
|
|
112
|
+
* @method
|
|
113
|
+
* @ignore
|
|
114
|
+
* @name weex#fetchSpotOHLCV
|
|
115
|
+
* @description helper method for fetchOHLCV
|
|
116
|
+
* @see https://www.weex.com/api-doc/spot/MarketDataAPI/GetKLineData
|
|
117
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
118
|
+
* @param {string} timeframe the length of time each candle represents
|
|
119
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
120
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
121
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
122
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
123
|
+
*/
|
|
124
|
+
fetchSpotOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
125
|
+
/**
|
|
126
|
+
* @method
|
|
127
|
+
* @ignore
|
|
128
|
+
* @name weex#fetchContractOHLCV
|
|
129
|
+
* @description helper method for fetchOHLCV
|
|
130
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetKlines // contract last price
|
|
131
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetIndexPriceKlines // contract index price
|
|
132
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetMarkPriceKlines // contract mark price
|
|
133
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetHistoryKlines // contract historical klines
|
|
134
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
135
|
+
* @param {string} timeframe the length of time each candle represents
|
|
136
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
137
|
+
* @param {int} [limit] the maximum amount of candles to fetch (default 100, max 100 for historical klines, max 1000 for other contract klines)
|
|
138
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
139
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
140
|
+
* @param {boolean} [params.paginate] whether to automatically paginate requests until the required number of candles is returned
|
|
141
|
+
* @param {boolean} [params.historical] whether to fetch historical klines (default is false). If false, will fetch last price klines
|
|
142
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
143
|
+
*/
|
|
144
|
+
fetchContractOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
145
|
+
parseOHLCV(ohlcv: any, market?: Market): OHLCV;
|
|
146
|
+
/**
|
|
147
|
+
* @method
|
|
148
|
+
* @name weex#fetchTrades
|
|
149
|
+
* @description get the list of most recent trades for a particular symbol
|
|
150
|
+
* @see https://www.weex.com/api-doc/spot/MarketDataAPI/GetTradeData // spot
|
|
151
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetRecentTrades // contract
|
|
152
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
153
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
154
|
+
* @param {int} [limit] the maximum amount of trades to fetch (default 100, max 1000)
|
|
155
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
156
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=public-trades}
|
|
157
|
+
*/
|
|
158
|
+
fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
159
|
+
parseTrade(trade: Dict, market?: Market): Trade;
|
|
160
|
+
/**
|
|
161
|
+
* @method
|
|
162
|
+
* @name weex#fetchOpenInterest
|
|
163
|
+
* @description retrieves the open interest of a contract trading pair
|
|
164
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetOpenInterest
|
|
165
|
+
* @param {string} symbol unified CCXT market symbol
|
|
166
|
+
* @param {object} [params] exchange specific parameters
|
|
167
|
+
* @returns {object} an open interest structure{@link https://docs.ccxt.com/?id=open-interest-structure}
|
|
168
|
+
*/
|
|
169
|
+
fetchOpenInterest(symbol: string, params?: {}): Promise<import("./base/types.js").OpenInterest>;
|
|
170
|
+
parseOpenInterest(interest: any, market?: Market): import("./base/types.js").OpenInterest;
|
|
171
|
+
/**
|
|
172
|
+
* @method
|
|
173
|
+
* @name weex#fetchFundingRates
|
|
174
|
+
* @description fetch the funding rate for multiple markets
|
|
175
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetCurrentFundingRate
|
|
176
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
177
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
178
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
179
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/?id=funding-rates-structure}, indexed by market symbols
|
|
180
|
+
*/
|
|
181
|
+
fetchFundingRates(symbols?: Strings, params?: {}): Promise<FundingRates>;
|
|
182
|
+
parseFundingRate(contract: any, market?: Market): FundingRate;
|
|
183
|
+
/**
|
|
184
|
+
* @method
|
|
185
|
+
* @name weex#fetchFundingRateHistory
|
|
186
|
+
* @description fetches historical funding rate prices
|
|
187
|
+
* @see https://www.weex.com/api-doc/contract/Market_API/GetFundingRateHistory
|
|
188
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
189
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
190
|
+
* @param {int} [limit] the maximum amount of funding rate records to fetch (default 100, max 1000)
|
|
191
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
192
|
+
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
193
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/?id=funding-rate-history-structure}
|
|
194
|
+
*/
|
|
195
|
+
fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
|
|
196
|
+
parseFundingRateHistory(contract: any, market?: Market): {
|
|
197
|
+
info: any;
|
|
198
|
+
symbol: string;
|
|
199
|
+
fundingRate: number;
|
|
200
|
+
timestamp: number;
|
|
201
|
+
datetime: string;
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* @method
|
|
205
|
+
* @name weex#fetchBalance
|
|
206
|
+
* @see https://www.weex.com/api-doc/spot/AccountAPI/GetAccountBalance // spot
|
|
207
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/GetAccountBalance // contract
|
|
208
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in positions
|
|
209
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
210
|
+
* @param {string} [params.type] 'spot' or 'swap' (default is 'spot')
|
|
211
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
212
|
+
*/
|
|
213
|
+
fetchBalance(params?: {}): Promise<Balances>;
|
|
214
|
+
parseBalance(response: any): Balances;
|
|
215
|
+
/**
|
|
216
|
+
* @method
|
|
217
|
+
* @name weex#fetchTransfers
|
|
218
|
+
* @description fetch a history of internal transfers made on an account
|
|
219
|
+
* @see https://www.weex.com/api-doc/spot/AccountAPI/TransferRecords
|
|
220
|
+
* @param {string} [code] unified currency code of the currency transferred
|
|
221
|
+
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
222
|
+
* @param {int} [limit] the maximum number of transfers structures to retrieve (default 10, max 100)
|
|
223
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
224
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
225
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/?id=transfer-structure}
|
|
226
|
+
*/
|
|
227
|
+
fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<TransferEntry[]>;
|
|
228
|
+
parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
|
|
229
|
+
parseTransferStatus(status: Str): string;
|
|
230
|
+
/**
|
|
231
|
+
* @method
|
|
232
|
+
* @name weex#createOrder
|
|
233
|
+
* @description Create an order on the exchange
|
|
234
|
+
* @see https://www.weex.com/api-doc/spot/orderApi/PlaceOrder // spot
|
|
235
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/PlaceOrder // contract
|
|
236
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/PlacePendingOrder // contract trigger
|
|
237
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/PlaceTpSlOrder // contract take profit / stop loss
|
|
238
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
239
|
+
* @param {string} type 'limit' or 'market'
|
|
240
|
+
* @param {string} side 'buy' or 'sell'
|
|
241
|
+
* @param {float} amount the amount of currency to trade
|
|
242
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
243
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
244
|
+
* Check createSpotOrder() and createContractOrder() for more details on the extra parameters that can be used in params
|
|
245
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
|
|
246
|
+
*/
|
|
247
|
+
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
248
|
+
/**
|
|
249
|
+
* @method
|
|
250
|
+
* @name weex#createSpotOrder
|
|
251
|
+
* @description helper method for creating spot orders
|
|
252
|
+
* @see https://www.weex.com/api-doc/spot/orderApi/PlaceOrder
|
|
253
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
254
|
+
* @param {string} type 'limit' or 'market'
|
|
255
|
+
* @param {string} side 'buy' or 'sell'
|
|
256
|
+
* @param {float} amount the amount of currency to trade
|
|
257
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
258
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
259
|
+
* @param {string} [params.clientOrderId] client order id
|
|
260
|
+
* @param {string} [params.timeInForce] 'GTC', 'IOC', or 'FOK'
|
|
261
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
|
|
262
|
+
*/
|
|
263
|
+
createSpotOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
264
|
+
createSpotOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Dict;
|
|
265
|
+
/**
|
|
266
|
+
* @method
|
|
267
|
+
* @name weex#createContractOrder
|
|
268
|
+
* @description helper method for creating contract orders
|
|
269
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/PlaceOrder
|
|
270
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/PlacePendingOrder
|
|
271
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
272
|
+
* @param {string} type 'limit' or 'market'
|
|
273
|
+
* @param {string} side 'buy' or 'sell'
|
|
274
|
+
* @param {float} amount the amount of currency to trade
|
|
275
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
276
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
277
|
+
* @param {string} [params.clientOrderId] client order id
|
|
278
|
+
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered and the triggerPriceType
|
|
279
|
+
* @param {float} [params.takeProfit.triggerPrice] The price at which the take profit order will be triggered
|
|
280
|
+
* @param {string} [params.takeProfit.triggerPriceType] The type of the trigger price for the take profit order, either 'last' or 'mark' (default is 'last')
|
|
281
|
+
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered and the triggerPriceType
|
|
282
|
+
* @param {float} [params.stopLoss.triggerPrice] The price at which the stop loss order will be triggered
|
|
283
|
+
* @param {string} [params.stopLoss.triggerPriceType] The type of the trigger price for the stop loss order, either 'last' or 'mark' (default is 'last')
|
|
284
|
+
* @param {float} [params.stopLossPrice] price to trigger stop-loss orders
|
|
285
|
+
* @param {string} [params.stopLossPriceType] The type of the trigger price for the stop loss order, either 'last' or 'mark' (default is 'last')
|
|
286
|
+
* @param {float} [params.takeProfitPrice] price to trigger take-profit orders
|
|
287
|
+
* @param {string} [params.takeProfitPriceType] The type of the trigger price for the take profit order, either 'last' or 'mark' (default is 'last')
|
|
288
|
+
* @param {bool} [params.reduceOnly] A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true.
|
|
289
|
+
* @param {string} [params.timeInForce] GTC, IOC, or FOK (default is GTC for limit orders)
|
|
290
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
|
|
291
|
+
*/
|
|
292
|
+
createContractOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
293
|
+
createContractOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): any;
|
|
294
|
+
encodeTriggerPriceType(triggerPriceType: Str): string;
|
|
295
|
+
/**
|
|
296
|
+
* @method
|
|
297
|
+
* @name weex#cancelOrder
|
|
298
|
+
* @description cancels an open order
|
|
299
|
+
* @see https://www.weex.com/api-doc/spot/orderApi/CancelOrder // spot
|
|
300
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/CancelOrder // contract
|
|
301
|
+
* @param {string} id order id
|
|
302
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
303
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
304
|
+
* @param {string} [params.type] 'spot' or 'swap' (default is 'spot')
|
|
305
|
+
* @param {boolean} [params.trigger] *contract orders only* whether the order to cancel is a trigger order
|
|
306
|
+
* @param {string} [params.clientOrderId] *non-trigger orders only* a unique id for the order
|
|
307
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
|
|
308
|
+
*/
|
|
309
|
+
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
310
|
+
/**
|
|
311
|
+
* @method
|
|
312
|
+
* @name weex#cancelAllOrders
|
|
313
|
+
* @description cancel all open orders
|
|
314
|
+
* @see https://www.weex.com/api-doc/spot/orderApi/Cancel-Symbol-Orders // spot
|
|
315
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/CancelAllOrders // contract
|
|
316
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/CancelAllPendingOrders // contract trigger
|
|
317
|
+
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
318
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
319
|
+
* @param {string} [params.type] 'spot' or 'swap', used if symbol is not provided (default is 'spot')
|
|
320
|
+
* @param {boolean} [params.trigger] *swap only* true for cancelling trigger orders (default is false)
|
|
321
|
+
* @returns Response from the exchange
|
|
322
|
+
*/
|
|
323
|
+
cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
|
|
324
|
+
/**
|
|
325
|
+
* @method
|
|
326
|
+
* @name weex#cancelOrders
|
|
327
|
+
* @description cancel multiple orders
|
|
328
|
+
* @see https://www.weex.com/api-doc/spot/orderApi/BulkCancel // spot
|
|
329
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/CancelOrdersBatch // contract
|
|
330
|
+
* @param {string[]} ids order ids
|
|
331
|
+
* @param {string} [symbol] unified market symbol, default is undefined
|
|
332
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
333
|
+
* @param {string[]} [params.clientOrderIds] client order ids (could be an alternative to ids)
|
|
334
|
+
* @param {string} [params.type] 'spot' or 'swap', used if symbol is not provided (default is 'spot')
|
|
335
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
|
|
336
|
+
*/
|
|
337
|
+
cancelOrders(ids: string[], symbol?: Str, params?: {}): Promise<Order[]>;
|
|
338
|
+
/**
|
|
339
|
+
* @method
|
|
340
|
+
* @name weex#fetchOrder
|
|
341
|
+
* @description fetches information on an order made by the user
|
|
342
|
+
* @see https://www.weex.com/api-doc/spot/orderApi/OrderDetails // spot
|
|
343
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/GetSingleOrderInfo // contract
|
|
344
|
+
* @param {string} id order id
|
|
345
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
346
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
347
|
+
* @param {string} [params.type] 'spot' or 'swap', used if symbol is not provided (default is 'spot')
|
|
348
|
+
* @param {string} [params.clientOrderId] *spot only* a unique id for the order, used if id is not provided
|
|
349
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/?id=order-structure}
|
|
350
|
+
*/
|
|
351
|
+
fetchOrder(id: Str, symbol?: Str, params?: {}): Promise<Order>;
|
|
352
|
+
/**
|
|
353
|
+
* @method
|
|
354
|
+
* @name weex#fetchOpenOrders
|
|
355
|
+
* @see https://www.weex.com/api-doc/spot/orderApi/UnfinishedOrders // spot
|
|
356
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/GetCurrentOrderStatus // contract
|
|
357
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/GetCurrentPendingOrders // contract trigger
|
|
358
|
+
* @description fetch all unfilled currently open orders
|
|
359
|
+
* @param {string} symbol unified market symbol
|
|
360
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
361
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
362
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
363
|
+
* @param {string} [params.type] 'spot' or 'swap', used if symbol is not provided (default is 'spot')
|
|
364
|
+
* @param {boolean} [params.trigger] *swap only* whether to fetch trigger orders (default is false)
|
|
365
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
366
|
+
*/
|
|
367
|
+
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
368
|
+
/**
|
|
369
|
+
* @method
|
|
370
|
+
* @name weex#fetchClosedOrders
|
|
371
|
+
* @description fetches information on multiple closed orders made by the user
|
|
372
|
+
* @see https://www.weex.com/api-doc/spot/orderApi/HistoryOrders // spot
|
|
373
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/GetOrderHistory // contract
|
|
374
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
375
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
376
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
377
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
378
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
379
|
+
* @param {string} [params.type] 'spot' or 'swap', used if symbol is not provided (default is 'spot')
|
|
380
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
|
|
381
|
+
*/
|
|
382
|
+
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
383
|
+
/**
|
|
384
|
+
* @method
|
|
385
|
+
* @name weex#fetchCanceledOrders
|
|
386
|
+
* @description fetches information on multiple canceled orders made by the user
|
|
387
|
+
* @see https://www.weex.com/api-doc/spot/orderApi/HistoryOrders // spot
|
|
388
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/GetOrderHistory // contract
|
|
389
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
390
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
391
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
392
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
393
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
394
|
+
* @param {string} [params.type] 'spot' or 'swap', used if symbol is not provided (default is 'spot')
|
|
395
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
|
|
396
|
+
*/
|
|
397
|
+
fetchCanceledOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
398
|
+
/**
|
|
399
|
+
* @method
|
|
400
|
+
* @name weex#fetchOrders
|
|
401
|
+
* @description fetches information on multiple spot orders made by the user
|
|
402
|
+
* @see https://www.weex.com/api-doc/spot/orderApi/HistoryOrders // spot
|
|
403
|
+
* @param {string} symbol unified market symbol of the market orders were made in (required for spot orders)
|
|
404
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
405
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
406
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
407
|
+
* @param {object} [params.until] end time, ms
|
|
408
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
409
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
|
|
410
|
+
*/
|
|
411
|
+
fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
412
|
+
/**
|
|
413
|
+
* @method
|
|
414
|
+
* @name weex#fetchCanceledAndClosedOrders
|
|
415
|
+
* @description fetches information on multiple closed and canceled orders made by the user
|
|
416
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/GetOrderHistory // contract
|
|
417
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in (required for spot orders)
|
|
418
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
419
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
420
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
421
|
+
* @param {object} [params.until] end time, ms
|
|
422
|
+
* @param {string} [params.type] 'spot' or 'swap', used if symbol is not provided (default is 'spot')
|
|
423
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
424
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
|
|
425
|
+
*/
|
|
426
|
+
fetchCanceledAndClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
427
|
+
parseOrder(order: Dict, market?: Market): Order;
|
|
428
|
+
parseOrderStatus(status: Str): string;
|
|
429
|
+
parseOrderType(type: Str): string;
|
|
430
|
+
handleOrderOrPositionError(errorCode: Str, errorMessage: Str, order: Dict): void;
|
|
431
|
+
/**
|
|
432
|
+
* @method
|
|
433
|
+
* @name weex#fetchOrderTrades
|
|
434
|
+
* @description fetch all the trades made from a single order
|
|
435
|
+
* @see https://www.weex.com/api-doc/spot/orderApi/TransactionDetails // spot
|
|
436
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/GetTradeDetails // contract
|
|
437
|
+
* @param {string} id order id
|
|
438
|
+
* @param {string} [symbol] unified market symbol
|
|
439
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
440
|
+
* @param {int} [limit] the maximum number of trades to retrieve
|
|
441
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
442
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=trade-structure}
|
|
443
|
+
*/
|
|
444
|
+
fetchOrderTrades(id: string, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
445
|
+
/**
|
|
446
|
+
* @method
|
|
447
|
+
* @name weex#fetchMyTrades
|
|
448
|
+
* @see https://www.weex.com/api-doc/spot/orderApi/TransactionDetails // spot
|
|
449
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/GetTradeDetails // contract
|
|
450
|
+
* @description fetch all trades made by the user
|
|
451
|
+
* @param {string} symbol unified market symbol
|
|
452
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
453
|
+
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
454
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
455
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
456
|
+
* @param {string} [params.type] 'spot' or 'swap', used if symbol is not provided (default is 'spot')
|
|
457
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=trade-structure}
|
|
458
|
+
*/
|
|
459
|
+
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
460
|
+
/**
|
|
461
|
+
* @method
|
|
462
|
+
* @name weex#fetchLedger
|
|
463
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
464
|
+
* @see https://www.weex.com/api-doc/spot/AccountAPI/GetBillRecords // spot
|
|
465
|
+
* @see https://www.weex.com/api-doc/spot/AccountAPI/GetFundBillRecords // funding
|
|
466
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/GetContractBills // contract
|
|
467
|
+
* @param {string} [code] unified currency code, default is undefined
|
|
468
|
+
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
469
|
+
* @param {int} [limit] max number of ledger entries to return, default is undefined, max is 100
|
|
470
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
471
|
+
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
472
|
+
* @param {string} [params.type] 'spot', 'funding' or 'swap' (default is 'spot')
|
|
473
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
474
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/?id=ledger-entry-structure}
|
|
475
|
+
*/
|
|
476
|
+
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
477
|
+
parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
|
|
478
|
+
parseLedgerType(type: Str): string;
|
|
479
|
+
/**
|
|
480
|
+
* @method
|
|
481
|
+
* @name weex#fetchPositions
|
|
482
|
+
* @description fetch all open positions
|
|
483
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/GetAllPositions
|
|
484
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
485
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
486
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/?id=position-structure}
|
|
487
|
+
*/
|
|
488
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
489
|
+
/**
|
|
490
|
+
* @method
|
|
491
|
+
* @name weex#fetchPosition
|
|
492
|
+
* @description fetch data on an open position
|
|
493
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/GetSinglePosition
|
|
494
|
+
* @param {string} symbol unified market symbol of the market the position is held in
|
|
495
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
496
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/?id=position-structure}
|
|
497
|
+
*/
|
|
498
|
+
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
499
|
+
/**
|
|
500
|
+
* @method
|
|
501
|
+
* @description fetch open positions for a single market
|
|
502
|
+
* @name weex#fetchPositionsForSymbol
|
|
503
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/GetSinglePosition
|
|
504
|
+
* @description fetch all open positions for specific symbol
|
|
505
|
+
* @param {string} symbol unified market symbol
|
|
506
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
507
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/?id=position-structure}
|
|
508
|
+
*/
|
|
509
|
+
fetchPositionsForSymbol(symbol: string, params?: {}): Promise<Position[]>;
|
|
510
|
+
parsePosition(position: Dict, market?: Market): Position;
|
|
511
|
+
/**
|
|
512
|
+
* @method
|
|
513
|
+
* @name weex#closeAllPositions
|
|
514
|
+
* @description closes all open positions for a market type
|
|
515
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/ClosePositions
|
|
516
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
517
|
+
* @returns {object[]} A list of [position structures]{@link https://docs.ccxt.com/?id=position-structure}
|
|
518
|
+
*/
|
|
519
|
+
closeAllPositions(params?: {}): Promise<Position[]>;
|
|
520
|
+
/**
|
|
521
|
+
* @method
|
|
522
|
+
* @name weex#closePosition
|
|
523
|
+
* @description closes open positions for a market
|
|
524
|
+
* @see https://www.weex.com/api-doc/contract/Transaction_API/ClosePositions
|
|
525
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
526
|
+
* @param {string} [side] not used by current exchange
|
|
527
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
528
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
|
|
529
|
+
*/
|
|
530
|
+
closePosition(symbol: string, side?: OrderSide, params?: {}): Promise<Order>;
|
|
531
|
+
/**
|
|
532
|
+
* @method
|
|
533
|
+
* @name weex#fetchTradingFee
|
|
534
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/GetCommissionRate // contract
|
|
535
|
+
* @description fetch the trading fees for a contract market
|
|
536
|
+
* @param {string} symbol unified market symbol
|
|
537
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
538
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
539
|
+
*/
|
|
540
|
+
fetchTradingFee(symbol: string, params?: {}): Promise<TradingFeeInterface>;
|
|
541
|
+
parseTradingFee(fee: Dict, market?: Market): TradingFeeInterface;
|
|
542
|
+
/**
|
|
543
|
+
* @method
|
|
544
|
+
* @name weex#fetchMarginMode
|
|
545
|
+
* @description fetches the margin mode of a specific symbol
|
|
546
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/GetSymbolConfig
|
|
547
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
548
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
549
|
+
* @returns {object} a [margin mode structure]{@link https://docs.ccxt.com/?id=margin-mode-structure}
|
|
550
|
+
*/
|
|
551
|
+
fetchMarginMode(symbol: string, params?: {}): Promise<MarginMode>;
|
|
552
|
+
/**
|
|
553
|
+
* @method
|
|
554
|
+
* @name weex#fetchMarginModes
|
|
555
|
+
* @description fetches margin modes the symbols, with symbols=undefined all markets are returned
|
|
556
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/GetSymbolConfig
|
|
557
|
+
* @param {string[]} symbols unified market symbols
|
|
558
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
559
|
+
* @returns {object} a list of [margin mode structures]{@link https://docs.ccxt.com/?id=margin-mode-structure}
|
|
560
|
+
*/
|
|
561
|
+
fetchMarginModes(symbols?: Strings, params?: {}): Promise<MarginModes>;
|
|
562
|
+
parseMarginMode(marginMode: Dict, market?: any): MarginMode;
|
|
563
|
+
parseMarginType(marginType: Str): string;
|
|
564
|
+
/**
|
|
565
|
+
* @method
|
|
566
|
+
* @name weex#setMarginMode
|
|
567
|
+
* @description set margin mode to 'cross' or 'isolated'
|
|
568
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/ChangeMarginModeTRADE
|
|
569
|
+
* @param {string} marginMode 'cross' or 'isolated'
|
|
570
|
+
* @param {string} symbol unified market symbol
|
|
571
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
572
|
+
* @returns {object} response from the exchange
|
|
573
|
+
*/
|
|
574
|
+
setMarginMode(marginMode: string, symbol?: Str, params?: {}): Promise<any>;
|
|
575
|
+
encodeMarginMode(marginMode: Str): string;
|
|
576
|
+
/**
|
|
577
|
+
* @method
|
|
578
|
+
* @name weex#fetchLeverage
|
|
579
|
+
* @description fetch the set leverage for a market
|
|
580
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/GetSymbolConfig
|
|
581
|
+
* @param {string} symbol unified market symbol
|
|
582
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
583
|
+
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/?id=leverage-structure}
|
|
584
|
+
*/
|
|
585
|
+
fetchLeverage(symbol: string, params?: {}): Promise<Leverage>;
|
|
586
|
+
/**
|
|
587
|
+
* @method
|
|
588
|
+
* @name weex#fetchLeverages
|
|
589
|
+
* @description fetch the set leverage for all markets
|
|
590
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/GetSymbolConfig
|
|
591
|
+
* @param {string[]} [symbols] a list of unified market symbols
|
|
592
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
593
|
+
* @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
594
|
+
*/
|
|
595
|
+
fetchLeverages(symbols?: Strings, params?: {}): Promise<Leverages>;
|
|
596
|
+
parseLeverage(leverage: Dict, market?: Market): Leverage;
|
|
597
|
+
/**
|
|
598
|
+
* @method
|
|
599
|
+
* @name weex#setLeverage
|
|
600
|
+
* @description set the level of leverage for a market
|
|
601
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/UpdateLeverageTRADE
|
|
602
|
+
* @param {float} leverage the rate of leverage
|
|
603
|
+
* @param {string} symbol unified market symbol
|
|
604
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
605
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated' (default is 'cross' if specific leverage parameters are not provided)
|
|
606
|
+
* @param {number} [params.crossLeverage] *cross margin mode only* leverage for cross margin mode when marginMode is 'cross'
|
|
607
|
+
* @param {number} [params.isolatedLongLeverage] *isolated margin mode only* leverage for long positions when marginMode is 'isolated'
|
|
608
|
+
* @param {number} [params.isolatedShortLeverage] *isolated margin mode only* leverage for short positions when marginMode is 'isolated'
|
|
609
|
+
* If specific leverage parameters are not provided
|
|
610
|
+
* the leverage value will be applied to both long and short positions if marginMode is 'isolated'
|
|
611
|
+
* or to cross margin mode if marginMode is 'cross'
|
|
612
|
+
* If marginMode is not provided and specific leverage parameters are not provided too
|
|
613
|
+
* the leverage value will be applied to cross leverage
|
|
614
|
+
* @returns {object} response from the exchange
|
|
615
|
+
*/
|
|
616
|
+
setLeverage(leverage: int, symbol?: Str, params?: {}): Promise<any>;
|
|
617
|
+
/**
|
|
618
|
+
* @method
|
|
619
|
+
* @name weex#fetchPositionMode
|
|
620
|
+
* @description fetchs the position mode, hedged or one way
|
|
621
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/GetSymbolConfig
|
|
622
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
623
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
624
|
+
* @returns {object} an object detailing whether the market is in hedged or one-way mode
|
|
625
|
+
*/
|
|
626
|
+
fetchPositionMode(symbol?: Str, params?: {}): Promise<{
|
|
627
|
+
info: any;
|
|
628
|
+
hedged: boolean;
|
|
629
|
+
}>;
|
|
630
|
+
/**
|
|
631
|
+
* @method
|
|
632
|
+
* @name weex#setPositionMode
|
|
633
|
+
* @description set hedged to true or false for a market
|
|
634
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/ChangeMarginModeTRADE
|
|
635
|
+
* @param {bool} hedged set to true to use dualSidePosition
|
|
636
|
+
* @param {string} symbol unified market symbol
|
|
637
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
638
|
+
* @param {string} params.marginMode 'cross' or 'isolated' (default is 'cross')
|
|
639
|
+
* @returns {object} response from the exchange
|
|
640
|
+
*/
|
|
641
|
+
setPositionMode(hedged: boolean, symbol?: Str, params?: {}): Promise<any>;
|
|
642
|
+
modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
|
|
643
|
+
parseMarginModification(data: Dict, market?: Market): MarginModification;
|
|
644
|
+
/**
|
|
645
|
+
* @method
|
|
646
|
+
* @name weex#reduceMargin
|
|
647
|
+
* @description remove margin from a position
|
|
648
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/AdjustPositionMarginTRADE
|
|
649
|
+
* @param {string} symbol unified market symbol
|
|
650
|
+
* @param {float} amount the amount of margin to remove
|
|
651
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
652
|
+
* @param {string} params.positionId the id of the position to reduce margin from, required
|
|
653
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/?id=margin-structure}
|
|
654
|
+
*/
|
|
655
|
+
reduceMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
|
|
656
|
+
/**
|
|
657
|
+
* @method
|
|
658
|
+
* @name weex#addMargin
|
|
659
|
+
* @description add margin
|
|
660
|
+
* @see https://www.weex.com/api-doc/contract/Account_API/AdjustPositionMarginTRADE
|
|
661
|
+
* @param {string} symbol unified market symbol
|
|
662
|
+
* @param {float} amount amount of margin to add
|
|
663
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
664
|
+
* @param {string} params.positionId the id of the position to add margin to, required
|
|
665
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/?id=margin-structure}
|
|
666
|
+
*/
|
|
667
|
+
addMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
|
|
668
|
+
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
669
|
+
url: string;
|
|
670
|
+
method: string;
|
|
671
|
+
body: any;
|
|
672
|
+
headers: any;
|
|
673
|
+
};
|
|
674
|
+
handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
|
|
675
|
+
}
|