@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,304 +0,0 @@
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/liq_sol_token.json`.
6
- */
7
- export type LiqSolToken = {
8
- "address": "5MRFSLCkXPEzfR6gkcZCVttq9g83mMUHyTZ85Z3TSpvU",
9
- "metadata": {
10
- "name": "liqSolToken",
11
- "version": "0.1.0",
12
- "spec": "0.1.0",
13
- "description": "Liquidity Staking Token Program"
14
- },
15
- "instructions": [
16
- {
17
- "name": "createMintAccount",
18
- "discriminator": [
19
- 76,
20
- 184,
21
- 50,
22
- 62,
23
- 162,
24
- 141,
25
- 47,
26
- 103
27
- ],
28
- "accounts": [
29
- {
30
- "name": "payer",
31
- "writable": true,
32
- "signer": true
33
- },
34
- {
35
- "name": "mintAuthority",
36
- "pda": {
37
- "seeds": [
38
- {
39
- "kind": "const",
40
- "value": [
41
- 109,
42
- 105,
43
- 110,
44
- 116,
45
- 95,
46
- 97,
47
- 117,
48
- 116,
49
- 104,
50
- 111,
51
- 114,
52
- 105,
53
- 116,
54
- 121
55
- ]
56
- }
57
- ]
58
- }
59
- },
60
- {
61
- "name": "receiver"
62
- },
63
- {
64
- "name": "mint",
65
- "docs": [
66
- "The mint PDA - deterministic address for liqSOL token"
67
- ],
68
- "writable": true,
69
- "pda": {
70
- "seeds": [
71
- {
72
- "kind": "const",
73
- "value": [
74
- 108,
75
- 105,
76
- 113,
77
- 95,
78
- 115,
79
- 111,
80
- 108,
81
- 95,
82
- 109,
83
- 105,
84
- 110,
85
- 116
86
- ]
87
- }
88
- ]
89
- }
90
- },
91
- {
92
- "name": "mintTokenAccount",
93
- "writable": true,
94
- "pda": {
95
- "seeds": [
96
- {
97
- "kind": "account",
98
- "path": "receiver"
99
- },
100
- {
101
- "kind": "account",
102
- "path": "tokenProgram"
103
- },
104
- {
105
- "kind": "account",
106
- "path": "mint"
107
- }
108
- ],
109
- "program": {
110
- "kind": "const",
111
- "value": [
112
- 140,
113
- 151,
114
- 37,
115
- 143,
116
- 78,
117
- 36,
118
- 137,
119
- 241,
120
- 187,
121
- 61,
122
- 16,
123
- 41,
124
- 20,
125
- 142,
126
- 13,
127
- 131,
128
- 11,
129
- 90,
130
- 19,
131
- 153,
132
- 218,
133
- 255,
134
- 16,
135
- 132,
136
- 4,
137
- 142,
138
- 123,
139
- 216,
140
- 219,
141
- 233,
142
- 248,
143
- 89
144
- ]
145
- }
146
- }
147
- },
148
- {
149
- "name": "systemProgram",
150
- "address": "11111111111111111111111111111111"
151
- },
152
- {
153
- "name": "associatedTokenProgram",
154
- "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
155
- },
156
- {
157
- "name": "tokenProgram",
158
- "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
159
- }
160
- ],
161
- "args": [
162
- {
163
- "name": "args",
164
- "type": {
165
- "defined": {
166
- "name": "createMintAccountArgs"
167
- }
168
- }
169
- }
170
- ]
171
- },
172
- {
173
- "name": "mintForAuthorizedProgram",
174
- "discriminator": [
175
- 116,
176
- 208,
177
- 64,
178
- 189,
179
- 2,
180
- 60,
181
- 50,
182
- 41
183
- ],
184
- "accounts": [
185
- {
186
- "name": "mint",
187
- "writable": true
188
- },
189
- {
190
- "name": "recipientTokenAccount",
191
- "writable": true
192
- },
193
- {
194
- "name": "programAuthority",
195
- "docs": [
196
- "This must be a PDA controlled by the calling program (deposit or distribution)"
197
- ],
198
- "writable": true,
199
- "signer": true
200
- },
201
- {
202
- "name": "mintAuthority",
203
- "pda": {
204
- "seeds": [
205
- {
206
- "kind": "const",
207
- "value": [
208
- 109,
209
- 105,
210
- 110,
211
- 116,
212
- 95,
213
- 97,
214
- 117,
215
- 116,
216
- 104,
217
- 111,
218
- 114,
219
- 105,
220
- 116,
221
- 121
222
- ]
223
- }
224
- ]
225
- }
226
- },
227
- {
228
- "name": "instructions",
229
- "address": "Sysvar1nstructions1111111111111111111111111"
230
- },
231
- {
232
- "name": "tokenProgram",
233
- "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
234
- }
235
- ],
236
- "args": [
237
- {
238
- "name": "args",
239
- "type": {
240
- "defined": {
241
- "name": "mintTokenArgs"
242
- }
243
- }
244
- }
245
- ]
246
- }
247
- ],
248
- "errors": [
249
- {
250
- "code": 6000,
251
- "name": "invalidMintAuthority",
252
- "msg": "Invalid mint authority"
253
- },
254
- {
255
- "code": 6001,
256
- "name": "unauthorizedProgram",
257
- "msg": "Unauthorized program attempting to mint"
258
- },
259
- {
260
- "code": 6002,
261
- "name": "cannotDetermineCallingProgram",
262
- "msg": "Cannot determine calling program"
263
- },
264
- {
265
- "code": 6003,
266
- "name": "directCallNotAllowed",
267
- "msg": "Direct calls not allowed, must be called via CPI"
268
- }
269
- ],
270
- "types": [
271
- {
272
- "name": "createMintAccountArgs",
273
- "type": {
274
- "kind": "struct",
275
- "fields": [
276
- {
277
- "name": "name",
278
- "type": "string"
279
- },
280
- {
281
- "name": "symbol",
282
- "type": "string"
283
- },
284
- {
285
- "name": "uri",
286
- "type": "string"
287
- }
288
- ]
289
- }
290
- },
291
- {
292
- "name": "mintTokenArgs",
293
- "type": {
294
- "kind": "struct",
295
- "fields": [
296
- {
297
- "name": "amount",
298
- "type": "u64"
299
- }
300
- ]
301
- }
302
- }
303
- ]
304
- };
@@ -1,116 +0,0 @@
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/mint_helper.json`.
6
- */
7
- export type MintHelper = {
8
- "address": "JXcNGqZVmeVsHorECRmsK2FtEt7dZRfqqaY451BDppW",
9
- "metadata": {
10
- "name": "mintHelper",
11
- "version": "0.1.0",
12
- "spec": "0.1.0",
13
- "description": "Created with Anchor"
14
- },
15
- "instructions": [
16
- {
17
- "name": "mintToAccount",
18
- "discriminator": [
19
- 67,
20
- 25,
21
- 254,
22
- 173,
23
- 127,
24
- 166,
25
- 62,
26
- 85
27
- ],
28
- "accounts": [
29
- {
30
- "name": "payer",
31
- "writable": true,
32
- "signer": true
33
- },
34
- {
35
- "name": "programAuthority",
36
- "docs": [
37
- "The mint-helper program authority PDA that will authorize the CPI"
38
- ],
39
- "writable": true,
40
- "pda": {
41
- "seeds": [
42
- {
43
- "kind": "const",
44
- "value": [
45
- 109,
46
- 105,
47
- 110,
48
- 116,
49
- 95,
50
- 104,
51
- 101,
52
- 108,
53
- 112,
54
- 101,
55
- 114,
56
- 95,
57
- 97,
58
- 117,
59
- 116,
60
- 104,
61
- 111,
62
- 114,
63
- 105,
64
- 116,
65
- 121
66
- ]
67
- }
68
- ]
69
- }
70
- },
71
- {
72
- "name": "liqsolMint",
73
- "docs": [
74
- "The liqSOL token mint"
75
- ],
76
- "writable": true
77
- },
78
- {
79
- "name": "recipientTokenAccount",
80
- "docs": [
81
- "The recipient token account to receive minted liqSOL"
82
- ],
83
- "writable": true
84
- },
85
- {
86
- "name": "liqsolMintAuthority",
87
- "docs": [
88
- "The liq-sol-token mint authority PDA"
89
- ]
90
- },
91
- {
92
- "name": "liqsolProgram",
93
- "docs": [
94
- "The liq-sol-token program for CPI"
95
- ]
96
- },
97
- {
98
- "name": "tokenProgram",
99
- "docs": [
100
- "Token program (Token2022)"
101
- ]
102
- },
103
- {
104
- "name": "instructionsSysvar",
105
- "address": "Sysvar1nstructions1111111111111111111111111"
106
- }
107
- ],
108
- "args": [
109
- {
110
- "name": "amount",
111
- "type": "u64"
112
- }
113
- ]
114
- }
115
- ]
116
- };
@@ -1,146 +0,0 @@
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/read_tracked_balance.json`.
6
- */
7
- export type ReadTrackedBalance = {
8
- "address": "4NBX78FYgvrg4sDoG5AR2LDbtXnuXcZ32sGAHvz9ao89",
9
- "metadata": {
10
- "name": "readTrackedBalance",
11
- "version": "0.1.0",
12
- "spec": "0.1.0",
13
- "description": "Program for reading tracked balance from distribution state"
14
- },
15
- "instructions": [
16
- {
17
- "name": "readTotalTrackedBalance",
18
- "discriminator": [
19
- 50,
20
- 249,
21
- 152,
22
- 17,
23
- 91,
24
- 135,
25
- 116,
26
- 90
27
- ],
28
- "accounts": [
29
- {
30
- "name": "distributionState",
31
- "docs": [
32
- "The distribution state account from the distribution program",
33
- "We validate it using the same PDA seeds as the distribution program"
34
- ],
35
- "pda": {
36
- "seeds": [
37
- {
38
- "kind": "const",
39
- "value": [
40
- 100,
41
- 105,
42
- 115,
43
- 116,
44
- 114,
45
- 105,
46
- 98,
47
- 117,
48
- 116,
49
- 105,
50
- 111,
51
- 110,
52
- 95,
53
- 115,
54
- 116,
55
- 97,
56
- 116,
57
- 101
58
- ]
59
- }
60
- ],
61
- "program": {
62
- "kind": "const",
63
- "value": [
64
- 192,
65
- 77,
66
- 48,
67
- 221,
68
- 223,
69
- 198,
70
- 148,
71
- 69,
72
- 53,
73
- 195,
74
- 230,
75
- 52,
76
- 221,
77
- 10,
78
- 39,
79
- 100,
80
- 176,
81
- 246,
82
- 220,
83
- 132,
84
- 12,
85
- 148,
86
- 188,
87
- 218,
88
- 70,
89
- 17,
90
- 75,
91
- 89,
92
- 171,
93
- 198,
94
- 208,
95
- 210
96
- ]
97
- }
98
- }
99
- }
100
- ],
101
- "args": [],
102
- "returns": "u64"
103
- }
104
- ],
105
- "accounts": [
106
- {
107
- "name": "distributionState",
108
- "discriminator": [
109
- 7,
110
- 25,
111
- 94,
112
- 15,
113
- 208,
114
- 170,
115
- 4,
116
- 103
117
- ]
118
- }
119
- ],
120
- "types": [
121
- {
122
- "name": "distributionState",
123
- "type": {
124
- "kind": "struct",
125
- "fields": [
126
- {
127
- "name": "liqsolMint",
128
- "type": "pubkey"
129
- },
130
- {
131
- "name": "totalTrackedBalance",
132
- "type": "u64"
133
- },
134
- {
135
- "name": "availableBalance",
136
- "type": "u64"
137
- },
138
- {
139
- "name": "bump",
140
- "type": "u8"
141
- }
142
- ]
143
- }
144
- }
145
- ]
146
- };