@wireio/stake 2.3.1 → 2.4.1

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.
package/lib/stake.m.js CHANGED
@@ -67,6 +67,51 @@ var instructions$7 = [
67
67
  args: [
68
68
  ]
69
69
  },
70
+ {
71
+ name: "admin_force_unbond_role",
72
+ discriminator: [
73
+ 80,
74
+ 107,
75
+ 27,
76
+ 49,
77
+ 126,
78
+ 25,
79
+ 31,
80
+ 238
81
+ ],
82
+ accounts: [
83
+ {
84
+ name: "admin",
85
+ signer: true
86
+ },
87
+ {
88
+ name: "global_config"
89
+ },
90
+ {
91
+ name: "global_state"
92
+ },
93
+ {
94
+ name: "user",
95
+ docs: [
96
+ "The user whose role bond is being force-unbonded"
97
+ ]
98
+ },
99
+ {
100
+ name: "outpost_account",
101
+ writable: true
102
+ }
103
+ ],
104
+ args: [
105
+ {
106
+ name: "role",
107
+ type: {
108
+ defined: {
109
+ name: "Role"
110
+ }
111
+ }
112
+ }
113
+ ]
114
+ },
70
115
  {
71
116
  name: "aggregate_stake_metrics",
72
117
  docs: [
@@ -841,6 +886,72 @@ var instructions$7 = [
841
886
  }
842
887
  ]
843
888
  },
889
+ {
890
+ name: "deposit_to_reserve",
891
+ discriminator: [
892
+ 8,
893
+ 79,
894
+ 123,
895
+ 129,
896
+ 146,
897
+ 140,
898
+ 178,
899
+ 128
900
+ ],
901
+ accounts: [
902
+ {
903
+ name: "admin",
904
+ signer: true
905
+ },
906
+ {
907
+ name: "global_config"
908
+ },
909
+ {
910
+ name: "depositor",
911
+ writable: true,
912
+ signer: true
913
+ },
914
+ {
915
+ name: "reserve_pool",
916
+ writable: true
917
+ },
918
+ {
919
+ name: "vault"
920
+ },
921
+ {
922
+ name: "ephemeral_stake",
923
+ writable: true
924
+ },
925
+ {
926
+ name: "controller_state"
927
+ },
928
+ {
929
+ name: "stake_program"
930
+ },
931
+ {
932
+ name: "system_program"
933
+ },
934
+ {
935
+ name: "clock"
936
+ },
937
+ {
938
+ name: "stake_history"
939
+ },
940
+ {
941
+ name: "rent"
942
+ }
943
+ ],
944
+ args: [
945
+ {
946
+ name: "amount",
947
+ type: "u64"
948
+ },
949
+ {
950
+ name: "seed",
951
+ type: "u32"
952
+ }
953
+ ]
954
+ },
844
955
  {
845
956
  name: "desynd",
846
957
  discriminator: [
@@ -917,6 +1028,10 @@ var instructions$7 = [
917
1028
  ],
918
1029
  writable: true
919
1030
  },
1031
+ {
1032
+ name: "pretoken_purchase_history",
1033
+ writable: true
1034
+ },
920
1035
  {
921
1036
  name: "token_program"
922
1037
  },
@@ -959,6 +1074,44 @@ var instructions$7 = [
959
1074
  ],
960
1075
  returns: "u16"
961
1076
  },
