import { AccountInfo, Commitment, Connection, PublicKey } from "@solana/web3.js"; import { KeyedStakeAccountInfo, StakeAccount } from "./account.js"; export declare type StakeAccAuthorityArgs = { staker?: PublicKey; withdrawer?: PublicKey; }; export declare class InvalidStakeAccAuthorityArgsError extends Error { constructor(); } /** * Finds all `Initialized` and `Stake` stake accounts with the given staker and/or withdrawer authority. * Note: this uses getParsedProgramAccounts under the hood * @param connection * @param stakeAccAuthorityArgs * @returns * @throws `InvalidStakeAccAuthorityArgsError` if stakeAccAuthorityArgs does not container either staker or withdrawer */ export declare function findAllStakeAccountsByAuth(connection: Connection, { staker, withdrawer }: StakeAccAuthorityArgs, commitment?: Commitment): Promise; export declare class StakeAccountDoesNotExistError extends Error { constructor(publicKey: PublicKey); } /** * Fetches a stake account from on-chain * @param connection * @param publicKey * @param commitment * @returns * @throws StakeAccountDoesNotExistError if stake account does not exist * @throws ParseStakeAccountError if unable to parse fetched account data */ export declare function getStakeAccount(connection: Connection, publicKey: PublicKey, commitment?: Commitment): Promise>;