@aspan/sdk 0.1.4

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.
@@ -0,0 +1,1324 @@
1
+ import * as viem from 'viem';
2
+ import { Address, Hash, PublicClient, Chain, Account } from 'viem';
3
+
4
+ /**
5
+ * Aspan SDK Type Definitions
6
+ */
7
+
8
+ /** BigInt formatted as string for serialization */
9
+ type BigIntString = string;
10
+ /** Token addresses */
11
+ interface TokenAddresses {
12
+ apUSD: Address;
13
+ xBNB: Address;
14
+ sApUSD: Address;
15
+ }
16
+ /** LST (Liquid Staking Token) info */
17
+ interface LSTInfo {
18
+ isAccepted: boolean;
19
+ priceFeed: Address;
20
+ manualPriceUSD: bigint;
21
+ collateralAmount: bigint;
22
+ decimals: number;
23
+ exchangeRateProvider: Address;
24
+ useIntrinsicValue: boolean;
25
+ }
26
+ /** LST yield tracking info */
27
+ interface LSTYieldInfo {
28
+ lastExchangeRate: bigint;
29
+ lastUpdateTimestamp: bigint;
30
+ }
31
+ /** Fee tier configuration */
32
+ interface FeeTier {
33
+ minCR: bigint;
34
+ apUSDMintFee: number;
35
+ apUSDRedeemFee: number;
36
+ xBNBMintFee: number;
37
+ xBNBRedeemFee: number;
38
+ apUSDMintDisabled: boolean;
39
+ }
40
+ /** Current fee tier with CR */
41
+ interface CurrentFeeTier extends FeeTier {
42
+ currentCR: bigint;
43
+ }
44
+ /** Current fees with tier info */
45
+ interface CurrentFees {
46
+ currentCR: bigint;
47
+ tierMinCR: bigint;
48
+ apUSDMintFee: number;
49
+ apUSDRedeemFee: number;
50
+ xBNBMintFee: number;
51
+ xBNBRedeemFee: number;
52
+ apUSDMintDisabled: boolean;
53
+ }
54
+ /** Oracle bounds */
55
+ interface OracleBounds {
56
+ minPrice: bigint;
57
+ maxPrice: bigint;
58
+ }
59
+ /** Stability mode info */
60
+ interface StabilityModeInfo {
61
+ mode: number;
62
+ currentCR: bigint;
63
+ }
64
+ /** Stability mode 2 trigger info */
65
+ interface StabilityMode2Info {
66
+ canTrigger: boolean;
67
+ currentCR: bigint;
68
+ potentialConversion: bigint;
69
+ }
70
+ /** Parameters for minting apUSD */
71
+ interface MintApUSDParams {
72
+ lstToken: Address;
73
+ lstAmount: bigint;
74
+ }
75
+ /** Parameters for redeeming apUSD */
76
+ interface RedeemApUSDParams {
77
+ lstToken: Address;
78
+ apUSDAmount: bigint;
79
+ }
80
+ /** Parameters for minting xBNB */
81
+ interface MintXBNBParams {
82
+ lstToken: Address;
83
+ lstAmount: bigint;
84
+ }
85
+ /** Parameters for redeeming xBNB */
86
+ interface RedeemXBNBParams {
87
+ lstToken: Address;
88
+ xBNBAmount: bigint;
89
+ }
90
+ /** Parameters for depositing to stability pool */
91
+ interface DepositParams {
92
+ apUSDAmount: bigint;
93
+ }
94
+ /** Parameters for withdrawing from stability pool */
95
+ interface WithdrawParams {
96
+ shares: bigint;
97
+ }
98
+ /** Parameters for withdrawing assets from stability pool */
99
+ interface WithdrawAssetsParams {
100
+ assets: bigint;
101
+ }
102
+ /** Overall protocol statistics */
103
+ interface ProtocolStats {
104
+ tvlInBNB: bigint;
105
+ tvlInUSD: bigint;
106
+ collateralRatio: bigint;
107
+ apUSDSupply: bigint;
108
+ xBNBSupply: bigint;
109
+ xBNBPriceBNB: bigint;
110
+ xBNBPriceUSD: bigint;
111
+ effectiveLeverage: bigint;
112
+ }
113
+ /** Stability pool statistics */
114
+ interface StabilityPoolStats {
115
+ totalStaked: bigint;
116
+ exchangeRate: bigint;
117
+ pendingYield: bigint;
118
+ }
119
+ /** Yield statistics */
120
+ interface YieldStats {
121
+ totalYieldGenerated: bigint;
122
+ pendingYield: bigint;
123
+ lastHarvestTimestamp: bigint;
124
+ minHarvestInterval: bigint;
125
+ previewedHarvest: bigint;
126
+ }
127
+ /** User's position in the stability pool */
128
+ interface UserStabilityPoolPosition {
129
+ shares: bigint;
130
+ balance: bigint;
131
+ }
132
+ /** ApUSD minted event */
133
+ interface ApUSDMintedEvent {
134
+ user: Address;
135
+ lstToken: Address;
136
+ lstAmount: bigint;
137
+ apUSDAmount: bigint;
138
+ feeBPS: bigint;
139
+ }
140
+ /** ApUSD redeemed event */
141
+ interface ApUSDRedeemedEvent {
142
+ user: Address;
143
+ lstToken: Address;
144
+ apUSDAmount: bigint;
145
+ lstAmount: bigint;
146
+ feeBPS: bigint;
147
+ }
148
+ /** xBNB minted event */
149
+ interface XBNBMintedEvent {
150
+ user: Address;
151
+ lstToken: Address;
152
+ lstAmount: bigint;
153
+ xBNBAmount: bigint;
154
+ feeBPS: bigint;
155
+ }
156
+ /** xBNB redeemed event */
157
+ interface XBNBRedeemedEvent {
158
+ user: Address;
159
+ lstToken: Address;
160
+ xBNBAmount: bigint;
161
+ lstAmount: bigint;
162
+ feeBPS: bigint;
163
+ }
164
+ /** Deposited to stability pool event */
165
+ interface DepositedEvent {
166
+ user: Address;
167
+ apUSDAmount: bigint;
168
+ sharesReceived: bigint;
169
+ }
170
+ /** Withdrawn from stability pool event */
171
+ interface WithdrawnEvent {
172
+ user: Address;
173
+ sharesRedeemed: bigint;
174
+ apUSDReceived: bigint;
175
+ }
176
+ /** Yield harvested event */
177
+ interface YieldHarvestedEvent {
178
+ yieldUSD: bigint;
179
+ }
180
+ /** Result of a transaction */
181
+ interface TransactionResult {
182
+ hash: Hash;
183
+ wait: () => Promise<TransactionReceipt>;
184
+ }
185
+ /** Transaction receipt */
186
+ interface TransactionReceipt {
187
+ blockHash: Hash;
188
+ blockNumber: bigint;
189
+ transactionHash: Hash;
190
+ status: "success" | "reverted";
191
+ }
192
+
193
+ interface AspanClientConfig {
194
+ /** Diamond contract address */
195
+ diamondAddress: Address;
196
+ /** Chain to connect to */
197
+ chain?: Chain;
198
+ /** RPC URL (optional, uses default if not provided) */
199
+ rpcUrl?: string;
200
+ }
201
+ interface AspanWriteClientConfig extends AspanClientConfig {
202
+ /** Account for signing transactions */
203
+ account: Account;
204
+ }
205
+ /**
206
+ * Read-only client for querying Aspan Protocol state
207
+ */
208
+ declare class AspanReadClient {
209
+ protected readonly publicClient: PublicClient;
210
+ protected readonly diamondAddress: Address;
211
+ protected readonly chain: Chain;
212
+ private static readonly ZERO_SUPPLY_ERROR_SIGNATURES;
213
+ constructor(config: AspanClientConfig);
214
+ /**
215
+ * Check if error is a known zero supply error from the contract
216
+ */
217
+ protected isZeroSupplyError(error: unknown): boolean;
218
+ /**
219
+ * Get comprehensive protocol statistics
220
+ */
221
+ getProtocolStats(): Promise<ProtocolStats>;
222
+ /**
223
+ * Get stability pool statistics
224
+ */
225
+ getStabilityPoolStats(): Promise<StabilityPoolStats>;
226
+ /**
227
+ * Get yield statistics
228
+ */
229
+ getYieldStats(): Promise<YieldStats>;
230
+ getTVLInBNB(): Promise<bigint>;
231
+ getTVLInUSD(): Promise<bigint>;
232
+ getCollateralRatio(): Promise<bigint>;
233
+ getXBNBPriceBNB(): Promise<bigint>;
234
+ getXBNBPriceUSD(): Promise<bigint>;
235
+ getEffectiveLeverage(): Promise<bigint>;
236
+ getApUSDSupply(): Promise<bigint>;
237
+ getXBNBSupply(): Promise<bigint>;
238
+ getLSTCollateral(lstToken: Address): Promise<bigint>;
239
+ getCurrentFees(): Promise<CurrentFees>;
240
+ getBNBPriceUSD(): Promise<bigint>;
241
+ getLSTPriceUSD(lstToken: Address): Promise<bigint>;
242
+ getLSTInfo(lstToken: Address): Promise<LSTInfo>;
243
+ getSupportedLSTs(): Promise<readonly Address[]>;
244
+ isLSTSupported(lstToken: Address): Promise<boolean>;
245
+ getBNBPriceFeed(): Promise<Address>;
246
+ getOracleBounds(priceFeed: Address): Promise<OracleBounds>;
247
+ getShares(user: Address): Promise<bigint>;
248
+ getBalance(user: Address): Promise<bigint>;
249
+ getUserStabilityPoolPosition(user: Address): Promise<UserStabilityPoolPosition>;
250
+ getExchangeRate(): Promise<bigint>;
251
+ getTotalStaked(): Promise<bigint>;
252
+ previewDeposit(assets: bigint): Promise<bigint>;
253
+ previewRedeem(shares: bigint): Promise<bigint>;
254
+ getPendingYield(): Promise<bigint>;
255
+ getTotalYieldGenerated(): Promise<bigint>;
256
+ getLSTYieldInfo(lstToken: Address): Promise<LSTYieldInfo>;
257
+ getMinHarvestInterval(): Promise<bigint>;
258
+ getLastHarvestTimestamp(): Promise<bigint>;
259
+ previewHarvest(): Promise<bigint>;
260
+ getTokens(): Promise<TokenAddresses>;
261
+ getSApUSD(): Promise<Address>;
262
+ getStabilityPool(): Promise<Address>;
263
+ getTreasury(): Promise<Address>;
264
+ getFeeTierCount(): Promise<bigint>;
265
+ getFeeTier(index: bigint): Promise<FeeTier>;
266
+ getCurrentFeeTier(): Promise<CurrentFeeTier>;
267
+ getMaxPriceAge(): Promise<bigint>;
268
+ getMinDepositPeriod(): Promise<bigint>;
269
+ isPaused(): Promise<boolean>;
270
+ getStabilityMode(): Promise<StabilityModeInfo>;
271
+ canTriggerStabilityMode2(): Promise<StabilityMode2Info>;
272
+ getOwner(): Promise<Address>;
273
+ }
274
+ /**
275
+ * Full client with write capabilities for interacting with Aspan Protocol
276
+ */
277
+ declare class AspanClient extends AspanReadClient {
278
+ private readonly walletClient;
279
+ constructor(config: AspanWriteClientConfig);
280
+ /**
281
+ * Mint apUSD by depositing LST
282
+ * @param params Mint parameters
283
+ * @returns Transaction hash
284
+ */
285
+ mintApUSD(params: MintApUSDParams): Promise<Hash>;
286
+ /**
287
+ * Redeem apUSD for LST
288
+ * @param params Redeem parameters
289
+ * @returns Transaction hash
290
+ */
291
+ redeemApUSD(params: RedeemApUSDParams): Promise<Hash>;
292
+ /**
293
+ * Mint xBNB by depositing LST
294
+ * @param params Mint parameters
295
+ * @returns Transaction hash
296
+ */
297
+ mintXBNB(params: MintXBNBParams): Promise<Hash>;
298
+ /**
299
+ * Redeem xBNB for LST
300
+ * @param params Redeem parameters
301
+ * @returns Transaction hash
302
+ */
303
+ redeemXBNB(params: RedeemXBNBParams): Promise<Hash>;
304
+ /**
305
+ * Deposit apUSD to stability pool to earn yield
306
+ * @param params Deposit parameters
307
+ * @returns Transaction hash
308
+ */
309
+ deposit(params: DepositParams): Promise<Hash>;
310
+ /**
311
+ * Withdraw from stability pool by shares
312
+ * @param params Withdraw parameters
313
+ * @returns Transaction hash
314
+ */
315
+ withdraw(params: WithdrawParams): Promise<Hash>;
316
+ /**
317
+ * Withdraw from stability pool by asset amount
318
+ * @param params Withdraw parameters
319
+ * @returns Transaction hash
320
+ */
321
+ withdrawAssets(params: WithdrawAssetsParams): Promise<Hash>;
322
+ /**
323
+ * Harvest yield from LSTs
324
+ * @returns Transaction hash
325
+ */
326
+ harvestYield(): Promise<Hash>;
327
+ /**
328
+ * Wait for transaction confirmation
329
+ * @param hash Transaction hash
330
+ * @returns Transaction receipt
331
+ */
332
+ waitForTransaction(hash: Hash): Promise<viem.TransactionReceipt>;
333
+ }
334
+ /**
335
+ * Create a read-only client for BSC mainnet
336
+ */
337
+ declare function createAspanReadClient(diamondAddress: Address, rpcUrl?: string): AspanReadClient;
338
+ /**
339
+ * Create a full client for BSC mainnet
340
+ */
341
+ declare function createAspanClient(diamondAddress: Address, account: Account, rpcUrl?: string): AspanClient;
342
+ /**
343
+ * Create a read-only client for BSC testnet
344
+ */
345
+ declare function createAspanTestnetReadClient(diamondAddress: Address, rpcUrl?: string): AspanReadClient;
346
+ /**
347
+ * Create a full client for BSC testnet
348
+ */
349
+ declare function createAspanTestnetClient(diamondAddress: Address, account: Account, rpcUrl?: string): AspanClient;
350
+
351
+ /**
352
+ * Combined Diamond ABI - includes all facet functions
353
+ * This ABI is used to interact with the Aspan Diamond contract
354
+ */
355
+ declare const DiamondABI: readonly [{
356
+ readonly type: "function";
357
+ readonly name: "mintApUSD";
358
+ readonly inputs: readonly [{
359
+ readonly name: "_lstToken";
360
+ readonly type: "address";
361
+ readonly internalType: "address";
362
+ }, {
363
+ readonly name: "_lstAmount";
364
+ readonly type: "uint256";
365
+ readonly internalType: "uint256";
366
+ }];
367
+ readonly outputs: readonly [{
368
+ readonly name: "apUSDAmount";
369
+ readonly type: "uint256";
370
+ readonly internalType: "uint256";
371
+ }];
372
+ readonly stateMutability: "nonpayable";
373
+ }, {
374
+ readonly type: "function";
375
+ readonly name: "redeemApUSD";
376
+ readonly inputs: readonly [{
377
+ readonly name: "_lstToken";
378
+ readonly type: "address";
379
+ readonly internalType: "address";
380
+ }, {
381
+ readonly name: "_apUSDAmount";
382
+ readonly type: "uint256";
383
+ readonly internalType: "uint256";
384
+ }];
385
+ readonly outputs: readonly [{
386
+ readonly name: "lstAmount";
387
+ readonly type: "uint256";
388
+ readonly internalType: "uint256";
389
+ }];
390
+ readonly stateMutability: "nonpayable";
391
+ }, {
392
+ readonly type: "function";
393
+ readonly name: "mintXBNB";
394
+ readonly inputs: readonly [{
395
+ readonly name: "_lstToken";
396
+ readonly type: "address";
397
+ readonly internalType: "address";
398
+ }, {
399
+ readonly name: "_lstAmount";
400
+ readonly type: "uint256";
401
+ readonly internalType: "uint256";
402
+ }];
403
+ readonly outputs: readonly [{
404
+ readonly name: "xBNBAmount";
405
+ readonly type: "uint256";
406
+ readonly internalType: "uint256";
407
+ }];
408
+ readonly stateMutability: "nonpayable";
409
+ }, {
410
+ readonly type: "function";
411
+ readonly name: "redeemXBNB";
412
+ readonly inputs: readonly [{
413
+ readonly name: "_lstToken";
414
+ readonly type: "address";
415
+ readonly internalType: "address";
416
+ }, {
417
+ readonly name: "_xBNBAmount";
418
+ readonly type: "uint256";
419
+ readonly internalType: "uint256";
420
+ }];
421
+ readonly outputs: readonly [{
422
+ readonly name: "lstAmount";
423
+ readonly type: "uint256";
424
+ readonly internalType: "uint256";
425
+ }];
426
+ readonly stateMutability: "nonpayable";
427
+ }, {
428
+ readonly type: "function";
429
+ readonly name: "getXBNBPriceBNB";
430
+ readonly inputs: readonly [];
431
+ readonly outputs: readonly [{
432
+ readonly name: "";
433
+ readonly type: "uint256";
434
+ readonly internalType: "uint256";
435
+ }];
436
+ readonly stateMutability: "view";
437
+ }, {
438
+ readonly type: "function";
439
+ readonly name: "getXBNBPriceUSD";
440
+ readonly inputs: readonly [];
441
+ readonly outputs: readonly [{
442
+ readonly name: "";
443
+ readonly type: "uint256";
444
+ readonly internalType: "uint256";
445
+ }];
446
+ readonly stateMutability: "view";
447
+ }, {
448
+ readonly type: "function";
449
+ readonly name: "getTVLInBNB";
450
+ readonly inputs: readonly [];
451
+ readonly outputs: readonly [{
452
+ readonly name: "";
453
+ readonly type: "uint256";
454
+ readonly internalType: "uint256";
455
+ }];
456
+ readonly stateMutability: "view";
457
+ }, {
458
+ readonly type: "function";
459
+ readonly name: "getTVLInUSD";
460
+ readonly inputs: readonly [];
461
+ readonly outputs: readonly [{
462
+ readonly name: "";
463
+ readonly type: "uint256";
464
+ readonly internalType: "uint256";
465
+ }];
466
+ readonly stateMutability: "view";
467
+ }, {
468
+ readonly type: "function";
469
+ readonly name: "getCollateralRatio";
470
+ readonly inputs: readonly [];
471
+ readonly outputs: readonly [{
472
+ readonly name: "";
473
+ readonly type: "uint256";
474
+ readonly internalType: "uint256";
475
+ }];
476
+ readonly stateMutability: "view";
477
+ }, {
478
+ readonly type: "function";
479
+ readonly name: "getCurrentFees";
480
+ readonly inputs: readonly [];
481
+ readonly outputs: readonly [{
482
+ readonly name: "currentCR";
483
+ readonly type: "uint256";
484
+ readonly internalType: "uint256";
485
+ }, {
486
+ readonly name: "tierMinCR";
487
+ readonly type: "uint256";
488
+ readonly internalType: "uint256";
489
+ }, {
490
+ readonly name: "apUSDMintFee";
491
+ readonly type: "uint16";
492
+ readonly internalType: "uint16";
493
+ }, {
494
+ readonly name: "apUSDRedeemFee";
495
+ readonly type: "uint16";
496
+ readonly internalType: "uint16";
497
+ }, {
498
+ readonly name: "xBNBMintFee";
499
+ readonly type: "uint16";
500
+ readonly internalType: "uint16";
501
+ }, {
502
+ readonly name: "xBNBRedeemFee";
503
+ readonly type: "uint16";
504
+ readonly internalType: "uint16";
505
+ }, {
506
+ readonly name: "apUSDMintDisabled";
507
+ readonly type: "bool";
508
+ readonly internalType: "bool";
509
+ }];
510
+ readonly stateMutability: "view";
511
+ }, {
512
+ readonly type: "function";
513
+ readonly name: "getEffectiveLeverage";
514
+ readonly inputs: readonly [];
515
+ readonly outputs: readonly [{
516
+ readonly name: "";
517
+ readonly type: "uint256";
518
+ readonly internalType: "uint256";
519
+ }];
520
+ readonly stateMutability: "view";
521
+ }, {
522
+ readonly type: "function";
523
+ readonly name: "getApUSDSupply";
524
+ readonly inputs: readonly [];
525
+ readonly outputs: readonly [{
526
+ readonly name: "";
527
+ readonly type: "uint256";
528
+ readonly internalType: "uint256";
529
+ }];
530
+ readonly stateMutability: "view";
531
+ }, {
532
+ readonly type: "function";
533
+ readonly name: "getXBNBSupply";
534
+ readonly inputs: readonly [];
535
+ readonly outputs: readonly [{
536
+ readonly name: "";
537
+ readonly type: "uint256";
538
+ readonly internalType: "uint256";
539
+ }];
540
+ readonly stateMutability: "view";
541
+ }, {
542
+ readonly type: "function";
543
+ readonly name: "getLSTCollateral";
544
+ readonly inputs: readonly [{
545
+ readonly name: "_lstToken";
546
+ readonly type: "address";
547
+ readonly internalType: "address";
548
+ }];
549
+ readonly outputs: readonly [{
550
+ readonly name: "amount";
551
+ readonly type: "uint256";
552
+ readonly internalType: "uint256";
553
+ }];
554
+ readonly stateMutability: "view";
555
+ }, {
556
+ readonly type: "event";
557
+ readonly name: "ApUSDMinted";
558
+ readonly inputs: readonly [{
559
+ readonly name: "user";
560
+ readonly type: "address";
561
+ readonly indexed: true;
562
+ readonly internalType: "address";
563
+ }, {
564
+ readonly name: "lstToken";
565
+ readonly type: "address";
566
+ readonly indexed: true;
567
+ readonly internalType: "address";
568
+ }, {
569
+ readonly name: "lstAmount";
570
+ readonly type: "uint256";
571
+ readonly indexed: false;
572
+ readonly internalType: "uint256";
573
+ }, {
574
+ readonly name: "apUSDAmount";
575
+ readonly type: "uint256";
576
+ readonly indexed: false;
577
+ readonly internalType: "uint256";
578
+ }, {
579
+ readonly name: "feeBPS";
580
+ readonly type: "uint256";
581
+ readonly indexed: false;
582
+ readonly internalType: "uint256";
583
+ }];
584
+ readonly anonymous: false;
585
+ }, {
586
+ readonly type: "event";
587
+ readonly name: "ApUSDRedeemed";
588
+ readonly inputs: readonly [{
589
+ readonly name: "user";
590
+ readonly type: "address";
591
+ readonly indexed: true;
592
+ readonly internalType: "address";
593
+ }, {
594
+ readonly name: "lstToken";
595
+ readonly type: "address";
596
+ readonly indexed: true;
597
+ readonly internalType: "address";
598
+ }, {
599
+ readonly name: "apUSDAmount";
600
+ readonly type: "uint256";
601
+ readonly indexed: false;
602
+ readonly internalType: "uint256";
603
+ }, {
604
+ readonly name: "lstAmount";
605
+ readonly type: "uint256";
606
+ readonly indexed: false;
607
+ readonly internalType: "uint256";
608
+ }, {
609
+ readonly name: "feeBPS";
610
+ readonly type: "uint256";
611
+ readonly indexed: false;
612
+ readonly internalType: "uint256";
613
+ }];
614
+ readonly anonymous: false;
615
+ }, {
616
+ readonly type: "event";
617
+ readonly name: "XBNBMinted";
618
+ readonly inputs: readonly [{
619
+ readonly name: "user";
620
+ readonly type: "address";
621
+ readonly indexed: true;
622
+ readonly internalType: "address";
623
+ }, {
624
+ readonly name: "lstToken";
625
+ readonly type: "address";
626
+ readonly indexed: true;
627
+ readonly internalType: "address";
628
+ }, {
629
+ readonly name: "lstAmount";
630
+ readonly type: "uint256";
631
+ readonly indexed: false;
632
+ readonly internalType: "uint256";
633
+ }, {
634
+ readonly name: "xBNBAmount";
635
+ readonly type: "uint256";
636
+ readonly indexed: false;
637
+ readonly internalType: "uint256";
638
+ }, {
639
+ readonly name: "feeBPS";
640
+ readonly type: "uint256";
641
+ readonly indexed: false;
642
+ readonly internalType: "uint256";
643
+ }];
644
+ readonly anonymous: false;
645
+ }, {
646
+ readonly type: "event";
647
+ readonly name: "XBNBRedeemed";
648
+ readonly inputs: readonly [{
649
+ readonly name: "user";
650
+ readonly type: "address";
651
+ readonly indexed: true;
652
+ readonly internalType: "address";
653
+ }, {
654
+ readonly name: "lstToken";
655
+ readonly type: "address";
656
+ readonly indexed: true;
657
+ readonly internalType: "address";
658
+ }, {
659
+ readonly name: "xBNBAmount";
660
+ readonly type: "uint256";
661
+ readonly indexed: false;
662
+ readonly internalType: "uint256";
663
+ }, {
664
+ readonly name: "lstAmount";
665
+ readonly type: "uint256";
666
+ readonly indexed: false;
667
+ readonly internalType: "uint256";
668
+ }, {
669
+ readonly name: "feeBPS";
670
+ readonly type: "uint256";
671
+ readonly indexed: false;
672
+ readonly internalType: "uint256";
673
+ }];
674
+ readonly anonymous: false;
675
+ }, {
676
+ readonly type: "function";
677
+ readonly name: "getBNBPriceUSD";
678
+ readonly inputs: readonly [];
679
+ readonly outputs: readonly [{
680
+ readonly name: "";
681
+ readonly type: "uint256";
682
+ readonly internalType: "uint256";
683
+ }];
684
+ readonly stateMutability: "view";
685
+ }, {
686
+ readonly type: "function";
687
+ readonly name: "getLSTPriceUSD";
688
+ readonly inputs: readonly [{
689
+ readonly name: "_lstToken";
690
+ readonly type: "address";
691
+ readonly internalType: "address";
692
+ }];
693
+ readonly outputs: readonly [{
694
+ readonly name: "";
695
+ readonly type: "uint256";
696
+ readonly internalType: "uint256";
697
+ }];
698
+ readonly stateMutability: "view";
699
+ }, {
700
+ readonly type: "function";
701
+ readonly name: "getLSTInfo";
702
+ readonly inputs: readonly [{
703
+ readonly name: "_lstToken";
704
+ readonly type: "address";
705
+ readonly internalType: "address";
706
+ }];
707
+ readonly outputs: readonly [{
708
+ readonly name: "isAccepted";
709
+ readonly type: "bool";
710
+ readonly internalType: "bool";
711
+ }, {
712
+ readonly name: "priceFeed";
713
+ readonly type: "address";
714
+ readonly internalType: "address";
715
+ }, {
716
+ readonly name: "manualPriceUSD";
717
+ readonly type: "uint256";
718
+ readonly internalType: "uint256";
719
+ }, {
720
+ readonly name: "collateralAmount";
721
+ readonly type: "uint256";
722
+ readonly internalType: "uint256";
723
+ }, {
724
+ readonly name: "decimals";
725
+ readonly type: "uint8";
726
+ readonly internalType: "uint8";
727
+ }, {
728
+ readonly name: "exchangeRateProvider";
729
+ readonly type: "address";
730
+ readonly internalType: "address";
731
+ }, {
732
+ readonly name: "useIntrinsicValue";
733
+ readonly type: "bool";
734
+ readonly internalType: "bool";
735
+ }];
736
+ readonly stateMutability: "view";
737
+ }, {
738
+ readonly type: "function";
739
+ readonly name: "getSupportedLSTs";
740
+ readonly inputs: readonly [];
741
+ readonly outputs: readonly [{
742
+ readonly name: "";
743
+ readonly type: "address[]";
744
+ readonly internalType: "address[]";
745
+ }];
746
+ readonly stateMutability: "view";
747
+ }, {
748
+ readonly type: "function";
749
+ readonly name: "isLSTSupported";
750
+ readonly inputs: readonly [{
751
+ readonly name: "_lstToken";
752
+ readonly type: "address";
753
+ readonly internalType: "address";
754
+ }];
755
+ readonly outputs: readonly [{
756
+ readonly name: "";
757
+ readonly type: "bool";
758
+ readonly internalType: "bool";
759
+ }];
760
+ readonly stateMutability: "view";
761
+ }, {
762
+ readonly type: "function";
763
+ readonly name: "bnbPriceFeed";
764
+ readonly inputs: readonly [];
765
+ readonly outputs: readonly [{
766
+ readonly name: "";
767
+ readonly type: "address";
768
+ readonly internalType: "address";
769
+ }];
770
+ readonly stateMutability: "view";
771
+ }, {
772
+ readonly type: "function";
773
+ readonly name: "getOracleBounds";
774
+ readonly inputs: readonly [{
775
+ readonly name: "_priceFeed";
776
+ readonly type: "address";
777
+ readonly internalType: "address";
778
+ }];
779
+ readonly outputs: readonly [{
780
+ readonly name: "minPrice";
781
+ readonly type: "uint256";
782
+ readonly internalType: "uint256";
783
+ }, {
784
+ readonly name: "maxPrice";
785
+ readonly type: "uint256";
786
+ readonly internalType: "uint256";
787
+ }];
788
+ readonly stateMutability: "view";
789
+ }, {
790
+ readonly type: "function";
791
+ readonly name: "deposit";
792
+ readonly inputs: readonly [{
793
+ readonly name: "_apUSDAmount";
794
+ readonly type: "uint256";
795
+ readonly internalType: "uint256";
796
+ }];
797
+ readonly outputs: readonly [{
798
+ readonly name: "shares";
799
+ readonly type: "uint256";
800
+ readonly internalType: "uint256";
801
+ }];
802
+ readonly stateMutability: "nonpayable";
803
+ }, {
804
+ readonly type: "function";
805
+ readonly name: "withdraw";
806
+ readonly inputs: readonly [{
807
+ readonly name: "_shares";
808
+ readonly type: "uint256";
809
+ readonly internalType: "uint256";
810
+ }];
811
+ readonly outputs: readonly [{
812
+ readonly name: "assets";
813
+ readonly type: "uint256";
814
+ readonly internalType: "uint256";
815
+ }];
816
+ readonly stateMutability: "nonpayable";
817
+ }, {
818
+ readonly type: "function";
819
+ readonly name: "withdrawAssets";
820
+ readonly inputs: readonly [{
821
+ readonly name: "_assets";
822
+ readonly type: "uint256";
823
+ readonly internalType: "uint256";
824
+ }];
825
+ readonly outputs: readonly [{
826
+ readonly name: "shares";
827
+ readonly type: "uint256";
828
+ readonly internalType: "uint256";
829
+ }];
830
+ readonly stateMutability: "nonpayable";
831
+ }, {
832
+ readonly type: "function";
833
+ readonly name: "getShares";
834
+ readonly inputs: readonly [{
835
+ readonly name: "_user";
836
+ readonly type: "address";
837
+ readonly internalType: "address";
838
+ }];
839
+ readonly outputs: readonly [{
840
+ readonly name: "";
841
+ readonly type: "uint256";
842
+ readonly internalType: "uint256";
843
+ }];
844
+ readonly stateMutability: "view";
845
+ }, {
846
+ readonly type: "function";
847
+ readonly name: "getBalance";
848
+ readonly inputs: readonly [{
849
+ readonly name: "_user";
850
+ readonly type: "address";
851
+ readonly internalType: "address";
852
+ }];
853
+ readonly outputs: readonly [{
854
+ readonly name: "";
855
+ readonly type: "uint256";
856
+ readonly internalType: "uint256";
857
+ }];
858
+ readonly stateMutability: "view";
859
+ }, {
860
+ readonly type: "function";
861
+ readonly name: "getExchangeRate";
862
+ readonly inputs: readonly [];
863
+ readonly outputs: readonly [{
864
+ readonly name: "";
865
+ readonly type: "uint256";
866
+ readonly internalType: "uint256";
867
+ }];
868
+ readonly stateMutability: "view";
869
+ }, {
870
+ readonly type: "function";
871
+ readonly name: "getTotalStaked";
872
+ readonly inputs: readonly [];
873
+ readonly outputs: readonly [{
874
+ readonly name: "";
875
+ readonly type: "uint256";
876
+ readonly internalType: "uint256";
877
+ }];
878
+ readonly stateMutability: "view";
879
+ }, {
880
+ readonly type: "function";
881
+ readonly name: "previewDeposit";
882
+ readonly inputs: readonly [{
883
+ readonly name: "_assets";
884
+ readonly type: "uint256";
885
+ readonly internalType: "uint256";
886
+ }];
887
+ readonly outputs: readonly [{
888
+ readonly name: "";
889
+ readonly type: "uint256";
890
+ readonly internalType: "uint256";
891
+ }];
892
+ readonly stateMutability: "view";
893
+ }, {
894
+ readonly type: "function";
895
+ readonly name: "previewRedeem";
896
+ readonly inputs: readonly [{
897
+ readonly name: "_shares";
898
+ readonly type: "uint256";
899
+ readonly internalType: "uint256";
900
+ }];
901
+ readonly outputs: readonly [{
902
+ readonly name: "";
903
+ readonly type: "uint256";
904
+ readonly internalType: "uint256";
905
+ }];
906
+ readonly stateMutability: "view";
907
+ }, {
908
+ readonly type: "function";
909
+ readonly name: "getPendingYield";
910
+ readonly inputs: readonly [];
911
+ readonly outputs: readonly [{
912
+ readonly name: "";
913
+ readonly type: "uint256";
914
+ readonly internalType: "uint256";
915
+ }];
916
+ readonly stateMutability: "view";
917
+ }, {
918
+ readonly type: "function";
919
+ readonly name: "harvestYield";
920
+ readonly inputs: readonly [];
921
+ readonly outputs: readonly [{
922
+ readonly name: "yieldAmount";
923
+ readonly type: "uint256";
924
+ readonly internalType: "uint256";
925
+ }];
926
+ readonly stateMutability: "nonpayable";
927
+ }, {
928
+ readonly type: "event";
929
+ readonly name: "Deposited";
930
+ readonly inputs: readonly [{
931
+ readonly name: "user";
932
+ readonly type: "address";
933
+ readonly indexed: true;
934
+ readonly internalType: "address";
935
+ }, {
936
+ readonly name: "apUSDAmount";
937
+ readonly type: "uint256";
938
+ readonly indexed: false;
939
+ readonly internalType: "uint256";
940
+ }, {
941
+ readonly name: "sharesReceived";
942
+ readonly type: "uint256";
943
+ readonly indexed: false;
944
+ readonly internalType: "uint256";
945
+ }];
946
+ readonly anonymous: false;
947
+ }, {
948
+ readonly type: "event";
949
+ readonly name: "Withdrawn";
950
+ readonly inputs: readonly [{
951
+ readonly name: "user";
952
+ readonly type: "address";
953
+ readonly indexed: true;
954
+ readonly internalType: "address";
955
+ }, {
956
+ readonly name: "sharesRedeemed";
957
+ readonly type: "uint256";
958
+ readonly indexed: false;
959
+ readonly internalType: "uint256";
960
+ }, {
961
+ readonly name: "apUSDReceived";
962
+ readonly type: "uint256";
963
+ readonly indexed: false;
964
+ readonly internalType: "uint256";
965
+ }];
966
+ readonly anonymous: false;
967
+ }, {
968
+ readonly type: "event";
969
+ readonly name: "YieldHarvested";
970
+ readonly inputs: readonly [{
971
+ readonly name: "yieldUSD";
972
+ readonly type: "uint256";
973
+ readonly indexed: false;
974
+ readonly internalType: "uint256";
975
+ }];
976
+ readonly anonymous: false;
977
+ }, {
978
+ readonly type: "function";
979
+ readonly name: "getTotalYieldGenerated";
980
+ readonly inputs: readonly [];
981
+ readonly outputs: readonly [{
982
+ readonly name: "";
983
+ readonly type: "uint256";
984
+ readonly internalType: "uint256";
985
+ }];
986
+ readonly stateMutability: "view";
987
+ }, {
988
+ readonly type: "function";
989
+ readonly name: "getLSTYieldInfo";
990
+ readonly inputs: readonly [{
991
+ readonly name: "_lstToken";
992
+ readonly type: "address";
993
+ readonly internalType: "address";
994
+ }];
995
+ readonly outputs: readonly [{
996
+ readonly name: "lastExchangeRate";
997
+ readonly type: "uint256";
998
+ readonly internalType: "uint256";
999
+ }, {
1000
+ readonly name: "lastUpdateTimestamp";
1001
+ readonly type: "uint256";
1002
+ readonly internalType: "uint256";
1003
+ }];
1004
+ readonly stateMutability: "view";
1005
+ }, {
1006
+ readonly type: "function";
1007
+ readonly name: "getMinHarvestInterval";
1008
+ readonly inputs: readonly [];
1009
+ readonly outputs: readonly [{
1010
+ readonly name: "";
1011
+ readonly type: "uint256";
1012
+ readonly internalType: "uint256";
1013
+ }];
1014
+ readonly stateMutability: "view";
1015
+ }, {
1016
+ readonly type: "function";
1017
+ readonly name: "getLastHarvestTimestamp";
1018
+ readonly inputs: readonly [];
1019
+ readonly outputs: readonly [{
1020
+ readonly name: "";
1021
+ readonly type: "uint256";
1022
+ readonly internalType: "uint256";
1023
+ }];
1024
+ readonly stateMutability: "view";
1025
+ }, {
1026
+ readonly type: "function";
1027
+ readonly name: "previewHarvest";
1028
+ readonly inputs: readonly [];
1029
+ readonly outputs: readonly [{
1030
+ readonly name: "totalYieldUSD";
1031
+ readonly type: "uint256";
1032
+ readonly internalType: "uint256";
1033
+ }];
1034
+ readonly stateMutability: "view";
1035
+ }, {
1036
+ readonly type: "function";
1037
+ readonly name: "getTokens";
1038
+ readonly inputs: readonly [];
1039
+ readonly outputs: readonly [{
1040
+ readonly name: "apUSD";
1041
+ readonly type: "address";
1042
+ readonly internalType: "address";
1043
+ }, {
1044
+ readonly name: "xBNB";
1045
+ readonly type: "address";
1046
+ readonly internalType: "address";
1047
+ }];
1048
+ readonly stateMutability: "view";
1049
+ }, {
1050
+ readonly type: "function";
1051
+ readonly name: "getSApUSD";
1052
+ readonly inputs: readonly [];
1053
+ readonly outputs: readonly [{
1054
+ readonly name: "";
1055
+ readonly type: "address";
1056
+ readonly internalType: "address";
1057
+ }];
1058
+ readonly stateMutability: "view";
1059
+ }, {
1060
+ readonly type: "function";
1061
+ readonly name: "getStabilityPool";
1062
+ readonly inputs: readonly [];
1063
+ readonly outputs: readonly [{
1064
+ readonly name: "";
1065
+ readonly type: "address";
1066
+ readonly internalType: "address";
1067
+ }];
1068
+ readonly stateMutability: "view";
1069
+ }, {
1070
+ readonly type: "function";
1071
+ readonly name: "getTreasury";
1072
+ readonly inputs: readonly [];
1073
+ readonly outputs: readonly [{
1074
+ readonly name: "";
1075
+ readonly type: "address";
1076
+ readonly internalType: "address";
1077
+ }];
1078
+ readonly stateMutability: "view";
1079
+ }, {
1080
+ readonly type: "function";
1081
+ readonly name: "getFeeTierCount";
1082
+ readonly inputs: readonly [];
1083
+ readonly outputs: readonly [{
1084
+ readonly name: "";
1085
+ readonly type: "uint256";
1086
+ readonly internalType: "uint256";
1087
+ }];
1088
+ readonly stateMutability: "view";
1089
+ }, {
1090
+ readonly type: "function";
1091
+ readonly name: "getFeeTier";
1092
+ readonly inputs: readonly [{
1093
+ readonly name: "_index";
1094
+ readonly type: "uint256";
1095
+ readonly internalType: "uint256";
1096
+ }];
1097
+ readonly outputs: readonly [{
1098
+ readonly name: "minCR";
1099
+ readonly type: "uint256";
1100
+ readonly internalType: "uint256";
1101
+ }, {
1102
+ readonly name: "apUSDMintFee";
1103
+ readonly type: "uint16";
1104
+ readonly internalType: "uint16";
1105
+ }, {
1106
+ readonly name: "apUSDRedeemFee";
1107
+ readonly type: "uint16";
1108
+ readonly internalType: "uint16";
1109
+ }, {
1110
+ readonly name: "xBNBMintFee";
1111
+ readonly type: "uint16";
1112
+ readonly internalType: "uint16";
1113
+ }, {
1114
+ readonly name: "xBNBRedeemFee";
1115
+ readonly type: "uint16";
1116
+ readonly internalType: "uint16";
1117
+ }, {
1118
+ readonly name: "apUSDMintDisabled";
1119
+ readonly type: "bool";
1120
+ readonly internalType: "bool";
1121
+ }];
1122
+ readonly stateMutability: "view";
1123
+ }, {
1124
+ readonly type: "function";
1125
+ readonly name: "getCurrentFeeTier";
1126
+ readonly inputs: readonly [];
1127
+ readonly outputs: readonly [{
1128
+ readonly name: "minCR";
1129
+ readonly type: "uint256";
1130
+ readonly internalType: "uint256";
1131
+ }, {
1132
+ readonly name: "apUSDMintFee";
1133
+ readonly type: "uint16";
1134
+ readonly internalType: "uint16";
1135
+ }, {
1136
+ readonly name: "apUSDRedeemFee";
1137
+ readonly type: "uint16";
1138
+ readonly internalType: "uint16";
1139
+ }, {
1140
+ readonly name: "xBNBMintFee";
1141
+ readonly type: "uint16";
1142
+ readonly internalType: "uint16";
1143
+ }, {
1144
+ readonly name: "xBNBRedeemFee";
1145
+ readonly type: "uint16";
1146
+ readonly internalType: "uint16";
1147
+ }, {
1148
+ readonly name: "apUSDMintDisabled";
1149
+ readonly type: "bool";
1150
+ readonly internalType: "bool";
1151
+ }, {
1152
+ readonly name: "currentCR";
1153
+ readonly type: "uint256";
1154
+ readonly internalType: "uint256";
1155
+ }];
1156
+ readonly stateMutability: "view";
1157
+ }, {
1158
+ readonly type: "function";
1159
+ readonly name: "getMaxPriceAge";
1160
+ readonly inputs: readonly [];
1161
+ readonly outputs: readonly [{
1162
+ readonly name: "";
1163
+ readonly type: "uint256";
1164
+ readonly internalType: "uint256";
1165
+ }];
1166
+ readonly stateMutability: "view";
1167
+ }, {
1168
+ readonly type: "function";
1169
+ readonly name: "getMinDepositPeriod";
1170
+ readonly inputs: readonly [];
1171
+ readonly outputs: readonly [{
1172
+ readonly name: "";
1173
+ readonly type: "uint256";
1174
+ readonly internalType: "uint256";
1175
+ }];
1176
+ readonly stateMutability: "view";
1177
+ }, {
1178
+ readonly type: "function";
1179
+ readonly name: "isPaused";
1180
+ readonly inputs: readonly [];
1181
+ readonly outputs: readonly [{
1182
+ readonly name: "";
1183
+ readonly type: "bool";
1184
+ readonly internalType: "bool";
1185
+ }];
1186
+ readonly stateMutability: "view";
1187
+ }, {
1188
+ readonly type: "function";
1189
+ readonly name: "getStabilityMode";
1190
+ readonly inputs: readonly [];
1191
+ readonly outputs: readonly [{
1192
+ readonly name: "mode";
1193
+ readonly type: "uint8";
1194
+ readonly internalType: "uint8";
1195
+ }, {
1196
+ readonly name: "currentCR";
1197
+ readonly type: "uint256";
1198
+ readonly internalType: "uint256";
1199
+ }];
1200
+ readonly stateMutability: "view";
1201
+ }, {
1202
+ readonly type: "function";
1203
+ readonly name: "canTriggerStabilityMode2";
1204
+ readonly inputs: readonly [];
1205
+ readonly outputs: readonly [{
1206
+ readonly name: "canTrigger";
1207
+ readonly type: "bool";
1208
+ readonly internalType: "bool";
1209
+ }, {
1210
+ readonly name: "currentCR";
1211
+ readonly type: "uint256";
1212
+ readonly internalType: "uint256";
1213
+ }, {
1214
+ readonly name: "potentialConversion";
1215
+ readonly type: "uint256";
1216
+ readonly internalType: "uint256";
1217
+ }];
1218
+ readonly stateMutability: "view";
1219
+ }, {
1220
+ readonly type: "function";
1221
+ readonly name: "triggerStabilityMode2";
1222
+ readonly inputs: readonly [{
1223
+ readonly name: "_targetCR";
1224
+ readonly type: "uint256";
1225
+ readonly internalType: "uint256";
1226
+ }];
1227
+ readonly outputs: readonly [{
1228
+ readonly name: "apUSDBurned";
1229
+ readonly type: "uint256";
1230
+ readonly internalType: "uint256";
1231
+ }, {
1232
+ readonly name: "xBNBMinted";
1233
+ readonly type: "uint256";
1234
+ readonly internalType: "uint256";
1235
+ }];
1236
+ readonly stateMutability: "nonpayable";
1237
+ }, {
1238
+ readonly type: "event";
1239
+ readonly name: "StabilityMode2Triggered";
1240
+ readonly inputs: readonly [{
1241
+ readonly name: "currentCR";
1242
+ readonly type: "uint256";
1243
+ readonly indexed: false;
1244
+ readonly internalType: "uint256";
1245
+ }, {
1246
+ readonly name: "targetCR";
1247
+ readonly type: "uint256";
1248
+ readonly indexed: false;
1249
+ readonly internalType: "uint256";
1250
+ }, {
1251
+ readonly name: "apUSDBurned";
1252
+ readonly type: "uint256";
1253
+ readonly indexed: false;
1254
+ readonly internalType: "uint256";
1255
+ }, {
1256
+ readonly name: "xBNBMinted";
1257
+ readonly type: "uint256";
1258
+ readonly indexed: false;
1259
+ readonly internalType: "uint256";
1260
+ }];
1261
+ readonly anonymous: false;
1262
+ }, {
1263
+ readonly type: "function";
1264
+ readonly name: "owner";
1265
+ readonly inputs: readonly [];
1266
+ readonly outputs: readonly [{
1267
+ readonly name: "";
1268
+ readonly type: "address";
1269
+ readonly internalType: "address";
1270
+ }];
1271
+ readonly stateMutability: "view";
1272
+ }];
1273
+
1274
+ /**
1275
+ * Aspan SDK
1276
+ * TypeScript SDK for interacting with the Aspan Protocol on BNB Chain
1277
+ *
1278
+ * @packageDocumentation
1279
+ */
1280
+
1281
+ declare const PRECISION: bigint;
1282
+ declare const BPS_PRECISION = 10000n;
1283
+ declare const PRICE_PRECISION: bigint;
1284
+ /**
1285
+ * Format a bigint amount to human-readable string with decimals
1286
+ * @param amount Amount in wei (18 decimals)
1287
+ * @param decimals Number of decimal places to show
1288
+ * @returns Formatted string
1289
+ */
1290
+ declare function formatAmount(amount: bigint, decimals?: number): string;
1291
+ /**
1292
+ * Parse a human-readable amount to bigint (18 decimals)
1293
+ * @param amount Human-readable amount string
1294
+ * @returns Amount in wei
1295
+ */
1296
+ declare function parseAmount(amount: string): bigint;
1297
+ /**
1298
+ * Format a fee in basis points to percentage string
1299
+ * @param bps Fee in basis points
1300
+ * @returns Percentage string (e.g., "0.25%")
1301
+ */
1302
+ declare function formatFeeBPS(bps: number): string;
1303
+ /**
1304
+ * Format collateral ratio to percentage string
1305
+ * @param cr Collateral ratio (18 decimals, 1e18 = 100%)
1306
+ * @returns Percentage string (e.g., "150%")
1307
+ */
1308
+ declare function formatCR(cr: bigint): string;
1309
+ /**
1310
+ * Format price (8 decimals) to USD string
1311
+ * @param price Price in 8 decimals
1312
+ * @returns USD string (e.g., "$583.25")
1313
+ */
1314
+ declare function formatPriceUSD(price: bigint): string;
1315
+ /**
1316
+ * Calculate effective APY from exchange rate change
1317
+ * @param previousRate Previous exchange rate
1318
+ * @param currentRate Current exchange rate
1319
+ * @param periodDays Number of days between rates
1320
+ * @returns Annualized percentage yield
1321
+ */
1322
+ declare function calculateAPY(previousRate: bigint, currentRate: bigint, periodDays: number): number;
1323
+
1324
+ export { type ApUSDMintedEvent, type ApUSDRedeemedEvent, AspanClient, type AspanClientConfig, AspanReadClient, 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 RedeemApUSDParams, type RedeemXBNBParams, type StabilityMode2Info, type StabilityModeInfo, type StabilityPoolStats, type TokenAddresses, type TransactionReceipt, type TransactionResult, type UserStabilityPoolPosition, type WithdrawAssetsParams, type WithdrawParams, type WithdrawnEvent, type XBNBMintedEvent, type XBNBRedeemedEvent, type YieldHarvestedEvent, type YieldStats, calculateAPY, createAspanClient, createAspanReadClient, createAspanTestnetClient, createAspanTestnetReadClient, formatAmount, formatCR, formatFeeBPS, formatPriceUSD, parseAmount };