1077
+ {
1078
+ name: "has_role",
1079
+ discriminator: [
1080
+ 218,
1081
+ 136,
1082
+ 44,
1083
+ 87,
1084
+ 142,
1085
+ 247,
1086
+ 141,
1087
+ 195
1088
+ ],
1089
+ accounts: [
1090
+ {
1091
+ name: "user",
1092
+ docs: [
1093
+ "User whose role status is being checked."
1094
+ ]
1095
+ },
1096
+ {
1097
+ name: "outpost_account"
1098
+ },
1099
+ {
1100
+ name: "global_state"
1101
+ }
1102
+ ],
1103
+ args: [
1104
+ {
1105
+ name: "role",
1106
+ type: {
1107
+ defined: {
1108
+ name: "Role"
1109
+ }
1110
+ }
1111
+ }
1112
+ ],
1113
+ returns: "bool"
1114
+ },
962
1115
  {
963
1116
  name: "init_bucket",
964
1117
  docs: [
@@ -1310,6 +1463,52 @@ var instructions$7 = [
1310
1463
  args: [
1311
1464
  ]
1312
1465
  },
1466
+ {
1467
+ name: "initialize_pretoken_purchase_history",
1468
+ docs: [
1469
+ "Admin-only: initialize PretokenPurchaseHistory PDA for a pool"
1470
+ ],
1471
+ discriminator: [
1472
+ 140,
1473
+ 166,
1474
+ 196,
1475
+ 128,
1476
+ 189,
1477
+ 240,
1478
+ 159,
1479
+ 1
1480
+ ],
1481
+ accounts: [
1482
+ {
1483
+ name: "admin",
1484
+ writable: true,
1485
+ signer: true
1486
+ },
1487
+ {
1488
+ name: "global_config"
1489
+ },
1490
+ {
1491
+ name: "pretoken_purchase_history",
1492
+ writable: true
1493
+ },
1494
+ {
1495
+ name: "pool_authority"
1496
+ },
1497
+ {
1498
+ name: "global_state",
1499
+ writable: true
1500
+ },
1501
+ {
1502
+ name: "pool_pretoken_record",
1503
+ writable: true
1504
+ },
1505
+ {
1506
+ name: "system_program"
1507
+ }
1508
+ ],
1509
+ args: [
1510
+ ]
1511
+ },
1313
1512
  {
1314
1513
  name: "initialize_processing_state",
1315
1514
  docs: [
@@ -2191,6 +2390,10 @@ var instructions$7 = [
2191
2390
  },
2192
2391
  {
2193
2392
  name: "system_program"
2393
+ },
2394
+ {
2395
+ name: "pretoken_purchase_history",
2396
+ writable: true
2194
2397
  }
2195
2398
  ],
2196
2399
  args: [
@@ -2285,6 +2488,10 @@ var instructions$7 = [
2285
2488
  },
2286
2489
  {
2287
2490
  name: "chainlink_program"
2491
+ },
2492
+ {
2493
+ name: "pretoken_purchase_history",
2494
+ writable: true
2288
2495
  }
2289
2496
  ],
2290
2497
  args: [
@@ -2380,7 +2587,7 @@ var instructions$7 = [
2380
2587
  name: "refresh_stake_metrics_post_sync",
2381
2588
  docs: [
2382
2589
  "V2: Refresh stake metrics after removal selection + PDA setup",
2383
- "Requires ActiveInfosSynced + ValidatorPdaSetup as prerequisites",
2590
+ "Requires ValidatorAdditionSelection + ValidatorPdaSetup as prerequisites",
2384
2591
  "Tracks completion in last_post_sync_stake_metrics_refresh_epoch"
2385
2592
  ],
2386
2593
  discriminator: [
@@ -2424,50 +2631,182 @@ var instructions$7 = [
2424
2631
  ]
2425
2632
  },
2426
2633
  {
2427
- name: "register_user",
2634
+ name: "refund",
2428
2635
  discriminator: [
2429
2636
  2,
2430
- 241,
2431
- 150,
2432
- 223,
2433
- 99,
2434
- 214,
2435
- 116,
2436
- 97
2637
+ 96,
2638
+ 183,
2639
+ 251,
2640
+ 63,
2641
+ 208,
2642
+ 46,
2643
+ 46
2437
2644
  ],
2438
2645
  accounts: [
2646
+ {
2647
+ name: "associated_token_program"
2648
+ },
2439
2649
  {
2440
2650
  name: "user",
2651
+ writable: true,
2652
+ signer: true
2653
+ },
2654
+ {
2655
+ name: "global_state",
2441
2656
  writable: true
2442
2657
  },
2443
2658
  {
2444
- name: "user_ata",
2659
+ name: "outpost_account",
2445
2660
  writable: true
2446
2661
  },
2447
2662
  {
2448
- name: "user_record",
2663
+ name: "distribution_state",
2449
2664
  writable: true
2450
2665
  },
2451
2666
  {
2452
- name: "payer",
2453
- docs: [
2454
- "Payer for the user record PDA creation (always the user)"
2455
- ],
2456
- writable: true,
2457
- signer: true
2667
+ name: "pool_authority"
2458
2668
  },
2459
2669
  {
2460
- name: "distribution_state",
2670
+ name: "liqsol_pool_ata",
2671
+ writable: true
2672
+ },
2673
+ {
2674
+ name: "refund_liqsol_ata",
2675
+ writable: true
2676
+ },
2677
+ {
2678
+ name: "liqsol_pool_user_record",
2679
+ writable: true
2680
+ },
2681
+ {
2682
+ name: "user_record",
2461
2683
  writable: true
2462
2684
  },
2685
+ {
2686
+ name: "extra_account_meta_list"
2687
+ },
2688
+ {
2689
+ name: "liqsol_core_program"
2690
+ },
2691
+ {
2692
+ name: "transfer_hook_program"
2693
+ },
2694
+ {
2695
+ name: "liqsol_mint"
2696
+ },
2697
+ {
2698
+ name: "token_program"
2699
+ },
2463
2700
  {
2464
2701
  name: "bucket_authority"
2465
2702
  },
2466
2703
  {
2467
2704
  name: "bucket_token_account",
2468
- docs: [
2469
- "The bucket's associated token account holding liqSOL (for index sync)"
2470
- ],
2705
+ writable: true
2706
+ },
2707
+ {
2708
+ name: "bucket_user_record",
2709
+ writable: true
2710
+ },
2711
+ {
2712
+ name: "system_program"
2713
+ }
2714
+ ],
2715
+ args: [
2716
+ ]
2717
+ },
2718
+ {
2719
+ name: "register_system_pda",
2720
+ discriminator: [
2721
+ 110,
2722
+ 93,
2723
+ 36,
2724
+ 156,
2725
+ 179,
2726
+ 69,
2727
+ 54,
2728
+ 210
2729
+ ],
2730
+ accounts: [
2731
+ {
2732
+ name: "admin",
2733
+ writable: true,
2734
+ signer: true
2735
+ },
2736
+ {
2737
+ name: "global_config"
2738
+ },
2739
+ {
2740
+ name: "pda_owner",
2741
+ docs: [
2742
+ "The PDA whose user record we're creating — must be system-owned (no program data)."
2743
+ ]
2744
+ },
2745
+ {
2746
+ name: "pda_ata"
2747
+ },
2748
+ {
2749
+ name: "user_record",
2750
+ writable: true
2751
+ },
2752
+ {
2753
+ name: "distribution_state",
2754
+ writable: true
2755
+ },
2756
+ {
2757
+ name: "bucket_authority"
2758
+ },
2759
+ {
2760
+ name: "bucket_token_account",
2761
+ docs: [
2762
+ "The bucket's associated token account holding liqSOL (for index sync)"
2763
+ ],
2764
+ writable: true
2765
+ },
2766
+ {
2767
+ name: "system_program"
2768
+ }
2769
+ ],
2770
+ args: [
2771
+ ]
2772
+ },
2773
+ {
2774
+ name: "register_user",
2775
+ discriminator: [
2776
+ 2,
2777
+ 241,
2778
+ 150,
2779
+ 223,
2780
+ 99,
2781
+ 214,
2782
+ 116,
2783
+ 97
2784
+ ],
2785
+ accounts: [
2786
+ {
2787
+ name: "payer",
2788
+ writable: true,
2789
+ signer: true
2790
+ },
2791
+ {
2792
+ name: "user_ata"
2793
+ },
2794
+ {
2795
+ name: "user_record",
2796
+ writable: true
2797
+ },
2798
+ {
2799
+ name: "distribution_state",
2800
+ writable: true
2801
+ },
2802
+ {
2803
+ name: "bucket_authority"
2804
+ },
2805
+ {
2806
+ name: "bucket_token_account",
2807
+ docs: [
2808
+ "The bucket's associated token account holding liqSOL (for index sync)"
2809
+ ],
2471
2810
  writable: true
2472
2811
  },
2473
2812
  {
@@ -2621,7 +2960,8 @@ var instructions$7 = [
2621
2960
  name: "bucket_token_account",
2622
2961
  docs: [
2623
2962
  "The bucket's token account holding liqSOL (for sync_index balance)"
2624
- ]
2963
+ ],
2964
+ writable: true
2625
2965
  },
2626
2966
  {
2627
2967
  name: "reserve_pool",
@@ -2970,7 +3310,8 @@ var instructions$7 = [
2970
3310
  name: "global_config"
2971
3311
  },
2972
3312
  {
2973
- name: "global_state"
3313
+ name: "global_state",
3314
+ writable: true
2974
3315
  },
2975
3316
  {
2976
3317
  name: "user",
@@ -3063,7 +3404,7 @@ var instructions$7 = [
3063
3404
  name: "sync_main_stake_accounts",
3064
3405
  docs: [
3065
3406
  "V2: Sync main stake accounts using PDA architecture (batched)",
3066
- "Processes up to 10 validators per transaction via remaining_accounts",
3407
+ "Processes validators in batches via remaining_accounts (batch size is enforced client-side)",
3067
3408
  "Note: Only syncs primary delegated stakes, not transient stakes"
3068
3409
  ],
3069
3410
  discriminator: [
@@ -3231,6 +3572,10 @@ var instructions$7 = [
3231
3572
  ],
3232
3573
  writable: true
3233
3574
  },
3575
+ {
3576
+ name: "pretoken_purchase_history",
3577
+ writable: true
3578
+ },
3234
3579
  {
3235
3580
  name: "token_program"
3236
3581
  },
@@ -3633,6 +3978,19 @@ var accounts$5 = [
3633
3978
  150
3634
3979
  ]
3635
3980
  },
3981
+ {
3982
+ name: "PretokenPurchaseHistory",
3983
+ discriminator: [
3984
+ 33,
3985
+ 71,
3986
+ 113,
3987
+ 206,
3988
+ 33,
3989
+ 180,
3990
+ 236,
3991
+ 131
3992
+ ]
3993
+ },
3636
3994
  {
3637
3995
  name: "PriceHistory",
3638
3996
  discriminator: [
@@ -4145,12 +4503,24 @@ var types$9 = [
4145
4503
  ],
4146
4504
  type: "u16"
4147
4505
  },
4506
+ {
4507
+ name: "aggregate_mode_tag",
4508
+ docs: [
4509
+ "Tracks which aggregation mode currently owns the shared temp fields.",
4510
+ "0 = idle,",
4511
+ "1 = Normal,",
4512
+ "2 = PostSync,",
4513
+ "3 = PostLateEpoch.",
4514
+ "Prevents cross-mode state contamination when modes share the same vars."
4515
+ ],
4516
+ type: "u8"
4517
+ },
4148
4518
  {
4149
4519
  name: "_reserved",
4150
4520
  type: {
4151
4521
  array: [
4152
4522
  "u8",
4153
- 32
4523
+ 31
4154
4524
  ]
4155
4525
  }
4156
4526
  }
@@ -4383,7 +4753,9 @@ var types$9 = [
4383
4753
  {
4384
4754
  name: "authority",
4385
4755
  docs: [
4386
- "Authority that can update serviceable_epoch"
4756
+ "DEPRECATED: Originally intended as authority for serviceable_epoch updates,",
4757
+ "but serviceable_epoch is updated by merge_deactivated_stakes gated via GlobalConfig.cranky.",
4758
+ "Retained to preserve account layout."
4387
4759
  ],
4388
4760
  type: "pubkey"
4389
4761
  },
@@ -4699,9 +5071,10 @@ var types$9 = [
4699
5071
  type: "u64"
4700
5072
  },
4701
5073
  {
4702
- name: "last_pool_liqsol_balance",
5074
+ name: "expected_pool_balance",
4703
5075
  docs: [
4704
- "Last observed liqSOL pool balance (for yield calculation)"
5076
+ "Expected liqSOL pool balance (tracked by protocol operations, not read from on-chain balance).",
5077
+ "Any discrepancy vs actual on-chain balance is treated as unsolicited donations, not yield."
4705
5078
  ],
4706
5079
  type: "u64"
4707
5080
  },
@@ -4914,6 +5287,9 @@ var types$9 = [
4914
5287
  },
4915
5288
  {
4916
5289
  name: "last_active_infos_synced_epoch",
5290
+ docs: [
5291
+ "DEPRECATED: ActiveInfosSynced removed in WIN-134. Retained to preserve account layout."
5292
+ ],
4917
5293
  type: "u16"
4918
5294
  },
4919
5295
  {
@@ -4928,6 +5304,9 @@ var types$9 = [
4928
5304
  },
4929
5305
  {
4930
5306
  name: "last_distribution_slot",
5307
+ docs: [
5308
+ "DEPRECATED: Distribution slot tracking removed in PR113. Retained to preserve account layout."
5309
+ ],
4931
5310
  type: {
4932
5311
  option: "u64"
4933
5312
  }
@@ -5092,6 +5471,24 @@ var types$9 = [
5092
5471
  {
5093
5472
  name: "bump",
5094
5473
  type: "u8"
5474
+ },
5475
+ {
5476
+ name: "accumulated_pretoken_yield",
5477
+ type: {
5478
+ option: "u64"
5479
+ }
5480
+ },
5481
+ {
5482
+ name: "last_epoch_synd_liqsol",
5483
+ type: {
5484
+ option: "u64"
5485
+ }
5486
+ },
5487
+ {
5488
+ name: "last_synd_epoch",
5489
+ type: {
5490
+ option: "u64"
5491
+ }
5095
5492
  }
5096
5493
  ]
5097
5494
  }
@@ -5186,6 +5583,57 @@ var types$9 = [
5186
5583
  ]
5187
5584
  }
5188
5585
  },
5586
+ {
5587
+ name: "PretokenPurchaseHistory",
5588
+ serialization: "bytemuck",
5589
+ repr: {
5590
+ kind: "c"
5591
+ },
5592
+ type: {
5593
+ kind: "struct",
5594
+ fields: [
5595
+ {
5596
+ name: "starting_epoch",
5597
+ type: "u64"
5598
+ },
5599
+ {
5600
+ name: "latest_epoch",
5601
+ type: "u64"
5602
+ },
5603
+ {
5604
+ name: "purchased_per_epoch",
5605
+ type: {
5606
+ array: [
5607
+ "u64",
5608
+ 100
5609
+ ]
5610
+ }
5611
+ },
5612
+ {
5613
+ name: "synd_per_epoch",
5614
+ type: {
5615
+ array: [
5616
+ "u64",
5617
+ 100
5618
+ ]
5619
+ }
5620
+ },
5621
+ {
5622
+ name: "bump",
5623
+ type: "u8"
5624
+ },
5625
+ {
5626
+ name: "_padding",
5627
+ type: {
5628
+ array: [
5629
+ "u8",
5630
+ 7
5631
+ ]
5632
+ }
5633
+ }
5634
+ ]
5635
+ }
5636
+ },
5189
5637
  {
5190
5638
  name: "PretokenPurchased",
5191
5639
  type: {
@@ -5446,56 +5894,56 @@ var types$9 = [
5446
5894
  {
5447
5895
  name: "addition_in_progress",
5448
5896
  docs: [
5449
- "Whether validator addition selection is currently in progress (batched processing)"
5897
+ "DEPRECATED see BatchOrchestrator. Always false."
5450
5898
  ],
5451
5899
  type: "bool"
5452
5900
  },
5453
5901
  {
5454
5902
  name: "addition_next_rank",
5455
5903
  docs: [
5456
- "Next rank to process in leaderboard sorted_indices"
5904
+ "DEPRECATED see BatchOrchestrator.addition_next_rank. Always 0."
5457
5905
  ],
5458
5906
  type: "u16"
5459
5907
  },
5460
5908
  {
5461
5909
  name: "addition_target_rank",
5462
5910
  docs: [
5463
- "Target rank to process up to (inclusive)"
5911
+ "DEPRECATED see BatchOrchestrator.addition_target_rank. Always 0."
5464
5912
  ],
5465
5913
  type: "u16"
5466
5914
  },
5467
5915
  {
5468
5916
  name: "validators_added_this_selection",
5469
5917
  docs: [
5470
- "Number of validators added in the current selection cycle"
5918
+ "DEPRECATED see BatchOrchestrator. Always 0."
5471
5919
  ],
5472
5920
  type: "u16"
5473
5921
  },
5474
5922
  {
5475
5923
  name: "removal_in_progress",
5476
5924
  docs: [
5477
- "Whether validator removal selection is currently in progress (batched processing)"
5925
+ "DEPRECATED see BatchOrchestrator. Always false."
5478
5926
  ],
5479
5927
  type: "bool"
5480
5928
  },
5481
5929
  {
5482
5930
  name: "removal_next_index",
5483
5931
  docs: [
5484
- "Next index in active list to check for removal"
5932
+ "DEPRECATED see BatchOrchestrator.removal_next_index. Always 0."
5485
5933
  ],
5486
5934
  type: "u16"
5487
5935
  },
5488
5936
  {
5489
5937
  name: "removal_active_list_snapshot",
5490
5938
  docs: [
5491
- "Snapshot of active list count at start of removal (frozen)"
5939
+ "DEPRECATED see BatchOrchestrator. Always 0."
5492
5940
  ],
5493
5941
  type: "u16"
5494
5942
  },
5495
5943
  {
5496
5944
  name: "validators_removed_this_selection",
5497
5945
  docs: [
5498
- "Number of validators removed in the current selection cycle"
5946
+ "DEPRECATED see BatchOrchestrator. Always 0."
5499
5947
  ],
5500
5948
  type: "u16"
5501
5949
  }
@@ -6351,6 +6799,41 @@ var instructions$6 = [
6351
6799
  }
6352
6800
  }
6353
6801
  ]
6802
+ },
6803
+ {
6804
+ name: "update_liqsol_metadata_permissionless",
6805
+ discriminator: [
6806
+ 21,
6807
+ 255,
6808
+ 26,
6809
+ 184,
6810
+ 136,
6811
+ 110,
6812
+ 214,
6813
+ 33
6814
+ ],
6815
+ accounts: [
6816
+ {
6817
+ name: "payer",
6818
+ writable: true,
6819
+ signer: true
6820
+ },
6821
+ {
6822
+ name: "mint_authority"
6823
+ },
6824
+ {
6825
+ name: "mint",
6826
+ writable: true
6827
+ },
6828
+ {
6829
+ name: "token_program"
6830
+ },
6831
+ {
6832
+ name: "system_program"
6833
+ }
6834
+ ],
6835
+ args: [
6836
+ ]
6354
6837
  }
6355
6838
  ];
6356
6839
  var errors$6 = [
@@ -7108,6 +7591,41 @@ var instructions$4 = [
7108
7591
  type: "u64"
7109
7592
  }
7110
7593
  ]
7594
+ },
7595
+ {
7596
+ name: "update_extra_account_meta_list",
7597
+ discriminator: [
7598
+ 44,
7599
+ 125,
7600
+ 141,
7601
+ 226,
7602
+ 97,
7603
+ 179,
7604
+ 166,
7605
+ 96
7606
+ ],
7607
+ accounts: [
7608
+ {
7609
+ name: "payer",
7610
+ writable: true,
7611
+ signer: true
7612
+ },
7613
+ {
7614
+ name: "extra_account_meta_list",
7615
+ writable: true
7616
+ },
7617
+ {
7618
+ name: "mint"
7619
+ },
7620
+ {
7621
+ name: "system_program"
7622
+ },
7623
+ {
7624
+ name: "liqsol_core"
7625
+ }
7626
+ ],
7627
+ args: [
7628
+ ]
7111
7629
  }
7112
7630
  ];
7113
7631
  var accounts$3 = [
@@ -7279,10 +7797,55 @@ var instructions$3 = [
7279
7797
  ]
7280
7798
  },
7281
7799
  {
7282
- name: "aggregate_stake_metrics",
7283
- docs: [
7284
- "V2: Aggregate stake metrics across all validators using PDA architecture"
7285
- ],
7800
+ name: "admin_force_unbond_role",
7801
+ discriminator: [
7802
+ 80,
7803
+ 107,
7804
+ 27,
7805
+ 49,
7806
+ 126,
7807
+ 25,
7808
+ 31,
7809
+ 238
7810
+ ],
7811
+ accounts: [
7812
+ {
7813
+ name: "admin",
7814
+ signer: true
7815
+ },
7816
+ {
7817
+ name: "global_config"
7818
+ },
7819
+ {
7820
+ name: "global_state"
7821
+ },
7822
+ {
7823
+ name: "user",
7824
+ docs: [
7825
+ "The user whose role bond is being force-unbonded"
7826
+ ]
7827
+ },
7828
+ {
7829
+ name: "outpost_account",
7830
+ writable: true
7831
+ }
7832
+ ],
7833
+ args: [
7834
+ {
7835
+ name: "role",
7836
+ type: {
7837
+ defined: {
7838
+ name: "Role"
7839
+ }
7840
+ }
7841
+ }
7842
+ ]
7843
+ },
7844
+ {
7845
+ name: "aggregate_stake_metrics",
7846
+ docs: [
7847
+ "V2: Aggregate stake metrics across all validators using PDA architecture"
7848
+ ],
7286
7849
  discriminator: [
7287
7850
  13,
7288
7851
  245,
@@ -8052,6 +8615,72 @@ var instructions$3 = [
8052
8615
  }
8053
8616
  ]
8054
8617
  },
8618
+ {
8619
+ name: "deposit_to_reserve",
8620
+ discriminator: [
8621
+ 8,
8622
+ 79,
8623
+ 123,
8624
+ 129,
8625
+ 146,
8626
+ 140,
8627
+ 178,
8628
+ 128
8629
+ ],
8630
+ accounts: [
8631
+ {
8632
+ name: "admin",
8633
+ signer: true
8634
+ },
8635
+ {
8636
+ name: "global_config"
8637
+ },
8638
+ {
8639
+ name: "depositor",
8640
+ writable: true,
8641
+ signer: true
8642
+ },
8643
+ {
8644
+ name: "reserve_pool",
8645
+ writable: true
8646
+ },
8647
+ {
8648
+ name: "vault"
8649
+ },
8650
+ {
8651
+ name: "ephemeral_stake",
8652
+ writable: true
8653
+ },
8654
+ {
8655
+ name: "controller_state"
8656
+ },
8657
+ {
8658
+ name: "stake_program"
8659
+ },
8660
+ {
8661
+ name: "system_program"
8662
+ },
8663
+ {
8664
+ name: "clock"
8665
+ },
8666
+ {
8667
+ name: "stake_history"
8668
+ },
8669
+ {
8670
+ name: "rent"
8671
+ }
8672
+ ],
8673
+ args: [
8674
+ {
8675
+ name: "amount",
8676
+ type: "u64"
8677
+ },
8678
+ {
8679
+ name: "seed",
8680
+ type: "u32"
8681
+ }
8682
+ ]
8683
+ },
8055
8684
  {
8056
8685
  name: "desynd",
8057
8686
  discriminator: [
@@ -8128,6 +8757,10 @@ var instructions$3 = [
8128
8757
  ],
8129
8758
  writable: true
8130
8759
  },
8760
+ {
8761
+ name: "pretoken_purchase_history",
8762
+ writable: true
8763
+ },
8131
8764
  {
8132
8765
  name: "token_program"
8133
8766
  },
@@ -8170,6 +8803,44 @@ var instructions$3 = [
8170
8803
  ],
8171
8804
  returns: "u16"
8172
8805
  },
8806
+ {
8807
+ name: "has_role",
8808
+ discriminator: [
8809
+ 218,
8810
+ 136,
8811
+ 44,
8812
+ 87,
8813
+ 142,
8814
+ 247,
8815
+ 141,
8816
+ 195
8817
+ ],
8818
+ accounts: [
8819
+ {
8820
+ name: "user",
8821
+ docs: [
8822
+ "User whose role status is being checked."
8823
+ ]
8824
+ },
8825
+ {
8826
+ name: "outpost_account"
8827
+ },
8828
+ {
8829
+ name: "global_state"
8830
+ }
8831
+ ],
8832
+ args: [
8833
+ {
8834
+ name: "role",
8835
+ type: {
8836
+ defined: {
8837
+ name: "Role"
8838
+ }
8839
+ }
8840
+ }
8841
+ ],
8842
+ returns: "bool"
8843
+ },
8173
8844
  {
8174
8845
  name: "init_bucket",
8175
8846
  docs: [
@@ -8521,6 +9192,52 @@ var instructions$3 = [
8521
9192
  args: [
8522
9193
  ]
8523
9194
  },
9195
+ {
9196
+ name: "initialize_pretoken_purchase_history",
9197
+ docs: [
9198
+ "Admin-only: initialize PretokenPurchaseHistory PDA for a pool"
9199
+ ],
9200
+ discriminator: [
9201
+ 140,
9202
+ 166,
9203
+ 196,
9204
+ 128,
9205
+ 189,
9206
+ 240,
9207
+ 159,
9208
+ 1
9209
+ ],
9210
+ accounts: [
9211
+ {
9212
+ name: "admin",
9213
+ writable: true,
9214
+ signer: true
9215
+ },
9216
+ {
9217
+ name: "global_config"
9218
+ },
9219
+ {
9220
+ name: "pretoken_purchase_history",
9221
+ writable: true
9222
+ },
9223
+ {
9224
+ name: "pool_authority"
9225
+ },
9226
+ {
9227
+ name: "global_state",
9228
+ writable: true
9229
+ },
9230
+ {
9231
+ name: "pool_pretoken_record",
9232
+ writable: true
9233
+ },
9234
+ {
9235
+ name: "system_program"
9236
+ }
9237
+ ],
9238
+ args: [
9239
+ ]
9240
+ },
8524
9241
  {
8525
9242
  name: "initialize_processing_state",
8526
9243
  docs: [
@@ -9402,6 +10119,10 @@ var instructions$3 = [
9402
10119
  },
9403
10120
  {
9404
10121
  name: "system_program"
10122
+ },
10123
+ {
10124
+ name: "pretoken_purchase_history",
10125
+ writable: true
9405
10126
  }
9406
10127
  ],
9407
10128
  args: [
@@ -9496,6 +10217,10 @@ var instructions$3 = [
9496
10217
  },
9497
10218
  {
9498
10219
  name: "chainlink_program"
10220
+ },
10221
+ {
10222
+ name: "pretoken_purchase_history",
10223
+ writable: true
9499
10224
  }
9500
10225
  ],
9501
10226
  args: [
@@ -9563,72 +10288,212 @@ var instructions$3 = [
9563
10288
  signer: true
9564
10289
  },
9565
10290
  {
9566
- name: "stake_metrics",
10291
+ name: "stake_metrics",
10292
+ writable: true
10293
+ },
10294
+ {
10295
+ name: "epoch_state",
10296
+ writable: true
10297
+ },
10298
+ {
10299
+ name: "processing_state",
10300
+ writable: true
10301
+ },
10302
+ {
10303
+ name: "active_list"
10304
+ },
10305
+ {
10306
+ name: "global_config",
10307
+ docs: [
10308
+ "Global config for late epoch slot gate"
10309
+ ]
10310
+ }
10311
+ ],
10312
+ args: [
10313
+ ]
10314
+ },
10315
+ {
10316
+ name: "refresh_stake_metrics_post_sync",
10317
+ docs: [
10318
+ "V2: Refresh stake metrics after removal selection + PDA setup",
10319
+ "Requires ValidatorAdditionSelection + ValidatorPdaSetup as prerequisites",
10320
+ "Tracks completion in last_post_sync_stake_metrics_refresh_epoch"
10321
+ ],
10322
+ discriminator: [
10323
+ 177,
10324
+ 250,
10325
+ 32,
10326
+ 155,
10327
+ 196,
10328
+ 199,
10329
+ 199,
10330
+ 249
10331
+ ],
10332
+ accounts: [
10333
+ {
10334
+ name: "admin",
10335
+ signer: true
10336
+ },
10337
+ {
10338
+ name: "stake_metrics",
10339
+ writable: true
10340
+ },
10341
+ {
10342
+ name: "epoch_state",
10343
+ writable: true
10344
+ },
10345
+ {
10346
+ name: "processing_state",
10347
+ writable: true
10348
+ },
10349
+ {
10350
+ name: "active_list"
10351
+ },
10352
+ {
10353
+ name: "global_config",
10354
+ docs: [
10355
+ "Global config for late epoch slot gate"
10356
+ ]
10357
+ }
10358
+ ],
10359
+ args: [
10360
+ ]
10361
+ },
10362
+ {
10363
+ name: "refund",
10364
+ discriminator: [
10365
+ 2,
10366
+ 96,
10367
+ 183,
10368
+ 251,
10369
+ 63,
10370
+ 208,
10371
+ 46,
10372
+ 46
10373
+ ],
10374
+ accounts: [
10375
+ {
10376
+ name: "associated_token_program"
10377
+ },
10378
+ {
10379
+ name: "user",
10380
+ writable: true,
10381
+ signer: true
10382
+ },
10383
+ {
10384
+ name: "global_state",
10385
+ writable: true
10386
+ },
10387
+ {
10388
+ name: "outpost_account",
10389
+ writable: true
10390
+ },
10391
+ {
10392
+ name: "distribution_state",
10393
+ writable: true
10394
+ },
10395
+ {
10396
+ name: "pool_authority"
10397
+ },
10398
+ {
10399
+ name: "liqsol_pool_ata",
10400
+ writable: true
10401
+ },
10402
+ {
10403
+ name: "refund_liqsol_ata",
10404
+ writable: true
10405
+ },
10406
+ {
10407
+ name: "liqsol_pool_user_record",
10408
+ writable: true
10409
+ },
10410
+ {
10411
+ name: "user_record",
9567
10412
  writable: true
9568
10413
  },
9569
10414
  {
9570
- name: "epoch_state",
9571
- writable: true
10415
+ name: "extra_account_meta_list"
9572
10416
  },
9573
10417
  {
9574
- name: "processing_state",
10418
+ name: "liqsol_core_program"
10419
+ },
10420
+ {
10421
+ name: "transfer_hook_program"
10422
+ },
10423
+ {
10424
+ name: "liqsol_mint"
10425
+ },
10426
+ {
10427
+ name: "token_program"
10428
+ },
10429
+ {
10430
+ name: "bucket_authority"
10431
+ },
10432
+ {
10433
+ name: "bucket_token_account",
9575
10434
  writable: true
9576
10435
  },
9577
10436
  {
9578
- name: "active_list"
10437
+ name: "bucket_user_record",
10438
+ writable: true
9579
10439
  },
9580
10440
  {
9581
- name: "global_config",
9582
- docs: [
9583
- "Global config for late epoch slot gate"
9584
- ]
10441
+ name: "system_program"
9585
10442
  }
9586
10443
  ],
9587
10444
  args: [
9588
10445
  ]
9589
10446
  },
9590
10447
  {
9591
- name: "refresh_stake_metrics_post_sync",
9592
- docs: [
9593
- "V2: Refresh stake metrics after removal selection + PDA setup",
9594
- "Requires ActiveInfosSynced + ValidatorPdaSetup as prerequisites",
9595
- "Tracks completion in last_post_sync_stake_metrics_refresh_epoch"
9596
- ],
10448
+ name: "register_system_pda",
9597
10449
  discriminator: [
9598
- 177,
9599
- 250,
9600
- 32,
9601
- 155,
9602
- 196,
9603
- 199,
9604
- 199,
9605
- 249
10450
+ 110,
10451
+ 93,
10452
+ 36,
10453
+ 156,
10454
+ 179,
10455
+ 69,
10456
+ 54,
10457
+ 210
9606
10458
  ],
9607
10459
  accounts: [
9608
10460
  {
9609
10461
  name: "admin",
10462
+ writable: true,
9610
10463
  signer: true
9611
10464
  },
9612
10465
  {
9613
- name: "stake_metrics",
9614
- writable: true
10466
+ name: "global_config"
9615
10467
  },
9616
10468
  {
9617
- name: "epoch_state",
10469
+ name: "pda_owner",
10470
+ docs: [
10471
+ "The PDA whose user record we're creating — must be system-owned (no program data)."
10472
+ ]
10473
+ },
10474
+ {
10475
+ name: "pda_ata"
10476
+ },
10477
+ {
10478
+ name: "user_record",
9618
10479
  writable: true
9619
10480
  },
9620
10481
  {
9621
- name: "processing_state",
10482
+ name: "distribution_state",
9622
10483
  writable: true
9623
10484
  },
9624
10485
  {
9625
- name: "active_list"
10486
+ name: "bucket_authority"
9626
10487
  },
9627
10488
  {
9628
- name: "global_config",
10489
+ name: "bucket_token_account",
9629
10490
  docs: [
9630
- "Global config for late epoch slot gate"
9631
- ]
10491
+ "The bucket's associated token account holding liqSOL (for index sync)"
10492
+ ],
10493
+ writable: true
10494
+ },
10495
+ {
10496
+ name: "system_program"
9632
10497
  }
9633
10498
  ],
9634
10499
  args: [
@@ -9648,25 +10513,17 @@ var instructions$3 = [
9648
10513
  ],
9649
10514
  accounts: [
9650
10515
  {
9651
- name: "user",
9652
- writable: true
10516
+ name: "payer",
10517
+ writable: true,
10518
+ signer: true
9653
10519
  },
9654
10520
  {
9655
- name: "user_ata",
9656
- writable: true
10521
+ name: "user_ata"
9657
10522
  },
9658
10523
  {
9659
10524
  name: "user_record",
9660
10525
  writable: true
9661
10526
  },
9662
- {
9663
- name: "payer",
9664
- docs: [
9665
- "Payer for the user record PDA creation (always the user)"
9666
- ],
9667
- writable: true,
9668
- signer: true
9669
- },
9670
10527
  {
9671
10528
  name: "distribution_state",
9672
10529
  writable: true
@@ -9832,7 +10689,8 @@ var instructions$3 = [
9832
10689
  name: "bucket_token_account",
9833
10690
  docs: [
9834
10691
  "The bucket's token account holding liqSOL (for sync_index balance)"
9835
- ]
10692
+ ],
10693
+ writable: true
9836
10694
  },
9837
10695
  {
9838
10696
  name: "reserve_pool",
@@ -10181,7 +11039,8 @@ var instructions$3 = [
10181
11039
  name: "global_config"
10182
11040
  },
10183
11041
  {
10184
- name: "global_state"
11042
+ name: "global_state",
11043
+ writable: true
10185
11044
  },
10186
11045
  {
10187
11046
  name: "user",
@@ -10274,7 +11133,7 @@ var instructions$3 = [
10274
11133
  name: "sync_main_stake_accounts",
10275
11134
  docs: [
10276
11135
  "V2: Sync main stake accounts using PDA architecture (batched)",
10277
- "Processes up to 10 validators per transaction via remaining_accounts",
11136
+ "Processes validators in batches via remaining_accounts (batch size is enforced client-side)",
10278
11137
  "Note: Only syncs primary delegated stakes, not transient stakes"
10279
11138
  ],
10280
11139
  discriminator: [
@@ -10442,6 +11301,10 @@ var instructions$3 = [
10442
11301
  ],
10443
11302
  writable: true
10444
11303
  },
11304
+ {
11305
+ name: "pretoken_purchase_history",
11306
+ writable: true
11307
+ },
10445
11308
  {
10446
11309
  name: "token_program"
10447
11310
  },
@@ -10844,6 +11707,19 @@ var accounts$2 = [
10844
11707
  150
10845
11708
  ]
10846
11709
  },
11710
+ {
11711
+ name: "PretokenPurchaseHistory",
11712
+ discriminator: [
11713
+ 33,
11714
+ 71,
11715
+ 113,
11716
+ 206,
11717
+ 33,
11718
+ 180,
11719
+ 236,
11720
+ 131
11721
+ ]
11722
+ },
10847
11723
  {
10848
11724
  name: "PriceHistory",
10849
11725
  discriminator: [
@@ -11356,12 +12232,24 @@ var types$5 = [
11356
12232
  ],
11357
12233
  type: "u16"
11358
12234
  },
12235
+ {
12236
+ name: "aggregate_mode_tag",
12237
+ docs: [
12238
+ "Tracks which aggregation mode currently owns the shared temp fields.",
12239
+ "0 = idle,",
12240
+ "1 = Normal,",
12241
+ "2 = PostSync,",
12242
+ "3 = PostLateEpoch.",
12243
+ "Prevents cross-mode state contamination when modes share the same vars."
12244
+ ],
12245
+ type: "u8"
12246
+ },
11359
12247
  {
11360
12248
  name: "_reserved",
11361
12249
  type: {
11362
12250
  array: [
11363
12251
  "u8",
11364
- 32
12252
+ 31
11365
12253
  ]
11366
12254
  }
11367
12255
  }
@@ -11594,7 +12482,9 @@ var types$5 = [
11594
12482
  {
11595
12483
  name: "authority",
11596
12484
  docs: [
11597
- "Authority that can update serviceable_epoch"
12485
+ "DEPRECATED: Originally intended as authority for serviceable_epoch updates,",
12486
+ "but serviceable_epoch is updated by merge_deactivated_stakes gated via GlobalConfig.cranky.",
12487
+ "Retained to preserve account layout."
11598
12488
  ],
11599
12489
  type: "pubkey"
11600
12490
  },
@@ -11910,9 +12800,10 @@ var types$5 = [
11910
12800
  type: "u64"
11911
12801
  },
11912
12802
  {
11913
- name: "last_pool_liqsol_balance",
12803
+ name: "expected_pool_balance",
11914
12804
  docs: [
11915
- "Last observed liqSOL pool balance (for yield calculation)"
12805
+ "Expected liqSOL pool balance (tracked by protocol operations, not read from on-chain balance).",
12806
+ "Any discrepancy vs actual on-chain balance is treated as unsolicited donations, not yield."
11916
12807
  ],
11917
12808
  type: "u64"
11918
12809
  },
@@ -12125,6 +13016,9 @@ var types$5 = [
12125
13016
  },
12126
13017
  {
12127
13018
  name: "last_active_infos_synced_epoch",
13019
+ docs: [
13020
+ "DEPRECATED: ActiveInfosSynced removed in WIN-134. Retained to preserve account layout."
13021
+ ],
12128
13022
  type: "u16"
12129
13023
  },
12130
13024
  {
@@ -12139,6 +13033,9 @@ var types$5 = [
12139
13033
  },
12140
13034
  {
12141
13035
  name: "last_distribution_slot",
13036
+ docs: [
13037
+ "DEPRECATED: Distribution slot tracking removed in PR113. Retained to preserve account layout."
13038
+ ],
12142
13039
  type: {
12143
13040
  option: "u64"
12144
13041
  }
@@ -12303,6 +13200,24 @@ var types$5 = [
12303
13200
  {
12304
13201
  name: "bump",
12305
13202
  type: "u8"
13203
+ },
13204
+ {
13205
+ name: "accumulated_pretoken_yield",
13206
+ type: {
13207
+ option: "u64"
13208
+ }
13209
+ },
13210
+ {
13211
+ name: "last_epoch_synd_liqsol",
13212
+ type: {
13213
+ option: "u64"
13214
+ }
13215
+ },
13216
+ {
13217
+ name: "last_synd_epoch",
13218
+ type: {
13219
+ option: "u64"
13220
+ }
12306
13221
  }
12307
13222
  ]
12308
13223
  }
@@ -12397,6 +13312,57 @@ var types$5 = [
12397
13312
  ]
12398
13313
  }
12399
13314
  },
13315
+ {
13316
+ name: "PretokenPurchaseHistory",
13317
+ serialization: "bytemuck",
13318
+ repr: {
13319
+ kind: "c"
13320
+ },
13321
+ type: {
13322
+ kind: "struct",
13323
+ fields: [
13324
+ {
13325
+ name: "starting_epoch",
13326
+ type: "u64"
13327
+ },
13328
+ {
13329
+ name: "latest_epoch",
13330
+ type: "u64"
13331
+ },
13332
+ {
13333
+ name: "purchased_per_epoch",
13334
+ type: {
13335
+ array: [
13336
+ "u64",
13337
+ 100
13338
+ ]
13339
+ }
13340
+ },
13341
+ {
13342
+ name: "synd_per_epoch",
13343
+ type: {
13344
+ array: [
13345
+ "u64",
13346
+ 100
13347
+ ]
13348
+ }
13349
+ },
13350
+ {
13351
+ name: "bump",
13352
+ type: "u8"
13353
+ },
13354
+ {
13355
+ name: "_padding",
13356
+ type: {
13357
+ array: [
13358
+ "u8",
13359
+ 7
13360
+ ]
13361
+ }
13362
+ }
13363
+ ]
13364
+ }
13365
+ },
12400
13366
  {
12401
13367
  name: "PretokenPurchased",
12402
13368
  type: {
@@ -12657,56 +13623,56 @@ var types$5 = [
12657
13623
  {
12658
13624
  name: "addition_in_progress",
12659
13625
  docs: [
12660
- "Whether validator addition selection is currently in progress (batched processing)"
13626
+ "DEPRECATED see BatchOrchestrator. Always false."
12661
13627
  ],
12662
13628
  type: "bool"
12663
13629
  },
12664
13630
  {
12665
13631
  name: "addition_next_rank",
12666
13632
  docs: [
12667
- "Next rank to process in leaderboard sorted_indices"
13633
+ "DEPRECATED see BatchOrchestrator.addition_next_rank. Always 0."
12668
13634
  ],
12669
13635
  type: "u16"
12670
13636
  },
12671
13637
  {
12672
13638
  name: "addition_target_rank",
12673
13639
  docs: [
12674
- "Target rank to process up to (inclusive)"
13640
+ "DEPRECATED see BatchOrchestrator.addition_target_rank. Always 0."
12675
13641
  ],
12676
13642
  type: "u16"
12677
13643
  },
12678
13644
  {
12679
13645
  name: "validators_added_this_selection",
12680
13646
  docs: [
12681
- "Number of validators added in the current selection cycle"
13647
+ "DEPRECATED see BatchOrchestrator. Always 0."
12682
13648
  ],
12683
13649
  type: "u16"
12684
13650
  },
12685
13651
  {
12686
13652
  name: "removal_in_progress",
12687
13653
  docs: [
12688
- "Whether validator removal selection is currently in progress (batched processing)"
13654
+ "DEPRECATED see BatchOrchestrator. Always false."
12689
13655
  ],
12690
13656
  type: "bool"
12691
13657
  },
12692
13658
  {
12693
13659
  name: "removal_next_index",
12694
13660
  docs: [
12695
- "Next index in active list to check for removal"
13661
+ "DEPRECATED see BatchOrchestrator.removal_next_index. Always 0."
12696
13662
  ],
12697
13663
  type: "u16"
12698
13664
  },
12699
13665
  {
12700
13666
  name: "removal_active_list_snapshot",
12701
13667
  docs: [
12702
- "Snapshot of active list count at start of removal (frozen)"
13668
+ "DEPRECATED see BatchOrchestrator. Always 0."
12703
13669
  ],
12704
13670
  type: "u16"
12705
13671
  },
12706
13672
  {
12707
13673
  name: "validators_removed_this_selection",
12708
13674
  docs: [
12709
- "Number of validators removed in the current selection cycle"
13675
+ "DEPRECATED see BatchOrchestrator. Always 0."
12710
13676
  ],
12711
13677
  type: "u16"
12712
13678
  }
@@ -13562,6 +14528,41 @@ var instructions$2 = [
13562
14528
  }
13563
14529
  }
13564
14530
  ]
14531
+ },
14532
+ {
14533
+ name: "update_liqsol_metadata_permissionless",
14534
+ discriminator: [
14535
+ 21,
14536
+ 255,
14537
+ 26,
14538
+ 184,
14539
+ 136,
14540
+ 110,
14541
+ 214,
14542
+ 33
14543
+ ],
14544
+ accounts: [
14545
+ {
14546
+ name: "payer",
14547
+ writable: true,
14548
+ signer: true
14549
+ },
14550
+ {
14551
+ name: "mint_authority"
14552
+ },
14553
+ {
14554
+ name: "mint",
14555
+ writable: true
14556
+ },
14557
+ {
14558
+ name: "token_program"
14559
+ },
14560
+ {
14561
+ name: "system_program"
14562
+ }
14563
+ ],
14564
+ args: [
14565
+ ]
13565
14566
  }
13566
14567
  ];
13567
14568
  var errors$2 = [
@@ -14319,6 +15320,41 @@ var instructions = [
14319
15320
  type: "u64"
14320
15321
  }
14321
15322
  ]
15323
+ },
15324
+ {
15325
+ name: "update_extra_account_meta_list",
15326
+ discriminator: [
15327
+ 44,
15328
+ 125,
15329
+ 141,
15330
+ 226,
15331
+ 97,
15332
+ 179,
15333
+ 166,
15334
+ 96
15335
+ ],
15336
+ accounts: [
15337
+ {
15338
+ name: "payer",
15339
+ writable: true,
15340
+ signer: true
15341
+ },
15342
+ {
15343
+ name: "extra_account_meta_list",
15344
+ writable: true
15345
+ },
15346
+ {
15347
+ name: "mint"
15348
+ },
15349
+ {
15350
+ name: "system_program"
15351
+ },
15352
+ {
15353
+ name: "liqsol_core"
15354
+ }
15355
+ ],
15356
+ args: [
15357
+ ]
14322
15358
  }
14323
15359
  ];
14324
15360
  var accounts = [
@@ -14484,7 +15520,8 @@ const PDA_SEEDS = {
14484
15520
  WITHDRAW_MINT_AUTHORITY: "mint_authority",
14485
15521
  MINT_METADATA: "mint_metadata",
14486
15522
  LIQ_RECEIPT_DATA: "liq_receipt_data",
14487
- WITHDRAW_MINT: "mint"
15523
+ WITHDRAW_MINT: "mint",
15524
+ PRETOKEN_PURCHASE_HISTORY: "pretoken_purchase_history"
14488
15525
  };
14489
15526
  const deriveEphemeralStakeAddress = async (user, seed) => {
14490
15527
  const seedStr = `ephemeral_${seed}`;
@@ -14669,6 +15706,7 @@ async function buildOutpostAccounts(connection, user, pgs) {
14669
15706
  const liqsolPoolUserRecord = pgs.deriveUserRecordPda(liqsolPoolAta);
14670
15707
  const userUserRecord = pgs.deriveUserRecordPda(userAta);
14671
15708
  const extraAccountMetaList = pgs.deriveExtraAccountMetaListPda(liqsolMint);
15709
+ const pretokenPurchaseHistory = pgs.derivePretokenPurchaseHistoryPda(poolAuthority);
14672
15710
  let chainLinkFeed = CHAINLINK_FEED;
14673
15711
  let chainLinkProgram = CHAINLINK_PROGRAM;
14674
15712
  try {
@@ -14698,7 +15736,8 @@ async function buildOutpostAccounts(connection, user, pgs) {
14698
15736
  trancheState,
14699
15737
  chainLinkFeed,
14700
15738
  chainLinkProgram,
14701
- extraAccountMetaList
15739
+ extraAccountMetaList,
15740
+ pretokenPurchaseHistory
14702
15741
  };
14703
15742
  }
14704
15743
  async function getEpochSnapshot(connection) {
@@ -15397,7 +16436,8 @@ class OutpostClient {
15397
16436
  outpostAccount: a.outpostAccount,
15398
16437
  tokenProgram: TOKEN_2022_PROGRAM_ID,
15399
16438
  associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
15400
- systemProgram: SystemProgram.programId
16439
+ systemProgram: SystemProgram.programId,
16440
+ pretokenPurchaseHistory: a.pretokenPurchaseHistory
15401
16441
  }).instruction();
15402
16442
  }
15403
16443
  async buildUnstakeIx(amountLamports, user) {
@@ -15425,7 +16465,8 @@ class OutpostClient {
15425
16465
  outpostAccount: a.outpostAccount,
15426
16466
  tokenProgram: TOKEN_2022_PROGRAM_ID,
15427
16467
  systemProgram: SystemProgram.programId,
15428
- associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID
16468
+ associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
16469
+ pretokenPurchaseHistory: a.pretokenPurchaseHistory
15429
16470
  }).instruction();
15430
16471
  }
15431
16472
  previewPretokens(params) {
@@ -15524,7 +16565,8 @@ class TokenClient {
15524
16565
  chainlinkProgram: a.chainLinkProgram ?? CHAINLINK_PROGRAM,
15525
16566
  tokenProgram: TOKEN_2022_PROGRAM_ID,
15526
16567
  associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
15527
- systemProgram: SystemProgram.programId
16568
+ systemProgram: SystemProgram.programId,
16569
+ pretokenPurchaseHistory: a.pretokenPurchaseHistory
15528
16570
  }).instruction();
15529
16571
  }
15530
16572
  async getSolPriceUsdSafe() {
@@ -15725,6 +16767,12 @@ class SolanaProgramService {
15725
16767
  this.ids.LIQSOL_CORE
15726
16768
  )[0];
15727
16769
  }
16770
+ derivePretokenPurchaseHistoryPda(poolAuthority) {
16771
+ return PublicKey.findProgramAddressSync(
16772
+ [Buffer.from(PDA_SEEDS.PRETOKEN_PURCHASE_HISTORY), poolAuthority.toBuffer()],
16773
+ this.ids.LIQSOL_CORE
16774
+ )[0];
16775
+ }
15728
16776
  deriveWithdrawNftMintPda(receiptId) {
15729
16777
  const receiptIdBytes = Buffer.alloc(8);
15730
16778
  const asBigInt = typeof receiptId === "bigint" ? receiptId : BigInt(receiptId.toString());