@ignitionfi/spl-stake-pool 1.1.10

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,195 @@
1
+ import { AccountInfo, Connection, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
2
+ import BN from 'bn.js';
3
+ import { StakeAccount, StakePool, ValidatorList } from './layouts';
4
+ import { ValidatorAccount } from './utils';
5
+ export { DEVNET_STAKE_POOL_PROGRAM_ID, STAKE_POOL_PROGRAM_ID, } from './constants';
6
+ export * from './instructions';
7
+ export type { AccountType, StakePool, ValidatorList, ValidatorStakeInfo, } from './layouts';
8
+ export { StakePoolLayout, ValidatorListLayout, ValidatorStakeInfoLayout, } from './layouts';
9
+ export interface ValidatorListAccount {
10
+ pubkey: PublicKey;
11
+ account: AccountInfo<ValidatorList>;
12
+ }
13
+ export interface StakePoolAccount {
14
+ pubkey: PublicKey;
15
+ account: AccountInfo<StakePool>;
16
+ }
17
+ export interface WithdrawAccount {
18
+ stakeAddress: PublicKey;
19
+ voteAddress?: PublicKey;
20
+ poolAmount: BN;
21
+ }
22
+ /**
23
+ * Wrapper class for a stake pool.
24
+ * Each stake pool has a stake pool account and a validator list account.
25
+ */
26
+ export interface StakePoolAccounts {
27
+ stakePool: StakePoolAccount | undefined;
28
+ validatorList: ValidatorListAccount | undefined;
29
+ }
30
+ export declare function getStakePoolProgramId(rpcEndpoint: string): PublicKey;
31
+ /**
32
+ * Retrieves and deserializes a StakePool account using a web3js connection and the stake pool address.
33
+ * @param connection An active web3js connection.
34
+ * @param stakePoolAddress The public key (address) of the stake pool account.
35
+ */
36
+ export declare function getStakePoolAccount(connection: Connection, stakePoolAddress: PublicKey): Promise<StakePoolAccount>;
37
+ /**
38
+ * Retrieves and deserializes a Stake account using a web3js connection and the stake address.
39
+ * @param connection An active web3js connection.
40
+ * @param stakeAccount The public key (address) of the stake account.
41
+ */
42
+ export declare function getStakeAccount(connection: Connection, stakeAccount: PublicKey): Promise<StakeAccount>;
43
+ /**
44
+ * Retrieves all StakePool and ValidatorList accounts that are running a particular StakePool program.
45
+ * @param connection An active web3js connection.
46
+ * @param stakePoolProgramAddress The public key (address) of the StakePool program.
47
+ */
48
+ export declare function getStakePoolAccounts(connection: Connection, stakePoolProgramAddress: PublicKey): Promise<(StakePoolAccount | ValidatorListAccount | undefined)[] | undefined>;
49
+ /**
50
+ * Creates instructions required to deposit stake to stake pool.
51
+ */
52
+ export declare function depositStake(connection: Connection, stakePoolAddress: PublicKey, authorizedPubkey: PublicKey, validatorVote: PublicKey, depositStake: PublicKey, poolTokenReceiverAccount?: PublicKey): Promise<{
53
+ instructions: TransactionInstruction[];
54
+ signers: Signer[];
55
+ }>;
56
+ /**
57
+ * Creates instructions required to deposit sol to stake pool.
58
+ */
59
+ export declare function depositWsolWithSession(connection: Connection, stakePoolAddress: PublicKey, signerOrSession: PublicKey, userPubkey: PublicKey, lamports: number, destinationTokenAccount?: PublicKey, referrerTokenAccount?: PublicKey, depositAuthority?: PublicKey, payer?: PublicKey): Promise<{
60
+ instructions: TransactionInstruction[];
61
+ signers: never[];
62
+ }>;
63
+ /**
64
+ * Creates instructions required to deposit sol to stake pool.
65
+ */
66
+ export declare function depositSol(connection: Connection, stakePoolAddress: PublicKey, from: PublicKey, lamports: number, destinationTokenAccount?: PublicKey, referrerTokenAccount?: PublicKey, depositAuthority?: PublicKey): Promise<{
67
+ instructions: TransactionInstruction[];
68
+ signers: Signer[];
69
+ }>;
70
+ /**
71
+ * Creates instructions required to withdraw stake from a stake pool.
72
+ */
73
+ export declare function withdrawStake(connection: Connection, stakePoolAddress: PublicKey, tokenOwner: PublicKey, amount: number, useReserve?: boolean, voteAccountAddress?: PublicKey, stakeReceiver?: PublicKey, poolTokenAccount?: PublicKey, validatorComparator?: (_a: ValidatorAccount, _b: ValidatorAccount) => number): Promise<{
74
+ instructions: TransactionInstruction[];
75
+ signers: Signer[];
76
+ stakeReceiver: PublicKey | undefined;
77
+ totalRentFreeBalances: number;
78
+ }>;
79
+ /**
80
+ * Creates instructions required to withdraw SOL directly from a stake pool.
81
+ */
82
+ export declare function withdrawSol(connection: Connection, stakePoolAddress: PublicKey, tokenOwner: PublicKey, solReceiver: PublicKey, amount: number, solWithdrawAuthority?: PublicKey): Promise<{
83
+ instructions: TransactionInstruction[];
84
+ signers: Signer[];
85
+ }>;
86
+ /**
87
+ * Creates instructions required to withdraw wSOL from a stake pool.
88
+ */
89
+ export declare function withdrawWsolWithSession(connection: Connection, stakePoolAddress: PublicKey, signerOrSession: PublicKey, userPubkey: PublicKey, amount: number, solWithdrawAuthority?: PublicKey): Promise<{
90
+ instructions: TransactionInstruction[];
91
+ signers: Signer[];
92
+ }>;
93
+ export declare function addValidatorToPool(connection: Connection, stakePoolAddress: PublicKey, validatorVote: PublicKey, seed?: number): Promise<{
94
+ instructions: TransactionInstruction[];
95
+ }>;
96
+ export declare function removeValidatorFromPool(connection: Connection, stakePoolAddress: PublicKey, validatorVote: PublicKey, seed?: number): Promise<{
97
+ instructions: TransactionInstruction[];
98
+ }>;
99
+ /**
100
+ * Creates instructions required to increase validator stake.
101
+ */
102
+ export declare function increaseValidatorStake(connection: Connection, stakePoolAddress: PublicKey, validatorVote: PublicKey, lamports: number, ephemeralStakeSeed?: number): Promise<{
103
+ instructions: TransactionInstruction[];
104
+ }>;
105
+ /**
106
+ * Creates instructions required to decrease validator stake.
107
+ */
108
+ export declare function decreaseValidatorStake(connection: Connection, stakePoolAddress: PublicKey, validatorVote: PublicKey, lamports: number, ephemeralStakeSeed?: number): Promise<{
109
+ instructions: TransactionInstruction[];
110
+ }>;
111
+ /**
112
+ * Creates instructions required to completely update a stake pool after epoch change.
113
+ */
114
+ export declare function updateStakePool(connection: Connection, stakePool: StakePoolAccount, noMerge?: boolean): Promise<{
115
+ updateListInstructions: TransactionInstruction[];
116
+ finalInstructions: TransactionInstruction[];
117
+ }>;
118
+ /**
119
+ * Retrieves detailed information about the StakePool.
120
+ */
121
+ export declare function stakePoolInfo(connection: Connection, stakePoolAddress: PublicKey): Promise<{
122
+ address: string;
123
+ poolWithdrawAuthority: string;
124
+ manager: string;
125
+ staker: string;
126
+ stakeDepositAuthority: string;
127
+ stakeWithdrawBumpSeed: number;
128
+ maxValidators: number;
129
+ validatorList: {
130
+ activeStakeLamports: string;
131
+ transientStakeLamports: string;
132
+ lastUpdateEpoch: string;
133
+ transientSeedSuffixStart: string;
134
+ transientSeedSuffixEnd: string;
135
+ status: string;
136
+ voteAccountAddress: string;
137
+ }[];
138
+ validatorListStorageAccount: string;
139
+ reserveStake: string;
140
+ poolMint: string;
141
+ managerFeeAccount: string;
142
+ tokenProgramId: string;
143
+ totalLamports: string;
144
+ poolTokenSupply: string;
145
+ lastUpdateEpoch: string;
146
+ lockup: import("./layouts").Lockup;
147
+ epochFee: import("./layouts").Fee;
148
+ nextEpochFee: import("./layouts").Fee | undefined;
149
+ preferredDepositValidatorVoteAddress: PublicKey | undefined;
150
+ preferredWithdrawValidatorVoteAddress: PublicKey | undefined;
151
+ stakeDepositFee: import("./layouts").Fee;
152
+ stakeWithdrawalFee: import("./layouts").Fee;
153
+ nextStakeWithdrawalFee: import("./layouts").Fee | undefined;
154
+ stakeReferralFee: number;
155
+ solDepositAuthority: string | undefined;
156
+ solDepositFee: import("./layouts").Fee;
157
+ solReferralFee: number;
158
+ solWithdrawAuthority: string | undefined;
159
+ solWithdrawalFee: import("./layouts").Fee;
160
+ nextSolWithdrawalFee: import("./layouts").Fee | undefined;
161
+ lastEpochPoolTokenSupply: string;
162
+ lastEpochTotalLamports: string;
163
+ details: {
164
+ reserveStakeLamports: number | undefined;
165
+ reserveAccountStakeAddress: string;
166
+ minimumReserveStakeBalance: number;
167
+ stakeAccounts: {
168
+ voteAccountAddress: string;
169
+ stakeAccountAddress: string;
170
+ validatorActiveStakeLamports: string;
171
+ validatorLastUpdateEpoch: string;
172
+ validatorLamports: string;
173
+ validatorTransientStakeAccountAddress: string;
174
+ validatorTransientStakeLamports: string;
175
+ updateRequired: boolean;
176
+ }[];
177
+ totalLamports: BN;
178
+ totalPoolTokens: number;
179
+ currentNumberOfValidators: number;
180
+ maxNumberOfValidators: number;
181
+ updateRequired: boolean;
182
+ };
183
+ }>;
184
+ /**
185
+ * Creates instructions required to create pool token metadata.
186
+ */
187
+ export declare function createPoolTokenMetadata(connection: Connection, stakePoolAddress: PublicKey, payer: PublicKey, name: string, symbol: string, uri: string): Promise<{
188
+ instructions: TransactionInstruction[];
189
+ }>;
190
+ /**
191
+ * Creates instructions required to update pool token metadata.
192
+ */
193
+ export declare function updatePoolTokenMetadata(connection: Connection, stakePoolAddress: PublicKey, name: string, symbol: string, uri: string): Promise<{
194
+ instructions: TransactionInstruction[];
195
+ }>;