@streamflow/staking 7.5.3 → 8.0.0-alpha.p287.25d0c28

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 (59) hide show
  1. package/dist/cjs/index.cjs +2988 -0
  2. package/dist/cjs/index.cjs.map +1 -0
  3. package/dist/cjs/index.d.cts +298 -0
  4. package/dist/cjs/solana/descriptor/fee_manager.cjs +4 -0
  5. package/dist/cjs/solana/descriptor/fee_manager.cjs.map +1 -0
  6. package/dist/cjs/solana/descriptor/fee_manager.d.cts +292 -0
  7. package/dist/cjs/solana/descriptor/reward_pool.cjs +4 -0
  8. package/dist/cjs/solana/descriptor/reward_pool.cjs.map +1 -0
  9. package/dist/cjs/solana/descriptor/reward_pool.d.cts +967 -0
  10. package/dist/cjs/solana/descriptor/stake_pool.cjs +4 -0
  11. package/dist/cjs/solana/descriptor/stake_pool.cjs.map +1 -0
  12. package/dist/cjs/solana/descriptor/stake_pool.d.cts +954 -0
  13. package/dist/esm/index.d.ts +298 -7
  14. package/dist/esm/index.js +2963 -7
  15. package/dist/esm/index.js.map +1 -0
  16. package/dist/esm/solana/descriptor/fee_manager.d.ts +3 -1
  17. package/dist/esm/solana/descriptor/fee_manager.js +3 -1
  18. package/dist/esm/solana/descriptor/fee_manager.js.map +1 -0
  19. package/dist/esm/solana/descriptor/idl/fee_manager.json +255 -407
  20. package/dist/esm/solana/descriptor/idl/reward_pool.json +853 -1296
  21. package/dist/esm/solana/descriptor/idl/stake_pool.json +875 -1247
  22. package/dist/esm/solana/descriptor/reward_pool.d.ts +3 -1
  23. package/dist/esm/solana/descriptor/reward_pool.js +3 -1
  24. package/dist/esm/solana/descriptor/reward_pool.js.map +1 -0
  25. package/dist/esm/solana/descriptor/stake_pool.d.ts +3 -1
  26. package/dist/esm/solana/descriptor/stake_pool.js +3 -1
  27. package/dist/esm/solana/descriptor/stake_pool.js.map +1 -0
  28. package/package.json +63 -18
  29. package/dist/cjs/__tests__/solana/rewards.spec.js +0 -61
  30. package/dist/cjs/index.js +0 -37
  31. package/dist/cjs/solana/client.js +0 -336
  32. package/dist/cjs/solana/constants.js +0 -72
  33. package/dist/cjs/solana/descriptor/fee_manager.js +0 -2
  34. package/dist/cjs/solana/descriptor/idl/fee_manager.json +0 -436
  35. package/dist/cjs/solana/descriptor/idl/reward_pool.json +0 -1372
  36. package/dist/cjs/solana/descriptor/idl/stake_pool.json +0 -1318
  37. package/dist/cjs/solana/descriptor/reward_pool.js +0 -2
  38. package/dist/cjs/solana/descriptor/stake_pool.js +0 -2
  39. package/dist/cjs/solana/lib/derive-accounts.js +0 -46
  40. package/dist/cjs/solana/lib/fee-amounts.js +0 -44
  41. package/dist/cjs/solana/lib/rewards.js +0 -154
  42. package/dist/cjs/solana/lib/stake-weight.js +0 -19
  43. package/dist/cjs/solana/types.js +0 -2
  44. package/dist/esm/__tests__/solana/rewards.spec.d.ts +0 -1
  45. package/dist/esm/__tests__/solana/rewards.spec.js +0 -56
  46. package/dist/esm/solana/client.d.ts +0 -89
  47. package/dist/esm/solana/client.js +0 -334
  48. package/dist/esm/solana/constants.d.ts +0 -54
  49. package/dist/esm/solana/constants.js +0 -69
  50. package/dist/esm/solana/lib/derive-accounts.d.ts +0 -10
  51. package/dist/esm/solana/lib/derive-accounts.js +0 -31
  52. package/dist/esm/solana/lib/fee-amounts.d.ts +0 -9
  53. package/dist/esm/solana/lib/fee-amounts.js +0 -38
  54. package/dist/esm/solana/lib/rewards.d.ts +0 -26
  55. package/dist/esm/solana/lib/rewards.js +0 -152
  56. package/dist/esm/solana/lib/stake-weight.d.ts +0 -2
  57. package/dist/esm/solana/lib/stake-weight.js +0 -12
  58. package/dist/esm/solana/types.d.ts +0 -77
  59. package/dist/esm/solana/types.js +0 -1
@@ -1,1372 +1,929 @@
1
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"
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": []
8
31
  },
9
- "instructions": [
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
+ },
10
41
  {
11
- "name": "change_authority",
12
- "discriminator": [
13
- 50,
14
- 106,
15
- 66,
16
- 104,
17
- 99,
18
- 118,
19
- 145,
20
- 88
21
- ],
22
- "accounts": [
23
- {
24
- "name": "authority",
25
- "docs": [
26
- "Current Authority"
27
- ],
28
- "writable": true,
29
- "signer": true,
30
- "relations": [
31
- "reward_pool"
32
- ]
33
- },
34
- {
35
- "name": "new_authority"
36
- },
37
- {
38
- "name": "reward_pool",
39
- "docs": [
40
- "Stake Pool"
41
- ],
42
- "writable": true
43
- }
44
- ],
45
- "args": []
42
+ "name": "stake_entry",
43
+ "docs": ["Stake Entry for which rewards are being claimed"]
46
44
  },
47
45
  {
48
- "name": "claim_rewards",
49
- "discriminator": [
50
- 4,
51
- 144,
52
- 132,
53
- 71,
54
- 116,
55
- 23,
56
- 151,
57
- 80
58
- ],
59
- "accounts": [
60
- {
61
- "name": "reward_pool",
62
- "docs": [
63
- "Reward Pool"
64
- ],
65
- "writable": true
66
- },
67
- {
68
- "name": "stake_entry",
69
- "docs": [
70
- "Stake Entry for which rewards are being claimed"
71
- ]
72
- },
73
- {
74
- "name": "reward_entry",
75
- "docs": [
76
- "Reward Entry that stores metadata about claimed rewards"
77
- ],
78
- "writable": true,
79
- "pda": {
80
- "seeds": [
81
- {
82
- "kind": "const",
83
- "value": [
84
- 114,
85
- 101,
86
- 119,
87
- 97,
88
- 114,
89
- 100,
90
- 45,
91
- 101,
92
- 110,
93
- 116,
94
- 114,
95
- 121
96
- ]
97
- },
98
- {
99
- "kind": "account",
100
- "path": "reward_pool"
101
- },
102
- {
103
- "kind": "account",
104
- "path": "stake_entry"
105
- }
106
- ]
107
- }
108
- },
109
- {
110
- "name": "vault",
111
- "docs": [
112
- "Reward Pool Vault that stores tokens"
113
- ],
114
- "writable": true,
115
- "relations": [
116
- "reward_pool"
117
- ]
118
- },
119
- {
120
- "name": "to",
121
- "docs": [
122
- "Account to send the reward tokens to."
123
- ],
124
- "writable": true
125
- },
126
- {
127
- "name": "claimant",
128
- "docs": [
129
- "Who is claiming the tokens."
130
- ],
131
- "writable": true,
132
- "signer": true
133
- },
134
- {
135
- "name": "mint",
136
- "docs": [
137
- "The mint to claim."
138
- ],
139
- "relations": [
140
- "reward_pool"
141
- ]
142
- },
143
- {
144
- "name": "token_program"
145
- },
146
- {
147
- "name": "system_program",
148
- "address": "11111111111111111111111111111111"
149
- }
150
- ],
151
- "args": []
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
+ }
152
65
  },
