@myx-trade/sdk 0.1.154 → 0.1.158

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 CHANGED
@@ -1,5 +1,4 @@
1
- import * as ethers from 'ethers';
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<string | undefined>;
51
+ declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<any>;
53
52
 
54
- declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<string | undefined>;
55
- declare const getMarketPools: (chainId: ChainId) => Promise<string[]>;
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: string;
59
- exchangeRate: bigint;
60
- poolTokenPrice: bigint;
61
- poolTokenSupply: bigint;
57
+ poolToken: any;
58
+ exchangeRate: any;
59
+ poolTokenPrice: any;
60
+ poolTokenSupply: any;
62
61
  };
63
62
  basePool: {
64
- poolToken: string;
65
- exchangeRate: bigint;
66
- poolTokenPrice: bigint;
67
- poolTokenSupply: bigint;
63
+ poolToken: any;
64
+ exchangeRate: any;
65
+ poolTokenPrice: any;
66
+ poolTokenSupply: any;
68
67
  };
69
68
  reserveInfo: {
70
- baseTotalAmount: bigint;
71
- baseReservedAmount: bigint;
72
- quoteTotalAmount: bigint;
73
- quoteReservedAmount: bigint;
69
+ baseTotalAmount: any;
70
+ baseReservedAmount: any;
71
+ quoteTotalAmount: any;
72
+ quoteReservedAmount: any;
74
73
  };
75
74
  fundingInfo: {
76
- nextFundingRate: bigint;
77
- lastFundingFeeTracker: bigint;
78
- nextEpochTime: bigint;
75
+ nextFundingRate: any;
76
+ lastFundingFeeTracker: any;
77
+ nextEpochTime: any;
79
78
  };
