@aspan/sdk 0.3.1 → 0.4.1

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.ts 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
+ /** Parameters for router mint function (unified) */
258
+ interface RouterMintParams2 {
257
259
  /** LST token address */
258
260
  lst: Address;
259
261
  /** Amount of LST to deposit */
260
262
  lstAmount: bigint;
261
- /** Minimum apUSD to receive */
262
- minOut?: bigint;
263
- }
264
- /** Parameters for router direct mint xBNB functions */
265
- interface RouterMintXBNBParams {
266
- /** LST token address */
267
- lst: Address;
268
- /** Amount of LST to deposit */
269
- 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;
@@ -458,6 +464,16 @@ declare class AspanReadClient {
458
464
  getMaxPriceAge(): Promise<bigint>;
459
465
  getMinDepositPeriod(): Promise<bigint>;
460
466
  isPaused(): Promise<boolean>;
467
+ /**
468
+ * Check if xBNB liquidity has been bootstrapped
469
+ * @returns true if bootstrap has been called
470
+ */
471
+ isBootstrapped(): Promise<boolean>;
472
+ /**
473
+ * Get the amount of xBNB locked in bootstrap (burned to dead address)
474
+ * @returns xBNB amount in wei
475
+ */
476
+ getBootstrapXBNBAmount(): Promise<bigint>;
461
477
  getStabilityMode(): Promise<StabilityModeInfo>;
462
478
  canTriggerStabilityMode2(): Promise<StabilityMode2Info>;
463
479
  getOwner(): Promise<Address>;
@@ -515,6 +531,43 @@ declare class AspanClient extends AspanReadClient {
515
531
  * @returns Transaction hash
516
532
  */
517
533
  harvestYield(): Promise<Hash>;
534
+ /**
535
+ * Trigger Stability Mode 2 forced conversion
536
+ * @description Anyone can call when CR < 130%. Burns apUSD from stability pool
537
+ * and mints xBNB to compensate stakers.
538
+ * @param targetCR Target CR to restore to (in BPS, e.g., 14000 = 140%)
539
+ * @returns Transaction hash
540
+ */
541
+ triggerStabilityMode2(targetCR?: bigint): Promise<Hash>;
542
+ /**
543
+ * Clean underwater xBNB (burn without getting LST back)
544
+ * @description Only works when xBNB is underwater (price = 0)
545
+ * @param xBNBAmount Amount of xBNB to clean (burn)
546
+ * @returns Transaction hash
547
+ */
548
+ cleanXbnb(xBNBAmount: bigint): Promise<Hash>;
549
+ /**
550
+ * Set fee tiers (requires feeManager or owner role)
551
+ * @param tiers Array of fee tier configurations
552
+ * @returns Transaction hash
553
+ */
554
+ setFeeTiers(tiers: Array<{
555
+ minCR: bigint;
556
+ apUSDMintFee: number;
557
+ apUSDRedeemFee: number;
558
+ xBNBMintFee: number;
559
+ xBNBRedeemFee: number;
560
+ apUSDMintDisabled: boolean;
561
+ }>): Promise<Hash>;
562
+ /**
563
+ * Bootstrap xBNB liquidity (owner only)
564
+ * @description Initializes xBNB supply by minting to dead address, preventing extreme initial prices.
565
+ * Similar to Uniswap V2's MINIMUM_LIQUIDITY. Can only be called once.
566
+ * @param lstToken LST token address to deposit
567
+ * @param lstAmount Amount of LST to deposit for bootstrap
568
+ * @returns Transaction hash
569
+ */
570
+ bootstrap(lstToken: Address, lstAmount: bigint): Promise<Hash>;
518
571
  /**
519
572
  * Wait for transaction confirmation
520
573
  * @param hash Transaction hash
@@ -578,21 +631,19 @@ declare class AspanRouterReadClient {
578
631
  */
579
632
  getDiamond(): Promise<Address>;
580
633
  /**
581
- * Preview apUSD mint output for a given LST amount
634
+ * Preview mint output for a given LST amount
635
+ * @param lst LST token address
636
+ * @param lstAmount Amount of LST
637
+ * @param mintXBNB true = preview xBNB mint, false = preview apUSD mint
582
638
  */
583
- previewMintApUSD(lst: Address, lstAmount: bigint): Promise<bigint>;
639
+ previewMint(lst: Address, lstAmount: bigint, mintXBNB: boolean): Promise<bigint>;
584
640
  /**
585
- * Preview xBNB mint output for a given LST amount
641
+ * Preview redeem output
642
+ * @param lst LST token to receive
643
+ * @param redeemXBNB true = redeem xBNB, false = redeem apUSD
644
+ * @param amount Amount of apUSD/xBNB to redeem
586
645
  */
587
- previewMintXBNB(lst: Address, lstAmount: bigint): Promise<bigint>;
588
- /**
589
- * Preview LST output for redeeming apUSD
590
- */
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>;
646
+ previewRedeem(lst: Address, redeemXBNB: boolean, amount: bigint): Promise<bigint>;
596
647
  /**
597
648
  * Get user's withdrawal request indices
598
649
  */
@@ -617,67 +668,43 @@ declare class AspanRouterClient extends AspanRouterReadClient {
617
668
  readonly walletClient: WalletClient;
618
669
  constructor(config: AspanRouterWriteClientConfig);
619
670
  /**
620
- * Swap input token to LST and mint apUSD
671
+ * Swap input token to LST and mint apUSD or xBNB
672
+ * @param params.swapParams Swap configuration
673
+ * @param params.mintParams Mint configuration (mintXBNB determines output token)
621
674
  */
622
- swapAndMintApUSD(params: SwapAndMintParams): Promise<Hash>;
675
+ swapAndMint(params: SwapAndMintParams): Promise<Hash>;
623
676
  /**
624
- * Swap input token to LST and mint xBNB
677
+ * Swap input token and mint using default LST (simplified)
678
+ * @param params.mintXBNB true = mint xBNB, false = mint apUSD
625
679
  */
626
- swapAndMintXBNB(params: SwapAndMintParams): Promise<Hash>;
680
+ swapAndMintDefault(params: SwapAndMintDefaultParams): Promise<Hash>;
627
681
  /**
628
682
  * Stake native BNB directly to LST and mint
683
+ * @param params.isXBNB true = mint xBNB, false = mint apUSD
629
684
  */
630
685
  stakeAndMint(params: StakeAndMintParams): Promise<Hash>;
631
686
  /**
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)
687
+ * Mint apUSD or xBNB by providing LST directly (no swap)
688
+ * @param params.mintXBNB true = mint xBNB, false = mint apUSD
649
689
  */
650
- mintApUSD(params: RouterMintApUSDParams): Promise<Hash>;
690
+ mint(params: RouterMintParams2): Promise<Hash>;
651
691
  /**
652
- * Mint xBNB by providing LST directly (no swap)
692
+ * Redeem apUSD or xBNB for LST (no swap)
693
+ * @param params.redeemXBNB true = redeem xBNB, false = redeem apUSD
653
694
  */
654
- mintXBNB(params: RouterMintXBNBParams): Promise<Hash>;
695
+ redeem(params: RouterRedeemParams): Promise<Hash>;
655
696
  /**
656
- * Redeem apUSD for LST (no swap)
697
+ * Redeem apUSD/xBNB and swap LST to output token via V3 path
698
+ * @param params.redeemXBNB true = redeem xBNB, false = redeem apUSD
699
+ * @param params.path PancakeSwap V3 encoded path (use encodeV3Path helper)
700
+ * @param params.unwrapBNB If true and output is WBNB, unwrap to native BNB
657
701
  */
658
- redeemApUSD(params: RouterRedeemApUSDParams): Promise<Hash>;
702
+ redeemAndSwap(params: RouterRedeemAndSwapParams): Promise<Hash>;
659
703
  /**
660
- * Redeem xBNB for LST (no swap)
704
+ * Redeem apUSD/xBNB and request native unstake from Lista (starts unbonding period)
705
+ * @param params.redeemXBNB true = redeem xBNB, false = redeem apUSD
661
706
  */
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)
666
- */
667
- redeemApUSDAndSwap(params: RouterRedeemAndSwapParams): Promise<Hash>;
668
- /**
669
- * Redeem xBNB and swap LST to output token via V3 path
670
- * @param params.path - PancakeSwap V3 encoded path (use encodeV3Path helper)
671
- */
672
- redeemXBNBAndSwap(params: RouterRedeemAndSwapParams): Promise<Hash>;
673
- /**
674
- * Redeem apUSD and request native unstake from Lista (starts unbonding period)
675
- */
676
- redeemApUSDAndRequestUnstake(apUSDAmount: bigint): Promise<Hash>;
677
- /**
678
- * Redeem xBNB and request native unstake from Lista (starts unbonding period)
679
- */
680
- redeemXBNBAndRequestUnstake(xBNBAmount: bigint): Promise<Hash>;
707
+ redeemAndRequestUnstake(params: RouterRedeemAndUnstakeParams): Promise<Hash>;
681
708
  /**
682
709
  * Claim BNB after unbonding period completes
683
710
  */
@@ -1556,6 +1583,44 @@ declare const DiamondABI: readonly [{
1556
1583
  readonly internalType: "bool";
1557
1584
  }];
1558
1585
  readonly stateMutability: "view";
1586
+ }, {
1587
+ readonly type: "function";
1588
+ readonly name: "bootstrap";
1589
+ readonly inputs: readonly [{
1590
+ readonly name: "_lstToken";
1591
+ readonly type: "address";
1592
+ readonly internalType: "address";
1593
+ }, {
1594
+ readonly name: "_lstAmount";
1595
+ readonly type: "uint256";
1596
+ readonly internalType: "uint256";
1597
+ }];
1598
+ readonly outputs: readonly [{
1599
+ readonly name: "xBNBAmount";
1600
+ readonly type: "uint256";
1601
+ readonly internalType: "uint256";
1602
+ }];
1603
+ readonly stateMutability: "nonpayable";
1604
+ }, {
1605
+ readonly type: "function";
1606
+ readonly name: "isBootstrapped";
1607
+ readonly inputs: readonly [];
1608
+ readonly outputs: readonly [{
1609
+ readonly name: "";
1610
+ readonly type: "bool";
1611
+ readonly internalType: "bool";
1612
+ }];
1613
+ readonly stateMutability: "view";
1614
+ }, {
1615
+ readonly type: "function";
1616
+ readonly name: "getBootstrapXBNBAmount";
1617
+ readonly inputs: readonly [];
1618
+ readonly outputs: readonly [{
1619
+ readonly name: "";
1620
+ readonly type: "uint256";
1621
+ readonly internalType: "uint256";
1622
+ }];
1623
+ readonly stateMutability: "view";
1559
1624
  }, {
1560
1625
  readonly type: "function";
1561
1626
  readonly name: "getStabilityMode";
@@ -1606,6 +1671,16 @@ declare const DiamondABI: readonly [{
1606
1671
  readonly internalType: "uint256";
1607
1672
  }];
1608
1673
  readonly stateMutability: "nonpayable";
1674
+ }, {
1675
+ readonly type: "function";
1676
+ readonly name: "cleanXbnb";
1677
+ readonly inputs: readonly [{
1678
+ readonly name: "_xBNBAmount";
1679
+ readonly type: "uint256";
1680
+ readonly internalType: "uint256";
1681
+ }];
1682
+ readonly outputs: readonly [];
1683
+ readonly stateMutability: "nonpayable";
1609
1684
  }, {
1610
1685
  readonly type: "event";
1611
1686
  readonly name: "StabilityMode2Triggered";
@@ -1641,63 +1716,81 @@ declare const DiamondABI: readonly [{
1641
1716
  readonly internalType: "address";
1642
1717
  }];
1643
1718
  readonly stateMutability: "view";
1644
- }];
1645
-
1646
- /**
1647
- * AspanRouter ABI
1648
- * Periphery contract for one-click swap+mint operations
1649
- * Updated: 2025-01-31
1650
- */
1651
- declare const RouterABI: readonly [{
1719
+ }, {
1652
1720
  readonly type: "function";
1653
- readonly name: "swapAndMintApUSD";
1721
+ readonly name: "setFeeManager";
1654
1722
  readonly inputs: readonly [{
1655
- readonly name: "swapParams";
1656
- readonly type: "tuple";
1723
+ readonly name: "_feeManager";
1724
+ readonly type: "address";
1725
+ readonly internalType: "address";
1726
+ }];
1727
+ readonly outputs: readonly [];
1728
+ readonly stateMutability: "nonpayable";
1729
+ }, {
1730
+ readonly type: "function";
1731
+ readonly name: "getFeeManager";
1732
+ readonly inputs: readonly [];
1733
+ readonly outputs: readonly [{
1734
+ readonly name: "";
1735
+ readonly type: "address";
1736
+ readonly internalType: "address";
1737
+ }];
1738
+ readonly stateMutability: "view";
1739
+ }, {
1740
+ readonly type: "function";
1741
+ readonly name: "setFeeTiers";
1742
+ readonly inputs: readonly [{
1743
+ readonly name: "_tiers";
1744
+ readonly type: "tuple[]";
1745
+ readonly internalType: "struct LibAppStorage.FeeTier[]";
1657
1746
  readonly components: readonly [{
1658
- readonly name: "inputToken";
1659
- readonly type: "address";
1660
- }, {
1661
- readonly name: "inputAmount";
1747
+ readonly name: "minCR";
1662
1748
  readonly type: "uint256";
1749
+ readonly internalType: "uint256";
1663
1750
  }, {
1664
- readonly name: "targetLST";
1665
- readonly type: "address";
1751
+ readonly name: "apUSDMintFee";
1752
+ readonly type: "uint16";
1753
+ readonly internalType: "uint16";
1666
1754
  }, {
1667
- readonly name: "minLSTOut";
1668
- readonly type: "uint256";
1755
+ readonly name: "apUSDRedeemFee";
1756
+ readonly type: "uint16";
1757
+ readonly internalType: "uint16";
1669
1758
  }, {
1670
- readonly name: "poolFee";
1671
- readonly type: "uint24";
1672
- }];
1673
- }, {
1674
- readonly name: "mintParams";
1675
- readonly type: "tuple";
1676
- readonly components: readonly [{
1677
- readonly name: "mintXBNB";
1678
- readonly type: "bool";
1759
+ readonly name: "xBNBMintFee";
1760
+ readonly type: "uint16";
1761
+ readonly internalType: "uint16";
1679
1762
  }, {
1680
- readonly name: "minMintOut";
1681
- readonly type: "uint256";
1682
- }, {
1683
- readonly name: "recipient";
1684
- readonly type: "address";
1763
+ readonly name: "xBNBRedeemFee";
1764
+ readonly type: "uint16";
1765
+ readonly internalType: "uint16";
1685
1766
  }, {
1686
- readonly name: "deadline";
1687
- readonly type: "uint256";
1767
+ readonly name: "apUSDMintDisabled";
1768
+ readonly type: "bool";
1769
+ readonly internalType: "bool";
1688
1770
  }];
1689
1771
  }];
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";
1772
+ readonly outputs: readonly [];
1773
+ readonly stateMutability: "nonpayable";
1698
1774
  }, {
1775
+ readonly type: "event";
1776
+ readonly name: "FeeManagerSet";
1777
+ readonly inputs: readonly [{
1778
+ readonly name: "feeManager";
1779
+ readonly type: "address";
1780
+ readonly indexed: true;
1781
+ readonly internalType: "address";
1782
+ }];
1783
+ readonly anonymous: false;
1784
+ }];
1785
+
1786
+ /**
1787
+ * AspanRouter ABI
1788
+ * Periphery contract for one-click swap+mint operations
1789
+ * Updated: 2026-02-04 (v2.0.0 - consolidated API)
1790
+ */
1791
+ declare const RouterABI: readonly [{
1699
1792
  readonly type: "function";
1700
- readonly name: "swapAndMintXBNB";
1793
+ readonly name: "swapAndMint";
1701
1794
  readonly inputs: readonly [{
1702
1795
  readonly name: "swapParams";
1703
1796
  readonly type: "tuple";
@@ -1734,30 +1827,6 @@ declare const RouterABI: readonly [{
1734
1827
  readonly type: "uint256";
1735
1828
  }];
1736
1829
  }];
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
1830
  readonly outputs: readonly [{
1762
1831
  readonly name: "lstAmount";
1763
1832
  readonly type: "uint256";
@@ -1768,37 +1837,16 @@ declare const RouterABI: readonly [{
1768
1837
  readonly stateMutability: "payable";
1769
1838
  }, {
1770
1839
  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";
1840
+ readonly name: "swapAndMintDefault";
1796
1841
  readonly inputs: readonly [{
1797
1842
  readonly name: "inputToken";
1798
1843
  readonly type: "address";
1799
1844
  }, {
1800
1845
  readonly name: "inputAmount";
1801
1846
  readonly type: "uint256";
1847
+ }, {
1848
+ readonly name: "mintXBNB";
1849
+ readonly type: "bool";
1802
1850
  }, {
1803
1851
  readonly name: "minMintOut";
1804
1852
  readonly type: "uint256";
@@ -1807,19 +1855,19 @@ declare const RouterABI: readonly [{
1807
1855
  readonly type: "uint256";
1808
1856
  }];
1809
1857
  readonly outputs: readonly [{
1810
- readonly name: "apUSDAmount";
1858
+ readonly name: "mintedAmount";
1811
1859
  readonly type: "uint256";
1812
1860
  }];
1813
1861
  readonly stateMutability: "payable";
1814
1862
  }, {
1815
1863
  readonly type: "function";
1816
- readonly name: "swapAndMintXBNBDefault";
1864
+ readonly name: "stakeAndMint";
1817
1865
  readonly inputs: readonly [{
1818
- readonly name: "inputToken";
1866
+ readonly name: "targetLST";
1819
1867
  readonly type: "address";
1820
1868
  }, {
1821
- readonly name: "inputAmount";
1822
- readonly type: "uint256";
1869
+ readonly name: "isXBNB";
1870
+ readonly type: "bool";
1823
1871
  }, {
1824
1872
  readonly name: "minMintOut";
1825
1873
  readonly type: "uint256";
@@ -1828,31 +1876,16 @@ declare const RouterABI: readonly [{
1828
1876
  readonly type: "uint256";
1829
1877
  }];
1830
1878
  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
1879
  readonly name: "lstAmount";
1843
1880
  readonly type: "uint256";
1844
1881
  }, {
1845
- readonly name: "minOut";
1846
- readonly type: "uint256";
1847
- }];
1848
- readonly outputs: readonly [{
1849
- readonly name: "apUSDAmount";
1882
+ readonly name: "mintedAmount";
1850
1883
  readonly type: "uint256";
1851
1884
  }];
1852
- readonly stateMutability: "nonpayable";
1885
+ readonly stateMutability: "payable";
1853
1886
  }, {
1854
1887
  readonly type: "function";
1855
- readonly name: "mintXBNB";
1888
+ readonly name: "mint";
1856
1889
  readonly inputs: readonly [{
1857
1890
  readonly name: "lst";
1858
1891
  readonly type: "address";
@@ -1860,40 +1893,28 @@ declare const RouterABI: readonly [{
1860
1893
  readonly name: "lstAmount";
1861
1894
  readonly type: "uint256";
1862
1895
  }, {
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";
1896
+ readonly name: "mintXBNB";
1897
+ readonly type: "bool";
1880
1898
  }, {
1881
1899
  readonly name: "minOut";
1882
1900
  readonly type: "uint256";
1883
1901
  }];
1884
1902
  readonly outputs: readonly [{
1885
- readonly name: "lstAmount";
1903
+ readonly name: "mintedAmount";
1886
1904
  readonly type: "uint256";
1887
1905
  }];
1888
1906
  readonly stateMutability: "nonpayable";
1889
1907
  }, {
1890
1908
  readonly type: "function";
1891
- readonly name: "redeemXBNB";
1909
+ readonly name: "redeem";
1892
1910
  readonly inputs: readonly [{
1893
1911
  readonly name: "lst";
1894
1912
  readonly type: "address";
1895
1913
  }, {
1896
- readonly name: "xBNBAmount";
1914
+ readonly name: "redeemXBNB";
1915
+ readonly type: "bool";
1916
+ }, {
1917
+ readonly name: "amount";
1897
1918
  readonly type: "uint256";
1898
1919
  }, {
1899
1920
  readonly name: "minOut";
@@ -1906,36 +1927,15 @@ declare const RouterABI: readonly [{
1906
1927
  readonly stateMutability: "nonpayable";
1907
1928
  }, {
1908
1929
  readonly type: "function";
1909
- readonly name: "redeemApUSDAndSwap";
1930
+ readonly name: "redeemAndSwap";
1910
1931
  readonly inputs: readonly [{
1911
1932
  readonly name: "lst";
1912
1933
  readonly type: "address";
1913
1934
  }, {
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";
1935
+ readonly name: "redeemXBNB";
1936
+ readonly type: "bool";
1937
1937
  }, {
1938
- readonly name: "xBNBAmount";
1938
+ readonly name: "amount";
1939
1939
  readonly type: "uint256";
1940
1940
  }, {
1941
1941
  readonly name: "path";
@@ -1946,6 +1946,9 @@ declare const RouterABI: readonly [{
1946
1946
  }, {
1947
1947
  readonly name: "deadline";
1948
1948
  readonly type: "uint256";
1949
+ }, {
1950
+ readonly name: "unwrapBNB";
1951
+ readonly type: "bool";
1949
1952
  }];
1950
1953
  readonly outputs: readonly [{
1951
1954
  readonly name: "outputAmount";
@@ -1954,24 +1957,12 @@ declare const RouterABI: readonly [{
1954
1957
  readonly stateMutability: "nonpayable";
1955
1958
  }, {
1956
1959
  readonly type: "function";
1957
- readonly name: "redeemApUSDAndRequestUnstake";
1960
+ readonly name: "redeemAndRequestUnstake";
1958
1961
  readonly inputs: readonly [{
1959
- readonly name: "apUSDAmount";
1960
- readonly type: "uint256";
1961
- }];
1962
- readonly outputs: readonly [{
1963
- readonly name: "requestIndex";
1964
- readonly type: "uint256";
1962
+ readonly name: "redeemXBNB";
1963
+ readonly type: "bool";
1965
1964
  }, {
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";
1965
+ readonly name: "amount";
1975
1966
  readonly type: "uint256";
1976
1967
  }];
1977
1968
  readonly outputs: readonly [{
@@ -2130,57 +2121,33 @@ declare const RouterABI: readonly [{
2130
2121
  readonly stateMutability: "view";
2131
2122
  }, {
2132
2123
  readonly type: "function";
2133
- readonly name: "previewMintApUSD";
2124
+ readonly name: "previewMint";
2134
2125
  readonly inputs: readonly [{
2135
2126
  readonly name: "lst";
2136
2127
  readonly type: "address";
2137
2128
  }, {
2138
2129
  readonly name: "lstAmount";
2139
2130
  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
2131
  }, {
2153
- readonly name: "lstAmount";
2154
- readonly type: "uint256";
2132
+ readonly name: "mintXBNB";
2133
+ readonly type: "bool";
2155
2134
  }];
2156
2135
  readonly outputs: readonly [{
2157
- readonly name: "xBNBAmount";
2136
+ readonly name: "mintedAmount";
2158
2137
  readonly type: "uint256";
2159
2138
  }];
2160
2139
  readonly stateMutability: "view";
2161
2140
  }, {
2162
2141
  readonly type: "function";
2163
- readonly name: "previewRedeemApUSD";
2142
+ readonly name: "previewRedeem";
2164
2143
  readonly inputs: readonly [{
2165
2144
  readonly name: "lst";
2166
2145
  readonly type: "address";
2167
2146
  }, {
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";
2147
+ readonly name: "redeemXBNB";
2148
+ readonly type: "bool";
2182
2149
  }, {
2183
- readonly name: "xBNBAmount";
2150
+ readonly name: "amount";
2184
2151
  readonly type: "uint256";
2185
2152
  }];
2186
2153
  readonly outputs: readonly [{
@@ -2307,15 +2274,15 @@ declare const RouterABI: readonly [{
2307
2274
  }, {
2308
2275
  readonly name: "inputToken";
2309
2276
  readonly type: "address";
2310
- readonly indexed: false;
2277
+ readonly indexed: true;
2311
2278
  }, {
2312
2279
  readonly name: "inputAmount";
2313
2280
  readonly type: "uint256";
2314
2281
  readonly indexed: false;
2315
2282
  }, {
2316
- readonly name: "lst";
2283
+ readonly name: "targetLST";
2317
2284
  readonly type: "address";
2318
- readonly indexed: false;
2285
+ readonly indexed: true;
2319
2286
  }, {
2320
2287
  readonly name: "lstAmount";
2321
2288
  readonly type: "uint256";
@@ -2341,9 +2308,9 @@ declare const RouterABI: readonly [{
2341
2308
  readonly type: "uint256";
2342
2309
  readonly indexed: false;
2343
2310
  }, {
2344
- readonly name: "lst";
2311
+ readonly name: "targetLST";
2345
2312
  readonly type: "address";
2346
- readonly indexed: false;
2313
+ readonly indexed: true;
2347
2314
  }, {
2348
2315
  readonly name: "lstAmount";
2349
2316
  readonly type: "uint256";
@@ -2351,12 +2318,24 @@ declare const RouterABI: readonly [{
2351
2318
  }, {
2352
2319
  readonly name: "mintedToken";
2353
2320
  readonly type: "address";
2354
- readonly indexed: false;
2321
+ readonly indexed: true;
2355
2322
  }, {
2356
2323
  readonly name: "mintedAmount";
2357
2324
  readonly type: "uint256";
2358
2325
  readonly indexed: false;
2359
2326
  }];
2327
+ }, {
2328
+ readonly type: "event";
2329
+ readonly name: "DefaultLSTUpdated";
2330
+ readonly inputs: readonly [{
2331
+ readonly name: "oldLST";
2332
+ readonly type: "address";
2333
+ readonly indexed: true;
2334
+ }, {
2335
+ readonly name: "newLST";
2336
+ readonly type: "address";
2337
+ readonly indexed: true;
2338
+ }];
2360
2339
  }, {
2361
2340
  readonly type: "event";
2362
2341
  readonly name: "Mint";
@@ -2367,7 +2346,7 @@ declare const RouterABI: readonly [{
2367
2346
  }, {
2368
2347
  readonly name: "lst";
2369
2348
  readonly type: "address";
2370
- readonly indexed: false;
2349
+ readonly indexed: true;
2371
2350
  }, {
2372
2351
  readonly name: "lstAmount";
2373
2352
  readonly type: "uint256";
@@ -2375,7 +2354,7 @@ declare const RouterABI: readonly [{
2375
2354
  }, {
2376
2355
  readonly name: "mintedToken";
2377
2356
  readonly type: "address";
2378
- readonly indexed: false;
2357
+ readonly indexed: true;
2379
2358
  }, {
2380
2359
  readonly name: "mintedAmount";
2381
2360
  readonly type: "uint256";
@@ -2391,7 +2370,7 @@ declare const RouterABI: readonly [{
2391
2370
  }, {
2392
2371
  readonly name: "redeemedToken";
2393
2372
  readonly type: "address";
2394
- readonly indexed: false;
2373
+ readonly indexed: true;
2395
2374
  }, {
2396
2375
  readonly name: "redeemedAmount";
2397
2376
  readonly type: "uint256";
@@ -2399,7 +2378,7 @@ declare const RouterABI: readonly [{
2399
2378
  }, {
2400
2379
  readonly name: "lst";
2401
2380
  readonly type: "address";
2402
- readonly indexed: false;
2381
+ readonly indexed: true;
2403
2382
  }, {
2404
2383
  readonly name: "lstAmount";
2405
2384
  readonly type: "uint256";
@@ -2431,7 +2410,7 @@ declare const RouterABI: readonly [{
2431
2410
  }, {
2432
2411
  readonly name: "outputToken";
2433
2412
  readonly type: "address";
2434
- readonly indexed: false;
2413
+ readonly indexed: true;
2435
2414
  }, {
2436
2415
  readonly name: "outputAmount";
2437
2416
  readonly type: "uint256";
@@ -2447,7 +2426,7 @@ declare const RouterABI: readonly [{
2447
2426
  }, {
2448
2427
  readonly name: "requestIndex";
2449
2428
  readonly type: "uint256";
2450
- readonly indexed: false;
2429
+ readonly indexed: true;
2451
2430
  }, {
2452
2431
  readonly name: "redeemedToken";
2453
2432
  readonly type: "address";
@@ -2471,24 +2450,12 @@ declare const RouterABI: readonly [{
2471
2450
  }, {
2472
2451
  readonly name: "requestIndex";
2473
2452
  readonly type: "uint256";
2474
- readonly indexed: false;
2453
+ readonly indexed: true;
2475
2454
  }, {
2476
2455
  readonly name: "bnbAmount";
2477
2456
  readonly type: "uint256";
2478
2457
  readonly indexed: false;
2479
2458
  }];
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
2459
  }, {
2493
2460
  readonly type: "event";
2494
2461
  readonly name: "OwnershipTransferred";
@@ -2551,7 +2518,7 @@ declare const RouterABI: readonly [{
2551
2518
  readonly inputs: readonly [];
2552
2519
  }, {
2553
2520
  readonly type: "error";
2554
- readonly name: "V3PoolNotFound";
2521
+ readonly name: "UnsupportedSwapPath";
2555
2522
  readonly inputs: readonly [];
2556
2523
  }, {
2557
2524
  readonly type: "error";
@@ -2605,6 +2572,19 @@ declare const RouterABI: readonly [{
2605
2572
  declare const PRECISION: bigint;
2606
2573
  declare const BPS_PRECISION = 10000n;
2607
2574
  declare const PRICE_PRECISION: bigint;
2575
+ declare const BSC_ADDRESSES: {
2576
+ readonly diamond: "0x6a11B30d3a70727d5477D6d8090e144443fA1c78";
2577
+ readonly router: "0x813d3D1A3154950E2f1d8718305426a335A974A9";
2578
+ readonly apUSD: "0x4570047eeB5aDb4081c5d470494EB5134e34A287";
2579
+ readonly xBNB: "0x0A0c9CD826e747D99F90D63e780B3727Da4D0d43";
2580
+ readonly sApUSD: "0x73407A291c007a47CC926EcD5CaC256A1E2d00cF";
2581
+ readonly slisBNB: "0xB0b84D294e0C75A6abe60171b70edEb2EFd14A1B";
2582
+ readonly asBNB: "0x77734e70b6E88b4d82fE632a168EDf6e700912b6";
2583
+ readonly wclisBNB: "0x448f7c2fa4e5135a4a5B50879602cf3CD428e108";
2584
+ readonly USDT: "0x55d398326f99059fF775485246999027B3197955";
2585
+ readonly USDC: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d";
2586
+ readonly WBNB: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c";
2587
+ };
2608
2588
  /**
2609
2589
  * Format a bigint amount to human-readable string with decimals
2610
2590
  * @param amount Amount in wei (18 decimals)
@@ -2645,4 +2625,4 @@ declare function formatPriceUSD(price: bigint): string;
2645
2625
  */
2646
2626
  declare function calculateAPY(previousRate: bigint, currentRate: bigint, periodDays: number): number;
2647
2627
 
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 };
2628
+ 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 };