@ignitionfi/fogo-stake-pool 1.0.2 → 1.1.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.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { AccountInfo, Connection, PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
2
2
  import BN from 'bn.js';
3
+ import { AmountInput } from './instructions';
3
4
  import { StakeAccount, StakePool, ValidatorList } from './layouts';
4
5
  import { ValidatorAccount } from './utils';
5
6
  export { DEVNET_STAKE_POOL_PROGRAM_ID, STAKE_POOL_PROGRAM_ID, } from './constants';
@@ -57,7 +58,7 @@ export declare function depositStake(connection: Connection, stakePoolAddress: P
57
58
  /**
58
59
  * Creates instructions required to deposit sol to stake pool.
59
60
  */
60
- export declare function depositWsolWithSession(connection: Connection, stakePoolAddress: PublicKey, signerOrSession: PublicKey, userPubkey: PublicKey, lamports: number, minimumPoolTokensOut?: number, destinationTokenAccount?: PublicKey, referrerTokenAccount?: PublicKey, depositAuthority?: PublicKey, payer?: PublicKey,
61
+ export declare function depositWsolWithSession(connection: Connection, stakePoolAddress: PublicKey, signerOrSession: PublicKey, userPubkey: PublicKey, lamports: AmountInput, minimumPoolTokensOut?: AmountInput, destinationTokenAccount?: PublicKey, referrerTokenAccount?: PublicKey, depositAuthority?: PublicKey, payer?: PublicKey,
61
62
  /**
62
63
  * Skip WSOL balance validation. Set to true when adding wrap instructions
63
64
  * in the same transaction that will fund the WSOL account before deposit.
@@ -69,7 +70,7 @@ skipBalanceCheck?: boolean): Promise<{
69
70
  /**
70
71
  * Creates instructions required to deposit sol to stake pool.
71
72
  */
72
- export declare function depositSol(connection: Connection, stakePoolAddress: PublicKey, from: PublicKey, lamports: number, destinationTokenAccount?: PublicKey, referrerTokenAccount?: PublicKey, depositAuthority?: PublicKey): Promise<{
73
+ export declare function depositSol(connection: Connection, stakePoolAddress: PublicKey, from: PublicKey, lamports: AmountInput, destinationTokenAccount?: PublicKey, referrerTokenAccount?: PublicKey, depositAuthority?: PublicKey): Promise<{
73
74
  instructions: TransactionInstruction[];
74
75
  signers: Signer[];
75
76
  }>;
@@ -144,24 +145,25 @@ export declare function getUserStakeAccounts(connection: Connection, programId:
144
145
  * Withdraws stake from a stake pool using a Fogo session.
145
146
  *
146
147
  * The on-chain program creates stake account PDAs. The rent for these accounts
147
- * is paid by the payer (typically the paymaster), not deducted from the user's withdrawal.
148
+ * is funded from the reserve stake.
148
149
  *
149
150
  * @param connection - Solana connection
150
151
  * @param stakePoolAddress - The stake pool to withdraw from
151
152
  * @param signerOrSession - The session signer public key
152
153
  * @param userPubkey - User's wallet (used for PDA derivation and token ownership)
153
- * @param payer - Payer for stake account rent (typically paymaster)
154
154
  * @param amount - Amount of pool tokens to withdraw
155
155
  * @param userStakeSeedStart - Starting seed for user stake PDA derivation (default: 0)
156
156
  * @param useReserve - Whether to withdraw from reserve (default: false)
157
157
  * @param voteAccountAddress - Optional specific validator to withdraw from
158
158
  * @param minimumLamportsOut - Minimum lamports to receive (slippage protection)
159
159
  * @param validatorComparator - Optional comparator for validator selection
160
+ * @param allowPartial - If true, returns partial results instead of throwing when not enough stake available
160
161
  */
161
- export declare function withdrawStakeWithSession(connection: Connection, stakePoolAddress: PublicKey, signerOrSession: PublicKey, userPubkey: PublicKey, payer: PublicKey, amount: number, userStakeSeedStart?: number, useReserve?: boolean, voteAccountAddress?: PublicKey, minimumLamportsOut?: number, validatorComparator?: (_a: ValidatorAccount, _b: ValidatorAccount) => number): Promise<{
162
+ export declare function withdrawStakeWithSession(connection: Connection, stakePoolAddress: PublicKey, signerOrSession: PublicKey, userPubkey: PublicKey, amount: number, userStakeSeedStart?: number, useReserve?: boolean, voteAccountAddress?: PublicKey, minimumLamportsOut?: number, validatorComparator?: (_a: ValidatorAccount, _b: ValidatorAccount) => number, allowPartial?: boolean): Promise<{
162
163
  instructions: TransactionInstruction[];
163
164
  stakeAccountPubkeys: PublicKey[];
164
165
  userStakeSeeds: number[];
166
+ remainingPoolTokens: number;
165
167
  }>;
166
168
  export declare function addValidatorToPool(connection: Connection, stakePoolAddress: PublicKey, validatorVote: PublicKey, seed?: number): Promise<{
167
169
  instructions: TransactionInstruction[];
@@ -172,13 +174,13 @@ export declare function removeValidatorFromPool(connection: Connection, stakePoo
172
174
  /**
173
175
  * Creates instructions required to increase validator stake.
174
176
  */
175
- export declare function increaseValidatorStake(connection: Connection, stakePoolAddress: PublicKey, validatorVote: PublicKey, lamports: number, ephemeralStakeSeed?: number): Promise<{
177
+ export declare function increaseValidatorStake(connection: Connection, stakePoolAddress: PublicKey, validatorVote: PublicKey, lamports: AmountInput, ephemeralStakeSeed?: number): Promise<{
176
178
  instructions: TransactionInstruction[];
177
179
  }>;
178
180
  /**
179
181
  * Creates instructions required to decrease validator stake.
180
182
  */
181
- export declare function decreaseValidatorStake(connection: Connection, stakePoolAddress: PublicKey, validatorVote: PublicKey, lamports: number, ephemeralStakeSeed?: number): Promise<{
183
+ export declare function decreaseValidatorStake(connection: Connection, stakePoolAddress: PublicKey, validatorVote: PublicKey, lamports: AmountInput, ephemeralStakeSeed?: number): Promise<{
182
184
  instructions: TransactionInstruction[];
183
185
  }>;
184
186
  /**