@wireio/stake 0.1.0 → 0.1.2

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 (104) hide show
  1. package/README.md +57 -0
  2. package/lib/stake.browser.js +11836 -4103
  3. package/lib/stake.browser.js.map +1 -1
  4. package/lib/stake.d.ts +374 -556
  5. package/lib/stake.js +12089 -4303
  6. package/lib/stake.js.map +1 -1
  7. package/lib/stake.m.js +11836 -4103
  8. package/lib/stake.m.js.map +1 -1
  9. package/package.json +1 -1
  10. package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.dbg.json +4 -0
  11. package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.json +1153 -0
  12. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IAccounting.dbg.json +4 -0
  13. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IAccounting.json +172 -0
  14. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositContract.dbg.json +4 -0
  15. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositContract.json +39 -0
  16. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositManager.dbg.json +4 -0
  17. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositManager.json +64 -0
  18. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthBurn.dbg.json +4 -0
  19. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthBurn.json +24 -0
  20. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthMint.dbg.json +4 -0
  21. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthMint.json +35 -0
  22. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20.dbg.json +4 -0
  23. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20.json +213 -0
  24. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IStakingModule.dbg.json +4 -0
  25. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IStakingModule.json +138 -0
  26. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +4 -0
  27. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.json +70 -0
  28. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +4 -0
  29. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IWithdrawalRecord.json +64 -0
  30. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/LiqEthCommon.dbg.json +4 -0
  31. package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/LiqEthCommon.json +10 -0
  32. package/src/assets/ethereum/ABI/liqEth/RewardsERC20.sol/RewardsERC20.dbg.json +4 -0
  33. package/src/assets/ethereum/ABI/liqEth/RewardsERC20.sol/RewardsERC20.json +749 -0
  34. package/src/assets/ethereum/ABI/liqEth/RewardsERC20Pausable.sol/RewardsERC20Pausable.dbg.json +4 -0
  35. package/src/assets/ethereum/ABI/liqEth/RewardsERC20Pausable.sol/RewardsERC20Pausable.json +812 -0
  36. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.dbg.json +4 -0
  37. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.json +10 -0
  38. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.dbg.json +4 -0
  39. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.json +10 -0
  40. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.dbg.json +4 -0
  41. package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.json +225 -0
  42. package/src/assets/ethereum/ABI/liqEth/Yield.sol/BeaconRoots.dbg.json +4 -0
  43. package/src/assets/ethereum/ABI/liqEth/Yield.sol/BeaconRoots.json +10 -0
  44. package/src/assets/ethereum/ABI/liqEth/Yield.sol/SSZ.dbg.json +4 -0
  45. package/src/assets/ethereum/ABI/liqEth/Yield.sol/SSZ.json +10 -0
  46. package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.dbg.json +4 -0
  47. package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.json +813 -0
  48. package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.dbg.json +4 -0
  49. package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.json +651 -0
  50. package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.dbg.json +4 -0
  51. package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.json +1110 -0
  52. package/src/assets/ethereum/ABI/liqEth/liqEthBurn.sol/LiqEthBurn.dbg.json +4 -0
  53. package/src/assets/ethereum/ABI/liqEth/liqEthBurn.sol/LiqEthBurn.json +391 -0
  54. package/src/assets/ethereum/ABI/liqEth/liqEthMint.sol/LiqEthMint.dbg.json +4 -0
  55. package/src/assets/ethereum/ABI/liqEth/liqEthMint.sol/LiqEthMint.json +402 -0
  56. package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.dbg.json +4 -0
  57. package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.json +1225 -0
  58. package/src/assets/ethereum/ABI/liqEth/withdrawalQueue.sol/WithdrawalQueue.dbg.json +4 -0
  59. package/src/assets/ethereum/ABI/liqEth/withdrawalQueue.sol/WithdrawalQueue.json +927 -0
  60. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.dbg.json +4 -0
  61. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.json +10 -0
  62. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.dbg.json +4 -0
  63. package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.json +447 -0
  64. package/src/assets/solana/idl/liqsol_core.json +4239 -0
  65. package/src/assets/solana/idl/liqsol_token.json +183 -0
  66. package/src/assets/solana/idl/validator_leaderboard.json +270 -265
  67. package/src/assets/solana/types/liqsol_core.ts +4245 -0
  68. package/src/assets/solana/types/liqsol_token.ts +189 -0
  69. package/src/assets/solana/types/validator_leaderboard.ts +270 -265
  70. package/src/index.ts +1 -3
  71. package/src/networks/ethereum/contract.ts +101 -36
  72. package/src/networks/ethereum/ethereum.ts +141 -45
  73. package/src/networks/ethereum/types.ts +30 -2
  74. package/src/networks/solana/clients/deposit.client.ts +71 -109
  75. package/src/networks/solana/clients/distribution.client.ts +256 -383
  76. package/src/networks/solana/clients/leaderboard.client.ts +38 -133
  77. package/src/networks/solana/constants.ts +214 -130
  78. package/src/networks/solana/program.ts +25 -38
  79. package/src/networks/solana/solana.ts +120 -105
  80. package/src/networks/solana/types.ts +37 -47
  81. package/src/networks/solana/utils.ts +551 -0
  82. package/src/scripts/tsconfig.json +17 -0
  83. package/src/staker/staker.ts +10 -6
  84. package/src/staker/types.ts +14 -9
  85. package/src/assets/solana/idl/deposit.json +0 -296
  86. package/src/assets/solana/idl/distribution.json +0 -768
  87. package/src/assets/solana/idl/liq_sol_token.json +0 -298
  88. package/src/assets/solana/idl/mint_helper.json +0 -110
  89. package/src/assets/solana/idl/read_tracked_balance.json +0 -140
  90. package/src/assets/solana/idl/stake_controller.json +0 -2149
  91. package/src/assets/solana/idl/treasury.json +0 -110
  92. package/src/assets/solana/idl/validator_registry.json +0 -487
  93. package/src/assets/solana/idl/yield_oracle.json +0 -32
  94. package/src/assets/solana/types/deposit.ts +0 -302
  95. package/src/assets/solana/types/distribution.ts +0 -774
  96. package/src/assets/solana/types/liq_sol_token.ts +0 -304
  97. package/src/assets/solana/types/mint_helper.ts +0 -116
  98. package/src/assets/solana/types/read_tracked_balance.ts +0 -146
  99. package/src/assets/solana/types/stake_controller.ts +0 -2155
  100. package/src/assets/solana/types/stake_registry.ts +0 -441
  101. package/src/assets/solana/types/treasury.ts +0 -116
  102. package/src/assets/solana/types/validator_registry.ts +0 -493
  103. package/src/assets/solana/types/yield_oracle.ts +0 -38
  104. package/src/common/utils.ts +0 -9