153
66
  {
154
- "name": "close_entry",
155
- "discriminator": [
156
- 132,
157
- 26,
158
- 202,
159
- 145,
160
- 190,
161
- 37,
162
- 114,
163
- 67
164
- ],
165
- "accounts": [
166
- {
167
- "name": "reward_pool",
168
- "docs": [
169
- "Reward Pool"
170
- ]
171
- },
172
- {
173
- "name": "stake_entry",
174
- "docs": [
175
- "Stake Entry for which rewards are being claimed"
176
- ]
177
- },
178
- {
179
- "name": "reward_entry",
180
- "docs": [
181
- "Reward Entry that stores metadata about claimed rewards"
182
- ],
183
- "writable": true,
184
- "pda": {
185
- "seeds": [
186
- {
187
- "kind": "const",
188
- "value": [
189
- 114,
190
- 101,
191
- 119,
192
- 97,
193
- 114,
194
- 100,
195
- 45,
196
- 101,
197
- 110,
198
- 116,
199
- 114,
200
- 121
201
- ]
202
- },
203
- {
204
- "kind": "account",
205
- "path": "reward_pool"
206
- },
207
- {
208
- "kind": "account",
209
- "path": "stake_entry"
210
- }
211
- ]
212
- }
213
- },
214
- {
215
- "name": "authority",
216
- "writable": true,
217
- "signer": true
218
- },
219
- {
220
- "name": "system_program",
221
- "address": "11111111111111111111111111111111"
222
- }
223
- ],
224
- "args": []
67
+ "name": "vault",
68
+ "docs": ["Reward Pool Vault that stores tokens"],
69
+ "writable": true,
70
+ "relations": ["reward_pool"]
225
71
  },
226
72
  {
227
- "name": "create_entry",
228
- "discriminator": [
229
- 248,
230
- 207,
231
- 142,
232
- 242,
233
- 66,
234
- 162,
235
- 150,
236
- 16
237
- ],
238
- "accounts": [
239
- {
240
- "name": "stake_pool",
241
- "docs": [
242
- "Original Stake Pool"
243
- ],
244
- "relations": [
245
- "reward_pool",
246
- "stake_entry"
247
- ]
248
- },
249
- {
250
- "name": "reward_pool",
251
- "docs": [
252
- "Reward Pool"
253
- ]
254
- },
255
- {
256
- "name": "stake_entry",
257
- "docs": [
258
- "Stake Entry for which rewards are being claimed"
259
- ]
260
- },
261
- {
262
- "name": "reward_entry",
263
- "docs": [
264
- "Reward Entry that stores metadata about claimed rewards"
265
- ],
266
- "writable": true,
267
- "pda": {
268
- "seeds": [
269
- {
270
- "kind": "const",
271
- "value": [
272
- 114,
273
- 101,
274
- 119,
275
- 97,
276
- 114,
277
- 100,
278
- 45,
279
- 101,
280
- 110,
281
- 116,
282
- 114,
283
- 121
284
- ]
285
- },
286
- {
287
- "kind": "account",
288
- "path": "reward_pool"
289
- },
290
- {
291
- "kind": "account",
292
- "path": "stake_entry"
293
- }
294
- ]
295
- }
296
- },
297
- {
298
- "name": "payer",
299
- "docs": [
300
- "Rent payer"
301
- ],
302
- "writable": true,
303
- "signer": true
304
- },
305
- {
306
- "name": "authority"
307
- },
308
- {
309
- "name": "system_program",
310
- "address": "11111111111111111111111111111111"
311
- }
312
- ],
313
- "args": []
73
+ "name": "to",
74
+ "docs": ["Account to send the reward tokens to."],
75
+ "writable": true
314
76
  },
315
77
  {
316
- "name": "create_pool",
317
- "discriminator": [
318
- 233,
319
- 146,
320
- 209,
321
- 142,
322
- 207,
323
- 104,
324
- 64,
325
- 188
326
- ],
327
- "accounts": [
328
- {
329
- "name": "stake_pool",
330
- "docs": [
331
- "Stake Pool to Which Reward Pool is being added"
332
- ]
333
- },
334
- {
335
- "name": "reward_pool",
336
- "docs": [
337
- "Reward Pool to add"
338
- ],
339
- "writable": true,
340
- "pda": {
341
- "seeds": [
342
- {
343
- "kind": "const",
344
- "value": [
345
- 114,
346
- 101,
347
- 119,
348
- 97,
349
- 114,
350
- 100,
351
- 45,
352
- 112,
353
- 111,
354
- 111,
355
- 108
356
- ]
357
- },
358
- {
359
- "kind": "account",
360
- "path": "stake_pool"
361
- },
362
- {
363
- "kind": "account",
364
- "path": "mint"
365
- },
366
- {
367
- "kind": "arg",
368
- "path": "nonce"
369
- }
370
- ]
371
- }
372
- },
373
- {
374
- "name": "mint",
375
- "docs": [
376
- "Mint used for rewards"
377
- ]
378
- },
379
- {
380
- "name": "vault",
381
- "docs": [
382
- "Escrow Account that will store the tokens"
383
- ],
384
- "writable": true,
385
- "pda": {
386
- "seeds": [
387
- {
388
- "kind": "const",
389
- "value": [
390
- 114,
391
- 101,
392
- 119,
393
- 97,
394
- 114,
395
- 100,
396
- 45,
397
- 118,
398
- 97,
399
- 117,
400
- 108,
401
- 116
402
- ]
403
- },
404
- {
405
- "kind": "account",
406
- "path": "reward_pool"
407
- }
408
- ]
409
- }
410
- },
411
- {
412
- "name": "creator",
413
- "docs": [
414
- "Reward Pool creator"
415
- ],
416
- "writable": true,
417
- "signer": true
418
- },
419
- {
420
- "name": "token_program"
421
- },
422
- {
423
- "name": "system_program",
424
- "address": "11111111111111111111111111111111"
425
- }
426
- ],
427
- "args": [
428
- {
429
- "name": "nonce",
430
- "type": "u8"
431
- },
432
- {
433
- "name": "reward_amount",
434
- "type": "u64"
435
- },
436
- {
437
- "name": "reward_period",
438
- "type": "u64"
439
- },
440
- {
441
- "name": "permissionless",
442
- "type": "bool"
443
- },
444
- {
445
- "name": "last_claim_period_opt",
446
- "type": {
447
- "option": "u64"
448
- }
449
- }
450
- ]
78
+ "name": "claimant",
79
+ "docs": ["Who is claiming the tokens."],
80
+ "writable": true,
81
+ "signer": true
451
82
  },
