@wireio/stake 1.1.0 → 2.0.0

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 (189) hide show
  1. package/lib/stake.browser.js +12942 -6703
  2. package/lib/stake.browser.js.map +1 -1
  3. package/lib/stake.d.ts +7627 -646
  4. package/lib/stake.js +13315 -7071
  5. package/lib/stake.js.map +1 -1
  6. package/lib/stake.m.js +12942 -6703
  7. package/lib/stake.m.js.map +1 -1
  8. package/package.json +4 -3
  9. package/src/assets/solana/mainnet/idl/liqsol_core.json +6166 -0
  10. package/src/assets/solana/mainnet/idl/liqsol_token.json +183 -0
  11. package/src/assets/solana/mainnet/idl/transfer_hook.json +197 -0
  12. package/src/assets/solana/mainnet/idl/validator_leaderboard.json +574 -0
  13. package/src/assets/solana/mainnet/types/liqsol_core.ts +6172 -0
  14. package/src/assets/solana/mainnet/types/liqsol_token.ts +189 -0
  15. package/src/assets/solana/mainnet/types/transfer_hook.ts +203 -0
  16. package/src/assets/solana/mainnet/types/validator_leaderboard.ts +580 -0
  17. package/src/networks/ethereum/clients/convert.client.ts +30 -1
  18. package/src/networks/ethereum/clients/receipt.client.ts +81 -3
  19. package/src/networks/ethereum/clients/stake.client.ts +1 -0
  20. package/src/networks/ethereum/contract.ts +260 -222
  21. package/src/networks/ethereum/ethereum.ts +36 -28
  22. package/src/networks/ethereum/types.ts +17 -2
  23. package/src/networks/solana/clients/deposit.client.ts +294 -65
  24. package/src/networks/solana/clients/distribution.client.ts +13 -18
  25. package/src/networks/solana/clients/leaderboard.client.ts +9 -11
  26. package/src/networks/solana/clients/outpost.client.ts +11 -10
  27. package/src/networks/solana/clients/token.client.ts +11 -13
  28. package/src/networks/solana/constants.ts +44 -285
  29. package/src/networks/solana/program.ts +365 -26
  30. package/src/networks/solana/solana.ts +213 -69
  31. package/src/networks/solana/types.ts +4 -4
  32. package/src/networks/solana/utils.ts +16 -301
  33. package/src/staker.ts +10 -2
  34. package/src/types.ts +19 -6
  35. /package/src/assets/ethereum/{ABI → mainnet}/common/Base58.sol/Base58.dbg.json +0 -0
  36. /package/src/assets/ethereum/{ABI → mainnet}/common/Base58.sol/Base58.json +0 -0
  37. /package/src/assets/ethereum/{ABI → mainnet}/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.dbg.json +0 -0
  38. /package/src/assets/ethereum/{ABI → mainnet}/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.json +0 -0
  39. /package/src/assets/ethereum/{ABI → mainnet}/common/RestrictedCallers.sol/RestrictedCallers.dbg.json +0 -0
  40. /package/src/assets/ethereum/{ABI → mainnet}/common/RestrictedCallers.sol/RestrictedCallers.json +0 -0
  41. /package/src/assets/ethereum/{ABI → mainnet}/common/iodata.sol/iodata.dbg.json +0 -0
  42. /package/src/assets/ethereum/{ABI → mainnet}/common/iodata.sol/iodata.json +0 -0
  43. /package/src/assets/ethereum/{ABI → mainnet}/common/iodata_util.sol/iodata_util.dbg.json +0 -0
  44. /package/src/assets/ethereum/{ABI → mainnet}/common/iodata_util.sol/iodata_util.json +0 -0
  45. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_data.sol/sysio_data.dbg.json +0 -0
  46. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_data.sol/sysio_data.json +0 -0
  47. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_errors.sol/sysio_errors.dbg.json +0 -0
  48. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_errors.sol/sysio_errors.json +0 -0
  49. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_merkle.sol/sysio_merkle.dbg.json +0 -0
  50. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_merkle.sol/sysio_merkle.json +0 -0
  51. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_name.sol/sysio_name.dbg.json +0 -0
  52. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_name.sol/sysio_name.json +0 -0
  53. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_pubkey.sol/sysio_pubkey.dbg.json +0 -0
  54. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_pubkey.sol/sysio_pubkey.json +0 -0
  55. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_read.sol/sysio_read.dbg.json +0 -0
  56. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_read.sol/sysio_read.json +0 -0
  57. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_tester.sol/SysioTester.dbg.json +0 -0
  58. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_tester.sol/SysioTester.json +0 -0
  59. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_verify.sol/sysio_verify.dbg.json +0 -0
  60. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_verify.sol/sysio_verify.json +0 -0
  61. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_write.sol/sysio_write.dbg.json +0 -0
  62. /package/src/assets/ethereum/{ABI → mainnet}/common/sysio_write.sol/sysio_write.json +0 -0
  63. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/BeaconState.sol/BeaconState.dbg.json +0 -0
  64. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/BeaconState.sol/BeaconState.json +0 -0
  65. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/DepositManager.sol/DepositManager.dbg.json +0 -0
  66. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/DepositManager.sol/DepositManager.json +0 -0
  67. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthAuthority.sol/LiqEthAuthority.dbg.json +0 -0
  68. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthAuthority.sol/LiqEthAuthority.json +0 -0
  69. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IAccounting.dbg.json +0 -0
  70. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IAccounting.json +0 -0
  71. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IDepositContract.dbg.json +0 -0
  72. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IDepositContract.json +0 -0
  73. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IDepositManager.dbg.json +0 -0
  74. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IDepositManager.json +0 -0
  75. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +0 -0
  76. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.json +0 -0
  77. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IRewardsERC20.dbg.json +0 -0
  78. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IRewardsERC20.json +0 -0
  79. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +0 -0
  80. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.json +0 -0
  81. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IStakingModule.dbg.json +0 -0
  82. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IStakingModule.json +0 -0
  83. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +0 -0
  84. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.json +0 -0
  85. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +0 -0
  86. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/IWithdrawalRecord.json +0 -0
  87. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/LiqEthCommon.dbg.json +0 -0
  88. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthCommon.sol/LiqEthCommon.json +0 -0
  89. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthManaged.sol/LiqEthManaged.dbg.json +0 -0
  90. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/LiqEthManaged.sol/LiqEthManaged.json +0 -0
  91. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/RewardsERC20.sol/RewardsERC20Upgradeable.dbg.json +0 -0
  92. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/RewardsERC20.sol/RewardsERC20Upgradeable.json +0 -0
  93. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.dbg.json +0 -0
  94. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.json +0 -0
  95. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/Yield.sol/YieldOracle.dbg.json +0 -0
  96. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/Yield.sol/YieldOracle.json +0 -0
  97. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/accounting.sol/Accounting.dbg.json +0 -0
  98. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/accounting.sol/Accounting.json +0 -0
  99. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/liqEth.sol/LiqEthToken.dbg.json +0 -0
  100. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/liqEth.sol/LiqEthToken.json +0 -0
  101. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/stakingModule.sol/StakingModule.dbg.json +0 -0
  102. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/stakingModule.sol/StakingModule.json +0 -0
  103. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/withdrawalQueue.sol/WithdrawalQueue.dbg.json +0 -0
  104. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/withdrawalQueue.sol/WithdrawalQueue.json +0 -0
  105. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/withdrawalVault.sol/Uint64BE.dbg.json +0 -0
  106. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/withdrawalVault.sol/Uint64BE.json +0 -0
  107. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/withdrawalVault.sol/WithdrawalVault.dbg.json +0 -0
  108. /package/src/assets/ethereum/{ABI → mainnet}/liqEth/withdrawalVault.sol/WithdrawalVault.json +0 -0
  109. /package/src/assets/ethereum/{ABI → mainnet}/outpost/Aggregator.sol/Aggregator.json +0 -0
  110. /package/src/assets/ethereum/{ABI → mainnet}/outpost/BAR.sol/BAR.dbg.json +0 -0
  111. /package/src/assets/ethereum/{ABI → mainnet}/outpost/BAR.sol/BAR.json +0 -0
  112. /package/src/assets/ethereum/{ABI → mainnet}/outpost/Depositor.sol/Depositor.dbg.json +0 -0
  113. /package/src/assets/ethereum/{ABI → mainnet}/outpost/Depositor.sol/Depositor.json +0 -0
  114. /package/src/assets/ethereum/{ABI → mainnet}/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.dbg.json +0 -0
  115. /package/src/assets/ethereum/{ABI → mainnet}/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.json +0 -0
  116. /package/src/assets/ethereum/{ABI → mainnet}/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.dbg.json +0 -0
  117. /package/src/assets/ethereum/{ABI → mainnet}/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.json +0 -0
  118. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPP.sol/OPP.dbg.json +0 -0
  119. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPP.sol/OPP.json +0 -0
  120. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPP.dbg.json +0 -0
  121. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPP.json +0 -0
  122. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPPEndpoint.dbg.json +0 -0
  123. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPPEndpoint.json +0 -0
  124. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPPInbound.dbg.json +0 -0
  125. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPPInbound.json +0 -0
  126. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPPReceiver.dbg.json +0 -0
  127. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPPReceiver.json +0 -0
  128. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPPSender.dbg.json +0 -0
  129. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/IOPPSender.json +0 -0
  130. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/OPPCommon.dbg.json +0 -0
  131. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPCommon.sol/OPPCommon.json +0 -0
  132. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPEndpoint.sol/OPPEndpoint.dbg.json +0 -0
  133. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPEndpoint.sol/OPPEndpoint.json +0 -0
  134. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.dbg.json +0 -0
  135. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.json +0 -0
  136. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.dbg.json +0 -0
  137. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.json +0 -0
  138. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPErrors.sol/OPPErrors.dbg.json +0 -0
  139. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPErrors.sol/OPPErrors.json +0 -0
  140. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPInbound.sol/OPPInbound.dbg.json +0 -0
  141. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPInbound.sol/OPPInbound.json +0 -0
  142. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPReceiver.sol/OPPReceiver.dbg.json +0 -0
  143. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPReceiver.sol/OPPReceiver.json +0 -0
  144. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPSender.sol/OPPSender.dbg.json +0 -0
  145. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OPPSender.sol/OPPSender.json +0 -0
  146. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostErrors.sol/OutpostErrors.dbg.json +0 -0
  147. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostErrors.sol/OutpostErrors.json +0 -0
  148. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManaged.sol/OutpostManaged.dbg.json +0 -0
  149. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManaged.sol/OutpostManaged.json +0 -0
  150. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManager.sol/OutpostManager.dbg.json +0 -0
  151. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManager.sol/OutpostManager.json +0 -0
  152. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.dbg.json +0 -0
  153. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.json +0 -0
  154. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManagerCommon.sol/IOutpostManager.dbg.json +0 -0
  155. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManagerCommon.sol/IOutpostManager.json +0 -0
  156. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.dbg.json +0 -0
  157. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.json +0 -0
  158. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.dbg.json +0 -0
  159. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.json +0 -0
  160. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostOwnable.sol/OutpostOwnable.dbg.json +0 -0
  161. /package/src/assets/ethereum/{ABI → mainnet}/outpost/OutpostOwnable.sol/OutpostOwnable.json +0 -0
  162. /package/src/assets/ethereum/{ABI → mainnet}/outpost/Pool.sol/Pool.dbg.json +0 -0
  163. /package/src/assets/ethereum/{ABI → mainnet}/outpost/Pool.sol/Pool.json +0 -0
  164. /package/src/assets/ethereum/{ABI → mainnet}/outpost/Pretoken.sol/Pretoken.dbg.json +0 -0
  165. /package/src/assets/ethereum/{ABI → mainnet}/outpost/Pretoken.sol/Pretoken.json +0 -0
  166. /package/src/assets/ethereum/{ABI → mainnet}/outpost/ReceiptNFT.sol/ReceiptNFT.dbg.json +0 -0
  167. /package/src/assets/ethereum/{ABI → mainnet}/outpost/ReceiptNFT.sol/ReceiptNFT.json +0 -0
  168. /package/src/assets/ethereum/{ABI → mainnet}/outpost/interfaces/IPretoken.sol/IPretoken.dbg.json +0 -0
  169. /package/src/assets/ethereum/{ABI → mainnet}/outpost/interfaces/IPretoken.sol/IPretoken.json +0 -0
  170. /package/src/assets/ethereum/{ABI → mainnet}/outpost/interfaces/IWarrant.sol/IWarrant.dbg.json +0 -0
  171. /package/src/assets/ethereum/{ABI → mainnet}/outpost/interfaces/IWarrant.sol/IWarrant.json +0 -0
  172. /package/src/assets/ethereum/{ABI → mainnet}/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.dbg.json +0 -0
  173. /package/src/assets/ethereum/{ABI → mainnet}/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.json +0 -0
  174. /package/src/assets/ethereum/{ABI → mainnet}/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.dbg.json +0 -0
  175. /package/src/assets/ethereum/{ABI → mainnet}/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.json +0 -0
  176. /package/src/assets/ethereum/{ABI → mainnet}/token/ERC1155Token.sol/ERC1155Token.dbg.json +0 -0
  177. /package/src/assets/ethereum/{ABI → mainnet}/token/ERC1155Token.sol/ERC1155Token.json +0 -0
  178. /package/src/assets/ethereum/{ABI → mainnet}/token/ERC20Token.sol/ERC20Token.dbg.json +0 -0
  179. /package/src/assets/ethereum/{ABI → mainnet}/token/ERC20Token.sol/ERC20Token.json +0 -0
  180. /package/src/assets/ethereum/{ABI → mainnet}/token/ERC721Token.sol/ERC721Token.dbg.json +0 -0
  181. /package/src/assets/ethereum/{ABI → mainnet}/token/ERC721Token.sol/ERC721Token.json +0 -0
  182. /package/src/assets/solana/{idl → devnet/idl}/liqsol_core.json +0 -0
  183. /package/src/assets/solana/{idl → devnet/idl}/liqsol_token.json +0 -0
  184. /package/src/assets/solana/{idl → devnet/idl}/transfer_hook.json +0 -0
  185. /package/src/assets/solana/{idl → devnet/idl}/validator_leaderboard.json +0 -0
  186. /package/src/assets/solana/{types → devnet/types}/liqsol_core.ts +0 -0
  187. /package/src/assets/solana/{types → devnet/types}/liqsol_token.ts +0 -0
  188. /package/src/assets/solana/{types → devnet/types}/transfer_hook.ts +0 -0
  189. /package/src/assets/solana/{types → devnet/types}/validator_leaderboard.ts +0 -0
