bsv-wallet-toolbox 0.2.23

Pure Rust BSV wallet-toolbox implementation
Documentation
//! Settings table struct.
//!
//! Maps to TS `TableSettings` in `wallet-toolbox/src/storage/schema/tables/TableSettings.ts`.

use chrono::NaiveDateTime;
use serde::{Deserialize, Serialize};
use sqlx::FromRow;

use crate::types::Chain;

/// Storage configuration settings.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, FromRow)]
#[serde(rename_all = "camelCase")]
#[sqlx(rename_all = "camelCase")]
pub struct Settings {
    /// When this record was created.
    #[sqlx(rename = "created_at")]
    #[serde(
        rename = "created_at",
        alias = "createdAt",
        with = "crate::serde_datetime"
    )]
    pub created_at: NaiveDateTime,
    /// When this record was last updated.
    #[sqlx(rename = "updated_at")]
    #[serde(
        rename = "updated_at",
        alias = "updatedAt",
        with = "crate::serde_datetime"
    )]
    pub updated_at: NaiveDateTime,
    /// Identity key identifying this storage instance.
    pub storage_identity_key: String,
    /// Human-readable name for this storage.
    pub storage_name: String,
    /// BSV network chain (main or test).
    pub chain: Chain,
    /// Database type identifier (e.g., "SQLite").
    pub dbtype: String,
    /// Maximum locking script size to store inline (bytes).
    pub max_output_script: i32,
    /// Serialized JSON blob of WalletSettings. NULL means use defaults.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub wallet_settings_json: Option<String>,
}