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 Proposal account
  • Notes
  1. Typescript
  2. Accounts

Proposal

Stores information on voting and status of a transaction

Proposals handle consensus for a given transaction, mapped one-to-one. Without a proposal account for a transaction, it can not be voted on and subsequently executed.

Getting a Proposal account

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

const { Proposal } = multisig.accounts;

async function main() {
    // Public Key of the Multisig PDA
    const multisigPda = new PublicKey("MyAmazingMultisig");
    
    // 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;    
    
    // Bump is generally not needed
    const [proposalPda, proposalBump] = multisig.getProposalPda({
        multisigPda,
        transactionIndex,
    });
    
    const proposalAccount = await Proposal.fromAccountAddress(
        connection,
        proposalPda
    );
          
    // Log the proposal status
    console.log("Proposal Status", proposalAccount.status);
}

Notes

  • Required for voting on and executing transactions

  • They store status of consensus, and tallies for who's approved and rejected.

PreviousTransactionsNextBatch

Last updated 8 months ago

See the for more information on account structure and seeds.

reference