Custom Instruction
How to create a custom instruction to be executed via Realms
Create a Custom Instruction
How Proposal Transactions Work
Two Transaction Types
Creating a Legacy Proposal Transaction
InstructionData Format
pub struct InstructionData {
/// Target program ID
pub program_id: Pubkey,
/// Account metadata for the instruction
pub accounts: Vec<AccountMetaData>,
/// Instruction data bytes
pub data: Vec<u8>,
}
pub struct AccountMetaData {
pub pubkey: Pubkey,
pub is_signer: bool,
pub is_writable: bool,
}Step-by-Step: Adding an Instruction to a Proposal
Creating Versioned Transactions (v3.1.2)
Direct Insert (Small Transactions)
Buffered Insert (Large Transactions)
Common Custom Instruction Patterns
Program Upgrade
Token Transfer from Treasury
Mint Tokens
Call Any Program
Important Notes
Last updated