@wireio/stake 0.2.4 → 0.3.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.
Files changed (100) hide show
  1. package/lib/stake.browser.js +5991 -4340
  2. package/lib/stake.browser.js.map +1 -1
  3. package/lib/stake.d.ts +74 -60
  4. package/lib/stake.js +9782 -8054
  5. package/lib/stake.js.map +1 -1
  6. package/lib/stake.m.js +5991 -4340
  7. package/lib/stake.m.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/assets/ethereum/ABI/liqEth/BeaconState.sol/BeaconState.dbg.json +4 -0
  10. package/src/assets/ethereum/ABI/liqEth/BeaconState.sol/BeaconState.json +807 -0
  11. package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.dbg.json +1 -1
  12. package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.json +184 -346
  13. package/src/assets/ethereum/ABI/liqEth/LiqEthAuthority.sol/LiqEthAuthority.dbg.json +4 -0
  14. package/src/assets/ethereum/ABI/liqEth/LiqEthAuthority.sol/LiqEthAuthority.json +1289 -0
  15. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IAccounting.dbg.json +1 -1
  16. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositContract.dbg.json +1 -1
  17. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositManager.dbg.json +1 -1
  18. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +4 -0
  19. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.json +29 -0
  20. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20.dbg.json +1 -1
  21. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20.json +36 -0
  22. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +4 -0
  23. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.json +263 -0
  24. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IStakingModule.dbg.json +1 -1
  25. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IStakingModule.json +226 -0
  26. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +1 -1
  27. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.json +59 -0
  28. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +1 -1
  29. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IWithdrawalRecord.json +14 -12
  30. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/LiqEthCommon.dbg.json +1 -1
  31. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/LiqEthCommon.json +2 -2
  32. package/src/assets/ethereum/ABI/liqEth/LiqEthManaged.sol/LiqEthManaged.dbg.json +4 -0
  33. package/src/assets/ethereum/ABI/liqEth/LiqEthManaged.sol/LiqEthManaged.json +229 -0
  34. package/src/assets/ethereum/ABI/liqEth/RewardsERC20.sol/RewardsERC20Upgradeable.dbg.json +4 -0
  35. package/src/assets/ethereum/ABI/liqEth/{RewardsERC20Pausable.sol/RewardsERC20Pausable.json → RewardsERC20.sol/RewardsERC20Upgradeable.json} +140 -78
  36. package/src/assets/ethereum/ABI/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.dbg.json +4 -0
  37. package/src/assets/ethereum/ABI/liqEth/{RewardsERC20.sol/RewardsERC20.json → RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.json} +218 -30
  38. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.dbg.json +1 -1
  39. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.json +2 -2
  40. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.dbg.json +1 -1
  41. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.json +2 -2
  42. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZExtras.dbg.json +4 -0
  43. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZExtras.json +10 -0
  44. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZVec48.dbg.json +4 -0
  45. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZVec48.json +10 -0
  46. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.dbg.json +1 -1
  47. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.json +121 -55
  48. package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.dbg.json +1 -1
  49. package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.json +836 -273
  50. package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.dbg.json +1 -1
  51. package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.json +150 -168
  52. package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.dbg.json +1 -1
  53. package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.json +301 -186
  54. package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.dbg.json +1 -1
  55. package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.json +814 -206
  56. package/src/assets/ethereum/ABI/liqEth/withdrawalQueue.sol/WithdrawalQueue.dbg.json +1 -1
  57. package/src/assets/ethereum/ABI/liqEth/withdrawalQueue.sol/WithdrawalQueue.json +244 -198
  58. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.dbg.json +1 -1
  59. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.json +2 -2
  60. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.dbg.json +1 -1
  61. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.json +165 -152
  62. package/src/assets/ethereum/ABI/outpost/Aggregator.sol/Aggregator.json +82 -0
  63. package/src/assets/ethereum/ABI/outpost/Depositor.sol/Depositor.dbg.json +1 -1
  64. package/src/assets/ethereum/ABI/outpost/Depositor.sol/Depositor.json +167 -282
  65. package/src/assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.dbg.json +1 -1
  66. package/src/assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.dbg.json +1 -1
  67. package/src/assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.json +2 -54
  68. package/src/assets/ethereum/ABI/outpost/OPP.sol/OPP.dbg.json +1 -1
  69. package/src/assets/ethereum/ABI/outpost/OPP.sol/OPP.json +26 -8
  70. package/src/assets/ethereum/ABI/outpost/OPPInbound.sol/OPPInbound.dbg.json +1 -1
  71. package/src/assets/ethereum/ABI/outpost/OPPInbound.sol/OPPInbound.json +2 -2
  72. package/src/assets/ethereum/ABI/outpost/Pretoken.sol/Pretoken.dbg.json +4 -0
  73. package/src/assets/ethereum/ABI/outpost/Pretoken.sol/Pretoken.json +1650 -0
  74. package/src/assets/ethereum/ABI/outpost/ReceiptNFT.sol/ReceiptNFT.dbg.json +1 -1
  75. package/src/assets/ethereum/ABI/outpost/ReceiptNFT.sol/ReceiptNFT.json +2 -22
  76. package/src/assets/ethereum/ABI/outpost/interfaces/IPretoken.sol/IPretoken.dbg.json +4 -0
  77. package/src/assets/ethereum/ABI/outpost/interfaces/IPretoken.sol/IPretoken.json +29 -0
  78. package/src/assets/ethereum/ABI/outpost/interfaces/IWarrant.sol/IWarrant.dbg.json +1 -1
  79. package/src/networks/ethereum/clients/deposit.client.ts +86 -8
  80. package/src/networks/ethereum/clients/liq.client.ts +47 -0
  81. package/src/networks/ethereum/clients/pretoken.client.ts +127 -0
  82. package/src/networks/ethereum/clients/stake.client.ts +87 -24
  83. package/src/networks/ethereum/contract.ts +34 -48
  84. package/src/networks/ethereum/ethereum.ts +219 -96
  85. package/src/networks/ethereum/types.ts +9 -6
  86. package/src/networks/ethereum/utils.ts +308 -0
  87. package/src/networks/solana/clients/token.client.ts +0 -1
  88. package/src/networks/solana/solana.ts +44 -146
  89. package/src/networks/solana/types.ts +6 -2
  90. package/src/networks/solana/utils.ts +4 -6
  91. package/src/staker/types.ts +62 -0
  92. package/src/types.ts +18 -33
  93. package/src/assets/ethereum/ABI/liqEth/RewardsERC20.sol/RewardsERC20.dbg.json +0 -4
  94. package/src/assets/ethereum/ABI/liqEth/RewardsERC20Pausable.sol/RewardsERC20Pausable.dbg.json +0 -4
  95. package/src/assets/ethereum/ABI/liqEth/Yield.sol/BeaconRoots.dbg.json +0 -4
  96. package/src/assets/ethereum/ABI/liqEth/Yield.sol/BeaconRoots.json +0 -10
  97. package/src/assets/ethereum/ABI/liqEth/Yield.sol/SSZ.dbg.json +0 -4
  98. package/src/assets/ethereum/ABI/liqEth/Yield.sol/SSZ.json +0 -10
  99. package/src/assets/ethereum/ABI/outpost/Warrant.sol/Warrant.dbg.json +0 -4
  100. package/src/assets/ethereum/ABI/outpost/Warrant.sol/Warrant.json +0 -1650
