import { SPL_STAKE_POOL_PROGRAM_ADDRESS } from "../programs/splStakePool.js"; import "../programs/index.js"; import { AccountMeta, AccountSignerMeta, Address, FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder, Instruction, InstructionWithAccounts, InstructionWithData, ReadonlyAccount, ReadonlySignerAccount, ReadonlyUint8Array, TransactionSigner, WritableAccount } from "@solana/kit"; //#region src/generated/instructions/withdrawStake.d.ts export declare const WITHDRAW_STAKE_DISCRIMINATOR = 10; export declare function getWithdrawStakeDiscriminatorBytes(): ReadonlyUint8Array; export type WithdrawStakeInstruction = string, TAccountValidatorList extends string | AccountMeta = string, TAccountWithdrawAuthority extends string | AccountMeta = string, TAccountSourceStakeAccount extends string | AccountMeta = string, TAccountDestinationStakeAccount extends string | AccountMeta = string, TAccountNewWithdrawAuthority extends string | AccountMeta = string, TAccountUserTransferAuthority extends string | AccountMeta = string, TAccountUserPoolTokenAccount extends string | AccountMeta = string, TAccountFeeAccount extends string | AccountMeta = string, TAccountPoolMint extends string | AccountMeta = string, TAccountClockSysvar extends string | AccountMeta = "SysvarC1ock11111111111111111111111111111111", TAccountTokenProgram extends string | AccountMeta = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TAccountStakeProgram extends string | AccountMeta = "Stake11111111111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[TAccountStakePool extends string ? WritableAccount : TAccountStakePool, TAccountValidatorList extends string ? WritableAccount : TAccountValidatorList, TAccountWithdrawAuthority extends string ? ReadonlyAccount : TAccountWithdrawAuthority, TAccountSourceStakeAccount extends string ? WritableAccount : TAccountSourceStakeAccount, TAccountDestinationStakeAccount extends string ? WritableAccount : TAccountDestinationStakeAccount, TAccountNewWithdrawAuthority extends string ? ReadonlyAccount : TAccountNewWithdrawAuthority, TAccountUserTransferAuthority extends string ? ReadonlySignerAccount & AccountSignerMeta : TAccountUserTransferAuthority, TAccountUserPoolTokenAccount extends string ? WritableAccount : TAccountUserPoolTokenAccount, TAccountFeeAccount extends string ? WritableAccount : TAccountFeeAccount, TAccountPoolMint extends string ? WritableAccount : TAccountPoolMint, TAccountClockSysvar extends string ? ReadonlyAccount : TAccountClockSysvar, TAccountTokenProgram extends string ? ReadonlyAccount : TAccountTokenProgram, TAccountStakeProgram extends string ? ReadonlyAccount : TAccountStakeProgram, ...TRemainingAccounts]>; export type WithdrawStakeInstructionData = { discriminator: number; args: bigint; }; export type WithdrawStakeInstructionDataArgs = { args: number | bigint; }; export declare function getWithdrawStakeInstructionDataEncoder(): FixedSizeEncoder; export declare function getWithdrawStakeInstructionDataDecoder(): FixedSizeDecoder; export declare function getWithdrawStakeInstructionDataCodec(): FixedSizeCodec; export type WithdrawStakeAsyncInput = { /** Stake pool */ stakePool: Address; /** Validator list */ validatorList: Address; /** Withdraw authority */ withdrawAuthority?: Address; /** Source stake account */ sourceStakeAccount: Address; /** Destination stake account */ destinationStakeAccount: Address; /** New withdraw authority */ newWithdrawAuthority: Address; /** User transfer authority */ userTransferAuthority: TransactionSigner; /** User pool token account */ userPoolTokenAccount: Address; /** Fee account */ feeAccount: Address; /** Pool mint */ poolMint: Address; /** Clock sysvar */ clockSysvar?: Address; /** Token program */ tokenProgram?: Address; /** Stake program */ stakeProgram?: Address; args: WithdrawStakeInstructionDataArgs["args"]; }; /** * Withdraw the token from the pool at the current ratio. * Succeeds if the stake account has enough SOL to cover the desired * amount of pool tokens, and if the withdrawal keeps the total * staked amount above the minimum of rent-exempt amount plus `max( * crate::MINIMUM_ACTIVE_STAKE, * solana_program::stake::tools::get_minimum_delegation() * )`. * When allowing withdrawals, the order of priority goes: * * preferred withdraw validator stake account (if set) * * validator stake accounts * * transient stake accounts * * reserve stake account OR totally remove validator stake accounts * A user can freely withdraw from a validator stake account, and if they * are all at the minimum, then they can withdraw from transient stake * accounts, and if they are all at minimum, then they can withdraw from * the reserve or remove any validator from the pool. * 0. `[w]` Stake pool * 1. `[w]` Validator stake list storage account * 2. `[]` Stake pool withdraw authority * 3. `[w]` Validator or reserve stake account to split * 4. `[w]` Uninitialized stake account to receive withdrawal * 5. `[]` User account to set as a new withdraw authority * 6. `[s]` User transfer authority, for pool token account * 7. `[w]` User account with pool tokens to burn from * 8. `[w]` Account to receive pool fee tokens * 9. `[w]` Pool token mint account * 10. `[]` Sysvar clock account (required) * 11. `[]` Pool token program id * 12. `[]` Stake program id, * User data: amount of pool tokens to withdraw */ export declare function getWithdrawStakeInstructionAsync(input: WithdrawStakeAsyncInput, config?: { programAddress?: TProgramAddress; }): Promise>; export type WithdrawStakeInput = { /** Stake pool */ stakePool: Address; /** Validator list */ validatorList: Address; /** Withdraw authority */ withdrawAuthority: Address; /** Source stake account */ sourceStakeAccount: Address; /** Destination stake account */ destinationStakeAccount: Address; /** New withdraw authority */ newWithdrawAuthority: Address; /** User transfer authority */ userTransferAuthority: TransactionSigner; /** User pool token account */ userPoolTokenAccount: Address; /** Fee account */ feeAccount: Address; /** Pool mint */ poolMint: Address; /** Clock sysvar */ clockSysvar?: Address; /** Token program */ tokenProgram?: Address; /** Stake program */ stakeProgram?: Address; args: WithdrawStakeInstructionDataArgs["args"]; }; /** * Withdraw the token from the pool at the current ratio. * Succeeds if the stake account has enough SOL to cover the desired * amount of pool tokens, and if the withdrawal keeps the total * staked amount above the minimum of rent-exempt amount plus `max( * crate::MINIMUM_ACTIVE_STAKE, * solana_program::stake::tools::get_minimum_delegation() * )`. * When allowing withdrawals, the order of priority goes: * * preferred withdraw validator stake account (if set) * * validator stake accounts * * transient stake accounts * * reserve stake account OR totally remove validator stake accounts * A user can freely withdraw from a validator stake account, and if they * are all at the minimum, then they can withdraw from transient stake * accounts, and if they are all at minimum, then they can withdraw from * the reserve or remove any validator from the pool. * 0. `[w]` Stake pool * 1. `[w]` Validator stake list storage account * 2. `[]` Stake pool withdraw authority * 3. `[w]` Validator or reserve stake account to split * 4. `[w]` Uninitialized stake account to receive withdrawal * 5. `[]` User account to set as a new withdraw authority * 6. `[s]` User transfer authority, for pool token account * 7. `[w]` User account with pool tokens to burn from * 8. `[w]` Account to receive pool fee tokens * 9. `[w]` Pool token mint account * 10. `[]` Sysvar clock account (required) * 11. `[]` Pool token program id * 12. `[]` Stake program id, * User data: amount of pool tokens to withdraw */ export declare function getWithdrawStakeInstruction(input: WithdrawStakeInput, config?: { programAddress?: TProgramAddress; }): WithdrawStakeInstruction; export type ParsedWithdrawStakeInstruction = { programAddress: Address; accounts: { /** Stake pool */ stakePool: TAccountMetas[0]; /** Validator list */ validatorList: TAccountMetas[1]; /** Withdraw authority */ withdrawAuthority: TAccountMetas[2]; /** Source stake account */ sourceStakeAccount: TAccountMetas[3]; /** Destination stake account */ destinationStakeAccount: TAccountMetas[4]; /** New withdraw authority */ newWithdrawAuthority: TAccountMetas[5]; /** User transfer authority */ userTransferAuthority: TAccountMetas[6]; /** User pool token account */ userPoolTokenAccount: TAccountMetas[7]; /** Fee account */ feeAccount: TAccountMetas[8]; /** Pool mint */ poolMint: TAccountMetas[9]; /** Clock sysvar */ clockSysvar: TAccountMetas[10]; /** Token program */ tokenProgram: TAccountMetas[11]; /** Stake program */ stakeProgram: TAccountMetas[12]; }; data: WithdrawStakeInstructionData; }; export declare function parseWithdrawStakeInstruction(instruction: Instruction & InstructionWithAccounts & InstructionWithData): ParsedWithdrawStakeInstruction; //#endregion //# sourceMappingURL=withdrawStake.d.ts.map