@wireio/stake 0.1.1 → 0.1.2

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 (68) hide show
  1. package/lib/stake.browser.js +6677 -116
  2. package/lib/stake.browser.js.map +1 -1
  3. package/lib/stake.d.ts +21 -38
  4. package/lib/stake.js +6680 -121
  5. package/lib/stake.js.map +1 -1
  6. package/lib/stake.m.js +6677 -116
  7. package/lib/stake.m.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.dbg.json +4 -0
  10. package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.json +1153 -0
  11. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IAccounting.dbg.json +4 -0
  12. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IAccounting.json +172 -0
  13. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositContract.dbg.json +4 -0
  14. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositContract.json +39 -0
  15. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositManager.dbg.json +4 -0
  16. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositManager.json +64 -0
  17. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthBurn.dbg.json +4 -0
  18. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthBurn.json +24 -0
  19. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthMint.dbg.json +4 -0
  20. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthMint.json +35 -0
  21. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20.dbg.json +4 -0
  22. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20.json +213 -0
  23. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IStakingModule.dbg.json +4 -0
  24. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IStakingModule.json +138 -0
  25. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +4 -0
  26. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.json +70 -0
  27. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +4 -0
  28. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IWithdrawalRecord.json +64 -0
  29. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/LiqEthCommon.dbg.json +4 -0
  30. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/LiqEthCommon.json +10 -0
  31. package/src/assets/ethereum/ABI/liqEth/RewardsERC20.sol/RewardsERC20.dbg.json +4 -0
  32. package/src/assets/ethereum/ABI/liqEth/RewardsERC20.sol/RewardsERC20.json +749 -0
  33. package/src/assets/ethereum/ABI/liqEth/RewardsERC20Pausable.sol/RewardsERC20Pausable.dbg.json +4 -0
  34. package/src/assets/ethereum/ABI/liqEth/RewardsERC20Pausable.sol/RewardsERC20Pausable.json +812 -0
  35. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.dbg.json +4 -0
  36. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.json +10 -0
  37. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.dbg.json +4 -0
  38. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.json +10 -0
  39. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.dbg.json +4 -0
  40. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.json +225 -0
  41. package/src/assets/ethereum/ABI/liqEth/Yield.sol/BeaconRoots.dbg.json +4 -0
  42. package/src/assets/ethereum/ABI/liqEth/Yield.sol/BeaconRoots.json +10 -0
  43. package/src/assets/ethereum/ABI/liqEth/Yield.sol/SSZ.dbg.json +4 -0
  44. package/src/assets/ethereum/ABI/liqEth/Yield.sol/SSZ.json +10 -0
  45. package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.dbg.json +4 -0
  46. package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.json +813 -0
  47. package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.dbg.json +4 -0
  48. package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.json +651 -0
  49. package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.dbg.json +4 -0
  50. package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.json +1110 -0
  51. package/src/assets/ethereum/ABI/liqEth/liqEthBurn.sol/LiqEthBurn.dbg.json +4 -0
  52. package/src/assets/ethereum/ABI/liqEth/liqEthBurn.sol/LiqEthBurn.json +391 -0
  53. package/src/assets/ethereum/ABI/liqEth/liqEthMint.sol/LiqEthMint.dbg.json +4 -0
  54. package/src/assets/ethereum/ABI/liqEth/liqEthMint.sol/LiqEthMint.json +402 -0
  55. package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.dbg.json +4 -0
  56. package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.json +1225 -0
  57. package/src/assets/ethereum/ABI/liqEth/withdrawalQueue.sol/WithdrawalQueue.dbg.json +4 -0
  58. package/src/assets/ethereum/ABI/liqEth/withdrawalQueue.sol/WithdrawalQueue.json +927 -0
  59. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.dbg.json +4 -0
  60. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.json +10 -0
  61. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.dbg.json +4 -0
  62. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.json +447 -0
  63. package/src/networks/ethereum/contract.ts +53 -90
  64. package/src/networks/ethereum/ethereum.ts +31 -64
  65. package/src/networks/ethereum/types.ts +6 -9
  66. package/src/networks/solana/solana.ts +36 -32
  67. package/src/staker/staker.ts +5 -2
  68. package/src/staker/types.ts +12 -7
package/lib/stake.d.ts CHANGED
@@ -14,7 +14,6 @@ interface IStakingClient {
14
14
  /** Amount is in the chain's smallest unit (lamports/wei, etc.) */
15
15
  deposit(amount: number): Promise<string>;
16
16
  /** Register any untracked LIQ staked tokens */
17
- register(): Promise<string>;
18
17
  /** Fetch the portfolio for the LIQ stake user */
19
18
  getPortfolio(): Promise<Portfolio>;
20
19
  }
@@ -24,14 +23,19 @@ type StakerConfig = {
24
23
  pubKey: PublicKey;
25
24
  };
