btcpay_client/models/
generate_on_chain_wallet_request.rs

1/*
2 * BTCPay Greenfield API
3 *
4 * A full API to use your BTCPay Server
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct GenerateOnChainWalletRequest {
16    /// An existing BIP39 mnemonic seed to generate the wallet with
17    #[serde(rename = "existingMnemonic", skip_serializing_if = "Option::is_none")]
18    pub existing_mnemonic: Option<String>,
19    /// A passphrase for the BIP39 mnemonic seed
20    #[serde(rename = "passphrase", skip_serializing_if = "Option::is_none")]
21    pub passphrase: Option<String>,
22    /// The account to derive from the BIP39 mnemonic seed
23    #[serde(rename = "accountNumber", skip_serializing_if = "Option::is_none")]
24    pub account_number: Option<f32>,
25    /// Whether to store the seed inside BTCPay Server to enable some additional services. IF `false` AND `existingMnemonic` IS NOT SPECIFIED, BE SURE TO SECURELY STORE THE SEED IN THE RESPONSE!
26    #[serde(rename = "savePrivateKeys", skip_serializing_if = "Option::is_none")]
27    pub save_private_keys: Option<bool>,
28    /// Whether to import all addresses generated via BTCPay Server into the underlying node wallet. (Private keys will also be imported if `savePrivateKeys` is set to true.
29    #[serde(rename = "importKeysToRPC", skip_serializing_if = "Option::is_none")]
30    pub import_keys_to_rpc: Option<bool>,
31    /// If `existingMnemonic` is not set, a mnemonic is generated using the specified wordList.
32    #[serde(rename = "wordList", skip_serializing_if = "Option::is_none")]
33    pub word_list: Option<WordList>,
34    /// If `existingMnemonic` is not set, a mnemonic is generated using the specified wordCount.
35    #[serde(rename = "wordCount", skip_serializing_if = "Option::is_none")]
36    pub word_count: Option<WordCount>,
37    /// the type of wallet to generate
38    #[serde(rename = "scriptPubKeyType", skip_serializing_if = "Option::is_none")]
39    pub script_pub_key_type: Option<ScriptPubKeyType>,
40}
41
42impl GenerateOnChainWalletRequest {
43    pub fn new() -> GenerateOnChainWalletRequest {
44        GenerateOnChainWalletRequest {
45            existing_mnemonic: None,
46            passphrase: None,
47            account_number: None,
48            save_private_keys: None,
49            import_keys_to_rpc: None,
50            word_list: None,
51            word_count: None,
52            script_pub_key_type: None,
53        }
54    }
55}
56
57/// If `existingMnemonic` is not set, a mnemonic is generated using the specified wordList.
58#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
59pub enum WordList {
60    #[serde(rename = "English")]
61    English,
62    #[serde(rename = "Japanese")]
63    Japanese,
64    #[serde(rename = "Spanish")]
65    Spanish,
66    #[serde(rename = "ChineseSimplified")]
67    ChineseSimplified,
68    #[serde(rename = "ChineseTraditional")]
69    ChineseTraditional,
70    #[serde(rename = "French")]
71    French,
72    #[serde(rename = "PortugueseBrazil")]
73    PortugueseBrazil,
74    #[serde(rename = "Czech")]
75    Czech,
76}
77
78impl Default for WordList {
79    fn default() -> WordList {
80        Self::English
81    }
82}
83/// If `existingMnemonic` is not set, a mnemonic is generated using the specified wordCount.
84#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
85pub enum WordCount {
86    #[serde(rename = "12")]
87    _12,
88    #[serde(rename = "15")]
89    _15,
90    #[serde(rename = "18")]
91    _18,
92    #[serde(rename = "21")]
93    _21,
94    #[serde(rename = "24")]
95    _24,
96}
97
98impl Default for WordCount {
99    fn default() -> WordCount {
100        Self::_12
101    }
102}
103/// the type of wallet to generate
104#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
105pub enum ScriptPubKeyType {
106    #[serde(rename = "Legacy")]
107    Legacy,
108    #[serde(rename = "Segwit")]
109    Segwit,
110    #[serde(rename = "SegwitP2SH")]
111    SegwitP2SH,
112}
113
114impl Default for ScriptPubKeyType {
115    fn default() -> ScriptPubKeyType {
116        Self::Legacy
117    }
118}
119