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
  • Example
  • Notes
  1. Typescript
  2. Instructions

Execute Config Transaction

Execute an approved Config Transaction

Executing a config transaction will simply execute the action specified in the Config Transaction. This execution can range from a simple account field change on the Multisig, to multiple field changes and corresponding account creation.

This instruction requires that the Proposal accounts for the transaction is of Approved status, and the member running the instruction has Executor permissions.

Example

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

async function main(member: PublicKey) {
    // Cluster Connection
    const connection = new Connection("<your rpc url>");
    
    // If you've saved your createKey, you can define it as a static PublicKey
    const createKey = new PublicKey("<your createkey>")
    
    // Derive the multisig PDA
    const [multisigPda] = multisig.getMultisigPda({
        createKey,
    });
    // or
    // const multisigPda = new PublicKey("<your multisig key>");
    
    // Get deserialized multisig account info
    const multisigInfo = await multisig.accounts.Multisig.fromAccountAddress(
      connection,
      multisigPda
    );

    // Get the current transaction index
    const transactionIndex = Number(multisigInfo.transactionIndex);
    // or, if this is tied to your first transaction
    // const transactionIndex = 1n;
    
    const ix = multisig.instructions.configTransactionExecute({
        multisigPda,
        transactionIndex: newTransactionIndex,
        // Member must have "Executor" permissions
        member: creator.publicKey,
    });
}

Notes

  • Member must have "Executor" permissions

  • Requires the corresponding proposal to be of Approved status

PreviousCancel ProposalNextExecute Vault Transaction

Last updated 8 months ago

Will execute the specified action in the account

Config Transaction