bitbox_api/
shiftcrypto.bitbox02.rs

1// This file is @generated by prost-build.
2#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
3#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct PubResponse {
6    #[prost(string, tag = "1")]
7    pub r#pub: ::prost::alloc::string::String,
8}
9#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
10#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
11#[derive(Clone, PartialEq, ::prost::Message)]
12pub struct PubsResponse {
13    #[prost(string, repeated, tag = "1")]
14    pub pubs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
15}
16#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
17#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
18#[derive(Clone, Copy, PartialEq, ::prost::Message)]
19pub struct RootFingerprintRequest {}
20#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
21#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct RootFingerprintResponse {
24    #[prost(bytes = "vec", tag = "1")]
25    #[cfg_attr(feature = "wasm", serde(deserialize_with = "hex::serde::deserialize"))]
26    pub fingerprint: ::prost::alloc::vec::Vec<u8>,
27}
28/// See <https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki.>
29/// version field dropped as it will set dynamically based on the context (xpub, ypub, etc.).
30#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
31#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
32#[derive(Clone, PartialEq, ::prost::Message)]
33pub struct XPub {
34    #[prost(bytes = "vec", tag = "1")]
35    pub depth: ::prost::alloc::vec::Vec<u8>,
36    #[prost(bytes = "vec", tag = "2")]
37    pub parent_fingerprint: ::prost::alloc::vec::Vec<u8>,
38    #[prost(uint32, tag = "3")]
39    pub child_num: u32,
40    #[prost(bytes = "vec", tag = "4")]
41    pub chain_code: ::prost::alloc::vec::Vec<u8>,
42    #[prost(bytes = "vec", tag = "5")]
43    pub public_key: ::prost::alloc::vec::Vec<u8>,
44}
45/// This message exists for use in oneof or repeated fields, where one can't inline `repeated uint32` due to protobuf rules.
46#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
47#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
48#[derive(Clone, PartialEq, ::prost::Message)]
49pub struct Keypath {
50    #[prost(uint32, repeated, tag = "1")]
51    #[cfg_attr(
52        feature = "wasm",
53        serde(deserialize_with = "crate::keypath::serde_deserialize")
54    )]
55    pub keypath: ::prost::alloc::vec::Vec<u32>,
56}
57#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
58#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
59#[cfg_attr(feature = "wasm", serde(try_from = "crate::btc::KeyOriginInfo"))]
60#[derive(Clone, PartialEq, ::prost::Message)]
61pub struct KeyOriginInfo {
62    #[prost(bytes = "vec", tag = "1")]
63    pub root_fingerprint: ::prost::alloc::vec::Vec<u8>,
64    #[prost(uint32, repeated, tag = "2")]
65    #[cfg_attr(
66        feature = "wasm",
67        serde(deserialize_with = "crate::keypath::serde_deserialize")
68    )]
69    pub keypath: ::prost::alloc::vec::Vec<u32>,
70    #[prost(message, optional, tag = "3")]
71    pub xpub: ::core::option::Option<XPub>,
72}
73#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
74#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
75#[derive(Clone, Copy, PartialEq, ::prost::Message)]
76pub struct CheckBackupRequest {
77    #[prost(bool, tag = "1")]
78    pub silent: bool,
79}
80#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
81#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct CheckBackupResponse {
84    #[prost(string, tag = "1")]
85    pub id: ::prost::alloc::string::String,
86}
87/// Timestamp must be in UTC
88#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
89#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
90#[derive(Clone, Copy, PartialEq, ::prost::Message)]
91pub struct CreateBackupRequest {
92    #[prost(uint32, tag = "1")]
93    pub timestamp: u32,
94    #[prost(int32, tag = "2")]
95    pub timezone_offset: i32,
96}
97#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
98#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
99#[derive(Clone, Copy, PartialEq, ::prost::Message)]
100pub struct ListBackupsRequest {}
101#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
102#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
103#[derive(Clone, PartialEq, ::prost::Message)]
104pub struct BackupInfo {
105    #[prost(string, tag = "1")]
106    pub id: ::prost::alloc::string::String,
107    #[prost(uint32, tag = "2")]
108    pub timestamp: u32,
109    /// uint32 timezone_offset = 3;
110    #[prost(string, tag = "4")]
111    pub name: ::prost::alloc::string::String,
112}
113#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
114#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
115#[derive(Clone, PartialEq, ::prost::Message)]
116pub struct ListBackupsResponse {
117    #[prost(message, repeated, tag = "1")]
118    pub info: ::prost::alloc::vec::Vec<BackupInfo>,
119}
120#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
121#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
122#[derive(Clone, PartialEq, ::prost::Message)]
123pub struct RestoreBackupRequest {
124    #[prost(string, tag = "1")]
125    pub id: ::prost::alloc::string::String,
126    #[prost(uint32, tag = "2")]
127    pub timestamp: u32,
128    #[prost(int32, tag = "3")]
129    pub timezone_offset: i32,
130}
131#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
132#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
133#[derive(Clone, Copy, PartialEq, ::prost::Message)]
134pub struct CheckSdCardRequest {}
135#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
136#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
137#[derive(Clone, Copy, PartialEq, ::prost::Message)]
138pub struct CheckSdCardResponse {
139    #[prost(bool, tag = "1")]
140    pub inserted: bool,
141}
142#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
143#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
144#[derive(Clone, Copy, PartialEq, ::prost::Message)]
145pub struct DeviceInfoRequest {}
146#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
147#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
148#[derive(Clone, PartialEq, ::prost::Message)]
149pub struct DeviceInfoResponse {
150    #[prost(string, tag = "1")]
151    pub name: ::prost::alloc::string::String,
152    #[prost(bool, tag = "2")]
153    pub initialized: bool,
154    #[prost(string, tag = "3")]
155    pub version: ::prost::alloc::string::String,
156    #[prost(bool, tag = "4")]
157    pub mnemonic_passphrase_enabled: bool,
158    #[prost(uint32, tag = "5")]
159    pub monotonic_increments_remaining: u32,
160    /// From v9.6.0: "ATECC608A" or "ATECC608B".
161    #[prost(string, tag = "6")]
162    pub securechip_model: ::prost::alloc::string::String,
163    /// Only present in Bluetooth-enabled devices.
164    #[prost(message, optional, tag = "7")]
165    pub bluetooth: ::core::option::Option<device_info_response::Bluetooth>,
166}
167/// Nested message and enum types in `DeviceInfoResponse`.
168pub mod device_info_response {
169    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
170    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
171    #[derive(Clone, PartialEq, ::prost::Message)]
172    pub struct Bluetooth {
173        /// Hash of the currently active Bluetooth firmware on the device.
174        #[prost(bytes = "vec", tag = "1")]
175        pub firmware_hash: ::prost::alloc::vec::Vec<u8>,
176        /// Firmware version, formated as an unsigned integer "1", "2", etc.
177        #[prost(string, tag = "2")]
178        pub firmware_version: ::prost::alloc::string::String,
179        /// True if Bluetooth is enabled
180        #[prost(bool, tag = "3")]
181        pub enabled: bool,
182    }
183}
184#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
185#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
186#[derive(Clone, Copy, PartialEq, ::prost::Message)]
187pub struct InsertRemoveSdCardRequest {
188    #[prost(enumeration = "insert_remove_sd_card_request::SdCardAction", tag = "1")]
189    pub action: i32,
190}
191/// Nested message and enum types in `InsertRemoveSDCardRequest`.
192pub mod insert_remove_sd_card_request {
193    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
194    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
195    #[derive(
196        Clone,
197        Copy,
198        Debug,
199        PartialEq,
200        Eq,
201        Hash,
202        PartialOrd,
203        Ord,
204        ::prost::Enumeration
205    )]
206    #[repr(i32)]
207    pub enum SdCardAction {
208        RemoveCard = 0,
209        InsertCard = 1,
210    }
211    impl SdCardAction {
212        /// String value of the enum field names used in the ProtoBuf definition.
213        ///
214        /// The values are not transformed in any way and thus are considered stable
215        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
216        pub fn as_str_name(&self) -> &'static str {
217            match self {
218                Self::RemoveCard => "REMOVE_CARD",
219                Self::InsertCard => "INSERT_CARD",
220            }
221        }
222        /// Creates an enum from field names used in the ProtoBuf definition.
223        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
224            match value {
225                "REMOVE_CARD" => Some(Self::RemoveCard),
226                "INSERT_CARD" => Some(Self::InsertCard),
227                _ => None,
228            }
229        }
230    }
231}
232#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
233#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
234#[derive(Clone, Copy, PartialEq, ::prost::Message)]
235pub struct ResetRequest {}
236#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
237#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
238#[derive(Clone, PartialEq, ::prost::Message)]
239pub struct SetDeviceLanguageRequest {
240    #[prost(string, tag = "1")]
241    pub language: ::prost::alloc::string::String,
242}
243#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
244#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
245#[derive(Clone, PartialEq, ::prost::Message)]
246pub struct SetDeviceNameRequest {
247    #[prost(string, tag = "1")]
248    pub name: ::prost::alloc::string::String,
249}
250#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
251#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
252#[derive(Clone, PartialEq, ::prost::Message)]
253pub struct SetPasswordRequest {
254    #[prost(bytes = "vec", tag = "1")]
255    pub entropy: ::prost::alloc::vec::Vec<u8>,
256}
257#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
258#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
259#[derive(Clone, Copy, PartialEq, ::prost::Message)]
260pub struct BluetoothToggleEnabledRequest {}
261#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
262#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
263#[derive(Clone, Copy, PartialEq, ::prost::Message)]
264pub struct BluetoothUpgradeInitRequest {
265    #[prost(uint32, tag = "1")]
266    pub firmware_length: u32,
267}
268#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
269#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
270#[derive(Clone, PartialEq, ::prost::Message)]
271pub struct BluetoothChunkRequest {
272    #[prost(bytes = "vec", tag = "1")]
273    pub data: ::prost::alloc::vec::Vec<u8>,
274}
275#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
276#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
277#[derive(Clone, Copy, PartialEq, ::prost::Message)]
278pub struct BluetoothSuccess {}
279#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
280#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
281#[derive(Clone, Copy, PartialEq, ::prost::Message)]
282pub struct BluetoothRequestChunkResponse {
283    #[prost(uint32, tag = "1")]
284    pub offset: u32,
285    #[prost(uint32, tag = "2")]
286    pub length: u32,
287}
288#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
289#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
290#[derive(Clone, PartialEq, ::prost::Message)]
291pub struct BluetoothRequest {
292    #[prost(oneof = "bluetooth_request::Request", tags = "1, 2, 3")]
293    pub request: ::core::option::Option<bluetooth_request::Request>,
294}
295/// Nested message and enum types in `BluetoothRequest`.
296pub mod bluetooth_request {
297    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
298    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
299    #[derive(Clone, PartialEq, ::prost::Oneof)]
300    pub enum Request {
301        #[prost(message, tag = "1")]
302        UpgradeInit(super::BluetoothUpgradeInitRequest),
303        #[prost(message, tag = "2")]
304        Chunk(super::BluetoothChunkRequest),
305        #[prost(message, tag = "3")]
306        ToggleEnabled(super::BluetoothToggleEnabledRequest),
307    }
308}
309#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
310#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
311#[derive(Clone, Copy, PartialEq, ::prost::Message)]
312pub struct BluetoothResponse {
313    #[prost(oneof = "bluetooth_response::Response", tags = "1, 2")]
314    pub response: ::core::option::Option<bluetooth_response::Response>,
315}
316/// Nested message and enum types in `BluetoothResponse`.
317pub mod bluetooth_response {
318    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
319    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
320    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
321    pub enum Response {
322        #[prost(message, tag = "1")]
323        Success(super::BluetoothSuccess),
324        #[prost(message, tag = "2")]
325        RequestChunk(super::BluetoothRequestChunkResponse),
326    }
327}
328#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
329#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
330#[derive(Clone, PartialEq, ::prost::Message)]
331pub struct AntiKleptoHostNonceCommitment {
332    #[prost(bytes = "vec", tag = "1")]
333    pub commitment: ::prost::alloc::vec::Vec<u8>,
334}
335#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
336#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
337#[derive(Clone, PartialEq, ::prost::Message)]
338pub struct AntiKleptoSignerCommitment {
339    #[prost(bytes = "vec", tag = "1")]
340    pub commitment: ::prost::alloc::vec::Vec<u8>,
341}
342#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
343#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
344#[derive(Clone, PartialEq, ::prost::Message)]
345pub struct AntiKleptoSignatureRequest {
346    #[prost(bytes = "vec", tag = "1")]
347    pub host_nonce: ::prost::alloc::vec::Vec<u8>,
348}
349#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
350#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
351#[cfg_attr(feature = "wasm", serde(try_from = "crate::btc::SerdeScriptConfig"))]
352#[derive(Clone, PartialEq, ::prost::Message)]
353pub struct BtcScriptConfig {
354    #[prost(oneof = "btc_script_config::Config", tags = "1, 2, 3")]
355    pub config: ::core::option::Option<btc_script_config::Config>,
356}
357/// Nested message and enum types in `BTCScriptConfig`.
358pub mod btc_script_config {
359    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
360    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
361    #[derive(Clone, PartialEq, ::prost::Message)]
362    pub struct Multisig {
363        #[prost(uint32, tag = "1")]
364        pub threshold: u32,
365        /// xpubs are acount-level xpubs. Addresses are going to be derived from it using: `m/<change>/<receive>`.
366        /// The number of xpubs defines the number of cosigners.
367        #[prost(message, repeated, tag = "2")]
368        pub xpubs: ::prost::alloc::vec::Vec<super::XPub>,
369        /// Index to the xpub of our keystore in xpubs. The keypath to it is provided via
370        /// BTCPubRequest/BTCSignInit.
371        #[prost(uint32, tag = "3")]
372        pub our_xpub_index: u32,
373        #[prost(enumeration = "multisig::ScriptType", tag = "4")]
374        pub script_type: i32,
375    }
376    /// Nested message and enum types in `Multisig`.
377    pub mod multisig {
378        #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
379        #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
380        #[derive(
381            Clone,
382            Copy,
383            Debug,
384            PartialEq,
385            Eq,
386            Hash,
387            PartialOrd,
388            Ord,
389            ::prost::Enumeration
390        )]
391        #[repr(i32)]
392        pub enum ScriptType {
393            /// native segwit v0 multisig (bech32 addresses)
394            P2wsh = 0,
395            /// wrapped segwit for legacy address compatibility
396            P2wshP2sh = 1,
397        }
398        impl ScriptType {
399            /// String value of the enum field names used in the ProtoBuf definition.
400            ///
401            /// The values are not transformed in any way and thus are considered stable
402            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
403            pub fn as_str_name(&self) -> &'static str {
404                match self {
405                    Self::P2wsh => "P2WSH",
406                    Self::P2wshP2sh => "P2WSH_P2SH",
407                }
408            }
409            /// Creates an enum from field names used in the ProtoBuf definition.
410            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
411                match value {
412                    "P2WSH" => Some(Self::P2wsh),
413                    "P2WSH_P2SH" => Some(Self::P2wshP2sh),
414                    _ => None,
415                }
416            }
417        }
418    }
419    /// A policy as specified by 'Wallet policies':
420    /// <https://github.com/bitcoin/bips/pull/1389>
421    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
422    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
423    #[derive(Clone, PartialEq, ::prost::Message)]
424    pub struct Policy {
425        #[prost(string, tag = "1")]
426        pub policy: ::prost::alloc::string::String,
427        #[prost(message, repeated, tag = "2")]
428        pub keys: ::prost::alloc::vec::Vec<super::KeyOriginInfo>,
429    }
430    /// SimpleType is a "simple" script: one public key, no additional inputs.
431    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
432    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
433    #[derive(
434        Clone,
435        Copy,
436        Debug,
437        PartialEq,
438        Eq,
439        Hash,
440        PartialOrd,
441        Ord,
442        ::prost::Enumeration
443    )]
444    #[repr(i32)]
445    pub enum SimpleType {
446        P2wpkhP2sh = 0,
447        P2wpkh = 1,
448        P2tr = 2,
449    }
450    impl SimpleType {
451        /// String value of the enum field names used in the ProtoBuf definition.
452        ///
453        /// The values are not transformed in any way and thus are considered stable
454        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
455        pub fn as_str_name(&self) -> &'static str {
456            match self {
457                Self::P2wpkhP2sh => "P2WPKH_P2SH",
458                Self::P2wpkh => "P2WPKH",
459                Self::P2tr => "P2TR",
460            }
461        }
462        /// Creates an enum from field names used in the ProtoBuf definition.
463        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
464            match value {
465                "P2WPKH_P2SH" => Some(Self::P2wpkhP2sh),
466                "P2WPKH" => Some(Self::P2wpkh),
467                "P2TR" => Some(Self::P2tr),
468                _ => None,
469            }
470        }
471    }
472    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
473    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
474    #[derive(Clone, PartialEq, ::prost::Oneof)]
475    pub enum Config {
476        #[prost(enumeration = "SimpleType", tag = "1")]
477        #[cfg_attr(
478            feature = "wasm",
479            serde(deserialize_with = "crate::btc::serde_deserialize_simple_type")
480        )]
481        SimpleType(i32),
482        #[prost(message, tag = "2")]
483        #[cfg_attr(
484            feature = "wasm",
485            serde(deserialize_with = "crate::btc::serde_deserialize_multisig")
486        )]
487        Multisig(Multisig),
488        #[prost(message, tag = "3")]
489        Policy(Policy),
490    }
491}
492#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
493#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
494#[derive(Clone, PartialEq, ::prost::Message)]
495pub struct BtcPubRequest {
496    #[prost(enumeration = "BtcCoin", tag = "1")]
497    pub coin: i32,
498    #[prost(uint32, repeated, tag = "2")]
499    #[cfg_attr(
500        feature = "wasm",
501        serde(deserialize_with = "crate::keypath::serde_deserialize")
502    )]
503    pub keypath: ::prost::alloc::vec::Vec<u32>,
504    #[prost(bool, tag = "5")]
505    pub display: bool,
506    #[prost(oneof = "btc_pub_request::Output", tags = "3, 4")]
507    pub output: ::core::option::Option<btc_pub_request::Output>,
508}
509/// Nested message and enum types in `BTCPubRequest`.
510pub mod btc_pub_request {
511    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
512    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
513    #[derive(
514        Clone,
515        Copy,
516        Debug,
517        PartialEq,
518        Eq,
519        Hash,
520        PartialOrd,
521        Ord,
522        ::prost::Enumeration
523    )]
524    #[repr(i32)]
525    pub enum XPubType {
526        Tpub = 0,
527        Xpub = 1,
528        Ypub = 2,
529        /// zpub
530        Zpub = 3,
531        /// vpub
532        Vpub = 4,
533        Upub = 5,
534        /// Vpub
535        #[cfg_attr(feature = "wasm", serde(rename = "Vpub"))]
536        CapitalVpub = 6,
537        /// Zpub
538        #[cfg_attr(feature = "wasm", serde(rename = "Zpub"))]
539        CapitalZpub = 7,
540        /// Upub
541        #[cfg_attr(feature = "wasm", serde(rename = "Upub"))]
542        CapitalUpub = 8,
543        /// Ypub
544        #[cfg_attr(feature = "wasm", serde(rename = "Ypub"))]
545        CapitalYpub = 9,
546    }
547    impl XPubType {
548        /// String value of the enum field names used in the ProtoBuf definition.
549        ///
550        /// The values are not transformed in any way and thus are considered stable
551        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
552        pub fn as_str_name(&self) -> &'static str {
553            match self {
554                Self::Tpub => "TPUB",
555                Self::Xpub => "XPUB",
556                Self::Ypub => "YPUB",
557                Self::Zpub => "ZPUB",
558                Self::Vpub => "VPUB",
559                Self::Upub => "UPUB",
560                Self::CapitalVpub => "CAPITAL_VPUB",
561                Self::CapitalZpub => "CAPITAL_ZPUB",
562                Self::CapitalUpub => "CAPITAL_UPUB",
563                Self::CapitalYpub => "CAPITAL_YPUB",
564            }
565        }
566        /// Creates an enum from field names used in the ProtoBuf definition.
567        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
568            match value {
569                "TPUB" => Some(Self::Tpub),
570                "XPUB" => Some(Self::Xpub),
571                "YPUB" => Some(Self::Ypub),
572                "ZPUB" => Some(Self::Zpub),
573                "VPUB" => Some(Self::Vpub),
574                "UPUB" => Some(Self::Upub),
575                "CAPITAL_VPUB" => Some(Self::CapitalVpub),
576                "CAPITAL_ZPUB" => Some(Self::CapitalZpub),
577                "CAPITAL_UPUB" => Some(Self::CapitalUpub),
578                "CAPITAL_YPUB" => Some(Self::CapitalYpub),
579                _ => None,
580            }
581        }
582    }
583    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
584    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
585    #[derive(Clone, PartialEq, ::prost::Oneof)]
586    pub enum Output {
587        #[prost(enumeration = "XPubType", tag = "3")]
588        XpubType(i32),
589        #[prost(message, tag = "4")]
590        ScriptConfig(super::BtcScriptConfig),
591    }
592}
593#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
594#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
595#[derive(Clone, PartialEq, ::prost::Message)]
596pub struct BtcXpubsRequest {
597    #[prost(enumeration = "BtcCoin", tag = "1")]
598    pub coin: i32,
599    #[prost(enumeration = "btc_xpubs_request::XPubType", tag = "2")]
600    pub xpub_type: i32,
601    #[prost(message, repeated, tag = "3")]
602    pub keypaths: ::prost::alloc::vec::Vec<Keypath>,
603}
604/// Nested message and enum types in `BTCXpubsRequest`.
605pub mod btc_xpubs_request {
606    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
607    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
608    #[derive(
609        Clone,
610        Copy,
611        Debug,
612        PartialEq,
613        Eq,
614        Hash,
615        PartialOrd,
616        Ord,
617        ::prost::Enumeration
618    )]
619    #[repr(i32)]
620    pub enum XPubType {
621        Unknown = 0,
622        Xpub = 1,
623        Tpub = 2,
624    }
625    impl XPubType {
626        /// String value of the enum field names used in the ProtoBuf definition.
627        ///
628        /// The values are not transformed in any way and thus are considered stable
629        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
630        pub fn as_str_name(&self) -> &'static str {
631            match self {
632                Self::Unknown => "UNKNOWN",
633                Self::Xpub => "XPUB",
634                Self::Tpub => "TPUB",
635            }
636        }
637        /// Creates an enum from field names used in the ProtoBuf definition.
638        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
639            match value {
640                "UNKNOWN" => Some(Self::Unknown),
641                "XPUB" => Some(Self::Xpub),
642                "TPUB" => Some(Self::Tpub),
643                _ => None,
644            }
645        }
646    }
647}
648#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
649#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
650#[derive(Clone, PartialEq, ::prost::Message)]
651pub struct BtcScriptConfigWithKeypath {
652    #[prost(message, optional, tag = "2")]
653    pub script_config: ::core::option::Option<BtcScriptConfig>,
654    #[prost(uint32, repeated, tag = "3")]
655    #[cfg_attr(
656        feature = "wasm",
657        serde(deserialize_with = "crate::keypath::serde_deserialize")
658    )]
659    pub keypath: ::prost::alloc::vec::Vec<u32>,
660}
661#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
662#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
663#[derive(Clone, PartialEq, ::prost::Message)]
664pub struct BtcSignInitRequest {
665    #[prost(enumeration = "BtcCoin", tag = "1")]
666    pub coin: i32,
667    /// used script configs in inputs and changes
668    #[prost(message, repeated, tag = "2")]
669    pub script_configs: ::prost::alloc::vec::Vec<BtcScriptConfigWithKeypath>,
670    /// must be 1 or 2
671    #[prost(uint32, tag = "4")]
672    pub version: u32,
673    #[prost(uint32, tag = "5")]
674    pub num_inputs: u32,
675    #[prost(uint32, tag = "6")]
676    pub num_outputs: u32,
677    /// must be <500000000
678    #[prost(uint32, tag = "7")]
679    pub locktime: u32,
680    #[prost(enumeration = "btc_sign_init_request::FormatUnit", tag = "8")]
681    pub format_unit: i32,
682    #[prost(bool, tag = "9")]
683    pub contains_silent_payment_outputs: bool,
684    /// used script configs for outputs that send to an address of the same keystore, but not
685    /// necessarily the same account (as defined by `script_configs` above).
686    #[prost(message, repeated, tag = "10")]
687    pub output_script_configs: ::prost::alloc::vec::Vec<BtcScriptConfigWithKeypath>,
688}
689/// Nested message and enum types in `BTCSignInitRequest`.
690pub mod btc_sign_init_request {
691    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
692    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
693    #[derive(
694        Clone,
695        Copy,
696        Debug,
697        PartialEq,
698        Eq,
699        Hash,
700        PartialOrd,
701        Ord,
702        ::prost::Enumeration
703    )]
704    #[repr(i32)]
705    pub enum FormatUnit {
706        /// According to `coin` (BTC, LTC, etc.).
707        Default = 0,
708        /// Only valid for BTC/TBTC, formats as "sat"/"tsat".
709        Sat = 1,
710    }
711    impl FormatUnit {
712        /// String value of the enum field names used in the ProtoBuf definition.
713        ///
714        /// The values are not transformed in any way and thus are considered stable
715        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
716        pub fn as_str_name(&self) -> &'static str {
717            match self {
718                Self::Default => "DEFAULT",
719                Self::Sat => "SAT",
720            }
721        }
722        /// Creates an enum from field names used in the ProtoBuf definition.
723        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
724            match value {
725                "DEFAULT" => Some(Self::Default),
726                "SAT" => Some(Self::Sat),
727                _ => None,
728            }
729        }
730    }
731}
732#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
733#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
734#[derive(Clone, PartialEq, ::prost::Message)]
735pub struct BtcSignNextResponse {
736    #[prost(enumeration = "btc_sign_next_response::Type", tag = "1")]
737    pub r#type: i32,
738    /// index of the current input or output
739    #[prost(uint32, tag = "2")]
740    pub index: u32,
741    /// only as a response to BTCSignInputRequest
742    #[prost(bool, tag = "3")]
743    pub has_signature: bool,
744    /// 64 bytes (32 bytes big endian R, 32 bytes big endian S). Only if has_signature is true.
745    #[prost(bytes = "vec", tag = "4")]
746    pub signature: ::prost::alloc::vec::Vec<u8>,
747    /// Previous tx's input/output index in case of PREV_INPUT or PREV_OUTPUT, for the input at `index`.
748    #[prost(uint32, tag = "5")]
749    pub prev_index: u32,
750    #[prost(message, optional, tag = "6")]
751    pub anti_klepto_signer_commitment: ::core::option::Option<
752        AntiKleptoSignerCommitment,
753    >,
754    /// Generated output. The host *must* verify its correctness using `silent_payment_dleq_proof`.
755    #[prost(bytes = "vec", tag = "7")]
756    pub generated_output_pkscript: ::prost::alloc::vec::Vec<u8>,
757    #[prost(bytes = "vec", tag = "8")]
758    pub silent_payment_dleq_proof: ::prost::alloc::vec::Vec<u8>,
759}
760/// Nested message and enum types in `BTCSignNextResponse`.
761pub mod btc_sign_next_response {
762    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
763    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
764    #[derive(
765        Clone,
766        Copy,
767        Debug,
768        PartialEq,
769        Eq,
770        Hash,
771        PartialOrd,
772        Ord,
773        ::prost::Enumeration
774    )]
775    #[repr(i32)]
776    pub enum Type {
777        Input = 0,
778        Output = 1,
779        Done = 2,
780        /// For the previous transaction at input `index`.
781        PrevtxInit = 3,
782        PrevtxInput = 4,
783        PrevtxOutput = 5,
784        HostNonce = 6,
785        PaymentRequest = 7,
786    }
787    impl Type {
788        /// String value of the enum field names used in the ProtoBuf definition.
789        ///
790        /// The values are not transformed in any way and thus are considered stable
791        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
792        pub fn as_str_name(&self) -> &'static str {
793            match self {
794                Self::Input => "INPUT",
795                Self::Output => "OUTPUT",
796                Self::Done => "DONE",
797                Self::PrevtxInit => "PREVTX_INIT",
798                Self::PrevtxInput => "PREVTX_INPUT",
799                Self::PrevtxOutput => "PREVTX_OUTPUT",
800                Self::HostNonce => "HOST_NONCE",
801                Self::PaymentRequest => "PAYMENT_REQUEST",
802            }
803        }
804        /// Creates an enum from field names used in the ProtoBuf definition.
805        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
806            match value {
807                "INPUT" => Some(Self::Input),
808                "OUTPUT" => Some(Self::Output),
809                "DONE" => Some(Self::Done),
810                "PREVTX_INIT" => Some(Self::PrevtxInit),
811                "PREVTX_INPUT" => Some(Self::PrevtxInput),
812                "PREVTX_OUTPUT" => Some(Self::PrevtxOutput),
813                "HOST_NONCE" => Some(Self::HostNonce),
814                "PAYMENT_REQUEST" => Some(Self::PaymentRequest),
815                _ => None,
816            }
817        }
818    }
819}
820#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
821#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
822#[derive(Clone, PartialEq, ::prost::Message)]
823pub struct BtcSignInputRequest {
824    #[prost(bytes = "vec", tag = "1")]
825    pub prev_out_hash: ::prost::alloc::vec::Vec<u8>,
826    #[prost(uint32, tag = "2")]
827    pub prev_out_index: u32,
828    #[prost(uint64, tag = "3")]
829    pub prev_out_value: u64,
830    /// must be 0xffffffff-2, 0xffffffff-1 or 0xffffffff
831    #[prost(uint32, tag = "4")]
832    pub sequence: u32,
833    /// all inputs must be ours.
834    #[prost(uint32, repeated, tag = "6")]
835    #[cfg_attr(
836        feature = "wasm",
837        serde(deserialize_with = "crate::keypath::serde_deserialize")
838    )]
839    pub keypath: ::prost::alloc::vec::Vec<u32>,
840    /// References a script config from BTCSignInitRequest
841    #[prost(uint32, tag = "7")]
842    pub script_config_index: u32,
843    #[prost(message, optional, tag = "8")]
844    pub host_nonce_commitment: ::core::option::Option<AntiKleptoHostNonceCommitment>,
845}
846#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
847#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
848#[derive(Clone, PartialEq, ::prost::Message)]
849pub struct BtcSignOutputRequest {
850    #[prost(bool, tag = "1")]
851    pub ours: bool,
852    /// if ours is false
853    #[prost(enumeration = "BtcOutputType", tag = "2")]
854    pub r#type: i32,
855    /// 20 bytes for p2pkh, p2sh, pw2wpkh. 32 bytes for p2wsh.
856    #[prost(uint64, tag = "3")]
857    pub value: u64,
858    /// if ours is false. Renamed from `hash`.
859    #[prost(bytes = "vec", tag = "4")]
860    pub payload: ::prost::alloc::vec::Vec<u8>,
861    /// if ours is true
862    #[prost(uint32, repeated, tag = "5")]
863    #[cfg_attr(
864        feature = "wasm",
865        serde(deserialize_with = "crate::keypath::serde_deserialize")
866    )]
867    pub keypath: ::prost::alloc::vec::Vec<u32>,
868    /// If ours is true and `output_script_config_index` is absent. References a script config from
869    /// BTCSignInitRequest. This allows change output identification and allows us to identify
870    /// non-change outputs to the same account, so we can display this info to the user.
871    #[prost(uint32, tag = "6")]
872    pub script_config_index: u32,
873    #[prost(uint32, optional, tag = "7")]
874    pub payment_request_index: ::core::option::Option<u32>,
875    /// If provided, `type` and `payload` is ignored. The generated output pkScript is returned in
876    /// BTCSignNextResponse. `contains_silent_payment_outputs` in the init request must be true.
877    #[prost(message, optional, tag = "8")]
878    pub silent_payment: ::core::option::Option<btc_sign_output_request::SilentPayment>,
879    /// If ours is true. If set, `script_config_index` is ignored. References an output script config
880    /// from BTCSignInitRequest. This enables verification that an output belongs to the same keystore,
881    /// even if it is from a different account than we spend from, allowing us to display this info to
882    /// the user.
883    #[prost(uint32, optional, tag = "9")]
884    pub output_script_config_index: ::core::option::Option<u32>,
885}
886/// Nested message and enum types in `BTCSignOutputRequest`.
887pub mod btc_sign_output_request {
888    /// <https://github.com/bitcoin/bips/blob/master/bip-0352.mediawiki>
889    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
890    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
891    #[derive(Clone, PartialEq, ::prost::Message)]
892    pub struct SilentPayment {
893        #[prost(string, tag = "1")]
894        pub address: ::prost::alloc::string::String,
895    }
896}
897#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
898#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
899#[derive(Clone, PartialEq, ::prost::Message)]
900pub struct BtcScriptConfigRegistration {
901    #[prost(enumeration = "BtcCoin", tag = "1")]
902    pub coin: i32,
903    #[prost(message, optional, tag = "2")]
904    pub script_config: ::core::option::Option<BtcScriptConfig>,
905    /// Unused for policy registrations.
906    #[prost(uint32, repeated, tag = "3")]
907    #[cfg_attr(
908        feature = "wasm",
909        serde(deserialize_with = "crate::keypath::serde_deserialize")
910    )]
911    pub keypath: ::prost::alloc::vec::Vec<u32>,
912}
913#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
914#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
915#[derive(Clone, Copy, PartialEq, ::prost::Message)]
916pub struct BtcSuccess {}
917#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
918#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
919#[derive(Clone, PartialEq, ::prost::Message)]
920pub struct BtcIsScriptConfigRegisteredRequest {
921    #[prost(message, optional, tag = "1")]
922    pub registration: ::core::option::Option<BtcScriptConfigRegistration>,
923}
924#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
925#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
926#[derive(Clone, Copy, PartialEq, ::prost::Message)]
927pub struct BtcIsScriptConfigRegisteredResponse {
928    #[prost(bool, tag = "1")]
929    pub is_registered: bool,
930}
931#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
932#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
933#[derive(Clone, PartialEq, ::prost::Message)]
934pub struct BtcRegisterScriptConfigRequest {
935    #[prost(message, optional, tag = "1")]
936    pub registration: ::core::option::Option<BtcScriptConfigRegistration>,
937    /// If empty, the name is entered on the device instead.
938    #[prost(string, tag = "2")]
939    pub name: ::prost::alloc::string::String,
940    #[prost(enumeration = "btc_register_script_config_request::XPubType", tag = "3")]
941    pub xpub_type: i32,
942}
943/// Nested message and enum types in `BTCRegisterScriptConfigRequest`.
944pub mod btc_register_script_config_request {
945    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
946    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
947    #[derive(
948        Clone,
949        Copy,
950        Debug,
951        PartialEq,
952        Eq,
953        Hash,
954        PartialOrd,
955        Ord,
956        ::prost::Enumeration
957    )]
958    #[repr(i32)]
959    pub enum XPubType {
960        /// Automatically choose to match Electrum's xpub format (e.g. Zpub/Vpub for p2wsh multisig mainnet/testnet).
961        AutoElectrum = 0,
962        /// Always xpub for mainnets, tpub for testnets.
963        AutoXpubTpub = 1,
964    }
965    impl XPubType {
966        /// String value of the enum field names used in the ProtoBuf definition.
967        ///
968        /// The values are not transformed in any way and thus are considered stable
969        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
970        pub fn as_str_name(&self) -> &'static str {
971            match self {
972                Self::AutoElectrum => "AUTO_ELECTRUM",
973                Self::AutoXpubTpub => "AUTO_XPUB_TPUB",
974            }
975        }
976        /// Creates an enum from field names used in the ProtoBuf definition.
977        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
978            match value {
979                "AUTO_ELECTRUM" => Some(Self::AutoElectrum),
980                "AUTO_XPUB_TPUB" => Some(Self::AutoXpubTpub),
981                _ => None,
982            }
983        }
984    }
985}
986#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
987#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
988#[derive(Clone, Copy, PartialEq, ::prost::Message)]
989pub struct BtcPrevTxInitRequest {
990    #[prost(uint32, tag = "1")]
991    pub version: u32,
992    #[prost(uint32, tag = "2")]
993    pub num_inputs: u32,
994    #[prost(uint32, tag = "3")]
995    pub num_outputs: u32,
996    #[prost(uint32, tag = "4")]
997    pub locktime: u32,
998}
999#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1000#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1001#[derive(Clone, PartialEq, ::prost::Message)]
1002pub struct BtcPrevTxInputRequest {
1003    #[prost(bytes = "vec", tag = "1")]
1004    pub prev_out_hash: ::prost::alloc::vec::Vec<u8>,
1005    #[prost(uint32, tag = "2")]
1006    pub prev_out_index: u32,
1007    #[prost(bytes = "vec", tag = "3")]
1008    pub signature_script: ::prost::alloc::vec::Vec<u8>,
1009    #[prost(uint32, tag = "4")]
1010    pub sequence: u32,
1011}
1012#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1013#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1014#[derive(Clone, PartialEq, ::prost::Message)]
1015pub struct BtcPrevTxOutputRequest {
1016    #[prost(uint64, tag = "1")]
1017    pub value: u64,
1018    #[prost(bytes = "vec", tag = "2")]
1019    pub pubkey_script: ::prost::alloc::vec::Vec<u8>,
1020}
1021#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1022#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1023#[derive(Clone, PartialEq, ::prost::Message)]
1024pub struct BtcPaymentRequestRequest {
1025    #[prost(string, tag = "1")]
1026    pub recipient_name: ::prost::alloc::string::String,
1027    #[prost(message, repeated, tag = "2")]
1028    pub memos: ::prost::alloc::vec::Vec<btc_payment_request_request::Memo>,
1029    #[prost(bytes = "vec", tag = "3")]
1030    pub nonce: ::prost::alloc::vec::Vec<u8>,
1031    #[prost(uint64, tag = "4")]
1032    pub total_amount: u64,
1033    #[prost(bytes = "vec", tag = "5")]
1034    pub signature: ::prost::alloc::vec::Vec<u8>,
1035}
1036/// Nested message and enum types in `BTCPaymentRequestRequest`.
1037pub mod btc_payment_request_request {
1038    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1039    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1040    #[derive(Clone, PartialEq, ::prost::Message)]
1041    pub struct Memo {
1042        #[prost(oneof = "memo::Memo", tags = "1")]
1043        pub memo: ::core::option::Option<memo::Memo>,
1044    }
1045    /// Nested message and enum types in `Memo`.
1046    pub mod memo {
1047        #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1048        #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1049        #[derive(Clone, PartialEq, ::prost::Message)]
1050        pub struct TextMemo {
1051            #[prost(string, tag = "1")]
1052            pub note: ::prost::alloc::string::String,
1053        }
1054        #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1055        #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1056        #[derive(Clone, PartialEq, ::prost::Oneof)]
1057        pub enum Memo {
1058            #[prost(message, tag = "1")]
1059            TextMemo(TextMemo),
1060        }
1061    }
1062}
1063#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1064#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1065#[derive(Clone, PartialEq, ::prost::Message)]
1066pub struct BtcSignMessageRequest {
1067    #[prost(enumeration = "BtcCoin", tag = "1")]
1068    pub coin: i32,
1069    #[prost(message, optional, tag = "2")]
1070    pub script_config: ::core::option::Option<BtcScriptConfigWithKeypath>,
1071    #[prost(bytes = "vec", tag = "3")]
1072    pub msg: ::prost::alloc::vec::Vec<u8>,
1073    #[prost(message, optional, tag = "4")]
1074    pub host_nonce_commitment: ::core::option::Option<AntiKleptoHostNonceCommitment>,
1075}
1076#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1077#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1078#[derive(Clone, PartialEq, ::prost::Message)]
1079pub struct BtcSignMessageResponse {
1080    /// 65 bytes (32 bytes big endian R, 32 bytes big endian S, 1 recid).
1081    #[prost(bytes = "vec", tag = "1")]
1082    pub signature: ::prost::alloc::vec::Vec<u8>,
1083}
1084#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1085#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1086#[derive(Clone, PartialEq, ::prost::Message)]
1087pub struct BtcRequest {
1088    #[prost(oneof = "btc_request::Request", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9")]
1089    pub request: ::core::option::Option<btc_request::Request>,
1090}
1091/// Nested message and enum types in `BTCRequest`.
1092pub mod btc_request {
1093    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1094    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1095    #[derive(Clone, PartialEq, ::prost::Oneof)]
1096    pub enum Request {
1097        #[prost(message, tag = "1")]
1098        IsScriptConfigRegistered(super::BtcIsScriptConfigRegisteredRequest),
1099        #[prost(message, tag = "2")]
1100        RegisterScriptConfig(super::BtcRegisterScriptConfigRequest),
1101        #[prost(message, tag = "3")]
1102        PrevtxInit(super::BtcPrevTxInitRequest),
1103        #[prost(message, tag = "4")]
1104        PrevtxInput(super::BtcPrevTxInputRequest),
1105        #[prost(message, tag = "5")]
1106        PrevtxOutput(super::BtcPrevTxOutputRequest),
1107        #[prost(message, tag = "6")]
1108        SignMessage(super::BtcSignMessageRequest),
1109        #[prost(message, tag = "7")]
1110        AntikleptoSignature(super::AntiKleptoSignatureRequest),
1111        #[prost(message, tag = "8")]
1112        PaymentRequest(super::BtcPaymentRequestRequest),
1113        #[prost(message, tag = "9")]
1114        Xpubs(super::BtcXpubsRequest),
1115    }
1116}
1117#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1118#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1119#[derive(Clone, PartialEq, ::prost::Message)]
1120pub struct BtcResponse {
1121    #[prost(oneof = "btc_response::Response", tags = "1, 2, 3, 4, 5, 6")]
1122    pub response: ::core::option::Option<btc_response::Response>,
1123}
1124/// Nested message and enum types in `BTCResponse`.
1125pub mod btc_response {
1126    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1127    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1128    #[derive(Clone, PartialEq, ::prost::Oneof)]
1129    pub enum Response {
1130        #[prost(message, tag = "1")]
1131        Success(super::BtcSuccess),
1132        #[prost(message, tag = "2")]
1133        IsScriptConfigRegistered(super::BtcIsScriptConfigRegisteredResponse),
1134        #[prost(message, tag = "3")]
1135        SignNext(super::BtcSignNextResponse),
1136        #[prost(message, tag = "4")]
1137        SignMessage(super::BtcSignMessageResponse),
1138        #[prost(message, tag = "5")]
1139        AntikleptoSignerCommitment(super::AntiKleptoSignerCommitment),
1140        #[prost(message, tag = "6")]
1141        Pubs(super::PubsResponse),
1142    }
1143}
1144#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1145#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1146#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1147#[repr(i32)]
1148pub enum BtcCoin {
1149    Btc = 0,
1150    Tbtc = 1,
1151    Ltc = 2,
1152    Tltc = 3,
1153    /// Regtest
1154    Rbtc = 4,
1155}
1156impl BtcCoin {
1157    /// String value of the enum field names used in the ProtoBuf definition.
1158    ///
1159    /// The values are not transformed in any way and thus are considered stable
1160    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1161    pub fn as_str_name(&self) -> &'static str {
1162        match self {
1163            Self::Btc => "BTC",
1164            Self::Tbtc => "TBTC",
1165            Self::Ltc => "LTC",
1166            Self::Tltc => "TLTC",
1167            Self::Rbtc => "RBTC",
1168        }
1169    }
1170    /// Creates an enum from field names used in the ProtoBuf definition.
1171    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1172        match value {
1173            "BTC" => Some(Self::Btc),
1174            "TBTC" => Some(Self::Tbtc),
1175            "LTC" => Some(Self::Ltc),
1176            "TLTC" => Some(Self::Tltc),
1177            "RBTC" => Some(Self::Rbtc),
1178            _ => None,
1179        }
1180    }
1181}
1182#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1183#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1184#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1185#[repr(i32)]
1186pub enum BtcOutputType {
1187    Unknown = 0,
1188    P2pkh = 1,
1189    P2sh = 2,
1190    P2wpkh = 3,
1191    P2wsh = 4,
1192    P2tr = 5,
1193}
1194impl BtcOutputType {
1195    /// String value of the enum field names used in the ProtoBuf definition.
1196    ///
1197    /// The values are not transformed in any way and thus are considered stable
1198    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1199    pub fn as_str_name(&self) -> &'static str {
1200        match self {
1201            Self::Unknown => "UNKNOWN",
1202            Self::P2pkh => "P2PKH",
1203            Self::P2sh => "P2SH",
1204            Self::P2wpkh => "P2WPKH",
1205            Self::P2wsh => "P2WSH",
1206            Self::P2tr => "P2TR",
1207        }
1208    }
1209    /// Creates an enum from field names used in the ProtoBuf definition.
1210    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1211        match value {
1212            "UNKNOWN" => Some(Self::Unknown),
1213            "P2PKH" => Some(Self::P2pkh),
1214            "P2SH" => Some(Self::P2sh),
1215            "P2WPKH" => Some(Self::P2wpkh),
1216            "P2WSH" => Some(Self::P2wsh),
1217            "P2TR" => Some(Self::P2tr),
1218            _ => None,
1219        }
1220    }
1221}
1222#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1223#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1224#[derive(Clone, PartialEq, ::prost::Message)]
1225pub struct CardanoXpubsRequest {
1226    #[prost(message, repeated, tag = "1")]
1227    pub keypaths: ::prost::alloc::vec::Vec<Keypath>,
1228}
1229#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1230#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1231#[derive(Clone, PartialEq, ::prost::Message)]
1232pub struct CardanoXpubsResponse {
1233    #[prost(bytes = "vec", repeated, tag = "1")]
1234    pub xpubs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
1235}
1236#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1237#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1238#[cfg_attr(feature = "wasm", serde(try_from = "crate::cardano::SerdeScriptConfig"))]
1239#[derive(Clone, PartialEq, ::prost::Message)]
1240pub struct CardanoScriptConfig {
1241    /// Entries correspond to address types as described in:
1242    /// <https://github.com/cardano-foundation/CIPs/blob/6c249ef48f8f5b32efc0ec768fadf4321f3173f2/CIP-0019/CIP-0019.md>
1243    /// See also:
1244    /// <https://github.com/input-output-hk/cardano-ledger-specs/blob/d0aa86ded0b973b09b629e5aa62aa1e71364d088/eras/alonzo/test-suite/cddl-files/alonzo.cddl#L137>
1245    #[prost(oneof = "cardano_script_config::Config", tags = "1")]
1246    pub config: ::core::option::Option<cardano_script_config::Config>,
1247}
1248/// Nested message and enum types in `CardanoScriptConfig`.
1249pub mod cardano_script_config {
1250    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1251    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1252    #[derive(Clone, PartialEq, ::prost::Message)]
1253    pub struct PkhSkh {
1254        #[prost(uint32, repeated, tag = "1")]
1255        #[cfg_attr(
1256            feature = "wasm",
1257            serde(deserialize_with = "crate::keypath::serde_deserialize")
1258        )]
1259        pub keypath_payment: ::prost::alloc::vec::Vec<u32>,
1260        #[prost(uint32, repeated, tag = "2")]
1261        #[cfg_attr(
1262            feature = "wasm",
1263            serde(deserialize_with = "crate::keypath::serde_deserialize")
1264        )]
1265        pub keypath_stake: ::prost::alloc::vec::Vec<u32>,
1266    }
1267    /// Entries correspond to address types as described in:
1268    /// <https://github.com/cardano-foundation/CIPs/blob/6c249ef48f8f5b32efc0ec768fadf4321f3173f2/CIP-0019/CIP-0019.md>
1269    /// See also:
1270    /// <https://github.com/input-output-hk/cardano-ledger-specs/blob/d0aa86ded0b973b09b629e5aa62aa1e71364d088/eras/alonzo/test-suite/cddl-files/alonzo.cddl#L137>
1271    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1272    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1273    #[derive(Clone, PartialEq, ::prost::Oneof)]
1274    pub enum Config {
1275        /// Shelley PaymentKeyHash & StakeKeyHash
1276        #[prost(message, tag = "1")]
1277        PkhSkh(PkhSkh),
1278    }
1279}
1280#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1281#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1282#[derive(Clone, PartialEq, ::prost::Message)]
1283pub struct CardanoAddressRequest {
1284    #[prost(enumeration = "CardanoNetwork", tag = "1")]
1285    pub network: i32,
1286    #[prost(bool, tag = "2")]
1287    pub display: bool,
1288    #[prost(message, optional, tag = "3")]
1289    pub script_config: ::core::option::Option<CardanoScriptConfig>,
1290}
1291/// Max allowed transaction size is 16384 bytes according to
1292/// <https://github.com/cardano-foundation/CIPs/blob/master/CIP-0009/CIP-0009.md.> Unlike with BTC, we
1293/// can fit the whole request in RAM and don't need to stream.
1294///
1295/// See also: <https://github.com/input-output-hk/cardano-ledger-specs/blob/d0aa86ded0b973b09b629e5aa62aa1e71364d088/eras/alonzo/test-suite/cddl-files/alonzo.cddl#L50>
1296#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1297#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1298#[derive(Clone, PartialEq, ::prost::Message)]
1299pub struct CardanoSignTransactionRequest {
1300    #[prost(enumeration = "CardanoNetwork", tag = "1")]
1301    #[cfg_attr(
1302        feature = "wasm",
1303        serde(deserialize_with = "crate::cardano::serde_deserialize_network")
1304    )]
1305    pub network: i32,
1306    #[prost(message, repeated, tag = "2")]
1307    pub inputs: ::prost::alloc::vec::Vec<cardano_sign_transaction_request::Input>,
1308    #[prost(message, repeated, tag = "3")]
1309    pub outputs: ::prost::alloc::vec::Vec<cardano_sign_transaction_request::Output>,
1310    #[prost(uint64, tag = "4")]
1311    pub fee: u64,
1312    #[prost(uint64, tag = "5")]
1313    pub ttl: u64,
1314    #[prost(message, repeated, tag = "6")]
1315    pub certificates: ::prost::alloc::vec::Vec<
1316        cardano_sign_transaction_request::Certificate,
1317    >,
1318    #[prost(message, repeated, tag = "7")]
1319    pub withdrawals: ::prost::alloc::vec::Vec<
1320        cardano_sign_transaction_request::Withdrawal,
1321    >,
1322    #[prost(uint64, tag = "8")]
1323    pub validity_interval_start: u64,
1324    /// include ttl even if it is zero
1325    #[prost(bool, tag = "9")]
1326    #[cfg_attr(feature = "wasm", serde(rename = "allowZeroTTL"))]
1327    pub allow_zero_ttl: bool,
1328    /// Tag arrays in the transaction serialization with the 258 tag.
1329    /// See <https://github.com/IntersectMBO/cardano-ledger/blob/6e2d37cc0f47bd02e89b4ce9f78b59c35c958e96/eras/conway/impl/cddl-files/extra.cddl#L5>
1330    #[prost(bool, tag = "10")]
1331    pub tag_cbor_sets: bool,
1332}
1333/// Nested message and enum types in `CardanoSignTransactionRequest`.
1334pub mod cardano_sign_transaction_request {
1335    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1336    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1337    #[derive(Clone, PartialEq, ::prost::Message)]
1338    pub struct Input {
1339        #[prost(uint32, repeated, tag = "1")]
1340        #[cfg_attr(
1341            feature = "wasm",
1342            serde(deserialize_with = "crate::keypath::serde_deserialize")
1343        )]
1344        pub keypath: ::prost::alloc::vec::Vec<u32>,
1345        #[prost(bytes = "vec", tag = "2")]
1346        pub prev_out_hash: ::prost::alloc::vec::Vec<u8>,
1347        #[prost(uint32, tag = "3")]
1348        pub prev_out_index: u32,
1349    }
1350    /// <https://github.com/input-output-hk/cardano-ledger/blob/d0aa86ded0b973b09b629e5aa62aa1e71364d088/eras/alonzo/test-suite/cddl-files/alonzo.cddl#L358>
1351    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1352    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1353    #[derive(Clone, PartialEq, ::prost::Message)]
1354    pub struct AssetGroup {
1355        #[prost(bytes = "vec", tag = "1")]
1356        pub policy_id: ::prost::alloc::vec::Vec<u8>,
1357        #[prost(message, repeated, tag = "2")]
1358        pub tokens: ::prost::alloc::vec::Vec<asset_group::Token>,
1359    }
1360    /// Nested message and enum types in `AssetGroup`.
1361    pub mod asset_group {
1362        #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1363        #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1364        #[derive(Clone, PartialEq, ::prost::Message)]
1365        pub struct Token {
1366            #[prost(bytes = "vec", tag = "1")]
1367            pub asset_name: ::prost::alloc::vec::Vec<u8>,
1368            /// Number of tokens transacted of this asset.
1369            #[prost(uint64, tag = "2")]
1370            pub value: u64,
1371        }
1372    }
1373    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1374    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1375    #[cfg_attr(feature = "wasm", serde(default))]
1376    #[derive(Clone, PartialEq, ::prost::Message)]
1377    pub struct Output {
1378        #[prost(string, tag = "1")]
1379        pub encoded_address: ::prost::alloc::string::String,
1380        #[prost(uint64, tag = "2")]
1381        pub value: u64,
1382        /// Optional. If provided, this is validated as a change output.
1383        #[prost(message, optional, tag = "3")]
1384        pub script_config: ::core::option::Option<super::CardanoScriptConfig>,
1385        #[prost(message, repeated, tag = "4")]
1386        pub asset_groups: ::prost::alloc::vec::Vec<AssetGroup>,
1387    }
1388    /// See <https://github.com/IntersectMBO/cardano-ledger/blob/cardano-ledger-conway-1.12.0.0/eras/conway/impl/cddl-files/conway.cddl#L273>
1389    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1390    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1391    #[cfg_attr(feature = "wasm", serde(try_from = "crate::cardano::SerdeCert"))]
1392    #[derive(Clone, PartialEq, ::prost::Message)]
1393    pub struct Certificate {
1394        #[prost(oneof = "certificate::Cert", tags = "1, 2, 3, 10")]
1395        pub cert: ::core::option::Option<certificate::Cert>,
1396    }
1397    /// Nested message and enum types in `Certificate`.
1398    pub mod certificate {
1399        #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1400        #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1401        #[derive(Clone, PartialEq, ::prost::Message)]
1402        pub struct StakeDelegation {
1403            #[prost(uint32, repeated, tag = "1")]
1404            #[cfg_attr(
1405                feature = "wasm",
1406                serde(deserialize_with = "crate::keypath::serde_deserialize")
1407            )]
1408            pub keypath: ::prost::alloc::vec::Vec<u32>,
1409            #[prost(bytes = "vec", tag = "2")]
1410            pub pool_keyhash: ::prost::alloc::vec::Vec<u8>,
1411        }
1412        #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1413        #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1414        #[derive(Clone, PartialEq, ::prost::Message)]
1415        pub struct VoteDelegation {
1416            /// keypath in this instance refers to stake credential
1417            #[prost(uint32, repeated, tag = "1")]
1418            #[cfg_attr(
1419                feature = "wasm",
1420                serde(deserialize_with = "crate::keypath::serde_deserialize")
1421            )]
1422            pub keypath: ::prost::alloc::vec::Vec<u32>,
1423            #[prost(enumeration = "vote_delegation::CardanoDRepType", tag = "2")]
1424            #[cfg_attr(
1425                feature = "wasm",
1426                serde(deserialize_with = "crate::cardano::serde_deserialize_drep_type")
1427            )]
1428            pub r#type: i32,
1429            #[prost(bytes = "vec", optional, tag = "3")]
1430            pub drep_credhash: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
1431        }
1432        /// Nested message and enum types in `VoteDelegation`.
1433        pub mod vote_delegation {
1434            #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1435            #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1436            #[derive(
1437                Clone,
1438                Copy,
1439                Debug,
1440                PartialEq,
1441                Eq,
1442                Hash,
1443                PartialOrd,
1444                Ord,
1445                ::prost::Enumeration
1446            )]
1447            #[repr(i32)]
1448            pub enum CardanoDRepType {
1449                KeyHash = 0,
1450                ScriptHash = 1,
1451                AlwaysAbstain = 2,
1452                AlwaysNoConfidence = 3,
1453            }
1454            impl CardanoDRepType {
1455                /// String value of the enum field names used in the ProtoBuf definition.
1456                ///
1457                /// The values are not transformed in any way and thus are considered stable
1458                /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1459                pub fn as_str_name(&self) -> &'static str {
1460                    match self {
1461                        Self::KeyHash => "KEY_HASH",
1462                        Self::ScriptHash => "SCRIPT_HASH",
1463                        Self::AlwaysAbstain => "ALWAYS_ABSTAIN",
1464                        Self::AlwaysNoConfidence => "ALWAYS_NO_CONFIDENCE",
1465                    }
1466                }
1467                /// Creates an enum from field names used in the ProtoBuf definition.
1468                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1469                    match value {
1470                        "KEY_HASH" => Some(Self::KeyHash),
1471                        "SCRIPT_HASH" => Some(Self::ScriptHash),
1472                        "ALWAYS_ABSTAIN" => Some(Self::AlwaysAbstain),
1473                        "ALWAYS_NO_CONFIDENCE" => Some(Self::AlwaysNoConfidence),
1474                        _ => None,
1475                    }
1476                }
1477            }
1478        }
1479        #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1480        #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1481        #[derive(Clone, PartialEq, ::prost::Oneof)]
1482        pub enum Cert {
1483            #[prost(message, tag = "1")]
1484            StakeRegistration(super::super::Keypath),
1485            #[prost(message, tag = "2")]
1486            StakeDeregistration(super::super::Keypath),
1487            #[prost(message, tag = "3")]
1488            StakeDelegation(StakeDelegation),
1489            #[prost(message, tag = "10")]
1490            VoteDelegation(VoteDelegation),
1491        }
1492    }
1493    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1494    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1495    #[derive(Clone, PartialEq, ::prost::Message)]
1496    pub struct Withdrawal {
1497        #[prost(uint32, repeated, tag = "1")]
1498        #[cfg_attr(
1499            feature = "wasm",
1500            serde(deserialize_with = "crate::keypath::serde_deserialize")
1501        )]
1502        pub keypath: ::prost::alloc::vec::Vec<u32>,
1503        #[prost(uint64, tag = "2")]
1504        pub value: u64,
1505    }
1506}
1507#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1508#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1509#[derive(Clone, PartialEq, ::prost::Message)]
1510pub struct CardanoSignTransactionResponse {
1511    #[prost(message, repeated, tag = "1")]
1512    pub shelley_witnesses: ::prost::alloc::vec::Vec<
1513        cardano_sign_transaction_response::ShelleyWitness,
1514    >,
1515}
1516/// Nested message and enum types in `CardanoSignTransactionResponse`.
1517pub mod cardano_sign_transaction_response {
1518    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1519    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1520    #[derive(Clone, PartialEq, ::prost::Message)]
1521    pub struct ShelleyWitness {
1522        #[prost(bytes = "vec", tag = "1")]
1523        pub public_key: ::prost::alloc::vec::Vec<u8>,
1524        #[prost(bytes = "vec", tag = "2")]
1525        pub signature: ::prost::alloc::vec::Vec<u8>,
1526    }
1527}
1528#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1529#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1530#[derive(Clone, PartialEq, ::prost::Message)]
1531pub struct CardanoRequest {
1532    #[prost(oneof = "cardano_request::Request", tags = "1, 2, 3")]
1533    pub request: ::core::option::Option<cardano_request::Request>,
1534}
1535/// Nested message and enum types in `CardanoRequest`.
1536pub mod cardano_request {
1537    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1538    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1539    #[derive(Clone, PartialEq, ::prost::Oneof)]
1540    pub enum Request {
1541        #[prost(message, tag = "1")]
1542        Xpubs(super::CardanoXpubsRequest),
1543        #[prost(message, tag = "2")]
1544        Address(super::CardanoAddressRequest),
1545        #[prost(message, tag = "3")]
1546        SignTransaction(super::CardanoSignTransactionRequest),
1547    }
1548}
1549#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1550#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1551#[derive(Clone, PartialEq, ::prost::Message)]
1552pub struct CardanoResponse {
1553    #[prost(oneof = "cardano_response::Response", tags = "1, 2, 3")]
1554    pub response: ::core::option::Option<cardano_response::Response>,
1555}
1556/// Nested message and enum types in `CardanoResponse`.
1557pub mod cardano_response {
1558    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1559    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1560    #[derive(Clone, PartialEq, ::prost::Oneof)]
1561    pub enum Response {
1562        #[prost(message, tag = "1")]
1563        Xpubs(super::CardanoXpubsResponse),
1564        #[prost(message, tag = "2")]
1565        Pub(super::PubResponse),
1566        #[prost(message, tag = "3")]
1567        SignTransaction(super::CardanoSignTransactionResponse),
1568    }
1569}
1570#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1571#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1572#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1573#[repr(i32)]
1574pub enum CardanoNetwork {
1575    #[cfg_attr(feature = "wasm", serde(rename = "mainnet"))]
1576    CardanoMainnet = 0,
1577    #[cfg_attr(feature = "wasm", serde(rename = "testnet"))]
1578    CardanoTestnet = 1,
1579}
1580impl CardanoNetwork {
1581    /// String value of the enum field names used in the ProtoBuf definition.
1582    ///
1583    /// The values are not transformed in any way and thus are considered stable
1584    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1585    pub fn as_str_name(&self) -> &'static str {
1586        match self {
1587            Self::CardanoMainnet => "CardanoMainnet",
1588            Self::CardanoTestnet => "CardanoTestnet",
1589        }
1590    }
1591    /// Creates an enum from field names used in the ProtoBuf definition.
1592    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1593        match value {
1594            "CardanoMainnet" => Some(Self::CardanoMainnet),
1595            "CardanoTestnet" => Some(Self::CardanoTestnet),
1596            _ => None,
1597        }
1598    }
1599}
1600#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1601#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1602#[derive(Clone, PartialEq, ::prost::Message)]
1603pub struct EthPubRequest {
1604    #[prost(uint32, repeated, tag = "1")]
1605    #[cfg_attr(
1606        feature = "wasm",
1607        serde(deserialize_with = "crate::keypath::serde_deserialize")
1608    )]
1609    pub keypath: ::prost::alloc::vec::Vec<u32>,
1610    /// Deprecated: use chain_id instead.
1611    #[prost(enumeration = "EthCoin", tag = "2")]
1612    pub coin: i32,
1613    #[prost(enumeration = "eth_pub_request::OutputType", tag = "3")]
1614    pub output_type: i32,
1615    #[prost(bool, tag = "4")]
1616    pub display: bool,
1617    #[prost(bytes = "vec", tag = "5")]
1618    pub contract_address: ::prost::alloc::vec::Vec<u8>,
1619    /// If non-zero, `coin` is ignored and `chain_id` is used to identify the network.
1620    #[prost(uint64, tag = "6")]
1621    pub chain_id: u64,
1622}
1623/// Nested message and enum types in `ETHPubRequest`.
1624pub mod eth_pub_request {
1625    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1626    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1627    #[derive(
1628        Clone,
1629        Copy,
1630        Debug,
1631        PartialEq,
1632        Eq,
1633        Hash,
1634        PartialOrd,
1635        Ord,
1636        ::prost::Enumeration
1637    )]
1638    #[repr(i32)]
1639    pub enum OutputType {
1640        Address = 0,
1641        Xpub = 1,
1642    }
1643    impl OutputType {
1644        /// String value of the enum field names used in the ProtoBuf definition.
1645        ///
1646        /// The values are not transformed in any way and thus are considered stable
1647        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1648        pub fn as_str_name(&self) -> &'static str {
1649            match self {
1650                Self::Address => "ADDRESS",
1651                Self::Xpub => "XPUB",
1652            }
1653        }
1654        /// Creates an enum from field names used in the ProtoBuf definition.
1655        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1656            match value {
1657                "ADDRESS" => Some(Self::Address),
1658                "XPUB" => Some(Self::Xpub),
1659                _ => None,
1660            }
1661        }
1662    }
1663}
1664/// TX payload for "legacy" (EIP-155) transactions: <https://eips.ethereum.org/EIPS/eip-155>
1665#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1666#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1667#[derive(Clone, PartialEq, ::prost::Message)]
1668pub struct EthSignRequest {
1669    /// Deprecated: use chain_id instead.
1670    #[prost(enumeration = "EthCoin", tag = "1")]
1671    pub coin: i32,
1672    #[prost(uint32, repeated, tag = "2")]
1673    #[cfg_attr(
1674        feature = "wasm",
1675        serde(deserialize_with = "crate::keypath::serde_deserialize")
1676    )]
1677    pub keypath: ::prost::alloc::vec::Vec<u32>,
1678    /// smallest big endian serialization, max. 16 bytes
1679    #[prost(bytes = "vec", tag = "3")]
1680    pub nonce: ::prost::alloc::vec::Vec<u8>,
1681    /// smallest big endian serialization, max. 16 bytes
1682    #[prost(bytes = "vec", tag = "4")]
1683    pub gas_price: ::prost::alloc::vec::Vec<u8>,
1684    /// smallest big endian serialization, max. 16 bytes
1685    #[prost(bytes = "vec", tag = "5")]
1686    pub gas_limit: ::prost::alloc::vec::Vec<u8>,
1687    /// 20 byte recipient
1688    #[prost(bytes = "vec", tag = "6")]
1689    pub recipient: ::prost::alloc::vec::Vec<u8>,
1690    /// smallest big endian serialization, max. 32 bytes
1691    #[prost(bytes = "vec", tag = "7")]
1692    pub value: ::prost::alloc::vec::Vec<u8>,
1693    #[prost(bytes = "vec", tag = "8")]
1694    pub data: ::prost::alloc::vec::Vec<u8>,
1695    #[prost(message, optional, tag = "9")]
1696    pub host_nonce_commitment: ::core::option::Option<AntiKleptoHostNonceCommitment>,
1697    /// If non-zero, `coin` is ignored and `chain_id` is used to identify the network.
1698    #[prost(uint64, tag = "10")]
1699    pub chain_id: u64,
1700    #[prost(enumeration = "EthAddressCase", tag = "11")]
1701    pub address_case: i32,
1702}
1703/// TX payload for an EIP-1559 (type 2) transaction: <https://eips.ethereum.org/EIPS/eip-1559>
1704#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1705#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1706#[derive(Clone, PartialEq, ::prost::Message)]
1707pub struct EthSignEip1559Request {
1708    #[prost(uint64, tag = "1")]
1709    pub chain_id: u64,
1710    #[prost(uint32, repeated, tag = "2")]
1711    #[cfg_attr(
1712        feature = "wasm",
1713        serde(deserialize_with = "crate::keypath::serde_deserialize")
1714    )]
1715    pub keypath: ::prost::alloc::vec::Vec<u32>,
1716    /// smallest big endian serialization, max. 16 bytes
1717    #[prost(bytes = "vec", tag = "3")]
1718    pub nonce: ::prost::alloc::vec::Vec<u8>,
1719    /// smallest big endian serialization, max. 16 bytes
1720    #[prost(bytes = "vec", tag = "4")]
1721    pub max_priority_fee_per_gas: ::prost::alloc::vec::Vec<u8>,
1722    /// smallest big endian serialization, max. 16 bytes
1723    #[prost(bytes = "vec", tag = "5")]
1724    pub max_fee_per_gas: ::prost::alloc::vec::Vec<u8>,
1725    /// smallest big endian serialization, max. 16 bytes
1726    #[prost(bytes = "vec", tag = "6")]
1727    pub gas_limit: ::prost::alloc::vec::Vec<u8>,
1728    /// 20 byte recipient
1729    #[prost(bytes = "vec", tag = "7")]
1730    pub recipient: ::prost::alloc::vec::Vec<u8>,
1731    /// smallest big endian serialization, max. 32 bytes
1732    #[prost(bytes = "vec", tag = "8")]
1733    pub value: ::prost::alloc::vec::Vec<u8>,
1734    #[prost(bytes = "vec", tag = "9")]
1735    pub data: ::prost::alloc::vec::Vec<u8>,
1736    #[prost(message, optional, tag = "10")]
1737    pub host_nonce_commitment: ::core::option::Option<AntiKleptoHostNonceCommitment>,
1738    #[prost(enumeration = "EthAddressCase", tag = "11")]
1739    pub address_case: i32,
1740}
1741#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1742#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1743#[derive(Clone, PartialEq, ::prost::Message)]
1744pub struct EthSignMessageRequest {
1745    /// Deprecated: use chain_id instead.
1746    #[prost(enumeration = "EthCoin", tag = "1")]
1747    pub coin: i32,
1748    #[prost(uint32, repeated, tag = "2")]
1749    #[cfg_attr(
1750        feature = "wasm",
1751        serde(deserialize_with = "crate::keypath::serde_deserialize")
1752    )]
1753    pub keypath: ::prost::alloc::vec::Vec<u32>,
1754    #[prost(bytes = "vec", tag = "3")]
1755    pub msg: ::prost::alloc::vec::Vec<u8>,
1756    #[prost(message, optional, tag = "4")]
1757    pub host_nonce_commitment: ::core::option::Option<AntiKleptoHostNonceCommitment>,
1758    /// If non-zero, `coin` is ignored and `chain_id` is used to identify the network.
1759    #[prost(uint64, tag = "5")]
1760    pub chain_id: u64,
1761}
1762#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1763#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1764#[derive(Clone, PartialEq, ::prost::Message)]
1765pub struct EthSignResponse {
1766    /// 65 bytes, last byte is the recid
1767    #[prost(bytes = "vec", tag = "1")]
1768    pub signature: ::prost::alloc::vec::Vec<u8>,
1769}
1770#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1771#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1772#[derive(Clone, PartialEq, ::prost::Message)]
1773pub struct EthSignTypedMessageRequest {
1774    #[prost(uint64, tag = "1")]
1775    pub chain_id: u64,
1776    #[prost(uint32, repeated, tag = "2")]
1777    #[cfg_attr(
1778        feature = "wasm",
1779        serde(deserialize_with = "crate::keypath::serde_deserialize")
1780    )]
1781    pub keypath: ::prost::alloc::vec::Vec<u32>,
1782    #[prost(message, repeated, tag = "3")]
1783    pub types: ::prost::alloc::vec::Vec<eth_sign_typed_message_request::StructType>,
1784    #[prost(string, tag = "4")]
1785    pub primary_type: ::prost::alloc::string::String,
1786    #[prost(message, optional, tag = "5")]
1787    pub host_nonce_commitment: ::core::option::Option<AntiKleptoHostNonceCommitment>,
1788}
1789/// Nested message and enum types in `ETHSignTypedMessageRequest`.
1790pub mod eth_sign_typed_message_request {
1791    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1792    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1793    #[derive(Clone, PartialEq, ::prost::Message)]
1794    pub struct MemberType {
1795        #[prost(enumeration = "DataType", tag = "1")]
1796        pub r#type: i32,
1797        #[prost(uint32, tag = "2")]
1798        pub size: u32,
1799        /// if type==STRUCT, name of struct type.
1800        #[prost(string, tag = "3")]
1801        pub struct_name: ::prost::alloc::string::String,
1802        /// if type==ARRAY, type of elements
1803        #[prost(message, optional, boxed, tag = "4")]
1804        pub array_type: ::core::option::Option<::prost::alloc::boxed::Box<MemberType>>,
1805    }
1806    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1807    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1808    #[derive(Clone, PartialEq, ::prost::Message)]
1809    pub struct Member {
1810        #[prost(string, tag = "1")]
1811        pub name: ::prost::alloc::string::String,
1812        #[prost(message, optional, tag = "2")]
1813        pub r#type: ::core::option::Option<MemberType>,
1814    }
1815    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1816    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1817    #[derive(Clone, PartialEq, ::prost::Message)]
1818    pub struct StructType {
1819        #[prost(string, tag = "1")]
1820        pub name: ::prost::alloc::string::String,
1821        #[prost(message, repeated, tag = "2")]
1822        pub members: ::prost::alloc::vec::Vec<Member>,
1823    }
1824    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1825    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1826    #[derive(
1827        Clone,
1828        Copy,
1829        Debug,
1830        PartialEq,
1831        Eq,
1832        Hash,
1833        PartialOrd,
1834        Ord,
1835        ::prost::Enumeration
1836    )]
1837    #[repr(i32)]
1838    pub enum DataType {
1839        Unknown = 0,
1840        Bytes = 1,
1841        Uint = 2,
1842        Int = 3,
1843        Bool = 4,
1844        Address = 5,
1845        String = 6,
1846        Array = 7,
1847        Struct = 8,
1848    }
1849    impl DataType {
1850        /// String value of the enum field names used in the ProtoBuf definition.
1851        ///
1852        /// The values are not transformed in any way and thus are considered stable
1853        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1854        pub fn as_str_name(&self) -> &'static str {
1855            match self {
1856                Self::Unknown => "UNKNOWN",
1857                Self::Bytes => "BYTES",
1858                Self::Uint => "UINT",
1859                Self::Int => "INT",
1860                Self::Bool => "BOOL",
1861                Self::Address => "ADDRESS",
1862                Self::String => "STRING",
1863                Self::Array => "ARRAY",
1864                Self::Struct => "STRUCT",
1865            }
1866        }
1867        /// Creates an enum from field names used in the ProtoBuf definition.
1868        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1869            match value {
1870                "UNKNOWN" => Some(Self::Unknown),
1871                "BYTES" => Some(Self::Bytes),
1872                "UINT" => Some(Self::Uint),
1873                "INT" => Some(Self::Int),
1874                "BOOL" => Some(Self::Bool),
1875                "ADDRESS" => Some(Self::Address),
1876                "STRING" => Some(Self::String),
1877                "ARRAY" => Some(Self::Array),
1878                "STRUCT" => Some(Self::Struct),
1879                _ => None,
1880            }
1881        }
1882    }
1883}
1884#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1885#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1886#[derive(Clone, PartialEq, ::prost::Message)]
1887pub struct EthTypedMessageValueResponse {
1888    #[prost(enumeration = "eth_typed_message_value_response::RootObject", tag = "1")]
1889    pub root_object: i32,
1890    #[prost(uint32, repeated, tag = "2")]
1891    pub path: ::prost::alloc::vec::Vec<u32>,
1892}
1893/// Nested message and enum types in `ETHTypedMessageValueResponse`.
1894pub mod eth_typed_message_value_response {
1895    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1896    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1897    #[derive(
1898        Clone,
1899        Copy,
1900        Debug,
1901        PartialEq,
1902        Eq,
1903        Hash,
1904        PartialOrd,
1905        Ord,
1906        ::prost::Enumeration
1907    )]
1908    #[repr(i32)]
1909    pub enum RootObject {
1910        Unknown = 0,
1911        Domain = 1,
1912        Message = 2,
1913    }
1914    impl RootObject {
1915        /// String value of the enum field names used in the ProtoBuf definition.
1916        ///
1917        /// The values are not transformed in any way and thus are considered stable
1918        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1919        pub fn as_str_name(&self) -> &'static str {
1920            match self {
1921                Self::Unknown => "UNKNOWN",
1922                Self::Domain => "DOMAIN",
1923                Self::Message => "MESSAGE",
1924            }
1925        }
1926        /// Creates an enum from field names used in the ProtoBuf definition.
1927        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1928            match value {
1929                "UNKNOWN" => Some(Self::Unknown),
1930                "DOMAIN" => Some(Self::Domain),
1931                "MESSAGE" => Some(Self::Message),
1932                _ => None,
1933            }
1934        }
1935    }
1936}
1937#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1938#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1939#[derive(Clone, PartialEq, ::prost::Message)]
1940pub struct EthTypedMessageValueRequest {
1941    #[prost(bytes = "vec", tag = "1")]
1942    pub value: ::prost::alloc::vec::Vec<u8>,
1943}
1944#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1945#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1946#[derive(Clone, PartialEq, ::prost::Message)]
1947pub struct EthRequest {
1948    #[prost(oneof = "eth_request::Request", tags = "1, 2, 3, 4, 5, 6, 7")]
1949    pub request: ::core::option::Option<eth_request::Request>,
1950}
1951/// Nested message and enum types in `ETHRequest`.
1952pub mod eth_request {
1953    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1954    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1955    #[derive(Clone, PartialEq, ::prost::Oneof)]
1956    pub enum Request {
1957        #[prost(message, tag = "1")]
1958        Pub(super::EthPubRequest),
1959        #[prost(message, tag = "2")]
1960        Sign(super::EthSignRequest),
1961        #[prost(message, tag = "3")]
1962        SignMsg(super::EthSignMessageRequest),
1963        #[prost(message, tag = "4")]
1964        AntikleptoSignature(super::AntiKleptoSignatureRequest),
1965        #[prost(message, tag = "5")]
1966        SignTypedMsg(super::EthSignTypedMessageRequest),
1967        #[prost(message, tag = "6")]
1968        TypedMsgValue(super::EthTypedMessageValueRequest),
1969        #[prost(message, tag = "7")]
1970        SignEip1559(super::EthSignEip1559Request),
1971    }
1972}
1973#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1974#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1975#[derive(Clone, PartialEq, ::prost::Message)]
1976pub struct EthResponse {
1977    #[prost(oneof = "eth_response::Response", tags = "1, 2, 3, 4")]
1978    pub response: ::core::option::Option<eth_response::Response>,
1979}
1980/// Nested message and enum types in `ETHResponse`.
1981pub mod eth_response {
1982    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1983    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1984    #[derive(Clone, PartialEq, ::prost::Oneof)]
1985    pub enum Response {
1986        #[prost(message, tag = "1")]
1987        Pub(super::PubResponse),
1988        #[prost(message, tag = "2")]
1989        Sign(super::EthSignResponse),
1990        #[prost(message, tag = "3")]
1991        AntikleptoSignerCommitment(super::AntiKleptoSignerCommitment),
1992        #[prost(message, tag = "4")]
1993        TypedMsgValue(super::EthTypedMessageValueResponse),
1994    }
1995}
1996/// Kept for backwards compatibility. Use chain_id instead, introduced in v9.10.0.
1997#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
1998#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
1999#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2000#[repr(i32)]
2001pub enum EthCoin {
2002    Eth = 0,
2003    /// Removed in v9.14.0 - deprecated
2004    RopstenEth = 1,
2005    /// Removed in v9.14.0 - deprecated
2006    RinkebyEth = 2,
2007}
2008impl EthCoin {
2009    /// String value of the enum field names used in the ProtoBuf definition.
2010    ///
2011    /// The values are not transformed in any way and thus are considered stable
2012    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2013    pub fn as_str_name(&self) -> &'static str {
2014        match self {
2015            Self::Eth => "ETH",
2016            Self::RopstenEth => "RopstenETH",
2017            Self::RinkebyEth => "RinkebyETH",
2018        }
2019    }
2020    /// Creates an enum from field names used in the ProtoBuf definition.
2021    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2022        match value {
2023            "ETH" => Some(Self::Eth),
2024            "RopstenETH" => Some(Self::RopstenEth),
2025            "RinkebyETH" => Some(Self::RinkebyEth),
2026            _ => None,
2027        }
2028    }
2029}
2030#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2031#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2032#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2033#[repr(i32)]
2034pub enum EthAddressCase {
2035    Mixed = 0,
2036    Upper = 1,
2037    Lower = 2,
2038}
2039impl EthAddressCase {
2040    /// String value of the enum field names used in the ProtoBuf definition.
2041    ///
2042    /// The values are not transformed in any way and thus are considered stable
2043    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2044    pub fn as_str_name(&self) -> &'static str {
2045        match self {
2046            Self::Mixed => "ETH_ADDRESS_CASE_MIXED",
2047            Self::Upper => "ETH_ADDRESS_CASE_UPPER",
2048            Self::Lower => "ETH_ADDRESS_CASE_LOWER",
2049        }
2050    }
2051    /// Creates an enum from field names used in the ProtoBuf definition.
2052    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2053        match value {
2054            "ETH_ADDRESS_CASE_MIXED" => Some(Self::Mixed),
2055            "ETH_ADDRESS_CASE_UPPER" => Some(Self::Upper),
2056            "ETH_ADDRESS_CASE_LOWER" => Some(Self::Lower),
2057            _ => None,
2058        }
2059    }
2060}
2061#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2062#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2063#[derive(Clone, PartialEq, ::prost::Message)]
2064pub struct ElectrumEncryptionKeyRequest {
2065    #[prost(uint32, repeated, tag = "1")]
2066    #[cfg_attr(
2067        feature = "wasm",
2068        serde(deserialize_with = "crate::keypath::serde_deserialize")
2069    )]
2070    pub keypath: ::prost::alloc::vec::Vec<u32>,
2071}
2072#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2073#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2074#[derive(Clone, PartialEq, ::prost::Message)]
2075pub struct ElectrumEncryptionKeyResponse {
2076    #[prost(string, tag = "1")]
2077    pub key: ::prost::alloc::string::String,
2078}
2079#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2080#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2081#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2082pub struct Bip85Request {
2083    #[prost(oneof = "bip85_request::App", tags = "1, 2")]
2084    pub app: ::core::option::Option<bip85_request::App>,
2085}
2086/// Nested message and enum types in `BIP85Request`.
2087pub mod bip85_request {
2088    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2089    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2090    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2091    pub struct AppLn {
2092        #[prost(uint32, tag = "1")]
2093        pub account_number: u32,
2094    }
2095    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2096    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2097    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
2098    pub enum App {
2099        #[prost(message, tag = "1")]
2100        Bip39(()),
2101        #[prost(message, tag = "2")]
2102        Ln(AppLn),
2103    }
2104}
2105#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2106#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2107#[derive(Clone, PartialEq, ::prost::Message)]
2108pub struct Bip85Response {
2109    #[prost(oneof = "bip85_response::App", tags = "1, 2")]
2110    pub app: ::core::option::Option<bip85_response::App>,
2111}
2112/// Nested message and enum types in `BIP85Response`.
2113pub mod bip85_response {
2114    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2115    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2116    #[derive(Clone, PartialEq, ::prost::Oneof)]
2117    pub enum App {
2118        #[prost(message, tag = "1")]
2119        Bip39(()),
2120        #[prost(bytes, tag = "2")]
2121        Ln(::prost::alloc::vec::Vec<u8>),
2122    }
2123}
2124#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2125#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2126#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2127pub struct ShowMnemonicRequest {}
2128#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2129#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2130#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2131pub struct RestoreFromMnemonicRequest {
2132    #[prost(uint32, tag = "1")]
2133    pub timestamp: u32,
2134    #[prost(int32, tag = "2")]
2135    pub timezone_offset: i32,
2136}
2137#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2138#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2139#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2140pub struct SetMnemonicPassphraseEnabledRequest {
2141    #[prost(bool, tag = "1")]
2142    pub enabled: bool,
2143}
2144#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2145#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2146#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2147pub struct RebootRequest {
2148    #[prost(enumeration = "reboot_request::Purpose", tag = "1")]
2149    pub purpose: i32,
2150}
2151/// Nested message and enum types in `RebootRequest`.
2152pub mod reboot_request {
2153    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2154    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2155    #[derive(
2156        Clone,
2157        Copy,
2158        Debug,
2159        PartialEq,
2160        Eq,
2161        Hash,
2162        PartialOrd,
2163        Ord,
2164        ::prost::Enumeration
2165    )]
2166    #[repr(i32)]
2167    pub enum Purpose {
2168        Upgrade = 0,
2169        Settings = 1,
2170    }
2171    impl Purpose {
2172        /// String value of the enum field names used in the ProtoBuf definition.
2173        ///
2174        /// The values are not transformed in any way and thus are considered stable
2175        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2176        pub fn as_str_name(&self) -> &'static str {
2177            match self {
2178                Self::Upgrade => "UPGRADE",
2179                Self::Settings => "SETTINGS",
2180            }
2181        }
2182        /// Creates an enum from field names used in the ProtoBuf definition.
2183        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2184            match value {
2185                "UPGRADE" => Some(Self::Upgrade),
2186                "SETTINGS" => Some(Self::Settings),
2187                _ => None,
2188            }
2189        }
2190    }
2191}
2192/// Deprecated, last used in v1.0.0
2193#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2194#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2195#[derive(Clone, PartialEq, ::prost::Message)]
2196pub struct PerformAttestationRequest {
2197    /// 32 bytes challenge.
2198    #[prost(bytes = "vec", tag = "1")]
2199    pub challenge: ::prost::alloc::vec::Vec<u8>,
2200}
2201/// Deprecated, last used in v1.0.0
2202#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2203#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2204#[derive(Clone, PartialEq, ::prost::Message)]
2205pub struct PerformAttestationResponse {
2206    #[prost(bytes = "vec", tag = "1")]
2207    pub bootloader_hash: ::prost::alloc::vec::Vec<u8>,
2208    #[prost(bytes = "vec", tag = "2")]
2209    pub device_pubkey: ::prost::alloc::vec::Vec<u8>,
2210    #[prost(bytes = "vec", tag = "3")]
2211    pub certificate: ::prost::alloc::vec::Vec<u8>,
2212    #[prost(bytes = "vec", tag = "4")]
2213    pub root_pubkey_identifier: ::prost::alloc::vec::Vec<u8>,
2214    #[prost(bytes = "vec", tag = "5")]
2215    pub challenge_signature: ::prost::alloc::vec::Vec<u8>,
2216}
2217#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2218#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2219#[derive(Clone, PartialEq, ::prost::Message)]
2220pub struct Error {
2221    #[prost(int32, tag = "1")]
2222    pub code: i32,
2223    #[prost(string, tag = "2")]
2224    pub message: ::prost::alloc::string::String,
2225}
2226#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2227#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2228#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2229pub struct Success {}
2230#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2231#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2232#[derive(Clone, PartialEq, ::prost::Message)]
2233pub struct Request {
2234    #[prost(
2235        oneof = "request::Request",
2236        tags = "2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29"
2237    )]
2238    pub request: ::core::option::Option<request::Request>,
2239}
2240/// Nested message and enum types in `Request`.
2241pub mod request {
2242    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2243    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2244    #[derive(Clone, PartialEq, ::prost::Oneof)]
2245    pub enum Request {
2246        /// removed: RandomNumberRequest random_number = 1;
2247        #[prost(message, tag = "2")]
2248        DeviceName(super::SetDeviceNameRequest),
2249        #[prost(message, tag = "3")]
2250        DeviceLanguage(super::SetDeviceLanguageRequest),
2251        #[prost(message, tag = "4")]
2252        DeviceInfo(super::DeviceInfoRequest),
2253        #[prost(message, tag = "5")]
2254        SetPassword(super::SetPasswordRequest),
2255        #[prost(message, tag = "6")]
2256        CreateBackup(super::CreateBackupRequest),
2257        #[prost(message, tag = "7")]
2258        ShowMnemonic(super::ShowMnemonicRequest),
2259        #[prost(message, tag = "8")]
2260        BtcPub(super::BtcPubRequest),
2261        #[prost(message, tag = "9")]
2262        BtcSignInit(super::BtcSignInitRequest),
2263        #[prost(message, tag = "10")]
2264        BtcSignInput(super::BtcSignInputRequest),
2265        #[prost(message, tag = "11")]
2266        BtcSignOutput(super::BtcSignOutputRequest),
2267        #[prost(message, tag = "12")]
2268        InsertRemoveSdcard(super::InsertRemoveSdCardRequest),
2269        #[prost(message, tag = "13")]
2270        CheckSdcard(super::CheckSdCardRequest),
2271        #[prost(message, tag = "14")]
2272        SetMnemonicPassphraseEnabled(super::SetMnemonicPassphraseEnabledRequest),
2273        #[prost(message, tag = "15")]
2274        ListBackups(super::ListBackupsRequest),
2275        #[prost(message, tag = "16")]
2276        RestoreBackup(super::RestoreBackupRequest),
2277        #[prost(message, tag = "17")]
2278        PerformAttestation(super::PerformAttestationRequest),
2279        #[prost(message, tag = "18")]
2280        Reboot(super::RebootRequest),
2281        #[prost(message, tag = "19")]
2282        CheckBackup(super::CheckBackupRequest),
2283        #[prost(message, tag = "20")]
2284        Eth(super::EthRequest),
2285        #[prost(message, tag = "21")]
2286        Reset(super::ResetRequest),
2287        #[prost(message, tag = "22")]
2288        RestoreFromMnemonic(super::RestoreFromMnemonicRequest),
2289        /// removed: BitBoxBaseRequest bitboxbase = 23;
2290        #[prost(message, tag = "24")]
2291        Fingerprint(super::RootFingerprintRequest),
2292        #[prost(message, tag = "25")]
2293        Btc(super::BtcRequest),
2294        #[prost(message, tag = "26")]
2295        ElectrumEncryptionKey(super::ElectrumEncryptionKeyRequest),
2296        #[prost(message, tag = "27")]
2297        Cardano(super::CardanoRequest),
2298        #[prost(message, tag = "28")]
2299        Bip85(super::Bip85Request),
2300        #[prost(message, tag = "29")]
2301        Bluetooth(super::BluetoothRequest),
2302    }
2303}
2304#[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2305#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2306#[derive(Clone, PartialEq, ::prost::Message)]
2307pub struct Response {
2308    #[prost(
2309        oneof = "response::Response",
2310        tags = "1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17"
2311    )]
2312    pub response: ::core::option::Option<response::Response>,
2313}
2314/// Nested message and enum types in `Response`.
2315pub mod response {
2316    #[cfg_attr(feature = "wasm", derive(serde::Serialize, serde::Deserialize))]
2317    #[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
2318    #[derive(Clone, PartialEq, ::prost::Oneof)]
2319    pub enum Response {
2320        #[prost(message, tag = "1")]
2321        Success(super::Success),
2322        #[prost(message, tag = "2")]
2323        Error(super::Error),
2324        /// removed: RandomNumberResponse random_number = 3;
2325        #[prost(message, tag = "4")]
2326        DeviceInfo(super::DeviceInfoResponse),
2327        #[prost(message, tag = "5")]
2328        Pub(super::PubResponse),
2329        #[prost(message, tag = "6")]
2330        BtcSignNext(super::BtcSignNextResponse),
2331        #[prost(message, tag = "7")]
2332        ListBackups(super::ListBackupsResponse),
2333        #[prost(message, tag = "8")]
2334        CheckBackup(super::CheckBackupResponse),
2335        #[prost(message, tag = "9")]
2336        PerformAttestation(super::PerformAttestationResponse),
2337        #[prost(message, tag = "10")]
2338        CheckSdcard(super::CheckSdCardResponse),
2339        #[prost(message, tag = "11")]
2340        Eth(super::EthResponse),
2341        #[prost(message, tag = "12")]
2342        Fingerprint(super::RootFingerprintResponse),
2343        #[prost(message, tag = "13")]
2344        Btc(super::BtcResponse),
2345        #[prost(message, tag = "14")]
2346        ElectrumEncryptionKey(super::ElectrumEncryptionKeyResponse),
2347        #[prost(message, tag = "15")]
2348        Cardano(super::CardanoResponse),
2349        #[prost(message, tag = "16")]
2350        Bip85(super::Bip85Response),
2351        #[prost(message, tag = "17")]
2352        Bluetooth(super::BluetoothResponse),
2353    }
2354}