Struct ethers_signers::Ledger[][src]

pub struct Ledger {
    pub chain_id: Option<u64>,
    pub address: Address,
    // some fields omitted
}

A Ledger Ethereum App.

This is a simple wrapper around the Ledger transport

Fields

chain_id: Option<u64>address: Address

The ledger’s address, instantiated at runtime

Implementations

impl LedgerEthereum[src]

pub async fn new(
    derivation: DerivationType,
    chain_id: Option<u64>
) -> Result<Self, LedgerError>
[src]

Instantiate the application by acquiring a lock on the ledger device.

use ethers::signers::{Ledger, HDPath};

let ledger = Ledger::new(HDPath::LedgerLive(0), Some(1)).await?;

pub fn close(self)[src]

Consume self and drop the ledger mutex

pub async fn get_address(&self) -> Result<Address, LedgerError>[src]

Get the account which corresponds to our derivation path

pub async fn get_address_with_path(
    &self,
    derivation: &DerivationType
) -> Result<Address, LedgerError>
[src]

Gets the account which corresponds to the provided derivation path

pub async fn version(&self) -> Result<String, LedgerError>[src]

Returns the semver of the Ethereum ledger app

pub async fn sign_tx(
    &self,
    tx: &TransactionRequest,
    chain_id: Option<u64>
) -> Result<Signature, LedgerError>
[src]

Signs an Ethereum transaction (requires confirmation on the ledger)

pub async fn sign_message<S: AsRef<[u8]>>(
    &self,
    message: S
) -> Result<Signature, LedgerError>
[src]

Signs an ethereum personal message

Trait Implementations

impl Debug for LedgerEthereum[src]

impl Signer for LedgerEthereum[src]

type Error = LedgerError

fn sign_message<'life0, 'async_trait, S: Send + Sync + AsRef<[u8]>>(
    &'life0 self,
    message: S
) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>> where
    S: 'async_trait,
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Signs the hash of the provided message after prefixing it

fn sign_transaction<'life0, 'life1, 'async_trait>(
    &'life0 self,
    message: &'life1 TransactionRequest
) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Signs the transaction

fn address(&self) -> Address[src]

Returns the signer’s Ethereum Address

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,