@myx-trade/sdk 0.1.213 → 0.1.215

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,4 +1,5 @@
1
- import { AddressLike, Signer, ethers } from 'ethers';
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 { Address as Address$1, 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<any>;
52
+ declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<string | undefined>;
52
53
 
53
- declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<any>;
54
- declare const getMarketPools: (chainId: ChainId) => Promise<any>;
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: any;
58
- exchangeRate: any;
59
- poolTokenPrice: any;
60
- poolTokenSupply: any;
58
+ poolToken: string;
59
+ exchangeRate: bigint;
60
+ poolTokenPrice: bigint;
61
+ poolTokenSupply: bigint;
61
62
  };
62
63
  basePool: {
63
- poolToken: any;
64
- exchangeRate: any;
65
- poolTokenPrice: any;
66
- poolTokenSupply: any;
64
+ poolToken: string;
65
+ exchangeRate: bigint;
66
+ poolTokenPrice: bigint;
67
+ poolTokenSupply: bigint;
67
68
  };
68
69
  reserveInfo: {
69
- baseTotalAmount: any;
70
- baseReservedAmount: any;
71
- quoteTotalAmount: any;
72
- quoteReservedAmount: any;
70
+ baseTotalAmount: bigint;
71
+ baseReservedAmount: bigint;
72
+ quoteTotalAmount: bigint;
73
+ quoteReservedAmount: bigint;
73
74
  };
74
75
  fundingInfo: {
75
- nextFundingRate: any;
76
- lastFundingFeeTracker: any;
77
- nextEpochTime: any;
76
+ nextFundingRate: bigint;
77
+ lastFundingFeeTracker: bigint;
78
+ nextEpochTime: bigint;
78
79
  };
79
80
  ioTracker: {
80
- tracker: any;
81
- longSize: any;
82
- shortSize: any;
83
- poolEntryPrice: any;
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<any>;
88
+ declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<bigint>;
88
89
 
89
- declare const addTpSl: (params: AddTpSLParams) => Promise<any>;
90
+ declare const addTpSl: (params: AddTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
90
91
 
91
- declare const cancelTpSl: (params: CancelTpSLParams) => Promise<any>;
92
+ declare const cancelTpSl: (params: CancelTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
92
93
 
93
- declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<any>;
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
@@ -890,21 +891,21 @@ interface PreviewWithdrawDataParams {
890
891
  amount: string | number;
891
892
  }
892
893
 
893
- declare const claimBasePoolRebate: (params: ClaimParams) => Promise<any>;
894
- declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
894
+ declare const claimBasePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
895
+ declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
895
896
 
896
- declare const deposit$1: (params: Deposit) => Promise<any>;
897
+ declare const deposit$1: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
897
898
 
898
- declare const withdraw$1: (params: WithdrawParams) => Promise<any>;
899
+ declare const withdraw$1: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
899
900
 
900
- declare const getRewards$1: (params: RewardsParams) => Promise<any>;
901
+ declare const getRewards$1: (params: RewardsParams) => Promise<bigint | undefined>;
901
902
 
902
903
  declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
903
- baseAmountOut: any;
904
- rebateAmount: any;
904
+ baseAmountOut: bigint;
905
+ rebateAmount: bigint;
905
906
  } | undefined>;
906
907
 
907
- declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<any>;
908
+ declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
908
909
 
909
910
  declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
910
911
  declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
@@ -913,18 +914,18 @@ declare namespace index$2 {
913
914
  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 };
914
915
  }
915
916
 
916
- declare const deposit: (params: Deposit) => Promise<any>;
917
+ declare const deposit: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
917
918
 
918
- declare const withdraw: (params: WithdrawParams) => Promise<any>;
919
+ declare const withdraw: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
919
920
 
920
- declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<any>;
921
+ declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<ethers.ContractTransactionResponse | null>;
921
922
 
922
- declare const getRewards: (params: RewardsParams) => Promise<any>;
923
+ declare const getRewards: (params: RewardsParams) => Promise<bigint | undefined>;
923
924
 
924
- declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<any>;
925
- declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
925
+ declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
926
+ declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
926
927
 
927
- declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<any>;
928
+ declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
928
929
 
929
930
  declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
930
931
  declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
@@ -937,9 +938,16 @@ declare namespace index$1 {
937
938
  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 };
938
939
  }
