import type { Blockhash , Commitment , ConfirmOptions , Connection , KeyedAccountInfo , PublicKey , RpcResponseAndContext , Signer , SimulatedTransactionResponse , Transaction , } from "@solana/web3.js" ; import type { PendingTransaction } from "." ; /**
 * Wallet interface for objects that can be used to sign provider transactions.
 *
 * This interface comes from Anchor.
 */ export interface Wallet { param tx signTransaction ( tx ) : Promise < Transaction > ; param txs signAllTransactions ( txs ) : Promise < Transaction [ ] > ; /**
     * The PublicKey of the wallet.
     */ publicKey : PublicKey ; } /**
 * Request to send a transaction.
 */ export interface SendTxRequest { tx : Transaction ; signers : Array < Signer | undefined > ; } /**
 * An entity that can fetch  KeyedAccountInfo .
  export interface AccountInfoFetcher { /**
     * Fetches the  KeyedAccountInfo associated with a
     *  PublicKey , if it exists.
     *
     *  param accountId getAccountInfo ( accountId ) : Promise < KeyedAccountInfo | null > ; } export interface ReadonlyProvider extends AccountInfoFetcher { /**
     * Connection for reading data.
     */ connection : Connection ; } /**
 * A Broadcaster broadcasts signed transactions to a node or set of nodes,
 * returning the transaction signatures.
 */ export interface Broadcaster { param commitment getRecentBlockhash ( commitment ? ) : Promise < Blockhash > ; param tx param opts broadcast : ( tx : Transaction , opts ? : ConfirmOptions ) => Promise < PendingTransaction > ; param tx param opts simulate ( tx , opts ) : Promise < RpcResponseAndContext < SimulatedTransactionResponse > > ; } /**
 * An interface that can sign transactions.
 */ export interface TransactionSigner { publicKey : PublicKey ; param tx param signers param opts sign : ( tx : Transaction , signers ? : readonly ( Signer | undefined ) [ ] , opts ? : ConfirmOptions ) => Promise < Transaction > ; /**
     * Similar to `sign`, but for an array of transactions and signers.
     */ signAll : ( reqs : readonly SendTxRequest [ ] , opts ? : ConfirmOptions ) => Promise < Transaction [ ] > ; } /**
 * The network and wallet context used to send transactions paid for and signed
 * by the provider.
 *
 * This interface is based on Anchor, but includes more features.
 */ export interface Provider extends ReadonlyProvider { /**
     * Connection for reading data.
     */ connection : Connection ; /**
     * Signs transactions.
     */ signer : TransactionSigner ; /**
     * Broadcasts transactions.
     */ broadcaster : Broadcaster ; /**
     * Transaction confirmation options to use by default.
     */ opts : ConfirmOptions ; /**
     * The wallet used to pay for and sign all transactions.
     */ wallet : Wallet ; param tx param signers param opts send : ( tx : Transaction , signers ? : ( Signer | undefined ) [ ] , opts ? : ConfirmOptions ) => Promise < PendingTransaction > ; /**
     * Similar to `send`, but for an array of transactions and signers.
     */ sendAll : ( reqs : readonly SendTxRequest [ ] , opts ? : ConfirmOptions ) => Promise < PendingTransaction [ ] > ; param tx param signers param opts simulate : ( tx : Transaction , signers ? : ( Signer | undefined ) [ ] , opts ? : ConfirmOptions ) => Promise < RpcResponseAndContext < SimulatedTransactionResponse > > ; } /**
 * An event emitted by a program.
 */ export interface Event { name : string ; data : Record < string , unknown > ; } /**
 * Parses the events from logs.
 */ export type EventParser < E extends Event > = ( logs : string [ ] ) => E [ ] ;