diff --git a/src/bitcoin.udl b/src/bitcoin.udl index de7cd10..3784a66 100644 --- a/src/bitcoin.udl +++ b/src/bitcoin.udl @@ -44,6 +44,13 @@ dictionary OutPoint { u32 vout; }; +dictionary TxIn { + OutPoint previous_output; + Script script_sig; + u32 sequence; + sequence> witness; +}; + [NonExhaustive] enum Network { "Bitcoin", diff --git a/src/lib.rs b/src/lib.rs index 9790d59..cd474e2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,11 +2,13 @@ use bitcoin::address::{NetworkChecked, NetworkUnchecked}; use bitcoin::Address as BitcoinAddress; use bitcoin::Amount as BitcoinAmount; use bitcoin::FeeRate as BitcoinFeeRate; -pub use bitcoin::OutPoint; use bitcoin::ScriptBuf as BitcoinScriptBuf; +use bitcoin::TxIn as BitcoinTxIn; use bitcoin::TxOut as BitcoinTxOut; +use bitcoin::Sequence; + +pub use bitcoin::OutPoint; pub use bitcoin::Txid; -use std::sync::Arc; use error::AddressParseError; use error::FeeRateError; @@ -15,6 +17,7 @@ use error::ParseAmountError; use std::fmt::Display; use std::str::FromStr; +use std::sync::Arc; #[macro_use] mod macros; @@ -172,6 +175,40 @@ impl Amount { impl_from_core_type!(Amount, BitcoinAmount); impl_from_ffi_type!(Amount, BitcoinAmount); +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct TxIn { + pub previous_output: OutPoint, + pub script_sig: Arc