Struct ethers::signers::Ledger [−][src]
pub struct Ledger { /* fields omitted */ }
Expand description
A Ledger Ethereum App.
This is a simple wrapper around the Ledger transport
Implementations
pub async fn new(
derivation: DerivationType,
chain_id: u64
) -> Result<LedgerEthereum, LedgerError>
pub async fn new(
derivation: DerivationType,
chain_id: u64
) -> Result<LedgerEthereum, LedgerError>
Instantiate the application by acquiring a lock on the ledger device.
use ethers_signers::{Ledger, HDPath};
let ledger = Ledger::new(HDPath::LedgerLive(0), 1).await?;
Get the account which corresponds to our derivation path
pub async fn get_address_with_path(
&'_ self,
derivation: &'_ DerivationType
) -> Result<H160, LedgerError>
pub async fn get_address_with_path(
&'_ self,
derivation: &'_ DerivationType
) -> Result<H160, LedgerError>
Gets the account which corresponds to the provided derivation path
Returns the semver of the Ethereum ledger app
Signs an Ethereum transaction (requires confirmation on the ledger)
pub async fn sign_message<S>(
&'_ self,
message: S
) -> Result<Signature, LedgerError> where
S: AsRef<[u8]>,
pub async fn sign_message<S>(
&'_ self,
message: S
) -> Result<Signature, LedgerError> where
S: AsRef<[u8]>,
Signs an ethereum personal message
pub async fn sign_typed_struct<T>(
&'_ self,
payload: &'_ T
) -> Result<Signature, LedgerError> where
T: Eip712,
pub async fn sign_typed_struct<T>(
&'_ self,
payload: &'_ T
) -> Result<Signature, LedgerError> where
T: Eip712,
Signs an EIP712 encoded domain separator and message
pub async fn sign_payload(
&'_ self,
command: INS,
payload: Vec<u8, Global>
) -> Result<Signature, LedgerError>
Trait Implementations
Signs the hash of the provided message after prefixing it
pub fn sign_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 TypedTransaction
) -> Pin<Box<dyn Future<Output = Result<Signature, <LedgerEthereum as Signer>::Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
LedgerEthereum: 'async_trait,
pub fn sign_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 TypedTransaction
) -> Pin<Box<dyn Future<Output = Result<Signature, <LedgerEthereum as Signer>::Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
LedgerEthereum: 'async_trait,
Signs the transaction
pub fn sign_typed_data<'life0, 'life1, 'async_trait, T>(
&'life0 self,
payload: &'life1 T
) -> Pin<Box<dyn Future<Output = Result<Signature, <LedgerEthereum as Signer>::Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
T: Eip712 + Send + Sync + 'async_trait,
LedgerEthereum: 'async_trait,
pub fn sign_typed_data<'life0, 'life1, 'async_trait, T>(
&'life0 self,
payload: &'life1 T
) -> Pin<Box<dyn Future<Output = Result<Signature, <LedgerEthereum as Signer>::Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
T: Eip712 + Send + Sync + 'async_trait,
LedgerEthereum: 'async_trait,
Signs a EIP712 derived struct
type Error = LedgerError
Sets the signer’s chain id
Auto Trait Implementations
impl !RefUnwindSafe for LedgerEthereum
impl Send for LedgerEthereum
impl Sync for LedgerEthereum
impl Unpin for LedgerEthereum
impl UnwindSafe for LedgerEthereum
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more