@wireio/stake 0.6.0 → 0.6.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.
Files changed (586) hide show
  1. package/README.md +185 -243
  2. package/lib/stake.browser.js +44095 -8541
  3. package/lib/stake.browser.js.map +1 -1
  4. package/lib/stake.d.ts +11351 -1479
  5. package/lib/stake.js +44672 -9038
  6. package/lib/stake.js.map +1 -1
  7. package/lib/stake.m.js +44095 -8541
  8. package/lib/stake.m.js.map +1 -1
  9. package/package.json +4 -3
  10. package/src/assets/ethereum/hoodi/WNS/BucketWNS.sol/BucketWNS.dbg.json +4 -0
  11. package/src/assets/ethereum/hoodi/WNS/BucketWNS.sol/BucketWNS.json +699 -0
  12. package/src/assets/ethereum/hoodi/WNS/Challenge.sol/Challenge.dbg.json +4 -0
  13. package/src/assets/ethereum/hoodi/WNS/Challenge.sol/Challenge.json +3139 -0
  14. package/src/assets/ethereum/hoodi/WNS/ChallengeLib.sol/ChallengeLib.dbg.json +4 -0
  15. package/src/assets/ethereum/hoodi/WNS/ChallengeLib.sol/ChallengeLib.json +106 -0
  16. package/src/assets/ethereum/hoodi/WNS/Errors.sol/WNSErrs.dbg.json +4 -0
  17. package/src/assets/ethereum/hoodi/WNS/Errors.sol/WNSErrs.json +180 -0
  18. package/src/assets/ethereum/hoodi/WNS/LiqWNS.sol/LiqWNS.dbg.json +4 -0
  19. package/src/assets/ethereum/hoodi/WNS/LiqWNS.sol/LiqWNS.json +470 -0
  20. package/src/assets/ethereum/hoodi/WNS/SChain.sol/SChain.dbg.json +4 -0
  21. package/src/assets/ethereum/hoodi/WNS/SChain.sol/SChain.json +1983 -0
  22. package/src/assets/ethereum/hoodi/WNS/UTXO.sol/UTXO.dbg.json +4 -0
  23. package/src/assets/ethereum/hoodi/WNS/UTXO.sol/UTXO.json +1231 -0
  24. package/src/assets/ethereum/hoodi/WNS/UTXOio.sol/UTXOio.dbg.json +4 -0
  25. package/src/assets/ethereum/hoodi/WNS/UTXOio.sol/UTXOio.json +1524 -0
  26. package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/IBucketWNS.dbg.json +4 -0
  27. package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/IBucketWNS.json +119 -0
  28. package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/IChallenge.dbg.json +4 -0
  29. package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/IChallenge.json +374 -0
  30. package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/ISChain.dbg.json +4 -0
  31. package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/ISChain.json +865 -0
  32. package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/IUTXO.dbg.json +4 -0
  33. package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/IUTXO.json +524 -0
  34. package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/WNSCommon.dbg.json +4 -0
  35. package/src/assets/ethereum/hoodi/WNS/WNSCommon.sol/WNSCommon.json +10 -0
  36. package/src/assets/ethereum/hoodi/WNS/WithdrawBatch.sol/WithdrawBatch.dbg.json +4 -0
  37. package/src/assets/ethereum/hoodi/WNS/WithdrawBatch.sol/WithdrawBatch.json +1232 -0
  38. package/src/assets/ethereum/hoodi/common/Base58.sol/Base58.dbg.json +4 -0
  39. package/src/assets/ethereum/hoodi/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.dbg.json +4 -0
  40. package/src/assets/ethereum/hoodi/common/RestrictedCallers.sol/RestrictedCallers.dbg.json +4 -0
  41. package/src/assets/ethereum/hoodi/common/iodata.sol/iodata.dbg.json +4 -0
  42. package/src/assets/ethereum/hoodi/common/iodata_util.sol/iodata_util.dbg.json +4 -0
  43. package/src/assets/ethereum/hoodi/common/sysio_data.sol/sysio_data.dbg.json +4 -0
  44. package/src/assets/ethereum/hoodi/common/sysio_errors.sol/sysio_errors.dbg.json +4 -0
  45. package/src/assets/ethereum/hoodi/common/sysio_merkle.sol/sysio_merkle.dbg.json +4 -0
  46. package/src/assets/ethereum/hoodi/common/sysio_name.sol/sysio_name.dbg.json +4 -0
  47. package/src/assets/ethereum/hoodi/common/sysio_pubkey.sol/sysio_pubkey.dbg.json +4 -0
  48. package/src/assets/ethereum/hoodi/common/sysio_read.sol/sysio_read.dbg.json +4 -0
  49. package/src/assets/ethereum/hoodi/common/sysio_tester.sol/SysioTester.dbg.json +4 -0
  50. package/src/assets/ethereum/hoodi/common/sysio_verify.sol/sysio_verify.dbg.json +4 -0
  51. package/src/assets/ethereum/hoodi/common/sysio_write.sol/sysio_write.dbg.json +4 -0
  52. package/src/assets/ethereum/hoodi/liqEth/BeaconState.sol/BeaconState.dbg.json +4 -0
  53. package/src/assets/ethereum/hoodi/liqEth/DepositManager.sol/DepositManagerV2.dbg.json +4 -0
  54. package/src/assets/ethereum/hoodi/liqEth/DepositManager.sol/DepositManagerV2.json +985 -0
  55. package/src/assets/ethereum/hoodi/liqEth/LiqEthAuthority.sol/LiqEthAuthority.dbg.json +4 -0
  56. package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IAccounting.dbg.json +4 -0
  57. package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IAccounting.json +182 -0
  58. package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IDepositContract.dbg.json +4 -0
  59. package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IDepositManager.dbg.json +4 -0
  60. package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +4 -0
  61. package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IRewardsERC20.dbg.json +4 -0
  62. package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IRewardsERC20.json +319 -0
  63. package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +4 -0
  64. package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.json +333 -0
  65. package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IStakingModule.dbg.json +4 -0
  66. package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthCommon.sol/IStakingModule.json +1 -1
  67. package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +4 -0
  68. package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +4 -0
  69. package/src/assets/ethereum/hoodi/liqEth/LiqEthCommon.sol/LiqEthCommon.dbg.json +4 -0
  70. package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthCommon.sol/LiqEthCommon.json +2 -2
  71. package/src/assets/ethereum/hoodi/liqEth/LiqEthDeepFreeze.sol/LiqEthDeepFreeze.dbg.json +4 -0
  72. package/src/assets/ethereum/hoodi/liqEth/LiqEthDeepFreeze.sol/LiqEthDeepFreeze.json +236 -0
  73. package/src/assets/ethereum/hoodi/liqEth/LiqEthManaged.sol/LiqEthManaged.dbg.json +4 -0
  74. package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthManaged.sol/LiqEthManaged.json +2 -2
  75. package/src/assets/ethereum/hoodi/liqEth/RewardsERC20.sol/RewardsERC20UpgradeableV2.dbg.json +4 -0
  76. package/src/assets/ethereum/hoodi/liqEth/RewardsERC20.sol/RewardsERC20UpgradeableV2.json +957 -0
  77. package/src/assets/ethereum/hoodi/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeableV2.dbg.json +4 -0
  78. package/src/assets/ethereum/hoodi/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeableV2.json +1020 -0
  79. package/src/assets/ethereum/hoodi/liqEth/Yield.sol/YieldOracle.dbg.json +4 -0
  80. package/src/assets/ethereum/{ABI → hoodi}/liqEth/Yield.sol/YieldOracle.json +2 -2
  81. package/src/assets/ethereum/hoodi/liqEth/accounting.sol/AccountingV2.dbg.json +4 -0
  82. package/src/assets/ethereum/hoodi/liqEth/accounting.sol/AccountingV2.json +629 -0
  83. package/src/assets/ethereum/hoodi/liqEth/liqEth.sol/LiqEthTokenV2.dbg.json +4 -0
  84. package/src/assets/ethereum/hoodi/liqEth/liqEth.sol/LiqEthTokenV2.json +1323 -0
  85. package/src/assets/ethereum/hoodi/liqEth/stakingModule.sol/StakingModuleV2.dbg.json +4 -0
  86. package/src/assets/ethereum/hoodi/liqEth/stakingModule.sol/StakingModuleV2.json +1779 -0
  87. package/src/assets/ethereum/hoodi/liqEth/v1/DepositManager.sol/DepositManager.dbg.json +4 -0
  88. package/src/assets/ethereum/{ABI/liqEth → hoodi/liqEth/v1}/DepositManager.sol/DepositManager.json +3 -3
  89. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IAccounting.dbg.json +4 -0
  90. package/src/assets/ethereum/{ABI/liqEth → hoodi/liqEth/v1}/LiqEthCommon.sol/IAccounting.json +1 -1
  91. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IDepositContract.dbg.json +4 -0
  92. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IDepositContract.json +39 -0
  93. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IDepositManager.dbg.json +4 -0
  94. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IDepositManager.json +64 -0
  95. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +4 -0
  96. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/ILiqEthUpgradeable.json +29 -0
  97. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IRewardsERC20.dbg.json +4 -0
  98. package/src/assets/ethereum/{ABI/liqEth → hoodi/liqEth/v1}/LiqEthCommon.sol/IRewardsERC20.json +1 -1
  99. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +4 -0
  100. package/src/assets/ethereum/{ABI/liqEth → hoodi/liqEth/v1}/LiqEthCommon.sol/IRewardsERC20Pausable.json +1 -1
  101. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IStakingModule.dbg.json +4 -0
  102. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IStakingModule.json +344 -0
  103. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +4 -0
  104. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IValidatorBalanceVerifier.json +129 -0
  105. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +4 -0
  106. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/IWithdrawalRecord.json +66 -0
  107. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/LiqEthCommon.dbg.json +4 -0
  108. package/src/assets/ethereum/hoodi/liqEth/v1/LiqEthCommon.sol/LiqEthCommon.json +10 -0
  109. package/src/assets/ethereum/hoodi/liqEth/v1/RewardsERC20.sol/RewardsERC20Upgradeable.dbg.json +4 -0
  110. package/src/assets/ethereum/{ABI/liqEth → hoodi/liqEth/v1}/RewardsERC20.sol/RewardsERC20Upgradeable.json +1 -1
  111. package/src/assets/ethereum/hoodi/liqEth/v1/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.dbg.json +4 -0
  112. package/src/assets/ethereum/{ABI/liqEth → hoodi/liqEth/v1}/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.json +1 -1
  113. package/src/assets/ethereum/hoodi/liqEth/v1/accounting.sol/Accounting.dbg.json +4 -0
  114. package/src/assets/ethereum/hoodi/liqEth/v1/accounting.sol/Accounting.json +548 -0
  115. package/src/assets/ethereum/hoodi/liqEth/v1/liqEth.sol/LiqEthToken.dbg.json +4 -0
  116. package/src/assets/ethereum/hoodi/liqEth/v1/liqEth.sol/LiqEthToken.json +1233 -0
  117. package/src/assets/ethereum/hoodi/liqEth/v1/stakingModule.sol/StakingModule.dbg.json +4 -0
  118. package/src/assets/ethereum/hoodi/liqEth/v1/stakingModule.sol/StakingModule.json +1772 -0
  119. package/src/assets/ethereum/hoodi/liqEth/withdrawalQueue.sol/WithdrawalQueue.dbg.json +4 -0
  120. package/src/assets/ethereum/{ABI → hoodi}/liqEth/withdrawalQueue.sol/WithdrawalQueue.json +2 -2
  121. package/src/assets/ethereum/hoodi/liqEth/withdrawalVault.sol/Uint64BE.dbg.json +4 -0
  122. package/src/assets/ethereum/{ABI → hoodi}/liqEth/withdrawalVault.sol/Uint64BE.json +2 -2
  123. package/src/assets/ethereum/hoodi/liqEth/withdrawalVault.sol/WithdrawalVault.dbg.json +4 -0
  124. package/src/assets/ethereum/{ABI → hoodi}/liqEth/withdrawalVault.sol/WithdrawalVault.json +2 -2
  125. package/src/assets/ethereum/hoodi/outpost/BAR.sol/BAR.dbg.json +4 -0
  126. package/src/assets/ethereum/hoodi/outpost/BAR.sol/BAR.json +1111 -0
  127. package/src/assets/ethereum/hoodi/outpost/Depositor.sol/Depositor.dbg.json +4 -0
  128. package/src/assets/ethereum/hoodi/outpost/Depositor.sol/Depositor.json +1590 -0
  129. package/src/assets/ethereum/hoodi/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.dbg.json +4 -0
  130. package/src/assets/ethereum/hoodi/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.dbg.json +4 -0
  131. package/src/assets/ethereum/hoodi/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.json +274 -0
  132. package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeDepositCodec.dbg.json +4 -0
  133. package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeDepositCodec.json +10 -0
  134. package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeWithdrawCodec.dbg.json +4 -0
  135. package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeWithdrawCodec.json +10 -0
  136. package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeWithdrawConfirmCodec.dbg.json +4 -0
  137. package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeWithdrawConfirmCodec.json +10 -0
  138. package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeWithdrawFailedCodec.dbg.json +4 -0
  139. package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/BridgeWithdrawFailedCodec.json +10 -0
  140. package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/InstaswapBridgeAttestationTypeLib.dbg.json +4 -0
  141. package/src/assets/ethereum/hoodi/outpost/InstaswapBridgeAttestations.sol/InstaswapBridgeAttestationTypeLib.json +10 -0
  142. package/src/assets/ethereum/hoodi/outpost/LiqEthBridge.sol/IDepositorBridgeHooks.dbg.json +4 -0
  143. package/src/assets/ethereum/hoodi/outpost/LiqEthBridge.sol/IDepositorBridgeHooks.json +29 -0
  144. package/src/assets/ethereum/hoodi/outpost/LiqEthBridge.sol/LiqEthBridge.dbg.json +4 -0
  145. package/src/assets/ethereum/hoodi/outpost/LiqEthBridge.sol/LiqEthBridge.json +1033 -0
  146. package/src/assets/ethereum/hoodi/outpost/MockAggregator.sol/MockAggregator.json +97 -0
  147. package/src/assets/ethereum/hoodi/outpost/OPP.sol/OPP.dbg.json +4 -0
  148. package/src/assets/ethereum/hoodi/outpost/OPP.sol/OPP.json +1055 -0
  149. package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPP.dbg.json +4 -0
  150. package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPP.json +81 -0
  151. package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPPEndpoint.dbg.json +4 -0
  152. package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPPInbound.dbg.json +4 -0
  153. package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPPInbound.json +330 -0
  154. package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPPReceiver.dbg.json +4 -0
  155. package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPPReceiver.json +29 -0
  156. package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPPSender.dbg.json +4 -0
  157. package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/IOPPSender.json +41 -0
  158. package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/OPPCommon.dbg.json +4 -0
  159. package/src/assets/ethereum/hoodi/outpost/OPPCommon.sol/OPPCommon.json +287 -0
  160. package/src/assets/ethereum/hoodi/outpost/OPPEndpoint.sol/OPPEndpoint.dbg.json +4 -0
  161. package/src/assets/ethereum/hoodi/outpost/OPPEndpoint.sol/OPPEndpoint.json +294 -0
  162. package/src/assets/ethereum/hoodi/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.dbg.json +4 -0
  163. package/src/assets/ethereum/hoodi/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.json +415 -0
  164. package/src/assets/ethereum/hoodi/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.dbg.json +4 -0
  165. package/src/assets/ethereum/hoodi/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.json +399 -0
  166. package/src/assets/ethereum/hoodi/outpost/OPPErrors.sol/OPPErrors.dbg.json +4 -0
  167. package/src/assets/ethereum/hoodi/outpost/OPPErrors.sol/OPPErrors.json +245 -0
  168. package/src/assets/ethereum/hoodi/outpost/OPPInbound.sol/OPPInbound.dbg.json +4 -0
  169. package/src/assets/ethereum/hoodi/outpost/OPPInbound.sol/OPPInbound.json +1204 -0
  170. package/src/assets/ethereum/hoodi/outpost/OPPReceiver.sol/OPPReceiver.dbg.json +4 -0
  171. package/src/assets/ethereum/hoodi/outpost/OPPReceiver.sol/OPPReceiver.json +312 -0
  172. package/src/assets/ethereum/hoodi/outpost/OPPSender.sol/OPPSender.dbg.json +4 -0
  173. package/src/assets/ethereum/hoodi/outpost/OPPSender.sol/OPPSender.json +324 -0
  174. package/src/assets/ethereum/hoodi/outpost/OperatorRegistry.sol/OperatorRegistry.dbg.json +4 -0
  175. package/src/assets/ethereum/hoodi/outpost/OperatorRegistry.sol/OperatorRegistry.json +1068 -0
  176. package/src/assets/ethereum/hoodi/outpost/OutpostErrors.sol/OutpostErrors.dbg.json +4 -0
  177. package/src/assets/ethereum/hoodi/outpost/OutpostErrors.sol/OutpostErrors.json +211 -0
  178. package/src/assets/ethereum/hoodi/outpost/OutpostManaged.sol/OutpostManaged.dbg.json +4 -0
  179. package/src/assets/ethereum/hoodi/outpost/OutpostManaged.sol/OutpostManaged.json +229 -0
  180. package/src/assets/ethereum/hoodi/outpost/OutpostManager.sol/OutpostManager.dbg.json +4 -0
  181. package/src/assets/ethereum/hoodi/outpost/OutpostManager.sol/OutpostManager.json +751 -0
  182. package/src/assets/ethereum/hoodi/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.dbg.json +4 -0
  183. package/src/assets/ethereum/hoodi/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.json +1432 -0
  184. package/src/assets/ethereum/hoodi/outpost/OutpostManagerCommon.sol/IOutpostManager.dbg.json +4 -0
  185. package/src/assets/ethereum/hoodi/outpost/OutpostManagerCommon.sol/IOutpostManager.json +130 -0
  186. package/src/assets/ethereum/hoodi/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.dbg.json +4 -0
  187. package/src/assets/ethereum/hoodi/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.dbg.json +4 -0
  188. package/src/assets/ethereum/hoodi/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.json +141 -0
  189. package/src/assets/ethereum/hoodi/outpost/OutpostOwnable.sol/OutpostOwnable.dbg.json +4 -0
  190. package/src/assets/ethereum/hoodi/outpost/OutpostOwnable.sol/OutpostOwnable.json +213 -0
  191. package/src/assets/ethereum/hoodi/outpost/OutpostReserve.sol/OutpostReserve.dbg.json +4 -0
  192. package/src/assets/ethereum/hoodi/outpost/OutpostReserve.sol/OutpostReserve.json +888 -0
  193. package/src/assets/ethereum/hoodi/outpost/Pool.sol/Pool.dbg.json +4 -0
  194. package/src/assets/ethereum/hoodi/outpost/Pool.sol/Pool.json +659 -0
  195. package/src/assets/ethereum/hoodi/outpost/Pretoken.sol/Pretoken.dbg.json +4 -0
  196. package/src/assets/ethereum/hoodi/outpost/Pretoken.sol/Pretoken.json +1393 -0
  197. package/src/assets/ethereum/hoodi/outpost/ReceiptNFT.sol/ReceiptNFT.dbg.json +4 -0
  198. package/src/assets/ethereum/hoodi/outpost/ReceiptNFT.sol/ReceiptNFT.json +1738 -0
  199. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapConfirmCodec.dbg.json +4 -0
  200. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapConfirmCodec.json +10 -0
  201. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapFailedCodec.dbg.json +4 -0
  202. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapFailedCodec.json +10 -0
  203. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapRequestCodec.dbg.json +4 -0
  204. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapRequestCodec.json +10 -0
  205. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapSettlementCodec.dbg.json +4 -0
  206. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/InstaswapSettlementCodec.json +10 -0
  207. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalExitConfirmCodec.dbg.json +4 -0
  208. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalExitConfirmCodec.json +10 -0
  209. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalExitFailedCodec.dbg.json +4 -0
  210. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalExitFailedCodec.json +10 -0
  211. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalExitRequestCodec.dbg.json +4 -0
  212. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalExitRequestCodec.json +10 -0
  213. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalStakeDeltaCodec.dbg.json +4 -0
  214. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/PrincipalStakeDeltaCodec.json +10 -0
  215. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/WireYieldHubAssetCodec.dbg.json +4 -0
  216. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/WireYieldHubAssetCodec.json +10 -0
  217. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/WireYieldHubAttestationTypeLib.dbg.json +4 -0
  218. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/WireYieldHubAttestationTypeLib.json +10 -0
  219. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/WireYieldHubAttestations.dbg.json +4 -0
  220. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/WireYieldHubAttestations.json +1437 -0
  221. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/YieldDepositCodec.dbg.json +4 -0
  222. package/src/assets/ethereum/hoodi/outpost/WireYieldHubAttestations.sol/YieldDepositCodec.json +10 -0
  223. package/src/assets/ethereum/hoodi/outpost/interfaces/IPretoken.sol/IPretoken.dbg.json +4 -0
  224. package/src/assets/ethereum/hoodi/outpost/interfaces/IWarrant.sol/IWarrant.dbg.json +4 -0
  225. package/src/assets/ethereum/hoodi/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.dbg.json +4 -0
  226. package/src/assets/ethereum/hoodi/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.dbg.json +4 -0
  227. package/src/assets/ethereum/hoodi/token/ERC1155Token.sol/ERC1155Token.dbg.json +4 -0
  228. package/src/assets/ethereum/hoodi/token/ERC1155Token.sol/ERC1155Token.json +472 -0
  229. package/src/assets/ethereum/hoodi/token/ERC20Token.sol/ERC20Token.dbg.json +4 -0
  230. package/src/assets/ethereum/hoodi/token/ERC20Token.sol/ERC20Token.json +330 -0
  231. package/src/assets/ethereum/hoodi/token/ERC721Token.sol/ERC721Token.dbg.json +4 -0
  232. package/src/assets/ethereum/hoodi/token/ERC721Token.sol/ERC721Token.json +449 -0
  233. package/src/assets/ethereum/hoodi/token/Eman1155.sol/Eman1155.dbg.json +4 -0
  234. package/src/assets/ethereum/hoodi/token/Eman1155.sol/Eman1155.json +560 -0
  235. package/src/assets/ethereum/hoodi/token/Eman20.sol/Eman20.dbg.json +4 -0
  236. package/src/assets/ethereum/hoodi/token/Eman20.sol/Eman20.json +460 -0
  237. package/src/assets/ethereum/hoodi/token/Eman721.sol/Eman721.dbg.json +4 -0
  238. package/src/assets/ethereum/hoodi/token/Eman721.sol/Eman721.json +624 -0
  239. package/src/assets/ethereum/mainnet/common/Base58.sol/Base58.dbg.json +4 -0
  240. package/src/assets/ethereum/mainnet/common/Base58.sol/Base58.json +164 -0
  241. package/src/assets/ethereum/mainnet/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.dbg.json +4 -0
  242. package/src/assets/ethereum/mainnet/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.json +76 -0
  243. package/src/assets/ethereum/mainnet/common/RestrictedCallers.sol/RestrictedCallers.dbg.json +4 -0
  244. package/src/assets/ethereum/mainnet/common/RestrictedCallers.sol/RestrictedCallers.json +10 -0
  245. package/src/assets/ethereum/mainnet/common/iodata.sol/iodata.dbg.json +4 -0
  246. package/src/assets/ethereum/mainnet/common/iodata.sol/iodata.json +618 -0
  247. package/src/assets/ethereum/mainnet/common/iodata_util.sol/iodata_util.dbg.json +4 -0
  248. package/src/assets/ethereum/mainnet/common/iodata_util.sol/iodata_util.json +40 -0
  249. package/src/assets/ethereum/mainnet/common/sysio_data.sol/sysio_data.dbg.json +4 -0
  250. package/src/assets/ethereum/mainnet/common/sysio_data.sol/sysio_data.json +10 -0
  251. package/src/assets/ethereum/mainnet/common/sysio_errors.sol/sysio_errors.dbg.json +4 -0
  252. package/src/assets/ethereum/mainnet/common/sysio_errors.sol/sysio_errors.json +10 -0
  253. package/src/assets/ethereum/mainnet/common/sysio_merkle.sol/sysio_merkle.dbg.json +4 -0
  254. package/src/assets/ethereum/mainnet/common/sysio_merkle.sol/sysio_merkle.json +233 -0
  255. package/src/assets/ethereum/mainnet/common/sysio_name.sol/sysio_name.dbg.json +4 -0
  256. package/src/assets/ethereum/mainnet/common/sysio_name.sol/sysio_name.json +49 -0
  257. package/src/assets/ethereum/mainnet/common/sysio_pubkey.sol/sysio_pubkey.dbg.json +4 -0
  258. package/src/assets/ethereum/mainnet/common/sysio_pubkey.sol/sysio_pubkey.json +64 -0
  259. package/src/assets/ethereum/mainnet/common/sysio_read.sol/sysio_read.dbg.json +4 -0
  260. package/src/assets/ethereum/mainnet/common/sysio_read.sol/sysio_read.json +1458 -0
  261. package/src/assets/ethereum/mainnet/common/sysio_tester.sol/SysioTester.dbg.json +4 -0
  262. package/src/assets/ethereum/mainnet/common/sysio_tester.sol/SysioTester.json +1532 -0
  263. package/src/assets/ethereum/mainnet/common/sysio_verify.sol/sysio_verify.dbg.json +4 -0
  264. package/src/assets/ethereum/mainnet/common/sysio_verify.sol/sysio_verify.json +1525 -0
  265. package/src/assets/ethereum/mainnet/common/sysio_write.sol/sysio_write.dbg.json +4 -0
  266. package/src/assets/ethereum/mainnet/common/sysio_write.sol/sysio_write.json +1076 -0
  267. package/src/assets/ethereum/mainnet/liqEth/BeaconState.sol/BeaconState.dbg.json +4 -0
  268. package/src/assets/ethereum/mainnet/liqEth/BeaconState.sol/BeaconState.json +807 -0
  269. package/src/assets/ethereum/mainnet/liqEth/DepositManager.sol/DepositManagerV2.dbg.json +4 -0
  270. package/src/assets/ethereum/mainnet/liqEth/DepositManager.sol/DepositManagerV2.json +1004 -0
  271. package/src/assets/ethereum/mainnet/liqEth/DepositManager.sol/IStakingModuleBondLocker.dbg.json +4 -0
  272. package/src/assets/ethereum/mainnet/liqEth/DepositManager.sol/IStakingModuleBondLocker.json +29 -0
  273. package/src/assets/ethereum/mainnet/liqEth/KeyBondManager.sol/KeyBondManager.dbg.json +4 -0
  274. package/src/assets/ethereum/mainnet/liqEth/KeyBondManager.sol/KeyBondManager.json +897 -0
  275. package/src/assets/ethereum/mainnet/liqEth/LiqEthAuthority.sol/LiqEthAuthority.dbg.json +4 -0
  276. package/src/assets/ethereum/mainnet/liqEth/LiqEthAuthority.sol/LiqEthAuthority.json +1289 -0
  277. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IDepositContract.dbg.json +4 -0
  278. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IDepositContract.json +39 -0
  279. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IDepositManager.dbg.json +4 -0
  280. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IDepositManager.json +64 -0
  281. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IKeyBondManager.dbg.json +4 -0
  282. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IKeyBondManager.json +189 -0
  283. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +4 -0
  284. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.json +29 -0
  285. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IRewardsERC20.dbg.json +4 -0
  286. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IRewardsERC20.json +319 -0
  287. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +4 -0
  288. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.json +333 -0
  289. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IStakingModule.dbg.json +4 -0
  290. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IStakingModule.json +279 -0
  291. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +4 -0
  292. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.json +129 -0
  293. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +4 -0
  294. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/IWithdrawalRecord.json +66 -0
  295. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/LiqEthCommon.dbg.json +4 -0
  296. package/src/assets/ethereum/mainnet/liqEth/LiqEthCommon.sol/LiqEthCommon.json +10 -0
  297. package/src/assets/ethereum/mainnet/liqEth/LiqEthDeepFreeze.sol/LiqEthDeepFreeze.dbg.json +4 -0
  298. package/src/assets/ethereum/mainnet/liqEth/LiqEthDeepFreeze.sol/LiqEthDeepFreeze.json +236 -0
  299. package/src/assets/ethereum/mainnet/liqEth/LiqEthManaged.sol/LiqEthManaged.dbg.json +4 -0
  300. package/src/assets/ethereum/mainnet/liqEth/LiqEthManaged.sol/LiqEthManaged.json +229 -0
  301. package/src/assets/ethereum/mainnet/liqEth/RewardsERC20.sol/RewardsERC20UpgradeableV2.dbg.json +4 -0
  302. package/src/assets/ethereum/mainnet/liqEth/RewardsERC20.sol/RewardsERC20UpgradeableV2.json +957 -0
  303. package/src/assets/ethereum/mainnet/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeableV2.dbg.json +4 -0
  304. package/src/assets/ethereum/mainnet/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeableV2.json +1020 -0
  305. package/src/assets/ethereum/mainnet/liqEth/StakingLib.sol/StakingLib.dbg.json +4 -0
  306. package/src/assets/ethereum/mainnet/liqEth/StakingLib.sol/StakingLib.json +89 -0
  307. package/src/assets/ethereum/mainnet/liqEth/Yield.sol/YieldOracle.dbg.json +4 -0
  308. package/src/assets/ethereum/mainnet/liqEth/Yield.sol/YieldOracle.json +1376 -0
  309. package/src/assets/ethereum/mainnet/liqEth/liqEth.sol/LiqEthTokenV2.dbg.json +4 -0
  310. package/src/assets/ethereum/mainnet/liqEth/liqEth.sol/LiqEthTokenV2.json +1323 -0
  311. package/src/assets/ethereum/mainnet/liqEth/stakingModule.sol/StakingModuleV2.dbg.json +4 -0
  312. package/src/assets/ethereum/mainnet/liqEth/stakingModule.sol/StakingModuleV2.json +1896 -0
  313. package/src/assets/ethereum/mainnet/liqEth/v1/DepositManager.sol/DepositManager.dbg.json +4 -0
  314. package/src/assets/ethereum/mainnet/liqEth/v1/DepositManager.sol/DepositManager.json +978 -0
  315. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IAccounting.dbg.json +4 -0
  316. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IAccounting.json +176 -0
  317. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IDepositContract.dbg.json +4 -0
  318. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IDepositContract.json +39 -0
  319. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IDepositManager.dbg.json +4 -0
  320. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IDepositManager.json +64 -0
  321. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +4 -0
  322. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/ILiqEthUpgradeable.json +29 -0
  323. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IRewardsERC20.dbg.json +4 -0
  324. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IRewardsERC20.json +249 -0
  325. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +4 -0
  326. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IRewardsERC20Pausable.json +263 -0
  327. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IStakingModule.dbg.json +4 -0
  328. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IStakingModule.json +344 -0
  329. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +4 -0
  330. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IValidatorBalanceVerifier.json +129 -0
  331. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +4 -0
  332. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/IWithdrawalRecord.json +66 -0
  333. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/LiqEthCommon.dbg.json +4 -0
  334. package/src/assets/ethereum/mainnet/liqEth/v1/LiqEthCommon.sol/LiqEthCommon.json +10 -0
  335. package/src/assets/ethereum/mainnet/liqEth/v1/RewardsERC20.sol/RewardsERC20Upgradeable.dbg.json +4 -0
  336. package/src/assets/ethereum/mainnet/liqEth/v1/RewardsERC20.sol/RewardsERC20Upgradeable.json +874 -0
  337. package/src/assets/ethereum/mainnet/liqEth/v1/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.dbg.json +4 -0
  338. package/src/assets/ethereum/mainnet/liqEth/v1/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.json +937 -0
  339. package/src/assets/ethereum/mainnet/liqEth/v1/accounting.sol/Accounting.dbg.json +4 -0
  340. package/src/assets/ethereum/{ABI/liqEth → mainnet/liqEth/v1}/accounting.sol/Accounting.json +3 -3
  341. package/src/assets/ethereum/mainnet/liqEth/v1/liqEth.sol/LiqEthToken.dbg.json +4 -0
  342. package/src/assets/ethereum/mainnet/liqEth/v1/liqEth.sol/LiqEthToken.json +1233 -0
  343. package/src/assets/ethereum/mainnet/liqEth/v1/stakingModule.sol/StakingModule.dbg.json +4 -0
  344. package/src/assets/ethereum/{ABI/liqEth → mainnet/liqEth/v1}/stakingModule.sol/StakingModule.json +3 -3
  345. package/src/assets/ethereum/mainnet/liqEth/withdrawalQueue.sol/WithdrawalQueue.dbg.json +4 -0
  346. package/src/assets/ethereum/mainnet/liqEth/withdrawalQueue.sol/WithdrawalQueue.json +973 -0
  347. package/src/assets/ethereum/mainnet/liqEth/withdrawalVault.sol/Uint64BE.dbg.json +4 -0
  348. package/src/assets/ethereum/mainnet/liqEth/withdrawalVault.sol/Uint64BE.json +10 -0
  349. package/src/assets/ethereum/mainnet/liqEth/withdrawalVault.sol/WithdrawalVault.dbg.json +4 -0
  350. package/src/assets/ethereum/mainnet/liqEth/withdrawalVault.sol/WithdrawalVault.json +441 -0
  351. package/src/assets/ethereum/mainnet/outpost/BAR.sol/BARV2.dbg.json +4 -0
  352. package/src/assets/ethereum/mainnet/outpost/BAR.sol/BARV2.json +1915 -0
  353. package/src/assets/ethereum/mainnet/outpost/Depositor.sol/DepositorV2.dbg.json +4 -0
  354. package/src/assets/ethereum/mainnet/outpost/Depositor.sol/DepositorV2.json +1845 -0
  355. package/src/assets/ethereum/mainnet/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.dbg.json +4 -0
  356. package/src/assets/ethereum/mainnet/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.json +122 -0
  357. package/src/assets/ethereum/mainnet/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.dbg.json +4 -0
  358. package/src/assets/ethereum/{ABI → mainnet}/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.json +31 -29
  359. package/src/assets/ethereum/mainnet/outpost/OPP.sol/OPP.dbg.json +4 -0
  360. package/src/assets/ethereum/mainnet/outpost/OPPCommon.sol/IOPP.dbg.json +4 -0
  361. package/src/assets/ethereum/mainnet/outpost/OPPCommon.sol/IOPPEndpoint.dbg.json +4 -0
  362. package/src/assets/ethereum/mainnet/outpost/OPPCommon.sol/IOPPEndpoint.json +29 -0
  363. package/src/assets/ethereum/mainnet/outpost/OPPCommon.sol/IOPPInbound.dbg.json +4 -0
  364. package/src/assets/ethereum/mainnet/outpost/OPPCommon.sol/IOPPReceiver.dbg.json +4 -0
  365. package/src/assets/ethereum/mainnet/outpost/OPPCommon.sol/IOPPSender.dbg.json +4 -0
  366. package/src/assets/ethereum/mainnet/outpost/OPPCommon.sol/OPPCommon.dbg.json +4 -0
  367. package/src/assets/ethereum/mainnet/outpost/OPPEndpoint.sol/OPPEndpoint.dbg.json +4 -0
  368. package/src/assets/ethereum/mainnet/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.dbg.json +4 -0
  369. package/src/assets/ethereum/mainnet/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.dbg.json +4 -0
  370. package/src/assets/ethereum/mainnet/outpost/OPPErrors.sol/OPPErrors.dbg.json +4 -0
  371. package/src/assets/ethereum/mainnet/outpost/OPPInbound.sol/OPPInbound.dbg.json +4 -0
  372. package/src/assets/ethereum/mainnet/outpost/OPPReceiver.sol/OPPReceiver.dbg.json +4 -0
  373. package/src/assets/ethereum/mainnet/outpost/OPPSender.sol/OPPSender.dbg.json +4 -0
  374. package/src/assets/ethereum/mainnet/outpost/OutpostErrors.sol/OutpostErrors.dbg.json +4 -0
  375. package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostErrors.sol/OutpostErrors.json +33 -18
  376. package/src/assets/ethereum/mainnet/outpost/OutpostManaged.sol/OutpostManaged.dbg.json +4 -0
  377. package/src/assets/ethereum/mainnet/outpost/OutpostManager.sol/OutpostManagerV2.dbg.json +4 -0
  378. package/src/assets/ethereum/mainnet/outpost/OutpostManager.sol/OutpostManagerV2.json +737 -0
  379. package/src/assets/ethereum/mainnet/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.dbg.json +4 -0
  380. package/src/assets/ethereum/mainnet/outpost/OutpostManagerCommon.sol/IOutpostManager.dbg.json +4 -0
  381. package/src/assets/ethereum/mainnet/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.dbg.json +4 -0
  382. package/src/assets/ethereum/mainnet/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.json +29 -0
  383. package/src/assets/ethereum/mainnet/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.dbg.json +4 -0
  384. package/src/assets/ethereum/mainnet/outpost/OutpostOwnable.sol/OutpostOwnable.dbg.json +4 -0
  385. package/src/assets/ethereum/mainnet/outpost/Pool.sol/PoolV2.dbg.json +4 -0
  386. package/src/assets/ethereum/mainnet/outpost/Pool.sol/PoolV2.json +943 -0
  387. package/src/assets/ethereum/mainnet/outpost/Pretoken.sol/PretokenV2.dbg.json +4 -0
  388. package/src/assets/ethereum/mainnet/outpost/Pretoken.sol/PretokenV2.json +1703 -0
  389. package/src/assets/ethereum/mainnet/outpost/ReceiptNFT.sol/ReceiptNFT.dbg.json +4 -0
  390. package/src/assets/ethereum/{ABI → mainnet}/outpost/ReceiptNFT.sol/ReceiptNFT.json +33 -18
  391. package/src/assets/ethereum/mainnet/outpost/interfaces/IPretoken.sol/IPretoken.dbg.json +4 -0
  392. package/src/assets/ethereum/mainnet/outpost/interfaces/IPretoken.sol/IPretoken.json +29 -0
  393. package/src/assets/ethereum/mainnet/outpost/interfaces/IWarrant.sol/IWarrant.dbg.json +4 -0
  394. package/src/assets/ethereum/mainnet/outpost/interfaces/IWarrant.sol/IWarrant.json +29 -0
  395. package/src/assets/ethereum/mainnet/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.dbg.json +4 -0
  396. package/src/assets/ethereum/mainnet/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.json +858 -0
  397. package/src/assets/ethereum/mainnet/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.dbg.json +4 -0
  398. package/src/assets/ethereum/mainnet/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.json +30 -0
  399. package/src/assets/ethereum/mainnet/outpost/v1/BAR.sol/BAR.dbg.json +4 -0
  400. package/src/assets/ethereum/{ABI/outpost → mainnet/outpost/v1}/BAR.sol/BAR.json +34 -19
  401. package/src/assets/ethereum/mainnet/outpost/v1/Depositor.sol/Depositor.dbg.json +4 -0
  402. package/src/assets/ethereum/{ABI/outpost → mainnet/outpost/v1}/Depositor.sol/Depositor.json +34 -19
  403. package/src/assets/ethereum/mainnet/outpost/v1/OutpostManager.sol/OutpostManager.dbg.json +4 -0
  404. package/src/assets/ethereum/{ABI/outpost → mainnet/outpost/v1}/OutpostManager.sol/OutpostManager.json +3 -3
  405. package/src/assets/ethereum/mainnet/outpost/v1/Pool.sol/Pool.dbg.json +4 -0
  406. package/src/assets/ethereum/{ABI/outpost → mainnet/outpost/v1}/Pool.sol/Pool.json +34 -19
  407. package/src/assets/ethereum/mainnet/outpost/v1/Pretoken.sol/Pretoken.dbg.json +4 -0
  408. package/src/assets/ethereum/{ABI/outpost → mainnet/outpost/v1}/Pretoken.sol/Pretoken.json +34 -19
  409. package/src/assets/ethereum/mainnet/token/ERC1155Token.sol/ERC1155Token.dbg.json +4 -0
  410. package/src/assets/ethereum/mainnet/token/ERC1155Token.sol/ERC1155Token.json +472 -0
  411. package/src/assets/ethereum/mainnet/token/ERC20Token.sol/ERC20Token.dbg.json +4 -0
  412. package/src/assets/ethereum/mainnet/token/ERC20Token.sol/ERC20Token.json +330 -0
  413. package/src/assets/ethereum/mainnet/token/ERC721Token.sol/ERC721Token.dbg.json +4 -0
  414. package/src/assets/ethereum/mainnet/token/ERC721Token.sol/ERC721Token.json +449 -0
  415. package/src/assets/solana/devnet/idl/liqsol_core.json +8566 -0
  416. package/src/assets/solana/{idl → devnet/idl}/liqsol_token.json +34 -0
  417. package/src/assets/solana/devnet/idl/transfer_hook.json +490 -0
  418. package/src/assets/solana/{idl → devnet/idl}/validator_leaderboard.json +15 -0
  419. package/src/assets/solana/devnet/types/liqsol_core.ts +8572 -0
  420. package/src/assets/solana/{types → devnet/types}/liqsol_token.ts +34 -0
  421. package/src/assets/solana/devnet/types/transfer_hook.ts +496 -0
  422. package/src/assets/solana/{types → devnet/types}/validator_leaderboard.ts +15 -0
  423. package/src/assets/solana/{idl → mainnet/idl}/liqsol_core.json +669 -420
  424. package/src/assets/solana/mainnet/idl/liqsol_token.json +217 -0
  425. package/src/assets/solana/mainnet/idl/transfer_hook.json +479 -0
  426. package/src/assets/solana/mainnet/idl/validator_leaderboard.json +574 -0
  427. package/src/assets/solana/{types → mainnet/types}/liqsol_core.ts +669 -420
  428. package/src/assets/solana/mainnet/types/liqsol_token.ts +223 -0
  429. package/src/assets/solana/mainnet/types/transfer_hook.ts +485 -0
  430. package/src/assets/solana/mainnet/types/validator_leaderboard.ts +580 -0
  431. package/src/assets/solana/realdevnet/idl/liqsol_core.json +7112 -0
  432. package/src/assets/solana/realdevnet/idl/liqsol_token.json +217 -0
  433. package/src/assets/solana/realdevnet/idl/transfer_hook.json +479 -0
  434. package/src/assets/solana/realdevnet/idl/validator_leaderboard.json +735 -0
  435. package/src/assets/solana/realdevnet/types/liqsol_core.ts +7118 -0
  436. package/src/assets/solana/realdevnet/types/liqsol_token.ts +223 -0
  437. package/src/assets/solana/realdevnet/types/transfer_hook.ts +485 -0
  438. package/src/assets/solana/realdevnet/types/validator_leaderboard.ts +741 -0
  439. package/src/index.ts +2 -2
  440. package/src/networks/ethereum/clients/convert.client.ts +35 -1
  441. package/src/networks/ethereum/clients/opp.client.ts +20 -21
  442. package/src/networks/ethereum/clients/receipt.client.ts +93 -23
  443. package/src/networks/ethereum/clients/stake.client.ts +192 -20
  444. package/src/networks/ethereum/clients/validator.client.ts +61 -0
  445. package/src/networks/ethereum/contract.ts +421 -235
  446. package/src/networks/ethereum/ethereum.ts +342 -127
  447. package/src/networks/ethereum/types.ts +41 -13
  448. package/src/networks/solana/clients/convert.client.ts +341 -0
  449. package/src/networks/solana/clients/distribution.client.ts +131 -24
  450. package/src/networks/solana/clients/leaderboard.client.ts +10 -13
  451. package/src/networks/solana/clients/outpost.client.ts +110 -78
  452. package/src/networks/solana/clients/token.client.ts +20 -15
  453. package/src/networks/solana/constants.ts +56 -285
  454. package/src/networks/solana/program.ts +446 -28
  455. package/src/networks/solana/solana.ts +817 -404
  456. package/src/networks/solana/types.ts +41 -15
  457. package/src/networks/solana/utils.ts +56 -305
  458. package/src/staker.ts +24 -4
  459. package/src/types.ts +94 -22
  460. package/src/assets/ethereum/ABI/common/Base58.sol/Base58.dbg.json +0 -4
  461. package/src/assets/ethereum/ABI/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.dbg.json +0 -4
  462. package/src/assets/ethereum/ABI/common/RestrictedCallers.sol/RestrictedCallers.dbg.json +0 -4
  463. package/src/assets/ethereum/ABI/common/iodata.sol/iodata.dbg.json +0 -4
  464. package/src/assets/ethereum/ABI/common/iodata_util.sol/iodata_util.dbg.json +0 -4
  465. package/src/assets/ethereum/ABI/common/sysio_data.sol/sysio_data.dbg.json +0 -4
  466. package/src/assets/ethereum/ABI/common/sysio_errors.sol/sysio_errors.dbg.json +0 -4
  467. package/src/assets/ethereum/ABI/common/sysio_merkle.sol/sysio_merkle.dbg.json +0 -4
  468. package/src/assets/ethereum/ABI/common/sysio_name.sol/sysio_name.dbg.json +0 -4
  469. package/src/assets/ethereum/ABI/common/sysio_pubkey.sol/sysio_pubkey.dbg.json +0 -4
  470. package/src/assets/ethereum/ABI/common/sysio_read.sol/sysio_read.dbg.json +0 -4
  471. package/src/assets/ethereum/ABI/common/sysio_tester.sol/SysioTester.dbg.json +0 -4
  472. package/src/assets/ethereum/ABI/common/sysio_verify.sol/sysio_verify.dbg.json +0 -4
  473. package/src/assets/ethereum/ABI/common/sysio_write.sol/sysio_write.dbg.json +0 -4
  474. package/src/assets/ethereum/ABI/liqEth/BeaconState.sol/BeaconState.dbg.json +0 -4
  475. package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.dbg.json +0 -4
  476. package/src/assets/ethereum/ABI/liqEth/LiqEthAuthority.sol/LiqEthAuthority.dbg.json +0 -4
  477. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IAccounting.dbg.json +0 -4
  478. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositContract.dbg.json +0 -4
  479. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositManager.dbg.json +0 -4
  480. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +0 -4
  481. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20.dbg.json +0 -4
  482. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +0 -4
  483. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IStakingModule.dbg.json +0 -4
  484. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +0 -4
  485. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +0 -4
  486. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/LiqEthCommon.dbg.json +0 -4
  487. package/src/assets/ethereum/ABI/liqEth/LiqEthManaged.sol/LiqEthManaged.dbg.json +0 -4
  488. package/src/assets/ethereum/ABI/liqEth/RewardsERC20.sol/RewardsERC20Upgradeable.dbg.json +0 -4
  489. package/src/assets/ethereum/ABI/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.dbg.json +0 -4
  490. package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.dbg.json +0 -4
  491. package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.dbg.json +0 -4
  492. package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.dbg.json +0 -4
  493. package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.json +0 -1202
  494. package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.dbg.json +0 -4
  495. package/src/assets/ethereum/ABI/liqEth/withdrawalQueue.sol/WithdrawalQueue.dbg.json +0 -4
  496. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.dbg.json +0 -4
  497. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.dbg.json +0 -4
  498. package/src/assets/ethereum/ABI/outpost/Aggregator.sol/Aggregator.json +0 -82
  499. package/src/assets/ethereum/ABI/outpost/BAR.sol/BAR.dbg.json +0 -4
  500. package/src/assets/ethereum/ABI/outpost/Depositor.sol/Depositor.dbg.json +0 -4
  501. package/src/assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.dbg.json +0 -4
  502. package/src/assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.dbg.json +0 -4
  503. package/src/assets/ethereum/ABI/outpost/OPP.sol/OPP.dbg.json +0 -4
  504. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPP.dbg.json +0 -4
  505. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPEndpoint.dbg.json +0 -4
  506. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPInbound.dbg.json +0 -4
  507. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPReceiver.dbg.json +0 -4
  508. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPSender.dbg.json +0 -4
  509. package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/OPPCommon.dbg.json +0 -4
  510. package/src/assets/ethereum/ABI/outpost/OPPEndpoint.sol/OPPEndpoint.dbg.json +0 -4
  511. package/src/assets/ethereum/ABI/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.dbg.json +0 -4
  512. package/src/assets/ethereum/ABI/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.dbg.json +0 -4
  513. package/src/assets/ethereum/ABI/outpost/OPPErrors.sol/OPPErrors.dbg.json +0 -4
  514. package/src/assets/ethereum/ABI/outpost/OPPInbound.sol/OPPInbound.dbg.json +0 -4
  515. package/src/assets/ethereum/ABI/outpost/OPPReceiver.sol/OPPReceiver.dbg.json +0 -4
  516. package/src/assets/ethereum/ABI/outpost/OPPSender.sol/OPPSender.dbg.json +0 -4
  517. package/src/assets/ethereum/ABI/outpost/OutpostErrors.sol/OutpostErrors.dbg.json +0 -4
  518. package/src/assets/ethereum/ABI/outpost/OutpostManaged.sol/OutpostManaged.dbg.json +0 -4
  519. package/src/assets/ethereum/ABI/outpost/OutpostManager.sol/OutpostManager.dbg.json +0 -4
  520. package/src/assets/ethereum/ABI/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.dbg.json +0 -4
  521. package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/IOutpostManager.dbg.json +0 -4
  522. package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.dbg.json +0 -4
  523. package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.dbg.json +0 -4
  524. package/src/assets/ethereum/ABI/outpost/OutpostOwnable.sol/OutpostOwnable.dbg.json +0 -4
  525. package/src/assets/ethereum/ABI/outpost/Pool.sol/Pool.dbg.json +0 -4
  526. package/src/assets/ethereum/ABI/outpost/Pretoken.sol/Pretoken.dbg.json +0 -4
  527. package/src/assets/ethereum/ABI/outpost/ReceiptNFT.sol/ReceiptNFT.dbg.json +0 -4
  528. package/src/assets/ethereum/ABI/outpost/interfaces/IPretoken.sol/IPretoken.dbg.json +0 -4
  529. package/src/assets/ethereum/ABI/outpost/interfaces/IWarrant.sol/IWarrant.dbg.json +0 -4
  530. package/src/assets/ethereum/ABI/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.dbg.json +0 -4
  531. package/src/assets/ethereum/ABI/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.dbg.json +0 -4
  532. package/src/assets/ethereum/ABI/token/ERC1155Token.sol/ERC1155Token.dbg.json +0 -4
  533. package/src/assets/ethereum/ABI/token/ERC1155Token.sol/ERC1155Token.json +0 -472
  534. package/src/assets/ethereum/ABI/token/ERC20Token.sol/ERC20Token.dbg.json +0 -4
  535. package/src/assets/ethereum/ABI/token/ERC20Token.sol/ERC20Token.json +0 -330
  536. package/src/assets/ethereum/ABI/token/ERC721Token.sol/ERC721Token.dbg.json +0 -4
  537. package/src/assets/ethereum/ABI/token/ERC721Token.sol/ERC721Token.json +0 -449
  538. package/src/assets/solana/idl/transfer_hook.json +0 -197
  539. package/src/assets/solana/types/transfer_hook.ts +0 -203
  540. package/src/networks/solana/clients/deposit.client.ts +0 -292
  541. /package/src/assets/ethereum/{ABI → hoodi}/common/Base58.sol/Base58.json +0 -0
  542. /package/src/assets/ethereum/{ABI → hoodi}/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.json +0 -0
  543. /package/src/assets/ethereum/{ABI → hoodi}/common/RestrictedCallers.sol/RestrictedCallers.json +0 -0
  544. /package/src/assets/ethereum/{ABI → hoodi}/common/iodata.sol/iodata.json +0 -0
  545. /package/src/assets/ethereum/{ABI → hoodi}/common/iodata_util.sol/iodata_util.json +0 -0
  546. /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_data.sol/sysio_data.json +0 -0
  547. /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_errors.sol/sysio_errors.json +0 -0
  548. /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_merkle.sol/sysio_merkle.json +0 -0
  549. /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_name.sol/sysio_name.json +0 -0
  550. /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_pubkey.sol/sysio_pubkey.json +0 -0
  551. /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_read.sol/sysio_read.json +0 -0
  552. /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_tester.sol/SysioTester.json +0 -0
  553. /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_verify.sol/sysio_verify.json +0 -0
  554. /package/src/assets/ethereum/{ABI → hoodi}/common/sysio_write.sol/sysio_write.json +0 -0
  555. /package/src/assets/ethereum/{ABI → hoodi}/liqEth/BeaconState.sol/BeaconState.json +0 -0
  556. /package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthAuthority.sol/LiqEthAuthority.json +0 -0
  557. /package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthCommon.sol/IDepositContract.json +0 -0
  558. /package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthCommon.sol/IDepositManager.json +0 -0
  559. /package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.json +0 -0
  560. /package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.json +0 -0
  561. /package/src/assets/ethereum/{ABI → hoodi}/liqEth/LiqEthCommon.sol/IWithdrawalRecord.json +0 -0
  562. /package/src/assets/ethereum/{ABI → hoodi}/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.json +0 -0
  563. /package/src/assets/ethereum/{ABI → hoodi}/outpost/OPPCommon.sol/IOPPEndpoint.json +0 -0
  564. /package/src/assets/ethereum/{ABI → hoodi}/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.json +0 -0
  565. /package/src/assets/ethereum/{ABI → hoodi}/outpost/interfaces/IPretoken.sol/IPretoken.json +0 -0
  566. /package/src/assets/ethereum/{ABI → hoodi}/outpost/interfaces/IWarrant.sol/IWarrant.json +0 -0
  567. /package/src/assets/ethereum/{ABI → hoodi}/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.json +0 -0
  568. /package/src/assets/ethereum/{ABI → hoodi}/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.json +0 -0
  569. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPP.sol/OPP.json +0 -0
  570. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPP.json +0 -0
  571. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPPInbound.json +0 -0
  572. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPPReceiver.json +0 -0
  573. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPPSender.json +0 -0
  574. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/OPPCommon.json +0 -0
  575. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPEndpoint.sol/OPPEndpoint.json +0 -0
  576. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.json +0 -0
  577. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.json +0 -0
  578. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPErrors.sol/OPPErrors.json +0 -0
  579. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPInbound.sol/OPPInbound.json +0 -0
  580. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPReceiver.sol/OPPReceiver.json +0 -0
  581. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPSender.sol/OPPSender.json +0 -0
  582. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManaged.sol/OutpostManaged.json +0 -0
  583. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.json +0 -0
  584. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManagerCommon.sol/IOutpostManager.json +0 -0
  585. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.json +0 -0
  586. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostOwnable.sol/OutpostOwnable.json +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,28 @@ 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 { DepositClient } from './clients/deposit.client';
