@myx-trade/sdk 0.1.86 → 0.1.89
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 -76
- package/dist/index.d.ts +82 -76
- package/dist/index.js +2 -4
- package/dist/index.mjs +2 -4
- 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';
|
|
@@ -8,9 +9,6 @@ declare enum ChainId {
|
|
|
8
9
|
LINEA_MAINNET = 59144,
|
|
9
10
|
ARB_TESTNET = 421614,
|
|
10
11
|
ARB_MAINNET = 42161,
|
|
11
|
-
OPBNB_TESTNET = 5611,
|
|
12
|
-
OPBNB_MAINNET = 204,
|
|
13
|
-
SCROLL_MAINNET = 534352,
|
|
14
12
|
BSC_TESTNET = 97,
|
|
15
13
|
BSC_MAINNET = 56
|
|
16
14
|
}
|
|
@@ -51,49 +49,49 @@ interface CancelTpSLParams {
|
|
|
51
49
|
orderId: string;
|
|
52
50
|
}
|
|
53
51
|
|
|
54
|
-
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<
|
|
52
|
+
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<string | undefined>;
|
|
55
53
|
|
|
56
|
-
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<
|
|
57
|
-
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[]>;
|
|
58
56
|
declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bigint) => Promise<{
|
|
59
57
|
quotePool: {
|
|
60
|
-
poolToken:
|
|
61
|
-
exchangeRate:
|
|
62
|
-
poolTokenPrice:
|
|
63
|
-
poolTokenSupply:
|
|
58
|
+
poolToken: string;
|
|
59
|
+
exchangeRate: bigint;
|
|
60
|
+
poolTokenPrice: bigint;
|
|
61
|
+
poolTokenSupply: bigint;
|
|
64
62
|
};
|
|
65
63
|
basePool: {
|
|
66
|
-
poolToken:
|
|
67
|
-
exchangeRate:
|
|
68
|
-
poolTokenPrice:
|
|
69
|
-
poolTokenSupply:
|
|
64
|
+
poolToken: string;
|
|
65
|
+
exchangeRate: bigint;
|
|
66
|
+
poolTokenPrice: bigint;
|
|
67
|
+
poolTokenSupply: bigint;
|
|
70
68
|
};
|
|
71
69
|
reserveInfo: {
|
|
72
|
-
baseTotalAmount:
|
|
73
|
-
baseReservedAmount:
|
|
74
|
-
quoteTotalAmount:
|
|
75
|
-
quoteReservedAmount:
|
|
70
|
+
baseTotalAmount: bigint;
|
|
71
|
+
baseReservedAmount: bigint;
|
|
72
|
+
quoteTotalAmount: bigint;
|
|
73
|
+
quoteReservedAmount: bigint;
|
|
76
74
|
};
|
|
77
75
|
fundingInfo: {
|
|
78
|
-
nextFundingRate:
|
|
79
|
-
lastFundingFeeTracker:
|
|
80
|
-
nextEpochTime:
|
|
76
|
+
nextFundingRate: bigint;
|
|
77
|
+
lastFundingFeeTracker: bigint;
|
|
78
|
+
nextEpochTime: bigint;
|
|
81
79
|
};
|
|
82
80
|
ioTracker: {
|
|
83
|
-
tracker:
|
|
84
|
-
longSize:
|
|
85
|
-
shortSize:
|
|
86
|
-
poolEntryPrice:
|
|
81
|
+
tracker: bigint;
|
|
82
|
+
longSize: bigint;
|
|
83
|
+
shortSize: bigint;
|
|
84
|
+
poolEntryPrice: bigint;
|
|
87
85
|
};
|
|
88
86
|
}>;
|
|
89
87
|
|
|
90
|
-
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<
|
|
88
|
+
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<bigint>;
|
|
91
89
|
|
|
92
|
-
declare const addTpSl: (params: AddTpSLParams) => Promise<
|
|
90
|
+
declare const addTpSl: (params: AddTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
93
91
|
|
|
94
|
-
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<
|
|
92
|
+
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
95
93
|
|
|
96
|
-
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<
|
|
94
|
+
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
97
95
|
|
|
98
96
|
/**
|
|
99
97
|
* Trading related types and enums
|
|
@@ -873,21 +871,21 @@ interface PreviewWithdrawDataParams {
|
|
|
873
871
|
amount: string | number;
|
|
874
872
|
}
|
|
875
873
|
|
|
876
|
-
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<
|
|
877
|
-
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
874
|
+
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
875
|
+
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
878
876
|
|
|
879
|
-
declare const deposit$1: (params: Deposit) => Promise<
|
|
877
|
+
declare const deposit$1: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
880
878
|
|
|
881
|
-
declare const withdraw$1: (params: WithdrawParams) => Promise<
|
|
879
|
+
declare const withdraw$1: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
|
|
882
880
|
|
|
883
|
-
declare const getRewards$1: (params: RewardsParams) => Promise<
|
|
881
|
+
declare const getRewards$1: (params: RewardsParams) => Promise<bigint | undefined>;
|
|
884
882
|
|
|
885
883
|
declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
|
|
886
|
-
baseAmountOut:
|
|
887
|
-
rebateAmount:
|
|
884
|
+
baseAmountOut: bigint;
|
|
885
|
+
rebateAmount: bigint;
|
|
888
886
|
} | undefined>;
|
|
889
887
|
|
|
890
|
-
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<
|
|
888
|
+
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
|
|
891
889
|
|
|
892
890
|
declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
|
|
893
891
|
declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
|
|
@@ -896,18 +894,18 @@ declare namespace index$2 {
|
|
|
896
894
|
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 };
|
|
897
895
|
}
|
|
898
896
|
|
|
899
|
-
declare const deposit: (params: Deposit) => Promise<
|
|
897
|
+
declare const deposit: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
900
898
|
|
|
901
|
-
declare const withdraw: (params: WithdrawParams) => Promise<
|
|
899
|
+
declare const withdraw: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
|
|
902
900
|
|
|
903
|
-
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<
|
|
901
|
+
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<ethers.ContractTransactionResponse | null>;
|
|
904
902
|
|
|
905
|
-
declare const getRewards: (params: RewardsParams) => Promise<
|
|
903
|
+
declare const getRewards: (params: RewardsParams) => Promise<bigint | undefined>;
|
|
906
904
|
|
|
907
|
-
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<
|
|
908
|
-
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
905
|
+
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
906
|
+
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
909
907
|
|
|
910
|
-
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<
|
|
908
|
+
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
|
|
911
909
|
|
|
912
910
|
declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
|
|
913
911
|
declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
|
|
@@ -920,9 +918,17 @@ declare namespace index$1 {
|
|
|
920
918
|
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 };
|
|
921
919
|
}
|
|
922
920
|
|
|
923
|
-
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<
|
|
921
|
+
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, string, bigint, bigint, bigint, bigint, bigint] & {
|
|
922
|
+
marketId: string;
|
|
923
|
+
quoteToken: string;
|
|
924
|
+
baseReserveRatio: bigint;
|
|
925
|
+
quoteReserveRatio: bigint;
|
|
926
|
+
oracleFeeUsd: bigint;
|
|
927
|
+
oracleRefundFeeUsd: bigint;
|
|
928
|
+
poolPrimeThreshold: bigint;
|
|
929
|
+
}) | undefined>;
|
|
924
930
|
|
|
925
|
-
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<
|
|
931
|
+
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<bigint | undefined>;
|
|
926
932
|
|
|
927
933
|
declare const index_getMarket: typeof getMarket;
|
|
928
934
|
declare const index_getOracleFee: typeof getOracleFee;
|
|
@@ -965,9 +971,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
|
|
|
965
971
|
declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
|
|
966
972
|
balance?: number | undefined;
|
|
967
973
|
address: string;
|
|
968
|
-
name:
|
|
969
|
-
symbol:
|
|
970
|
-
decimals:
|
|
974
|
+
name: string;
|
|
975
|
+
symbol: string;
|
|
976
|
+
decimals: bigint;
|
|
971
977
|
icon: string;
|
|
972
978
|
totalSupply: number;
|
|
973
979
|
}>;
|
|
@@ -1181,7 +1187,7 @@ interface MyxClientConfig {
|
|
|
1181
1187
|
signer?: Signer;
|
|
1182
1188
|
seamlessAccount?: {
|
|
1183
1189
|
masterAddress: string;
|
|
1184
|
-
wallet: ethers.Wallet | null;
|
|
1190
|
+
wallet: ethers$1.Wallet | null;
|
|
1185
1191
|
authorized: boolean;
|
|
1186
1192
|
};
|
|
1187
1193
|
walletClient?: WalletClient;
|
|
@@ -1201,7 +1207,7 @@ declare class ConfigManager {
|
|
|
1201
1207
|
clear(): void;
|
|
1202
1208
|
startSeamlessMode(open: boolean): void;
|
|
1203
1209
|
updateSeamlessWallet({ wallet, authorized, masterAddress }: {
|
|
1204
|
-
wallet?: ethers.Wallet;
|
|
1210
|
+
wallet?: ethers$1.Wallet;
|
|
1205
1211
|
authorized?: boolean;
|
|
1206
1212
|
masterAddress?: string;
|
|
1207
1213
|
}): void;
|
|
@@ -1520,9 +1526,9 @@ declare class Seamless {
|
|
|
1520
1526
|
private utils;
|
|
1521
1527
|
private account;
|
|
1522
1528
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
|
|
1523
|
-
onCheckRelayer(account: string, relayer: string): Promise<
|
|
1529
|
+
onCheckRelayer(account: string, relayer: string): Promise<boolean>;
|
|
1524
1530
|
getUSDPermitParams(deadline: number): Promise<{
|
|
1525
|
-
token: string | ethers.Addressable;
|
|
1531
|
+
token: string | ethers$1.Addressable;
|
|
1526
1532
|
owner: Promise<string> | undefined;
|
|
1527
1533
|
spender: string;
|
|
1528
1534
|
value: bigint;
|
|
@@ -1539,7 +1545,7 @@ declare class Seamless {
|
|
|
1539
1545
|
deadline: number;
|
|
1540
1546
|
data: string;
|
|
1541
1547
|
nonce: string;
|
|
1542
|
-
}, provider?: ethers.Signer): Promise<ApiResponse<any>>;
|
|
1548
|
+
}, provider?: ethers$1.Signer): Promise<ApiResponse<any>>;
|
|
1543
1549
|
authorizeSeamlessAccount({ approve, seamlessAddress }: {
|
|
1544
1550
|
approve: boolean;
|
|
1545
1551
|
seamlessAddress: string;
|
|
@@ -1559,7 +1565,7 @@ declare class Seamless {
|
|
|
1559
1565
|
data: {
|
|
1560
1566
|
masterAddress: string;
|
|
1561
1567
|
seamlessAccount: string;
|
|
1562
|
-
authorized:
|
|
1568
|
+
authorized: boolean;
|
|
1563
1569
|
};
|
|
1564
1570
|
}>;
|
|
1565
1571
|
exportSeamlessPrivateKey({ password, apiKey }: {
|
|
@@ -1577,9 +1583,9 @@ declare class Seamless {
|
|
|
1577
1583
|
}): Promise<{
|
|
1578
1584
|
code: number;
|
|
1579
1585
|
data: {
|
|
1580
|
-
masterAddress:
|
|
1586
|
+
masterAddress: string;
|
|
1581
1587
|
seamlessAccount: string;
|
|
1582
|
-
authorized:
|
|
1588
|
+
authorized: boolean;
|
|
1583
1589
|
apiKey: string;
|
|
1584
1590
|
};
|
|
1585
1591
|
}>;
|
|
@@ -1598,7 +1604,7 @@ declare class Seamless {
|
|
|
1598
1604
|
data: {
|
|
1599
1605
|
masterAddress: string;
|
|
1600
1606
|
seamlessAccount: string;
|
|
1601
|
-
authorized:
|
|
1607
|
+
authorized: boolean;
|
|
1602
1608
|
apiKey: string;
|
|
1603
1609
|
};
|
|
1604
1610
|
message?: undefined;
|
|
@@ -1625,13 +1631,13 @@ declare class Order {
|
|
|
1625
1631
|
data: {
|
|
1626
1632
|
success: boolean;
|
|
1627
1633
|
orderId: string | null;
|
|
1628
|
-
transactionHash:
|
|
1629
|
-
blockNumber:
|
|
1630
|
-
gasUsed:
|
|
1634
|
+
transactionHash: string;
|
|
1635
|
+
blockNumber: number | undefined;
|
|
1636
|
+
gasUsed: string | undefined;
|
|
1631
1637
|
status: string;
|
|
1632
1638
|
confirmations: number;
|
|
1633
1639
|
timestamp: number;
|
|
1634
|
-
receipt:
|
|
1640
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1635
1641
|
};
|
|
1636
1642
|
} | {
|
|
1637
1643
|
code: number;
|
|
@@ -1642,13 +1648,13 @@ declare class Order {
|
|
|
1642
1648
|
code: number;
|
|
1643
1649
|
message: string;
|
|
1644
1650
|
data: string | null;
|
|
1645
|
-
transactionHash:
|
|
1646
|
-
blockNumber:
|
|
1647
|
-
gasUsed:
|
|
1651
|
+
transactionHash: string;
|
|
1652
|
+
blockNumber: number | undefined;
|
|
1653
|
+
gasUsed: string | undefined;
|
|
1648
1654
|
status: string;
|
|
1649
1655
|
confirmations: number;
|
|
1650
1656
|
timestamp: number;
|
|
1651
|
-
receipt:
|
|
1657
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1652
1658
|
} | {
|
|
1653
1659
|
code: number;
|
|
1654
1660
|
message: any;
|
|
@@ -1667,13 +1673,13 @@ declare class Order {
|
|
|
1667
1673
|
data: {
|
|
1668
1674
|
success: boolean;
|
|
1669
1675
|
orderId: string | null;
|
|
1670
|
-
transactionHash:
|
|
1671
|
-
blockNumber:
|
|
1672
|
-
gasUsed:
|
|
1676
|
+
transactionHash: string;
|
|
1677
|
+
blockNumber: number | undefined;
|
|
1678
|
+
gasUsed: string | undefined;
|
|
1673
1679
|
status: string;
|
|
1674
1680
|
confirmations: number;
|
|
1675
1681
|
timestamp: number;
|
|
1676
|
-
receipt:
|
|
1682
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1677
1683
|
};
|
|
1678
1684
|
} | {
|
|
1679
1685
|
code: number;
|
|
@@ -1686,13 +1692,13 @@ declare class Order {
|
|
|
1686
1692
|
data: {
|
|
1687
1693
|
success: boolean;
|
|
1688
1694
|
orderId: string | null;
|
|
1689
|
-
transactionHash:
|
|
1690
|
-
blockNumber:
|
|
1691
|
-
gasUsed:
|
|
1695
|
+
transactionHash: string;
|
|
1696
|
+
blockNumber: number | undefined;
|
|
1697
|
+
gasUsed: string | undefined;
|
|
1692
1698
|
status: string;
|
|
1693
1699
|
confirmations: number;
|
|
1694
1700
|
timestamp: number;
|
|
1695
|
-
receipt:
|
|
1701
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1696
1702
|
};
|
|
1697
1703
|
} | {
|
|
1698
1704
|
code: number;
|
|
@@ -1713,7 +1719,7 @@ declare class Order {
|
|
|
1713
1719
|
}>;
|
|
1714
1720
|
updateOrderTpSl(params: UpdateOrderParams, chainId: number): Promise<{
|
|
1715
1721
|
code: number;
|
|
1716
|
-
data:
|
|
1722
|
+
data: ethers$1.ContractTransactionReceipt | null;
|
|
1717
1723
|
message: string;
|
|
1718
1724
|
} | {
|
|
1719
1725
|
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';
|
|
@@ -8,9 +9,6 @@ declare enum ChainId {
|
|
|
8
9
|
LINEA_MAINNET = 59144,
|
|
9
10
|
ARB_TESTNET = 421614,
|
|
10
11
|
ARB_MAINNET = 42161,
|
|
11
|
-
OPBNB_TESTNET = 5611,
|
|
12
|
-
OPBNB_MAINNET = 204,
|
|
13
|
-
SCROLL_MAINNET = 534352,
|
|
14
12
|
BSC_TESTNET = 97,
|
|
15
13
|
BSC_MAINNET = 56
|
|
16
14
|
}
|
|
@@ -51,49 +49,49 @@ interface CancelTpSLParams {
|
|
|
51
49
|
orderId: string;
|
|
52
50
|
}
|
|
53
51
|
|
|
54
|
-
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<
|
|
52
|
+
declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<string | undefined>;
|
|
55
53
|
|
|
56
|
-
declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<
|
|
57
|
-
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[]>;
|
|
58
56
|
declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bigint) => Promise<{
|
|
59
57
|
quotePool: {
|
|
60
|
-
poolToken:
|
|
61
|
-
exchangeRate:
|
|
62
|
-
poolTokenPrice:
|
|
63
|
-
poolTokenSupply:
|
|
58
|
+
poolToken: string;
|
|
59
|
+
exchangeRate: bigint;
|
|
60
|
+
poolTokenPrice: bigint;
|
|
61
|
+
poolTokenSupply: bigint;
|
|
64
62
|
};
|
|
65
63
|
basePool: {
|
|
66
|
-
poolToken:
|
|
67
|
-
exchangeRate:
|
|
68
|
-
poolTokenPrice:
|
|
69
|
-
poolTokenSupply:
|
|
64
|
+
poolToken: string;
|
|
65
|
+
exchangeRate: bigint;
|
|
66
|
+
poolTokenPrice: bigint;
|
|
67
|
+
poolTokenSupply: bigint;
|
|
70
68
|
};
|
|
71
69
|
reserveInfo: {
|
|
72
|
-
baseTotalAmount:
|
|
73
|
-
baseReservedAmount:
|
|
74
|
-
quoteTotalAmount:
|
|
75
|
-
quoteReservedAmount:
|
|
70
|
+
baseTotalAmount: bigint;
|
|
71
|
+
baseReservedAmount: bigint;
|
|
72
|
+
quoteTotalAmount: bigint;
|
|
73
|
+
quoteReservedAmount: bigint;
|
|
76
74
|
};
|
|
77
75
|
fundingInfo: {
|
|
78
|
-
nextFundingRate:
|
|
79
|
-
lastFundingFeeTracker:
|
|
80
|
-
nextEpochTime:
|
|
76
|
+
nextFundingRate: bigint;
|
|
77
|
+
lastFundingFeeTracker: bigint;
|
|
78
|
+
nextEpochTime: bigint;
|
|
81
79
|
};
|
|
82
80
|
ioTracker: {
|
|
83
|
-
tracker:
|
|
84
|
-
longSize:
|
|
85
|
-
shortSize:
|
|
86
|
-
poolEntryPrice:
|
|
81
|
+
tracker: bigint;
|
|
82
|
+
longSize: bigint;
|
|
83
|
+
shortSize: bigint;
|
|
84
|
+
poolEntryPrice: bigint;
|
|
87
85
|
};
|
|
88
86
|
}>;
|
|
89
87
|
|
|
90
|
-
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<
|
|
88
|
+
declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<bigint>;
|
|
91
89
|
|
|
92
|
-
declare const addTpSl: (params: AddTpSLParams) => Promise<
|
|
90
|
+
declare const addTpSl: (params: AddTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
93
91
|
|
|
94
|
-
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<
|
|
92
|
+
declare const cancelTpSl: (params: CancelTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
95
93
|
|
|
96
|
-
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<
|
|
94
|
+
declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<ethers.ContractTransactionReceipt | null>;
|
|
97
95
|
|
|
98
96
|
/**
|
|
99
97
|
* Trading related types and enums
|
|
@@ -873,21 +871,21 @@ interface PreviewWithdrawDataParams {
|
|
|
873
871
|
amount: string | number;
|
|
874
872
|
}
|
|
875
873
|
|
|
876
|
-
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<
|
|
877
|
-
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
874
|
+
declare const claimBasePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
875
|
+
declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
878
876
|
|
|
879
|
-
declare const deposit$1: (params: Deposit) => Promise<
|
|
877
|
+
declare const deposit$1: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
880
878
|
|
|
881
|
-
declare const withdraw$1: (params: WithdrawParams) => Promise<
|
|
879
|
+
declare const withdraw$1: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
|
|
882
880
|
|
|
883
|
-
declare const getRewards$1: (params: RewardsParams) => Promise<
|
|
881
|
+
declare const getRewards$1: (params: RewardsParams) => Promise<bigint | undefined>;
|
|
884
882
|
|
|
885
883
|
declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
|
|
886
|
-
baseAmountOut:
|
|
887
|
-
rebateAmount:
|
|
884
|
+
baseAmountOut: bigint;
|
|
885
|
+
rebateAmount: bigint;
|
|
888
886
|
} | undefined>;
|
|
889
887
|
|
|
890
|
-
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<
|
|
888
|
+
declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
|
|
891
889
|
|
|
892
890
|
declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
|
|
893
891
|
declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
|
|
@@ -896,18 +894,18 @@ declare namespace index$2 {
|
|
|
896
894
|
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 };
|
|
897
895
|
}
|
|
898
896
|
|
|
899
|
-
declare const deposit: (params: Deposit) => Promise<
|
|
897
|
+
declare const deposit: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
900
898
|
|
|
901
|
-
declare const withdraw: (params: WithdrawParams) => Promise<
|
|
899
|
+
declare const withdraw: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
|
|
902
900
|
|
|
903
|
-
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<
|
|
901
|
+
declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<ethers.ContractTransactionResponse | null>;
|
|
904
902
|
|
|
905
|
-
declare const getRewards: (params: RewardsParams) => Promise<
|
|
903
|
+
declare const getRewards: (params: RewardsParams) => Promise<bigint | undefined>;
|
|
906
904
|
|
|
907
|
-
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<
|
|
908
|
-
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<
|
|
905
|
+
declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
906
|
+
declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
|
|
909
907
|
|
|
910
|
-
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<
|
|
908
|
+
declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
|
|
911
909
|
|
|
912
910
|
declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
|
|
913
911
|
declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
|
|
@@ -920,9 +918,17 @@ declare namespace index$1 {
|
|
|
920
918
|
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 };
|
|
921
919
|
}
|
|
922
920
|
|
|
923
|
-
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<
|
|
921
|
+
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, string, bigint, bigint, bigint, bigint, bigint] & {
|
|
922
|
+
marketId: string;
|
|
923
|
+
quoteToken: string;
|
|
924
|
+
baseReserveRatio: bigint;
|
|
925
|
+
quoteReserveRatio: bigint;
|
|
926
|
+
oracleFeeUsd: bigint;
|
|
927
|
+
oracleRefundFeeUsd: bigint;
|
|
928
|
+
poolPrimeThreshold: bigint;
|
|
929
|
+
}) | undefined>;
|
|
924
930
|
|
|
925
|
-
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<
|
|
931
|
+
declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<bigint | undefined>;
|
|
926
932
|
|
|
927
933
|
declare const index_getMarket: typeof getMarket;
|
|
928
934
|
declare const index_getOracleFee: typeof getOracleFee;
|
|
@@ -965,9 +971,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
|
|
|
965
971
|
declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
|
|
966
972
|
balance?: number | undefined;
|
|
967
973
|
address: string;
|
|
968
|
-
name:
|
|
969
|
-
symbol:
|
|
970
|
-
decimals:
|
|
974
|
+
name: string;
|
|
975
|
+
symbol: string;
|
|
976
|
+
decimals: bigint;
|
|
971
977
|
icon: string;
|
|
972
978
|
totalSupply: number;
|
|
973
979
|
}>;
|
|
@@ -1181,7 +1187,7 @@ interface MyxClientConfig {
|
|
|
1181
1187
|
signer?: Signer;
|
|
1182
1188
|
seamlessAccount?: {
|
|
1183
1189
|
masterAddress: string;
|
|
1184
|
-
wallet: ethers.Wallet | null;
|
|
1190
|
+
wallet: ethers$1.Wallet | null;
|
|
1185
1191
|
authorized: boolean;
|
|
1186
1192
|
};
|
|
1187
1193
|
walletClient?: WalletClient;
|
|
@@ -1201,7 +1207,7 @@ declare class ConfigManager {
|
|
|
1201
1207
|
clear(): void;
|
|
1202
1208
|
startSeamlessMode(open: boolean): void;
|
|
1203
1209
|
updateSeamlessWallet({ wallet, authorized, masterAddress }: {
|
|
1204
|
-
wallet?: ethers.Wallet;
|
|
1210
|
+
wallet?: ethers$1.Wallet;
|
|
1205
1211
|
authorized?: boolean;
|
|
1206
1212
|
masterAddress?: string;
|
|
1207
1213
|
}): void;
|
|
@@ -1520,9 +1526,9 @@ declare class Seamless {
|
|
|
1520
1526
|
private utils;
|
|
1521
1527
|
private account;
|
|
1522
1528
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
|
|
1523
|
-
onCheckRelayer(account: string, relayer: string): Promise<
|
|
1529
|
+
onCheckRelayer(account: string, relayer: string): Promise<boolean>;
|
|
1524
1530
|
getUSDPermitParams(deadline: number): Promise<{
|
|
1525
|
-
token: string | ethers.Addressable;
|
|
1531
|
+
token: string | ethers$1.Addressable;
|
|
1526
1532
|
owner: Promise<string> | undefined;
|
|
1527
1533
|
spender: string;
|
|
1528
1534
|
value: bigint;
|
|
@@ -1539,7 +1545,7 @@ declare class Seamless {
|
|
|
1539
1545
|
deadline: number;
|
|
1540
1546
|
data: string;
|
|
1541
1547
|
nonce: string;
|
|
1542
|
-
}, provider?: ethers.Signer): Promise<ApiResponse<any>>;
|
|
1548
|
+
}, provider?: ethers$1.Signer): Promise<ApiResponse<any>>;
|
|
1543
1549
|
authorizeSeamlessAccount({ approve, seamlessAddress }: {
|
|
1544
1550
|
approve: boolean;
|
|
1545
1551
|
seamlessAddress: string;
|
|
@@ -1559,7 +1565,7 @@ declare class Seamless {
|
|
|
1559
1565
|
data: {
|
|
1560
1566
|
masterAddress: string;
|
|
1561
1567
|
seamlessAccount: string;
|
|
1562
|
-
authorized:
|
|
1568
|
+
authorized: boolean;
|
|
1563
1569
|
};
|
|
1564
1570
|
}>;
|
|
1565
1571
|
exportSeamlessPrivateKey({ password, apiKey }: {
|
|
@@ -1577,9 +1583,9 @@ declare class Seamless {
|
|
|
1577
1583
|
}): Promise<{
|
|
1578
1584
|
code: number;
|
|
1579
1585
|
data: {
|
|
1580
|
-
masterAddress:
|
|
1586
|
+
masterAddress: string;
|
|
1581
1587
|
seamlessAccount: string;
|
|
1582
|
-
authorized:
|
|
1588
|
+
authorized: boolean;
|
|
1583
1589
|
apiKey: string;
|
|
1584
1590
|
};
|
|
1585
1591
|
}>;
|
|
@@ -1598,7 +1604,7 @@ declare class Seamless {
|
|
|
1598
1604
|
data: {
|
|
1599
1605
|
masterAddress: string;
|
|
1600
1606
|
seamlessAccount: string;
|
|
1601
|
-
authorized:
|
|
1607
|
+
authorized: boolean;
|
|
1602
1608
|
apiKey: string;
|
|
1603
1609
|
};
|
|
1604
1610
|
message?: undefined;
|
|
@@ -1625,13 +1631,13 @@ declare class Order {
|
|
|
1625
1631
|
data: {
|
|
1626
1632
|
success: boolean;
|
|
1627
1633
|
orderId: string | null;
|
|
1628
|
-
transactionHash:
|
|
1629
|
-
blockNumber:
|
|
1630
|
-
gasUsed:
|
|
1634
|
+
transactionHash: string;
|
|
1635
|
+
blockNumber: number | undefined;
|
|
1636
|
+
gasUsed: string | undefined;
|
|
1631
1637
|
status: string;
|
|
1632
1638
|
confirmations: number;
|
|
1633
1639
|
timestamp: number;
|
|
1634
|
-
receipt:
|
|
1640
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1635
1641
|
};
|
|
1636
1642
|
} | {
|
|
1637
1643
|
code: number;
|
|
@@ -1642,13 +1648,13 @@ declare class Order {
|
|
|
1642
1648
|
code: number;
|
|
1643
1649
|
message: string;
|
|
1644
1650
|
data: string | null;
|
|
1645
|
-
transactionHash:
|
|
1646
|
-
blockNumber:
|
|
1647
|
-
gasUsed:
|
|
1651
|
+
transactionHash: string;
|
|
1652
|
+
blockNumber: number | undefined;
|
|
1653
|
+
gasUsed: string | undefined;
|
|
1648
1654
|
status: string;
|
|
1649
1655
|
confirmations: number;
|
|
1650
1656
|
timestamp: number;
|
|
1651
|
-
receipt:
|
|
1657
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1652
1658
|
} | {
|
|
1653
1659
|
code: number;
|
|
1654
1660
|
message: any;
|
|
@@ -1667,13 +1673,13 @@ declare class Order {
|
|
|
1667
1673
|
data: {
|
|
1668
1674
|
success: boolean;
|
|
1669
1675
|
orderId: string | null;
|
|
1670
|
-
transactionHash:
|
|
1671
|
-
blockNumber:
|
|
1672
|
-
gasUsed:
|
|
1676
|
+
transactionHash: string;
|
|
1677
|
+
blockNumber: number | undefined;
|
|
1678
|
+
gasUsed: string | undefined;
|
|
1673
1679
|
status: string;
|
|
1674
1680
|
confirmations: number;
|
|
1675
1681
|
timestamp: number;
|
|
1676
|
-
receipt:
|
|
1682
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1677
1683
|
};
|
|
1678
1684
|
} | {
|
|
1679
1685
|
code: number;
|
|
@@ -1686,13 +1692,13 @@ declare class Order {
|
|
|
1686
1692
|
data: {
|
|
1687
1693
|
success: boolean;
|
|
1688
1694
|
orderId: string | null;
|
|
1689
|
-
transactionHash:
|
|
1690
|
-
blockNumber:
|
|
1691
|
-
gasUsed:
|
|
1695
|
+
transactionHash: string;
|
|
1696
|
+
blockNumber: number | undefined;
|
|
1697
|
+
gasUsed: string | undefined;
|
|
1692
1698
|
status: string;
|
|
1693
1699
|
confirmations: number;
|
|
1694
1700
|
timestamp: number;
|
|
1695
|
-
receipt:
|
|
1701
|
+
receipt: ethers$1.ContractTransactionReceipt | null;
|
|
1696
1702
|
};
|
|
1697
1703
|
} | {
|
|
1698
1704
|
code: number;
|
|
@@ -1713,7 +1719,7 @@ declare class Order {
|
|
|
1713
1719
|
}>;
|
|
1714
1720
|
updateOrderTpSl(params: UpdateOrderParams, chainId: number): Promise<{
|
|
1715
1721
|
code: number;
|
|
1716
|
-
data:
|
|
1722
|
+
data: ethers$1.ContractTransactionReceipt | null;
|
|
1717
1723
|
message: string;
|
|
1718
1724
|
} | {
|
|
1719
1725
|
code: number;
|
package/dist/index.js
CHANGED
|
@@ -1456,9 +1456,6 @@ var ChainId = /* @__PURE__ */ ((ChainId3) => {
|
|
|
1456
1456
|
ChainId3[ChainId3["LINEA_MAINNET"] = 59144] = "LINEA_MAINNET";
|
|
1457
1457
|
ChainId3[ChainId3["ARB_TESTNET"] = 421614] = "ARB_TESTNET";
|
|
1458
1458
|
ChainId3[ChainId3["ARB_MAINNET"] = 42161] = "ARB_MAINNET";
|
|
1459
|
-
ChainId3[ChainId3["OPBNB_TESTNET"] = 5611] = "OPBNB_TESTNET";
|
|
1460
|
-
ChainId3[ChainId3["OPBNB_MAINNET"] = 204] = "OPBNB_MAINNET";
|
|
1461
|
-
ChainId3[ChainId3["SCROLL_MAINNET"] = 534352] = "SCROLL_MAINNET";
|
|
1462
1459
|
ChainId3[ChainId3["BSC_TESTNET"] = 97] = "BSC_TESTNET";
|
|
1463
1460
|
ChainId3[ChainId3["BSC_MAINNET"] = 56] = "BSC_MAINNET";
|
|
1464
1461
|
return ChainId3;
|
|
@@ -1841,7 +1838,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
|
|
|
1841
1838
|
// package.json
|
|
1842
1839
|
var package_default = {
|
|
1843
1840
|
name: "@myx-trade/sdk",
|
|
1844
|
-
version: "0.1.
|
|
1841
|
+
version: "0.1.89",
|
|
1845
1842
|
private: false,
|
|
1846
1843
|
publishConfig: {
|
|
1847
1844
|
access: "public"
|
|
@@ -14483,6 +14480,7 @@ var Order = class {
|
|
|
14483
14480
|
useAccountBalance: false
|
|
14484
14481
|
};
|
|
14485
14482
|
});
|
|
14483
|
+
this.logger.info("closeAllPositions params--->", positionIds, dataMap);
|
|
14486
14484
|
const gasLimit = await brokerContract.placeOrdersWithPosition.estimateGas(positionIds, dataMap);
|
|
14487
14485
|
const transaction = await brokerContract.placeOrdersWithPosition(positionIds, dataMap, {
|
|
14488
14486
|
gasLimit: gasLimit * 120n / 100n
|
package/dist/index.mjs
CHANGED
|
@@ -1361,9 +1361,6 @@ var ChainId = /* @__PURE__ */ ((ChainId3) => {
|
|
|
1361
1361
|
ChainId3[ChainId3["LINEA_MAINNET"] = 59144] = "LINEA_MAINNET";
|
|
1362
1362
|
ChainId3[ChainId3["ARB_TESTNET"] = 421614] = "ARB_TESTNET";
|
|
1363
1363
|
ChainId3[ChainId3["ARB_MAINNET"] = 42161] = "ARB_MAINNET";
|
|
1364
|
-
ChainId3[ChainId3["OPBNB_TESTNET"] = 5611] = "OPBNB_TESTNET";
|
|
1365
|
-
ChainId3[ChainId3["OPBNB_MAINNET"] = 204] = "OPBNB_MAINNET";
|
|
1366
|
-
ChainId3[ChainId3["SCROLL_MAINNET"] = 534352] = "SCROLL_MAINNET";
|
|
1367
1364
|
ChainId3[ChainId3["BSC_TESTNET"] = 97] = "BSC_TESTNET";
|
|
1368
1365
|
ChainId3[ChainId3["BSC_MAINNET"] = 56] = "BSC_MAINNET";
|
|
1369
1366
|
return ChainId3;
|
|
@@ -1752,7 +1749,7 @@ var RotationProvider = class extends BaseProvider {
|
|
|
1752
1749
|
// package.json
|
|
1753
1750
|
var package_default = {
|
|
1754
1751
|
name: "@myx-trade/sdk",
|
|
1755
|
-
version: "0.1.
|
|
1752
|
+
version: "0.1.89",
|
|
1756
1753
|
private: false,
|
|
1757
1754
|
publishConfig: {
|
|
1758
1755
|
access: "public"
|
|
@@ -14394,6 +14391,7 @@ var Order = class {
|
|
|
14394
14391
|
useAccountBalance: false
|
|
14395
14392
|
};
|
|
14396
14393
|
});
|
|
14394
|
+
this.logger.info("closeAllPositions params--->", positionIds, dataMap);
|
|
14397
14395
|
const gasLimit = await brokerContract.placeOrdersWithPosition.estimateGas(positionIds, dataMap);
|
|
14398
14396
|
const transaction = await brokerContract.placeOrdersWithPosition(positionIds, dataMap, {
|
|
14399
14397
|
gasLimit: gasLimit * 120n / 100n
|