import { Keypair , PublicKey , TransactionInstruction } from '@solana/web3.js' ; import { Proposal } from '@solana/spl-governance' ; import { withRemoveInstruction } from '@solana/spl-governance' ; import { sendTransactionWithNotifications } from '../tools/transactions' ; import { RpcContext } from '@solana/spl-governance' ; import { ProgramAccount } from '@solana/spl-governance' ; export const removeInstruction = async ( { connection , wallet , programId , walletPubkey } , proposal , proposalInstruction ) => { let signers = [ ] ; let instructions = [ ] ; const governanceAuthority = walletPubkey ; const beneficiary = walletPubkey ; await withRemoveInstruction ( instructions , programId , proposal . pubkey , proposal . account . tokenOwnerRecord , governanceAuthority , proposalInstruction , beneficiary ) ; await sendTransactionWithNotifications ( connection , wallet , instructions , signers , 'Removing instruction' , 'Instruction removed' ) ; } ;