452
83
  {
453
- "name": "fund_pool",
454
- "discriminator": [
455
- 36,
456
- 57,
457
- 233,
458
- 176,
459
- 181,
460
- 20,
461
- 87,
462
- 159
463
- ],
464
- "accounts": [
465
- {
466
- "name": "funder",
467
- "docs": [
468
- "Reward Pool funder"
469
- ],
470
- "writable": true,
471
- "signer": true
472
- },
473
- {
474
- "name": "from",
475
- "docs": [
476
- "Token Account from which tokens will be transferred"
477
- ],
478
- "writable": true
479
- },
480
- {
481
- "name": "vault",
482
- "docs": [
483
- "Reward Pool Vault that stores tokens"
484
- ],
485
- "writable": true,
486
- "relations": [
487
- "reward_pool"
488
- ]
489
- },
490
- {
491
- "name": "mint",
492
- "docs": [
493
- "Mint of reward tokens"
494
- ],
495
- "relations": [
496
- "reward_pool"
497
- ]
498
- },
499
- {
500
- "name": "reward_pool",
501
- "docs": [
502
- "Stake Pool"
503
- ],
504
- "writable": true
505
- },
506
- {
507
- "name": "streamflow_treasury",
508
- "writable": true,
509
- "address": "5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw"
510
- },
511
- {
512
- "name": "streamflow_treasury_tokens",
513
- "writable": true,
514
- "pda": {
515
- "seeds": [
516
- {
517
- "kind": "account",
518
- "path": "streamflow_treasury"
519
- },
520
- {
521
- "kind": "account",
522
- "path": "token_program"
523
- },
524
- {
525
- "kind": "account",
526
- "path": "mint"
527
- }
528
- ],
529
- "program": {
530
- "kind": "const",
531
- "value": [
532
- 140,
533
- 151,
534
- 37,
535
- 143,
536
- 78,
537
- 36,
538
- 137,
539
- 241,
540
- 187,
541
- 61,
542
- 16,
543
- 41,
544
- 20,
545
- 142,
546
- 13,
547
- 131,
548
- 11,
549
- 90,
550
- 19,
551
- 153,
552
- 218,
553
- 255,
554
- 16,
555
- 132,
556
- 4,
557
- 142,
558
- 123,
559
- 216,
560
- 219,
561
- 233,
562
- 248,
563
- 89
564
- ]
565
- }
566
- }
567
- },
568
- {
569
- "name": "config",
570
- "docs": [
571
- "Fee Configuration"
572
- ],
573
- "pda": {
574
- "seeds": [
575
- {
576
- "kind": "const",
577
- "value": [
578
- 99,
579
- 111,
580
- 110,
581
- 102,
582
- 105,
583
- 103
584
- ]
585
- }
586
- ],
587
- "program": {
588
- "kind": "account",
589
- "path": "fee_program"
590
- }
591
- }
592
- },
593
- {
594
- "name": "fee_value",
595
- "docs": [
596
- "Fee Value for the funder account"
597
- ],
598
- "optional": true,
599
- "pda": {
600
- "seeds": [
601
- {
602
- "kind": "const",
603
- "value": [
604
- 102,
605
- 101,
606
- 101,
607
- 45,
608
- 118,
609
- 97,
610
- 108,
611
- 117,
612
- 101
613
- ]
614
- },
615
- {
616
- "kind": "account",
617
- "path": "funder"
618
- }
619
- ],
620
- "program": {
621
- "kind": "account",
622
- "path": "fee_program"
623
- }
624
- }
625
- },
626
- {
627
- "name": "fee_program",
628
- "address": "FEELzfBhsWXTNJX53zZcDVfRNoFYZQ6cZA3jLiGVL16V"
629
- },
630
- {
631
- "name": "token_program"
632
- }
633
- ],
634
- "args": [
635
- {
636
- "name": "amount",
637
- "type": "u64"
638
- }
639
- ]
84
+ "name": "mint",
85
+ "docs": ["The mint to claim."],
86
+ "relations": ["reward_pool"]
640
87
  },
641
88
  {
642
- "name": "update_pool",
643
- "discriminator": [
644
- 239,
645
- 214,
646
- 170,
647
- 78,
648
- 36,
649
- 35,
650
- 30,
651
- 34
652
- ],
653
- "accounts": [
654
- {
655
- "name": "authority",
656
- "docs": [
657
- "Current Authority"
658
- ],
659
- "writable": true,
660
- "signer": true,
661
- "relations": [
662
- "reward_pool"
663
- ]
664
- },
665
- {
666
- "name": "stake_pool",
667
- "docs": [
668
- "Stake Pool to Which Reward Pool belongs"
669
- ],
670
- "relations": [
671
- "reward_pool"
672
- ]
673
- },
674
- {
675
- "name": "reward_pool",
676
- "docs": [
677
- "Reward Pool"
678
- ],
679
- "writable": true
680
- }
681
- ],
682
- "args": [
683
- {
684
- "name": "reward_amount",
685
- "type": {
686
- "option": "u64"
687
- }
688
- },
689
- {
690
- "name": "reward_period",
691
- "type": {
692
- "option": "u64"
693
- }
694
- }
695
- ]
89
+ "name": "token_program"
90
+ },
91
+ {
92
+ "name": "system_program",
93
+ "address": "11111111111111111111111111111111"
696
94
  }
697
- ],
698
- "accounts": [
95
+ ],
96
+ "args": []
97
+ },
98
+ {
99
+ "name": "close_entry",
100
+ "discriminator": [132, 26, 202, 145, 190, 37, 114, 67],
101
+ "accounts": [
699
102
  {
700
- "name": "Config",
701
- "discriminator": [
702
- 155,
703
- 12,
704
- 170,
705
- 224,
706
- 30,
707
- 250,
708
- 204,
709
- 130
710
- ]
103
+ "name": "reward_pool",
104
+ "docs": ["Reward Pool"]
711
105
  },
712
106
  {
713
- "name": "FeeValue",
714
- "discriminator": [
715
- 10,
716
- 188,
717
- 89,
718
- 64,
719
- 4,
720
- 183,
721
- 231,
722
- 0
723
- ]
107
+ "name": "stake_entry",
108
+ "docs": ["Stake Entry for which rewards are being claimed"]
724
109
  },
725
110
  {
726
- "name": "RewardEntry",
727
- "discriminator": [
728
- 208,
729
- 191,
730
- 173,
731
- 14,
732
- 213,
733
- 84,
734
- 179,
735
- 162
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
+ }
736
128
  ]
129
+ }
737
130
  },
738
131
  {
739
- "name": "RewardPool",
740
- "discriminator": [
741
- 134,
742
- 121,
743
- 197,
744
- 211,
745
- 133,
746
- 154,
747
- 82,
748
- 32
749
- ]
132
+ "name": "authority",
133
+ "writable": true,
134
+ "signer": true
750
135
  },
751
136
  {
752
- "name": "StakeEntry",
753
- "discriminator": [
754
- 187,
755
- 127,
756
- 9,
757
- 35,
758
- 155,
759
- 68,
760
- 86,
761
- 40
762
- ]
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"]
763
159
  },
764
160
  {
765
- "name": "StakePool",
766
- "discriminator": [
767
- 121,
768
- 34,
769
- 206,
770
- 21,
771
- 79,
772
- 127,
773
- 255,
774
- 28
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
+ }
775
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"
776
193
  }
