@wireio/stake 1.0.1 → 1.0.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 +195 -243
- package/lib/stake.browser.js +48207 -10167
- package/lib/stake.browser.js.map +1 -1
- package/lib/stake.d.ts +11368 -978
- package/lib/stake.js +46986 -8773
- package/lib/stake.js.map +1 -1
- package/lib/stake.m.js +48207 -10167
- package/lib/stake.m.js.map +1 -1
- package/package.json +4 -3
- package/src/assets/ethereum/hoodi/WNS/BucketWNS.sol/BucketWNS.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/WNS/BucketWNS.sol/BucketWNS.json +699 -0
- package/src/assets/ethereum/hoodi/WNS/Challenge.sol/Challenge.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/WNS/Challenge.sol/Challenge.json +3139 -0
- package/src/assets/ethereum/hoodi/WNS/ChallengeLib.sol/ChallengeLib.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/WNS/ChallengeLib.sol/ChallengeLib.json +106 -0
- package/src/assets/ethereum/hoodi/WNS/Errors.sol/WNSErrs.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/WNS/Errors.sol/WNSErrs.json +180 -0
- package/src/assets/ethereum/hoodi/WNS/LiqWNS.sol/LiqWNS.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/WNS/LiqWNS.sol/LiqWNS.json +470 -0
- package/src/assets/ethereum/hoodi/WNS/SChain.sol/SChain.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/WNS/SChain.sol/SChain.json +1983 -0
- package/src/assets/ethereum/hoodi/WNS/UTXO.sol/UTXO.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/WNS/UTXO.sol/UTXO.json +1231 -0
- package/src/assets/ethereum/hoodi/WNS/UTXOio.sol/UTXOio.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/WNS/UTXOio.sol/UTXOio.json +1524 -0
- package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/IBucketWNS.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/IBucketWNS.json +119 -0
- package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/IChallenge.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/IChallenge.json +374 -0
- package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/ISChain.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/ISChain.json +865 -0
- package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/IUTXO.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/IUTXO.json +524 -0
- package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/WNSCommon.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/WNSCommon.json +10 -0
- package/src/assets/ethereum/hoodi/WNS/WithdrawBatch.sol/WithdrawBatch.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/WNS/WithdrawBatch.sol/WithdrawBatch.json +1232 -0
- package/src/assets/ethereum/hoodi/common/Base58.sol/Base58.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/RestrictedCallers.sol/RestrictedCallers.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/iodata.sol/iodata.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/iodata_util.sol/iodata_util.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_data.sol/sysio_data.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_errors.sol/sysio_errors.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_merkle.sol/sysio_merkle.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_name.sol/sysio_name.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_pubkey.sol/sysio_pubkey.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_read.sol/sysio_read.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_tester.sol/SysioTester.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_verify.sol/sysio_verify.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/common/sysio_write.sol/sysio_write.dbg.json +4 -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/{ABI/liqEth → hoodi/liqEth/v1}/DepositManager.sol/DepositManager.json +3 -3
- 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/{ABI/liqEth → hoodi/liqEth/v1}/liqEth.sol/LiqEthToken.json +3 -3
- 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/{ABI → hoodi}/liqEth/withdrawalVault.sol/WithdrawalVault.json +2 -2
- 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 +1590 -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/BridgeWithdrawFailedCodec.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeWithdrawFailedCodec.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/IDepositorBridgeHooks.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/LiqEthBridge.sol/IDepositorBridgeHooks.json +29 -0
- package/src/assets/ethereum/hoodi/outpost/LiqEthBridge.sol/LiqEthBridge.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/outpost/LiqEthBridge.sol/LiqEthBridge.json +1033 -0
- package/src/assets/ethereum/hoodi/outpost/MockAggregator.sol/MockAggregator.json +97 -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/ERC20Token.sol/ERC20Token.dbg.json +4 -0
- package/src/assets/ethereum/hoodi/token/ERC721Token.sol/ERC721Token.dbg.json +4 -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/{ABI/liqEth → mainnet/liqEth/v1}/accounting.sol/Accounting.json +3 -3
- 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/{ABI/liqEth → mainnet/liqEth/v1}/stakingModule.sol/StakingModule.json +3 -3
- 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 +33 -2
- 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 -2
- 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 -2
- 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 -3
- 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 -3
- package/src/assets/ethereum/mainnet/outpost/v1/Pretoken.sol/Pretoken.dbg.json +4 -0
- package/src/assets/ethereum/{ABI/outpost → mainnet/outpost/v1}/Pretoken.sol/Pretoken.json +34 -3
- 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 +34 -0
- package/src/assets/solana/devnet/idl/transfer_hook.json +490 -0
- package/src/assets/solana/devnet/idl/validator_leaderboard.json +735 -0
- package/src/assets/solana/devnet/types/liqsol_core.ts +8572 -0
- package/src/assets/solana/{types → devnet/types}/liqsol_token.ts +34 -0
- package/src/assets/solana/devnet/types/transfer_hook.ts +496 -0
- package/src/assets/solana/devnet/types/validator_leaderboard.ts +741 -0
- package/src/assets/solana/{idl → mainnet/idl}/liqsol_core.json +542 -30
- 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/{types → mainnet/types}/liqsol_core.ts +542 -30
- 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/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 +4 -2
- package/src/networks/ethereum/clients/convert.client.ts +35 -1
- package/src/networks/ethereum/clients/instaswap.client.ts +432 -0
- package/src/networks/ethereum/clients/opp.client.ts +20 -21
- package/src/networks/ethereum/clients/receipt.client.ts +93 -23
- package/src/networks/ethereum/clients/stake.client.ts +192 -20
- package/src/networks/ethereum/clients/validator.client.ts +61 -0
- package/src/networks/ethereum/contract.ts +423 -239
- package/src/networks/ethereum/ethereum.ts +379 -165
- package/src/networks/ethereum/types.ts +40 -11
- package/src/networks/solana/clients/convert.client.ts +377 -0
- package/src/networks/solana/clients/distribution.client.ts +141 -29
- package/src/networks/solana/clients/instaswap.client.ts +474 -0
- package/src/networks/solana/clients/leaderboard.client.ts +10 -13
- package/src/networks/solana/clients/outpost.client.ts +120 -80
- package/src/networks/solana/clients/token.client.ts +33 -22
- package/src/networks/solana/constants.ts +58 -285
- package/src/networks/solana/program.ts +467 -29
- package/src/networks/solana/solana.ts +523 -222
- package/src/networks/solana/types.ts +41 -15
- package/src/networks/solana/utils.ts +74 -306
- package/src/staker.ts +23 -2
- package/src/types.ts +82 -11
- package/src/assets/ethereum/ABI/common/Base58.sol/Base58.dbg.json +0 -4
- package/src/assets/ethereum/ABI/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.dbg.json +0 -4
- package/src/assets/ethereum/ABI/common/RestrictedCallers.sol/RestrictedCallers.dbg.json +0 -4
- package/src/assets/ethereum/ABI/common/iodata.sol/iodata.dbg.json +0 -4
- package/src/assets/ethereum/ABI/common/iodata_util.sol/iodata_util.dbg.json +0 -4
- package/src/assets/ethereum/ABI/common/sysio_data.sol/sysio_data.dbg.json +0 -4
- package/src/assets/ethereum/ABI/common/sysio_errors.sol/sysio_errors.dbg.json +0 -4
- package/src/assets/ethereum/ABI/common/sysio_merkle.sol/sysio_merkle.dbg.json +0 -4
- package/src/assets/ethereum/ABI/common/sysio_name.sol/sysio_name.dbg.json +0 -4
- package/src/assets/ethereum/ABI/common/sysio_pubkey.sol/sysio_pubkey.dbg.json +0 -4
- package/src/assets/ethereum/ABI/common/sysio_read.sol/sysio_read.dbg.json +0 -4
- package/src/assets/ethereum/ABI/common/sysio_tester.sol/SysioTester.dbg.json +0 -4
- package/src/assets/ethereum/ABI/common/sysio_verify.sol/sysio_verify.dbg.json +0 -4
- package/src/assets/ethereum/ABI/common/sysio_write.sol/sysio_write.dbg.json +0 -4
- 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/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/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/liqEth.sol/LiqEthToken.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.dbg.json +0 -4
- 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/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 -1622
- 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/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/ERC20Token.sol/ERC20Token.dbg.json +0 -4
- package/src/assets/ethereum/ABI/token/ERC721Token.sol/ERC721Token.dbg.json +0 -4
- package/src/assets/solana/idl/transfer_hook.json +0 -197
- package/src/assets/solana/types/transfer_hook.ts +0 -203
- package/src/networks/solana/clients/deposit.client.ts +0 -292
- /package/src/assets/ethereum/{ABI → hoodi}/common/Base58.sol/Base58.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/common/RestrictedCallers.sol/RestrictedCallers.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/common/iodata.sol/iodata.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/common/iodata_util.sol/iodata_util.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_data.sol/sysio_data.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_errors.sol/sysio_errors.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_merkle.sol/sysio_merkle.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_name.sol/sysio_name.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_pubkey.sol/sysio_pubkey.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_read.sol/sysio_read.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_tester.sol/SysioTester.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_verify.sol/sysio_verify.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_write.sol/sysio_write.json +0 -0
- /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 → hoodi}/token/ERC1155Token.sol/ERC1155Token.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/token/ERC20Token.sol/ERC20Token.json +0 -0
- /package/src/assets/ethereum/{ABI → hoodi}/token/ERC721Token.sol/ERC721Token.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
- /package/src/assets/solana/{idl → mainnet/idl}/validator_leaderboard.json +0 -0
- /package/src/assets/solana/{types → mainnet/types}/validator_leaderboard.ts +0 -0
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AddressLookupTableAccount,
|
|
2
3
|
Commitment,
|
|
3
4
|
ComputeBudgetProgram,
|
|
4
5
|
Connection,
|
|
5
6
|
ConnectionConfig,
|
|
6
7
|
PerfSample,
|
|
8
|
+
SendTransactionError,
|
|
7
9
|
PublicKey as SolPubKey,
|
|
8
10
|
SystemProgram,
|
|
9
11
|
Transaction,
|
|
12
|
+
TransactionInstruction,
|
|
13
|
+
TransactionMessage,
|
|
10
14
|
TransactionSignature,
|
|
15
|
+
VersionedTransaction,
|
|
11
16
|
} from '@solana/web3.js';
|
|
12
17
|
import { AnchorProvider, BN } from '@coral-xyz/anchor';
|
|
13
18
|
import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
|
|
14
19
|
import {
|
|
15
20
|
ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
21
|
+
createAssociatedTokenAccountInstruction,
|
|
16
22
|
getAssociatedTokenAddressSync,
|
|
17
23
|
TOKEN_2022_PROGRAM_ID,
|
|
18
24
|
} from '@solana/spl-token';
|
|
19
25
|
|
|
26
|
+
import * as multisig from "@sqds/multisig";
|
|
27
|
+
|
|
20
28
|
import {
|
|
29
|
+
Base58,
|
|
21
30
|
ChainID,
|
|
22
31
|
ExternalNetwork,
|
|
23
32
|
KeyType,
|
|
@@ -28,28 +37,29 @@ import {
|
|
|
28
37
|
import {
|
|
29
38
|
IStakingClient,
|
|
30
39
|
Portfolio,
|
|
40
|
+
SquadsXConfig,
|
|
31
41
|
StakerConfig,
|
|
32
42
|
TrancheSnapshot,
|
|
33
43
|
} from '../../types';
|
|
34
44
|
|
|
35
|
-
import {
|
|
45
|
+
import { ConvertClient } from './clients/convert.client';
|
|
36
46
|
import { DistributionClient } from './clients/distribution.client';
|
|
47
|
+
import { SolanaInstaswapClient } from './clients/instaswap.client';
|
|
37
48
|
import { LeaderboardClient } from './clients/leaderboard.client';
|
|
38
49
|
import { OutpostClient } from './clients/outpost.client';
|
|
39
50
|
import { TokenClient } from './clients/token.client';
|
|
40
51
|
|
|
41
52
|
import {
|
|
42
|
-
|
|
43
|
-
deriveReservePoolPda,
|
|
44
|
-
deriveStakeMetricsPda,
|
|
45
|
-
deriveVaultPda,
|
|
53
|
+
DEFAULT_AVERAGE_PAY_RATE,
|
|
46
54
|
INDEX_SCALE,
|
|
47
55
|
PAY_RATE_SCALE_FACTOR,
|
|
48
56
|
} from './constants';
|
|
49
57
|
|
|
50
58
|
import { buildSolanaTrancheSnapshot, ceilDiv } from './utils';
|
|
51
59
|
import { GlobalConfig, PayRateEntry, SolanaTransaction } from './types';
|
|
60
|
+
import { WithdrawReceipt } from '../../types';
|
|
52
61
|
import { SolanaProgramService } from './program';
|
|
62
|
+
import bs58 from 'bs58';
|
|
53
63
|
|
|
54
64
|
const commitment: Commitment = 'confirmed';
|
|
55
65
|
|
|
@@ -71,13 +81,17 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
71
81
|
public connection: Connection;
|
|
72
82
|
public anchor: AnchorProvider;
|
|
73
83
|
|
|
74
|
-
public
|
|
84
|
+
public convertClient: ConvertClient;
|
|
75
85
|
public distributionClient: DistributionClient;
|
|
86
|
+
public instaswapClient: SolanaInstaswapClient;
|
|
76
87
|
public leaderboardClient: LeaderboardClient;
|
|
77
88
|
public outpostClient: OutpostClient;
|
|
78
89
|
public tokenClient: TokenClient;
|
|
79
90
|
public program: SolanaProgramService
|
|
80
91
|
|
|
92
|
+
private smartAccount?: SolPubKey; // PDA (off-curve)
|
|
93
|
+
private signer?: SolPubKey; // on-curve signer
|
|
94
|
+
|
|
81
95
|
get solPubKey(): SolPubKey {
|
|
82
96
|
if (!this.pubKey) throw new Error('pubKey is undefined');
|
|
83
97
|
return new SolPubKey(this.pubKey.data.array);
|
|
@@ -87,6 +101,18 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
87
101
|
return this.config.network;
|
|
88
102
|
}
|
|
89
103
|
|
|
104
|
+
get feePayer(): SolPubKey {
|
|
105
|
+
if (this.signer) return this.signer;
|
|
106
|
+
// fallback for normal wallets
|
|
107
|
+
if (this.anchor.wallet.publicKey) return this.anchor.wallet.publicKey;
|
|
108
|
+
throw new Error('No signing authority available');
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
get squadsX(): SquadsXConfig | null {
|
|
112
|
+
const config = this.config.extras?.squadsX;
|
|
113
|
+
return config ?? null;
|
|
114
|
+
}
|
|
115
|
+
|
|
90
116
|
constructor(private config: StakerConfig) {
|
|
91
117
|
const adapter = config.provider as BaseSignerWalletAdapter | undefined;
|
|
92
118
|
|
|
@@ -185,12 +211,18 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
185
211
|
commitment,
|
|
186
212
|
});
|
|
187
213
|
|
|
188
|
-
this.
|
|
189
|
-
|
|
190
|
-
this.
|
|
191
|
-
this.
|
|
192
|
-
this.
|
|
193
|
-
|
|
214
|
+
this.program = new SolanaProgramService(this.anchor, config.network.chainId as SolChainID);
|
|
215
|
+
|
|
216
|
+
this.convertClient = new ConvertClient(this.anchor, this.program);
|
|
217
|
+
this.distributionClient = new DistributionClient(this.anchor, this.program);
|
|
218
|
+
this.instaswapClient = new SolanaInstaswapClient(
|
|
219
|
+
this.anchor,
|
|
220
|
+
this.program,
|
|
221
|
+
this.buildAndSendIx.bind(this),
|
|
222
|
+
);
|
|
223
|
+
this.leaderboardClient = new LeaderboardClient(this.anchor, this.program);
|
|
224
|
+
this.outpostClient = new OutpostClient(this.anchor, this.program);
|
|
225
|
+
this.tokenClient = new TokenClient(this.anchor, this.program);
|
|
194
226
|
}
|
|
195
227
|
|
|
196
228
|
// ---------------------------------------------------------------------
|
|
@@ -203,25 +235,35 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
203
235
|
*/
|
|
204
236
|
async deposit(amountLamports: bigint): Promise<string> {
|
|
205
237
|
this.ensureUser();
|
|
206
|
-
if (amountLamports <= BigInt(0))
|
|
238
|
+
if (amountLamports <= BigInt(0))
|
|
207
239
|
throw new Error('Deposit amount must be greater than zero.');
|
|
208
|
-
}
|
|
209
240
|
|
|
210
241
|
try {
|
|
211
|
-
|
|
212
|
-
const
|
|
242
|
+
const user = this.squadsVaultPDA ?? this.anchor.wallet.publicKey;
|
|
243
|
+
const submit = async (ix: TransactionInstruction | TransactionInstruction[]) => (
|
|
244
|
+
!!this.squadsX
|
|
245
|
+
? await this.sendSquadsIxs(ix)
|
|
246
|
+
: await this.buildAndSendIx(ix)
|
|
247
|
+
);
|
|
213
248
|
|
|
214
|
-
|
|
215
|
-
|
|
249
|
+
try {
|
|
250
|
+
const ix = await this.convertClient.buildDepositTx(amountLamports, user);
|
|
251
|
+
return await submit(ix);
|
|
252
|
+
} catch (err) {
|
|
253
|
+
if (!this.isLegacyUserRecordMigrationRequired(err)) {
|
|
254
|
+
throw err;
|
|
255
|
+
}
|
|
216
256
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
257
|
+
const registerIx = await this.convertClient.buildRegisterUserIx(user);
|
|
258
|
+
await submit(registerIx);
|
|
259
|
+
|
|
260
|
+
const retryIx = await this.convertClient.buildDepositTx(amountLamports, user);
|
|
261
|
+
return await submit(retryIx);
|
|
262
|
+
}
|
|
221
263
|
|
|
222
|
-
return this.sendAndConfirmHttp(signed, prepared);
|
|
223
264
|
} catch (err) {
|
|
224
|
-
|
|
265
|
+
console.log(`Failed to deposit Solana: ${err}`);
|
|
266
|
+
throw err;
|
|
225
267
|
}
|
|
226
268
|
}
|
|
227
269
|
|
|
@@ -237,55 +279,89 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
237
279
|
*/
|
|
238
280
|
async withdraw(amountLamports: bigint): Promise<string> {
|
|
239
281
|
this.ensureUser();
|
|
240
|
-
if (amountLamports <= BigInt(0))
|
|
282
|
+
if (amountLamports <= BigInt(0))
|
|
241
283
|
throw new Error('Withdraw amount must be greater than zero.');
|
|
242
|
-
}
|
|
243
284
|
|
|
244
285
|
try {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
const ix = await this.depositClient.buildWithdrawTx(amountLamports);
|
|
250
|
-
|
|
251
|
-
// Wrap in a transaction and send
|
|
252
|
-
const tx = new Transaction().add(cuIx, ix);
|
|
253
|
-
const prepared = await this.prepareTx(tx);
|
|
254
|
-
const signed = await this.signTransaction(prepared.tx);
|
|
286
|
+
const ix = await this.convertClient.buildWithdrawTx(amountLamports, this.squadsVaultPDA)
|
|
287
|
+
return !!this.squadsX
|
|
288
|
+
? await this.sendSquadsIxs(ix)
|
|
289
|
+
: await this.buildAndSendIx(ix)
|
|
255
290
|
|
|
256
|
-
return this.sendAndConfirmHttp(signed, prepared);
|
|
257
291
|
} catch (err) {
|
|
258
|
-
|
|
292
|
+
console.log(`Failed to withdraw Solana: ${err}`);
|
|
293
|
+
throw err;
|
|
259
294
|
}
|
|
260
295
|
}
|
|
261
296
|
|
|
262
297
|
/**
|
|
263
|
-
*
|
|
298
|
+
* Enumerate withdrawal receipt NFTs held by the user (queued/ready/claimed).
|
|
299
|
+
* Mirrors the ETH getPendingWithdraws helper for UI parity.
|
|
264
300
|
*/
|
|
265
|
-
async
|
|
301
|
+
async getPendingWithdraws(address?: string): Promise<WithdrawReceipt[]> {
|
|
266
302
|
this.ensureUser();
|
|
303
|
+
const owner = address ? new SolPubKey(address) :
|
|
304
|
+
this.squadsVaultPDA ?? this.anchor.wallet.publicKey;
|
|
305
|
+
return await this.convertClient.fetchWithdrawReceipts(owner);
|
|
306
|
+
}
|
|
267
307
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
308
|
+
/**
|
|
309
|
+
* Claim a withdrawal receipt (burn NFT + receive SOL) via claim_withdraw.
|
|
310
|
+
*/
|
|
311
|
+
async claimWithdraw(tokenId: bigint): Promise<string> {
|
|
312
|
+
this.ensureUser();
|
|
313
|
+
const owner = this.squadsVaultPDA ?? this.anchor.wallet.publicKey;
|
|
271
314
|
|
|
272
315
|
try {
|
|
273
|
-
const
|
|
316
|
+
const ix = await this.convertClient.buildClaimWithdrawTx(tokenId, owner);
|
|
317
|
+
return !!this.squadsX
|
|
318
|
+
? await this.sendSquadsIxs(ix)
|
|
319
|
+
: await this.buildAndSendIx(ix);
|
|
320
|
+
} catch (err) {
|
|
321
|
+
console.log(`Failed to claim withdraw on Solana: ${err}`);
|
|
322
|
+
throw err;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
274
325
|
|
|
275
|
-
|
|
276
|
-
|
|
326
|
+
/**
|
|
327
|
+
* Claim accrued liqSOL distribution rewards (liqsol_core::claim_rewards).
|
|
328
|
+
*/
|
|
329
|
+
async claimLiqsolRewards(): Promise<string> {
|
|
330
|
+
this.ensureUser();
|
|
331
|
+
const owner = this.squadsVaultPDA ?? this.anchor.wallet.publicKey;
|
|
277
332
|
|
|
278
|
-
|
|
279
|
-
const ix = await this.
|
|
333
|
+
try {
|
|
334
|
+
const ix = await this.distributionClient.buildClaimRewardsIx(owner);
|
|
335
|
+
return !!this.squadsX
|
|
336
|
+
? await this.sendSquadsIxs(ix)
|
|
337
|
+
: await this.buildAndSendIx(ix);
|
|
338
|
+
} catch (err) {
|
|
339
|
+
console.log(`Failed to claim liqSOL rewards on Solana: ${err}`);
|
|
340
|
+
throw err;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
280
343
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
344
|
+
/**
|
|
345
|
+
* Stake liqSOL into Outpost (liqSOL → pool) via liqsol_core::synd.
|
|
346
|
+
*/
|
|
347
|
+
async stake(amountLamports: bigint, wireAccount?: string): Promise<string> {
|
|
348
|
+
this.ensureUser();
|
|
349
|
+
if (!amountLamports || amountLamports <= BigInt(0))
|
|
350
|
+
throw new Error('Stake amount must be greater than zero.');
|
|
351
|
+
|
|
352
|
+
try {
|
|
353
|
+
const ix = await this.outpostClient.buildStakeIx(
|
|
354
|
+
amountLamports,
|
|
355
|
+
this.squadsVaultPDA,
|
|
356
|
+
wireAccount,
|
|
357
|
+
)
|
|
358
|
+
return !!this.squadsX
|
|
359
|
+
? await this.sendSquadsIxs(ix)
|
|
360
|
+
: await this.buildAndSendIx(ix)
|
|
285
361
|
|
|
286
|
-
return this.sendAndConfirmHttp(signed, prepared);
|
|
287
362
|
} catch (err) {
|
|
288
|
-
|
|
363
|
+
console.log(`Failed to stake Solana: ${err}`);
|
|
364
|
+
throw err;
|
|
289
365
|
}
|
|
290
366
|
}
|
|
291
367
|
|
|
@@ -294,29 +370,18 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
294
370
|
*/
|
|
295
371
|
async unstake(amountLamports: bigint): Promise<string> {
|
|
296
372
|
this.ensureUser();
|
|
297
|
-
|
|
298
|
-
if (!amountLamports || amountLamports <= BigInt(0)) {
|
|
373
|
+
if (!amountLamports || amountLamports <= BigInt(0))
|
|
299
374
|
throw new Error('Unstake amount must be greater than zero.');
|
|
300
|
-
}
|
|
301
375
|
|
|
302
376
|
try {
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
// Build the Outpost desynd instruction
|
|
309
|
-
const ix = await this.outpostClient.buildUnstakeIx(amountLamports, user);
|
|
310
|
-
|
|
311
|
-
// Wrap in a transaction and send
|
|
312
|
-
const tx = new Transaction().add(cuIx, ix);
|
|
313
|
-
const prepared = await this.prepareTx(tx);
|
|
314
|
-
const signed = await this.signTransaction(prepared.tx);
|
|
315
|
-
|
|
316
|
-
return this.sendAndConfirmHttp(signed, prepared);
|
|
377
|
+
const ix = await this.outpostClient.buildUnstakeIx(amountLamports, this.squadsVaultPDA)
|
|
378
|
+
return !!this.squadsX
|
|
379
|
+
? await this.sendSquadsIxs(ix)
|
|
380
|
+
: await this.buildAndSendIx(ix)
|
|
317
381
|
}
|
|
318
382
|
catch (err) {
|
|
319
|
-
|
|
383
|
+
console.log(`Failed to unstake Solana: ${err}`);
|
|
384
|
+
throw err;
|
|
320
385
|
}
|
|
321
386
|
}
|
|
322
387
|
|
|
@@ -328,23 +393,82 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
328
393
|
*/
|
|
329
394
|
async buy(amountLamports: bigint): Promise<string> {
|
|
330
395
|
this.ensureUser();
|
|
331
|
-
if (!amountLamports || amountLamports <= BigInt(0))
|
|
396
|
+
if (!amountLamports || amountLamports <= BigInt(0))
|
|
332
397
|
throw new Error('liqSOL pretoken purchase requires a positive amount.');
|
|
398
|
+
|
|
399
|
+
try {
|
|
400
|
+
const ix = await this.tokenClient.buildPurchaseIx(amountLamports, this.squadsVaultPDA)
|
|
401
|
+
return !!this.squadsX
|
|
402
|
+
? await this.sendSquadsIxs(ix)
|
|
403
|
+
: await this.buildAndSendIx(ix)
|
|
404
|
+
}
|
|
405
|
+
catch (err) {
|
|
406
|
+
console.log(`Failed to buy liqSOL pretokens: ${err}`);
|
|
407
|
+
throw err;
|
|
333
408
|
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/** Deposit SOL to liqSOL, then syndicate that liqSOL in one transaction. Requires enough SOL for the deposit fee. */
|
|
412
|
+
async depositAndStake(amountLamports: bigint, wireAccount?: string): Promise<string> {
|
|
413
|
+
this.ensureUser();
|
|
414
|
+
if (!amountLamports || amountLamports <= BigInt(0))
|
|
415
|
+
throw new Error('Amount must be greater than zero.');
|
|
334
416
|
|
|
335
417
|
try {
|
|
336
|
-
const user = this.
|
|
337
|
-
const
|
|
338
|
-
const
|
|
418
|
+
const user = this.squadsVaultPDA ?? this.anchor.wallet.publicKey;
|
|
419
|
+
const depositIx = await this.convertClient.buildDepositTx(amountLamports, user);
|
|
420
|
+
const stakeIx = await this.outpostClient.buildStakeIx(
|
|
421
|
+
amountLamports,
|
|
422
|
+
user,
|
|
423
|
+
wireAccount,
|
|
424
|
+
);
|
|
339
425
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
426
|
+
return !!this.squadsX
|
|
427
|
+
? await this.sendSquadsIxs([depositIx, stakeIx])
|
|
428
|
+
: await this.buildAndSendIx([depositIx, stakeIx]);
|
|
429
|
+
} catch (err) {
|
|
430
|
+
console.log(`Failed to deposit and stake: ${err}`);
|
|
431
|
+
throw err;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
343
434
|
|
|
344
|
-
|
|
435
|
+
/** Deposit SOL to liqSOL, then buy pretokens with that liqSOL in one transaction. Requires enough SOL for the deposit fee. */
|
|
436
|
+
async depositAndBuy(amountLamports: bigint): Promise<string> {
|
|
437
|
+
this.ensureUser();
|
|
438
|
+
if (!amountLamports || amountLamports <= BigInt(0))
|
|
439
|
+
throw new Error('Amount must be greater than zero.');
|
|
440
|
+
|
|
441
|
+
try {
|
|
442
|
+
const user = this.squadsVaultPDA ?? this.anchor.wallet.publicKey;
|
|
443
|
+
const depositIx = await this.convertClient.buildDepositTx(amountLamports, user);
|
|
444
|
+
const purchaseIx = await this.tokenClient.buildPurchaseIx(amountLamports, user);
|
|
445
|
+
|
|
446
|
+
return !!this.squadsX
|
|
447
|
+
? await this.sendSquadsIxs([depositIx, purchaseIx])
|
|
448
|
+
: await this.buildAndSendIx([depositIx, purchaseIx]);
|
|
449
|
+
} catch (err) {
|
|
450
|
+
console.log(`Failed to deposit and buy: ${err}`);
|
|
451
|
+
throw err;
|
|
345
452
|
}
|
|
346
|
-
|
|
347
|
-
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/** Desyndicate liqSOL, then request withdraw in one transaction. */
|
|
456
|
+
async unstakeAndWithdraw(amountLamports: bigint): Promise<string> {
|
|
457
|
+
this.ensureUser();
|
|
458
|
+
if (!amountLamports || amountLamports <= BigInt(0))
|
|
459
|
+
throw new Error('Amount must be greater than zero.');
|
|
460
|
+
|
|
461
|
+
try {
|
|
462
|
+
const user = this.squadsVaultPDA ?? this.anchor.wallet.publicKey;
|
|
463
|
+
const unstakeIx = await this.outpostClient.buildUnstakeIx(amountLamports, user);
|
|
464
|
+
const withdrawIx = await this.convertClient.buildWithdrawTx(amountLamports, user);
|
|
465
|
+
|
|
466
|
+
return !!this.squadsX
|
|
467
|
+
? await this.sendSquadsIxs([unstakeIx, withdrawIx])
|
|
468
|
+
: await this.buildAndSendIx([unstakeIx, withdrawIx]);
|
|
469
|
+
} catch (err) {
|
|
470
|
+
console.log(`Failed to unstake and withdraw: ${err}`);
|
|
471
|
+
throw err;
|
|
348
472
|
}
|
|
349
473
|
}
|
|
350
474
|
|
|
@@ -357,20 +481,20 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
357
481
|
* - yield: on-chain index/shares plus an estimated accrued liqSOL yield
|
|
358
482
|
* - extras: useful internal addresses and raw state for debugging/UX
|
|
359
483
|
*/
|
|
360
|
-
async getPortfolio(): Promise<Portfolio> {
|
|
361
|
-
if (!this.pubKey) throw new Error('User pubKey is undefined');
|
|
362
|
-
|
|
484
|
+
async getPortfolio(address?: string): Promise<Portfolio> {
|
|
485
|
+
// if (!this.pubKey) throw new Error('User pubKey is undefined');
|
|
363
486
|
try {
|
|
364
|
-
const user =
|
|
487
|
+
const user = address ? new SolPubKey(address) :
|
|
488
|
+
!!this.squadsX ? this.squadsVaultPDA! : this.solPubKey;
|
|
365
489
|
|
|
366
|
-
const reservePoolPDA = deriveReservePoolPda();
|
|
367
|
-
const vaultPDA = deriveVaultPda();
|
|
368
|
-
const liqsolMint = deriveLiqsolMintPda();
|
|
490
|
+
const reservePoolPDA = this.program.deriveReservePoolPda();
|
|
491
|
+
const vaultPDA = this.program.deriveVaultPda();
|
|
492
|
+
const liqsolMint = this.program.deriveLiqsolMintPda();
|
|
369
493
|
|
|
370
494
|
const userLiqsolAta = getAssociatedTokenAddressSync(
|
|
371
495
|
liqsolMint,
|
|
372
496
|
user,
|
|
373
|
-
|
|
497
|
+
true,
|
|
374
498
|
TOKEN_2022_PROGRAM_ID,
|
|
375
499
|
ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
376
500
|
);
|
|
@@ -379,12 +503,13 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
379
503
|
// - nativeLamports: wallet SOL
|
|
380
504
|
// - actualBalResp: liqSOL balance in user ATA
|
|
381
505
|
// - snapshot: Outpost + pretokens + global index/shares
|
|
382
|
-
const [nativeLamports, actualBalResp, snapshot] = await Promise.all([
|
|
506
|
+
const [nativeLamports, actualBalResp, snapshot, claimableLamports] = await Promise.all([
|
|
383
507
|
this.connection.getBalance(user, 'confirmed'),
|
|
384
508
|
this.connection
|
|
385
509
|
.getTokenAccountBalance(userLiqsolAta, 'confirmed')
|
|
386
510
|
.catch(() => null),
|
|
387
511
|
this.outpostClient.fetchWireState(user).catch(() => null),
|
|
512
|
+
this.distributionClient.getClaimableLiqsol(user).catch(() => new BN(0)),
|
|
388
513
|
]);
|
|
389
514
|
|
|
390
515
|
const LIQSOL_DECIMALS = 9;
|
|
@@ -460,6 +585,12 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
460
585
|
decimals: LIQSOL_DECIMALS,
|
|
461
586
|
ata: userLiqsolAta,
|
|
462
587
|
},
|
|
588
|
+
claimable: {
|
|
589
|
+
amount: BigInt(claimableLamports.toString()),
|
|
590
|
+
symbol: 'LiqSOL',
|
|
591
|
+
decimals: LIQSOL_DECIMALS,
|
|
592
|
+
ata: userLiqsolAta,
|
|
593
|
+
},
|
|
463
594
|
staked: {
|
|
464
595
|
// liqSOL staked in Outpost via `synd`
|
|
465
596
|
amount: stakedLiqsol,
|
|
@@ -497,7 +628,8 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
497
628
|
};
|
|
498
629
|
}
|
|
499
630
|
catch (err) {
|
|
500
|
-
|
|
631
|
+
console.log(`Failed to get Solana portfolio: ${err}`);
|
|
632
|
+
throw err;
|
|
501
633
|
}
|
|
502
634
|
}
|
|
503
635
|
|
|
@@ -510,6 +642,260 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
510
642
|
return this.distributionClient.getUserRecord(this.solPubKey);
|
|
511
643
|
}
|
|
512
644
|
|
|
645
|
+
// ---------------------------------------------------------------------
|
|
646
|
+
// SquadsX Helpers
|
|
647
|
+
// ---------------------------------------------------------------------
|
|
648
|
+
|
|
649
|
+
get squadsMultisigPDA(): SolPubKey | undefined {
|
|
650
|
+
if (!this.squadsX) return undefined;
|
|
651
|
+
return new SolPubKey(this.squadsX.multisigPDA);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
get squadsVaultPDA(): SolPubKey | undefined {
|
|
655
|
+
if (!this.squadsX || !this.squadsMultisigPDA) return undefined;
|
|
656
|
+
const multisigPda = this.squadsMultisigPDA;
|
|
657
|
+
const index = this.squadsX.vaultIndex ?? 0;
|
|
658
|
+
const pda = multisig.getVaultPda({ multisigPda, index });
|
|
659
|
+
return pda[0];
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/** Create a Squads vault transaction/proposal for one or more instructions. */
|
|
663
|
+
private async sendSquadsIxs(ix: TransactionInstruction | TransactionInstruction[]): Promise<string> {
|
|
664
|
+
if (!this.squadsX) throw new Error('Attempting to wrap Squads instruction without SquadsX config');
|
|
665
|
+
|
|
666
|
+
const ixs = Array.isArray(ix) ? ix : [ix];
|
|
667
|
+
const multisigPda = this.squadsMultisigPDA!;
|
|
668
|
+
const vaultPda = this.squadsVaultPDA!;
|
|
669
|
+
const vaultIndex = this.squadsX?.vaultIndex ?? 0;
|
|
670
|
+
const creator = this.solPubKey;
|
|
671
|
+
|
|
672
|
+
const ms = await multisig.accounts.Multisig.fromAccountAddress(this.connection, multisigPda);
|
|
673
|
+
const current = BigInt(ms.transactionIndex?.toString() ?? 0);
|
|
674
|
+
const transactionIndex = current + BigInt(1);
|
|
675
|
+
|
|
676
|
+
const altAddress = this.program.PROGRAM_IDS.ALT;
|
|
677
|
+
const altAccount = await this.connection.getAddressLookupTable(altAddress);
|
|
678
|
+
if (!altAccount.value) throw new Error("ALT not found on-chain or not yet active.");
|
|
679
|
+
|
|
680
|
+
const lookupTable: AddressLookupTableAccount = altAccount.value;
|
|
681
|
+
const computeLimitIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 600_000 });
|
|
682
|
+
const computePriceIx = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 2000 });
|
|
683
|
+
|
|
684
|
+
const { blockhash } = await this.connection.getLatestBlockhash("confirmed");
|
|
685
|
+
const transactionMessage = new TransactionMessage({
|
|
686
|
+
payerKey: vaultPda,
|
|
687
|
+
recentBlockhash: blockhash,
|
|
688
|
+
instructions: [computeLimitIx, computePriceIx, ...ixs],
|
|
689
|
+
});
|
|
690
|
+
|
|
691
|
+
const createVaultTxIx = await multisig.instructions.vaultTransactionCreate({
|
|
692
|
+
multisigPda,
|
|
693
|
+
transactionIndex,
|
|
694
|
+
creator,
|
|
695
|
+
vaultIndex,
|
|
696
|
+
transactionMessage,
|
|
697
|
+
ephemeralSigners: 0,
|
|
698
|
+
addressLookupTableAccounts: [lookupTable],
|
|
699
|
+
});
|
|
700
|
+
|
|
701
|
+
const vaultTransactionCreate = await this.buildAndSendIx(createVaultTxIx)
|
|
702
|
+
console.log('SQUADSX: vaultTransactionCreate', vaultTransactionCreate);
|
|
703
|
+
|
|
704
|
+
const createProposalIx = await multisig.instructions.proposalCreate({
|
|
705
|
+
multisigPda,
|
|
706
|
+
transactionIndex,
|
|
707
|
+
creator,
|
|
708
|
+
});
|
|
709
|
+
|
|
710
|
+
const proposalCreate = await this.buildAndSendIx(createProposalIx)
|
|
711
|
+
console.log('SQUADSX: proposalCreate', proposalCreate);
|
|
712
|
+
|
|
713
|
+
return proposalCreate;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
// async finish(multisigPda: string, transactionIndex: number): Promise<void> {
|
|
717
|
+
// const vaultExecute = await multisig.instructions.vaultTransactionExecute({
|
|
718
|
+
// connection: this.connection,
|
|
719
|
+
// multisigPda: new SolPubKey(multisigPda),
|
|
720
|
+
// transactionIndex: BigInt(transactionIndex),
|
|
721
|
+
// member: this.solPubKey
|
|
722
|
+
// });
|
|
723
|
+
|
|
724
|
+
// const cuIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 400_000 });
|
|
725
|
+
// const tx1 = new Transaction().add(cuIx, vaultExecute.instruction);
|
|
726
|
+
// const prepared1 = await this.prepareTx(tx1);
|
|
727
|
+
// const signed1 = await this.signTransaction(prepared1.tx);
|
|
728
|
+
// const sent1 = await this.sendAndConfirmHttp(signed1, prepared1);
|
|
729
|
+
// console.log('SENT FINISH', sent1);
|
|
730
|
+
// }
|
|
731
|
+
|
|
732
|
+
// ---------------------------------------------------------------------
|
|
733
|
+
// Tx helpers
|
|
734
|
+
// ---------------------------------------------------------------------
|
|
735
|
+
|
|
736
|
+
async buildAndSendIx(ix: TransactionInstruction | TransactionInstruction[]): Promise<string> {
|
|
737
|
+
const ixs = Array.isArray(ix) ? ix : [ix];
|
|
738
|
+
const computeLimitIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 600_000 });
|
|
739
|
+
const computePriceIx = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 2000 });
|
|
740
|
+
const { blockhash, lastValidBlockHeight } =
|
|
741
|
+
await this.connection.getLatestBlockhash('confirmed');
|
|
742
|
+
|
|
743
|
+
const altAddress = this.program.PROGRAM_IDS.ALT;
|
|
744
|
+
const altAccount = await this.connection.getAddressLookupTable(altAddress);
|
|
745
|
+
const lookupTable = altAccount.value;
|
|
746
|
+
|
|
747
|
+
const instructions = [computeLimitIx, computePriceIx, ...ixs];
|
|
748
|
+
|
|
749
|
+
const tx = lookupTable
|
|
750
|
+
? new VersionedTransaction(
|
|
751
|
+
new TransactionMessage({
|
|
752
|
+
payerKey: this.feePayer,
|
|
753
|
+
recentBlockhash: blockhash,
|
|
754
|
+
instructions,
|
|
755
|
+
}).compileToV0Message([lookupTable]),
|
|
756
|
+
)
|
|
757
|
+
: new Transaction().add(...instructions);
|
|
758
|
+
|
|
759
|
+
const prepared =
|
|
760
|
+
tx instanceof Transaction
|
|
761
|
+
? await this.prepareTx(tx)
|
|
762
|
+
: { tx, blockhash, lastValidBlockHeight };
|
|
763
|
+
|
|
764
|
+
const signed = await this.signTransaction(prepared.tx);
|
|
765
|
+
|
|
766
|
+
return this.sendAndConfirmHttp(signed, prepared);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* Send a signed transaction over HTTP RPC.
|
|
772
|
+
*
|
|
773
|
+
* - Returns immediately on successful sendRawTransaction.
|
|
774
|
+
* - If sendRawTransaction throws a SendTransactionError with
|
|
775
|
+
* "already been processed", we treat it as success and
|
|
776
|
+
* just return a derived signature.
|
|
777
|
+
* - No confirmTransaction / polling / blockheight handling.
|
|
778
|
+
*/
|
|
779
|
+
private async sendAndConfirmHttp(
|
|
780
|
+
signed: SolanaTransaction,
|
|
781
|
+
_ctx: { blockhash: string; lastValidBlockHeight: number },
|
|
782
|
+
): Promise<string> {
|
|
783
|
+
this.ensureUser();
|
|
784
|
+
|
|
785
|
+
const rawTx = signed.serialize();
|
|
786
|
+
|
|
787
|
+
try {
|
|
788
|
+
// Normal happy path: RPC accepts the tx and returns a signature
|
|
789
|
+
const signature = await this.connection.sendRawTransaction(rawTx, {
|
|
790
|
+
skipPreflight: false,
|
|
791
|
+
preflightCommitment: commitment,
|
|
792
|
+
maxRetries: 3,
|
|
793
|
+
});
|
|
794
|
+
return signature;
|
|
795
|
+
} catch (e: any) {
|
|
796
|
+
const msg = e?.message ?? '';
|
|
797
|
+
const isSendTxError =
|
|
798
|
+
e instanceof SendTransactionError || e?.name === 'SendTransactionError';
|
|
799
|
+
|
|
800
|
+
// Benign duplicate case: tx is already in the ledger / cache
|
|
801
|
+
if (isSendTxError && msg.includes('already been processed')) {
|
|
802
|
+
console.warn(
|
|
803
|
+
'sendRawTransaction reports "already been processed"; ' +
|
|
804
|
+
'treating as success without further confirmation.',
|
|
805
|
+
);
|
|
806
|
+
|
|
807
|
+
// Try to derive a signature from the signed Transaction.
|
|
808
|
+
// If SolanaTransaction is a legacy Transaction, this works.
|
|
809
|
+
const legacy = signed as unknown as Transaction;
|
|
810
|
+
const first = legacy.signatures?.[0]?.signature;
|
|
811
|
+
|
|
812
|
+
if (first) {
|
|
813
|
+
return bs58.encode(first);
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
// Fallback: return a dummy string
|
|
817
|
+
return 'already-processed';
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
// Any other send error is a real failure
|
|
821
|
+
throw e;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Sign a single Solana transaction using the connected wallet adapter.
|
|
827
|
+
*/
|
|
828
|
+
async signTransaction(
|
|
829
|
+
tx: SolanaTransaction,
|
|
830
|
+
): Promise<SolanaTransaction> {
|
|
831
|
+
this.ensureUser();
|
|
832
|
+
return this.anchor.wallet.signTransaction(tx);
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Generic "fire and forget" send helper if the caller already
|
|
837
|
+
* prepared and signed the transaction.
|
|
838
|
+
*/
|
|
839
|
+
async sendTransaction(
|
|
840
|
+
signed: SolanaTransaction,
|
|
841
|
+
): Promise<TransactionSignature> {
|
|
842
|
+
this.ensureUser();
|
|
843
|
+
return this.anchor.sendAndConfirm(signed);
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* Attach recent blockhash + fee payer to a transaction.
|
|
848
|
+
* Required before signing and sending.
|
|
849
|
+
*/
|
|
850
|
+
async prepareTx(
|
|
851
|
+
tx: Transaction,
|
|
852
|
+
): Promise<{
|
|
853
|
+
tx: Transaction;
|
|
854
|
+
blockhash: string;
|
|
855
|
+
lastValidBlockHeight: number;
|
|
856
|
+
}> {
|
|
857
|
+
const { blockhash, lastValidBlockHeight } =
|
|
858
|
+
await this.connection.getLatestBlockhash('confirmed');
|
|
859
|
+
tx.recentBlockhash = blockhash;
|
|
860
|
+
tx.feePayer = this.feePayer;
|
|
861
|
+
return { tx, blockhash, lastValidBlockHeight };
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* Guard for all write operations (deposit/withdraw/stake/unstake/buy).
|
|
866
|
+
* Ensures we have a Wire pubKey and an Anchor wallet pubKey, and that they match.
|
|
867
|
+
*/
|
|
868
|
+
ensureUser() {
|
|
869
|
+
if (!this.pubKey) throw new Error('User pubKey is undefined');
|
|
870
|
+
|
|
871
|
+
const wallet = this.anchor?.wallet as any;
|
|
872
|
+
const pk = wallet?.publicKey as SolPubKey | undefined;
|
|
873
|
+
|
|
874
|
+
if (!pk) throw new Error('Wallet not connected');
|
|
875
|
+
if (typeof wallet.signTransaction !== 'function') {
|
|
876
|
+
throw new Error('Wallet does not support signTransaction');
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
// if (!this.pubKey || !this.anchor.wallet.publicKey) {
|
|
880
|
+
// throw new Error('User Authorization required: pubKey is undefined');
|
|
881
|
+
// }
|
|
882
|
+
// if (
|
|
883
|
+
// this.solPubKey.toBase58() !==
|
|
884
|
+
// this.anchor.wallet.publicKey.toBase58()
|
|
885
|
+
// ) {
|
|
886
|
+
// throw new Error(
|
|
887
|
+
// 'Write access requires connected wallet to match pubKey',
|
|
888
|
+
// );
|
|
889
|
+
// }
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
private isLegacyUserRecordMigrationRequired(error: unknown): boolean {
|
|
893
|
+
const message = error instanceof Error ? error.message : String(error ?? '');
|
|
894
|
+
const normalized = message.toLowerCase();
|
|
895
|
+
return normalized.includes('legacyuserrecordmigrationrequired')
|
|
896
|
+
|| normalized.includes('legacy user record must be migrated')
|
|
897
|
+
|| normalized.includes('custom program error: 0x1784');
|
|
898
|
+
}
|
|
513
899
|
|
|
514
900
|
// ---------------------------------------------------------------------
|
|
515
901
|
// READ-ONLY Public Methods
|
|
@@ -525,18 +911,8 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
525
911
|
*
|
|
526
912
|
* This is READ-ONLY and works even with no connected wallet.
|
|
527
913
|
*/
|
|
528
|
-
async getTrancheSnapshot(
|
|
529
|
-
chainID?: ChainID;
|
|
530
|
-
windowBefore?: number;
|
|
531
|
-
windowAfter?: number;
|
|
532
|
-
}): Promise<TrancheSnapshot> {
|
|
914
|
+
async getTrancheSnapshot(chainID: ChainID): Promise<TrancheSnapshot> {
|
|
533
915
|
try {
|
|
534
|
-
const {
|
|
535
|
-
chainID = SolChainID.WireTestnet,
|
|
536
|
-
windowBefore,
|
|
537
|
-
windowAfter,
|
|
538
|
-
} = options ?? {};
|
|
539
|
-
|
|
540
916
|
const [globalState, trancheState] = await Promise.all([
|
|
541
917
|
this.tokenClient.fetchGlobalState(),
|
|
542
918
|
this.tokenClient.fetchTrancheState(),
|
|
@@ -551,12 +927,11 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
551
927
|
trancheState,
|
|
552
928
|
solPriceUsd,
|
|
553
929
|
nativePriceTimestamp: timestamp,
|
|
554
|
-
ladderWindowBefore: windowBefore,
|
|
555
|
-
ladderWindowAfter: windowAfter,
|
|
556
930
|
});
|
|
557
931
|
}
|
|
558
932
|
catch (err) {
|
|
559
|
-
|
|
933
|
+
console.log(`Failed to build Solana tranche snapshot: ${err}`);
|
|
934
|
+
throw err;
|
|
560
935
|
}
|
|
561
936
|
}
|
|
562
937
|
|
|
@@ -578,7 +953,8 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
578
953
|
|
|
579
954
|
return apyPercent;
|
|
580
955
|
} catch (err) {
|
|
581
|
-
|
|
956
|
+
console.log(`Failed to compute Solana system APY: ${err}`);
|
|
957
|
+
throw err;
|
|
582
958
|
}
|
|
583
959
|
}
|
|
584
960
|
|
|
@@ -588,24 +964,48 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
588
964
|
* de-scaled using PAY_RATE_SCALE_FACTOR (1e12).
|
|
589
965
|
*/
|
|
590
966
|
private async getEpochRateDecimalFromProgram(): Promise<number> {
|
|
591
|
-
|
|
967
|
+
const liqSolCoreProgram: any = this.program.getProgram('liqsolCore');
|
|
968
|
+
const payRateHistoryPda = this.program.derivePayRateHistoryPda();
|
|
969
|
+
|
|
970
|
+
const payRateHistory =
|
|
971
|
+
await liqSolCoreProgram.account.payRateHistory.fetch(payRateHistoryPda);
|
|
972
|
+
|
|
973
|
+
const totalEntriesAdded = Number(payRateHistory.totalEntriesAdded);
|
|
974
|
+
const maxEntries = Number(payRateHistory.maxEntries);
|
|
975
|
+
|
|
976
|
+
if (totalEntriesAdded === 0) {
|
|
977
|
+
// No real entries yet, fall back to default
|
|
978
|
+
return Number(DEFAULT_AVERAGE_PAY_RATE) / Number(PAY_RATE_SCALE_FACTOR);
|
|
979
|
+
}
|
|
592
980
|
|
|
593
|
-
|
|
594
|
-
const stakeMetricsPda = deriveStakeMetricsPda();
|
|
595
|
-
const stakeMetrics =
|
|
596
|
-
await liqSolCoreProgram.account.stakeMetrics.fetch(stakeMetricsPda);
|
|
981
|
+
const currentIndex = Number(payRateHistory.currentIndex);
|
|
597
982
|
|
|
598
|
-
|
|
599
|
-
|
|
983
|
+
// Only average entries that have actually been processed (written by add_entry),
|
|
984
|
+
// not the default-initialized slots. After 10+ entries, processedCount === maxEntries.
|
|
985
|
+
const processedCount = Math.min(totalEntriesAdded, maxEntries);
|
|
600
986
|
|
|
601
|
-
|
|
602
|
-
|
|
987
|
+
let sum = BigInt(0);
|
|
988
|
+
let validCount = 0;
|
|
989
|
+
// Walk backward from most recent entry
|
|
990
|
+
let idx = (currentIndex - 1 + maxEntries) % maxEntries;
|
|
603
991
|
|
|
604
|
-
|
|
992
|
+
for (let i = 0; i < processedCount; i++) {
|
|
993
|
+
const entry = payRateHistory.entries[idx];
|
|
994
|
+
const scaledRate = BigInt(entry.scaledRate.toString());
|
|
995
|
+
if (scaledRate > BigInt(0)) {
|
|
996
|
+
sum += scaledRate;
|
|
997
|
+
validCount++;
|
|
998
|
+
}
|
|
999
|
+
idx = (idx - 1 + maxEntries) % maxEntries;
|
|
605
1000
|
}
|
|
606
|
-
|
|
607
|
-
|
|
1001
|
+
|
|
1002
|
+
if (validCount === 0) {
|
|
1003
|
+
return Number(DEFAULT_AVERAGE_PAY_RATE) / Number(PAY_RATE_SCALE_FACTOR);
|
|
608
1004
|
}
|
|
1005
|
+
|
|
1006
|
+
// Average the processed entries
|
|
1007
|
+
const average = Number(sum / BigInt(validCount));
|
|
1008
|
+
return average / Number(PAY_RATE_SCALE_FACTOR);
|
|
609
1009
|
}
|
|
610
1010
|
|
|
611
1011
|
// Simple cache so we don’t hammer RPC
|
|
@@ -690,7 +1090,7 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
690
1090
|
return BigInt(0);
|
|
691
1091
|
}
|
|
692
1092
|
|
|
693
|
-
const [avgPayRate, globalConfig]: [BN, GlobalConfig] = await Promise.all([
|
|
1093
|
+
const [avgPayRate, globalConfig]: [BN, GlobalConfig | null] = await Promise.all([
|
|
694
1094
|
this.distributionClient.getAverageScaledPayRate(windowSize),
|
|
695
1095
|
this.distributionClient.getGlobalConfig(),
|
|
696
1096
|
]);
|
|
@@ -741,14 +1141,12 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
741
1141
|
}): Promise<bigint> {
|
|
742
1142
|
this.ensureUser();
|
|
743
1143
|
|
|
744
|
-
const payer = this.solPubKey;
|
|
745
|
-
|
|
746
1144
|
// -------------------------------------------------------------
|
|
747
1145
|
// 1) Current wallet balance (prefer caller override)
|
|
748
1146
|
// -------------------------------------------------------------
|
|
749
1147
|
const balanceLamports: bigint =
|
|
750
1148
|
options?.balanceOverrideLamports ??
|
|
751
|
-
BigInt(await this.connection.getBalance(
|
|
1149
|
+
BigInt(await this.connection.getBalance(this.feePayer, commitment));
|
|
752
1150
|
|
|
753
1151
|
if (balanceLamports <= BigInt(0)) {
|
|
754
1152
|
return BigInt(0);
|
|
@@ -859,7 +1257,7 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
859
1257
|
return this.cachedTxFee.value;
|
|
860
1258
|
}
|
|
861
1259
|
|
|
862
|
-
const payer = this.
|
|
1260
|
+
const payer = this.feePayer;
|
|
863
1261
|
|
|
864
1262
|
const dummyIx = SystemProgram.transfer({
|
|
865
1263
|
fromPubkey: payer,
|
|
@@ -885,102 +1283,5 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
885
1283
|
return singleTxFeeLamports;
|
|
886
1284
|
}
|
|
887
1285
|
|
|
888
|
-
// ---------------------------------------------------------------------
|
|
889
|
-
// Tx helpers
|
|
890
|
-
// ---------------------------------------------------------------------
|
|
891
|
-
|
|
892
|
-
/**
|
|
893
|
-
* Send a signed transaction over HTTP RPC and wait for confirmation.
|
|
894
|
-
* Throws if the transaction fails.
|
|
895
|
-
*/
|
|
896
|
-
private async sendAndConfirmHttp(
|
|
897
|
-
signed: SolanaTransaction,
|
|
898
|
-
ctx: { blockhash: string; lastValidBlockHeight: number },
|
|
899
|
-
): Promise<string> {
|
|
900
|
-
this.ensureUser();
|
|
901
|
-
|
|
902
|
-
const signature = await this.connection.sendRawTransaction(
|
|
903
|
-
signed.serialize(),
|
|
904
|
-
{
|
|
905
|
-
skipPreflight: false,
|
|
906
|
-
preflightCommitment: commitment,
|
|
907
|
-
maxRetries: 3,
|
|
908
|
-
},
|
|
909
|
-
);
|
|
910
|
-
|
|
911
|
-
const conf = await this.connection.confirmTransaction(
|
|
912
|
-
{
|
|
913
|
-
signature,
|
|
914
|
-
blockhash: ctx.blockhash,
|
|
915
|
-
lastValidBlockHeight: ctx.lastValidBlockHeight,
|
|
916
|
-
},
|
|
917
|
-
commitment,
|
|
918
|
-
);
|
|
919
|
-
|
|
920
|
-
if (conf.value.err) {
|
|
921
|
-
throw new Error(
|
|
922
|
-
`Transaction failed: ${JSON.stringify(conf.value.err)}`,
|
|
923
|
-
);
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
return signature;
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
/**
|
|
930
|
-
* Sign a single Solana transaction using the connected wallet adapter.
|
|
931
|
-
*/
|
|
932
|
-
async signTransaction(
|
|
933
|
-
tx: SolanaTransaction,
|
|
934
|
-
): Promise<SolanaTransaction> {
|
|
935
|
-
this.ensureUser();
|
|
936
|
-
return this.anchor.wallet.signTransaction(tx);
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
/**
|
|
940
|
-
* Generic "fire and forget" send helper if the caller already
|
|
941
|
-
* prepared and signed the transaction.
|
|
942
|
-
*/
|
|
943
|
-
async sendTransaction(
|
|
944
|
-
signed: SolanaTransaction,
|
|
945
|
-
): Promise<TransactionSignature> {
|
|
946
|
-
this.ensureUser();
|
|
947
|
-
return this.anchor.sendAndConfirm(signed);
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
/**
|
|
951
|
-
* Attach recent blockhash + fee payer to a transaction.
|
|
952
|
-
* Required before signing and sending.
|
|
953
|
-
*/
|
|
954
|
-
async prepareTx(
|
|
955
|
-
tx: Transaction,
|
|
956
|
-
): Promise<{
|
|
957
|
-
tx: Transaction;
|
|
958
|
-
blockhash: string;
|
|
959
|
-
lastValidBlockHeight: number;
|
|
960
|
-
}> {
|
|
961
|
-
const { blockhash, lastValidBlockHeight } =
|
|
962
|
-
await this.connection.getLatestBlockhash('confirmed');
|
|
963
|
-
tx.recentBlockhash = blockhash;
|
|
964
|
-
tx.feePayer = this.solPubKey;
|
|
965
|
-
return { tx, blockhash, lastValidBlockHeight };
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
/**
|
|
969
|
-
* Guard for all write operations (deposit/withdraw/stake/unstake/buy).
|
|
970
|
-
* Ensures we have a Wire pubKey and an Anchor wallet pubKey, and that they match.
|
|
971
|
-
*/
|
|
972
|
-
ensureUser() {
|
|
973
|
-
if (!this.pubKey || !this.anchor.wallet.publicKey) {
|
|
974
|
-
throw new Error('User Authorization required: pubKey is undefined');
|
|
975
|
-
}
|
|
976
|
-
if (
|
|
977
|
-
this.solPubKey.toBase58() !==
|
|
978
|
-
this.anchor.wallet.publicKey.toBase58()
|
|
979
|
-
) {
|
|
980
|
-
throw new Error(
|
|
981
|
-
'Write access requires connected wallet to match pubKey',
|
|
982
|
-
);
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
1286
|
|
|
986
|
-
}
|
|
1287
|
+
}
|