Close Vault Transaction Account

Typescript

import * as multisig from "@sqds/multisig";

// Cluster Connection
const connection = new Connection( < your rpc url > );

// Fee payer is the a signer that pays the transaction fees
const feePayer = Keypair.generate();

// Derive the multisig PDA
const multisigPda = multisig.getMultisigPda({
    // The createKey has to be a Public Key, see accounts reference for more info
    createKey,
})[0];

const transactionIndex = 1n;

const newRentCollector = Keypair.generate().publicKey;

const sig = await multisig.rpc.vaultTransactionAccountsClose({
      connection,
      feePayer,
      multisigPda,
      // This value should be the current rent collector Public Key of the Multisig.
      rentCollector: vaultPda,
      transactionIndex,
      programId,
});

Last updated