Struct ethers_signers::Trezor
source · [−]pub struct Trezor { /* private fields */ }
Expand description
A Trezor Ethereum App.
This is a simple wrapper around the Trezor transport
Implementations
sourceimpl TrezorEthereum
impl TrezorEthereum
pub async fn new(
derivation: DerivationType,
chain_id: u64,
cache_dir: Option<PathBuf>
) -> Result<Self, TrezorError>
sourcepub async fn get_address(&self) -> Result<Address, TrezorError>
pub async fn get_address(&self) -> Result<Address, TrezorError>
Get the account which corresponds to our derivation path
sourcepub async fn get_address_with_path(
&self,
derivation: &DerivationType
) -> Result<Address, TrezorError>
pub async fn get_address_with_path(
&self,
derivation: &DerivationType
) -> Result<Address, TrezorError>
Gets the account which corresponds to the provided derivation path
sourcepub async fn sign_tx(
&self,
tx: &TypedTransaction
) -> Result<Signature, TrezorError>
pub async fn sign_tx(
&self,
tx: &TypedTransaction
) -> Result<Signature, TrezorError>
Signs an Ethereum transaction (requires confirmation on the Trezor)
sourcepub async fn sign_message<S: AsRef<[u8]>>(
&self,
message: S
) -> Result<Signature, TrezorError>
pub async fn sign_message<S: AsRef<[u8]>>(
&self,
message: S
) -> Result<Signature, TrezorError>
Signs an ethereum personal message
sourcepub async fn sign_typed_struct<T>(
&self,
payload: &T
) -> Result<Signature, TrezorError> where
T: Eip712,
pub async fn sign_typed_struct<T>(
&self,
payload: &T
) -> Result<Signature, TrezorError> where
T: Eip712,
Signs an EIP712 encoded domain separator and message
Trait Implementations
sourceimpl Debug for TrezorEthereum
impl Debug for TrezorEthereum
sourceimpl Signer for TrezorEthereum
impl Signer for TrezorEthereum
sourcefn sign_message<'life0, 'async_trait, S>(
&'life0 self,
message: S
) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>> where
S: 'async_trait + Send + Sync + AsRef<[u8]>,
'life0: 'async_trait,
Self: 'async_trait,
fn sign_message<'life0, 'async_trait, S>(
&'life0 self,
message: S
) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>> where
S: 'async_trait + Send + Sync + AsRef<[u8]>,
'life0: 'async_trait,
Self: 'async_trait,
Signs the hash of the provided message after prefixing it
sourcefn sign_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 TypedTransaction
) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn sign_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 TypedTransaction
) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Signs the transaction
sourcefn sign_typed_data<'life0, 'life1, 'async_trait, T>(
&'life0 self,
payload: &'life1 T
) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>> where
T: 'async_trait + Eip712 + Send + Sync,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn sign_typed_data<'life0, 'life1, 'async_trait, T>(
&'life0 self,
payload: &'life1 T
) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>> where
T: 'async_trait + Eip712 + Send + Sync,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Signs a EIP712 derived struct
type Error = TrezorError
sourcefn with_chain_id<T: Into<u64>>(self, chain_id: T) -> Self
fn with_chain_id<T: Into<u64>>(self, chain_id: T) -> Self
Sets the signer’s chain id
Auto Trait Implementations
impl RefUnwindSafe for TrezorEthereum
impl Send for TrezorEthereum
impl Sync for TrezorEthereum
impl Unpin for TrezorEthereum
impl UnwindSafe for TrezorEthereum
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more