45
+ import { ConvertClient } from './clients/convert.client';
36
46
  import { DistributionClient } from './clients/distribution.client';
37
47
  import { LeaderboardClient } from './clients/leaderboard.client';
38
48
  import { OutpostClient } from './clients/outpost.client';
39
49
  import { TokenClient } from './clients/token.client';
40
50
 
41
51
  import {
42
- deriveLiqsolMintPda,
43
- deriveReservePoolPda,
44
- deriveStakeMetricsPda,
45
- deriveVaultPda,
52
+ DEFAULT_AVERAGE_PAY_RATE,
46
53
  INDEX_SCALE,
47
54
  PAY_RATE_SCALE_FACTOR,
48
55
  } from './constants';
49
56
 
50
57
  import { buildSolanaTrancheSnapshot, ceilDiv } from './utils';
51
58
  import { GlobalConfig, PayRateEntry, SolanaTransaction } from './types';
59
+ import { WithdrawReceipt } from '../../types';
52
60
  import { SolanaProgramService } from './program';
61
+ import bs58 from 'bs58';
53
62
 
54
63
  const commitment: Commitment = 'confirmed';
55
64
 
@@ -71,13 +80,16 @@ export class SolanaStakingClient implements IStakingClient {
71
80
  public connection: Connection;
72
81
  public anchor: AnchorProvider;
73
82
 
74
- public depositClient: DepositClient;
83
+ public convertClient: ConvertClient;
75
84
  public distributionClient: DistributionClient;
76
85
  public leaderboardClient: LeaderboardClient;
77
86
  public outpostClient: OutpostClient;
78
87
  public tokenClient: TokenClient;
79
88
  public program: SolanaProgramService
80
89
 
90
+ private smartAccount?: SolPubKey; // PDA (off-curve)
91
+ private signer?: SolPubKey; // on-curve signer
92
+
81
93
  get solPubKey(): SolPubKey {
82
94
  if (!this.pubKey) throw new Error('pubKey is undefined');
83
95
  return new SolPubKey(this.pubKey.data.array);
@@ -87,6 +99,18 @@ export class SolanaStakingClient implements IStakingClient {
87
99
  return this.config.network;
88
100
  }
89
101
 
102
+ get feePayer(): SolPubKey {
103
+ if (this.signer) return this.signer;
104
+ // fallback for normal wallets
105
+ if (this.anchor.wallet.publicKey) return this.anchor.wallet.publicKey;
106
+ throw new Error('No signing authority available');
107
+ }
108
+
109
+ get squadsX(): SquadsXConfig | null {
110
+ const config = this.config.extras?.squadsX;
111
+ return config ?? null;
112
+ }
113
+
90
114
  constructor(private config: StakerConfig) {
91
115
  const adapter = config.provider as BaseSignerWalletAdapter | undefined;
92
116
 
@@ -185,12 +209,13 @@ export class SolanaStakingClient implements IStakingClient {
185
209
  commitment,
186
210
  });
187
211
 
188
- this.depositClient = new DepositClient(this.anchor);
189
- this.distributionClient = new DistributionClient(this.anchor);
190
- this.leaderboardClient = new LeaderboardClient(this.anchor);
191
- this.outpostClient = new OutpostClient(this.anchor);
192
- this.tokenClient = new TokenClient(this.anchor);
193
- this.program = new SolanaProgramService(this.anchor);
212
+ this.program = new SolanaProgramService(this.anchor, config.network.chainId as SolChainID);
213
+
214
+ this.convertClient = new ConvertClient(this.anchor, this.program);
215
+ this.distributionClient = new DistributionClient(this.anchor, this.program);
216
+ this.leaderboardClient = new LeaderboardClient(this.anchor, this.program);
217
+ this.outpostClient = new OutpostClient(this.anchor, this.program);
218
+ this.tokenClient = new TokenClient(this.anchor, this.program);
194
219
  }
195
220
 
196
221
  // ---------------------------------------------------------------------
@@ -203,18 +228,19 @@ export class SolanaStakingClient implements IStakingClient {
203
228
  */
204
229
  async deposit(amountLamports: bigint): Promise<string> {
205
230
  this.ensureUser();
206
- if (amountLamports <= BigInt(0)) {
231
+ if (amountLamports <= BigInt(0))
207
232
  throw new Error('Deposit amount must be greater than zero.');
208
- }
209
233
 
210
- const tx = await this.depositClient.buildDepositTx(amountLamports);
211
- const { tx: prepared, blockhash, lastValidBlockHeight } =
212
- await this.prepareTx(tx);
213
- const signed = await this.signTransaction(prepared);
214
- return await this.sendAndConfirmHttp(signed, {
215
- blockhash,
216
- lastValidBlockHeight,
217
- });
234
+ try {
235
+ const ix = await this.convertClient.buildDepositTx(amountLamports, this.squadsVaultPDA)
236
+ return !!this.squadsX
237
+ ? await this.sendSquadsIxs(ix)
238
+ : await this.buildAndSendIx(ix)
239
+
240
+ } catch (err) {
241
+ console.log(`Failed to deposit Solana: ${err}`);
242
+ throw err;
243
+ }
218
244
  }
219
245
 
220
246
  /**
@@ -229,44 +255,90 @@ export class SolanaStakingClient implements IStakingClient {
229
255
  */
230
256
  async withdraw(amountLamports: bigint): Promise<string> {
231
257
  this.ensureUser();
232
- if (amountLamports <= BigInt(0)) {
258
+ if (amountLamports <= BigInt(0))
233
259
  throw new Error('Withdraw amount must be greater than zero.');
234
- }
235
260
 
236
- const tx = await this.depositClient.buildWithdrawTx(amountLamports);
237
- const { tx: prepared, blockhash, lastValidBlockHeight } =
238
- await this.prepareTx(tx);
239
- const signed = await this.signTransaction(prepared);
240
- return await this.sendAndConfirmHttp(signed, {
241
- blockhash,
242
- lastValidBlockHeight,
243
- });
261
+ try {
262
+ const ix = await this.convertClient.buildWithdrawTx(amountLamports, this.squadsVaultPDA)
263
+ return !!this.squadsX
264
+ ? await this.sendSquadsIxs(ix)
265
+ : await this.buildAndSendIx(ix)
266
+
267
+ } catch (err) {
268
+ console.log(`Failed to withdraw Solana: ${err}`);
269
+ throw err;
270
+ }
244
271
  }
245
272
 
246
273
  /**
247
- * Stake liqSOL into Outpost (liqSOL pool) via liqsol_core::synd.
274
+ * Enumerate withdrawal receipt NFTs held by the user (queued/ready/claimed).
275
+ * Mirrors the ETH getPendingWithdraws helper for UI parity.
248
276
  */
249
- async stake(amountLamports: bigint): Promise<string> {
277
+ async getPendingWithdraws(address?: string): Promise<WithdrawReceipt[]> {
250
278
  this.ensureUser();
279
+ const owner = address ? new SolPubKey(address) :
280
+ this.squadsVaultPDA ?? this.anchor.wallet.publicKey;
281
+ return await this.convertClient.fetchWithdrawReceipts(owner);
282
+ }
251
283
 
252
- if (!amountLamports || amountLamports <= BigInt(0)) {
253
- throw new Error('Stake amount must be greater than zero.');
284
+ /**
285
+ * Claim a withdrawal receipt (burn NFT + receive SOL) via claim_withdraw.
286
+ */
287
+ async claimWithdraw(tokenId: bigint): Promise<string> {
288
+ this.ensureUser();
289
+ const owner = this.squadsVaultPDA ?? this.anchor.wallet.publicKey;
290
+
291
+ try {
292
+ const ix = await this.convertClient.buildClaimWithdrawTx(tokenId, owner);
293
+ return !!this.squadsX
294
+ ? await this.sendSquadsIxs(ix)
295
+ : await this.buildAndSendIx(ix);
296
+ } catch (err) {
297
+ console.log(`Failed to claim withdraw on Solana: ${err}`);
298
+ throw err;
254
299
  }
300
+ }
255
301
 
256
- const user = this.solPubKey;
257
-
258
- // Build compute budget increase instruction
259
- const cuIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 400_000 });
260
-
261
- // Build the Outpost synd instruction
262
- const ix = await this.outpostClient.buildStakeIx(amountLamports, user);
302
+ /**
303
+ * Claim accrued liqSOL distribution rewards (liqsol_core::claim_rewards).
304
+ */
305
+ async claimLiqsolRewards(): Promise<string> {
306
+ this.ensureUser();
307
+ const owner = this.squadsVaultPDA ?? this.anchor.wallet.publicKey;
308
+
309
+ try {
310
+ const ix = await this.distributionClient.buildClaimRewardsIx(owner);
311
+ return !!this.squadsX
312
+ ? await this.sendSquadsIxs(ix)
313
+ : await this.buildAndSendIx(ix);
314
+ } catch (err) {
315
+ console.log(`Failed to claim liqSOL rewards on Solana: ${err}`);
316
+ throw err;
317
+ }
318
+ }
263
319
 
264
- // Wrap in a transaction and send
265
- const tx = new Transaction().add(cuIx, ix);
266
- const prepared = await this.prepareTx(tx);
267
- const signed = await this.signTransaction(prepared.tx);
320
+ /**
321
+ * Stake liqSOL into Outpost (liqSOL → pool) via liqsol_core::synd.
322
+ */
323
+ async stake(amountLamports: bigint, wireAccount?: string): Promise<string> {
324
+ this.ensureUser();
325
+ if (!amountLamports || amountLamports <= BigInt(0))
326
+ throw new Error('Stake amount must be greater than zero.');
268
327
 
269
- return this.sendAndConfirmHttp(signed, prepared);
328
+ try {
329
+ const ix = await this.outpostClient.buildStakeIx(
330
+ amountLamports,
331
+ this.squadsVaultPDA,
332
+ wireAccount,
333
+ )
334
+ return !!this.squadsX
335
+ ? await this.sendSquadsIxs(ix)
336
+ : await this.buildAndSendIx(ix)
337
+
338
+ } catch (err) {
339
+ console.log(`Failed to stake Solana: ${err}`);
340
+ throw err;
341
+ }
270
342
  }
271
343
 
272
344
  /**
@@ -274,25 +346,19 @@ export class SolanaStakingClient implements IStakingClient {
274
346
  */
275
347
  async unstake(amountLamports: bigint): Promise<string> {
276
348
  this.ensureUser();
277
-
278
- if (!amountLamports || amountLamports <= BigInt(0)) {
349
+ if (!amountLamports || amountLamports <= BigInt(0))
279
350
  throw new Error('Unstake amount must be greater than zero.');
280
- }
281
-
282
- const user = this.solPubKey;
283
-
284
- // Build compute budget increase instruction
285
- const cuIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 400_000 });
286
-
287
- // Build the Outpost desynd instruction
288
- const ix = await this.outpostClient.buildUnstakeIx(amountLamports, user);
289
351
 
290
- // Wrap in a transaction and send
291
- const tx = new Transaction().add(cuIx, ix);
292
- const prepared = await this.prepareTx(tx);
293
- const signed = await this.signTransaction(prepared.tx);
294
-
295
- return this.sendAndConfirmHttp(signed, prepared);
352
+ try {
353
+ const ix = await this.outpostClient.buildUnstakeIx(amountLamports, this.squadsVaultPDA)
354
+ return !!this.squadsX
355
+ ? await this.sendSquadsIxs(ix)
356
+ : await this.buildAndSendIx(ix)
357
+ }
358
+ catch (err) {
359
+ console.log(`Failed to unstake Solana: ${err}`);
360
+ throw err;
361
+ }
296
362
  }
