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.

  • See the reference for more information on account structure and seeds.

Last updated