80
79
  ioTracker: {
81
- tracker: bigint;
82
- longSize: bigint;
83
- shortSize: bigint;
84
- poolEntryPrice: bigint;
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<bigint>;
87
+ declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<any>;
89
88
 
90
- declare const addTpSl: (params: AddTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
89
+ declare const addTpSl: (params: AddTpSLParams) => Promise<any>;
91
90
 
92
- declare const cancelTpSl: (params: CancelTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
91
+ declare const cancelTpSl: (params: CancelTpSLParams) => Promise<any>;
93
92
 
94
- declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<ethers.ContractTransactionReceipt | null>;
93
+ declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<any>;
95
94
 
96
95
  /**
97
96
  * Trading related types and enums
@@ -888,21 +887,21 @@ interface PreviewWithdrawDataParams {
888
887
  amount: string | number;
889
888
  }
890
889
 
891
- declare const claimBasePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
892
- declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
890
+ declare const claimBasePoolRebate: (params: ClaimParams) => Promise<any>;
891
+ declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
893
892
 
894
- declare const deposit$1: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
893
+ declare const deposit$1: (params: Deposit) => Promise<any>;
895
894
 
896
- declare const withdraw$1: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
895
+ declare const withdraw$1: (params: WithdrawParams) => Promise<any>;
897
896
 
898
- declare const getRewards$1: (params: RewardsParams) => Promise<bigint | undefined>;
897
+ declare const getRewards$1: (params: RewardsParams) => Promise<any>;
899
898
 
900
899
  declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
901
- baseAmountOut: bigint;
902
- rebateAmount: bigint;
900
+ baseAmountOut: any;
901
+ rebateAmount: any;
903
902
  } | undefined>;
904
903
 
905
- declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
904
+ declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<any>;
906
905
 
907
906
  declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
908
907
  declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
@@ -911,18 +910,18 @@ declare namespace index$2 {
911
910
  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 };
912
911
  }
913
912
 
914
- declare const deposit: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
913
+ declare const deposit: (params: Deposit) => Promise<any>;
915
914
 
916
- declare const withdraw: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
915
+ declare const withdraw: (params: WithdrawParams) => Promise<any>;
917
916
 
918
- declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<ethers.ContractTransactionResponse | null>;
917
+ declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<any>;
919
918
 
920
- declare const getRewards: (params: RewardsParams) => Promise<bigint | undefined>;
919
+ declare const getRewards: (params: RewardsParams) => Promise<any>;
921
920
 
922
- declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
923
- declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
921
+ declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<any>;
922
+ declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
924
923
 
925
- declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
924
+ declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<any>;
926
925
 
927
926
  declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
928
927
  declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
@@ -935,16 +934,9 @@ declare namespace index$1 {
935
934
  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 };
936
935
  }
937
936
 
938
- declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint] & {
939
- quoteToken: string;
940
- baseReserveRatio: bigint;
941
- quoteReserveRatio: bigint;
942
- oracleFeeUsd: bigint;
943
- oracleRefundFeeUsd: bigint;
944
- poolPrimeThreshold: bigint;
945
- }) | undefined>;
937
+ declare const getMarket: (chainId: ChainId, marketId: string) => Promise<any>;
946
938
 
947
- declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<bigint | undefined>;
939
+ declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<any>;
948
940
 
949
941
  declare const index_getMarket: typeof getMarket;
950
942
  declare const index_getOracleFee: typeof getOracleFee;
@@ -987,9 +979,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
987
979
  declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
988
980
  balance?: number | undefined;
989
981
  address: string;
990
- name: string;
991
- symbol: string;
992
- decimals: bigint;
982
+ name: any;
983
+ symbol: any;
984
+ decimals: any;
993
985
  icon: string;
994
986
  totalSupply: number;
995
987
  }>;
@@ -1203,7 +1195,7 @@ interface MyxClientConfig {
1203
1195
  signer?: Signer;
1204
1196
  seamlessAccount?: {
1205
1197
  masterAddress: string;
1206
- wallet: ethers$1.Wallet | null;
1198
+ wallet: ethers.Wallet | null;
1207
1199
  authorized: boolean;
1208
1200
  };
1209
1201
  walletClient?: WalletClient;
@@ -1223,7 +1215,7 @@ declare class ConfigManager {
1223
1215
  clear(): void;
1224
1216
  startSeamlessMode(open: boolean): MyxClientConfig;
1225
1217
  updateSeamlessWallet({ wallet, authorized, masterAddress }: {
1226
- wallet?: ethers$1.Wallet;
1218
+ wallet?: ethers.Wallet;
1227
1219
  authorized?: boolean;
1228
1220
  masterAddress?: string;
1229
1221
  }): void;
@@ -1331,7 +1323,7 @@ declare class Utils {
1331
1323
  quoteAddress: string;
1332
1324
  amount?: string;
1333
1325
  spenderAddress?: string;
1334
- signer?: ethers$1.Signer;
1326
+ signer?: ethers.Signer;
1335
1327
  }): Promise<{
1336
1328
  code: number;
1337
1329
  message: any;
@@ -1374,68 +1366,7 @@ declare class Utils {
1374
1366
  marketPrice: string;
1375
1367
  }): Promise<{
1376
1368
  code: number;
1377
- data: [[string, bigint, bigint, bigint] & {
1378
- poolToken: string;
1379
- exchangeRate: bigint;
1380
- poolTokenPrice: bigint;
1381
- poolTokenSupply: bigint;
1382
- }, [string, bigint, bigint, bigint] & {
1383
- poolToken: string;
1384
- exchangeRate: bigint;
1385
- poolTokenPrice: bigint;
1386
- poolTokenSupply: bigint;
1387
- }, [bigint, bigint, bigint, bigint] & {
1388
- baseTotalAmount: bigint;
1389
- baseReservedAmount: bigint;
1390
- quoteTotalAmount: bigint;
1391
- quoteReservedAmount: bigint;
1392
- }, [bigint, bigint, bigint] & {
1393
- nextFundingRate: bigint;
1394
- lastFundingFeeTracker: bigint;
1395
- nextEpochTime: bigint;
1396
- }, [bigint, bigint, bigint, bigint] & {
1397
- tracker: bigint;
1398
- longSize: bigint;
1399
- shortSize: bigint;
1400
- poolEntryPrice: bigint;
1401
- }, [bigint, bigint] & {
1402
- windowCaps: bigint;
1403
- openInterest: bigint;
1404
- }] & {
1405
- basePool: [string, bigint, bigint, bigint] & {
1406
- poolToken: string;
1407
- exchangeRate: bigint;
1408
- poolTokenPrice: bigint;
1409
- poolTokenSupply: bigint;
1410
- };
1411
- quotePool: [string, bigint, bigint, bigint] & {
1412
- poolToken: string;
1413
- exchangeRate: bigint;
1414
- poolTokenPrice: bigint;
1415
- poolTokenSupply: bigint;
1416
- };
1417
- reserveInfo: [bigint, bigint, bigint, bigint] & {
1418
- baseTotalAmount: bigint;
1419
- baseReservedAmount: bigint;
1420
- quoteTotalAmount: bigint;
1421
- quoteReservedAmount: bigint;
1422
- };
1423
- fundingInfo: [bigint, bigint, bigint] & {
1424
- nextFundingRate: bigint;
1425
- lastFundingFeeTracker: bigint;
1426
- nextEpochTime: bigint;
1427
- };
1428
- oi: [bigint, bigint, bigint, bigint] & {
1429
- tracker: bigint;
1430
- longSize: bigint;
1431
- shortSize: bigint;
1432
- poolEntryPrice: bigint;
1433
- };
1434
- liquidityInfo: [bigint, bigint] & {
1435
- windowCaps: bigint;
1436
- openInterest: bigint;
1437
- };
1438
- };
1369
+ data: any;
1439
1370
  message?: undefined;
1440
1371
  } | {
1441
1372
  code: number;
@@ -1589,9 +1520,9 @@ declare class Seamless {
1589
1520
  private utils;
1590
1521
  private account;
1591
1522
  constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
1592
- onCheckRelayer(account: string, relayer: string, chainId: number): Promise<boolean>;
1523
+ onCheckRelayer(account: string, relayer: string, chainId: number): Promise<any>;
1593
1524
  getUSDPermitParams(deadline: number, chainId: number): Promise<{
1594
- token: string | ethers$1.Addressable;
1525
+ token: string | ethers.Addressable;
1595
1526
  owner: string;
1596
1527
  spender: string;
1597
1528
  value: bigint;
@@ -1608,7 +1539,7 @@ declare class Seamless {
1608
1539
  deadline: number;
1609
1540
  data: string;
1610
1541
  nonce: string;
1611
- }, chainId: number, provider?: ethers$1.Signer): Promise<ApiResponse<any>>;
1542
+ }, chainId: number, provider?: ethers.Signer): Promise<ApiResponse<any>>;
1612
1543
  authorizeSeamlessAccount({ approve, seamlessAddress, chainId }: {
1613
1544
  approve: boolean;
1614
1545
  seamlessAddress: string;
@@ -1630,7 +1561,7 @@ declare class Seamless {
1630
1561
  data: {
1631
1562
  masterAddress: string;
1632
1563
  seamlessAccount: string;
1633
- authorized: boolean;
1564
+ authorized: any;
1634
1565
  };
1635
1566
  }>;
1636
1567
  exportSeamlessPrivateKey({ password, apiKey }: {
@@ -1649,9 +1580,9 @@ declare class Seamless {
1649
1580
  }): Promise<{
1650
1581
  code: number;
1651
1582
  data: {
1652
- masterAddress: string;
1583
+ masterAddress: any;
1653
1584
  seamlessAccount: string;
1654
- authorized: boolean;
1585
+ authorized: any;
1655
1586
  apiKey: string;
1656
1587
  };
1657
1588
  }>;
@@ -1671,7 +1602,7 @@ declare class Seamless {
1671
1602
  data: {
1672
1603
  masterAddress: string;
1673
1604
  seamlessAccount: string;
1674
- authorized: boolean;
1605
+ authorized: any;
1675
1606
  apiKey: string;
1676
1607
  };
1677
1608
  message?: undefined;
@@ -1758,13 +1689,13 @@ declare class Order {
1758
1689
  data: {
1759
1690
  success: boolean;
1760
1691
  orderId: string | null;
1761
- transactionHash: string;
1762
- blockNumber: number | undefined;
1763
- gasUsed: string | undefined;
1692
+ transactionHash: any;
1693
+ blockNumber: any;
1694
+ gasUsed: any;
1764
1695
  status: string;
1765
1696
  confirmations: number;
1766
1697
  timestamp: number;
1767
- receipt: ethers$1.ContractTransactionReceipt | null;
1698
+ receipt: any;
1768
1699
  };
1769
1700
  } | {
1770
1701
  code: number;
@@ -1786,13 +1717,13 @@ declare class Order {
1786
1717
  code: number;
1787
1718
  message: string;
1788
1719
  data: string | null;
1789
- transactionHash: string;
1790
- blockNumber: number | undefined;
1791
- gasUsed: string | undefined;
1720
+ transactionHash: any;
1721
+ blockNumber: any;
1722
+ gasUsed: any;
1792
1723
  status: string;
1793
1724
  confirmations: number;
1794
1725
  timestamp: number;
1795
- receipt: ethers$1.ContractTransactionReceipt | null;
1726
+ receipt: any;
1796
1727
  } | {
1797
1728
  code: number;
1798
1729
  message: any;
@@ -1815,13 +1746,13 @@ declare class Order {
1815
1746
  data: {
1816
1747
  success: boolean;
1817
1748
  orderId: string | null;
1818
- transactionHash: string;
1819
- blockNumber: number | undefined;
1820
- gasUsed: string | undefined;
1749
+ transactionHash: any;
1750
+ blockNumber: any;
1751
+ gasUsed: any;
1821
1752
  status: string;
1822
1753
  confirmations: number;
1823
1754
  timestamp: number;
1824
- receipt: ethers$1.ContractTransactionReceipt | null;
1755
+ receipt: any;
1825
1756
  };
1826
1757
  } | {
1827
1758
  code: number;
@@ -1838,13 +1769,13 @@ declare class Order {
1838
1769
  data: {
1839
1770
  success: boolean;
1840
1771
  orderId: string | null;
1841
- transactionHash: string;
1842
- blockNumber: number | undefined;
1843
- gasUsed: string | undefined;
1772
+ transactionHash: any;
1773
+ blockNumber: any;
1774
+ gasUsed: any;
1844
1775
  status: string;
1845
1776
  confirmations: number;
1846
1777
  timestamp: number;
1847
- receipt: ethers$1.ContractTransactionReceipt | null;
1778
+ receipt: any;
1848
1779
  };
1849
1780
  } | {
1850
1781
  code: number;
@@ -1870,7 +1801,7 @@ declare class Order {
1870
1801
  }>;
1871
1802
  updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number): Promise<{
1872
1803
  code: number;
1873
- data: ethers$1.ContractTransactionReceipt | null;
1804
+ data: any;
1874
1805
  message: string;
1875
1806
  } | {
1876
1807
  code: number;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import * as ethers from 'ethers';
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<string | undefined>;
51
+ declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<any>;
53
52
 
54
- declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<string | undefined>;
55
- declare const getMarketPools: (chainId: ChainId) => Promise<string[]>;
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: string;
59
- exchangeRate: bigint;
60
- poolTokenPrice: bigint;
61
- poolTokenSupply: bigint;
57
+ poolToken: any;
58
+ exchangeRate: any;
59
+ poolTokenPrice: any;
60
+ poolTokenSupply: any;
62
61
  };
63
62
  basePool: {
64
- poolToken: string;
65
- exchangeRate: bigint;
66
- poolTokenPrice: bigint;
67
- poolTokenSupply: bigint;
63
+ poolToken: any;
64
+ exchangeRate: any;
65
+ poolTokenPrice: any;
66
+ poolTokenSupply: any;
68
67
  };
69
68
  reserveInfo: {
70
- baseTotalAmount: bigint;
71
- baseReservedAmount: bigint;
72
- quoteTotalAmount: bigint;
73
- quoteReservedAmount: bigint;
69
+ baseTotalAmount: any;
70
+ baseReservedAmount: any;
71
+ quoteTotalAmount: any;
72
+ quoteReservedAmount: any;
74
73
  };
75
74
  fundingInfo: {
76
- nextFundingRate: bigint;
77
- lastFundingFeeTracker: bigint;
78
- nextEpochTime: bigint;
75
+ nextFundingRate: any;
76
+ lastFundingFeeTracker: any;
77
+ nextEpochTime: any;
79
78
  };
80
79
  ioTracker: {
81
- tracker: bigint;
82
- longSize: bigint;
83
- shortSize: bigint;
84
- poolEntryPrice: bigint;
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<bigint>;
87
+ declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<any>;
89
88
 
90
- declare const addTpSl: (params: AddTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
89
+ declare const addTpSl: (params: AddTpSLParams) => Promise<any>;
91
90
 
92
- declare const cancelTpSl: (params: CancelTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
91
+ declare const cancelTpSl: (params: CancelTpSLParams) => Promise<any>;
93
92
 
94
- declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<ethers.ContractTransactionReceipt | null>;
93
+ declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<any>;
95
94
 
96
95
  /**
97
96
  * Trading related types and enums
@@ -888,21 +887,21 @@ interface PreviewWithdrawDataParams {
888
887
  amount: string | number;
889
888
  }
890
889
 
891
- declare const claimBasePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
892
- declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
890
+ declare const claimBasePoolRebate: (params: ClaimParams) => Promise<any>;
891
+ declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
893
892
 
894
- declare const deposit$1: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
893
+ declare const deposit$1: (params: Deposit) => Promise<any>;
895
894
 
896
- declare const withdraw$1: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
895
+ declare const withdraw$1: (params: WithdrawParams) => Promise<any>;
897
896
 
898
- declare const getRewards$1: (params: RewardsParams) => Promise<bigint | undefined>;
897
+ declare const getRewards$1: (params: RewardsParams) => Promise<any>;
899
898
 
900
899
  declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
901
- baseAmountOut: bigint;
902
- rebateAmount: bigint;
900
+ baseAmountOut: any;
901
+ rebateAmount: any;
903
902
  } | undefined>;
904
903
 
905
- declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
904
+ declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<any>;
906
905
 
907
906
  declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
908
907
  declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
@@ -911,18 +910,18 @@ declare namespace index$2 {
911
910
  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 };
912
911
  }
913
912
 
914
- declare const deposit: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
913
+ declare const deposit: (params: Deposit) => Promise<any>;
915
914
 
916
- declare const withdraw: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
915
+ declare const withdraw: (params: WithdrawParams) => Promise<any>;
917
916
 
918
- declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<ethers.ContractTransactionResponse | null>;
917
+ declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<any>;
919
918
 
920
- declare const getRewards: (params: RewardsParams) => Promise<bigint | undefined>;
919
+ declare const getRewards: (params: RewardsParams) => Promise<any>;
921
920
 
922
- declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
923
- declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
921
+ declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<any>;
922
+ declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
924
923
 
925
- declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
924
+ declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<any>;
926
925
 
927
926
  declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
928
927
  declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
@@ -935,16 +934,9 @@ declare namespace index$1 {
935
934
  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 };
936
935
  }
937
936
 
938
- declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint] & {
939
- quoteToken: string;
940
- baseReserveRatio: bigint;
941
- quoteReserveRatio: bigint;
942
- oracleFeeUsd: bigint;
943
- oracleRefundFeeUsd: bigint;
944
- poolPrimeThreshold: bigint;
945
- }) | undefined>;
937
+ declare const getMarket: (chainId: ChainId, marketId: string) => Promise<any>;
946
938
 
947
- declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<bigint | undefined>;
939
+ declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<any>;
948
940
 
949
941
  declare const index_getMarket: typeof getMarket;
950
942
  declare const index_getOracleFee: typeof getOracleFee;
@@ -987,9 +979,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
987
979
  declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
988
980
  balance?: number | undefined;
989
981
  address: string;
990
- name: string;
991
- symbol: string;
992
- decimals: bigint;
982
+ name: any;
983
+ symbol: any;
984
+ decimals: any;
993
985
  icon: string;
994
986
  totalSupply: number;
995
987
  }>;
@@ -1203,7 +1195,7 @@ interface MyxClientConfig {
1203
1195
  signer?: Signer;
1204
1196
  seamlessAccount?: {
1205
1197
  masterAddress: string;
1206
- wallet: ethers$1.Wallet | null;
1198
+ wallet: ethers.Wallet | null;
1207
1199
  authorized: boolean;
1208
1200
  };
1209
1201
  walletClient?: WalletClient;
@@ -1223,7 +1215,7 @@ declare class ConfigManager {
1223
1215
  clear(): void;
1224
1216
  startSeamlessMode(open: boolean): MyxClientConfig;
1225
1217
  updateSeamlessWallet({ wallet, authorized, masterAddress }: {
1226
- wallet?: ethers$1.Wallet;
1218
+ wallet?: ethers.Wallet;
1227
1219
  authorized?: boolean;
1228
1220
  masterAddress?: string;
1229
1221
  }): void;
@@ -1331,7 +1323,7 @@ declare class Utils {
1331
1323
  quoteAddress: string;
1332
1324
  amount?: string;
1333
1325
  spenderAddress?: string;
1334
- signer?: ethers$1.Signer;
1326
+ signer?: ethers.Signer;
1335
1327
  }): Promise<{
1336
1328
  code: number;
1337
1329
  message: any;
@@ -1374,68 +1366,7 @@ declare class Utils {
1374
1366
  marketPrice: string;
1375
1367
  }): Promise<{
1376
1368
  code: number;
1377
- data: [[string, bigint, bigint, bigint] & {
1378
- poolToken: string;
1379
- exchangeRate: bigint;
1380
- poolTokenPrice: bigint;
1381
- poolTokenSupply: bigint;
1382
- }, [string, bigint, bigint, bigint] & {
1383
- poolToken: string;
1384
- exchangeRate: bigint;
1385
- poolTokenPrice: bigint;
1386
- poolTokenSupply: bigint;
1387
- }, [bigint, bigint, bigint, bigint] & {
1388
- baseTotalAmount: bigint;
1389
- baseReservedAmount: bigint;
1390
- quoteTotalAmount: bigint;
1391
- quoteReservedAmount: bigint;
1392
- }, [bigint, bigint, bigint] & {
1393
- nextFundingRate: bigint;
1394
- lastFundingFeeTracker: bigint;
1395
- nextEpochTime: bigint;
1396
- }, [bigint, bigint, bigint, bigint] & {
1397
- tracker: bigint;
1398
- longSize: bigint;
1399
- shortSize: bigint;
1400
- poolEntryPrice: bigint;
1401
- }, [bigint, bigint] & {
1402
- windowCaps: bigint;
1403
- openInterest: bigint;
1404
- }] & {
1405
- basePool: [string, bigint, bigint, bigint] & {
1406
- poolToken: string;
1407
- exchangeRate: bigint;
1408
- poolTokenPrice: bigint;
1409
- poolTokenSupply: bigint;
1410
- };
1411
- quotePool: [string, bigint, bigint, bigint] & {
1412
- poolToken: string;
1413
- exchangeRate: bigint;
1414
- poolTokenPrice: bigint;
1415
- poolTokenSupply: bigint;
1416
- };
1417
- reserveInfo: [bigint, bigint, bigint, bigint] & {
1418
- baseTotalAmount: bigint;
1419
- baseReservedAmount: bigint;
1420
- quoteTotalAmount: bigint;
1421
- quoteReservedAmount: bigint;
1422
- };
1423
- fundingInfo: [bigint, bigint, bigint] & {
1424
- nextFundingRate: bigint;
1425
- lastFundingFeeTracker: bigint;
1426
- nextEpochTime: bigint;
1427
- };
1428
- oi: [bigint, bigint, bigint, bigint] & {
1429
- tracker: bigint;
1430
- longSize: bigint;
1431
- shortSize: bigint;
1432
- poolEntryPrice: bigint;
1433
- };
1434
- liquidityInfo: [bigint, bigint] & {
1435
- windowCaps: bigint;
1436
- openInterest: bigint;
1437
- };
1438
- };
1369
+ data: any;
1439
1370
  message?: undefined;
1440
1371
  } | {
1441
1372
  code: number;
@@ -1589,9 +1520,9 @@ declare class Seamless {
1589
1520
  private utils;
1590
1521
  private account;
1591
1522
  constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
1592
- onCheckRelayer(account: string, relayer: string, chainId: number): Promise<boolean>;
1523
+ onCheckRelayer(account: string, relayer: string, chainId: number): Promise<any>;
1593
1524
  getUSDPermitParams(deadline: number, chainId: number): Promise<{
1594
- token: string | ethers$1.Addressable;
1525
+ token: string | ethers.Addressable;
1595
1526
  owner: string;
1596
1527
  spender: string;
1597
1528
  value: bigint;
@@ -1608,7 +1539,7 @@ declare class Seamless {
1608
1539
  deadline: number;
1609
1540
  data: string;
1610
1541
  nonce: string;
1611
- }, chainId: number, provider?: ethers$1.Signer): Promise<ApiResponse<any>>;
1542
+ }, chainId: number, provider?: ethers.Signer): Promise<ApiResponse<any>>;
1612
1543
  authorizeSeamlessAccount({ approve, seamlessAddress, chainId }: {
1613
1544
  approve: boolean;
1614
1545
  seamlessAddress: string;
@@ -1630,7 +1561,7 @@ declare class Seamless {
1630
1561
  data: {
1631
1562
  masterAddress: string;
1632
1563
  seamlessAccount: string;
1633
- authorized: boolean;
1564
+ authorized: any;
1634
1565
  };
1635
1566
  }>;
1636
1567
  exportSeamlessPrivateKey({ password, apiKey }: {
@@ -1649,9 +1580,9 @@ declare class Seamless {
1649
1580
  }): Promise<{
1650
1581
  code: number;
1651
1582
  data: {
1652
- masterAddress: string;
1583
+ masterAddress: any;
1653
1584
  seamlessAccount: string;
1654
- authorized: boolean;
1585
+ authorized: any;
1655
1586
  apiKey: string;
1656
1587
  };
1657
1588
  }>;
@@ -1671,7 +1602,7 @@ declare class Seamless {
1671
1602
  data: {
1672
1603
  masterAddress: string;
1673
1604
  seamlessAccount: string;
1674
- authorized: boolean;
1605
+ authorized: any;
1675
1606
  apiKey: string;
1676
1607
  };
1677
1608
  message?: undefined;
@@ -1758,13 +1689,13 @@ declare class Order {
1758
1689
  data: {
1759
1690
  success: boolean;
1760
1691
  orderId: string | null;
1761
- transactionHash: string;
1762
- blockNumber: number | undefined;
1763
- gasUsed: string | undefined;
1692
+ transactionHash: any;
1693
+ blockNumber: any;
1694
+ gasUsed: any;
1764
1695
  status: string;
1765
1696
  confirmations: number;
1766
1697
  timestamp: number;
1767
- receipt: ethers$1.ContractTransactionReceipt | null;
1698
+ receipt: any;
1768
1699
  };
1769
1700
  } | {
1770
1701
  code: number;
@@ -1786,13 +1717,13 @@ declare class Order {
1786
1717
  code: number;
1787
1718
  message: string;
1788
1719
  data: string | null;
1789
- transactionHash: string;
1790
- blockNumber: number | undefined;
1791
- gasUsed: string | undefined;
1720
+ transactionHash: any;
1721
+ blockNumber: any;
1722
+ gasUsed: any;
1792
1723
  status: string;
1793
1724
  confirmations: number;
1794
1725
  timestamp: number;
1795
- receipt: ethers$1.ContractTransactionReceipt | null;
1726
+ receipt: any;
1796
1727
  } | {
1797
1728
  code: number;
1798
1729
  message: any;
@@ -1815,13 +1746,13 @@ declare class Order {
1815
1746
  data: {
1816
1747
  success: boolean;
1817
1748
  orderId: string | null;
1818
- transactionHash: string;
1819
- blockNumber: number | undefined;
1820
- gasUsed: string | undefined;
1749
+ transactionHash: any;
1750
+ blockNumber: any;
1751
+ gasUsed: any;
1821
1752
  status: string;
1822
1753
  confirmations: number;
1823
1754
  timestamp: number;
1824
- receipt: ethers$1.ContractTransactionReceipt | null;
1755
+ receipt: any;
1825
1756
  };
1826
1757
  } | {
1827
1758
  code: number;
@@ -1838,13 +1769,13 @@ declare class Order {
1838
1769
  data: {
1839
1770
  success: boolean;
1840
1771
  orderId: string | null;
1841
- transactionHash: string;
1842
- blockNumber: number | undefined;
1843
- gasUsed: string | undefined;
1772
+ transactionHash: any;
1773
+ blockNumber: any;
1774
+ gasUsed: any;
1844
1775
  status: string;
1845
1776
  confirmations: number;
1846
1777
  timestamp: number;
1847
- receipt: ethers$1.ContractTransactionReceipt | null;
1778
+ receipt: any;
1848
1779
  };
1849
1780
  } | {
1850
1781
  code: number;
@@ -1870,7 +1801,7 @@ declare class Order {
1870
1801
  }>;
1871
1802
  updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number): Promise<{
1872
1803
  code: number;
1873
- data: ethers$1.ContractTransactionReceipt | null;
1804
+ data: any;
1874
1805
  message: string;
1875
1806
  } | {
1876
1807
  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.154",
1824
+ version: "0.1.158",
1825
1825
  private: false,
1826
1826
  publishConfig: {
1827
1827
  access: "public"
@@ -14372,8 +14372,8 @@ var Order = class {
14372
14372
  params.executionFeeToken,
14373
14373
  params.collateralAmount
14374
14374
  );
14375
- const totalCollateralAmount = BigInt(params.collateralAmount) + BigInt(tradingFee);
14376
14375
  const availableAccountMarginBalance = await this.account.getAvailableMarginBalance({ poolId: params.poolId, chainId: params.chainId, address: params.address });
14376
+ const totalCollateralAmount = BigInt(params.collateralAmount) + BigInt(tradingFee);
14377
14377
  const needAmount = BigInt(tradingFee) + BigInt(params.collateralAmount) + totalNetWorkFee;
14378
14378
  let depositAmount = BigInt(0);
14379
14379
  const diff = needAmount - availableAccountMarginBalance;
@@ -21463,6 +21463,8 @@ var Seamless = class {
21463
21463
  throw new MyxSDKError("INVALID_SIGNER" /* InvalidSigner */, "Signer is required for permit");
21464
21464
  }
21465
21465
  const masterAddress = await config.signer.getAddress();
21466
+ const forwarderContract = await getForwarderContract(chainId);
21467
+ const forwarderAddress = forwarderContract.target;
21466
21468
  const brokerAddress = config.brokerAddress;
21467
21469
  const contractAddress = getContractAddressByChainId(chainId);
21468
21470
  const erc20Contract = new import_ethers27.ethers.Contract(
@@ -21483,6 +21485,17 @@ var Seamless = class {
21483
21485
  deadline.toString(),
21484
21486
  chainId
21485
21487
  );
21488
+ const forwarderSignPermit = await signPermit(
21489
+ config.signer,
21490
+ // 使用 signer 而不是 provider
21491
+ erc20Contract,
21492
+ masterAddress,
21493
+ forwarderAddress,
21494
+ import_ethers27.ethers.MaxUint256.toString(),
21495
+ (nonces + 1).toString(),
21496
+ deadline.toString(),
21497
+ chainId
21498
+ );
21486
21499
  const brokerSeamlessUSDPermitParams = {
21487
21500
  token: erc20Contract.target,
21488
21501
  owner: masterAddress,
@@ -21493,7 +21506,17 @@ var Seamless = class {
21493
21506
  r: brokerSignPermit.r,
21494
21507
  s: brokerSignPermit.s
21495
21508
  };
21496
- return [brokerSeamlessUSDPermitParams];
21509
+ const forwarderPermitParams = {
21510
+ token: erc20Contract.target,
21511
+ owner: masterAddress,
21512
+ spender: forwarderAddress,
21513
+ value: import_ethers27.ethers.MaxUint256,
21514
+ deadline,
21515
+ v: forwarderSignPermit.v,
21516
+ r: forwarderSignPermit.r,
21517
+ s: forwarderSignPermit.s
21518
+ };
21519
+ return [brokerSeamlessUSDPermitParams, forwarderPermitParams];
21497
21520
  } catch (error) {
21498
21521
  throw new MyxSDKError("INVALID_PRIVATE_KEY" /* InvalidPrivateKey */, "Invalid private key generated");
21499
21522
  }
@@ -21724,14 +21747,6 @@ var Seamless = class {
21724
21747
  wallet,
21725
21748
  authorized: isAuthorized
21726
21749
  });
21727
- const forwarderContract = await getForwarderContract(chainId);
21728
- const erc20Address = getContractAddressByChainId(chainId).ERC20;
21729
- await this.utils.approveAuthorization({
21730
- chainId,
21731
- quoteAddress: erc20Address,
21732
- amount: import_ethers27.ethers.MaxUint256.toString(),
21733
- spenderAddress: forwarderContract.target
21734
- });
21735
21750
  return {
21736
21751
  code: 0,
21737
21752
  data: {
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.154",
1734
+ version: "0.1.158",
1735
1735
  private: false,
1736
1736
  publishConfig: {
1737
1737
  access: "public"
@@ -14282,8 +14282,8 @@ var Order = class {
14282
14282
  params.executionFeeToken,
14283
14283
  params.collateralAmount
14284
14284
  );
14285
- const totalCollateralAmount = BigInt(params.collateralAmount) + BigInt(tradingFee);
14286
14285
  const availableAccountMarginBalance = await this.account.getAvailableMarginBalance({ poolId: params.poolId, chainId: params.chainId, address: params.address });
14286
+ const totalCollateralAmount = BigInt(params.collateralAmount) + BigInt(tradingFee);
14287
14287
  const needAmount = BigInt(tradingFee) + BigInt(params.collateralAmount) + totalNetWorkFee;
14288
14288
  let depositAmount = BigInt(0);
14289
14289
  const diff = needAmount - availableAccountMarginBalance;
@@ -21373,6 +21373,8 @@ var Seamless = class {
21373
21373
  throw new MyxSDKError("INVALID_SIGNER" /* InvalidSigner */, "Signer is required for permit");
21374
21374
  }
21375
21375
  const masterAddress = await config.signer.getAddress();
21376
+ const forwarderContract = await getForwarderContract(chainId);
21377
+ const forwarderAddress = forwarderContract.target;
21376
21378
  const brokerAddress = config.brokerAddress;
21377
21379
  const contractAddress = getContractAddressByChainId(chainId);
21378
21380
  const erc20Contract = new ethers9.Contract(
@@ -21393,6 +21395,17 @@ var Seamless = class {
21393
21395
  deadline.toString(),
21394
21396
  chainId
21395
21397
  );
21398
+ const forwarderSignPermit = await signPermit(
21399
+ config.signer,
21400
+ // 使用 signer 而不是 provider
21401
+ erc20Contract,
21402
+ masterAddress,
21403
+ forwarderAddress,
21404
+ ethers9.MaxUint256.toString(),
21405
+ (nonces + 1).toString(),
21406
+ deadline.toString(),
21407
+ chainId
21408
+ );
21396
21409
  const brokerSeamlessUSDPermitParams = {
21397
21410
  token: erc20Contract.target,
21398
21411
  owner: masterAddress,
@@ -21403,7 +21416,17 @@ var Seamless = class {
21403
21416
  r: brokerSignPermit.r,
21404
21417
  s: brokerSignPermit.s
21405
21418
  };
21406
- return [brokerSeamlessUSDPermitParams];
21419
+ const forwarderPermitParams = {
21420
+ token: erc20Contract.target,
21421
+ owner: masterAddress,
21422
+ spender: forwarderAddress,
21423
+ value: ethers9.MaxUint256,
21424
+ deadline,
21425
+ v: forwarderSignPermit.v,
21426
+ r: forwarderSignPermit.r,
21427
+ s: forwarderSignPermit.s
21428
+ };
21429
+ return [brokerSeamlessUSDPermitParams, forwarderPermitParams];
21407
21430
  } catch (error) {
21408
21431
  throw new MyxSDKError("INVALID_PRIVATE_KEY" /* InvalidPrivateKey */, "Invalid private key generated");
21409
21432
  }
@@ -21634,14 +21657,6 @@ var Seamless = class {
21634
21657
  wallet,
21635
21658
  authorized: isAuthorized
21636
21659
  });
21637
- const forwarderContract = await getForwarderContract(chainId);
21638
- const erc20Address = getContractAddressByChainId(chainId).ERC20;
21639
- await this.utils.approveAuthorization({
21640
- chainId,
21641
- quoteAddress: erc20Address,
21642
- amount: ethers9.MaxUint256.toString(),
21643
- spenderAddress: forwarderContract.target
21644
- });
21645
21660
  return {
21646
21661
  code: 0,
21647
21662
  data: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myx-trade/sdk",
3
- "version": "0.1.154",
3
+ "version": "0.1.158",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"