> ## Documentation Index
> Fetch the complete documentation index at: https://new-docs.squads.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Approve Proposal

## Overview

Cast an approval vote on a given transaction's proposal. Proposals require approvals equal to the threshold for the underlying transaction to be executed.

## Prerequisites

* Existing proposal in Active status
* `@sqds/multisig` package installed
* Member with Voter permissions

## Quick Example

```typescript theme={null}
import * as multisig from "@sqds/multisig";
import { Connection, PublicKey } from "@solana/web3.js";

const connection = new Connection("<your rpc url>");

const ix = await multisig.instructions.proposalApprove({
  multisigPda,
  transactionIndex,
  member: member,
});
```

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `multisigPda` | `PublicKey` | Yes | PDA of the multisig |
| `transactionIndex` | `bigint` | Yes | Index of the transaction to approve |
| `member` | `PublicKey` | Yes | Member casting the approval (must have Voter permissions) |

## Full Example

```typescript theme={null}
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 = BigInt(multisigInfo.transactionIndex.toString());
    // or, if this is tied to your first transaction
    // const transactionIndex = 1n;

    const ix = await multisig.instructions.proposalApprove({
      multisigPda,
      transactionIndex,
      // Member must have "Voter" permissions
      member: member,
    });
}
```

## Error Handling

| Error | Cause | Solution |
| - | - | - |
| Stale proposal | Transaction index ≤ stale transaction index | Cannot approve stale proposals |
| `AlreadyApproved` | Member has already approved | A member can approve once. A member who rejected can still switch to approve while the proposal is Active |
| Insufficient permissions | Member lacks Voter permission | Use a member with Voter permissions |

## See Also

* [Proposal Account](/developers/typescript-sdk/accounts/proposal)
* [Reject Proposal](/developers/typescript-sdk/instructions/reject-proposal)
* [Execute Vault Transaction](/developers/typescript-sdk/instructions/execute-vault-transaction)
* [Multisig Reference](/developers/reference/accounts#multisig)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.