import type { ConfirmOptions , Connection , PublicKey , Signer , Transaction , } from "@solana/web3.js" ; import type { Provider , Wallet } from "./interfaces" ; import { SolanaProvider } from "./provider" ; /**
 * Wallet based on a Signer.
 */ export class SignerWallet implements Wallet { constructor ( readonly signer ) { } get publicKey ( ) : PublicKey { return this . signer . publicKey ; } signAllTransactions ( transactions ) { return Promise . resolve ( transactions . map ( ( tx ) => { tx . partialSign ( this . signer ) ; return tx ; } ) ) ; } signTransaction ( transaction ) { transaction . partialSign ( this . signer ) ; return Promise . resolve ( transaction ) ; } param connection returns createProvider ( connection , sendConnection ? , opts ? ) { return SolanaProvider . load ( { connection , sendConnection , wallet : this , opts , } ) ; } }