@myx-trade/sdk 1.0.4-beta.1 → 1.0.4-beta.10
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/index.d.mts +15 -152
- package/dist/index.d.ts +15 -152
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
|
-
import { zeroAddress, Address as Address$2,
|
|
2
|
+
import { zeroAddress, Address as Address$2, WalletClient, PublicClient, Abi } from 'viem';
|
|
3
3
|
export { formatUnits, parseUnits } from 'viem';
|
|
4
4
|
import { Options, Event } from 'reconnecting-websocket';
|
|
5
5
|
import { WretchOptions } from 'wretch/types';
|
|
@@ -1314,17 +1314,11 @@ interface MyxClientConfig {
|
|
|
1314
1314
|
chainId: number;
|
|
1315
1315
|
/** ethers v5/v6 Signer, viem WalletClient, or ISigner. Use walletClient when app uses viem to avoid ethers in bundle. */
|
|
1316
1316
|
signer?: SignerLike;
|
|
1317
|
-
seamlessAccount?: {
|
|
1318
|
-
masterAddress: string;
|
|
1319
|
-
wallet: Account$1 | null;
|
|
1320
|
-
authorized: boolean;
|
|
1321
|
-
};
|
|
1322
1317
|
walletClient?: WalletClient;
|
|
1323
1318
|
brokerAddress: string;
|
|
1324
1319
|
isTestnet?: boolean;
|
|
1325
1320
|
isBetaMode?: boolean;
|
|
1326
1321
|
poolingInterval?: number;
|
|
1327
|
-
seamlessMode?: boolean;
|
|
1328
1322
|
socketConfig?: Partial<Omit<WebSocketConfig, "url">>;
|
|
1329
1323
|
logLevel?: LogLevel;
|
|
1330
1324
|
getAccessToken?: (() => Promise<AccessTokenResponse | undefined>) | (() => AccessTokenResponse | undefined);
|
|
@@ -1343,12 +1337,6 @@ declare class ConfigManager {
|
|
|
1343
1337
|
getSignerAddress(chainId: number): Promise<string>;
|
|
1344
1338
|
/** Returns viem WalletClient for the chain (for readContract/writeContract). Use when SDK uses viem. */
|
|
1345
1339
|
getViemWalletClient(chainId: number): Promise<WalletClient>;
|
|
1346
|
-
startSeamlessMode(open: boolean): Promise<MyxClientConfig>;
|
|
1347
|
-
updateSeamlessWallet({ wallet, authorized, masterAddress, }: {
|
|
1348
|
-
wallet?: Account$1 | null;
|
|
1349
|
-
authorized?: boolean;
|
|
1350
|
-
masterAddress?: string;
|
|
1351
|
-
}): void;
|
|
1352
1340
|
updateClientChainId(chainId: number, brokerAddress: string): void;
|
|
1353
1341
|
auth(params: Pick<MyxClientConfig, "signer" | "walletClient" | "getAccessToken">): void;
|
|
1354
1342
|
private validateConfig;
|
|
@@ -1500,7 +1488,7 @@ declare class Utils {
|
|
|
1500
1488
|
code: number;
|
|
1501
1489
|
message: string;
|
|
1502
1490
|
}>;
|
|
1503
|
-
getUserTradingFeeRate(assetClass: number, riskTier: number, chainId: number): Promise<{
|
|
1491
|
+
getUserTradingFeeRate(assetClass: number, riskTier: number, chainId: number, userAddress?: string): Promise<{
|
|
1504
1492
|
code: 0;
|
|
1505
1493
|
data: {
|
|
1506
1494
|
takerFeeRate: string;
|
|
@@ -1531,7 +1519,6 @@ declare class Utils {
|
|
|
1531
1519
|
}[]>;
|
|
1532
1520
|
transferKlineResolutionToInterval(resolution: KlineResolution): HttpKlineIntervalEnum;
|
|
1533
1521
|
getErrorMessage(error: any, fallbackErrorMessage?: string): Promise<any>;
|
|
1534
|
-
checkSeamlessGas(userAddress: string, chainId: number): Promise<boolean>;
|
|
1535
1522
|
getLiquidityInfo({ chainId, poolId, marketPrice, }: {
|
|
1536
1523
|
chainId: number;
|
|
1537
1524
|
poolId: string;
|
|
@@ -1888,13 +1875,6 @@ declare class Api extends Request {
|
|
|
1888
1875
|
getHistoryOrders({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest): Promise<ApiResponse<HistoryOrderItem[]>>;
|
|
1889
1876
|
getPositionHistory({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest): Promise<ApiResponse<PositionHistoryItem[]>>;
|
|
1890
1877
|
getMarketList(): Promise<ApiResponse<MarketInfo[]>>;
|
|
1891
|
-
getAccountVipInfo({ address, accessToken, chainId, deadline, nonce, }: {
|
|
1892
|
-
address: string;
|
|
1893
|
-
accessToken: string;
|
|
1894
|
-
chainId: number;
|
|
1895
|
-
deadline: number;
|
|
1896
|
-
nonce: string;
|
|
1897
|
-
}): Promise<ApiResponse<any>>;
|
|
1898
1878
|
/**
|
|
1899
1879
|
* appeal module start ------>
|
|
1900
1880
|
*/
|
|
@@ -2013,15 +1993,15 @@ declare class Account {
|
|
|
2013
1993
|
code: number;
|
|
2014
1994
|
data: TradeFlowItem[];
|
|
2015
1995
|
}>;
|
|
2016
|
-
getWalletQuoteTokenBalance(chainId
|
|
1996
|
+
getWalletQuoteTokenBalance({ chainId, address, tokenAddress }: {
|
|
1997
|
+
chainId: number;
|
|
1998
|
+
address?: string;
|
|
1999
|
+
tokenAddress: string;
|
|
2000
|
+
}): Promise<{
|
|
2017
2001
|
code: number;
|
|
2018
2002
|
data: any;
|
|
2019
2003
|
}>;
|
|
2020
2004
|
updateAndWithdraw(receiver: string, poolId: string, isQuoteToken: boolean, amount: string, chainId: number): Promise<{
|
|
2021
|
-
code: number;
|
|
2022
|
-
message: string;
|
|
2023
|
-
data: ApiResponse<any>;
|
|
2024
|
-
} | {
|
|
2025
2005
|
code: number;
|
|
2026
2006
|
data: viem.TransactionReceipt;
|
|
2027
2007
|
message?: undefined;
|
|
@@ -2035,10 +2015,6 @@ declare class Account {
|
|
|
2035
2015
|
tokenAddress: string;
|
|
2036
2016
|
chainId: number;
|
|
2037
2017
|
}): Promise<{
|
|
2038
|
-
code: number;
|
|
2039
|
-
message: string;
|
|
2040
|
-
data: ApiResponse<any>;
|
|
2041
|
-
} | {
|
|
2042
2018
|
code: number;
|
|
2043
2019
|
data: viem.TransactionReceipt;
|
|
2044
2020
|
message?: undefined;
|
|
@@ -2076,15 +2052,6 @@ declare class Account {
|
|
|
2076
2052
|
message: string;
|
|
2077
2053
|
data?: undefined;
|
|
2078
2054
|
}>;
|
|
2079
|
-
getAccountVipInfoByBackend(address: string, chainId: number, deadline: number, nonce: string): Promise<{
|
|
2080
|
-
code: number;
|
|
2081
|
-
data: any;
|
|
2082
|
-
message?: undefined;
|
|
2083
|
-
} | {
|
|
2084
|
-
code: number;
|
|
2085
|
-
message: string;
|
|
2086
|
-
data?: undefined;
|
|
2087
|
-
}>;
|
|
2088
2055
|
setUserFeeData(address: string, chainId: number, deadline: number, params: {
|
|
2089
2056
|
tier: number;
|
|
2090
2057
|
referrer: string;
|
|
@@ -2092,10 +2059,6 @@ declare class Account {
|
|
|
2092
2059
|
referrerRebatePct: number;
|
|
2093
2060
|
nonce: string;
|
|
2094
2061
|
}, signature: string): Promise<{
|
|
2095
|
-
code: number;
|
|
2096
|
-
data: ApiResponse<any>;
|
|
2097
|
-
message?: undefined;
|
|
2098
|
-
} | {
|
|
2099
2062
|
code: number;
|
|
2100
2063
|
data: viem.TransactionReceipt;
|
|
2101
2064
|
message?: undefined;
|
|
@@ -2113,9 +2076,9 @@ declare class Seamless {
|
|
|
2113
2076
|
private account;
|
|
2114
2077
|
private api;
|
|
2115
2078
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account, api: Api);
|
|
2116
|
-
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<any>;
|
|
2117
|
-
getUSDPermitParams(deadline: number, chainId: number): Promise<{
|
|
2118
|
-
token:
|
|
2079
|
+
onCheckRelayer(account: string, relayer: string, chainId: number, tokenAddress: string): Promise<any>;
|
|
2080
|
+
getUSDPermitParams(deadline: number, chainId: number, tokenAddress: string): Promise<{
|
|
2081
|
+
token: string;
|
|
2119
2082
|
owner: `0x${string}`;
|
|
2120
2083
|
spender: `0x${string}`;
|
|
2121
2084
|
value: string;
|
|
@@ -2124,7 +2087,7 @@ declare class Seamless {
|
|
|
2124
2087
|
r: `0x${string}`;
|
|
2125
2088
|
s: `0x${string}`;
|
|
2126
2089
|
}[]>;
|
|
2127
|
-
forwarderTx({ from, to, value, gas, deadline, data, nonce, }: {
|
|
2090
|
+
forwarderTx({ from, to, value, gas, deadline, data, nonce, forwardFeeToken, }: {
|
|
2128
2091
|
from: string;
|
|
2129
2092
|
to: string;
|
|
2130
2093
|
value: string;
|
|
@@ -2132,11 +2095,13 @@ declare class Seamless {
|
|
|
2132
2095
|
deadline: number;
|
|
2133
2096
|
data: string;
|
|
2134
2097
|
nonce: string;
|
|
2098
|
+
forwardFeeToken: string;
|
|
2135
2099
|
}, chainId: number, walletClient?: Awaited<ReturnType<typeof getWalletClient>>): Promise<ApiResponse<any>>;
|
|
2136
|
-
authorizeSeamlessAccount({ approve, seamlessAddress, chainId }: {
|
|
2100
|
+
authorizeSeamlessAccount({ approve, seamlessAddress, chainId, forwardFeeToken }: {
|
|
2137
2101
|
approve: boolean;
|
|
2138
2102
|
seamlessAddress: string;
|
|
2139
2103
|
chainId: number;
|
|
2104
|
+
forwardFeeToken: string;
|
|
2140
2105
|
}): Promise<{
|
|
2141
2106
|
code: number;
|
|
2142
2107
|
data: {
|
|
@@ -2149,65 +2114,11 @@ declare class Seamless {
|
|
|
2149
2114
|
data: null;
|
|
2150
2115
|
message: string;
|
|
2151
2116
|
}>;
|
|
2152
|
-
|
|
2153
|
-
masterAddress: string;
|
|
2154
|
-
password: string;
|
|
2155
|
-
apiKey: string;
|
|
2156
|
-
chainId: number;
|
|
2157
|
-
}): Promise<{
|
|
2158
|
-
code: number;
|
|
2159
|
-
data: {
|
|
2160
|
-
masterAddress: string;
|
|
2161
|
-
seamlessAccount: `0x${string}`;
|
|
2162
|
-
authorized: any;
|
|
2163
|
-
};
|
|
2164
|
-
}>;
|
|
2165
|
-
exportSeamlessPrivateKey({ password, apiKey }: {
|
|
2166
|
-
password: string;
|
|
2167
|
-
apiKey: string;
|
|
2168
|
-
}): Promise<{
|
|
2169
|
-
code: number;
|
|
2170
|
-
data: {
|
|
2171
|
-
privateKey: string;
|
|
2172
|
-
};
|
|
2173
|
-
}>;
|
|
2174
|
-
importSeamlessPrivateKey({ privateKey, password, chainId }: {
|
|
2175
|
-
privateKey: string;
|
|
2176
|
-
password: string;
|
|
2177
|
-
chainId: number;
|
|
2178
|
-
}): Promise<{
|
|
2117
|
+
getOriginSeamlessAccount(address: string, chainId: number): Promise<{
|
|
2179
2118
|
code: number;
|
|
2180
2119
|
data: {
|
|
2181
2120
|
masterAddress: any;
|
|
2182
|
-
seamlessAccount: `0x${string}`;
|
|
2183
|
-
authorized: any;
|
|
2184
|
-
apiKey: string;
|
|
2185
|
-
};
|
|
2186
|
-
}>;
|
|
2187
|
-
startSeamlessMode({ open }: {
|
|
2188
|
-
open: boolean;
|
|
2189
|
-
}): Promise<{
|
|
2190
|
-
code: number;
|
|
2191
|
-
data: {
|
|
2192
|
-
open: boolean;
|
|
2193
|
-
};
|
|
2194
|
-
}>;
|
|
2195
|
-
createSeamless({ password, chainId }: {
|
|
2196
|
-
password: string;
|
|
2197
|
-
chainId: number;
|
|
2198
|
-
}): Promise<{
|
|
2199
|
-
code: number;
|
|
2200
|
-
data: {
|
|
2201
|
-
masterAddress: `0x${string}`;
|
|
2202
|
-
seamlessAccount: `0x${string}`;
|
|
2203
|
-
authorized: any;
|
|
2204
|
-
apiKey: string;
|
|
2205
2121
|
};
|
|
2206
|
-
message?: undefined;
|
|
2207
|
-
} | {
|
|
2208
|
-
code: number;
|
|
2209
|
-
message: string;
|
|
2210
|
-
data?: undefined;
|
|
2211
2122
|
}>;
|
|
2212
2123
|
}
|
|
2213
2124
|
|
|
@@ -2240,10 +2151,6 @@ declare class Position {
|
|
|
2240
2151
|
chainId: number;
|
|
2241
2152
|
address: string;
|
|
2242
2153
|
}): Promise<{
|
|
2243
|
-
code: number;
|
|
2244
|
-
message: string;
|
|
2245
|
-
data: ApiResponse<any>;
|
|
2246
|
-
} | {
|
|
2247
2154
|
code: number;
|
|
2248
2155
|
data: {
|
|
2249
2156
|
hash: any;
|
|
@@ -2281,10 +2188,6 @@ declare class Order {
|
|
|
2281
2188
|
private api;
|
|
2282
2189
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, seamless: Seamless, account: Account, api: Api);
|
|
2283
2190
|
createIncreaseOrder(params: PlaceOrderParams, tradingFee: string, marketId: string): Promise<{
|
|
2284
|
-
code: number;
|
|
2285
|
-
message: string;
|
|
2286
|
-
data: ApiResponse<any>;
|
|
2287
|
-
} | {
|
|
2288
2191
|
code: number;
|
|
2289
2192
|
message: string;
|
|
2290
2193
|
data: {
|
|
@@ -2303,17 +2206,6 @@ declare class Order {
|
|
|
2303
2206
|
data?: undefined;
|
|
2304
2207
|
}>;
|
|
2305
2208
|
closeAllPositions(chainId: number, params: PlaceOrderParams[]): Promise<{
|
|
2306
|
-
code: number;
|
|
2307
|
-
message: string;
|
|
2308
|
-
data: ApiResponse<any>;
|
|
2309
|
-
transactionHash?: undefined;
|
|
2310
|
-
blockNumber?: undefined;
|
|
2311
|
-
gasUsed?: undefined;
|
|
2312
|
-
status?: undefined;
|
|
2313
|
-
confirmations?: undefined;
|
|
2314
|
-
timestamp?: undefined;
|
|
2315
|
-
receipt?: undefined;
|
|
2316
|
-
} | {
|
|
2317
2209
|
code: number;
|
|
2318
2210
|
message: string;
|
|
2319
2211
|
transactionHash: any;
|
|
@@ -2323,11 +2215,9 @@ declare class Order {
|
|
|
2323
2215
|
confirmations: number;
|
|
2324
2216
|
timestamp: number;
|
|
2325
2217
|
receipt: viem.TransactionReceipt;
|
|
2326
|
-
data?: undefined;
|
|
2327
2218
|
} | {
|
|
2328
2219
|
code: number;
|
|
2329
2220
|
message: any;
|
|
2330
|
-
data?: undefined;
|
|
2331
2221
|
transactionHash?: undefined;
|
|
2332
2222
|
blockNumber?: undefined;
|
|
2333
2223
|
gasUsed?: undefined;
|
|
@@ -2337,10 +2227,6 @@ declare class Order {
|
|
|
2337
2227
|
receipt?: undefined;
|
|
2338
2228
|
}>;
|
|
2339
2229
|
createDecreaseOrder(params: PlaceOrderParams): Promise<{
|
|
2340
|
-
code: number;
|
|
2341
|
-
message: string;
|
|
2342
|
-
data: ApiResponse<any>;
|
|
2343
|
-
} | {
|
|
2344
2230
|
code: number;
|
|
2345
2231
|
message: string;
|
|
2346
2232
|
data: {
|
|
@@ -2359,10 +2245,6 @@ declare class Order {
|
|
|
2359
2245
|
data?: undefined;
|
|
2360
2246
|
}>;
|
|
2361
2247
|
createPositionTpSlOrder(params: PositionTpSlOrderParams): Promise<{
|
|
2362
|
-
code: number;
|
|
2363
|
-
message: string;
|
|
2364
|
-
data: ApiResponse<any>;
|
|
2365
|
-
} | {
|
|
2366
2248
|
code: number;
|
|
2367
2249
|
message: string;
|
|
2368
2250
|
data: {
|
|
@@ -2381,37 +2263,18 @@ declare class Order {
|
|
|
2381
2263
|
data?: undefined;
|
|
2382
2264
|
}>;
|
|
2383
2265
|
cancelAllOrders(orderIds: string[], chainId: ChainId): Promise<{
|
|
2384
|
-
code: number;
|
|
2385
|
-
message: string;
|
|
2386
|
-
data: ApiResponse<any>;
|
|
2387
|
-
} | {
|
|
2388
2266
|
code: number;
|
|
2389
2267
|
message: any;
|
|
2390
|
-
data?: undefined;
|
|
2391
2268
|
}>;
|
|
2392
2269
|
cancelOrder(orderId: string, chainId: ChainId): Promise<{
|
|
2393
|
-
code: number;
|
|
2394
|
-
message: string;
|
|
2395
|
-
data: ApiResponse<any>;
|
|
2396
|
-
} | {
|
|
2397
2270
|
code: number;
|
|
2398
2271
|
message: any;
|
|
2399
|
-
data?: undefined;
|
|
2400
2272
|
}>;
|
|
2401
2273
|
cancelOrders(orderIds: string[], chainId: ChainId): Promise<{
|
|
2402
|
-
code: number;
|
|
2403
|
-
message: string;
|
|
2404
|
-
data: ApiResponse<any>;
|
|
2405
|
-
} | {
|
|
2406
2274
|
code: number;
|
|
2407
2275
|
message: any;
|
|
2408
|
-
data?: undefined;
|
|
2409
2276
|
}>;
|
|
2410
2277
|
updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number, address: string, marketId: string, isTpSlOrder?: boolean): Promise<{
|
|
2411
|
-
code: number;
|
|
2412
|
-
message: string;
|
|
2413
|
-
data: ApiResponse<any>;
|
|
2414
|
-
} | {
|
|
2415
2278
|
code: number;
|
|
2416
2279
|
data: viem.TransactionReceipt;
|
|
2417
2280
|
message: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
|
-
import { zeroAddress, Address as Address$2,
|
|
2
|
+
import { zeroAddress, Address as Address$2, WalletClient, PublicClient, Abi } from 'viem';
|
|
3
3
|
export { formatUnits, parseUnits } from 'viem';
|
|
4
4
|
import { Options, Event } from 'reconnecting-websocket';
|
|
5
5
|
import { WretchOptions } from 'wretch/types';
|
|
@@ -1314,17 +1314,11 @@ interface MyxClientConfig {
|
|
|
1314
1314
|
chainId: number;
|
|
1315
1315
|
/** ethers v5/v6 Signer, viem WalletClient, or ISigner. Use walletClient when app uses viem to avoid ethers in bundle. */
|
|
1316
1316
|
signer?: SignerLike;
|
|
1317
|
-
seamlessAccount?: {
|
|
1318
|
-
masterAddress: string;
|
|
1319
|
-
wallet: Account$1 | null;
|
|
1320
|
-
authorized: boolean;
|
|
1321
|
-
};
|
|
1322
1317
|
walletClient?: WalletClient;
|
|
1323
1318
|
brokerAddress: string;
|
|
1324
1319
|
isTestnet?: boolean;
|
|
1325
1320
|
isBetaMode?: boolean;
|
|
1326
1321
|
poolingInterval?: number;
|
|
1327
|
-
seamlessMode?: boolean;
|
|
1328
1322
|
socketConfig?: Partial<Omit<WebSocketConfig, "url">>;
|
|
1329
1323
|
logLevel?: LogLevel;
|
|
1330
1324
|
getAccessToken?: (() => Promise<AccessTokenResponse | undefined>) | (() => AccessTokenResponse | undefined);
|
|
@@ -1343,12 +1337,6 @@ declare class ConfigManager {
|
|
|
1343
1337
|
getSignerAddress(chainId: number): Promise<string>;
|
|
1344
1338
|
/** Returns viem WalletClient for the chain (for readContract/writeContract). Use when SDK uses viem. */
|
|
1345
1339
|
getViemWalletClient(chainId: number): Promise<WalletClient>;
|
|
1346
|
-
startSeamlessMode(open: boolean): Promise<MyxClientConfig>;
|
|
1347
|
-
updateSeamlessWallet({ wallet, authorized, masterAddress, }: {
|
|
1348
|
-
wallet?: Account$1 | null;
|
|
1349
|
-
authorized?: boolean;
|
|
1350
|
-
masterAddress?: string;
|
|
1351
|
-
}): void;
|
|
1352
1340
|
updateClientChainId(chainId: number, brokerAddress: string): void;
|
|
1353
1341
|
auth(params: Pick<MyxClientConfig, "signer" | "walletClient" | "getAccessToken">): void;
|
|
1354
1342
|
private validateConfig;
|
|
@@ -1500,7 +1488,7 @@ declare class Utils {
|
|
|
1500
1488
|
code: number;
|
|
1501
1489
|
message: string;
|
|
1502
1490
|
}>;
|
|
1503
|
-
getUserTradingFeeRate(assetClass: number, riskTier: number, chainId: number): Promise<{
|
|
1491
|
+
getUserTradingFeeRate(assetClass: number, riskTier: number, chainId: number, userAddress?: string): Promise<{
|
|
1504
1492
|
code: 0;
|
|
1505
1493
|
data: {
|
|
1506
1494
|
takerFeeRate: string;
|
|
@@ -1531,7 +1519,6 @@ declare class Utils {
|
|
|
1531
1519
|
}[]>;
|
|
1532
1520
|
transferKlineResolutionToInterval(resolution: KlineResolution): HttpKlineIntervalEnum;
|
|
1533
1521
|
getErrorMessage(error: any, fallbackErrorMessage?: string): Promise<any>;
|
|
1534
|
-
checkSeamlessGas(userAddress: string, chainId: number): Promise<boolean>;
|
|
1535
1522
|
getLiquidityInfo({ chainId, poolId, marketPrice, }: {
|
|
1536
1523
|
chainId: number;
|
|
1537
1524
|
poolId: string;
|
|
@@ -1888,13 +1875,6 @@ declare class Api extends Request {
|
|
|
1888
1875
|
getHistoryOrders({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest): Promise<ApiResponse<HistoryOrderItem[]>>;
|
|
1889
1876
|
getPositionHistory({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest): Promise<ApiResponse<PositionHistoryItem[]>>;
|
|
1890
1877
|
getMarketList(): Promise<ApiResponse<MarketInfo[]>>;
|
|
1891
|
-
getAccountVipInfo({ address, accessToken, chainId, deadline, nonce, }: {
|
|
1892
|
-
address: string;
|
|
1893
|
-
accessToken: string;
|
|
1894
|
-
chainId: number;
|
|
1895
|
-
deadline: number;
|
|
1896
|
-
nonce: string;
|
|
1897
|
-
}): Promise<ApiResponse<any>>;
|
|
1898
1878
|
/**
|
|
1899
1879
|
* appeal module start ------>
|
|
1900
1880
|
*/
|
|
@@ -2013,15 +1993,15 @@ declare class Account {
|
|
|
2013
1993
|
code: number;
|
|
2014
1994
|
data: TradeFlowItem[];
|
|
2015
1995
|
}>;
|
|
2016
|
-
getWalletQuoteTokenBalance(chainId
|
|
1996
|
+
getWalletQuoteTokenBalance({ chainId, address, tokenAddress }: {
|
|
1997
|
+
chainId: number;
|
|
1998
|
+
address?: string;
|
|
1999
|
+
tokenAddress: string;
|
|
2000
|
+
}): Promise<{
|
|
2017
2001
|
code: number;
|
|
2018
2002
|
data: any;
|
|
2019
2003
|
}>;
|
|
2020
2004
|
updateAndWithdraw(receiver: string, poolId: string, isQuoteToken: boolean, amount: string, chainId: number): Promise<{
|
|
2021
|
-
code: number;
|
|
2022
|
-
message: string;
|
|
2023
|
-
data: ApiResponse<any>;
|
|
2024
|
-
} | {
|
|
2025
2005
|
code: number;
|
|
2026
2006
|
data: viem.TransactionReceipt;
|
|
2027
2007
|
message?: undefined;
|
|
@@ -2035,10 +2015,6 @@ declare class Account {
|
|
|
2035
2015
|
tokenAddress: string;
|
|
2036
2016
|
chainId: number;
|
|
2037
2017
|
}): Promise<{
|
|
2038
|
-
code: number;
|
|
2039
|
-
message: string;
|
|
2040
|
-
data: ApiResponse<any>;
|
|
2041
|
-
} | {
|
|
2042
2018
|
code: number;
|
|
2043
2019
|
data: viem.TransactionReceipt;
|
|
2044
2020
|
message?: undefined;
|
|
@@ -2076,15 +2052,6 @@ declare class Account {
|
|
|
2076
2052
|
message: string;
|
|
2077
2053
|
data?: undefined;
|
|
2078
2054
|
}>;
|
|
2079
|
-
getAccountVipInfoByBackend(address: string, chainId: number, deadline: number, nonce: string): Promise<{
|
|
2080
|
-
code: number;
|
|
2081
|
-
data: any;
|
|
2082
|
-
message?: undefined;
|
|
2083
|
-
} | {
|
|
2084
|
-
code: number;
|
|
2085
|
-
message: string;
|
|
2086
|
-
data?: undefined;
|
|
2087
|
-
}>;
|
|
2088
2055
|
setUserFeeData(address: string, chainId: number, deadline: number, params: {
|
|
2089
2056
|
tier: number;
|
|
2090
2057
|
referrer: string;
|
|
@@ -2092,10 +2059,6 @@ declare class Account {
|
|
|
2092
2059
|
referrerRebatePct: number;
|
|
2093
2060
|
nonce: string;
|
|
2094
2061
|
}, signature: string): Promise<{
|
|
2095
|
-
code: number;
|
|
2096
|
-
data: ApiResponse<any>;
|
|
2097
|
-
message?: undefined;
|
|
2098
|
-
} | {
|
|
2099
2062
|
code: number;
|
|
2100
2063
|
data: viem.TransactionReceipt;
|
|
2101
2064
|
message?: undefined;
|
|
@@ -2113,9 +2076,9 @@ declare class Seamless {
|
|
|
2113
2076
|
private account;
|
|
2114
2077
|
private api;
|
|
2115
2078
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account, api: Api);
|
|
2116
|
-
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<any>;
|
|
2117
|
-
getUSDPermitParams(deadline: number, chainId: number): Promise<{
|
|
2118
|
-
token:
|
|
2079
|
+
onCheckRelayer(account: string, relayer: string, chainId: number, tokenAddress: string): Promise<any>;
|
|
2080
|
+
getUSDPermitParams(deadline: number, chainId: number, tokenAddress: string): Promise<{
|
|
2081
|
+
token: string;
|
|
2119
2082
|
owner: `0x${string}`;
|
|
2120
2083
|
spender: `0x${string}`;
|
|
2121
2084
|
value: string;
|
|
@@ -2124,7 +2087,7 @@ declare class Seamless {
|
|
|
2124
2087
|
r: `0x${string}`;
|
|
2125
2088
|
s: `0x${string}`;
|
|
2126
2089
|
}[]>;
|
|
2127
|
-
forwarderTx({ from, to, value, gas, deadline, data, nonce, }: {
|
|
2090
|
+
forwarderTx({ from, to, value, gas, deadline, data, nonce, forwardFeeToken, }: {
|
|
2128
2091
|
from: string;
|
|
2129
2092
|
to: string;
|
|
2130
2093
|
value: string;
|
|
@@ -2132,11 +2095,13 @@ declare class Seamless {
|
|
|
2132
2095
|
deadline: number;
|
|
2133
2096
|
data: string;
|
|
2134
2097
|
nonce: string;
|
|
2098
|
+
forwardFeeToken: string;
|
|
2135
2099
|
}, chainId: number, walletClient?: Awaited<ReturnType<typeof getWalletClient>>): Promise<ApiResponse<any>>;
|
|
2136
|
-
authorizeSeamlessAccount({ approve, seamlessAddress, chainId }: {
|
|
2100
|
+
authorizeSeamlessAccount({ approve, seamlessAddress, chainId, forwardFeeToken }: {
|
|
2137
2101
|
approve: boolean;
|
|
2138
2102
|
seamlessAddress: string;
|
|
2139
2103
|
chainId: number;
|
|
2104
|
+
forwardFeeToken: string;
|
|
2140
2105
|
}): Promise<{
|
|
2141
2106
|
code: number;
|
|
2142
2107
|
data: {
|
|
@@ -2149,65 +2114,11 @@ declare class Seamless {
|
|
|
2149
2114
|
data: null;
|
|
2150
2115
|
message: string;
|
|
2151
2116
|
}>;
|
|
2152
|
-
|
|
2153
|
-
masterAddress: string;
|
|
2154
|
-
password: string;
|
|
2155
|
-
apiKey: string;
|
|
2156
|
-
chainId: number;
|
|
2157
|
-
}): Promise<{
|
|
2158
|
-
code: number;
|
|
2159
|
-
data: {
|
|
2160
|
-
masterAddress: string;
|
|
2161
|
-
seamlessAccount: `0x${string}`;
|
|
2162
|
-
authorized: any;
|
|
2163
|
-
};
|
|
2164
|
-
}>;
|
|
2165
|
-
exportSeamlessPrivateKey({ password, apiKey }: {
|
|
2166
|
-
password: string;
|
|
2167
|
-
apiKey: string;
|
|
2168
|
-
}): Promise<{
|
|
2169
|
-
code: number;
|
|
2170
|
-
data: {
|
|
2171
|
-
privateKey: string;
|
|
2172
|
-
};
|
|
2173
|
-
}>;
|
|
2174
|
-
importSeamlessPrivateKey({ privateKey, password, chainId }: {
|
|
2175
|
-
privateKey: string;
|
|
2176
|
-
password: string;
|
|
2177
|
-
chainId: number;
|
|
2178
|
-
}): Promise<{
|
|
2117
|
+
getOriginSeamlessAccount(address: string, chainId: number): Promise<{
|
|
2179
2118
|
code: number;
|
|
2180
2119
|
data: {
|
|
2181
2120
|
masterAddress: any;
|
|
2182
|
-
seamlessAccount: `0x${string}`;
|
|
2183
|
-
authorized: any;
|
|
2184
|
-
apiKey: string;
|
|
2185
|
-
};
|
|
2186
|
-
}>;
|
|
2187
|
-
startSeamlessMode({ open }: {
|
|
2188
|
-
open: boolean;
|
|
2189
|
-
}): Promise<{
|
|
2190
|
-
code: number;
|
|
2191
|
-
data: {
|
|
2192
|
-
open: boolean;
|
|
2193
|
-
};
|
|
2194
|
-
}>;
|
|
2195
|
-
createSeamless({ password, chainId }: {
|
|
2196
|
-
password: string;
|
|
2197
|
-
chainId: number;
|
|
2198
|
-
}): Promise<{
|
|
2199
|
-
code: number;
|
|
2200
|
-
data: {
|
|
2201
|
-
masterAddress: `0x${string}`;
|
|
2202
|
-
seamlessAccount: `0x${string}`;
|
|
2203
|
-
authorized: any;
|
|
2204
|
-
apiKey: string;
|
|
2205
2121
|
};
|
|
2206
|
-
message?: undefined;
|
|
2207
|
-
} | {
|
|
2208
|
-
code: number;
|
|
2209
|
-
message: string;
|
|
2210
|
-
data?: undefined;
|
|
2211
2122
|
}>;
|
|
2212
2123
|
}
|
|
2213
2124
|
|
|
@@ -2240,10 +2151,6 @@ declare class Position {
|
|
|
2240
2151
|
chainId: number;
|
|
2241
2152
|
address: string;
|
|
2242
2153
|
}): Promise<{
|
|
2243
|
-
code: number;
|
|
2244
|
-
message: string;
|
|
2245
|
-
data: ApiResponse<any>;
|
|
2246
|
-
} | {
|
|
2247
2154
|
code: number;
|
|
2248
2155
|
data: {
|
|
2249
2156
|
hash: any;
|
|
@@ -2281,10 +2188,6 @@ declare class Order {
|
|
|
2281
2188
|
private api;
|
|
2282
2189
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, seamless: Seamless, account: Account, api: Api);
|
|
2283
2190
|
createIncreaseOrder(params: PlaceOrderParams, tradingFee: string, marketId: string): Promise<{
|
|
2284
|
-
code: number;
|
|
2285
|
-
message: string;
|
|
2286
|
-
data: ApiResponse<any>;
|
|
2287
|
-
} | {
|
|
2288
2191
|
code: number;
|
|
2289
2192
|
message: string;
|
|
2290
2193
|
data: {
|
|
@@ -2303,17 +2206,6 @@ declare class Order {
|
|
|
2303
2206
|
data?: undefined;
|
|
2304
2207
|
}>;
|
|
2305
2208
|
closeAllPositions(chainId: number, params: PlaceOrderParams[]): Promise<{
|
|
2306
|
-
code: number;
|
|
2307
|
-
message: string;
|
|
2308
|
-
data: ApiResponse<any>;
|
|
2309
|
-
transactionHash?: undefined;
|
|
2310
|
-
blockNumber?: undefined;
|
|
2311
|
-
gasUsed?: undefined;
|
|
2312
|
-
status?: undefined;
|
|
2313
|
-
confirmations?: undefined;
|
|
2314
|
-
timestamp?: undefined;
|
|
2315
|
-
receipt?: undefined;
|
|
2316
|
-
} | {
|
|
2317
2209
|
code: number;
|
|
2318
2210
|
message: string;
|
|
2319
2211
|
transactionHash: any;
|
|
@@ -2323,11 +2215,9 @@ declare class Order {
|
|
|
2323
2215
|
confirmations: number;
|
|
2324
2216
|
timestamp: number;
|
|
2325
2217
|
receipt: viem.TransactionReceipt;
|
|
2326
|
-
data?: undefined;
|
|
2327
2218
|
} | {
|
|
2328
2219
|
code: number;
|
|
2329
2220
|
message: any;
|
|
2330
|
-
data?: undefined;
|
|
2331
2221
|
transactionHash?: undefined;
|
|
2332
2222
|
blockNumber?: undefined;
|
|
2333
2223
|
gasUsed?: undefined;
|
|
@@ -2337,10 +2227,6 @@ declare class Order {
|
|
|
2337
2227
|
receipt?: undefined;
|
|
2338
2228
|
}>;
|
|
2339
2229
|
createDecreaseOrder(params: PlaceOrderParams): Promise<{
|
|
2340
|
-
code: number;
|
|
2341
|
-
message: string;
|
|
2342
|
-
data: ApiResponse<any>;
|
|
2343
|
-
} | {
|
|
2344
2230
|
code: number;
|
|
2345
2231
|
message: string;
|
|
2346
2232
|
data: {
|
|
@@ -2359,10 +2245,6 @@ declare class Order {
|
|
|
2359
2245
|
data?: undefined;
|
|
2360
2246
|
}>;
|
|
2361
2247
|
createPositionTpSlOrder(params: PositionTpSlOrderParams): Promise<{
|
|
2362
|
-
code: number;
|
|
2363
|
-
message: string;
|
|
2364
|
-
data: ApiResponse<any>;
|
|
2365
|
-
} | {
|
|
2366
2248
|
code: number;
|
|
2367
2249
|
message: string;
|
|
2368
2250
|
data: {
|
|
@@ -2381,37 +2263,18 @@ declare class Order {
|
|
|
2381
2263
|
data?: undefined;
|
|
2382
2264
|
}>;
|
|
2383
2265
|
cancelAllOrders(orderIds: string[], chainId: ChainId): Promise<{
|
|
2384
|
-
code: number;
|
|
2385
|
-
message: string;
|
|
2386
|
-
data: ApiResponse<any>;
|
|
2387
|
-
} | {
|
|
2388
2266
|
code: number;
|
|
2389
2267
|
message: any;
|
|
2390
|
-
data?: undefined;
|
|
2391
2268
|
}>;
|
|
2392
2269
|
cancelOrder(orderId: string, chainId: ChainId): Promise<{
|
|
2393
|
-
code: number;
|
|
2394
|
-
message: string;
|
|
2395
|
-
data: ApiResponse<any>;
|
|
2396
|
-
} | {
|
|
2397
2270
|
code: number;
|
|
2398
2271
|
message: any;
|
|
2399
|
-
data?: undefined;
|
|
2400
2272
|
}>;
|
|
2401
2273
|
cancelOrders(orderIds: string[], chainId: ChainId): Promise<{
|
|
2402
|
-
code: number;
|
|
2403
|
-
message: string;
|
|
2404
|
-
data: ApiResponse<any>;
|
|
2405
|
-
} | {
|
|
2406
2274
|
code: number;
|
|
2407
2275
|
message: any;
|
|
2408
|
-
data?: undefined;
|
|
2409
2276
|
}>;
|
|
2410
2277
|
updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number, address: string, marketId: string, isTpSlOrder?: boolean): Promise<{
|
|
2411
|
-
code: number;
|
|
2412
|
-
message: string;
|
|
2413
|
-
data: ApiResponse<any>;
|
|
2414
|
-
} | {
|
|
2415
2278
|
code: number;
|
|
2416
2279
|
data: viem.TransactionReceipt;
|
|
2417
2280
|
message: string;
|