@wireio/stake 0.4.0 → 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/lib/stake.d.ts CHANGED
@@ -192,6 +192,37 @@ interface TrancheSnapshot {
192
192
  */
193
193
  ladder: TrancheLadderItem[];
194
194
  }
195
+ declare enum PurchaseAsset {
196
+ SOL = "SOL",
197
+ LIQSOL = "LIQSOL",
198
+ ETH = "ETH",
199
+ LIQETH = "LIQETH",
200
+ YIELD = "YIELD"
201
+ }
202
+ interface PurchaseQuote {
203
+ purchaseAsset: PurchaseAsset;
204
+ amountIn: bigint;
205
+ /** Expected pretoken “shares” (pretokens) and decimals */
206
+ wireShares: bigint;
207
+ wireDecimals: number;
208
+ /** Current price + notional in USD (1e8 scale) */
209
+ wirePriceUsd: bigint;
210
+ notionalUsd: bigint;
211
+ }
212
+ interface OPPAssertion {
213
+ type: 'liq_pretoken_purchase' | 'yield_pretoken_purchase' | 'pretoken_purchase' | 'stake' | 'unstake' | 'bonded_actor' | 'unbonded_actor' | 'unknown';
214
+ data: any;
215
+ chain: 'ETH' | 'SOL';
216
+ timestamp: number | null;
217
+ from: string | null;
218
+ to: string | null;
219
+ txHash: string;
220
+ raw: any;
221
+ }
222
+ declare enum ReceiptNFTKind {
223
+ STAKE = 0,
224
+ PRETOKEN_PURCHASE = 1
225
+ }
195
226
 