939
940
 
940
- declare const getMarket: (chainId: ChainId, marketId: string) => Promise<any>;
941
+ declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint] & {
942
+ quoteToken: string;
943
+ baseReserveRatio: bigint;
944
+ quoteReserveRatio: bigint;
945
+ oracleFeeUsd: bigint;
946
+ oracleRefundFeeUsd: bigint;
947
+ poolPrimeThreshold: bigint;
948
+ }) | undefined>;
941
949
 
942
- declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<any>;
950
+ declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<bigint | undefined>;
943
951
 
944
952
  declare const index_getMarket: typeof getMarket;
945
953
  declare const index_getOracleFee: typeof getOracleFee;
@@ -982,9 +990,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
982
990
  declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
983
991
  balance?: number | undefined;
984
992
  address: string;
985
- name: any;
986
- symbol: any;
987
- decimals: any;
993
+ name: string;
994
+ symbol: string;
995
+ decimals: bigint;
988
996
  icon: string;
989
997
  totalSupply: number;
990
998
  }>;
@@ -1198,7 +1206,7 @@ interface MyxClientConfig {
1198
1206
  signer?: Signer;
1199
1207
  seamlessAccount?: {
1200
1208
  masterAddress: string;
1201
- wallet: ethers.Wallet | null;
1209
+ wallet: ethers$1.Wallet | null;
1202
1210
  authorized: boolean;
1203
1211
  };
1204
1212
  walletClient?: WalletClient;
@@ -1218,7 +1226,7 @@ declare class ConfigManager {
1218
1226
  clear(): void;
1219
1227
  startSeamlessMode(open: boolean): MyxClientConfig;
1220
1228
  updateSeamlessWallet({ wallet, authorized, masterAddress }: {
1221
- wallet?: ethers.Wallet;
1229
+ wallet?: ethers$1.Wallet;
1222
1230
  authorized?: boolean;
1223
1231
  masterAddress?: string;
1224
1232
  }): void;
@@ -1326,7 +1334,7 @@ declare class Utils {
1326
1334
  quoteAddress: string;
1327
1335
  amount?: string;
1328
1336
  spenderAddress?: string;
1329
- signer?: ethers.Signer;
1337
+ signer?: ethers$1.Signer;
1330
1338
  }): Promise<{
1331
1339
  code: number;
1332
1340
  message: any;
@@ -1369,7 +1377,68 @@ declare class Utils {
1369
1377
  marketPrice: string;
1370
1378
  }): Promise<{
1371
1379
  code: number;
1372
- data: any;
1380
+ data: [[string, bigint, bigint, bigint] & {
1381
+ poolToken: string;
1382
+ exchangeRate: bigint;
1383
+ poolTokenPrice: bigint;
1384
+ poolTokenSupply: bigint;
1385
+ }, [string, bigint, bigint, bigint] & {
1386
+ poolToken: string;
1387
+ exchangeRate: bigint;
1388
+ poolTokenPrice: bigint;
1389
+ poolTokenSupply: bigint;
1390
+ }, [bigint, bigint, bigint, bigint] & {
1391
+ baseTotalAmount: bigint;
1392
+ baseReservedAmount: bigint;
1393
+ quoteTotalAmount: bigint;
1394
+ quoteReservedAmount: bigint;
1395
+ }, [bigint, bigint, bigint] & {
1396
+ nextFundingRate: bigint;
1397
+ lastFundingFeeTracker: bigint;
1398
+ nextEpochTime: bigint;
1399
+ }, [bigint, bigint, bigint, bigint] & {
1400
+ tracker: bigint;
1401
+ longSize: bigint;
1402
+ shortSize: bigint;
1403
+ poolEntryPrice: bigint;
1404
+ }, [bigint, bigint] & {
1405
+ windowCaps: bigint;
1406
+ openInterest: bigint;
1407
+ }] & {
1408
+ basePool: [string, bigint, bigint, bigint] & {
1409
+ poolToken: string;
1410
+ exchangeRate: bigint;
1411
+ poolTokenPrice: bigint;
1412
+ poolTokenSupply: bigint;
1413
+ };
1414
+ quotePool: [string, bigint, bigint, bigint] & {
1415
+ poolToken: string;
1416
+ exchangeRate: bigint;
1417
+ poolTokenPrice: bigint;
1418
+ poolTokenSupply: bigint;
1419
+ };
1420
+ reserveInfo: [bigint, bigint, bigint, bigint] & {
1421
+ baseTotalAmount: bigint;
1422
+ baseReservedAmount: bigint;
1423
+ quoteTotalAmount: bigint;
1424
+ quoteReservedAmount: bigint;
1425
+ };
1426
+ fundingInfo: [bigint, bigint, bigint] & {
1427
+ nextFundingRate: bigint;
1428
+ lastFundingFeeTracker: bigint;
1429
+ nextEpochTime: bigint;
1430
+ };
1431
+ oi: [bigint, bigint, bigint, bigint] & {
1432
+ tracker: bigint;
1433
+ longSize: bigint;
1434
+ shortSize: bigint;
1435
+ poolEntryPrice: bigint;
1436
+ };
1437
+ liquidityInfo: [bigint, bigint] & {
1438
+ windowCaps: bigint;
1439
+ openInterest: bigint;
1440
+ };
1441
+ };
1373
1442
  message?: undefined;
1374
1443
  } | {
1375
1444
  code: number;
@@ -1584,9 +1653,9 @@ declare class Seamless {
1584
1653
  private account;
1585
1654
  private api;
1586
1655
  constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account, api: Api);
1587
- onCheckRelayer(account: string, relayer: string, chainId: number): Promise<any>;
1656
+ onCheckRelayer(account: string, relayer: string, chainId: number): Promise<boolean>;
1588
1657
  getUSDPermitParams(deadline: number, chainId: number): Promise<{
1589
- token: string | ethers.Addressable;
1658
+ token: string | ethers$1.Addressable;
1590
1659
  owner: string;
1591
1660
  spender: string;
1592
1661
  value: bigint;
@@ -1603,7 +1672,7 @@ declare class Seamless {
1603
1672
  deadline: number;
1604
1673
  data: string;
1605
1674
  nonce: string;
1606
- }, chainId: number, provider?: ethers.Signer): Promise<ApiResponse<any>>;
1675
+ }, chainId: number, provider?: ethers$1.Signer): Promise<ApiResponse<any>>;
1607
1676
  authorizeSeamlessAccount({ approve, seamlessAddress, chainId }: {
1608
1677
  approve: boolean;
1609
1678
  seamlessAddress: string;
@@ -1625,7 +1694,7 @@ declare class Seamless {
1625
1694
  data: {
1626
1695
  masterAddress: string;
1627
1696
  seamlessAccount: string;
1628
- authorized: any;
1697
+ authorized: boolean;
1629
1698
  };
1630
1699
  }>;
1631
1700
  exportSeamlessPrivateKey({ password, apiKey }: {
@@ -1644,9 +1713,9 @@ declare class Seamless {
1644
1713
  }): Promise<{
1645
1714
  code: number;
1646
1715
  data: {
1647
- masterAddress: any;
1716
+ masterAddress: string;
1648
1717
  seamlessAccount: string;
1649
- authorized: any;
1718
+ authorized: boolean;
1650
1719
  apiKey: string;
1651
1720
  };
1652
1721
  }>;
@@ -1666,7 +1735,7 @@ declare class Seamless {
1666
1735
  data: {
1667
1736
  masterAddress: string;
1668
1737
  seamlessAccount: string;
1669
- authorized: any;
1738
+ authorized: boolean;
1670
1739
  apiKey: string;
1671
1740
  };
1672
1741
  message?: undefined;
@@ -1756,13 +1825,13 @@ declare class Order {
1756
1825
  message: string;
1757
1826
  data: {
1758
1827
  success: boolean;
1759
- transactionHash: any;
1760
- blockNumber: any;
1761
- gasUsed: any;
1828
+ transactionHash: string;
1829
+ blockNumber: number | undefined;
1830
+ gasUsed: string | undefined;
1762
1831
  status: string;
1763
1832
  confirmations: number;
1764
1833
  timestamp: number;
1765
- receipt: any;
1834
+ receipt: ethers$1.ContractTransactionReceipt | null;
1766
1835
  };
1767
1836
  } | {
1768
1837
  code: number;
@@ -1783,13 +1852,13 @@ declare class Order {
1783
1852
  } | {
1784
1853
  code: number;
1785
1854
  message: string;
1786
- transactionHash: any;
1787
- blockNumber: any;
1788
- gasUsed: any;
1855
+ transactionHash: string;
1856
+ blockNumber: number | undefined;
1857
+ gasUsed: string | undefined;
1789
1858
  status: string;
1790
1859
  confirmations: number;
1791
1860
  timestamp: number;
1792
- receipt: any;
1861
+ receipt: ethers$1.ContractTransactionReceipt | null;
1793
1862
  data?: undefined;
1794
1863
  } | {
1795
1864
  code: number;
@@ -1812,13 +1881,13 @@ declare class Order {
1812
1881
  message: string;
1813
1882
  data: {
1814
1883
  success: boolean;
1815
- transactionHash: any;
1816
- blockNumber: any;
1817
- gasUsed: any;
1884
+ transactionHash: string;
1885
+ blockNumber: number | undefined;
1886
+ gasUsed: string | undefined;
1818
1887
  status: string;
1819
1888
  confirmations: number;
1820
1889
  timestamp: number;
1821
- receipt: any;
1890
+ receipt: ethers$1.ContractTransactionReceipt | null;
1822
1891
  };
1823
1892
  } | {
1824
1893
  code: number;
@@ -1834,13 +1903,13 @@ declare class Order {
1834
1903
  message: string;
1835
1904
  data: {
1836
1905
  success: boolean;
1837
- transactionHash: any;
1838
- blockNumber: any;
1839
- gasUsed: any;
1906
+ transactionHash: string;
1907
+ blockNumber: number | undefined;
1908
+ gasUsed: string | undefined;
1840
1909
  status: string;
1841
1910
  confirmations: number;
1842
1911
  timestamp: number;
1843
- receipt: any;
1912
+ receipt: ethers$1.ContractTransactionReceipt | null;
1844
1913
  };
1845
1914
  } | {
1846
1915
  code: number;
@@ -1866,7 +1935,7 @@ declare class Order {
1866
1935
  }>;
1867
1936
  updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number): Promise<{
1868
1937
  code: number;
1869
- data: any;
1938
+ data: ethers$1.ContractTransactionReceipt | null;
1870
1939
  message: string;
1871
1940
  } | {
1872
1941
  code: number;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { AddressLike, Signer, ethers } from 'ethers';
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 { Address as Address$1, 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<any>;
52
+ declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<string | undefined>;
52
53
 
53
- declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<any>;
54
- declare const getMarketPools: (chainId: ChainId) => Promise<any>;
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: any;
58
- exchangeRate: any;
59
- poolTokenPrice: any;
60
- poolTokenSupply: any;
58
+ poolToken: string;
59
+ exchangeRate: bigint;
60
+ poolTokenPrice: bigint;
61
+ poolTokenSupply: bigint;
61
62
  };
62
63
  basePool: {
63
- poolToken: any;
64
- exchangeRate: any;
65
- poolTokenPrice: any;
66
- poolTokenSupply: any;
64
+ poolToken: string;
65
+ exchangeRate: bigint;
66
+ poolTokenPrice: bigint;
67
+ poolTokenSupply: bigint;
67
68
  };
68
69
  reserveInfo: {
69
- baseTotalAmount: any;
70
- baseReservedAmount: any;
71
- quoteTotalAmount: any;
72
- quoteReservedAmount: any;
70
+ baseTotalAmount: bigint;
71
+ baseReservedAmount: bigint;
72
+ quoteTotalAmount: bigint;
73
+ quoteReservedAmount: bigint;
73
74
  };
74
75
  fundingInfo: {
75
- nextFundingRate: any;
76
- lastFundingFeeTracker: any;
77
- nextEpochTime: any;
76
+ nextFundingRate: bigint;
77
+ lastFundingFeeTracker: bigint;
78
+ nextEpochTime: bigint;
78
79
  };
79
80
  ioTracker: {
80
- tracker: any;
81
- longSize: any;
82
- shortSize: any;
83
- poolEntryPrice: any;
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<any>;
88
+ declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<bigint>;
88
89
 
89
- declare const addTpSl: (params: AddTpSLParams) => Promise<any>;
90
+ declare const addTpSl: (params: AddTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
90
91
 
91
- declare const cancelTpSl: (params: CancelTpSLParams) => Promise<any>;
92
+ declare const cancelTpSl: (params: CancelTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
92
93
 
93
- declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<any>;
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
@@ -890,21 +891,21 @@ interface PreviewWithdrawDataParams {
890
891
  amount: string | number;
891
892
  }
892
893
 
893
- declare const claimBasePoolRebate: (params: ClaimParams) => Promise<any>;
894
- declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
894
+ declare const claimBasePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
895
+ declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
895
896
 
896
- declare const deposit$1: (params: Deposit) => Promise<any>;
897
+ declare const deposit$1: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
897
898
 
898
- declare const withdraw$1: (params: WithdrawParams) => Promise<any>;
899
+ declare const withdraw$1: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
899
900
 
900
- declare const getRewards$1: (params: RewardsParams) => Promise<any>;
901
+ declare const getRewards$1: (params: RewardsParams) => Promise<bigint | undefined>;
901
902
 
902
903
  declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
903
- baseAmountOut: any;
904
- rebateAmount: any;
904
+ baseAmountOut: bigint;
905
+ rebateAmount: bigint;
905
906
  } | undefined>;
906
907
 
907
- declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<any>;
908
+ declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
908
909
 
909
910
  declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
910
911
  declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
@@ -913,18 +914,18 @@ declare namespace index$2 {
913
914
  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 };
914
915
  }
915
916
 
916
- declare const deposit: (params: Deposit) => Promise<any>;
917
+ declare const deposit: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
917
918
 
918
- declare const withdraw: (params: WithdrawParams) => Promise<any>;
919
+ declare const withdraw: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
919
920
 
920
- declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<any>;
921
+ declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<ethers.ContractTransactionResponse | null>;
921
922
 
922
- declare const getRewards: (params: RewardsParams) => Promise<any>;
923
+ declare const getRewards: (params: RewardsParams) => Promise<bigint | undefined>;
923
924
 
924
- declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<any>;
925
- declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
925
+ declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
926
+ declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
926
927
 
927
- declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<any>;
928
+ declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
928
929
 
929
930
  declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
930
931
  declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
@@ -937,9 +938,16 @@ declare namespace index$1 {
937
938
  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 };
938
939
  }
939
940
 
940
- declare const getMarket: (chainId: ChainId, marketId: string) => Promise<any>;
941
+ declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint] & {
942
+ quoteToken: string;
943
+ baseReserveRatio: bigint;
944
+ quoteReserveRatio: bigint;
945
+ oracleFeeUsd: bigint;
946
+ oracleRefundFeeUsd: bigint;
947
+ poolPrimeThreshold: bigint;
948
+ }) | undefined>;
941
949
 
942
- declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<any>;
950
+ declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<bigint | undefined>;
943
951
 
944
952
  declare const index_getMarket: typeof getMarket;
945
953
  declare const index_getOracleFee: typeof getOracleFee;
@@ -982,9 +990,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
982
990
  declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
983
991
  balance?: number | undefined;
984
992
  address: string;
985
- name: any;
986
- symbol: any;
987
- decimals: any;
993
+ name: string;
994
+ symbol: string;
995
+ decimals: bigint;
988
996
  icon: string;
989
997
  totalSupply: number;
990
998
  }>;
@@ -1198,7 +1206,7 @@ interface MyxClientConfig {
1198
1206
  signer?: Signer;
1199
1207
  seamlessAccount?: {
1200
1208
  masterAddress: string;
1201
- wallet: ethers.Wallet | null;
1209
+ wallet: ethers$1.Wallet | null;
1202
1210
  authorized: boolean;
1203
1211
  };
1204
1212
  walletClient?: WalletClient;
@@ -1218,7 +1226,7 @@ declare class ConfigManager {
1218
1226
  clear(): void;
1219
1227
  startSeamlessMode(open: boolean): MyxClientConfig;
1220
1228
  updateSeamlessWallet({ wallet, authorized, masterAddress }: {
1221
- wallet?: ethers.Wallet;
1229
+ wallet?: ethers$1.Wallet;
1222
1230
  authorized?: boolean;
1223
1231
  masterAddress?: string;
1224
1232
  }): void;
@@ -1326,7 +1334,7 @@ declare class Utils {
1326
1334
  quoteAddress: string;
1327
1335
  amount?: string;
1328
1336
  spenderAddress?: string;
1329
- signer?: ethers.Signer;
1337
+ signer?: ethers$1.Signer;
1330
1338
  }): Promise<{
1331
1339
  code: number;
1332
1340
  message: any;
@@ -1369,7 +1377,68 @@ declare class Utils {
1369
1377
  marketPrice: string;
1370
1378
  }): Promise<{
1371
1379
  code: number;
1372
- data: any;
1380
+ data: [[string, bigint, bigint, bigint] & {
1381
+ poolToken: string;
1382
+ exchangeRate: bigint;
1383
+ poolTokenPrice: bigint;
1384
+ poolTokenSupply: bigint;
1385
+ }, [string, bigint, bigint, bigint] & {
1386
+ poolToken: string;
1387
+ exchangeRate: bigint;
1388
+ poolTokenPrice: bigint;
1389
+ poolTokenSupply: bigint;
1390
+ }, [bigint, bigint, bigint, bigint] & {
1391
+ baseTotalAmount: bigint;
1392
+ baseReservedAmount: bigint;
1393
+ quoteTotalAmount: bigint;
1394
+ quoteReservedAmount: bigint;
1395
+ }, [bigint, bigint, bigint] & {
1396
+ nextFundingRate: bigint;
1397
+ lastFundingFeeTracker: bigint;
1398
+ nextEpochTime: bigint;
1399
+ }, [bigint, bigint, bigint, bigint] & {
1400
+ tracker: bigint;
1401
+ longSize: bigint;
1402
+ shortSize: bigint;
1403
+ poolEntryPrice: bigint;
1404
+ }, [bigint, bigint] & {
1405
+ windowCaps: bigint;
1406
+ openInterest: bigint;
1407
+ }] & {
1408
+ basePool: [string, bigint, bigint, bigint] & {
1409
+ poolToken: string;
1410
+ exchangeRate: bigint;
1411
+ poolTokenPrice: bigint;
1412
+ poolTokenSupply: bigint;
1413
+ };
1414
+ quotePool: [string, bigint, bigint, bigint] & {
1415
+ poolToken: string;
1416
+ exchangeRate: bigint;
1417
+ poolTokenPrice: bigint;
1418
+ poolTokenSupply: bigint;
1419
+ };
1420
+ reserveInfo: [bigint, bigint, bigint, bigint] & {
1421
+ baseTotalAmount: bigint;
1422
+ baseReservedAmount: bigint;
1423
+ quoteTotalAmount: bigint;
1424
+ quoteReservedAmount: bigint;
1425
+ };
1426
+ fundingInfo: [bigint, bigint, bigint] & {
1427
+ nextFundingRate: bigint;
1428
+ lastFundingFeeTracker: bigint;
1429
+ nextEpochTime: bigint;
1430
+ };
1431
+ oi: [bigint, bigint, bigint, bigint] & {
1432
+ tracker: bigint;
1433
+ longSize: bigint;
1434
+ shortSize: bigint;
1435
+ poolEntryPrice: bigint;
1436
+ };
1437
+ liquidityInfo: [bigint, bigint] & {
1438
+ windowCaps: bigint;
1439
+ openInterest: bigint;
1440
+ };
1441
+ };
1373
1442
  message?: undefined;
1374
1443
  } | {
1375
1444
  code: number;
@@ -1584,9 +1653,9 @@ declare class Seamless {
1584
1653
  private account;
1585
1654
  private api;
1586
1655
  constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account, api: Api);
1587
- onCheckRelayer(account: string, relayer: string, chainId: number): Promise<any>;
1656
+ onCheckRelayer(account: string, relayer: string, chainId: number): Promise<boolean>;
1588
1657
  getUSDPermitParams(deadline: number, chainId: number): Promise<{
1589
- token: string | ethers.Addressable;
1658
+ token: string | ethers$1.Addressable;
1590
1659
  owner: string;
1591
1660
  spender: string;
1592
1661
  value: bigint;
@@ -1603,7 +1672,7 @@ declare class Seamless {
1603
1672
  deadline: number;
1604
1673
  data: string;
1605
1674
  nonce: string;
1606
- }, chainId: number, provider?: ethers.Signer): Promise<ApiResponse<any>>;
1675
+ }, chainId: number, provider?: ethers$1.Signer): Promise<ApiResponse<any>>;
1607
1676
  authorizeSeamlessAccount({ approve, seamlessAddress, chainId }: {
1608
1677
  approve: boolean;
1609
1678
  seamlessAddress: string;
@@ -1625,7 +1694,7 @@ declare class Seamless {
1625
1694
  data: {
1626
1695
  masterAddress: string;
1627
1696
  seamlessAccount: string;
1628
- authorized: any;
1697
+ authorized: boolean;
1629
1698
  };
1630
1699
  }>;
1631
1700
  exportSeamlessPrivateKey({ password, apiKey }: {
@@ -1644,9 +1713,9 @@ declare class Seamless {
1644
1713
  }): Promise<{
1645
1714
  code: number;
1646
1715
  data: {
1647
- masterAddress: any;
1716
+ masterAddress: string;
1648
1717
  seamlessAccount: string;
1649
- authorized: any;
1718
+ authorized: boolean;
1650
1719
  apiKey: string;
1651
1720
  };
1652
1721
  }>;
@@ -1666,7 +1735,7 @@ declare class Seamless {
1666
1735
  data: {
1667
1736
  masterAddress: string;
1668
1737
  seamlessAccount: string;
1669
- authorized: any;
1738
+ authorized: boolean;
1670
1739
  apiKey: string;
1671
1740
  };
1672
1741
  message?: undefined;
@@ -1756,13 +1825,13 @@ declare class Order {
1756
1825
  message: string;
1757
1826
  data: {
1758
1827
  success: boolean;
1759
- transactionHash: any;
1760
- blockNumber: any;
1761
- gasUsed: any;
1828
+ transactionHash: string;
1829
+ blockNumber: number | undefined;
1830
+ gasUsed: string | undefined;
1762
1831
  status: string;
1763
1832
  confirmations: number;
1764
1833
  timestamp: number;
1765
- receipt: any;
1834
+ receipt: ethers$1.ContractTransactionReceipt | null;
1766
1835
  };
1767
1836
  } | {
1768
1837
  code: number;
@@ -1783,13 +1852,13 @@ declare class Order {
1783
1852
  } | {
1784
1853
  code: number;
1785
1854
  message: string;
1786
- transactionHash: any;
1787
- blockNumber: any;
1788
- gasUsed: any;
1855
+ transactionHash: string;
1856
+ blockNumber: number | undefined;
1857
+ gasUsed: string | undefined;
1789
1858
  status: string;
1790
1859
  confirmations: number;
1791
1860
  timestamp: number;
1792
- receipt: any;
1861
+ receipt: ethers$1.ContractTransactionReceipt | null;
1793
1862
  data?: undefined;
1794
1863
  } | {
1795
1864
  code: number;
@@ -1812,13 +1881,13 @@ declare class Order {
1812
1881
  message: string;
1813
1882
  data: {
1814
1883
  success: boolean;
1815
- transactionHash: any;
1816
- blockNumber: any;
1817
- gasUsed: any;
1884
+ transactionHash: string;
1885
+ blockNumber: number | undefined;
1886
+ gasUsed: string | undefined;
1818
1887
  status: string;
1819
1888
  confirmations: number;
1820
1889
  timestamp: number;
1821
- receipt: any;
1890
+ receipt: ethers$1.ContractTransactionReceipt | null;
1822
1891
  };
1823
1892
  } | {
1824
1893
  code: number;
@@ -1834,13 +1903,13 @@ declare class Order {
1834
1903
  message: string;
1835
1904
  data: {
1836
1905
  success: boolean;
1837
- transactionHash: any;
1838
- blockNumber: any;
1839
- gasUsed: any;
1906
+ transactionHash: string;
1907
+ blockNumber: number | undefined;
1908
+ gasUsed: string | undefined;
1840
1909
  status: string;
1841
1910
  confirmations: number;
1842
1911
  timestamp: number;
1843
- receipt: any;
1912
+ receipt: ethers$1.ContractTransactionReceipt | null;
1844
1913
  };
1845
1914
  } | {
1846
1915
  code: number;
@@ -1866,7 +1935,7 @@ declare class Order {
1866
1935
  }>;
1867
1936
  updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number): Promise<{
1868
1937
  code: number;
1869
- data: any;
1938
+ data: ethers$1.ContractTransactionReceipt | null;
1870
1939
  message: string;
1871
1940
  } | {
1872
1941
  code: number;
package/dist/index.js CHANGED
@@ -1807,7 +1807,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
1807
1807
  // package.json
1808
1808
  var package_default = {
1809
1809
  name: "@myx-trade/sdk",
1810
- version: "0.1.213",
1810
+ version: "0.1.215",
1811
1811
  private: false,
1812
1812
  publishConfig: {
1813
1813
  access: "public"
@@ -20291,8 +20291,14 @@ var Utils = class {
20291
20291
  if (error?.code === "ACTION_REJECTED" || error?.code === 4001 || error?.info?.error?.code === 4001 || typeof error?.message === "string" && (error.message.toLowerCase().includes("user rejected") || error.message.toLowerCase().includes("denied"))) {
20292
20292
  return "User Rejected";
20293
20293
  }
20294
- if (error?.data) {
20295
- const errorData = error.data;
20294
+ let errorData = error?.data;
20295
+ if (!errorData && error?.message && typeof error.message === "string") {
20296
+ const dataMatch = error.message.match(/data=["'](0x[0-9a-fA-F]+)["']/i);
20297
+ if (dataMatch && dataMatch[1]) {
20298
+ errorData = dataMatch[1];
20299
+ }
20300
+ }
20301
+ if (errorData) {
20296
20302
  const selector = typeof errorData === "string" && errorData.startsWith("0x") ? errorData.slice(0, 10).toLowerCase() : null;
20297
20303
  if (selector) {
20298
20304
  const errorKey = Object.keys(customErrorMapping).find(
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.213",
1734
+ version: "0.1.215",
1735
1735
  private: false,
1736
1736
  publishConfig: {
1737
1737
  access: "public"
@@ -20215,8 +20215,14 @@ var Utils = class {
20215
20215
  if (error?.code === "ACTION_REJECTED" || error?.code === 4001 || error?.info?.error?.code === 4001 || typeof error?.message === "string" && (error.message.toLowerCase().includes("user rejected") || error.message.toLowerCase().includes("denied"))) {
20216
20216
  return "User Rejected";
20217
20217
  }
20218
- if (error?.data) {
20219
- const errorData = error.data;
20218
+ let errorData = error?.data;
20219
+ if (!errorData && error?.message && typeof error.message === "string") {
20220
+ const dataMatch = error.message.match(/data=["'](0x[0-9a-fA-F]+)["']/i);
20221
+ if (dataMatch && dataMatch[1]) {
20222
+ errorData = dataMatch[1];
20223
+ }
20224
+ }
20225
+ if (errorData) {
20220
20226
  const selector = typeof errorData === "string" && errorData.startsWith("0x") ? errorData.slice(0, 10).toLowerCase() : null;
20221
20227
  if (selector) {
20222
20228
  const errorKey = Object.keys(customErrorMapping).find(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myx-trade/sdk",
3
- "version": "0.1.213",
3
+ "version": "0.1.215",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"