@wireio/stake 1.0.0 → 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 -10172
- package/lib/stake.browser.js.map +1 -1
- package/lib/stake.d.ts +11368 -978
- package/lib/stake.js +46986 -8778
- package/lib/stake.js.map +1 -1
- package/lib/stake.m.js +48207 -10172
- 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 +529 -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,21 +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
|
-
const
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
+
);
|
|
248
|
+
|
|
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
|
+
}
|
|
256
|
+
|
|
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
|
+
}
|
|
263
|
+
|
|
219
264
|
} catch (err) {
|
|
220
|
-
|
|
265
|
+
console.log(`Failed to deposit Solana: ${err}`);
|
|
266
|
+
throw err;
|
|
221
267
|
}
|
|
222
268
|
}
|
|
223
269
|
|
|
@@ -233,51 +279,89 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
233
279
|
*/
|
|
234
280
|
async withdraw(amountLamports: bigint): Promise<string> {
|
|
235
281
|
this.ensureUser();
|
|
236
|
-
if (amountLamports <= BigInt(0))
|
|
282
|
+
if (amountLamports <= BigInt(0))
|
|
237
283
|
throw new Error('Withdraw amount must be greater than zero.');
|
|
238
|
-
}
|
|
239
284
|
|
|
240
285
|
try {
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
await this.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
blockhash,
|
|
247
|
-
lastValidBlockHeight,
|
|
248
|
-
});
|
|
286
|
+
const ix = await this.convertClient.buildWithdrawTx(amountLamports, this.squadsVaultPDA)
|
|
287
|
+
return !!this.squadsX
|
|
288
|
+
? await this.sendSquadsIxs(ix)
|
|
289
|
+
: await this.buildAndSendIx(ix)
|
|
290
|
+
|
|
249
291
|
} catch (err) {
|
|
250
|
-
|
|
292
|
+
console.log(`Failed to withdraw Solana: ${err}`);
|
|
293
|
+
throw err;
|
|
251
294
|
}
|
|
252
295
|
}
|
|
253
296
|
|
|
254
297
|
/**
|
|
255
|
-
*
|
|
298
|
+
* Enumerate withdrawal receipt NFTs held by the user (queued/ready/claimed).
|
|
299
|
+
* Mirrors the ETH getPendingWithdraws helper for UI parity.
|
|
256
300
|
*/
|
|
257
|
-
async
|
|
301
|
+
async getPendingWithdraws(address?: string): Promise<WithdrawReceipt[]> {
|
|
258
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
|
+
}
|
|
259
307
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
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;
|
|
263
314
|
|
|
264
315
|
try {
|
|
265
|
-
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
|
+
}
|
|
325
|
+
|
|
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;
|
|
266
332
|
|
|
267
|
-
|
|
268
|
-
const
|
|
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
|
+
}
|
|
269
343
|
|
|
270
|
-
|
|
271
|
-
|
|
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.');
|
|
272
351
|
|
|
273
|
-
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
|
|
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)
|
|
277
361
|
|
|
278
|
-
return this.sendAndConfirmHttp(signed, prepared);
|
|
279
362
|
} catch (err) {
|
|
280
|
-
|
|
363
|
+
console.log(`Failed to stake Solana: ${err}`);
|
|
364
|
+
throw err;
|
|
281
365
|
}
|
|
282
366
|
}
|
|
283
367
|
|
|
@@ -286,29 +370,18 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
286
370
|
*/
|
|
287
371
|
async unstake(amountLamports: bigint): Promise<string> {
|
|
288
372
|
this.ensureUser();
|
|
289
|
-
|
|
290
|
-
if (!amountLamports || amountLamports <= BigInt(0)) {
|
|
373
|
+
if (!amountLamports || amountLamports <= BigInt(0))
|
|
291
374
|
throw new Error('Unstake amount must be greater than zero.');
|
|
292
|
-
}
|
|
293
375
|
|
|
294
376
|
try {
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
// Build the Outpost desynd instruction
|
|
301
|
-
const ix = await this.outpostClient.buildUnstakeIx(amountLamports, user);
|
|
302
|
-
|
|
303
|
-
// Wrap in a transaction and send
|
|
304
|
-
const tx = new Transaction().add(cuIx, ix);
|
|
305
|
-
const prepared = await this.prepareTx(tx);
|
|
306
|
-
const signed = await this.signTransaction(prepared.tx);
|
|
307
|
-
|
|
308
|
-
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)
|
|
309
381
|
}
|
|
310
382
|
catch (err) {
|
|
311
|
-
|
|
383
|
+
console.log(`Failed to unstake Solana: ${err}`);
|
|
384
|
+
throw err;
|
|
312
385
|
}
|
|
313
386
|
}
|
|
314
387
|
|
|
@@ -320,25 +393,82 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
320
393
|
*/
|
|
321
394
|
async buy(amountLamports: bigint): Promise<string> {
|
|
322
395
|
this.ensureUser();
|
|
323
|
-
if (!amountLamports || amountLamports <= BigInt(0))
|
|
396
|
+
if (!amountLamports || amountLamports <= BigInt(0))
|
|
324
397
|
throw new Error('liqSOL pretoken purchase requires a positive amount.');
|
|
325
|
-
}
|
|
326
398
|
|
|
327
399
|
try {
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
const { tx: prepared, blockhash, lastValidBlockHeight } =
|
|
333
|
-
await this.prepareTx(tx);
|
|
334
|
-
const signed = await this.signTransaction(prepared);
|
|
335
|
-
return await this.sendAndConfirmHttp(signed, {
|
|
336
|
-
blockhash,
|
|
337
|
-
lastValidBlockHeight,
|
|
338
|
-
});
|
|
400
|
+
const ix = await this.tokenClient.buildPurchaseIx(amountLamports, this.squadsVaultPDA)
|
|
401
|
+
return !!this.squadsX
|
|
402
|
+
? await this.sendSquadsIxs(ix)
|
|
403
|
+
: await this.buildAndSendIx(ix)
|
|
339
404
|
}
|
|
340
405
|
catch (err) {
|
|
341
|
-
|
|
406
|
+
console.log(`Failed to buy liqSOL pretokens: ${err}`);
|
|
407
|
+
throw err;
|
|
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.');
|
|
416
|
+
|
|
417
|
+
try {
|
|
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
|
+
);
|
|
425
|
+
|
|
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
|
+
}
|
|
434
|
+
|
|
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;
|
|
452
|
+
}
|
|
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;
|
|
342
472
|
}
|
|
343
473
|
}
|
|
344
474
|
|
|
@@ -351,20 +481,20 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
351
481
|
* - yield: on-chain index/shares plus an estimated accrued liqSOL yield
|
|
352
482
|
* - extras: useful internal addresses and raw state for debugging/UX
|
|
353
483
|
*/
|
|
354
|
-
async getPortfolio(): Promise<Portfolio> {
|
|
355
|
-
if (!this.pubKey) throw new Error('User pubKey is undefined');
|
|
356
|
-
|
|
484
|
+
async getPortfolio(address?: string): Promise<Portfolio> {
|
|
485
|
+
// if (!this.pubKey) throw new Error('User pubKey is undefined');
|
|
357
486
|
try {
|
|
358
|
-
const user =
|
|
487
|
+
const user = address ? new SolPubKey(address) :
|
|
488
|
+
!!this.squadsX ? this.squadsVaultPDA! : this.solPubKey;
|
|
359
489
|
|
|
360
|
-
const reservePoolPDA = deriveReservePoolPda();
|
|
361
|
-
const vaultPDA = deriveVaultPda();
|
|
362
|
-
const liqsolMint = deriveLiqsolMintPda();
|
|
490
|
+
const reservePoolPDA = this.program.deriveReservePoolPda();
|
|
491
|
+
const vaultPDA = this.program.deriveVaultPda();
|
|
492
|
+
const liqsolMint = this.program.deriveLiqsolMintPda();
|
|
363
493
|
|
|
364
494
|
const userLiqsolAta = getAssociatedTokenAddressSync(
|
|
365
495
|
liqsolMint,
|
|
366
496
|
user,
|
|
367
|
-
|
|
497
|
+
true,
|
|
368
498
|
TOKEN_2022_PROGRAM_ID,
|
|
369
499
|
ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
370
500
|
);
|
|
@@ -373,12 +503,13 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
373
503
|
// - nativeLamports: wallet SOL
|
|
374
504
|
// - actualBalResp: liqSOL balance in user ATA
|
|
375
505
|
// - snapshot: Outpost + pretokens + global index/shares
|
|
376
|
-
const [nativeLamports, actualBalResp, snapshot] = await Promise.all([
|
|
506
|
+
const [nativeLamports, actualBalResp, snapshot, claimableLamports] = await Promise.all([
|
|
377
507
|
this.connection.getBalance(user, 'confirmed'),
|
|
378
508
|
this.connection
|
|
379
509
|
.getTokenAccountBalance(userLiqsolAta, 'confirmed')
|
|
380
510
|
.catch(() => null),
|
|
381
511
|
this.outpostClient.fetchWireState(user).catch(() => null),
|
|
512
|
+
this.distributionClient.getClaimableLiqsol(user).catch(() => new BN(0)),
|
|
382
513
|
]);
|
|
383
514
|
|
|
384
515
|
const LIQSOL_DECIMALS = 9;
|
|
@@ -454,6 +585,12 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
454
585
|
decimals: LIQSOL_DECIMALS,
|
|
455
586
|
ata: userLiqsolAta,
|
|
456
587
|
},
|
|
588
|
+
claimable: {
|
|
589
|
+
amount: BigInt(claimableLamports.toString()),
|
|
590
|
+
symbol: 'LiqSOL',
|
|
591
|
+
decimals: LIQSOL_DECIMALS,
|
|
592
|
+
ata: userLiqsolAta,
|
|
593
|
+
},
|
|
457
594
|
staked: {
|
|
458
595
|
// liqSOL staked in Outpost via `synd`
|
|
459
596
|
amount: stakedLiqsol,
|
|
@@ -491,7 +628,8 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
491
628
|
};
|
|
492
629
|
}
|
|
493
630
|
catch (err) {
|
|
494
|
-
|
|
631
|
+
console.log(`Failed to get Solana portfolio: ${err}`);
|
|
632
|
+
throw err;
|
|
495
633
|
}
|
|
496
634
|
}
|
|
497
635
|
|
|
@@ -504,6 +642,260 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
504
642
|
return this.distributionClient.getUserRecord(this.solPubKey);
|
|
505
643
|
}
|
|
506
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
|
+
}
|
|
507
899
|
|
|
508
900
|
// ---------------------------------------------------------------------
|
|
509
901
|
// READ-ONLY Public Methods
|
|
@@ -519,18 +911,8 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
519
911
|
*
|
|
520
912
|
* This is READ-ONLY and works even with no connected wallet.
|
|
521
913
|
*/
|
|
522
|
-
async getTrancheSnapshot(
|
|
523
|
-
chainID?: ChainID;
|
|
524
|
-
windowBefore?: number;
|
|
525
|
-
windowAfter?: number;
|
|
526
|
-
}): Promise<TrancheSnapshot> {
|
|
914
|
+
async getTrancheSnapshot(chainID: ChainID): Promise<TrancheSnapshot> {
|
|
527
915
|
try {
|
|
528
|
-
const {
|
|
529
|
-
chainID = SolChainID.WireTestnet,
|
|
530
|
-
windowBefore,
|
|
531
|
-
windowAfter,
|
|
532
|
-
} = options ?? {};
|
|
533
|
-
|
|
534
916
|
const [globalState, trancheState] = await Promise.all([
|
|
535
917
|
this.tokenClient.fetchGlobalState(),
|
|
536
918
|
this.tokenClient.fetchTrancheState(),
|
|
@@ -545,12 +927,11 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
545
927
|
trancheState,
|
|
546
928
|
solPriceUsd,
|
|
547
929
|
nativePriceTimestamp: timestamp,
|
|
548
|
-
ladderWindowBefore: windowBefore,
|
|
549
|
-
ladderWindowAfter: windowAfter,
|
|
550
930
|
});
|
|
551
931
|
}
|
|
552
932
|
catch (err) {
|
|
553
|
-
|
|
933
|
+
console.log(`Failed to build Solana tranche snapshot: ${err}`);
|
|
934
|
+
throw err;
|
|
554
935
|
}
|
|
555
936
|
}
|
|
556
937
|
|
|
@@ -572,7 +953,8 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
572
953
|
|
|
573
954
|
return apyPercent;
|
|
574
955
|
} catch (err) {
|
|
575
|
-
|
|
956
|
+
console.log(`Failed to compute Solana system APY: ${err}`);
|
|
957
|
+
throw err;
|
|
576
958
|
}
|
|
577
959
|
}
|
|
578
960
|
|
|
@@ -582,24 +964,48 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
582
964
|
* de-scaled using PAY_RATE_SCALE_FACTOR (1e12).
|
|
583
965
|
*/
|
|
584
966
|
private async getEpochRateDecimalFromProgram(): Promise<number> {
|
|
585
|
-
|
|
967
|
+
const liqSolCoreProgram: any = this.program.getProgram('liqsolCore');
|
|
968
|
+
const payRateHistoryPda = this.program.derivePayRateHistoryPda();
|
|
586
969
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
const stakeMetrics =
|
|
590
|
-
await liqSolCoreProgram.account.stakeMetrics.fetch(stakeMetricsPda);
|
|
970
|
+
const payRateHistory =
|
|
971
|
+
await liqSolCoreProgram.account.payRateHistory.fetch(payRateHistoryPda);
|
|
591
972
|
|
|
592
|
-
|
|
593
|
-
|
|
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
|
+
}
|
|
594
980
|
|
|
595
|
-
|
|
596
|
-
const rateDecimal = Number(raw) / Number(PAY_RATE_SCALE_FACTOR);
|
|
981
|
+
const currentIndex = Number(payRateHistory.currentIndex);
|
|
597
982
|
|
|
598
|
-
|
|
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);
|
|
986
|
+
|
|
987
|
+
let sum = BigInt(0);
|
|
988
|
+
let validCount = 0;
|
|
989
|
+
// Walk backward from most recent entry
|
|
990
|
+
let idx = (currentIndex - 1 + maxEntries) % maxEntries;
|
|
991
|
+
|
|
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;
|
|
599
1000
|
}
|
|
600
|
-
|
|
601
|
-
|
|
1001
|
+
|
|
1002
|
+
if (validCount === 0) {
|
|
1003
|
+
return Number(DEFAULT_AVERAGE_PAY_RATE) / Number(PAY_RATE_SCALE_FACTOR);
|
|
602
1004
|
}
|
|
1005
|
+
|
|
1006
|
+
// Average the processed entries
|
|
1007
|
+
const average = Number(sum / BigInt(validCount));
|
|
1008
|
+
return average / Number(PAY_RATE_SCALE_FACTOR);
|
|
603
1009
|
}
|
|
604
1010
|
|
|
605
1011
|
// Simple cache so we don’t hammer RPC
|
|
@@ -684,7 +1090,7 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
684
1090
|
return BigInt(0);
|
|
685
1091
|
}
|
|
686
1092
|
|
|
687
|
-
const [avgPayRate, globalConfig]: [BN, GlobalConfig] = await Promise.all([
|
|
1093
|
+
const [avgPayRate, globalConfig]: [BN, GlobalConfig | null] = await Promise.all([
|
|
688
1094
|
this.distributionClient.getAverageScaledPayRate(windowSize),
|
|
689
1095
|
this.distributionClient.getGlobalConfig(),
|
|
690
1096
|
]);
|
|
@@ -735,14 +1141,12 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
735
1141
|
}): Promise<bigint> {
|
|
736
1142
|
this.ensureUser();
|
|
737
1143
|
|
|
738
|
-
const payer = this.solPubKey;
|
|
739
|
-
|
|
740
1144
|
// -------------------------------------------------------------
|
|
741
1145
|
// 1) Current wallet balance (prefer caller override)
|
|
742
1146
|
// -------------------------------------------------------------
|
|
743
1147
|
const balanceLamports: bigint =
|
|
744
1148
|
options?.balanceOverrideLamports ??
|
|
745
|
-
BigInt(await this.connection.getBalance(
|
|
1149
|
+
BigInt(await this.connection.getBalance(this.feePayer, commitment));
|
|
746
1150
|
|
|
747
1151
|
if (balanceLamports <= BigInt(0)) {
|
|
748
1152
|
return BigInt(0);
|
|
@@ -853,7 +1257,7 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
853
1257
|
return this.cachedTxFee.value;
|
|
854
1258
|
}
|
|
855
1259
|
|
|
856
|
-
const payer = this.
|
|
1260
|
+
const payer = this.feePayer;
|
|
857
1261
|
|
|
858
1262
|
const dummyIx = SystemProgram.transfer({
|
|
859
1263
|
fromPubkey: payer,
|
|
@@ -879,102 +1283,5 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
879
1283
|
return singleTxFeeLamports;
|
|
880
1284
|
}
|
|
881
1285
|
|
|
882
|
-
// ---------------------------------------------------------------------
|
|
883
|
-
// Tx helpers
|
|
884
|
-
// ---------------------------------------------------------------------
|
|
885
|
-
|
|
886
|
-
/**
|
|
887
|
-
* Send a signed transaction over HTTP RPC and wait for confirmation.
|
|
888
|
-
* Throws if the transaction fails.
|
|
889
|
-
*/
|
|
890
|
-
private async sendAndConfirmHttp(
|
|
891
|
-
signed: SolanaTransaction,
|
|
892
|
-
ctx: { blockhash: string; lastValidBlockHeight: number },
|
|
893
|
-
): Promise<string> {
|
|
894
|
-
this.ensureUser();
|
|
895
|
-
|
|
896
|
-
const signature = await this.connection.sendRawTransaction(
|
|
897
|
-
signed.serialize(),
|
|
898
|
-
{
|
|
899
|
-
skipPreflight: false,
|
|
900
|
-
preflightCommitment: commitment,
|
|
901
|
-
maxRetries: 3,
|
|
902
|
-
},
|
|
903
|
-
);
|
|
904
|
-
|
|
905
|
-
const conf = await this.connection.confirmTransaction(
|
|
906
|
-
{
|
|
907
|
-
signature,
|
|
908
|
-
blockhash: ctx.blockhash,
|
|
909
|
-
lastValidBlockHeight: ctx.lastValidBlockHeight,
|
|
910
|
-
},
|
|
911
|
-
commitment,
|
|
912
|
-
);
|
|
913
|
-
|
|
914
|
-
if (conf.value.err) {
|
|
915
|
-
throw new Error(
|
|
916
|
-
`Transaction failed: ${JSON.stringify(conf.value.err)}`,
|
|
917
|
-
);
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
return signature;
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
/**
|
|
924
|
-
* Sign a single Solana transaction using the connected wallet adapter.
|
|
925
|
-
*/
|
|
926
|
-
async signTransaction(
|
|
927
|
-
tx: SolanaTransaction,
|
|
928
|
-
): Promise<SolanaTransaction> {
|
|
929
|
-
this.ensureUser();
|
|
930
|
-
return this.anchor.wallet.signTransaction(tx);
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
/**
|
|
934
|
-
* Generic "fire and forget" send helper if the caller already
|
|
935
|
-
* prepared and signed the transaction.
|
|
936
|
-
*/
|
|
937
|
-
async sendTransaction(
|
|
938
|
-
signed: SolanaTransaction,
|
|
939
|
-
): Promise<TransactionSignature> {
|
|
940
|
-
this.ensureUser();
|
|
941
|
-
return this.anchor.sendAndConfirm(signed);
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
/**
|
|
945
|
-
* Attach recent blockhash + fee payer to a transaction.
|
|
946
|
-
* Required before signing and sending.
|
|
947
|
-
*/
|
|
948
|
-
async prepareTx(
|
|
949
|
-
tx: Transaction,
|
|
950
|
-
): Promise<{
|
|
951
|
-
tx: Transaction;
|
|
952
|
-
blockhash: string;
|
|
953
|
-
lastValidBlockHeight: number;
|
|
954
|
-
}> {
|
|
955
|
-
const { blockhash, lastValidBlockHeight } =
|
|
956
|
-
await this.connection.getLatestBlockhash('confirmed');
|
|
957
|
-
tx.recentBlockhash = blockhash;
|
|
958
|
-
tx.feePayer = this.solPubKey;
|
|
959
|
-
return { tx, blockhash, lastValidBlockHeight };
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
/**
|
|
963
|
-
* Guard for all write operations (deposit/withdraw/stake/unstake/buy).
|
|
964
|
-
* Ensures we have a Wire pubKey and an Anchor wallet pubKey, and that they match.
|
|
965
|
-
*/
|
|
966
|
-
ensureUser() {
|
|
967
|
-
if (!this.pubKey || !this.anchor.wallet.publicKey) {
|
|
968
|
-
throw new Error('User Authorization required: pubKey is undefined');
|
|
969
|
-
}
|
|
970
|
-
if (
|
|
971
|
-
this.solPubKey.toBase58() !==
|
|
972
|
-
this.anchor.wallet.publicKey.toBase58()
|
|
973
|
-
) {
|
|
974
|
-
throw new Error(
|
|
975
|
-
'Write access requires connected wallet to match pubKey',
|
|
976
|
-
);
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
1286
|
|
|
980
|
-
}
|
|
1287
|
+
}
|