196
227
  declare class Staker {
197
228
  selectedChainID?: ChainID;
@@ -213,7 +244,7 @@ declare class Staker {
213
244
  setChain(chainID: ChainID): boolean;
214
245
  }
215
246
 
216
- declare const CONTRACT_NAMES: readonly ["Accounting", "DepositManager", "LiqEth", "StakingModule", "WithdrawalQueue", "WithdrawalVault", "Depositor", "ReceiptNFT", "OutpostManager", "BAR", "OPP", "OPPCommon", "OPPInbound", "Pretoken", "Aggregator", "EthUsdPriceConsumer"];
247
+ declare const CONTRACT_NAMES: readonly ["Accounting", "DepositManager", "LiqEth", "StakingModule", "WithdrawalQueue", "WithdrawalVault", "Depositor", "ReceiptNFT", "OutpostManager", "BAR", "OPP", "OPPCommon", "OPPInbound", "Pretoken", "Aggregator", "EthUsdPriceConsumer", "Pool"];
217
248
  type ContractName = typeof CONTRACT_NAMES[number];
218
249
  type AddressBook = Record<ContractName, string>;
219
250
  interface Result {
@@ -303,10 +334,11 @@ declare class EthereumStakingClient implements IStakingClient {
303
334
  private readonly provider;
304
335
  private readonly signer;
305
336
  private readonly contractService;
306
- private depositClient;
307
- private liqClient;
337
+ private convertClient;
308
338
  private pretokenClient;
309
339
  private stakeClient;
340
+ private oppClient;
341
+ private receiptClient;
310
342
  get contract(): {
311
343
  Accounting: ethers.Contract;
312
344
  DepositManager: ethers.Contract;
@@ -324,6 +356,7 @@ declare class EthereumStakingClient implements IStakingClient {
324
356
  Pretoken: ethers.Contract;
325
357
  Aggregator: ethers.Contract;
326
358
  EthUsdPriceConsumer: ethers.Contract;
359
+ Pool: ethers.Contract;
327
360
  };
328
361
  get network(): _wireio_core.ExternalNetwork;
329
362
  constructor(config: StakerConfig);
@@ -342,8 +375,7 @@ declare class EthereumStakingClient implements IStakingClient {
342
375
  withdraw(amount: bigint): Promise<string>;
343
376
  /**
344
377
  * Stake liqETH via DepositManager.
345
- * @param amount Amount in wei
346
- * Keep this as a bigint / string in the caller; avoid JS floats.
378
+ * @param amount Amount in wei - Keep this as a bigint / string in the caller; avoid JS floats.
347
379
  * @returns transaction hash
348
380
  */
349
381
  stake(amount: bigint): Promise<string>;
@@ -356,9 +388,10 @@ declare class EthereumStakingClient implements IStakingClient {
356
388
  */
357
389
  unstakePrelaunch(tokenId: bigint, recipient: string): Promise<string>;
358
390
  buy(amount: bigint): Promise<string>;
391
+ getOPPMessages(address?: string): Promise<OPPAssertion[]>;
359
392
  getOPPStatus(): Promise<any>;
360
393
  /**
361
- * ETH Prelaunch function to list the ReceiptNFTs owned by a specific user
394
+ * ETH Prelaunch function to list the Stake ReceiptNFTs owned by a specific user
362
395
  * @param address address to query the receipts for
363
396
  * @returns array of receipts
364
397
  */
@@ -7598,5 +7631,5 @@ declare const INDEX_SCALE: bigint;
7598
7631
  declare const lamportsToSol: (lamports: number | bigint) => number;
7599
7632
  declare const solToLamports: (sol: number) => bigint;
7600
7633
 
7601
- 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, INDEX_SCALE, LAMPORTS_PER_SOL, LIQSOL_CORE, LIQSOL_TOKEN, LeaderboardClient, OutpostClient, PAY_RATE_SCALE_FACTOR, PDA_SEEDS, PROGRAM_IDS, types as SOL, SolanaStakingClient, Staker, TRANSFER_HOOK, TokenClient, VALIDATOR_LEADERBOARD, airdropSol, buildOutpostAccounts, buildSolanaTrancheLadder, buildSolanaTrancheSnapshot, calculateExpectedFee, deriveBarConfigPda, deriveBondLevelPda, deriveBondedActorPda, deriveBucketAuthorityPda, deriveDepositAuthorityPda, deriveDistributionStatePda, deriveEphemeralStakeAddress, deriveExtraAccountMetaListPda, deriveLeaderboardStatePda, deriveLiqReceiptDataPda, deriveLiqsolMintAuthorityPda, deriveLiqsolMintPda, deriveMaintenanceLedgerPda, deriveOutpostAccountPda, deriveOutpostGlobalStatePda, deriveOutpostPoolAuthorityPda, derivePayRateHistoryPda, derivePayoutStatePda, derivePriceHistoryPda, deriveReservePoolPda, deriveStakeAllocationStatePda, deriveStakeControllerStatePda, deriveStakeControllerVaultPda, deriveStakeMetricsPda, deriveTrancheStatePda, deriveUserPretokenRecordPda, deriveUserRecordPda, deriveValidatorRecordPda, deriveVaultPda, deriveWithdrawGlobalPda, deriveWithdrawMintAuthorityPda, deriveWithdrawMintMetadataPda, deriveWithdrawNftMintPda, generateRandomDepositAmount, generateTestKeypair, getAveragePayRate, getBucketLiqSolBalance, getEpochSnapshot, getErrorMessage, getLiqsolCoreProgram, getPayoutStateRaw, getReservePoolBalance, getStakeControllerStateRaw, getUserLiqSolBalance, getUserRecordRaw, lamportsToSol, msToEpochEnd, previewDepositEffects, scheduledInstruction, sleep, solToLamports, toBigint, tokensToShares, waitForConfirmation, waitUntilSafeToExecuteFunction };
7602
- export type { BalanceView, ContractConfig, ContractOptions, Contracts, EpochSnapshot, IStakingClient, OutpostAccounts, Portfolio, ScheduleConfig, StakerConfig, TrancheLadderItem, TrancheSnapshot, YieldView };
7634
+ 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, INDEX_SCALE, LAMPORTS_PER_SOL, LIQSOL_CORE, LIQSOL_TOKEN, LeaderboardClient, OutpostClient, PAY_RATE_SCALE_FACTOR, PDA_SEEDS, PROGRAM_IDS, PurchaseAsset, ReceiptNFTKind, types as SOL, SolanaStakingClient, Staker, TRANSFER_HOOK, TokenClient, VALIDATOR_LEADERBOARD, airdropSol, buildOutpostAccounts, buildSolanaTrancheLadder, buildSolanaTrancheSnapshot, calculateExpectedFee, deriveBarConfigPda, deriveBondLevelPda, deriveBondedActorPda, deriveBucketAuthorityPda, deriveDepositAuthorityPda, deriveDistributionStatePda, deriveEphemeralStakeAddress, deriveExtraAccountMetaListPda, deriveLeaderboardStatePda, deriveLiqReceiptDataPda, deriveLiqsolMintAuthorityPda, deriveLiqsolMintPda, deriveMaintenanceLedgerPda, deriveOutpostAccountPda, deriveOutpostGlobalStatePda, deriveOutpostPoolAuthorityPda, derivePayRateHistoryPda, derivePayoutStatePda, derivePriceHistoryPda, deriveReservePoolPda, deriveStakeAllocationStatePda, deriveStakeControllerStatePda, deriveStakeControllerVaultPda, deriveStakeMetricsPda, deriveTrancheStatePda, deriveUserPretokenRecordPda, deriveUserRecordPda, deriveValidatorRecordPda, deriveVaultPda, deriveWithdrawGlobalPda, deriveWithdrawMintAuthorityPda, deriveWithdrawMintMetadataPda, deriveWithdrawNftMintPda, generateRandomDepositAmount, generateTestKeypair, getAveragePayRate, getBucketLiqSolBalance, getEpochSnapshot, getErrorMessage, getLiqsolCoreProgram, getPayoutStateRaw, getReservePoolBalance, getStakeControllerStateRaw, getUserLiqSolBalance, getUserRecordRaw, lamportsToSol, msToEpochEnd, previewDepositEffects, scheduledInstruction, sleep, solToLamports, toBigint, tokensToShares, waitForConfirmation, waitUntilSafeToExecuteFunction };
7635
+ export type { BalanceView, ContractConfig, ContractOptions, Contracts, EpochSnapshot, IStakingClient, OPPAssertion, OutpostAccounts, Portfolio, PurchaseQuote, ScheduleConfig, StakerConfig, TrancheLadderItem, TrancheSnapshot, YieldView };