hanzo_client/models/wallet.rs
1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Wallet {
16 #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
17 pub account_id: Option<String>,
18 /// Address is the on-chain address. For kms/mpc/treasury it is the EOA a signature from this wallet recovers to; for safe it is the CREATE2 address of the Safe CONTRACT, which holds no key — its approvals recover to the MPC owner instead. Rotating a kms wallet mints a new key and therefore a NEW address, and funds and approvals at the old one do not follow; mpc, treasury and safe addresses are invariant under rotation.
19 #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
20 pub address: Option<String>,
21 #[serde(rename = "agent", skip_serializing_if = "Option::is_none")]
22 pub agent: Option<String>,
23 /// Chain is the EVM chain the wallet is bound to, CAIP-2 \"eip155:<n>\" or a bare decimal chain id. Empty is chain-agnostic: the ring signs an unbound digest, and a Safe falls back to the Hanzo L1 (36963) because a Safe and its EIP-712 domain must be chain-bound.
24 #[serde(rename = "chain", skip_serializing_if = "Option::is_none")]
25 pub chain: Option<String>,
26 /// CreatedAt is when the wallet was provisioned, Unix seconds. Listings order by it, newest first.
27 #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
28 pub created_at: Option<i32>,
29 /// Custody is the backend holding the signing material, fixed at creation: \"kms\" (a secp256k1 key sealed under KMS and opened in-process), \"mpc\" or \"treasury\" (an m-of-n threshold key on the deployed ring, which differ by governance and not by signing mechanics), or \"safe\" (a Safe contract owned by an MPC key). A kind the deployment has not wired refuses with 503 rather than fabricating a signature.
30 #[serde(rename = "custody", skip_serializing_if = "Option::is_none")]
31 pub custody: Option<String>,
32 /// FinanceAccount is the finance ledger account bound to this wallet — the lookup that turns a ledger account back into an on-chain signer. Absent is the normal state and means unbound; the column is NULL until something binds it.
33 #[serde(rename = "financeAccount", skip_serializing_if = "Option::is_none")]
34 pub finance_account: Option<String>,
35 /// ID is the wallet id, minted by the server as \"wal_\" + 24 hex. It is the last segment of the key ref, and it is the LEDGER SUBJECT an x402 payment into this wallet credits — so it names money as well as key material.
36 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
37 pub id: Option<String>,
38 /// Name is the display label given at creation. It addresses nothing: the key ref is derived from the scope and the id, so renaming moves no material.
39 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
40 pub name: Option<String>,
41 #[serde(rename = "org", skip_serializing_if = "Option::is_none")]
42 pub org: Option<String>,
43 #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
44 pub project: Option<String>,
45 /// Tier is the wallet tier the ring keys its TierPolicy on: hot, warm, cold, gas, bridge, contract_admin, validator, quarantine or disaster_recovery. It defaults to hot and is refused at the boundary if it is none of the nine.
46 #[serde(rename = "tier", skip_serializing_if = "Option::is_none")]
47 pub tier: Option<String>,
48}
49
50impl Wallet {
51 pub fn new() -> Wallet {
52 Wallet {
53 account_id: None,
54 address: None,
55 agent: None,
56 chain: None,
57 created_at: None,
58 custody: None,
59 finance_account: None,
60 id: None,
61 name: None,
62 org: None,
63 project: None,
64 tier: None,
65 }
66 }
67}
68