0.1.0
This commit is contained in:
31
kb-lib/src/model/observation.rs
Normal file
31
kb-lib/src/model/observation.rs
Normal file
@@ -0,0 +1,31 @@
|
||||
// file: kb-lib/src/model/observation.rs
|
||||
// version: 4
|
||||
|
||||
//! 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_model/observation/ProgramObservation.ts"
|
||||
)]
|
||||
pub struct ProgramObservation {
|
||||
/// Transaction signature.
|
||||
pub signature: crate::Signature,
|
||||
/// Transaction slot.
|
||||
pub slot: crate::Slot,
|
||||
/// Instruction path.
|
||||
pub instruction_path: crate::InstructionPath,
|
||||
/// Program id.
|
||||
pub program_id: crate::ProgramId,
|
||||
/// 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,
|
||||
}
|
||||
Reference in New Issue
Block a user