diff --git a/bdk-ffi/src/bitcoin.rs b/bdk-ffi/src/bitcoin.rs index f17a8383..dd977742 100644 --- a/bdk-ffi/src/bitcoin.rs +++ b/bdk-ffi/src/bitcoin.rs @@ -4,6 +4,7 @@ use crate::error::{ }; use crate::error::{ParseAmountError, PsbtFinalizeError}; use crate::{impl_from_core_type, impl_hash_like, impl_into_core_type}; +use std::collections::HashMap; use bdk_wallet::bitcoin::address::NetworkChecked; use bdk_wallet::bitcoin::address::NetworkUnchecked; @@ -14,7 +15,9 @@ use bdk_wallet::bitcoin::consensus::encode::serialize; use bdk_wallet::bitcoin::consensus::Decodable; use bdk_wallet::bitcoin::hashes::sha256::Hash as BitcoinSha256Hash; use bdk_wallet::bitcoin::hashes::sha256d::Hash as BitcoinDoubleSha256Hash; +use bdk_wallet::bitcoin::hex::DisplayHex; use bdk_wallet::bitcoin::io::Cursor; +use bdk_wallet::bitcoin::psbt::Input as BdkInput; use bdk_wallet::bitcoin::secp256k1::Secp256k1; use bdk_wallet::bitcoin::Amount as BdkAmount; use bdk_wallet::bitcoin::BlockHash as BitcoinBlockHash; @@ -500,6 +503,238 @@ impl Display for Transaction { } } +#[derive(Clone, Debug, uniffi::Record)] +pub struct TapScriptSig { + /// x-only pubkey as hex + pub xonly_pubkey: String, + /// tap leaf hash as hex + pub leaf_hash: String, + /// signature bytes + pub signature: Vec, +} + +#[derive(Clone, Debug, uniffi::Record)] +pub struct TapScriptEntry { + /// control block bytes + pub control_block: String, + /// script (reuse existing `Script` FFI type) + pub script: Arc