import { Keypair , PublicKey , TransactionInstruction } from '@solana/web3.js' ; import { Proposal } from '@solana/spl-governance' ; import { withFinalizeVote } from '@solana/spl-governance' ; import { sendTransactionWithNotifications } from '../tools/transactions' ; import { RpcContext } from '@solana/spl-governance' ; import { ProgramAccount } from '@solana/spl-governance' ; export const finalizeVote = async ( { connection , wallet , programId } , realm , proposal ) => { let signers = [ ] ; let instructions = [ ] ; withFinalizeVote ( instructions , programId , realm , proposal . account . governance , proposal . pubkey , proposal . account . tokenOwnerRecord , proposal . account . governingTokenMint ) ; await sendTransactionWithNotifications ( connection , wallet , instructions , signers , 'Finalizing vote' , 'Vote finalized' ) ; } ;