Transaction Account Info

To fetch the Account Information for a transaction, you will need its Public Key. The Public Key can be derived with the underlying Multisig Public Key and the transaction index, which is an incrementing counter keeping track of the number of total transactions.

Let's set the code up

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

const {
    Transaction
} = multisig.accounts;

// Public Key of the Multisig PDA, head to the Multisig Account Info tab to leanrn more
const multisigPda = new PublicKey("MyAmazingMultisig");

// Unique index of the transaction you are creating
const transactionIndex = 1n;


const [transactionPda] = multisig.getTransactionPda({
    multisigPda,
    index: transactionIndex,
});

// Log out the multisig's members
console.log("Members", multisigAccount.members);

Different transaction Types

On Squads V4 there are two kind of transactions, the one you will probably need the most is the vault transaction, used to manage pretty much everything that is not configuration related to your Multisig (Asset management, validator withdraw authority management, program upgrade authority management...). The second one is the config transaction, which is used to manage configurations (spending limits, members, time-locks...) on your Multisig.

Fetch Vault Transaction Info

let transactionAccount = await VaultTransaction.fromAccountAddress(
    connection,
    transactionPda
);
      
// Log the transactions underlying multisig address
console.log("The transactions multisig: ", transactionAccount.multisig.toBase58());

Fetch Config Transaction Info

const configTransactionAccount =
        await ConfigTransaction.fromAccountAddress(connection, transactionPda);
        
// Log the transactions underlying multisig address
console.log("The transaction multisig: ", configTransactionAccount.multisig.toBase58());

For more information on the structure of the different Transaction accounts, head to their reference.

Last updated