297
363
 
298
364
  /**
@@ -303,21 +369,83 @@ export class SolanaStakingClient implements IStakingClient {
303
369
  */
304
370
  async buy(amountLamports: bigint): Promise<string> {
305
371
  this.ensureUser();
306
- if (!amountLamports || amountLamports <= BigInt(0)) {
372
+ if (!amountLamports || amountLamports <= BigInt(0))
307
373
  throw new Error('liqSOL pretoken purchase requires a positive amount.');
374
+
375
+ try {
376
+ const ix = await this.tokenClient.buildPurchaseIx(amountLamports, this.squadsVaultPDA)
377
+ return !!this.squadsX
378
+ ? await this.sendSquadsIxs(ix)
379
+ : await this.buildAndSendIx(ix)
308
380
  }
381
+ catch (err) {
382
+ console.log(`Failed to buy liqSOL pretokens: ${err}`);
383
+ throw err;
384
+ }
385
+ }
309
386
 
310
- const user = this.solPubKey;
311
- const cuIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 400_000 });
312
- const ix = await this.tokenClient.buildPurchaseIx(amountLamports, user);
313
- const tx = new Transaction().add(cuIx, ix);
314
- const { tx: prepared, blockhash, lastValidBlockHeight } =
315
- await this.prepareTx(tx);
316
- const signed = await this.signTransaction(prepared);
317
- return await this.sendAndConfirmHttp(signed, {
318
- blockhash,
319
- lastValidBlockHeight,
320
- });
387
+ /** Deposit SOL to liqSOL, then syndicate that liqSOL in one transaction. Requires enough SOL for the deposit fee. */
388
+ async depositAndStake(amountLamports: bigint, wireAccount?: string): Promise<string> {
389
+ this.ensureUser();
390
+ if (!amountLamports || amountLamports <= BigInt(0))
391
+ throw new Error('Amount must be greater than zero.');
392
+
393
+ try {
394
+ const user = this.squadsVaultPDA ?? this.anchor.wallet.publicKey;
395
+ const depositIx = await this.convertClient.buildDepositTx(amountLamports, user);
396
+ const stakeIx = await this.outpostClient.buildStakeIx(
397
+ amountLamports,
398
+ user,
399
+ wireAccount,
400
+ );
401
+
402
+ return !!this.squadsX
403
+ ? await this.sendSquadsIxs([depositIx, stakeIx])
404
+ : await this.buildAndSendIx([depositIx, stakeIx]);
405
+ } catch (err) {
406
+ console.log(`Failed to deposit and stake: ${err}`);
407
+ throw err;
408
+ }
409
+ }
410
+
411
+ /** Deposit SOL to liqSOL, then buy pretokens with that liqSOL in one transaction. Requires enough SOL for the deposit fee. */
412
+ async depositAndBuy(amountLamports: bigint): 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 purchaseIx = await this.tokenClient.buildPurchaseIx(amountLamports, user);
421
+
422
+ return !!this.squadsX
423
+ ? await this.sendSquadsIxs([depositIx, purchaseIx])
424
+ : await this.buildAndSendIx([depositIx, purchaseIx]);
425
+ } catch (err) {
426
+ console.log(`Failed to deposit and buy: ${err}`);
427
+ throw err;
428
+ }
429
+ }
430
+
431
+ /** Desyndicate liqSOL, then request withdraw in one transaction. */
432
+ async unstakeAndWithdraw(amountLamports: bigint): Promise<string> {
433
+ this.ensureUser();
434
+ if (!amountLamports || amountLamports <= BigInt(0))
435
+ throw new Error('Amount must be greater than zero.');
436
+
437
+ try {
438
+ const user = this.squadsVaultPDA ?? this.anchor.wallet.publicKey;
439
+ const unstakeIx = await this.outpostClient.buildUnstakeIx(amountLamports, user);
440
+ const withdrawIx = await this.convertClient.buildWithdrawTx(amountLamports, user);
441
+
442
+ return !!this.squadsX
443
+ ? await this.sendSquadsIxs([unstakeIx, withdrawIx])
444
+ : await this.buildAndSendIx([unstakeIx, withdrawIx]);
445
+ } catch (err) {
446
+ console.log(`Failed to unstake and withdraw: ${err}`);
447
+ throw err;
448
+ }
321
449
  }
