import { Keypair } from '@solana/web3.js'; import type { Wallet } from './wallet'; import type { Commitment, ConfirmOptions, Connection, PublicKey, SendOptions, Signer, SimulatedTransactionResponse, Transaction, TransactionInstruction, TransactionInstructionCtorFields, TransactionSignature, VersionedTransaction } from '@solana/web3.js'; export interface Provider { readonly connection: Connection; readonly publicKey?: PublicKey; send?(tx: Transaction | VersionedTransaction, signers?: Signer[], opts?: SendOptions): Promise; sendAndConfirm?(tx: Transaction | VersionedTransaction, signers?: Signer[], opts?: ConfirmOptions): Promise; sendAll?(txWithSigners: { tx: T; signers?: Signer[]; }[], opts?: ConfirmOptions): Promise>; simulate?(tx: Transaction | VersionedTransaction, signers?: Signer[], commitment?: Commitment, includeAccounts?: boolean | PublicKey[]): Promise; } export type SuccessfulTxSimulationResponse = Omit; export type WalletProvider = Provider & { wallet: Wallet | Signer | Keypair; }; export declare function instanceOfProvider(object: any): object is Provider; export declare function instanceOfProviderWithWallet(object: any): object is Provider & { wallet: Wallet | Signer | Keypair; }; export declare function providerPubkey(provider: Provider): PublicKey; export declare function providerOrConnection(provider: Provider | Connection, feePayer?: PublicKey): [Connection, PublicKey]; export declare function walletProviderOrConnection(provider: Provider | Connection, feePayer?: Wallet | Signer | Keypair): [Connection, Wallet | Signer | Keypair]; export declare class NullProvider implements Provider { readonly connection: Connection; publicKey?: PublicKey; constructor(connection: Connection); send(tx: Transaction | VersionedTransaction, signers?: Signer[], opts?: SendOptions): Promise; sendAndConfirm(tx: Transaction | VersionedTransaction, signers?: Signer[], opts?: ConfirmOptions): Promise; sendAll(txWithSigners: { tx: T; signers?: Signer[] | undefined; }[], opts?: ConfirmOptions): Promise; simulate(tx: Transaction | VersionedTransaction, signers?: Signer[], commitment?: Commitment, includeAccounts?: boolean | PublicKey[]): Promise; } export type SignerType = Keypair | Signer | Wallet; export interface ExtendedProvider extends Provider { sendIx(signers: SignerType[], ...ixes: (Transaction | TransactionInstruction | TransactionInstructionCtorFields)[]): Promise; get walletPubkey(): PublicKey; } //# sourceMappingURL=provider.d.ts.map