pub enum Event {
Show 23 variants None, GetWalletKeys { account_index: u32, }, GetSubaddressKeys { account_index: u32, subaddress_index: u64, }, GetKeyImage { account_index: u32, subaddress_index: u64, txout_public_key: TxOutPublic, }, GetRandom, IdentSign { ident_index: u32, ident_uri: String<32>, challenge: Vec<u8, 64>, }, IdentGet, TxInit { account_index: u32, num_rings: u8, }, TxSignMemo { subaddress_index: u64, tx_public_key: TxOutPublic, receiver_view_public: SubaddressViewPublic, kind: [u8; 2], payload: [u8; 48], }, TxSetMessage(Vec<u8, 64>), TxSummaryInit { message: [u8; 32], block_version: u32, num_outputs: u32, num_inputs: u32, }, TxSummaryAddOutput { masked_amount: Option<MaskedAmount>, target_key: CompressedRistrettoPublic, public_key: CompressedRistrettoPublic, associated_to_input_rules: bool, }, TxSummaryAddOutputUnblinding { unmasked_amount: UnmaskedAmount, address: Option<PublicSubaddress>, fog_info: Option<(FogId, [u8; 64])>, tx_private_key: Option<TxPrivateKey>, }, TxSummaryAddInput { pseudo_output_commitment: CompressedCommitment, input_rules_digest: Option<[u8; 32]>, unmasked_amount: UnmaskedAmount, }, TxSummaryBuild { fee: Amount, tombstone_block: u64, }, TxRingInit { ring_size: u8, real_index: u8, subaddress_index: u64, value: u64, token_id: u64, onetime_private_key: Option<TxOnetimeKey>, }, TxSetBlinding { blinding: Scalar, output_blinding: Scalar, }, TxAddTxout(u8, ReducedTxOut), TxSign, TxGetKeyImage, TxGetResponse { index: u8, }, TxComplete, TxGetInfo,
}
Expand description

Engine input events, typically decoded from request APDUs

Variants§

§

None

§

GetWalletKeys

Fields

§account_index: u32

Fetch wallet keys

§

GetSubaddressKeys

Fields

§account_index: u32
§subaddress_index: u64

Fetch subaddress keys

§

GetKeyImage

Fields

§account_index: u32
§subaddress_index: u64
§txout_public_key: TxOutPublic

Fetch key image

§

GetRandom

Fetch random value via RNG

§

IdentSign

Fields

§ident_index: u32
§ident_uri: String<32>
§challenge: Vec<u8, 64>

Request BIP-0017 derived ed25519 identity

§

IdentGet

Fetch signed identity

§

TxInit

Fields

§account_index: u32
§num_rings: u8

Initialise transaction

§

TxSignMemo

Fields

§subaddress_index: u64
§tx_public_key: TxOutPublic
§receiver_view_public: SubaddressViewPublic
§kind: [u8; 2]
§payload: [u8; 48]

Sign transaction memos

§

TxSetMessage(Vec<u8, 64>)

Set transaction message

§

TxSummaryInit

Fields

§message: [u8; 32]
§block_version: u32
§num_outputs: u32
§num_inputs: u32

Set transaction summary (replaces TxSetMessage where streaming verification is supported)

§

TxSummaryAddOutput

Fields

§masked_amount: Option<MaskedAmount>
§target_key: CompressedRistrettoPublic
§public_key: CompressedRistrettoPublic
§associated_to_input_rules: bool

Add output to TxSummary

§

TxSummaryAddOutputUnblinding

Fields

§unmasked_amount: UnmaskedAmount
§address: Option<PublicSubaddress>
§fog_info: Option<(FogId, [u8; 64])>
§tx_private_key: Option<TxPrivateKey>

Add output unblinding to TxSummary

§

TxSummaryAddInput

Fields

§pseudo_output_commitment: CompressedCommitment
§input_rules_digest: Option<[u8; 32]>
§unmasked_amount: UnmaskedAmount

Add input to TxSummary

§

TxSummaryBuild

Fields

§fee: Amount
§tombstone_block: u64

Build complete TxSummary

§

TxRingInit

Fields

§ring_size: u8
§real_index: u8
§subaddress_index: u64
§value: u64
§token_id: u64
§onetime_private_key: Option<TxOnetimeKey>

