@wireio/stake 0.4.3 → 0.5.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.
Files changed (129) hide show
  1. package/lib/stake.browser.js +12820 -6787
  2. package/lib/stake.browser.js.map +1 -1
  3. package/lib/stake.d.ts +353 -209
  4. package/lib/stake.js +12940 -6886
  5. package/lib/stake.js.map +1 -1
  6. package/lib/stake.m.js +12820 -6787
  7. package/lib/stake.m.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/assets/ethereum/ABI/common/Base58.sol/Base58.dbg.json +4 -0
  10. package/src/assets/ethereum/ABI/common/Base58.sol/Base58.json +164 -0
  11. package/src/assets/ethereum/ABI/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.dbg.json +4 -0
  12. package/src/assets/ethereum/ABI/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.json +76 -0
  13. package/src/assets/ethereum/ABI/common/RestrictedCallers.sol/RestrictedCallers.dbg.json +4 -0
  14. package/src/assets/ethereum/ABI/common/RestrictedCallers.sol/RestrictedCallers.json +10 -0
  15. package/src/assets/ethereum/ABI/common/iodata.sol/iodata.dbg.json +4 -0
  16. package/src/assets/ethereum/ABI/common/iodata.sol/iodata.json +618 -0
  17. package/src/assets/ethereum/ABI/common/iodata_util.sol/iodata_util.dbg.json +4 -0
  18. package/src/assets/ethereum/ABI/common/iodata_util.sol/iodata_util.json +40 -0
  19. package/src/assets/ethereum/ABI/common/sysio_data.sol/sysio_data.dbg.json +4 -0
  20. package/src/assets/ethereum/ABI/common/sysio_data.sol/sysio_data.json +10 -0
  21. package/src/assets/ethereum/ABI/common/sysio_errors.sol/sysio_errors.dbg.json +4 -0
  22. package/src/assets/ethereum/ABI/common/sysio_errors.sol/sysio_errors.json +10 -0
  23. package/src/assets/ethereum/ABI/common/sysio_merkle.sol/sysio_merkle.dbg.json +4 -0
  24. package/src/assets/ethereum/ABI/common/sysio_merkle.sol/sysio_merkle.json +233 -0
  25. package/src/assets/ethereum/ABI/common/sysio_name.sol/sysio_name.dbg.json +4 -0
  26. package/src/assets/ethereum/ABI/common/sysio_name.sol/sysio_name.json +49 -0
  27. package/src/assets/ethereum/ABI/common/sysio_pubkey.sol/sysio_pubkey.dbg.json +4 -0
  28. package/src/assets/ethereum/ABI/common/sysio_pubkey.sol/sysio_pubkey.json +64 -0
  29. package/src/assets/ethereum/ABI/common/sysio_read.sol/sysio_read.dbg.json +4 -0
  30. package/src/assets/ethereum/ABI/common/sysio_read.sol/sysio_read.json +1458 -0
  31. package/src/assets/ethereum/ABI/common/sysio_tester.sol/SysioTester.dbg.json +4 -0
  32. package/src/assets/ethereum/ABI/common/sysio_tester.sol/SysioTester.json +1532 -0
  33. package/src/assets/ethereum/ABI/common/sysio_verify.sol/sysio_verify.dbg.json +4 -0
  34. package/src/assets/ethereum/ABI/common/sysio_verify.sol/sysio_verify.json +1525 -0
  35. package/src/assets/ethereum/ABI/common/sysio_write.sol/sysio_write.dbg.json +4 -0
  36. package/src/assets/ethereum/ABI/common/sysio_write.sol/sysio_write.json +1076 -0
  37. package/src/assets/ethereum/ABI/liqEth/BeaconState.sol/BeaconState.dbg.json +1 -1
  38. package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.dbg.json +1 -1
  39. package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.json +28 -2
  40. package/src/assets/ethereum/ABI/liqEth/LiqEthAuthority.sol/LiqEthAuthority.dbg.json +1 -1
  41. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IAccounting.dbg.json +1 -1
  42. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositContract.dbg.json +1 -1
  43. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositManager.dbg.json +1 -1
  44. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +1 -1
  45. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20.dbg.json +1 -1
  46. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +1 -1
  47. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IStakingModule.dbg.json +1 -1
  48. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +1 -1
  49. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +1 -1
  50. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/LiqEthCommon.dbg.json +1 -1
  51. package/src/assets/ethereum/ABI/liqEth/LiqEthManaged.sol/LiqEthManaged.dbg.json +1 -1
  52. package/src/assets/ethereum/ABI/liqEth/RewardsERC20.sol/RewardsERC20Upgradeable.dbg.json +1 -1
  53. package/src/assets/ethereum/ABI/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.dbg.json +1 -1
  54. package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.dbg.json +1 -1
  55. package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.json +2 -2
  56. package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.dbg.json +1 -1
  57. package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.json +2 -15
  58. package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.dbg.json +1 -1
  59. package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.dbg.json +1 -1
  60. package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.json +6 -25
  61. package/src/assets/ethereum/ABI/liqEth/withdrawalQueue.sol/WithdrawalQueue.dbg.json +1 -1
  62. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.dbg.json +1 -1
  63. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.json +2 -2
  64. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.dbg.json +1 -1
  65. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.json +6 -25
  66. package/src/assets/ethereum/ABI/outpost/BAR.sol/BAR.dbg.json +1 -1
  67. package/src/assets/ethereum/ABI/outpost/Depositor.sol/Depositor.dbg.json +1 -1
  68. package/src/assets/ethereum/ABI/outpost/Depositor.sol/Depositor.json +26 -26
  69. package/src/assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.dbg.json +1 -1
  70. package/src/assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.dbg.json +1 -1
  71. package/src/assets/ethereum/ABI/outpost/OPP.sol/OPP.dbg.json +1 -1
  72. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPP.dbg.json +1 -1
  73. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPEndpoint.dbg.json +1 -1
  74. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPInbound.dbg.json +1 -1
  75. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPReceiver.dbg.json +1 -1
  76. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPSender.dbg.json +1 -1
  77. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/OPPCommon.dbg.json +1 -1
  78. package/src/assets/ethereum/ABI/outpost/OPPEndpoint.sol/OPPEndpoint.dbg.json +1 -1
  79. package/src/assets/ethereum/ABI/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.dbg.json +1 -1
  80. package/src/assets/ethereum/ABI/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.dbg.json +1 -1
  81. package/src/assets/ethereum/ABI/outpost/OPPErrors.sol/OPPErrors.dbg.json +1 -1
  82. package/src/assets/ethereum/ABI/outpost/OPPInbound.sol/OPPInbound.dbg.json +1 -1
  83. package/src/assets/ethereum/ABI/outpost/OPPReceiver.sol/OPPReceiver.dbg.json +1 -1
  84. package/src/assets/ethereum/ABI/outpost/OPPSender.sol/OPPSender.dbg.json +1 -1
  85. package/src/assets/ethereum/ABI/outpost/OutpostErrors.sol/OutpostErrors.dbg.json +1 -1
  86. package/src/assets/ethereum/ABI/outpost/OutpostManaged.sol/OutpostManaged.dbg.json +1 -1
  87. package/src/assets/ethereum/ABI/outpost/OutpostManager.sol/OutpostManager.dbg.json +1 -1
  88. package/src/assets/ethereum/ABI/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.dbg.json +1 -1
  89. package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/IOutpostManager.dbg.json +1 -1
  90. package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.dbg.json +1 -1
  91. package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.dbg.json +1 -1
  92. package/src/assets/ethereum/ABI/outpost/OutpostOwnable.sol/OutpostOwnable.dbg.json +1 -1
  93. package/src/assets/ethereum/ABI/outpost/Pool.sol/Pool.dbg.json +1 -1
  94. package/src/assets/ethereum/ABI/outpost/Pool.sol/Pool.json +2 -2
  95. package/src/assets/ethereum/ABI/outpost/Pretoken.sol/Pretoken.dbg.json +1 -1
  96. package/src/assets/ethereum/ABI/outpost/Pretoken.sol/Pretoken.json +9 -9
  97. package/src/assets/ethereum/ABI/outpost/ReceiptNFT.sol/ReceiptNFT.dbg.json +1 -1
  98. package/src/assets/ethereum/ABI/outpost/interfaces/IPretoken.sol/IPretoken.dbg.json +1 -1
  99. package/src/assets/ethereum/ABI/outpost/interfaces/IWarrant.sol/IWarrant.dbg.json +1 -1
  100. package/src/assets/ethereum/ABI/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.dbg.json +1 -1
  101. package/src/assets/ethereum/ABI/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.dbg.json +1 -1
  102. package/src/assets/solana/idl/liqsol_core.json +132 -182
  103. package/src/assets/solana/types/liqsol_core.ts +132 -182
  104. package/src/networks/ethereum/clients/convert.client.ts +2 -2
  105. package/src/networks/ethereum/clients/pretoken.client.ts +8 -9
  106. package/src/networks/ethereum/clients/stake.client.ts +4 -7
  107. package/src/networks/ethereum/contract.ts +112 -59
  108. package/src/networks/ethereum/ethereum.ts +144 -56
  109. package/src/networks/ethereum/types.ts +26 -17
  110. package/src/networks/ethereum/utils.ts +8 -8
  111. package/src/networks/solana/clients/deposit.client.ts +25 -7
  112. package/src/networks/solana/clients/distribution.client.ts +119 -1
  113. package/src/networks/solana/clients/outpost.client.ts +34 -28
  114. package/src/networks/solana/constants.ts +0 -3
  115. package/src/networks/solana/solana.ts +145 -12
  116. package/src/networks/solana/types.ts +132 -9
  117. package/src/networks/solana/utils.ts +14 -7
  118. package/src/types.ts +19 -11
  119. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.dbg.json +0 -4
  120. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.json +0 -10
  121. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.dbg.json +0 -4
  122. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.json +0 -10
  123. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZExtras.dbg.json +0 -4
  124. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZExtras.json +0 -10
  125. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZVec48.dbg.json +0 -4
  126. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZVec48.json +0 -10
  127. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.dbg.json +0 -4
  128. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.json +0 -291
  129. package/src/staker/types.ts +0 -62
