Skip to content

Commit

Permalink
feat: add lock_time method on transaction type
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed May 16, 2024
1 parent c702894 commit 5e3e249
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bdk-ffi/src/bdk.udl
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,8 @@ interface Transaction {
sequence<TxIn> input();

sequence<TxOut> output();

u32 lock_time();
};

interface Psbt {
Expand Down
4 changes: 4 additions & 0 deletions bdk-ffi/src/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ impl Transaction {
pub fn output(&self) -> Vec<TxOut> {
self.0.output.iter().map(|tx_out| tx_out.into()).collect()
}

pub fn lock_time(&self) -> u32 {
self.0.lock_time.to_consensus_u32()
}
}

impl From<BdkTransaction> for Transaction {
Expand Down

0 comments on commit 5e3e249

Please sign in to comment.