777
- ],
778
- "errors": [
194
+ ],
195
+ "args": []
196
+ },
197
+ {
198
+ "name": "create_pool",
199
+ "discriminator": [233, 146, 209, 142, 207, 104, 64, 188],
200
+ "accounts": [
779
201
  {
780
- "code": 6000,
781
- "name": "ArithmeticError",
782
- "msg": "Arithmetic Error (overflow/underflow)"
202
+ "name": "stake_pool",
203
+ "docs": ["Stake Pool to Which Reward Pool is being added"]
783
204
  },
784
205
  {
785
- "code": 6001,
786
- "name": "InvalidRewardAmount",
787
- "msg": "Reward amount should be more than 0"
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
+ }
788
229
  },
789
230
  {
790
- "code": 6002,
791
- "name": "InvalidRewardPeriod",
792
- "msg": "Reward period should be more than 0"
231
+ "name": "mint",
232
+ "docs": ["Mint used for rewards"]
793
233
  },
794
234
  {
795
- "code": 6003,
796
- "name": "Unauthorized",
797
- "msg": "Account is not authorized to execute this instruction"
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
+ }
798
250
  },
799
251
  {
800
- "code": 6004,
801
- "name": "OwnerMismatch",
802
- "msg": "Token account owner did not match intended owner"
252
+ "name": "creator",
253
+ "docs": ["Reward Pool creator"],
254
+ "writable": true,
255
+ "signer": true
803
256
  },
804
257
  {
805
- "code": 6005,
806
- "name": "InvalidRewardVault",
807
- "msg": "Provided Reward Vault is Invalid"
258
+ "name": "token_program"
808
259
  },