package/lib/stake.d.ts CHANGED
@@ -11,17 +11,17 @@ import { BN, AnchorProvider, Program } from '@coral-xyz/anchor';
11
11
  type StakerConfig = {
12
12
  network: ExternalNetwork;
13
13
  provider: BaseSignerWalletAdapter | ethers.providers.Web3Provider;
14
- pubKey: PublicKey;
14
+ pubKey?: PublicKey;
15
15
  };
16
16
  interface IStakingClient {
17
- pubKey: PublicKey;
17
+ pubKey?: PublicKey;
18
18
  network: ExternalNetwork;
19
19
  /** Amount is in the chain's smallest unit (lamports/wei, etc.) */
20
20
  deposit(amount: bigint): Promise<string>;
21
21
  withdraw(amount: bigint): Promise<string>;
22
22
  stake(amount: bigint): Promise<string>;
23
23
  unstake(amount: bigint): Promise<string>;
24
- buy(amount: bigint, asset: PurchaseAsset): Promise<string>;
24
+ buy(amount: bigint): Promise<string>;
25
25
  /** Fetch the complete user portfolio */
26
26
  getPortfolio(): Promise<Portfolio>;
27
27
  /**
@@ -36,8 +36,6 @@ interface IStakingClient {
36
36
  windowBefore?: number;
37
37
  windowAfter?: number;
38
38
  }): Promise<TrancheSnapshot | null>;
39
- /** */
40
- getBuyQuote(amount: bigint, asset: PurchaseAsset): Promise<PurchaseQuote>;
41
39
  }
