Struct trezor_client::SignTxProgress
source · pub struct SignTxProgress<'a> { /* private fields */ }
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
sourceimpl<'a> SignTxProgress<'a>
impl<'a> SignTxProgress<'a>
sourcepub fn new(client: &mut Trezor, req: TxRequest) -> SignTxProgress<'_>
pub fn new(client: &mut Trezor, req: TxRequest) -> SignTxProgress<'_>
Only intended for internal usage.
sourcepub fn tx_request(&self) -> &TxRequest
pub fn tx_request(&self) -> &TxRequest
Inspector to the request message received from the device.
sourcepub fn has_signature(&self) -> bool
pub fn has_signature(&self) -> bool
Check if a signature is provided by the device.
sourcepub fn get_signature(&self) -> Option<(usize, &[u8])>
pub fn get_signature(&self) -> Option<(usize, &[u8])>
Get the signature provided from the device along with the input index of the signature.
sourcepub fn has_serialized_tx_part(&self) -> bool
pub fn has_serialized_tx_part(&self) -> bool
Check if a part of the serialized signed tx is provided by the device.
sourcepub fn get_serialized_tx_part(&self) -> Option<&[u8]>
pub fn get_serialized_tx_part(&self) -> Option<&[u8]>
Get the part of the serialized signed tx from the device.
sourcepub fn ack_msg(
self,
ack: TxAck
) -> Result<TrezorResponse<'a, SignTxProgress<'a>, TxRequest>>
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.
sourcepub fn ack_psbt(
self,
psbt: &PartiallySignedTransaction,
network: Network
) -> Result<TrezorResponse<'a, SignTxProgress<'a>, TxRequest>>
pub fn ack_psbt(
self,
psbt: &PartiallySignedTransaction,
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.