@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
@@ -5,7 +5,7 @@
5
5
  * IDL can be found at `target/idl/validator_leaderboard.json`.
6
6
  */
7
7
  export type ValidatorLeaderboard = {
8
- "address": "CYxrJjaraGmdVjnB6EDNyx73pz9Lk2dqpaVtysNo7EXj",
8
+ "address": "5Nf6jL5B2qkMbnLoN3RTT1sKcBKrrsRnovTBDZXcQnfo",
9
9
  "metadata": {
10
10
  "name": "validatorLeaderboard",
11
11
  "version": "0.1.0",
@@ -14,16 +14,16 @@ export type ValidatorLeaderboard = {
14
14
  },
15
15
  "instructions": [
16
16
  {
17
- "name": "initialize",
17
+ "name": "initializeLeaderboard",
18
18
  "discriminator": [
19
- 175,
20
- 175,
21
- 109,
22
- 31,
23
- 13,
24
- 152,
25
- 155,
26
- 237
19
+ 47,
20
+ 23,
21
+ 34,
22
+ 39,
23
+ 46,
24
+ 108,
25
+ 91,
26
+ 176
27
27
  ],
28
28
  "accounts": [
29
29
  {
@@ -32,40 +32,39 @@ export type ValidatorLeaderboard = {
32
32
  "signer": true
33
33
  },
34
34
  {
35
- "name": "leaderboardHead",
36
- "docs": [
37
- "HEAD node - points to the highest VPP validator"
38
- ],
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",
39
63
  "writable": true,
40
- "pda": {
41
- "seeds": [
42
- {
43
- "kind": "const",
44
- "value": [
45
- 108,
46
- 101,
47
- 97,
48
- 100,
49
- 101,
50
- 114,
51
- 98,
52
- 111,
53
- 97,
54
- 114,
55
- 100,
56
- 95,
57
- 104,
58
- 101,
59
- 97,
60
- 100
61
- ]
62
- }
63
- ]
64
- }
64
+ "signer": true
65
65
  },
66
66
  {
67
- "name": "systemProgram",
68
- "address": "11111111111111111111111111111111"
67
+ "name": "systemProgram"
69
68
  }
70
69
  ],
71
70
  "args": []
@@ -93,124 +92,40 @@ export type ValidatorLeaderboard = {
93
92
  },
94
93
  {
95
94
  "name": "validatorRecord",
96
- "writable": true,
97
- "pda": {
98
- "seeds": [
99
- {
100
- "kind": "const",
101
- "value": [
102
- 118,
103
- 97,
104
- 108,
105
- 105,
106
- 100,
107
- 97,
108
- 116,
109
- 111,
110
- 114
111
- ]
112
- },
113
- {
114
- "kind": "account",
115
- "path": "voteAccount"
116
- }
117
- ]
118
- }
95
+ "writable": true
119
96
  },
120
97
  {
121
- "name": "systemProgram",
122
- "address": "11111111111111111111111111111111"
98
+ "name": "systemProgram"
123
99
  }
124
100
  ],
125
101
  "args": []
126
102
  },
127
103
  {
128
- "name": "updateTop10Cache",
104
+ "name": "updateMevCommission",
129
105
  "discriminator": [
130
- 0,
131
- 35,
132
- 58,
133
- 64,
134
- 74,
135
- 12,
136
- 249,
137
- 209
106
+ 107,
107
+ 65,
108
+ 238,
109
+ 108,
110
+ 183,
111
+ 47,
112
+ 236,
113
+ 203
138
114
  ],
139
115
  "accounts": [
140
116
  {
141
- "name": "payer",
142
- "writable": true,
117
+ "name": "signer",
143
118
  "signer": true
144
119
  },
145
120
  {
146
- "name": "cache",
147
- "writable": true,
148
- "pda": {
149
- "seeds": [
150
- {
151
- "kind": "const",
152
- "value": [
153
- 116,
154
- 111,
155
- 112,
156
- 95,
157
- 49,
158
- 48,
159
- 95,
160
- 99,
161
- 97,
162
- 99,
163
- 104,
164
- 101
165
- ]
166
- }
167
- ]
168
- }
169
- },
170
- {
171
- "name": "leaderboardHead",
172
- "pda": {
173
- "seeds": [
174
- {
175
- "kind": "const",
176
- "value": [
177
- 108,
178
- 101,
179
- 97,
180
- 100,
181
- 101,
182
- 114,
183
- 98,
184
- 111,
185
- 97,
186
- 114,
187
- 100,
188
- 95,
189
- 104,
190
- 101,
191
- 97,
192
- 100
193
- ]
194
- }
195
- ]
196
- }
121
+ "name": "validatorRecord",
122
+ "writable": true
197
123
  },
198
124
  {
199
- "name": "systemProgram",
200
- "address": "11111111111111111111111111111111"
125
+ "name": "tipDistributionAccount"
201
126
  }
202
127
  ],
203
- "args": [
204
- {
205
- "name": "top10",
206
- "type": {
207
- "array": [
208
- "pubkey",
209
- 10
210
- ]
211
- }
212
- }
213
- ]
128
+ "args": []
214
129
  },
215
130
  {
216
131
  "name": "updateValidator",
@@ -235,117 +150,40 @@ export type ValidatorLeaderboard = {
235
150
  },
236
151
  {
237
152
  "name": "validatorRecord",
238
- "writable": true,
239
- "pda": {
240
- "seeds": [
241
- {
242
- "kind": "const",
243
- "value": [
244
- 118,
245
- 97,
246
- 108,
247
- 105,
248
- 100,
249
- 97,
250
- 116,
251
- 111,
252
- 114
253
- ]
254
- },
255
- {
256
- "kind": "account",
257
- "path": "voteAccount"
258
- }
259
- ]
260
- }
261
- },
262
- {
263
- "name": "leaderboardHead",
264
- "writable": true,
265
- "pda": {
266
- "seeds": [
267
- {
268
- "kind": "const",
269
- "value": [
270
- 108,
271
- 101,
272
- 97,
273
- 100,
274
- 101,
275
- 114,
276
- 98,
277
- 111,
278
- 97,
279
- 114,
280
- 100,
281
- 95,
282
- 104,
283
- 101,
284
- 97,
285
- 100
286
- ]
287
- }
288
- ]
289
- }
153
+ "writable": true
290
154
  },
291
155
  {
292
- "name": "insertAfter",
293
- "writable": true,
294
- "optional": true
156
+ "name": "leaderboardState",
157
+ "writable": true
295
158
  },
296
159
  {
297
- "name": "insertBefore",
298
- "writable": true,
299
- "optional": true
300
- },
301
- {
302
- "name": "currentPrev",
303
- "writable": true,
304
- "optional": true
305
- },
306
- {
307
- "name": "currentNext",
308
- "writable": true,
309
- "optional": true
310
- },
311
- {
312
- "name": "systemProgram",
313
- "address": "11111111111111111111111111111111"
160
+ "name": "systemProgram"
314
161
  }
315
162
  ],
316
163
  "args": [
317
164
  {
318
165
  "name": "vpp",
319
166
  "type": "u64"
167
+ },
168
+ {
169
+ "name": "proposedRank",
170
+ "type": "u16"
320
171
  }
321
172
  ]
322
173
  }
323
174
  ],
324
175
  "accounts": [
325
176
  {
326
- "name": "leaderboardHead",
177
+ "name": "leaderboardState",
327
178
  "discriminator": [
328
- 159,
329
- 158,
330
- 16,
331
- 9,
332
- 41,
333
- 114,
334
- 23,
335
- 157
336
- ]
337
- },
338
- {
339
- "name": "top10Cache",
340
- "discriminator": [
341
- 112,
342
- 78,
179
+ 211,
180
+ 181,
181
+ 29,
182
+ 120,
343
183
  189,
344
- 26,
345
- 143,
346
- 41,
347
- 15,
348
- 81
184
+ 4,
185
+ 106,
186
+ 111
349
187
  ]
350
188
  },
351
189
  {
@@ -452,71 +290,207 @@ export type ValidatorLeaderboard = {
452
290
  "code": 6017,
453
291
  "name": "commissionNotUpdated",
454
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"
455
343
  }
456
344
  ],
457
345
  "types": [
458
346
  {
459
- "name": "leaderboardHead",
347
+ "name": "leaderboardState",
460
348
  "docs": [
461
- "Special HEAD node for the linked list"
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"
462
352
  ],
353
+ "serialization": "bytemuck",
354
+ "repr": {
355
+ "kind": "c"
356
+ },
463
357
  "type": {
464
358
  "kind": "struct",
465
359
  "fields": [
466
360
  {
467
- "name": "nextValidator",
468
- "type": "pubkey"
361
+ "name": "scores",
362
+ "docs": [
363
+ "VPP scores indexed by registry_index",
364
+ "registry_index is assigned on first validator registration and never changes"
365
+ ],
366
+ "type": {
367
+ "array": [
368
+ "u64",
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"
469
410
  },
470
411
  {
471
412
  "name": "bump",
413
+ "docs": [
414
+ "PDA bump seed"
415
+ ],
472
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
+ }
473
429
  }
474
430
  ]
475
431
  }
476
432
  },
477
433
  {
478
- "name": "top10Cache",
434
+ "name": "pubkeyBytes",
479
435
  "docs": [
480
- "Cache for the top 10 validators for fast CPI access"
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`."
481
438
  ],
439
+ "serialization": "bytemuck",
440
+ "repr": {
441
+ "kind": "transparent"
442
+ },
482
443
  "type": {
483
444
  "kind": "struct",
484
445
  "fields": [
485
446
  {
486
- "name": "validators",
447
+ "name": "bytes",
487
448
  "type": {
488
449
  "array": [
489
- "pubkey",
490
- 10
450
+ "u8",
451
+ 32
491
452
  ]
492
453
  }
493
- },
494
- {
495
- "name": "lastUpdatedSlot",
496
- "type": "u64"
497
- },
498
- {
499
- "name": "bump",
500
- "type": "u8"
501
454
  }
502
455
  ]
503
456
  }
504
457
  },
505
458
  {
506
459
  "name": "validatorRecord",
460
+ "docs": [
461
+ "Per-validator record account storing commission data and metadata"
462
+ ],
507
463
  "type": {
508
464
  "kind": "struct",
509
465
  "fields": [
510
466
  {
511
467
  "name": "voteAccount",
468
+ "docs": [
469
+ "The validator's vote account pubkey"
470
+ ],
512
471
  "type": "pubkey"
513
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
+ },
514
481
  {
515
482
  "name": "creditsObserved",
483
+ "docs": [
484
+ "Current cumulative credits from vote account"
485
+ ],
516
486
  "type": "u64"
517
487
  },
518
488
  {
519
489
  "name": "commissionHistory",
490
+ "docs": [
491
+ "Circular buffer of past 10 commission values (0-100)",
492
+ "Used to penalize validators who increase commission"
493
+ ],
520
494
  "type": {
521
495
  "array": [
522
496
  "u8",
@@ -526,46 +500,77 @@ export type ValidatorLeaderboard = {
526
500
  },
527
501
  {
528
502
  "name": "commissionIndex",
503
+ "docs": [
504
+ "Current index in commission_history circular buffer (0-9)"
505
+ ],
529
506
  "type": "u8"
530
507
  },
531
508
  {
532
509
  "name": "lastCommissionUpdate",
510
+ "docs": [
511
+ "Last epoch when commission was updated"
512
+ ],
533
513
  "type": "u64"
534
514
  },
535
515
  {
536
516
  "name": "epoch",
517
+ "docs": [
518
+ "Last epoch this validator was updated"
519
+ ],
537
520
  "type": "u64"
538
521
  },
539
522
  {
540
523
  "name": "slot",
524
+ "docs": [
525
+ "Last slot this validator was updated"
526
+ ],
541
527
  "type": "u64"
542
528
  },
543
529
  {
544
- "name": "performance",
545
- "type": "u64"
530
+ "name": "wireOperator",
531
+ "docs": [
532
+ "Whether this validator is a Wire operator (5% bonus)"
533
+ ],
534
+ "type": "bool"
546
535
  },
547
536
  {
548
- "name": "stake",
549
- "type": "u64"
537
+ "name": "mevCommission",
538
+ "docs": [
539
+ "Current MEV commission in basis points"
540
+ ],
541
+ "type": "u16"
550
542
  },
551
543
  {
552
- "name": "registrant",
553
- "type": "pubkey"
554
- },
555
- {
556
- "name": "wireOperator",
557
- "type": "bool"
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
+ }
558
554
  },
559
555
  {
560
- "name": "nextValidator",
561
- "type": "pubkey"
556
+ "name": "mevCommissionIndex",
557
+ "docs": [
558
+ "Current index in mev_commission_history circular buffer (0-9)"
559
+ ],
560
+ "type": "u8"
562
561
  },
563
562
  {
564
- "name": "prevValidator",
565
- "type": "pubkey"
563
+ "name": "lastMevCommissionUpdate",
564
+ "docs": [
565
+ "Last epoch when MEV commission was updated"
566
+ ],
567
+ "type": "u64"
566
568
  },
567
569
  {
568
570
  "name": "bump",
571
+ "docs": [
572
+ "PDA bump seed"
573
+ ],
569
574
  "type": "u8"
570
575
  }
571
576
  ]
package/src/index.ts CHANGED
@@ -1,6 +1,3 @@
1
- // Export all utilities from the utils module
2
- export * from './common/utils';
3
-
4
1
  // Staker utilities
5
2
  export * from './staker/staker';
6
3
  export * from './staker/types';
@@ -13,6 +10,7 @@ export * as ETH from './networks/ethereum/types';
13
10
  export * from './networks/solana/solana';
14
11
  export * from './networks/solana/constants';
15
12
  export * as SOL from './networks/solana/types';
13
+ export * from './networks/solana/utils';
16
14
 
17
15
  // CLIENTS
18
16
  export * from './networks/solana/clients/deposit.client';