@myx-trade/sdk 0.1.175 → 0.1.177
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 +90 -146
- package/dist/index.d.ts +90 -146
- package/dist/index.js +20 -15
- package/dist/index.mjs +20 -15
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AddressLike, Signer, ethers as ethers$1 } from 'ethers';
|
|
1
|
+
import { AddressLike, Signer, ethers } from 'ethers';
|
|
3
2
|
export { formatUnits, parseUnits } from 'ethers';
|
|
4
3
|
import { Options, Event } from 'reconnecting-websocket';
|
|
5
4
|
import { WalletClient } from 'viem';
|
|
@@ -49,49 +48,49 @@ interface CancelTpSLParams {
|
|
|
49
48
|
orderId: string;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<
|
|
51
|
+
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<any>;
|
|
53
52
|
|
|
54
|
-
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<
|
|
55
|
-
declare const getMarketPools: (chainId: ChainId) => Promise<
|
|
53
|
+
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<any>;
|
|
54
|
+
declare const getMarketPools: (chainId: ChainId) => Promise<any>;
|
|
56
55
|
declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bigint) => Promise<{
|
|
57
56
|
quotePool: {
|
|
58
|
-
poolToken:
|
|
59
|
-
exchangeRate:
|
|
60
|
-
poolTokenPrice:
|
|
61
|
-
poolTokenSupply:
|
|
57
|
+
poolToken: any;
|
|
58
|
+
exchangeRate: any;
|
|
59
|
+
poolTokenPrice: any;
|
|
60
|
+
poolTokenSupply: any;
|
|
62
61
|
};
|
|
63
62
|
basePool: {
|
|
64
|
-
poolToken:
|
|
65
|
-
exchangeRate:
|
|
66
|
-
poolTokenPrice:
|
|
67
|
-
poolTokenSupply:
|
|
63
|
+
poolToken: any;
|
|
64
|
+
exchangeRate: any;
|
|
65
|
+
poolTokenPrice: any;
|
|
66
|
+
poolTokenSupply: any;
|
|
68
67
|
};
|
|
69
68
|
reserveInfo: {
|
|
70
|
-
baseTotalAmount:
|
|
71
|
-
baseReservedAmount:
|
|
72
|
-
quoteTotalAmount:
|
|
73
|
-
quoteReservedAmount:
|
|
69
|
+
baseTotalAmount: any;
|
|
70
|
+
baseReservedAmount: any;
|
|
71
|
+
quoteTotalAmount: any;
|
|
72
|
+
quoteReservedAmount: any;
|
|
74
73
|
};
|
|
75
74
|
fundingInfo: {
|
|
76
|
-
nextFundingRate:
|
|
77
|
-
lastFundingFeeTracker:
|
|
78
|
-
nextEpochTime:
|
|
75
|
+
nextFundingRate: any;
|
|
76
|
+
lastFundingFeeTracker: any;
|
|
77
|
+
nextEpochTime: any;
|
|
79
78
|
};
|
|
80
79
|
ioTracker: {
|
|
81
|
-
tracker:
|
|
82
|
-
longSize:
|
|
83
|
-
shortSize:
|
|
84
|
-
poolEntryPrice:
|
|
80
|
+
tracker: any;
|
|
81
|
+
longSize: any;
|
|
82
|
+
shortSize: any;
|
|
83
|
+
poolEntryPrice: any;
|
|
85
84
|
};
|
|
86
85
|
}>;
|
|
87
86
|
|
|
88
|
-
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<
|
|
87
|
+
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<any>;
|
|
89
88
|
|
|
90
|
-
declare const addTpSl: (params: AddTpSLParams) => Promise<
|
|
89
|
+
declare const addTpSl: (params: AddTpSLParams) => Promise<any>;
|
|
91
90
|
|
|
92
|
-
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<
|
|
91
|
+
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<any>;
|
|
93
92
|
|
|
94
|
-
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<
|
|
93
|
+
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<any>;
|
|
95
94
|
|
|
96
95
|
/**
|
|
97
96
|
* Trading related types and enums
|
|
@@ -889,21 +888,21 @@ interface PreviewWithdrawDataParams {
|
|
|
889
888
|
amount: string | number;
|
|
890
889
|
}
|
|
891
890
|
|
|
892
|
-
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<
|
|
893
|
-
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
891
|
+
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<any>;
|
|
892
|
+
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
|
|
894
893
|
|
|
895
|
-
declare const deposit$1: (params: Deposit) => Promise<
|
|
894
|
+
declare const deposit$1: (params: Deposit) => Promise<any>;
|
|
896
895
|
|
|
897
|
-
declare const withdraw$1: (params: WithdrawParams) => Promise<
|
|
896
|
+
declare const withdraw$1: (params: WithdrawParams) => Promise<any>;
|
|
898
897
|
|
|
899
|
-
declare const getRewards$1: (params: RewardsParams) => Promise<
|
|
898
|
+
declare const getRewards$1: (params: RewardsParams) => Promise<any>;
|
|
900
899
|
|
|
901
900
|
declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
|
|
902
|
-
baseAmountOut:
|
|
903
|
-
rebateAmount:
|
|
901
|
+
baseAmountOut: any;
|
|
902
|
+
rebateAmount: any;
|
|
904
903
|
} | undefined>;
|
|
905
904
|
|
|
906
|
-
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<
|
|
905
|
+
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<any>;
|
|
907
906
|
|
|
908
907
|
declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
|
|
909
908
|
declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
|
|
@@ -912,18 +911,18 @@ declare namespace index$2 {
|
|
|
912
911
|
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 };
|
|
913
912
|
}
|
|
914
913
|
|
|
915
|
-
declare const deposit: (params: Deposit) => Promise<
|
|
914
|
+
declare const deposit: (params: Deposit) => Promise<any>;
|
|
916
915
|
|
|
917
|
-
declare const withdraw: (params: WithdrawParams) => Promise<
|
|
916
|
+
declare const withdraw: (params: WithdrawParams) => Promise<any>;
|
|
918
917
|
|
|
919
|
-
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<
|
|
918
|
+
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<any>;
|
|
920
919
|
|
|
921
|
-
declare const getRewards: (params: RewardsParams) => Promise<
|
|
920
|
+
declare const getRewards: (params: RewardsParams) => Promise<any>;
|
|
922
921
|
|
|
923
|
-
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<
|
|
924
|
-
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
922
|
+
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<any>;
|
|
923
|
+
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
|
|
925
924
|
|
|
926
|
-
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<
|
|
925
|
+
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<any>;
|
|
927
926
|
|
|
928
927
|
declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
|
|
929
928
|
declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
|
|
@@ -936,16 +935,9 @@ declare namespace index$1 {
|
|
|
936
935
|
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 };
|
|
937
936
|
}
|
|
938
937
|
|
|
939
|
-
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<
|
|
940
|
-
quoteToken: string;
|
|
941
|
-
baseReserveRatio: bigint;
|
|
942
|
-
quoteReserveRatio: bigint;
|
|
943
|
-
oracleFeeUsd: bigint;
|
|
944
|
-
oracleRefundFeeUsd: bigint;
|
|
945
|
-
poolPrimeThreshold: bigint;
|
|
946
|
-
}) | undefined>;
|
|
938
|
+
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<any>;
|
|
947
939
|
|
|
948
|
-
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<
|
|
940
|
+
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<any>;
|
|
949
941
|
|
|
950
942
|
declare const index_getMarket: typeof getMarket;
|
|
951
943
|
declare const index_getOracleFee: typeof getOracleFee;
|
|
@@ -988,9 +980,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
|
|
|
988
980
|
declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
|
|
989
981
|
balance?: number | undefined;
|
|
990
982
|
address: string;
|
|
991
|
-
name:
|
|
992
|
-
symbol:
|
|
993
|
-
decimals:
|
|
983
|
+
name: any;
|
|
984
|
+
symbol: any;
|
|
985
|
+
decimals: any;
|
|
994
986
|
icon: string;
|
|
995
987
|
totalSupply: number;
|
|
996
988
|
}>;
|
|
@@ -1204,7 +1196,7 @@ interface MyxClientConfig {
|
|
|
1204
1196
|
signer?: Signer;
|
|
1205
1197
|
seamlessAccount?: {
|
|
1206
1198
|
masterAddress: string;
|
|
1207
|
-
wallet: ethers
|
|
1199
|
+
wallet: ethers.Wallet | null;
|
|
1208
1200
|
authorized: boolean;
|
|
1209
1201
|
};
|
|
1210
1202
|
walletClient?: WalletClient;
|
|
@@ -1224,7 +1216,7 @@ declare class ConfigManager {
|
|
|
1224
1216
|
clear(): void;
|
|
1225
1217
|
startSeamlessMode(open: boolean): MyxClientConfig;
|
|
1226
1218
|
updateSeamlessWallet({ wallet, authorized, masterAddress }: {
|
|
1227
|
-
wallet?: ethers
|
|
1219
|
+
wallet?: ethers.Wallet;
|
|
1228
1220
|
authorized?: boolean;
|
|
1229
1221
|
masterAddress?: string;
|
|
1230
1222
|
}): void;
|
|
@@ -1320,6 +1312,15 @@ declare class SubScription {
|
|
|
1320
1312
|
off<K extends keyof WebSocketEvents>(event: K, handler: (data: WebSocketEvents[K]) => void): void;
|
|
1321
1313
|
}
|
|
1322
1314
|
|
|
1315
|
+
interface PoolSymbolAllResponse {
|
|
1316
|
+
chainId: number;
|
|
1317
|
+
marketId: string;
|
|
1318
|
+
poolId: string;
|
|
1319
|
+
baseSymbol: string;
|
|
1320
|
+
quoteSymbol: string;
|
|
1321
|
+
baseTokenIcon: string;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1323
1324
|
declare class Utils {
|
|
1324
1325
|
private configManager;
|
|
1325
1326
|
private logger;
|
|
@@ -1332,7 +1333,7 @@ declare class Utils {
|
|
|
1332
1333
|
quoteAddress: string;
|
|
1333
1334
|
amount?: string;
|
|
1334
1335
|
spenderAddress?: string;
|
|
1335
|
-
signer?: ethers
|
|
1336
|
+
signer?: ethers.Signer;
|
|
1336
1337
|
}): Promise<{
|
|
1337
1338
|
code: number;
|
|
1338
1339
|
message: any;
|
|
@@ -1375,68 +1376,7 @@ declare class Utils {
|
|
|
1375
1376
|
marketPrice: string;
|
|
1376
1377
|
}): Promise<{
|
|
1377
1378
|
code: number;
|
|
1378
|
-
data:
|
|
1379
|
-
poolToken: string;
|
|
1380
|
-
exchangeRate: bigint;
|
|
1381
|
-
poolTokenPrice: bigint;
|
|
1382
|
-
poolTokenSupply: bigint;
|
|
1383
|
-
}, [string, bigint, bigint, bigint] & {
|
|
1384
|
-
poolToken: string;
|
|
1385
|
-
exchangeRate: bigint;
|
|
1386
|
-
poolTokenPrice: bigint;
|
|
1387
|
-
poolTokenSupply: bigint;
|
|
1388
|
-
}, [bigint, bigint, bigint, bigint] & {
|
|
1389
|
-
baseTotalAmount: bigint;
|
|
1390
|
-
baseReservedAmount: bigint;
|
|
1391
|
-
quoteTotalAmount: bigint;
|
|
1392
|
-
quoteReservedAmount: bigint;
|
|
1393
|
-
}, [bigint, bigint, bigint] & {
|
|
1394
|
-
nextFundingRate: bigint;
|
|
1395
|
-
lastFundingFeeTracker: bigint;
|
|
1396
|
-
nextEpochTime: bigint;
|
|
1397
|
-
}, [bigint, bigint, bigint, bigint] & {
|
|
1398
|
-
tracker: bigint;
|
|
1399
|
-
longSize: bigint;
|
|
1400
|
-
shortSize: bigint;
|
|
1401
|
-
poolEntryPrice: bigint;
|
|
1402
|
-
}, [bigint, bigint] & {
|
|
1403
|
-
windowCaps: bigint;
|
|
1404
|
-
openInterest: bigint;
|
|
1405
|
-
}] & {
|
|
1406
|
-
basePool: [string, bigint, bigint, bigint] & {
|
|
1407
|
-
poolToken: string;
|
|
1408
|
-
exchangeRate: bigint;
|
|
1409
|
-
poolTokenPrice: bigint;
|
|
1410
|
-
poolTokenSupply: bigint;
|
|
1411
|
-
};
|
|
1412
|
-
quotePool: [string, bigint, bigint, bigint] & {
|
|
1413
|
-
poolToken: string;
|
|
1414
|
-
exchangeRate: bigint;
|
|
1415
|
-
poolTokenPrice: bigint;
|
|
1416
|
-
poolTokenSupply: bigint;
|
|
1417
|
-
};
|
|
1418
|
-
reserveInfo: [bigint, bigint, bigint, bigint] & {
|
|
1419
|
-
baseTotalAmount: bigint;
|
|
1420
|
-
baseReservedAmount: bigint;
|
|
1421
|
-
quoteTotalAmount: bigint;
|
|
1422
|
-
quoteReservedAmount: bigint;
|
|
1423
|
-
};
|
|
1424
|
-
fundingInfo: [bigint, bigint, bigint] & {
|
|
1425
|
-
nextFundingRate: bigint;
|
|
1426
|
-
lastFundingFeeTracker: bigint;
|
|
1427
|
-
nextEpochTime: bigint;
|
|
1428
|
-
};
|
|
1429
|
-
oi: [bigint, bigint, bigint, bigint] & {
|
|
1430
|
-
tracker: bigint;
|
|
1431
|
-
longSize: bigint;
|
|
1432
|
-
shortSize: bigint;
|
|
1433
|
-
poolEntryPrice: bigint;
|
|
1434
|
-
};
|
|
1435
|
-
liquidityInfo: [bigint, bigint] & {
|
|
1436
|
-
windowCaps: bigint;
|
|
1437
|
-
openInterest: bigint;
|
|
1438
|
-
};
|
|
1439
|
-
};
|
|
1379
|
+
data: any;
|
|
1440
1380
|
message?: undefined;
|
|
1441
1381
|
} | {
|
|
1442
1382
|
code: number;
|
|
@@ -1454,10 +1394,10 @@ declare class Markets {
|
|
|
1454
1394
|
/**
|
|
1455
1395
|
* kline start
|
|
1456
1396
|
*/
|
|
1457
|
-
getKlineList({ interval, ...params }: Pick<GetKlineDataParams, "poolId" | "limit" | "endTime" |
|
|
1397
|
+
getKlineList({ interval, ...params }: Pick<GetKlineDataParams, "poolId" | "limit" | "endTime" | "chainId"> & {
|
|
1458
1398
|
interval: KlineResolution;
|
|
1459
1399
|
}): Promise<KlineDataItemType[]>;
|
|
1460
|
-
getKlineLatestBar({ interval, ...params }: Pick<GetKlineDataParams, "poolId" | "limit" | "endTime" |
|
|
1400
|
+
getKlineLatestBar({ interval, ...params }: Pick<GetKlineDataParams, "poolId" | "limit" | "endTime" | "chainId"> & {
|
|
1461
1401
|
interval: KlineResolution;
|
|
1462
1402
|
}): Promise<KlineDataItemType>;
|
|
1463
1403
|
/**
|
|
@@ -1498,6 +1438,10 @@ declare class Markets {
|
|
|
1498
1438
|
* get market detail
|
|
1499
1439
|
*/
|
|
1500
1440
|
getMarketDetail(params: GetMarketDetailParams): Promise<MarketDetailResponse>;
|
|
1441
|
+
/**
|
|
1442
|
+
* get pool symbol all
|
|
1443
|
+
*/
|
|
1444
|
+
getPoolSymbolAll(): Promise<PoolSymbolAllResponse[]>;
|
|
1501
1445
|
}
|
|
1502
1446
|
|
|
1503
1447
|
declare class Account {
|
|
@@ -1590,9 +1534,9 @@ declare class Seamless {
|
|
|
1590
1534
|
private utils;
|
|
1591
1535
|
private account;
|
|
1592
1536
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
|
|
1593
|
-
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<
|
|
1537
|
+
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<any>;
|
|
1594
1538
|
getUSDPermitParams(deadline: number, chainId: number): Promise<{
|
|
1595
|
-
token: string | ethers
|
|
1539
|
+
token: string | ethers.Addressable;
|
|
1596
1540
|
owner: string;
|
|
1597
1541
|
spender: string;
|
|
1598
1542
|
value: bigint;
|
|
@@ -1609,7 +1553,7 @@ declare class Seamless {
|
|
|
1609
1553
|
deadline: number;
|
|
1610
1554
|
data: string;
|
|
1611
1555
|
nonce: string;
|
|
1612
|
-
}, chainId: number, provider?: ethers
|
|
1556
|
+
}, chainId: number, provider?: ethers.Signer): Promise<ApiResponse<any>>;
|
|
1613
1557
|
authorizeSeamlessAccount({ approve, seamlessAddress, chainId }: {
|
|
1614
1558
|
approve: boolean;
|
|
1615
1559
|
seamlessAddress: string;
|
|
@@ -1631,7 +1575,7 @@ declare class Seamless {
|
|
|
1631
1575
|
data: {
|
|
1632
1576
|
masterAddress: string;
|
|
1633
1577
|
seamlessAccount: string;
|
|
1634
|
-
authorized:
|
|
1578
|
+
authorized: any;
|
|
1635
1579
|
};
|
|
1636
1580
|
}>;
|
|
1637
1581
|
exportSeamlessPrivateKey({ password, apiKey }: {
|
|
@@ -1650,9 +1594,9 @@ declare class Seamless {
|
|
|
1650
1594
|
}): Promise<{
|
|
1651
1595
|
code: number;
|
|
1652
1596
|
data: {
|
|
1653
|
-
masterAddress:
|
|
1597
|
+
masterAddress: any;
|
|
1654
1598
|
seamlessAccount: string;
|
|
1655
|
-
authorized:
|
|
1599
|
+
authorized: any;
|
|
1656
1600
|
apiKey: string;
|
|
1657
1601
|
};
|
|
1658
1602
|
}>;
|
|
@@ -1672,7 +1616,7 @@ declare class Seamless {
|
|
|
1672
1616
|
data: {
|
|
1673
1617
|
masterAddress: string;
|
|
1674
1618
|
seamlessAccount: string;
|
|
1675
|
-
authorized:
|
|
1619
|
+
authorized: any;
|
|
1676
1620
|
apiKey: string;
|
|
1677
1621
|
};
|
|
1678
1622
|
message?: undefined;
|
|
@@ -1761,13 +1705,13 @@ declare class Order {
|
|
|
1761
1705
|
data: {
|
|
1762
1706
|
success: boolean;
|
|
1763
1707
|
orderId: string | null;
|
|
1764
|
-
transactionHash:
|
|
1765
|
-
blockNumber:
|
|
1766
|
-
gasUsed:
|
|
1708
|
+
transactionHash: any;
|
|
1709
|
+
blockNumber: any;
|
|
1710
|
+
gasUsed: any;
|
|
1767
1711
|
status: string;
|
|
1768
1712
|
confirmations: number;
|
|
1769
1713
|
timestamp: number;
|
|
1770
|
-
receipt:
|
|
1714
|
+
receipt: any;
|
|
1771
1715
|
};
|
|
1772
1716
|
} | {
|
|
1773
1717
|
code: number;
|
|
@@ -1789,13 +1733,13 @@ declare class Order {
|
|
|
1789
1733
|
code: number;
|
|
1790
1734
|
message: string;
|
|
1791
1735
|
data: string | null;
|
|
1792
|
-
transactionHash:
|
|
1793
|
-
blockNumber:
|
|
1794
|
-
gasUsed:
|
|
1736
|
+
transactionHash: any;
|
|
1737
|
+
blockNumber: any;
|
|
1738
|
+
gasUsed: any;
|
|
1795
1739
|
status: string;
|
|
1796
1740
|
confirmations: number;
|
|
1797
1741
|
timestamp: number;
|
|
1798
|
-
receipt:
|
|
1742
|
+
receipt: any;
|
|
1799
1743
|
} | {
|
|
1800
1744
|
code: number;
|
|
1801
1745
|
message: any;
|
|
@@ -1818,13 +1762,13 @@ declare class Order {
|
|
|
1818
1762
|
data: {
|
|
1819
1763
|
success: boolean;
|
|
1820
1764
|
orderId: string | null;
|
|
1821
|
-
transactionHash:
|
|
1822
|
-
blockNumber:
|
|
1823
|
-
gasUsed:
|
|
1765
|
+
transactionHash: any;
|
|
1766
|
+
blockNumber: any;
|
|
1767
|
+
gasUsed: any;
|
|
1824
1768
|
status: string;
|
|
1825
1769
|
confirmations: number;
|
|
1826
1770
|
timestamp: number;
|
|
1827
|
-
receipt:
|
|
1771
|
+
receipt: any;
|
|
1828
1772
|
};
|
|
1829
1773
|
} | {
|
|
1830
1774
|
code: number;
|
|
@@ -1841,13 +1785,13 @@ declare class Order {
|
|
|
1841
1785
|
data: {
|
|
1842
1786
|
success: boolean;
|
|
1843
1787
|
orderId: string | null;
|
|
1844
|
-
transactionHash:
|
|
1845
|
-
blockNumber:
|
|
1846
|
-
gasUsed:
|
|
1788
|
+
transactionHash: any;
|
|
1789
|
+
blockNumber: any;
|
|
1790
|
+
gasUsed: any;
|
|
1847
1791
|
status: string;
|
|
1848
1792
|
confirmations: number;
|
|
1849
1793
|
timestamp: number;
|
|
1850
|
-
receipt:
|
|
1794
|
+
receipt: any;
|
|
1851
1795
|
};
|
|
1852
1796
|
} | {
|
|
1853
1797
|
code: number;
|
|
@@ -1873,7 +1817,7 @@ declare class Order {
|
|
|
1873
1817
|
}>;
|
|
1874
1818
|
updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number): Promise<{
|
|
1875
1819
|
code: number;
|
|
1876
|
-
data:
|
|
1820
|
+
data: any;
|
|
1877
1821
|
message: string;
|
|
1878
1822
|
} | {
|
|
1879
1823
|
code: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AddressLike, Signer, ethers as ethers$1 } from 'ethers';
|
|
1
|
+
import { AddressLike, Signer, ethers } from 'ethers';
|
|
3
2
|
export { formatUnits, parseUnits } from 'ethers';
|
|
4
3
|
import { Options, Event } from 'reconnecting-websocket';
|
|
5
4
|
import { WalletClient } from 'viem';
|
|
@@ -49,49 +48,49 @@ interface CancelTpSLParams {
|
|
|
49
48
|
orderId: string;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<
|
|
51
|
+
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<any>;
|
|
53
52
|
|
|
54
|
-
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<
|
|
55
|
-
declare const getMarketPools: (chainId: ChainId) => Promise<
|
|
53
|
+
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<any>;
|
|
54
|
+
declare const getMarketPools: (chainId: ChainId) => Promise<any>;
|
|
56
55
|
declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bigint) => Promise<{
|
|
57
56
|
quotePool: {
|
|
58
|
-
poolToken:
|
|
59
|
-
exchangeRate:
|
|
60
|
-
poolTokenPrice:
|
|
61
|
-
poolTokenSupply:
|
|
57
|
+
poolToken: any;
|
|
58
|
+
exchangeRate: any;
|
|
59
|
+
poolTokenPrice: any;
|
|
60
|
+
poolTokenSupply: any;
|
|
62
61
|
};
|
|
63
62
|
basePool: {
|
|
64
|
-
poolToken:
|
|
65
|
-
exchangeRate:
|
|
66
|
-
poolTokenPrice:
|
|
67
|
-
poolTokenSupply:
|
|
63
|
+
poolToken: any;
|
|
64
|
+
exchangeRate: any;
|
|
65
|
+
poolTokenPrice: any;
|
|
66
|
+
poolTokenSupply: any;
|
|
68
67
|
};
|
|
69
68
|
reserveInfo: {
|
|
70
|
-
baseTotalAmount:
|
|
71
|
-
baseReservedAmount:
|
|
72
|
-
quoteTotalAmount:
|
|
73
|
-
quoteReservedAmount:
|
|
69
|
+
baseTotalAmount: any;
|
|
70
|
+
baseReservedAmount: any;
|
|
71
|
+
quoteTotalAmount: any;
|
|
72
|
+
quoteReservedAmount: any;
|
|
74
73
|
};
|
|
75
74
|
fundingInfo: {
|
|
76
|
-
nextFundingRate:
|
|
77
|
-
lastFundingFeeTracker:
|
|
78
|
-
nextEpochTime:
|
|
75
|
+
nextFundingRate: any;
|
|
76
|
+
lastFundingFeeTracker: any;
|
|
77
|
+
nextEpochTime: any;
|
|
79
78
|
};
|
|
80
79
|
ioTracker: {
|
|
81
|
-
tracker:
|
|
82
|
-
longSize:
|
|
83
|
-
shortSize:
|
|
84
|
-
poolEntryPrice:
|
|
80
|
+
tracker: any;
|
|
81
|
+
longSize: any;
|
|
82
|
+
shortSize: any;
|
|
83
|
+
poolEntryPrice: any;
|
|
85
84
|
};
|
|
86
85
|
}>;
|
|
87
86
|
|
|
88
|
-
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<
|
|
87
|
+
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<any>;
|
|
89
88
|
|
|
90
|
-
declare const addTpSl: (params: AddTpSLParams) => Promise<
|
|
89
|
+
declare const addTpSl: (params: AddTpSLParams) => Promise<any>;
|
|
91
90
|
|
|
92
|
-
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<
|
|
91
|
+
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<any>;
|
|
93
92
|
|
|
94
|
-
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<
|
|
93
|
+
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<any>;
|
|
95
94
|
|
|
96
95
|
/**
|
|
97
96
|
* Trading related types and enums
|
|
@@ -889,21 +888,21 @@ interface PreviewWithdrawDataParams {
|
|
|
889
888
|
amount: string | number;
|
|
890
889
|
}
|
|
891
890
|
|
|
892
|
-
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<
|
|
893
|
-
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
891
|
+
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<any>;
|
|
892
|
+
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
|
|
894
893
|
|
|
895
|
-
declare const deposit$1: (params: Deposit) => Promise<
|
|
894
|
+
declare const deposit$1: (params: Deposit) => Promise<any>;
|
|
896
895
|
|
|
897
|
-
declare const withdraw$1: (params: WithdrawParams) => Promise<
|
|
896
|
+
declare const withdraw$1: (params: WithdrawParams) => Promise<any>;
|
|
898
897
|
|
|
899
|
-
declare const getRewards$1: (params: RewardsParams) => Promise<
|
|
898
|
+
declare const getRewards$1: (params: RewardsParams) => Promise<any>;
|
|
900
899
|
|
|
901
900
|
declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
|
|
902
|
-
baseAmountOut:
|
|
903
|
-
rebateAmount:
|
|
901
|
+
baseAmountOut: any;
|
|
902
|
+
rebateAmount: any;
|
|
904
903
|
} | undefined>;
|
|
905
904
|
|
|
906
|
-
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<
|
|
905
|
+
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<any>;
|
|
907
906
|
|
|
908
907
|
declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
|
|
909
908
|
declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
|
|
@@ -912,18 +911,18 @@ declare namespace index$2 {
|
|
|
912
911
|
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 };
|
|
913
912
|
}
|
|
914
913
|
|
|
915
|
-
declare const deposit: (params: Deposit) => Promise<
|
|
914
|
+
declare const deposit: (params: Deposit) => Promise<any>;
|
|
916
915
|
|
|
917
|
-
declare const withdraw: (params: WithdrawParams) => Promise<
|
|
916
|
+
declare const withdraw: (params: WithdrawParams) => Promise<any>;
|
|
918
917
|
|
|
919
|
-
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<
|
|
918
|
+
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<any>;
|
|
920
919
|
|
|
921
|
-
declare const getRewards: (params: RewardsParams) => Promise<
|
|
920
|
+
declare const getRewards: (params: RewardsParams) => Promise<any>;
|
|
922
921
|
|
|
923
|
-
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<
|
|
924
|
-
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
922
|
+
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<any>;
|
|
923
|
+
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
|
|
925
924
|
|
|
926
|
-
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<
|
|
925
|
+
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<any>;
|
|
927
926
|
|
|
928
927
|
declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
|
|
929
928
|
declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
|
|
@@ -936,16 +935,9 @@ declare namespace index$1 {
|
|
|
936
935
|
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 };
|
|
937
936
|
}
|
|
938
937
|
|
|
939
|
-
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<
|
|
940
|
-
quoteToken: string;
|
|
941
|
-
baseReserveRatio: bigint;
|
|
942
|
-
quoteReserveRatio: bigint;
|
|
943
|
-
oracleFeeUsd: bigint;
|
|
944
|
-
oracleRefundFeeUsd: bigint;
|
|
945
|
-
poolPrimeThreshold: bigint;
|
|
946
|
-
}) | undefined>;
|
|
938
|
+
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<any>;
|
|
947
939
|
|
|
948
|
-
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<
|
|
940
|
+
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<any>;
|
|
949
941
|
|
|
950
942
|
declare const index_getMarket: typeof getMarket;
|
|
951
943
|
declare const index_getOracleFee: typeof getOracleFee;
|
|
@@ -988,9 +980,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
|
|
|
988
980
|
declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
|
|
989
981
|
balance?: number | undefined;
|
|
990
982
|
address: string;
|
|
991
|
-
name:
|
|
992
|
-
symbol:
|
|
993
|
-
decimals:
|
|
983
|
+
name: any;
|
|
984
|
+
symbol: any;
|
|
985
|
+
decimals: any;
|
|
994
986
|
icon: string;
|
|
995
987
|
totalSupply: number;
|
|
996
988
|
}>;
|
|
@@ -1204,7 +1196,7 @@ interface MyxClientConfig {
|
|
|
1204
1196
|
signer?: Signer;
|
|
1205
1197
|
seamlessAccount?: {
|
|
1206
1198
|
masterAddress: string;
|
|
1207
|
-
wallet: ethers
|
|
1199
|
+
wallet: ethers.Wallet | null;
|
|
1208
1200
|
authorized: boolean;
|
|
1209
1201
|
};
|
|
1210
1202
|
walletClient?: WalletClient;
|
|
@@ -1224,7 +1216,7 @@ declare class ConfigManager {
|
|
|
1224
1216
|
clear(): void;
|
|
1225
1217
|
startSeamlessMode(open: boolean): MyxClientConfig;
|
|
1226
1218
|
updateSeamlessWallet({ wallet, authorized, masterAddress }: {
|
|
1227
|
-
wallet?: ethers
|
|
1219
|
+
wallet?: ethers.Wallet;
|
|
1228
1220
|
authorized?: boolean;
|
|
1229
1221
|
masterAddress?: string;
|
|
1230
1222
|
}): void;
|
|
@@ -1320,6 +1312,15 @@ declare class SubScription {
|
|
|
1320
1312
|
off<K extends keyof WebSocketEvents>(event: K, handler: (data: WebSocketEvents[K]) => void): void;
|
|
1321
1313
|
}
|
|
1322
1314
|
|
|
1315
|
+
interface PoolSymbolAllResponse {
|
|
1316
|
+
chainId: number;
|
|
1317
|
+
marketId: string;
|
|
1318
|
+
poolId: string;
|
|
1319
|
+
baseSymbol: string;
|
|
1320
|
+
quoteSymbol: string;
|
|
1321
|
+
baseTokenIcon: string;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1323
1324
|
declare class Utils {
|
|
1324
1325
|
private configManager;
|
|
1325
1326
|
private logger;
|
|
@@ -1332,7 +1333,7 @@ declare class Utils {
|
|
|
1332
1333
|
quoteAddress: string;
|
|
1333
1334
|
amount?: string;
|
|
1334
1335
|
spenderAddress?: string;
|
|
1335
|
-
signer?: ethers
|
|
1336
|
+
signer?: ethers.Signer;
|
|
1336
1337
|
}): Promise<{
|
|
1337
1338
|
code: number;
|
|
1338
1339
|
message: any;
|
|
@@ -1375,68 +1376,7 @@ declare class Utils {
|
|
|
1375
1376
|
marketPrice: string;
|
|
1376
1377
|
}): Promise<{
|
|
1377
1378
|
code: number;
|
|
1378
|
-
data:
|
|
1379
|
-
poolToken: string;
|
|
1380
|
-
exchangeRate: bigint;
|
|
1381
|
-
poolTokenPrice: bigint;
|
|
1382
|
-
poolTokenSupply: bigint;
|
|
1383
|
-
}, [string, bigint, bigint, bigint] & {
|
|
1384
|
-
poolToken: string;
|
|
1385
|
-
exchangeRate: bigint;
|
|
1386
|
-
poolTokenPrice: bigint;
|
|
1387
|
-
poolTokenSupply: bigint;
|
|
1388
|
-
}, [bigint, bigint, bigint, bigint] & {
|
|
1389
|
-
baseTotalAmount: bigint;
|
|
1390
|
-
baseReservedAmount: bigint;
|
|
1391
|
-
quoteTotalAmount: bigint;
|
|
1392
|
-
quoteReservedAmount: bigint;
|
|
1393
|
-
}, [bigint, bigint, bigint] & {
|
|
1394
|
-
nextFundingRate: bigint;
|
|
1395
|
-
lastFundingFeeTracker: bigint;
|
|
1396
|
-
nextEpochTime: bigint;
|
|
1397
|
-
}, [bigint, bigint, bigint, bigint] & {
|
|
1398
|
-
tracker: bigint;
|
|
1399
|
-
longSize: bigint;
|
|
1400
|
-
shortSize: bigint;
|
|
1401
|
-
poolEntryPrice: bigint;
|
|
1402
|
-
}, [bigint, bigint] & {
|
|
1403
|
-
windowCaps: bigint;
|
|
1404
|
-
openInterest: bigint;
|
|
1405
|
-
}] & {
|
|
1406
|
-
basePool: [string, bigint, bigint, bigint] & {
|
|
1407
|
-
poolToken: string;
|
|
1408
|
-
exchangeRate: bigint;
|
|
1409
|
-
poolTokenPrice: bigint;
|
|
1410
|
-
poolTokenSupply: bigint;
|
|
1411
|
-
};
|
|
1412
|
-
quotePool: [string, bigint, bigint, bigint] & {
|
|
1413
|
-
poolToken: string;
|
|
1414
|
-
exchangeRate: bigint;
|
|
1415
|
-
poolTokenPrice: bigint;
|
|
1416
|
-
poolTokenSupply: bigint;
|
|
1417
|
-
};
|
|
1418
|
-
reserveInfo: [bigint, bigint, bigint, bigint] & {
|
|
1419
|
-
baseTotalAmount: bigint;
|
|
1420
|
-
baseReservedAmount: bigint;
|
|
1421
|
-
quoteTotalAmount: bigint;
|
|
1422
|
-
quoteReservedAmount: bigint;
|
|
1423
|
-
};
|
|
1424
|
-
fundingInfo: [bigint, bigint, bigint] & {
|
|
1425
|
-
nextFundingRate: bigint;
|
|
1426
|
-
lastFundingFeeTracker: bigint;
|
|
1427
|
-
nextEpochTime: bigint;
|
|
1428
|
-
};
|
|
1429
|
-
oi: [bigint, bigint, bigint, bigint] & {
|
|
1430
|
-
tracker: bigint;
|
|
1431
|
-
longSize: bigint;
|
|
1432
|
-
shortSize: bigint;
|
|
1433
|
-
poolEntryPrice: bigint;
|
|
1434
|
-
};
|
|
1435
|
-
liquidityInfo: [bigint, bigint] & {
|
|
1436
|
-
windowCaps: bigint;
|
|
1437
|
-
openInterest: bigint;
|
|
1438
|
-
};
|
|
1439
|
-
};
|
|
1379
|
+
data: any;
|
|
1440
1380
|
message?: undefined;
|
|
1441
1381
|
} | {
|
|
1442
1382
|
code: number;
|
|
@@ -1454,10 +1394,10 @@ declare class Markets {
|
|
|
1454
1394
|
/**
|
|
1455
1395
|
* kline start
|
|
1456
1396
|
*/
|
|
1457
|
-
getKlineList({ interval, ...params }: Pick<GetKlineDataParams, "poolId" | "limit" | "endTime" |
|
|
1397
|
+
getKlineList({ interval, ...params }: Pick<GetKlineDataParams, "poolId" | "limit" | "endTime" | "chainId"> & {
|
|
1458
1398
|
interval: KlineResolution;
|
|
1459
1399
|
}): Promise<KlineDataItemType[]>;
|
|
1460
|
-
getKlineLatestBar({ interval, ...params }: Pick<GetKlineDataParams, "poolId" | "limit" | "endTime" |
|
|
1400
|
+
getKlineLatestBar({ interval, ...params }: Pick<GetKlineDataParams, "poolId" | "limit" | "endTime" | "chainId"> & {
|
|
1461
1401
|
interval: KlineResolution;
|
|
1462
1402
|
}): Promise<KlineDataItemType>;
|
|
1463
1403
|
/**
|
|
@@ -1498,6 +1438,10 @@ declare class Markets {
|
|
|
1498
1438
|
* get market detail
|
|
1499
1439
|
*/
|
|
1500
1440
|
getMarketDetail(params: GetMarketDetailParams): Promise<MarketDetailResponse>;
|
|
1441
|
+
/**
|
|
1442
|
+
* get pool symbol all
|
|
1443
|
+
*/
|
|
1444
|
+
getPoolSymbolAll(): Promise<PoolSymbolAllResponse[]>;
|
|
1501
1445
|
}
|
|
1502
1446
|
|
|
1503
1447
|
declare class Account {
|
|
@@ -1590,9 +1534,9 @@ declare class Seamless {
|
|
|
1590
1534
|
private utils;
|
|
1591
1535
|
private account;
|
|
1592
1536
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
|
|
1593
|
-
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<
|
|
1537
|
+
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<any>;
|
|
1594
1538
|
getUSDPermitParams(deadline: number, chainId: number): Promise<{
|
|
1595
|
-
token: string | ethers
|
|
1539
|
+
token: string | ethers.Addressable;
|
|
1596
1540
|
owner: string;
|
|
1597
1541
|
spender: string;
|
|
1598
1542
|
value: bigint;
|
|
@@ -1609,7 +1553,7 @@ declare class Seamless {
|
|
|
1609
1553
|
deadline: number;
|
|
1610
1554
|
data: string;
|
|
1611
1555
|
nonce: string;
|
|
1612
|
-
}, chainId: number, provider?: ethers
|
|
1556
|
+
}, chainId: number, provider?: ethers.Signer): Promise<ApiResponse<any>>;
|
|
1613
1557
|
authorizeSeamlessAccount({ approve, seamlessAddress, chainId }: {
|
|
1614
1558
|
approve: boolean;
|
|
1615
1559
|
seamlessAddress: string;
|
|
@@ -1631,7 +1575,7 @@ declare class Seamless {
|
|
|
1631
1575
|
data: {
|
|
1632
1576
|
masterAddress: string;
|
|
1633
1577
|
seamlessAccount: string;
|
|
1634
|
-
authorized:
|
|
1578
|
+
authorized: any;
|
|
1635
1579
|
};
|
|
1636
1580
|
}>;
|
|
1637
1581
|
exportSeamlessPrivateKey({ password, apiKey }: {
|
|
@@ -1650,9 +1594,9 @@ declare class Seamless {
|
|
|
1650
1594
|
}): Promise<{
|
|
1651
1595
|
code: number;
|
|
1652
1596
|
data: {
|
|
1653
|
-
masterAddress:
|
|
1597
|
+
masterAddress: any;
|
|
1654
1598
|
seamlessAccount: string;
|
|
1655
|
-
authorized:
|
|
1599
|
+
authorized: any;
|
|
1656
1600
|
apiKey: string;
|
|
1657
1601
|
};
|
|
1658
1602
|
}>;
|
|
@@ -1672,7 +1616,7 @@ declare class Seamless {
|
|
|
1672
1616
|
data: {
|
|
1673
1617
|
masterAddress: string;
|
|
1674
1618
|
seamlessAccount: string;
|
|
1675
|
-
authorized:
|
|
1619
|
+
authorized: any;
|
|
1676
1620
|
apiKey: string;
|
|
1677
1621
|
};
|
|
1678
1622
|
message?: undefined;
|
|
@@ -1761,13 +1705,13 @@ declare class Order {
|
|
|
1761
1705
|
data: {
|
|
1762
1706
|
success: boolean;
|
|
1763
1707
|
orderId: string | null;
|
|
1764
|
-
transactionHash:
|
|
1765
|
-
blockNumber:
|
|
1766
|
-
gasUsed:
|
|
1708
|
+
transactionHash: any;
|
|
1709
|
+
blockNumber: any;
|
|
1710
|
+
gasUsed: any;
|
|
1767
1711
|
status: string;
|
|
1768
1712
|
confirmations: number;
|
|
1769
1713
|
timestamp: number;
|
|
1770
|
-
receipt:
|
|
1714
|
+
receipt: any;
|
|
1771
1715
|
};
|
|
1772
1716
|
} | {
|
|
1773
1717
|
code: number;
|
|
@@ -1789,13 +1733,13 @@ declare class Order {
|
|
|
1789
1733
|
code: number;
|
|
1790
1734
|
message: string;
|
|
1791
1735
|
data: string | null;
|
|
1792
|
-
transactionHash:
|
|
1793
|
-
blockNumber:
|
|
1794
|
-
gasUsed:
|
|
1736
|
+
transactionHash: any;
|
|
1737
|
+
blockNumber: any;
|
|
1738
|
+
gasUsed: any;
|
|
1795
1739
|
status: string;
|
|
1796
1740
|
confirmations: number;
|
|
1797
1741
|
timestamp: number;
|
|
1798
|
-
receipt:
|
|
1742
|
+
receipt: any;
|
|
1799
1743
|
} | {
|
|
1800
1744
|
code: number;
|
|
1801
1745
|
message: any;
|
|
@@ -1818,13 +1762,13 @@ declare class Order {
|
|
|
1818
1762
|
data: {
|
|
1819
1763
|
success: boolean;
|
|
1820
1764
|
orderId: string | null;
|
|
1821
|
-
transactionHash:
|
|
1822
|
-
blockNumber:
|
|
1823
|
-
gasUsed:
|
|
1765
|
+
transactionHash: any;
|
|
1766
|
+
blockNumber: any;
|
|
1767
|
+
gasUsed: any;
|
|
1824
1768
|
status: string;
|
|
1825
1769
|
confirmations: number;
|
|
1826
1770
|
timestamp: number;
|
|
1827
|
-
receipt:
|
|
1771
|
+
receipt: any;
|
|
1828
1772
|
};
|
|
1829
1773
|
} | {
|
|
1830
1774
|
code: number;
|
|
@@ -1841,13 +1785,13 @@ declare class Order {
|
|
|
1841
1785
|
data: {
|
|
1842
1786
|
success: boolean;
|
|
1843
1787
|
orderId: string | null;
|
|
1844
|
-
transactionHash:
|
|
1845
|
-
blockNumber:
|
|
1846
|
-
gasUsed:
|
|
1788
|
+
transactionHash: any;
|
|
1789
|
+
blockNumber: any;
|
|
1790
|
+
gasUsed: any;
|
|
1847
1791
|
status: string;
|
|
1848
1792
|
confirmations: number;
|
|
1849
1793
|
timestamp: number;
|
|
1850
|
-
receipt:
|
|
1794
|
+
receipt: any;
|
|
1851
1795
|
};
|
|
1852
1796
|
} | {
|
|
1853
1797
|
code: number;
|
|
@@ -1873,7 +1817,7 @@ declare class Order {
|
|
|
1873
1817
|
}>;
|
|
1874
1818
|
updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number): Promise<{
|
|
1875
1819
|
code: number;
|
|
1876
|
-
data:
|
|
1820
|
+
data: any;
|
|
1877
1821
|
message: string;
|
|
1878
1822
|
} | {
|
|
1879
1823
|
code: number;
|
package/dist/index.js
CHANGED
|
@@ -1821,7 +1821,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
|
|
|
1821
1821
|
// package.json
|
|
1822
1822
|
var package_default = {
|
|
1823
1823
|
name: "@myx-trade/sdk",
|
|
1824
|
-
version: "0.1.
|
|
1824
|
+
version: "0.1.177",
|
|
1825
1825
|
private: false,
|
|
1826
1826
|
publishConfig: {
|
|
1827
1827
|
access: "public"
|
|
@@ -13987,6 +13987,18 @@ var ConfigManager = class {
|
|
|
13987
13987
|
}
|
|
13988
13988
|
};
|
|
13989
13989
|
|
|
13990
|
+
// src/api/pool/index.ts
|
|
13991
|
+
var getPoolList = async () => {
|
|
13992
|
+
return http.get(
|
|
13993
|
+
`${baseUrl}/openapi/gateway/scan/market/list`
|
|
13994
|
+
);
|
|
13995
|
+
};
|
|
13996
|
+
var getPoolSymbolAll = async () => {
|
|
13997
|
+
return http.get(
|
|
13998
|
+
`${baseUrl}/openapi/gateway/scan/pools`
|
|
13999
|
+
);
|
|
14000
|
+
};
|
|
14001
|
+
|
|
13990
14002
|
// src/manager/markets/index.ts
|
|
13991
14003
|
var Markets = class {
|
|
13992
14004
|
constructor(configManager, utils) {
|
|
@@ -14122,6 +14134,12 @@ var Markets = class {
|
|
|
14122
14134
|
async getMarketDetail(params) {
|
|
14123
14135
|
return (await getMarketDetail(params)).data;
|
|
14124
14136
|
}
|
|
14137
|
+
/**
|
|
14138
|
+
* get pool symbol all
|
|
14139
|
+
*/
|
|
14140
|
+
async getPoolSymbolAll() {
|
|
14141
|
+
return (await getPoolSymbolAll()).data;
|
|
14142
|
+
}
|
|
14125
14143
|
};
|
|
14126
14144
|
|
|
14127
14145
|
// src/manager/position/index.ts
|
|
@@ -14209,9 +14227,8 @@ var Position = class {
|
|
|
14209
14227
|
}
|
|
14210
14228
|
const authorized = this.configManager.getConfig().seamlessAccount?.authorized;
|
|
14211
14229
|
const seamlessWallet = this.configManager.getConfig().seamlessAccount?.wallet;
|
|
14212
|
-
const networkFee = await this.utils.getNetworkFee(quoteToken, chainId);
|
|
14213
14230
|
let depositAmount = BigInt(0);
|
|
14214
|
-
const used = BigInt(
|
|
14231
|
+
const used = BigInt(adjustAmount) > 0 ? BigInt(adjustAmount) : 0n;
|
|
14215
14232
|
const availableAccountMarginBalance = await this.account.getAvailableMarginBalance({ poolId, chainId, address });
|
|
14216
14233
|
let diff = BigInt(0);
|
|
14217
14234
|
if (availableAccountMarginBalance < used) {
|
|
@@ -14402,21 +14419,16 @@ var Order = class {
|
|
|
14402
14419
|
);
|
|
14403
14420
|
const totalCollateralAmount = BigInt(params.collateralAmount) + BigInt(tradingFee);
|
|
14404
14421
|
const availableAccountMarginBalance = await this.account.getAvailableMarginBalance({ poolId: params.poolId, chainId: params.chainId, address: params.address });
|
|
14405
|
-
this.logger.info("createIncreaseOrder availableAccountMarginBalance-->", availableAccountMarginBalance);
|
|
14406
14422
|
const needAmount = totalCollateralAmount + totalNetWorkFee;
|
|
14407
|
-
this.logger.info("createIncreaseOrder needAmount-->", needAmount);
|
|
14408
14423
|
let depositAmount = BigInt(0);
|
|
14409
14424
|
const diff = needAmount - availableAccountMarginBalance;
|
|
14410
|
-
this.logger.info("createIncreaseOrder diff-->", diff);
|
|
14411
14425
|
if (diff > BigInt(0)) {
|
|
14412
14426
|
depositAmount = diff;
|
|
14413
14427
|
}
|
|
14414
|
-
this.logger.info("createIncreaseOrder depositAmount-->", depositAmount);
|
|
14415
14428
|
const depositData = {
|
|
14416
14429
|
token: params.executionFeeToken,
|
|
14417
14430
|
amount: depositAmount.toString()
|
|
14418
14431
|
};
|
|
14419
|
-
this.logger.info("createIncreaseOrder depositData-->", depositData);
|
|
14420
14432
|
const data = {
|
|
14421
14433
|
user: params.address,
|
|
14422
14434
|
poolId: params.poolId,
|
|
@@ -21075,13 +21087,6 @@ var Account_default = [
|
|
|
21075
21087
|
|
|
21076
21088
|
// src/manager/account/index.ts
|
|
21077
21089
|
var import_dayjs3 = __toESM(require("dayjs"));
|
|
21078
|
-
|
|
21079
|
-
// src/api/pool/index.ts
|
|
21080
|
-
var getPoolList = async () => {
|
|
21081
|
-
return http.get(`${baseUrl}/openapi/gateway/scan/market/list`);
|
|
21082
|
-
};
|
|
21083
|
-
|
|
21084
|
-
// src/manager/account/index.ts
|
|
21085
21090
|
var Account = class {
|
|
21086
21091
|
constructor(configManager, logger, utils, client2) {
|
|
21087
21092
|
this.configManager = configManager;
|
package/dist/index.mjs
CHANGED
|
@@ -1731,7 +1731,7 @@ var RotationProvider = class extends BaseProvider {
|
|
|
1731
1731
|
// package.json
|
|
1732
1732
|
var package_default = {
|
|
1733
1733
|
name: "@myx-trade/sdk",
|
|
1734
|
-
version: "0.1.
|
|
1734
|
+
version: "0.1.177",
|
|
1735
1735
|
private: false,
|
|
1736
1736
|
publishConfig: {
|
|
1737
1737
|
access: "public"
|
|
@@ -13897,6 +13897,18 @@ var ConfigManager = class {
|
|
|
13897
13897
|
}
|
|
13898
13898
|
};
|
|
13899
13899
|
|
|
13900
|
+
// src/api/pool/index.ts
|
|
13901
|
+
var getPoolList = async () => {
|
|
13902
|
+
return http.get(
|
|
13903
|
+
`${baseUrl}/openapi/gateway/scan/market/list`
|
|
13904
|
+
);
|
|
13905
|
+
};
|
|
13906
|
+
var getPoolSymbolAll = async () => {
|
|
13907
|
+
return http.get(
|
|
13908
|
+
`${baseUrl}/openapi/gateway/scan/pools`
|
|
13909
|
+
);
|
|
13910
|
+
};
|
|
13911
|
+
|
|
13900
13912
|
// src/manager/markets/index.ts
|
|
13901
13913
|
var Markets = class {
|
|
13902
13914
|
constructor(configManager, utils) {
|
|
@@ -14032,6 +14044,12 @@ var Markets = class {
|
|
|
14032
14044
|
async getMarketDetail(params) {
|
|
14033
14045
|
return (await getMarketDetail(params)).data;
|
|
14034
14046
|
}
|
|
14047
|
+
/**
|
|
14048
|
+
* get pool symbol all
|
|
14049
|
+
*/
|
|
14050
|
+
async getPoolSymbolAll() {
|
|
14051
|
+
return (await getPoolSymbolAll()).data;
|
|
14052
|
+
}
|
|
14035
14053
|
};
|
|
14036
14054
|
|
|
14037
14055
|
// src/manager/position/index.ts
|
|
@@ -14119,9 +14137,8 @@ var Position = class {
|
|
|
14119
14137
|
}
|
|
14120
14138
|
const authorized = this.configManager.getConfig().seamlessAccount?.authorized;
|
|
14121
14139
|
const seamlessWallet = this.configManager.getConfig().seamlessAccount?.wallet;
|
|
14122
|
-
const networkFee = await this.utils.getNetworkFee(quoteToken, chainId);
|
|
14123
14140
|
let depositAmount = BigInt(0);
|
|
14124
|
-
const used = BigInt(
|
|
14141
|
+
const used = BigInt(adjustAmount) > 0 ? BigInt(adjustAmount) : 0n;
|
|
14125
14142
|
const availableAccountMarginBalance = await this.account.getAvailableMarginBalance({ poolId, chainId, address });
|
|
14126
14143
|
let diff = BigInt(0);
|
|
14127
14144
|
if (availableAccountMarginBalance < used) {
|
|
@@ -14312,21 +14329,16 @@ var Order = class {
|
|
|
14312
14329
|
);
|
|
14313
14330
|
const totalCollateralAmount = BigInt(params.collateralAmount) + BigInt(tradingFee);
|
|
14314
14331
|
const availableAccountMarginBalance = await this.account.getAvailableMarginBalance({ poolId: params.poolId, chainId: params.chainId, address: params.address });
|
|
14315
|
-
this.logger.info("createIncreaseOrder availableAccountMarginBalance-->", availableAccountMarginBalance);
|
|
14316
14332
|
const needAmount = totalCollateralAmount + totalNetWorkFee;
|
|
14317
|
-
this.logger.info("createIncreaseOrder needAmount-->", needAmount);
|
|
14318
14333
|
let depositAmount = BigInt(0);
|
|
14319
14334
|
const diff = needAmount - availableAccountMarginBalance;
|
|
14320
|
-
this.logger.info("createIncreaseOrder diff-->", diff);
|
|
14321
14335
|
if (diff > BigInt(0)) {
|
|
14322
14336
|
depositAmount = diff;
|
|
14323
14337
|
}
|
|
14324
|
-
this.logger.info("createIncreaseOrder depositAmount-->", depositAmount);
|
|
14325
14338
|
const depositData = {
|
|
14326
14339
|
token: params.executionFeeToken,
|
|
14327
14340
|
amount: depositAmount.toString()
|
|
14328
14341
|
};
|
|
14329
|
-
this.logger.info("createIncreaseOrder depositData-->", depositData);
|
|
14330
14342
|
const data = {
|
|
14331
14343
|
user: params.address,
|
|
14332
14344
|
poolId: params.poolId,
|
|
@@ -20985,13 +20997,6 @@ var Account_default = [
|
|
|
20985
20997
|
|
|
20986
20998
|
// src/manager/account/index.ts
|
|
20987
20999
|
import dayjs3 from "dayjs";
|
|
20988
|
-
|
|
20989
|
-
// src/api/pool/index.ts
|
|
20990
|
-
var getPoolList = async () => {
|
|
20991
|
-
return http.get(`${baseUrl}/openapi/gateway/scan/market/list`);
|
|
20992
|
-
};
|
|
20993
|
-
|
|
20994
|
-
// src/manager/account/index.ts
|
|
20995
21000
|
var Account = class {
|
|
20996
21001
|
constructor(configManager, logger, utils, client2) {
|
|
20997
21002
|
this.configManager = configManager;
|