26
25
  interface Portfolio {
27
- /** Native SOL balance on chain */
26
+ /** Native balance on chain: ETH, SOL */
28
27
  native: BalanceView;
29
- /** Actual liquid SOL balance from ATA */
30
- actual: BalanceView;
31
- /** Tracked liquid SOL balance from distribution program */
32
- tracked: BalanceView;
28
+ /** Actual Liquid balance of LiqETH, LiqSOL*/
29
+ liq: BalanceView;
30
+ /** Outpost Staked balance */
31
+ staked: BalanceView;
32
+ /** SOL ONLY!
33
+ * Tracked liqSOL balance from distribution program */
34
+ tracked?: BalanceView;
33
35
  /** Extra PDAs and account addresses */
34
36
  extras?: Record<string, any>;
37
+ /** Chain ID of the network for which this portfolio is from */
38
+ chainID: ChainID;
35
39
  }
36
40
  type BalanceView = {
37
41
  amount: BigNumberish;
@@ -67,17 +71,11 @@ declare class EthereumStakingClient implements IStakingClient {
67
71
  private readonly signer;
68
72
  private readonly contractService;
69
73
  get contract(): {
70
- Stake: ethers.Contract;
71
- LiqEth: ethers.Contract;
74
+ Accounting: ethers.Contract;
72
75
  DepositManager: ethers.Contract;
73
- LiqEthMint: ethers.Contract;
76
+ LiqEth: ethers.Contract;
74
77
  LiqEthBurn: ethers.Contract;
75
- LiqEthTreasury: ethers.Contract;
76
- LiqEthCommon: ethers.Contract;
77
- RewardsERC20: ethers.Contract;
78
- ValidatorBalanceVerifier: ethers.Contract;
79
- Yield: ethers.Contract;
80
- Accounting: ethers.Contract;
78
+ LiqEthMint: ethers.Contract;
81
79
  StakingModule: ethers.Contract;
82
80
  WithdrawalQueue: ethers.Contract;
83
81
  WithdrawalVault: ethers.Contract;
@@ -99,15 +97,6 @@ declare class EthereumStakingClient implements IStakingClient {
99
97
  */
100
98
  simulateDeposit(amount: number | string | bigint | BigNumber): Promise<void>;
101
99
  private performDeposit;
102
- /**
103
- * Build, sign, and submit a single transaction that:
104
- * - Corrects other users (if needed) to free available balance, then
105
- * - Registers the caller’s untracked liqSOL.
106
- *
107
- * @param amount Optional: register a smaller amount than your full untracked balance.
108
- * @returns signature string
109
- */
110
- register(amount?: bigint): Promise<string>;
111
100
  /**
112
101
  * Resolve the user's ETH + liqETH balances.
113
102
  *
@@ -118,7 +107,7 @@ declare class EthereumStakingClient implements IStakingClient {
118
107
  getPortfolio(): Promise<Portfolio>;
119
108
  }
120
109
 
121
- declare const CONTRACT_NAMES: readonly ["Stake", "LiqEth", "DepositManager", "LiqEthMint", "LiqEthBurn", "LiqEthTreasury", "LiqEthCommon", "RewardsERC20", "ValidatorBalanceVerifier", "Yield", "Accounting", "StakingModule", "WithdrawalQueue", "WithdrawalVault"];
110
+ declare const CONTRACT_NAMES: readonly ["Accounting", "DepositManager", "LiqEth", "LiqEthBurn", "LiqEthMint", "StakingModule", "WithdrawalQueue", "WithdrawalVault"];
122
111
  type ContractName = typeof CONTRACT_NAMES[number];
123
112
  type AddressBook = Record<ContractName, string>;
124
113
  interface DepositEvent {
@@ -146,12 +135,6 @@ declare namespace types$1 {
146
135
  export type { types$1_AddressBook as AddressBook, types$1_ContractName as ContractName, types$1_DepositEvent as DepositEvent, types$1_DepositResult as DepositResult };
147
136
  }
148
137
 
149
- /**
150
- * @module EthereumContractService
151
- *
152
- * Provides a unified service for interacting with Ethereum smart contracts using ethers.js.
153
- */
154
-
155
138
  declare const ERC20Abi: ({
156
139
  inputs: {
157
140
  internalType: string;
@@ -420,6 +403,12 @@ declare class SolanaStakingClient implements IStakingClient {
420
403
  */
421
404
  getUserRecord(): Promise<UserRecord | null>;
422
405
  getProtocolFee(): void;
406
+ /**
407
+ * Deposit funds into the staking pool.
408
+ * @param lamports The amount to deposit (in lamports).
409
+ * @returns The transaction signature.
410
+ */
411
+ deposit(lamports: number): Promise<string>;
423
412
  /**
424
413
  * Build, sign, and submit a single transaction that:
425
414
  * - Corrects other users (if needed) to free available balance, then
@@ -428,13 +417,7 @@ declare class SolanaStakingClient implements IStakingClient {
428
417
  * @param amount Optional: register a smaller amount than your full untracked balance.
429
418
  * @returns signature string
430
419
  */
431
- register(amount?: bigint): Promise<string>;
432
- /**
433
- * Deposit funds into the staking pool.
434
- * @param lamports The amount to deposit (in lamports).
435
- * @returns The transaction signature.
436
- */
437
- deposit(lamports: number): Promise<string>;
420
+ correctBalance(amount?: bigint): Promise<string>;
438
421
  private sendAndConfirmHttp;
439
422
  signTransaction(tx: SolanaTransaction): Promise<SolanaTransaction>;
440
423
  sendTransaction(signed: SolanaTransaction): Promise<TransactionSignature>;