Squads Protocol Multisig
Squads Protocol Multisig
Create and manage 2-of-2 multisig accounts using Squads Protocol
This implementation enables secure shared control over assets between an AI agent and a user.
Core Features
-
Multisig Management
- Create 2-of-2 multisig
- Deposit funds
- Create proposals
- Execute transactions
-
Proposal Operations
- Create proposals
- Approve proposals
- Reject proposals
- Execute transactions
Quick Start
Example Prompts
Natural Language Prompts
LangChain Tool Prompts
Create Multisig
Deposit Funds
Transfer Funds
Detailed Function Reference
Creation Operations
createSquadsMultisig
Creates a new 2-of-2 multisig account with the agent and creator as members.
agent
: SolanaAgentKit instancecreator
: Public key of the second member- Returns: Transaction signature
depositToMultisig
Deposits funds to the multisig vault.
amount
: Amount to depositvaultIndex
: Optional vault index (default: 0)mint
: Optional SPL token mint address- Returns: Transaction signature
Proposal Operations
createProposal
Creates a new proposal for a pending transaction.
transactionIndex
: Optional specific transaction index- Returns: Transaction signature
approveProposal
Approves a pending proposal.
transactionIndex
: Optional specific transaction index- Returns: Transaction signature
rejectProposal
Rejects a pending proposal.
transactionIndex
: Optional specific transaction index- Returns: Transaction signature
Transaction Operations
transferFromMultisig
Creates a transaction to transfer funds from the multisig vault.
amount
: Amount to transferto
: Recipient addressvaultIndex
: Optional vault index (default: 0)mint
: Optional SPL token mint address- Returns: Transaction signature
executeTransaction
Executes an approved transaction.
transactionIndex
: Optional specific transaction index- Returns: Transaction signature
Usage Examples
Complete Workflow Example
SPL Token Example
Common Function Patterns
Transaction Index Management
Error Handling
Multisig Operations
1. Create Multisig
2. Deposit Funds
3. Create Transfer
Proposal Lifecycle
- Create Proposal
- Approve Proposal
- Execute Transaction
Implementation Details
Member Permissions
Transaction Workflow
- Create transaction
- Create proposal
- Collect approvals
- Execute transaction
Error Handling
Best Practices
-
Account Management
- Secure private keys
- Track proposal indices
- Monitor balances
- Verify permissions
-
Transaction Flow
- Validate amounts
- Check approvals
- Monitor timeouts
- Handle failures
-
Security
- Double-check recipients
- Verify amounts
- Confirm approvals
- Track transactions
Common Issues
-
Transaction Failures
- Insufficient approvals
- Invalid indices
- Balance issues
- Permission errors
-
Proposal Management
- Missing approvals
- Invalid sequences
- Timeout issues
- Execution failures
-
Account Issues
- Permission problems
- Invalid addresses
- Wrong indices
- State conflicts
Response Format
Success Response
Error Response
Technical Notes
-
Vault Management
- Vault indices
- Balance tracking
- Token support
- Permission checks
-
Proposal Tracking
- Index management
- State tracking
- Approval counting
- Execution status
-
Transaction Building
- Instruction creation
- Message compilation
- Signature collection
- Execution verification
Related Functions
getMultisigBalance
: Check vault balancegetProposalStatus
: Check proposal stategetApprovals
: Get approval countcancelProposal
: Cancel pending proposal
Resources
Was this page helpful?