@streamflow/staking 7.0.0-alpha.10

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 (39) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +216 -0
  3. package/dist/cjs/index.js +39 -0
  4. package/dist/cjs/solana/client.js +315 -0
  5. package/dist/cjs/solana/constants.js +61 -0
  6. package/dist/cjs/solana/descriptor/fee_manager.js +2 -0
  7. package/dist/cjs/solana/descriptor/idl/fee_manager.json +284 -0
  8. package/dist/cjs/solana/descriptor/idl/reward_pool.json +905 -0
  9. package/dist/cjs/solana/descriptor/idl/stake_pool.json +734 -0
  10. package/dist/cjs/solana/descriptor/reward_pool.js +2 -0
  11. package/dist/cjs/solana/descriptor/stake_pool.js +2 -0
  12. package/dist/cjs/solana/lib/derive-accounts.js +46 -0
  13. package/dist/cjs/solana/lib/rewards.js +134 -0
  14. package/dist/cjs/solana/types.js +2 -0
  15. package/dist/cjs/solana/utils.js +61 -0
  16. package/dist/esm/index.d.ts +6 -0
  17. package/dist/esm/index.js +6 -0
  18. package/dist/esm/solana/client.d.ts +77 -0
  19. package/dist/esm/solana/client.js +313 -0
  20. package/dist/esm/solana/constants.d.ts +50 -0
  21. package/dist/esm/solana/constants.js +58 -0
  22. package/dist/esm/solana/descriptor/fee_manager.d.ts +290 -0
  23. package/dist/esm/solana/descriptor/fee_manager.js +1 -0
  24. package/dist/esm/solana/descriptor/idl/fee_manager.json +284 -0
  25. package/dist/esm/solana/descriptor/idl/reward_pool.json +905 -0
  26. package/dist/esm/solana/descriptor/idl/stake_pool.json +734 -0
  27. package/dist/esm/solana/descriptor/reward_pool.d.ts +939 -0
  28. package/dist/esm/solana/descriptor/reward_pool.js +1 -0
  29. package/dist/esm/solana/descriptor/stake_pool.d.ts +538 -0
  30. package/dist/esm/solana/descriptor/stake_pool.js +1 -0
  31. package/dist/esm/solana/lib/derive-accounts.d.ts +10 -0
  32. package/dist/esm/solana/lib/derive-accounts.js +31 -0
  33. package/dist/esm/solana/lib/rewards.d.ts +24 -0
  34. package/dist/esm/solana/lib/rewards.js +136 -0
  35. package/dist/esm/solana/types.d.ts +66 -0
  36. package/dist/esm/solana/types.js +1 -0
  37. package/dist/esm/solana/utils.d.ts +11 -0
  38. package/dist/esm/solana/utils.js +50 -0
  39. package/package.json +48 -0