322
450
 
323
451
  /**
@@ -329,175 +457,473 @@ export class SolanaStakingClient implements IStakingClient {
329
457
  * - yield: on-chain index/shares plus an estimated accrued liqSOL yield
330
458
  * - extras: useful internal addresses and raw state for debugging/UX
331
459
  */
332
- async getPortfolio(): Promise<Portfolio> {
460
+ async getPortfolio(address?: string): Promise<Portfolio> {
461
+ // if (!this.pubKey) throw new Error('User pubKey is undefined');
462
+ try {
463
+ const user = address ? new SolPubKey(address) :
464
+ !!this.squadsX ? this.squadsVaultPDA! : this.solPubKey;
465
+
466
+ const reservePoolPDA = this.program.deriveReservePoolPda();
467
+ const vaultPDA = this.program.deriveVaultPda();
468
+ const liqsolMint = this.program.deriveLiqsolMintPda();
469
+
470
+ const userLiqsolAta = getAssociatedTokenAddressSync(
471
+ liqsolMint,
472
+ user,
473
+ true,
474
+ TOKEN_2022_PROGRAM_ID,
475
+ ASSOCIATED_TOKEN_PROGRAM_ID,
476
+ );
477
+
478
+ // NOTE:
479
+ // - nativeLamports: wallet SOL
480
+ // - actualBalResp: liqSOL balance in user ATA
481
+ // - snapshot: Outpost + pretokens + global index/shares
482
+ const [nativeLamports, actualBalResp, snapshot, claimableLamports] = await Promise.all([
483
+ this.connection.getBalance(user, 'confirmed'),
484
+ this.connection
485
+ .getTokenAccountBalance(userLiqsolAta, 'confirmed')
486
+ .catch(() => null),
487
+ this.outpostClient.fetchWireState(user).catch(() => null),
488
+ this.distributionClient.getClaimableLiqsol(user).catch(() => new BN(0)),
489
+ ]);
490
+
491
+ const LIQSOL_DECIMALS = 9;
492
+
493
+ const actualAmountStr = actualBalResp?.value?.amount ?? '0';
494
+
495
+ const globalState = snapshot?.globalState ?? null;
496
+ const outpostAccount = snapshot?.outpostAccount ?? null;
497
+ const trancheState = snapshot?.trancheState ?? null;
498
+ const userPretokenRecord = snapshot?.userPretokenRecord ?? null;
499
+
500
+ // -----------------------------
501
+ // Staked liqSOL (Outpost)
502
+ // -----------------------------
503
+ // This is the liqSOL that has been syndicated into Outpost via `synd`.
504
+ // It lives on the outpost account as `stakedLiqsol`.
505
+ const stakedLiqsolStr =
506
+ outpostAccount?.stakedLiqsol?.toString?.() ?? '0';
507
+
508
+ // -----------------------------
509
+ // WIRE pretokens (1e8 scale)
510
+ // -----------------------------
511
+ // This is NOT stake — it’s the prelaunch WIRE position.
512
+ const wirePretokensStr =
513
+ userPretokenRecord?.totalPretokensPurchased?.toString?.() ??
514
+ '0';
515
+
516
+ // -----------------------------
517
+ // Yield view (index + shares)
518
+ // -----------------------------
519
+ // We expose:
520
+ // - currentIndex: globalState.currentIndex (1e12 scale)
521
+ // - totalShares: globalState.totalShares
522
+ // - userShares: outpostAccount.stakedShares
523
+ // - estimatedClaimLiqsol: floor(userShares * index / INDEX_SCALE)
524
+ // - estimatedYield: max(0, estimatedClaim - stakedLiqsol)
525
+ //
526
+ // This matches the capital-staking math:
527
+ // sharesToTokens(shares, index) = shares * index / INDEX_SCALE
528
+ const currentIndexStr =
529
+ globalState?.currentIndex?.toString?.() ?? '0';
530
+ const totalSharesStr =
531
+ globalState?.totalShares?.toString?.() ?? '0';
532
+ const userSharesStr =
533
+ outpostAccount?.stakedShares?.toString?.() ?? '0';
534
+
535
+ const stakedLiqsol = BigInt(stakedLiqsolStr);
536
+ const currentIndex = BigInt(currentIndexStr);
537
+ const totalShares = BigInt(totalSharesStr);
538
+ const userShares = BigInt(userSharesStr);
539
+
540
+ let estimatedClaim = BigInt(0);
541
+ let estimatedYield = BigInt(0);
542
+
543
+ if (userShares > BigInt(0) && currentIndex > BigInt(0)) {
544
+ // sharesToTokens(userShares, currentIndex)
545
+ estimatedClaim = (userShares * currentIndex) / INDEX_SCALE;
546
+
547
+ if (estimatedClaim > stakedLiqsol) {
548
+ estimatedYield = estimatedClaim - stakedLiqsol;
549
+ }
550
+ }
551
+
552
+ return {
553
+ native: {
554
+ amount: BigInt(nativeLamports),
555
+ symbol: 'SOL',
556
+ decimals: 9,
557
+ },
558
+ liq: {
559
+ amount: BigInt(actualAmountStr),
560
+ symbol: 'LiqSOL',
561
+ decimals: LIQSOL_DECIMALS,
562
+ ata: userLiqsolAta,
563
+ },
564
+ claimable: {
565
+ amount: BigInt(claimableLamports.toString()),
566
+ symbol: 'LiqSOL',
567
+ decimals: LIQSOL_DECIMALS,
568
+ ata: userLiqsolAta,
569
+ },
570
+ staked: {
571
+ // liqSOL staked in Outpost via `synd`
572
+ amount: stakedLiqsol,
573
+ symbol: 'LiqSOL',
574
+ decimals: LIQSOL_DECIMALS,
575
+ },
576
+ wire: {
577
+ // Prelaunch WIRE pretokens (1e8 scale)
578
+ amount: BigInt(wirePretokensStr),
579
+ symbol: '$WIRE',
580
+ decimals: 8,
581
+ },
582
+ yield: {
583
+ // Raw primitives so the frontend can display curves, charts, etc.
584
+ currentIndex,
585
+ indexScale: INDEX_SCALE,
586
+ totalShares,
587
+ userShares,
588
+ // liqSOL amounts (lamports) implied by index/shares
589
+ estimatedClaim,
590
+ estimatedYield,
591
+ },
592
+ extras: {
593
+ userLiqsolAta: userLiqsolAta.toBase58(),
594
+ reservePoolPDA: reservePoolPDA.toBase58(),
595
+ vaultPDA: vaultPDA.toBase58(),
596
+ globalIndex: globalState?.currentIndex?.toString(),
597
+ totalShares: globalState?.totalShares?.toString(),
598
+ currentTrancheNumber:
599
+ trancheState?.currentTrancheNumber?.toString(),
600
+ currentTranchePriceUsd:
601
+ trancheState?.currentTranchePriceUsd?.toString(), // 1e8 USD
602
+ },
603
+ chainID: this.network.chainId,
604
+ };
605
+ }
606
+ catch (err) {
607
+ console.log(`Failed to get Solana portfolio: ${err}`);
608
+ throw err;
609
+ }
610
+ }
611
+
612
+ /**
613
+ * Convenience helper to fetch the distribution userRecord for the current user.
614
+ * Used by balance-correction flows and debugging.
615
+ */
616
+ async getUserRecord() {
333
617
  if (!this.pubKey) throw new Error('User pubKey is undefined');
618
+ return this.distributionClient.getUserRecord(this.solPubKey);
619
+ }
334
620
 
335
- const user = this.solPubKey;
621
+ // ---------------------------------------------------------------------
622
+ // SquadsX Helpers
623
+ // ---------------------------------------------------------------------
336
624
 
337
- const reservePoolPDA = deriveReservePoolPda();
338
- const vaultPDA = deriveVaultPda();
339
- const liqsolMint = deriveLiqsolMintPda();
625
+ get squadsMultisigPDA(): SolPubKey | undefined {
626
+ if (!this.squadsX) return undefined;
627
+ return new SolPubKey(this.squadsX.multisigPDA);
628
+ }
340
629
 
341
- const userLiqsolAta = getAssociatedTokenAddressSync(
342
- liqsolMint,
343
- user,
344
- false,
345
- TOKEN_2022_PROGRAM_ID,
346
- ASSOCIATED_TOKEN_PROGRAM_ID,
347
- );
630
+ get squadsVaultPDA(): SolPubKey | undefined {
631
+ if (!this.squadsX || !this.squadsMultisigPDA) return undefined;
632
+ const multisigPda = this.squadsMultisigPDA;
633
+ const index = this.squadsX.vaultIndex ?? 0;
634
+ const pda = multisig.getVaultPda({ multisigPda, index });
635
+ return pda[0];
636
+ }
348
637
 
349
- // NOTE:
350
- // - nativeLamports: wallet SOL
351
- // - actualBalResp: liqSOL balance in user ATA
352
- // - snapshot: Outpost + pretokens + global index/shares
353
- const [nativeLamports, actualBalResp, snapshot] = await Promise.all([
354
- this.connection.getBalance(user, 'confirmed'),
355
- this.connection
356
- .getTokenAccountBalance(userLiqsolAta, 'confirmed')
357
- .catch(() => null),
358
- this.outpostClient.fetchWireState(user).catch(() => null),
359
- ]);
638
+ /** Create a Squads vault transaction/proposal for one or more instructions. */
639
+ private async sendSquadsIxs(ix: TransactionInstruction | TransactionInstruction[]): Promise<string> {
640
+ if (!this.squadsX) throw new Error('Attempting to wrap Squads instruction without SquadsX config');
641
+
642
+ const ixs = Array.isArray(ix) ? ix : [ix];
643
+ const multisigPda = this.squadsMultisigPDA!;
644
+ const vaultPda = this.squadsVaultPDA!;
645
+ const vaultIndex = this.squadsX?.vaultIndex ?? 0;
646
+ const creator = this.solPubKey;
647
+
648
+ const ms = await multisig.accounts.Multisig.fromAccountAddress(this.connection, multisigPda);
649
+ const current = BigInt(ms.transactionIndex?.toString() ?? 0);
650
+ const transactionIndex = current + BigInt(1);
651
+
652
+ const altAddress = this.program.PROGRAM_IDS.ALT;
653
+ const altAccount = await this.connection.getAddressLookupTable(altAddress);
654
+ if (!altAccount.value) throw new Error("ALT not found on-chain or not yet active.");
655
+
656
+ const lookupTable: AddressLookupTableAccount = altAccount.value;
657
+ const computeLimitIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 600_000 });
658
+ const computePriceIx = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 2000 });
659
+
660
+ const { blockhash } = await this.connection.getLatestBlockhash("confirmed");
661
+ const transactionMessage = new TransactionMessage({
662
+ payerKey: vaultPda,
663
+ recentBlockhash: blockhash,
664
+ instructions: [computeLimitIx, computePriceIx, ...ixs],
665
+ });
360
666
 