@@ -1,298 +0,0 @@
1
- {
2
- "address": "5MRFSLCkXPEzfR6gkcZCVttq9g83mMUHyTZ85Z3TSpvU",
3
- "metadata": {
4
- "name": "liq_sol_token",
5
- "version": "0.1.0",
6
- "spec": "0.1.0",
7
- "description": "Liquidity Staking Token Program"
8
- },
9
- "instructions": [
10
- {
11
- "name": "create_mint_account",
12
- "discriminator": [
13
- 76,
14
- 184,
15
- 50,
16
- 62,
17
- 162,
18
- 141,
19
- 47,
20
- 103
21
- ],
22
- "accounts": [
23
- {
24
- "name": "payer",
25
- "writable": true,
26
- "signer": true
27
- },
28
- {
29
- "name": "mint_authority",
30
- "pda": {
31
- "seeds": [
32
- {
33
- "kind": "const",
34
- "value": [
35
- 109,
36
- 105,
37
- 110,
38
- 116,
39
- 95,
40
- 97,
41
- 117,
42
- 116,
43
- 104,
44
- 111,
45
- 114,
46
- 105,
47
- 116,
48
- 121
49
- ]
50
- }
51
- ]
52
- }
53
- },
54
- {
55
- "name": "receiver"
56
- },
57
- {
58
- "name": "mint",
59
- "docs": [
60
- "The mint PDA - deterministic address for liqSOL token"
61
- ],
62
- "writable": true,
63
- "pda": {
64
- "seeds": [
65
- {
66
- "kind": "const",
67
- "value": [
68
- 108,
69
- 105,
70
- 113,
71
- 95,
72
- 115,
73
- 111,
74
- 108,
75
- 95,
76
- 109,
77
- 105,
78
- 110,
79
- 116
80
- ]
81
- }
82
- ]
83
- }
84
- },
85
- {
86
- "name": "mint_token_account",
87
- "writable": true,
88
- "pda": {
89
- "seeds": [
90
- {
91
- "kind": "account",
92
- "path": "receiver"
93
- },
94
- {
95
- "kind": "account",
96
- "path": "token_program"
97
- },
98
- {
99
- "kind": "account",
100
- "path": "mint"
101
- }
102
- ],
103
- "program": {
104
- "kind": "const",
105
- "value": [
106
- 140,
107
- 151,
108
- 37,
109
- 143,
110
- 78,
111
- 36,
112
- 137,
113
- 241,
114
- 187,
115
- 61,
116
- 16,
117
- 41,
118
- 20,
119
- 142,
120
- 13,
121
- 131,
122
- 11,
123
- 90,
124
- 19,
125
- 153,
126
- 218,
127
- 255,
128
- 16,
129
- 132,
130
- 4,
131
- 142,
132
- 123,
133
- 216,
134
- 219,
135
- 233,
136
- 248,
137
- 89
138
- ]
139
- }
140
- }
141
- },
142
- {
143
- "name": "system_program",
144
- "address": "11111111111111111111111111111111"
145
- },
146
- {
147
- "name": "associated_token_program",
148
- "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
149
- },
150
- {
151
- "name": "token_program",
152
- "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
153
- }
154
- ],
155
- "args": [
156
- {
157
- "name": "args",
158
- "type": {
159
- "defined": {
160
- "name": "CreateMintAccountArgs"
161
- }
162
- }
163
- }
164
- ]
165
- },
166
- {
167
- "name": "mint_for_authorized_program",
168
- "discriminator": [
169
- 116,
170
- 208,
171
- 64,
172
- 189,
173
- 2,
174
- 60,
175
- 50,
176
- 41
177
- ],
178
- "accounts": [
179
- {
180
- "name": "mint",
181
- "writable": true
182
- },
183
- {
184
- "name": "recipient_token_account",
185
- "writable": true
186
- },
187
- {
188
- "name": "program_authority",
189
- "docs": [
190
- "This must be a PDA controlled by the calling program (deposit or distribution)"
191
- ],
192
- "writable": true,
193
- "signer": true
194
- },
195
- {
196
- "name": "mint_authority",
197
- "pda": {
198
- "seeds": [
199
- {
200
- "kind": "const",
201
- "value": [
202
- 109,
203
- 105,
204
- 110,
205
- 116,
206
- 95,
207
- 97,
208
- 117,
209
- 116,
210
- 104,
211
- 111,
212
- 114,
213
- 105,
214
- 116,
215
- 121
216
- ]
217
- }
218
- ]
219
- }
220
- },
221
- {
222
- "name": "instructions",
223
- "address": "Sysvar1nstructions1111111111111111111111111"
224
- },
225
- {
226
- "name": "token_program",
227
- "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
228
- }
229
- ],
230
- "args": [
231
- {
232
- "name": "args",
233
- "type": {
234
- "defined": {
235
- "name": "MintTokenArgs"
236
- }
237
- }
238
- }
239
- ]
240
- }
241
- ],
242
- "errors": [
243
- {
244
- "code": 6000,
245
- "name": "InvalidMintAuthority",
246
- "msg": "Invalid mint authority"
247
- },
248
- {
249
- "code": 6001,
250
- "name": "UnauthorizedProgram",
251
- "msg": "Unauthorized program attempting to mint"
252
- },
253
- {
254
- "code": 6002,
255
- "name": "CannotDetermineCallingProgram",
256
- "msg": "Cannot determine calling program"
257
- },
258
- {
259
- "code": 6003,
260
- "name": "DirectCallNotAllowed",
261
- "msg": "Direct calls not allowed, must be called via CPI"
262
- }
263
- ],
264
- "types": [
265
- {
266
- "name": "CreateMintAccountArgs",
267
- "type": {
268
- "kind": "struct",
269
- "fields": [
270
- {
271
- "name": "name",
272
- "type": "string"
273
- },
274
- {
275
- "name": "symbol",
276
- "type": "string"
277
- },
278
- {
279
- "name": "uri",
280
- "type": "string"
281
- }
282
- ]
283
- }
284
- },
285
- {
286
- "name": "MintTokenArgs",
287
- "type": {
288
- "kind": "struct",
289
- "fields": [
290
- {
291
- "name": "amount",
292
- "type": "u64"
293
- }
294
- ]
295
- }
296
- }
297
- ]
298
- }
@@ -1,110 +0,0 @@
1
- {
2
- "address": "JXcNGqZVmeVsHorECRmsK2FtEt7dZRfqqaY451BDppW",
3
- "metadata": {
4
- "name": "mint_helper",
5
- "version": "0.1.0",
6
- "spec": "0.1.0",
7
- "description": "Created with Anchor"
8
- },
9
- "instructions": [
10
- {
11
- "name": "mint_to_account",
12
- "discriminator": [
13
- 67,
14
- 25,
15
- 254,
16
- 173,
17
- 127,
18
- 166,
19
- 62,
20
- 85
21
- ],
22
- "accounts": [
23
- {
24
- "name": "payer",
25
- "writable": true,
26
- "signer": true
27
- },
28
- {
29
- "name": "program_authority",
30
- "docs": [
31
- "The mint-helper program authority PDA that will authorize the CPI"
32
- ],
33
- "writable": true,
34
- "pda": {
35
- "seeds": [
36
- {
37
- "kind": "const",
38
- "value": [
39
- 109,
40
- 105,
41
- 110,
42
- 116,
43
- 95,
44
- 104,
45
- 101,
46
- 108,
47
- 112,
48
- 101,
49
- 114,
50
- 95,
51
- 97,
52
- 117,
53
- 116,
54
- 104,
55
- 111,
56
- 114,
57
- 105,
58
- 116,
59
- 121
60
- ]
61
- }
62
- ]
63
- }
64
- },
65
- {
66
- "name": "liqsol_mint",
67
- "docs": [
68
- "The liqSOL token mint"
69
- ],
70
- "writable": true
71
- },
72
- {
73
- "name": "recipient_token_account",
74
- "docs": [
75
- "The recipient token account to receive minted liqSOL"
76
- ],
77
- "writable": true
78
- },
79
- {
80
- "name": "liqsol_mint_authority",
81
- "docs": [
82
- "The liq-sol-token mint authority PDA"
83
- ]
84
- },
85
- {
86
- "name": "liqsol_program",
87
- "docs": [
88
- "The liq-sol-token program for CPI"
89
- ]
90
- },
91
- {
92
- "name": "token_program",
93
- "docs": [
94
- "Token program (Token2022)"
95
- ]
96
- },
97
- {
98
- "name": "instructions_sysvar",
99
- "address": "Sysvar1nstructions1111111111111111111111111"
100
- }
101
- ],
102
- "args": [
103
- {
104
- "name": "amount",
105
- "type": "u64"
106
- }
107
- ]
108
- }
109
- ]
110
- }
@@ -1,140 +0,0 @@
1
- {
2
- "address": "4NBX78FYgvrg4sDoG5AR2LDbtXnuXcZ32sGAHvz9ao89",
3
- "metadata": {
4
- "name": "read_tracked_balance",
5
- "version": "0.1.0",
6
- "spec": "0.1.0",
7
- "description": "Program for reading tracked balance from distribution state"
8
- },
9
- "instructions": [
10
- {
11
- "name": "read_total_tracked_balance",
12
- "discriminator": [
13
- 50,
14
- 249,
15
- 152,
16
- 17,
17
- 91,
18
- 135,
19
- 116,
20
- 90
21
- ],
22
- "accounts": [
23
- {
24
- "name": "distribution_state",
25
- "docs": [
26
- "The distribution state account from the distribution program",
27
- "We validate it using the same PDA seeds as the distribution program"
28
- ],
29
- "pda": {
30
- "seeds": [
31
- {
32
- "kind": "const",
33
- "value": [
34
- 100,
35
- 105,
36
- 115,
37
- 116,
38
- 114,
39
- 105,
40
- 98,
41
- 117,
42
- 116,
43
- 105,
44
- 111,
45
- 110,
46
- 95,
47
- 115,
48
- 116,
49
- 97,
50
- 116,
51
- 101
52
- ]
53
- }
54
- ],
55
- "program": {
56
- "kind": "const",
57
- "value": [
58
- 192,
59
- 77,
60
- 48,
61
- 221,
62
- 223,
63
- 198,
64
- 148,
65
- 69,
66
- 53,
67
- 195,
68
- 230,
69
- 52,
70
- 221,
71
- 10,
72
- 39,
73
- 100,
74
- 176,
75
- 246,
76
- 220,
77
- 132,
78
- 12,
79
- 148,
80
- 188,
81
- 218,
82
- 70,
83
- 17,
84
- 75,
85
- 89,
86
- 171,
87
- 198,
88
- 208,
89
- 210
90
- ]
91
- }
92
- }
93
- }
94
- ],
95
- "args": [],
96
- "returns": "u64"
97
- }
98
- ],
99
- "accounts": [
100
- {
101
- "name": "DistributionState",
102
- "discriminator": [
103
- 7,
104
- 25,
105
- 94,
106
- 15,
107
- 208,
108
- 170,
109
- 4,
110
- 103
111
- ]
112
- }
113
- ],
114
- "types": [
115
- {
116
- "name": "DistributionState",
117
- "type": {
118
- "kind": "struct",
119
- "fields": [
120
- {
121
- "name": "liqsol_mint",
122
- "type": "pubkey"
123
- },
124
- {
125
- "name": "total_tracked_balance",
126
- "type": "u64"
127
- },
128
- {
129
- "name": "available_balance",
130
- "type": "u64"
131
- },
132
- {
133
- "name": "bump",
134
- "type": "u8"
135
- }
136
- ]
137
- }
138
- }
139
- ]
140
- }