@@ -0,0 +1,905 @@
1
+ {
2
+ "address": "RWRDdfRbi3339VgKxTAXg4cjyniF7cbhNbMxZWiSKmj",
3
+ "metadata": {
4
+ "name": "reward_pool",
5
+ "version": "1.0.0",
6
+ "spec": "0.1.0",
7
+ "description": "Program to manage Reward Pools for Stake Pools and claim rewards from them"
8
+ },
9
+ "instructions": [
10
+ {
11
+ "name": "change_authority",
12
+ "discriminator": [50, 106, 66, 104, 99, 118, 145, 88],
13
+ "accounts": [
14
+ {
15
+ "name": "authority",
16
+ "docs": ["Current Authority"],
17
+ "writable": true,
18
+ "signer": true,
19
+ "relations": ["reward_pool"]
20
+ },
21
+ {
22
+ "name": "new_authority"
23
+ },
24
+ {
25
+ "name": "reward_pool",
26
+ "docs": ["Stake Pool"],
27
+ "writable": true
28
+ }
29
+ ],
30
+ "args": []
31
+ },
32
+ {
33
+ "name": "claim_rewards",
34
+ "discriminator": [4, 144, 132, 71, 116, 23, 151, 80],
35
+ "accounts": [
36
+ {
37
+ "name": "reward_pool",
38
+ "docs": ["Reward Pool"],
39
+ "writable": true
40
+ },
41
+ {
42
+ "name": "stake_entry",
43
+ "docs": ["Stake Entry for which rewards are being claimed"]
44
+ },
45
+ {
46
+ "name": "reward_entry",
47
+ "docs": ["Reward Entry that stores metadata about claimed rewards"],
48
+ "writable": true,
49
+ "pda": {
50
+ "seeds": [
51
+ {
52
+ "kind": "const",
53
+ "value": [114, 101, 119, 97, 114, 100, 45, 101, 110, 116, 114, 121]
54
+ },
55
+ {
56
+ "kind": "account",
57
+ "path": "reward_pool"
58
+ },
59
+ {
60
+ "kind": "account",
61
+ "path": "stake_entry"
62
+ }
63
+ ]
64
+ }
65
+ },
66
+ {
67
+ "name": "vault",
68
+ "docs": ["Reward Pool Vault that stores tokens"],
69
+ "writable": true,
70
+ "relations": ["reward_pool"]
71
+ },
72
+ {
73
+ "name": "to",
74
+ "docs": ["Account to send the reward tokens to."],
75
+ "writable": true
76
+ },
77
+ {
78
+ "name": "claimant",
79
+ "docs": ["Who is claiming the tokens."],
80
+ "writable": true,
81
+ "signer": true
82
+ },
83
+ {
84
+ "name": "mint",
85
+ "docs": ["The mint to claim."],
86
+ "relations": ["reward_pool"]
87
+ },
88
+ {
89
+ "name": "token_program"
90
+ },
91
+ {
92
+ "name": "system_program",
93
+ "address": "11111111111111111111111111111111"
94
+ }
95
+ ],
96
+ "args": []
97
+ },
98
+ {
99
+ "name": "close_entry",
100
+ "discriminator": [132, 26, 202, 145, 190, 37, 114, 67],
101
+ "accounts": [
102
+ {
103
+ "name": "reward_pool",
104
+ "docs": ["Reward Pool"]
105
+ },
106
+ {
107
+ "name": "stake_entry",
108
+ "docs": ["Stake Entry for which rewards are being claimed"]
109
+ },
110
+ {
111
+ "name": "reward_entry",
112
+ "docs": ["Reward Entry that stores metadata about claimed rewards"],
113
+ "writable": true,
114
+ "pda": {
115
+ "seeds": [
116
+ {
117
+ "kind": "const",
118
+ "value": [114, 101, 119, 97, 114, 100, 45, 101, 110, 116, 114, 121]
119
+ },
120
+ {
121
+ "kind": "account",
122
+ "path": "reward_pool"
123
+ },
124
+ {
125
+ "kind": "account",
126
+ "path": "stake_entry"
127
+ }
128
+ ]
129
+ }
130
+ },
131
+ {
132
+ "name": "authority",
133
+ "writable": true,
134
+ "signer": true
135
+ },
136
+ {
137
+ "name": "system_program",
138
+ "address": "11111111111111111111111111111111"
139
+ }
140
+ ],
141
+ "args": []
142
+ },
143
+ {
144
+ "name": "create_entry",
145
+ "discriminator": [248, 207, 142, 242, 66, 162, 150, 16],
146
+ "accounts": [
147
+ {
148
+ "name": "stake_pool",
149
+ "docs": ["Original Stake Pool"],
150
+ "relations": ["reward_pool", "stake_entry"]
151
+ },
152
+ {
153
+ "name": "reward_pool",
154
+ "docs": ["Reward Pool"]
155
+ },
156
+ {
157
+ "name": "stake_entry",
158
+ "docs": ["Stake Entry for which rewards are being claimed"]
159
+ },
160
+ {
161
+ "name": "reward_entry",
162
+ "docs": ["Reward Entry that stores metadata about claimed rewards"],
163
+ "writable": true,
164
+ "pda": {
165
+ "seeds": [
166
+ {
167
+ "kind": "const",
168
+ "value": [114, 101, 119, 97, 114, 100, 45, 101, 110, 116, 114, 121]
169
+ },
170
+ {
171
+ "kind": "account",
172
+ "path": "reward_pool"
173
+ },
174
+ {
175
+ "kind": "account",
176
+ "path": "stake_entry"
177
+ }
178
+ ]
179
+ }
180
+ },
181
+ {
182
+ "name": "payer",
183
+ "docs": ["Rent payer"],
184
+ "writable": true,
185
+ "signer": true
186
+ },
187
+ {
188
+ "name": "authority"
189
+ },
190
+ {
191
+ "name": "system_program",
192
+ "address": "11111111111111111111111111111111"
193
+ }
194
+ ],
195
+ "args": []
196
+ },
197
+ {
198
+ "name": "create_pool",
199
+ "discriminator": [233, 146, 209, 142, 207, 104, 64, 188],
200
+ "accounts": [
201
+ {
202
+ "name": "stake_pool",
203
+ "docs": ["Stake Pool to Which Reward Pool is being added"]
204
+ },
205
+ {
206
+ "name": "reward_pool",
207
+ "docs": ["Reward Pool to add"],
208
+ "writable": true,
209
+ "pda": {
210
+ "seeds": [
211
+ {
212
+ "kind": "const",
213
+ "value": [114, 101, 119, 97, 114, 100, 45, 112, 111, 111, 108]
214
+ },
215
+ {
216
+ "kind": "account",
217
+ "path": "stake_pool"
218
+ },
219
+ {
220
+ "kind": "account",
221
+ "path": "mint"
222
+ },
223
+ {
224
+ "kind": "arg",
225
+ "path": "nonce"
226
+ }
227
+ ]
228
+ }
229
+ },
230
+ {
231
+ "name": "mint",
232
+ "docs": ["Mint used for rewards"]
233
+ },
234
+ {
235
+ "name": "vault",
236
+ "docs": ["Escrow Account that will store the tokens"],
237
+ "writable": true,
238
+ "pda": {
239
+ "seeds": [
240
+ {
241
+ "kind": "const",
242
+ "value": [114, 101, 119, 97, 114, 100, 45, 118, 97, 117, 108, 116]
243
+ },
244
+ {
245
+ "kind": "account",
246
+ "path": "reward_pool"
247
+ }
248
+ ]
249
+ }
250
+ },
251
+ {
252
+ "name": "creator",
253
+ "docs": ["Reward Pool creator"],
254
+ "writable": true,
255
+ "signer": true
256
+ },
257
+ {
258
+ "name": "token_program"
259
+ },
260
+ {
261
+ "name": "system_program",
262
+ "address": "11111111111111111111111111111111"
263
+ }
264
+ ],
265
+ "args": [
266
+ {
267
+ "name": "nonce",
268
+ "type": "u8"
269
+ },
270
+ {
271
+ "name": "reward_amount",
272
+ "type": "u64"
273
+ },
274
+ {
275
+ "name": "reward_period",
276
+ "type": "u64"
277
+ },
278
+ {
279
+ "name": "permissionless",
280
+ "type": "bool"
281
+ }
282
+ ]
283
+ },
284
+ {
285
+ "name": "fund_pool",
286
+ "discriminator": [36, 57, 233, 176, 181, 20, 87, 159],
287
+ "accounts": [
288
+ {
289
+ "name": "funder",
290
+ "docs": ["Reward Pool funder"],
291
+ "writable": true,
292
+ "signer": true
293
+ },
294
+ {
295
+ "name": "from",
296
+ "docs": ["Token Account from which tokens will be transferred"],
297
+ "writable": true
298
+ },
299
+ {
300
+ "name": "vault",
301
+ "docs": ["Reward Pool Vault that stores tokens"],
302
+ "writable": true,
303
+ "relations": ["reward_pool"]
304
+ },
305
+ {
306
+ "name": "mint",
307
+ "docs": ["Mint of reward tokens"],
308
+ "relations": ["reward_pool"]
309
+ },
310
+ {
311
+ "name": "reward_pool",
312
+ "docs": ["Stake Pool"],
313
+ "writable": true
314
+ },
315
+ {
316
+ "name": "streamflow_treasury",
317
+ "writable": true,
318
+ "address": "5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw"
319
+ },
320
+ {
321
+ "name": "streamflow_treasury_tokens",
322
+ "writable": true,
323
+ "pda": {
324
+ "seeds": [
325
+ {
326
+ "kind": "account",
327
+ "path": "streamflow_treasury"
328
+ },
329
+ {
330
+ "kind": "account",
331
+ "path": "token_program"
332
+ },
333
+ {
334
+ "kind": "account",
335
+ "path": "mint"
336
+ }
337
+ ],
338
+ "program": {
339
+ "kind": "const",
340
+ "value": [
341
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218,
342
+ 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89
343
+ ]
344
+ }
345
+ }
346
+ },
347
+ {
348
+ "name": "config",
349
+ "docs": ["Fee Configuration"],
350
+ "pda": {
351
+ "seeds": [
352
+ {
353
+ "kind": "const",
354
+ "value": [99, 111, 110, 102, 105, 103]
355
+ }
356
+ ],
357
+ "program": {
358
+ "kind": "account",
359
+ "path": "fee_program"
360
+ }
361
+ }
362
+ },
363
+ {
364
+ "name": "fee_value",
365
+ "docs": ["Fee Value for the funder account"],
366
+ "optional": true,
367
+ "pda": {
368
+ "seeds": [
369
+ {
370
+ "kind": "const",
371
+ "value": [102, 101, 101, 45, 118, 97, 108, 117, 101]
372
+ },
373
+ {
374
+ "kind": "account",
375
+ "path": "funder"
376
+ }
377
+ ],
378
+ "program": {
379
+ "kind": "account",
380
+ "path": "fee_program"
381
+ }
382
+ }
383
+ },
384
+ {
385
+ "name": "fee_program",
386
+ "address": "FEELzfBhsWXTNJX53zZcDVfRNoFYZQ6cZA3jLiGVL16V"
387
+ },
388
+ {
389
+ "name": "token_program"
390
+ }
391
+ ],
392
+ "args": [
393
+ {
394
+ "name": "amount",
395
+ "type": "u64"
396
+ }
397
+ ]
398
+ },
399
+ {
400
+ "name": "update_pool",
401
+ "discriminator": [239, 214, 170, 78, 36, 35, 30, 34],
402
+ "accounts": [
403
+ {
404
+ "name": "authority",
405
+ "docs": ["Current Authority"],
406
+ "writable": true,
407
+ "signer": true,
408
+ "relations": ["reward_pool"]
409
+ },
410
+ {
411
+ "name": "reward_pool",
412
+ "docs": ["Stake Pool"],
413
+ "writable": true
414
+ }
415
+ ],
416
+ "args": [
417
+ {
418
+ "name": "reward_amount",
419
+ "type": {
420
+ "option": "u64"
421
+ }
422
+ },
423
+ {
424
+ "name": "reward_period",
425
+ "type": {
426
+ "option": "u64"
427
+ }
428
+ }
429
+ ]
430
+ }
431
+ ],
432
+ "accounts": [
433
+ {
434
+ "name": "Config",
435
+ "discriminator": [155, 12, 170, 224, 30, 250, 204, 130]
436
+ },
437
+ {
438
+ "name": "FeeValue",
439
+ "discriminator": [10, 188, 89, 64, 4, 183, 231, 0]
440
+ },
441
+ {
442
+ "name": "RewardEntry",
443
+ "discriminator": [208, 191, 173, 14, 213, 84, 179, 162]
444
+ },
445
+ {
446
+ "name": "RewardPool",
447
+ "discriminator": [134, 121, 197, 211, 133, 154, 82, 32]
448
+ },
449
+ {
450
+ "name": "StakeEntry",
451
+ "discriminator": [187, 127, 9, 35, 155, 68, 86, 40]
452
+ },
453
+ {
454
+ "name": "StakePool",
455
+ "discriminator": [121, 34, 206, 21, 79, 127, 255, 28]
456
+ }
457
+ ],
458
+ "errors": [
459
+ {
460
+ "code": 6000,
461
+ "name": "ArithmeticError",
462
+ "msg": "Arithmetic Error (overflow/underflow)"
463
+ },
464
+ {
465
+ "code": 6001,
466
+ "name": "InvalidRewardAmount",
467
+ "msg": "Reward amount should be more than 0"
468
+ },
469
+ {
470
+ "code": 6002,
471
+ "name": "InvalidRewardPeriod",
472
+ "msg": "Reward period should be more than 0"
473
+ },
474
+ {
475
+ "code": 6003,
476
+ "name": "Unauthorized",
477
+ "msg": "Account is not authorized to execute this instruction"
478
+ },
479
+ {
480
+ "code": 6004,
481
+ "name": "OwnerMismatch",
482
+ "msg": "Token account owner did not match intended owner"
483
+ },
484
+ {
485
+ "code": 6005,
486
+ "name": "InvalidRewardVault",
487
+ "msg": "Provided Reward Vault is Invalid"
488
+ },
489
+ {
490
+ "code": 6006,
491
+ "name": "InvalidRewardEntry",
492
+ "msg": "Provided Reward Entry is Invalid"
493
+ },
494
+ {
495
+ "code": 6007,
496
+ "name": "InvalidStakeEntry",
497
+ "msg": "Provided Stake Entry is Invalid"
498
+ },
499
+ {
500
+ "code": 6008,
501
+ "name": "InvalidRewardPool",
502
+ "msg": "Provided Reward Pool is Invalid"
503
+ },
504
+ {
505
+ "code": 6009,
506
+ "name": "InvalidMint",
507
+ "msg": "Invalid Mint"
508
+ },
509
+ {
510
+ "code": 6010,
511
+ "name": "StakeEntryClosed",
512
+ "msg": "Stake Entry is closed, rewards are not claimable anymore"
513
+ },
514
+ {
515
+ "code": 6011,
516
+ "name": "StakeEntryOpened",
517
+ "msg": "Stake Entry is still opened, closing is not possible"
518
+ },
519
+ {
520
+ "code": 6012,
521
+ "name": "RewardPoolDrained",
522
+ "msg": "Reward Pool does not have enough Rewards for Claiming"
523
+ }
524
+ ],
525
+ "types": [
526
+ {
527
+ "name": "Config",
528
+ "type": {
529
+ "kind": "struct",
530
+ "fields": [
531
+ {
532
+ "name": "authority",
533
+ "docs": ["Fee Manager authority"],
534
+ "type": "pubkey"
535
+ },
536
+ {
537
+ "name": "streamflow_fee",
538
+ "docs": ["Default fee"],
539
+ "type": "u64"
540
+ },
541
+ {
542
+ "name": "_buffer_1",
543
+ "docs": ["Buffer for additional fields"],
544
+ "type": {
545
+ "array": ["u8", 64]
546
+ }
547
+ },
548
+ {
549
+ "name": "_buffer_2",
550
+ "docs": ["Buffer for additional fields"],
551
+ "type": {
552
+ "array": ["u8", 64]
553
+ }
554
+ },
555
+ {
556
+ "name": "_buffer_3",
557
+ "docs": ["Buffer for additional fields"],
558
+ "type": {
559
+ "array": ["u8", 64]
560
+ }
561
+ }
562
+ ]
563
+ }
564
+ },
565
+ {
566
+ "name": "FeeValue",
567
+ "type": {
568
+ "kind": "struct",
569
+ "fields": [
570
+ {
571
+ "name": "streamflow_fee",
572
+ "type": "u64"
573
+ },
574
+ {
575
+ "name": "_buffer",
576
+ "docs": ["Buffer for additional fields"],
577
+ "type": {
578
+ "array": ["u8", 64]
579
+ }
580
+ }
581
+ ]
582
+ }
583
+ },
584
+ {
585
+ "name": "RewardEntry",
586
+ "type": {
587
+ "kind": "struct",
588
+ "fields": [
589
+ {
590
+ "name": "reward_pool",
591
+ "docs": ["Reward Pool"],
592
+ "type": "pubkey"
593
+ },
594
+ {
595
+ "name": "stake_entry",
596
+ "docs": ["Stake Entry for which reward entry was initialized"],
597
+ "type": "pubkey"
598
+ },
599
+ {
600
+ "name": "created_ts",
601
+ "docs": ["Timestamp when reward entry has been created"],
602
+ "type": "u64"
603
+ },
604
+ {
605
+ "name": "accounted_amount",
606
+ "docs": ["Sum of accounted amounts, used to correctly issue rewards in case of precision loss"],
607
+ "type": "u128"
608
+ },
609
+ {
610
+ "name": "claimed_amount",
611
+ "docs": ["Sum of already claimed rewards"],
612
+ "type": "u64"
613
+ },
614
+ {
615
+ "name": "last_accounted_ts",
616
+ "docs": ["Timestamp when rewards have been claimed last time"],
617
+ "type": "u64"
618
+ },
619
+ {
620
+ "name": "last_reward_amount",
621
+ "docs": ["Reward amount used on last claim or entry creation"],
622
+ "type": "u64"
623
+ },
624
+ {
625
+ "name": "last_reward_period",
626
+ "docs": ["Reward Period used on last claim or entry creation"],
627
+ "type": "u64"
628
+ },
629
+ {
630
+ "name": "_buffer",
631
+ "docs": ["Buffer for additional fields"],
632
+ "type": {
633
+ "array": ["u8", 32]
634
+ }
635
+ }
636
+ ]
637
+ }
638
+ },
639
+ {
640
+ "name": "RewardPool",
641
+ "type": {
642
+ "kind": "struct",
643
+ "fields": [
644
+ {
645
+ "name": "bump",
646
+ "docs": ["Bump Seed used to sign transactions"],
647
+ "type": "u8"
648
+ },
649
+ {
650
+ "name": "nonce",
651
+ "docs": ["Nonce to differentiate pools for the same mint"],
652
+ "type": "u8"
653
+ },
654
+ {
655
+ "name": "stake_pool",
656
+ "docs": ["Stake Pool for which Reward Pool was added"],
657
+ "type": "pubkey"
658
+ },
659
+ {
660
+ "name": "mint",
661
+ "docs": ["Mint of Reward Pool"],
662
+ "type": "pubkey"
663
+ },
664
+ {
665
+ "name": "creator",
666
+ "docs": ["Creator of the Pool"],
667
+ "type": "pubkey"
668
+ },
669
+ {
670
+ "name": "authority",
671
+ "docs": ["Current authority"],
672
+ "type": "pubkey"
673
+ },
674
+ {
675
+ "name": "reward_amount",
676
+ "docs": [
677
+ "Amount of rewards that will be distributed per effective stake",
678
+ "",
679
+ "Should be a fraction of a raw token amount which is 1 / 10^9,",
680
+ "i.e. `reward_amount` of `1_000_000_000` equals one raw token per effective stake"
681
+ ],
682
+ "type": "u64"
683
+ },
684
+ {
685
+ "name": "reward_period",
686
+ "docs": ["Period of Rewards distribution in seconds"],
687
+ "type": "u64"
688
+ },
689
+ {
690
+ "name": "permissionless",
691
+ "docs": ["Whether anyone can fund the Pool"],
692
+ "type": "bool"
693
+ },
694
+ {
695
+ "name": "last_reward_amount",
696
+ "docs": ["`reward_amount` used before the last update"],
697
+ "type": "u64"
698
+ },
699
+ {
700
+ "name": "last_reward_period",
701
+ "docs": ["`reward_period` used before the last update"],
702
+ "type": "u64"
703
+ },
704
+ {
705
+ "name": "last_amount_update_ts",
706
+ "docs": ["Time when `reward_amount` was updated the last time"],
707
+ "type": "u64"
708
+ },
709
+ {
710
+ "name": "last_period_update_ts",
711
+ "docs": ["Time when `reward_period` was updated the last time"],
712
+ "type": "u64"
713
+ },
714
+ {
715
+ "name": "vault",
716
+ "docs": ["Escrow Account that stores reward tokens"],
717
+ "type": "pubkey"
718
+ },
719
+ {
720
+ "name": "funded_amount",
721
+ "docs": ["Total funded amount"],
722
+ "type": "u64"
723
+ },
724
+ {
725
+ "name": "claimed_amount",
726
+ "docs": ["Total number of rewards claimed"],
727
+ "type": "u64"
728
+ },
729
+ {
730
+ "name": "created_ts",
731
+ "docs": ["Time when Reward Pool was created"],
732
+ "type": "u64"
733
+ },
734
+ {
735
+ "name": "_buffer",
736
+ "docs": ["Buffer for additional fields"],
737
+ "type": {
738
+ "array": ["u8", 56]
739
+ }
740
+ }
741
+ ]
742
+ }
743
+ },
744
+ {
745
+ "name": "StakeEntry",
746
+ "type": {
747
+ "kind": "struct",
748
+ "fields": [
749
+ {
750
+ "name": "nonce",
751
+ "docs": ["Nonce to differentiate stakes for the same pool"],
752
+ "type": "u32"
753
+ },
754
+ {
755
+ "name": "stake_pool",
756
+ "docs": ["Stake Pool for which tokens were staked"],
757
+ "type": "pubkey"
758
+ },
759
+ {
760
+ "name": "payer",
761
+ "docs": ["Original Owner of Staked tokens"],
762
+ "type": "pubkey"
763
+ },
764
+ {
765
+ "name": "authority",
766
+ "docs": ["Authority of the Entry"],
767
+ "type": "pubkey"
768
+ },
769
+ {
770
+ "name": "amount",
771
+ "docs": ["Amount of deposited funds"],
772
+ "type": "u64"
773
+ },
774
+ {
775
+ "name": "duration",
776
+ "docs": ["Duration of the lockup"],
777
+ "type": "u64"
778
+ },
779
+ {
780
+ "name": "effective_amount",
781
+ "docs": [
782
+ "Effective Amount staked, does not equal to deposited amount, accounts for Stake Weight"
783
+ ],
784
+ "type": "u128"
785
+ },
786
+ {
787
+ "name": "created_ts",
788
+ "docs": ["Timestamp when Deposit was made"],
789
+ "type": "u64"
790
+ },
791
+ {
792
+ "name": "closed_ts",
793
+ "docs": ["Flag whether entry has been already unstaked"],
794
+ "type": "u64"
795
+ },
796
+ {
797
+ "name": "_buffer",
798
+ "docs": ["Buffer for additional fields"],
799
+ "type": {
800
+ "array": ["u8", 64]
801
+ }
802
+ }
803
+ ]
804
+ }
805
+ },
806
+ {
807
+ "name": "StakePool",
808
+ "type": {
809
+ "kind": "struct",
810
+ "fields": [
811
+ {
812
+ "name": "bump",
813
+ "docs": ["Bump Seed used to sign transactions"],
814
+ "type": "u8"
815
+ },
816
+ {
817
+ "name": "nonce",
818
+ "docs": ["Nonce to differentiate pools for the same mint"],
819
+ "type": "u8"
820
+ },
821
+ {
822
+ "name": "mint",
823
+ "docs": ["Mint of the Stake Pool"],
824
+ "type": "pubkey"
825
+ },
826
+ {
827
+ "name": "creator",
828
+ "docs": ["Initial Creator"],
829
+ "type": "pubkey"
830
+ },
831
+ {
832
+ "name": "authority",
833
+ "docs": ["Current authority"],
834
+ "type": "pubkey"
835
+ },
836
+ {
837
+ "name": "min_weight",
838
+ "docs": [
839
+ "The lowest weight awarded for staking, measured as a fraction of `1 / SCALE_FACTOR_BASE`.",
840
+ "For instance:",
841
+ "* `min_weight = 1 x SCALE_FACTOR_BASE` signifies a minimum multiplier of 1x for min staking duration",
842
+ "* `min_weight = 2 x SCALE_FACTOR_BASE` indicates a minimum multiplier of 2x for min staking duration"
843
+ ],
844
+ "type": "u64"
845
+ },
846
+ {
847
+ "name": "max_weight",
848
+ "docs": [
849
+ "The highest weight awarded for staking, measured as a fraction of `1 / SCALE_FACTOR_BASE`.",
850
+ "For instance:",
851
+ "* `max_weight = 1 x SCALE_FACTOR_BASE` signifies a max multiplier of 1x for max staking duration",
852
+ "* `max_weight = 2 x SCALE_FACTOR_BASE` indicates a max multiplier of 2x for max staking duration"
853
+ ],
854
+ "type": "u64"
855
+ },
856
+ {
857
+ "name": "min_duration",
858
+ "docs": ["Min Duration of stake in seconds"],
859
+ "type": "u64"
860
+ },
861
+ {
862
+ "name": "max_duration",
863
+ "docs": ["Max Duration of stake in seconds, the more duration, the more weight the stake has"],
864
+ "type": "u64"
865
+ },
866
+ {
867
+ "name": "permissionless",
868
+ "docs": ["Whether anyone can add Reward Pools or just admin"],
869
+ "type": "bool"
870
+ },
871
+ {
872
+ "name": "vault",
873
+ "docs": ["Escrow Account that stores staked tokens"],
874
+ "type": "pubkey"
875
+ },
876
+ {
877
+ "name": "stake_mint",
878
+ "docs": ["Stake Mint, will be returned in exchange for stake tokens"],
879
+ "type": "pubkey"
880
+ },
881
+ {
882
+ "name": "total_stake",
883
+ "docs": ["Total number of Staked tokens"],
884
+ "type": "u64"
885
+ },
886
+ {
887
+ "name": "total_effective_stake",
888
+ "docs": [
889
+ "Total staked tokens accounting for each stake weight, does not equal `total_stake`,",
890
+ "represents a sum of effective stake multiplied by 10^9 for precision"
891
+ ],
892
+ "type": "u128"
893
+ },
894
+ {
895
+ "name": "_buffer",
896
+ "docs": ["Buffer for additional fields"],
897
+ "type": {
898
+ "array": ["u8", 64]
899
+ }
900
+ }
901
+ ]
902
+ }
903
+ }
904
+ ]
905
+ }