@@ -114,7 +114,7 @@ export function buildSolanaTrancheLadder(options: {
114
114
  currentTrancheSupply: bigint;
115
115
  currentPriceUsd: bigint;
116
116
  supplyGrowthBps: number;
117
- priceGrowthBps: number;
117
+ priceGrowthCents: number;
118
118
  windowBefore?: number;
119
119
  windowAfter?: number;
120
120
  }): TrancheLadderItem[] {
@@ -124,7 +124,7 @@ export function buildSolanaTrancheLadder(options: {
124
124
  currentTrancheSupply,
125
125
  currentPriceUsd,
126
126
  supplyGrowthBps,
127
- priceGrowthBps,
127
+ priceGrowthCents,
128
128
  windowBefore = 5,
129
129
  windowAfter = 5,
130
130
  } = options;
@@ -144,7 +144,7 @@ export function buildSolanaTrancheLadder(options: {
144
144
  const prevCap = capacity.get(id - 1)!;
145
145
  const prevPrice = price.get(id - 1)!;
146
146
  capacity.set(id, growOnce(prevCap, supplyGrowthBps));
147
- price.set(id, growOnce(prevPrice, priceGrowthBps));
147
+ price.set(id, growOnce(prevPrice, priceGrowthCents));
148
148
  }
149
149
 
150
150
  // Backward (past tranches)
@@ -152,7 +152,7 @@ export function buildSolanaTrancheLadder(options: {
152
152
  const nextCap = capacity.get(id + 1)!;
153
153
  const nextPrice = price.get(id + 1)!;
154
154
  capacity.set(id, shrinkOnce(nextCap, supplyGrowthBps));
155
- price.set(id, shrinkOnce(nextPrice, priceGrowthBps));
155
+ price.set(id, shrinkOnce(nextPrice, priceGrowthCents));
156
156
  }
157
157
 
158
158
  const ladder: TrancheLadderItem[] = [];
@@ -210,7 +210,7 @@ export function buildSolanaTrancheSnapshot(options: {
210
210
  const totalPretokensSold = toBigint(trancheState.totalPretokensSold);
211
211
  const currentPriceUsd = toBigint(trancheState.currentTranchePriceUsd);
212
212
  const supplyGrowthBps = trancheState.supplyGrowthBps;
213
- const priceGrowthBps = trancheState.priceGrowthBps;
213
+ const priceGrowthCents = trancheState.priceGrowthCents;
214
214
 
215
215
  const ladder = buildSolanaTrancheLadder({
216
216
  currentTranche,
@@ -218,7 +218,7 @@ export function buildSolanaTrancheSnapshot(options: {
218
218
  currentTrancheSupply,
219
219
  currentPriceUsd,
220
220
  supplyGrowthBps,
221
- priceGrowthBps,
221
+ priceGrowthCents,
222
222
  windowBefore: ladderWindowBefore,
223
223
  windowAfter: ladderWindowAfter,
224
224
  });
@@ -230,7 +230,7 @@ export function buildSolanaTrancheSnapshot(options: {
230
230
  currentTranche,
231
231
  currentPriceUsd,
232
232
  supplyGrowthBps,
233
- priceGrowthBps,
233
+ priceGrowthCents,
234
234
  totalPretokensSold,
235
235
  currentTrancheSupply,
236
236
  initialTrancheSupply,
@@ -798,4 +798,11 @@ export async function waitUntilSafeToExecuteFunction(
798
798
  export interface ScheduleConfig {
799
799
  early?: number; // fraction of epoch, default 0.10
800
800
  late?: number; // fraction of epoch, default 0.90
801
+ }
802
+
803
+ export function ceilDiv(n: BN, d: BN): BN {
804
+ if (d.isZero()) {
805
+ throw new Error('Division by zero in ceilDiv');
806
+ }
807
+ return n.add(d.subn(1)).div(d);
801
808
  }
package/src/types.ts CHANGED
@@ -21,12 +21,16 @@ export interface IStakingClient {
21
21
  buy(amount: bigint): Promise<string>;
22
22
 
23
23
  /** Fetch the complete user portfolio */
24
- getPortfolio(): Promise<Portfolio>;
24
+ getPortfolio(): Promise<Portfolio | null>;
25
25
 
26
26
  // Estimated total APY for staking yeild
27
27
  getSystemAPY(): Promise<number>;
28
28
 
29
- // Protocol fee charged for deposit from Native to LIQ
29
+ /**
30
+ * Protocol fee charged for deposit from Native to LIQ
31
+ * in Solana: amount in lamports
32
+ * in Ethereum: amount in wei
33
+ */
30
34
  getDepositFee(amount: bigint): Promise<bigint>;
31
35
 
32
36
  /**
@@ -41,12 +45,17 @@ export interface IStakingClient {
41
45
  windowBefore?: number;
42
46
  windowAfter?: number;
43
47
  }): Promise<TrancheSnapshot | null>;
44
-
45
- // Estimated total APY for staking yeild
46
- getSystemAPY(): Promise<number>;
47
48
 
48
- // Protocol fee charged for deposit from Native to LIQ
49
- getDepositFee(amount: bigint): Promise<bigint>;
49
+ /**
50
+ * Estimate a conservative ETH(wei) / SOL(lamports) buffer to leave in the wallet
51
+ * so the user can pay fees for the current deposit and at least one
52
+ * more transaction, plus a bit extra for future interactions.
53
+ */
54
+ estimateGasBuffer(options?: {
55
+ txCount?: number;
56
+ safetyMultiplier?: number;
57
+ minBuffer?: bigint;
58
+ }): Promise<bigint>
50
59
  }
51
60
 
52
61
  /**
@@ -207,10 +216,9 @@ export interface TrancheSnapshot {
207
216
  /** Current tranche price in USD (1e8 scale) */
208
217
  currentPriceUsd: bigint;
209
218
 
210
- /** Tranche curve config (per-chain) */
211
- // TODO make a constant?
212
- supplyGrowthBps: number; // e.g. 100 = +1% per tranche
213
- priceGrowthBps: number; // e.g. 200 = +2% per tranche
219
+ supplyGrowthBps: number; // 2.5% growth per tranche
220
+
221
+ priceGrowthCents: number; // $0.02 USD growth per tranche
214
222
 
215
223
  totalPretokensSold: bigint; // total pretokens sold across all tranches (1e8 scale)
216
224
 
@@ -1,4 +0,0 @@
1
- {
2
- "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b5e46b2b97b85c57c7cd2a26cf972153.json"
4
- }
@@ -1,10 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "BeaconRoots",
4
- "sourceName": "contracts/liqEth/ValidatorBalanceVerifier.sol",
5
- "abi": [],
6
- "bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea26469706673582212205929e6d47abd57360b3b4a693fd02ffc914ee421946709f79543eb45d9d83cf464736f6c63430008190033",
7
- "deployedBytecode": "0x600080fdfea26469706673582212205929e6d47abd57360b3b4a693fd02ffc914ee421946709f79543eb45d9d83cf464736f6c63430008190033",
8
- "linkReferences": {},
9
- "deployedLinkReferences": {}
10
- }
@@ -1,4 +0,0 @@
1
- {
2
- "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b5e46b2b97b85c57c7cd2a26cf972153.json"
4
- }
@@ -1,10 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "SSZ",
4
- "sourceName": "contracts/liqEth/ValidatorBalanceVerifier.sol",
5
- "abi": [],
6
- "bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea26469706673582212208e86ba8a0ca879e7aaa6715b41e1830cf4b6301e2c95453171a9c2f0e1487d9464736f6c63430008190033",
7
- "deployedBytecode": "0x600080fdfea26469706673582212208e86ba8a0ca879e7aaa6715b41e1830cf4b6301e2c95453171a9c2f0e1487d9464736f6c63430008190033",
8
- "linkReferences": {},
9
- "deployedLinkReferences": {}
10
- }
@@ -1,4 +0,0 @@
1
- {
2
- "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b5e46b2b97b85c57c7cd2a26cf972153.json"
4
- }
@@ -1,10 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "SSZExtras",
4
- "sourceName": "contracts/liqEth/ValidatorBalanceVerifier.sol",
5
- "abi": [],
6
- "bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea26469706673582212206bffbfe494c06c048356d1409faeae745422d98713ff3b960f4da6ba1bdd203364736f6c63430008190033",
7
- "deployedBytecode": "0x600080fdfea26469706673582212206bffbfe494c06c048356d1409faeae745422d98713ff3b960f4da6ba1bdd203364736f6c63430008190033",
8
- "linkReferences": {},
9
- "deployedLinkReferences": {}
10
- }
@@ -1,4 +0,0 @@
1
- {
2
- "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b5e46b2b97b85c57c7cd2a26cf972153.json"
4
- }
@@ -1,10 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "SSZVec48",
4
- "sourceName": "contracts/liqEth/ValidatorBalanceVerifier.sol",
5
- "abi": [],
6
- "bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea264697066735822122024a0384f9481f6f7a712a90218373b99bd388332bb381d7c3078087bbdf6bb3c64736f6c63430008190033",
7
- "deployedBytecode": "0x600080fdfea264697066735822122024a0384f9481f6f7a712a90218373b99bd388332bb381d7c3078087bbdf6bb3c64736f6c63430008190033",
8
- "linkReferences": {},
9
- "deployedLinkReferences": {}
10
- }
@@ -1,4 +0,0 @@
1
- {
2
- "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b5e46b2b97b85c57c7cd2a26cf972153.json"
4
- }
@@ -1,291 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "ValidatorBalanceVerifier",
4
- "sourceName": "contracts/liqEth/ValidatorBalanceVerifier.sol",
5
- "abi": [
6
- {
7
- "inputs": [
8
- {
9
- "internalType": "uint64",
10
- "name": "ts",
11
- "type": "uint64"
12
- },
13
- {
14
- "internalType": "uint256",
15
- "name": "",
16
- "type": "uint256"
17
- },
18
- {
19
- "internalType": "uint64",
20
- "name": "expectedActivationEpoch",
21
- "type": "uint64"
22
- },
23
- {
24
- "internalType": "bytes32",
25
- "name": "actLeaf",
26
- "type": "bytes32"
27
- },
28
- {
29
- "internalType": "bytes32[]",
30
- "name": "branchState",
31
- "type": "bytes32[]"
32
- },
33
- {
34
- "internalType": "uint256",
35
- "name": "gindexState",
36
- "type": "uint256"
37
- },
38
- {
39
- "internalType": "bytes32[]",
40
- "name": "branchBlock",
41
- "type": "bytes32[]"
42
- },
43
- {
44
- "internalType": "uint256",
45
- "name": "gindexStateInBlock",
46
- "type": "uint256"
47
- }
48
- ],
49
- "name": "verifyActivationEpochAtTimestamp",
50
- "outputs": [
51
- {
52
- "internalType": "bool",
53
- "name": "ok",
54
- "type": "bool"
55
- },
56
- {
57
- "internalType": "uint64",
58
- "name": "activationEpoch",
59
- "type": "uint64"
60
- }
61
- ],
62
- "stateMutability": "view",
63
- "type": "function"
64
- },
65
- {
66
- "inputs": [
67
- {
68
- "internalType": "uint64",
69
- "name": "ts",
70
- "type": "uint64"
71
- },
72
- {
73
- "internalType": "uint256",
74
- "name": "index",
75
- "type": "uint256"
76
- },
77
- {
78
- "internalType": "uint64",
79
- "name": "expectedGwei",
80
- "type": "uint64"
81
- },
82
- {
83
- "internalType": "bytes32",
84
- "name": "balanceLeaf",
85
- "type": "bytes32"
86
- },
87
- {
88
- "internalType": "bytes32[]",
89
- "name": "branchState",
90
- "type": "bytes32[]"
91
- },
92
- {
93
- "internalType": "uint256",
94
- "name": "gindexState",
95
- "type": "uint256"
96
- },
97
- {
98
- "internalType": "bytes32[]",
99
- "name": "branchBlock",
100
- "type": "bytes32[]"
101
- },
102
- {
103
- "internalType": "uint256",
104
- "name": "gindexStateInBlock",
105
- "type": "uint256"
106
- }
107
- ],
108
- "name": "verifyBalanceAtTimestamp",
109
- "outputs": [
110
- {
111
- "internalType": "bool",
112
- "name": "ok",
113
- "type": "bool"
114
- },
115
- {
116
- "internalType": "uint64",
117
- "name": "balanceGwei",
118
- "type": "uint64"
119
- }
120
- ],
121
- "stateMutability": "view",
122
- "type": "function"
123
- },
124
- {
125
- "inputs": [
126
- {
127
- "internalType": "uint64",
128
- "name": "ts",
129
- "type": "uint64"
130
- },
131
- {
132
- "internalType": "uint64",
133
- "name": "expectedExitEpoch",
134
- "type": "uint64"
135
- },
136
- {
137
- "internalType": "bytes32",
138
- "name": "exitLeaf",
139
- "type": "bytes32"
140
- },
141
- {
142
- "internalType": "bytes32[]",
143
- "name": "branchState",
144
- "type": "bytes32[]"
145
- },
146
- {
147
- "internalType": "uint256",
148
- "name": "gindexState",
149
- "type": "uint256"
150
- },
151
- {
152
- "internalType": "bytes32[]",
153
- "name": "branchBlock",
154
- "type": "bytes32[]"
155
- },
156
- {
157
- "internalType": "uint256",
158
- "name": "gindexStateInBlock",
159
- "type": "uint256"
160
- }
161
- ],
162
- "name": "verifyExitEpochAtTimestamp",
163
- "outputs": [
164
- {
165
- "internalType": "bool",
166
- "name": "ok",
167
- "type": "bool"
168
- },
169
- {
170
- "internalType": "uint64",
171
- "name": "exitEpoch",
172
- "type": "uint64"
173
- }
174
- ],
175
- "stateMutability": "view",
176
- "type": "function"
177
- },
178
- {
179
- "inputs": [
180
- {
181
- "internalType": "uint64",
182
- "name": "ts",
183
- "type": "uint64"
184
- },
185
- {
186
- "internalType": "bool",
187
- "name": "expectedSlashed",
188
- "type": "bool"
189
- },
190
- {
191
- "internalType": "bytes32",
192
- "name": "slashedLeaf",
193
- "type": "bytes32"
194
- },
195
- {
196
- "internalType": "bytes32[]",
197
- "name": "branchState",
198
- "type": "bytes32[]"
199
- },
200
- {
201
- "internalType": "uint256",
202
- "name": "gindexState",
203
- "type": "uint256"
204
- },
205
- {
206
- "internalType": "bytes32[]",
207
- "name": "branchBlock",
208
- "type": "bytes32[]"
209
- },
210
- {
211
- "internalType": "uint256",
212
- "name": "gindexStateInBlock",
213
- "type": "uint256"
214
- }
215
- ],
216
- "name": "verifySlashedAtTimestamp",
217
- "outputs": [
218
- {
219
- "internalType": "bool",
220
- "name": "ok",
221
- "type": "bool"
222
- },
223
- {
224
- "internalType": "bool",
225
- "name": "slashed",
226
- "type": "bool"
227
- }
228
- ],
229
- "stateMutability": "view",
230
- "type": "function"
231
- },
232
- {
233
- "inputs": [
234
- {
235
- "internalType": "uint64",
236
- "name": "ts",
237
- "type": "uint64"
238
- },
239
- {
240
- "internalType": "uint64",
241
- "name": "expectedWithdrawableEpoch",
242
- "type": "uint64"
243
- },
244
- {
245
- "internalType": "bytes32",
246
- "name": "wdrLeaf",
247
- "type": "bytes32"
248
- },
249
- {
250
- "internalType": "bytes32[]",
251
- "name": "branchState",
252
- "type": "bytes32[]"
253
- },
254
- {
255
- "internalType": "uint256",
256
- "name": "gindexState",
257
- "type": "uint256"
258
- },
259
- {
260
- "internalType": "bytes32[]",
261
- "name": "branchBlock",
262
- "type": "bytes32[]"
263
- },
264
- {
265
- "internalType": "uint256",
266
- "name": "gindexStateInBlock",
267
- "type": "uint256"
268
- }
269
- ],
270
- "name": "verifyWithdrawableEpochAtTimestamp",
271
- "outputs": [
272
- {
273
- "internalType": "bool",
274
- "name": "ok",
275
- "type": "bool"
276
- },
277
- {
278
- "internalType": "uint64",
279
- "name": "withdrawableEpoch",
280
- "type": "uint64"
281
- }
282
- ],
283
- "stateMutability": "view",
284
- "type": "function"
285
- }
286
- ],
287
- "bytecode": "0x608080604052346015576109d6908161001b8239f35b600080fdfe60406080815260048036101561001457600080fd5b6000803560e01c80634a6c1e07146103ef578063897a245914610365578063d58a9e0514610190578063dfd01bdb146100f45763ef8aaee91461005657600080fd5b346100f1575061007d9061008461006c36610534565b9580989b979b959195949294610619565b50506107f7565b916001600160401b03809116908316036100b857509051600181526001600160401b039091166020820152604090f35b0390f35b606490602084519162461bcd60e51b835282015260136024820152720caf0d2e8becae0dec6d040dad2e6dac2e8c6d606b1b6044820152fd5b80fd5b50346100f1575061007d9061011d61010b366105a4565b969b9750948098949194939293610619565b916001600160401b038091169083160361014d57509051600181526001600160401b039091166020820152604090f35b606490602084519162461bcd60e51b8352820152601960248201527f61637469766174696f6e5f65706f6368206d69736d61746368000000000000006044820152fd5b50346100f1576101b56101a2366105a4565b95809b98999a979a959195949294610619565b505060038216918583101561033c576018908751956020870152602086526101dc8661079f565b60031b16918083046008149015171561032957506101fa81846107d0565b5160f81c9261ff0061020f60018401836107d0565b5160f01c169462ff000061022660028501846107d0565b5160e81c1663ff00000061023d60038601856107d0565b5160e01c169064ff00000000610255848701866107d0565b5160d81c16926001600160401b0360ff60381b6102a965ff000000000061027f60058b018a6107d0565b5160d01c1697600766ff00000000000061029c60068d01846107d0565b5160c81c169a01906107d0565b5160c01c169716888a17831784178517861787178817036102f357506100b496979851988998171717171717178291909160206001600160401b0360408301946001845216910152565b60649060208b519162461bcd60e51b8352820152601060248201526f0c4c2d8c2dcc6ca40dad2e6dac2e8c6d60831b6044820152fd5b634e487b7160e01b815260118552602490fd5b865162461bcd60e51b81526020818801526003602482015262706f7360e81b6044820152606490fd5b50346100f1575061007d9061037c61006c36610534565b916001600160401b03809116908316036103ac57509051600181526001600160401b039091166020820152604090f35b606490602084519162461bcd60e51b8352820152601b60248201527f776974686472617761626c655f65706f6368206d69736d6174636800000000006044820152fd5b5090346104fb5760e03660031901126104fb5780356001600160401b039283821682036100f157602435938415158095036104fb57604435926064358281116104f75761043f90369087016104ff565b909260a4359081116104f3579061045e61046f949392369089016104ff565b92909160c435948860843593610619565b5050845160208101928352602081526104878161079f565b51156104e057505160f81c15159182036104aa5750815190600182526020820152f35b606490602084519162461bcd60e51b8352820152601060248201526f0e6d8c2e6d0cac840dad2e6dac2e8c6d60831b6044820152fd5b634e487b7160e01b815260328352602490fd5b8480fd5b8380fd5b5080fd5b9181601f8401121561052f578235916001600160401b03831161052f576020808501948460051b01011161052f57565b600080fd5b60e060031982011261052f576001600160401b0390600435828116810361052f5792602435838116810361052f57926044359260643582811161052f578161057e916004016104ff565b939093926084359260a43591821161052f5761059c916004016104ff565b909160c43590565b9061010060031983011261052f576001600160401b03600435818116810361052f579260243592604435838116810361052f57926064359260843582811161052f57816105f3916004016104ff565b9390939260a4359260c43591821161052f57610611916004016104ff565b909160e43590565b94969193979590976001600160401b03936040519660209786898201921682528881526106458161079f565b6000809281925190720f3df6d732807ef1319fb7b8bb8522d0beac025afa3d15610796573d8781116107825760405197601f8201601f19908116603f011689019081118982101761076e5760405287523d828a89013e5b80610764575b15610729575086855195015194878110610713575b50906106c99185966106d0969b6108cf565b96876108cf565b036106d85750565b6064906040519062461bcd60e51b8252600482015260146024820152730c4cac2c6dedc40e4dedee840dad2e6dac2e8c6d60631b6044820152fd5b60001990880360031b1b909416936106c96106b7565b60405162461bcd60e51b81526004810189905260136024820152721152540d0dce0e081c9958590819985a5b1959606a1b6044820152606490fd5b50878651146106a2565b634e487b7160e01b84526041600452602484fd5b634e487b7160e01b83526041600452602483fd5b6060965061069c565b604081019081106001600160401b038211176107ba57604052565b634e487b7160e01b600052604160045260246000fd5b9081518110156107e1570160200190565b634e487b7160e01b600052603260045260246000fd5b60405190602082019081526020825261080f8261079f565b8151156107e1575160f81c8151600110156107e15761ff00602183015160f01c16178151600210156107e15762ff0000602283015160e81c16178151600310156107e15763ff000000602383015160e01c16178151600410156107e15764ff00000000602483015160d81c16178151600510156107e15765ff0000000000602583015160d01c16178151600610156107e15766ff000000000000602683015160c81c1617908051600710156107e1576027015160c01c60ff60381b161790565b939260009182915b8484106108e5575050505050565b6001908460051b8301359782988980841614600014610912579061090891610920565b971c9301926108d7565b61091b91610920565b610908565b906040519060209260208301526040820152604081526060808201928284106001600160401b038511176107ba578360405282519160005b83811061098e57505050918160209360009301836060820152039060025afa156109825760005190565b6040513d6000823e3d90fd5b8481018084015190830152820161095856fea2646970667358221220978d33b3745ac7ea3e60b913e4c65946a1fbe0b1e9e1584d16ca425a7224599b64736f6c63430008190033",
288
- "deployedBytecode": "0x60406080815260048036101561001457600080fd5b6000803560e01c80634a6c1e07146103ef578063897a245914610365578063d58a9e0514610190578063dfd01bdb146100f45763ef8aaee91461005657600080fd5b346100f1575061007d9061008461006c36610534565b9580989b979b959195949294610619565b50506107f7565b916001600160401b03809116908316036100b857509051600181526001600160401b039091166020820152604090f35b0390f35b606490602084519162461bcd60e51b835282015260136024820152720caf0d2e8becae0dec6d040dad2e6dac2e8c6d606b1b6044820152fd5b80fd5b50346100f1575061007d9061011d61010b366105a4565b969b9750948098949194939293610619565b916001600160401b038091169083160361014d57509051600181526001600160401b039091166020820152604090f35b606490602084519162461bcd60e51b8352820152601960248201527f61637469766174696f6e5f65706f6368206d69736d61746368000000000000006044820152fd5b50346100f1576101b56101a2366105a4565b95809b98999a979a959195949294610619565b505060038216918583101561033c576018908751956020870152602086526101dc8661079f565b60031b16918083046008149015171561032957506101fa81846107d0565b5160f81c9261ff0061020f60018401836107d0565b5160f01c169462ff000061022660028501846107d0565b5160e81c1663ff00000061023d60038601856107d0565b5160e01c169064ff00000000610255848701866107d0565b5160d81c16926001600160401b0360ff60381b6102a965ff000000000061027f60058b018a6107d0565b5160d01c1697600766ff00000000000061029c60068d01846107d0565b5160c81c169a01906107d0565b5160c01c169716888a17831784178517861787178817036102f357506100b496979851988998171717171717178291909160206001600160401b0360408301946001845216910152565b60649060208b519162461bcd60e51b8352820152601060248201526f0c4c2d8c2dcc6ca40dad2e6dac2e8c6d60831b6044820152fd5b634e487b7160e01b815260118552602490fd5b865162461bcd60e51b81526020818801526003602482015262706f7360e81b6044820152606490fd5b50346100f1575061007d9061037c61006c36610534565b916001600160401b03809116908316036103ac57509051600181526001600160401b039091166020820152604090f35b606490602084519162461bcd60e51b8352820152601b60248201527f776974686472617761626c655f65706f6368206d69736d6174636800000000006044820152fd5b5090346104fb5760e03660031901126104fb5780356001600160401b039283821682036100f157602435938415158095036104fb57604435926064358281116104f75761043f90369087016104ff565b909260a4359081116104f3579061045e61046f949392369089016104ff565b92909160c435948860843593610619565b5050845160208101928352602081526104878161079f565b51156104e057505160f81c15159182036104aa5750815190600182526020820152f35b606490602084519162461bcd60e51b8352820152601060248201526f0e6d8c2e6d0cac840dad2e6dac2e8c6d60831b6044820152fd5b634e487b7160e01b815260328352602490fd5b8480fd5b8380fd5b5080fd5b9181601f8401121561052f578235916001600160401b03831161052f576020808501948460051b01011161052f57565b600080fd5b60e060031982011261052f576001600160401b0390600435828116810361052f5792602435838116810361052f57926044359260643582811161052f578161057e916004016104ff565b939093926084359260a43591821161052f5761059c916004016104ff565b909160c43590565b9061010060031983011261052f576001600160401b03600435818116810361052f579260243592604435838116810361052f57926064359260843582811161052f57816105f3916004016104ff565b9390939260a4359260c43591821161052f57610611916004016104ff565b909160e43590565b94969193979590976001600160401b03936040519660209786898201921682528881526106458161079f565b6000809281925190720f3df6d732807ef1319fb7b8bb8522d0beac025afa3d15610796573d8781116107825760405197601f8201601f19908116603f011689019081118982101761076e5760405287523d828a89013e5b80610764575b15610729575086855195015194878110610713575b50906106c99185966106d0969b6108cf565b96876108cf565b036106d85750565b6064906040519062461bcd60e51b8252600482015260146024820152730c4cac2c6dedc40e4dedee840dad2e6dac2e8c6d60631b6044820152fd5b60001990880360031b1b909416936106c96106b7565b60405162461bcd60e51b81526004810189905260136024820152721152540d0dce0e081c9958590819985a5b1959606a1b6044820152606490fd5b50878651146106a2565b634e487b7160e01b84526041600452602484fd5b634e487b7160e01b83526041600452602483fd5b6060965061069c565b604081019081106001600160401b038211176107ba57604052565b634e487b7160e01b600052604160045260246000fd5b9081518110156107e1570160200190565b634e487b7160e01b600052603260045260246000fd5b60405190602082019081526020825261080f8261079f565b8151156107e1575160f81c8151600110156107e15761ff00602183015160f01c16178151600210156107e15762ff0000602283015160e81c16178151600310156107e15763ff000000602383015160e01c16178151600410156107e15764ff00000000602483015160d81c16178151600510156107e15765ff0000000000602583015160d01c16178151600610156107e15766ff000000000000602683015160c81c1617908051600710156107e1576027015160c01c60ff60381b161790565b939260009182915b8484106108e5575050505050565b6001908460051b8301359782988980841614600014610912579061090891610920565b971c9301926108d7565b61091b91610920565b610908565b906040519060209260208301526040820152604081526060808201928284106001600160401b038511176107ba578360405282519160005b83811061098e57505050918160209360009301836060820152039060025afa156109825760005190565b6040513d6000823e3d90fd5b8481018084015190830152820161095856fea2646970667358221220978d33b3745ac7ea3e60b913e4c65946a1fbe0b1e9e1584d16ca425a7224599b64736f6c63430008190033",
289
- "linkReferences": {},
290
- "deployedLinkReferences": {}
291
- }
@@ -1,62 +0,0 @@
1
- import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
2
- import { PublicKey as SolPubKey } from '@solana/web3.js';
3
- import { ChainID, ExternalNetwork, PublicKey } from '@wireio/core';
4
- import { ethers } from 'ethers';
5
-
6
- export interface IStakingClient {
7
- pubKey: PublicKey;
8
- network: ExternalNetwork;
9
-
10
- /** Amount is in the chain's smallest unit (lamports/wei, etc.) */
11
- deposit(amount: bigint): Promise<string>;
12
- withdraw(amount: bigint): Promise<string>;
13
- stake(amount: bigint): Promise<string>;
14
- unstake(amount: bigint): Promise<string>;
15
-
16
- buy?(amount: bigint, purchaseAsset: PurchaseAsset): Promise<string>;
17
-
18
- // REMOVED from shared client, SOLANA ONLY
19
- /** Register any untracked LIQ staked tokens */
20
- // register(): Promise<string>;
21
-
22
- /** Fetch the portfolio for the LIQ stake user */
23
- getPortfolio(): Promise<Portfolio>;
24
- }
25
-
26
- // Enum describing which asset is being used to buy pretoken
27
- export enum PurchaseAsset {
28
- SOL = "SOL",
29
- LIQSOL = "LIQSOL",
30
- ETH = "ETH",
31
- LIQETH = "LIQETH",
32
- YIELD = "YIELD",
33
- }
34
-
35
- export type StakerConfig = {
36
- network: ExternalNetwork;
37
- provider: BaseSignerWalletAdapter | ethers.providers.Web3Provider;
38
- pubKey: PublicKey;
39
- }
40
-
41
- export interface Portfolio {
42
- /** Native balance on chain: ETH, SOL */
43
- native: BalanceView;
44
- /** Actual Liquid balance of LiqETH, LiqSOL*/
45
- liq: BalanceView;
46
- /** Outpost Staked balance */
47
- staked: BalanceView
48
- /** SOL ONLY!
49
- * Tracked liqSOL balance from distribution program */
50
- tracked?: BalanceView;
51
- /** Extra PDAs and account addresses */
52
- extras?: Record<string, any>;
53
- /** Chain ID of the network for which this portfolio is from */
54
- chainID: ChainID;
55
- }
56
-
57
- export type BalanceView = {
58
- amount: bigint; // raw on-chain integer value
59
- decimals: number; // number of decimal places
60
- symbol?: string; // optional token symbol identifier
61
- ata?: SolPubKey; // associated token account address
62
- };