openzeppelin_relayer/models/transaction/solana/
instruction.rs

1//! Solana instruction specifications for transaction building
2
3use serde::{Deserialize, Serialize};
4use utoipa::ToSchema;
5
6/// Specification for a Solana instruction
7#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq)]
8pub struct SolanaInstructionSpec {
9    /// Program ID (base58-encoded pubkey)
10    pub program_id: String,
11    /// Account metadata for the instruction
12    pub accounts: Vec<SolanaAccountMeta>,
13    /// Instruction data (base64-encoded)
14    pub data: String,
15}
16
17/// Account metadata for a Solana instruction
18#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq)]
19pub struct SolanaAccountMeta {
20    /// Account public key (base58-encoded)
21    pub pubkey: String,
22    /// Whether the account is a signer
23    pub is_signer: bool,
24    /// Whether the account is writable
25    pub is_writable: bool,
26}