Struct ledger_ethereum::EthApp

source ·
pub struct EthApp<E: Exchange> { /* private fields */ }

Implementations§

source§

impl<E> EthApp<E>where E: Exchange + Send + Sync, E::Error: Error,

source

pub async fn address( &self, path: &BIP44Path, enable_display: Option<bool>, enabled_chain_code: Option<bool> ) -> Result<Address, EthError<E::Error>>

Retrieves the public key and address

source§

impl<E> EthApp<E>where E: Exchange + Send + Sync, E::Error: Error,

source

pub async fn configuration( &self ) -> Result<AppConfiguration, EthError<E::Error>>

Retrieves the app configuration

source§

impl<E> EthApp<E>where E: Exchange + Send + Sync, E::Error: Error,

source

pub async fn provide_erc20_token_info( &self, data: &[u8] ) -> Result<(), EthError<E::Error>>

This command provides a trusted description of an ERC 20 token to associate a contract address with a ticker and number of decimals. It shall be run immediately before performing a transaction involving a contract calling this contract address to display the proper token information to the user if necessary, as marked in GET APP CONFIGURATION flags. The signature is computed on ticker || address || number of decimals (uint4be) || chainId (uint4be) signed by the following secp256k1 public key 0482bbf2f34f367b2e5bc21847b6566f21f0976b22d3388a9a5e446ac62d25cf725b62a2555b2dd464a4da0ab2f4d506820543af1d242470b1b1a969a27578f353

source§

impl<E> EthApp<E>where E: Exchange + Send + Sync, E::Error: Error,

source

pub async fn sign( &self, path: &BIP44Path, raw_tx: &[u8], _resolution: Option<LedgerEthTransactionResolution> ) -> Result<Signature, EthError<E::Error>>

Sign a transaction

source§

impl<E: Exchange> EthApp<E>

source

pub const fn new(transport: E) -> Self

Create a new EthApp with the given transport

source§

impl<E> EthApp<E>where E: Exchange + Send + Sync, E::Error: Error,

source

pub async fn send_chunks( &self, command: APDUCommand<Vec<u8>> ) -> Result<APDUAnswer<E::AnswerType>, LedgerAppError<E::Error>>

Trait Implementations§

source§

impl<E: Exchange> App for EthApp<E>

source§

const CLA: u8 = 224u8

App’s APDU CLA
source§

impl<E: Debug + Exchange> Debug for EthApp<E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<E> RefUnwindSafe for EthApp<E>where E: RefUnwindSafe,

§

impl<E> Send for EthApp<E>where E: Send,

§

impl<E> Sync for EthApp<E>where E: Sync,

§

impl<E> Unpin for EthApp<E>where E: Unpin,

§

impl<E> UnwindSafe for EthApp<E>where E: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.