@aspan/sdk 0.2.1 → 0.2.2

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.mjs CHANGED
@@ -1422,7 +1422,7 @@ import { bsc as bsc2, bscTestnet as bscTestnet2 } from "viem/chains";
1422
1422
 
1423
1423
  // src/abi/router.ts
1424
1424
  var RouterABI = [
1425
- // ============ Core Functions ============
1425
+ // ============ Core Swap+Mint Functions ============
1426
1426
  // swapAndMintApUSD
1427
1427
  {
1428
1428
  type: "function",
@@ -1436,15 +1436,13 @@ var RouterABI = [
1436
1436
  { name: "inputAmount", type: "uint256" },
1437
1437
  { name: "targetLST", type: "address" },
1438
1438
  { name: "minLSTOut", type: "uint256" },
1439
- { name: "poolFee", type: "uint24" },
1440
- { name: "useV2", type: "bool" }
1439
+ { name: "poolFee", type: "uint24" }
1441
1440
  ]
1442
1441
  },
1443
1442
  {
1444
1443
  name: "mintParams",
1445
1444
  type: "tuple",
1446
1445
  components: [
1447
- { name: "mintXBNB", type: "bool" },
1448
1446
  { name: "minMintOut", type: "uint256" },
1449
1447
  { name: "recipient", type: "address" },
1450
1448
  { name: "deadline", type: "uint256" }
@@ -1470,15 +1468,13 @@ var RouterABI = [
1470
1468
  { name: "inputAmount", type: "uint256" },
1471
1469
  { name: "targetLST", type: "address" },
1472
1470
  { name: "minLSTOut", type: "uint256" },
1473
- { name: "poolFee", type: "uint24" },
1474
- { name: "useV2", type: "bool" }
1471
+ { name: "poolFee", type: "uint24" }
1475
1472
  ]
1476
1473
  },
1477
1474
  {
1478
1475
  name: "mintParams",
1479
1476
  type: "tuple",
1480
1477
  components: [
1481
- { name: "mintXBNB", type: "bool" },
1482
1478
  { name: "minMintOut", type: "uint256" },
1483
1479
  { name: "recipient", type: "address" },
1484
1480
  { name: "deadline", type: "uint256" }
@@ -1491,6 +1487,7 @@ var RouterABI = [
1491
1487
  ],
1492
1488
  stateMutability: "payable"
1493
1489
  },
1490
+ // ============ Stake+Mint Functions ============
1494
1491
  // stakeAndMint
1495
1492
  {
1496
1493
  type: "function",
@@ -1507,7 +1504,23 @@ var RouterABI = [
1507
1504
  ],
1508
1505
  stateMutability: "payable"
1509
1506
  },
1510
- // ============ Simplified Functions ============
1507
+ // stakeAndMintApUSD (simplified)
1508
+ {
1509
+ type: "function",
1510
+ name: "stakeAndMintApUSD",
1511
+ inputs: [{ name: "minMintOut", type: "uint256" }],
1512
+ outputs: [{ name: "apUSDAmount", type: "uint256" }],
1513
+ stateMutability: "payable"
1514
+ },
1515
+ // stakeAndMintXBNB (simplified)
1516
+ {
1517
+ type: "function",
1518
+ name: "stakeAndMintXBNB",
1519
+ inputs: [{ name: "minMintOut", type: "uint256" }],
1520
+ outputs: [{ name: "xBNBAmount", type: "uint256" }],
1521
+ stateMutability: "payable"
1522
+ },
1523
+ // ============ Simplified Swap+Mint Functions ============
1511
1524
  // swapAndMintApUSDDefault
1512
1525
  {
1513
1526
  type: "function",
@@ -1534,22 +1547,6 @@ var RouterABI = [
1534
1547
  outputs: [{ name: "xBNBAmount", type: "uint256" }],
1535
1548
  stateMutability: "payable"
1536
1549
  },
1537
- // stakeAndMintApUSD
1538
- {
1539
- type: "function",
1540
- name: "stakeAndMintApUSD",
1541
- inputs: [{ name: "minMintOut", type: "uint256" }],
1542
- outputs: [{ name: "apUSDAmount", type: "uint256" }],
1543
- stateMutability: "payable"
1544
- },
1545
- // stakeAndMintXBNB
1546
- {
1547
- type: "function",
1548
- name: "stakeAndMintXBNB",
1549
- inputs: [{ name: "minMintOut", type: "uint256" }],
1550
- outputs: [{ name: "xBNBAmount", type: "uint256" }],
1551
- stateMutability: "payable"
1552
- },
1553
1550
  // ============ Direct Mint/Redeem Functions ============
1554
1551
  // mintApUSD
1555
1552
  {
@@ -1599,7 +1596,7 @@ var RouterABI = [
1599
1596
  outputs: [{ name: "lstAmount", type: "uint256" }],
1600
1597
  stateMutability: "nonpayable"
1601
1598
  },
1602
- // ============ Redeem and Swap Functions ============
1599
+ // ============ Redeem + Swap Functions (V3 path) ============
1603
1600
  // redeemApUSDAndSwap
1604
1601
  {
1605
1602
  type: "function",
@@ -1607,11 +1604,9 @@ var RouterABI = [
1607
1604
  inputs: [
1608
1605
  { name: "lst", type: "address" },
1609
1606
  { name: "apUSDAmount", type: "uint256" },
1610
- { name: "outputToken", type: "address" },
1607
+ { name: "path", type: "bytes" },
1611
1608
  { name: "minOut", type: "uint256" },
1612
- { name: "deadline", type: "uint256" },
1613
- { name: "useV2", type: "bool" },
1614
- { name: "poolFee", type: "uint24" }
1609
+ { name: "deadline", type: "uint256" }
1615
1610
  ],
1616
1611
  outputs: [{ name: "outputAmount", type: "uint256" }],
1617
1612
  stateMutability: "nonpayable"
@@ -1623,39 +1618,11 @@ var RouterABI = [
1623
1618
  inputs: [
1624
1619
  { name: "lst", type: "address" },
1625
1620
  { name: "xBNBAmount", type: "uint256" },
1626
- { name: "outputToken", type: "address" },
1621
+ { name: "path", type: "bytes" },
1627
1622
  { name: "minOut", type: "uint256" },
1628
- { name: "deadline", type: "uint256" },
1629
- { name: "useV2", type: "bool" },
1630
- { name: "poolFee", type: "uint24" }
1631
- ],
1632
- outputs: [{ name: "outputAmount", type: "uint256" }],
1633
- stateMutability: "nonpayable"
1634
- },
1635
- // redeemApUSDAndUnstake
1636
- {
1637
- type: "function",
1638
- name: "redeemApUSDAndUnstake",
1639
- inputs: [
1640
- { name: "lst", type: "address" },
1641
- { name: "apUSDAmount", type: "uint256" },
1642
- { name: "minBNBOut", type: "uint256" },
1643
1623
  { name: "deadline", type: "uint256" }
1644
1624
  ],
1645
- outputs: [{ name: "bnbAmount", type: "uint256" }],
1646
- stateMutability: "nonpayable"
1647
- },
1648
- // redeemXBNBAndUnstake
1649
- {
1650
- type: "function",
1651
- name: "redeemXBNBAndUnstake",
1652
- inputs: [
1653
- { name: "lst", type: "address" },
1654
- { name: "xBNBAmount", type: "uint256" },
1655
- { name: "minBNBOut", type: "uint256" },
1656
- { name: "deadline", type: "uint256" }
1657
- ],
1658
- outputs: [{ name: "bnbAmount", type: "uint256" }],
1625
+ outputs: [{ name: "outputAmount", type: "uint256" }],
1659
1626
  stateMutability: "nonpayable"
1660
1627
  },
1661
1628
  // ============ Native Unstake Functions ============
@@ -1690,71 +1657,38 @@ var RouterABI = [
1690
1657
  stateMutability: "nonpayable"
1691
1658
  },
1692
1659
  // ============ View Functions ============
1693
- // defaultLST
1694
- {
1695
- type: "function",
1696
- name: "defaultLST",
1697
- inputs: [],
1698
- outputs: [{ name: "", type: "address" }],
1699
- stateMutability: "view"
1700
- },
1701
- // supportedInputTokens
1660
+ // Token addresses
1661
+ { type: "function", name: "wbnb", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1662
+ { type: "function", name: "usdt", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1663
+ { type: "function", name: "usdc", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1664
+ { type: "function", name: "slisBNB", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1665
+ { type: "function", name: "asBNB", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1666
+ { type: "function", name: "wclisBNB", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1667
+ { type: "function", name: "apUSD", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1668
+ { type: "function", name: "xBNB", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1669
+ // Protocol addresses
1670
+ { type: "function", name: "diamond", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1671
+ { type: "function", name: "pancakeV3Router", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1672
+ { type: "function", name: "listaStakeManager", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1673
+ { type: "function", name: "astherusMinter", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1674
+ { type: "function", name: "slisBNBProvider", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1675
+ // Configuration
1676
+ { type: "function", name: "defaultLST", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1702
1677
  {
1703
1678
  type: "function",
1704
1679
  name: "supportedInputTokens",
1705
1680
  inputs: [{ name: "token", type: "address" }],
1706
- outputs: [{ name: "", type: "bool" }],
1681
+ outputs: [{ type: "bool" }],
1707
1682
  stateMutability: "view"
1708
1683
  },
1709
- // supportedLSTs
1710
1684
  {
1711
1685
  type: "function",
1712
1686
  name: "supportedLSTs",
1713
1687
  inputs: [{ name: "lst", type: "address" }],
1714
- outputs: [{ name: "", type: "bool" }],
1715
- stateMutability: "view"
1716
- },
1717
- // diamond
1718
- {
1719
- type: "function",
1720
- name: "diamond",
1721
- inputs: [],
1722
- outputs: [{ name: "", type: "address" }],
1723
- stateMutability: "view"
1724
- },
1725
- // getExpectedMintOutput
1726
- {
1727
- type: "function",
1728
- name: "getExpectedMintOutput",
1729
- inputs: [
1730
- { name: "inputToken", type: "address" },
1731
- { name: "inputAmount", type: "uint256" },
1732
- { name: "targetLST", type: "address" },
1733
- { name: "isXBNB", type: "bool" }
1734
- ],
1735
- outputs: [
1736
- { name: "expectedLST", type: "uint256" },
1737
- { name: "expectedMint", type: "uint256" }
1738
- ],
1688
+ outputs: [{ type: "bool" }],
1739
1689
  stateMutability: "view"
1740
1690
  },
1741
- // getExpectedRedeemOutput
1742
- {
1743
- type: "function",
1744
- name: "getExpectedRedeemOutput",
1745
- inputs: [
1746
- { name: "isXBNB", type: "bool" },
1747
- { name: "redeemAmount", type: "uint256" },
1748
- { name: "lst", type: "address" },
1749
- { name: "outputToken", type: "address" }
1750
- ],
1751
- outputs: [
1752
- { name: "expectedLST", type: "uint256" },
1753
- { name: "expectedOutput", type: "uint256" }
1754
- ],
1755
- stateMutability: "view"
1756
- },
1757
- // previewMintApUSD
1691
+ // Preview functions
1758
1692
  {
1759
1693
  type: "function",
1760
1694
  name: "previewMintApUSD",
@@ -1765,7 +1699,6 @@ var RouterABI = [
1765
1699
  outputs: [{ name: "apUSDAmount", type: "uint256" }],
1766
1700
  stateMutability: "view"
1767
1701
  },
1768
- // previewMintXBNB
1769
1702
  {
1770
1703
  type: "function",
1771
1704
  name: "previewMintXBNB",
@@ -1776,7 +1709,6 @@ var RouterABI = [
1776
1709
  outputs: [{ name: "xBNBAmount", type: "uint256" }],
1777
1710
  stateMutability: "view"
1778
1711
  },
1779
- // previewRedeemApUSD
1780
1712
  {
1781
1713
  type: "function",
1782
1714
  name: "previewRedeemApUSD",
@@ -1787,7 +1719,6 @@ var RouterABI = [
1787
1719
  outputs: [{ name: "lstAmount", type: "uint256" }],
1788
1720
  stateMutability: "view"
1789
1721
  },
1790
- // previewRedeemXBNB
1791
1722
  {
1792
1723
  type: "function",
1793
1724
  name: "previewRedeemXBNB",
@@ -1798,15 +1729,14 @@ var RouterABI = [
1798
1729
  outputs: [{ name: "lstAmount", type: "uint256" }],
1799
1730
  stateMutability: "view"
1800
1731
  },
1801
- // getUserWithdrawalIndices
1732
+ // Withdrawal tracking
1802
1733
  {
1803
1734
  type: "function",
1804
1735
  name: "getUserWithdrawalIndices",
1805
1736
  inputs: [{ name: "user", type: "address" }],
1806
- outputs: [{ name: "", type: "uint256[]" }],
1737
+ outputs: [{ type: "uint256[]" }],
1807
1738
  stateMutability: "view"
1808
1739
  },
1809
- // getWithdrawalStatus
1810
1740
  {
1811
1741
  type: "function",
1812
1742
  name: "getWithdrawalStatus",
@@ -1817,116 +1747,107 @@ var RouterABI = [
1817
1747
  ],
1818
1748
  stateMutability: "view"
1819
1749
  },
1820
- // Immutable addresses
1821
1750
  {
1822
1751
  type: "function",
1823
- name: "wbnb",
1824
- inputs: [],
1825
- outputs: [{ name: "", type: "address" }],
1826
- stateMutability: "view"
1827
- },
1828
- {
1829
- type: "function",
1830
- name: "usdt",
1831
- inputs: [],
1832
- outputs: [{ name: "", type: "address" }],
1833
- stateMutability: "view"
1834
- },
1835
- {
1836
- type: "function",
1837
- name: "usdc",
1838
- inputs: [],
1839
- outputs: [{ name: "", type: "address" }],
1752
+ name: "withdrawalRequests",
1753
+ inputs: [{ name: "index", type: "uint256" }],
1754
+ outputs: [
1755
+ { name: "user", type: "address" },
1756
+ { name: "listaIdx", type: "uint256" },
1757
+ { name: "slisBNBAmount", type: "uint256" },
1758
+ { name: "claimed", type: "bool" }
1759
+ ],
1840
1760
  stateMutability: "view"
1841
1761
  },
1762
+ // ============ Admin Functions ============
1763
+ { type: "function", name: "owner", inputs: [], outputs: [{ type: "address" }], stateMutability: "view" },
1842
1764
  {
1843
1765
  type: "function",
1844
- name: "slisBNB",
1845
- inputs: [],
1846
- outputs: [{ name: "", type: "address" }],
1847
- stateMutability: "view"
1766
+ name: "setDefaultLST",
1767
+ inputs: [{ name: "lst", type: "address" }],
1768
+ outputs: [],
1769
+ stateMutability: "nonpayable"
1848
1770
  },
1849
1771
  {
1850
1772
  type: "function",
1851
- name: "asBNB",
1852
- inputs: [],
1853
- outputs: [{ name: "", type: "address" }],
1854
- stateMutability: "view"
1773
+ name: "addSupportedInputToken",
1774
+ inputs: [{ name: "token", type: "address" }],
1775
+ outputs: [],
1776
+ stateMutability: "nonpayable"
1855
1777
  },
1856
1778
  {
1857
1779
  type: "function",
1858
- name: "wclisBNB",
1859
- inputs: [],
1860
- outputs: [{ name: "", type: "address" }],
1861
- stateMutability: "view"
1780
+ name: "addSupportedLST",
1781
+ inputs: [{ name: "lst", type: "address" }],
1782
+ outputs: [],
1783
+ stateMutability: "nonpayable"
1862
1784
  },
1863
1785
  {
1864
1786
  type: "function",
1865
- name: "apUSD",
1866
- inputs: [],
1867
- outputs: [{ name: "", type: "address" }],
1868
- stateMutability: "view"
1787
+ name: "rescueTokens",
1788
+ inputs: [
1789
+ { name: "token", type: "address" },
1790
+ { name: "amount", type: "uint256" }
1791
+ ],
1792
+ outputs: [],
1793
+ stateMutability: "nonpayable"
1869
1794
  },
1870
1795
  {
1871
1796
  type: "function",
1872
- name: "xBNB",
1873
- inputs: [],
1874
- outputs: [{ name: "", type: "address" }],
1875
- stateMutability: "view"
1797
+ name: "transferOwnership",
1798
+ inputs: [{ name: "newOwner", type: "address" }],
1799
+ outputs: [],
1800
+ stateMutability: "nonpayable"
1876
1801
  },
1802
+ { type: "function", name: "renounceOwnership", inputs: [], outputs: [], stateMutability: "nonpayable" },
1877
1803
  // ============ Events ============
1878
- // SwapAndMint
1879
1804
  {
1880
1805
  type: "event",
1881
1806
  name: "SwapAndMint",
1882
1807
  inputs: [
1883
1808
  { name: "user", type: "address", indexed: true },
1884
- { name: "inputToken", type: "address", indexed: true },
1809
+ { name: "inputToken", type: "address", indexed: false },
1885
1810
  { name: "inputAmount", type: "uint256", indexed: false },
1886
- { name: "targetLST", type: "address", indexed: true },
1811
+ { name: "lst", type: "address", indexed: false },
1887
1812
  { name: "lstAmount", type: "uint256", indexed: false },
1888
1813
  { name: "mintedToken", type: "address", indexed: false },
1889
1814
  { name: "mintedAmount", type: "uint256", indexed: false }
1890
1815
  ]
1891
1816
  },
1892
- // StakeAndMint
1893
1817
  {
1894
1818
  type: "event",
1895
1819
  name: "StakeAndMint",
1896
1820
  inputs: [
1897
1821
  { name: "user", type: "address", indexed: true },
1898
1822
  { name: "bnbAmount", type: "uint256", indexed: false },
1899
- { name: "targetLST", type: "address", indexed: true },
1823
+ { name: "lst", type: "address", indexed: false },
1900
1824
  { name: "lstAmount", type: "uint256", indexed: false },
1901
- { name: "mintedToken", type: "address", indexed: true },
1825
+ { name: "mintedToken", type: "address", indexed: false },
1902
1826
  { name: "mintedAmount", type: "uint256", indexed: false }
1903
1827
  ]
1904
1828
  },
1905
- // Mint
1906
1829
  {
1907
1830
  type: "event",
1908
1831
  name: "Mint",
1909
1832
  inputs: [
1910
1833
  { name: "user", type: "address", indexed: true },
1911
- { name: "lst", type: "address", indexed: true },
1834
+ { name: "lst", type: "address", indexed: false },
1912
1835
  { name: "lstAmount", type: "uint256", indexed: false },
1913
- { name: "mintedToken", type: "address", indexed: true },
1836
+ { name: "mintedToken", type: "address", indexed: false },
1914
1837
  { name: "mintedAmount", type: "uint256", indexed: false }
1915
1838
  ]
1916
1839
  },
1917
- // Redeem
1918
1840
  {
1919
1841
  type: "event",
1920
1842
  name: "Redeem",
1921
1843
  inputs: [
1922
1844
  { name: "user", type: "address", indexed: true },
1923
- { name: "redeemedToken", type: "address", indexed: true },
1845
+ { name: "redeemedToken", type: "address", indexed: false },
1924
1846
  { name: "redeemedAmount", type: "uint256", indexed: false },
1925
- { name: "lst", type: "address", indexed: true },
1847
+ { name: "lst", type: "address", indexed: false },
1926
1848
  { name: "lstAmount", type: "uint256", indexed: false }
1927
1849
  ]
1928
1850
  },
1929
- // RedeemAndSwap
1930
1851
  {
1931
1852
  type: "event",
1932
1853
  name: "RedeemAndSwap",
@@ -1936,57 +1857,69 @@ var RouterABI = [
1936
1857
  { name: "redeemedAmount", type: "uint256", indexed: false },
1937
1858
  { name: "lst", type: "address", indexed: false },
1938
1859
  { name: "lstAmount", type: "uint256", indexed: false },
1939
- { name: "outputToken", type: "address", indexed: true },
1860
+ { name: "outputToken", type: "address", indexed: false },
1940
1861
  { name: "outputAmount", type: "uint256", indexed: false }
1941
1862
  ]
1942
1863
  },
1943
- // UnstakeRequested
1944
1864
  {
1945
1865
  type: "event",
1946
1866
  name: "UnstakeRequested",
1947
1867
  inputs: [
1948
1868
  { name: "user", type: "address", indexed: true },
1949
- { name: "requestIndex", type: "uint256", indexed: true },
1869
+ { name: "requestIndex", type: "uint256", indexed: false },
1950
1870
  { name: "redeemedToken", type: "address", indexed: false },
1951
1871
  { name: "redeemedAmount", type: "uint256", indexed: false },
1952
1872
  { name: "slisBNBAmount", type: "uint256", indexed: false }
1953
1873
  ]
1954
1874
  },
1955
- // UnstakeClaimed
1956
1875
  {
1957
1876
  type: "event",
1958
1877
  name: "UnstakeClaimed",
1959
1878
  inputs: [
1960
1879
  { name: "user", type: "address", indexed: true },
1961
- { name: "requestIndex", type: "uint256", indexed: true },
1880
+ { name: "requestIndex", type: "uint256", indexed: false },
1962
1881
  { name: "bnbAmount", type: "uint256", indexed: false }
1963
1882
  ]
1964
1883
  },
1965
- // DefaultLSTUpdated
1966
1884
  {
1967
1885
  type: "event",
1968
1886
  name: "DefaultLSTUpdated",
1969
1887
  inputs: [
1970
- { name: "oldLST", type: "address", indexed: true },
1971
- { name: "newLST", type: "address", indexed: true }
1888
+ { name: "oldLST", type: "address", indexed: false },
1889
+ { name: "newLST", type: "address", indexed: false }
1890
+ ]
1891
+ },
1892
+ {
1893
+ type: "event",
1894
+ name: "OwnershipTransferred",
1895
+ inputs: [
1896
+ { name: "previousOwner", type: "address", indexed: true },
1897
+ { name: "newOwner", type: "address", indexed: true }
1972
1898
  ]
1973
1899
  },
1974
1900
  // ============ Errors ============
1975
- { type: "error", name: "UnsupportedInputToken", inputs: [] },
1976
- { type: "error", name: "UnsupportedLST", inputs: [] },
1977
1901
  { type: "error", name: "DeadlineExpired", inputs: [] },
1902
+ { type: "error", name: "DefaultLSTNotSet", inputs: [] },
1978
1903
  { type: "error", name: "InsufficientOutput", inputs: [] },
1979
- { type: "error", name: "ZeroAmount", inputs: [] },
1904
+ { type: "error", name: "InvalidPoolFee", inputs: [] },
1980
1905
  { type: "error", name: "InvalidRecipient", inputs: [] },
1981
- { type: "error", name: "SwapFailed", inputs: [] },
1906
+ { type: "error", name: "InvalidWithdrawalRequest", inputs: [] },
1982
1907
  { type: "error", name: "MintFailed", inputs: [] },
1983
1908
  { type: "error", name: "NativeTransferFailed", inputs: [] },
1984
- { type: "error", name: "InvalidPoolFee", inputs: [] },
1985
- { type: "error", name: "DefaultLSTNotSet", inputs: [] },
1986
- { type: "error", name: "InvalidWithdrawalRequest", inputs: [] },
1987
- { type: "error", name: "WithdrawalNotClaimable", inputs: [] },
1909
+ { type: "error", name: "OnlySlisBNBSupported", inputs: [] },
1910
+ { type: "error", name: "SwapFailed", inputs: [] },
1911
+ { type: "error", name: "UnsupportedInputToken", inputs: [] },
1912
+ { type: "error", name: "UnsupportedLST", inputs: [] },
1913
+ { type: "error", name: "V3PoolNotFound", inputs: [] },
1988
1914
  { type: "error", name: "WithdrawalAlreadyClaimed", inputs: [] },
1989
- { type: "error", name: "OnlySlisBNBSupported", inputs: [] }
1915
+ { type: "error", name: "WithdrawalNotClaimable", inputs: [] },
1916
+ { type: "error", name: "ZeroAmount", inputs: [] },
1917
+ { type: "error", name: "ReentrancyGuardReentrantCall", inputs: [] },
1918
+ { type: "error", name: "OwnableInvalidOwner", inputs: [{ name: "owner", type: "address" }] },
1919
+ { type: "error", name: "OwnableUnauthorizedAccount", inputs: [{ name: "account", type: "address" }] },
1920
+ { type: "error", name: "SafeERC20FailedOperation", inputs: [{ name: "token", type: "address" }] },
1921
+ // Receive
1922
+ { type: "receive", stateMutability: "payable" }
1990
1923
  ];
1991
1924
 
1992
1925
  // src/router.ts
@@ -2045,36 +1978,6 @@ var AspanRouterReadClient = class {
2045
1978
  functionName: "diamond"
2046
1979
  });
2047
1980
  }
2048
- /**
2049
- * Get expected output from a swap and mint operation
2050
- */
2051
- async getExpectedMintOutput(inputToken, inputAmount, targetLST, isXBNB) {
2052
- const result = await this.publicClient.readContract({
2053
- address: this.routerAddress,
2054
- abi: RouterABI,
2055
- functionName: "getExpectedMintOutput",
2056
- args: [inputToken, inputAmount, targetLST, isXBNB]
2057
- });
2058
- return {
2059
- expectedLST: result[0],
2060
- expectedMint: result[1]
2061
- };
2062
- }
2063
- /**
2064
- * Get expected output from a redeem and swap operation
2065
- */
2066
- async getExpectedRedeemOutput(isXBNB, redeemAmount, lst, outputToken) {
2067
- const result = await this.publicClient.readContract({
2068
- address: this.routerAddress,
2069
- abi: RouterABI,
2070
- functionName: "getExpectedRedeemOutput",
2071
- args: [isXBNB, redeemAmount, lst, outputToken]
2072
- });
2073
- return {
2074
- expectedLST: result[0],
2075
- expectedMint: result[1]
2076
- };
2077
- }
2078
1981
  /**
2079
1982
  * Preview apUSD mint output for a given LST amount
2080
1983
  */
@@ -2238,11 +2141,9 @@ var AspanRouterClient = class extends AspanRouterReadClient {
2238
2141
  inputAmount: params.swapParams.inputAmount,
2239
2142
  targetLST: params.swapParams.targetLST,
2240
2143
  minLSTOut: params.swapParams.minLSTOut,
2241
- poolFee: params.swapParams.poolFee,
2242
- useV2: params.swapParams.useV2
2144
+ poolFee: params.swapParams.poolFee
2243
2145
  },
2244
2146
  {
2245
- mintXBNB: params.mintParams.mintXBNB,
2246
2147
  minMintOut: params.mintParams.minMintOut,
2247
2148
  recipient: params.mintParams.recipient,
2248
2149
  deadline: params.mintParams.deadline
@@ -2268,11 +2169,9 @@ var AspanRouterClient = class extends AspanRouterReadClient {
2268
2169
  inputAmount: params.swapParams.inputAmount,
2269
2170
  targetLST: params.swapParams.targetLST,
2270
2171
  minLSTOut: params.swapParams.minLSTOut,
2271
- poolFee: params.swapParams.poolFee,
2272
- useV2: params.swapParams.useV2
2172
+ poolFee: params.swapParams.poolFee
2273
2173
  },
2274
2174
  {
2275
- mintXBNB: params.mintParams.mintXBNB,
2276
2175
  minMintOut: params.mintParams.minMintOut,
2277
2176
  recipient: params.mintParams.recipient,
2278
2177
  deadline: params.mintParams.deadline
@@ -2424,7 +2323,8 @@ var AspanRouterClient = class extends AspanRouterReadClient {
2424
2323
  }
2425
2324
  // ============ Redeem and Swap Functions ============
2426
2325
  /**
2427
- * Redeem apUSD and swap LST to output token
2326
+ * Redeem apUSD and swap LST to output token via V3 path
2327
+ * @param params.path - PancakeSwap V3 encoded path (use encodeV3Path helper)
2428
2328
  */
2429
2329
  async redeemApUSDAndSwap(params) {
2430
2330
  return this.walletClient.writeContract({
@@ -2436,16 +2336,15 @@ var AspanRouterClient = class extends AspanRouterReadClient {
2436
2336
  args: [
2437
2337
  params.lst,
2438
2338
  params.amount,
2439
- params.outputToken,
2339
+ params.path,
2440
2340
  params.minOut,
2441
- params.deadline,
2442
- params.useV2,
2443
- params.poolFee
2341
+ params.deadline
2444
2342
  ]
2445
2343
  });
2446
2344
  }
2447
2345
  /**
2448
- * Redeem xBNB and swap LST to output token
2346
+ * Redeem xBNB and swap LST to output token via V3 path
2347
+ * @param params.path - PancakeSwap V3 encoded path (use encodeV3Path helper)
2449
2348
  */
2450
2349
  async redeemXBNBAndSwap(params) {
2451
2350
  return this.walletClient.writeContract({
@@ -2457,40 +2356,12 @@ var AspanRouterClient = class extends AspanRouterReadClient {
2457
2356
  args: [
2458
2357
  params.lst,
2459
2358
  params.amount,
2460
- params.outputToken,
2359
+ params.path,
2461
2360
  params.minOut,
2462
- params.deadline,
2463
- params.useV2,
2464
- params.poolFee
2361
+ params.deadline
2465
2362
  ]
2466
2363
  });
2467
2364
  }
2468
- /**
2469
- * Redeem apUSD and instantly unstake LST to native BNB via DEX
2470
- */
2471
- async redeemApUSDAndUnstake(params) {
2472
- return this.walletClient.writeContract({
2473
- chain: this.chain,
2474
- account: this.walletClient.account,
2475
- address: this.routerAddress,
2476
- abi: RouterABI,
2477
- functionName: "redeemApUSDAndUnstake",
2478
- args: [params.lst, params.amount, params.minBNBOut, params.deadline]
2479
- });
2480
- }
2481
- /**
2482
- * Redeem xBNB and instantly unstake LST to native BNB via DEX
2483
- */
2484
- async redeemXBNBAndUnstake(params) {
2485
- return this.walletClient.writeContract({
2486
- chain: this.chain,
2487
- account: this.walletClient.account,
2488
- address: this.routerAddress,
2489
- abi: RouterABI,
2490
- functionName: "redeemXBNBAndUnstake",
2491
- args: [params.lst, params.amount, params.minBNBOut, params.deadline]
2492
- });
2493
- }
2494
2365
  // ============ Native Unstake Functions ============
2495
2366
  /**
2496
2367
  * Redeem apUSD and request native unstake from Lista (starts unbonding period)
@@ -2570,6 +2441,19 @@ function createRouterTestnetClient(routerAddress, account, rpcUrl) {
2570
2441
  });
2571
2442
  }
2572
2443
 
2444
+ // src/types.ts
2445
+ function encodeV3Path(tokens, fees) {
2446
+ if (tokens.length < 2) throw new Error("Path must have at least 2 tokens");
2447
+ if (fees.length !== tokens.length - 1) throw new Error("Fees length must be tokens.length - 1");
2448
+ let path = tokens[0].toLowerCase().slice(2);
2449
+ for (let i = 0; i < fees.length; i++) {
2450
+ const feeHex = fees[i].toString(16).padStart(6, "0");
2451
+ path += feeHex;
2452
+ path += tokens[i + 1].toLowerCase().slice(2);
2453
+ }
2454
+ return `0x${path}`;
2455
+ }
2456
+
2573
2457
  // src/index.ts
2574
2458
  var PRECISION = 10n ** 18n;
2575
2459
  var BPS_PRECISION = 10000n;
@@ -2624,6 +2508,7 @@ export {
2624
2508
  createRouterReadClient,
2625
2509
  createRouterTestnetClient,
2626
2510
  createRouterTestnetReadClient,
2511
+ encodeV3Path,
2627
2512
  formatAmount,
2628
2513
  formatCR,
2629
2514
  formatFeeBPS,