361
- const LIQSOL_DECIMALS = 9;
362
-
363
- const actualAmountStr = actualBalResp?.value?.amount ?? '0';
364
-
365
- const globalState = snapshot?.globalState ?? null;
366
- const outpostAccount = snapshot?.outpostAccount ?? null;
367
- const trancheState = snapshot?.trancheState ?? null;
368
- const userPretokenRecord = snapshot?.userPretokenRecord ?? null;
369
-
370
- // -----------------------------
371
- // Staked liqSOL (Outpost)
372
- // -----------------------------
373
- // This is the liqSOL that has been syndicated into Outpost via `synd`.
374
- // It lives on the outpost account as `stakedLiqsol`.
375
- const stakedLiqsolStr =
376
- outpostAccount?.stakedLiqsol?.toString?.() ?? '0';
377
-
378
- // -----------------------------
379
- // WIRE pretokens (1e8 scale)
380
- // -----------------------------
381
- // This is NOT stake — it’s the prelaunch WIRE position.
382
- const wirePretokensStr =
383
- userPretokenRecord?.totalPretokensPurchased?.toString?.() ??
384
- '0';
385
-
386
- // -----------------------------
387
- // Yield view (index + shares)
388
- // -----------------------------
389
- // We expose:
390
- // - currentIndex: globalState.currentIndex (1e12 scale)
391
- // - totalShares: globalState.totalShares
392
- // - userShares: outpostAccount.stakedShares
393
- // - estimatedClaimLiqsol: floor(userShares * index / INDEX_SCALE)
394
- // - estimatedYield: max(0, estimatedClaim - stakedLiqsol)
395
- //
396
- // This matches the capital-staking math:
397
- // sharesToTokens(shares, index) = shares * index / INDEX_SCALE
398
- const currentIndexStr =
399
- globalState?.currentIndex?.toString?.() ?? '0';
400
- const totalSharesStr =
401
- globalState?.totalShares?.toString?.() ?? '0';
402
- const userSharesStr =
403
- outpostAccount?.stakedShares?.toString?.() ?? '0';
404
-
405
- const stakedLiqsol = BigInt(stakedLiqsolStr);
406
- const currentIndex = BigInt(currentIndexStr);
407
- const totalShares = BigInt(totalSharesStr);
408
- const userShares = BigInt(userSharesStr);
409
-
410
- let estimatedClaim = BigInt(0);
411
- let estimatedYield = BigInt(0);
412
-
413
- if (userShares > BigInt(0) && currentIndex > BigInt(0)) {
414
- // sharesToTokens(userShares, currentIndex)
415
- estimatedClaim = (userShares * currentIndex) / INDEX_SCALE;
416
-
417
- if (estimatedClaim > stakedLiqsol) {
418
- estimatedYield = estimatedClaim - stakedLiqsol;
667
+ const createVaultTxIx = await multisig.instructions.vaultTransactionCreate({
668
+ multisigPda,
669
+ transactionIndex,
670
+ creator,
671
+ vaultIndex,
672
+ transactionMessage,
673
+ ephemeralSigners: 0,
674
+ addressLookupTableAccounts: [lookupTable],
675
+ });
676
+
677
+ const vaultTransactionCreate = await this.buildAndSendIx(createVaultTxIx)
678
+ console.log('SQUADSX: vaultTransactionCreate', vaultTransactionCreate);
679
+
680
+ const createProposalIx = await multisig.instructions.proposalCreate({
681
+ multisigPda,
682
+ transactionIndex,
683
+ creator,
684
+ });
685
+
686
+ const proposalCreate = await this.buildAndSendIx(createProposalIx)
687
+ console.log('SQUADSX: proposalCreate', proposalCreate);
688
+
689
+ return proposalCreate;
690
+ }
691
+
692
+ // async finish(multisigPda: string, transactionIndex: number): Promise<void> {
693
+ // const vaultExecute = await multisig.instructions.vaultTransactionExecute({
694
+ // connection: this.connection,
695
+ // multisigPda: new SolPubKey(multisigPda),
696
+ // transactionIndex: BigInt(transactionIndex),
697
+ // member: this.solPubKey
698
+ // });
699
+
700
+ // const cuIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 400_000 });
701
+ // const tx1 = new Transaction().add(cuIx, vaultExecute.instruction);
702
+ // const prepared1 = await this.prepareTx(tx1);
703
+ // const signed1 = await this.signTransaction(prepared1.tx);
704
+ // const sent1 = await this.sendAndConfirmHttp(signed1, prepared1);
705
+ // console.log('SENT FINISH', sent1);
706
+ // }
707
+
708
+ // ---------------------------------------------------------------------
709
+ // Tx helpers
710
+ // ---------------------------------------------------------------------
711
+
712
+ async buildAndSendIx(ix: TransactionInstruction | TransactionInstruction[]): Promise<string> {
713
+ const ixs = Array.isArray(ix) ? ix : [ix];
714
+ const computeLimitIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 600_000 });
715
+ const computePriceIx = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 2000 });
716
+ const { blockhash, lastValidBlockHeight } =
717
+ await this.connection.getLatestBlockhash('confirmed');
718
+
719
+ const altAddress = this.program.PROGRAM_IDS.ALT;
720
+ const altAccount = await this.connection.getAddressLookupTable(altAddress);
721
+ const lookupTable = altAccount.value;
722
+
723
+ const instructions = [computeLimitIx, computePriceIx, ...ixs];
724
+
725
+ const tx = lookupTable
726
+ ? new VersionedTransaction(
727
+ new TransactionMessage({
728
+ payerKey: this.feePayer,
729
+ recentBlockhash: blockhash,
730
+ instructions,
731
+ }).compileToV0Message([lookupTable]),
732
+ )
733
+ : new Transaction().add(...instructions);
734
+
735
+ const prepared =
736
+ tx instanceof Transaction
737
+ ? await this.prepareTx(tx)
738
+ : { tx, blockhash, lastValidBlockHeight };
739
+
740
+ const signed = await this.signTransaction(prepared.tx);
741
+
742
+ return this.sendAndConfirmHttp(signed, prepared);
743
+ }
744
+
745
+
746
+ /**
747
+ * Send a signed transaction over HTTP RPC.
748
+ *
749
+ * - Returns immediately on successful sendRawTransaction.
750
+ * - If sendRawTransaction throws a SendTransactionError with
751
+ * "already been processed", we treat it as success and
752
+ * just return a derived signature.
753
+ * - No confirmTransaction / polling / blockheight handling.
754
+ */
755
+ private async sendAndConfirmHttp(
756
+ signed: SolanaTransaction,
757
+ _ctx: { blockhash: string; lastValidBlockHeight: number },
758
+ ): Promise<string> {
759
+ this.ensureUser();
760
+
761
+ const rawTx = signed.serialize();
762
+
763
+ try {
764
+ // Normal happy path: RPC accepts the tx and returns a signature
765
+ const signature = await this.connection.sendRawTransaction(rawTx, {
766
+ skipPreflight: false,
767
+ preflightCommitment: commitment,
768
+ maxRetries: 3,
769
+ });
770
+ return signature;
771
+ } catch (e: any) {
772
+ const msg = e?.message ?? '';
773
+ const isSendTxError =
774
+ e instanceof SendTransactionError || e?.name === 'SendTransactionError';
775
+
776
+ // Benign duplicate case: tx is already in the ledger / cache
777
+ if (isSendTxError && msg.includes('already been processed')) {
778
+ console.warn(
779
+ 'sendRawTransaction reports "already been processed"; ' +
780
+ 'treating as success without further confirmation.',
781
+ );
782
+
783
+ // Try to derive a signature from the signed Transaction.
784
+ // If SolanaTransaction is a legacy Transaction, this works.
785
+ const legacy = signed as unknown as Transaction;
786
+ const first = legacy.signatures?.[0]?.signature;
787
+
788
+ if (first) {
789
+ return bs58.encode(first);
790
+ }
791
+
792
+ // Fallback: return a dummy string
793
+ return 'already-processed';
419
794
  }
795
+
796
+ // Any other send error is a real failure
797
+ throw e;
420
798
  }
799
+ }
421
800
 
