1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! 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>,
}