42
40
  interface Portfolio {
43
41
  /** Native balance on chain: ETH, SOL */
@@ -46,7 +44,7 @@ interface Portfolio {
46
44
  liq: BalanceView;
47
45
  /** Outpost Staked balance */
48
46
  staked: BalanceView;
49
- /** Prelaunch WIRE “shares” (warrants/pretokens) */
47
+ /** Prelaunch WIRE “shares” (pretokens) */
50
48
  wire: BalanceView;
51
49
  /** SOL ONLY!
52
50
  * Tracked liqSOL balance from distribution program */
@@ -74,6 +72,18 @@ interface TrancheLadderItem {
74
72
  /** Price for this tranche in USD (1e8 scale) */
75
73
  priceUsd: bigint;
76
74
  }
75
+ interface TrancheLadderItem {
76
+ /** On-chain tranche id, 0-based (0,1,2,...) */
77
+ id: number;
78
+ /** Total capacity for this tranche (pretokens, 1e8 scale) */
79
+ capacity: bigint;
80
+ /** Sold amount in this tranche (1e8 scale) */
81
+ sold: bigint;
82
+ /** Remaining = capacity - sold (1e8 scale) */
83
+ remaining: bigint;
84
+ /** Price for this tranche in USD (1e8 scale) */
85
+ priceUsd: bigint;
86
+ }
77
87
  /**
78
88
  * Unified pretoken/tranche snapshot for any chain.
79
89
  * ETH / other chains just fill the same shape from their own contracts.
@@ -88,16 +98,13 @@ interface TrancheSnapshot {
88
98
  currentTranche: number;
89
99
  /** Current tranche price in USD (1e8 scale) */
90
100
  currentPriceUsd: bigint;
91
- /** Optional min/max bounds for price validation (1e8 scale) */
92
- minPriceUsd?: bigint;
93
- maxPriceUsd?: bigint;
94
101
  /** Tranche curve config (per-chain) */
95
102
  supplyGrowthBps: number;
96
103
  priceGrowthBps: number;
97
104
  /** Current tranche supply state (1e8 scale) */
98
105
  currentTrancheSupply: bigint;
99
106
  initialTrancheSupply: bigint;
100
- totalWarrantsSold: bigint;
107
+ totalPretokensSold: bigint;
101
108
  /** Native token → USD price if available (SOL/USD, ETH/USD, etc, 1e8 scale) */
102
109
  nativePriceUsd?: bigint;
103
110
  /** Optional timestamp (sec) for the last recorded native price */
@@ -108,24 +115,6 @@ interface TrancheSnapshot {
108
115
  */
109
116
  ladder: TrancheLadderItem[];
110
117
  }
111
- /** Purchase asset selection used by staking client(s) */
112
- declare enum PurchaseAsset {
113
- SOL = "SOL",
114
- LIQSOL = "LIQSOL",
115
- ETH = "ETH",
116
- LIQETH = "LIQETH",
117
- YIELD = "YIELD"
118
- }
119
- interface PurchaseQuote {
120
- purchaseAsset: PurchaseAsset;
121
- amountIn: bigint;
122
- /** Expected pretoken “shares” (pretokens) and decimals */
123
- wireShares: bigint;
124
- wireDecimals: number;
125
- /** Current price + notional in USD (1e8 scale) */
126
- wirePriceUsd: bigint;
127
- notionalUsd: bigint;
128
- }
129
118
 
130
119
  declare class Staker {
131
120
  selectedChainID?: ChainID;
@@ -147,7 +136,7 @@ declare class Staker {
147
136
  setChain(chainID: ChainID): boolean;
148
137
  }
149
138
 
150
- declare const CONTRACT_NAMES: readonly ["Accounting", "DepositManager", "LiqEth", "StakingModule", "WithdrawalQueue", "WithdrawalVault", "Depositor", "ReceiptNFT", "OutpostManager", "BAR", "OPP", "OPPCommon", "OPPInbound", "Warrant"];
139
+ declare const CONTRACT_NAMES: readonly ["Accounting", "DepositManager", "LiqEth", "StakingModule", "WithdrawalQueue", "WithdrawalVault", "Depositor", "ReceiptNFT", "OutpostManager", "BAR", "OPP", "OPPCommon", "OPPInbound", "Pretoken", "Aggregator", "EthUsdPriceConsumer"];
151
140
  type ContractName = typeof CONTRACT_NAMES[number];
152
141
  type AddressBook = Record<ContractName, string>;
153
142
  interface Result {
@@ -195,6 +184,11 @@ interface WithdrawnStakeResult extends Result {
195
184
  /** Parsed WithdrawnStake event, if present */
196
185
  withdrawnstake?: WithdrawnStakeEvent;
197
186
  }
187
+ interface SharesBurnedEvent {
188
+ from: string;
189
+ shares: BigNumber;
190
+ tokenValue: BigNumber;
191
+ }
198
192
  interface preLaunchReceipt {
199
193
  tokenId: bigint;
200
194
  receipt: {
@@ -213,6 +207,7 @@ declare const types$1_CONTRACT_NAMES: typeof CONTRACT_NAMES;
213
207
  type types$1_ContractName = ContractName;
214
208
  type types$1_DepositEvent = DepositEvent;
215
209
  type types$1_DepositResult = DepositResult;
210
+ type types$1_SharesBurnedEvent = SharesBurnedEvent;
216
211
  type types$1_StakedEvent = StakedEvent;
217
212
  type types$1_StakedResult = StakedResult;
218
213
  type types$1_WithdrawRequestedEvent = WithdrawRequestedEvent;
@@ -222,16 +217,18 @@ type types$1_WithdrawnStakeResult = WithdrawnStakeResult;
222
217
  type types$1_preLaunchReceipt = preLaunchReceipt;
223
218
  declare namespace types$1 {
224
219
  export { types$1_CONTRACT_NAMES as CONTRACT_NAMES };
225
- export type { types$1_AddressBook as AddressBook, types$1_ContractName as ContractName, types$1_DepositEvent as DepositEvent, types$1_DepositResult as DepositResult, types$1_StakedEvent as StakedEvent, types$1_StakedResult as StakedResult, types$1_WithdrawRequestedEvent as WithdrawRequestedEvent, types$1_WithdrawResult as WithdrawResult, types$1_WithdrawnStakeEvent as WithdrawnStakeEvent, types$1_WithdrawnStakeResult as WithdrawnStakeResult, types$1_preLaunchReceipt as preLaunchReceipt };
220
+ export type { types$1_AddressBook as AddressBook, types$1_ContractName as ContractName, types$1_DepositEvent as DepositEvent, types$1_DepositResult as DepositResult, types$1_SharesBurnedEvent as SharesBurnedEvent, types$1_StakedEvent as StakedEvent, types$1_StakedResult as StakedResult, types$1_WithdrawRequestedEvent as WithdrawRequestedEvent, types$1_WithdrawResult as WithdrawResult, types$1_WithdrawnStakeEvent as WithdrawnStakeEvent, types$1_WithdrawnStakeResult as WithdrawnStakeResult, types$1_preLaunchReceipt as preLaunchReceipt };
226
221
  }
227
222
 
228
223
  declare class EthereumStakingClient implements IStakingClient {
229
224
  private config;
230
- readonly pubKey: PublicKey;
225
+ readonly pubKey?: PublicKey;
231
226
  private readonly provider;
232
227
  private readonly signer;
233
228
  private readonly contractService;
234
229
  private depositClient;
230
+ private liqClient;
231
+ private pretokenClient;
235
232
  private stakeClient;
236
233
  get contract(): {
237
234
  Accounting: ethers.Contract;
@@ -247,7 +244,9 @@ declare class EthereumStakingClient implements IStakingClient {
247
244
  OPP: ethers.Contract;
248
245
  OPPCommon: ethers.Contract;
249
246
  OPPInbound: ethers.Contract;
250
- Warrant: ethers.Contract;
247
+ Pretoken: ethers.Contract;
248
+ Aggregator: ethers.Contract;
249
+ EthUsdPriceConsumer: ethers.Contract;
251
250
  };
252
251
  get network(): _wireio_core.ExternalNetwork;
253
252
  constructor(config: StakerConfig);
@@ -258,14 +257,36 @@ declare class EthereumStakingClient implements IStakingClient {
258
257
  * @returns transaction hash
259
258
  */
260
259
  deposit(amount: number | string | bigint | BigNumber): Promise<string>;
261
- withdraw(amount: number | string | bigint | BigNumber): Promise<string>;
260
+ /**
261
+ * Withdraw native ETH from the liqETH protocol via the liqeth safeBurn function, which burns the LiqETH and adds the user to the withdrawal queue.
262
+ * @param amount Amount in wei (or something convertible to BigNumber).
263
+ * @returns transaction hash
264
+ */
265
+ withdraw(amount: bigint): Promise<string>;
266
+ /**
267
+ * Stake liqETH via DepositManager.
268
+ * @param amount Amount in wei
269
+ * Keep this as a bigint / string in the caller; avoid JS floats.
270
+ * @returns transaction hash
271
+ */
262
272
  stake(amount: bigint): Promise<string>;
263
273
  unstake(): Promise<string>;
274
+ /**
275
+ * ETH Prelaunch function to unstake liqEth
276
+ * @param tokenId ReceiptNFT tokenId for the owned NFT that will be burned
277
+ * @param recipient Address to receive the liqEth funds linked to the burned NFT
278
+ * @returns the transaction hash
279
+ */
264
280
  unstakePrelaunch(tokenId: bigint, recipient: string): Promise<string>;
281
+ buy(amount: bigint): Promise<string>;
282
+ getOPPStatus(): Promise<any>;
283
+ /**
284
+ * ETH Prelaunch function to list the ReceiptNFTs owned by a specific user
285
+ * @param address address to query the receipts for
286
+ * @returns array of receipts
287
+ */
265
288
  fetchPrelaunchReceipts(address?: string): Promise<preLaunchReceipt[]>;
266
289
  getEthStats(): Promise<any>;
267
- buy(amount: bigint, purchaseAsset: PurchaseAsset): Promise<string>;
268
- getBuyQuote(amount: bigint, purchaseAsset: PurchaseAsset): Promise<PurchaseQuote>;
269
290
  /**
270
291
  * Resolve the user's ETH + liqETH balances.
271
292
  *
@@ -275,12 +296,14 @@ declare class EthereumStakingClient implements IStakingClient {
275
296
  */
276
297
  getPortfolio(): Promise<Portfolio>;
277
298
  /**
278
- * Program-level prelaunch WIRE / tranche snapshot for Solana.
279
- * Uses the same OutpostWireStateSnapshot primitive as getPortfolio().
280
- * TODO! for eth
299
+ * Program-level prelaunch WIRE / tranche snapshot for Ethereum
281
300
  */
282
- getTrancheSnapshot(): Promise<TrancheSnapshot | null>;
283
- private requestWithdraw;
301
+ getTrancheSnapshot(options?: {
302
+ chainID?: ChainID;
303
+ windowBefore?: number;
304
+ windowAfter?: number;
305
+ }): Promise<TrancheSnapshot>;
306
+ private updateMockAggregatorPrice;
284
307
  }
285
308
 
286
309
  declare const ERC20Abi: ({
@@ -559,7 +582,7 @@ type GlobalState = {
559
582
  type UserWarrantRecord = {
560
583
  user: PublicKey$1;
561
584
  totalSolDeposited: BN;
562
- totalWarrantsPurchased: BN;
585
+ totalPretokensPurchased: BN;
563
586
  lastTrancheNumber: BN;
564
587
  lastTranchePriceUsd: BN;
565
588
  bump: number;
@@ -569,7 +592,8 @@ type TrancheState = {
569
592
  currentTrancheNumber: BN;
570
593
  currentTrancheSupply: BN;
571
594
  currentTranchePriceUsd: BN;
572
- totalWarrantsSold: BN;
595
+ totalPretokensSold?: BN;
596
+ totalWarrantsSold?: BN;
573
597
  initialTrancheSupply: BN;
574
598
  supplyGrowthBps: number;
575
599
  priceGrowthBps: number;
@@ -630,7 +654,7 @@ declare namespace types {
630
654
  */
631
655
  declare class SolanaStakingClient implements IStakingClient {
632
656
  private config;
633
- pubKey: PublicKey;
657
+ pubKey?: PublicKey;
634
658
  connection: Connection;
635
659
  anchor: AnchorProvider;
636
660
  private depositClient;
@@ -670,7 +694,7 @@ declare class SolanaStakingClient implements IStakingClient {
670
694
  *
671
695
  * ETH / LIQETH are not valid on Solana.
672
696
  */
673
- buy(amountLamports: bigint, purchaseAsset: PurchaseAsset): Promise<string>;
697
+ buy(amountLamports: bigint): Promise<string>;
674
698
  /**
675
699
  * Aggregate view of the user’s balances on Solana:
676
700
  * - native: SOL wallet balance
@@ -692,25 +716,14 @@ declare class SolanaStakingClient implements IStakingClient {
692
716
  * windowBefore/windowAfter control how many ladder rows we precompute
693
717
  * around the current tranche for UI, but you can pass nothing if you
694
718
  * only need current tranche info.
719
+ *
720
+ * READ-ONLY allowed
695
721
  */
696
722
  getTrancheSnapshot(options?: {
697
723
  chainID?: ChainID;
698
724
  windowBefore?: number;
699
725
  windowAfter?: number;
700
726
  }): Promise<TrancheSnapshot>;
701
- /**
702
- * Approximate prelaunch WIRE quote for a given amount & asset.
703
- *
704
- * Uses TrancheSnapshot + SOL/USD price for:
705
- * - SOL: amount is lamports
706
- * - LIQSOL: amount is liqSOL base units (decimals = 9)
707
- * - YIELD: amount is treated as SOL lamports-equivalent of yield
708
- *
709
- * NOTE: On-chain rounding may differ slightly (this is UI-only).
710
- */
711
- getBuyQuote(amount: bigint, asset: PurchaseAsset, opts?: {
712
- chainID?: ChainID;
713
- }): Promise<PurchaseQuote>;
714
727
  /**
715
728
  * Convenience helper to fetch the distribution userRecord for the current user.
716
729
  * Used by balance-correction flows and debugging.
@@ -745,6 +758,7 @@ declare class SolanaStakingClient implements IStakingClient {
745
758
  blockhash: string;
746
759
  lastValidBlockHeight: number;
747
760
  }>;
761
+ ensureWriteAccess(): void;
748
762
  }
749
763
 
750
764
  /**
@@ -5310,7 +5324,7 @@ declare function buildSolanaTrancheLadder(options: {
5310
5324
  currentTranche: number;
5311
5325
  initialTrancheSupply: bigint;
5312
5326
  currentTrancheSupply: bigint;
5313
- totalWarrantsSold: bigint;
5327
+ totalPretokensSold: bigint;
5314
5328
  currentPriceUsd: bigint;
5315
5329
  supplyGrowthBps: number;
5316
5330
  priceGrowthBps: number;
@@ -5677,5 +5691,5 @@ declare class TokenClient {
5677
5691
  getSolPriceUsd(): Promise<bigint>;
5678
5692
  }
5679
5693
 
5680
- export { ADDRESSES, CHAINLINK_FEED, CHAINLINK_PROGRAM, CONTRACTS, DEFAULT_AVERAGE_PAY_RATE, DEFAULT_PAY_RATE_LOOKBACK, DepositClient, DistributionClient, EPHEMERAL_RENT_EXEMPTION, ERC1155Abi, ERC20Abi, ERC721Abi, types$1 as ETH, EthereumContractService, EthereumStakingClient, LAMPORTS_PER_SOL, LIQSOL_CORE, LIQSOL_TOKEN, LeaderboardClient, OutpostClient, PAY_RATE_SCALE_FACTOR, PDA_SEEDS, PROGRAM_IDS, PurchaseAsset, types as SOL, SolanaStakingClient, Staker, TokenClient, VALIDATOR_LEADERBOARD, airdropSol, buildOutpostAccounts, buildSolanaTrancheLadder, buildSolanaTrancheSnapshot, calculateExpectedFee, deriveBarConfigPda, deriveBondLevelPda, deriveBondedActorPda, deriveBucketAuthorityPda, deriveDepositAuthorityPda, deriveDistributionStatePda, deriveEphemeralStakeAddress, deriveLeaderboardStatePda, deriveLiqsolMintAuthorityPda, deriveLiqsolMintPda, deriveOutpostGlobalStatePda, deriveOutpostPoolAuthorityPda, derivePayRateHistoryPda, derivePayoutStatePda, derivePoolUserRecordPda, derivePriceHistoryPda, deriveReservePoolPda, deriveSolBucketPda, deriveStakeControllerStatePda, deriveStakeControllerVaultPda, deriveTrancheStatePda, deriveUserRecordPda, deriveUserUserRecordPda, deriveUserWarrantRecordPda, deriveValidatorRecordPda, deriveVaultPda, deriveWireReceiptPda, generateRandomDepositAmount, generateTestKeypair, getAveragePayRate, getBucketLiqSolBalance, getEpochSnapshot, getErrorMessage, getLiqsolCoreProgram, getPayoutStateRaw, getReservePoolBalance, getStakeControllerStateRaw, getUserLiqSolBalance, getUserRecordRaw, lamportsToSol, msToEpochEnd, previewDepositEffects, scheduledInstruction, sleep, solToLamports, toBigint, tokensToShares, waitForConfirmation, waitUntilSafeToExecuteFunction };
5681
- export type { BalanceView, ContractConfig, ContractOptions, Contracts, EpochSnapshot, IStakingClient, OutpostAccounts, Portfolio, PurchaseQuote, ScheduleConfig, StakerConfig, TrancheLadderItem, TrancheSnapshot };
5694
+ export { ADDRESSES, CHAINLINK_FEED, CHAINLINK_PROGRAM, CONTRACTS, DEFAULT_AVERAGE_PAY_RATE, DEFAULT_PAY_RATE_LOOKBACK, DepositClient, DistributionClient, EPHEMERAL_RENT_EXEMPTION, ERC1155Abi, ERC20Abi, ERC721Abi, types$1 as ETH, EthereumContractService, EthereumStakingClient, LAMPORTS_PER_SOL, LIQSOL_CORE, LIQSOL_TOKEN, LeaderboardClient, OutpostClient, PAY_RATE_SCALE_FACTOR, PDA_SEEDS, PROGRAM_IDS, types as SOL, SolanaStakingClient, Staker, TokenClient, VALIDATOR_LEADERBOARD, airdropSol, buildOutpostAccounts, buildSolanaTrancheLadder, buildSolanaTrancheSnapshot, calculateExpectedFee, deriveBarConfigPda, deriveBondLevelPda, deriveBondedActorPda, deriveBucketAuthorityPda, deriveDepositAuthorityPda, deriveDistributionStatePda, deriveEphemeralStakeAddress, deriveLeaderboardStatePda, deriveLiqsolMintAuthorityPda, deriveLiqsolMintPda, deriveOutpostGlobalStatePda, deriveOutpostPoolAuthorityPda, derivePayRateHistoryPda, derivePayoutStatePda, derivePoolUserRecordPda, derivePriceHistoryPda, deriveReservePoolPda, deriveSolBucketPda, deriveStakeControllerStatePda, deriveStakeControllerVaultPda, deriveTrancheStatePda, deriveUserRecordPda, deriveUserUserRecordPda, deriveUserWarrantRecordPda, deriveValidatorRecordPda, deriveVaultPda, deriveWireReceiptPda, generateRandomDepositAmount, generateTestKeypair, getAveragePayRate, getBucketLiqSolBalance, getEpochSnapshot, getErrorMessage, getLiqsolCoreProgram, getPayoutStateRaw, getReservePoolBalance, getStakeControllerStateRaw, getUserLiqSolBalance, getUserRecordRaw, lamportsToSol, msToEpochEnd, previewDepositEffects, scheduledInstruction, sleep, solToLamports, toBigint, tokensToShares, waitForConfirmation, waitUntilSafeToExecuteFunction };
5695
+ export type { BalanceView, ContractConfig, ContractOptions, Contracts, EpochSnapshot, IStakingClient, OutpostAccounts, Portfolio, ScheduleConfig, StakerConfig, TrancheLadderItem, TrancheSnapshot };