@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,302 +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/deposit.json`.
6
- */
7
- export type Deposit = {
8
- "address": "GqksbjX3r7SHZ5e8c6nFyPecZNnBSUTYHbF8U2YDb5Qf",
9
- "metadata": {
10
- "name": "deposit",
11
- "version": "0.1.0",
12
- "spec": "0.1.0",
13
- "description": "Created with Anchor"
14
- },
15
- "instructions": [
16
- {
17
- "name": "deposit",
18
- "discriminator": [
19
- 242,
20
- 35,
21
- 198,
22
- 137,
23
- 82,
24
- 225,
25
- 242,
26
- 182
27
- ],
28
- "accounts": [
29
- {
30
- "name": "user",
31
- "writable": true,
32
- "signer": true
33
- },
34
- {
35
- "name": "programAuthority",
36
- "writable": true,
37
- "pda": {
38
- "seeds": [
39
- {
40
- "kind": "const",
41
- "value": [
42
- 112,
43
- 114,
44
- 111,
45
- 103,
46
- 114,
47
- 97,
48
- 109,
49
- 95,
50
- 97,
51
- 117,
52
- 116,
53
- 104,
54
- 111,
55
- 114,
56
- 105,
57
- 116,
58
- 121
59
- ]
60
- }
61
- ]
62
- }
63
- },
64
- {
65
- "name": "systemProgram",
66
- "address": "11111111111111111111111111111111"
67
- },
68
- {
69
- "name": "tokenProgram"
70
- },
71
- {
72
- "name": "associatedTokenProgram",
73
- "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
74
- },
75
- {
76
- "name": "stakeControllerProgram",
77
- "address": "4Ab1SwV6RPUN5Btnf95qvQCyNVR3iHnXjnMYaKsgimTp"
78
- },
79
- {
80
- "name": "liqsolProgram"
81
- },
82
- {
83
- "name": "payRateHistory"
84
- },
85
- {
86
- "name": "stakeProgram",
87
- "address": "Stake11111111111111111111111111111111111111"
88
- },
89
- {
90
- "name": "distributionProgram",
91
- "address": "26LF4typrWwBapujpvUPFpdfs4pBb6RwcWoBBy7Awf5j"
92
- },
93
- {
94
- "name": "liqsolMint",
95
- "writable": true
96
- },
97
- {
98
- "name": "userAta",
99
- "writable": true,
100
- "pda": {
101
- "seeds": [
102
- {
103
- "kind": "account",
104
- "path": "user"
105
- },
106
- {
107
- "kind": "account",
108
- "path": "tokenProgram"
109
- },
110
- {
111
- "kind": "account",
112
- "path": "liqsolMint"
113
- }
114
- ],
115
- "program": {
116
- "kind": "const",
117
- "value": [
118
- 140,
119
- 151,
120
- 37,
121
- 143,
122
- 78,
123
- 36,
124
- 137,
125
- 241,
126
- 187,
127
- 61,
128
- 16,
129
- 41,
130
- 20,
131
- 142,
132
- 13,
133
- 131,
134
- 11,
135
- 90,
136
- 19,
137
- 153,
138
- 218,
139
- 255,
140
- 16,
141
- 132,
142
- 4,
143
- 142,
144
- 123,
145
- 216,
146
- 219,
147
- 233,
148
- 248,
149
- 89
150
- ]
151
- }
152
- }
153
- },
154
- {
155
- "name": "liqsolMintAuthority"
156
- },
157
- {
158
- "name": "reservePool",
159
- "writable": true
160
- },
161
- {
162
- "name": "vault",
163
- "writable": true
164
- },
165
- {
166
- "name": "ephemeralStake",
167
- "writable": true
168
- },
169
- {
170
- "name": "controllerState",
171
- "writable": true
172
- },
173
- {
174
- "name": "globalStakeInfo",
175
- "writable": true
176
- },
177
- {
178
- "name": "bucketAuthority",
179
- "pda": {
180
- "seeds": [
181
- {
182
- "kind": "const",
183
- "value": [
184
- 108,
185
- 105,
186
- 113,
187
- 115,
188
- 111,
189
- 108,
190
- 95,
191
- 98,
192
- 117,
193
- 99,
194
- 107,
195
- 101,
196
- 116
197
- ]
198
- }
199
- ],
200
- "program": {
201
- "kind": "account",
202
- "path": "stakeControllerProgram"
203
- }
204
- }
205
- },
206
- {
207
- "name": "bucketTokenAccount",
208
- "docs": [
209
- "The bucket's associated token account"
210
- ],
211
- "writable": true
212
- },
213
- {
214
- "name": "userRecord",
215
- "writable": true
216
- },
217
- {
218
- "name": "distributionState",
219
- "writable": true
220
- },
221
- {
222
- "name": "instructionsSysvar",
223
- "address": "Sysvar1nstructions1111111111111111111111111"
224
- },
225
- {
226
- "name": "clock",
227
- "address": "SysvarC1ock11111111111111111111111111111111"
228
- },
229
- {
230
- "name": "stakeHistory",
231
- "address": "SysvarStakeHistory1111111111111111111111111"
232
- },
233
- {
234
- "name": "rent",
235
- "address": "SysvarRent111111111111111111111111111111111"
236
- }
237
- ],
238
- "args": [
239
- {
240
- "name": "amount",
241
- "type": "u64"
242
- },
243
- {
244
- "name": "seed",
245
- "type": "u32"
246
- }
247
- ]
248
- }
249
- ],
250
- "errors": [
251
- {
252
- "code": 6000,
253
- "name": "depositTooSmall",
254
- "msg": "Deposit amount is below minimum required"
255
- },
256
- {
257
- "code": 6001,
258
- "name": "notInitialized",
259
- "msg": "Deposit Router not initialized"
260
- },
261
- {
262
- "code": 6002,
263
- "name": "invalidAuthority",
264
- "msg": "Invalid authority"
265
- },
266
- {
267
- "code": 6003,
268
- "name": "insufficientFunds",
269
- "msg": "Insufficient funds"
270
- },
271
- {
272
- "code": 6004,
273
- "name": "overflow",
274
- "msg": "Arithmetic overflow"
275
- },
276
- {
277
- "code": 6005,
278
- "name": "calculationFailure",
279
- "msg": "Calculation failure"
280
- },
281
- {
282
- "code": 6006,
283
- "name": "nothingToMint",
284
- "msg": "Cannot mint zero tokens"
285
- },
286
- {
287
- "code": 6007,
288
- "name": "invalidAccount",
289
- "msg": "Invalid account provided"
290
- },
291
- {
292
- "code": 6008,
293
- "name": "insufficientFundsForStake",
294
- "msg": "Insufficient funds remaining after reserving fees to proceed with staking"
295
- },
296
- {
297
- "code": 6009,
298
- "name": "unauthorizedProgram",
299
- "msg": "Unauthorized program attempting to call this instruction"
300
- }
301
- ]
302
- };