@streamflow/staking 7.5.3 → 8.0.0-alpha.p284.726ba98

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 +2942 -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 +2917 -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
@@ -0,0 +1,954 @@
1
+ /**
2
+ * Program IDL in camelCase format in order to be used in JS/TS.
3
+ *
4
+ * Note that this is only a type helper and is not the actual IDL. The original
5
+ * IDL can be found at `target/idl/stake_pool.json`.
6
+ */
7
+ type StakePool = {
8
+ address: "STAKEvGqQTtzJZH6BWDcbpzXXn2BBerPAgQ3EGLN2GH";
9
+ metadata: {
10
+ name: "stakePool";
11
+ version: "2.1.1";
12
+ spec: "0.1.0";
13
+ description: "Program to manage Stake Pools and stake/unstake tokens";
14
+ };
15
+ instructions: [
16
+ {
17
+ name: "changeAuthority";
18
+ discriminator: [50, 106, 66, 104, 99, 118, 145, 88];
19
+ accounts: [
20
+ {
21
+ name: "stakePool";
22
+ docs: ["Stake Pool"];
23
+ writable: true;
24
+ },
25
+ {
26
+ name: "authority";
27
+ docs: ["Current Authority"];
28
+ writable: true;
29
+ signer: true;
30
+ },
31
+ {
32
+ name: "newAuthority";
33
+ }
34
+ ];
35
+ args: [];
36
+ },
37
+ {
38
+ name: "createLookupTable";
39
+ discriminator: [74, 26, 45, 214, 23, 155, 143, 153];
40
+ accounts: [
41
+ {
42
+ name: "stakePool";
43
+ docs: ["Stake Pool"];
44
+ },
45
+ {
46
+ name: "lookupTableLink";
47
+ docs: ["Link that will store address of the actual Lookup Table"];
48
+ writable: true;
49
+ pda: {
50
+ seeds: [
51
+ {
52
+ kind: "const";
53
+ value: [108, 111, 111, 107, 117, 112, 45, 116, 97, 98, 108, 101];
54
+ },
55
+ {
56
+ kind: "account";
57
+ path: "stakePool";
58
+ },
59
+ {
60
+ kind: "account";
61
+ path: "authority";
62
+ },
63
+ {
64
+ kind: "arg";
65
+ path: "nonce";
66
+ }
67
+ ];
68
+ };
69
+ },
70
+ {
71
+ name: "lookupTable";
72
+ writable: true;
73
+ },
74
+ {
75
+ name: "lookupTableProgram";
76
+ address: "AddressLookupTab1e1111111111111111111111111";
77
+ },
78
+ {
79
+ name: "payer";
80
+ docs: ["Payer of the transaction"];
81
+ writable: true;
82
+ signer: true;
83
+ },
84
+ {
85
+ name: "authority";
86
+ },
87
+ {
88
+ name: "systemProgram";
89
+ address: "11111111111111111111111111111111";
90
+ }
91
+ ];
92
+ args: [
93
+ {
94
+ name: "nonce";
95
+ type: "u32";
96
+ },
97
+ {
98
+ name: "recentSlot";
99
+ type: "u64";
100
+ }
101
+ ];
102
+ },
103
+ {
104
+ name: "createPool";
105
+ discriminator: [233, 146, 209, 142, 207, 104, 64, 188];
106
+ accounts: [
107
+ {
108
+ name: "stakePool";
109
+ writable: true;
110
+ pda: {
111
+ seeds: [
112
+ {
113
+ kind: "const";
114
+ value: [115, 116, 97, 107, 101, 45, 112, 111, 111, 108];
115
+ },
116
+ {
117
+ kind: "account";
118
+ path: "mint";
119
+ },
120
+ {
121
+ kind: "account";
122
+ path: "creator";
123
+ },
124
+ {
125
+ kind: "arg";
126
+ path: "nonce";
127
+ }
128
+ ];
129
+ };
130
+ },
131
+ {
132
+ name: "mint";
133
+ docs: ["Mint used for staking"];
134
+ },
135
+ {
136
+ name: "vault";
137
+ writable: true;
138
+ pda: {
139
+ seeds: [
140
+ {
141
+ kind: "const";
142
+ value: [115, 116, 97, 107, 101, 45, 118, 97, 117, 108, 116];
143
+ },
144
+ {
145
+ kind: "account";
146
+ path: "stakePool";
147
+ }
148
+ ];
149
+ };
150
+ },
151
+ {
152
+ name: "stakeMint";
153
+ writable: true;
154
+ pda: {
155
+ seeds: [
156
+ {
157
+ kind: "const";
158
+ value: [115, 116, 97, 107, 101, 45, 109, 105, 110, 116];
159
+ },
160
+ {
161
+ kind: "account";
162
+ path: "stakePool";
163
+ }
164
+ ];
165
+ };
166
+ },
167
+ {
168
+ name: "creator";
169
+ docs: ["Stake Pool creator"];
170
+ writable: true;
171
+ signer: true;
172
+ },
173
+ {
174
+ name: "tokenProgram";
175
+ },
176
+ {
177
+ name: "systemProgram";
178
+ address: "11111111111111111111111111111111";
179
+ }
180
+ ];
181
+ args: [
182
+ {
183
+ name: "nonce";
184
+ type: "u8";
185
+ },
186
+ {
187
+ name: "maxWeight";
188
+ type: "u64";
189
+ },
190
+ {
191
+ name: "minDuration";
192
+ type: "u64";
193
+ },
194
+ {
195
+ name: "maxDuration";
196
+ type: "u64";
197
+ },
198
+ {
199
+ name: "permissionless";
200
+ type: "bool";
201
+ },
202
+ {
203
+ name: "freezeStakeMint";
204
+ type: {
205
+ option: "bool";
206
+ };
207
+ },
208
+ {
209
+ name: "unstakePeriod";
210
+ type: {
211
+ option: "u64";
212
+ };
213
+ }
214
+ ];
215
+ },
216
+ {
217
+ name: "migrateEntry";
218
+ discriminator: [239, 154, 55, 173, 110, 36, 188, 214];
219
+ accounts: [
220
+ {
221
+ name: "stakePoolFrom";
222
+ docs: ["Stake Pool"];
223
+ writable: true;
224
+ address: "Cja9f8JFS6sTgBqSRZGBrA2HDbUj4MZUGdtRYruKTeJp";
225
+ },
226
+ {
227
+ name: "stakePoolTo";
228
+ docs: ["Stake Pool"];
229
+ writable: true;
230
+ address: "BXRBbWMkscNBZoBL4fgRk77GBUX9eVP4AendQEumtPi8";
231
+ },
232
+ {
233
+ name: "stakeEntryFrom";
234
+ docs: ["Entry that will store Stake Metadata"];
235
+ writable: true;
236
+ pda: {
237
+ seeds: [
238
+ {
239
+ kind: "const";
240
+ value: [115, 116, 97, 107, 101, 45, 101, 110, 116, 114, 121];
241
+ },
242
+ {
243
+ kind: "account";
244
+ path: "stakePoolFrom";
245
+ },
246
+ {
247
+ kind: "account";
248
+ path: "authority";
249
+ },
250
+ {
251
+ kind: "arg";
252
+ path: "nonce";
253
+ }
254
+ ];
255
+ };
256
+ },
257
+ {
258
+ name: "stakeEntryTo";
259
+ docs: ["Entry that will store Stake Metadata"];
260
+ writable: true;
261
+ pda: {
262
+ seeds: [
263
+ {
264
+ kind: "const";
265
+ value: [115, 116, 97, 107, 101, 45, 101, 110, 116, 114, 121];
266
+ },
267
+ {
268
+ kind: "account";
269
+ path: "stakePoolTo";
270
+ },
271
+ {
272
+ kind: "account";
273
+ path: "authority";
274
+ },
275
+ {
276
+ kind: "arg";
277
+ path: "newNonce";
278
+ }
279
+ ];
280
+ };
281
+ },
282
+ {
283
+ name: "vaultFrom";
284
+ docs: ["Stake Pool Vault that stores staked tokens"];
285
+ writable: true;
286
+ },
287
+ {
288
+ name: "vaultTo";
289
+ docs: ["Stake Pool Vault that stores staked tokens"];
290
+ writable: true;
291
+ },
292
+ {
293
+ name: "to";
294
+ docs: ["Token Account to transfer Stake Mint tokens to"];
295
+ writable: true;
296
+ },
297
+ {
298
+ name: "payer";
299
+ docs: ["Owner of the Token Account from which tokens will be staked"];
300
+ writable: true;
301
+ signer: true;
302
+ },
303
+ {
304
+ name: "authority";
305
+ },
306
+ {
307
+ name: "mint";
308
+ docs: ["Original mint of staked tokens"];
309
+ writable: true;
310
+ relations: ["stakePoolFrom", "stakePoolTo"];
311
+ },
312
+ {
313
+ name: "stakeMintFrom";
314
+ docs: ["Mint of stake tokens that will be minted in return for staking"];
315
+ writable: true;
316
+ },
317
+ {
318
+ name: "stakeMintTo";
319
+ docs: ["Mint of stake tokens that will be minted in return for staking"];
320
+ writable: true;
321
+ },
322
+ {
323
+ name: "tokenProgram";
324
+ },
325
+ {
326
+ name: "systemProgram";
327
+ address: "11111111111111111111111111111111";
328
+ }
329
+ ];
330
+ args: [
331
+ {
332
+ name: "nonce";
333
+ type: "u32";
334
+ },
335
+ {
336
+ name: "newNonce";
337
+ type: "u32";
338
+ }
339
+ ];
340
+ },
341
+ {
342
+ name: "requestUnstake";
343
+ discriminator: [44, 154, 110, 253, 160, 202, 54, 34];
344
+ accounts: [
345
+ {
346
+ name: "stakePool";
347
+ writable: true;
348
+ relations: ["stakeEntry"];
349
+ },
350
+ {
351
+ name: "stakeEntry";
352
+ docs: ["Entry that stores Stake Metadata"];
353
+ writable: true;
354
+ },
355
+ {
356
+ name: "authority";
357
+ docs: ["Stake Entry Authority"];
358
+ writable: true;
359
+ signer: true;
360
+ }
361
+ ];
362
+ args: [];
363
+ },
364
+ {
365
+ name: "setTokenMetadataSpl";
366
+ discriminator: [244, 162, 227, 218, 129, 5, 25, 253];
367
+ accounts: [
368
+ {
369
+ name: "authority";
370
+ docs: ["Stake Pool Authority"];
371
+ signer: true;
372
+ relations: ["stakePool"];
373
+ },
374
+ {
375
+ name: "stakePool";
376
+ },
377
+ {
378
+ name: "stakeMint";
379
+ relations: ["stakePool"];
380
+ },
381
+ {
382
+ name: "metadataAccount";
383
+ writable: true;
384
+ pda: {
385
+ seeds: [
386
+ {
387
+ kind: "const";
388
+ value: [109, 101, 116, 97, 100, 97, 116, 97];
389
+ },
390
+ {
391
+ kind: "account";
392
+ path: "metadataProgram";
393
+ },
394
+ {
395
+ kind: "account";
396
+ path: "stakeMint";
397
+ }
398
+ ];
399
+ program: {
400
+ kind: "account";
401
+ path: "metadataProgram";
402
+ };
403
+ };
404
+ },
405
+ {
406
+ name: "metadataProgram";
407
+ docs: ["MPL Program"];
408
+ address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s";
409
+ },
410
+ {
411
+ name: "tokenProgram";
412
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
413
+ },
414
+ {
415
+ name: "rent";
416
+ address: "SysvarRent111111111111111111111111111111111";
417
+ },
418
+ {
419
+ name: "systemProgram";
420
+ address: "11111111111111111111111111111111";
421
+ }
422
+ ];
423
+ args: [
424
+ {
425
+ name: "name";
426
+ type: "string";
427
+ },
428
+ {
429
+ name: "symbol";
430
+ type: "string";
431
+ },
432
+ {
433
+ name: "uri";
434
+ type: "string";
435
+ }
436
+ ];
437
+ },
438
+ {
439
+ name: "setTokenMetadataT22";
440
+ discriminator: [239, 134, 91, 83, 196, 57, 120, 106];
441
+ accounts: [
442
+ {
443
+ name: "authority";
444
+ docs: ["Stake Pool Authority"];
445
+ signer: true;
446
+ relations: ["stakePool"];
447
+ },
448
+ {
449
+ name: "stakePool";
450
+ },
451
+ {
452
+ name: "stakeMint";
453
+ writable: true;
454
+ relations: ["stakePool"];
455
+ },
456
+ {
457
+ name: "tokenProgram";
458
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
459
+ },
460
+ {
461
+ name: "systemProgram";
462
+ address: "11111111111111111111111111111111";
463
+ }
464
+ ];
465
+ args: [
466
+ {
467
+ name: "name";
468
+ type: "string";
469
+ },
470
+ {
471
+ name: "symbol";
472
+ type: "string";
473
+ },
474
+ {
475
+ name: "uri";
476
+ type: "string";
477
+ }
478
+ ];
479
+ },
480
+ {
481
+ name: "stake";
482
+ discriminator: [206, 176, 202, 18, 200, 209, 179, 108];
483
+ accounts: [
484
+ {
485
+ name: "stakePool";
486
+ docs: ["Stake Pool"];
487
+ writable: true;
488
+ },
489
+ {
490
+ name: "stakeEntry";
491
+ docs: ["Entry that will store Stake Metadata"];
492
+ writable: true;
493
+ pda: {
494
+ seeds: [
495
+ {
496
+ kind: "const";
497
+ value: [115, 116, 97, 107, 101, 45, 101, 110, 116, 114, 121];
498
+ },
499
+ {
500
+ kind: "account";
501
+ path: "stakePool";
502
+ },
503
+ {
504
+ kind: "account";
505
+ path: "authority";
506
+ },
507
+ {
508
+ kind: "arg";
509
+ path: "nonce";
510
+ }
511
+ ];
512
+ };
513
+ },
514
+ {
515
+ name: "from";
516
+ docs: ["Token Account from which stake tokens will be transferred"];
517
+ writable: true;
518
+ },
519
+ {
520
+ name: "vault";
521
+ docs: ["Stake Pool Vault that stores staked tokens"];
522
+ writable: true;
523
+ relations: ["stakePool"];
524
+ },
525
+ {
526
+ name: "to";
527
+ docs: ["Token Account to transfer Stake Mint tokens to"];
528
+ writable: true;
529
+ },
530
+ {
531
+ name: "payer";
532
+ docs: ["Owner of the Token Account from which tokens will be staked"];
533
+ writable: true;
534
+ signer: true;
535
+ },
536
+ {
537
+ name: "authority";
538
+ },
539
+ {
540
+ name: "mint";
541
+ docs: ["Original mint of staked tokens"];
542
+ writable: true;
543
+ relations: ["stakePool"];
544
+ },
545
+ {
546
+ name: "stakeMint";
547
+ docs: ["Mint of stake tokens that will be minted in return for staking"];
548
+ writable: true;
549
+ relations: ["stakePool"];
550
+ },
551
+ {
552
+ name: "tokenProgram";
553
+ },
554
+ {
555
+ name: "systemProgram";
556
+ address: "11111111111111111111111111111111";
557
+ }
558
+ ];
559
+ args: [
560
+ {
561
+ name: "nonce";
562
+ type: "u32";
563
+ },
564
+ {
565
+ name: "amount";
566
+ type: "u64";
567
+ },
568
+ {
569
+ name: "duration";
570
+ type: "u64";
571
+ }
572
+ ];
573
+ },
574
+ {
575
+ name: "unstake";
576
+ discriminator: [90, 95, 107, 42, 205, 124, 50, 225];
577
+ accounts: [
578
+ {
579
+ name: "stakePool";
580
+ writable: true;
581
+ relations: ["stakeEntry"];
582
+ },
583
+ {
584
+ name: "stakeEntry";
585
+ docs: ["Entry that stores Stake Metadata"];
586
+ writable: true;
587
+ },
588
+ {
589
+ name: "from";
590
+ docs: ["Stake Mint Token account"];
591
+ writable: true;
592
+ },
593
+ {
594
+ name: "vault";
595
+ docs: ["Escrow Account that stores Staked tokens"];
596
+ writable: true;
597
+ relations: ["stakePool"];
598
+ },
599
+ {
600
+ name: "to";
601
+ docs: ["Token account to withdraw Staked tokens to"];
602
+ writable: true;
603
+ },
604
+ {
605
+ name: "authority";
606
+ docs: ["Stake Entry Authority"];
607
+ writable: true;
608
+ signer: true;
609
+ },
610
+ {
611
+ name: "mint";
612
+ docs: ["Original mint of staked tokens"];
613
+ writable: true;
614
+ relations: ["stakePool"];
615
+ },
616
+ {
617
+ name: "stakeMint";
618
+ docs: ["Stake Mint used to exchanged Staked tokens to"];
619
+ writable: true;
620
+ relations: ["stakePool"];
621
+ },
622
+ {
623
+ name: "tokenProgram";
624
+ }
625
+ ];
626
+ args: [];
627
+ }
628
+ ];
629
+ accounts: [
630
+ {
631
+ name: "lookupTableLink";
632
+ discriminator: [133, 88, 187, 141, 1, 53, 72, 236];
633
+ },
634
+ {
635
+ name: "stakeEntry";
636
+ discriminator: [187, 127, 9, 35, 155, 68, 86, 40];
637
+ },
638
+ {
639
+ name: "stakePool";
640
+ discriminator: [121, 34, 206, 21, 79, 127, 255, 28];
641
+ }
642
+ ];
643
+ errors: [
644
+ {
645
+ code: 6000;
646
+ name: "invalidDuration";
647
+ msg: "Minimum duration must be less than the maximum";
648
+ },
649
+ {
650
+ code: 6001;
651
+ name: "invalidWeight";
652
+ msg: "Weight should be more than minimum";
653
+ },
654
+ {
655
+ code: 6002;
656
+ name: "durationTooShort";
657
+ msg: "Duration of staking can't be less than minimum duration of the pool";
658
+ },
659
+ {
660
+ code: 6003;
661
+ name: "invalidStakeAmount";
662
+ msg: "Stake amount should be more than 0";
663
+ },
664
+ {
665
+ code: 6004;
666
+ name: "arithmeticError";
667
+ msg: "Arithmetic Error (overflow/underflow)";
668
+ },
669
+ {
670
+ code: 6005;
671
+ name: "unauthorized";
672
+ msg: "Account is not authorized to execute this instruction";
673
+ },
674
+ {
675
+ code: 6006;
676
+ name: "ownerMismatch";
677
+ msg: "Token account owner did not match intended owner";
678
+ },
679
+ {
680
+ code: 6007;
681
+ name: "invalidMint";
682
+ msg: "Provided Mint does not equal the Pool Mint";
683
+ },
684
+ {
685
+ code: 6008;
686
+ name: "invalidStakeVault";
687
+ msg: "Provided Stake Vault does not equal the Pool Vault";
688
+ },
689
+ {
690
+ code: 6009;
691
+ name: "invalidStakeMint";
692
+ msg: "Provided Stake Mint does not equal the Pool Stake Mint";
693
+ },
694
+ {
695
+ code: 6010;
696
+ name: "invalidStakePool";
697
+ msg: "Provided Stake Pool does not equal the Entry Stake Pool";
698
+ },
699
+ {
700
+ code: 6011;
701
+ name: "invalidPoolMint";
702
+ msg: "Provided Mint does not equal the Pool Mint";
703
+ },
704
+ {
705
+ code: 6012;
706
+ name: "closedStake";
707
+ msg: "Stake Entry is already closed and can't be used";
708
+ },
709
+ {
710
+ code: 6013;
711
+ name: "lockedStake";
712
+ msg: "Stake is locked, unstake is not possible";
713
+ },
714
+ {
715
+ code: 6014;
716
+ name: "unsupportedTokenExtensions";
717
+ msg: "Mint has unsupported Token Extensions";
718
+ },
719
+ {
720
+ code: 6015;
721
+ name: "unstakeRequestNotRequired";
722
+ msg: "Unstake request is not required";
723
+ },
724
+ {
725
+ code: 6016;
726
+ name: "unstakeRequestRequired";
727
+ msg: "Stake pool has unstake period, request is required prior to unstake";
728
+ },
729
+ {
730
+ code: 6017;
731
+ name: "unstakeTooEarly";
732
+ msg: "Unstake is not possible until unstake period has passed";
733
+ }
734
+ ];
735
+ types: [
736
+ {
737
+ name: "lookupTableLink";
738
+ type: {
739
+ kind: "struct";
740
+ fields: [
741
+ {
742
+ name: "nonce";
743
+ docs: ["Nonce to differentiate lookup tables for the same stake pool"];
744
+ type: "u32";
745
+ },
746
+ {
747
+ name: "stakePool";
748
+ docs: ["Stake Pool for which tokens were staked"];
749
+ type: "pubkey";
750
+ },
751
+ {
752
+ name: "authority";
753
+ docs: ["Authority of the Entry"];
754
+ type: "pubkey";
755
+ },
756
+ {
757
+ name: "lookupTable";
758
+ docs: ["Pubkey of the address lookup table"];
759
+ type: "pubkey";
760
+ },
761
+ {
762
+ name: "buffer";
763
+ docs: ["Buffer for additional fields"];
764
+ type: {
765
+ array: ["u8", 64];
766
+ };
767
+ }
768
+ ];
769
+ };
770
+ },
771
+ {
772
+ name: "stakeEntry";
773
+ type: {
774
+ kind: "struct";
775
+ fields: [
776
+ {
777
+ name: "nonce";
778
+ docs: ["Nonce to differentiate stakes for the same pool"];
779
+ type: "u32";
780
+ },
781
+ {
782
+ name: "stakePool";
783
+ docs: ["Stake Pool for which tokens were staked"];
784
+ type: "pubkey";
785
+ },
786
+ {
787
+ name: "payer";
788
+ docs: ["Original Owner of Staked tokens"];
789
+ type: "pubkey";
790
+ },
791
+ {
792
+ name: "authority";
793
+ docs: ["Authority of the Entry"];
794
+ type: "pubkey";
795
+ },
796
+ {
797
+ name: "amount";
798
+ docs: ["Amount of deposited funds"];
799
+ type: "u64";
800
+ },
801
+ {
802
+ name: "duration";
803
+ docs: ["Duration of the lockup"];
804
+ type: "u64";
805
+ },
806
+ {
807
+ name: "effectiveAmount";
808
+ docs: ["Effective Amount staked, does not equal to deposited amount, accounts for Stake Weight"];
809
+ type: "u128";
810
+ },
811
+ {
812
+ name: "createdTs";
813
+ docs: ["Timestamp when Deposit was made"];
814
+ type: "u64";
815
+ },
816
+ {
817
+ name: "closedTs";
818
+ docs: ["Timestamp when entry has been closed"];
819
+ type: "u64";
820
+ },
821
+ {
822
+ name: "priorTotalEffectiveStake";
823
+ docs: ["Total effective stake at the time of staking"];
824
+ type: "u128";
825
+ },
826
+ {
827
+ name: "unstakeTs";
828
+ docs: ["Timestamp when unstake was requested, will be used in case `unstake_period` is set"];
829
+ type: "u64";
830
+ },
831
+ {
832
+ name: "buffer";
833
+ docs: ["Buffer for additional fields"];
834
+ type: {
835
+ array: ["u8", 40];
836
+ };
837
+ }
838
+ ];
839
+ };
840
+ },
841
+ {
842
+ name: "stakePool";
843
+ type: {
844
+ kind: "struct";
845
+ fields: [
846
+ {
847
+ name: "bump";
848
+ docs: ["Bump Seed used to sign transactions"];
849
+ type: "u8";
850
+ },
851
+ {
852
+ name: "nonce";
853
+ docs: ["Nonce to differentiate pools for the same mint"];
854
+ type: "u8";
855
+ },
856
+ {
857
+ name: "mint";
858
+ docs: ["Mint of the Stake Pool"];
859
+ type: "pubkey";
860
+ },
861
+ {
862
+ name: "creator";
863
+ docs: ["Initial Creator"];
864
+ type: "pubkey";
865
+ },
866
+ {
867
+ name: "authority";
868
+ docs: ["Current authority"];
869
+ type: "pubkey";
870
+ },
871
+ {
872
+ name: "minWeight";
873
+ docs: [
874
+ "The lowest weight awarded for staking, measured as a fraction of `1 / SCALE_FACTOR_BASE`.",
875
+ "For instance:",
876
+ "* `min_weight = 1 x SCALE_FACTOR_BASE` signifies a minimum multiplier of 1x for min staking duration",
877
+ "* `min_weight = 2 x SCALE_FACTOR_BASE` indicates a minimum multiplier of 2x for min staking duration"
878
+ ];
879
+ type: "u64";
880
+ },
881
+ {
882
+ name: "maxWeight";
883
+ docs: [
884
+ "The highest weight awarded for staking, measured as a fraction of `1 / SCALE_FACTOR_BASE`.",
885
+ "For instance:",
886
+ "* `max_weight = 1 x SCALE_FACTOR_BASE` signifies a max multiplier of 1x for max staking duration",
887
+ "* `max_weight = 2 x SCALE_FACTOR_BASE` indicates a max multiplier of 2x for max staking duration"
888
+ ];
889
+ type: "u64";
890
+ },
891
+ {
892
+ name: "minDuration";
893
+ docs: ["Min Duration of stake in seconds"];
894
+ type: "u64";
895
+ },
896
+ {
897
+ name: "maxDuration";
898
+ docs: ["Max Duration of stake in seconds, the more duration, the more weight the stake has"];
899
+ type: "u64";
900
+ },
901
+ {
902
+ name: "permissionless";
903
+ docs: ["Whether anyone can add Reward Pools or just admin"];
904
+ type: "bool";
905
+ },
906
+ {
907
+ name: "vault";
908
+ docs: ["Escrow Account that stores staked tokens"];
909
+ type: "pubkey";
910
+ },
911
+ {
912
+ name: "stakeMint";
913
+ docs: ["Stake Mint, will be returned in exchange for stake tokens"];
914
+ type: "pubkey";
915
+ },
916
+ {
917
+ name: "totalStake";
918
+ docs: ["Total number of Staked tokens"];
919
+ type: "u64";
920
+ },
921
+ {
922
+ name: "totalEffectiveStake";
923
+ docs: [
924
+ "Total staked tokens accounting for each stake weight, does not equal `total_stake`,",
925
+ "represents a sum of effective stake multiplied by 10^9 for precision"
926
+ ];
927
+ type: "u128";
928
+ },
929
+ {
930
+ name: "freezeStakeMint";
931
+ docs: ["Whether we should freeze stake mint token accounts"];
932
+ type: "bool";
933
+ },
934
+ {
935
+ name: "unstakePeriod";
936
+ docs: [
937
+ "Period for unstaking, if set unstake at first should be requested, and the real unstake can only happen after this period"
938
+ ];
939
+ type: "u64";
940
+ },
941
+ {
942
+ name: "buffer";
943
+ docs: ["Buffer for additional fields"];
944
+ type: {
945
+ array: ["u8", 55];
946
+ };
947
+ }
948
+ ];
949
+ };
950
+ }
951
+ ];
952
+ };
953
+
954
+ export type { StakePool };