@ignitionfi/fogo-stake-pool 1.0.0

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.
@@ -0,0 +1,381 @@
1
+ import * as BufferLayout from '@solana/buffer-layout';
2
+ import { PublicKey, TransactionInstruction } from '@solana/web3.js';
3
+ import { InstructionType } from './utils';
4
+ /**
5
+ * An enumeration of valid StakePoolInstructionType's
6
+ */
7
+ export type StakePoolInstructionType = 'IncreaseValidatorStake' | 'DecreaseValidatorStake' | 'UpdateValidatorListBalance' | 'UpdateStakePoolBalance' | 'CleanupRemovedValidatorEntries' | 'DepositStake' | 'DepositSol' | 'WithdrawStake' | 'WithdrawSol' | 'IncreaseAdditionalValidatorStake' | 'DecreaseAdditionalValidatorStake' | 'DecreaseValidatorStakeWithReserve' | 'Redelegate' | 'AddValidatorToPool' | 'RemoveValidatorFromPool' | 'DepositWsolWithSession' | 'WithdrawWsolWithSession' | 'WithdrawStakeWithSession' | 'WithdrawFromStakeAccountWithSession';
8
+ export declare function tokenMetadataLayout(instruction: number, nameLength: number, symbolLength: number, uriLength: number): {
9
+ index: number;
10
+ layout: BufferLayout.Structure<any>;
11
+ };
12
+ /**
13
+ * An enumeration of valid stake InstructionType's
14
+ * @internal
15
+ */
16
+ export declare const STAKE_POOL_INSTRUCTION_LAYOUTS: {
17
+ [type in StakePoolInstructionType]: InstructionType;
18
+ };
19
+ /**
20
+ * Cleans up validator stake account entries marked as `ReadyForRemoval`
21
+ */
22
+ export type CleanupRemovedValidatorEntriesParams = {
23
+ programId?: PublicKey | undefined;
24
+ stakePool: PublicKey;
25
+ validatorList: PublicKey;
26
+ };
27
+ /**
28
+ * Updates balances of validator and transient stake accounts in the pool.
29
+ */
30
+ export type UpdateValidatorListBalanceParams = {
31
+ programId?: PublicKey | undefined;
32
+ stakePool: PublicKey;
33
+ withdrawAuthority: PublicKey;
34
+ validatorList: PublicKey;
35
+ reserveStake: PublicKey;
36
+ validatorAndTransientStakePairs: PublicKey[];
37
+ startIndex: number;
38
+ noMerge: boolean;
39
+ };
40
+ /**
41
+ * Updates total pool balance based on balances in the reserve and validator list.
42
+ */
43
+ export type UpdateStakePoolBalanceParams = {
44
+ programId?: PublicKey | undefined;
45
+ stakePool: PublicKey;
46
+ withdrawAuthority: PublicKey;
47
+ validatorList: PublicKey;
48
+ reserveStake: PublicKey;
49
+ managerFeeAccount: PublicKey;
50
+ poolMint: PublicKey;
51
+ };
52
+ /**
53
+ * (Staker only) Decrease active stake on a validator, eventually moving it to the reserve
54
+ */
55
+ export type DecreaseValidatorStakeParams = {
56
+ programId?: PublicKey | undefined;
57
+ stakePool: PublicKey;
58
+ staker: PublicKey;
59
+ withdrawAuthority: PublicKey;
60
+ validatorList: PublicKey;
61
+ validatorStake: PublicKey;
62
+ transientStake: PublicKey;
63
+ lamports: number;
64
+ transientStakeSeed: number;
65
+ };
66
+ export interface DecreaseValidatorStakeWithReserveParams extends DecreaseValidatorStakeParams {
67
+ reserveStake: PublicKey;
68
+ }
69
+ export interface DecreaseAdditionalValidatorStakeParams extends DecreaseValidatorStakeParams {
70
+ reserveStake: PublicKey;
71
+ ephemeralStake: PublicKey;
72
+ ephemeralStakeSeed: number;
73
+ }
74
+ /**
75
+ * (Staker only) Increase stake on a validator from the reserve account.
76
+ */
77
+ export type IncreaseValidatorStakeParams = {
78
+ programId?: PublicKey | undefined;
79
+ stakePool: PublicKey;
80
+ staker: PublicKey;
81
+ withdrawAuthority: PublicKey;
82
+ validatorList: PublicKey;
83
+ reserveStake: PublicKey;
84
+ transientStake: PublicKey;
85
+ validatorStake: PublicKey;
86
+ validatorVote: PublicKey;
87
+ lamports: number;
88
+ transientStakeSeed: number;
89
+ };
90
+ export interface IncreaseAdditionalValidatorStakeParams extends IncreaseValidatorStakeParams {
91
+ ephemeralStake: PublicKey;
92
+ ephemeralStakeSeed: number;
93
+ }
94
+ /**
95
+ * Deposits a stake account into the pool in exchange for pool tokens
96
+ */
97
+ export type DepositStakeParams = {
98
+ programId?: PublicKey | undefined;
99
+ stakePool: PublicKey;
100
+ validatorList: PublicKey;
101
+ depositAuthority: PublicKey;
102
+ withdrawAuthority: PublicKey;
103
+ depositStake: PublicKey;
104
+ validatorStake: PublicKey;
105
+ reserveStake: PublicKey;
106
+ destinationPoolAccount: PublicKey;
107
+ managerFeeAccount: PublicKey;
108
+ referralPoolAccount: PublicKey;
109
+ poolMint: PublicKey;
110
+ };
111
+ /**
112
+ * Withdraws a stake account from the pool in exchange for pool tokens
113
+ */
114
+ export type WithdrawStakeParams = {
115
+ programId?: PublicKey | undefined;
116
+ stakePool: PublicKey;
117
+ validatorList: PublicKey;
118
+ withdrawAuthority: PublicKey;
119
+ validatorStake: PublicKey;
120
+ destinationStake: PublicKey;
121
+ destinationStakeAuthority: PublicKey;
122
+ sourceTransferAuthority: PublicKey;
123
+ sourcePoolAccount: PublicKey;
124
+ managerFeeAccount: PublicKey;
125
+ poolMint: PublicKey;
126
+ poolTokens: number;
127
+ };
128
+ /**
129
+ * Withdraw sol instruction params
130
+ */
131
+ export type WithdrawSolParams = {
132
+ programId?: PublicKey | undefined;
133
+ stakePool: PublicKey;
134
+ sourcePoolAccount: PublicKey;
135
+ withdrawAuthority: PublicKey;
136
+ reserveStake: PublicKey;
137
+ destinationSystemAccount: PublicKey;
138
+ sourceTransferAuthority: PublicKey;
139
+ solWithdrawAuthority?: PublicKey | undefined;
140
+ managerFeeAccount: PublicKey;
141
+ poolMint: PublicKey;
142
+ poolTokens: number;
143
+ };
144
+ /**
145
+ * Withdraw WSOL with session instruction params
146
+ */
147
+ export type WithdrawWsolWithSessionParams = {
148
+ programId: PublicKey;
149
+ stakePool: PublicKey;
150
+ withdrawAuthority: PublicKey;
151
+ userTransferAuthority: PublicKey;
152
+ poolTokensFrom: PublicKey;
153
+ reserveStake: PublicKey;
154
+ userWsolAccount: PublicKey;
155
+ managerFeeAccount: PublicKey;
156
+ poolMint: PublicKey;
157
+ tokenProgramId: PublicKey;
158
+ wsolMint: PublicKey;
159
+ programSigner: PublicKey;
160
+ userWallet: PublicKey;
161
+ poolTokensIn: number;
162
+ minimumLamportsOut: number;
163
+ solWithdrawAuthority?: PublicKey;
164
+ };
165
+ export type WithdrawStakeWithSessionParams = {
166
+ programId: PublicKey;
167
+ stakePool: PublicKey;
168
+ validatorList: PublicKey;
169
+ withdrawAuthority: PublicKey;
170
+ stakeToSplit: PublicKey;
171
+ /** The stake account PDA that will receive the withdrawn stake (derived from user wallet + seed) */
172
+ stakeToReceive: PublicKey;
173
+ /** The session signer (user or session) - used as both stake authority and transfer authority */
174
+ sessionSigner: PublicKey;
175
+ burnFromPool: PublicKey;
176
+ managerFeeAccount: PublicKey;
177
+ poolMint: PublicKey;
178
+ tokenProgramId: PublicKey;
179
+ /** The program signer PDA derived from PROGRAM_SIGNER_SEED */
180
+ programSigner: PublicKey;
181
+ /** The payer for stake account rent (typically the paymaster) */
182
+ payer: PublicKey;
183
+ poolTokensIn: number;
184
+ minimumLamportsOut: number;
185
+ /** Seed used to derive the user stake PDA */
186
+ userStakeSeed: number;
187
+ };
188
+ export type WithdrawFromStakeAccountWithSessionParams = {
189
+ programId: PublicKey;
190
+ /** The user stake account PDA to withdraw from */
191
+ userStakeAccount: PublicKey;
192
+ /** The user's wallet to receive the withdrawn SOL */
193
+ userWallet: PublicKey;
194
+ /** The session signer (user or session) */
195
+ sessionSigner: PublicKey;
196
+ /** Seed used to derive the user stake PDA */
197
+ userStakeSeed: number;
198
+ /** Lamports to withdraw (use Number.MAX_SAFE_INTEGER for full withdrawal) */
199
+ lamports: number;
200
+ };
201
+ /**
202
+ * Deposit SOL directly into the pool's reserve account. The output is a "pool" token
203
+ * representing ownership into the pool. Inputs are converted to the current ratio.
204
+ */
205
+ export type DepositSolParams = {
206
+ programId?: PublicKey | undefined;
207
+ stakePool: PublicKey;
208
+ depositAuthority?: PublicKey | undefined;
209
+ withdrawAuthority: PublicKey;
210
+ reserveStake: PublicKey;
211
+ fundingAccount: PublicKey;
212
+ destinationPoolAccount: PublicKey;
213
+ managerFeeAccount: PublicKey;
214
+ referralPoolAccount: PublicKey;
215
+ poolMint: PublicKey;
216
+ lamports: number;
217
+ };
218
+ export type CreateTokenMetadataParams = {
219
+ programId?: PublicKey | undefined;
220
+ stakePool: PublicKey;
221
+ manager: PublicKey;
222
+ tokenMetadata: PublicKey;
223
+ withdrawAuthority: PublicKey;
224
+ poolMint: PublicKey;
225
+ payer: PublicKey;
226
+ name: string;
227
+ symbol: string;
228
+ uri: string;
229
+ };
230
+ export type UpdateTokenMetadataParams = {
231
+ programId?: PublicKey | undefined;
232
+ stakePool: PublicKey;
233
+ manager: PublicKey;
234
+ tokenMetadata: PublicKey;
235
+ withdrawAuthority: PublicKey;
236
+ name: string;
237
+ symbol: string;
238
+ uri: string;
239
+ };
240
+ export type AddValidatorToPoolParams = {
241
+ programId?: PublicKey | undefined;
242
+ stakePool: PublicKey;
243
+ staker: PublicKey;
244
+ reserveStake: PublicKey;
245
+ withdrawAuthority: PublicKey;
246
+ validatorList: PublicKey;
247
+ validatorStake: PublicKey;
248
+ validatorVote: PublicKey;
249
+ seed?: number;
250
+ };
251
+ export type RemoveValidatorFromPoolParams = {
252
+ programId?: PublicKey | undefined;
253
+ stakePool: PublicKey;
254
+ staker: PublicKey;
255
+ withdrawAuthority: PublicKey;
256
+ validatorList: PublicKey;
257
+ validatorStake: PublicKey;
258
+ transientStake: PublicKey;
259
+ };
260
+ /**
261
+ * Stake Pool Instruction class
262
+ */
263
+ export declare class StakePoolInstruction {
264
+ /**
265
+ * Creates instruction to add a validator into the stake pool.
266
+ */
267
+ static addValidatorToPool(params: AddValidatorToPoolParams): TransactionInstruction;
268
+ /**
269
+ * Creates instruction to remove a validator from the stake pool.
270
+ */
271
+ static removeValidatorFromPool(params: RemoveValidatorFromPoolParams): TransactionInstruction;
272
+ /**
273
+ * Creates instruction to update a set of validators in the stake pool.
274
+ */
275
+ static updateValidatorListBalance(params: UpdateValidatorListBalanceParams): TransactionInstruction;
276
+ /**
277
+ * Creates instruction to update the overall stake pool balance.
278
+ */
279
+ static updateStakePoolBalance(params: UpdateStakePoolBalanceParams): TransactionInstruction;
280
+ /**
281
+ * Creates instruction to cleanup removed validator entries.
282
+ */
283
+ static cleanupRemovedValidatorEntries(params: CleanupRemovedValidatorEntriesParams): TransactionInstruction;
284
+ /**
285
+ * Creates `IncreaseValidatorStake` instruction (rebalance from reserve account to
286
+ * transient account)
287
+ */
288
+ static increaseValidatorStake(params: IncreaseValidatorStakeParams): TransactionInstruction;
289
+ /**
290
+ * Creates `IncreaseAdditionalValidatorStake` instruction (rebalance from reserve account to
291
+ * transient account)
292
+ */
293
+ static increaseAdditionalValidatorStake(params: IncreaseAdditionalValidatorStakeParams): TransactionInstruction;
294
+ /**
295
+ * Creates `DecreaseValidatorStake` instruction (rebalance from validator account to
296
+ * transient account)
297
+ */
298
+ static decreaseValidatorStake(params: DecreaseValidatorStakeParams): TransactionInstruction;
299
+ /**
300
+ * Creates `DecreaseValidatorStakeWithReserve` instruction (rebalance from
301
+ * validator account to transient account)
302
+ */
303
+ static decreaseValidatorStakeWithReserve(params: DecreaseValidatorStakeWithReserveParams): TransactionInstruction;
304
+ /**
305
+ * Creates `DecreaseAdditionalValidatorStake` instruction (rebalance from
306
+ * validator account to transient account)
307
+ */
308
+ static decreaseAdditionalValidatorStake(params: DecreaseAdditionalValidatorStakeParams): TransactionInstruction;
309
+ /**
310
+ * Creates a transaction instruction to deposit a stake account into a stake pool.
311
+ */
312
+ static depositStake(params: DepositStakeParams): TransactionInstruction;
313
+ /**
314
+ * Creates a transaction instruction to deposit SOL into a stake pool.
315
+ */
316
+ static depositSol(params: DepositSolParams): TransactionInstruction;
317
+ /**
318
+ * Creates a transaction instruction to deposit WSOL into a stake pool.
319
+ */
320
+ static depositWsolWithSession(params: Omit<DepositSolParams, 'lamports'> & {
321
+ wsolMint: PublicKey;
322
+ wsolTokenAccount: PublicKey;
323
+ wsolTransientAccount: PublicKey;
324
+ programSigner: PublicKey;
325
+ tokenProgramId: PublicKey;
326
+ programId: PublicKey;
327
+ userWallet: PublicKey;
328
+ lamportsIn: number;
329
+ minimumPoolTokensOut: number;
330
+ payer?: PublicKey;
331
+ }): TransactionInstruction;
332
+ /**
333
+ * Creates a transaction instruction to withdraw active stake from a stake pool.
334
+ */
335
+ static withdrawStake(params: WithdrawStakeParams): TransactionInstruction;
336
+ /**
337
+ * Creates a transaction instruction to withdraw SOL from a stake pool.
338
+ */
339
+ static withdrawSol(params: WithdrawSolParams): TransactionInstruction;
340
+ /**
341
+ * Creates a transaction instruction to withdraw WSOL from a stake pool using a session.
342
+ * Rent for ATA creation (if needed) is paid from the withdrawal amount.
343
+ */
344
+ static withdrawWsolWithSession(params: WithdrawWsolWithSessionParams): TransactionInstruction;
345
+ /**
346
+ * Creates a transaction instruction to withdraw stake from a stake pool using a Fogo session.
347
+ * The stake account is created as a PDA and rent is paid by the payer (typically paymaster).
348
+ */
349
+ static withdrawStakeWithSession(params: WithdrawStakeWithSessionParams): TransactionInstruction;
350
+ /**
351
+ * Creates a transaction instruction to withdraw SOL from a deactivated user stake account using a Fogo session.
352
+ * The stake account must be fully deactivated (inactive).
353
+ */
354
+ static withdrawFromStakeAccountWithSession(params: WithdrawFromStakeAccountWithSessionParams): TransactionInstruction;
355
+ /**
356
+ * Creates an instruction to create metadata
357
+ * using the mpl token metadata program for the pool token
358
+ */
359
+ static createTokenMetadata(params: CreateTokenMetadataParams): TransactionInstruction;
360
+ /**
361
+ * Creates an instruction to update metadata
362
+ * in the mpl token metadata program account for the pool token
363
+ */
364
+ static updateTokenMetadata(params: UpdateTokenMetadataParams): TransactionInstruction;
365
+ /**
366
+ * Decode a deposit stake pool instruction and retrieve the instruction params.
367
+ */
368
+ static decodeDepositStake(instruction: TransactionInstruction): DepositStakeParams;
369
+ /**
370
+ * Decode a deposit sol instruction and retrieve the instruction params.
371
+ */
372
+ static decodeDepositSol(instruction: TransactionInstruction): DepositSolParams;
373
+ /**
374
+ * @internal
375
+ */
376
+ private static checkProgramId;
377
+ /**
378
+ * @internal
379
+ */
380
+ private static checkKeyLength;
381
+ }
@@ -0,0 +1,318 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import BN from 'bn.js';
3
+ import { Layout as LayoutCls } from 'buffer-layout';
4
+ import { Infer } from 'superstruct';
5
+ import { Layout } from './codecs';
6
+ export interface Fee {
7
+ denominator: BN;
8
+ numerator: BN;
9
+ }
10
+ export declare enum AccountType {
11
+ Uninitialized = 0,
12
+ StakePool = 1,
13
+ ValidatorList = 2
14
+ }
15
+ export declare const BigNumFromString: import("superstruct").Struct<BN, null>;
16
+ export declare const PublicKeyFromString: import("superstruct").Struct<PublicKey, null>;
17
+ export declare class FutureEpochLayout<T> extends LayoutCls<T | null> {
18
+ layout: Layout<T>;
19
+ discriminator: Layout<number>;
20
+ constructor(layout: Layout<T>, property?: string);
21
+ encode(src: T | null, b: Buffer, offset?: number): number;
22
+ decode(b: Buffer, offset?: number): T | null;
23
+ getSpan(b: Buffer, offset?: number): number;
24
+ }
25
+ export declare function futureEpoch<T>(layout: Layout<T>, property?: string): LayoutCls<T | null>;
26
+ export type StakeAccountType = Infer<typeof StakeAccountType>;
27
+ export declare const StakeAccountType: import("superstruct").Struct<"uninitialized" | "initialized" | "delegated" | "rewardsPool", {
28
+ uninitialized: "uninitialized";
29
+ initialized: "initialized";
30
+ delegated: "delegated";
31
+ rewardsPool: "rewardsPool";
32
+ }>;
33
+ export type StakeMeta = Infer<typeof StakeMeta>;
34
+ export declare const StakeMeta: import("superstruct").Struct<{
35
+ rentExemptReserve: BN;
36
+ authorized: {
37
+ staker: PublicKey;
38
+ withdrawer: PublicKey;
39
+ };
40
+ lockup: {
41
+ unixTimestamp: number;
42
+ epoch: number;
43
+ custodian: PublicKey;
44
+ };
45
+ }, {
46
+ rentExemptReserve: import("superstruct").Struct<BN, null>;
47
+ authorized: import("superstruct").Struct<{
48
+ staker: PublicKey;
49
+ withdrawer: PublicKey;
50
+ }, {
51
+ staker: import("superstruct").Struct<PublicKey, null>;
52
+ withdrawer: import("superstruct").Struct<PublicKey, null>;
53
+ }>;
54
+ lockup: import("superstruct").Struct<{
55
+ unixTimestamp: number;
56
+ epoch: number;
57
+ custodian: PublicKey;
58
+ }, {
59
+ unixTimestamp: import("superstruct").Struct<number, null>;
60
+ epoch: import("superstruct").Struct<number, null>;
61
+ custodian: import("superstruct").Struct<PublicKey, null>;
62
+ }>;
63
+ }>;
64
+ export type StakeAccountInfo = Infer<typeof StakeAccountInfo>;
65
+ export declare const StakeAccountInfo: import("superstruct").Struct<{
66
+ meta: {
67
+ rentExemptReserve: BN;
68
+ authorized: {
69
+ staker: PublicKey;
70
+ withdrawer: PublicKey;
71
+ };
72
+ lockup: {
73
+ unixTimestamp: number;
74
+ epoch: number;
75
+ custodian: PublicKey;
76
+ };
77
+ };
78
+ stake: {
79
+ delegation: {
80
+ stake: BN;
81
+ voter: PublicKey;
82
+ activationEpoch: BN;
83
+ deactivationEpoch: BN;
84
+ warmupCooldownRate: number;
85
+ };
86
+ creditsObserved: number;
87
+ } | null;
88
+ }, {
89
+ meta: import("superstruct").Struct<{
90
+ rentExemptReserve: BN;
91
+ authorized: {
92
+ staker: PublicKey;
93
+ withdrawer: PublicKey;
94
+ };
95
+ lockup: {
96
+ unixTimestamp: number;
97
+ epoch: number;
98
+ custodian: PublicKey;
99
+ };
100
+ }, {
101
+ rentExemptReserve: import("superstruct").Struct<BN, null>;
102
+ authorized: import("superstruct").Struct<{
103
+ staker: PublicKey;
104
+ withdrawer: PublicKey;
105
+ }, {
106
+ staker: import("superstruct").Struct<PublicKey, null>;
107
+ withdrawer: import("superstruct").Struct<PublicKey, null>;
108
+ }>;
109
+ lockup: import("superstruct").Struct<{
110
+ unixTimestamp: number;
111
+ epoch: number;
112
+ custodian: PublicKey;
113
+ }, {
114
+ unixTimestamp: import("superstruct").Struct<number, null>;
115
+ epoch: import("superstruct").Struct<number, null>;
116
+ custodian: import("superstruct").Struct<PublicKey, null>;
117
+ }>;
118
+ }>;
119
+ stake: import("superstruct").Struct<{
120
+ delegation: {
121
+ stake: BN;
122
+ voter: PublicKey;
123
+ activationEpoch: BN;
124
+ deactivationEpoch: BN;
125
+ warmupCooldownRate: number;
126
+ };
127
+ creditsObserved: number;
128
+ } | null, {
129
+ delegation: import("superstruct").Struct<{
130
+ stake: BN;
131
+ voter: PublicKey;
132
+ activationEpoch: BN;
133
+ deactivationEpoch: BN;
134
+ warmupCooldownRate: number;
135
+ }, {
136
+ voter: import("superstruct").Struct<PublicKey, null>;
137
+ stake: import("superstruct").Struct<BN, null>;
138
+ activationEpoch: import("superstruct").Struct<BN, null>;
139
+ deactivationEpoch: import("superstruct").Struct<BN, null>;
140
+ warmupCooldownRate: import("superstruct").Struct<number, null>;
141
+ }>;
142
+ creditsObserved: import("superstruct").Struct<number, null>;
143
+ }>;
144
+ }>;
145
+ export type StakeAccount = Infer<typeof StakeAccount>;
146
+ export declare const StakeAccount: import("superstruct").Struct<{
147
+ type: "uninitialized" | "initialized" | "delegated" | "rewardsPool";
148
+ info?: {
149
+ meta: {
150
+ rentExemptReserve: BN;
151
+ authorized: {
152
+ staker: PublicKey;
153
+ withdrawer: PublicKey;
154
+ };
155
+ lockup: {
156
+ unixTimestamp: number;
157
+ epoch: number;
158
+ custodian: PublicKey;
159
+ };
160
+ };
161
+ stake: {
162
+ delegation: {
163
+ stake: BN;
164
+ voter: PublicKey;
165
+ activationEpoch: BN;
166
+ deactivationEpoch: BN;
167
+ warmupCooldownRate: number;
168
+ };
169
+ creditsObserved: number;
170
+ } | null;
171
+ } | undefined;
172
+ }, {
173
+ type: import("superstruct").Struct<"uninitialized" | "initialized" | "delegated" | "rewardsPool", {
174
+ uninitialized: "uninitialized";
175
+ initialized: "initialized";
176
+ delegated: "delegated";
177
+ rewardsPool: "rewardsPool";
178
+ }>;
179
+ info: import("superstruct").Struct<{
180
+ meta: {
181
+ rentExemptReserve: BN;
182
+ authorized: {
183
+ staker: PublicKey;
184
+ withdrawer: PublicKey;
185
+ };
186
+ lockup: {
187
+ unixTimestamp: number;
188
+ epoch: number;
189
+ custodian: PublicKey;
190
+ };
191
+ };
192
+ stake: {
193
+ delegation: {
194
+ stake: BN;
195
+ voter: PublicKey;
196
+ activationEpoch: BN;
197
+ deactivationEpoch: BN;
198
+ warmupCooldownRate: number;
199
+ };
200
+ creditsObserved: number;
201
+ } | null;
202
+ } | undefined, {
203
+ meta: import("superstruct").Struct<{
204
+ rentExemptReserve: BN;
205
+ authorized: {
206
+ staker: PublicKey;
207
+ withdrawer: PublicKey;
208
+ };
209
+ lockup: {
210
+ unixTimestamp: number;
211
+ epoch: number;
212
+ custodian: PublicKey;
213
+ };
214
+ }, {
215
+ rentExemptReserve: import("superstruct").Struct<BN, null>;
216
+ authorized: import("superstruct").Struct<{
217
+ staker: PublicKey;
218
+ withdrawer: PublicKey;
219
+ }, {
220
+ staker: import("superstruct").Struct<PublicKey, null>;
221
+ withdrawer: import("superstruct").Struct<PublicKey, null>;
222
+ }>;
223
+ lockup: import("superstruct").Struct<{
224
+ unixTimestamp: number;
225
+ epoch: number;
226
+ custodian: PublicKey;
227
+ }, {
228
+ unixTimestamp: import("superstruct").Struct<number, null>;
229
+ epoch: import("superstruct").Struct<number, null>;
230
+ custodian: import("superstruct").Struct<PublicKey, null>;
231
+ }>;
232
+ }>;
233
+ stake: import("superstruct").Struct<{
234
+ delegation: {
235
+ stake: BN;
236
+ voter: PublicKey;
237
+ activationEpoch: BN;
238
+ deactivationEpoch: BN;
239
+ warmupCooldownRate: number;
240
+ };
241
+ creditsObserved: number;
242
+ } | null, {
243
+ delegation: import("superstruct").Struct<{
244
+ stake: BN;
245
+ voter: PublicKey;
246
+ activationEpoch: BN;
247
+ deactivationEpoch: BN;
248
+ warmupCooldownRate: number;
249
+ }, {
250
+ voter: import("superstruct").Struct<PublicKey, null>;
251
+ stake: import("superstruct").Struct<BN, null>;
252
+ activationEpoch: import("superstruct").Struct<BN, null>;
253
+ deactivationEpoch: import("superstruct").Struct<BN, null>;
254
+ warmupCooldownRate: import("superstruct").Struct<number, null>;
255
+ }>;
256
+ creditsObserved: import("superstruct").Struct<number, null>;
257
+ }>;
258
+ }>;
259
+ }>;
260
+ export interface Lockup {
261
+ unixTimestamp: BN;
262
+ epoch: BN;
263
+ custodian: PublicKey;
264
+ }
265
+ export interface StakePool {
266
+ accountType: AccountType;
267
+ manager: PublicKey;
268
+ staker: PublicKey;
269
+ stakeDepositAuthority: PublicKey;
270
+ stakeWithdrawBumpSeed: number;
271
+ validatorList: PublicKey;
272
+ reserveStake: PublicKey;
273
+ poolMint: PublicKey;
274
+ managerFeeAccount: PublicKey;
275
+ tokenProgramId: PublicKey;
276
+ totalLamports: BN;
277
+ poolTokenSupply: BN;
278
+ lastUpdateEpoch: BN;
279
+ lockup: Lockup;
280
+ epochFee: Fee;
281
+ nextEpochFee?: Fee | undefined;
282
+ preferredDepositValidatorVoteAddress?: PublicKey | undefined;
283
+ preferredWithdrawValidatorVoteAddress?: PublicKey | undefined;
284
+ stakeDepositFee: Fee;
285
+ stakeWithdrawalFee: Fee;
286
+ nextStakeWithdrawalFee?: Fee | undefined;
287
+ stakeReferralFee: number;
288
+ solDepositAuthority?: PublicKey | undefined;
289
+ solDepositFee: Fee;
290
+ solReferralFee: number;
291
+ solWithdrawAuthority?: PublicKey | undefined;
292
+ solWithdrawalFee: Fee;
293
+ nextSolWithdrawalFee?: Fee | undefined;
294
+ lastEpochPoolTokenSupply: BN;
295
+ lastEpochTotalLamports: BN;
296
+ }
297
+ export declare const StakePoolLayout: LayoutCls<StakePool>;
298
+ export declare enum ValidatorStakeInfoStatus {
299
+ Active = 0,
300
+ DeactivatingTransient = 1,
301
+ ReadyForRemoval = 2
302
+ }
303
+ export interface ValidatorStakeInfo {
304
+ status: ValidatorStakeInfoStatus;
305
+ voteAccountAddress: PublicKey;
306
+ activeStakeLamports: BN;
307
+ transientStakeLamports: BN;
308
+ transientSeedSuffixStart: BN;
309
+ transientSeedSuffixEnd: BN;
310
+ lastUpdateEpoch: BN;
311
+ }
312
+ export declare const ValidatorStakeInfoLayout: LayoutCls<ValidatorStakeInfo>;
313
+ export interface ValidatorList {
314
+ accountType: number;
315
+ maxValidators: number;
316
+ validators: ValidatorStakeInfo[];
317
+ }
318
+ export declare const ValidatorListLayout: LayoutCls<ValidatorList>;
@@ -0,0 +1,5 @@
1
+ export * from './instruction';
2
+ export * from './math';
3
+ export * from './program-address';
4
+ export * from './stake';
5
+ export declare function arrayChunk(array: any[], size: number): any[];