422
- return {
423
- native: {
424
- amount: BigInt(nativeLamports),
425
- symbol: 'SOL',
426
- decimals: 9,
427
- },
428
- liq: {
429
- amount: BigInt(actualAmountStr),
430
- symbol: 'LiqSOL',
431
- decimals: LIQSOL_DECIMALS,
432
- ata: userLiqsolAta,
433
- },
434
- staked: {
435
- // liqSOL staked in Outpost via `synd`
436
- amount: stakedLiqsol,
437
- symbol: 'LiqSOL',
438
- decimals: LIQSOL_DECIMALS,
439
- },
440
- wire: {
441
- // Prelaunch WIRE pretokens (1e8 scale)
442
- amount: BigInt(wirePretokensStr),
443
- symbol: '$WIRE',
444
- decimals: 8,
445
- },
446
- yield: {
447
- // Raw primitives so the frontend can display curves, charts, etc.
448
- currentIndex,
449
- indexScale: INDEX_SCALE,
450
- totalShares,
451
- userShares,
452
- // liqSOL amounts (lamports) implied by index/shares
453
- estimatedClaim,
454
- estimatedYield,
455
- },
456
- extras: {
457
- userLiqsolAta: userLiqsolAta.toBase58(),
458
- reservePoolPDA: reservePoolPDA.toBase58(),
459
- vaultPDA: vaultPDA.toBase58(),
460
- globalIndex: globalState?.currentIndex?.toString(),
461
- totalShares: globalState?.totalShares?.toString(),
462
- currentTrancheNumber:
463
- trancheState?.currentTrancheNumber?.toString(),
464
- currentTranchePriceUsd:
465
- trancheState?.currentTranchePriceUsd?.toString(), // 1e8 USD
466
- },
467
- chainID: this.network.chainId,
468
- };
801
+ /**
802
+ * Sign a single Solana transaction using the connected wallet adapter.
803
+ */
804
+ async signTransaction(
805
+ tx: SolanaTransaction,
806
+ ): Promise<SolanaTransaction> {
807
+ this.ensureUser();
808
+ return this.anchor.wallet.signTransaction(tx);
469
809
  }
