Struct 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> Freeze for EthApp<E>
where E: Freeze,

§

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T, E> AppExt<E> for T
where T: App, E: Exchange + Send + Sync, <E as Exchange>::Error: Error,

Source§

fn get_device_info<'life0, 'async_trait>( transport: &'life0 E, ) -> Pin<Box<dyn Future<Output = Result<DeviceInfo, LedgerAppError<<E as Exchange>::Error>>> + Send + 'async_trait>>
where 'life0: 'async_trait,

Retrieve the device info Read more
Source§

fn get_app_info<'life0, 'async_trait>( transport: &'life0 E, ) -> Pin<Box<dyn Future<Output = Result<AppInfo, LedgerAppError<<E as Exchange>::Error>>> + Send + 'async_trait>>
where 'life0: 'async_trait,

Retrieve the app info Read more
Source§

fn get_version<'life0, 'async_trait>( transport: &'life0 E, ) -> Pin<Box<dyn Future<Output = Result<Version, LedgerAppError<<E as Exchange>::Error>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Send + 'async_trait,

Retrieve the app version
Source§

fn send_chunks<'life0, 'life1, 'async_trait, I>( transport: &'life0 E, command: APDUCommand<I>, message: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<APDUAnswer<<E as Exchange>::AnswerType>, LedgerAppError<<E as Exchange>::Error>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, I: 'async_trait + Deref<Target = [u8]> + Send + Sync,

Stream a long request in chunks
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.