Struct trezor_client::SignTxProgress

source ·
pub struct SignTxProgress<'a> { /* private fields */ }
Available on crate feature bitcoin only.
Expand description

Object to track the progress in the transaction signing flow. The device will ask for various parts of the transaction and dependent transactions and can at any point also ask for user interaction. The information asked for by the device is provided based on a PSBT object and the resulting extra signatures are also added to the PSBT file.

It’s important to always first check with the finished() method if more data is requested by the device. If you’re not yet finished you must call the ack_psbt() method to send more information to the device.

Implementations§

source§

impl<'a> SignTxProgress<'a>

source

pub fn new(client: &mut Trezor, req: TxRequest) -> SignTxProgress<'_>

Only intended for internal usage.

source

pub fn tx_request(&self) -> &TxRequest

Inspector to the request message received from the device.

source

pub fn finished(&self) -> bool

Check whether or not the signing process is finished.

source

pub fn has_signature(&self) -> bool

Check if a signature is provided by the device.

source

pub fn get_signature(&self) -> Option<(usize, &[u8])>

Get the signature provided from the device along with the input index of the signature.

source

pub fn has_serialized_tx_part(&self) -> bool

Check if a part of the serialized signed tx is provided by the device.

source

pub fn get_serialized_tx_part(&self) -> Option<&[u8]>

Get the part of the serialized signed tx from the device.

source

pub fn ack_msg( self, ack: TxAck, ) -> Result<TrezorResponse<'a, SignTxProgress<'a>, TxRequest>>

Manually provide a TxAck message to the device.

This method will panic if finished() returned true, so it should always be checked in advance.

source

pub fn ack_psbt( self, psbt: &Psbt, network: Network, ) -> Result<TrezorResponse<'a, SignTxProgress<'a>, TxRequest>>

Provide additional PSBT information to the device.

This method will panic if apply() returned true, so it should always be checked in advance.

Auto Trait Implementations§

§

impl<'a> !Freeze for SignTxProgress<'a>

§

impl<'a> !RefUnwindSafe for SignTxProgress<'a>

§

impl<'a> Send for SignTxProgress<'a>

§

impl<'a> Sync for SignTxProgress<'a>

§

impl<'a> Unpin for SignTxProgress<'a>

§

impl<'a> !UnwindSafe for SignTxProgress<'a>

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> 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> 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 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>,

§

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>,

§

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