32 lines
1018 B
Rust
32 lines
1018 B
Rust
// file: kb-lib/src/model/observation.rs
|
|
// version: 5
|
|
|
|
//! Shared program observation model.
|
|
|
|
use ts_rs::TS; // rust-rules: derive-import
|
|
|
|
/// Generic program observation derived from a Solana instruction.
|
|
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
|
|
#[ts(
|
|
export,
|
|
export_to = "../frontend/ts/bindings/kb_lib/model/observation/ProgramObservation.ts"
|
|
)]
|
|
pub struct MdProgramObservation {
|
|
/// Transaction signature.
|
|
pub signature: crate::MdSignature,
|
|
/// Transaction slot.
|
|
pub slot: crate::MdSlot,
|
|
/// Instruction path.
|
|
pub instruction_path: crate::MdInstructionPath,
|
|
/// Program id.
|
|
pub program_id: crate::MdProgramId,
|
|
/// Optional 8-byte discriminator in hexadecimal.
|
|
pub discriminator_8: std::option::Option<std::string::String>,
|
|
/// Raw instruction data length.
|
|
pub data_len: usize,
|
|
/// Number of instruction accounts.
|
|
pub accounts_len: usize,
|
|
/// Whether the source transaction failed.
|
|
pub failed: bool,
|
|
}
|