@lidofinance/lsv-cli 1.0.0-alpha.6 → 1.0.0-alpha.61
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/README.md +53 -20
- package/dist/abi/AccessControlConfirmable.d.ts +331 -0
- package/dist/abi/AccessControlConfirmable.js +430 -0
- package/dist/abi/AccessControlConfirmable.js.map +1 -0
- package/dist/abi/Dashboard.d.ts +2305 -0
- package/dist/abi/Dashboard.js +2105 -0
- package/dist/abi/Dashboard.js.map +1 -0
- package/dist/abi/LazyOracle.d.ts +592 -0
- package/dist/abi/LazyOracle.js +766 -0
- package/dist/abi/LazyOracle.js.map +1 -0
- package/dist/abi/LidoLocator.d.ts +358 -0
- package/dist/abi/LidoLocator.js +462 -0
- package/dist/abi/LidoLocator.js.map +1 -0
- package/dist/abi/OperatorGrid.d.ts +1246 -0
- package/dist/abi/OperatorGrid.js +1368 -0
- package/dist/abi/OperatorGrid.js.map +1 -0
- package/dist/abi/PredepositGuarantee.d.ts +1697 -0
- package/dist/abi/PredepositGuarantee.js +2010 -0
- package/dist/abi/PredepositGuarantee.js.map +1 -0
- package/dist/abi/StEth.d.ts +372 -0
- package/dist/abi/StEth.js +493 -0
- package/dist/abi/StEth.js.map +1 -0
- package/dist/abi/StakingVault.d.ts +757 -0
- package/dist/abi/StakingVault.js +790 -0
- package/dist/abi/StakingVault.js.map +1 -0
- package/dist/abi/TokenManager.d.ts +577 -0
- package/dist/abi/TokenManager.js +756 -0
- package/dist/abi/TokenManager.js.map +1 -0
- package/dist/abi/VaultFactory.d.ts +739 -0
- package/dist/abi/VaultFactory.js +269 -0
- package/dist/abi/VaultFactory.js.map +1 -0
- package/dist/abi/VaultHub.d.ts +2546 -0
- package/dist/abi/VaultHub.js +2276 -509
- package/dist/abi/VaultHub.js.map +1 -1
- package/dist/abi/VaultViewer.d.ts +617 -0
- package/dist/abi/VaultViewer.js +807 -0
- package/dist/abi/VaultViewer.js.map +1 -0
- package/dist/abi/Voting.d.ts +676 -0
- package/dist/abi/Voting.js +884 -0
- package/dist/abi/Voting.js.map +1 -0
- package/dist/abi/WstEth.d.ts +362 -0
- package/dist/abi/WstEth.js +478 -0
- package/dist/abi/WstEth.js.map +1 -0
- package/dist/abi/index.d.ts +14 -0
- package/dist/abi/index.js +15 -0
- package/dist/abi/index.js.map +1 -0
- package/dist/command/index.d.ts +2 -0
- package/dist/command/index.js +9 -5
- package/dist/command/index.js.map +1 -1
- package/dist/configs/constants.d.ts +35 -0
- package/dist/configs/constants.js +3 -0
- package/dist/configs/constants.js.map +1 -0
- package/dist/configs/deployed.d.ts +17 -0
- package/dist/configs/deployed.js +87 -52
- package/dist/configs/deployed.js.map +1 -1
- package/dist/configs/envs.d.ts +2 -0
- package/dist/configs/envs.js +13 -37
- package/dist/configs/envs.js.map +1 -1
- package/dist/configs/index.d.ts +3 -0
- package/dist/configs/index.js +3 -18
- package/dist/configs/index.js.map +1 -1
- package/dist/configs/utils.d.ts +4 -0
- package/dist/configs/utils.js +22 -0
- package/dist/configs/utils.js.map +1 -0
- package/dist/contracts/dashboard.d.ts +4 -0
- package/dist/contracts/dashboard.js +11 -0
- package/dist/contracts/dashboard.js.map +1 -0
- package/dist/contracts/index.d.ts +12 -0
- package/dist/contracts/index.js +12 -17
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/lazy-oracle.d.ts +3 -0
- package/dist/contracts/lazy-oracle.js +18 -0
- package/dist/contracts/lazy-oracle.js.map +1 -0
- package/dist/contracts/locator.d.ts +8239 -0
- package/dist/contracts/locator.js +16 -0
- package/dist/contracts/locator.js.map +1 -0
- package/dist/contracts/operator-grid.d.ts +4 -0
- package/dist/contracts/operator-grid.js +17 -0
- package/dist/contracts/operator-grid.js.map +1 -0
- package/dist/contracts/pdg.d.ts +4 -0
- package/dist/contracts/pdg.js +17 -0
- package/dist/contracts/pdg.js.map +1 -0
- package/dist/contracts/steth.d.ts +27706 -0
- package/dist/contracts/steth.js +18 -0
- package/dist/contracts/steth.js.map +1 -0
- package/dist/contracts/token-manager.d.ts +3 -0
- package/dist/contracts/token-manager.js +13 -0
- package/dist/contracts/token-manager.js.map +1 -0
- package/dist/contracts/vault-factory.d.ts +16404 -0
- package/dist/contracts/vault-factory.js +14 -0
- package/dist/contracts/vault-factory.js.map +1 -0
- package/dist/contracts/vault-hub.d.ts +3 -0
- package/dist/contracts/vault-hub.js +14 -16
- package/dist/contracts/vault-hub.js.map +1 -1
- package/dist/contracts/vault-viewer.d.ts +11197 -0
- package/dist/contracts/vault-viewer.js +23 -0
- package/dist/contracts/vault-viewer.js.map +1 -0
- package/dist/contracts/vault.d.ts +4 -0
- package/dist/contracts/vault.js +11 -0
- package/dist/contracts/vault.js.map +1 -0
- package/dist/contracts/wsteth.d.ts +24690 -0
- package/dist/contracts/wsteth.js +18 -0
- package/dist/contracts/wsteth.js.map +1 -0
- package/dist/features/dashboard.d.ts +5 -0
- package/dist/features/dashboard.js +14 -0
- package/dist/features/dashboard.js.map +1 -0
- package/dist/features/deposits/check-bls-deposits.d.ts +3 -0
- package/dist/features/deposits/check-bls-deposits.js +15 -0
- package/dist/features/deposits/check-bls-deposits.js.map +1 -0
- package/dist/features/deposits/index.d.ts +3 -0
- package/dist/features/deposits/index.js +4 -0
- package/dist/features/deposits/index.js.map +1 -0
- package/dist/features/deposits/make-pdg-proof.d.ts +3 -0
- package/dist/features/deposits/make-pdg-proof.js +52 -0
- package/dist/features/deposits/make-pdg-proof.js.map +1 -0
- package/dist/features/deposits/no-pdg.d.ts +22 -0
- package/dist/features/deposits/no-pdg.js +103 -0
- package/dist/features/deposits/no-pdg.js.map +1 -0
- package/dist/features/index.d.ts +10 -0
- package/dist/features/index.js +11 -0
- package/dist/features/index.js.map +1 -0
- package/dist/features/mint-burn/allowance.d.ts +2 -0
- package/dist/features/mint-burn/allowance.js +49 -0
- package/dist/features/mint-burn/allowance.js.map +1 -0
- package/dist/features/mint-burn/burn-shares.d.ts +3 -0
- package/dist/features/mint-burn/burn-shares.js +33 -0
- package/dist/features/mint-burn/burn-shares.js.map +1 -0
- package/dist/features/mint-burn/burn-steth.d.ts +3 -0
- package/dist/features/mint-burn/burn-steth.js +35 -0
- package/dist/features/mint-burn/burn-steth.js.map +1 -0
- package/dist/features/mint-burn/index.d.ts +5 -0
- package/dist/features/mint-burn/index.js +6 -0
- package/dist/features/mint-burn/index.js.map +1 -0
- package/dist/features/mint-burn/mint-shares.d.ts +3 -0
- package/dist/features/mint-burn/mint-shares.js +37 -0
- package/dist/features/mint-burn/mint-shares.js.map +1 -0
- package/dist/features/mint-burn/mint-steth.d.ts +3 -0
- package/dist/features/mint-burn/mint-steth.js +39 -0
- package/dist/features/mint-burn/mint-steth.js.map +1 -0
- package/dist/features/operator-grid.d.ts +2 -0
- package/dist/features/operator-grid.js +64 -0
- package/dist/features/operator-grid.js.map +1 -0
- package/dist/features/pdg.d.ts +4 -0
- package/dist/features/pdg.js +114 -0
- package/dist/features/pdg.js.map +1 -0
- package/dist/features/token-manager.d.ts +1 -0
- package/dist/features/token-manager.js +7 -0
- package/dist/features/token-manager.js.map +1 -0
- package/dist/features/utils/get-address.d.ts +2 -0
- package/dist/features/utils/get-address.js +16 -0
- package/dist/features/utils/get-address.js.map +1 -0
- package/dist/features/utils/index.d.ts +5 -0
- package/dist/features/utils/index.js +6 -0
- package/dist/features/utils/index.js.map +1 -0
- package/dist/features/utils/liability-shares.d.ts +2 -0
- package/dist/features/utils/liability-shares.js +10 -0
- package/dist/features/utils/liability-shares.js.map +1 -0
- package/dist/features/utils/minting-capacity.d.ts +2 -0
- package/dist/features/utils/minting-capacity.js +11 -0
- package/dist/features/utils/minting-capacity.js.map +1 -0
- package/dist/features/utils/quarantine.d.ts +23 -0
- package/dist/features/utils/quarantine.js +47 -0
- package/dist/features/utils/quarantine.js.map +1 -0
- package/dist/features/utils/report-fresh.d.ts +3 -0
- package/dist/features/utils/report-fresh.js +36 -0
- package/dist/features/utils/report-fresh.js.map +1 -0
- package/dist/features/vault-factory.d.ts +29 -0
- package/dist/features/vault-factory.js +99 -0
- package/dist/features/vault-factory.js.map +1 -0
- package/dist/features/vault-hub.d.ts +2 -0
- package/dist/features/vault-hub.js +88 -0
- package/dist/features/vault-hub.js.map +1 -0
- package/dist/features/vault-operations/create-vault.d.ts +2 -0
- package/dist/features/vault-operations/create-vault.js +58 -0
- package/dist/features/vault-operations/create-vault.js.map +1 -0
- package/dist/features/vault-operations/dashboard-by-vault.d.ts +11 -0
- package/dist/features/vault-operations/dashboard-by-vault.js +34 -0
- package/dist/features/vault-operations/dashboard-by-vault.js.map +1 -0
- package/dist/features/vault-operations/index.d.ts +7 -0
- package/dist/features/vault-operations/index.js +8 -0
- package/dist/features/vault-operations/index.js.map +1 -0
- package/dist/features/vault-operations/vault-health.d.ts +2 -0
- package/dist/features/vault-operations/vault-health.js +27 -0
- package/dist/features/vault-operations/vault-health.js.map +1 -0
- package/dist/features/vault-operations/vault-info.d.ts +2 -0
- package/dist/features/vault-operations/vault-info.js +109 -0
- package/dist/features/vault-operations/vault-info.js.map +1 -0
- package/dist/features/vault-operations/vault-overview.d.ts +2 -0
- package/dist/features/vault-operations/vault-overview.js +141 -0
- package/dist/features/vault-operations/vault-overview.js.map +1 -0
- package/dist/features/vault-operations/vault-roles.d.ts +5 -0
- package/dist/features/vault-operations/vault-roles.js +64 -0
- package/dist/features/vault-operations/vault-roles.js.map +1 -0
- package/dist/features/vault-operations/vaults-by-role.d.ts +1 -0
- package/dist/features/vault-operations/vaults-by-role.js +48 -0
- package/dist/features/vault-operations/vaults-by-role.js.map +1 -0
- package/dist/features/vault.d.ts +2 -0
- package/dist/features/vault.js +48 -0
- package/dist/features/vault.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +23 -5
- package/dist/index.js.map +1 -1
- package/dist/programs/account/index.d.ts +3 -0
- package/dist/programs/account/index.js +4 -0
- package/dist/programs/account/index.js.map +1 -0
- package/dist/programs/account/main.d.ts +1 -0
- package/dist/programs/account/main.js +5 -0
- package/dist/programs/account/main.js.map +1 -0
- package/dist/programs/account/read.d.ts +1 -0
- package/dist/programs/account/read.js +79 -0
- package/dist/programs/account/read.js.map +1 -0
- package/dist/programs/account/write.d.ts +1 -0
- package/dist/programs/account/write.js +73 -0
- package/dist/programs/account/write.js.map +1 -0
- package/dist/programs/config.d.ts +1 -0
- package/dist/programs/config.js +31 -0
- package/dist/programs/config.js.map +1 -0
- package/dist/programs/contracts/dashboard/config.d.ts +3 -0
- package/dist/programs/contracts/dashboard/config.js +115 -0
- package/dist/programs/contracts/dashboard/config.js.map +1 -0
- package/dist/programs/contracts/dashboard/index.d.ts +3 -0
- package/dist/programs/contracts/dashboard/index.js +4 -0
- package/dist/programs/contracts/dashboard/index.js.map +1 -0
- package/dist/programs/contracts/dashboard/main.d.ts +1 -0
- package/dist/programs/contracts/dashboard/main.js +5 -0
- package/dist/programs/contracts/dashboard/main.js.map +1 -0
- package/dist/programs/contracts/dashboard/read.d.ts +1 -0
- package/dist/programs/contracts/dashboard/read.js +98 -0
- package/dist/programs/contracts/dashboard/read.js.map +1 -0
- package/dist/programs/contracts/dashboard/write.d.ts +1 -0
- package/dist/programs/contracts/dashboard/write.js +638 -0
- package/dist/programs/contracts/dashboard/write.js.map +1 -0
- package/dist/programs/contracts/hub/config.d.ts +3 -0
- package/dist/programs/contracts/hub/config.js +165 -0
- package/dist/programs/contracts/hub/config.js.map +1 -0
- package/dist/programs/contracts/hub/index.d.ts +3 -0
- package/dist/programs/contracts/hub/index.js +4 -0
- package/dist/programs/contracts/hub/index.js.map +1 -0
- package/dist/programs/contracts/hub/main.d.ts +1 -0
- package/dist/programs/contracts/hub/main.js +5 -0
- package/dist/programs/contracts/hub/main.js.map +1 -0
- package/dist/programs/contracts/hub/read.d.ts +1 -0
- package/dist/programs/contracts/hub/read.js +54 -0
- package/dist/programs/contracts/hub/read.js.map +1 -0
- package/dist/programs/contracts/hub/write.d.ts +1 -0
- package/dist/programs/contracts/hub/write.js +425 -0
- package/dist/programs/contracts/hub/write.js.map +1 -0
- package/dist/programs/contracts/index.d.ts +9 -0
- package/dist/programs/contracts/index.js +10 -0
- package/dist/programs/contracts/index.js.map +1 -0
- package/dist/programs/contracts/lazy-oracle/config.d.ts +3 -0
- package/dist/programs/contracts/lazy-oracle/config.js +57 -0
- package/dist/programs/contracts/lazy-oracle/config.js.map +1 -0
- package/dist/programs/contracts/lazy-oracle/index.d.ts +2 -0
- package/dist/programs/contracts/lazy-oracle/index.js +3 -0
- package/dist/programs/contracts/lazy-oracle/index.js.map +1 -0
- package/dist/programs/contracts/lazy-oracle/main.d.ts +1 -0
- package/dist/programs/contracts/lazy-oracle/main.js +5 -0
- package/dist/programs/contracts/lazy-oracle/main.js.map +1 -0
- package/dist/programs/contracts/lazy-oracle/read.d.ts +1 -0
- package/dist/programs/contracts/lazy-oracle/read.js +17 -0
- package/dist/programs/contracts/lazy-oracle/read.js.map +1 -0
- package/dist/programs/contracts/main.d.ts +1 -0
- package/dist/programs/contracts/main.js +6 -0
- package/dist/programs/contracts/main.js.map +1 -0
- package/dist/programs/contracts/operator-grid/config.d.ts +3 -0
- package/dist/programs/contracts/operator-grid/config.js +87 -0
- package/dist/programs/contracts/operator-grid/config.js.map +1 -0
- package/dist/programs/contracts/operator-grid/index.d.ts +3 -0
- package/dist/programs/contracts/operator-grid/index.js +4 -0
- package/dist/programs/contracts/operator-grid/index.js.map +1 -0
- package/dist/programs/contracts/operator-grid/main.d.ts +1 -0
- package/dist/programs/contracts/operator-grid/main.js +5 -0
- package/dist/programs/contracts/operator-grid/main.js.map +1 -0
- package/dist/programs/contracts/operator-grid/read.d.ts +1 -0
- package/dist/programs/contracts/operator-grid/read.js +30 -0
- package/dist/programs/contracts/operator-grid/read.js.map +1 -0
- package/dist/programs/contracts/operator-grid/write.d.ts +1 -0
- package/dist/programs/contracts/operator-grid/write.js +119 -0
- package/dist/programs/contracts/operator-grid/write.js.map +1 -0
- package/dist/programs/contracts/pdg/config.d.ts +3 -0
- package/dist/programs/contracts/pdg/config.js +160 -0
- package/dist/programs/contracts/pdg/config.js.map +1 -0
- package/dist/programs/contracts/pdg/index.d.ts +3 -0
- package/dist/programs/contracts/pdg/index.js +4 -0
- package/dist/programs/contracts/pdg/index.js.map +1 -0
- package/dist/programs/contracts/pdg/main.d.ts +1 -0
- package/dist/programs/contracts/pdg/main.js +5 -0
- package/dist/programs/contracts/pdg/main.js.map +1 -0
- package/dist/programs/contracts/pdg/read.d.ts +1 -0
- package/dist/programs/contracts/pdg/read.js +38 -0
- package/dist/programs/contracts/pdg/read.js.map +1 -0
- package/dist/programs/contracts/pdg/write.d.ts +1 -0
- package/dist/programs/contracts/pdg/write.js +388 -0
- package/dist/programs/contracts/pdg/write.js.map +1 -0
- package/dist/programs/contracts/vault/config.d.ts +3 -0
- package/dist/programs/contracts/vault/config.js +42 -0
- package/dist/programs/contracts/vault/config.js.map +1 -0
- package/dist/programs/contracts/vault/index.d.ts +3 -0
- package/dist/programs/contracts/vault/index.js +4 -0
- package/dist/programs/contracts/vault/index.js.map +1 -0
- package/dist/programs/contracts/vault/main.d.ts +1 -0
- package/dist/programs/contracts/vault/main.js +3 -0
- package/dist/programs/contracts/vault/main.js.map +1 -0
- package/dist/programs/contracts/vault/read.d.ts +1 -0
- package/dist/programs/contracts/vault/read.js +25 -0
- package/dist/programs/contracts/vault/read.js.map +1 -0
- package/dist/programs/contracts/vault/write.d.ts +1 -0
- package/dist/programs/contracts/vault/write.js +214 -0
- package/dist/programs/contracts/vault/write.js.map +1 -0
- package/dist/programs/contracts/vault-factory/config.d.ts +3 -0
- package/dist/programs/contracts/vault-factory/config.js +2 -0
- package/dist/programs/contracts/vault-factory/config.js.map +1 -0
- package/dist/programs/contracts/vault-factory/index.d.ts +3 -0
- package/dist/programs/contracts/vault-factory/index.js +4 -0
- package/dist/programs/contracts/vault-factory/index.js.map +1 -0
- package/dist/programs/contracts/vault-factory/main.d.ts +1 -0
- package/dist/programs/contracts/vault-factory/main.js +5 -0
- package/dist/programs/contracts/vault-factory/main.js.map +1 -0
- package/dist/programs/contracts/vault-factory/read.d.ts +1 -0
- package/dist/programs/contracts/vault-factory/read.js +24 -0
- package/dist/programs/contracts/vault-factory/read.js.map +1 -0
- package/dist/programs/contracts/vault-factory/write.d.ts +1 -0
- package/dist/programs/contracts/vault-factory/write.js +126 -0
- package/dist/programs/contracts/vault-factory/write.js.map +1 -0
- package/dist/programs/contracts/vault-viewer/config.d.ts +3 -0
- package/dist/programs/contracts/vault-viewer/config.js +120 -0
- package/dist/programs/contracts/vault-viewer/config.js.map +1 -0
- package/dist/programs/contracts/vault-viewer/index.d.ts +2 -0
- package/dist/programs/contracts/vault-viewer/index.js +3 -0
- package/dist/programs/contracts/vault-viewer/index.js.map +1 -0
- package/dist/programs/contracts/vault-viewer/main.d.ts +1 -0
- package/dist/programs/contracts/vault-viewer/main.js +5 -0
- package/dist/programs/contracts/vault-viewer/main.js.map +1 -0
- package/dist/programs/contracts/vault-viewer/read.d.ts +1 -0
- package/dist/programs/contracts/vault-viewer/read.js +131 -0
- package/dist/programs/contracts/vault-viewer/read.js.map +1 -0
- package/dist/programs/index.d.ts +4 -0
- package/dist/programs/index.js +4 -17
- package/dist/programs/index.js.map +1 -1
- package/dist/programs/pdg-helpers.d.ts +1 -0
- package/dist/programs/pdg-helpers.js +257 -0
- package/dist/programs/pdg-helpers.js.map +1 -0
- package/dist/programs/use-cases/deposits/index.d.ts +3 -0
- package/dist/programs/use-cases/deposits/index.js +4 -0
- package/dist/programs/use-cases/deposits/index.js.map +1 -0
- package/dist/programs/use-cases/deposits/main.d.ts +1 -0
- package/dist/programs/use-cases/deposits/main.js +6 -0
- package/dist/programs/use-cases/deposits/main.js.map +1 -0
- package/dist/programs/use-cases/deposits/read.d.ts +1 -0
- package/dist/programs/use-cases/deposits/read.js +77 -0
- package/dist/programs/use-cases/deposits/read.js.map +1 -0
- package/dist/programs/use-cases/deposits/write.d.ts +1 -0
- package/dist/programs/use-cases/deposits/write.js +212 -0
- package/dist/programs/use-cases/deposits/write.js.map +1 -0
- package/dist/programs/use-cases/index.d.ts +4 -0
- package/dist/programs/use-cases/index.js +5 -0
- package/dist/programs/use-cases/index.js.map +1 -0
- package/dist/programs/use-cases/metrics/index.d.ts +2 -0
- package/dist/programs/use-cases/metrics/index.js +3 -0
- package/dist/programs/use-cases/metrics/index.js.map +1 -0
- package/dist/programs/use-cases/metrics/main.d.ts +1 -0
- package/dist/programs/use-cases/metrics/main.js +6 -0
- package/dist/programs/use-cases/metrics/main.js.map +1 -0
- package/dist/programs/use-cases/metrics/read.d.ts +1 -0
- package/dist/programs/use-cases/metrics/read.js +239 -0
- package/dist/programs/use-cases/metrics/read.js.map +1 -0
- package/dist/programs/use-cases/report/index.d.ts +3 -0
- package/dist/programs/use-cases/report/index.js +4 -0
- package/dist/programs/use-cases/report/index.js.map +1 -0
- package/dist/programs/use-cases/report/main.d.ts +1 -0
- package/dist/programs/use-cases/report/main.js +6 -0
- package/dist/programs/use-cases/report/main.js.map +1 -0
- package/dist/programs/use-cases/report/read.d.ts +1 -0
- package/dist/programs/use-cases/report/read.js +104 -0
- package/dist/programs/use-cases/report/read.js.map +1 -0
- package/dist/programs/use-cases/report/write.d.ts +1 -0
- package/dist/programs/use-cases/report/write.js +97 -0
- package/dist/programs/use-cases/report/write.js.map +1 -0
- package/dist/programs/use-cases/vault-operations/create-vault.d.ts +1 -0
- package/dist/programs/use-cases/vault-operations/create-vault.js +129 -0
- package/dist/programs/use-cases/vault-operations/create-vault.js.map +1 -0
- package/dist/programs/use-cases/vault-operations/index.d.ts +4 -0
- package/dist/programs/use-cases/vault-operations/index.js +5 -0
- package/dist/programs/use-cases/vault-operations/index.js.map +1 -0
- package/dist/programs/use-cases/vault-operations/main.d.ts +1 -0
- package/dist/programs/use-cases/vault-operations/main.js +6 -0
- package/dist/programs/use-cases/vault-operations/main.js.map +1 -0
- package/dist/programs/use-cases/vault-operations/read.d.ts +1 -0
- package/dist/programs/use-cases/vault-operations/read.js +58 -0
- package/dist/programs/use-cases/vault-operations/read.js.map +1 -0
- package/dist/programs/use-cases/vault-operations/write.d.ts +1 -0
- package/dist/programs/use-cases/vault-operations/write.js +220 -0
- package/dist/programs/use-cases/vault-operations/write.js.map +1 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.js +1 -17
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/wallet.d.ts +14564 -0
- package/dist/providers/wallet.js +64 -28
- package/dist/providers/wallet.js.map +1 -1
- package/dist/tests/utils/arguments.test.d.ts +1 -0
- package/dist/tests/utils/arguments.test.js +92 -0
- package/dist/tests/utils/arguments.test.js.map +1 -0
- package/dist/tests/utils/calculate-overview.test.d.ts +1 -0
- package/dist/tests/utils/calculate-overview.test.js +30 -0
- package/dist/tests/utils/calculate-overview.test.js.map +1 -0
- package/dist/tests/utils/data-validators.test.d.ts +1 -0
- package/dist/tests/utils/data-validators.test.js +56 -0
- package/dist/tests/utils/data-validators.test.js.map +1 -0
- package/dist/tests/utils/error-handler.test.d.ts +1 -0
- package/dist/tests/utils/error-handler.test.js +43 -0
- package/dist/tests/utils/error-handler.test.js.map +1 -0
- package/dist/tests/utils/get-commands.test.d.ts +1 -0
- package/dist/tests/utils/get-commands.test.js +19 -0
- package/dist/tests/utils/get-commands.test.js.map +1 -0
- package/dist/tests/utils/get-deposit-data-root.test.d.ts +1 -0
- package/dist/tests/utils/get-deposit-data-root.test.js +31 -0
- package/dist/tests/utils/get-deposit-data-root.test.js.map +1 -0
- package/dist/tests/utils/get-value.test.d.ts +1 -0
- package/dist/tests/utils/get-value.test.js +13 -0
- package/dist/tests/utils/get-value.test.js.map +1 -0
- package/dist/tests/utils/health.test.d.ts +1 -0
- package/dist/tests/utils/health.test.js +22 -0
- package/dist/tests/utils/health.test.js.map +1 -0
- package/dist/tests/utils/interrupt-handler.test.d.ts +1 -0
- package/dist/tests/utils/interrupt-handler.test.js +15 -0
- package/dist/tests/utils/interrupt-handler.test.js.map +1 -0
- package/dist/tests/utils/ipfs.test.d.ts +1 -0
- package/dist/tests/utils/ipfs.test.js +110 -0
- package/dist/tests/utils/ipfs.test.js.map +1 -0
- package/dist/tests/utils/logging.test.d.ts +1 -0
- package/dist/tests/utils/logging.test.js +23 -0
- package/dist/tests/utils/logging.test.js.map +1 -0
- package/dist/tests/utils/resove-path.test.d.ts +1 -0
- package/dist/tests/utils/resove-path.test.js +18 -0
- package/dist/tests/utils/resove-path.test.js.map +1 -0
- package/dist/tests/utils/sleep.test.d.ts +1 -0
- package/dist/tests/utils/sleep.test.js +14 -0
- package/dist/tests/utils/sleep.test.js.map +1 -0
- package/dist/types/common.d.ts +35 -0
- package/dist/types/common.js +2 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/config.d.ts +26 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/arguments.d.ts +15 -0
- package/dist/utils/arguments.js +73 -0
- package/dist/utils/arguments.js.map +1 -0
- package/dist/utils/bls.d.ts +21 -0
- package/dist/utils/bls.js +101 -0
- package/dist/utils/bls.js.map +1 -0
- package/dist/utils/cache.d.ts +18 -0
- package/dist/utils/cache.js +109 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/calculate-overview-v2.d.ts +25 -0
- package/dist/utils/calculate-overview-v2.js +59 -0
- package/dist/utils/calculate-overview-v2.js.map +1 -0
- package/dist/utils/calculate-overview.d.ts +28 -0
- package/dist/utils/calculate-overview.js +57 -0
- package/dist/utils/calculate-overview.js.map +1 -0
- package/dist/utils/charts/blessed/charts-apr.d.ts +98 -0
- package/dist/utils/charts/blessed/charts-apr.js +121 -0
- package/dist/utils/charts/blessed/charts-apr.js.map +1 -0
- package/dist/utils/charts/blessed/charts-rewards.d.ts +74 -0
- package/dist/utils/charts/blessed/charts-rewards.js +106 -0
- package/dist/utils/charts/blessed/charts-rewards.js.map +1 -0
- package/dist/utils/charts/blessed/constants.d.ts +22 -0
- package/dist/utils/charts/blessed/constants.js +23 -0
- package/dist/utils/charts/blessed/constants.js.map +1 -0
- package/dist/utils/charts/blessed/datasets/bottom-line.d.ts +19 -0
- package/dist/utils/charts/blessed/datasets/bottom-line.js +35 -0
- package/dist/utils/charts/blessed/datasets/bottom-line.js.map +1 -0
- package/dist/utils/charts/blessed/datasets/carry-spread.d.ts +18 -0
- package/dist/utils/charts/blessed/datasets/carry-spread.js +34 -0
- package/dist/utils/charts/blessed/datasets/carry-spread.js.map +1 -0
- package/dist/utils/charts/blessed/datasets/gross-staking-apr.d.ts +18 -0
- package/dist/utils/charts/blessed/datasets/gross-staking-apr.js +34 -0
- package/dist/utils/charts/blessed/datasets/gross-staking-apr.js.map +1 -0
- package/dist/utils/charts/blessed/datasets/gross-staking-rewards.d.ts +24 -0
- package/dist/utils/charts/blessed/datasets/gross-staking-rewards.js +40 -0
- package/dist/utils/charts/blessed/datasets/gross-staking-rewards.js.map +1 -0
- package/dist/utils/charts/blessed/datasets/index.d.ts +9 -0
- package/dist/utils/charts/blessed/datasets/index.js +10 -0
- package/dist/utils/charts/blessed/datasets/index.js.map +1 -0
- package/dist/utils/charts/blessed/datasets/lido-apr.d.ts +19 -0
- package/dist/utils/charts/blessed/datasets/lido-apr.js +35 -0
- package/dist/utils/charts/blessed/datasets/lido-apr.js.map +1 -0
- package/dist/utils/charts/blessed/datasets/net-staking-apr.d.ts +18 -0
- package/dist/utils/charts/blessed/datasets/net-staking-apr.js +34 -0
- package/dist/utils/charts/blessed/datasets/net-staking-apr.js.map +1 -0
- package/dist/utils/charts/blessed/datasets/net-staking-rewards.d.ts +18 -0
- package/dist/utils/charts/blessed/datasets/net-staking-rewards.js +34 -0
- package/dist/utils/charts/blessed/datasets/net-staking-rewards.js.map +1 -0
- package/dist/utils/charts/blessed/datasets/node-operator-rewards.d.ts +24 -0
- package/dist/utils/charts/blessed/datasets/node-operator-rewards.js +40 -0
- package/dist/utils/charts/blessed/datasets/node-operator-rewards.js.map +1 -0
- package/dist/utils/charts/blessed/datasets/prepare-metrics.d.ts +37 -0
- package/dist/utils/charts/blessed/datasets/prepare-metrics.js +147 -0
- package/dist/utils/charts/blessed/datasets/prepare-metrics.js.map +1 -0
- package/dist/utils/charts/blessed/datasets/types.d.ts +4 -0
- package/dist/utils/charts/blessed/datasets/types.js +2 -0
- package/dist/utils/charts/blessed/datasets/types.js.map +1 -0
- package/dist/utils/charts/blessed/index.d.ts +3 -0
- package/dist/utils/charts/blessed/index.js +4 -0
- package/dist/utils/charts/blessed/index.js.map +1 -0
- package/dist/utils/charts/blessed/net-vs-lido-apr.d.ts +13 -0
- package/dist/utils/charts/blessed/net-vs-lido-apr.js +19 -0
- package/dist/utils/charts/blessed/net-vs-lido-apr.js.map +1 -0
- package/dist/utils/charts/blessed/utils.d.ts +61 -0
- package/dist/utils/charts/blessed/utils.js +79 -0
- package/dist/utils/charts/blessed/utils.js.map +1 -0
- package/dist/utils/charts/index.d.ts +3 -0
- package/dist/utils/charts/index.js +4 -0
- package/dist/utils/charts/index.js.map +1 -0
- package/dist/utils/charts/metrics.d.ts +16 -0
- package/dist/utils/charts/metrics.js +160 -0
- package/dist/utils/charts/metrics.js.map +1 -0
- package/dist/utils/charts/overview.d.ts +10 -0
- package/dist/utils/charts/overview.js +89 -0
- package/dist/utils/charts/overview.js.map +1 -0
- package/dist/utils/charts/simple/index.d.ts +1 -0
- package/dist/utils/charts/simple/index.js +2 -0
- package/dist/utils/charts/simple/index.js.map +1 -0
- package/dist/utils/charts/simple/simple-charts.d.ts +7 -0
- package/dist/utils/charts/simple/simple-charts.js +78 -0
- package/dist/utils/charts/simple/simple-charts.js.map +1 -0
- package/dist/utils/commands/confirmations.d.ts +35 -0
- package/dist/utils/commands/confirmations.js +117 -0
- package/dist/utils/commands/confirmations.js.map +1 -0
- package/dist/utils/commands/index.d.ts +2 -0
- package/dist/utils/commands/index.js +3 -0
- package/dist/utils/commands/index.js.map +1 -0
- package/dist/utils/commands/report.d.ts +7 -0
- package/dist/utils/commands/report.js +42 -0
- package/dist/utils/commands/report.js.map +1 -0
- package/dist/utils/consts.d.ts +3 -0
- package/dist/utils/consts.js +4 -0
- package/dist/utils/consts.js.map +1 -0
- package/dist/utils/csv-file.d.ts +6 -0
- package/dist/utils/csv-file.js +48 -0
- package/dist/utils/csv-file.js.map +1 -0
- package/dist/utils/data-validators.d.ts +6 -0
- package/dist/utils/data-validators.js +54 -0
- package/dist/utils/data-validators.js.map +1 -0
- package/dist/utils/error-handler.d.ts +1 -0
- package/dist/utils/error-handler.js +13 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/fetchCL.d.ts +36 -0
- package/dist/utils/fetchCL.js +81 -0
- package/dist/utils/fetchCL.js.map +1 -0
- package/dist/utils/get-commands.d.ts +2 -0
- package/dist/utils/get-commands.js +11 -0
- package/dist/utils/get-commands.js.map +1 -0
- package/dist/utils/get-deposit-data-root.d.ts +7 -0
- package/dist/utils/get-deposit-data-root.js +37 -0
- package/dist/utils/get-deposit-data-root.js.map +1 -0
- package/dist/utils/get-value.d.ts +1 -0
- package/dist/utils/get-value.js +5 -11
- package/dist/utils/get-value.js.map +1 -1
- package/dist/utils/health/calculate-health.d.ts +10 -0
- package/dist/utils/health/calculate-health.js +22 -0
- package/dist/utils/health/calculate-health.js.map +1 -0
- package/dist/utils/health/health-utils.d.ts +27743 -0
- package/dist/utils/health/health-utils.js +74 -0
- package/dist/utils/health/health-utils.js.map +1 -0
- package/dist/utils/health/index.d.ts +2 -0
- package/dist/utils/health/index.js +3 -0
- package/dist/utils/health/index.js.map +1 -0
- package/dist/utils/index.d.ts +35 -0
- package/dist/utils/index.js +35 -17
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/interrupt-handler.d.ts +3 -0
- package/dist/utils/interrupt-handler.js +28 -0
- package/dist/utils/interrupt-handler.js.map +1 -0
- package/dist/utils/ipfs.d.ts +17 -0
- package/dist/utils/ipfs.js +100 -0
- package/dist/utils/ipfs.js.map +1 -0
- package/dist/utils/lido-apr.d.ts +2 -0
- package/dist/utils/lido-apr.js +8 -0
- package/dist/utils/lido-apr.js.map +1 -0
- package/dist/utils/logging/console.d.ts +16 -0
- package/dist/utils/logging/console.js +44 -0
- package/dist/utils/logging/console.js.map +1 -0
- package/dist/utils/logging/constants.d.ts +4 -0
- package/dist/utils/logging/constants.js +18 -0
- package/dist/utils/logging/constants.js.map +1 -0
- package/dist/utils/logging/index.d.ts +1 -0
- package/dist/utils/logging/index.js +2 -0
- package/dist/utils/logging/index.js.map +1 -0
- package/dist/utils/prompts/confirmations.d.ts +2 -0
- package/dist/utils/prompts/confirmations.js +18 -0
- package/dist/utils/prompts/confirmations.js.map +1 -0
- package/dist/utils/prompts/default.d.ts +6 -0
- package/dist/utils/prompts/default.js +27 -0
- package/dist/utils/prompts/default.js.map +1 -0
- package/dist/utils/prompts/index.d.ts +6 -0
- package/dist/utils/prompts/index.js +7 -0
- package/dist/utils/prompts/index.js.map +1 -0
- package/dist/utils/prompts/mint-burn/confirm-burn.d.ts +17 -0
- package/dist/utils/prompts/mint-burn/confirm-burn.js +23 -0
- package/dist/utils/prompts/mint-burn/confirm-burn.js.map +1 -0
- package/dist/utils/prompts/mint-burn/confirm-mint.d.ts +18 -0
- package/dist/utils/prompts/mint-burn/confirm-mint.js +23 -0
- package/dist/utils/prompts/mint-burn/confirm-mint.js.map +1 -0
- package/dist/utils/prompts/mint-burn/constants.d.ts +2 -0
- package/dist/utils/prompts/mint-burn/constants.js +6 -0
- package/dist/utils/prompts/mint-burn/constants.js.map +1 -0
- package/dist/utils/prompts/mint-burn/index.d.ts +2 -0
- package/dist/utils/prompts/mint-burn/index.js +3 -0
- package/dist/utils/prompts/mint-burn/index.js.map +1 -0
- package/dist/utils/prompts/operations.d.ts +9 -0
- package/dist/utils/prompts/operations.js +52 -0
- package/dist/utils/prompts/operations.js.map +1 -0
- package/dist/utils/prompts/predeposit-guarantee.d.ts +3 -0
- package/dist/utils/prompts/predeposit-guarantee.js +23 -0
- package/dist/utils/prompts/predeposit-guarantee.js.map +1 -0
- package/dist/utils/prompts/vault.d.ts +2 -0
- package/dist/utils/prompts/vault.js +14 -0
- package/dist/utils/prompts/vault.js.map +1 -0
- package/dist/utils/proof/create-proof.d.ts +15 -0
- package/dist/utils/proof/create-proof.js +40 -0
- package/dist/utils/proof/create-proof.js.map +1 -0
- package/dist/utils/proof/first-validator-gindex.d.ts +1 -0
- package/dist/utils/proof/first-validator-gindex.js +32 -0
- package/dist/utils/proof/first-validator-gindex.js.map +1 -0
- package/dist/utils/proof/index.d.ts +3 -0
- package/dist/utils/proof/index.js +4 -0
- package/dist/utils/proof/index.js.map +1 -0
- package/dist/utils/proof/merkle-utils.d.ts +55 -0
- package/dist/utils/proof/merkle-utils.js +173 -0
- package/dist/utils/proof/merkle-utils.js.map +1 -0
- package/dist/utils/proof/proofs.d.ts +30 -0
- package/dist/utils/proof/proofs.js +52 -0
- package/dist/utils/proof/proofs.js.map +1 -0
- package/dist/utils/read-programs-by-abi.d.ts +27 -0
- package/dist/utils/read-programs-by-abi.js +92 -0
- package/dist/utils/read-programs-by-abi.js.map +1 -0
- package/dist/utils/rebase-rewards.d.ts +7 -0
- package/dist/utils/rebase-rewards.js +6 -0
- package/dist/utils/rebase-rewards.js.map +1 -0
- package/dist/utils/report/index.d.ts +4 -0
- package/dist/utils/report/index.js +5 -0
- package/dist/utils/report/index.js.map +1 -0
- package/dist/utils/report/report-proof.d.ts +39 -0
- package/dist/utils/report/report-proof.js +38 -0
- package/dist/utils/report/report-proof.js.map +1 -0
- package/dist/utils/report/report.d.ts +19 -0
- package/dist/utils/report/report.js +133 -0
- package/dist/utils/report/report.js.map +1 -0
- package/dist/utils/report/statistic-data.d.ts +32 -0
- package/dist/utils/report/statistic-data.js +28 -0
- package/dist/utils/report/statistic-data.js.map +1 -0
- package/dist/utils/report/types.d.ts +52 -0
- package/dist/utils/report/types.js +2 -0
- package/dist/utils/report/types.js.map +1 -0
- package/dist/utils/resolve-path.d.ts +1 -0
- package/dist/utils/resolve-path.js +10 -0
- package/dist/utils/resolve-path.js.map +1 -0
- package/dist/utils/share-rate.d.ts +1 -0
- package/dist/utils/share-rate.js +16 -0
- package/dist/utils/share-rate.js.map +1 -0
- package/dist/utils/sleep.d.ts +1 -0
- package/dist/utils/sleep.js +4 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/snake-to-camel.d.ts +6 -0
- package/dist/utils/snake-to-camel.js +9 -0
- package/dist/utils/snake-to-camel.js.map +1 -0
- package/dist/utils/spinner/constants.d.ts +6 -0
- package/dist/utils/spinner/constants.js +120 -0
- package/dist/utils/spinner/constants.js.map +1 -0
- package/dist/utils/spinner/index.d.ts +1 -0
- package/dist/utils/spinner/index.js +2 -0
- package/dist/utils/spinner/index.js.map +1 -0
- package/dist/utils/spinner/spinners.d.ts +7 -0
- package/dist/utils/spinner/spinners.js +16 -0
- package/dist/utils/spinner/spinners.js.map +1 -0
- package/dist/utils/statistic/index.d.ts +1 -0
- package/dist/utils/statistic/index.js +2 -0
- package/dist/utils/statistic/index.js.map +1 -0
- package/dist/utils/statistic/report-statistic.d.ts +51 -0
- package/dist/utils/statistic/report-statistic.js +125 -0
- package/dist/utils/statistic/report-statistic.js.map +1 -0
- package/dist/utils/timestamp.d.ts +1 -0
- package/dist/utils/timestamp.js +17 -0
- package/dist/utils/timestamp.js.map +1 -0
- package/dist/utils/transactions/index.d.ts +3 -0
- package/dist/utils/transactions/index.js +4 -0
- package/dist/utils/transactions/index.js.map +1 -0
- package/dist/utils/transactions/tx-private-key.d.ts +26 -0
- package/dist/utils/transactions/tx-private-key.js +310 -0
- package/dist/utils/transactions/tx-private-key.js.map +1 -0
- package/dist/utils/transactions/tx-wc.d.ts +34 -0
- package/dist/utils/transactions/tx-wc.js +174 -0
- package/dist/utils/transactions/tx-wc.js.map +1 -0
- package/dist/utils/transactions/types.d.ts +40 -0
- package/dist/utils/transactions/types.js +2 -0
- package/dist/utils/transactions/types.js.map +1 -0
- package/dist/utils/wallet-connect.d.ts +7677 -0
- package/dist/utils/wallet-connect.js +179 -0
- package/dist/utils/wallet-connect.js.map +1 -0
- package/dist/version/index.d.ts +1 -0
- package/dist/version/index.js +1 -0
- package/dist/version/index.js.map +1 -0
- package/package.json +82 -20
- package/dist/programs/vault-hub.js +0 -137
- package/dist/programs/vault-hub.js.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getContract, createPublicClient, http } from 'viem';
|
|
2
|
+
import { WstEthAbi } from '../abi/index.js';
|
|
3
|
+
import { getChain, getElUrl } from '../configs/index.js';
|
|
4
|
+
import { getLocatorContract } from './index.js';
|
|
5
|
+
export const getWstethContract = async () => {
|
|
6
|
+
const locator = getLocatorContract();
|
|
7
|
+
const elUrl = getElUrl();
|
|
8
|
+
const address = await locator.read.wstETH();
|
|
9
|
+
return getContract({
|
|
10
|
+
address: address,
|
|
11
|
+
abi: WstEthAbi,
|
|
12
|
+
client: createPublicClient({
|
|
13
|
+
chain: getChain(),
|
|
14
|
+
transport: http(elUrl),
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=wsteth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wsteth.js","sourceRoot":"","sources":["../../contracts/wsteth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,IAAI,EAAE;IAC1C,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAE5C,OAAO,WAAW,CAAC;QACjB,OAAO,EAAE,OAAO;QAChB,GAAG,EAAE,SAAS;QACd,MAAM,EAAE,kBAAkB,CAAC;YACzB,KAAK,EAAE,QAAQ,EAAE;YACjB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC;SACvB,CAAC;KACH,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DashboardContract } from '../contracts/index.js';
|
|
2
|
+
export declare const getDashboardHealth: (contract: DashboardContract) => Promise<void>;
|
|
3
|
+
export declare const getDashboardOverview: (contract: DashboardContract) => Promise<void>;
|
|
4
|
+
export declare const getDashboardBaseInfo: (contract: DashboardContract) => Promise<void>;
|
|
5
|
+
export declare const getDashboardRoles: (contract: DashboardContract) => Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getVaultHealthByDashboard, getVaultInfoByDashboard, getVaultOverviewByDashboard, getVaultRolesByDashboard, } from './vault-operations/index.js';
|
|
2
|
+
export const getDashboardHealth = async (contract) => {
|
|
3
|
+
return getVaultHealthByDashboard(contract);
|
|
4
|
+
};
|
|
5
|
+
export const getDashboardOverview = async (contract) => {
|
|
6
|
+
return getVaultOverviewByDashboard(contract);
|
|
7
|
+
};
|
|
8
|
+
export const getDashboardBaseInfo = async (contract) => {
|
|
9
|
+
await getVaultInfoByDashboard(contract);
|
|
10
|
+
};
|
|
11
|
+
export const getDashboardRoles = async (contract) => {
|
|
12
|
+
await getVaultRolesByDashboard(contract);
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../features/dashboard.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EAAE,QAA2B,EAAE,EAAE;IACtE,OAAO,yBAAyB,CAAC,QAAQ,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EAAE,QAA2B,EAAE,EAAE;IACxE,OAAO,2BAA2B,CAAC,QAAQ,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EAAE,QAA2B,EAAE,EAAE;IACxE,MAAM,uBAAuB,CAAC,QAAQ,CAAC,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,QAA2B,EAAE,EAAE;IACrE,MAAM,wBAAwB,CAAC,QAAQ,CAAC,CAAC;AAC3C,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PredepositGuaranteeContract, StakingVaultContract } from '../../contracts/index.js';
|
|
2
|
+
import { Deposit } from '../../types/index.js';
|
|
3
|
+
export declare const checkBLSDeposits: (pdgContract: PredepositGuaranteeContract, vaultContract: StakingVaultContract, deposits: Deposit[]) => Promise<void>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { callReadMethod, isValidBLSDeposit } from '../../utils/index.js';
|
|
2
|
+
export const checkBLSDeposits = async (pdgContract, vaultContract, deposits) => {
|
|
3
|
+
const PREDEPOSIT_AMOUNT = await callReadMethod(pdgContract, 'PREDEPOSIT_AMOUNT');
|
|
4
|
+
const withdrawalCredentials = await callReadMethod(vaultContract, 'withdrawalCredentials');
|
|
5
|
+
for (const deposit of deposits) {
|
|
6
|
+
const isBLSValid = isValidBLSDeposit(deposit, withdrawalCredentials);
|
|
7
|
+
if (deposit.amount !== PREDEPOSIT_AMOUNT) {
|
|
8
|
+
throw new Error(`❌ Deposit amount is not equal to PREDEPOSIT_AMOUNT for pubkey ${deposit.pubkey}`);
|
|
9
|
+
}
|
|
10
|
+
if (!isBLSValid) {
|
|
11
|
+
throw new Error(`❌ Offchain - BLS signature is not valid for Pubkey ${deposit.pubkey}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=check-bls-deposits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-bls-deposits.js","sourceRoot":"","sources":["../../../features/deposits/check-bls-deposits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EACnC,WAAwC,EACxC,aAAmC,EACnC,QAAmB,EACnB,EAAE;IACF,MAAM,iBAAiB,GAAG,MAAM,cAAc,CAC5C,WAAW,EACX,mBAAmB,CACpB,CAAC;IACF,MAAM,qBAAqB,GAAG,MAAM,cAAc,CAChD,aAAa,EACb,uBAAuB,CACxB,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAG,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;QAErE,IAAI,OAAO,CAAC,MAAM,KAAK,iBAAiB,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CACb,iEAAiE,OAAO,CAAC,MAAM,EAAE,CAClF,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CACb,sDAAsD,OAAO,CAAC,MAAM,EAAE,CACvE,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../features/deposits/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ValidatorWitness } from '../../utils/index.js';
|
|
2
|
+
export declare const makePDGProofByIndex: (validatorIndex: number) => Promise<import("../../utils/index.js").ValidatorWitnessWithWC>;
|
|
3
|
+
export declare const makePDGProofByIndexes: (indexes: number[]) => Promise<ValidatorWitness[] | undefined>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { logInfo, logResult, logTable, printError, showSpinner, createPDGProof, confirmMakeProof, } from '../../utils/index.js';
|
|
2
|
+
export const makePDGProofByIndex = async (validatorIndex) => {
|
|
3
|
+
const hideSpinner = showSpinner({
|
|
4
|
+
type: 'bouncingBar',
|
|
5
|
+
message: 'Making proof...',
|
|
6
|
+
});
|
|
7
|
+
try {
|
|
8
|
+
const packageProof = await createPDGProof(Number(validatorIndex));
|
|
9
|
+
hideSpinner();
|
|
10
|
+
const { proof, pubkey, childBlockTimestamp, withdrawalCredentials, slot, proposerIndex, } = packageProof;
|
|
11
|
+
logResult({});
|
|
12
|
+
logInfo('----------------------proof----------------------');
|
|
13
|
+
logInfo(proof);
|
|
14
|
+
logInfo('-------------------------------------------------');
|
|
15
|
+
logTable({
|
|
16
|
+
data: [
|
|
17
|
+
['Pubkey', pubkey],
|
|
18
|
+
['Child Block Timestamp', childBlockTimestamp],
|
|
19
|
+
['Withdrawal Credentials', withdrawalCredentials],
|
|
20
|
+
['Slot', slot],
|
|
21
|
+
['Proposer Index', proposerIndex],
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
logInfo('-----------------------end-----------------------');
|
|
25
|
+
return packageProof;
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
hideSpinner();
|
|
29
|
+
printError(err, 'Error when making proof');
|
|
30
|
+
throw err;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export const makePDGProofByIndexes = async (indexes) => {
|
|
34
|
+
const witnesses = [];
|
|
35
|
+
for (const index of indexes) {
|
|
36
|
+
const validatorIndex = await confirmMakeProof(index);
|
|
37
|
+
if (!validatorIndex)
|
|
38
|
+
return;
|
|
39
|
+
const packageProof = await makePDGProofByIndex(validatorIndex);
|
|
40
|
+
const { proof, pubkey, childBlockTimestamp, slot, proposerIndex } = packageProof;
|
|
41
|
+
witnesses.push({
|
|
42
|
+
proof,
|
|
43
|
+
pubkey,
|
|
44
|
+
validatorIndex: BigInt(validatorIndex),
|
|
45
|
+
childBlockTimestamp,
|
|
46
|
+
slot,
|
|
47
|
+
proposerIndex,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return witnesses;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=make-pdg-proof.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"make-pdg-proof.js","sourceRoot":"","sources":["../../../features/deposits/make-pdg-proof.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,SAAS,EACT,QAAQ,EACR,UAAU,EACV,WAAW,EACX,cAAc,EAEd,gBAAgB,GACjB,MAAM,OAAO,CAAC;AAEf,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EAAE,cAAsB,EAAE,EAAE;IAClE,MAAM,WAAW,GAAG,WAAW,CAAC;QAC9B,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,iBAAiB;KAC3B,CAAC,CAAC;IACH,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;QAClE,WAAW,EAAE,CAAC;QACd,MAAM,EACJ,KAAK,EACL,MAAM,EACN,mBAAmB,EACnB,qBAAqB,EACrB,IAAI,EACJ,aAAa,GACd,GAAG,YAAY,CAAC;QAEjB,SAAS,CAAC,EAAE,CAAC,CAAC;QACd,OAAO,CAAC,mDAAmD,CAAC,CAAC;QAC7D,OAAO,CAAC,KAAK,CAAC,CAAC;QACf,OAAO,CAAC,mDAAmD,CAAC,CAAC;QAC7D,QAAQ,CAAC;YACP,IAAI,EAAE;gBACJ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAClB,CAAC,uBAAuB,EAAE,mBAAmB,CAAC;gBAC9C,CAAC,wBAAwB,EAAE,qBAAqB,CAAC;gBACjD,CAAC,MAAM,EAAE,IAAI,CAAC;gBACd,CAAC,gBAAgB,EAAE,aAAa,CAAC;aAClC;SACF,CAAC,CAAC;QACH,OAAO,CAAC,mDAAmD,CAAC,CAAC;QAE7D,OAAO,YAAY,CAAC;IACtB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,WAAW,EAAE,CAAC;QACd,UAAU,CAAC,GAAG,EAAE,yBAAyB,CAAC,CAAC;QAC3C,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EAAE,OAAiB,EAAE,EAAE;IAC/D,MAAM,SAAS,GAAuB,EAAE,CAAC;IAEzC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,cAAc,GAAG,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC;QACrD,IAAI,CAAC,cAAc;YAAE,OAAO;QAE5B,MAAM,YAAY,GAAG,MAAM,mBAAmB,CAAC,cAAc,CAAC,CAAC;QAC/D,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,IAAI,EAAE,aAAa,EAAE,GAC/D,YAAY,CAAC;QAEf,SAAS,CAAC,IAAI,CAAC;YACb,KAAK;YACL,MAAM;YACN,cAAc,EAAE,MAAM,CAAC,cAAc,CAAC;YACtC,mBAAmB;YACnB,IAAI;YACJ,aAAa;SACd,CAAC,CAAC;IACL,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { PredepositGuaranteeContract, StakingVaultContract } from '../../contracts/index.js';
|
|
3
|
+
export declare const checkNOBalancePDGforDeposit: (pdgContract: PredepositGuaranteeContract, nodeOperator: Address) => Promise<{
|
|
4
|
+
balance: {
|
|
5
|
+
total: bigint;
|
|
6
|
+
locked: bigint;
|
|
7
|
+
};
|
|
8
|
+
unlockedBalance: bigint;
|
|
9
|
+
amountToTopUp: bigint;
|
|
10
|
+
isNeedTopUp: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const checkNOBalancePDGforDeposits: (pdgContract: PredepositGuaranteeContract, nodeOperator: Address, countOfDeposits: number) => Promise<{
|
|
13
|
+
amountToTopUp: bigint;
|
|
14
|
+
isNeedTopUp: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const checkNodeOperatorForDeposit: (vault: StakingVaultContract) => Promise<`0x${string}`>;
|
|
17
|
+
export declare const checkAndSpecifyNodeOperatorForTopUpOrWithdraw: (vault: StakingVaultContract, pdg: PredepositGuaranteeContract, isTopUp: boolean) => Promise<`0x${string}`>;
|
|
18
|
+
export declare const getGuarantor: (pdgContract: PredepositGuaranteeContract) => Promise<{
|
|
19
|
+
newGuarantor: any;
|
|
20
|
+
currentAccount: `0x${string}`;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const specifyNodeOperatorAddress: () => Promise<any>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { formatEther } from 'viem';
|
|
2
|
+
import { callReadMethodSilent, confirmOperation, logInfo, numberPrompt, addressPrompt, } from '../../utils/index.js';
|
|
3
|
+
import { getAccount } from '../../providers/index.js';
|
|
4
|
+
export const checkNOBalancePDGforDeposit = async (pdgContract, nodeOperator) => {
|
|
5
|
+
const currentAccount = await getAccount();
|
|
6
|
+
const balance = await callReadMethodSilent(pdgContract, 'nodeOperatorBalance', [nodeOperator]);
|
|
7
|
+
const unlockedBalance = await callReadMethodSilent(pdgContract, 'unlockedBalance', [nodeOperator]);
|
|
8
|
+
const nodeOperatorGuarantor = await callReadMethodSilent(pdgContract, 'nodeOperatorGuarantor', [nodeOperator]);
|
|
9
|
+
let amountToTopUp = 0n;
|
|
10
|
+
let isNeedTopUp = false;
|
|
11
|
+
if (balance.total === 0n || unlockedBalance === 0n) {
|
|
12
|
+
logInfo(`Node operator ${nodeOperator} has no unlocked balance in PDG to deposit`);
|
|
13
|
+
if (nodeOperatorGuarantor.toLocaleLowerCase() !==
|
|
14
|
+
currentAccount.address.toLocaleLowerCase()) {
|
|
15
|
+
throw new Error(`You ${currentAccount.address} are not the guarantor ${nodeOperatorGuarantor} of the node operator ${nodeOperator}. You can't top up the balance.`);
|
|
16
|
+
}
|
|
17
|
+
const isTopUp = await confirmOperation(`Do you want to top up NO balance in PDG?`);
|
|
18
|
+
if (!isTopUp)
|
|
19
|
+
throw new Error('A top-up is required for predeposit if the unlocked balance is 0');
|
|
20
|
+
const amount = await numberPrompt('Enter amount to top up (in ETH). Value should multiply of 1 ETH (PREDEPOSIT_AMOUNT)', 'value');
|
|
21
|
+
if (!amount)
|
|
22
|
+
throw new Error('Amount is required');
|
|
23
|
+
amountToTopUp = BigInt(amount.value);
|
|
24
|
+
isNeedTopUp = true;
|
|
25
|
+
}
|
|
26
|
+
return { balance, unlockedBalance, amountToTopUp, isNeedTopUp };
|
|
27
|
+
};
|
|
28
|
+
export const checkNOBalancePDGforDeposits = async (pdgContract, nodeOperator, countOfDeposits) => {
|
|
29
|
+
const PREDEPOSIT_AMOUNT = await callReadMethodSilent(pdgContract, 'PREDEPOSIT_AMOUNT');
|
|
30
|
+
const unlockedBalance = await callReadMethodSilent(pdgContract, 'unlockedBalance', [nodeOperator]);
|
|
31
|
+
const amountToTopUp = PREDEPOSIT_AMOUNT * BigInt(countOfDeposits);
|
|
32
|
+
const isNeedTopUp = unlockedBalance < amountToTopUp;
|
|
33
|
+
if (isNeedTopUp) {
|
|
34
|
+
const isTopUp = await confirmOperation(`Do you want to top up NO balance in PDG? Need to top up ${formatEther(amountToTopUp)} ETH (PREDEPOSIT_AMOUNT * countOfDeposits)`);
|
|
35
|
+
if (!isTopUp)
|
|
36
|
+
throw new Error('A top-up is required for predeposit');
|
|
37
|
+
}
|
|
38
|
+
return { amountToTopUp, isNeedTopUp };
|
|
39
|
+
};
|
|
40
|
+
export const checkNodeOperatorForDeposit = async (vault) => {
|
|
41
|
+
const currentAccount = await getAccount();
|
|
42
|
+
const vaultNodeOperator = await callReadMethodSilent(vault, 'nodeOperator');
|
|
43
|
+
if (vaultNodeOperator.toLocaleLowerCase() !==
|
|
44
|
+
currentAccount.address.toLocaleLowerCase()) {
|
|
45
|
+
throw new Error(`You are not the node operator of the vault ${vault.address}. Only node operator can deposit from the vault.`);
|
|
46
|
+
}
|
|
47
|
+
return vaultNodeOperator;
|
|
48
|
+
};
|
|
49
|
+
export const checkAndSpecifyNodeOperatorForTopUpOrWithdraw = async (vault, pdg, isTopUp) => {
|
|
50
|
+
const currentAccount = await getAccount();
|
|
51
|
+
const vaultNodeOperator = await callReadMethodSilent(vault, 'nodeOperator');
|
|
52
|
+
const noGuarantor = await callReadMethodSilent(pdg, 'nodeOperatorGuarantor', [
|
|
53
|
+
vaultNodeOperator,
|
|
54
|
+
]);
|
|
55
|
+
const isNoGuarantor = noGuarantor.toLocaleLowerCase() ===
|
|
56
|
+
currentAccount.address.toLocaleLowerCase();
|
|
57
|
+
const isNodeOperator = vaultNodeOperator.toLocaleLowerCase() ===
|
|
58
|
+
currentAccount.address.toLocaleLowerCase();
|
|
59
|
+
if (!isNoGuarantor && !isNodeOperator) {
|
|
60
|
+
throw new Error(`You are not the node operator of the vault ${vault.address} or not the guarantor of the node operator.`);
|
|
61
|
+
}
|
|
62
|
+
if (!isNodeOperator && isNoGuarantor) {
|
|
63
|
+
logInfo(`You are not the node operator of the vault ${vault.address}. You are the guarantor of the node operator ${vaultNodeOperator}.`);
|
|
64
|
+
const confirm = await confirmOperation(`Do you want to ${isTopUp ? 'top up' : 'withdraw'} the node operator ${vaultNodeOperator} balance?`);
|
|
65
|
+
if (!confirm)
|
|
66
|
+
throw new Error('Top up or withdraw is not confirmed');
|
|
67
|
+
return vaultNodeOperator;
|
|
68
|
+
}
|
|
69
|
+
return vaultNodeOperator;
|
|
70
|
+
};
|
|
71
|
+
export const getGuarantor = async (pdgContract) => {
|
|
72
|
+
const currentAccount = await getAccount();
|
|
73
|
+
const balance = await callReadMethodSilent(pdgContract, 'nodeOperatorBalance', [currentAccount.address]);
|
|
74
|
+
if (balance.locked > 0n) {
|
|
75
|
+
throw new Error(`You have locked balance in PDG. You can't change the guarantor.`);
|
|
76
|
+
}
|
|
77
|
+
if (balance.total > 0n) {
|
|
78
|
+
logInfo(`You have balance in PDG. If you change the guarantor, your balance will be refunded to the previous guarantor
|
|
79
|
+
or guarantor can withdraw it before you change the guarantor.`);
|
|
80
|
+
const confirm = await confirmOperation(`Do you want to change the guarantor?`);
|
|
81
|
+
if (!confirm)
|
|
82
|
+
throw new Error('Change the guarantor is not confirmed');
|
|
83
|
+
}
|
|
84
|
+
const newGuarantor = await addressPrompt('Enter new guarantor address', 'value');
|
|
85
|
+
if (!newGuarantor)
|
|
86
|
+
throw new Error('New guarantor address is required');
|
|
87
|
+
return {
|
|
88
|
+
newGuarantor: newGuarantor.value,
|
|
89
|
+
currentAccount: currentAccount.address,
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
export const specifyNodeOperatorAddress = async () => {
|
|
93
|
+
const currentAccount = await getAccount();
|
|
94
|
+
const confirm = await confirmOperation(`Do you want to use your address to check the balance ${currentAccount.address}?`);
|
|
95
|
+
if (!confirm) {
|
|
96
|
+
const otherAddress = await addressPrompt('Enter the address', 'value');
|
|
97
|
+
if (!otherAddress.value)
|
|
98
|
+
throw new Error('Invalid address');
|
|
99
|
+
return otherAddress.value;
|
|
100
|
+
}
|
|
101
|
+
return currentAccount.address;
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=no-pdg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-pdg.js","sourceRoot":"","sources":["../../../features/deposits/no-pdg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,WAAW,EAAE,MAAM,M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,YAAY,CAAC,KAAK,CAAC;IAC5B,CAAC;IAED,OAAO,cAAc,CAAC,OAAO,CAAC;AAChC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './vault-factory.js';
|
|
2
|
+
export * from './dashboard.js';
|
|
3
|
+
export * from './vault-hub.js';
|
|
4
|
+
export * from './operator-grid.js';
|
|
5
|
+
export * from './pdg.js';
|
|
6
|
+
export * from './vault.js';
|
|
7
|
+
export * from './vault-operations/index.js';
|
|
8
|
+
export * from './utils/index.js';
|
|
9
|
+
export * from './mint-burn/index.js';
|
|
10
|
+
export * from './deposits/index.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './vault-factory.js';
|
|
2
|
+
export * from './dashboard.js';
|
|
3
|
+
export * from './vault-hub.js';
|
|
4
|
+
export * from './operator-grid.js';
|
|
5
|
+
export * from './pdg.js';
|
|
6
|
+
export * from './vault.js';
|
|
7
|
+
export * from './vault-operations/index.js';
|
|
8
|
+
export * from './utils/index.js';
|
|
9
|
+
export * from './mint-burn/index.js';
|
|
10
|
+
export * from './deposits/index.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../features/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { formatEther } from 'viem';
|
|
2
|
+
import { getStethContract, getWstethContract, } from '../../contracts/index.js';
|
|
3
|
+
import { getAccount } from '../../providers/index.js';
|
|
4
|
+
import { callReadMethod, callReadMethodSilent, callWriteMethodWithReceipt, confirmOperation, logInfo, } from '../../utils/index.js';
|
|
5
|
+
export const checkAllowance = async (contract, amount, token) => {
|
|
6
|
+
const accountAddress = (await getAccount()).address;
|
|
7
|
+
const isShares = token === 'shares';
|
|
8
|
+
let currentAmount = amount;
|
|
9
|
+
if (token === 'steth' || isShares) {
|
|
10
|
+
const stethContract = await getStethContract();
|
|
11
|
+
const allowance = await callReadMethod(stethContract, 'allowance', [
|
|
12
|
+
accountAddress,
|
|
13
|
+
contract.address,
|
|
14
|
+
]);
|
|
15
|
+
if (isShares) {
|
|
16
|
+
currentAmount = await callReadMethodSilent(stethContract, 'getPooledEthBySharesRoundUp', [amount]);
|
|
17
|
+
}
|
|
18
|
+
if (allowance < currentAmount) {
|
|
19
|
+
logInfo('Insufficient allowance');
|
|
20
|
+
const confirm = await confirmOperation(`Do you want to set allowance for ${formatEther(amount)} ${token} (${formatEther(currentAmount)} stETH) to ${contract.address} (Dashboard contract)? Current allowance: ${formatEther(allowance)} stETH`);
|
|
21
|
+
if (!confirm)
|
|
22
|
+
throw new Error('Allowance not set');
|
|
23
|
+
await callWriteMethodWithReceipt({
|
|
24
|
+
contract: stethContract,
|
|
25
|
+
methodName: 'approve',
|
|
26
|
+
payload: [contract.address, currentAmount],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
const wstethContract = await getWstethContract();
|
|
32
|
+
const wstethAllowance = await callReadMethod(wstethContract, 'allowance', [
|
|
33
|
+
accountAddress,
|
|
34
|
+
accountAddress,
|
|
35
|
+
]);
|
|
36
|
+
if (wstethAllowance < amount) {
|
|
37
|
+
logInfo('Insufficient allowance');
|
|
38
|
+
const confirm = await confirmOperation(`Do you want to set allowance for ${formatEther(amount)} ${token} to ${contract.address} (Dashboard contract)? Current allowance: ${formatEther(wstethAllowance)} wstETH`);
|
|
39
|
+
if (!confirm)
|
|
40
|
+
throw new Error('Allowance not set');
|
|
41
|
+
await callWriteMethodWithReceipt({
|
|
42
|
+
contract: wstethContract,
|
|
43
|
+
methodName: 'approve',
|
|
44
|
+
payload: [contract.address, amount],
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=allowance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowance.js","sourceRoot":"","sources":["../../../features/mint-burn/allowance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,EACL,gBAAgB,EAEhB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,EAChB,OAAO,GACR,MAAM,OAAO,CAAC;AACf,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,QAA2B,EAC3B,MAAc,EACd,KAAoC,EACpC,EAAE;IACF,MAAM,cAAc,GAAG,CAAC,MAAM,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC;IACpD,MAAM,QAAQ,GAAG,KAAK,KAAK,QAAQ,CAAC;IACpC,IAAI,aAAa,GAAG,MAAM,CAAC;IAE3B,IAAI,KAAK,KAAK,OAAO,IAAI,QAAQ,EAAE,CAAC;QAClC,MAAM,aAAa,GAAG,MAAM,gBAAgB,EAAE,CAAC;QAE/C,MAAM,SAAS,GAAG,MAAM,cAAc,CAAC,aAAa,EAAE,WAAW,EAAE;YACjE,cAAc;YACd,QAAQ,CAAC,OAAO;SACjB,CAAC,CAAC;QACH,IAAI,QAAQ,EAAE,CAAC;YACb,aAAa,GAAG,MAAM,oBAAoB,CACxC,aAAa,EACb,6BAA6B,EAC7B,CAAC,MAAM,CAAC,CACT,CAAC;QACJ,CAAC;QAED,IAAI,SAAS,GAAG,aAAa,EAAE,CAAC;YAC9B,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aultHealthWithNewValue, showSpinner, confirmBurn, callWriteMethodWithReceipt, } from '../../utils/index.js';
|
|
2
|
+
import { checkLiabilityShares } from '../index.js';
|
|
3
|
+
export const burnShares = async (contract, amountOfShares, vault, method) => {
|
|
4
|
+
const type = method === 'burnShares' ? 'shares' : 'wstETH';
|
|
5
|
+
const isLiabilitySharesOk = await checkLiabilityShares(contract, amountOfShares);
|
|
6
|
+
if (!isLiabilitySharesOk)
|
|
7
|
+
return;
|
|
8
|
+
const hideSpinner = showSpinner();
|
|
9
|
+
const { currentVaultHealth, newVaultHealth, newLiabilityShares, newLiabilitySharesInStethWei, valueInStethWei, liabilityShares, liabilitySharesInStethWei, } = await fetchAndCalculateVaultHealthWithNewValue(contract, amountOfShares, 'burn');
|
|
10
|
+
hideSpinner();
|
|
11
|
+
const confirm = await confirmBurn({
|
|
12
|
+
vaultAddress: vault,
|
|
13
|
+
amountOfBurn: amountOfShares,
|
|
14
|
+
amountOfBurnInStethWei: valueInStethWei,
|
|
15
|
+
newLiabilityShares: newLiabilityShares,
|
|
16
|
+
newLiabilitySharesInStethWei: newLiabilitySharesInStethWei,
|
|
17
|
+
currentLiabilityShares: liabilityShares,
|
|
18
|
+
currentLiabilitySharesInStethWei: liabilitySharesInStethWei,
|
|
19
|
+
newHealthRatio: newVaultHealth.healthRatio,
|
|
20
|
+
currentHealthRatio: currentVaultHealth.healthRatio,
|
|
21
|
+
newIsHealthy: newVaultHealth.isHealthy,
|
|
22
|
+
currentIsHealthy: currentVaultHealth.isHealthy,
|
|
23
|
+
type,
|
|
24
|
+
});
|
|
25
|
+
if (!confirm)
|
|
26
|
+
return;
|
|
27
|
+
await callWriteMethodWithReceipt({
|
|
28
|
+
contract,
|
|
29
|
+
methodName: method,
|
|
30
|
+
payload: [amountOfShares],
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=burn-shares.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"burn-shares.js","source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C/B,QAAQ;QACR,UAAU,EAAE,MAAM;QAClB,OAAO,EAAE,CAAC,cAAc,CAAC;KAC1B,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { getStethContract } from '../../contracts/index.js';
|
|
2
|
+
import { fetchAndCalculateVaultHealthWithNewValue, showSpinner, confirmBurn, callWriteMethodWithReceipt, callReadMethodSilent, } from '../../utils/index.js';
|
|
3
|
+
import { checkLiabilityShares } from '../index.js';
|
|
4
|
+
export const burnSteth = async (contract, amountOfSteth, vault) => {
|
|
5
|
+
const stethContract = await getStethContract();
|
|
6
|
+
const amountOfShares = await callReadMethodSilent(stethContract, 'getSharesByPooledEth', [amountOfSteth]);
|
|
7
|
+
const isLiabilitySharesOk = await checkLiabilityShares(contract, amountOfShares);
|
|
8
|
+
if (!isLiabilitySharesOk)
|
|
9
|
+
return;
|
|
10
|
+
const hideSpinner = showSpinner();
|
|
11
|
+
const { currentVaultHealth, newVaultHealth, newLiabilityShares, newLiabilitySharesInStethWei, valueInStethWei, liabilityShares, liabilitySharesInStethWei, } = await fetchAndCalculateVaultHealthWithNewValue(contract, amountOfShares, 'burn');
|
|
12
|
+
hideSpinner();
|
|
13
|
+
const confirm = await confirmBurn({
|
|
14
|
+
vaultAddress: vault,
|
|
15
|
+
amountOfBurn: amountOfSteth,
|
|
16
|
+
amountOfBurnInStethWei: valueInStethWei,
|
|
17
|
+
newLiabilityShares: newLiabilityShares,
|
|
18
|
+
newLiabilitySharesInStethWei: newLiabilitySharesInStethWei,
|
|
19
|
+
currentLiabilityShares: liabilityShares,
|
|
20
|
+
currentLiabilitySharesInStethWei: liabilitySharesInStethWei,
|
|
21
|
+
newHealthRatio: newVaultHealth.healthRatio,
|
|
22
|
+
currentHealthRatio: currentVaultHealth.healthRatio,
|
|
23
|
+
newIsHealthy: newVaultHealth.isHealthy,
|
|
24
|
+
currentIsHealthy: currentVaultHealth.isHealthy,
|
|
25
|
+
type: 'stETH',
|
|
26
|
+
});
|
|
27
|
+
if (!confirm)
|
|
28
|
+
return;
|
|
29
|
+
await callWriteMethodWithReceipt({
|
|
30
|
+
contract,
|
|
31
|
+
methodName: 'burnStETH',
|
|
32
|
+
payload: [amountOfSteth],
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=burn-steth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"burn-steth.js","sourceRoot":"","sources":["../../../features/mint-burn/burn-steth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EACL,wCAAwC,EACxC,WAAW,EACX,WAAW,EACX,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAC5B,QAA2B,EAC3B,aAAqB,EACrB,KAAc,EACd,EAAE;IACF,MAAM,aAAa,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAC/C,MAAM,cAAc,GAAG,MAAM,oBAAoB,CAC/C,aAAa,EACb,sBAAsB,EACtB,CAAC,aAAa,CAAC,CAChB,CAAC;IAEF,MAAM,mBAAmB,GAAG,MAAM,oBAAoB,CACpD,QAAQ,EACR,cAAc,CACf,CAAC;IACF,IAAI,CAAC,mBAAmB;QAAE,OAAO;IAEjC,MAAM,WAAW,GAAG,WAAW,EAAE,CAAC;IAClC,MAAM,EACJ,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,4BAA4B,EAC5B,eAAe,EACf,eAAe,EACf,yBAAyB,GAC1B,GAAG,MAAM,wCAAwC,CAChD,QAAQ,EACR,cAAc,EACd,MAAM,CACP,CAAC;IACF,WAAW,EAAE,CAAC;IAEd,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC;QAChC,YAAY,EAAE,KAAK;QACnB,YAAY,EAAE,aAAa;QAC3B,sBAAsB,EAAE,eAAe;QACvC,kBAAkB,EAAE,kBAAkB;QACtC,4BAA4B,EAAE,4BAA4B;QAC1D,sBAAsB,EAAE,eAAe;QACvC,gCAAgC,EAAE,yBAAyB;QAC3D,cAAc,EAAE,cAAc,CAAC,WAAW;QAC1C,kBAAkB,EAAE,kBAAkB,CAAC,WAAW;QAClD,YAAY,EAAE,cAAc,CAAC,SAAS;QACtC,gBAAgB,EAAE,kBAAkB,CAAC,SAAS;QAC9C,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;IACH,IAAI,CAAC,OAAO;QAAE,OAAO;IAErB,MAAM,0BAA0B,CAAC;QAC/B,QAAQ;QACR,UAAU,EAAE,WAAW;QACvB,OAAO,EAAE,CAAC,aAAa,CAAC;KACzB,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../features/mint-burn/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { fetchAndCalculateVaultHealthWithNewValue, showSpinner, confirmMint, callWriteMethodWithReceipt, } from '../../utils/index.js';
|
|
2
|
+
import { checkIsReportFresh, checkMintingCapacity } from '../index.js';
|
|
3
|
+
export const mintShares = async (contract, recipient, amountOfShares, vault, method) => {
|
|
4
|
+
const type = method === 'mintShares' ? 'shares' : 'wstETH';
|
|
5
|
+
const isReportFresh = await checkIsReportFresh(vault);
|
|
6
|
+
if (!isReportFresh)
|
|
7
|
+
return;
|
|
8
|
+
const isMintingCapacityOk = await checkMintingCapacity(contract, amountOfShares);
|
|
9
|
+
if (!isMintingCapacityOk)
|
|
10
|
+
return;
|
|
11
|
+
const hideSpinner = showSpinner();
|
|
12
|
+
const { currentVaultHealth, newVaultHealth, newLiabilityShares, newLiabilitySharesInStethWei, liabilityShares, liabilitySharesInStethWei, valueInStethWei, } = await fetchAndCalculateVaultHealthWithNewValue(contract, amountOfShares, 'mint');
|
|
13
|
+
hideSpinner();
|
|
14
|
+
const confirm = await confirmMint({
|
|
15
|
+
vaultAddress: vault,
|
|
16
|
+
recipient,
|
|
17
|
+
amountOfMint: amountOfShares,
|
|
18
|
+
amountOfMintInStethWei: valueInStethWei,
|
|
19
|
+
newLiabilityShares: newLiabilityShares,
|
|
20
|
+
newLiabilitySharesInStethWei: newLiabilitySharesInStethWei,
|
|
21
|
+
currentLiabilityShares: liabilityShares,
|
|
22
|
+
currentLiabilitySharesInStethWei: liabilitySharesInStethWei,
|
|
23
|
+
newHealthRatio: newVaultHealth.healthRatio,
|
|
24
|
+
currentHealthRatio: currentVaultHealth.healthRatio,
|
|
25
|
+
newIsHealthy: newVaultHealth.isHealthy,
|
|
26
|
+
currentIsHealthy: currentVaultHealth.isHealthy,
|
|
27
|
+
type,
|
|
28
|
+
});
|
|
29
|
+
if (!confirm)
|
|
30
|
+
return;
|
|
31
|
+
await callWriteMethodWithReceipt({
|
|
32
|
+
contract,
|
|
33
|
+
methodName: method,
|
|
34
|
+
payload: [recipient, amountOfShares],
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=mint-shares.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mint-shares.js","sourceRoot":"","sources":["../../../features/mint-burn/mint-shares.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,wCAAwC,EACxC,WAAW,EACX,WAAW,EACX,0BAA0B,GAC3B,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEpE,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAC7B,QAA2B,EAC3B,SAAkB,EAClB,cAAsB,EACtB,KAAc,EACd,MAAmC,EACnC,EAAE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
|
|
2
|
+
import { fetchAndCalculateVaultHealthWithNewValue, showSpinner, confirmMint, callWriteMethodWithReceipt, callReadMethodSilent, } from '../../utils/index.js';
|
|
3
|
+
import { checkIsReportFresh, checkMintingCapacity } from '../index.js';
|
|
4
|
+
export const mintSteth = async (contract, recipient, amountOfSteth, vault) => {
|
|
5
|
+
const stethContract = await getStethContract();
|
|
6
|
+
const amountOfShares = await callReadMethodSilent(stethContract, 'getSharesByPooledEth', [amountOfSteth]);
|
|
7
|
+
const isReportFresh = await checkIsReportFresh(vault);
|
|
8
|
+
if (!isReportFresh)
|
|
9
|
+
return;
|
|
10
|
+
const isMintingCapacityOk = await checkMintingCapacity(contract, amountOfShares);
|
|
11
|
+
if (!isMintingCapacityOk)
|
|
12
|
+
return;
|
|
13
|
+
const hideSpinner = showSpinner();
|
|
14
|
+
const { currentVaultHealth, newVaultHealth, newLiabilityShares, newLiabilitySharesInStethWei, liabilityShares, liabilitySharesInStethWei, valueInStethWei, } = await fetchAndCalculateVaultHealthWithNewValue(contract, amountOfShares, 'mint');
|
|
15
|
+
hideSpinner();
|
|
16
|
+
const confirm = await confirmMint({
|
|
17
|
+
vaultAddress: vault,
|
|
18
|
+
recipient,
|
|
19
|
+
amountOfMint: amountOfShares,
|
|
20
|
+
amountOfMintInStethWei: valueInStethWei,
|
|
21
|
+
newLiabilityShares: newLiabilityShares,
|
|
22
|
+
newLiabilitySharesInStethWei: newLiabilitySharesInStethWei,
|
|
23
|
+
currentLiabilityShares: liabilityShares,
|
|
24
|
+
currentLiabilitySharesInStethWei: liabilitySharesInStethWei,
|
|
25
|
+
newHealthRatio: newVaultHealth.healthRatio,
|
|
26
|
+
currentHealthRatio: currentVaultHealth.healthRatio,
|
|
27
|
+
newIsHealthy: newVaultHealth.isHealthy,
|
|
28
|
+
currentIsHealthy: currentVaultHealth.isHealthy,
|
|
29
|
+
type: 'stETH',
|
|
30
|
+
});
|
|
31
|
+
if (!confirm)
|
|
32
|
+
return;
|
|
33
|
+
await callWriteMethodWithReceipt({
|
|
34
|
+
contract,
|
|
35
|
+
methodName: 'mintStETH',
|
|
36
|
+
payload: [recipient, amountOfSteth],
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=mint-steth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mint-steth.js","sourceRoot":"","sources":["../../../features/mint-burn/mint-steth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EACL,wCAAwC,EACxC,WAAW,EACX,WAAW,EACX,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEpE,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAC5B,QAA2B,EAC3B,SAAkB,EAClB,aAAqB,EACrB,KAAc,EACd,EAAE;IACF,MAAM,aAAa,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAC/C,MAAM,cAAc,GAAG,MAAM,oBAAoB,CAC/C,aAAa,EACb,sBAAsB,EACtB,CAAC,aAAa,CAAC,CAChB,CAAC;IAEF,MAAM,aAAa,GAAG,MAAM,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtD,IAAI,CAAC,aAAa;QAAE,OAAO;IAE3B,MAAM,mBAAmB,GAAG,MAAM,oBAAoB,CACpD,QAAQ,EACR,cAAc,CACf,CAAC;IACF,IAAI,CAAC,mBAAmB;QAAE,OAAO;IAEjC,MAAM,WAAW,GAAG,WAAW,EAAE,CAAC;IAClC,MAAM,EACJ,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,4BAA4B,EAC5B,eAAe,EACf,yBAAyB,EACzB,eAAe,GAChB,GAAG,MAAM,wCAAwC,CAChD,QAAQ,EACR,cAAc,EACd,MAAM,CACP,CAAC;IACF,WAAW,EAAE,CAAC;IAEd,MAAM,OAAO,GAAG,MAA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