// file: crates/ksp-app-store-desk/src/dto_account.rs // version: 1 //! Application-owned DTOs for RAW account-state inspection and detail commands. use ts_rs::TS; // rust-rules: trait-import /// Bounded Store-owned query request projected from one DataTables page request. #[derive(Debug, serde::Deserialize, TS)] #[serde(rename_all = "camelCase")] #[ts(export, export_to = "../frontend/ts/bindings/ksp_app_store_desk/dto_account/StoreAccountQueryRequestDto.ts")] pub(crate) struct StoreAccountQueryRequestDto { /// Stable Store sort direction code (`ascending` or `descending`). pub(crate) direction: String, /// Whitelisted page size (`25`, `50`, or `100`). pub(crate) limit: u32, /// Absolute zero-based inspection offset encoded as exact decimal text. pub(crate) offset: String, /// Optional exact account public key in canonical base58 text. pub(crate) pubkey: std::option::Option, /// Optional inclusive maximum slot encoded as decimal text. pub(crate) slot_max: std::option::Option, /// Optional inclusive minimum slot encoded as decimal text. pub(crate) slot_min: std::option::Option, } /// Data-free RAW account-state row returned to the server-side DataTables adapter. #[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, TS)] #[serde(rename_all = "camelCase")] #[ts(export, export_to = "../frontend/ts/bindings/ksp_app_store_desk/dto_account/StoreAccountRowDto.ts")] pub(crate) struct StoreAccountRowDto { /// Exact complete account-data length encoded as decimal text. pub(crate) data_length_decimal: String, /// Whether the account is executable. pub(crate) executable: bool, /// Exact lamport balance encoded as decimal text. pub(crate) lamports_decimal: String, /// Account owner program public key in canonical base58 text. pub(crate) owner: String, /// Account public key in canonical base58 text. pub(crate) pubkey: String, /// Exact rent epoch encoded as decimal text. pub(crate) rent_epoch_decimal: String, /// Solana slot encoded as exact decimal text. pub(crate) slot_decimal: String, /// Canonical account-state hash encoded as lower-case hexadecimal text. pub(crate) state_hash: String, } /// Server-side account-state table result using exact decimal counts. #[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, TS)] #[serde(rename_all = "camelCase")] #[ts(export, export_to = "../frontend/ts/bindings/ksp_app_store_desk/dto_account/StoreAccountQueryResponseDto.ts")] pub(crate) struct StoreAccountQueryResponseDto { /// Exact count after optional Store filters. pub(crate) records_filtered_decimal: String, /// Exact count in the mandatory Store network scope before optional filters. pub(crate) records_total_decimal: String, /// Data-free inspection rows for the requested random-access page. pub(crate) rows: std::vec::Vec, } /// App-owned identity request for one explicit RAW account-state detail load. #[derive(Debug, serde::Deserialize, TS)] #[serde(rename_all = "camelCase")] #[ts(export, export_to = "../frontend/ts/bindings/ksp_app_store_desk/dto_account/StoreAccountDetailRequestDto.ts")] pub(crate) struct StoreAccountDetailRequestDto { /// Account public key in canonical base58 text. pub(crate) pubkey: String, /// Solana slot encoded as exact decimal text. pub(crate) slot: String, /// Canonical account-state hash encoded as lower-case hexadecimal text. pub(crate) state_hash: String, } /// Bounded detail projection for one complete RAW account state. #[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, TS)] #[serde(rename_all = "camelCase")] #[ts(export, export_to = "../frontend/ts/bindings/ksp_app_store_desk/dto_account/StoreAccountDetailDto.ts")] pub(crate) struct StoreAccountDetailDto { /// Exact complete account-data length encoded as decimal text. pub(crate) data_length_decimal: String, /// Bounded lower-case hexadecimal preview of complete canonical account data. pub(crate) data_preview_hex: String, /// Whether complete account data is larger than the returned preview. pub(crate) data_preview_truncated: bool, /// Whether the account is executable. pub(crate) executable: bool, /// Exact lamport balance encoded as decimal text. pub(crate) lamports_decimal: String, /// Account owner program public key in canonical base58 text. pub(crate) owner: String, /// Account public key in canonical base58 text. pub(crate) pubkey: String, /// Exact rent epoch encoded as decimal text. pub(crate) rent_epoch_decimal: String, /// Solana slot encoded as exact decimal text. pub(crate) slot_decimal: String, /// Canonical account-state hash encoded as lower-case hexadecimal text. pub(crate) state_hash: String, } #[cfg(test)] #[path = "../unit_tests/dto_account.rs"] mod tests;