import { Keypair , PublicKey , TransactionInstruction } from '@solana/web3.js' ; import { Proposal } from '@solana/spl-governance' ; import { withRelinquishVote } from '@solana/spl-governance' ; import { sendTransactionWithNotifications } from '../tools/transactions' ; import { RpcContext } from '@solana/spl-governance' ; import { ProgramAccount } from '@solana/spl-governance' ; export const relinquishVote = async ( { connection , wallet , programId , walletPubkey } , proposal , tokenOwnerRecord , voteRecord , IsWithdrawal ) => { let signers = [ ] ; let instructions = [ ] ; let governanceAuthority = walletPubkey ; let beneficiary = walletPubkey ; withRelinquishVote ( instructions , programId , proposal . account . governance , proposal . pubkey , tokenOwnerRecord , proposal . account . governingTokenMint , voteRecord , governanceAuthority , beneficiary ) ; await sendTransactionWithNotifications ( connection , wallet , instructions , signers , IsWithdrawal ? 'Withdrawing vote from proposal' : 'Releasing voting tokens' , IsWithdrawal ? 'Vote withdrawn' : 'Tokens released' ) ; } ;