pub struct Psbt(/* private fields */);Expand description
A Partially Signed Transaction.
Implementations§
Source§impl Psbt
impl Psbt
Sourcepub fn new(psbt_base64: String) -> Result<Self, PsbtParseError>
pub fn new(psbt_base64: String) -> Result<Self, PsbtParseError>
Creates a new Psbt instance from a base64-encoded string.
Sourcepub fn from_unsigned_tx(tx: Arc<Transaction>) -> Result<Arc<Psbt>, PsbtError>
pub fn from_unsigned_tx(tx: Arc<Transaction>) -> Result<Arc<Psbt>, PsbtError>
Sourcepub fn extract_tx(&self) -> Result<Arc<Transaction>, ExtractTxError>
pub fn extract_tx(&self) -> Result<Arc<Transaction>, ExtractTxError>
Extracts the Transaction from a Psbt by filling in the available signature information.
§Errors
ExtractTxError variants will contain either the Psbt itself or the Transaction
that was extracted. These can be extracted from the Errors in order to recover.
See the error documentation for info on the variants. In general, it covers large fees.
Sourcepub fn fee(&self) -> Result<u64, PsbtError>
pub fn fee(&self) -> Result<u64, PsbtError>
Calculates transaction fee.
‘Fee’ being the amount that will be paid for mining a transaction with the current inputs and outputs i.e., the difference in value of the total inputs and the total outputs.
§Errors
MissingUtxowhen UTXO information for any input is not present or is invalid.NegativeFeeif calculated value is negative.FeeOverflowif an integer overflow occurs.
Sourcepub fn combine(&self, other: Arc<Psbt>) -> Result<Arc<Psbt>, PsbtError>
pub fn combine(&self, other: Arc<Psbt>) -> Result<Arc<Psbt>, PsbtError>
Combines this Psbt with other PSBT as described by BIP 174.
In accordance with BIP 174 this function is commutative i.e., A.combine(B) == B.combine(A)
Sourcepub fn finalize(&self) -> FinalizedPsbtResult
pub fn finalize(&self) -> FinalizedPsbtResult
Finalizes the current PSBT and produces a result indicating
whether the finalization was successful or not.
Sourcepub fn write_to_file(&self, path: String) -> Result<(), PsbtError>
pub fn write_to_file(&self, path: String) -> Result<(), PsbtError>
Write the Psbt to a file. Note that the file must not yet exist.
Sourcepub fn json_serialize(&self) -> String
pub fn json_serialize(&self) -> String
Serializes the PSBT into a JSON string representation.
Sourcepub fn spend_utxo(&self, input_index: u64) -> String
pub fn spend_utxo(&self, input_index: u64) -> String
Returns the spending utxo for this PSBT’s input at input_index.
Trait Implementations§
Source§impl<UT> LowerError<UT> for Psbt
impl<UT> LowerError<UT> for Psbt
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for Psbt
impl<UT> LowerReturn<UT> for Psbt
Source§type ReturnType = <Arc<Psbt> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<Psbt> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Auto Trait Implementations§
impl !Freeze for Psbt
impl RefUnwindSafe for Psbt
impl Send for Psbt
impl Sync for Psbt
impl Unpin for Psbt
impl UnwindSafe for Psbt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more