@@ -0,0 +1,580 @@
1
+ /**
2
+ * Program IDL in camelCase format in order to be used in JS/TS.
3
+ *
4
+ * Note that this is only a type helper and is not the actual IDL. The original
5
+ * IDL can be found at `target/idl/validator_leaderboard.json`.
6
+ */
7
+ export type ValidatorLeaderboard = {
8
+ "address": "5v7mWL1735qp2Th9B5WNf7spGynR5ZaxwyCYoQw13DP2",
9
+ "metadata": {
10
+ "name": "validatorLeaderboard",
11
+ "version": "0.1.0",
12
+ "spec": "0.1.0",
13
+ "description": "Created with Anchor"
14
+ },
15
+ "instructions": [
16
+ {
17
+ "name": "initializeLeaderboard",
18
+ "discriminator": [
19
+ 47,
20
+ 23,
21
+ 34,
22
+ 39,
23
+ 46,
24
+ 108,
25
+ 91,
26
+ 176
27
+ ],
28
+ "accounts": [
29
+ {
30
+ "name": "authority",
31
+ "writable": true,
32
+ "signer": true
33
+ },
34
+ {
35
+ "name": "leaderboardState",
36
+ "writable": true
37
+ },
38
+ {
39
+ "name": "systemProgram"
40
+ }
41
+ ],
42
+ "args": []
43
+ },
44
+ {
45
+ "name": "reallocLeaderboard",
46
+ "discriminator": [
47
+ 2,
48
+ 70,
49
+ 106,
50
+ 94,
51
+ 81,
52
+ 225,
53
+ 113,
54
+ 152
55
+ ],
56
+ "accounts": [
57
+ {
58
+ "name": "leaderboardState",
59
+ "writable": true
60
+ },
61
+ {
62
+ "name": "payer",
63
+ "writable": true,
64
+ "signer": true
65
+ },
66
+ {
67
+ "name": "systemProgram"
68
+ }
69
+ ],
70
+ "args": []
71
+ },
72
+ {
73
+ "name": "updateCommission",
74
+ "discriminator": [
75
+ 2,
76
+ 202,
77
+ 72,
78
+ 156,
79
+ 19,
80
+ 253,
81
+ 91,
82
+ 174
83
+ ],
84
+ "accounts": [
85
+ {
86
+ "name": "registrant",
87
+ "writable": true,
88
+ "signer": true
89
+ },
90
+ {
91
+ "name": "voteAccount"
92
+ },
93
+ {
94
+ "name": "validatorRecord",
95
+ "writable": true
96
+ },
97
+ {
98
+ "name": "systemProgram"
99
+ }
100
+ ],
101
+ "args": []
102
+ },
103
+ {
104
+ "name": "updateMevCommission",
105
+ "discriminator": [
106
+ 107,
107
+ 65,
108
+ 238,
109
+ 108,
110
+ 183,
111
+ 47,
112
+ 236,
113
+ 203
114
+ ],
115
+ "accounts": [
116
+ {
117
+ "name": "signer",
118
+ "signer": true
119
+ },
120
+ {
121
+ "name": "validatorRecord",
122
+ "writable": true
123
+ },
124
+ {
125
+ "name": "tipDistributionAccount"
126
+ }
127
+ ],
128
+ "args": []
129
+ },
130
+ {
131
+ "name": "updateValidator",
132
+ "discriminator": [
133
+ 105,
134
+ 192,
135
+ 4,
136
+ 98,
137
+ 236,
138
+ 115,
139
+ 108,
140
+ 192
141
+ ],
142
+ "accounts": [
143
+ {
144
+ "name": "registrant",
145
+ "writable": true,
146
+ "signer": true
147
+ },
148
+ {
149
+ "name": "voteAccount"
150
+ },
151
+ {
152
+ "name": "validatorRecord",
153
+ "writable": true
154
+ },
155
+ {
156
+ "name": "leaderboardState",
157
+ "writable": true
158
+ },
159
+ {
160
+ "name": "systemProgram"
161
+ }
162
+ ],
163
+ "args": [
164
+ {
165
+ "name": "vpp",
166
+ "type": "u8"
167
+ },
168
+ {
169
+ "name": "proposedRank",
170
+ "type": "u16"
171
+ }
172
+ ]
173
+ }
174
+ ],
175
+ "accounts": [
176
+ {
177
+ "name": "leaderboardState",
178
+ "discriminator": [
179
+ 211,
180
+ 181,
181
+ 29,
182
+ 120,
183
+ 189,
184
+ 4,
185
+ 106,
186
+ 111
187
+ ]
188
+ },
189
+ {
190
+ "name": "validatorRecord",
191
+ "discriminator": [
192
+ 105,
193
+ 248,
194
+ 112,
195
+ 34,
196
+ 71,
197
+ 224,
198
+ 21,
199
+ 71
200
+ ]
201
+ }
202
+ ],
203
+ "errors": [
204
+ {
205
+ "code": 6000,
206
+ "name": "missingPreviousValidator",
207
+ "msg": "Missing previous validator account"
208
+ },
209
+ {
210
+ "code": 6001,
211
+ "name": "missingNextValidator",
212
+ "msg": "Missing next validator account"
213
+ },
214
+ {
215
+ "code": 6002,
216
+ "name": "invalidVppScore",
217
+ "msg": "Invalid VPP score provided."
218
+ },
219
+ {
220
+ "code": 6003,
221
+ "name": "invalidInsertPosition",
222
+ "msg": "Invalid insertion position."
223
+ },
224
+ {
225
+ "code": 6004,
226
+ "name": "invalidCurrentPrev",
227
+ "msg": "Invalid current previous validator."
228
+ },
229
+ {
230
+ "code": 6005,
231
+ "name": "invalidCurrentNext",
232
+ "msg": "Invalid current next validator."
233
+ },
234
+ {
235
+ "code": 6006,
236
+ "name": "invalidHeadValidator",
237
+ "msg": "Head validator cannot have a previous validator"
238
+ },
239
+ {
240
+ "code": 6007,
241
+ "name": "invalidTailValidator",
242
+ "msg": "Tail validator cannot have a next validator"
243
+ },
244
+ {
245
+ "code": 6008,
246
+ "name": "validatorNotInLeaderboard",
247
+ "msg": "Cannot remove validator that is not in the leaderboard"
248
+ },
249
+ {
250
+ "code": 6009,
251
+ "name": "validatorAlreadyExists",
252
+ "msg": "Validator already exists in the leaderboard"
253
+ },
254
+ {
255
+ "code": 6010,
256
+ "name": "overflow",
257
+ "msg": "Arithmetic overflow"
258
+ },
259
+ {
260
+ "code": 6011,
261
+ "name": "invalidVoteAccount",
262
+ "msg": "Invalid vote account - must be owned by vote program"
263
+ },
264
+ {
265
+ "code": 6012,
266
+ "name": "vppVerificationFailed",
267
+ "msg": "VPP verification failed"
268
+ },
269
+ {
270
+ "code": 6013,
271
+ "name": "vppUnchanged",
272
+ "msg": "VPP score unchanged - update not needed"
273
+ },
274
+ {
275
+ "code": 6014,
276
+ "name": "invalidAccountCount",
277
+ "msg": "Invalid account count for top 10 verification"
278
+ },
279
+ {
280
+ "code": 6015,
281
+ "name": "invalidVppOrdering",
282
+ "msg": "Validators not in correct VPP order"
283
+ },
284
+ {
285
+ "code": 6016,
286
+ "name": "brokenLinkage",
287
+ "msg": "Broken linked list continuity"
288
+ },
289
+ {
290
+ "code": 6017,
291
+ "name": "commissionNotUpdated",
292
+ "msg": "Commission must be updated for current epoch before updating validator"
293
+ },
294
+ {
295
+ "code": 6018,
296
+ "name": "mevCommissionNotUpdated",
297
+ "msg": "MEV commission must be updated for current epoch before updating validator"
298
+ },
299
+ {
300
+ "code": 6019,
301
+ "name": "invalidCurrentNeighbor",
302
+ "msg": "Current neighbor account doesn't match validator's stored links"
303
+ },
304
+ {
305
+ "code": 6020,
306
+ "name": "nonAdjacentInsertionPosition",
307
+ "msg": "Insertion position accounts are not actually adjacent in leaderboard"
308
+ },
309
+ {
310
+ "code": 6021,
311
+ "name": "staleAccountReference",
312
+ "msg": "Account reference is outdated due to concurrent update"
313
+ },
314
+ {
315
+ "code": 6022,
316
+ "name": "invalidStakeAmount",
317
+ "msg": "Invalid stake amount - exceeds maximum allowed"
318
+ },
319
+ {
320
+ "code": 6023,
321
+ "name": "invalidTipDistributionAccount",
322
+ "msg": "Invalid Tip Distribution Account provided"
323
+ },
324
+ {
325
+ "code": 6024,
326
+ "name": "invalidRankPosition",
327
+ "msg": "Proposed rank position violates sorted ordering"
328
+ },
329
+ {
330
+ "code": 6025,
331
+ "name": "leaderboardFull",
332
+ "msg": "Leaderboard is full - cannot add more validators"
333
+ },
334
+ {
335
+ "code": 6026,
336
+ "name": "validatorNotInRankings",
337
+ "msg": "Validator not found in rankings"
338
+ },
339
+ {
340
+ "code": 6027,
341
+ "name": "arithmeticOverflow",
342
+ "msg": "Arithmetic overflow"
343
+ }
344
+ ],
345
+ "types": [
346
+ {
347
+ "name": "leaderboardState",
348
+ "docs": [
349
+ "Central leaderboard state using parallel arrays for efficient ranking and CPI access",
350
+ "Stores VPP scores and sorted rankings for up to 1024 validators",
351
+ "Uses zero-copy for efficient access from other programs via CPI"
352
+ ],
353
+ "serialization": "bytemuck",
354
+ "repr": {
355
+ "kind": "c"
356
+ },
357
+ "type": {
358
+ "kind": "struct",
359
+ "fields": [
360
+ {
361
+ "name": "scores",
362
+ "docs": [
363
+ "VPP scores indexed by registry_index (0-100 range)",
364
+ "registry_index is assigned on first validator registration and never changes"
365
+ ],
366
+ "type": {
367
+ "array": [
368
+ "u8",
369
+ 1024
370
+ ]
371
+ }
372
+ },
373
+ {
374
+ "name": "sortedIndices",
375
+ "docs": [
376
+ "Validator indices sorted by VPP score descending",
377
+ "sorted_indices[0] = registry_index of highest VPP validator",
378
+ "sorted_indices[1] = registry_index of 2nd highest VPP validator, etc."
379
+ ],
380
+ "type": {
381
+ "array": [
382
+ "u16",
383
+ 1024
384
+ ]
385
+ }
386
+ },
387
+ {
388
+ "name": "voteAccounts",
389
+ "docs": [
390
+ "Vote account pubkeys indexed by registry_index",
391
+ "Allows CPI callers to get vote accounts for top N validators"
392
+ ],
393
+ "type": {
394
+ "array": [
395
+ {
396
+ "defined": {
397
+ "name": "pubkeyBytes"
398
+ }
399
+ },
400
+ 1024
401
+ ]
402
+ }
403
+ },
404
+ {
405
+ "name": "numValidators",
406
+ "docs": [
407
+ "Number of active validators currently in the leaderboard"
408
+ ],
409
+ "type": "u16"
410
+ },
411
+ {
412
+ "name": "bump",
413
+ "docs": [
414
+ "PDA bump seed"
415
+ ],
416
+ "type": "u8"
417
+ },
418
+ {
419
+ "name": "padding",
420
+ "docs": [
421
+ "Reserved space for future upgrades"
422
+ ],
423
+ "type": {
424
+ "array": [
425
+ "u8",
426
+ 5
427
+ ]
428
+ }
429
+ }
430
+ ]
431
+ }
432
+ },
433
+ {
434
+ "name": "pubkeyBytes",
435
+ "docs": [
436
+ "Fixed-size representation of a `Pubkey` that satisfies Anchor's zero-copy rules.",
437
+ "Stores the raw 32-byte array and offers helpers to convert to/from `Pubkey`."
438
+ ],
439
+ "serialization": "bytemuck",
440
+ "repr": {
441
+ "kind": "transparent"
442
+ },
443
+ "type": {
444
+ "kind": "struct",
445
+ "fields": [
446
+ {
447
+ "name": "bytes",
448
+ "type": {
449
+ "array": [
450
+ "u8",
451
+ 32
452
+ ]
453
+ }
454
+ }
455
+ ]
456
+ }
457
+ },
458
+ {
459
+ "name": "validatorRecord",
460
+ "docs": [
461
+ "Per-validator record account storing commission data and metadata"
462
+ ],
463
+ "type": {
464
+ "kind": "struct",
465
+ "fields": [
466
+ {
467
+ "name": "voteAccount",
468
+ "docs": [
469
+ "The validator's vote account pubkey"
470
+ ],
471
+ "type": "pubkey"
472
+ },
473
+ {
474
+ "name": "registryIndex",
475
+ "docs": [
476
+ "Immutable index into LeaderboardState arrays",
477
+ "Assigned on first registration, never changes"
478
+ ],
479
+ "type": "u16"
480
+ },
481
+ {
482
+ "name": "creditsObserved",
483
+ "docs": [
484
+ "Current cumulative credits from vote account"
485
+ ],
486
+ "type": "u64"
487
+ },
488
+ {
489
+ "name": "commissionHistory",
490
+ "docs": [
491
+ "Circular buffer of past 10 commission values (0-100)",
492
+ "Used to penalize validators who increase commission"
493
+ ],
494
+ "type": {
495
+ "array": [
496
+ "u8",
497
+ 10
498
+ ]
499
+ }
500
+ },
501
+ {
502
+ "name": "commissionIndex",
503
+ "docs": [
504
+ "Current index in commission_history circular buffer (0-9)"
505
+ ],
506
+ "type": "u8"
507
+ },
508
+ {
509
+ "name": "lastCommissionUpdate",
510
+ "docs": [
511
+ "Last epoch when commission was updated"
512
+ ],
513
+ "type": "u64"
514
+ },
515
+ {
516
+ "name": "epoch",
517
+ "docs": [
518
+ "Last epoch this validator was updated"
519
+ ],
520
+ "type": "u64"
521
+ },
522
+ {
523
+ "name": "slot",
524
+ "docs": [
525
+ "Last slot this validator was updated"
526
+ ],
527
+ "type": "u64"
528
+ },
529
+ {
530
+ "name": "wireOperator",
531
+ "docs": [
532
+ "Whether this validator is a Wire operator (5% bonus)"
533
+ ],
534
+ "type": "bool"
535
+ },
536
+ {
537
+ "name": "mevCommission",
538
+ "docs": [
539
+ "Current MEV commission in basis points"
540
+ ],
541
+ "type": "u16"
542
+ },
543
+ {
544
+ "name": "mevCommissionHistory",
545
+ "docs": [
546
+ "Circular buffer of past 10 MEV commission values"
547
+ ],
548
+ "type": {
549
+ "array": [
550
+ "u16",
551
+ 10
552
+ ]
553
+ }
554
+ },
555
+ {
556
+ "name": "mevCommissionIndex",
557
+ "docs": [
558
+ "Current index in mev_commission_history circular buffer (0-9)"
559
+ ],
560
+ "type": "u8"
561
+ },
562
+ {
563
+ "name": "lastMevCommissionUpdate",
564
+ "docs": [
565
+ "Last epoch when MEV commission was updated"
566
+ ],
567
+ "type": "u64"
568
+ },
569
+ {
570
+ "name": "bump",
571
+ "docs": [
572
+ "PDA bump seed"
573
+ ],
574
+ "type": "u8"
575
+ }
576
+ ]
577
+ }
578
+ }
579
+ ]
580
+ };
@@ -1,5 +1,5 @@
1
1
  import { BigNumber, ethers } from "ethers";
