@aspan/sdk 0.3.1 → 0.4.0

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
@@ -221,7 +221,7 @@ interface RouterMintParams {
221
221
  /** Transaction deadline timestamp */
222
222
  deadline: bigint;
223
223
  }
224
- /** Parameters for swapAndMint functions */
224
+ /** Parameters for swapAndMint function */
225
225
  interface SwapAndMintParams {
226
226
  swapParams: RouterSwapParams;
227
227
  mintParams: RouterMintParams;
@@ -239,12 +239,14 @@ interface StakeAndMintParams {
239
239
  /** Native BNB amount to stake */
240
240
  value: bigint;
241
241
  }
242
- /** Parameters for simplified swap and mint functions */
242
+ /** Parameters for swapAndMintDefault function */
243
243
  interface SwapAndMintDefaultParams {
244
244
  /** Input token address (address(0) for native BNB) */
245
245
  inputToken: Address;
246
246
  /** Amount of input token */
247
247
  inputAmount: bigint;
248
+ /** true = mint xBNB, false = mint apUSD */
249
+ mintXBNB: boolean;
248
250
  /** Minimum output to receive */
249
251
  minMintOut: bigint;
250
252
  /** Transaction deadline timestamp */
@@ -252,51 +254,39 @@ interface SwapAndMintDefaultParams {
252
254
  /** Native BNB amount (if inputToken is address(0)) */
253
255
  value?: bigint;
254
256
  }
255
- /** Parameters for router direct mint functions */
256
- interface RouterMintApUSDParams {
257
- /** LST token address */
258
- lst: Address;
259
- /** Amount of LST to deposit */
260
- lstAmount: bigint;
261
- /** Minimum apUSD to receive */
262
- minOut?: bigint;
263
- }
264
- /** Parameters for router direct mint xBNB functions */
265
- interface RouterMintXBNBParams {
257
+ /** Parameters for router mint function (unified) */
258
+ interface RouterMintParams2 {
266
259
  /** LST token address */
267
260
  lst: Address;
268
261
  /** Amount of LST to deposit */
269
262
  lstAmount: bigint;
270
- /** Minimum xBNB to receive */
271
- minOut?: bigint;
272
- }
273
- /** Parameters for router redeem apUSD functions */
274
- interface RouterRedeemApUSDParams {
275
- /** LST token to receive */
276
- lst: Address;
277
- /** Amount of apUSD to redeem */
278
- apUSDAmount: bigint;
279
- /** Minimum LST to receive */
263
+ /** true = mint xBNB, false = mint apUSD */
264
+ mintXBNB: boolean;
265
+ /** Minimum output to receive */
280
266
  minOut?: bigint;
281
267
  }
282
- /** Parameters for router redeem xBNB functions */
283
- interface RouterRedeemXBNBParams {
268
+ /** Parameters for router redeem function (unified) */
269
+ interface RouterRedeemParams {
284
270
  /** LST token to receive */
285
271
  lst: Address;
286
- /** Amount of xBNB to redeem */
287
- xBNBAmount: bigint;
272
+ /** true = redeem xBNB, false = redeem apUSD */
273
+ redeemXBNB: boolean;
274
+ /** Amount of apUSD/xBNB to redeem */
275
+ amount: bigint;
288
276
  /** Minimum LST to receive */
289
277
  minOut?: bigint;
290
278
  }
291
- /** Parameters for redeemAndSwap functions (uses PancakeSwap V3 path) */
279
+ /** Parameters for redeemAndSwap function (unified with unwrapBNB) */
292
280
  interface RouterRedeemAndSwapParams {
293
281
  /** LST to redeem */
294
282
  lst: Address;
283
+ /** true = redeem xBNB, false = redeem apUSD */
284
+ redeemXBNB: boolean;
295
285
  /** Amount to redeem (apUSD or xBNB) */
296
286
  amount: bigint;
297
287
  /**
298
288
  * PancakeSwap V3 encoded swap path (LST → ... → outputToken)
299
- * Use encodeV3Path() helper or get from PancakeSwap Quoter
289
+ * Use encodeV3Path() helper
300
290
  * Example: slisBNB → WBNB → USDT
301
291
  */
302
292
  path: `0x${string}`;
@@ -304,6 +294,15 @@ interface RouterRedeemAndSwapParams {
304
294
  minOut: bigint;
305
295
  /** Transaction deadline timestamp */
306
296
  deadline: bigint;
297
+ /** If true and output is WBNB, unwrap to native BNB */
298
+ unwrapBNB: boolean;
299
+ }
300
+ /** Parameters for redeemAndRequestUnstake function (unified) */
301
+ interface RouterRedeemAndUnstakeParams {
302
+ /** true = redeem xBNB, false = redeem apUSD */
303
+ redeemXBNB: boolean;
304
+ /** Amount to redeem (apUSD or xBNB) */
305
+ amount: bigint;
307
306
  }
308
307
  /**
309
308
  * Encode a PancakeSwap V3 swap path
@@ -319,6 +318,13 @@ interface WithdrawalRequestInfo {
319
318
  /** Amount of BNB to receive */
320
319
  bnbAmount: bigint;
321
320
  }
321
+ /** Expected output from swap and mint */
322
+ interface ExpectedOutput {
323
+ /** Expected LST from swap */
324
+ expectedLST: bigint;
325
+ /** Expected apUSD/xBNB from mint */
326
+ expectedMint: bigint;
327
+ }
322
328
  /** SwapAndMint event */
323
329
  interface SwapAndMintEvent {
324
330
  user: Address;
@@ -578,21 +584,19 @@ declare class AspanRouterReadClient {
578
584
  */
579
585
  getDiamond(): Promise<Address>;
580
586
  /**
581
- * Preview apUSD mint output for a given LST amount
582
- */
583
- previewMintApUSD(lst: Address, lstAmount: bigint): Promise<bigint>;
584
- /**
585
- * Preview xBNB mint output for a given LST amount
587
+ * Preview mint output for a given LST amount
588
+ * @param lst LST token address
589
+ * @param lstAmount Amount of LST
590
+ * @param mintXBNB true = preview xBNB mint, false = preview apUSD mint
586
591
  */
587
- previewMintXBNB(lst: Address, lstAmount: bigint): Promise<bigint>;
592
+ previewMint(lst: Address, lstAmount: bigint, mintXBNB: boolean): Promise<bigint>;
588
593
  /**
589
- * Preview LST output for redeeming apUSD
594
+ * Preview redeem output
595
+ * @param lst LST token to receive
596
+ * @param redeemXBNB true = redeem xBNB, false = redeem apUSD
597
+ * @param amount Amount of apUSD/xBNB to redeem
590
598
  */
591
- previewRedeemApUSD(lst: Address, apUSDAmount: bigint): Promise<bigint>;
592
- /**
593
- * Preview LST output for redeeming xBNB
594
- */
595
- previewRedeemXBNB(lst: Address, xBNBAmount: bigint): Promise<bigint>;
599
+ previewRedeem(lst: Address, redeemXBNB: boolean, amount: bigint): Promise<bigint>;
596
600
  /**
597
601
  * Get user's withdrawal request indices
598
602
  */
@@ -617,67 +621,43 @@ declare class AspanRouterClient extends AspanRouterReadClient {
617
621
  readonly walletClient: WalletClient;
618
622
  constructor(config: AspanRouterWriteClientConfig);
619
623
  /**
620
- * Swap input token to LST and mint apUSD
624
+ * Swap input token to LST and mint apUSD or xBNB
625
+ * @param params.swapParams Swap configuration
626
+ * @param params.mintParams Mint configuration (mintXBNB determines output token)
621
627
  */
622
- swapAndMintApUSD(params: SwapAndMintParams): Promise<Hash>;
628
+ swapAndMint(params: SwapAndMintParams): Promise<Hash>;
623
629
  /**
624
- * Swap input token to LST and mint xBNB
630
+ * Swap input token and mint using default LST (simplified)
631
+ * @param params.mintXBNB true = mint xBNB, false = mint apUSD
625
632
  */
626
- swapAndMintXBNB(params: SwapAndMintParams): Promise<Hash>;
633
+ swapAndMintDefault(params: SwapAndMintDefaultParams): Promise<Hash>;
627
634
  /**
628
635
  * Stake native BNB directly to LST and mint
636
+ * @param params.isXBNB true = mint xBNB, false = mint apUSD
629
637
  */
630
638
  stakeAndMint(params: StakeAndMintParams): Promise<Hash>;
631
639
  /**
632
- * Swap input token and mint apUSD using default LST
633
- */
634
- swapAndMintApUSDDefault(params: SwapAndMintDefaultParams): Promise<Hash>;
635
- /**
636
- * Swap input token and mint xBNB using default LST
637
- */
638
- swapAndMintXBNBDefault(params: SwapAndMintDefaultParams): Promise<Hash>;
639
- /**
640
- * Stake native BNB and mint apUSD using default LST
641
- */
642
- stakeAndMintApUSD(minMintOut: bigint, value: bigint): Promise<Hash>;
643
- /**
644
- * Stake native BNB and mint xBNB using default LST
645
- */
646
- stakeAndMintXBNB(minMintOut: bigint, value: bigint): Promise<Hash>;
647
- /**
648
- * Mint apUSD by providing LST directly (no swap)
649
- */
650
- mintApUSD(params: RouterMintApUSDParams): Promise<Hash>;
651
- /**
652
- * Mint xBNB by providing LST directly (no swap)
653
- */
654
- mintXBNB(params: RouterMintXBNBParams): Promise<Hash>;
655
- /**
656
- * Redeem apUSD for LST (no swap)
657
- */
658
- redeemApUSD(params: RouterRedeemApUSDParams): Promise<Hash>;
659
- /**
660
- * Redeem xBNB for LST (no swap)
661
- */
662
- redeemXBNB(params: RouterRedeemXBNBParams): Promise<Hash>;
663
- /**
664
- * Redeem apUSD and swap LST to output token via V3 path
665
- * @param params.path - PancakeSwap V3 encoded path (use encodeV3Path helper)
640
+ * Mint apUSD or xBNB by providing LST directly (no swap)
641
+ * @param params.mintXBNB true = mint xBNB, false = mint apUSD
666
642
  */
667
- redeemApUSDAndSwap(params: RouterRedeemAndSwapParams): Promise<Hash>;
643
+ mint(params: RouterMintParams2): Promise<Hash>;
668
644
  /**
669
- * Redeem xBNB and swap LST to output token via V3 path
670
- * @param params.path - PancakeSwap V3 encoded path (use encodeV3Path helper)
645
+ * Redeem apUSD or xBNB for LST (no swap)
646
+ * @param params.redeemXBNB true = redeem xBNB, false = redeem apUSD
671
647
  */
672
- redeemXBNBAndSwap(params: RouterRedeemAndSwapParams): Promise<Hash>;
648
+ redeem(params: RouterRedeemParams): Promise<Hash>;
673
649
  /**
674
- * Redeem apUSD and request native unstake from Lista (starts unbonding period)
650
+ * Redeem apUSD/xBNB and swap LST to output token via V3 path
651
+ * @param params.redeemXBNB true = redeem xBNB, false = redeem apUSD
652
+ * @param params.path PancakeSwap V3 encoded path (use encodeV3Path helper)
653
+ * @param params.unwrapBNB If true and output is WBNB, unwrap to native BNB
675
654
  */
676
- redeemApUSDAndRequestUnstake(apUSDAmount: bigint): Promise<Hash>;
655
+ redeemAndSwap(params: RouterRedeemAndSwapParams): Promise<Hash>;
677
656
  /**
678
- * Redeem xBNB and request native unstake from Lista (starts unbonding period)
657
+ * Redeem apUSD/xBNB and request native unstake from Lista (starts unbonding period)
658
+ * @param params.redeemXBNB true = redeem xBNB, false = redeem apUSD
679
659
  */
680
- redeemXBNBAndRequestUnstake(xBNBAmount: bigint): Promise<Hash>;
660
+ redeemAndRequestUnstake(params: RouterRedeemAndUnstakeParams): Promise<Hash>;
681
661
  /**
682
662
  * Claim BNB after unbonding period completes
683
663
  */
@@ -1646,11 +1626,11 @@ declare const DiamondABI: readonly [{
1646
1626
  /**
1647
1627
  * AspanRouter ABI
1648
1628
  * Periphery contract for one-click swap+mint operations
1649
- * Updated: 2025-01-31
1629
+ * Updated: 2026-02-04 (v2.0.0 - consolidated API)
1650
1630
  */
1651
1631
  declare const RouterABI: readonly [{
1652
1632
  readonly type: "function";
1653
- readonly name: "swapAndMintApUSD";
1633
+ readonly name: "swapAndMint";
1654
1634
  readonly inputs: readonly [{
1655
1635
  readonly name: "swapParams";
1656
1636
  readonly type: "tuple";
@@ -1687,77 +1667,6 @@ declare const RouterABI: readonly [{
1687
1667
  readonly type: "uint256";
1688
1668
  }];
1689
1669
  }];
1690
- readonly outputs: readonly [{
1691
- readonly name: "lstAmount";
1692
- readonly type: "uint256";
1693
- }, {
1694
- readonly name: "apUSDAmount";
1695
- readonly type: "uint256";
1696
- }];
1697
- readonly stateMutability: "payable";
1698
- }, {
1699
- readonly type: "function";
1700
- readonly name: "swapAndMintXBNB";
1701
- readonly inputs: readonly [{
1702
- readonly name: "swapParams";
1703
- readonly type: "tuple";
1704
- readonly components: readonly [{
1705
- readonly name: "inputToken";
1706
- readonly type: "address";
1707
- }, {
1708
- readonly name: "inputAmount";
1709
- readonly type: "uint256";
1710
- }, {
1711
- readonly name: "targetLST";
1712
- readonly type: "address";
1713
- }, {
1714
- readonly name: "minLSTOut";
1715
- readonly type: "uint256";
1716
- }, {
1717
- readonly name: "poolFee";
1718
- readonly type: "uint24";
1719
- }];
1720
- }, {
1721
- readonly name: "mintParams";
1722
- readonly type: "tuple";
1723
- readonly components: readonly [{
1724
- readonly name: "mintXBNB";
1725
- readonly type: "bool";
1726
- }, {
1727
- readonly name: "minMintOut";
1728
- readonly type: "uint256";
1729
- }, {
1730
- readonly name: "recipient";
1731
- readonly type: "address";
1732
- }, {
1733
- readonly name: "deadline";
1734
- readonly type: "uint256";
1735
- }];
1736
- }];
1737
- readonly outputs: readonly [{
1738
- readonly name: "lstAmount";
1739
- readonly type: "uint256";
1740
- }, {
1741
- readonly name: "xBNBAmount";
1742
- readonly type: "uint256";
1743
- }];
1744
- readonly stateMutability: "payable";
1745
- }, {
1746
- readonly type: "function";
1747
- readonly name: "stakeAndMint";
1748
- readonly inputs: readonly [{
1749
- readonly name: "targetLST";
1750
- readonly type: "address";
1751
- }, {
1752
- readonly name: "isXBNB";
1753
- readonly type: "bool";
1754
- }, {
1755
- readonly name: "minMintOut";
1756
- readonly type: "uint256";
1757
- }, {
1758
- readonly name: "deadline";
1759
- readonly type: "uint256";
1760
- }];
1761
1670
  readonly outputs: readonly [{
1762
1671
  readonly name: "lstAmount";
1763
1672
  readonly type: "uint256";
@@ -1768,37 +1677,16 @@ declare const RouterABI: readonly [{
1768
1677
  readonly stateMutability: "payable";
1769
1678
  }, {
1770
1679
  readonly type: "function";
1771
- readonly name: "stakeAndMintApUSD";
1772
- readonly inputs: readonly [{
1773
- readonly name: "minMintOut";
1774
- readonly type: "uint256";
1775
- }];
1776
- readonly outputs: readonly [{
1777
- readonly name: "apUSDAmount";
1778
- readonly type: "uint256";
1779
- }];
1780
- readonly stateMutability: "payable";
1781
- }, {
1782
- readonly type: "function";
1783
- readonly name: "stakeAndMintXBNB";
1784
- readonly inputs: readonly [{
1785
- readonly name: "minMintOut";
1786
- readonly type: "uint256";
1787
- }];
1788
- readonly outputs: readonly [{
1789
- readonly name: "xBNBAmount";
1790
- readonly type: "uint256";
1791
- }];
1792
- readonly stateMutability: "payable";
1793
- }, {
1794
- readonly type: "function";
1795
- readonly name: "swapAndMintApUSDDefault";
1680
+ readonly name: "swapAndMintDefault";
1796
1681
  readonly inputs: readonly [{
1797
1682
  readonly name: "inputToken";
1798
1683
  readonly type: "address";
1799
1684
  }, {
1800
1685
  readonly name: "inputAmount";
1801
1686
  readonly type: "uint256";
1687
+ }, {
1688
+ readonly name: "mintXBNB";
1689
+ readonly type: "bool";
1802
1690
  }, {
1803
1691
  readonly name: "minMintOut";
1804
1692
  readonly type: "uint256";
@@ -1807,19 +1695,19 @@ declare const RouterABI: readonly [{
1807
1695
  readonly type: "uint256";
1808
1696
  }];
1809
1697
  readonly outputs: readonly [{
1810
- readonly name: "apUSDAmount";
1698
+ readonly name: "mintedAmount";
1811
1699
  readonly type: "uint256";
1812
1700
  }];
1813
1701
  readonly stateMutability: "payable";
1814
1702
  }, {
1815
1703
  readonly type: "function";
1816
- readonly name: "swapAndMintXBNBDefault";
1704
+ readonly name: "stakeAndMint";
1817
1705
  readonly inputs: readonly [{
1818
- readonly name: "inputToken";
1706
+ readonly name: "targetLST";
1819
1707
  readonly type: "address";
1820
1708
  }, {
1821
- readonly name: "inputAmount";
1822
- readonly type: "uint256";
1709
+ readonly name: "isXBNB";
1710
+ readonly type: "bool";
1823
1711
  }, {
1824
1712
  readonly name: "minMintOut";
1825
1713
  readonly type: "uint256";
@@ -1828,31 +1716,16 @@ declare const RouterABI: readonly [{
1828
1716
  readonly type: "uint256";
1829
1717
  }];
1830
1718
  readonly outputs: readonly [{
1831
- readonly name: "xBNBAmount";
1832
- readonly type: "uint256";
1833
- }];
1834
- readonly stateMutability: "payable";
1835
- }, {
1836
- readonly type: "function";
1837
- readonly name: "mintApUSD";
1838
- readonly inputs: readonly [{
1839
- readonly name: "lst";
1840
- readonly type: "address";
1841
- }, {
1842
1719
  readonly name: "lstAmount";
1843
1720
  readonly type: "uint256";
1844
1721
  }, {
1845
- readonly name: "minOut";
1846
- readonly type: "uint256";
1847
- }];
1848
- readonly outputs: readonly [{
1849
- readonly name: "apUSDAmount";
1722
+ readonly name: "mintedAmount";
1850
1723
  readonly type: "uint256";
1851
1724
  }];
1852
- readonly stateMutability: "nonpayable";
1725
+ readonly stateMutability: "payable";
1853
1726
  }, {
1854
1727
  readonly type: "function";
1855
- readonly name: "mintXBNB";
1728
+ readonly name: "mint";
1856
1729
  readonly inputs: readonly [{
1857
1730
  readonly name: "lst";
1858
1731
  readonly type: "address";
@@ -1860,40 +1733,28 @@ declare const RouterABI: readonly [{
1860
1733
  readonly name: "lstAmount";
1861
1734
  readonly type: "uint256";
1862
1735
  }, {
1863
- readonly name: "minOut";
1864
- readonly type: "uint256";
1865
- }];
1866
- readonly outputs: readonly [{
1867
- readonly name: "xBNBAmount";
1868
- readonly type: "uint256";
1869
- }];
1870
- readonly stateMutability: "nonpayable";
1871
- }, {
1872
- readonly type: "function";
1873
- readonly name: "redeemApUSD";
1874
- readonly inputs: readonly [{
1875
- readonly name: "lst";
1876
- readonly type: "address";
1877
- }, {
1878
- readonly name: "apUSDAmount";
1879
- readonly type: "uint256";
1736
+ readonly name: "mintXBNB";
1737
+ readonly type: "bool";
1880
1738
  }, {
1881
1739
  readonly name: "minOut";
1882
1740
  readonly type: "uint256";
1883
1741
  }];
1884
1742
  readonly outputs: readonly [{
1885
- readonly name: "lstAmount";
1743
+ readonly name: "mintedAmount";
1886
1744
  readonly type: "uint256";
1887
1745
  }];
1888
1746
  readonly stateMutability: "nonpayable";
1889
1747
  }, {
1890
1748
  readonly type: "function";
1891
- readonly name: "redeemXBNB";
1749
+ readonly name: "redeem";
1892
1750
  readonly inputs: readonly [{
1893
1751
  readonly name: "lst";
1894
1752
  readonly type: "address";
1895
1753
  }, {
1896
- readonly name: "xBNBAmount";
1754
+ readonly name: "redeemXBNB";
1755
+ readonly type: "bool";
1756
+ }, {
1757
+ readonly name: "amount";
1897
1758
  readonly type: "uint256";
1898
1759
  }, {
1899
1760
  readonly name: "minOut";
@@ -1906,36 +1767,15 @@ declare const RouterABI: readonly [{
1906
1767
  readonly stateMutability: "nonpayable";
1907
1768
  }, {
1908
1769
  readonly type: "function";
1909
- readonly name: "redeemApUSDAndSwap";
1770
+ readonly name: "redeemAndSwap";
1910
1771
  readonly inputs: readonly [{
1911
1772
  readonly name: "lst";
1912
1773
  readonly type: "address";
1913
1774
  }, {
1914
- readonly name: "apUSDAmount";
1915
- readonly type: "uint256";
1916
- }, {
1917
- readonly name: "path";
1918
- readonly type: "bytes";
1919
- }, {
1920
- readonly name: "minOut";
1921
- readonly type: "uint256";
1922
- }, {
1923
- readonly name: "deadline";
1924
- readonly type: "uint256";
1925
- }];
1926
- readonly outputs: readonly [{
1927
- readonly name: "outputAmount";
1928
- readonly type: "uint256";
1929
- }];
1930
- readonly stateMutability: "nonpayable";
1931
- }, {
1932
- readonly type: "function";
1933
- readonly name: "redeemXBNBAndSwap";
1934
- readonly inputs: readonly [{
1935
- readonly name: "lst";
1936
- readonly type: "address";
1775
+ readonly name: "redeemXBNB";
1776
+ readonly type: "bool";
1937
1777
  }, {
1938
- readonly name: "xBNBAmount";
1778
+ readonly name: "amount";
1939
1779
  readonly type: "uint256";
1940
1780
  }, {
1941
1781
  readonly name: "path";
@@ -1946,6 +1786,9 @@ declare const RouterABI: readonly [{
1946
1786
  }, {
1947
1787
  readonly name: "deadline";
1948
1788
  readonly type: "uint256";
1789
+ }, {
1790
+ readonly name: "unwrapBNB";
1791
+ readonly type: "bool";
1949
1792
  }];
1950
1793
  readonly outputs: readonly [{
1951
1794
  readonly name: "outputAmount";
@@ -1954,24 +1797,12 @@ declare const RouterABI: readonly [{
1954
1797
  readonly stateMutability: "nonpayable";
1955
1798
  }, {
1956
1799
  readonly type: "function";
1957
- readonly name: "redeemApUSDAndRequestUnstake";
1800
+ readonly name: "redeemAndRequestUnstake";
1958
1801
  readonly inputs: readonly [{
1959
- readonly name: "apUSDAmount";
1960
- readonly type: "uint256";
1961
- }];
1962
- readonly outputs: readonly [{
1963
- readonly name: "requestIndex";
1964
- readonly type: "uint256";
1802
+ readonly name: "redeemXBNB";
1803
+ readonly type: "bool";
1965
1804
  }, {
1966
- readonly name: "slisBNBAmount";
1967
- readonly type: "uint256";
1968
- }];
1969
- readonly stateMutability: "nonpayable";
1970
- }, {
1971
- readonly type: "function";
1972
- readonly name: "redeemXBNBAndRequestUnstake";
1973
- readonly inputs: readonly [{
1974
- readonly name: "xBNBAmount";
1805
+ readonly name: "amount";
1975
1806
  readonly type: "uint256";
1976
1807
  }];
1977
1808
  readonly outputs: readonly [{
@@ -2130,57 +1961,33 @@ declare const RouterABI: readonly [{
2130
1961
  readonly stateMutability: "view";
2131
1962
  }, {
2132
1963
  readonly type: "function";
2133
- readonly name: "previewMintApUSD";
1964
+ readonly name: "previewMint";
2134
1965
  readonly inputs: readonly [{
2135
1966
  readonly name: "lst";
2136
1967
  readonly type: "address";
2137
1968
  }, {
2138
1969
  readonly name: "lstAmount";
2139
1970
  readonly type: "uint256";
2140
- }];
2141
- readonly outputs: readonly [{
2142
- readonly name: "apUSDAmount";
2143
- readonly type: "uint256";
2144
- }];
2145
- readonly stateMutability: "view";
2146
- }, {
2147
- readonly type: "function";
2148
- readonly name: "previewMintXBNB";
2149
- readonly inputs: readonly [{
2150
- readonly name: "lst";
2151
- readonly type: "address";
2152
1971
  }, {
2153
- readonly name: "lstAmount";
2154
- readonly type: "uint256";
1972
+ readonly name: "mintXBNB";
1973
+ readonly type: "bool";
2155
1974
  }];
2156
1975
  readonly outputs: readonly [{
2157
- readonly name: "xBNBAmount";
1976
+ readonly name: "mintedAmount";
2158
1977
  readonly type: "uint256";
2159
1978
  }];
2160
1979
  readonly stateMutability: "view";
2161
1980
  }, {
2162
1981
  readonly type: "function";
2163
- readonly name: "previewRedeemApUSD";
1982
+ readonly name: "previewRedeem";
2164
1983
  readonly inputs: readonly [{
2165
1984
  readonly name: "lst";
2166
1985
  readonly type: "address";
2167
1986
  }, {
2168
- readonly name: "apUSDAmount";
2169
- readonly type: "uint256";
2170
- }];
2171
- readonly outputs: readonly [{
2172
- readonly name: "lstAmount";
2173
- readonly type: "uint256";
2174
- }];
2175
- readonly stateMutability: "view";
2176
- }, {
2177
- readonly type: "function";
2178
- readonly name: "previewRedeemXBNB";
2179
- readonly inputs: readonly [{
2180
- readonly name: "lst";
2181
- readonly type: "address";
1987
+ readonly name: "redeemXBNB";
1988
+ readonly type: "bool";
2182
1989
  }, {
2183
- readonly name: "xBNBAmount";
1990
+ readonly name: "amount";
2184
1991
  readonly type: "uint256";
2185
1992
  }];
2186
1993
  readonly outputs: readonly [{
@@ -2307,15 +2114,15 @@ declare const RouterABI: readonly [{
2307
2114
  }, {
2308
2115
  readonly name: "inputToken";
2309
2116
  readonly type: "address";
2310
- readonly indexed: false;
2117
+ readonly indexed: true;
2311
2118
  }, {
2312
2119
  readonly name: "inputAmount";
2313
2120
  readonly type: "uint256";
2314
2121
  readonly indexed: false;
2315
2122
  }, {
2316
- readonly name: "lst";
2123
+ readonly name: "targetLST";
2317
2124
  readonly type: "address";
2318
- readonly indexed: false;
2125
+ readonly indexed: true;
2319
2126
  }, {
2320
2127
  readonly name: "lstAmount";
2321
2128
  readonly type: "uint256";
@@ -2341,9 +2148,9 @@ declare const RouterABI: readonly [{
2341
2148
  readonly type: "uint256";
2342
2149
  readonly indexed: false;
2343
2150
  }, {
2344
- readonly name: "lst";
2151
+ readonly name: "targetLST";
2345
2152
  readonly type: "address";
2346
- readonly indexed: false;
2153
+ readonly indexed: true;
2347
2154
  }, {
2348
2155
  readonly name: "lstAmount";
2349
2156
  readonly type: "uint256";
@@ -2351,12 +2158,24 @@ declare const RouterABI: readonly [{
2351
2158
  }, {
2352
2159
  readonly name: "mintedToken";
2353
2160
  readonly type: "address";
2354
- readonly indexed: false;
2161
+ readonly indexed: true;
2355
2162
  }, {
2356
2163
  readonly name: "mintedAmount";
2357
2164
  readonly type: "uint256";
2358
2165
  readonly indexed: false;
2359
2166
  }];
2167
+ }, {
2168
+ readonly type: "event";
2169
+ readonly name: "DefaultLSTUpdated";
2170
+ readonly inputs: readonly [{
2171
+ readonly name: "oldLST";
2172
+ readonly type: "address";
2173
+ readonly indexed: true;
2174
+ }, {
2175
+ readonly name: "newLST";
2176
+ readonly type: "address";
2177
+ readonly indexed: true;
2178
+ }];
2360
2179
  }, {
2361
2180
  readonly type: "event";
2362
2181
  readonly name: "Mint";
@@ -2367,7 +2186,7 @@ declare const RouterABI: readonly [{
2367
2186
  }, {
2368
2187
  readonly name: "lst";
2369
2188
  readonly type: "address";
2370
- readonly indexed: false;
2189
+ readonly indexed: true;
2371
2190
  }, {
2372
2191
  readonly name: "lstAmount";
2373
2192
  readonly type: "uint256";
@@ -2375,7 +2194,7 @@ declare const RouterABI: readonly [{
2375
2194
  }, {
2376
2195
  readonly name: "mintedToken";
2377
2196
  readonly type: "address";
2378
- readonly indexed: false;
2197
+ readonly indexed: true;
2379
2198
  }, {
2380
2199
  readonly name: "mintedAmount";
2381
2200
  readonly type: "uint256";
@@ -2391,7 +2210,7 @@ declare const RouterABI: readonly [{
2391
2210
  }, {
2392
2211
  readonly name: "redeemedToken";
2393
2212
  readonly type: "address";
2394
- readonly indexed: false;
2213
+ readonly indexed: true;
2395
2214
  }, {
2396
2215
  readonly name: "redeemedAmount";
2397
2216
  readonly type: "uint256";
@@ -2399,7 +2218,7 @@ declare const RouterABI: readonly [{
2399
2218
  }, {
2400
2219
  readonly name: "lst";
2401
2220
  readonly type: "address";
2402
- readonly indexed: false;
2221
+ readonly indexed: true;
2403
2222
  }, {
2404
2223
  readonly name: "lstAmount";
2405
2224
  readonly type: "uint256";
@@ -2431,7 +2250,7 @@ declare const RouterABI: readonly [{
2431
2250
  }, {
2432
2251
  readonly name: "outputToken";
2433
2252
  readonly type: "address";
2434
- readonly indexed: false;
2253
+ readonly indexed: true;
2435
2254
  }, {
2436
2255
  readonly name: "outputAmount";
2437
2256
  readonly type: "uint256";
@@ -2447,7 +2266,7 @@ declare const RouterABI: readonly [{
2447
2266
  }, {
2448
2267
  readonly name: "requestIndex";
2449
2268
  readonly type: "uint256";
2450
- readonly indexed: false;
2269
+ readonly indexed: true;
2451
2270
  }, {
2452
2271
  readonly name: "redeemedToken";
2453
2272
  readonly type: "address";
@@ -2471,24 +2290,12 @@ declare const RouterABI: readonly [{
2471
2290
  }, {
2472
2291
  readonly name: "requestIndex";
2473
2292
  readonly type: "uint256";
2474
- readonly indexed: false;
2293
+ readonly indexed: true;
2475
2294
  }, {
2476
2295
  readonly name: "bnbAmount";
2477
2296
  readonly type: "uint256";
2478
2297
  readonly indexed: false;
2479
2298
  }];
2480
- }, {
2481
- readonly type: "event";
2482
- readonly name: "DefaultLSTUpdated";
2483
- readonly inputs: readonly [{
2484
- readonly name: "oldLST";
2485
- readonly type: "address";
2486
- readonly indexed: false;
2487
- }, {
2488
- readonly name: "newLST";
2489
- readonly type: "address";
2490
- readonly indexed: false;
2491
- }];
2492
2299
  }, {
2493
2300
  readonly type: "event";
2494
2301
  readonly name: "OwnershipTransferred";
@@ -2551,7 +2358,7 @@ declare const RouterABI: readonly [{
2551
2358
  readonly inputs: readonly [];
2552
2359
  }, {
2553
2360
  readonly type: "error";
2554
- readonly name: "V3PoolNotFound";
2361
+ readonly name: "UnsupportedSwapPath";
2555
2362
  readonly inputs: readonly [];
2556
2363
  }, {
2557
2364
  readonly type: "error";
@@ -2605,6 +2412,19 @@ declare const RouterABI: readonly [{
2605
2412
  declare const PRECISION: bigint;
2606
2413
  declare const BPS_PRECISION = 10000n;
2607
2414
  declare const PRICE_PRECISION: bigint;
2415
+ declare const BSC_ADDRESSES: {
2416
+ readonly diamond: "0x10d25Ae0690533e0BA9E64EC7ae77dbD4fE8A46f";
2417
+ readonly router: "0x813d3D1A3154950E2f1d8718305426a335A974A9";
2418
+ readonly apUSD: "0x1977097E2E5697A6DD91b6732F368a14F50f6B3d";
2419
+ readonly xBNB: "0xB78eB4d5928bAb158Eb23c3154544084cD2661d5";
2420
+ readonly sApUSD: "0xE2BE739C4aA4126ee72D612d9548C38B1B0e5A1b";
2421
+ readonly slisBNB: "0xB0b84D294e0C75A6abe60171b70edEb2EFd14A1B";
2422
+ readonly asBNB: "0x77734e70b6E88b4d82fE632a168EDf6e700912b6";
2423
+ readonly wclisBNB: "0x439faaC2229559121C4Ad4fd8B3FE13Dff038046";
2424
+ readonly USDT: "0x55d398326f99059fF775485246999027B3197955";
2425
+ readonly USDC: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d";
2426
+ readonly WBNB: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c";
2427
+ };
2608
2428
  /**
2609
2429
  * Format a bigint amount to human-readable string with decimals
2610
2430
  * @param amount Amount in wei (18 decimals)
@@ -2645,4 +2465,4 @@ declare function formatPriceUSD(price: bigint): string;
2645
2465
  */
2646
2466
  declare function calculateAPY(previousRate: bigint, currentRate: bigint, periodDays: number): number;
2647
2467
 
2648
- export { type ApUSDMintedEvent, type ApUSDRedeemedEvent, AspanClient, type AspanClientConfig, AspanReadClient, AspanRouterClient, type AspanRouterClientConfig, AspanRouterReadClient, type AspanRouterWriteClientConfig, type AspanWriteClientConfig, BPS_PRECISION, type BigIntString, type CurrentFeeTier, type CurrentFees, type DepositParams, type DepositedEvent, DiamondABI, type FeeTier, type LSTInfo, type LSTYieldInfo, type MintApUSDParams, type MintXBNBParams, type OracleBounds, PRECISION, PRICE_PRECISION, type ProtocolStats, type RedeemAndSwapEvent, type RedeemApUSDParams, type RedeemXBNBParams, RouterABI, type RouterMintApUSDParams, type RouterMintEvent, type RouterMintParams, type RouterMintXBNBParams, type RouterRedeemAndSwapParams, type RouterRedeemApUSDParams, type RouterRedeemEvent, type RouterRedeemXBNBParams, type RouterSwapParams, type StabilityMode2Info, type StabilityModeInfo, type StabilityPoolStats, type StakeAndMintEvent, type StakeAndMintParams, type SwapAndMintDefaultParams, type SwapAndMintEvent, type SwapAndMintParams, type TokenAddresses, type TransactionReceipt, type TransactionResult, type UnstakeClaimedEvent, type UnstakeRequestedEvent, type UserStabilityPoolPosition, type WithdrawAssetsParams, type WithdrawParams, type WithdrawalRequestInfo, type WithdrawnEvent, type XBNBMintedEvent, type XBNBRedeemedEvent, type YieldHarvestedEvent, type YieldStats, calculateAPY, createAspanClient, createAspanReadClient, createAspanTestnetClient, createAspanTestnetReadClient, createRouterClient, createRouterReadClient, createRouterTestnetClient, createRouterTestnetReadClient, encodeV3Path, formatAmount, formatCR, formatFeeBPS, formatPriceUSD, parseAmount };
2468
+ export { type ApUSDMintedEvent, type ApUSDRedeemedEvent, AspanClient, type AspanClientConfig, AspanReadClient, AspanRouterClient, type AspanRouterClientConfig, AspanRouterReadClient, type AspanRouterWriteClientConfig, type AspanWriteClientConfig, BPS_PRECISION, BSC_ADDRESSES, type BigIntString, type CurrentFeeTier, type CurrentFees, type DepositParams, type DepositedEvent, DiamondABI, type ExpectedOutput, type FeeTier, type LSTInfo, type LSTYieldInfo, type MintApUSDParams, type MintXBNBParams, type OracleBounds, PRECISION, PRICE_PRECISION, type ProtocolStats, type RedeemAndSwapEvent, type RedeemApUSDParams, type RedeemXBNBParams, RouterABI, type RouterMintEvent, type RouterMintParams, type RouterMintParams2, type RouterRedeemAndSwapParams, type RouterRedeemAndUnstakeParams, type RouterRedeemEvent, type RouterRedeemParams, type RouterSwapParams, type StabilityMode2Info, type StabilityModeInfo, type StabilityPoolStats, type StakeAndMintEvent, type StakeAndMintParams, type SwapAndMintDefaultParams, type SwapAndMintEvent, type SwapAndMintParams, type TokenAddresses, type TransactionReceipt, type TransactionResult, type UnstakeClaimedEvent, type UnstakeRequestedEvent, type UserStabilityPoolPosition, type WithdrawAssetsParams, type WithdrawParams, type WithdrawalRequestInfo, type WithdrawnEvent, type XBNBMintedEvent, type XBNBRedeemedEvent, type YieldHarvestedEvent, type YieldStats, calculateAPY, createAspanClient, createAspanReadClient, createAspanTestnetClient, createAspanTestnetReadClient, createRouterClient, createRouterReadClient, createRouterTestnetClient, createRouterTestnetReadClient, encodeV3Path, formatAmount, formatCR, formatFeeBPS, formatPriceUSD, parseAmount };