Squads Protocol Side Track for Hyperdrive
Submit your project
  • Introduction
    • Hyperdrive Hackathon
    • What is Squads Protocol
    • Quickstart
  • Development
    • Overview
    • Instructions - Interact with the program
      • Create Multisig
      • Add Member
      • Add spending limit
      • Remove Spending Limit
      • Create Vault Transaction
      • Create Config Transaction
      • Create Proposal
      • Approve Transaction
      • Reject Proposal
      • Cancel Proposal
      • Execute Transaction
    • PDAs - Read data from the Program
      • Multisig Account Info
      • Transaction Account Info
      • Proposal Account Info
  • Reference
    • Accounts
    • Spending Limits
    • Time-locks
    • Permissions
    • SDKs
    • Transaction Builder
  • Squads CLI
    • Installation
    • Commands
  • Submissions
    • Submit your project
    • Get support
Powered by GitBook
On this page
  1. Development
  2. PDAs - Read data from the Program

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());
PreviousMultisig Account InfoNextProposal Account Info

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

reference