@myx-trade/sdk 0.1.94 → 0.1.96
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 +82 -73
- package/dist/index.d.ts +82 -73
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as ethers from 'ethers';
|
|
2
|
+
import { AddressLike, Signer, ethers as ethers$1 } from 'ethers';
|
|
2
3
|
export { formatUnits, parseUnits } from 'ethers';
|
|
3
4
|
import { Options, Event } from 'reconnecting-websocket';
|
|
4
5
|
import { WalletClient } from 'viem';
|
|
@@ -48,49 +49,49 @@ interface CancelTpSLParams {
|
|
|
48
49
|
orderId: string;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<
|
|
52
|
+
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<string | undefined>;
|
|
52
53
|
|
|
53
|
-
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<
|
|
54
|
-
declare const getMarketPools: (chainId: ChainId) => Promise<
|
|
54
|
+
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<string | undefined>;
|
|
55
|
+
declare const getMarketPools: (chainId: ChainId) => Promise<string[]>;
|
|
55
56
|
declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bigint) => Promise<{
|
|
56
57
|
quotePool: {
|
|
57
|
-
poolToken:
|
|
58
|
-
exchangeRate:
|
|
59
|
-
poolTokenPrice:
|
|
60
|
-
poolTokenSupply:
|
|
58
|
+
poolToken: string;
|
|
59
|
+
exchangeRate: bigint;
|
|
60
|
+
poolTokenPrice: bigint;
|
|
61
|
+
poolTokenSupply: bigint;
|
|
61
62
|
};
|
|
62
63
|
basePool: {
|
|
63
|
-
poolToken:
|
|
64
|
-
exchangeRate:
|
|
65
|
-
poolTokenPrice:
|
|
66
|
-
poolTokenSupply:
|
|
64
|
+
poolToken: string;
|
|
65
|
+
exchangeRate: bigint;
|
|
66
|
+
poolTokenPrice: bigint;
|
|
67
|
+
poolTokenSupply: bigint;
|
|
67
68
|
};
|
|
68
69
|
reserveInfo: {
|
|
69
|
-
baseTotalAmount:
|
|
70
|
-
baseReservedAmount:
|
|
71
|
-
quoteTotalAmount:
|
|
72
|
-
quoteReservedAmount:
|
|
70
|
+
baseTotalAmount: bigint;
|
|
71
|
+
baseReservedAmount: bigint;
|
|
72
|
+
quoteTotalAmount: bigint;
|
|
73
|
+
quoteReservedAmount: bigint;
|
|
73
74
|
};
|
|
74
75
|
fundingInfo: {
|
|
75
|
-
nextFundingRate:
|
|
76
|
-
lastFundingFeeTracker:
|
|
77
|
-
nextEpochTime:
|
|
76
|
+
nextFundingRate: bigint;
|
|
77
|
+
lastFundingFeeTracker: bigint;
|
|
78
|
+
nextEpochTime: bigint;
|
|
78
79
|
};
|
|
79
80
|
ioTracker: {
|
|
80
|
-
tracker:
|
|
81
|
-
longSize:
|
|
82
|
-
shortSize:
|
|
83
|
-
poolEntryPrice:
|
|
81
|
+
tracker: bigint;
|
|
82
|
+
longSize: bigint;
|
|
83
|
+
shortSize: bigint;
|
|
84
|
+
poolEntryPrice: bigint;
|
|
84
85
|
};
|
|
85
86
|
}>;
|
|
86
87
|
|
|
87
|
-
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<
|
|
88
|
+
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<bigint>;
|
|
88
89
|
|
|
89
|
-
declare const addTpSl: (params: AddTpSLParams) => Promise<
|
|
90
|
+
declare const addTpSl: (params: AddTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
90
91
|
|
|
91
|
-
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<
|
|
92
|
+
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
92
93
|
|
|
93
|
-
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<
|
|
94
|
+
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
94
95
|
|
|
95
96
|
/**
|
|
96
97
|
* Trading related types and enums
|
|
@@ -879,21 +880,21 @@ interface PreviewWithdrawDataParams {
|
|
|
879
880
|
amount: string | number;
|
|
880
881
|
}
|
|
881
882
|
|
|
882
|
-
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<
|
|
883
|
-
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
883
|
+
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
884
|
+
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
884
885
|
|
|
885
|
-
declare const deposit$1: (params: Deposit) => Promise<
|
|
886
|
+
declare const deposit$1: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
886
887
|
|
|
887
|
-
declare const withdraw$1: (params: WithdrawParams) => Promise<
|
|
888
|
+
declare const withdraw$1: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
|
|
888
889
|
|
|
889
|
-
declare const getRewards$1: (params: RewardsParams) => Promise<
|
|
890
|
+
declare const getRewards$1: (params: RewardsParams) => Promise<bigint | undefined>;
|
|
890
891
|
|
|
891
892
|
declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
|
|
892
|
-
baseAmountOut:
|
|
893
|
-
rebateAmount:
|
|
893
|
+
baseAmountOut: bigint;
|
|
894
|
+
rebateAmount: bigint;
|
|
894
895
|
} | undefined>;
|
|
895
896
|
|
|
896
|
-
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<
|
|
897
|
+
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
|
|
897
898
|
|
|
898
899
|
declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
|
|
899
900
|
declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
|
|
@@ -902,18 +903,18 @@ declare namespace index$2 {
|
|
|
902
903
|
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 };
|
|
903
904
|
}
|
|
904
905
|
|
|
905
|
-
declare const deposit: (params: Deposit) => Promise<
|
|
906
|
+
declare const deposit: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
906
907
|
|
|
907
|
-
declare const withdraw: (params: WithdrawParams) => Promise<
|
|
908
|
+
declare const withdraw: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
|
|
908
909
|
|
|
909
|
-
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<
|
|
910
|
+
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<ethers.ContractTransactionResponse | null>;
|
|
910
911
|
|
|
911
|
-
declare const getRewards: (params: RewardsParams) => Promise<
|
|
912
|
+
declare const getRewards: (params: RewardsParams) => Promise<bigint | undefined>;
|
|
912
913
|
|
|
913
|
-
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<
|
|
914
|
-
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
914
|
+
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
915
|
+
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
915
916
|
|
|
916
|
-
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<
|
|
917
|
+
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
|
|
917
918
|
|
|
918
919
|
declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
|
|
919
920
|
declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
|
|
@@ -926,9 +927,17 @@ declare namespace index$1 {
|
|
|
926
927
|
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 };
|
|
927
928
|
}
|
|
928
929
|
|
|
929
|
-
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<
|
|
930
|
+
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, string, bigint, bigint, bigint, bigint, bigint] & {
|
|
931
|
+
marketId: string;
|
|
932
|
+
quoteToken: string;
|
|
933
|
+
baseReserveRatio: bigint;
|
|
934
|
+
quoteReserveRatio: bigint;
|
|
935
|
+
oracleFeeUsd: bigint;
|
|
936
|
+
oracleRefundFeeUsd: bigint;
|
|
937
|
+
poolPrimeThreshold: bigint;
|
|
938
|
+
}) | undefined>;
|
|
930
939
|
|
|
931
|
-
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<
|
|
940
|
+
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<bigint | undefined>;
|
|
932
941
|
|
|
933
942
|
declare const index_getMarket: typeof getMarket;
|
|
934
943
|
declare const index_getOracleFee: typeof getOracleFee;
|
|
@@ -971,9 +980,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
|
|
|
971
980
|
declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
|
|
972
981
|
balance?: number | undefined;
|
|
973
982
|
address: string;
|
|
974
|
-
name:
|
|
975
|
-
symbol:
|
|
976
|
-
decimals:
|
|
983
|
+
name: string;
|
|
984
|
+
symbol: string;
|
|
985
|
+
decimals: bigint;
|
|
977
986
|
icon: string;
|
|
978
987
|
totalSupply: number;
|
|
979
988
|
}>;
|
|
@@ -1187,7 +1196,7 @@ interface MyxClientConfig {
|
|
|
1187
1196
|
signer?: Signer;
|
|
1188
1197
|
seamlessAccount?: {
|
|
1189
1198
|
masterAddress: string;
|
|
1190
|
-
wallet: ethers.Wallet | null;
|
|
1199
|
+
wallet: ethers$1.Wallet | null;
|
|
1191
1200
|
authorized: boolean;
|
|
1192
1201
|
};
|
|
1193
1202
|
walletClient?: WalletClient;
|
|
@@ -1207,7 +1216,7 @@ declare class ConfigManager {
|
|
|
1207
1216
|
clear(): void;
|
|
1208
1217
|
startSeamlessMode(open: boolean): void;
|
|
1209
1218
|
updateSeamlessWallet({ wallet, authorized, masterAddress }: {
|
|
1210
|
-
wallet?: ethers.Wallet;
|
|
1219
|
+
wallet?: ethers$1.Wallet;
|
|
1211
1220
|
authorized?: boolean;
|
|
1212
1221
|
masterAddress?: string;
|
|
1213
1222
|
}): void;
|
|
@@ -1526,9 +1535,9 @@ declare class Seamless {
|
|
|
1526
1535
|
private utils;
|
|
1527
1536
|
private account;
|
|
1528
1537
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
|
|
1529
|
-
onCheckRelayer(account: string, relayer: string): Promise<
|
|
1538
|
+
onCheckRelayer(account: string, relayer: string): Promise<boolean>;
|
|
1530
1539
|
getUSDPermitParams(deadline: number): Promise<{
|
|
1531
|
-
token: string | ethers.Addressable;
|
|
1540
|
+
token: string | ethers$1.Addressable;
|
|
1532
1541
|
owner: Promise<string> | undefined;
|
|
1533
1542
|
spender: string;
|
|
1534
1543
|
value: bigint;
|
|
@@ -1545,7 +1554,7 @@ declare class Seamless {
|
|
|
1545
1554
|
deadline: number;
|
|
1546
1555
|
data: string;
|
|
1547
1556
|
nonce: string;
|
|
1548
|
-
}, provider?: ethers.Signer): Promise<ApiResponse<any>>;
|
|
1557
|
+
}, provider?: ethers$1.Signer): Promise<ApiResponse<any>>;
|
|
1549
1558
|
authorizeSeamlessAccount({ approve, seamlessAddress }: {
|
|
1550
1559
|
approve: boolean;
|
|
1551
1560
|
seamlessAddress: string;
|
|
@@ -1565,7 +1574,7 @@ declare class Seamless {
|
|
|
1565
1574
|
data: {
|
|
1566
1575
|
masterAddress: string;
|
|
1567
1576
|
seamlessAccount: string;
|
|
1568
|
-
authorized:
|
|
1577
|
+
authorized: boolean;
|
|
1569
1578
|
};
|
|
1570
1579
|
}>;
|
|
1571
1580
|
exportSeamlessPrivateKey({ password, apiKey }: {
|
|
@@ -1583,9 +1592,9 @@ declare class Seamless {
|
|
|
1583
1592
|
}): Promise<{
|
|
1584
1593
|
code: number;
|
|
1585
1594
|
data: {
|
|
1586
|
-
masterAddress:
|
|
1595
|
+
masterAddress: string;
|
|
1587
1596
|
seamlessAccount: string;
|
|
1588
|
-
authorized:
|
|
1597
|
+
authorized: boolean;
|
|
1589
1598
|
apiKey: string;
|
|
1590
1599
|
};
|
|
1591
1600
|
}>;
|
|
@@ -1604,7 +1613,7 @@ declare class Seamless {
|
|
|
1604
1613
|
data: {
|
|
1605
1614
|
masterAddress: string;
|
|
1606
1615
|
seamlessAccount: string;
|
|
1607
|
-
authorized:
|
|
1616
|
+
authorized: boolean;
|
|
1608
1617
|
apiKey: string;
|
|
1609
1618
|
};
|
|
1610
1619
|
message?: undefined;
|
|
@@ -1631,13 +1640,13 @@ declare class Order {
|
|
|
1631
1640
|
data: {
|
|
1632
1641
|
success: boolean;
|
|
1633
1642
|
orderId: string | null;
|
|
1634
|
-
transactionHash:
|
|
1635
|
-
blockNumber:
|
|
1636
|
-
gasUsed:
|
|
1643
|
+
transactionHash: string;
|
|
1644
|
+
blockNumber: number | undefined;
|
|
1645
|
+
gasUsed: string | undefined;
|
|
1637
1646
|
status: string;
|
|
1638
1647
|
confirmations: number;
|
|
1639
1648
|
timestamp: number;
|
|
1640
|
-
receipt:
|
|
1649
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1641
1650
|
};
|
|
1642
1651
|
} | {
|
|
1643
1652
|
code: number;
|
|
@@ -1648,13 +1657,13 @@ declare class Order {
|
|
|
1648
1657
|
code: number;
|
|
1649
1658
|
message: string;
|
|
1650
1659
|
data: string | null;
|
|
1651
|
-
transactionHash:
|
|
1652
|
-
blockNumber:
|
|
1653
|
-
gasUsed:
|
|
1660
|
+
transactionHash: string;
|
|
1661
|
+
blockNumber: number | undefined;
|
|
1662
|
+
gasUsed: string | undefined;
|
|
1654
1663
|
status: string;
|
|
1655
1664
|
confirmations: number;
|
|
1656
1665
|
timestamp: number;
|
|
1657
|
-
receipt:
|
|
1666
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1658
1667
|
} | {
|
|
1659
1668
|
code: number;
|
|
1660
1669
|
message: any;
|
|
@@ -1673,13 +1682,13 @@ declare class Order {
|
|
|
1673
1682
|
data: {
|
|
1674
1683
|
success: boolean;
|
|
1675
1684
|
orderId: string | null;
|
|
1676
|
-
transactionHash:
|
|
1677
|
-
blockNumber:
|
|
1678
|
-
gasUsed:
|
|
1685
|
+
transactionHash: string;
|
|
1686
|
+
blockNumber: number | undefined;
|
|
1687
|
+
gasUsed: string | undefined;
|
|
1679
1688
|
status: string;
|
|
1680
1689
|
confirmations: number;
|
|
1681
1690
|
timestamp: number;
|
|
1682
|
-
receipt:
|
|
1691
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1683
1692
|
};
|
|
1684
1693
|
} | {
|
|
1685
1694
|
code: number;
|
|
@@ -1692,13 +1701,13 @@ declare class Order {
|
|
|
1692
1701
|
data: {
|
|
1693
1702
|
success: boolean;
|
|
1694
1703
|
orderId: string | null;
|
|
1695
|
-
transactionHash:
|
|
1696
|
-
blockNumber:
|
|
1697
|
-
gasUsed:
|
|
1704
|
+
transactionHash: string;
|
|
1705
|
+
blockNumber: number | undefined;
|
|
1706
|
+
gasUsed: string | undefined;
|
|
1698
1707
|
status: string;
|
|
1699
1708
|
confirmations: number;
|
|
1700
1709
|
timestamp: number;
|
|
1701
|
-
receipt:
|
|
1710
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1702
1711
|
};
|
|
1703
1712
|
} | {
|
|
1704
1713
|
code: number;
|
|
@@ -1719,7 +1728,7 @@ declare class Order {
|
|
|
1719
1728
|
}>;
|
|
1720
1729
|
updateOrderTpSl(params: UpdateOrderParams, chainId: number): Promise<{
|
|
1721
1730
|
code: number;
|
|
1722
|
-
data:
|
|
1731
|
+
data: ethers$1.ContractTransactionReceipt | null;
|
|
1723
1732
|
message: string;
|
|
1724
1733
|
} | {
|
|
1725
1734
|
code: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as ethers from 'ethers';
|
|
2
|
+
import { AddressLike, Signer, ethers as ethers$1 } from 'ethers';
|
|
2
3
|
export { formatUnits, parseUnits } from 'ethers';
|
|
3
4
|
import { Options, Event } from 'reconnecting-websocket';
|
|
4
5
|
import { WalletClient } from 'viem';
|
|
@@ -48,49 +49,49 @@ interface CancelTpSLParams {
|
|
|
48
49
|
orderId: string;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<
|
|
52
|
+
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<string | undefined>;
|
|
52
53
|
|
|
53
|
-
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<
|
|
54
|
-
declare const getMarketPools: (chainId: ChainId) => Promise<
|
|
54
|
+
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<string | undefined>;
|
|
55
|
+
declare const getMarketPools: (chainId: ChainId) => Promise<string[]>;
|
|
55
56
|
declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bigint) => Promise<{
|
|
56
57
|
quotePool: {
|
|
57
|
-
poolToken:
|
|
58
|
-
exchangeRate:
|
|
59
|
-
poolTokenPrice:
|
|
60
|
-
poolTokenSupply:
|
|
58
|
+
poolToken: string;
|
|
59
|
+
exchangeRate: bigint;
|
|
60
|
+
poolTokenPrice: bigint;
|
|
61
|
+
poolTokenSupply: bigint;
|
|
61
62
|
};
|
|
62
63
|
basePool: {
|
|
63
|
-
poolToken:
|
|
64
|
-
exchangeRate:
|
|
65
|
-
poolTokenPrice:
|
|
66
|
-
poolTokenSupply:
|
|
64
|
+
poolToken: string;
|
|
65
|
+
exchangeRate: bigint;
|
|
66
|
+
poolTokenPrice: bigint;
|
|
67
|
+
poolTokenSupply: bigint;
|
|
67
68
|
};
|
|
68
69
|
reserveInfo: {
|
|
69
|
-
baseTotalAmount:
|
|
70
|
-
baseReservedAmount:
|
|
71
|
-
quoteTotalAmount:
|
|
72
|
-
quoteReservedAmount:
|
|
70
|
+
baseTotalAmount: bigint;
|
|
71
|
+
baseReservedAmount: bigint;
|
|
72
|
+
quoteTotalAmount: bigint;
|
|
73
|
+
quoteReservedAmount: bigint;
|
|
73
74
|
};
|
|
74
75
|
fundingInfo: {
|
|
75
|
-
nextFundingRate:
|
|
76
|
-
lastFundingFeeTracker:
|
|
77
|
-
nextEpochTime:
|
|
76
|
+
nextFundingRate: bigint;
|
|
77
|
+
lastFundingFeeTracker: bigint;
|
|
78
|
+
nextEpochTime: bigint;
|
|
78
79
|
};
|
|
79
80
|
ioTracker: {
|
|
80
|
-
tracker:
|
|
81
|
-
longSize:
|
|
82
|
-
shortSize:
|
|
83
|
-
poolEntryPrice:
|
|
81
|
+
tracker: bigint;
|
|
82
|
+
longSize: bigint;
|
|
83
|
+
shortSize: bigint;
|
|
84
|
+
poolEntryPrice: bigint;
|
|
84
85
|
};
|
|
85
86
|
}>;
|
|
86
87
|
|
|
87
|
-
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<
|
|
88
|
+
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<bigint>;
|
|
88
89
|
|
|
89
|
-
declare const addTpSl: (params: AddTpSLParams) => Promise<
|
|
90
|
+
declare const addTpSl: (params: AddTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
90
91
|
|
|
91
|
-
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<
|
|
92
|
+
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
92
93
|
|
|
93
|
-
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<
|
|
94
|
+
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
94
95
|
|
|
95
96
|
/**
|
|
96
97
|
* Trading related types and enums
|
|
@@ -879,21 +880,21 @@ interface PreviewWithdrawDataParams {
|
|
|
879
880
|
amount: string | number;
|
|
880
881
|
}
|
|
881
882
|
|
|
882
|
-
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<
|
|
883
|
-
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
883
|
+
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
884
|
+
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
884
885
|
|
|
885
|
-
declare const deposit$1: (params: Deposit) => Promise<
|
|
886
|
+
declare const deposit$1: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
886
887
|
|
|
887
|
-
declare const withdraw$1: (params: WithdrawParams) => Promise<
|
|
888
|
+
declare const withdraw$1: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
|
|
888
889
|
|
|
889
|
-
declare const getRewards$1: (params: RewardsParams) => Promise<
|
|
890
|
+
declare const getRewards$1: (params: RewardsParams) => Promise<bigint | undefined>;
|
|
890
891
|
|
|
891
892
|
declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
|
|
892
|
-
baseAmountOut:
|
|
893
|
-
rebateAmount:
|
|
893
|
+
baseAmountOut: bigint;
|
|
894
|
+
rebateAmount: bigint;
|
|
894
895
|
} | undefined>;
|
|
895
896
|
|
|
896
|
-
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<
|
|
897
|
+
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
|
|
897
898
|
|
|
898
899
|
declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
|
|
899
900
|
declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
|
|
@@ -902,18 +903,18 @@ declare namespace index$2 {
|
|
|
902
903
|
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 };
|
|
903
904
|
}
|
|
904
905
|
|
|
905
|
-
declare const deposit: (params: Deposit) => Promise<
|
|
906
|
+
declare const deposit: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
906
907
|
|
|
907
|
-
declare const withdraw: (params: WithdrawParams) => Promise<
|
|
908
|
+
declare const withdraw: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
|
|
908
909
|
|
|
909
|
-
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<
|
|
910
|
+
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<ethers.ContractTransactionResponse | null>;
|
|
910
911
|
|
|
911
|
-
declare const getRewards: (params: RewardsParams) => Promise<
|
|
912
|
+
declare const getRewards: (params: RewardsParams) => Promise<bigint | undefined>;
|
|
912
913
|
|
|
913
|
-
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<
|
|
914
|
-
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
914
|
+
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
915
|
+
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
915
916
|
|
|
916
|
-
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<
|
|
917
|
+
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
|
|
917
918
|
|
|
918
919
|
declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
|
|
919
920
|
declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
|
|
@@ -926,9 +927,17 @@ declare namespace index$1 {
|
|
|
926
927
|
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 };
|
|
927
928
|
}
|
|
928
929
|
|
|
929
|
-
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<
|
|
930
|
+
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, string, bigint, bigint, bigint, bigint, bigint] & {
|
|
931
|
+
marketId: string;
|
|
932
|
+
quoteToken: string;
|
|
933
|
+
baseReserveRatio: bigint;
|
|
934
|
+
quoteReserveRatio: bigint;
|
|
935
|
+
oracleFeeUsd: bigint;
|
|
936
|
+
oracleRefundFeeUsd: bigint;
|
|
937
|
+
poolPrimeThreshold: bigint;
|
|
938
|
+
}) | undefined>;
|
|
930
939
|
|
|
931
|
-
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<
|
|
940
|
+
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<bigint | undefined>;
|
|
932
941
|
|
|
933
942
|
declare const index_getMarket: typeof getMarket;
|
|
934
943
|
declare const index_getOracleFee: typeof getOracleFee;
|
|
@@ -971,9 +980,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
|
|
|
971
980
|
declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
|
|
972
981
|
balance?: number | undefined;
|
|
973
982
|
address: string;
|
|
974
|
-
name:
|
|
975
|
-
symbol:
|
|
976
|
-
decimals:
|
|
983
|
+
name: string;
|
|
984
|
+
symbol: string;
|
|
985
|
+
decimals: bigint;
|
|
977
986
|
icon: string;
|
|
978
987
|
totalSupply: number;
|
|
979
988
|
}>;
|
|
@@ -1187,7 +1196,7 @@ interface MyxClientConfig {
|
|
|
1187
1196
|
signer?: Signer;
|
|
1188
1197
|
seamlessAccount?: {
|
|
1189
1198
|
masterAddress: string;
|
|
1190
|
-
wallet: ethers.Wallet | null;
|
|
1199
|
+
wallet: ethers$1.Wallet | null;
|
|
1191
1200
|
authorized: boolean;
|
|
1192
1201
|
};
|
|
1193
1202
|
walletClient?: WalletClient;
|
|
@@ -1207,7 +1216,7 @@ declare class ConfigManager {
|
|
|
1207
1216
|
clear(): void;
|
|
1208
1217
|
startSeamlessMode(open: boolean): void;
|
|
1209
1218
|
updateSeamlessWallet({ wallet, authorized, masterAddress }: {
|
|
1210
|
-
wallet?: ethers.Wallet;
|
|
1219
|
+
wallet?: ethers$1.Wallet;
|
|
1211
1220
|
authorized?: boolean;
|
|
1212
1221
|
masterAddress?: string;
|
|
1213
1222
|
}): void;
|
|
@@ -1526,9 +1535,9 @@ declare class Seamless {
|
|
|
1526
1535
|
private utils;
|
|
1527
1536
|
private account;
|
|
1528
1537
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
|
|
1529
|
-
onCheckRelayer(account: string, relayer: string): Promise<
|
|
1538
|
+
onCheckRelayer(account: string, relayer: string): Promise<boolean>;
|
|
1530
1539
|
getUSDPermitParams(deadline: number): Promise<{
|
|
1531
|
-
token: string | ethers.Addressable;
|
|
1540
|
+
token: string | ethers$1.Addressable;
|
|
1532
1541
|
owner: Promise<string> | undefined;
|
|
1533
1542
|
spender: string;
|
|
1534
1543
|
value: bigint;
|
|
@@ -1545,7 +1554,7 @@ declare class Seamless {
|
|
|
1545
1554
|
deadline: number;
|
|
1546
1555
|
data: string;
|
|
1547
1556
|
nonce: string;
|
|
1548
|
-
}, provider?: ethers.Signer): Promise<ApiResponse<any>>;
|
|
1557
|
+
}, provider?: ethers$1.Signer): Promise<ApiResponse<any>>;
|
|
1549
1558
|
authorizeSeamlessAccount({ approve, seamlessAddress }: {
|
|
1550
1559
|
approve: boolean;
|
|
1551
1560
|
seamlessAddress: string;
|
|
@@ -1565,7 +1574,7 @@ declare class Seamless {
|
|
|
1565
1574
|
data: {
|
|
1566
1575
|
masterAddress: string;
|
|
1567
1576
|
seamlessAccount: string;
|
|
1568
|
-
authorized:
|
|
1577
|
+
authorized: boolean;
|
|
1569
1578
|
};
|
|
1570
1579
|
}>;
|
|
1571
1580
|
exportSeamlessPrivateKey({ password, apiKey }: {
|
|
@@ -1583,9 +1592,9 @@ declare class Seamless {
|
|
|
1583
1592
|
}): Promise<{
|
|
1584
1593
|
code: number;
|
|
1585
1594
|
data: {
|
|
1586
|
-
masterAddress:
|
|
1595
|
+
masterAddress: string;
|
|
1587
1596
|
seamlessAccount: string;
|
|
1588
|
-
authorized:
|
|
1597
|
+
authorized: boolean;
|
|
1589
1598
|
apiKey: string;
|
|
1590
1599
|
};
|
|
1591
1600
|
}>;
|
|
@@ -1604,7 +1613,7 @@ declare class Seamless {
|
|
|
1604
1613
|
data: {
|
|
1605
1614
|
masterAddress: string;
|
|
1606
1615
|
seamlessAccount: string;
|
|
1607
|
-
authorized:
|
|
1616
|
+
authorized: boolean;
|
|
1608
1617
|
apiKey: string;
|
|
1609
1618
|
};
|
|
1610
1619
|
message?: undefined;
|
|
@@ -1631,13 +1640,13 @@ declare class Order {
|
|
|
1631
1640
|
data: {
|
|
1632
1641
|
success: boolean;
|
|
1633
1642
|
orderId: string | null;
|
|
1634
|
-
transactionHash:
|
|
1635
|
-
blockNumber:
|
|
1636
|
-
gasUsed:
|
|
1643
|
+
transactionHash: string;
|
|
1644
|
+
blockNumber: number | undefined;
|
|
1645
|
+
gasUsed: string | undefined;
|
|
1637
1646
|
status: string;
|
|
1638
1647
|
confirmations: number;
|
|
1639
1648
|
timestamp: number;
|
|
1640
|
-
receipt:
|
|
1649
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1641
1650
|
};
|
|
1642
1651
|
} | {
|
|
1643
1652
|
code: number;
|
|
@@ -1648,13 +1657,13 @@ declare class Order {
|
|
|
1648
1657
|
code: number;
|
|
1649
1658
|
message: string;
|
|
1650
1659
|
data: string | null;
|
|
1651
|
-
transactionHash:
|
|
1652
|
-
blockNumber:
|
|
1653
|
-
gasUsed:
|
|
1660
|
+
transactionHash: string;
|
|
1661
|
+
blockNumber: number | undefined;
|
|
1662
|
+
gasUsed: string | undefined;
|
|
1654
1663
|
status: string;
|
|
1655
1664
|
confirmations: number;
|
|
1656
1665
|
timestamp: number;
|
|
1657
|
-
receipt:
|
|
1666
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1658
1667
|
} | {
|
|
1659
1668
|
code: number;
|
|
1660
1669
|
message: any;
|
|
@@ -1673,13 +1682,13 @@ declare class Order {
|
|
|
1673
1682
|
data: {
|
|
1674
1683
|
success: boolean;
|
|
1675
1684
|
orderId: string | null;
|
|
1676
|
-
transactionHash:
|
|
1677
|
-
blockNumber:
|
|
1678
|
-
gasUsed:
|
|
1685
|
+
transactionHash: string;
|
|
1686
|
+
blockNumber: number | undefined;
|
|
1687
|
+
gasUsed: string | undefined;
|
|
1679
1688
|
status: string;
|
|
1680
1689
|
confirmations: number;
|
|
1681
1690
|
timestamp: number;
|
|
1682
|
-
receipt:
|
|
1691
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1683
1692
|
};
|
|
1684
1693
|
} | {
|
|
1685
1694
|
code: number;
|
|
@@ -1692,13 +1701,13 @@ declare class Order {
|
|
|
1692
1701
|
data: {
|
|
1693
1702
|
success: boolean;
|
|
1694
1703
|
orderId: string | null;
|
|
1695
|
-
transactionHash:
|
|
1696
|
-
blockNumber:
|
|
1697
|
-
gasUsed:
|
|
1704
|
+
transactionHash: string;
|
|
1705
|
+
blockNumber: number | undefined;
|
|
1706
|
+
gasUsed: string | undefined;
|
|
1698
1707
|
status: string;
|
|
1699
1708
|
confirmations: number;
|
|
1700
1709
|
timestamp: number;
|
|
1701
|
-
receipt:
|
|
1710
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1702
1711
|
};
|
|
1703
1712
|
} | {
|
|
1704
1713
|
code: number;
|
|
@@ -1719,7 +1728,7 @@ declare class Order {
|
|
|
1719
1728
|
}>;
|
|
1720
1729
|
updateOrderTpSl(params: UpdateOrderParams, chainId: number): Promise<{
|
|
1721
1730
|
code: number;
|
|
1722
|
-
data:
|
|
1731
|
+
data: ethers$1.ContractTransactionReceipt | null;
|
|
1723
1732
|
message: string;
|
|
1724
1733
|
} | {
|
|
1725
1734
|
code: number;
|
package/dist/index.js
CHANGED
|
@@ -1839,7 +1839,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
|
|
|
1839
1839
|
// package.json
|
|
1840
1840
|
var package_default = {
|
|
1841
1841
|
name: "@myx-trade/sdk",
|
|
1842
|
-
version: "0.1.
|
|
1842
|
+
version: "0.1.96",
|
|
1843
1843
|
private: false,
|
|
1844
1844
|
publishConfig: {
|
|
1845
1845
|
access: "public"
|
package/dist/index.mjs
CHANGED