@myx-trade/sdk 1.0.8-beta.9 → 1.0.8
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/dist/chunk-AOF7T7AK.js +2 -0
- package/dist/chunk-KHOL4KXA.mjs +2 -0
- package/dist/index-C4yQUiAJ.d.mts +749 -0
- package/dist/index-C4yQUiAJ.d.ts +749 -0
- package/dist/index.d.mts +126 -866
- package/dist/index.d.ts +126 -866
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/lp.d.mts +2 -0
- package/dist/lp.d.ts +2 -0
- package/dist/lp.js +1 -0
- package/dist/lp.mjs +1 -0
- package/package.json +7 -2
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,577 +1,11 @@
|
|
|
1
|
+
import { B as BaseResponse, A as ApiResponse, C as ChainId, H as HttpKlineIntervalEnum, S as SearchTypeEnum, a as SearchSecondTypeEnum, P as PriceResponse, b as PoolResponse, c as PoolOpenOrdersResponse, d as HttpEnvParams, T as TickerDataItem, e as BaseDetailResponse, M as MarketDetailResponse, f as MarketInfo, O as OracleType, g as AccessTokenRequest, h as PositionResponse, i as OrderResponse, K as KlineDataItemType, j as SearchResultResponse, F as FavoritesListItem, k as PositionType, l as PlaceOrderParams, m as PositionTpSlOrderParams, n as OrderItem, o as Address$1, p as ContractAddress } from './index-C4yQUiAJ.js';
|
|
2
|
+
export { U as AccessTokenResponse, R as AccessTokenType, u as AddTpSLParams, D as COMMON_LP_AMOUNT_DECIMALS, z as COMMON_PRICE_DECIMALS, v as CancelTpSLParams, a0 as ChainIdRequest, w as CreatePoolRequest, L as DashboardType, a8 as Direction, J as ErrorCode, a1 as FavoritesType, $ as MarketCapType, W as MarketPool, X as MarketPoolResponse, V as MarketPoolState, _ as MarketType, N as NetWorkFee, I as ObjectType, a7 as OperationType, ab as Order, ac as OrderStatus, a5 as OrderType, Z as PoolOpenOrder, aa as Position, Y as PriceType, a2 as SearchResultContractItem, a3 as SearchResultCookItem, a4 as SearchResultEarnItem, Q as StatDashBoardResponse, a9 as TimeInForce, x as TpSLParams, y as TpSl, ad as TradingResult, a6 as TriggerType, ae as UpdateOrderTpSlParams, q as base, G as getPriceData, E as getPricesData, t as market, s as pool, r as quote } from './index-C4yQUiAJ.js';
|
|
1
3
|
import * as viem from 'viem';
|
|
2
|
-
import {
|
|
4
|
+
import { Address, WalletClient, PublicClient, Abi } from 'viem';
|
|
3
5
|
export { formatUnits, parseUnits } from 'viem';
|
|
4
6
|
import { Options, Event } from 'reconnecting-websocket';
|
|
5
7
|
import { WretchOptions } from 'wretch/types';
|
|
6
8
|
|
|
7
|
-
type Address$1 = `0x${string}` | typeof zeroAddress;
|
|
8
|
-
declare enum ChainId {
|
|
9
|
-
LINEA_SEPOLIA = 59141,
|
|
10
|
-
LINEA_MAINNET = 59144,
|
|
11
|
-
ARB_TESTNET = 421614,
|
|
12
|
-
ARB_MAINNET = 42161,
|
|
13
|
-
BSC_TESTNET = 97,
|
|
14
|
-
BSC_MAINNET = 56
|
|
15
|
-
}
|
|
16
|
-
interface ContractAddress {
|
|
17
|
-
readonly USDC: Address$1;
|
|
18
|
-
readonly Account: Address$1;
|
|
19
|
-
readonly POOL_MANAGER: Address$1;
|
|
20
|
-
readonly POSITION_MANAGER: Address$1;
|
|
21
|
-
readonly ORDER_MANAGER: Address$1;
|
|
22
|
-
readonly PYTH: Address$1;
|
|
23
|
-
readonly ERC20: Address$1;
|
|
24
|
-
readonly LIQUIDITY_ROUTER: Address$1;
|
|
25
|
-
readonly BASE_POOL: Address$1;
|
|
26
|
-
readonly QUOTE_POOL: Address$1;
|
|
27
|
-
readonly ORACLE: Address$1;
|
|
28
|
-
readonly EIP7702Delegation: Address$1;
|
|
29
|
-
readonly MARKET_MANAGER: Address$1;
|
|
30
|
-
readonly DATA_PROVIDER: Address$1;
|
|
31
|
-
readonly ORACLE_RESERVE: Address$1;
|
|
32
|
-
readonly FORWARDER: Address$1;
|
|
33
|
-
readonly REIMBURSEMENT: Address$1;
|
|
34
|
-
readonly DISPUTE_COURT: Address$1;
|
|
35
|
-
readonly TRADING_ROUTER: Address$1;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
interface CreatePoolRequest {
|
|
39
|
-
chainId: ChainId;
|
|
40
|
-
baseToken: `0x${string}`;
|
|
41
|
-
marketId: string;
|
|
42
|
-
}
|
|
43
|
-
declare enum PoolType {
|
|
44
|
-
Base = 0,
|
|
45
|
-
Quote = 1
|
|
46
|
-
}
|
|
47
|
-
declare enum TriggerType$1 {
|
|
48
|
-
TP = 1,
|
|
49
|
-
SL = 2
|
|
50
|
-
}
|
|
51
|
-
interface TpSl {
|
|
52
|
-
amount: number;
|
|
53
|
-
triggerPrice: number;
|
|
54
|
-
triggerType: TriggerType$1;
|
|
55
|
-
}
|
|
56
|
-
interface TpSLParams {
|
|
57
|
-
amount: bigint;
|
|
58
|
-
triggerPrice: bigint;
|
|
59
|
-
triggerType: bigint;
|
|
60
|
-
minQuoteOut: bigint;
|
|
61
|
-
}
|
|
62
|
-
interface AddTpSLParams {
|
|
63
|
-
slippage: number;
|
|
64
|
-
chainId: ChainId;
|
|
65
|
-
poolId: string;
|
|
66
|
-
poolType: PoolType;
|
|
67
|
-
tpsl: TpSl[];
|
|
68
|
-
}
|
|
69
|
-
interface CancelTpSLParams {
|
|
70
|
-
chainId: ChainId;
|
|
71
|
-
orderId: string;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Trading related types and enums
|
|
76
|
-
*/
|
|
77
|
-
declare const OrderType: {
|
|
78
|
-
readonly MARKET: 0;
|
|
79
|
-
readonly LIMIT: 1;
|
|
80
|
-
readonly STOP: 2;
|
|
81
|
-
readonly CONDITIONAL: 3;
|
|
82
|
-
};
|
|
83
|
-
type OrderType = (typeof OrderType)[keyof typeof OrderType];
|
|
84
|
-
declare const TriggerType: {
|
|
85
|
-
readonly NONE: 0;
|
|
86
|
-
readonly GTE: 1;
|
|
87
|
-
readonly LTE: 2;
|
|
88
|
-
};
|
|
89
|
-
type TriggerType = (typeof TriggerType)[keyof typeof TriggerType];
|
|
90
|
-
declare const OperationType: {
|
|
91
|
-
readonly INCREASE: 0;
|
|
92
|
-
readonly DECREASE: 1;
|
|
93
|
-
};
|
|
94
|
-
type OperationType = (typeof OperationType)[keyof typeof OperationType];
|
|
95
|
-
declare const Direction: {
|
|
96
|
-
readonly LONG: 0;
|
|
97
|
-
readonly SHORT: 1;
|
|
98
|
-
};
|
|
99
|
-
type Direction = (typeof Direction)[keyof typeof Direction];
|
|
100
|
-
declare const TimeInForce: {
|
|
101
|
-
readonly IOC: 0;
|
|
102
|
-
};
|
|
103
|
-
type TimeInForce = (typeof TimeInForce)[keyof typeof TimeInForce];
|
|
104
|
-
interface Position$1 {
|
|
105
|
-
positionId: string;
|
|
106
|
-
poolId: string;
|
|
107
|
-
direction: Direction;
|
|
108
|
-
size: string;
|
|
109
|
-
collateral: string;
|
|
110
|
-
leverage: number;
|
|
111
|
-
entryPrice: string;
|
|
112
|
-
markPrice: string;
|
|
113
|
-
pnl: string;
|
|
114
|
-
unrealizedPnl: string;
|
|
115
|
-
liquidationPrice: string;
|
|
116
|
-
marginRatio: string;
|
|
117
|
-
timestamp: number;
|
|
118
|
-
}
|
|
119
|
-
interface Order$1 {
|
|
120
|
-
orderId: string;
|
|
121
|
-
poolId: string;
|
|
122
|
-
positionId: string;
|
|
123
|
-
orderType: OrderType;
|
|
124
|
-
triggerType: TriggerType;
|
|
125
|
-
operation: OperationType;
|
|
126
|
-
direction: Direction;
|
|
127
|
-
size: string;
|
|
128
|
-
collateralAmount: string;
|
|
129
|
-
orderPrice?: string;
|
|
130
|
-
triggerPrice?: string;
|
|
131
|
-
timeInForce: TimeInForce;
|
|
132
|
-
postOnly: boolean;
|
|
133
|
-
slippagePct: string;
|
|
134
|
-
leverage: number;
|
|
135
|
-
status: OrderStatus;
|
|
136
|
-
createdAt: number;
|
|
137
|
-
updatedAt: number;
|
|
138
|
-
}
|
|
139
|
-
declare const OrderStatus: {
|
|
140
|
-
readonly PENDING: 0;
|
|
141
|
-
readonly PARTIAL: 1;
|
|
142
|
-
readonly FILLED: 2;
|
|
143
|
-
readonly CANCELLED: 3;
|
|
144
|
-
readonly REJECTED: 4;
|
|
145
|
-
readonly EXPIRED: 5;
|
|
146
|
-
};
|
|
147
|
-
type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus];
|
|
148
|
-
interface PlaceOrderParams {
|
|
149
|
-
chainId: number;
|
|
150
|
-
address: string;
|
|
151
|
-
poolId: string;
|
|
152
|
-
positionId: string;
|
|
153
|
-
orderType: OrderType;
|
|
154
|
-
triggerType: TriggerType;
|
|
155
|
-
direction: Direction;
|
|
156
|
-
collateralAmount: string;
|
|
157
|
-
size: string;
|
|
158
|
-
price: string;
|
|
159
|
-
timeInForce: TimeInForce;
|
|
160
|
-
postOnly: boolean;
|
|
161
|
-
slippagePct: string;
|
|
162
|
-
executionFeeToken: string;
|
|
163
|
-
leverage: number;
|
|
164
|
-
tpSize?: string;
|
|
165
|
-
tpPrice?: string;
|
|
166
|
-
slSize?: string;
|
|
167
|
-
slPrice?: string;
|
|
168
|
-
}
|
|
169
|
-
interface PositionTpSlOrderParams {
|
|
170
|
-
chainId: number;
|
|
171
|
-
address: string;
|
|
172
|
-
poolId: string;
|
|
173
|
-
positionId: string;
|
|
174
|
-
executionFeeToken: string;
|
|
175
|
-
tpTriggerType: TriggerType;
|
|
176
|
-
slTriggerType: TriggerType;
|
|
177
|
-
direction: Direction;
|
|
178
|
-
leverage: number;
|
|
179
|
-
tpSize?: string;
|
|
180
|
-
tpPrice?: string;
|
|
181
|
-
slSize?: string;
|
|
182
|
-
slPrice?: string;
|
|
183
|
-
slippagePct: string;
|
|
184
|
-
}
|
|
185
|
-
interface TradingResult {
|
|
186
|
-
success: boolean;
|
|
187
|
-
orderId?: string;
|
|
188
|
-
transactionHash: string;
|
|
189
|
-
gasUsed?: string;
|
|
190
|
-
error?: string;
|
|
191
|
-
}
|
|
192
|
-
interface UpdateOrderTpSlParams {
|
|
193
|
-
orderId: string;
|
|
194
|
-
tpSize: string;
|
|
195
|
-
tpPrice: string;
|
|
196
|
-
slSize: string;
|
|
197
|
-
slPrice: string;
|
|
198
|
-
address: string;
|
|
199
|
-
executionFeeToken: string;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
interface ObjectType<T> {
|
|
203
|
-
[key: string]: T;
|
|
204
|
-
}
|
|
205
|
-
type Address = `0x${string}`;
|
|
206
|
-
type NetWorkFee = {
|
|
207
|
-
paymentType: number;
|
|
208
|
-
volScale: number;
|
|
209
|
-
};
|
|
210
|
-
declare enum ErrorCode {
|
|
211
|
-
SUCCESS = 9200,
|
|
212
|
-
SUCCESS_ORIGIN = 0,
|
|
213
|
-
IDENTITY_VERIFICATION_FAILED = 9401,
|
|
214
|
-
PERMISSION_DENIED = 9403,
|
|
215
|
-
NOT_EXIST = 9404,
|
|
216
|
-
REQUEST_LIMIT = 9429,
|
|
217
|
-
SERVICE_ERROR = 9500,
|
|
218
|
-
MISS_REQUESTED_PARAMETER = 9900,
|
|
219
|
-
INVALID_PARAMETER = 9901,
|
|
220
|
-
NETWORK_ERROR = "ERR_NETWORK"
|
|
221
|
-
}
|
|
222
|
-
interface BaseResponse<T = any> {
|
|
223
|
-
code: ErrorCode;
|
|
224
|
-
msg: string | null;
|
|
225
|
-
data?: T;
|
|
226
|
-
}
|
|
227
|
-
type DashboardType = {
|
|
228
|
-
lpAsset: string;
|
|
229
|
-
cumTradeAmount: string;
|
|
230
|
-
cumEarnings: string;
|
|
231
|
-
accountCount: number;
|
|
232
|
-
positionAmount: string;
|
|
233
|
-
positionAmountRate: string | number;
|
|
234
|
-
accountCountRate: string | number;
|
|
235
|
-
tradeAmountRate: number | string;
|
|
236
|
-
lpAssetRate: string | number;
|
|
237
|
-
earningsRate: string | number;
|
|
238
|
-
};
|
|
239
|
-
interface StatDashBoardResponse extends BaseResponse {
|
|
240
|
-
data: DashboardType;
|
|
241
|
-
}
|
|
242
|
-
type AccessTokenType = {
|
|
243
|
-
accessToken: string;
|
|
244
|
-
expireAt: number;
|
|
245
|
-
allowAccount: string;
|
|
246
|
-
appId: string;
|
|
247
|
-
};
|
|
248
|
-
interface AccessTokenResponse$1 extends BaseResponse {
|
|
249
|
-
data: AccessTokenType;
|
|
250
|
-
}
|
|
251
|
-
declare enum MarketPoolState {
|
|
252
|
-
Cook = 0,// Market created
|
|
253
|
-
Primed = 1,// Fee charged, waiting for oracle initialization
|
|
254
|
-
Trench = 2,// Trading enabled
|
|
255
|
-
PreBench = 3,// Pending delisting
|
|
256
|
-
Bench = 4
|
|
257
|
-
}
|
|
258
|
-
type MarketPool = {
|
|
259
|
-
chainId: number;
|
|
260
|
-
marketId: string;
|
|
261
|
-
poolId: string;
|
|
262
|
-
oracleId?: number | null;
|
|
263
|
-
globalId: number;
|
|
264
|
-
state: MarketPoolState;
|
|
265
|
-
baseSymbol: string;
|
|
266
|
-
quoteSymbol: string;
|
|
267
|
-
baseDecimals: number;
|
|
268
|
-
quoteDecimals: number;
|
|
269
|
-
baseToken: string;
|
|
270
|
-
quoteToken: string;
|
|
271
|
-
basePoolToken: string;
|
|
272
|
-
quotePoolToken: string;
|
|
273
|
-
oracleType?: number | null;
|
|
274
|
-
feedId?: number | null;
|
|
275
|
-
activeTime: number;
|
|
276
|
-
poolPreTime: number;
|
|
277
|
-
};
|
|
278
|
-
interface MarketPoolResponse extends BaseResponse {
|
|
279
|
-
data: MarketPool[];
|
|
280
|
-
}
|
|
281
|
-
interface PoolResponse extends BaseResponse {
|
|
282
|
-
data: MarketPool;
|
|
283
|
-
}
|
|
284
|
-
declare enum OracleType {
|
|
285
|
-
Chainlink = 1,
|
|
286
|
-
Pyth = 2
|
|
287
|
-
}
|
|
288
|
-
type PriceType = {
|
|
289
|
-
oracleId: number;
|
|
290
|
-
price: string;
|
|
291
|
-
vaa: string;
|
|
292
|
-
publishTime: number;
|
|
293
|
-
oracleType?: OracleType;
|
|
294
|
-
nativeFee?: number | string;
|
|
295
|
-
poolId: string;
|
|
296
|
-
};
|
|
297
|
-
interface PriceResponse extends BaseResponse {
|
|
298
|
-
data: PriceType[];
|
|
299
|
-
}
|
|
300
|
-
interface ApiResponse<T = Record<string, any>> extends BaseResponse {
|
|
301
|
-
data: T;
|
|
302
|
-
}
|
|
303
|
-
interface PositionType {
|
|
304
|
-
chainId: number;
|
|
305
|
-
poolId: string;
|
|
306
|
-
positionId: string;
|
|
307
|
-
direction: Direction;
|
|
308
|
-
entryPrice: string;
|
|
309
|
-
size: string;
|
|
310
|
-
collateralAmount: string;
|
|
311
|
-
fundingRateIndex: string;
|
|
312
|
-
riskTier: number;
|
|
313
|
-
txTime: number;
|
|
314
|
-
broker: string;
|
|
315
|
-
userLeverage: number;
|
|
316
|
-
baseSymbol: string;
|
|
317
|
-
quoteSymbol: string;
|
|
318
|
-
earlyClosePrice: string;
|
|
319
|
-
tradingFee: string;
|
|
320
|
-
tokenId: string | null;
|
|
321
|
-
freeAmount: string;
|
|
322
|
-
lockedAmount: string;
|
|
323
|
-
}
|
|
324
|
-
interface PositionResponse extends BaseResponse {
|
|
325
|
-
data: PositionType[];
|
|
326
|
-
}
|
|
327
|
-
interface OrderItem {
|
|
328
|
-
baseSymbol: string;
|
|
329
|
-
chainId: number;
|
|
330
|
-
collateralAmount: string;
|
|
331
|
-
direction: Direction;
|
|
332
|
-
executionFeeAmount: string;
|
|
333
|
-
executionFeeToken: string | null;
|
|
334
|
-
filledAmount: string;
|
|
335
|
-
filledSize: string;
|
|
336
|
-
operation: OperationType;
|
|
337
|
-
orderId: number;
|
|
338
|
-
orderType: OrderType;
|
|
339
|
-
poolId: string;
|
|
340
|
-
positionId: string;
|
|
341
|
-
postOnly: 0 | 1;
|
|
342
|
-
price: string;
|
|
343
|
-
quoteSymbol: string;
|
|
344
|
-
size: string;
|
|
345
|
-
slPrice: string | null;
|
|
346
|
-
slSize: string | null;
|
|
347
|
-
slippagePct: number;
|
|
348
|
-
tif: TimeInForce;
|
|
349
|
-
tpPrice: string | null;
|
|
350
|
-
tpSize: string | null;
|
|
351
|
-
triggerType: TriggerType$1;
|
|
352
|
-
txHash: string;
|
|
353
|
-
txTime: number;
|
|
354
|
-
user: string;
|
|
355
|
-
useLeverage: number;
|
|
356
|
-
}
|
|
357
|
-
interface OrderResponse extends BaseResponse {
|
|
358
|
-
data: OrderItem[];
|
|
359
|
-
}
|
|
360
|
-
interface PoolOpenOrder {
|
|
361
|
-
amount: string;
|
|
362
|
-
chainId: number;
|
|
363
|
-
minQuoteOut: string;
|
|
364
|
-
orderId: number;
|
|
365
|
-
poolId: string;
|
|
366
|
-
poolType: PoolType;
|
|
367
|
-
triggerPrice: string;
|
|
368
|
-
triggerType: TriggerType$1;
|
|
369
|
-
txTime: number;
|
|
370
|
-
user: string;
|
|
371
|
-
}
|
|
372
|
-
interface PoolOpenOrdersResponse extends BaseResponse {
|
|
373
|
-
data: PoolOpenOrder[];
|
|
374
|
-
}
|
|
375
|
-
interface AccessTokenRequest {
|
|
376
|
-
accessToken: string;
|
|
377
|
-
address: string;
|
|
378
|
-
}
|
|
379
|
-
interface HttpEnvParams {
|
|
380
|
-
isProd?: boolean;
|
|
381
|
-
}
|
|
382
|
-
declare enum HttpKlineIntervalEnum {
|
|
383
|
-
Minute1 = 1,
|
|
384
|
-
Minute5 = 5,
|
|
385
|
-
Minute15 = 15,
|
|
386
|
-
Minute30 = 30,
|
|
387
|
-
Hour1 = 60,
|
|
388
|
-
Hour4 = 240,
|
|
389
|
-
Day1 = 1440,
|
|
390
|
-
Week1 = 10080,
|
|
391
|
-
Month1 = 40320
|
|
392
|
-
}
|
|
393
|
-
interface KlineDataItemType {
|
|
394
|
-
time: number;
|
|
395
|
-
open: string;
|
|
396
|
-
close: string;
|
|
397
|
-
high: string;
|
|
398
|
-
low: string;
|
|
399
|
-
}
|
|
400
|
-
interface TickerDataItem {
|
|
401
|
-
chainId: ChainId;
|
|
402
|
-
poolId: string;
|
|
403
|
-
oracleId: number;
|
|
404
|
-
price: string;
|
|
405
|
-
change: string;
|
|
406
|
-
high: string;
|
|
407
|
-
low: string;
|
|
408
|
-
volume: string;
|
|
409
|
-
turnover: string;
|
|
410
|
-
}
|
|
411
|
-
declare enum MarketType {
|
|
412
|
-
Contract = 1,
|
|
413
|
-
Cook = 2,
|
|
414
|
-
Earn = 3
|
|
415
|
-
}
|
|
416
|
-
declare enum SearchTypeEnum {
|
|
417
|
-
All = 0,
|
|
418
|
-
Contract = 1,
|
|
419
|
-
Cook = 2,
|
|
420
|
-
Earn = 3
|
|
421
|
-
}
|
|
422
|
-
declare enum MarketCapType {
|
|
423
|
-
BlueChips = 1,
|
|
424
|
-
Alpha = 2
|
|
425
|
-
}
|
|
426
|
-
declare enum SearchSecondTypeEnum {
|
|
427
|
-
BlueChips = 1,
|
|
428
|
-
Alpha = 2,
|
|
429
|
-
Favorite = 3
|
|
430
|
-
}
|
|
431
|
-
interface ChainIdRequest {
|
|
432
|
-
chainId: ChainId;
|
|
433
|
-
}
|
|
434
|
-
type FavoritesType = -1 | 1;
|
|
435
|
-
interface SearchResultContractItem {
|
|
436
|
-
chainId: ChainId;
|
|
437
|
-
poolId: string;
|
|
438
|
-
baseQuoteSymbol: string;
|
|
439
|
-
symbolName: string;
|
|
440
|
-
baseToken: Address;
|
|
441
|
-
tokenIcon: string;
|
|
442
|
-
type: MarketType;
|
|
443
|
-
capType: MarketCapType;
|
|
444
|
-
favorites: FavoritesType;
|
|
445
|
-
volume: string;
|
|
446
|
-
liquidity: string;
|
|
447
|
-
basePrice: string;
|
|
448
|
-
priceChange: string;
|
|
449
|
-
tvl: string;
|
|
450
|
-
marketCap: string;
|
|
451
|
-
globalId: number;
|
|
452
|
-
baseSymbol: string;
|
|
453
|
-
quoteSymbol: string;
|
|
454
|
-
}
|
|
455
|
-
interface SearchResultCookItem {
|
|
456
|
-
chainId: ChainId;
|
|
457
|
-
poolId: string;
|
|
458
|
-
mBaseQuoteSymbol: string;
|
|
459
|
-
symbolName: string;
|
|
460
|
-
baseToken: Address;
|
|
461
|
-
tokenIcon: string;
|
|
462
|
-
type: MarketType;
|
|
463
|
-
state: MarketPoolState;
|
|
464
|
-
tvl: string;
|
|
465
|
-
marketCap: string;
|
|
466
|
-
lpPrice: string;
|
|
467
|
-
lpPriceChange: string;
|
|
468
|
-
globalId: number;
|
|
469
|
-
}
|
|
470
|
-
interface SearchResultEarnItem {
|
|
471
|
-
chainId: ChainId;
|
|
472
|
-
poolId: string;
|
|
473
|
-
mQuoteBaseSymbol: string;
|
|
474
|
-
symbolName: string;
|
|
475
|
-
baseToken: Address;
|
|
476
|
-
tokenIcon: string;
|
|
477
|
-
type: MarketType;
|
|
478
|
-
state: MarketPoolState;
|
|
479
|
-
rating: string;
|
|
480
|
-
tvl: string;
|
|
481
|
-
marketCap: string;
|
|
482
|
-
apr: string;
|
|
483
|
-
globalId: number;
|
|
484
|
-
}
|
|
485
|
-
interface SearchResultResponse {
|
|
486
|
-
earnInfo: {
|
|
487
|
-
list: SearchResultEarnItem[];
|
|
488
|
-
total: number;
|
|
489
|
-
};
|
|
490
|
-
cookInfo: {
|
|
491
|
-
list: SearchResultCookItem[];
|
|
492
|
-
total: number;
|
|
493
|
-
};
|
|
494
|
-
contractInfo: {
|
|
495
|
-
list: SearchResultContractItem[];
|
|
496
|
-
total: number;
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
interface FavoritesListItem {
|
|
500
|
-
ChainId: ChainId;
|
|
501
|
-
poolId: string;
|
|
502
|
-
symbolName: string;
|
|
503
|
-
tokenIcon: string;
|
|
504
|
-
capType: MarketCapType;
|
|
505
|
-
baseToken: Address;
|
|
506
|
-
basePrice: string;
|
|
507
|
-
priceChange: string;
|
|
508
|
-
volume: string;
|
|
509
|
-
marketCap: string;
|
|
510
|
-
baseQuoteSymbol: string;
|
|
511
|
-
favorites: FavoritesType;
|
|
512
|
-
}
|
|
513
|
-
interface BaseDetailResponse {
|
|
514
|
-
totalSupply: string;
|
|
515
|
-
circulation: string;
|
|
516
|
-
marketCap: string;
|
|
517
|
-
fdv: string;
|
|
518
|
-
holders: number;
|
|
519
|
-
traders: number;
|
|
520
|
-
liquidity: string;
|
|
521
|
-
volume: string;
|
|
522
|
-
longPosition: number;
|
|
523
|
-
shortPosition: number;
|
|
524
|
-
fundingRate: string;
|
|
525
|
-
tokenIcon: string;
|
|
526
|
-
poolId: string;
|
|
527
|
-
mSymbol: string;
|
|
528
|
-
symbolName: string;
|
|
529
|
-
lpPriceChange: string;
|
|
530
|
-
chainId: number;
|
|
531
|
-
tokenCreateTime: number;
|
|
532
|
-
baseToken: Address;
|
|
533
|
-
marketId: string;
|
|
534
|
-
basePrice: string;
|
|
535
|
-
tvl: string;
|
|
536
|
-
apr: string;
|
|
537
|
-
}
|
|
538
|
-
interface MarketDetailResponse {
|
|
539
|
-
chainId: number;
|
|
540
|
-
marketId: string;
|
|
541
|
-
poolId: string;
|
|
542
|
-
oracleId: number;
|
|
543
|
-
globalId: number;
|
|
544
|
-
state: MarketPoolState;
|
|
545
|
-
baseSymbol: string;
|
|
546
|
-
quoteSymbol: string;
|
|
547
|
-
baseDecimals: number;
|
|
548
|
-
quoteDecimals: number;
|
|
549
|
-
baseToken: Address;
|
|
550
|
-
quoteToken: Address;
|
|
551
|
-
basePoolToken: Address;
|
|
552
|
-
quotePoolToken: Address;
|
|
553
|
-
oracleType: OracleType;
|
|
554
|
-
feedId: string;
|
|
555
|
-
activeTime: number;
|
|
556
|
-
capType: MarketCapType;
|
|
557
|
-
baseReserveRatio: string;
|
|
558
|
-
quoteReserveRatio: string;
|
|
559
|
-
}
|
|
560
|
-
interface MarketInfo {
|
|
561
|
-
chainId: number;
|
|
562
|
-
marketId: string;
|
|
563
|
-
poolId: string;
|
|
564
|
-
quoteSymbol: string;
|
|
565
|
-
quoteDecimals: number;
|
|
566
|
-
quoteToken: string;
|
|
567
|
-
baseReserveRatio: number;
|
|
568
|
-
quoteReserveRatio: number;
|
|
569
|
-
oracleFeeUsd: number;
|
|
570
|
-
oracleRefundFeeUsd: number;
|
|
571
|
-
poolPrimeThreshold: number;
|
|
572
|
-
decimals: number;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
9
|
interface GetHistoryOrdersParams {
|
|
576
10
|
limit?: number;
|
|
577
11
|
chainId?: number;
|
|
@@ -648,7 +82,7 @@ interface HistoryOrderItem {
|
|
|
648
82
|
orderStatus: OrderStatusEnum;
|
|
649
83
|
execType: ExecTypeEnum;
|
|
650
84
|
slippagePct: number;
|
|
651
|
-
executionFeeToken: Address
|
|
85
|
+
executionFeeToken: Address;
|
|
652
86
|
executionFeeAmount: string;
|
|
653
87
|
tradingFee: string;
|
|
654
88
|
fundingFee: string;
|
|
@@ -704,7 +138,7 @@ declare enum TradeFlowAccountTypeEnum {
|
|
|
704
138
|
interface TradeFlowItem {
|
|
705
139
|
chainId: number;
|
|
706
140
|
orderId: number;
|
|
707
|
-
user: Address
|
|
141
|
+
user: Address;
|
|
708
142
|
poolId: string;
|
|
709
143
|
fundingFee: string;
|
|
710
144
|
tradingFee: string;
|
|
@@ -723,7 +157,7 @@ interface TradeFlowItem {
|
|
|
723
157
|
referrerRebate: string;
|
|
724
158
|
referralRebate: string;
|
|
725
159
|
rebateClaimedAmount: string;
|
|
726
|
-
token?: Address
|
|
160
|
+
token?: Address;
|
|
727
161
|
}
|
|
728
162
|
|
|
729
163
|
type ForwarderTxParams = {
|
|
@@ -860,183 +294,6 @@ interface GetMarketDetailParams {
|
|
|
860
294
|
declare const getMarketDetail: ({ ...params }: GetMarketDetailParams) => Promise<ApiResponse<MarketDetailResponse>>;
|
|
861
295
|
declare const getMarketList: () => Promise<ApiResponse<MarketInfo[]>>;
|
|
862
296
|
|
|
863
|
-
type DepositTpSl = Pick<TpSl, 'triggerType' | 'triggerPrice'>;
|
|
864
|
-
interface Deposit {
|
|
865
|
-
chainId: ChainId;
|
|
866
|
-
poolId: string;
|
|
867
|
-
decimals?: number;
|
|
868
|
-
amount: number;
|
|
869
|
-
slippage: number;
|
|
870
|
-
tpsl?: DepositTpSl[];
|
|
871
|
-
}
|
|
872
|
-
interface WithdrawParams {
|
|
873
|
-
chainId: ChainId;
|
|
874
|
-
poolId: string;
|
|
875
|
-
amount: number;
|
|
876
|
-
slippage: number;
|
|
877
|
-
}
|
|
878
|
-
interface RewardsParams {
|
|
879
|
-
chainId: ChainId;
|
|
880
|
-
poolId: string;
|
|
881
|
-
account: string;
|
|
882
|
-
}
|
|
883
|
-
interface ClaimParams {
|
|
884
|
-
chainId: ChainId;
|
|
885
|
-
poolId: string;
|
|
886
|
-
}
|
|
887
|
-
interface ClaimRebatesParams {
|
|
888
|
-
chainId: ChainId;
|
|
889
|
-
poolIds: string[];
|
|
890
|
-
}
|
|
891
|
-
interface PreviewWithdrawDataParams {
|
|
892
|
-
chainId: ChainId;
|
|
893
|
-
poolId: string;
|
|
894
|
-
account: string;
|
|
895
|
-
amount: string | number;
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<any>;
|
|
899
|
-
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<viem.TransactionReceipt | undefined>;
|
|
900
|
-
|
|
901
|
-
declare const deposit$1: (params: Deposit) => Promise<viem.TransactionReceipt | undefined>;
|
|
902
|
-
|
|
903
|
-
declare const withdrawableLpAmount$1: (params: {
|
|
904
|
-
chainId: ChainId;
|
|
905
|
-
poolId: string;
|
|
906
|
-
price?: bigint;
|
|
907
|
-
}) => Promise<any>;
|
|
908
|
-
declare const withdraw$1: (params: WithdrawParams) => Promise<viem.TransactionReceipt>;
|
|
909
|
-
|
|
910
|
-
declare const getRewards$1: (params: RewardsParams) => Promise<{
|
|
911
|
-
rebates: any;
|
|
912
|
-
genesisRebates: any;
|
|
913
|
-
} | undefined>;
|
|
914
|
-
|
|
915
|
-
declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
|
|
916
|
-
baseAmountOut: any;
|
|
917
|
-
rebateAmount: any;
|
|
918
|
-
} | undefined>;
|
|
919
|
-
|
|
920
|
-
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<any>;
|
|
921
|
-
|
|
922
|
-
declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
|
|
923
|
-
declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
|
|
924
|
-
declare const index$2_previewUserWithdrawData: typeof previewUserWithdrawData;
|
|
925
|
-
declare namespace index$2 {
|
|
926
|
-
export { index$2_claimBasePoolRebate as claimBasePoolRebate, index$2_claimBasePoolRebates as claimBasePoolRebates, deposit$1 as deposit, getLpPrice$1 as getLpPrice, getRewards$1 as getRewards, index$2_previewUserWithdrawData as previewUserWithdrawData, withdraw$1 as withdraw, withdrawableLpAmount$1 as withdrawableLpAmount };
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
declare const deposit: (params: Deposit) => Promise<viem.TransactionReceipt | undefined>;
|
|
930
|
-
|
|
931
|
-
declare const withdrawableLpAmount: (params: {
|
|
932
|
-
chainId: ChainId;
|
|
933
|
-
poolId: string;
|
|
934
|
-
price?: bigint;
|
|
935
|
-
}) => Promise<any>;
|
|
936
|
-
declare const withdraw: (params: WithdrawParams) => Promise<viem.TransactionReceipt>;
|
|
937
|
-
|
|
938
|
-
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<viem.TransactionReceipt | null>;
|
|
939
|
-
|
|
940
|
-
declare const getRewards: (params: RewardsParams) => Promise<any>;
|
|
941
|
-
|
|
942
|
-
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<any>;
|
|
943
|
-
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<viem.TransactionReceipt | undefined>;
|
|
944
|
-
|
|
945
|
-
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<any>;
|
|
946
|
-
|
|
947
|
-
declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
|
|
948
|
-
declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
|
|
949
|
-
declare const index$1_deposit: typeof deposit;
|
|
950
|
-
declare const index$1_getLpPrice: typeof getLpPrice;
|
|
951
|
-
declare const index$1_getRewards: typeof getRewards;
|
|
952
|
-
declare const index$1_transfer: typeof transfer;
|
|
953
|
-
declare const index$1_withdraw: typeof withdraw;
|
|
954
|
-
declare const index$1_withdrawableLpAmount: typeof withdrawableLpAmount;
|
|
955
|
-
declare namespace index$1 {
|
|
956
|
-
export { index$1_claimQuotePoolRebate as claimQuotePoolRebate, index$1_claimQuotePoolRebates as claimQuotePoolRebates, index$1_deposit as deposit, index$1_getLpPrice as getLpPrice, index$1_getRewards as getRewards, index$1_transfer as transfer, index$1_withdraw as withdraw, index$1_withdrawableLpAmount as withdrawableLpAmount };
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<any>;
|
|
960
|
-
|
|
961
|
-
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<any>;
|
|
962
|
-
|
|
963
|
-
declare const index_getMarket: typeof getMarket;
|
|
964
|
-
declare const index_getOracleFee: typeof getOracleFee;
|
|
965
|
-
declare namespace index {
|
|
966
|
-
export { index_getMarket as getMarket, index_getOracleFee as getOracleFee };
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
declare const getPricesData: (chainId: ChainId, poolIds: string[]) => Promise<{
|
|
970
|
-
poolId: string;
|
|
971
|
-
price: string;
|
|
972
|
-
value: bigint;
|
|
973
|
-
publishTime: number;
|
|
974
|
-
oracleType: OracleType;
|
|
975
|
-
vaa: string;
|
|
976
|
-
}[] | undefined>;
|
|
977
|
-
declare const getPriceData: (chainId: ChainId, poolId: string) => Promise<{
|
|
978
|
-
poolId: string;
|
|
979
|
-
price: string;
|
|
980
|
-
value: bigint;
|
|
981
|
-
publishTime: number;
|
|
982
|
-
oracleType: OracleType;
|
|
983
|
-
vaa: string;
|
|
984
|
-
} | undefined>;
|
|
985
|
-
|
|
986
|
-
declare const COMMON_PRICE_DECIMALS = 30;
|
|
987
|
-
declare const COMMON_LP_AMOUNT_DECIMALS = 18;
|
|
988
|
-
|
|
989
|
-
declare const pool: {
|
|
990
|
-
createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<any>;
|
|
991
|
-
getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<any>;
|
|
992
|
-
getMarketPools: (chainId: ChainId) => Promise<any>;
|
|
993
|
-
getPoolInfo: (chainId: ChainId, poolId: string, marketPrice?: bigint) => Promise<{
|
|
994
|
-
quotePool: {
|
|
995
|
-
poolToken: any;
|
|
996
|
-
exchangeRate: any;
|
|
997
|
-
poolTokenPrice: any;
|
|
998
|
-
poolTokenSupply: any;
|
|
999
|
-
totalDebt: any;
|
|
1000
|
-
baseCollateral: any;
|
|
1001
|
-
};
|
|
1002
|
-
basePool: {
|
|
1003
|
-
poolToken: any;
|
|
1004
|
-
exchangeRate: any;
|
|
1005
|
-
poolTokenPrice: any;
|
|
1006
|
-
poolTokenSupply: any;
|
|
1007
|
-
totalDebt: any;
|
|
1008
|
-
baseCollateral: any;
|
|
1009
|
-
};
|
|
1010
|
-
reserveInfo: {
|
|
1011
|
-
baseTotalAmount: any;
|
|
1012
|
-
baseReservedAmount: any;
|
|
1013
|
-
quoteTotalAmount: any;
|
|
1014
|
-
quoteReservedAmount: any;
|
|
1015
|
-
};
|
|
1016
|
-
fundingInfo: {
|
|
1017
|
-
nextFundingRate: any;
|
|
1018
|
-
lastFundingFeeTracker: any;
|
|
1019
|
-
nextEpochTime: any;
|
|
1020
|
-
};
|
|
1021
|
-
ioTracker: {
|
|
1022
|
-
tracker: any;
|
|
1023
|
-
longSize: any;
|
|
1024
|
-
shortSize: any;
|
|
1025
|
-
poolEntryPrice: any;
|
|
1026
|
-
};
|
|
1027
|
-
liquidityInfo: {
|
|
1028
|
-
windowCaps: any;
|
|
1029
|
-
openInterest: any;
|
|
1030
|
-
};
|
|
1031
|
-
}>;
|
|
1032
|
-
getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<any>;
|
|
1033
|
-
addTpSl: (params: AddTpSLParams) => Promise<viem.TransactionReceipt>;
|
|
1034
|
-
cancelTpSl: (params: CancelTpSLParams) => Promise<viem.TransactionReceipt>;
|
|
1035
|
-
reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<viem.TransactionReceipt>;
|
|
1036
|
-
getPoolDetail: (chainId: ChainId, poolId: string) => Promise<MarketPool | undefined>;
|
|
1037
|
-
getOpenOrders: (chainId: ChainId, address: string) => Promise<PoolOpenOrder[]>;
|
|
1038
|
-
};
|
|
1039
|
-
|
|
1040
297
|
declare const approve: (chainId: ChainId, _account: string, tokenAddress: string, approveAddress: string, amount: bigint) => Promise<void>;
|
|
1041
298
|
|
|
1042
299
|
declare const getAllowanceApproved: (chainId: ChainId, account: string, tokenAddress: string, approveAddress: string, approveAmount: bigint) => Promise<boolean>;
|
|
@@ -1820,10 +1077,10 @@ interface GetAppealVoteNodeDetailParams {
|
|
|
1820
1077
|
}
|
|
1821
1078
|
interface PostVoteSignatureParams {
|
|
1822
1079
|
chainId: number;
|
|
1823
|
-
address: Address
|
|
1080
|
+
address: Address;
|
|
1824
1081
|
caseId: number;
|
|
1825
1082
|
type: AppealCaseTypeEnum;
|
|
1826
|
-
validator: Address
|
|
1083
|
+
validator: Address;
|
|
1827
1084
|
voteOption: VoteTypeEnum;
|
|
1828
1085
|
nonce: number;
|
|
1829
1086
|
deadline: number;
|
|
@@ -2106,119 +1363,13 @@ declare class Account {
|
|
|
2106
1363
|
}>;
|
|
2107
1364
|
}
|
|
2108
1365
|
|
|
2109
|
-
declare class Seamless {
|
|
2110
|
-
private configManager;
|
|
2111
|
-
private logger;
|
|
2112
|
-
private utils;
|
|
2113
|
-
private account;
|
|
2114
|
-
private api;
|
|
2115
|
-
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account, api: Api);
|
|
2116
|
-
onCheckRelayer(account: string, relayer: string, chainId: number, tokenAddress: string): Promise<any>;
|
|
2117
|
-
getUSDPermitParams(deadline: number, chainId: number, tokenAddress: string): Promise<{
|
|
2118
|
-
token: string;
|
|
2119
|
-
owner: `0x${string}`;
|
|
2120
|
-
spender: `0x${string}`;
|
|
2121
|
-
value: string;
|
|
2122
|
-
deadline: string;
|
|
2123
|
-
v: number;
|
|
2124
|
-
r: `0x${string}`;
|
|
2125
|
-
s: `0x${string}`;
|
|
2126
|
-
}[]>;
|
|
2127
|
-
getForwardEip712Domain(chainId: number): Promise<{
|
|
2128
|
-
name: any;
|
|
2129
|
-
version: any;
|
|
2130
|
-
chainId: any;
|
|
2131
|
-
verifyingContract: any;
|
|
2132
|
-
}>;
|
|
2133
|
-
forwardTxInFront({ chainId, seamlessAddress, signFunction, forwardFeeToken, functionName, orderParams }: {
|
|
2134
|
-
chainId: number;
|
|
2135
|
-
masterAddress: string;
|
|
2136
|
-
seamlessAddress: string;
|
|
2137
|
-
signFunction: (signParams: {
|
|
2138
|
-
domain: any;
|
|
2139
|
-
functionHash: string;
|
|
2140
|
-
to: string;
|
|
2141
|
-
nonce: string;
|
|
2142
|
-
deadline: number;
|
|
2143
|
-
}) => Promise<string>;
|
|
2144
|
-
functionName: string;
|
|
2145
|
-
forwardFeeToken: string;
|
|
2146
|
-
orderParams: any;
|
|
2147
|
-
}): Promise<{
|
|
2148
|
-
code: number;
|
|
2149
|
-
data?: undefined;
|
|
2150
|
-
message?: undefined;
|
|
2151
|
-
} | {
|
|
2152
|
-
code: number;
|
|
2153
|
-
data: null;
|
|
2154
|
-
message: string;
|
|
2155
|
-
}>;
|
|
2156
|
-
forwarderTx({ from, to, value, gas, deadline, data, nonce, forwardFeeToken, }: {
|
|
2157
|
-
from: string;
|
|
2158
|
-
to: string;
|
|
2159
|
-
value: string;
|
|
2160
|
-
gas: string;
|
|
2161
|
-
deadline: number;
|
|
2162
|
-
data: string;
|
|
2163
|
-
nonce: string;
|
|
2164
|
-
forwardFeeToken: string;
|
|
2165
|
-
}, chainId: number): Promise<ApiResponse<any>>;
|
|
2166
|
-
authorizeSeamlessAccount({ approve, seamlessAddress, chainId, forwardFeeToken, }: {
|
|
2167
|
-
approve: boolean;
|
|
2168
|
-
seamlessAddress: string;
|
|
2169
|
-
chainId: number;
|
|
2170
|
-
forwardFeeToken: string;
|
|
2171
|
-
walletClientOrSigner?: Awaited<ReturnType<typeof getWalletClient>> | SignerLike;
|
|
2172
|
-
}): Promise<{
|
|
2173
|
-
code: number;
|
|
2174
|
-
data: {
|
|
2175
|
-
seamlessAccount: string;
|
|
2176
|
-
authorized: boolean;
|
|
2177
|
-
};
|
|
2178
|
-
message?: undefined;
|
|
2179
|
-
} | {
|
|
2180
|
-
code: number;
|
|
2181
|
-
data: null;
|
|
2182
|
-
message: string;
|
|
2183
|
-
}>;
|
|
2184
|
-
getOriginSeamlessAccount(address: string, chainId: number): Promise<{
|
|
2185
|
-
code: number;
|
|
2186
|
-
data: {
|
|
2187
|
-
masterAddress: any;
|
|
2188
|
-
};
|
|
2189
|
-
}>;
|
|
2190
|
-
/**
|
|
2191
|
-
* Build ForwardRequest fields for a Broker contract call executed via the Forwarder.
|
|
2192
|
-
* `data` must be the ABI args array for `functionName` (same order as the contract), with no undefined addresses.
|
|
2193
|
-
*/
|
|
2194
|
-
formatForwarderTxParams({ address, chainId, forwardFeeToken, functionName, data, seamlessAddress, }: {
|
|
2195
|
-
address: string;
|
|
2196
|
-
chainId: number;
|
|
2197
|
-
forwardFeeToken: string;
|
|
2198
|
-
functionName: string;
|
|
2199
|
-
/** ABI args tuple for `functionName`, e.g. `[user, poolId, ...]` */
|
|
2200
|
-
data: readonly unknown[] | unknown[];
|
|
2201
|
-
seamlessAddress: string;
|
|
2202
|
-
}): Promise<{
|
|
2203
|
-
from: `0x${string}`;
|
|
2204
|
-
to: `0x${string}`;
|
|
2205
|
-
value: string;
|
|
2206
|
-
gas: string;
|
|
2207
|
-
deadline: number;
|
|
2208
|
-
data: `0x${string}`;
|
|
2209
|
-
nonce: any;
|
|
2210
|
-
forwardFeeToken: `0x${string}`;
|
|
2211
|
-
}>;
|
|
2212
|
-
}
|
|
2213
|
-
|
|
2214
1366
|
declare class Position {
|
|
2215
1367
|
private configManager;
|
|
2216
1368
|
private logger;
|
|
2217
1369
|
private utils;
|
|
2218
|
-
private seamless;
|
|
2219
1370
|
private account;
|
|
2220
1371
|
private api;
|
|
2221
|
-
constructor(configManager: ConfigManager, logger: Logger, utils: Utils,
|
|
1372
|
+
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account, api: Api);
|
|
2222
1373
|
listPositions(address: string, positionId?: string): Promise<{
|
|
2223
1374
|
code: number;
|
|
2224
1375
|
data: PositionType[];
|
|
@@ -2272,10 +1423,9 @@ declare class Order {
|
|
|
2272
1423
|
private configManager;
|
|
2273
1424
|
private logger;
|
|
2274
1425
|
private utils;
|
|
2275
|
-
private seamless;
|
|
2276
1426
|
private account;
|
|
2277
1427
|
private api;
|
|
2278
|
-
constructor(configManager: ConfigManager, logger: Logger, utils: Utils,
|
|
1428
|
+
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account, api: Api);
|
|
2279
1429
|
createIncreaseOrder(params: PlaceOrderParams, tradingFee: string, marketId: string): Promise<{
|
|
2280
1430
|
code: number;
|
|
2281
1431
|
message: string;
|
|
@@ -2387,9 +1537,119 @@ declare class Order {
|
|
|
2387
1537
|
}>;
|
|
2388
1538
|
}
|
|
2389
1539
|
|
|
1540
|
+
declare class Seamless {
|
|
1541
|
+
private configManager;
|
|
1542
|
+
private logger;
|
|
1543
|
+
private utils;
|
|
1544
|
+
private account;
|
|
1545
|
+
private api;
|
|
1546
|
+
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account, api: Api);
|
|
1547
|
+
onCheckRelayer(account: string, relayer: string, chainId: number, tokenAddress: string): Promise<any>;
|
|
1548
|
+
getContractAbiAndAddressByFunctionName(functionName: string, chainId: ChainId): Promise<{
|
|
1549
|
+
abi: any;
|
|
1550
|
+
address: string;
|
|
1551
|
+
}>;
|
|
1552
|
+
getUSDPermitParams(deadline: number, chainId: number, tokenAddress: string): Promise<{
|
|
1553
|
+
token: string;
|
|
1554
|
+
owner: `0x${string}`;
|
|
1555
|
+
spender: `0x${string}`;
|
|
1556
|
+
value: string;
|
|
1557
|
+
deadline: string;
|
|
1558
|
+
v: number;
|
|
1559
|
+
r: `0x${string}`;
|
|
1560
|
+
s: `0x${string}`;
|
|
1561
|
+
}[]>;
|
|
1562
|
+
getForwardEip712Domain(chainId: number): Promise<{
|
|
1563
|
+
name: any;
|
|
1564
|
+
version: any;
|
|
1565
|
+
chainId: any;
|
|
1566
|
+
verifyingContract: any;
|
|
1567
|
+
}>;
|
|
1568
|
+
forwardTxInFront({ chainId, seamlessAddress, signFunction, forwardFeeToken, functionName, orderParams, value }: {
|
|
1569
|
+
chainId: number;
|
|
1570
|
+
masterAddress: string;
|
|
1571
|
+
seamlessAddress: string;
|
|
1572
|
+
signFunction: (signParams: {
|
|
1573
|
+
domain: any;
|
|
1574
|
+
functionHash: string;
|
|
1575
|
+
to: string;
|
|
1576
|
+
nonce: string;
|
|
1577
|
+
deadline: number;
|
|
1578
|
+
}) => Promise<string>;
|
|
1579
|
+
functionName: string;
|
|
1580
|
+
forwardFeeToken: string;
|
|
1581
|
+
orderParams: any;
|
|
1582
|
+
value?: string;
|
|
1583
|
+
}): Promise<{
|
|
1584
|
+
code: number;
|
|
1585
|
+
data?: undefined;
|
|
1586
|
+
message?: undefined;
|
|
1587
|
+
} | {
|
|
1588
|
+
code: number;
|
|
1589
|
+
data: null;
|
|
1590
|
+
message: string;
|
|
1591
|
+
}>;
|
|
1592
|
+
forwarderTx({ from, to, value, gas, deadline, data, nonce, forwardFeeToken, }: {
|
|
1593
|
+
from: string;
|
|
1594
|
+
to: string;
|
|
1595
|
+
value: string;
|
|
1596
|
+
gas: string;
|
|
1597
|
+
deadline: number;
|
|
1598
|
+
data: string;
|
|
1599
|
+
nonce: string;
|
|
1600
|
+
forwardFeeToken: string;
|
|
1601
|
+
}, chainId: number): Promise<ApiResponse<any>>;
|
|
1602
|
+
authorizeSeamlessAccount({ approve, seamlessAddress, chainId, forwardFeeToken, }: {
|
|
1603
|
+
approve: boolean;
|
|
1604
|
+
seamlessAddress: string;
|
|
1605
|
+
chainId: number;
|
|
1606
|
+
forwardFeeToken: string;
|
|
1607
|
+
walletClientOrSigner?: Awaited<ReturnType<typeof getWalletClient>> | SignerLike;
|
|
1608
|
+
}): Promise<{
|
|
1609
|
+
code: number;
|
|
1610
|
+
data: {
|
|
1611
|
+
seamlessAccount: string;
|
|
1612
|
+
authorized: boolean;
|
|
1613
|
+
};
|
|
1614
|
+
message?: undefined;
|
|
1615
|
+
} | {
|
|
1616
|
+
code: number;
|
|
1617
|
+
data: null;
|
|
1618
|
+
message: string;
|
|
1619
|
+
}>;
|
|
1620
|
+
getOriginSeamlessAccount(address: string, chainId: number): Promise<{
|
|
1621
|
+
code: number;
|
|
1622
|
+
data: {
|
|
1623
|
+
masterAddress: any;
|
|
1624
|
+
};
|
|
1625
|
+
}>;
|
|
1626
|
+
/**
|
|
1627
|
+
* Build ForwardRequest fields for a Broker contract call executed via the Forwarder.
|
|
1628
|
+
* `data` must be the ABI args array for `functionName` (same order as the contract), with no undefined addresses.
|
|
1629
|
+
*/
|
|
1630
|
+
formatForwarderTxParams({ address, chainId, forwardFeeToken, functionName, data, seamlessAddress, }: {
|
|
1631
|
+
address: string;
|
|
1632
|
+
chainId: number;
|
|
1633
|
+
forwardFeeToken: string;
|
|
1634
|
+
functionName: string;
|
|
1635
|
+
/** ABI args tuple for `functionName`, e.g. `[user, poolId, ...]` */
|
|
1636
|
+
data: readonly unknown[] | unknown[];
|
|
1637
|
+
seamlessAddress: string;
|
|
1638
|
+
}): Promise<{
|
|
1639
|
+
from: `0x${string}`;
|
|
1640
|
+
to: `0x${string}`;
|
|
1641
|
+
value: string;
|
|
1642
|
+
gas: string;
|
|
1643
|
+
deadline: number;
|
|
1644
|
+
data: `0x${string}`;
|
|
1645
|
+
nonce: any;
|
|
1646
|
+
forwardFeeToken: `0x${string}`;
|
|
1647
|
+
}>;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
2390
1650
|
/** Cast viem getContract result so .read/.write and legacy contract.methodName() accept any ABI function name. */
|
|
2391
1651
|
type ContractLike = {
|
|
2392
|
-
address: Address;
|
|
1652
|
+
address: Address$1;
|
|
2393
1653
|
abi: Abi;
|
|
2394
1654
|
read: Record<string, (...args: any[]) => Promise<any>>;
|
|
2395
1655
|
write?: Record<string, (...args: any[]) => Promise<any>>;
|
|
@@ -2410,7 +1670,7 @@ declare class BaseMyxClient {
|
|
|
2410
1670
|
|
|
2411
1671
|
interface AppealVoteParams {
|
|
2412
1672
|
caseId: number;
|
|
2413
|
-
validator: Address
|
|
1673
|
+
validator: Address;
|
|
2414
1674
|
isFor: boolean;
|
|
2415
1675
|
deadline: number;
|
|
2416
1676
|
v: number;
|
|
@@ -2430,7 +1690,7 @@ declare class Appeal extends BaseMyxClient {
|
|
|
2430
1690
|
* @param poolToken - the pool token
|
|
2431
1691
|
* @returns the transaction receipt
|
|
2432
1692
|
*/
|
|
2433
|
-
submitAppeal(poolId: string, lpToken: Address
|
|
1693
|
+
submitAppeal(poolId: string, lpToken: Address, lpAmount: string): Promise<{
|
|
2434
1694
|
transaction: viem.TransactionReceipt;
|
|
2435
1695
|
caseId: bigint;
|
|
2436
1696
|
}>;
|
|
@@ -2468,7 +1728,7 @@ declare class Appeal extends BaseMyxClient {
|
|
|
2468
1728
|
tx: viem.TransactionReceipt;
|
|
2469
1729
|
caseId: bigint;
|
|
2470
1730
|
}>;
|
|
2471
|
-
appealReconsideration(caseId: number, appealToken: Address
|
|
1731
|
+
appealReconsideration(caseId: number, appealToken: Address, appealAmount: string): Promise<{
|
|
2472
1732
|
tx: viem.TransactionReceipt;
|
|
2473
1733
|
appealCaseId: bigint;
|
|
2474
1734
|
caseId: number;
|
|
@@ -2497,7 +1757,7 @@ declare class Appeal extends BaseMyxClient {
|
|
|
2497
1757
|
|
|
2498
1758
|
declare class Referrals extends BaseMyxClient {
|
|
2499
1759
|
constructor(client: MyxClient);
|
|
2500
|
-
claimRebate(tokenAddress: Address
|
|
1760
|
+
claimRebate(tokenAddress: Address): Promise<viem.TransactionReceipt>;
|
|
2501
1761
|
}
|
|
2502
1762
|
|
|
2503
1763
|
declare class MyxClient {
|
|
@@ -2560,4 +1820,4 @@ declare function normalizeSigner(signerLike: SignerLike): ISigner;
|
|
|
2560
1820
|
|
|
2561
1821
|
declare const SDK_VERSION: string;
|
|
2562
1822
|
|
|
2563
|
-
export {
|
|
1823
|
+
export { AccessTokenRequest, type AddFavoriteParams, Address$1 as Address, ApiResponse, AppealCaseTypeEnum, AppealClaimStatusEnum, type AppealDetail, type AppealListItem, AppealNodeStateEnum, type AppealNodeVoteItem, type AppealNodeVoteListItem, AppealNodeVotedStateEnum, type AppealReconsiderationDetail, type AppealReconsiderationItem, type AppealReconsiderationListItem, AppealReconsiderationType, type AppealReimbursementItem, type AppealReimbursementParams, AppealStage, AppealStatus, AppealType, type AppealUploadEvidenceParams, type AppealVoteItem, BaseDetailResponse, BaseResponse, ChainId, CloseTypeEnum, DirectionEnum, ExecTypeEnum, FavoritesListItem, type FavoritesListParams, type FavoritesTimeInterval, type FetchForwarderGetParams, type FetchForwarderGetResponse, type FetchForwarderGetResponseData, ForwarderGetStatus, type ForwarderTxParams, type GetAppealDetailParams, type GetAppealListParams, type GetAppealNodeVoteListParams, type GetAppealReconsiderationDetailParams, type GetAppealReconsiderationListParams, type GetAppealVoteNodeDetailParams, type GetBaseDetailParams, type GetHistoryOrdersParams, type GetIsVoteNodeParams, type GetKlineDataParams, type GetMarketDetailParams, type GetPoolLevelConfigParams, type GetTickerDataParams, type GetWarmholeSignParams, type GetWarmholeSignResponse, type GuardianSignatureItem, type HistoryOrderItem, HttpEnvParams, HttpKlineIntervalEnum, type ISigner, IsVoteNodeEnum, KlineDataItemType, type KlineDataResponse, type KlineResolution, type LevelConfig, type LogLevel, type LogSink, Logger, type LoggerOptions, MarketDetailResponse, MarketInfo, MxSDK, MyxClient, type MyxClientConfig, type MyxSubscriptionOptions, NodeTypeEnum, type OnKlineCallback, type OnOrderCallback, type OnPositionCallback, type OnTickersAllCallback, type OnTickersCallback, OperationEnum, OracleType, OrderItem, OrderResponse, OrderStatusEnum, OrderTypeEnum, PlaceOrderParams, type PoolLevelConfig, PoolOpenOrdersResponse, PoolResponse, type PoolSymbolAllResponse, type PositionHistoryItem, PositionResponse, PositionTpSlOrderParams, PositionType, type PostVoteResponse, type PostVoteSignatureParams, PriceResponse, type RemoveFavoriteParams, SDK_VERSION, type SearchMarketParams, SearchResultResponse, SearchSecondTypeEnum, SearchTypeEnum, type SignerLike, TickerDataItem, type TickersDataResponse, TradeFlowAccountTypeEnum, type TradeFlowItem, TradeFlowTypeEnum, TriggerTypeEnum, VoteTypeEnum, approve, bigintAmountSlipperCalculator, bigintTradingGasPriceWithRatio, bigintTradingGasToRatioCalculator, fromViemWalletClient, getAllowanceApproved, getBalanceOf, getBaseDetail, getBaseUrlByEnv, getMarketDetail, getMarketList, getOraclePrice, getPoolDetail, getPoolList, getPoolOpenOrders, getPublicClient, getSdkLogSink, getTickerData, getTokenInfo, getWalletClient, getWalletProvider, normalizeSigner, sdkError, sdkLog, sdkWarn, setConfigManagerForViem, setSdkLogSink };
|