Struct trezor_client::client::Trezor
source · pub struct Trezor { /* private fields */ }
Expand description
A Trezor client.
Implementations§
source§impl Trezor
impl Trezor
pub fn get_public_key( &mut self, path: &DerivationPath, script_type: InputScriptType, network: Network, show_display: bool, ) -> Result<TrezorResponse<'_, Xpub, PublicKey>>
Available on crate feature
bitcoin
only.pub fn get_address( &mut self, path: &DerivationPath, script_type: InputScriptType, network: Network, show_display: bool, ) -> Result<TrezorResponse<'_, Address, Address>>
Available on crate feature
bitcoin
only.pub fn sign_tx( &mut self, psbt: &Psbt, network: Network, ) -> Result<TrezorResponse<'_, SignTxProgress<'_>, TxRequest>>
Available on crate feature
bitcoin
only.pub fn sign_message( &mut self, message: String, path: &DerivationPath, script_type: InputScriptType, network: Network, ) -> Result<TrezorResponse<'_, (Address, RecoverableSignature), MessageSignature>>
Available on crate feature
bitcoin
only.source§impl Trezor
impl Trezor
pub fn ethereum_get_address(&mut self, path: Vec<u32>) -> Result<String>
Available on crate feature
ethereum
only.pub fn ethereum_sign_message( &mut self, message: Vec<u8>, path: Vec<u32>, ) -> Result<Signature>
Available on crate feature
ethereum
only.pub fn ethereum_sign_tx( &mut self, path: Vec<u32>, nonce: Vec<u8>, gas_price: Vec<u8>, gas_limit: Vec<u8>, to: String, value: Vec<u8>, data: Vec<u8>, chain_id: Option<u64>, ) -> Result<Signature>
Available on crate feature
ethereum
only.pub fn ethereum_sign_eip1559_tx( &mut self, path: Vec<u32>, nonce: Vec<u8>, gas_limit: Vec<u8>, to: String, value: Vec<u8>, data: Vec<u8>, chain_id: Option<u64>, max_gas_fee: Vec<u8>, max_priority_fee: Vec<u8>, access_list: Vec<AccessListItem>, ) -> Result<Signature>
Available on crate feature
ethereum
only.source§impl Trezor
impl Trezor
sourcepub fn call_raw<S: TrezorMessage>(&mut self, message: S) -> Result<ProtoMessage>
pub fn call_raw<S: TrezorMessage>(&mut self, message: S) -> Result<ProtoMessage>
Sends a message and returns the raw ProtoMessage struct that was responded by the device. This method is only exported for users that want to expand the features of this library f.e. for supporting additional coins etc.
sourcepub fn call<'a, T, S: TrezorMessage, R: TrezorMessage>(
&'a mut self,
message: S,
result_handler: Box<ResultHandler<'a, T, R>>,
) -> Result<TrezorResponse<'a, T, R>>
pub fn call<'a, T, S: TrezorMessage, R: TrezorMessage>( &'a mut self, message: S, result_handler: Box<ResultHandler<'a, T, R>>, ) -> Result<TrezorResponse<'a, T, R>>
Sends a message and returns a TrezorResponse with either the expected response message, a failure or an interaction request. This method is only exported for users that want to expand the features of this library f.e. for supporting additional coins etc.
pub fn init_device(&mut self, session_id: Option<Vec<u8>>) -> Result<()>
pub fn initialize( &mut self, session_id: Option<Vec<u8>>, ) -> Result<TrezorResponse<'_, Features, Features>>
pub fn ping(&mut self, message: &str) -> Result<TrezorResponse<'_, (), Success>>
pub fn change_pin( &mut self, remove: bool, ) -> Result<TrezorResponse<'_, (), Success>>
pub fn wipe_device(&mut self) -> Result<TrezorResponse<'_, (), Success>>
pub fn recover_device( &mut self, word_count: WordCount, passphrase_protection: bool, pin_protection: bool, label: String, dry_run: bool, ) -> Result<TrezorResponse<'_, (), Success>>
pub fn reset_device( &mut self, display_random: bool, strength: usize, passphrase_protection: bool, pin_protection: bool, label: String, skip_backup: bool, no_backup: bool, ) -> Result<TrezorResponse<'_, EntropyRequest<'_>, EntropyRequest>>
pub fn backup(&mut self) -> Result<TrezorResponse<'_, (), Success>>
pub fn apply_settings( &mut self, label: Option<String>, use_passphrase: Option<bool>, homescreen: Option<Vec<u8>>, auto_lock_delay_ms: Option<usize>, ) -> Result<TrezorResponse<'_, (), Success>>
pub fn sign_identity( &mut self, identity: IdentityType, digest: Vec<u8>, curve: String, ) -> Result<TrezorResponse<'_, Vec<u8>, SignedIdentity>>
pub fn get_ecdh_session_key( &mut self, identity: IdentityType, peer_public_key: Vec<u8>, curve: String, ) -> Result<TrezorResponse<'_, ECDHSessionKey, ECDHSessionKey>>
Auto Trait Implementations§
impl !Freeze for Trezor
impl !RefUnwindSafe for Trezor
impl Send for Trezor
impl Sync for Trezor
impl Unpin for Trezor
impl !UnwindSafe for Trezor
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more