diff --git a/bdk-ffi/src/bdk.udl b/bdk-ffi/src/bdk.udl index c5966f25..ae8a244c 100644 --- a/bdk-ffi/src/bdk.udl +++ b/bdk-ffi/src/bdk.udl @@ -519,6 +519,8 @@ interface Transaction { i32 version(); sequence serialize(); + + u64 weight(); }; interface Psbt { diff --git a/bdk-ffi/src/bitcoin.rs b/bdk-ffi/src/bitcoin.rs index 74171013..3ca3d527 100644 --- a/bdk-ffi/src/bitcoin.rs +++ b/bdk-ffi/src/bitcoin.rs @@ -129,9 +129,9 @@ impl Transaction { self.inner.txid().to_string() } - // fn weight(&self) -> u64 { - // self.inner.weight() as u64 - // } + pub fn weight(&self) -> u64 { + self.inner.weight().to_wu() + } pub fn total_size(&self) -> u64 { self.inner.total_size() as u64