Skip to main content

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