2
- import { DepositEvent, DepositResult, SharesBurnedEvent } from "../types";
2
+ import { ClaimedEvent, DepositEvent, DepositResult, SharesBurnedEvent } from "../types";
3
3
  import { EthereumContractService } from "../contract";
4
4
  import { formatContractErrors } from "../utils";
5
5
 
@@ -114,6 +114,35 @@ export class ConvertClient {
114
114
  }
115
115
 
116
116
 
117
+ public async claimWithdraw(tokenId: BigNumber): Promise<any> {
118
+ let tx, receipt;
119
+ try {
120
+ tx = await this.contract.DepositManager.claim(tokenId);
121
+ receipt = await tx.wait(1);
122
+ } catch (err: any) {
123
+ let errorObj = formatContractErrors(err);
124
+ throw new Error(errorObj.name ?? errorObj.raw)
125
+ }
126
+
127
+ // Parse Claimed event if present
128
+ let event: ClaimedEvent | undefined;
129
+ const ev = receipt.events?.find((e) => e.event === 'Claimed');
130
+
131
+ if (ev && ev.args) {
132
+ const { user, amount } = ev.args;
133
+ event = {
134
+ user,
135
+ amount: BigNumber.from(amount),
136
+ };
137
+ }
138
+
139
+ return {
140
+ txHash: tx.hash,
141
+ receipt,
142
+ event,
143
+ };
144
+ }
145
+
117
146
 
118
147
  /*
119
148
  // OLD - this was replaced with LiqEth.safeBurn() on 1/13/26