@wireio/stake 0.7.3 → 1.0.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.js CHANGED
@@ -14,68 +14,6 @@ var metadata$3 = {
14
14
  description: "Created with Anchor"
15
15
  };
16
16
  var instructions$3 = [
17
- {
18
- name: "accumulate_unstake_request",
19
- docs: [
20
- "Accumulate unstake requests to be processed in next allocation cycle",
21
- "Multiple requests can be accumulated before calculating allocations",
22
- "Returns the target epoch when this unstake request will be processed",
23
- "We should not be able to call this without development feature enabled",
24
- ""
25
- ],
26
- discriminator: [
27
- 24,
28
- 73,
29
- 69,
30
- 139,
31
- 36,
32
- 209,
33
- 105,
34
- 252
35
- ],
36
- accounts: [
37
- {
38
- name: "admin",
39
- writable: true,
40
- signer: true
41
- },
42
- {
43
- name: "stake_allocation_state",
44
- docs: [
45
- "Stake allocation state - to accumulate pending unstake requests"
46
- ],
47
- writable: true
48
- },
49
- {
50
- name: "stake_metrics",
51
- docs: [
52
- "Stake metrics - to validate total unstake amount is available"
53
- ]
54
- },
55
- {
56
- name: "maintenance_ledger",
57
- docs: [
58
- "Maintenance ledger - to determine target processing epoch"
59
- ]
60
- },
61
- {
62
- name: "global_config",
63
- docs: [
64
- "Global config for min_unstake_request setting"
65
- ]
66
- },
67
- {
68
- name: "clock"
69
- }
70
- ],
71
- args: [
72
- {
73
- name: "amount",
74
- type: "u64"
75
- }
76
- ],
77
- returns: "u64"
78
- },
79
17
  {
80
18
  name: "add_top_performers_batch",
81
19
  docs: [
@@ -129,74 +67,6 @@ var instructions$3 = [
129
67
  args: [
130
68
  ]
131
69
  },
132
- {
133
- name: "add_validator_v2",
134
- docs: [
135
- "Add a new validator bbypassing the looking at leaderboard and getting validators form there"
136
- ],
137
- discriminator: [
138
- 217,
139
- 158,
140
- 30,
141
- 19,
142
- 123,
143
- 99,
144
- 110,
145
- 30
146
- ],
147
- accounts: [
148
- {
149
- name: "authority",
150
- writable: true,
151
- signer: true
152
- },
153
- {
154
- name: "active_list",
155
- docs: [
156
- "Active list - will add the validator here"
157
- ],
158
- writable: true
159
- },
160
- {
161
- name: "validator_info",
162
- docs: [
163
- "Create the validator info account"
164
- ],
165
- writable: true
166
- },
167
- {
168
- name: "validator_transient",
169
- docs: [
170
- "Create the validator transient account"
171
- ],
172
- writable: true
173
- },
174
- {
175
- name: "stake_allocation_state",
176
- docs: [
177
- "Stake allocation state - to update total_active_vpp when adding validator"
178
- ],
179
- writable: true
180
- },
181
- {
182
- name: "system_program"
183
- }
184
- ],
185
- args: [
186
- {
187
- name: "vote_account",
188
- type: "pubkey"
189
- },
190
- {
191
- name: "name",
192
- type: "string"
193
- },
194
- {
195
- name: "performance_score",
196
- type: "u8"
197
- }
198
- ]
199
- },
200
70
  {
201
71
  name: "aggregate_stake_metrics",
202
72
  docs: [
@@ -236,43 +106,6 @@ var instructions$3 = [
236
106
  args: [
237
107
  ]
238
108
  },
239
- {
240
- name: "blacklist_validator",
241
- docs: [
242
- "Blacklist a validator (user-facing, maintenance will handle graveyard movement)",
243
- "UnderPerforming is set automatically when score is updated",
244
- "Another serious emergency stop function"
245
- ],
246
- discriminator: [
247
- 125,
248
- 42,
249
- 36,
250
- 229,
251
- 27,
252
- 38,
253
- 226,
254
- 62
255
- ],
256
- accounts: [
257
- {
258
- name: "validator_info",
259
- writable: true
260
- },
261
- {
262
- name: "stake_allocation_state",
263
- docs: [
264
- "Stake allocation state - to update total_active_vpp when VPP changes"
265
- ],
266
- writable: true
267
- }
268
- ],
269
- args: [
270
- {
271
- name: "vote_account",
272
- type: "pubkey"
273
- }
274
- ]
275
- },
276
109
  {
277
110
  name: "bond_role",
278
111
  discriminator: [
@@ -2862,147 +2695,6 @@ var instructions$3 = [
2862
2695
  }
2863
2696
  ]
2864
2697
  },
2865
- {
2866
- name: "reset_distribution_state",
2867
- discriminator: [
2868
- 159,
2869
- 183,
2870
- 162,
2871
- 74,
2872
- 228,
2873
- 135,
2874
- 157,
2875
- 79
2876
- ],
2877
- accounts: [
2878
- {
2879
- name: "admin",
2880
- signer: true
2881
- },
2882
- {
2883
- name: "distribution_state",
2884
- writable: true
2885
- }
2886
- ],
2887
- args: [
2888
- ]
2889
- },
2890
- {
2891
- name: "reset_global_state",
2892
- discriminator: [
2893
- 252,
2894
- 41,
2895
- 117,
2896
- 110,
2897
- 248,
2898
- 165,
2899
- 48,
2900
- 88
2901
- ],
2902
- accounts: [
2903
- {
2904
- name: "admin",
2905
- signer: true
2906
- },
2907
- {
2908
- name: "global_config"
2909
- },
2910
- {
2911
- name: "global_state",
2912
- writable: true
2913
- },
2914
- {
2915
- name: "pool_authority"
2916
- },
2917
- {
2918
- name: "liqsol_mint"
2919
- },
2920
- {
2921
- name: "liqsol_pool_ata",
2922
- writable: true
2923
- },
2924
- {
2925
- name: "token_program"
2926
- },
2927
- {
2928
- name: "associated_token_program"
2929
- }
2930
- ],
2931
- args: [
2932
- ]
2933
- },
2934
- {
2935
- name: "reset_price_history",
2936
- discriminator: [
2937
- 213,
2938
- 231,
2939
- 155,
2940
- 139,
2941
- 248,
2942
- 60,
2943
- 67,
2944
- 199
2945
- ],
2946
- accounts: [
2947
- {
2948
- name: "admin",
2949
- writable: true,
2950
- signer: true
2951
- },
2952
- {
2953
- name: "global_config"
2954
- },
2955
- {
2956
- name: "tranche_state",
2957
- writable: true
2958
- },
2959
- {
2960
- name: "price_history",
2961
- writable: true
2962
- },
2963
- {
2964
- name: "system_program"
2965
- }
2966
- ],
2967
- args: [
2968
- ]
2969
- },
2970
- {
2971
- name: "reset_tranche_state",
2972
- discriminator: [
2973
- 106,
2974
- 102,
2975
- 143,
2976
- 40,
2977
- 152,
2978
- 173,
2979
- 165,
2980
- 168
2981
- ],
2982
- accounts: [
2983
- {
2984
- name: "admin",
2985
- writable: true,
2986
- signer: true
2987
- },
2988
- {
2989
- name: "global_config"
2990
- },
2991
- {
2992
- name: "tranche_state",
2993
- writable: true
2994
- },
2995
- {
2996
- name: "price_history",
2997
- writable: true
2998
- },
2999
- {
3000
- name: "system_program"
3001
- }
3002
- ],
3003
- args: [
3004
- ]
3005
- },
3006
2698
  {
3007
2699
  name: "set_admin",
3008
2700
  discriminator: [
@@ -3025,8 +2717,7 @@ var instructions$3 = [
3025
2717
  signer: true
3026
2718
  },
3027
2719
  {
3028
- name: "new_authority",
3029
- signer: true
2720
+ name: "new_authority"
3030
2721
  }
3031
2722
  ],
3032
2723
  args: [
@@ -3054,50 +2745,10 @@ var instructions$3 = [
3054
2745
  signer: true
3055
2746
  },
3056
2747
  {
3057
- name: "new_authority",
3058
- signer: true
3059
- }
3060
- ],
3061
- args: [
3062
- ]
3063
- },
3064
- {
3065
- name: "set_last_state_change_epoch",
3066
- docs: [
3067
- "Admin function to directly set last_state_change_epoch (useful for testing cooldowns)"
3068
- ],
3069
- discriminator: [
3070
- 94,
3071
- 57,
3072
- 139,
3073
- 195,
3074
- 123,
3075
- 224,
3076
- 227,
3077
- 106
3078
- ],
3079
- accounts: [
3080
- {
3081
- name: "validator_info",
3082
- writable: true
3083
- },
3084
- {
3085
- name: "stake_allocation_state",
3086
- docs: [
3087
- "Stake allocation state - to update total_active_vpp when VPP changes"
3088
- ],
3089
- writable: true
2748
+ name: "new_authority"
3090
2749
  }
3091
2750
  ],
3092
2751
  args: [
3093
- {
3094
- name: "vote_account",
3095
- type: "pubkey"
3096
- },
3097
- {
3098
- name: "epoch",
3099
- type: "u16"
3100
- }
3101
2752
  ]
3102
2753
  },
3103
2754
  {
@@ -3589,35 +3240,6 @@ var instructions$3 = [
3589
3240
  }
3590
3241
  ]
3591
3242
  },
3592
- {
3593
- name: "test_clear_active_list",
3594
- discriminator: [
3595
- 17,
3596
- 195,
3597
- 59,
3598
- 174,
3599
- 184,
3600
- 137,
3601
- 149,
3602
- 144
3603
- ],
3604
- accounts: [
3605
- {
3606
- name: "active_list",
3607
- writable: true
3608
- },
3609
- {
3610
- name: "processing_state",
3611
- writable: true
3612
- },
3613
- {
3614
- name: "authority",
3615
- signer: true
3616
- }
3617
- ],
3618
- args: [
3619
- ]
3620
- },
3621
3243
  {
3622
3244
  name: "update_config_bool",
3623
3245
  discriminator: [
@@ -4295,8 +3917,118 @@ var events = [
4295
3917
  var errors$3 = [
4296
3918
  {
4297
3919
  code: 6000,
4298
- name: "AccountBorrowFailed",
4299
- msg: "Util Acc borrow Failed"
3920
+ name: "DestinationAccountDoesNotExist",
3921
+ msg: "Destination stake account does not exist"
3922
+ },
3923
+ {
3924
+ code: 6001,
3925
+ name: "SourceAccountDoesNotExist",
3926
+ msg: "Source stake account does not exist"
3927
+ },
3928
+ {
3929
+ code: 6002,
3930
+ name: "InvalidDestinationOwner",
3931
+ msg: "Destination account not owned by stake program"
3932
+ },
3933
+ {
3934
+ code: 6003,
3935
+ name: "InvalidSourceOwner",
3936
+ msg: "Source account not owned by stake program"
3937
+ },
3938
+ {
3939
+ code: 6004,
3940
+ name: "ClockBorrowFailed",
3941
+ msg: "Failed to borrow clock data"
3942
+ },
3943
+ {
3944
+ code: 6005,
3945
+ name: "ClockDeserializeFailed",
3946
+ msg: "Failed to deserialize clock"
3947
+ },
3948
+ {
3949
+ code: 6006,
3950
+ name: "DestinationAnalysisFailed",
3951
+ msg: "Failed to analyze destination stake account"
3952
+ },
3953
+ {
3954
+ code: 6007,
3955
+ name: "SourceAnalysisFailed",
3956
+ msg: "Failed to analyze source stake account"
3957
+ },
3958
+ {
3959
+ code: 6008,
3960
+ name: "DestinationStillActivating",
3961
+ msg: "Destination stake is still activating"
3962
+ },
3963
+ {
3964
+ code: 6009,
3965
+ name: "DestinationDeactivating",
3966
+ msg: "Destination stake is deactivating"
3967
+ },
3968
+ {
3969
+ code: 6010,
3970
+ name: "SourceStillActivating",
3971
+ msg: "Source stake is still activating"
3972
+ },
3973
+ {
3974
+ code: 6011,
3975
+ name: "SourceDeactivating",
3976
+ msg: "Source stake is deactivating"
3977
+ },
3978
+ {
3979
+ code: 6012,
3980
+ name: "DestinationBorrowFailed",
3981
+ msg: "Failed to borrow destination account data"
3982
+ },
3983
+ {
3984
+ code: 6013,
3985
+ name: "DestinationParseFailed",
3986
+ msg: "Failed to parse destination stake state"
3987
+ },
3988
+ {
3989
+ code: 6014,
3990
+ name: "SourceBorrowFailed",
3991
+ msg: "Failed to borrow source account data"
3992
+ },
3993
+ {
3994
+ code: 6015,
3995
+ name: "SourceParseFailed",
3996
+ msg: "Failed to parse source stake state"
3997
+ },
3998
+ {
3999
+ code: 6016,
4000
+ name: "DifferentValidators",
4001
+ msg: "Stakes are delegated to different validators"
4002
+ },
4003
+ {
4004
+ code: 6017,
4005
+ name: "DifferentStakers",
4006
+ msg: "Stakes have different staker authorities"
4007
+ },
4008
+ {
4009
+ code: 6018,
4010
+ name: "DifferentWithdrawers",
4011
+ msg: "Stakes have different withdrawer authorities"
4012
+ },
4013
+ {
4014
+ code: 6019,
4015
+ name: "AuthoritiesNotFound",
4016
+ msg: "Could not extract authorities from accounts"
4017
+ },
4018
+ {
4019
+ code: 6020,
4020
+ name: "MergeInstructionFailed",
4021
+ msg: "Merge instruction failed"
4022
+ },
4023
+ {
4024
+ code: 6021,
4025
+ name: "EpochRewardsActive",
4026
+ msg: "Epoch rewards distribution is active - stake operations blocked"
4027
+ },
4028
+ {
4029
+ code: 6022,
4030
+ name: "DifferentCreditsObserved",
4031
+ msg: "Stakes have different credits_observed - cannot merge until both earn same rewards"
4300
4032
  }
4301
4033
  ];
4302
4034
  var types$5 = [
@@ -6749,153 +6481,6 @@ var instructions$1 = [
6749
6481
  args: [
6750
6482
  ]
6751
6483
  },
6752
- {
6753
- name: "test_clear_leaderboard",
6754
- discriminator: [
6755
- 118,
6756
- 207,
6757
- 26,
6758
- 205,
6759
- 180,
6760
- 7,
6761
- 75,
6762
- 244
6763
- ],
6764
- accounts: [
6765
- {
6766
- name: "leaderboard_state",
6767
- writable: true
6768
- },
6769
- {
6770
- name: "authority",
6771
- signer: true
6772
- }
6773
- ],
6774
- args: [
6775
- ]
6776
- },
6777
- {
6778
- name: "test_force_register_validator",
6779
- discriminator: [
6780
- 136,
6781
- 156,
6782
- 132,
6783
- 32,
6784
- 96,
6785
- 240,
6786
- 7,
6787
- 115
6788
- ],
6789
- accounts: [
6790
- {
6791
- name: "registrant",
6792
- writable: true,
6793
- signer: true
6794
- },
6795
- {
6796
- name: "vote_account"
6797
- },
6798
- {
6799
- name: "validator_record",
6800
- writable: true
6801
- },
6802
- {
6803
- name: "leaderboard_state",
6804
- writable: true
6805
- },
6806
- {
6807
- name: "system_program"
6808
- },
6809
- {
6810
- name: "clock"
6811
- }
6812
- ],
6813
- args: [
6814
- {
6815
- name: "vpp",
6816
- type: "u8"
6817
- }
6818
- ]
6819
- },
6820
- {
6821
- name: "test_force_update_vpp",
6822
- discriminator: [
6823
- 67,
6824
- 51,
6825
- 28,
6826
- 174,
6827
- 200,
6828
- 214,
6829
- 203,
6830
- 162
6831
- ],
6832
- accounts: [
6833
- {
6834
- name: "registrant",
6835
- writable: true,
6836
- signer: true
6837
- },
6838
- {
6839
- name: "vote_account"
6840
- },
6841
- {
6842
- name: "validator_record",
6843
- writable: true
6844
- },
6845
- {
6846
- name: "leaderboard_state",
6847
- writable: true
6848
- }
6849
- ],
6850
- args: [
6851
- {
6852
- name: "vpp",
6853
- type: "u8"
6854
- }
6855
- ]
6856
- },
6857
- {
6858
- name: "test_seed_random_validators",
6859
- discriminator: [
6860
- 48,
6861
- 155,
6862
- 181,
6863
- 112,
6864
- 163,
6865
- 242,
6866
- 43,
6867
- 146
6868
- ],
6869
- accounts: [
6870
- {
6871
- name: "registrant",
6872
- writable: true,
6873
- signer: true
6874
- },
6875
- {
6876
- name: "leaderboard_state",
6877
- writable: true
6878
- }
6879
- ],
6880
- args: [
6881
- {
6882
- name: "count",
6883
- type: "u16"
6884
- },
6885
- {
6886
- name: "seed",
6887
- type: "u64"
6888
- },
6889
- {
6890
- name: "min_vpp",
6891
- type: "u8"
6892
- },
6893
- {
6894
- name: "max_vpp",
6895
- type: "u8"
6896
- }
6897
- ]
6898
- },
6899
6484
  {
6900
6485
  name: "update_commission",
6901
6486
  discriminator: [
@@ -7829,7 +7414,7 @@ const deriveEphemeralStakeAddress = (user, seed) => __async$f(null, null, functi
7829
7414
  return web3_js.PublicKey.createWithSeed(user, seedStr, web3_js.StakeProgram.programId);
7830
7415
  });
7831
7416
  const CHAINLINK_FEED = new web3_js.PublicKey(
7832
- "99B2bTijsU6f1GCT73HmdR7HCFFjGMBcPZY6jZ96ynrR"
7417
+ "CH31Xns5z3M1cTAbKW34jcxPPciazARpijcHj9rxtemt"
7833
7418
  );
7834
7419
  const CHAINLINK_PROGRAM = new web3_js.PublicKey(
7835
7420
  "HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny"
@@ -9262,13 +8847,16 @@ const _SolanaStakingClient = class _SolanaStakingClient {
9262
8847
  if (amountLamports <= BigInt(0)) {
9263
8848
  throw new Error("Deposit amount must be greater than zero.");
9264
8849
  }
9265
- const tx = yield this.depositClient.buildDepositTx(amountLamports);
9266
- const { tx: prepared, blockhash, lastValidBlockHeight } = yield this.prepareTx(tx);
9267
- const signed = yield this.signTransaction(prepared);
9268
- return yield this.sendAndConfirmHttp(signed, {
9269
- blockhash,
9270
- lastValidBlockHeight
9271
- });
8850
+ try {
8851
+ const cuIx = web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
8852
+ const ix = yield this.depositClient.buildDepositTx(amountLamports);
8853
+ const tx = new web3_js.Transaction().add(cuIx, ix);
8854
+ const prepared = yield this.prepareTx(tx);
8855
+ const signed = yield this.signTransaction(prepared.tx);
8856
+ return this.sendAndConfirmHttp(signed, prepared);
8857
+ } catch (err) {
8858
+ throw new Error(`Failed to deposit Solana: ${err}`);
8859
+ }
9272
8860
  });
9273
8861
  }
9274
8862
  withdraw(amountLamports) {
@@ -9277,13 +8865,16 @@ const _SolanaStakingClient = class _SolanaStakingClient {
9277
8865
  if (amountLamports <= BigInt(0)) {
9278
8866
  throw new Error("Withdraw amount must be greater than zero.");
9279
8867
  }
9280
- const tx = yield this.depositClient.buildWithdrawTx(amountLamports);
9281
- const { tx: prepared, blockhash, lastValidBlockHeight } = yield this.prepareTx(tx);
9282
- const signed = yield this.signTransaction(prepared);
9283
- return yield this.sendAndConfirmHttp(signed, {
9284
- blockhash,
9285
- lastValidBlockHeight
9286
- });
8868
+ try {
8869
+ const cuIx = web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
8870
+ const ix = yield this.depositClient.buildWithdrawTx(amountLamports);
8871
+ const tx = new web3_js.Transaction().add(cuIx, ix);
8872
+ const prepared = yield this.prepareTx(tx);
8873
+ const signed = yield this.signTransaction(prepared.tx);
8874
+ return this.sendAndConfirmHttp(signed, prepared);
8875
+ } catch (err) {
8876
+ throw new Error(`Failed to withdraw Solana: ${err}`);
8877
+ }
9287
8878
  });
9288
8879
  }
9289
8880
  stake(amountLamports) {
@@ -9292,13 +8883,17 @@ const _SolanaStakingClient = class _SolanaStakingClient {
9292
8883
  if (!amountLamports || amountLamports <= BigInt(0)) {
9293
8884
  throw new Error("Stake amount must be greater than zero.");
9294
8885
  }
9295
- const user = this.solPubKey;
9296
- const cuIx = web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
9297
- const ix = yield this.outpostClient.buildStakeIx(amountLamports, user);
9298
- const tx = new web3_js.Transaction().add(cuIx, ix);
9299
- const prepared = yield this.prepareTx(tx);
9300
- const signed = yield this.signTransaction(prepared.tx);
9301
- return this.sendAndConfirmHttp(signed, prepared);
8886
+ try {
8887
+ const user = this.solPubKey;
8888
+ const cuIx = web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
8889
+ const ix = yield this.outpostClient.buildStakeIx(amountLamports, user);
8890
+ const tx = new web3_js.Transaction().add(cuIx, ix);
8891
+ const prepared = yield this.prepareTx(tx);
8892
+ const signed = yield this.signTransaction(prepared.tx);
8893
+ return this.sendAndConfirmHttp(signed, prepared);
8894
+ } catch (err) {
8895
+ throw new Error(`Failed to stake Solana: ${err}`);
8896
+ }
9302
8897
  });
9303
8898
  }
9304
8899
  unstake(amountLamports) {
@@ -9307,13 +8902,17 @@ const _SolanaStakingClient = class _SolanaStakingClient {
9307
8902
  if (!amountLamports || amountLamports <= BigInt(0)) {
9308
8903
  throw new Error("Unstake amount must be greater than zero.");
9309
8904
  }
9310
- const user = this.solPubKey;
9311
- const cuIx = web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
9312
- const ix = yield this.outpostClient.buildUnstakeIx(amountLamports, user);
9313
- const tx = new web3_js.Transaction().add(cuIx, ix);
9314
- const prepared = yield this.prepareTx(tx);
9315
- const signed = yield this.signTransaction(prepared.tx);
9316
- return this.sendAndConfirmHttp(signed, prepared);
8905
+ try {
8906
+ const user = this.solPubKey;
8907
+ const cuIx = web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
8908
+ const ix = yield this.outpostClient.buildUnstakeIx(amountLamports, user);
8909
+ const tx = new web3_js.Transaction().add(cuIx, ix);
8910
+ const prepared = yield this.prepareTx(tx);
8911
+ const signed = yield this.signTransaction(prepared.tx);
8912
+ return this.sendAndConfirmHttp(signed, prepared);
8913
+ } catch (err) {
8914
+ throw new Error(`Failed to unstake Solana: ${err}`);
8915
+ }
9317
8916
  });
9318
8917
  }
9319
8918
  buy(amountLamports) {
@@ -9322,102 +8921,107 @@ const _SolanaStakingClient = class _SolanaStakingClient {
9322
8921
  if (!amountLamports || amountLamports <= BigInt(0)) {
9323
8922
  throw new Error("liqSOL pretoken purchase requires a positive amount.");
9324
8923
  }
9325
- const user = this.solPubKey;
9326
- const cuIx = web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
9327
- const ix = yield this.tokenClient.buildPurchaseIx(amountLamports, user);
9328
- const tx = new web3_js.Transaction().add(cuIx, ix);
9329
- const { tx: prepared, blockhash, lastValidBlockHeight } = yield this.prepareTx(tx);
9330
- const signed = yield this.signTransaction(prepared);
9331
- return yield this.sendAndConfirmHttp(signed, {
9332
- blockhash,
9333
- lastValidBlockHeight
9334
- });
8924
+ try {
8925
+ const user = this.solPubKey;
8926
+ const cuIx = web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
8927
+ const ix = yield this.tokenClient.buildPurchaseIx(amountLamports, user);
8928
+ const tx = new web3_js.Transaction().add(cuIx, ix);
8929
+ const prepared = yield this.prepareTx(tx);
8930
+ const signed = yield this.signTransaction(prepared.tx);
8931
+ return this.sendAndConfirmHttp(signed, prepared);
8932
+ } catch (err) {
8933
+ throw new Error(`Failed to buy liqSOL pretokens: ${err}`);
8934
+ }
9335
8935
  });
9336
8936
  }
9337
8937
  getPortfolio() {
9338
8938
  return __async$8(this, null, function* () {
9339
8939
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
9340
8940
  if (!this.pubKey) throw new Error("User pubKey is undefined");
9341
- const user = this.solPubKey;
9342
- const reservePoolPDA = deriveReservePoolPda();
9343
- const vaultPDA = deriveVaultPda();
9344
- const liqsolMint = deriveLiqsolMintPda();
9345
- const userLiqsolAta = splToken.getAssociatedTokenAddressSync(
9346
- liqsolMint,
9347
- user,
9348
- false,
9349
- splToken.TOKEN_2022_PROGRAM_ID,
9350
- splToken.ASSOCIATED_TOKEN_PROGRAM_ID
9351
- );
9352
- const [nativeLamports, actualBalResp, snapshot] = yield Promise.all([
9353
- this.connection.getBalance(user, "confirmed"),
9354
- this.connection.getTokenAccountBalance(userLiqsolAta, "confirmed").catch(() => null),
9355
- this.outpostClient.fetchWireState(user).catch(() => null)
9356
- ]);
9357
- const LIQSOL_DECIMALS = 9;
9358
- const actualAmountStr = (_b = (_a = actualBalResp == null ? void 0 : actualBalResp.value) == null ? void 0 : _a.amount) != null ? _b : "0";
9359
- const globalState = (_c = snapshot == null ? void 0 : snapshot.globalState) != null ? _c : null;
9360
- const outpostAccount = (_d = snapshot == null ? void 0 : snapshot.outpostAccount) != null ? _d : null;
9361
- const trancheState = (_e = snapshot == null ? void 0 : snapshot.trancheState) != null ? _e : null;
9362
- const userPretokenRecord = (_f = snapshot == null ? void 0 : snapshot.userPretokenRecord) != null ? _f : null;
9363
- const stakedLiqsolStr = (_i = (_h = (_g = outpostAccount == null ? void 0 : outpostAccount.stakedLiqsol) == null ? void 0 : _g.toString) == null ? void 0 : _h.call(_g)) != null ? _i : "0";
9364
- const wirePretokensStr = (_l = (_k = (_j = userPretokenRecord == null ? void 0 : userPretokenRecord.totalPretokensPurchased) == null ? void 0 : _j.toString) == null ? void 0 : _k.call(_j)) != null ? _l : "0";
9365
- const currentIndexStr = (_o = (_n = (_m = globalState == null ? void 0 : globalState.currentIndex) == null ? void 0 : _m.toString) == null ? void 0 : _n.call(_m)) != null ? _o : "0";
9366
- const totalSharesStr = (_r = (_q = (_p = globalState == null ? void 0 : globalState.totalShares) == null ? void 0 : _p.toString) == null ? void 0 : _q.call(_p)) != null ? _r : "0";
9367
- const userSharesStr = (_u = (_t = (_s = outpostAccount == null ? void 0 : outpostAccount.stakedShares) == null ? void 0 : _s.toString) == null ? void 0 : _t.call(_s)) != null ? _u : "0";
9368
- const stakedLiqsol = BigInt(stakedLiqsolStr);
9369
- const currentIndex = BigInt(currentIndexStr);
9370
- const totalShares = BigInt(totalSharesStr);
9371
- const userShares = BigInt(userSharesStr);
9372
- let estimatedClaim = BigInt(0);
9373
- let estimatedYield = BigInt(0);
9374
- if (userShares > BigInt(0) && currentIndex > BigInt(0)) {
9375
- estimatedClaim = userShares * currentIndex / INDEX_SCALE$1;
9376
- if (estimatedClaim > stakedLiqsol) {
9377
- estimatedYield = estimatedClaim - stakedLiqsol;
8941
+ try {
8942
+ const user = this.solPubKey;
8943
+ const reservePoolPDA = deriveReservePoolPda();
8944
+ const vaultPDA = deriveVaultPda();
8945
+ const liqsolMint = deriveLiqsolMintPda();
8946
+ const userLiqsolAta = splToken.getAssociatedTokenAddressSync(
8947
+ liqsolMint,
8948
+ user,
8949
+ false,
8950
+ splToken.TOKEN_2022_PROGRAM_ID,
8951
+ splToken.ASSOCIATED_TOKEN_PROGRAM_ID
8952
+ );
8953
+ const [nativeLamports, actualBalResp, snapshot] = yield Promise.all([
8954
+ this.connection.getBalance(user, "confirmed"),
8955
+ this.connection.getTokenAccountBalance(userLiqsolAta, "confirmed").catch(() => null),
8956
+ this.outpostClient.fetchWireState(user).catch(() => null)
8957
+ ]);
8958
+ const LIQSOL_DECIMALS = 9;
8959
+ const actualAmountStr = (_b = (_a = actualBalResp == null ? void 0 : actualBalResp.value) == null ? void 0 : _a.amount) != null ? _b : "0";
8960
+ const globalState = (_c = snapshot == null ? void 0 : snapshot.globalState) != null ? _c : null;
8961
+ const outpostAccount = (_d = snapshot == null ? void 0 : snapshot.outpostAccount) != null ? _d : null;
8962
+ const trancheState = (_e = snapshot == null ? void 0 : snapshot.trancheState) != null ? _e : null;
8963
+ const userPretokenRecord = (_f = snapshot == null ? void 0 : snapshot.userPretokenRecord) != null ? _f : null;
8964
+ const stakedLiqsolStr = (_i = (_h = (_g = outpostAccount == null ? void 0 : outpostAccount.stakedLiqsol) == null ? void 0 : _g.toString) == null ? void 0 : _h.call(_g)) != null ? _i : "0";
8965
+ const wirePretokensStr = (_l = (_k = (_j = userPretokenRecord == null ? void 0 : userPretokenRecord.totalPretokensPurchased) == null ? void 0 : _j.toString) == null ? void 0 : _k.call(_j)) != null ? _l : "0";
8966
+ const currentIndexStr = (_o = (_n = (_m = globalState == null ? void 0 : globalState.currentIndex) == null ? void 0 : _m.toString) == null ? void 0 : _n.call(_m)) != null ? _o : "0";
8967
+ const totalSharesStr = (_r = (_q = (_p = globalState == null ? void 0 : globalState.totalShares) == null ? void 0 : _p.toString) == null ? void 0 : _q.call(_p)) != null ? _r : "0";
8968
+ const userSharesStr = (_u = (_t = (_s = outpostAccount == null ? void 0 : outpostAccount.stakedShares) == null ? void 0 : _s.toString) == null ? void 0 : _t.call(_s)) != null ? _u : "0";
8969
+ const stakedLiqsol = BigInt(stakedLiqsolStr);
8970
+ const currentIndex = BigInt(currentIndexStr);
8971
+ const totalShares = BigInt(totalSharesStr);
8972
+ const userShares = BigInt(userSharesStr);
8973
+ let estimatedClaim = BigInt(0);
8974
+ let estimatedYield = BigInt(0);
8975
+ if (userShares > BigInt(0) && currentIndex > BigInt(0)) {
8976
+ estimatedClaim = userShares * currentIndex / INDEX_SCALE$1;
8977
+ if (estimatedClaim > stakedLiqsol) {
8978
+ estimatedYield = estimatedClaim - stakedLiqsol;
8979
+ }
9378
8980
  }
8981
+ return {
8982
+ native: {
8983
+ amount: BigInt(nativeLamports),
8984
+ symbol: "SOL",
8985
+ decimals: 9
8986
+ },
8987
+ liq: {
8988
+ amount: BigInt(actualAmountStr),
8989
+ symbol: "LiqSOL",
8990
+ decimals: LIQSOL_DECIMALS,
8991
+ ata: userLiqsolAta
8992
+ },
8993
+ staked: {
8994
+ amount: stakedLiqsol,
8995
+ symbol: "LiqSOL",
8996
+ decimals: LIQSOL_DECIMALS
8997
+ },
8998
+ wire: {
8999
+ amount: BigInt(wirePretokensStr),
9000
+ symbol: "$WIRE",
9001
+ decimals: 8
9002
+ },
9003
+ yield: {
9004
+ currentIndex,
9005
+ indexScale: INDEX_SCALE$1,
9006
+ totalShares,
9007
+ userShares,
9008
+ estimatedClaim,
9009
+ estimatedYield
9010
+ },
9011
+ extras: {
9012
+ userLiqsolAta: userLiqsolAta.toBase58(),
9013
+ reservePoolPDA: reservePoolPDA.toBase58(),
9014
+ vaultPDA: vaultPDA.toBase58(),
9015
+ globalIndex: (_v = globalState == null ? void 0 : globalState.currentIndex) == null ? void 0 : _v.toString(),
9016
+ totalShares: (_w = globalState == null ? void 0 : globalState.totalShares) == null ? void 0 : _w.toString(),
9017
+ currentTrancheNumber: (_x = trancheState == null ? void 0 : trancheState.currentTrancheNumber) == null ? void 0 : _x.toString(),
9018
+ currentTranchePriceUsd: (_y = trancheState == null ? void 0 : trancheState.currentTranchePriceUsd) == null ? void 0 : _y.toString()
9019
+ },
9020
+ chainID: this.network.chainId
9021
+ };
9022
+ } catch (err) {
9023
+ throw new Error(`Failed to get Solana portfolio: ${err}`);
9379
9024
  }
9380
- return {
9381
- native: {
9382
- amount: BigInt(nativeLamports),
9383
- symbol: "SOL",
9384
- decimals: 9
9385
- },
9386
- liq: {
9387
- amount: BigInt(actualAmountStr),
9388
- symbol: "LiqSOL",
9389
- decimals: LIQSOL_DECIMALS,
9390
- ata: userLiqsolAta
9391
- },
9392
- staked: {
9393
- amount: stakedLiqsol,
9394
- symbol: "LiqSOL",
9395
- decimals: LIQSOL_DECIMALS
9396
- },
9397
- wire: {
9398
- amount: BigInt(wirePretokensStr),
9399
- symbol: "$WIRE",
9400
- decimals: 8
9401
- },
9402
- yield: {
9403
- currentIndex,
9404
- indexScale: INDEX_SCALE$1,
9405
- totalShares,
9406
- userShares,
9407
- estimatedClaim,
9408
- estimatedYield
9409
- },
9410
- extras: {
9411
- userLiqsolAta: userLiqsolAta.toBase58(),
9412
- reservePoolPDA: reservePoolPDA.toBase58(),
9413
- vaultPDA: vaultPDA.toBase58(),
9414
- globalIndex: (_v = globalState == null ? void 0 : globalState.currentIndex) == null ? void 0 : _v.toString(),
9415
- totalShares: (_w = globalState == null ? void 0 : globalState.totalShares) == null ? void 0 : _w.toString(),
9416
- currentTrancheNumber: (_x = trancheState == null ? void 0 : trancheState.currentTrancheNumber) == null ? void 0 : _x.toString(),
9417
- currentTranchePriceUsd: (_y = trancheState == null ? void 0 : trancheState.currentTranchePriceUsd) == null ? void 0 : _y.toString()
9418
- },
9419
- chainID: this.network.chainId
9420
- };
9421
9025
  });
9422
9026
  }
9423
9027
  getUserRecord() {
@@ -9428,44 +9032,56 @@ const _SolanaStakingClient = class _SolanaStakingClient {
9428
9032
  }
9429
9033
  getTrancheSnapshot(options) {
9430
9034
  return __async$8(this, null, function* () {
9431
- const {
9432
- chainID = core.SolChainID.WireTestnet,
9433
- windowBefore,
9434
- windowAfter
9435
- } = options != null ? options : {};
9436
- const [globalState, trancheState] = yield Promise.all([
9437
- this.tokenClient.fetchGlobalState(),
9438
- this.tokenClient.fetchTrancheState()
9439
- ]);
9440
- const { price: solPriceUsd, timestamp } = yield this.tokenClient.getSolPriceUsdSafe();
9441
- return buildSolanaTrancheSnapshot({
9442
- chainID,
9443
- globalState,
9444
- trancheState,
9445
- solPriceUsd,
9446
- nativePriceTimestamp: timestamp,
9447
- ladderWindowBefore: windowBefore,
9448
- ladderWindowAfter: windowAfter
9449
- });
9035
+ try {
9036
+ const {
9037
+ chainID = core.SolChainID.WireTestnet,
9038
+ windowBefore,
9039
+ windowAfter
9040
+ } = options != null ? options : {};
9041
+ const [globalState, trancheState] = yield Promise.all([
9042
+ this.tokenClient.fetchGlobalState(),
9043
+ this.tokenClient.fetchTrancheState()
9044
+ ]);
9045
+ const { price: solPriceUsd, timestamp } = yield this.tokenClient.getSolPriceUsdSafe();
9046
+ return buildSolanaTrancheSnapshot({
9047
+ chainID,
9048
+ globalState,
9049
+ trancheState,
9050
+ solPriceUsd,
9051
+ nativePriceTimestamp: timestamp,
9052
+ ladderWindowBefore: windowBefore,
9053
+ ladderWindowAfter: windowAfter
9054
+ });
9055
+ } catch (err) {
9056
+ throw new Error(`Failed to build Solana tranche snapshot: ${err}`);
9057
+ }
9450
9058
  });
9451
9059
  }
9452
9060
  getSystemAPY() {
9453
9061
  return __async$8(this, null, function* () {
9454
- const ratePerEpoch = yield this.getEpochRateDecimalFromProgram();
9455
- const epochsPerYear = yield this.getEpochsPerYearFromCluster();
9456
- const apyDecimal = Math.pow(1 + ratePerEpoch, epochsPerYear) - 1;
9457
- const apyPercent = apyDecimal * 100;
9458
- return apyPercent;
9062
+ try {
9063
+ const ratePerEpoch = yield this.getEpochRateDecimalFromProgram();
9064
+ const epochsPerYear = yield this.getEpochsPerYearFromCluster();
9065
+ const apyDecimal = Math.pow(1 + ratePerEpoch, epochsPerYear) - 1;
9066
+ const apyPercent = apyDecimal * 100;
9067
+ return apyPercent;
9068
+ } catch (err) {
9069
+ throw new Error(`Failed to compute Solana system APY: ${err}`);
9070
+ }
9459
9071
  });
9460
9072
  }
9461
9073
  getEpochRateDecimalFromProgram() {
9462
9074
  return __async$8(this, null, function* () {
9463
- const liqSolCoreProgram = this.program.getProgram("liqsolCore");
9464
- const stakeMetricsPda = deriveStakeMetricsPda();
9465
- const stakeMetrics = yield liqSolCoreProgram.account.stakeMetrics.fetch(stakeMetricsPda);
9466
- const raw = BigInt(stakeMetrics.solSystemPayRate.toString());
9467
- const rateDecimal = Number(raw) / Number(PAY_RATE_SCALE_FACTOR);
9468
- return rateDecimal;
9075
+ try {
9076
+ const liqSolCoreProgram = this.program.getProgram("liqsolCore");
9077
+ const stakeMetricsPda = deriveStakeMetricsPda();
9078
+ const stakeMetrics = yield liqSolCoreProgram.account.stakeMetrics.fetch(stakeMetricsPda);
9079
+ const raw = BigInt(stakeMetrics.solSystemPayRate.toString());
9080
+ const rateDecimal = Number(raw) / Number(PAY_RATE_SCALE_FACTOR);
9081
+ return rateDecimal;
9082
+ } catch (err) {
9083
+ throw new Error(`Failed to read stakeMetrics from program: ${err}`);
9084
+ }
9469
9085
  });
9470
9086
  }
9471
9087
  getEpochsPerYearFromCluster() {
@@ -9675,10 +9291,10 @@ _SolanaStakingClient.EPOCHS_PER_YEAR_TTL_MS = 10 * 60 * 1e3;
9675
9291
  _SolanaStakingClient.FEE_CACHE_TTL_MS = 6e4;
9676
9292
  let SolanaStakingClient = _SolanaStakingClient;
9677
9293
 
9678
- var _format$q = "hh-sol-artifact-1";
9679
- var contractName$q = "Accounting";
9680
- var sourceName$q = "contracts/liqEth/accounting.sol";
9681
- var abi$q = [
9294
+ var _format$p = "hh-sol-artifact-1";
9295
+ var contractName$p = "Accounting";
9296
+ var sourceName$p = "contracts/liqEth/accounting.sol";
9297
+ var abi$p = [
9682
9298
  {
9683
9299
  inputs: [
9684
9300
  {
@@ -10240,20 +9856,20 @@ var linkReferences$p = {
10240
9856
  var deployedLinkReferences$p = {
10241
9857
  };
10242
9858
  var AccountingArtifact = {
10243
- _format: _format$q,
10244
- contractName: contractName$q,
10245
- sourceName: sourceName$q,
10246
- abi: abi$q,
9859
+ _format: _format$p,
9860
+ contractName: contractName$p,
9861
+ sourceName: sourceName$p,
9862
+ abi: abi$p,
10247
9863
  bytecode: bytecode$p,
10248
9864
  deployedBytecode: deployedBytecode$p,
10249
9865
  linkReferences: linkReferences$p,
10250
9866
  deployedLinkReferences: deployedLinkReferences$p
10251
9867
  };
10252
9868
 
10253
- var _format$p = "hh-sol-artifact-1";
10254
- var contractName$p = "DepositManager";
10255
- var sourceName$p = "contracts/liqEth/DepositManager.sol";
10256
- var abi$p = [
9869
+ var _format$o = "hh-sol-artifact-1";
9870
+ var contractName$o = "DepositManager";
9871
+ var sourceName$o = "contracts/liqEth/DepositManager.sol";
9872
+ var abi$o = [
10257
9873
  {
10258
9874
  inputs: [
10259
9875
  {
@@ -11288,20 +10904,20 @@ var linkReferences$o = {
11288
10904
  var deployedLinkReferences$o = {
11289
10905
  };
11290
10906
  var DepositManagerArtifact = {
11291
- _format: _format$p,
11292
- contractName: contractName$p,
11293
- sourceName: sourceName$p,
11294
- abi: abi$p,
10907
+ _format: _format$o,
10908
+ contractName: contractName$o,
10909
+ sourceName: sourceName$o,
10910
+ abi: abi$o,
11295
10911
  bytecode: bytecode$o,
11296
10912
  deployedBytecode: deployedBytecode$o,
11297
10913
  linkReferences: linkReferences$o,
11298
10914
  deployedLinkReferences: deployedLinkReferences$o
11299
10915
  };
11300
10916
 
11301
- var _format$o = "hh-sol-artifact-1";
11302
- var contractName$o = "LiqEthToken";
11303
- var sourceName$o = "contracts/liqEth/liqEth.sol";
11304
- var abi$o = [
10917
+ var _format$n = "hh-sol-artifact-1";
10918
+ var contractName$n = "LiqEthToken";
10919
+ var sourceName$n = "contracts/liqEth/liqEth.sol";
10920
+ var abi$n = [
11305
10921
  {
11306
10922
  inputs: [
11307
10923
  {
@@ -12572,20 +12188,20 @@ var linkReferences$n = {
12572
12188
  var deployedLinkReferences$n = {
12573
12189
  };
12574
12190
  var LiqEthArtifact = {
12575
- _format: _format$o,
12576
- contractName: contractName$o,
12577
- sourceName: sourceName$o,
12578
- abi: abi$o,
12191
+ _format: _format$n,
12192
+ contractName: contractName$n,
12193
+ sourceName: sourceName$n,
12194
+ abi: abi$n,
12579
12195
  bytecode: bytecode$n,
12580
12196
  deployedBytecode: deployedBytecode$n,
12581
12197
  linkReferences: linkReferences$n,
12582
12198
  deployedLinkReferences: deployedLinkReferences$n
12583
12199
  };
12584
12200
 
12585
- var _format$n = "hh-sol-artifact-1";
12586
- var contractName$n = "StakingModule";
12587
- var sourceName$n = "contracts/liqEth/stakingModule.sol";
12588
- var abi$n = [
12201
+ var _format$m = "hh-sol-artifact-1";
12202
+ var contractName$m = "StakingModule";
12203
+ var sourceName$m = "contracts/liqEth/stakingModule.sol";
12204
+ var abi$m = [
12589
12205
  {
12590
12206
  inputs: [
12591
12207
  {
@@ -14412,20 +14028,20 @@ var deployedLinkReferences$m = {
14412
14028
  }
14413
14029
  };
14414
14030
  var StakingModuleArtifact = {
14415
- _format: _format$n,
14416
- contractName: contractName$n,
14417
- sourceName: sourceName$n,
14418
- abi: abi$n,
14031
+ _format: _format$m,
14032
+ contractName: contractName$m,
14033
+ sourceName: sourceName$m,
14034
+ abi: abi$m,
14419
14035
  bytecode: bytecode$m,
14420
14036
  deployedBytecode: deployedBytecode$m,
14421
14037
  linkReferences: linkReferences$m,
14422
14038
  deployedLinkReferences: deployedLinkReferences$m
14423
14039
  };
14424
14040
 
14425
- var _format$m = "hh-sol-artifact-1";
14426
- var contractName$m = "WithdrawalQueue";
14427
- var sourceName$m = "contracts/liqEth/withdrawalQueue.sol";
14428
- var abi$m = [
14041
+ var _format$l = "hh-sol-artifact-1";
14042
+ var contractName$l = "WithdrawalQueue";
14043
+ var sourceName$l = "contracts/liqEth/withdrawalQueue.sol";
14044
+ var abi$l = [
14429
14045
  {
14430
14046
  inputs: [
14431
14047
  {
@@ -15423,20 +15039,20 @@ var linkReferences$l = {
15423
15039
  var deployedLinkReferences$l = {
15424
15040
  };
15425
15041
  var WithdrawalQueueArtifact = {
15426
- _format: _format$m,
15427
- contractName: contractName$m,
15428
- sourceName: sourceName$m,
15429
- abi: abi$m,
15042
+ _format: _format$l,
15043
+ contractName: contractName$l,
15044
+ sourceName: sourceName$l,
15045
+ abi: abi$l,
15430
15046
  bytecode: bytecode$l,
15431
15047
  deployedBytecode: deployedBytecode$l,
15432
15048
  linkReferences: linkReferences$l,
15433
15049
  deployedLinkReferences: deployedLinkReferences$l
15434
15050
  };
15435
15051
 
15436
- var _format$l = "hh-sol-artifact-1";
15437
- var contractName$l = "WithdrawalVault";
15438
- var sourceName$l = "contracts/liqEth/withdrawalVault.sol";
15439
- var abi$l = [
15052
+ var _format$k = "hh-sol-artifact-1";
15053
+ var contractName$k = "WithdrawalVault";
15054
+ var sourceName$k = "contracts/liqEth/withdrawalVault.sol";
15055
+ var abi$k = [
15440
15056
  {
15441
15057
  inputs: [
15442
15058
  {
@@ -15898,20 +15514,20 @@ var linkReferences$k = {
15898
15514
  var deployedLinkReferences$k = {
15899
15515
  };
15900
15516
  var WithdrawalVaultArtifact = {
15901
- _format: _format$l,
15902
- contractName: contractName$l,
15903
- sourceName: sourceName$l,
15904
- abi: abi$l,
15517
+ _format: _format$k,
15518
+ contractName: contractName$k,
15519
+ sourceName: sourceName$k,
15520
+ abi: abi$k,
15905
15521
  bytecode: bytecode$k,
15906
15522
  deployedBytecode: deployedBytecode$k,
15907
15523
  linkReferences: linkReferences$k,
15908
15524
  deployedLinkReferences: deployedLinkReferences$k
15909
15525
  };
15910
15526
 
15911
- var _format$k = "hh-sol-artifact-1";
15912
- var contractName$k = "BeaconState";
15913
- var sourceName$k = "contracts/liqEth/BeaconState.sol";
15914
- var abi$k = [
15527
+ var _format$j = "hh-sol-artifact-1";
15528
+ var contractName$j = "BeaconState";
15529
+ var sourceName$j = "contracts/liqEth/BeaconState.sol";
15530
+ var abi$j = [
15915
15531
  {
15916
15532
  inputs: [
15917
15533
  {
@@ -16734,20 +16350,20 @@ var linkReferences$j = {
16734
16350
  var deployedLinkReferences$j = {
16735
16351
  };
16736
16352
  var BeaconStateArtifact = {
16737
- _format: _format$k,
16738
- contractName: contractName$k,
16739
- sourceName: sourceName$k,
16740
- abi: abi$k,
16353
+ _format: _format$j,
16354
+ contractName: contractName$j,
16355
+ sourceName: sourceName$j,
16356
+ abi: abi$j,
16741
16357
  bytecode: bytecode$j,
16742
16358
  deployedBytecode: deployedBytecode$j,
16743
16359
  linkReferences: linkReferences$j,
16744
16360
  deployedLinkReferences: deployedLinkReferences$j
16745
16361
  };
16746
16362
 
16747
- var _format$j = "hh-sol-artifact-1";
16748
- var contractName$j = "YieldOracle";
16749
- var sourceName$j = "contracts/liqEth/Yield.sol";
16750
- var abi$j = [
16363
+ var _format$i = "hh-sol-artifact-1";
16364
+ var contractName$i = "YieldOracle";
16365
+ var sourceName$i = "contracts/liqEth/Yield.sol";
16366
+ var abi$i = [
16751
16367
  {
16752
16368
  inputs: [
16753
16369
  {
@@ -18164,20 +17780,20 @@ var deployedLinkReferences$i = {
18164
17780
  }
18165
17781
  };
18166
17782
  var YieldOracleArtifact = {
18167
- _format: _format$j,
18168
- contractName: contractName$j,
18169
- sourceName: sourceName$j,
18170
- abi: abi$j,
17783
+ _format: _format$i,
17784
+ contractName: contractName$i,
17785
+ sourceName: sourceName$i,
17786
+ abi: abi$i,
18171
17787
  bytecode: bytecode$i,
18172
17788
  deployedBytecode: deployedBytecode$i,
18173
17789
  linkReferences: linkReferences$i,
18174
17790
  deployedLinkReferences: deployedLinkReferences$i
18175
17791
  };
18176
17792
 
18177
- var _format$i = "hh-sol-artifact-1";
18178
- var contractName$i = "Depositor";
18179
- var sourceName$i = "contracts/outpost/Depositor.sol";
18180
- var abi$i = [
17793
+ var _format$h = "hh-sol-artifact-1";
17794
+ var contractName$h = "Depositor";
17795
+ var sourceName$h = "contracts/outpost/Depositor.sol";
17796
+ var abi$h = [
18181
17797
  {
18182
17798
  inputs: [
18183
17799
  {
@@ -19858,20 +19474,20 @@ var deployedLinkReferences$h = {
19858
19474
  }
19859
19475
  };
19860
19476
  var DepositorArtifact = {
19861
- _format: _format$i,
19862
- contractName: contractName$i,
19863
- sourceName: sourceName$i,
19864
- abi: abi$i,
19477
+ _format: _format$h,
19478
+ contractName: contractName$h,
19479
+ sourceName: sourceName$h,
19480
+ abi: abi$h,
19865
19481
  bytecode: bytecode$h,
19866
19482
  deployedBytecode: deployedBytecode$h,
19867
19483
  linkReferences: linkReferences$h,
19868
19484
  deployedLinkReferences: deployedLinkReferences$h
19869
19485
  };
19870
19486
 
19871
- var _format$h = "hh-sol-artifact-1";
19872
- var contractName$h = "ReceiptNFT";
19873
- var sourceName$h = "contracts/outpost/ReceiptNFT.sol";
19874
- var abi$h = [
19487
+ var _format$g = "hh-sol-artifact-1";
19488
+ var contractName$g = "ReceiptNFT";
19489
+ var sourceName$g = "contracts/outpost/ReceiptNFT.sol";
19490
+ var abi$g = [
19875
19491
  {
19876
19492
  inputs: [
19877
19493
  {
@@ -21908,20 +21524,20 @@ var linkReferences$g = {
21908
21524
  var deployedLinkReferences$g = {
21909
21525
  };
21910
21526
  var ReceiptNFTArtifact = {
21911
- _format: _format$h,
21912
- contractName: contractName$h,
21913
- sourceName: sourceName$h,
21914
- abi: abi$h,
21527
+ _format: _format$g,
21528
+ contractName: contractName$g,
21529
+ sourceName: sourceName$g,
21530
+ abi: abi$g,
21915
21531
  bytecode: bytecode$g,
21916
21532
  deployedBytecode: deployedBytecode$g,
21917
21533
  linkReferences: linkReferences$g,
21918
21534
  deployedLinkReferences: deployedLinkReferences$g
21919
21535
  };
21920
21536
 
21921
- var _format$g = "hh-sol-artifact-1";
21922
- var contractName$g = "OutpostManager";
21923
- var sourceName$g = "contracts/outpost/OutpostManager.sol";
21924
- var abi$g = [
21537
+ var _format$f = "hh-sol-artifact-1";
21538
+ var contractName$f = "OutpostManager";
21539
+ var sourceName$f = "contracts/outpost/OutpostManager.sol";
21540
+ var abi$f = [
21925
21541
  {
21926
21542
  inputs: [
21927
21543
  {
@@ -22683,20 +22299,20 @@ var linkReferences$f = {
22683
22299
  var deployedLinkReferences$f = {
22684
22300
  };
22685
22301
  var OutpostManagerArtifact = {
22686
- _format: _format$g,
22687
- contractName: contractName$g,
22688
- sourceName: sourceName$g,
22689
- abi: abi$g,
22302
+ _format: _format$f,
22303
+ contractName: contractName$f,
22304
+ sourceName: sourceName$f,
22305
+ abi: abi$f,
22690
22306
  bytecode: bytecode$f,
22691
22307
  deployedBytecode: deployedBytecode$f,
22692
22308
  linkReferences: linkReferences$f,
22693
22309
  deployedLinkReferences: deployedLinkReferences$f
22694
22310
  };
22695
22311
 
22696
- var _format$f = "hh-sol-artifact-1";
22697
- var contractName$f = "BAR";
22698
- var sourceName$f = "contracts/outpost/BAR.sol";
22699
- var abi$f = [
22312
+ var _format$e = "hh-sol-artifact-1";
22313
+ var contractName$e = "BAR";
22314
+ var sourceName$e = "contracts/outpost/BAR.sol";
22315
+ var abi$e = [
22700
22316
  {
22701
22317
  inputs: [
22702
22318
  {
@@ -24575,20 +24191,20 @@ var deployedLinkReferences$e = {
24575
24191
  }
24576
24192
  };
24577
24193
  var BARArtifact = {
24578
- _format: _format$f,
24579
- contractName: contractName$f,
24580
- sourceName: sourceName$f,
24581
- abi: abi$f,
24194
+ _format: _format$e,
24195
+ contractName: contractName$e,
24196
+ sourceName: sourceName$e,
24197
+ abi: abi$e,
24582
24198
  bytecode: bytecode$e,
24583
24199
  deployedBytecode: deployedBytecode$e,
24584
24200
  linkReferences: linkReferences$e,
24585
24201
  deployedLinkReferences: deployedLinkReferences$e
24586
24202
  };
24587
24203
 
24588
- var _format$e = "hh-sol-artifact-1";
24589
- var contractName$e = "OPP";
24590
- var sourceName$e = "contracts/outpost/OPP.sol";
24591
- var abi$e = [
24204
+ var _format$d = "hh-sol-artifact-1";
24205
+ var contractName$d = "OPP";
24206
+ var sourceName$d = "contracts/outpost/OPP.sol";
24207
+ var abi$d = [
24592
24208
  {
24593
24209
  inputs: [
24594
24210
  {
@@ -25564,20 +25180,20 @@ var deployedLinkReferences$d = {
25564
25180
  }
25565
25181
  };
25566
25182
  var OPPArtifact = {
25567
- _format: _format$e,
25568
- contractName: contractName$e,
25569
- sourceName: sourceName$e,
25570
- abi: abi$e,
25183
+ _format: _format$d,
25184
+ contractName: contractName$d,
25185
+ sourceName: sourceName$d,
25186
+ abi: abi$d,
25571
25187
  bytecode: bytecode$d,
25572
25188
  deployedBytecode: deployedBytecode$d,
25573
25189
  linkReferences: linkReferences$d,
25574
25190
  deployedLinkReferences: deployedLinkReferences$d
25575
25191
  };
25576
25192
 
25577
- var _format$d = "hh-sol-artifact-1";
25578
- var contractName$d = "OPPCommon";
25579
- var sourceName$d = "contracts/outpost/OPPCommon.sol";
25580
- var abi$d = [
25193
+ var _format$c = "hh-sol-artifact-1";
25194
+ var contractName$c = "OPPCommon";
25195
+ var sourceName$c = "contracts/outpost/OPPCommon.sol";
25196
+ var abi$c = [
25581
25197
  {
25582
25198
  inputs: [
25583
25199
  {
@@ -25772,20 +25388,20 @@ var deployedLinkReferences$c = {
25772
25388
  }
25773
25389
  };
25774
25390
  var OPPCommonArtifact = {
25775
- _format: _format$d,
25776
- contractName: contractName$d,
25777
- sourceName: sourceName$d,
25778
- abi: abi$d,
25391
+ _format: _format$c,
25392
+ contractName: contractName$c,
25393
+ sourceName: sourceName$c,
25394
+ abi: abi$c,
25779
25395
  bytecode: bytecode$c,
25780
25396
  deployedBytecode: deployedBytecode$c,
25781
25397
  linkReferences: linkReferences$c,
25782
25398
  deployedLinkReferences: deployedLinkReferences$c
25783
25399
  };
25784
25400
 
25785
- var _format$c = "hh-sol-artifact-1";
25786
- var contractName$c = "OPPInbound";
25787
- var sourceName$c = "contracts/outpost/OPPInbound.sol";
25788
- var abi$c = [
25401
+ var _format$b = "hh-sol-artifact-1";
25402
+ var contractName$b = "OPPInbound";
25403
+ var sourceName$b = "contracts/outpost/OPPInbound.sol";
25404
+ var abi$b = [
25789
25405
  {
25790
25406
  inputs: [
25791
25407
  {
@@ -26818,20 +26434,20 @@ var deployedLinkReferences$b = {
26818
26434
  }
26819
26435
  };
26820
26436
  var OPPInboundArtifact = {
26821
- _format: _format$c,
26822
- contractName: contractName$c,
26823
- sourceName: sourceName$c,
26824
- abi: abi$c,
26437
+ _format: _format$b,
26438
+ contractName: contractName$b,
26439
+ sourceName: sourceName$b,
26440
+ abi: abi$b,
26825
26441
  bytecode: bytecode$b,
26826
26442
  deployedBytecode: deployedBytecode$b,
26827
26443
  linkReferences: linkReferences$b,
26828
26444
  deployedLinkReferences: deployedLinkReferences$b
26829
26445
  };
26830
26446
 
26831
- var _format$b = "hh-sol-artifact-1";
26832
- var contractName$b = "Pretoken";
26833
- var sourceName$b = "contracts/outpost/Pretoken.sol";
26834
- var abi$b = [
26447
+ var _format$a = "hh-sol-artifact-1";
26448
+ var contractName$a = "Pretoken";
26449
+ var sourceName$a = "contracts/outpost/Pretoken.sol";
26450
+ var abi$a = [
26835
26451
  {
26836
26452
  inputs: [
26837
26453
  {
@@ -28512,200 +28128,16 @@ var deployedLinkReferences$a = {
28512
28128
  }
28513
28129
  };
28514
28130
  var PretokenArtifact = {
28515
- _format: _format$b,
28516
- contractName: contractName$b,
28517
- sourceName: sourceName$b,
28518
- abi: abi$b,
28131
+ _format: _format$a,
28132
+ contractName: contractName$a,
28133
+ sourceName: sourceName$a,
28134
+ abi: abi$a,
28519
28135
  bytecode: bytecode$a,
28520
28136
  deployedBytecode: deployedBytecode$a,
28521
28137
  linkReferences: linkReferences$a,
28522
28138
  deployedLinkReferences: deployedLinkReferences$a
28523
28139
  };
28524
28140
 
28525
- var _format$a = "hh-sol-artifact-1";
28526
- var contractName$a = "Aggregator";
28527
- var sourceName$a = "contracts/outpost/Aggregator.sol";
28528
- var abi$a = [
28529
- {
28530
- inputs: [
28531
- {
28532
- internalType: "address",
28533
- name: "_authority",
28534
- type: "address"
28535
- },
28536
- {
28537
- internalType: "int256",
28538
- name: "initialPrice",
28539
- type: "int256"
28540
- },
28541
- {
28542
- internalType: "uint8",
28543
- name: "__decimals",
28544
- type: "uint8"
28545
- }
28546
- ],
28547
- name: "initialize",
28548
- outputs: [
28549
- ],
28550
- stateMutability: "nonpayable",
28551
- type: "function"
28552
- },
28553
- {
28554
- inputs: [
28555
- ],
28556
- name: "decimals",
28557
- outputs: [
28558
- {
28559
- internalType: "uint8",
28560
- name: "",
28561
- type: "uint8"
28562
- }
28563
- ],
28564
- stateMutability: "view",
28565
- type: "function"
28566
- },
28567
- {
28568
- inputs: [
28569
- ],
28570
- name: "description",
28571
- outputs: [
28572
- {
28573
- internalType: "string",
28574
- name: "",
28575
- type: "string"
28576
- }
28577
- ],
28578
- stateMutability: "pure",
28579
- type: "function"
28580
- },
28581
- {
28582
- inputs: [
28583
- ],
28584
- name: "version",
28585
- outputs: [
28586
- {
28587
- internalType: "uint256",
28588
- name: "",
28589
- type: "uint256"
28590
- }
28591
- ],
28592
- stateMutability: "pure",
28593
- type: "function"
28594
- },
28595
- {
28596
- inputs: [
28597
- {
28598
- internalType: "uint80",
28599
- name: "",
28600
- type: "uint80"
28601
- }
28602
- ],
28603
- name: "getRoundData",
28604
- outputs: [
28605
- {
28606
- internalType: "uint80",
28607
- name: "roundId",
28608
- type: "uint80"
28609
- },
28610
- {
28611
- internalType: "int256",
28612
- name: "answer",
28613
- type: "int256"
28614
- },
28615
- {
28616
- internalType: "uint256",
28617
- name: "startedAt",
28618
- type: "uint256"
28619
- },
28620
- {
28621
- internalType: "uint256",
28622
- name: "updatedAt",
28623
- type: "uint256"
28624
- },
28625
- {
28626
- internalType: "uint80",
28627
- name: "answeredInRound",
28628
- type: "uint80"
28629
- }
28630
- ],
28631
- stateMutability: "view",
28632
- type: "function"
28633
- },
28634
- {
28635
- inputs: [
28636
- ],
28637
- name: "latestRoundData",
28638
- outputs: [
28639
- {
28640
- internalType: "uint80",
28641
- name: "roundId",
28642
- type: "uint80"
28643
- },
28644
- {
28645
- internalType: "int256",
28646
- name: "answer",
28647
- type: "int256"
28648
- },
28649
- {
28650
- internalType: "uint256",
28651
- name: "startedAt",
28652
- type: "uint256"
28653
- },
28654
- {
28655
- internalType: "uint256",
28656
- name: "updatedAt",
28657
- type: "uint256"
28658
- },
28659
- {
28660
- internalType: "uint80",
28661
- name: "answeredInRound",
28662
- type: "uint80"
28663
- }
28664
- ],
28665
- stateMutability: "view",
28666
- type: "function"
28667
- },
28668
- {
28669
- inputs: [
28670
- {
28671
- internalType: "int256",
28672
- name: "newPrice",
28673
- type: "int256"
28674
- }
28675
- ],
28676
- name: "updateAnswer",
28677
- outputs: [
28678
- ],
28679
- stateMutability: "nonpayable",
28680
- type: "function"
28681
- },
28682
- {
28683
- inputs: [
28684
- {
28685
- internalType: "int256",
28686
- name: "newPrice",
28687
- type: "int256"
28688
- },
28689
- {
28690
- internalType: "uint256",
28691
- name: "oldTimestamp",
28692
- type: "uint256"
28693
- }
28694
- ],
28695
- name: "updateStale",
28696
- outputs: [
28697
- ],
28698
- stateMutability: "nonpayable",
28699
- type: "function"
28700
- }
28701
- ];
28702
- var AggregatorArtifact = {
28703
- _format: _format$a,
28704
- contractName: contractName$a,
28705
- sourceName: sourceName$a,
28706
- abi: abi$a
28707
- };
28708
-
28709
28141
  var _format$9 = "hh-sol-artifact-1";
28710
28142
  var contractName$9 = "EthUsdPriceConsumer";
28711
28143
  var sourceName$9 = "contracts/outpost/EthUsdPriceConsumer.sol";
@@ -35140,31 +34572,30 @@ const ERC20Abi = ERC20Artifact.abi;
35140
34572
  const ERC721Abi = ERC721Artifact.abi;
35141
34573
  const ERC1155Abi = ERC1155Artifact.abi;
35142
34574
  const ADDRESSES = {
35143
- LiqEthAuthority: "0x3Eb66Bb91F7a022FbABc1619Cb6acce7025Bc41F",
35144
- BeaconState: "0x08F879c6D0964E0A17bF688Af23168f654DF372e",
35145
- WithdrawalQueue: "0x74aDeD940369baDDb0F36426F23B08499e45Fe18",
35146
- LiqEthToken: "0x8C974517D038e2e3b8a1da7b1A026bC8132A4b2e",
35147
- Accounting: "0x766CE996B8132b927988c5b2ECAE8108fB1a9307",
35148
- DepositManager: "0xEd391dB5DB11B5eDBE08e69A51D16e84293C09a3",
35149
- WithdrawalVault: "0xbaBc0D5997283ab9886696A0dEaB8A8093436b48",
35150
- StakingModule: "0x4998fBb6Ca5Ee3Db6c339e2962A34791Af643fEa",
35151
- YieldOracle: "0x61Fe311C57dd9a38Fb7B0c5A8ec521452dB25378",
35152
- OutpostManagerAuthority: "0x3B8705Ba1195AF632b3bd9E46F19348BC828FA3D",
35153
- iodata: "0x4aCABbC74a1cA9B0058d9ADAa0E00Af0f4f73212",
35154
- Base58: "0x1241F36ff30065deD52d51f0d6524EF971259A12",
35155
- sysio_merkle: "0x58ca9b5515266Fd6bF94D5F1268C505b2eC9679c",
35156
- ReceiptNFT: "0x03d6bD46cA9F54B8F8bbA21CfAfe717b36cB8593",
35157
- EthUsdPriceConsumer: "0xdC2DD993A13b3DD6D255B52285625694bd967c9A",
35158
- Pool: "0xd4742757AA61B1Fd3Fcd87980D7D460B12Cd9275",
35159
- OutpostManager: "0x38ec2B56cBCeCaFFe28b535517de1a102C3D74E3",
35160
- sysio_write: "0x0Ec4C1BaB772958aa3Db27459643bfbE7d92E305",
35161
- Pretoken: "0x8c97a51A71640fa411DEfab8feC3401eFfd1a2E4",
35162
- BAR: "0xbAFac13ffd3Aa9aEabaaeb6e4C2cF3dFf3479DC0",
35163
- OPPCommon: "0x12283a6d4E6cE4A0e8AdB319Fc161c7F4f91EA8F",
35164
- OPP: "0x87CE3Fe2CDca39C04aa2c14bbF1E1d9DB6358C4A",
35165
- Depositor: "0x5351B30EA4b75bD9be9Fc0048e88F675f7b3Ac2b",
35166
- OPPInbound: "0x0B1f7FB1c7f01A9cf490a1387E1E100F2bEA6C6d",
35167
- MockAggregator: "0xFCfc3ddd4CBd9Ad3b3af3A374B8bdA1b66eE6FFF"
34575
+ LiqEthAuthority: "0xB8fb7dBA2de501c94EAB723fa48679f698a39Aa4",
34576
+ BeaconState: "0x29719E8e76C52F5fD4888DF401579859c305f2DF",
34577
+ WithdrawalQueue: "0xce388339bFDAed9cAF536ea7b4F42123b4D755d4",
34578
+ LiqEthToken: "0x2C0e75e930Fc72ceD0725854C5E7A55566333F3f",
34579
+ Accounting: "0xE31C44d04c7B055afAC9301F55840f030eaF04BC",
34580
+ DepositManager: "0x21b339ED55A0f037f91B88044C808CcfCCBbF9A8",
34581
+ WithdrawalVault: "0x028743bE7E727aA331A1e952575cb00623B95fE2",
34582
+ StakingModule: "0xDe9754Fb58CcD4D74e94DA5682192E4e6eC334b0",
34583
+ YieldOracle: "0x7B7B8894e75b44B6cA7Dc8bE6dED5059621907b2",
34584
+ OutpostManagerAuthority: "0xeaE32b94c0F858b3600861aAE4Caeee6B6341751",
34585
+ iodata: "0x485Ed153c45189d623Bb37816eD3016A56552273",
34586
+ Base58: "0x8bB3856EC1114B1cE45a78620CF174D90a1Fd4e7",
34587
+ sysio_merkle: "0x5180a926D71c6d94c5c939Fe7Fed14cD7dcAa541",
34588
+ ReceiptNFT: "0x651De616A20b17De1095f9A0694A0e0E68025b78",
34589
+ EthUsdPriceConsumer: "0x2d866f8DB6F6c94997b0027Ba24bc64a03627ddc",
34590
+ Pool: "0xDA268Adcb90c422C2102A5f713182A42A8b9EA0D",
34591
+ OutpostManager: "0x9f279804Cb8539c53709AA37a4C1b30A52A85175",
34592
+ sysio_write: "0x3F8c880efd2c8C3aA1f0CE40b886cc6913eEC1d3",
34593
+ Pretoken: "0xCabF19Fdb7cD063738dd63a418702Ee3642FFc68",
34594
+ BAR: "0x2D8f4D4435509d7b8F93C3Ba93D45447C892f7ED",
34595
+ OPPCommon: "0x1716EEC9f1E0c1aF7BbbA8Fed10652138914f766",
34596
+ OPP: "0x5e1135cF8987268a3e7F68551558Ae92c454429f",
34597
+ Depositor: "0xf4b4ccfD684feB46504D77232FBde23b23d4F774",
34598
+ OPPInbound: "0x088484d45fF93AFabC63810FB0b335792E2B24f3"
35168
34599
  };
35169
34600
  const CONTRACTS = {
35170
34601
  LiqEthAuthority: {
@@ -35223,10 +34654,6 @@ const CONTRACTS = {
35223
34654
  address: ADDRESSES.ReceiptNFT,
35224
34655
  abi: ReceiptNFTArtifact.abi
35225
34656
  },
35226
- MockAggregator: {
35227
- address: ADDRESSES.MockAggregator,
35228
- abi: AggregatorArtifact.abi
35229
- },
35230
34657
  Pool: {
35231
34658
  address: ADDRESSES.Pool,
35232
34659
  abi: PoolArtifact.abi
@@ -36408,10 +35835,6 @@ class EthereumStakingClient {
36408
35835
  return __async(this, null, function* () {
36409
35836
  this.ensureUser();
36410
35837
  const buyer = yield this.signer.getAddress();
36411
- const network = yield this.provider.getNetwork();
36412
- const chainId = network.chainId;
36413
- const allowedTestChains = new Set([560048]);
36414
- if (allowedTestChains.has(chainId)) yield this.updateMockAggregatorPrice();
36415
35838
  let result = yield this.pretokenClient.purchasePretokensWithLiqETH(amount, buyer);
36416
35839
  return result && result.txHash ? result.txHash : "Error - no resulting txHash";
36417
35840
  });
@@ -36542,7 +35965,7 @@ class EthereumStakingClient {
36542
35965
  getTrancheSnapshot(options) {
36543
35966
  return __async(this, null, function* () {
36544
35967
  const {
36545
- chainID = core.EvmChainID.Hoodi,
35968
+ chainID = core.EvmChainID.Ethereum,
36546
35969
  windowBefore,
36547
35970
  windowAfter
36548
35971
  } = options != null ? options : {};
@@ -36563,10 +35986,8 @@ class EthereumStakingClient {
36563
35986
  ]);
36564
35987
  const totalTrancheSupply = BigInt(totalSupplyBn.toString()) / BigInt(1e10);
36565
35988
  const currentTrancheSupply = BigInt(trancheSupplyBn.toString()) / BigInt(1e10);
36566
- const [roundId, answer, startedAt, updatedAt, answeredInRound] = yield this.contract.MockAggregator.latestRoundData();
36567
35989
  let ethPriceUsdBn = yield this.contract.EthUsdPriceConsumer.getPrice18Decimals();
36568
35990
  let ethPriceUsd = BigInt(ethPriceUsdBn.toString()) / BigInt(1e10);
36569
- let nativePriceTimestamp = Number(updatedAt);
36570
35991
  const initialTrancheSupply = BigInt(INITIAL_TRANCHE_SUPPLY) * BigInt(1e8);
36571
35992
  return buildEthereumTrancheSnapshot({
36572
35993
  chainID,
@@ -36582,7 +36003,6 @@ class EthereumStakingClient {
36582
36003
  minPriceUsd,
36583
36004
  maxPriceUsd,
36584
36005
  ethPriceUsd,
36585
- nativePriceTimestamp,
36586
36006
  ladderWindowBefore: windowBefore,
36587
36007
  ladderWindowAfter: windowAfter
36588
36008
  });
@@ -36619,36 +36039,6 @@ class EthereumStakingClient {
36619
36039
  return bufferWei;
36620
36040
  });
36621
36041
  }
36622
- updateMockAggregatorPrice() {
36623
- return __async(this, null, function* () {
36624
- const aggregator = this.contract.MockAggregator;
36625
- const [roundId, answer, startedAt, updatedAt, answeredInRound] = yield aggregator.latestRoundData();
36626
- const now = (yield this.provider.getBlock("latest")).timestamp;
36627
- const ageSec = Number(now) - Number(updatedAt);
36628
- const ONE_HOUR = 1 * 3600;
36629
- if (ageSec > ONE_HOUR) {
36630
- const network = yield this.provider.getNetwork();
36631
- const chainId = network.chainId;
36632
- const allowedTestChains = new Set([560048]);
36633
- if (!allowedTestChains.has(chainId)) {
36634
- console.warn(`MockAggregator is stale (${ageSec}s) but chainId ${chainId} is not a test/local network \u2014 skipping update.`);
36635
- return;
36636
- }
36637
- const res = yield fetch("https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd");
36638
- const data = yield res.json();
36639
- const ethUsd = data.ethereum.usd;
36640
- const currentEthPrice = ethers.ethers.utils.parseUnits(ethUsd.toString(), 8);
36641
- try {
36642
- const tx = yield aggregator.updateAnswer(currentEthPrice);
36643
- const txreceipt = yield tx.wait(1);
36644
- } catch (err) {
36645
- console.error("MockAggregator updateAnswer failed", (err == null ? void 0 : err.message) || err);
36646
- }
36647
- } else {
36648
- console.log(`MockAggregator updated ${ageSec}s ago \u2014 no update needed`);
36649
- }
36650
- });
36651
- }
36652
36042
  }
36653
36043
 
36654
36044
  class Staker {
@@ -36658,12 +36048,10 @@ class Staker {
36658
36048
  if (!Array.isArray(config)) config = [config];
36659
36049
  config.forEach((cfg) => {
36660
36050
  switch (cfg.network.chainId) {
36661
- case core.SolChainID.Devnet:
36662
- case core.SolChainID.WireTestnet:
36051
+ case core.SolChainID.Mainnet:
36663
36052
  this.clients.set(cfg.network.chainId, new SolanaStakingClient(cfg));
36664
36053
  break;
36665
36054
  case core.EvmChainID.Ethereum:
36666
- case core.EvmChainID.Hoodi:
36667
36055
  this.clients.set(cfg.network.chainId, new EthereumStakingClient(cfg));
36668
36056
  break;
36669
36057
  default:
@@ -36703,7 +36091,6 @@ const CONTRACT_NAMES = [
36703
36091
  "Base58",
36704
36092
  "sysio_merkle",
36705
36093
  "ReceiptNFT",
36706
- "MockAggregator",
36707
36094
  "Pool",
36708
36095
  "OutpostManager",
36709
36096
  "sysio_write",