pub struct DeviceHandle<T: Device> { /* private fields */ }
Expand description

MobileCoin handle for a connected ledger Device.

This is generic over Device types to support different underlying transports / providers

Implementations§

source§

impl<T: Device + Send> DeviceHandle<T>

source

pub async fn app_info(&mut self) -> Result<MobAppInfo, Error>

Fetch ledger application info

source

pub async fn account_keys( &mut self, account_index: u32 ) -> Result<ViewAccount, Error>

Fetch root keys for the provided account index

source

pub async fn subaddress_keys( &mut self, account_index: u32, subaddress_index: u64 ) -> Result<ViewSubaddress, Error>

Fetch subaddress keys for the provided account and subaddress index

source

pub async fn key_image( &mut self, account_index: u32, subaddress_index: u64, tx_public_key: RistrettoPublic ) -> Result<KeyImage, Error>

Resolve a key image for a given tx_out

source

pub async fn account(&mut self, account_index: u32) -> AccountHandle<T>

Fetch a handle to a specific on-device account by SLIP-0010 index

source

pub async fn transaction( &mut self, account_index: u32, approval_timeout_s: u32, unsigned: UnsignedTx ) -> Result<(Tx, Vec<TxoSynced>), Error>

Sign an unsigned transaction object using the device

source

pub async fn identity( &mut self, index: u32, uri: &str, challenge: &[u8] ) -> Result<(VerifyingKey, [u8; 64]), Error>

Execute and identity challenge and response

Trait Implementations§

source§

impl<T: Clone + Device> Clone for DeviceHandle<T>

source§

fn clone(&self) -> DeviceHandle<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Device + Send> Device for DeviceHandle<T>

Re-export Device trait for MobileCoin DeviceHandle

source§

fn request<'a, 'b, 'life0, 'async_trait, RESP>( &'life0 mut self, request: impl 'async_trait + ApduReq<'a> + Send, buff: &'b mut [u8], timeout: Duration ) -> Pin<Box<dyn Future<Output = Result<RESP, Error>> + Send + 'async_trait>>where RESP: 'async_trait + ApduBase<'b>, Self: 'async_trait, 'a: 'async_trait, 'b: 'async_trait, 'life0: 'async_trait,

Issue a request APDU, returning a reponse APDU
§

fn app_info<'life0, 'async_trait>( &'life0 mut self, timeout: Duration ) -> Pin<Box<dyn Future<Output = Result<AppInfo, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Send + 'async_trait,

Fetch application information
§

fn device_info<'life0, 'async_trait>( &'life0 mut self, timeout: Duration ) -> Pin<Box<dyn Future<Output = Result<DeviceInfo, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: Send + 'async_trait,

Fetch device information
source§

impl<T: Device> From<T> for DeviceHandle<T>

Create a DeviceHandle wrapper from a type implementing Device

source§

fn from(t: T) -> Self

Converts to this type from the input type.
source§

impl<T: Device> Send for DeviceHandle<T>

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for DeviceHandle<T>

§

impl<T> Sync for DeviceHandle<T>where T: Send,

§

impl<T> Unpin for DeviceHandle<T>

§

impl<T> !UnwindSafe for DeviceHandle<T>

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more