Initialise ring signing

§

TxSetBlinding

Fields

§blinding: Scalar
§output_blinding: Scalar
§

TxAddTxout(u8, ReducedTxOut)

Add TxOut to ring

§

TxSign

Sign ring

§

TxGetKeyImage

Fetch key image

§

TxGetResponse

Fields

§index: u8

Index into ring

Fetch responses

§

TxComplete

Complete transaction

§

TxGetInfo

Fetch TX info / state

Implementations§

source§

impl Event

source

pub unsafe fn init(p: *mut Self)

In-place initialisation

Safety

This is safe as long as the pointer is valid

source

pub fn parse(ins: u8, buff: &[u8]) -> Result<Self, ApduError>

Parse an incoming APDU to engine event

source

pub fn hash(&self) -> Option<[u8; 32]>

Compute a SHA512_256 hash for state-mutating events, used in the construction of the streaming digest.

This calls out to ledger_mob_apdu::digest methods for consistency between events and APDUs.

Trait Implementations§

source§

impl Clone for Event

source§

fn clone(&self) -> Event

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 Debug for Event

source§

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

Formats the value using the given formatter. Read more
source§

impl From<IdentGetReq> for Event

source§

fn from(_i: IdentGetReq) -> Self

Converts to this type from the input type.
source§

impl<'a> From<IdentSignReq<'a>> for Event

source§

fn from(i: IdentSignReq<'a>) -> Self

Converts to this type from the input type.
source§

impl From<KeyImageReq> for Event

source§

fn from(a: KeyImageReq) -> Self

Converts to this type from the input type.
source§

impl From<RandomReq> for Event

source§

fn from(_: RandomReq) -> Self

Converts to this type from the input type.
source§

impl From<SubaddressKeyReq> for Event

source§

fn from(a: SubaddressKeyReq) -> Self

Converts to this type from the input type.
source§

impl From<TxAddTxOut> for Event

source§

fn from(a: TxAddTxOut) -> Self

Converts to this type from the input type.
source§

impl From<TxComplete> for Event

source§

fn from(_: TxComplete) -> Self

Converts to this type from the input type.
source§

impl From<TxGetKeyImage> for Event

source§

fn from(_: TxGetKeyImage) -> Self

Converts to this type from the input type.
source§

impl From<TxGetResponse> for Event

source§

fn from(a: TxGetResponse) -> Self

Converts to this type from the input type.
source§

impl From<TxInfoReq> for Event

source§

fn from(_: TxInfoReq) -> Self

Converts to this type from the input type.
source§

impl From<TxInit> for Event

source§

fn from(a: TxInit) -> Self

Converts to this type from the input type.
source§

impl From<TxMemoSign> for Event

source§

fn from(a: TxMemoSign) -> Self

Converts to this type from the input type.
source§

impl From<TxRingInit> for Event

source§

fn from(a: TxRingInit) -> Self

Converts to this type from the input type.
source§

impl From<TxRingSign> for Event

source§

fn from(_: TxRingSign) -> Self

Converts to this type from the input type.
source§

impl From<TxSetBlinding> for Event

source§

fn from(a: TxSetBlinding) -> Self

Converts to this type from the input type.
source§

impl<'a> From<TxSetMessage<'a>> for Event

source§

fn from(a: TxSetMessage<'a>) -> Self

Converts to this type from the input type.
source§

impl From<TxSummaryAddTxIn> for Event

source§

fn from(a: TxSummaryAddTxIn) -> Self

Converts to this type from the input type.
source§

impl From<TxSummaryAddTxOut> for Event

source§

fn from(a: TxSummaryAddTxOut) -> Self

Converts to this type from the input type.
source§

impl From<TxSummaryAddTxOutUnblinding> for Event

source§

fn from(a: TxSummaryAddTxOutUnblinding) -> Self

Converts to this type from the input type.
source§

impl From<TxSummaryBuild> for Event

source§

fn from(a: TxSummaryBuild) -> Self

Converts to this type from the input type.
source§

impl From<TxSummaryInit> for Event

source§

fn from(a: TxSummaryInit) -> Self

Converts to this type from the input type.
source§

impl From<WalletKeyReq> for Event

source§

fn from(a: WalletKeyReq) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

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<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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