@wireio/stake 0.4.2 → 0.4.69
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 +185 -243
- package/lib/stake.browser.js +52382 -10034
- package/lib/stake.browser.js.map +1 -1
- package/lib/stake.d.ts +12552 -964
- package/lib/stake.js +52993 -10538
- package/lib/stake.js.map +1 -1
- package/lib/stake.m.js +52382 -10034
- package/lib/stake.m.js.map +1 -1
- package/package.json +4 -3
- package/src/assets/ethereum/hoodi/common/Base58.sol/Base58.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/Base58.sol/Base58.json +164 -0
- package/src/assets/ethereum/hoodi/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.json +76 -0
- package/src/assets/ethereum/hoodi/common/RestrictedCallers.sol/RestrictedCallers.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/RestrictedCallers.sol/RestrictedCallers.json +10 -0
- package/src/assets/ethereum/hoodi/common/iodata.sol/iodata.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/iodata.sol/iodata.json +618 -0
- package/src/assets/ethereum/hoodi/common/iodata_util.sol/iodata_util.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/iodata_util.sol/iodata_util.json +40 -0
- package/src/assets/ethereum/hoodi/common/sysio_data.sol/sysio_data.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_data.sol/sysio_data.json +10 -0
- package/src/assets/ethereum/hoodi/common/sysio_errors.sol/sysio_errors.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_errors.sol/sysio_errors.json +10 -0
- package/src/assets/ethereum/hoodi/common/sysio_merkle.sol/sysio_merkle.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_merkle.sol/sysio_merkle.json +233 -0
- package/src/assets/ethereum/hoodi/common/sysio_name.sol/sysio_name.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_name.sol/sysio_name.json +49 -0
- package/src/assets/ethereum/hoodi/common/sysio_pubkey.sol/sysio_pubkey.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_pubkey.sol/sysio_pubkey.json +64 -0
- package/src/assets/ethereum/hoodi/common/sysio_read.sol/sysio_read.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_read.sol/sysio_read.json +1458 -0
- package/src/assets/ethereum/hoodi/common/sysio_tester.sol/SysioTester.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_tester.sol/SysioTester.json +1532 -0
- package/src/assets/ethereum/hoodi/common/sysio_verify.sol/sysio_verify.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_verify.sol/sysio_verify.json +1525 -0
- package/src/assets/ethereum/hoodi/common/sysio_write.sol/sysio_write.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_write.sol/sysio_write.json +1076 -0
- package/src/assets/ethereum/hoodi/liqEth/BeaconState.sol/BeaconState.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/DepositManager.sol/DepositManagerV2.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/DepositManager.sol/DepositManagerV2.json +985 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthAuthority.sol/LiqEthAuthority.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IAccounting.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IAccounting.json +182 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IDepositContract.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IDepositManager.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IRewardsERC20.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IRewardsERC20.json +319 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.json +333 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IStakingModule.dbg.json +4 -0
- package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthCommon.sol/IStakingModule.json +1 -1
- package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/LiqEthCommon.dbg.json +4 -0
- package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthCommon.sol/LiqEthCommon.json +2 -2
- package/src/assets/ethereum/hoodi/liqEth/LiqEthDeepFreeze.sol/LiqEthDeepFreeze.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthDeepFreeze.sol/LiqEthDeepFreeze.json +236 -0
- package/src/assets/ethereum/hoodi/liqEth/LiqEthManaged.sol/LiqEthManaged.dbg.json +4 -0
- package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthManaged.sol/LiqEthManaged.json +2 -2
- package/src/assets/ethereum/hoodi/liqEth/RewardsERC20.sol/RewardsERC20UpgradeableV2.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/RewardsERC20.sol/RewardsERC20UpgradeableV2.json +957 -0
- package/src/assets/ethereum/hoodi/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeableV2.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeableV2.json +1020 -0
- package/src/assets/ethereum/hoodi/liqEth/Yield.sol/YieldOracle.dbg.json +4 -0
- package/src/assets/ethereum/{ABI → hoodi}/liqEth/Yield.sol/YieldOracle.json +2 -2
- package/src/assets/ethereum/hoodi/liqEth/accounting.sol/AccountingV2.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/accounting.sol/AccountingV2.json +629 -0
- package/src/assets/ethereum/hoodi/liqEth/liqEth.sol/LiqEthTokenV2.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/liqEth.sol/LiqEthTokenV2.json +1323 -0
- package/src/assets/ethereum/hoodi/liqEth/stakingModule.sol/StakingModuleV2.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/stakingModule.sol/StakingModuleV2.json +1779 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/DepositManager.sol/DepositManager.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/DepositManager.sol/DepositManager.json +978 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IAccounting.dbg.json +4 -0
- package/src/assets/ethereum/{ABI/liqEth → hoodi/liqEth/v1}/LiqEthCommon.sol/IAccounting.json +1 -1
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IDepositContract.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IDepositContract.json +39 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IDepositManager.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IDepositManager.json +64 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/ILiqEthUpgradeable.json +29 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IRewardsERC20.dbg.json +4 -0
- package/src/assets/ethereum/{ABI/liqEth → hoodi/liqEth/v1}/LiqEthCommon.sol/IRewardsERC20.json +1 -1
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +4 -0
- package/src/assets/ethereum/{ABI/liqEth → hoodi/liqEth/v1}/LiqEthCommon.sol/IRewardsERC20Pausable.json +1 -1
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IStakingModule.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IStakingModule.json +344 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IValidatorBalanceVerifier.json +129 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IWithdrawalRecord.json +66 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/LiqEthCommon.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/LiqEthCommon.json +10 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/RewardsERC20.sol/RewardsERC20Upgradeable.dbg.json +4 -0
- package/src/assets/ethereum/{ABI/liqEth → hoodi/liqEth/v1}/RewardsERC20.sol/RewardsERC20Upgradeable.json +1 -1
- package/src/assets/ethereum/hoodi/liqEth/v1/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.dbg.json +4 -0
- package/src/assets/ethereum/{ABI/liqEth → hoodi/liqEth/v1}/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.json +1 -1
- package/src/assets/ethereum/hoodi/liqEth/v1/accounting.sol/Accounting.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/accounting.sol/Accounting.json +548 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/liqEth.sol/LiqEthToken.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/liqEth.sol/LiqEthToken.json +1233 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/stakingModule.sol/StakingModule.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/v1/stakingModule.sol/StakingModule.json +1772 -0
- package/src/assets/ethereum/hoodi/liqEth/withdrawalQueue.sol/WithdrawalQueue.dbg.json +4 -0
- package/src/assets/ethereum/{ABI → hoodi}/liqEth/withdrawalQueue.sol/WithdrawalQueue.json +2 -2
- package/src/assets/ethereum/hoodi/liqEth/withdrawalVault.sol/Uint64BE.dbg.json +4 -0
- package/src/assets/ethereum/{ABI → hoodi}/liqEth/withdrawalVault.sol/Uint64BE.json +2 -2
- package/src/assets/ethereum/hoodi/liqEth/withdrawalVault.sol/WithdrawalVault.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/liqEth/withdrawalVault.sol/WithdrawalVault.json +441 -0
- package/src/assets/ethereum/hoodi/outpost/BAR.sol/BAR.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/BAR.sol/BAR.json +1111 -0
- package/src/assets/ethereum/hoodi/outpost/Depositor.sol/Depositor.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/Depositor.sol/Depositor.json +1696 -0
- package/src/assets/ethereum/hoodi/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.json +274 -0
- package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeDepositCodec.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeDepositCodec.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeWithdrawCodec.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeWithdrawCodec.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeWithdrawConfirmCodec.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeWithdrawConfirmCodec.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/InstaswapBridgeAttestationTypeLib.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/InstaswapBridgeAttestationTypeLib.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/LiqEthBridge.sol/LiqEthBridge.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/LiqEthBridge.sol/LiqEthBridge.json +1044 -0
- package/src/assets/ethereum/hoodi/outpost/OPP.sol/OPP.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OPP.sol/OPP.json +1055 -0
- package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPP.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPP.json +81 -0
- package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPPEndpoint.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPPInbound.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPPInbound.json +330 -0
- package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPPReceiver.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPPReceiver.json +29 -0
- package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPPSender.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPPSender.json +41 -0
- package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/OPPCommon.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/OPPCommon.json +287 -0
- package/src/assets/ethereum/hoodi/outpost/OPPEndpoint.sol/OPPEndpoint.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OPPEndpoint.sol/OPPEndpoint.json +294 -0
- package/src/assets/ethereum/hoodi/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.json +415 -0
- package/src/assets/ethereum/hoodi/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.json +399 -0
- package/src/assets/ethereum/hoodi/outpost/OPPErrors.sol/OPPErrors.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OPPErrors.sol/OPPErrors.json +245 -0
- package/src/assets/ethereum/hoodi/outpost/OPPInbound.sol/OPPInbound.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OPPInbound.sol/OPPInbound.json +1204 -0
- package/src/assets/ethereum/hoodi/outpost/OPPReceiver.sol/OPPReceiver.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OPPReceiver.sol/OPPReceiver.json +312 -0
- package/src/assets/ethereum/hoodi/outpost/OPPSender.sol/OPPSender.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OPPSender.sol/OPPSender.json +324 -0
- package/src/assets/ethereum/hoodi/outpost/OperatorRegistry.sol/OperatorRegistry.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OperatorRegistry.sol/OperatorRegistry.json +1068 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostErrors.sol/OutpostErrors.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostErrors.sol/OutpostErrors.json +211 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostManaged.sol/OutpostManaged.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostManaged.sol/OutpostManaged.json +229 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostManager.sol/OutpostManager.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostManager.sol/OutpostManager.json +751 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.json +1432 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostManagerCommon.sol/IOutpostManager.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostManagerCommon.sol/IOutpostManager.json +130 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.json +141 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostOwnable.sol/OutpostOwnable.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostOwnable.sol/OutpostOwnable.json +213 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostReserve.sol/OutpostReserve.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/OutpostReserve.sol/OutpostReserve.json +888 -0
- package/src/assets/ethereum/hoodi/outpost/Pool.sol/Pool.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/Pool.sol/Pool.json +659 -0
- package/src/assets/ethereum/hoodi/outpost/Pretoken.sol/Pretoken.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/Pretoken.sol/Pretoken.json +1393 -0
- package/src/assets/ethereum/hoodi/outpost/ReceiptNFT.sol/ReceiptNFT.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/ReceiptNFT.sol/ReceiptNFT.json +1738 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapConfirmCodec.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapConfirmCodec.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapFailedCodec.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapFailedCodec.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapRequestCodec.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapRequestCodec.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapSettlementCodec.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapSettlementCodec.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalExitConfirmCodec.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalExitConfirmCodec.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalExitFailedCodec.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalExitFailedCodec.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalExitRequestCodec.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalExitRequestCodec.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalStakeDeltaCodec.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalStakeDeltaCodec.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/WireYieldHubAssetCodec.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/WireYieldHubAssetCodec.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/WireYieldHubAttestationTypeLib.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/WireYieldHubAttestationTypeLib.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/WireYieldHubAttestations.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/WireYieldHubAttestations.json +1437 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/YieldDepositCodec.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/YieldDepositCodec.json +10 -0
- package/src/assets/ethereum/hoodi/outpost/interfaces/IPretoken.sol/IPretoken.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/interfaces/IWarrant.sol/IWarrant.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/token/ERC1155Token.sol/ERC1155Token.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/token/ERC1155Token.sol/ERC1155Token.json +472 -0
- package/src/assets/ethereum/hoodi/token/ERC20Token.sol/ERC20Token.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/token/ERC20Token.sol/ERC20Token.json +330 -0
- package/src/assets/ethereum/hoodi/token/ERC721Token.sol/ERC721Token.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/token/ERC721Token.sol/ERC721Token.json +449 -0
- package/src/assets/ethereum/hoodi/token/Eman1155.sol/Eman1155.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/token/Eman1155.sol/Eman1155.json +560 -0
- package/src/assets/ethereum/hoodi/token/Eman20.sol/Eman20.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/token/Eman20.sol/Eman20.json +460 -0
- package/src/assets/ethereum/hoodi/token/Eman721.sol/Eman721.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/token/Eman721.sol/Eman721.json +624 -0
- package/src/assets/ethereum/mainnet/common/Base58.sol/Base58.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/common/Base58.sol/Base58.json +164 -0
- package/src/assets/ethereum/mainnet/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.json +76 -0
- package/src/assets/ethereum/mainnet/common/RestrictedCallers.sol/RestrictedCallers.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/common/RestrictedCallers.sol/RestrictedCallers.json +10 -0
- package/src/assets/ethereum/mainnet/common/iodata.sol/iodata.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/common/iodata.sol/iodata.json +618 -0
- package/src/assets/ethereum/mainnet/common/iodata_util.sol/iodata_util.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/common/iodata_util.sol/iodata_util.json +40 -0
- package/src/assets/ethereum/mainnet/common/sysio_data.sol/sysio_data.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/common/sysio_data.sol/sysio_data.json +10 -0
- package/src/assets/ethereum/mainnet/common/sysio_errors.sol/sysio_errors.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/common/sysio_errors.sol/sysio_errors.json +10 -0
- package/src/assets/ethereum/mainnet/common/sysio_merkle.sol/sysio_merkle.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/common/sysio_merkle.sol/sysio_merkle.json +233 -0
- package/src/assets/ethereum/mainnet/common/sysio_name.sol/sysio_name.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/common/sysio_name.sol/sysio_name.json +49 -0
- package/src/assets/ethereum/mainnet/common/sysio_pubkey.sol/sysio_pubkey.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/common/sysio_pubkey.sol/sysio_pubkey.json +64 -0
- package/src/assets/ethereum/mainnet/common/sysio_read.sol/sysio_read.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/common/sysio_read.sol/sysio_read.json +1458 -0
- package/src/assets/ethereum/mainnet/common/sysio_tester.sol/SysioTester.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/common/sysio_tester.sol/SysioTester.json +1532 -0
- package/src/assets/ethereum/mainnet/common/sysio_verify.sol/sysio_verify.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/common/sysio_verify.sol/sysio_verify.json +1525 -0
- package/src/assets/ethereum/mainnet/common/sysio_write.sol/sysio_write.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/common/sysio_write.sol/sysio_write.json +1076 -0
- package/src/assets/ethereum/mainnet/liqEth/BeaconState.sol/BeaconState.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/BeaconState.sol/BeaconState.json +807 -0
- package/src/assets/ethereum/mainnet/liqEth/DepositManager.sol/DepositManagerV2.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/DepositManager.sol/DepositManagerV2.json +1004 -0
- package/src/assets/ethereum/mainnet/liqEth/DepositManager.sol/IStakingModuleBondLocker.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/DepositManager.sol/IStakingModuleBondLocker.json +29 -0
- package/src/assets/ethereum/mainnet/liqEth/KeyBondManager.sol/KeyBondManager.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/KeyBondManager.sol/KeyBondManager.json +897 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthAuthority.sol/LiqEthAuthority.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthAuthority.sol/LiqEthAuthority.json +1289 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IDepositContract.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IDepositContract.json +39 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IDepositManager.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IDepositManager.json +64 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IKeyBondManager.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IKeyBondManager.json +189 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.json +29 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IRewardsERC20.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IRewardsERC20.json +319 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.json +333 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IStakingModule.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IStakingModule.json +279 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.json +129 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IWithdrawalRecord.json +66 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/LiqEthCommon.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/LiqEthCommon.json +10 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthDeepFreeze.sol/LiqEthDeepFreeze.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthDeepFreeze.sol/LiqEthDeepFreeze.json +236 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthManaged.sol/LiqEthManaged.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/LiqEthManaged.sol/LiqEthManaged.json +229 -0
- package/src/assets/ethereum/mainnet/liqEth/RewardsERC20.sol/RewardsERC20UpgradeableV2.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/RewardsERC20.sol/RewardsERC20UpgradeableV2.json +957 -0
- package/src/assets/ethereum/mainnet/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeableV2.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeableV2.json +1020 -0
- package/src/assets/ethereum/mainnet/liqEth/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/StakingLib.sol/StakingLib.json +89 -0
- package/src/assets/ethereum/mainnet/liqEth/Yield.sol/YieldOracle.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/Yield.sol/YieldOracle.json +1376 -0
- package/src/assets/ethereum/mainnet/liqEth/liqEth.sol/LiqEthTokenV2.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/liqEth.sol/LiqEthTokenV2.json +1323 -0
- package/src/assets/ethereum/mainnet/liqEth/stakingModule.sol/StakingModuleV2.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/stakingModule.sol/StakingModuleV2.json +1896 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/DepositManager.sol/DepositManager.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/DepositManager.sol/DepositManager.json +978 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IAccounting.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IAccounting.json +176 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IDepositContract.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IDepositContract.json +39 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IDepositManager.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IDepositManager.json +64 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/ILiqEthUpgradeable.json +29 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IRewardsERC20.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IRewardsERC20.json +249 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IRewardsERC20Pausable.json +263 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IStakingModule.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IStakingModule.json +344 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IValidatorBalanceVerifier.json +129 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IWithdrawalRecord.json +66 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/LiqEthCommon.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/LiqEthCommon.json +10 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/RewardsERC20.sol/RewardsERC20Upgradeable.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/RewardsERC20.sol/RewardsERC20Upgradeable.json +874 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.json +937 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/accounting.sol/Accounting.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/accounting.sol/Accounting.json +542 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/liqEth.sol/LiqEthToken.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/liqEth.sol/LiqEthToken.json +1233 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/stakingModule.sol/StakingModule.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/v1/stakingModule.sol/StakingModule.json +1772 -0
- package/src/assets/ethereum/mainnet/liqEth/withdrawalQueue.sol/WithdrawalQueue.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/withdrawalQueue.sol/WithdrawalQueue.json +973 -0
- package/src/assets/ethereum/mainnet/liqEth/withdrawalVault.sol/Uint64BE.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/withdrawalVault.sol/Uint64BE.json +10 -0
- package/src/assets/ethereum/mainnet/liqEth/withdrawalVault.sol/WithdrawalVault.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/liqEth/withdrawalVault.sol/WithdrawalVault.json +441 -0
- package/src/assets/ethereum/mainnet/outpost/BAR.sol/BARV2.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/BAR.sol/BARV2.json +1915 -0
- package/src/assets/ethereum/mainnet/outpost/Depositor.sol/DepositorV2.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/Depositor.sol/DepositorV2.json +1845 -0
- package/src/assets/ethereum/mainnet/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.json +122 -0
- package/src/assets/ethereum/mainnet/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.dbg.json +4 -0
- package/src/assets/ethereum/{ABI → mainnet}/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.json +31 -29
- package/src/assets/ethereum/mainnet/outpost/OPP.sol/OPP.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OPPCommon.sol/IOPP.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OPPCommon.sol/IOPPEndpoint.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OPPCommon.sol/IOPPEndpoint.json +29 -0
- package/src/assets/ethereum/mainnet/outpost/OPPCommon.sol/IOPPInbound.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OPPCommon.sol/IOPPReceiver.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OPPCommon.sol/IOPPSender.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OPPCommon.sol/OPPCommon.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OPPEndpoint.sol/OPPEndpoint.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OPPErrors.sol/OPPErrors.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OPPInbound.sol/OPPInbound.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OPPReceiver.sol/OPPReceiver.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OPPSender.sol/OPPSender.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OutpostErrors.sol/OutpostErrors.dbg.json +4 -0
- package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostErrors.sol/OutpostErrors.json +33 -18
- package/src/assets/ethereum/mainnet/outpost/OutpostManaged.sol/OutpostManaged.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OutpostManager.sol/OutpostManagerV2.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OutpostManager.sol/OutpostManagerV2.json +737 -0
- package/src/assets/ethereum/mainnet/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OutpostManagerCommon.sol/IOutpostManager.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.json +29 -0
- package/src/assets/ethereum/mainnet/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/OutpostOwnable.sol/OutpostOwnable.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/Pool.sol/PoolV2.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/Pool.sol/PoolV2.json +943 -0
- package/src/assets/ethereum/mainnet/outpost/Pretoken.sol/PretokenV2.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/Pretoken.sol/PretokenV2.json +1703 -0
- package/src/assets/ethereum/mainnet/outpost/ReceiptNFT.sol/ReceiptNFT.dbg.json +4 -0
- package/src/assets/ethereum/{ABI → mainnet}/outpost/ReceiptNFT.sol/ReceiptNFT.json +33 -18
- package/src/assets/ethereum/mainnet/outpost/interfaces/IPretoken.sol/IPretoken.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/interfaces/IPretoken.sol/IPretoken.json +29 -0
- package/src/assets/ethereum/mainnet/outpost/interfaces/IWarrant.sol/IWarrant.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/interfaces/IWarrant.sol/IWarrant.json +29 -0
- package/src/assets/ethereum/mainnet/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.json +858 -0
- package/src/assets/ethereum/mainnet/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.json +30 -0
- package/src/assets/ethereum/mainnet/outpost/v1/BAR.sol/BAR.dbg.json +4 -0
- package/src/assets/ethereum/{ABI/outpost → mainnet/outpost/v1}/BAR.sol/BAR.json +34 -19
- package/src/assets/ethereum/mainnet/outpost/v1/Depositor.sol/Depositor.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/v1/Depositor.sol/Depositor.json +1653 -0
- package/src/assets/ethereum/mainnet/outpost/v1/OutpostManager.sol/OutpostManager.dbg.json +4 -0
- package/src/assets/ethereum/{ABI/outpost → mainnet/outpost/v1}/OutpostManager.sol/OutpostManager.json +3 -3
- package/src/assets/ethereum/mainnet/outpost/v1/Pool.sol/Pool.dbg.json +4 -0
- package/src/assets/ethereum/{ABI/outpost → mainnet/outpost/v1}/Pool.sol/Pool.json +34 -19
- package/src/assets/ethereum/mainnet/outpost/v1/Pretoken.sol/Pretoken.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/outpost/v1/Pretoken.sol/Pretoken.json +1665 -0
- package/src/assets/ethereum/mainnet/token/ERC1155Token.sol/ERC1155Token.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/token/ERC1155Token.sol/ERC1155Token.json +472 -0
- package/src/assets/ethereum/mainnet/token/ERC20Token.sol/ERC20Token.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/token/ERC20Token.sol/ERC20Token.json +330 -0
- package/src/assets/ethereum/mainnet/token/ERC721Token.sol/ERC721Token.dbg.json +4 -0
- package/src/assets/ethereum/mainnet/token/ERC721Token.sol/ERC721Token.json +449 -0
- package/src/assets/solana/devnet/idl/liqsol_core.json +8566 -0
- package/src/assets/solana/{idl → devnet/idl}/liqsol_token.json +35 -1
- package/src/assets/solana/devnet/idl/transfer_hook.json +490 -0
- package/src/assets/solana/{idl → devnet/idl}/validator_leaderboard.json +19 -1
- package/src/assets/solana/devnet/types/liqsol_core.ts +8572 -0
- package/src/assets/solana/{types → devnet/types}/liqsol_token.ts +35 -1
- package/src/assets/solana/devnet/types/transfer_hook.ts +496 -0
- package/src/assets/solana/{types → devnet/types}/validator_leaderboard.ts +19 -1
- package/src/assets/solana/{idl → mainnet/idl}/liqsol_core.json +1466 -657
- package/src/assets/solana/mainnet/idl/liqsol_token.json +217 -0
- package/src/assets/solana/mainnet/idl/transfer_hook.json +479 -0
- package/src/assets/solana/mainnet/idl/validator_leaderboard.json +574 -0
- package/src/assets/solana/{types → mainnet/types}/liqsol_core.ts +1466 -657
- package/src/assets/solana/mainnet/types/liqsol_token.ts +223 -0
- package/src/assets/solana/mainnet/types/transfer_hook.ts +485 -0
- package/src/assets/solana/mainnet/types/validator_leaderboard.ts +580 -0
- package/src/assets/solana/realdevnet/idl/liqsol_core.json +7112 -0
- package/src/assets/solana/realdevnet/idl/liqsol_token.json +217 -0
- package/src/assets/solana/realdevnet/idl/transfer_hook.json +479 -0
- package/src/assets/solana/realdevnet/idl/validator_leaderboard.json +735 -0
- package/src/assets/solana/realdevnet/types/liqsol_core.ts +7118 -0
- package/src/assets/solana/realdevnet/types/liqsol_token.ts +223 -0
- package/src/assets/solana/realdevnet/types/transfer_hook.ts +485 -0
- package/src/assets/solana/realdevnet/types/validator_leaderboard.ts +741 -0
- package/src/index.ts +2 -2
- package/src/networks/ethereum/clients/convert.client.ts +32 -3
- package/src/networks/ethereum/clients/opp.client.ts +20 -21
- package/src/networks/ethereum/clients/pretoken.client.ts +8 -9
- package/src/networks/ethereum/clients/receipt.client.ts +93 -23
- package/src/networks/ethereum/clients/stake.client.ts +86 -14
- package/src/networks/ethereum/clients/validator.client.ts +61 -0
- package/src/networks/ethereum/contract.ts +425 -153
- package/src/networks/ethereum/ethereum.ts +378 -163
- package/src/networks/ethereum/types.ts +65 -28
- package/src/networks/ethereum/utils.ts +104 -72
- package/src/networks/solana/clients/convert.client.ts +341 -0
- package/src/networks/solana/clients/distribution.client.ts +245 -20
- package/src/networks/solana/clients/leaderboard.client.ts +10 -13
- package/src/networks/solana/clients/outpost.client.ts +93 -55
- package/src/networks/solana/clients/token.client.ts +20 -15
- package/src/networks/solana/constants.ts +59 -277
- package/src/networks/solana/program.ts +446 -28
- package/src/networks/solana/solana.ts +917 -281
- package/src/networks/solana/types.ts +173 -24
- package/src/networks/solana/utils.ts +125 -339
- package/src/staker.ts +25 -4
- package/src/types.ts +113 -27
- package/src/assets/ethereum/ABI/liqEth/BeaconState.sol/BeaconState.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.json +0 -952
- package/src/assets/ethereum/ABI/liqEth/LiqEthAuthority.sol/LiqEthAuthority.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IAccounting.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositContract.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositManager.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IStakingModule.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/LiqEthCommon.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/LiqEthManaged.sol/LiqEthManaged.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/RewardsERC20.sol/RewardsERC20Upgradeable.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.json +0 -10
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.json +0 -10
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZExtras.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZExtras.json +0 -10
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZVec48.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZVec48.json +0 -10
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.json +0 -291
- package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.json +0 -555
- package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.json +0 -1202
- package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.json +0 -1791
- package/src/assets/ethereum/ABI/liqEth/withdrawalQueue.sol/WithdrawalQueue.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.json +0 -460
- package/src/assets/ethereum/ABI/outpost/Aggregator.sol/Aggregator.json +0 -82
- package/src/assets/ethereum/ABI/outpost/BAR.sol/BAR.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/Depositor.sol/Depositor.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/Depositor.sol/Depositor.json +0 -1638
- package/src/assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OPP.sol/OPP.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPP.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPEndpoint.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPInbound.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPReceiver.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPSender.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/OPPCommon.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OPPEndpoint.sol/OPPEndpoint.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OPPErrors.sol/OPPErrors.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OPPInbound.sol/OPPInbound.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OPPReceiver.sol/OPPReceiver.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OPPSender.sol/OPPSender.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OutpostErrors.sol/OutpostErrors.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OutpostManaged.sol/OutpostManaged.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OutpostManager.sol/OutpostManager.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/IOutpostManager.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/OutpostOwnable.sol/OutpostOwnable.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/Pool.sol/Pool.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/Pretoken.sol/Pretoken.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/Pretoken.sol/Pretoken.json +0 -1650
- package/src/assets/ethereum/ABI/outpost/ReceiptNFT.sol/ReceiptNFT.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/interfaces/IPretoken.sol/IPretoken.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/interfaces/IWarrant.sol/IWarrant.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.dbg.json +0 -4
- package/src/assets/ethereum/ABI/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.dbg.json +0 -4
- package/src/assets/ethereum/ABI/token/ERC1155Token.sol/ERC1155Token.dbg.json +0 -4
- package/src/assets/ethereum/ABI/token/ERC1155Token.sol/ERC1155Token.json +0 -472
- package/src/assets/ethereum/ABI/token/ERC20Token.sol/ERC20Token.dbg.json +0 -4
- package/src/assets/ethereum/ABI/token/ERC20Token.sol/ERC20Token.json +0 -330
- package/src/assets/ethereum/ABI/token/ERC721Token.sol/ERC721Token.dbg.json +0 -4
- package/src/assets/ethereum/ABI/token/ERC721Token.sol/ERC721Token.json +0 -449
- package/src/assets/solana/idl/transfer_hook.json +0 -192
- package/src/assets/solana/types/transfer_hook.ts +0 -198
- package/src/networks/solana/clients/deposit.client.ts +0 -273
- package/src/staker/types.ts +0 -62
- /package/src/assets/ethereum/{ABI → hoodi}/liqEth/BeaconState.sol/BeaconState.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthAuthority.sol/LiqEthAuthority.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthCommon.sol/IDepositContract.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthCommon.sol/IDepositManager.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthCommon.sol/IWithdrawalRecord.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/outpost/OPPCommon.sol/IOPPEndpoint.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/outpost/interfaces/IPretoken.sol/IPretoken.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/outpost/interfaces/IWarrant.sol/IWarrant.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPP.sol/OPP.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPP.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPPInbound.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPPReceiver.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPPSender.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/OPPCommon.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPEndpoint.sol/OPPEndpoint.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPErrors.sol/OPPErrors.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPInbound.sol/OPPInbound.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPReceiver.sol/OPPReceiver.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPSender.sol/OPPSender.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManaged.sol/OutpostManaged.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManagerCommon.sol/IOutpostManager.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.json +0 -0
- /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostOwnable.sol/OutpostOwnable.json +0 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { AnchorProvider, BN, Program } from '@coral-xyz/anchor';
|
|
2
|
+
import {
|
|
3
|
+
SystemProgram,
|
|
4
|
+
TransactionInstruction,
|
|
5
|
+
StakeProgram,
|
|
6
|
+
SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
7
|
+
SYSVAR_CLOCK_PUBKEY,
|
|
8
|
+
SYSVAR_RENT_PUBKEY,
|
|
9
|
+
SYSVAR_STAKE_HISTORY_PUBKEY,
|
|
10
|
+
Connection,
|
|
11
|
+
PublicKey,
|
|
12
|
+
} from '@solana/web3.js';
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
TOKEN_2022_PROGRAM_ID,
|
|
16
|
+
ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
17
|
+
getAssociatedTokenAddressSync,
|
|
18
|
+
} from '@solana/spl-token';
|
|
19
|
+
|
|
20
|
+
import { LiqsolCoreClientIdl, SolanaProgramService } from '../program';
|
|
21
|
+
import { GlobalAccount, ReceiptData, WalletLike } from '../types';
|
|
22
|
+
import { BalanceView, WithdrawReceipt } from '../../../types';
|
|
23
|
+
import { normalizeToBigInt } from '../utils';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* ConvertClient (Solana):
|
|
27
|
+
* - deposit SOL -> liqSOL
|
|
28
|
+
* - request withdraw (liqSOL burn -> NFT receipt)
|
|
29
|
+
* - list withdrawal receipts owned by a user
|
|
30
|
+
* - build claim_withdraw instruction
|
|
31
|
+
*/
|
|
32
|
+
export class ConvertClient {
|
|
33
|
+
private program: Program<LiqsolCoreClientIdl>;
|
|
34
|
+
|
|
35
|
+
get connection(): Connection {
|
|
36
|
+
return this.provider.connection;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get wallet(): WalletLike {
|
|
40
|
+
return this.provider.wallet;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
constructor(
|
|
44
|
+
private readonly provider: AnchorProvider,
|
|
45
|
+
private readonly pgs: SolanaProgramService,
|
|
46
|
+
) {
|
|
47
|
+
this.program = pgs.getProgram('liqsolCore');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Build a deposit instruction (SOL -> liqSOL).
|
|
52
|
+
*/
|
|
53
|
+
async buildDepositTx(
|
|
54
|
+
amount: bigint,
|
|
55
|
+
user = this.wallet.publicKey,
|
|
56
|
+
): Promise<TransactionInstruction> {
|
|
57
|
+
if (!user) throw new Error('ConvertClient.buildDepositTx: wallet not connected');
|
|
58
|
+
if (!amount || amount <= BigInt(0))
|
|
59
|
+
throw new Error('ConvertClient.buildDepositTx: amount must be greater than zero.');
|
|
60
|
+
|
|
61
|
+
const depositAuthority = this.pgs.deriveDepositAuthorityPda();
|
|
62
|
+
const liqsolMint = this.pgs.deriveLiqsolMintPda();
|
|
63
|
+
const liqsolMintAuthority = this.pgs.deriveLiqsolMintAuthorityPda();
|
|
64
|
+
const reservePool = this.pgs.deriveReservePoolPda();
|
|
65
|
+
const vault = this.pgs.deriveVaultPda();
|
|
66
|
+
const controllerState = this.pgs.deriveStakeControllerStatePda();
|
|
67
|
+
const payoutState = this.pgs.derivePayoutStatePda();
|
|
68
|
+
const bucketAuthority = this.pgs.deriveBucketAuthorityPda();
|
|
69
|
+
const payRateHistory = this.pgs.derivePayRateHistoryPda();
|
|
70
|
+
const globalConfig = this.pgs.deriveGlobalConfigPda();
|
|
71
|
+
|
|
72
|
+
const userAta = getAssociatedTokenAddressSync(liqsolMint, user, true, TOKEN_2022_PROGRAM_ID);
|
|
73
|
+
const distributionState = this.pgs.deriveDistributionStatePda();
|
|
74
|
+
const userRecord = this.pgs.deriveUserRecordPda(userAta);
|
|
75
|
+
const bucketTokenAccount = getAssociatedTokenAddressSync(
|
|
76
|
+
liqsolMint,
|
|
77
|
+
bucketAuthority,
|
|
78
|
+
true,
|
|
79
|
+
TOKEN_2022_PROGRAM_ID,
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const seed = Math.floor(Math.random() * 2 ** 32);
|
|
83
|
+
const ephemeralStake = await this.pgs.deriveEphemeralStakeAddress(user, seed);
|
|
84
|
+
|
|
85
|
+
return await this.program.methods
|
|
86
|
+
.deposit(new BN(amount.toString()), seed)
|
|
87
|
+
.accounts({
|
|
88
|
+
user,
|
|
89
|
+
depositAuthority,
|
|
90
|
+
systemProgram: SystemProgram.programId,
|
|
91
|
+
tokenProgram: TOKEN_2022_PROGRAM_ID,
|
|
92
|
+
associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
93
|
+
liqsolProgram: this.pgs.PROGRAM_IDS.LIQSOL_TOKEN,
|
|
94
|
+
stakeProgram: StakeProgram.programId,
|
|
95
|
+
liqsolMint,
|
|
96
|
+
userAta,
|
|
97
|
+
liqsolMintAuthority,
|
|
98
|
+
reservePool,
|
|
99
|
+
vault,
|
|
100
|
+
ephemeralStake,
|
|
101
|
+
controllerState,
|
|
102
|
+
payoutState,
|
|
103
|
+
bucketAuthority,
|
|
104
|
+
bucketTokenAccount,
|
|
105
|
+
userRecord,
|
|
106
|
+
distributionState,
|
|
107
|
+
payRateHistory,
|
|
108
|
+
instructionsSysvar: SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
109
|
+
clock: SYSVAR_CLOCK_PUBKEY,
|
|
110
|
+
stakeHistory: SYSVAR_STAKE_HISTORY_PUBKEY,
|
|
111
|
+
rent: SYSVAR_RENT_PUBKEY,
|
|
112
|
+
globalConfig,
|
|
113
|
+
})
|
|
114
|
+
.instruction();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Build a withdraw-request instruction (liqSOL burn -> NFT receipt).
|
|
119
|
+
*/
|
|
120
|
+
async buildWithdrawTx(
|
|
121
|
+
amount: bigint,
|
|
122
|
+
user = this.wallet.publicKey,
|
|
123
|
+
): Promise<TransactionInstruction> {
|
|
124
|
+
if (!user) throw new Error('ConvertClient.buildWithdrawTx: wallet not connected');
|
|
125
|
+
if (!amount || amount <= BigInt(0))
|
|
126
|
+
throw new Error('ConvertClient.buildWithdrawTx: amount must be greater than zero.');
|
|
127
|
+
|
|
128
|
+
const liqsolMint = this.pgs.deriveLiqsolMintPda();
|
|
129
|
+
const userAta = getAssociatedTokenAddressSync(liqsolMint, user, true, TOKEN_2022_PROGRAM_ID);
|
|
130
|
+
const userRecord = this.pgs.deriveUserRecordPda(userAta);
|
|
131
|
+
const distributionState = this.pgs.deriveDistributionStatePda();
|
|
132
|
+
|
|
133
|
+
const global = this.pgs.deriveWithdrawGlobalPda();
|
|
134
|
+
const reservePool = this.pgs.deriveReservePoolPda();
|
|
135
|
+
const stakeAllocationState = this.pgs.deriveStakeAllocationStatePda();
|
|
136
|
+
const stakeMetrics = this.pgs.deriveStakeMetricsPda();
|
|
137
|
+
const maintenanceLedger = this.pgs.deriveMaintenanceLedgerPda();
|
|
138
|
+
const globalConfig = this.pgs.deriveGlobalConfigPda();
|
|
139
|
+
|
|
140
|
+
const globalAcct: GlobalAccount = await this.program.account.global.fetch(global);
|
|
141
|
+
const rawId = globalAcct.nextReceiptId;
|
|
142
|
+
const receiptId = normalizeToBigInt(rawId);
|
|
143
|
+
|
|
144
|
+
const mintAuthority = this.pgs.deriveWithdrawMintAuthorityPda();
|
|
145
|
+
const metadata = this.pgs.deriveWithdrawMintMetadataPda();
|
|
146
|
+
const nftMint = this.pgs.deriveWithdrawNftMintPda(receiptId);
|
|
147
|
+
const receiptData = this.pgs.deriveLiqReceiptDataPda(nftMint);
|
|
148
|
+
const owner = user;
|
|
149
|
+
const nftAta = getAssociatedTokenAddressSync(nftMint, owner, true, TOKEN_2022_PROGRAM_ID);
|
|
150
|
+
|
|
151
|
+
const bucketAuthority = this.pgs.deriveBucketAuthorityPda();
|
|
152
|
+
const bucketTokenAccount = getAssociatedTokenAddressSync(
|
|
153
|
+
liqsolMint,
|
|
154
|
+
bucketAuthority,
|
|
155
|
+
true,
|
|
156
|
+
TOKEN_2022_PROGRAM_ID,
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
return await this.program.methods
|
|
160
|
+
.requestWithdraw(new BN(amount.toString()))
|
|
161
|
+
.accounts({
|
|
162
|
+
user,
|
|
163
|
+
owner,
|
|
164
|
+
global,
|
|
165
|
+
liqsolMint,
|
|
166
|
+
userAta,
|
|
167
|
+
userRecord,
|
|
168
|
+
reservePool,
|
|
169
|
+
stakeAllocationState,
|
|
170
|
+
stakeMetrics,
|
|
171
|
+
maintenanceLedger,
|
|
172
|
+
clock: SYSVAR_CLOCK_PUBKEY,
|
|
173
|
+
mintAuthority,
|
|
174
|
+
receiptData,
|
|
175
|
+
metadata,
|
|
176
|
+
nftMint,
|
|
177
|
+
nftAta,
|
|
178
|
+
distributionState,
|
|
179
|
+
bucketTokenAccount,
|
|
180
|
+
tokenProgram: TOKEN_2022_PROGRAM_ID,
|
|
181
|
+
tokenInterface: TOKEN_2022_PROGRAM_ID,
|
|
182
|
+
associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
183
|
+
systemProgram: SystemProgram.programId,
|
|
184
|
+
rent: SYSVAR_RENT_PUBKEY,
|
|
185
|
+
globalConfig,
|
|
186
|
+
})
|
|
187
|
+
.instruction();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Enumerate withdrawal receipt NFTs owned by `owner`.
|
|
192
|
+
*/
|
|
193
|
+
async fetchWithdrawReceipts(owner: PublicKey): Promise<WithdrawReceipt[]> {
|
|
194
|
+
const globalPda = this.pgs.deriveWithdrawGlobalPda();
|
|
195
|
+
const globalAcct: GlobalAccount = await this.program.account.global.fetch(globalPda);
|
|
196
|
+
const nextId = normalizeToBigInt(globalAcct.nextReceiptId);
|
|
197
|
+
|
|
198
|
+
const mintToId = new Map<string, bigint>();
|
|
199
|
+
for (let i = BigInt(0); i < nextId; i++) {
|
|
200
|
+
const mint = this.pgs.deriveWithdrawNftMintPda(i);
|
|
201
|
+
mintToId.set(mint.toBase58(), i);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const tokenAccounts = await this.connection.getParsedTokenAccountsByOwner(owner, {
|
|
205
|
+
programId: TOKEN_2022_PROGRAM_ID,
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
const receipts: WithdrawReceipt[] = [];
|
|
209
|
+
|
|
210
|
+
for (const { pubkey, account } of tokenAccounts.value) {
|
|
211
|
+
const info: any = account.data?.['parsed']?.info;
|
|
212
|
+
if (!info) continue;
|
|
213
|
+
const amount = info.tokenAmount;
|
|
214
|
+
const decimals = Number(amount?.decimals ?? 0);
|
|
215
|
+
const uiAmount = Number(amount?.uiAmount ?? 0);
|
|
216
|
+
if (decimals !== 0 || uiAmount !== 1) continue;
|
|
217
|
+
|
|
218
|
+
const mintStr: string | undefined = info.mint;
|
|
219
|
+
if (!mintStr) continue;
|
|
220
|
+
const receiptId = mintToId.get(mintStr);
|
|
221
|
+
if (receiptId === undefined) continue;
|
|
222
|
+
|
|
223
|
+
const mintKey = new PublicKey(mintStr);
|
|
224
|
+
const receiptDataPda = this.pgs.deriveLiqReceiptDataPda(mintKey);
|
|
225
|
+
|
|
226
|
+
let receiptData: ReceiptData;
|
|
227
|
+
try {
|
|
228
|
+
const raw = await this.program.account.liqReceiptData.fetch(receiptDataPda);
|
|
229
|
+
receiptData = {
|
|
230
|
+
receiptId: normalizeToBigInt(raw.receiptId),
|
|
231
|
+
liqports: normalizeToBigInt(raw.liqports),
|
|
232
|
+
epoch: normalizeToBigInt(raw.epoch),
|
|
233
|
+
fulfilled: Boolean(raw.fulfilled),
|
|
234
|
+
};
|
|
235
|
+
} catch (err) {
|
|
236
|
+
console.warn(`ConvertClient: failed to fetch receipt data for mint ${mintStr}`, err);
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
const { etaMs, readyAtMs } = await this.estimateEpochEta(receiptData.epoch);
|
|
241
|
+
const status = receiptData.fulfilled ? 'claimed' : etaMs <= 0 ? 'ready' : 'queued';
|
|
242
|
+
|
|
243
|
+
const amountView: BalanceView = {
|
|
244
|
+
amount: receiptData.liqports,
|
|
245
|
+
decimals: 9,
|
|
246
|
+
symbol: 'SOL',
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
receipts.push({
|
|
250
|
+
tokenId: receiptData.receiptId,
|
|
251
|
+
receipt: {
|
|
252
|
+
amount: amountView,
|
|
253
|
+
readyAt: readyAtMs,
|
|
254
|
+
chain: 'SOL',
|
|
255
|
+
epoch: receiptData.epoch,
|
|
256
|
+
status,
|
|
257
|
+
mint: mintKey.toBase58(),
|
|
258
|
+
ownerAta: pubkey.toBase58(),
|
|
259
|
+
},
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return receipts;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Build the claim_withdraw instruction for a given receiptId.
|
|
268
|
+
*/
|
|
269
|
+
async buildClaimWithdrawTx(
|
|
270
|
+
receiptId: bigint,
|
|
271
|
+
user: PublicKey,
|
|
272
|
+
): Promise<TransactionInstruction> {
|
|
273
|
+
const mintAccount = this.pgs.deriveWithdrawNftMintPda(receiptId);
|
|
274
|
+
const receiptData = this.pgs.deriveLiqReceiptDataPda(mintAccount);
|
|
275
|
+
const ownerAta = getAssociatedTokenAddressSync(
|
|
276
|
+
mintAccount,
|
|
277
|
+
user,
|
|
278
|
+
true,
|
|
279
|
+
TOKEN_2022_PROGRAM_ID,
|
|
280
|
+
);
|
|
281
|
+
|
|
282
|
+
const accounts = {
|
|
283
|
+
user,
|
|
284
|
+
global: this.pgs.deriveWithdrawGlobalPda(),
|
|
285
|
+
mintAuthority: this.pgs.deriveWithdrawMintAuthorityPda(),
|
|
286
|
+
receiptData,
|
|
287
|
+
mintAccount,
|
|
288
|
+
ownerAta,
|
|
289
|
+
reservePool: this.pgs.deriveReservePoolPda(),
|
|
290
|
+
vault: this.pgs.deriveVaultPda(),
|
|
291
|
+
clock: SYSVAR_CLOCK_PUBKEY,
|
|
292
|
+
stakeHistory: SYSVAR_STAKE_HISTORY_PUBKEY,
|
|
293
|
+
globalConfig: this.pgs.deriveGlobalConfigPda(),
|
|
294
|
+
tokenProgram: TOKEN_2022_PROGRAM_ID,
|
|
295
|
+
stakeProgram: StakeProgram.programId,
|
|
296
|
+
systemProgram: SystemProgram.programId,
|
|
297
|
+
associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
return this.program.methods.claimWithdraw().accounts(accounts).instruction();
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Estimate ready time for target epoch using recent slot time.
|
|
305
|
+
*/
|
|
306
|
+
private async estimateEpochEta(targetEpoch: bigint): Promise<{ etaMs: number; readyAtMs: number }> {
|
|
307
|
+
const conn = this.connection;
|
|
308
|
+
const epochInfo = await conn.getEpochInfo();
|
|
309
|
+
const schedule = await conn.getEpochSchedule();
|
|
310
|
+
const currentEpoch = BigInt(epochInfo.epoch);
|
|
311
|
+
|
|
312
|
+
if (targetEpoch <= currentEpoch) {
|
|
313
|
+
const now = Date.now();
|
|
314
|
+
return { etaMs: 0, readyAtMs: now };
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
let slotTimeSec = 0.4;
|
|
318
|
+
try {
|
|
319
|
+
const samples = await conn.getRecentPerformanceSamples(60);
|
|
320
|
+
if (samples?.length) {
|
|
321
|
+
const valid = samples.filter(s => s.numSlots > 0);
|
|
322
|
+
if (valid.length) {
|
|
323
|
+
slotTimeSec = valid.reduce((sum, s) => sum + s.samplePeriodSecs / s.numSlots, 0) / valid.length;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
} catch (_) {
|
|
327
|
+
// ignore
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const slotsPerEpoch = BigInt(schedule.slotsPerEpoch);
|
|
331
|
+
const slotsRemainingInCurrent = slotsPerEpoch - BigInt(epochInfo.slotIndex);
|
|
332
|
+
const epochsRemaining = targetEpoch - currentEpoch - BigInt(1);
|
|
333
|
+
const slotsRemaining =
|
|
334
|
+
(epochsRemaining > 0 ? epochsRemaining * slotsPerEpoch : BigInt(0)) +
|
|
335
|
+
slotsRemainingInCurrent;
|
|
336
|
+
|
|
337
|
+
const etaSeconds = Number(slotsRemaining) * slotTimeSec;
|
|
338
|
+
const etaMs = Math.max(0, Math.round(etaSeconds * 1000));
|
|
339
|
+
return { etaMs, readyAtMs: Date.now() + etaMs };
|
|
340
|
+
}
|
|
341
|
+
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { AnchorProvider, Program, BN } from '@coral-xyz/anchor';
|
|
2
|
-
import { PublicKey } from '@solana/web3.js';
|
|
3
|
-
|
|
4
|
-
import { SolanaProgramService } from '../program';
|
|
5
|
-
import type {
|
|
6
|
-
import {
|
|
7
|
-
deriveDistributionStatePda,
|
|
8
|
-
deriveLiqsolMintPda,
|
|
9
|
-
deriveUserRecordPda,
|
|
10
|
-
} from '../constants';
|
|
11
|
-
import type { DistributionState, DistributionUserRecord } from '../types';
|
|
2
|
+
import { PublicKey, SystemProgram, TransactionInstruction } from '@solana/web3.js';
|
|
3
|
+
|
|
4
|
+
import { LiqsolCoreClientIdl, SolanaProgramService } from '../program';
|
|
5
|
+
import type { DistributionState, DistributionUserRecord, GlobalConfig, PayRateEntry, PayRateHistory } from '../types';
|
|
12
6
|
import { getAssociatedTokenAddressSync, TOKEN_2022_PROGRAM_ID } from '@solana/spl-token';
|
|
7
|
+
import { ceilDiv } from '../utils';
|
|
8
|
+
|
|
9
|
+
const INDEX_SCALE_BN = new BN('1000000000000');
|
|
13
10
|
|
|
14
11
|
/**
|
|
15
12
|
* Distribution client – wraps the distribution portion of the liqsol_core
|
|
@@ -30,24 +27,35 @@ import { getAssociatedTokenAddressSync, TOKEN_2022_PROGRAM_ID } from '@solana/sp
|
|
|
30
27
|
* - DistributionState + UserRecord track *shares* for yield.
|
|
31
28
|
*/
|
|
32
29
|
export class DistributionClient {
|
|
33
|
-
private program: Program<
|
|
30
|
+
private program: Program<LiqsolCoreClientIdl>;
|
|
34
31
|
|
|
35
|
-
constructor(
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
constructor(
|
|
33
|
+
private readonly provider: AnchorProvider,
|
|
34
|
+
private readonly pgs: SolanaProgramService
|
|
35
|
+
) {
|
|
36
|
+
this.program = pgs.getProgram('liqsolCore');
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
get connection() {
|
|
41
40
|
return this.provider.connection;
|
|
42
41
|
}
|
|
43
42
|
|
|
43
|
+
private async getTokenBalance(ata: PublicKey): Promise<BN> {
|
|
44
|
+
try {
|
|
45
|
+
const bal = await this.connection.getTokenAccountBalance(ata);
|
|
46
|
+
return new BN(bal.value.amount);
|
|
47
|
+
} catch {
|
|
48
|
+
return new BN(0);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
44
52
|
/**
|
|
45
53
|
* Fetch the global distribution state account.
|
|
46
54
|
*
|
|
47
55
|
* IDL account name: "distributionState"
|
|
48
56
|
*/
|
|
49
57
|
async getDistributionState(): Promise<DistributionState | null> {
|
|
50
|
-
const pda = deriveDistributionStatePda();
|
|
58
|
+
const pda = this.pgs.deriveDistributionStatePda();
|
|
51
59
|
try {
|
|
52
60
|
return await this.program.account.distributionState.fetch(pda);
|
|
53
61
|
} catch {
|
|
@@ -55,6 +63,39 @@ export class DistributionClient {
|
|
|
55
63
|
}
|
|
56
64
|
}
|
|
57
65
|
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Fetch the global payRateHistory account (circular buffer of scaled pay rates).
|
|
69
|
+
*
|
|
70
|
+
* IDL account name: "payRateHistory"
|
|
71
|
+
*/
|
|
72
|
+
async getPayRateHistory(): Promise<PayRateHistory | null> {
|
|
73
|
+
const pda = this.pgs.derivePayRateHistoryPda();
|
|
74
|
+
try {
|
|
75
|
+
// Anchor types map directly onto our PayRateHistory TS type
|
|
76
|
+
return (await this.program.account.payRateHistory.fetch(
|
|
77
|
+
pda,
|
|
78
|
+
)) as PayRateHistory;
|
|
79
|
+
} catch {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Fetch the globalConfig account (contains depositFeeMultiplier, etc).
|
|
86
|
+
*
|
|
87
|
+
* IDL account name: "globalConfig"
|
|
88
|
+
*/
|
|
89
|
+
async getGlobalConfig(): Promise<GlobalConfig | null> {
|
|
90
|
+
const pda = this.pgs.deriveGlobalConfigPda();
|
|
91
|
+
try {
|
|
92
|
+
return (await this.program.account.globalConfig.fetch(
|
|
93
|
+
pda,
|
|
94
|
+
)) as GlobalConfig;
|
|
95
|
+
} catch {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
58
99
|
/**
|
|
59
100
|
* Fetch a user's distribution userRecord (or null if missing).
|
|
60
101
|
*
|
|
@@ -63,17 +104,17 @@ export class DistributionClient {
|
|
|
63
104
|
async getUserRecord(
|
|
64
105
|
ownerOrAta: PublicKey,
|
|
65
106
|
): Promise<DistributionUserRecord | null> {
|
|
66
|
-
const liqsolMint = deriveLiqsolMintPda();
|
|
107
|
+
const liqsolMint = this.pgs.deriveLiqsolMintPda();
|
|
67
108
|
|
|
68
109
|
// 1) Try treating ownerOrAta as a WALLET: derive its liqSOL ATA, then userRecord.
|
|
69
110
|
try {
|
|
70
111
|
const ata = getAssociatedTokenAddressSync(
|
|
71
112
|
liqsolMint,
|
|
72
113
|
ownerOrAta,
|
|
73
|
-
|
|
114
|
+
true,
|
|
74
115
|
TOKEN_2022_PROGRAM_ID,
|
|
75
116
|
);
|
|
76
|
-
const pdaFromWallet = deriveUserRecordPda(ata);
|
|
117
|
+
const pdaFromWallet = this.pgs.deriveUserRecordPda(ata);
|
|
77
118
|
const recFromWallet =
|
|
78
119
|
await this.program.account.userRecord.fetchNullable(pdaFromWallet);
|
|
79
120
|
if (recFromWallet) {
|
|
@@ -85,7 +126,7 @@ export class DistributionClient {
|
|
|
85
126
|
|
|
86
127
|
// 2) Fallback: treat ownerOrAta as already being the TOKEN ACCOUNT.
|
|
87
128
|
try {
|
|
88
|
-
const pdaFromAta = deriveUserRecordPda(ownerOrAta);
|
|
129
|
+
const pdaFromAta = this.pgs.deriveUserRecordPda(ownerOrAta);
|
|
89
130
|
return await this.program.account.userRecord.fetchNullable(pdaFromAta);
|
|
90
131
|
} catch {
|
|
91
132
|
return null;
|
|
@@ -130,4 +171,188 @@ export class DistributionClient {
|
|
|
130
171
|
|
|
131
172
|
return { shares: userShares, totalShares, ratio };
|
|
132
173
|
}
|
|
133
|
-
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Compute claimable liqSOL for a wallet:
|
|
177
|
+
* claimable = max(0, entitled - actual)
|
|
178
|
+
* entitled = floor(shares * syncedIndex / 1e12)
|
|
179
|
+
*
|
|
180
|
+
* `syncedIndex` mirrors on-chain `sync_index` behavior by incorporating any
|
|
181
|
+
* unsynced bucket delta (bucket_balance - last_bucket_balance).
|
|
182
|
+
*/
|
|
183
|
+
async getClaimableLiqsol(user: PublicKey): Promise<BN> {
|
|
184
|
+
const liqsolMint = this.pgs.deriveLiqsolMintPda();
|
|
185
|
+
const bucketAuthority = this.pgs.deriveBucketAuthorityPda();
|
|
186
|
+
|
|
187
|
+
const userAta = getAssociatedTokenAddressSync(
|
|
188
|
+
liqsolMint,
|
|
189
|
+
user,
|
|
190
|
+
true,
|
|
191
|
+
TOKEN_2022_PROGRAM_ID,
|
|
192
|
+
);
|
|
193
|
+
const bucketTokenAccount = getAssociatedTokenAddressSync(
|
|
194
|
+
liqsolMint,
|
|
195
|
+
bucketAuthority,
|
|
196
|
+
true,
|
|
197
|
+
TOKEN_2022_PROGRAM_ID,
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
const [distributionState, userRecord, actualBalance, bucketBalance] = await Promise.all([
|
|
201
|
+
this.getDistributionState(),
|
|
202
|
+
this.getUserRecord(user),
|
|
203
|
+
this.getTokenBalance(userAta),
|
|
204
|
+
this.getTokenBalance(bucketTokenAccount),
|
|
205
|
+
]);
|
|
206
|
+
|
|
207
|
+
if (!distributionState || !userRecord) {
|
|
208
|
+
return new BN(0);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
let syncedIndex = new BN(distributionState.currentIndex.toString());
|
|
212
|
+
const totalShares = new BN(distributionState.totalShares.toString());
|
|
213
|
+
const lastBucketBalance = new BN(distributionState.lastBucketBalance.toString());
|
|
214
|
+
|
|
215
|
+
if (totalShares.gt(new BN(0)) && bucketBalance.gt(lastBucketBalance)) {
|
|
216
|
+
const delta = bucketBalance.sub(lastBucketBalance);
|
|
217
|
+
const indexDelta = delta.mul(INDEX_SCALE_BN).div(totalShares);
|
|
218
|
+
if (indexDelta.gt(new BN(0))) {
|
|
219
|
+
syncedIndex = syncedIndex.add(indexDelta);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const shares = new BN(userRecord.shares.toString());
|
|
224
|
+
const entitled = shares.mul(syncedIndex).div(INDEX_SCALE_BN);
|
|
225
|
+
|
|
226
|
+
if (entitled.lte(actualBalance)) {
|
|
227
|
+
return new BN(0);
|
|
228
|
+
}
|
|
229
|
+
return entitled.sub(actualBalance);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Build claim_rewards instruction for a wallet.
|
|
234
|
+
*/
|
|
235
|
+
async buildClaimRewardsIx(user: PublicKey): Promise<TransactionInstruction> {
|
|
236
|
+
const liqsolMint = this.pgs.deriveLiqsolMintPda();
|
|
237
|
+
const distributionState = this.pgs.deriveDistributionStatePda();
|
|
238
|
+
const bucketAuthority = this.pgs.deriveBucketAuthorityPda();
|
|
239
|
+
|
|
240
|
+
const userAta = getAssociatedTokenAddressSync(
|
|
241
|
+
liqsolMint,
|
|
242
|
+
user,
|
|
243
|
+
true,
|
|
244
|
+
TOKEN_2022_PROGRAM_ID,
|
|
245
|
+
);
|
|
246
|
+
const bucketTokenAccount = getAssociatedTokenAddressSync(
|
|
247
|
+
liqsolMint,
|
|
248
|
+
bucketAuthority,
|
|
249
|
+
true,
|
|
250
|
+
TOKEN_2022_PROGRAM_ID,
|
|
251
|
+
);
|
|
252
|
+
|
|
253
|
+
const userRecord = this.pgs.deriveUserRecordPda(userAta);
|
|
254
|
+
const bucketUserRecord = this.pgs.deriveUserRecordPda(bucketTokenAccount);
|
|
255
|
+
const extraAccountMetaList = this.pgs.deriveExtraAccountMetaListPda(liqsolMint);
|
|
256
|
+
|
|
257
|
+
return this.program.methods
|
|
258
|
+
.claimRewards()
|
|
259
|
+
.accounts({
|
|
260
|
+
user,
|
|
261
|
+
userAta,
|
|
262
|
+
userRecord,
|
|
263
|
+
bucketUserRecord,
|
|
264
|
+
distributionState,
|
|
265
|
+
extraAccountMetaList,
|
|
266
|
+
liqsolCoreProgram: this.pgs.PROGRAM_IDS.LIQSOL_CORE,
|
|
267
|
+
transferHookProgram: this.pgs.PROGRAM_IDS.TRANSFER_HOOK,
|
|
268
|
+
liqsolMint,
|
|
269
|
+
bucketAuthority,
|
|
270
|
+
bucketTokenAccount,
|
|
271
|
+
tokenProgram: TOKEN_2022_PROGRAM_ID,
|
|
272
|
+
systemProgram: SystemProgram.programId
|
|
273
|
+
})
|
|
274
|
+
.instruction();
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Compute an average scaled pay rate over the most recent `windowSize`
|
|
279
|
+
* valid entries in the pay-rate history circular buffer.
|
|
280
|
+
*
|
|
281
|
+
* Returns a BN scaled by 1e12 (same as on-chain).
|
|
282
|
+
*/
|
|
283
|
+
async getAverageScaledPayRate(windowSize = 5): Promise<BN> {
|
|
284
|
+
const history = await this.getPayRateHistory();
|
|
285
|
+
if (!history) {
|
|
286
|
+
return new BN(0);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const entries: PayRateEntry[] = history.entries ?? [];
|
|
290
|
+
if (!entries.length) {
|
|
291
|
+
return new BN(0);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
const maxEntries: number =
|
|
295
|
+
typeof history.maxEntries === 'number'
|
|
296
|
+
? history.maxEntries
|
|
297
|
+
: entries.length;
|
|
298
|
+
|
|
299
|
+
const rawTotalAdded: any = history.totalEntriesAdded ?? 0;
|
|
300
|
+
const totalAddedBn = new BN(rawTotalAdded.toString());
|
|
301
|
+
|
|
302
|
+
// No valid entries written yet
|
|
303
|
+
if (totalAddedBn.isZero()) {
|
|
304
|
+
return new BN(0);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const totalAdded = Math.min(
|
|
308
|
+
totalAddedBn.toNumber(),
|
|
309
|
+
maxEntries,
|
|
310
|
+
entries.length,
|
|
311
|
+
);
|
|
312
|
+
|
|
313
|
+
if (!totalAdded) {
|
|
314
|
+
return new BN(0);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const COUNT = Math.max(1, Math.min(windowSize, totalAdded));
|
|
318
|
+
|
|
319
|
+
const currentIndexNum = Number(history.currentIndex ?? 0);
|
|
320
|
+
|
|
321
|
+
// Most recently written entry is at currentIndex - 1 (mod maxEntries)
|
|
322
|
+
let idx =
|
|
323
|
+
currentIndexNum === 0
|
|
324
|
+
? maxEntries - 1
|
|
325
|
+
: currentIndexNum - 1;
|
|
326
|
+
|
|
327
|
+
let sum = new BN(0);
|
|
328
|
+
let valid = 0;
|
|
329
|
+
const zero = new BN(0);
|
|
330
|
+
|
|
331
|
+
for (let i = 0; i < COUNT; i++) {
|
|
332
|
+
const entry: any = entries[idx];
|
|
333
|
+
if (entry) {
|
|
334
|
+
// Support both camelCase and snake_case (for safety)
|
|
335
|
+
const rawScaled =
|
|
336
|
+
entry.scaledRate ??
|
|
337
|
+
entry.scaled_rate ??
|
|
338
|
+
0;
|
|
339
|
+
|
|
340
|
+
const rate = new BN(rawScaled.toString());
|
|
341
|
+
if (rate.gt(zero)) {
|
|
342
|
+
sum = sum.add(rate);
|
|
343
|
+
valid += 1;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// Walk backwards through the circular buffer
|
|
348
|
+
idx = idx === 0 ? maxEntries - 1 : idx - 1;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
if (!valid) {
|
|
352
|
+
return new BN(0);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// Same behavior as the dashboard: use a ceiling-like average
|
|
356
|
+
return ceilDiv(sum, new BN(valid));
|
|
357
|
+
}
|
|
358
|
+
}
|