470
810
 
471
811
  /**
472
- * Convenience helper to fetch the distribution userRecord for the current user.
473
- * Used by balance-correction flows and debugging.
812
+ * Generic "fire and forget" send helper if the caller already
813
+ * prepared and signed the transaction.
474
814
  */
475
- async getUserRecord() {
476
- if (!this.pubKey) throw new Error('User pubKey is undefined');
477
- return this.distributionClient.getUserRecord(this.solPubKey);
815
+ async sendTransaction(
816
+ signed: SolanaTransaction,
817
+ ): Promise<TransactionSignature> {
818
+ this.ensureUser();
819
+ return this.anchor.sendAndConfirm(signed);
820
+ }
821
+
822
+ /**
823
+ * Attach recent blockhash + fee payer to a transaction.
824
+ * Required before signing and sending.
825
+ */
826
+ async prepareTx(
827
+ tx: Transaction,
828
+ ): Promise<{
829
+ tx: Transaction;
830
+ blockhash: string;
831
+ lastValidBlockHeight: number;
832
+ }> {
833
+ const { blockhash, lastValidBlockHeight } =
834
+ await this.connection.getLatestBlockhash('confirmed');
835
+ tx.recentBlockhash = blockhash;
836
+ tx.feePayer = this.feePayer;
837
+ return { tx, blockhash, lastValidBlockHeight };
478
838
  }
479
839
 
840
+ /**
841
+ * Guard for all write operations (deposit/withdraw/stake/unstake/buy).
842
+ * Ensures we have a Wire pubKey and an Anchor wallet pubKey, and that they match.
843
+ */
844
+ ensureUser() {
845
+ if (!this.pubKey) throw new Error('User pubKey is undefined');
846
+
847
+ const wallet = this.anchor?.wallet as any;
848
+ const pk = wallet?.publicKey as SolPubKey | undefined;
849
+
850
+ if (!pk) throw new Error('Wallet not connected');
851
+ if (typeof wallet.signTransaction !== 'function') {
852
+ throw new Error('Wallet does not support signTransaction');
853
+ }
854
+
855
+ // if (!this.pubKey || !this.anchor.wallet.publicKey) {
856
+ // throw new Error('User Authorization required: pubKey is undefined');
857
+ // }
858
+ // if (
859
+ // this.solPubKey.toBase58() !==
860
+ // this.anchor.wallet.publicKey.toBase58()
861
+ // ) {
862
+ // throw new Error(
863
+ // 'Write access requires connected wallet to match pubKey',
864
+ // );
865
+ // }
866
+ }
480
867
 
481
868
  // ---------------------------------------------------------------------
482
869
  // READ-ONLY Public Methods
483
870
  // ---------------------------------------------------------------------
484
871
 
872
+ /**
873
+ * Unified, chain-agnostic tranche snapshot for Solana.
874
+ *
875
+ * Uses:
876
+ * - liqsol_core.globalState (currentIndex, totalShares, etc.)
877
+ * - liqsol_core.trancheState (price, supply, total sold, etc.)
878
+ * - PriceHistory/Chainlink SOL/USD via TokenClient.getSolPriceUsdSafe()
879
+ *
880
+ * This is READ-ONLY and works even with no connected wallet.
881
+ */
882
+ async getTrancheSnapshot(chainID: ChainID): Promise<TrancheSnapshot> {
883
+ try {
884
+ const [globalState, trancheState] = await Promise.all([
885
+ this.tokenClient.fetchGlobalState(),
886
+ this.tokenClient.fetchTrancheState(),
887
+ ]);
888
+
889
+ const { price: solPriceUsd, timestamp } =
890
+ await this.tokenClient.getSolPriceUsdSafe();
891
+
892
+ return buildSolanaTrancheSnapshot({
893
+ chainID,
894
+ globalState,
895
+ trancheState,
896
+ solPriceUsd,
897
+ nativePriceTimestamp: timestamp,
898
+ });
899
+ }
900
+ catch (err) {
901
+ console.log(`Failed to build Solana tranche snapshot: ${err}`);
902
+ throw err;
903
+ }
904
+ }
905
+
485
906
  /**
486
907
  * Returns the system APY (percent) for Solana,
487
908
  * using compound interest per epoch and a
488
909
  * cluster-derived epochs-per-year.
489
910
  */
490
911
  async getSystemAPY(): Promise<number> {
491
- // 1) Per-epoch rate (decimal) from on-chain stakeMetrics
492
- const ratePerEpoch = await this.getEpochRateDecimalFromProgram();
493
- // 2) Live epochs-per-year estimate from cluster
494
- const epochsPerYear = await this.getEpochsPerYearFromCluster();
495
- // 3) Compound: (1 + r)^N - 1
496
- const apyDecimal = Math.pow(1 + ratePerEpoch, epochsPerYear) - 1;
497
- // 4) Convert to percent
498
- const apyPercent = apyDecimal * 100;
499
-
500
- return apyPercent;
912
+ try {
913
+ // 1) Per-epoch rate (decimal) from on-chain stakeMetrics
914
+ const ratePerEpoch = await this.getEpochRateDecimalFromProgram();
915
+ // 2) Live epochs-per-year estimate from cluster
916
+ const epochsPerYear = await this.getEpochsPerYearFromCluster();
917
+ // 3) Compound: (1 + r)^N - 1
918
+ const apyDecimal = Math.pow(1 + ratePerEpoch, epochsPerYear) - 1;
919
+ // 4) Convert to percent
920
+ const apyPercent = apyDecimal * 100;
921
+
922
+ return apyPercent;
923
+ } catch (err) {
924
+ console.log(`Failed to compute Solana system APY: ${err}`);
925
+ throw err;
926
+ }
501
927
  }
502
928
 
503
929
  /**
@@ -507,17 +933,47 @@ export class SolanaStakingClient implements IStakingClient {
507
933
  */
508
934
  private async getEpochRateDecimalFromProgram(): Promise<number> {
509
935
  const liqSolCoreProgram = this.program.getProgram('liqsolCore');
510
- const stakeMetricsPda = deriveStakeMetricsPda();
511
- const stakeMetrics =
512
- await liqSolCoreProgram.account.stakeMetrics.fetch(stakeMetricsPda);
936
+ const payRateHistoryPda = this.program.derivePayRateHistoryPda();
937
+
938
+ const payRateHistory =
939
+ await liqSolCoreProgram.account.payRateHistory.fetch(payRateHistoryPda);
940
+
941
+ const totalEntriesAdded = Number(payRateHistory.totalEntriesAdded);
942
+ const maxEntries = Number(payRateHistory.maxEntries);
513
943
 
514
- // solSystemPayRate is stored on-chain with PAY_RATE_SCALE_FACTOR (1e12)
515
- const raw = BigInt(stakeMetrics.solSystemPayRate.toString());
944
+ if (totalEntriesAdded === 0) {
945
+ // No real entries yet, fall back to default
946
+ return Number(DEFAULT_AVERAGE_PAY_RATE) / Number(PAY_RATE_SCALE_FACTOR);
947
+ }
948
+
949
+ const currentIndex = Number(payRateHistory.currentIndex);
950
+
951
+ // Only average entries that have actually been processed (written by add_entry),
952
+ // not the default-initialized slots. After 10+ entries, processedCount === maxEntries.
953
+ const processedCount = Math.min(totalEntriesAdded, maxEntries);
516
954
 
517
- // Convert to JS number in **decimal per epoch** units
518
- const rateDecimal = Number(raw) / Number(PAY_RATE_SCALE_FACTOR);
955
+ let sum = BigInt(0);
956
+ let validCount = 0;
957
+ // Walk backward from most recent entry
958
+ let idx = (currentIndex - 1 + maxEntries) % maxEntries;
959
+
960
+ for (let i = 0; i < processedCount; i++) {
961
+ const entry = payRateHistory.entries[idx];
962
+ const scaledRate = BigInt(entry.scaledRate.toString());
963
+ if (scaledRate > BigInt(0)) {
964
+ sum += scaledRate;
965
+ validCount++;
966
+ }
967
+ idx = (idx - 1 + maxEntries) % maxEntries;
968
+ }
519
969
 
520
- return rateDecimal;
970
+ if (validCount === 0) {
971
+ return Number(DEFAULT_AVERAGE_PAY_RATE) / Number(PAY_RATE_SCALE_FACTOR);
972
+ }
973
+
974
+ // Average the processed entries
975
+ const average = Number(sum / BigInt(validCount));
976
+ return average / Number(PAY_RATE_SCALE_FACTOR);
521
977
  }
522
978
 
523
979
  // Simple cache so we don’t hammer RPC
@@ -602,7 +1058,7 @@ export class SolanaStakingClient implements IStakingClient {
602
1058
  return BigInt(0);
603
1059
  }
604
1060
 
605
- const [avgPayRate, globalConfig]: [BN, GlobalConfig] = await Promise.all([
1061
+ const [avgPayRate, globalConfig]: [BN, GlobalConfig | null] = await Promise.all([
606
1062
  this.distributionClient.getAverageScaledPayRate(windowSize),
607
1063
  this.distributionClient.getGlobalConfig(),
608
1064
  ]);
@@ -633,210 +1089,167 @@ export class SolanaStakingClient implements IStakingClient {
633
1089
  }
634
1090
 
635
1091
  /**
636
- * Unified, chain-agnostic tranche snapshot for Solana.
637
- *
638
- * Uses:
639
- * - liqsol_core.globalState (currentIndex, totalShares, etc.)
640
- * - liqsol_core.trancheState (price, supply, total sold, etc.)
641
- * - PriceHistory/Chainlink SOL/USD via TokenClient.getSolPriceUsdSafe()
642
- *
643
- * This is READ-ONLY and works even with no connected wallet.
644
- */
645
- async getTrancheSnapshot(options?: {
646
- chainID?: ChainID;
647
- windowBefore?: number;
648
- windowAfter?: number;
649
- }): Promise<TrancheSnapshot> {
650
- const {
651
- chainID = SolChainID.WireTestnet,
652
- windowBefore,
653
- windowAfter,
654
- } = options ?? {};
655
-
656
- const [globalState, trancheState] = await Promise.all([
657
- this.tokenClient.fetchGlobalState(),
658
- this.tokenClient.fetchTrancheState(),
659
- ]);
660
-
661
- const { price: solPriceUsd, timestamp } =
662
- await this.tokenClient.getSolPriceUsdSafe();
663
-
664
- return buildSolanaTrancheSnapshot({
665
- chainID,
666
- globalState,
667
- trancheState,
668
- solPriceUsd,
669
- nativePriceTimestamp: timestamp,
670
- ladderWindowBefore: windowBefore,
671
- ladderWindowAfter: windowAfter,
672
- });
673
- }
674
-
675
- /**
676
- * Estimate a conservative SOL buffer (lamports) to leave in the wallet
677
- * so the user can pay fees for the current deposit and at least one
678
- * more transaction, plus a bit extra for future interactions.
1092
+ * Compute a conservative "deposit buffer" in lamports that should be left
1093
+ * in the wallet so that a MAX deposit (balance - buffer) will succeed.
679
1094
  *
680
- * Intended usage in UI:
681
- * const bufferLamports = await client.estimateGasBuffer();
682
- * const maxSpendable = balanceLamports > bufferLamports
683
- * ? balanceLamports - bufferLamports
684
- * : 0n;
1095
+ * It accounts for:
1096
+ * - Runtime tx fees (via cached dummy self-transfer fee)
1097
+ * - Protocol deposit fee (via getDepositFee(amount))
685
1098
  *
686
- * @param options.txCount How many transactions to cover (default 2)
687
- * @param options.safetyMultiplier Extra safety multiplier (default 3x)
688
- * @param options.minBufferLamports Optional override minimum buffer (default ~0.01 SOL)
1099
+ * Intended UI usage:
1100
+ * const buffer = await client.getDepositBuffer();
1101
+ * const balance = portfolio.native.amount;
1102
+ * const maxDeposit = balance > buffer ? balance - buffer : BigInt(0);
689
1103
  */
690
- async estimateGasBuffer(options?: {
691
- txCount?: number;
692
- safetyMultiplier?: number;
693
- minBufferLamports?: bigint;
1104
+ async getDepositBuffer(options?: {
1105
+ txCount?: number; // how many txs to cover in gas buffer (default 2)
1106
+ safetyMultiplier?: number; // safety multiplier on per-tx fee (default 3x)
1107
+ minBufferLamports?: bigint; // minimum gas buffer (default ~0.01 SOL)
1108
+ balanceOverrideLamports?: bigint; // for tests/custom callers
694
1109
  }): Promise<bigint> {
695
1110
  this.ensureUser();
696
1111
 
697
- const payer = this.solPubKey;
1112
+ // -------------------------------------------------------------
1113
+ // 1) Current wallet balance (prefer caller override)
1114
+ // -------------------------------------------------------------
1115
+ const balanceLamports: bigint =
1116
+ options?.balanceOverrideLamports ??
1117
+ BigInt(await this.connection.getBalance(this.feePayer, commitment));
698
1118
 
699
- // 1) Build a small dummy transaction (self-transfer of 0 lamports).
700
- const dummyIx = SystemProgram.transfer({
701
- fromPubkey: payer,
702
- toPubkey: payer,
703
- lamports: 0,
704
- });
1119
+ if (balanceLamports <= BigInt(0)) {
1120
+ return BigInt(0);
1121
+ }
705
1122
 
706
- const tx = new Transaction().add(dummyIx);
707
- const { blockhash } = await this.connection.getLatestBlockhash(commitment);
708
- tx.recentBlockhash = blockhash;
709
- tx.feePayer = payer;
1123
+ // -------------------------------------------------------------
1124
+ // 2) Estimate gas buffer (using cached single-tx fee)
1125
+ // -------------------------------------------------------------
1126
+ let gasBuffer = BigInt(0);
710
1127
 
711
- // 2) Ask the cluster what it would charge in lamports for this tx.
712
- const message = tx.compileMessage();
713
- const feeInfo = await this.connection.getFeeForMessage(message, commitment);
1128
+ try {
1129
+ const singleTxFeeLamports = await this.getSingleTxFeeLamports();
714
1130
 
715
- // Fallback to a conservative default if RPC doesn't give a value.
716
- const singleTxFeeLamports = BigInt(feeInfo.value ?? 5000);
1131
+ const txCount = BigInt(options?.txCount ?? 2);
1132
+ const safetyMultiplier = options?.safetyMultiplier ?? 3;
1133
+ const safetyScaled = BigInt(Math.round(safetyMultiplier * 100)); // e.g. 300
717
1134
 
718
- // 3) How many txs do we want to cover?
719
- // Default: 2 (deposit + one extra operation).
720
- const txCount = BigInt(options?.txCount ?? 2);
1135
+ let buf =
1136
+ (singleTxFeeLamports * txCount * safetyScaled) /
1137
+ BigInt(100);
721
1138
 
722
- // 4) Apply a safety multiplier (default 3x to be very safe).
723
- const safetyMultiplier = options?.safetyMultiplier ?? 3;
724
- const safetyScaled = BigInt(Math.round(safetyMultiplier * 100)); // e.g. 300
1139
+ const defaultMinBufferLamports = BigInt(10_000_000); // ~0.01 SOL
1140
+ const minBufferLamports =
1141
+ options?.minBufferLamports ?? defaultMinBufferLamports;
725
1142
 
726
- let bufferLamports =
727
- (singleTxFeeLamports *
728
- txCount *
729
- safetyScaled) /
730
- BigInt(100);
1143
+ if (buf < minBufferLamports) {
1144
+ buf = minBufferLamports;
1145
+ }
731
1146
 
732
- // 5) Enforce a minimum buffer (default ~0.01 SOL).
733
- const defaultMinBufferLamports = BigInt(10_000_000); // 0.01 SOL (1e9 / 100)
734
- const minBufferLamports =
735
- options?.minBufferLamports ?? defaultMinBufferLamports;
1147
+ gasBuffer = buf;
1148
+ } catch {
1149
+ // If fee estimation fails, just fall back to "no gas buffer".
1150
+ gasBuffer = BigInt(0);
1151
+ }
736
1152
 
737
- if (bufferLamports < minBufferLamports) {
738
- bufferLamports = minBufferLamports;
1153
+ // If gas buffer alone eats the whole balance, we just keep everything.
1154
+ if (balanceLamports <= gasBuffer) {
1155
+ return balanceLamports;
739
1156
  }
740
1157
 
741
- return bufferLamports;
742
- }
1158
+ const spendable = balanceLamports - gasBuffer;
743
1159
 
744
- // ---------------------------------------------------------------------
745
- // Tx helpers
746
- // ---------------------------------------------------------------------
1160
+ // -------------------------------------------------------------
1161
+ // 3) If we can't compute deposit fee, buffer == gasBuffer
1162
+ // -------------------------------------------------------------
1163
+ if (typeof this.getDepositFee !== 'function') {
1164
+ return gasBuffer;
1165
+ }
747
1166
 
748
- /**
749
- * Send a signed transaction over HTTP RPC and wait for confirmation.
750
- * Throws if the transaction fails.
751
- */
752
- private async sendAndConfirmHttp(
753
- signed: SolanaTransaction,
754
- ctx: { blockhash: string; lastValidBlockHeight: number },
755
- ): Promise<string> {
756
- this.ensureUser();
1167
+ // -------------------------------------------------------------
1168
+ // 4) Approximate principal using linear fee model from ONE RPC call
1169
+ //
1170
+ // fee(a) ≈ k * a
1171
+ // want: a + k*a <= spendable → a <= spendable / (1 + k)
1172
+ //
1173
+ // We estimate k from fee(spendable) / spendable.
1174
+ // -------------------------------------------------------------
1175
+ let feeAtSpendable: bigint;
757
1176
 
758
- const signature = await this.connection.sendRawTransaction(
759
- signed.serialize(),
760
- {
761
- skipPreflight: false,
762
- preflightCommitment: commitment,
763
- maxRetries: 3,
764
- },
765
- );
1177
+ try {
1178
+ feeAtSpendable = await this.getDepositFee(spendable);
1179
+ } catch {
1180
+ // If protocol fee lookup fails, fall back to gas-only buffer
1181
+ return gasBuffer;
1182
+ }
766
1183
 
767
- const conf = await this.connection.confirmTransaction(
768
- {
769
- signature,
770
- blockhash: ctx.blockhash,
771
- lastValidBlockHeight: ctx.lastValidBlockHeight,
772
- },
773
- commitment,
774
- );
1184
+ // If there is effectively no protocol fee, keep only gas buffer.
1185
+ if (feeAtSpendable <= BigInt(0)) {
1186
+ return gasBuffer;
1187
+ }
775
1188
 
776
- if (conf.value.err) {
777
- throw new Error(
778
- `Transaction failed: ${JSON.stringify(conf.value.err)}`,
779
- );
1189
+ const s = spendable;
1190
+ const f = feeAtSpendable;
1191
+
1192
+ // denom = s + f = s * (1 + k) (since f ≈ k*s)
1193
+ const denom = s + f;
1194
+ if (denom === BigInt(0)) {
1195
+ return gasBuffer;
780
1196
  }
781
1197
 
782
- return signature;
783
- }
1198
+ // a ≈ floor( s^2 / (s + f) )
1199
+ let a = (s * s) / denom;
784
1200
 
785
- /**
786
- * Sign a single Solana transaction using the connected wallet adapter.
787
- */
788
- async signTransaction(
789
- tx: SolanaTransaction,
790
- ): Promise<SolanaTransaction> {
791
- this.ensureUser();
792
- return this.anchor.wallet.signTransaction(tx);
793
- }
1201
+ // Tiny safety haircut to avoid edge off-by-one lamports
1202
+ const fudge = BigInt(10_000); // 0.00001 SOL
1203
+ let effectivePrincipal =
1204
+ a > fudge ? a - fudge : a;
794
1205
 
795
- /**
796
- * Generic "fire and forget" send helper if the caller already
797
- * prepared and signed the transaction.
798
- */
799
- async sendTransaction(
800
- signed: SolanaTransaction,
801
- ): Promise<TransactionSignature> {
802
- this.ensureUser();
803
- return this.anchor.sendAndConfirm(signed);
804
- }
1206
+ if (effectivePrincipal < BigInt(0)) {
1207
+ effectivePrincipal = BigInt(0);
1208
+ }
805
1209
 
806
- /**
807
- * Attach recent blockhash + fee payer to a transaction.
808
- * Required before signing and sending.
809
- */
810
- async prepareTx(
811
- tx: Transaction,
812
- ): Promise<{
813
- tx: Transaction;
814
- blockhash: string;
815
- lastValidBlockHeight: number;
816
- }> {
817
- const { blockhash, lastValidBlockHeight } =
818
- await this.connection.getLatestBlockhash('confirmed');
819
- tx.recentBlockhash = blockhash;
820
- tx.feePayer = this.solPubKey;
821
- return { tx, blockhash, lastValidBlockHeight };
1210
+ const buffer = balanceLamports > effectivePrincipal
1211
+ ? balanceLamports - effectivePrincipal
1212
+ : balanceLamports;
1213
+
1214
+ // Ensure we never under-reserve gas.
1215
+ return buffer < gasBuffer ? gasBuffer : buffer;
822
1216
  }
823
1217
 
824
- /**
825
- * Guard for all write operations (deposit/withdraw/stake/unstake/buy).
826
- * Ensures we have a Wire pubKey and an Anchor wallet pubKey, and that they match.
827
- */
828
- ensureUser() {
829
- if (!this.pubKey || !this.anchor.wallet.publicKey) {
830
- throw new Error('User Authorization required: pubKey is undefined');
831
- }
832
- if (
833
- this.solPubKey.toBase58() !==
834
- this.anchor.wallet.publicKey.toBase58()
835
- ) {
836
- throw new Error(
837
- 'Write access requires connected wallet to match pubKey',
838
- );
1218
+ private cachedTxFee?: { value: bigint; fetchedAt: number };
1219
+ private static readonly FEE_CACHE_TTL_MS = 60_000; // 60s
1220
+
1221
+ private async getSingleTxFeeLamports(): Promise<bigint> {
1222
+ const now = Date.now();
1223
+
1224
+ if (this.cachedTxFee && now - this.cachedTxFee.fetchedAt < SolanaStakingClient.FEE_CACHE_TTL_MS) {
1225
+ return this.cachedTxFee.value;
839
1226
  }
1227
+
1228
+ const payer = this.feePayer;
1229
+
1230
+ const dummyIx = SystemProgram.transfer({
1231
+ fromPubkey: payer,
1232
+ toPubkey: payer,
1233
+ lamports: 0,
1234
+ });
1235
+
1236
+ const tx = new Transaction().add(dummyIx);
1237
+ const { blockhash } = await this.connection.getLatestBlockhash(commitment);
1238
+ tx.recentBlockhash = blockhash;
1239
+ tx.feePayer = payer;
1240
+
1241
+ const message = tx.compileMessage();
1242
+ const feeInfo = await this.connection.getFeeForMessage(message, commitment);
1243
+
1244
+ const singleTxFeeLamports = BigInt(feeInfo.value ?? 5000);
1245
+
1246
+ this.cachedTxFee = {
1247
+ value: singleTxFeeLamports,
1248
+ fetchedAt: now,
1249
+ };
1250
+
1251
+ return singleTxFeeLamports;
840
1252
  }
841
1253
 
842
- }
1254
+
1255
+ }