809
260
  {
810
- "code": 6006,
811
- "name": "InvalidRewardEntry",
812
- "msg": "Provided Reward Entry is Invalid"
261
+ "name": "system_program",
262
+ "address": "11111111111111111111111111111111"
263
+ }
264
+ ],
265
+ "args": [
266
+ {
267
+ "name": "nonce",
268
+ "type": "u8"
813
269
  },
814
270
  {
815
- "code": 6007,
816
- "name": "InvalidStakeEntry",
817
- "msg": "Provided Stake Entry is Invalid"
271
+ "name": "reward_amount",
272
+ "type": "u64"
818
273
  },
819
274
  {
820
- "code": 6008,
821
- "name": "InvalidRewardPool",
822
- "msg": "Provided Reward Pool is Invalid"
275
+ "name": "reward_period",
276
+ "type": "u64"
823
277
  },
824
278
  {
825
- "code": 6009,
826
- "name": "InvalidMint",
827
- "msg": "Invalid Mint"
279
+ "name": "permissionless",
280
+ "type": "bool"
828
281
  },
829
282
  {
830
- "code": 6010,
831
- "name": "StakeEntryClosed",
832
- "msg": "Stake Entry is closed, rewards are not claimable anymore"
283
+ "name": "last_claim_period_opt",
284
+ "type": {
285
+ "option": "u64"
286
+ }
287
+ }
288
+ ]
289
+ },
290
+ {
291
+ "name": "fund_pool",
292
+ "discriminator": [36, 57, 233, 176, 181, 20, 87, 159],
293
+ "accounts": [
294
+ {
295
+ "name": "funder",
296
+ "docs": ["Reward Pool funder"],
297
+ "writable": true,
298
+ "signer": true
833
299
  },
834
300
  {
835
- "code": 6011,
836
- "name": "StakeEntryOpened",
837
- "msg": "Stake Entry is still opened, closing is not possible"
301
+ "name": "from",
302
+ "docs": ["Token Account from which tokens will be transferred"],
303
+ "writable": true
838
304
  },
839
305
  {
840
- "code": 6012,
841
- "name": "RewardPoolDrained",
842
- "msg": "Reward Pool does not have enough Rewards for Claiming"
306
+ "name": "vault",
307
+ "docs": ["Reward Pool Vault that stores tokens"],
308
+ "writable": true,
309
+ "relations": ["reward_pool"]
843
310
  },
844
311
  {
845
- "code": 6013,
846
- "name": "UpdateTooSoon",
847
- "msg": "Repeated update can not happen sooner than the stake pool max duration"
312
+ "name": "mint",
313
+ "docs": ["Mint of reward tokens"],
314
+ "relations": ["reward_pool"]
848
315
  },
849
316
  {
850
- "code": 6014,
851
- "name": "InvalidLastClaimPeriod",
852
- "msg": "Invalid last claim period provided"
853
- }
854
- ],
855
- "types": [
317
+ "name": "reward_pool",
318
+ "docs": ["Stake Pool"],
319
+ "writable": true
320
+ },
856
321
  {
857
- "name": "Config",
858
- "type": {
859
- "kind": "struct",
860
- "fields": [
861
- {
862
- "name": "authority",
863
- "docs": [
864
- "Fee Manager authority"
865
- ],
866
- "type": "pubkey"
867
- },
868
- {
869
- "name": "streamflow_fee",
870
- "docs": [
871
- "Default fee"
872
- ],
873
- "type": "u64"
874
- },
875
- {
876
- "name": "_buffer_1",
877
- "docs": [
878
- "Buffer for additional fields"
879
- ],
880
- "type": {
881
- "array": [
882
- "u8",
883
- 64
884
- ]
885
- }
886
- },
887
- {
888
- "name": "_buffer_2",
889
- "docs": [
890
- "Buffer for additional fields"
891
- ],
892
- "type": {
893
- "array": [
894
- "u8",
895
- 64
896
- ]
897
- }
898
- },
899
- {
900
- "name": "_buffer_3",
901
- "docs": [
902
- "Buffer for additional fields"
903
- ],
904
- "type": {
905
- "array": [
906
- "u8",
907
- 64
908
- ]
909
- }
910
- }
911
- ]
912
- }
322
+ "name": "streamflow_treasury",
323
+ "writable": true,
324
+ "address": "5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw"
913
325
  },
914
326
  {
915
- "name": "FeeValue",
916
- "type": {
917
- "kind": "struct",
918
- "fields": [
919
- {
920
- "name": "streamflow_fee",
921
- "type": "u64"
922
- },
923
- {
924
- "name": "_buffer",
925
- "docs": [
926
- "Buffer for additional fields"
927
- ],
928
- "type": {
929
- "array": [
930
- "u8",
931
- 64
932
- ]
933
- }
934
- }
935
- ]
327
+ "name": "streamflow_treasury_tokens",
328
+ "writable": true,
329
+ "pda": {
330
+ "seeds": [
331
+ {
332
+ "kind": "account",
333
+ "path": "streamflow_treasury"
334
+ },
335
+ {
336
+ "kind": "account",
337
+ "path": "token_program"
338
+ },
339
+ {
340
+ "kind": "account",
341
+ "path": "mint"
342
+ }
343
+ ],
344
+ "program": {
345
+ "kind": "const",
346
+ "value": [
347
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16,
348
+ 132, 4, 142, 123, 216, 219, 233, 248, 89
349
+ ]
936
350
  }
351
+ }
937
352
  },
938
353
  {
939
- "name": "RewardEntry",
940
- "type": {
941
- "kind": "struct",
942
- "fields": [
943
- {
944
- "name": "reward_pool",
945
- "docs": [
946
- "Reward Pool"
947
- ],
948
- "type": "pubkey"
949
- },
950
- {
951
- "name": "stake_entry",
952
- "docs": [
953
- "Stake Entry for which reward entry was initialized"
954
- ],
955
- "type": "pubkey"
956
- },
957
- {
958
- "name": "created_ts",
959
- "docs": [
960
- "Timestamp when reward entry has been created"
961
- ],
962
- "type": "u64"
963
- },
964
- {
965
- "name": "accounted_amount",
966
- "docs": [
967
- "Sum of accounted amounts, used to correctly issue rewards in case of precision loss"
968
- ],
969
- "type": "u128"
970
- },
971
- {
972
- "name": "claimed_amount",
973
- "docs": [
974
- "Sum of already claimed rewards"
975
- ],
976
- "type": "u64"
977
- },
978
- {
979
- "name": "last_accounted_ts",
980
- "docs": [
981
- "Timestamp when rewards have been claimed last time"
982
- ],
983
- "type": "u64"
984
- },
985
- {
986
- "name": "last_reward_amount",
987
- "docs": [
988
- "Reward amount used on last claim or entry creation"
989
- ],
990
- "type": "u64"
991
- },
992
- {
993
- "name": "last_reward_period",
994
- "docs": [
995
- "Reward Period used on last claim or entry creation"
996
- ],
997
- "type": "u64"
998
- },
999
- {
1000
- "name": "_buffer",
1001
- "docs": [
1002
- "Buffer for additional fields"
1003
- ],
1004
- "type": {
1005
- "array": [
1006
- "u8",
1007
- 32
1008
- ]
1009
- }
1010
- }
1011
- ]
354
+ "name": "config",
355
+ "docs": ["Fee Configuration"],
356
+ "pda": {
357
+ "seeds": [
358
+ {
359
+ "kind": "const",
360
+ "value": [99, 111, 110, 102, 105, 103]
361
+ }
362
+ ],
363
+ "program": {
364
+ "kind": "account",
365
+ "path": "fee_program"
1012
366
  }
367
+ }
1013
368
  },
1014
369
  {
1015
- "name": "RewardPool",
1016
- "type": {
1017
- "kind": "struct",
1018
- "fields": [
1019
- {
1020
- "name": "bump",
1021
- "docs": [
1022
- "Bump Seed used to sign transactions"
1023
- ],
1024
- "type": "u8"
1025
- },
1026
- {
1027
- "name": "nonce",
1028
- "docs": [
1029
- "Nonce to differentiate pools for the same mint"
1030
- ],
1031
- "type": "u8"
1032
- },
1033
- {
1034
- "name": "stake_pool",
1035
- "docs": [
1036
- "Stake Pool for which Reward Pool was added"
1037
- ],
1038
- "type": "pubkey"
1039
- },
1040
- {
1041
- "name": "mint",
1042
- "docs": [
1043
- "Mint of Reward Pool"
1044
- ],
1045
- "type": "pubkey"
1046
- },
1047
- {
1048
- "name": "creator",
1049
- "docs": [
1050
- "Creator of the Pool"
1051
- ],
1052
- "type": "pubkey"
1053
- },
1054
- {
1055
- "name": "authority",
1056
- "docs": [
1057
- "Current authority"
1058
- ],
1059
- "type": "pubkey"
1060
- },
1061
- {
1062
- "name": "reward_amount",
1063
- "docs": [
1064
- "Amount of rewards that will be distributed per effective stake",
1065
- "",
1066
- "Should be a fraction of a raw token amount which is 1 / 10^9,",
1067
- "i.e. `reward_amount` of `1_000_000_000` equals one raw token per effective stake"
1068
- ],
1069
- "type": "u64"
1070
- },
1071
- {
1072
- "name": "reward_period",
1073
- "docs": [
1074
- "Period of Rewards distribution in seconds"
1075
- ],
1076
- "type": "u64"
1077
- },
1078
- {
1079
- "name": "permissionless",
1080
- "docs": [
1081
- "Whether anyone can fund the Pool"
1082
- ],
1083
- "type": "bool"
1084
- },
1085
- {
1086
- "name": "last_reward_amount",
1087
- "docs": [
1088
- "`reward_amount` used before the last update"
1089
- ],
1090
- "type": "u64"
1091
- },
1092
- {
1093
- "name": "last_reward_period",
1094
- "docs": [
1095
- "`reward_period` used before the last update"
1096
- ],
1097
- "type": "u64"
1098
- },
1099
- {
1100
- "name": "last_amount_update_ts",
1101
- "docs": [
1102
- "Time when `reward_amount` was updated the last time"
1103
- ],
1104
- "type": "u64"
1105
- },
1106
- {
1107
- "name": "last_period_update_ts",
1108
- "docs": [
1109
- "Time when `reward_period` was updated the last time"
1110
- ],
1111
- "type": "u64"
1112
- },
1113
- {
1114
- "name": "vault",
1115
- "docs": [
1116
- "Escrow Account that stores reward tokens"
1117
- ],
1118
- "type": "pubkey"
1119
- },
1120
- {
1121
- "name": "funded_amount",
1122
- "docs": [
1123
- "Total funded amount"
1124
- ],
1125
- "type": "u64"
1126
- },
1127
- {
1128
- "name": "claimed_amount",
1129
- "docs": [
1130
- "Total number of rewards claimed"
1131
- ],
1132
- "type": "u64"
1133
- },
1134
- {
1135
- "name": "created_ts",
1136
- "docs": [
1137
- "Time when Reward Pool was created"
1138
- ],
1139
- "type": "u64"
1140
- },
1141
- {
1142
- "name": "last_claim_period",
1143
- "docs": [
1144
- "For how much seconds after unstake user should be able to claim rewards"
1145
- ],
1146
- "type": "u64"
1147
- },
1148
- {
1149
- "name": "_buffer",
1150
- "docs": [
1151
- "Buffer for additional fields"
1152
- ],
1153
- "type": {
1154
- "array": [
1155
- "u8",
1156
- 48
1157
- ]
1158
- }
1159
- }
1160
- ]
370
+ "name": "fee_value",
371
+ "docs": ["Fee Value for the funder account"],
372
+ "optional": true,
373
+ "pda": {
374
+ "seeds": [
375
+ {
376
+ "kind": "const",
377
+ "value": [102, 101, 101, 45, 118, 97, 108, 117, 101]
378
+ },
379
+ {
380
+ "kind": "account",
381
+ "path": "funder"
382
+ }
383
+ ],
384
+ "program": {
385
+ "kind": "account",
386
+ "path": "fee_program"
1161
387
  }
388
+ }
1162
389
  },
1163
390
  {
1164
- "name": "StakeEntry",
1165
- "type": {
1166
- "kind": "struct",
1167
- "fields": [
1168
- {
1169
- "name": "nonce",
1170
- "docs": [
1171
- "Nonce to differentiate stakes for the same pool"
1172
- ],
1173
- "type": "u32"
1174
- },
1175
- {
1176
- "name": "stake_pool",
1177
- "docs": [
1178
- "Stake Pool for which tokens were staked"
1179
- ],
1180
- "type": "pubkey"
1181
- },
1182
- {
1183
- "name": "payer",
1184
- "docs": [
1185
- "Original Owner of Staked tokens"
1186
- ],
1187
- "type": "pubkey"
1188
- },
1189
- {
1190
- "name": "authority",
1191
- "docs": [
1192
- "Authority of the Entry"
1193
- ],
1194
- "type": "pubkey"
1195
- },
1196
- {
1197
- "name": "amount",
1198
- "docs": [
1199
- "Amount of deposited funds"
1200
- ],
1201
- "type": "u64"
1202
- },
1203
- {
1204
- "name": "duration",
1205
- "docs": [
1206
- "Duration of the lockup"
1207
- ],
1208
- "type": "u64"
1209
- },
1210
- {
1211
- "name": "effective_amount",
1212
- "docs": [
1213
- "Effective Amount staked, does not equal to deposited amount, accounts for Stake Weight"
1214
- ],
1215
- "type": "u128"
1216
- },
1217
- {
1218
- "name": "created_ts",
1219
- "docs": [
1220
- "Timestamp when Deposit was made"
1221
- ],
1222
- "type": "u64"
1223
- },
1224
- {
1225
- "name": "closed_ts",
1226
- "docs": [
1227
- "Flag whether entry has been already unstaked"
1228
- ],
1229
- "type": "u64"
1230
- },
1231
- {
1232
- "name": "_buffer",
1233
- "docs": [
1234
- "Buffer for additional fields"
1235
- ],
1236
- "type": {
1237
- "array": [
1238
- "u8",
1239
- 64
1240
- ]
1241
- }
1242
- }
1243
- ]
1244
- }
391
+ "name": "fee_program",
392
+ "address": "FEELzfBhsWXTNJX53zZcDVfRNoFYZQ6cZA3jLiGVL16V"
393
+ },
394
+ {
395
+ "name": "token_program"
396
+ }
397
+ ],
398
+ "args": [
399
+ {
400
+ "name": "amount",
401
+ "type": "u64"
402
+ }
403
+ ]
404
+ },
405
+ {
406
+ "name": "update_pool",
407
+ "discriminator": [239, 214, 170, 78, 36, 35, 30, 34],
408
+ "accounts": [
409
+ {
410
+ "name": "authority",
411
+ "docs": ["Current Authority"],
412
+ "writable": true,
413
+ "signer": true,
414
+ "relations": ["reward_pool"]
415
+ },
416
+ {
417
+ "name": "stake_pool",
418
+ "docs": ["Stake Pool to Which Reward Pool belongs"],
419
+ "relations": ["reward_pool"]
420
+ },
421
+ {
422
+ "name": "reward_pool",
423
+ "docs": ["Reward Pool"],
424
+ "writable": true
425
+ }
426
+ ],
427
+ "args": [
428
+ {
429
+ "name": "reward_amount",
430
+ "type": {
431
+ "option": "u64"
432
+ }
1245
433
  },
1246
434
  {
1247
- "name": "StakePool",
435
+ "name": "reward_period",
436
+ "type": {
437
+ "option": "u64"
438
+ }
439
+ }
440
+ ]
441
+ }
442
+ ],
443
+ "accounts": [
444
+ {
445
+ "name": "Config",
446
+ "discriminator": [155, 12, 170, 224, 30, 250, 204, 130]
447
+ },
448
+ {
449
+ "name": "FeeValue",
450
+ "discriminator": [10, 188, 89, 64, 4, 183, 231, 0]
451
+ },
452
+ {
453
+ "name": "RewardEntry",
454
+ "discriminator": [208, 191, 173, 14, 213, 84, 179, 162]
455
+ },
456
+ {
457
+ "name": "RewardPool",
458
+ "discriminator": [134, 121, 197, 211, 133, 154, 82, 32]
459
+ },
460
+ {
461
+ "name": "StakeEntry",
462
+ "discriminator": [187, 127, 9, 35, 155, 68, 86, 40]
463
+ },
464
+ {
465
+ "name": "StakePool",
466
+ "discriminator": [121, 34, 206, 21, 79, 127, 255, 28]
467
+ }
468
+ ],
469
+ "errors": [
470
+ {
471
+ "code": 6000,
472
+ "name": "ArithmeticError",
473
+ "msg": "Arithmetic Error (overflow/underflow)"
474
+ },
475
+ {
476
+ "code": 6001,
477
+ "name": "InvalidRewardAmount",
478
+ "msg": "Reward amount should be more than 0"
479
+ },
480
+ {
481
+ "code": 6002,
482
+ "name": "InvalidRewardPeriod",
483
+ "msg": "Reward period should be more than 0"
484
+ },
485
+ {
486
+ "code": 6003,
487
+ "name": "Unauthorized",
488
+ "msg": "Account is not authorized to execute this instruction"
489
+ },
490
+ {
491
+ "code": 6004,
492
+ "name": "OwnerMismatch",
493
+ "msg": "Token account owner did not match intended owner"
494
+ },
495
+ {
496
+ "code": 6005,
497
+ "name": "InvalidRewardVault",
498
+ "msg": "Provided Reward Vault is Invalid"
499
+ },
500
+ {
501
+ "code": 6006,
502
+ "name": "InvalidRewardEntry",
503
+ "msg": "Provided Reward Entry is Invalid"
504
+ },
505
+ {
506
+ "code": 6007,
507
+ "name": "InvalidStakeEntry",
508
+ "msg": "Provided Stake Entry is Invalid"
509
+ },
510
+ {
511
+ "code": 6008,
512
+ "name": "InvalidRewardPool",
513
+ "msg": "Provided Reward Pool is Invalid"
514
+ },
515
+ {
516
+ "code": 6009,
517
+ "name": "InvalidMint",
518
+ "msg": "Invalid Mint"
519
+ },
520
+ {
521
+ "code": 6010,
522
+ "name": "StakeEntryClosed",
523
+ "msg": "Stake Entry is closed, rewards are not claimable anymore"
524
+ },
525
+ {
526
+ "code": 6011,
527
+ "name": "StakeEntryOpened",
528
+ "msg": "Stake Entry is still opened, closing is not possible"
529
+ },
530
+ {
531
+ "code": 6012,
532
+ "name": "RewardPoolDrained",
533
+ "msg": "Reward Pool does not have enough Rewards for Claiming"
534
+ },
535
+ {
536
+ "code": 6013,
537
+ "name": "UpdateTooSoon",
538
+ "msg": "Repeated update can not happen sooner than the stake pool max duration"
539
+ },
540
+ {
541
+ "code": 6014,
542
+ "name": "InvalidLastClaimPeriod",
543
+ "msg": "Invalid last claim period provided"
544
+ }
545
+ ],
546
+ "types": [
547
+ {
548
+ "name": "Config",
549
+ "type": {
550
+ "kind": "struct",
551
+ "fields": [
552
+ {
553
+ "name": "authority",
554
+ "docs": ["Fee Manager authority"],
555
+ "type": "pubkey"
556
+ },
557
+ {
558
+ "name": "streamflow_fee",
559
+ "docs": ["Default fee"],
560
+ "type": "u64"
561
+ },
562
+ {
563
+ "name": "_buffer_1",
564
+ "docs": ["Buffer for additional fields"],
1248
565
  "type": {
1249
- "kind": "struct",
1250
- "fields": [
1251
- {
1252
- "name": "bump",
1253
- "docs": [
1254
- "Bump Seed used to sign transactions"
1255
- ],
1256
- "type": "u8"
1257
- },
1258
- {
1259
- "name": "nonce",
1260
- "docs": [
1261
- "Nonce to differentiate pools for the same mint"
1262
- ],
1263
- "type": "u8"
1264
- },
1265
- {
1266
- "name": "mint",
1267
- "docs": [
1268
- "Mint of the Stake Pool"
1269
- ],
1270
- "type": "pubkey"
1271
- },
1272
- {
1273
- "name": "creator",
1274
- "docs": [
1275
- "Initial Creator"
1276
- ],
1277
- "type": "pubkey"
1278
- },
1279
- {
1280
- "name": "authority",
1281
- "docs": [
1282
- "Current authority"
1283
- ],
1284
- "type": "pubkey"
1285
- },
1286
- {
1287
- "name": "min_weight",
1288
- "docs": [
1289
- "The lowest weight awarded for staking, measured as a fraction of `1 / SCALE_FACTOR_BASE`.",
1290
- "For instance:",
1291
- "* `min_weight = 1 x SCALE_FACTOR_BASE` signifies a minimum multiplier of 1x for min staking duration",
1292
- "* `min_weight = 2 x SCALE_FACTOR_BASE` indicates a minimum multiplier of 2x for min staking duration"
1293
- ],
1294
- "type": "u64"
1295
- },
1296
- {
1297
- "name": "max_weight",
1298
- "docs": [
1299
- "The highest weight awarded for staking, measured as a fraction of `1 / SCALE_FACTOR_BASE`.",
1300
- "For instance:",
1301
- "* `max_weight = 1 x SCALE_FACTOR_BASE` signifies a max multiplier of 1x for max staking duration",
1302
- "* `max_weight = 2 x SCALE_FACTOR_BASE` indicates a max multiplier of 2x for max staking duration"
1303
- ],
1304
- "type": "u64"
1305
- },
1306
- {
1307
- "name": "min_duration",
1308
- "docs": [
1309
- "Min Duration of stake in seconds"
1310
- ],
1311
- "type": "u64"
1312
- },
1313
- {
1314
- "name": "max_duration",
1315
- "docs": [
1316
- "Max Duration of stake in seconds, the more duration, the more weight the stake has"
1317
- ],
1318
- "type": "u64"
1319
- },
1320
- {
1321
- "name": "permissionless",
1322
- "docs": [
1323
- "Whether anyone can add Reward Pools or just admin"
1324
- ],
1325
- "type": "bool"
1326
- },
1327
- {
1328
- "name": "vault",
1329
- "docs": [
1330
- "Escrow Account that stores staked tokens"
1331
- ],
1332
- "type": "pubkey"
1333
- },
1334
- {
1335
- "name": "stake_mint",
1336
- "docs": [
1337
- "Stake Mint, will be returned in exchange for stake tokens"
1338
- ],
1339
- "type": "pubkey"
1340
- },
1341
- {
1342
- "name": "total_stake",
1343
- "docs": [
1344
- "Total number of Staked tokens"
1345
- ],
1346
- "type": "u64"
1347
- },
1348
- {
1349
- "name": "total_effective_stake",
1350
- "docs": [
1351
- "Total staked tokens accounting for each stake weight, does not equal `total_stake`,",
1352
- "represents a sum of effective stake multiplied by 10^9 for precision"
1353
- ],
1354
- "type": "u128"
1355
- },
1356
- {
1357
- "name": "_buffer",
1358
- "docs": [
1359
- "Buffer for additional fields"
1360
- ],
1361
- "type": {
1362
- "array": [
1363
- "u8",
1364
- 64
1365
- ]
1366
- }
1367
- }
1368
- ]
566
+ "array": ["u8", 64]
1369
567
  }
1370
- }
1371
- ]
568
+ },
569
+ {
570
+ "name": "_buffer_2",
571
+ "docs": ["Buffer for additional fields"],
572
+ "type": {
573
+ "array": ["u8", 64]
574
+ }
575
+ },
576
+ {
577
+ "name": "_buffer_3",
578
+ "docs": ["Buffer for additional fields"],
579
+ "type": {
580
+ "array": ["u8", 64]
581
+ }
582
+ }
583
+ ]
584
+ }
585
+ },
586
+ {
587
+ "name": "FeeValue",
588
+ "type": {
589
+ "kind": "struct",
590
+ "fields": [
591
+ {
592
+ "name": "streamflow_fee",
593
+ "type": "u64"
594
+ },
595
+ {
596
+ "name": "_buffer",
597
+ "docs": ["Buffer for additional fields"],
598
+ "type": {
599
+ "array": ["u8", 64]
600
+ }
601
+ }
602
+ ]
603
+ }
604
+ },
605
+ {
606
+ "name": "RewardEntry",
607
+ "type": {
608
+ "kind": "struct",
609
+ "fields": [
610
+ {
611
+ "name": "reward_pool",
612
+ "docs": ["Reward Pool"],
613
+ "type": "pubkey"
614
+ },
615
+ {
616
+ "name": "stake_entry",
617
+ "docs": ["Stake Entry for which reward entry was initialized"],
618
+ "type": "pubkey"
619
+ },
620
+ {
621
+ "name": "created_ts",
622
+ "docs": ["Timestamp when reward entry has been created"],
623
+ "type": "u64"
624
+ },
625
+ {
626
+ "name": "accounted_amount",
627
+ "docs": ["Sum of accounted amounts, used to correctly issue rewards in case of precision loss"],
628
+ "type": "u128"
629
+ },
630
+ {
631
+ "name": "claimed_amount",
632
+ "docs": ["Sum of already claimed rewards"],
633
+ "type": "u64"
634
+ },
635
+ {
636
+ "name": "last_accounted_ts",
637
+ "docs": ["Timestamp when rewards have been claimed last time"],
638
+ "type": "u64"
639
+ },
640
+ {
641
+ "name": "last_reward_amount",
642
+ "docs": ["Reward amount used on last claim or entry creation"],
643
+ "type": "u64"
644
+ },
645
+ {
646
+ "name": "last_reward_period",
647
+ "docs": ["Reward Period used on last claim or entry creation"],
648
+ "type": "u64"
649
+ },
650
+ {
651
+ "name": "_buffer",
652
+ "docs": ["Buffer for additional fields"],
653
+ "type": {
654
+ "array": ["u8", 32]
655
+ }
656
+ }
657
+ ]
658
+ }
659
+ },
660
+ {
661
+ "name": "RewardPool",
662
+ "type": {
663
+ "kind": "struct",
664
+ "fields": [
665
+ {
666
+ "name": "bump",
667
+ "docs": ["Bump Seed used to sign transactions"],
668
+ "type": "u8"
669
+ },
670
+ {
671
+ "name": "nonce",
672
+ "docs": ["Nonce to differentiate pools for the same mint"],
673
+ "type": "u8"
674
+ },
675
+ {
676
+ "name": "stake_pool",
677
+ "docs": ["Stake Pool for which Reward Pool was added"],
678
+ "type": "pubkey"
679
+ },
680
+ {
681
+ "name": "mint",
682
+ "docs": ["Mint of Reward Pool"],
683
+ "type": "pubkey"
684
+ },
685
+ {
686
+ "name": "creator",
687
+ "docs": ["Creator of the Pool"],
688
+ "type": "pubkey"
689
+ },
690
+ {
691
+ "name": "authority",
692
+ "docs": ["Current authority"],
693
+ "type": "pubkey"
694
+ },
695
+ {
696
+ "name": "reward_amount",
697
+ "docs": [
698
+ "Amount of rewards that will be distributed per effective stake",
699
+ "",
700
+ "Should be a fraction of a raw token amount which is 1 / 10^9,",
701
+ "i.e. `reward_amount` of `1_000_000_000` equals one raw token per effective stake"
702
+ ],
703
+ "type": "u64"
704
+ },
705
+ {
706
+ "name": "reward_period",
707
+ "docs": ["Period of Rewards distribution in seconds"],
708
+ "type": "u64"
709
+ },
710
+ {
711
+ "name": "permissionless",
712
+ "docs": ["Whether anyone can fund the Pool"],
713
+ "type": "bool"
714
+ },
715
+ {
716
+ "name": "last_reward_amount",
717
+ "docs": ["`reward_amount` used before the last update"],
718
+ "type": "u64"
719
+ },
720
+ {
721
+ "name": "last_reward_period",
722
+ "docs": ["`reward_period` used before the last update"],
723
+ "type": "u64"
724
+ },
725
+ {
726
+ "name": "last_amount_update_ts",
727
+ "docs": ["Time when `reward_amount` was updated the last time"],
728
+ "type": "u64"
729
+ },
730
+ {
731
+ "name": "last_period_update_ts",
732
+ "docs": ["Time when `reward_period` was updated the last time"],
733
+ "type": "u64"
734
+ },
735
+ {
736
+ "name": "vault",
737
+ "docs": ["Escrow Account that stores reward tokens"],
738
+ "type": "pubkey"
739
+ },
740
+ {
741
+ "name": "funded_amount",
742
+ "docs": ["Total funded amount"],
743
+ "type": "u64"
744
+ },
745
+ {
746
+ "name": "claimed_amount",
747
+ "docs": ["Total number of rewards claimed"],
748
+ "type": "u64"
749
+ },
750
+ {
751
+ "name": "created_ts",
752
+ "docs": ["Time when Reward Pool was created"],
753
+ "type": "u64"
754
+ },
755
+ {
756
+ "name": "last_claim_period",
757
+ "docs": ["For how much seconds after unstake user should be able to claim rewards"],
758
+ "type": "u64"
759
+ },
760
+ {
761
+ "name": "_buffer",
762
+ "docs": ["Buffer for additional fields"],
763
+ "type": {
764
+ "array": ["u8", 48]
765
+ }
766
+ }
767
+ ]
768
+ }
769
+ },
770
+ {
771
+ "name": "StakeEntry",
772
+ "type": {
773
+ "kind": "struct",
774
+ "fields": [
775
+ {
776
+ "name": "nonce",
777
+ "docs": ["Nonce to differentiate stakes for the same pool"],
778
+ "type": "u32"
779
+ },
780
+ {
781
+ "name": "stake_pool",
782
+ "docs": ["Stake Pool for which tokens were staked"],
783
+ "type": "pubkey"
784
+ },
785
+ {
786
+ "name": "payer",
787
+ "docs": ["Original Owner of Staked tokens"],
788
+ "type": "pubkey"
789
+ },
790
+ {
791
+ "name": "authority",
792
+ "docs": ["Authority of the Entry"],
793
+ "type": "pubkey"
794
+ },
795
+ {
796
+ "name": "amount",
797
+ "docs": ["Amount of deposited funds"],
798
+ "type": "u64"
799
+ },
800
+ {
801
+ "name": "duration",
802
+ "docs": ["Duration of the lockup"],
803
+ "type": "u64"
804
+ },
805
+ {
806
+ "name": "effective_amount",
807
+ "docs": ["Effective Amount staked, does not equal to deposited amount, accounts for Stake Weight"],
808
+ "type": "u128"
809
+ },
810
+ {
811
+ "name": "created_ts",
812
+ "docs": ["Timestamp when Deposit was made"],
813
+ "type": "u64"
814
+ },
815
+ {
816
+ "name": "closed_ts",
817
+ "docs": ["Flag whether entry has been already unstaked"],
818
+ "type": "u64"
819
+ },
820
+ {
821
+ "name": "_buffer",
822
+ "docs": ["Buffer for additional fields"],
823
+ "type": {
824
+ "array": ["u8", 64]
825
+ }
826
+ }
827
+ ]
828
+ }
829
+ },
830
+ {
831
+ "name": "StakePool",
832
+ "type": {
833
+ "kind": "struct",
834
+ "fields": [
835
+ {
836
+ "name": "bump",
837
+ "docs": ["Bump Seed used to sign transactions"],
838
+ "type": "u8"
839
+ },
840
+ {
841
+ "name": "nonce",
842
+ "docs": ["Nonce to differentiate pools for the same mint"],
843
+ "type": "u8"
844
+ },
845
+ {
846
+ "name": "mint",
847
+ "docs": ["Mint of the Stake Pool"],
848
+ "type": "pubkey"
849
+ },
850
+ {
851
+ "name": "creator",
852
+ "docs": ["Initial Creator"],
853
+ "type": "pubkey"
854
+ },
855
+ {
856
+ "name": "authority",
857
+ "docs": ["Current authority"],
858
+ "type": "pubkey"
859
+ },
860
+ {
861
+ "name": "min_weight",
862
+ "docs": [
863
+ "The lowest weight awarded for staking, measured as a fraction of `1 / SCALE_FACTOR_BASE`.",
864
+ "For instance:",
865
+ "* `min_weight = 1 x SCALE_FACTOR_BASE` signifies a minimum multiplier of 1x for min staking duration",
866
+ "* `min_weight = 2 x SCALE_FACTOR_BASE` indicates a minimum multiplier of 2x for min staking duration"
867
+ ],
868
+ "type": "u64"
869
+ },
870
+ {
871
+ "name": "max_weight",
872
+ "docs": [
873
+ "The highest weight awarded for staking, measured as a fraction of `1 / SCALE_FACTOR_BASE`.",
874
+ "For instance:",
875
+ "* `max_weight = 1 x SCALE_FACTOR_BASE` signifies a max multiplier of 1x for max staking duration",
876
+ "* `max_weight = 2 x SCALE_FACTOR_BASE` indicates a max multiplier of 2x for max staking duration"
877
+ ],
878
+ "type": "u64"
879
+ },
880
+ {
881
+ "name": "min_duration",
882
+ "docs": ["Min Duration of stake in seconds"],
883
+ "type": "u64"
884
+ },
885
+ {
886
+ "name": "max_duration",
887
+ "docs": ["Max Duration of stake in seconds, the more duration, the more weight the stake has"],
888
+ "type": "u64"
889
+ },
890
+ {
891
+ "name": "permissionless",
892
+ "docs": ["Whether anyone can add Reward Pools or just admin"],
893
+ "type": "bool"
894
+ },
895
+ {
896
+ "name": "vault",
897
+ "docs": ["Escrow Account that stores staked tokens"],
898
+ "type": "pubkey"
899
+ },
900
+ {
901
+ "name": "stake_mint",
902
+ "docs": ["Stake Mint, will be returned in exchange for stake tokens"],
903
+ "type": "pubkey"
904
+ },
905
+ {
906
+ "name": "total_stake",
907
+ "docs": ["Total number of Staked tokens"],
908
+ "type": "u64"
909
+ },
910
+ {
911
+ "name": "total_effective_stake",
912
+ "docs": [
913
+ "Total staked tokens accounting for each stake weight, does not equal `total_stake`,",
914
+ "represents a sum of effective stake multiplied by 10^9 for precision"
915
+ ],
916
+ "type": "u128"
917
+ },
918
+ {
919
+ "name": "_buffer",
920
+ "docs": ["Buffer for additional fields"],
921
+ "type": {
922
+ "array": ["u8", 64]
923
+ }
924
+ }
925
+ ]
926
+ }
927
+ }
928
+ ]
1372
929
  }