Squads Docs
Development
Development
  • Introduction
    • What is Squads Protocol
    • Use Cases
    • Quickstart
  • Typescript
    • Overview
    • Instructions
      • Create Multisig
      • Create Config Transaction
      • Create Vault Transaction
      • Create Proposal
      • Approve Proposal
      • Reject Proposal
      • Cancel Proposal
      • Execute Config Transaction
      • Execute Vault Transaction
      • Create Batch
      • Add To Batch
      • Close Vault Transaction Account
      • Controlled Multisig Instructions
        • Add Member
        • Remove Member
        • Set Rent Collector
        • Add spending limit
        • Remove Spending Limit
    • Accounts
      • Multisig
      • Vault
      • Transactions
      • Proposal
      • Batch
  • Reference
    • Accounts
    • Permissions
    • Spending Limits
    • Time-locks
    • SDKs
    • Controlled Multisigs
  • API
    • Vault Check
  • CLI
    • Installation
    • Commands
  • Get Support
    • We're here to help
  • Other
    • Migrating from MultisigCreate v1 to v2
    • Squads Actions and Blinks
Powered by GitBook
On this page
  • Getting a Transaction address
  • Vault Transactions
  • Config Transactions
  • Notes
  1. Typescript
  2. Accounts

Transactions

Accounts that store different types of transactions

PreviousVaultNextProposal

Last updated 8 months ago

Transactions are split into two types, each with their own execution instructions and parameters. Both types are subject to consensus. The two types are:

  • Store, vote, and execute on arbitrary Solana instructions

  • : Edit config in the Multisig account (members, spending limits, etc...)

Both types of transactions are bound to a transaction index, which denotes where the transaction is in the continuity of the multisig. This index is also used to derivation. Because of this, you can use the method below to derive the address of either account type:

Getting a Transaction address

import * as multisig from "@sqds/multisig";
import { PublicKey } from "@solana/web3.js";

async function main() {
    // Public Key of the Multisig PDA
    const multisigPda = new PublicKey("<my multisig>");
    
    // Fetch the deserialized Multisig account
    const multisigInfo = await multisig.accounts.Multisig.fromAccountAddress(
      connection,
      multisigPda
    );

    // Get the current transaction index
    const currentTransactionIndex = Number(multisigInfo.transactionIndex);
    const transactionIndex = BigInt(currentTransactionIndex + 1);
    // or, if this is your first transaction
    // const transactionIndex = 1n;
    
    // Can be either a VaultTransaction or ConfigTransaction
    const [transactionPda] = multisig.getTransactionPda({
        multisigPda,
        index: transactionIndex,
    });
}

Vault Transactions

This transaction type is by far the most common. Most actions you conduct via your multisig will be Vault Transactions. These take a Transaction Message containing a number of arbitrary instructions, and saves them in an account for voting and execution.

Fetch Vault Transaction Info

// Fetch the deserialized account
let transactionAccount = 
    await multisig.accounts.VaultTransaction.fromAccountAddress(
        connection,
        transactionPda
    );
      
// Log the Vault Transaction structure
console.log("Transaction: ", transactionAccount);

Config Transactions

Less common, but equally important is the config transaction, which is used to manage configurations (spending limits, members, time-locks, etc...) on your Multisig. These consist of a set of predefined actions that any given transaction can take, with some invalidating all previous transactions on execution.

Fetch Config Transaction Info

// Fetch the deserialized account
const configTransactionAccount =
        await multisig.accounts.ConfigTransaction.fromAccountAddress(
                connection, 
                transactionPda
        );
        
// Log the Config Transaction structure
console.log("Config Transaction: ", configTransactionAccount);

Notes

  • Two types of transactions: Vault Transactions, and Config Transactions

  • They require a proposal account to be voted on, and subsequently executed

See for more information about how to create this account.

See for more information about how to create this account.

See their for more information on account structure and seeds.

Create Vault Transaction
Create Config Transaction
Vault Transactions:
Config Transactions
reference