Repository: bitcoindevkit/bdk-ffi (language: python)

Issue:
Use custom package name
Take a look at examples/arithmetic/uniffi.toml over at mozilla/uniffi-rs


Discussion / hints:

Fix patch:
diff --git a/.gitignore b/.gitignore
index fbdc479d..b520e20b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,8 @@
 target
 build
 Cargo.lock
-/bdk-kotlin/local.properties
+/bindings/bdk-kotlin/local.properties
+/bindings/bdk-swift
 .gradle
 wallet_db
 bdk_ffi_test
diff --git a/Cargo.toml b/Cargo.toml
index 1f154006..4d799ff4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,5 @@
 [package]
-name = "uniffi_bdk"
+name = "bdk-ffi"
 version = "0.1.0"
 authors = ["Steve Myers <steve@notmandatory.org>", "Sudarsan Balaji <sudarsan.balaji@artfuldev.com>"]
 edition = "2018"
@@ -7,6 +7,7 @@ edition = "2018"
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 [lib]
 crate-type = ["staticlib", "cdylib"]
+name = "bdkffi"
 
 [dependencies]
 bdk = { version = "0.13", features = ["all-keys", "use-esplora-ureq"] }
diff --git a/bindings/bdk-kotlin/android/build.gradle b/bindings/bdk-kotlin/android/build.gradle
index ef034b4a..06b71acd 100644
--- a/bindings/bdk-kotlin/android/build.gradle
+++ b/bindings/bdk-kotlin/android/build.gradle
@@ -33,7 +33,7 @@ afterEvaluate {
                 from components.release
 
                 // You can then customize attributes of the publication as shown below.
-                groupId = 'uniffi.bdk'
+                groupId = 'org.bitcoindevkit'
                 artifactId = 'bdk'
                 version = '0.0.1-SNAPSHOT'
             }
@@ -42,7 +42,7 @@ afterEvaluate {
                 // Applies the component for the debug build variant.
                 from components.debug
 
-                groupId = 'uniffi.bdk'
+                groupId = 'org.bitcoindevkit'
                 artifactId = 'bdk-debug'
                 version = '0.0.1-SNAPSHOT'
             }
diff --git a/bindings/bdk-kotlin/android/src/androidTest/kotlin/uniffi/bdk/AndroidLibTest.kt b/bindings/bdk-kotlin/android/src/androidTest/kotlin/uniffi/bdk/AndroidLibTest.kt
index b3396811..323626e6 100644
--- a/bindings/bdk-kotlin/android/src/androidTest/kotlin/uniffi/bdk/AndroidLibTest.kt
+++ b/bindings/bdk-kotlin/android/src/androidTest/kotlin/uniffi/bdk/AndroidLibTest.kt
@@ -1,4 +1,4 @@
-package uniffi.bdk
+package org.bitcoindevkit
 
 import android.app.Application
 import android.content.Context.MODE_PRIVATE
diff --git a/bindings/bdk-kotlin/demo/build.gradle b/bindings/bdk-kotlin/demo/build.gradle
index b320d2f6..1fcea5c9 100644
--- a/bindings/bdk-kotlin/demo/build.gradle
+++ b/bindings/bdk-kotlin/demo/build.gradle
@@ -3,7 +3,7 @@ plugins {
     id 'application'
 }
 
-group = 'uniffi.bdk'
+group = 'org.bitcoindevkit.bdk'
 version = '1.0-SNAPSHOT'
 
 repositories {
diff --git a/bindings/bdk-kotlin/demo/src/main/kotlin/Main.kt b/bindings/bdk-kotlin/demo/src/main/kotlin/Main.kt
index 941b6eab..a02f8431 100644
--- a/bindings/bdk-kotlin/demo/src/main/kotlin/Main.kt
+++ b/bindings/bdk-kotlin/demo/src/main/kotlin/Main.kt
@@ -1,6 +1,6 @@
 import java.util.Optional
 import kotlin.ExperimentalUnsignedTypes
-import uniffi.bdk.*
+import org.bitcoindevkit.*
 
 class LogProgress : BdkProgress {
     override fun update(progress: Float, message: String?) {
diff --git a/bindings/bdk-swift.swiftdoc b/bindings/bdk-swift.swiftdoc
index 8581fa7f..69b2d4f5 100644
Binary files a/bindings/bdk-swift.swiftdoc and b/bindings/bdk-swift.swiftdoc differ
diff --git a/bindings/bdk-swift.swiftsourceinfo b/bindings/bdk-swift.swiftsourceinfo
index 61b1fc79..df9190c0 100644
Binary files a/bindings/bdk-swift.swiftsourceinfo and b/bindings/bdk-swift.swiftsourceinfo differ
diff --git a/bindings/bdk-swift/bdk.swift b/bindings/bdk-swift/bdk.swift
deleted file mode 100644
index 17d7ae38..00000000
--- a/bindings/bdk-swift/bdk.swift
+++ /dev/null
@@ -1,2077 +0,0 @@
-// This file was autogenerated by some hot garbage in the `uniffi` crate.
-// Trust me, you don't want to mess with it!
-import Foundation
-
-// Depending on the consumer's build setup, the low-level FFI code
-// might be in a separate module, or it might be compiled inline into
-// this module. This is a bit of light hackery to work with both.
-#if canImport(bdkFFI)
-import bdkFFI
-#endif
-
-fileprivate extension RustBuffer {
-    // Allocate a new buffer, copying the contents of a `UInt8` array.
-    init(bytes: [UInt8]) {
-        let rbuf = bytes.withUnsafeBufferPointer { ptr in
-            RustBuffer.from(ptr)
-        }
-        self.init(capacity: rbuf.capacity, len: rbuf.len, data: rbuf.data)
-    }
-
-    static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
-        try! rustCall { ffi_bdk_62af_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
-    }
-
-    // Frees the buffer in place.
-    // The buffer must not be used after this is called.
-    func deallocate() {
-        try! rustCall { ffi_bdk_62af_rustbuffer_free(self, $0) }
-    }
-}
-
-fileprivate extension ForeignBytes {
-    init(bufferPointer: UnsafeBufferPointer<UInt8>) {
-        self.init(len: Int32(bufferPointer.count), data: bufferPointer.baseAddress)
-    }
-}
-
-// For every type used in the interface, we provide helper methods for conveniently
-// lifting and lowering that type from C-compatible data, and for reading and writing
-// values of that type in a buffer.
-
-// Helper classes/extensions that don't change.
-// Someday, this will be in a libray of its own.
-
-fileprivate extension Data {
-    init(rustBuffer: RustBuffer) {
-        // TODO: This copies the buffer. Can we read directly from a
-        // Rust buffer?
-        self.init(bytes: rustBuffer.data!, count: Int(rustBuffer.len))
-    }
-}
-
-// A helper class to read values out of a byte buffer.
-fileprivate class Reader {
-    let data: Data
-    var offset: Data.Index
-
-    init(data: Data) {
-        self.data = data
-        self.offset = 0
-    }
-
-    // Reads an integer at the current offset, in big-endian order, and advances
-    // the offset on success. Throws if reading the integer would move the
-    // offset past the end of the buffer.
-    func readInt<T: FixedWidthInteger>() throws -> T {
-        let range = offset..<offset + MemoryLayout<T>.size
-        guard data.count >= range.upperBound else {
-            throw UniffiInternalError.bufferOverflow
-        }
-        if T.self == UInt8.self {
-            let value = data[offset]
-            offset += 1
-            return value as! T
-        }
-        var value: T = 0
-        let _ = withUnsafeMutableBytes(of: &value, { data.copyBytes(to: $0, from: range)})
-        offset = range.upperBound
-        return value.bigEndian
-    }
-
-    // Reads an arbitrary number of bytes, to be used to read
-    // raw bytes, this is useful when lifting strings
-    func readBytes(count: Int) throws -> Array<UInt8> {
-        let range = offset..<(offset+count)
-        guard data.count >= range.upperBound else {
-            throw UniffiInternalError.bufferOverflow
-        }
-        var value = [UInt8](repeating: 0, count: count)
-        value.withUnsafeMutableBufferPointer({ buffer in
-            data.copyBytes(to: buffer, from: range)
-        })
-        offset = range.upperBound
-        return value
-    }
-
-    // Reads a float at the current offset.
-    @inlinable
-    func readFloat() throws -> Float {
-        return Float(bitPattern: try readInt())
-    }
-
-    // Reads a float at the current offset.
-    @inlinable
-    func readDouble() throws -> Double {
-        return Double(bitPattern: try readInt())
-    }
-
-    // Indicates if the offset has reached the end of the buffer.
-    @inlinable
-    func hasRemaining() -> Bool {
-        return offset < data.count
-    }
-}
-
-// A helper class to write values into a byte buffer.
-fileprivate class Writer {
-    var bytes: [UInt8]
-    var offset: Array<UInt8>.Index
-
-    init() {
-        self.bytes = []
-        self.offset = 0
-    }
-
-    func writeBytes<S>(_ byteArr: S) where S: Sequence, S.Element == UInt8 {
-        bytes.append(contentsOf: byteArr)
-    }
-
-    // Writes an integer in big-endian order.
-    //
-    // Warning: make sure what you are trying to write
-    // is in the correct type!
-    func writeInt<T: FixedWidthInteger>(_ value: T) {
-        var value = value.bigEndian
-        withUnsafeBytes(of: &value) { bytes.append(contentsOf: $0) }
-    }
-
-    @inlinable
-    func writeFloat(_ value: Float) {
-        writeInt(value.bitPattern)
-    }
-
-    @inlinable
-    func writeDouble(_ value: Double) {
-        writeInt(value.bitPattern)
-    }
-}
-
-
-// Types conforming to `Serializable` can be read and written in a bytebuffer.
-fileprivate protocol Serializable {
-    func write(into: Writer)
-    static func read(from: Reader) throws -> Self
-}
-
-// Types confirming to `ViaFfi` can be transferred back-and-for over the FFI.
-// This is analogous to the Rust trait of the same name.
-fileprivate protocol ViaFfi: Serializable {
-    associatedtype FfiType
-    static func lift(_ v: FfiType) throws -> Self
-    func lower() -> FfiType
-}
-
-// Types conforming to `Primitive` pass themselves directly over the FFI.
-fileprivate protocol Primitive {}
-
-extension Primitive {
-    fileprivate typealias FfiType = Self
-
-    fileprivate static func lift(_ v: Self) throws -> Self {
-        return v
-    }
-
-    fileprivate func lower() -> Self {
-        return self
-    }
-}
-
-// Types conforming to `ViaFfiUsingByteBuffer` lift and lower into a bytebuffer.
-// Use this for complex types where it's hard to write a custom lift/lower.
-fileprivate protocol ViaFfiUsingByteBuffer: Serializable {}
-
-extension ViaFfiUsingByteBuffer {
-    fileprivate typealias FfiType = RustBuffer
-
-    fileprivate static func lift(_ buf: FfiType) throws -> Self {
-      let reader = Reader(data: Data(rustBuffer: buf))
-      let value = try Self.read(from: reader)
-      if reader.hasRemaining() {
-          throw UniffiInternalError.incompleteData
-      }
-      buf.deallocate()
-      return value
-    }
-
-    fileprivate func lower() -> FfiType {
-      let writer = Writer()
-      self.write(into: writer)
-      return RustBuffer(bytes: writer.bytes)
-    }
-}
-// An error type for FFI errors. These errors occur at the UniFFI level, not
-// the library level.
-fileprivate enum UniffiInternalError: LocalizedError {
-    case bufferOverflow
-    case incompleteData
-    case unexpectedOptionalTag
-    case unexpectedEnumCase
-    case unexpectedNullPointer
-    case unexpectedRustCallStatusCode
-    case unexpectedRustCallError
-    case unexpectedStaleHandle
-    case rustPanic(_ message: String)
-
-    public var errorDescription: String? {
-        switch self {
-        case .bufferOverflow: return "Reading the requested value would read past the end of the buffer"
-        case .incompleteData: return "The buffer still has data after lifting its containing value"
-        case .unexpectedOptionalTag: return "Unexpected optional tag; should be 0 or 1"
-        case .unexpectedEnumCase: return "Raw enum value doesn't match any cases"
-        case .unexpectedNullPointer: return "Raw pointer value was null"
-        case .unexpectedRustCallStatusCode: return "Unexpected RustCallStatus code"
-        case .unexpectedRustCallError: return "CALL_ERROR but no errorClass specified"
-        case .unexpectedStaleHandle: return "The object in the handle map has been dropped already"
-        case let .rustPanic(message): return message
-        }
-    }
-}
-
-fileprivate let CALL_SUCCESS: Int8 = 0
-fileprivate let CALL_ERROR: Int8 = 1
-fileprivate let CALL_PANIC: Int8 = 2
-
-fileprivate extension RustCallStatus {
-    init() {
-        self.init(
-            code: CALL_SUCCESS,
-            errorBuf: RustBuffer.init(
-                capacity: 0,
-                len: 0,
-                data: nil
-            )
-        )
-    }
-}
-
-private func rustCall<T>(_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
-    try makeRustCall(callback, errorHandler: {
-        $0.deallocate()
-        return UniffiInternalError.unexpectedRustCallError
-    })
-}
-
-private func rustCallWithError<T, E: ViaFfiUsingByteBuffer & Error>(_ errorClass: E.Type, _ callback: (UnsafeMutablePointer<RustCallStatus>) -> T) throws -> T {
-    try makeRustCall(callback, errorHandler: { return try E.lift($0) })
-}
-
-private func makeRustCall<T>(_ callback: (UnsafeMutablePointer<RustCallStatus>) -> T, errorHandler: (RustBuffer) throws -> Error) throws -> T {
-    var callStatus = RustCallStatus.init()
-    let returnedVal = callback(&callStatus)
-    switch callStatus.code {
-        case CALL_SUCCESS:
-            return returnedVal
-
-        case CALL_ERROR:
-            throw try errorHandler(callStatus.errorBuf)
-
-        case CALL_PANIC:
-            // When the rust code sees a panic, it tries to construct a RustBuffer
-            // with the message.  But if that code panics, then it just sends back
-            // an empty buffer.
-            if callStatus.errorBuf.len > 0 {
-                throw UniffiInternalError.rustPanic(try String.lift(callStatus.errorBuf))
-            } else {
-                callStatus.errorBuf.deallocate()
-                throw UniffiInternalError.rustPanic("Rust panic")
-            }
-
-        default:
-            throw UniffiInternalError.unexpectedRustCallStatusCode
-    }
-}
-// Protocols for converters we'll implement in templates
-
-fileprivate protocol FfiConverter {
-    associatedtype SwiftType
-    associatedtype FfiType
-
-    static func lift(_ ffiValue: FfiType) throws -> SwiftType
-    static func lower(_ value: SwiftType) -> FfiType
-
-    static func read(from: Reader) throws -> SwiftType
-    static func write(_ value: SwiftType, into: Writer)
-}
-
-fileprivate protocol FfiConverterUsingByteBuffer: FfiConverter where FfiType == RustBuffer {
-    // Empty, because we want to declare some helper methods in the extension below.
-}
-
-extension FfiConverterUsingByteBuffer {
-    static func lower(_ value: SwiftType) -> FfiType {
-        let writer = Writer()
-        Self.write(value, into: writer)
-        return RustBuffer(bytes: writer.bytes)
-    }
-
-    static func lift(_ buf: FfiType) throws -> SwiftType {
-        let reader = Reader(data: Data(rustBuffer: buf))
-        let value = try Self.read(from: reader)
-        if reader.hasRemaining() {
-          throw UniffiInternalError.incompleteData
-        }
-        buf.deallocate()
-        return value
-    }
-}
-
-// Helpers for structural types. Note that because of canonical_names, it /should/ be impossible
-// to make another `FfiConverterSequence` etc just using the UDL.
-fileprivate enum FfiConverterSequence {
-    static func write<T>(_ value: [T], into buf: Writer, writeItem: (T, Writer) -> Void) {
-        let len = Int32(value.count)
-        buf.writeInt(len)
-        for item in value {
-            writeItem(item, buf)
-        }
-    }
-
-    static func read<T>(from buf: Reader, readItem: (Reader) throws -> T) throws -> [T] {
-        let len: Int32 = try buf.readInt()
-        var seq = [T]()
-        seq.reserveCapacity(Int(len))
-        for _ in 0 ..< len {
-            seq.append(try readItem(buf))
-        }
-        return seq
-    }
-}
-
-fileprivate enum FfiConverterOptional {
-    static func write<T>(_ value: T?, into buf: Writer, writeItem: (T, Writer) -> Void) {
-        guard let value = value else {
-            buf.writeInt(Int8(0))
-            return
-        }
-        buf.writeInt(Int8(1))
-        writeItem(value, buf)
-    }
-
-    static func read<T>(from buf: Reader, readItem: (Reader) throws -> T) throws -> T? {
-        switch try buf.readInt() as Int8 {
-        case 0: return nil
-        case 1: return try readItem(buf)
-        default: throw UniffiInternalError.unexpectedOptionalTag
-        }
-    }
-}
-
-fileprivate enum FfiConverterDictionary {
-    static func write<T>(_ value: [String: T], into buf: Writer, writeItem: (String, T, Writer) -> Void) {
-        let len = Int32(value.count)
-        buf.writeInt(len)
-        for (key, value) in value {
-            writeItem(key, value, buf)
-        }
-    }
-
-    static func read<T>(from buf: Reader, readItem: (Reader) throws -> (String, T)) throws -> [String: T] {
-        let len: Int32 = try buf.readInt()
-        var dict = [String: T]()
-        dict.reserveCapacity(Int(len))
-        for _ in 0..<len {
-            let (key, value) = try readItem(buf)
-            dict[key] = value
-        }
-        return dict
-    }
-}
-
-// Public interface members begin here.
-
-
-fileprivate extension NSLock {
-    func withLock<T>(f: () throws -> T) rethrows -> T {
-        self.lock()
-        defer { self.unlock() }
-        return try f()
-    }
-}
-
-fileprivate typealias Handle = UInt64
-fileprivate class ConcurrentHandleMap<T> {
-    private var leftMap: [Handle: T] = [:]
-    private var counter: [Handle: UInt64] = [:]
-    private var rightMap: [ObjectIdentifier: Handle] = [:]
-
-    private let lock = NSLock()
-    private var currentHandle: Handle = 0
-    private let stride: Handle = 1
-
-    func insert(obj: T) -> Handle {
-        lock.withLock {
-            let id = ObjectIdentifier(obj as AnyObject)
-            let handle = rightMap[id] ?? {
-                currentHandle += stride
-                let handle = currentHandle
-                leftMap[handle] = obj
-                rightMap[id] = handle
-                return handle
-            }()
-            counter[handle] = (counter[handle] ?? 0) + 1
-            return handle
-        }
-    }
-
-    func get(handle: Handle) -> T? {
-        lock.withLock {
-            leftMap[handle]
-        }
-    }
-
-    func delete(handle: Handle) {
-        remove(handle: handle)
-    }
-
-    @discardableResult
-    func remove(handle: Handle) -> T? {
-        lock.withLock {
-            defer { counter[handle] = (counter[handle] ?? 1) - 1 }
-            guard counter[handle] == 1 else { return leftMap[handle] }
-            let obj = leftMap.removeValue(forKey: handle)
-            if let obj = obj {
-                rightMap.removeValue(forKey: ObjectIdentifier(obj as AnyObject))
-            }
-            return obj
-        }
-    }
-}
-
-// Magic number for the Rust proxy to call using the same mechanism as every other method,
-// to free the callback once it's dropped by Rust.
-private let IDX_CALLBACK_FREE: Int32 = 0
-
-fileprivate class FfiConverterCallbackInterface<CallbackInterface> {
-    fileprivate let handleMap = ConcurrentHandleMap<CallbackInterface>()
-
-    func drop(handle: Handle) {
-        handleMap.remove(handle: handle)
-    }
-
-    func lift(_ handle: Handle) throws -> CallbackInterface {
-        guard let callback = handleMap.get(handle: handle) else {
-            throw UniffiInternalError.unexpectedStaleHandle
-        }
-        return callback
-    }
-
-    func read(from buf: Reader) throws -> CallbackInterface {
-        let handle: Handle = try buf.readInt()
-        return try lift(handle)
-    }
-
-    func lower(_ v: CallbackInterface) -> Handle {
-        let handle = handleMap.insert(obj: v)
-        return handle
-        // assert(handleMap.get(handle: obj) == v, "Handle map is not returning the object we just placed there. This is a bug in the HandleMap.")
-    }
-
-    func write(_ v: CallbackInterface, into buf: Writer) {
-        buf.writeInt(lower(v))
-    }
-}
-
-// Note that we don't yet support `indirect` for enums.
-// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
-
-public enum Network {
-    
-    case bitcoin
-    case testnet
-    case signet
-    case regtest
-}
-
-extension Network: ViaFfiUsingByteBuffer, ViaFfi {
-    fileprivate static func read(from buf: Reader) throws -> Network {
-        let variant: Int32 = try buf.readInt()
-        switch variant {
-        
-        case 1: return .bitcoin
-        case 2: return .testnet
-        case 3: return .signet
-        case 4: return .regtest
-        default: throw UniffiInternalError.unexpectedEnumCase
-        }
-    }
-
-    fileprivate func write(into buf: Writer) {
-        switch self {
-        
-        
-        case .bitcoin:
-            buf.writeInt(Int32(1))
-        
-        
-        case .testnet:
-            buf.writeInt(Int32(2))
-        
-        
-        case .signet:
-            buf.writeInt(Int32(3))
-        
-        
-        case .regtest:
-            buf.writeInt(Int32(4))
-        
-        }
-    }
-}
-
-
-extension Network: Equatable, Hashable {}
-
-
-// Note that we don't yet support `indirect` for enums.
-// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
-
-public enum DatabaseConfig {
-    
-    case memory(junk: String )
-    case sled(config: SledDbConfiguration )
-}
-
-extension DatabaseConfig: ViaFfiUsingByteBuffer, ViaFfi {
-    fileprivate static func read(from buf: Reader) throws -> DatabaseConfig {
-        let variant: Int32 = try buf.readInt()
-        switch variant {
-        
-        case 1: return .memory(
-            junk: try String.read(from: buf)
-            )
-        case 2: return .sled(
-            config: try SledDbConfiguration.read(from: buf)
-            )
-        default: throw UniffiInternalError.unexpectedEnumCase
-        }
-    }
-
-    fileprivate func write(into buf: Writer) {
-        switch self {
-        
-        
-        case let .memory(junk):
-            buf.writeInt(Int32(1))
-            junk.write(into: buf)
-            
-        
-        
-        case let .sled(config):
-            buf.writeInt(Int32(2))
-            config.write(into: buf)
-            
-        
-        }
-    }
-}
-
-
-extension DatabaseConfig: Equatable, Hashable {}
-
-
-// Note that we don't yet support `indirect` for enums.
-// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
-
-public enum Transaction {
-    
-    case unconfirmed(details: TransactionDetails )
-    case confirmed(details: TransactionDetails, confirmation: Confirmation )
-}
-
-extension Transaction: ViaFfiUsingByteBuffer, ViaFfi {
-    fileprivate static func read(from buf: Reader) throws -> Transaction {
-        let variant: Int32 = try buf.readInt()
-        switch variant {
-        
-        case 1: return .unconfirmed(
-            details: try TransactionDetails.read(from: buf)
-            )
-        case 2: return .confirmed(
-            details: try TransactionDetails.read(from: buf),
-            confirmation: try Confirmation.read(from: buf)
-            )
-        default: throw UniffiInternalError.unexpectedEnumCase
-        }
-    }
-
-    fileprivate func write(into buf: Writer) {
-        switch self {
-        
-        
-        case let .unconfirmed(details):
-            buf.writeInt(Int32(1))
-            details.write(into: buf)
-            
-        
-        
-        case let .confirmed(details,confirmation):
-            buf.writeInt(Int32(2))
-            details.write(into: buf)
-            confirmation.write(into: buf)
-            
-        
-        }
-    }
-}
-
-
-extension Transaction: Equatable, Hashable {}
-
-
-// Note that we don't yet support `indirect` for enums.
-// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
-
-public enum BlockchainConfig {
-    
-    case electrum(config: ElectrumConfig )
-    case esplora(config: EsploraConfig )
-}
-
-extension BlockchainConfig: ViaFfiUsingByteBuffer, ViaFfi {
-    fileprivate static func read(from buf: Reader) throws -> BlockchainConfig {
-        let variant: Int32 = try buf.readInt()
-        switch variant {
-        
-        case 1: return .electrum(
-            config: try ElectrumConfig.read(from: buf)
-            )
-        case 2: return .esplora(
-            config: try EsploraConfig.read(from: buf)
-            )
-        default: throw UniffiInternalError.unexpectedEnumCase
-        }
-    }
-
-    fileprivate func write(into buf: Writer) {
-        switch self {
-        
-        
-        case let .electrum(config):
-            buf.writeInt(Int32(1))
-            config.write(into: buf)
-            
-        
-        
-        case let .esplora(config):
-            buf.writeInt(Int32(2))
-            config.write(into: buf)
-            
-        
-        }
-    }
-}
-
-
-extension BlockchainConfig: Equatable, Hashable {}
-
-
-// Note that we don't yet support `indirect` for enums.
-// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
-
-public enum MnemonicType {
-    
-    case words12
-    case words15
-    case words18
-    case words21
-    case words24
-}
-
-extension MnemonicType: ViaFfiUsingByteBuffer, ViaFfi {
-    fileprivate static func read(from buf: Reader) throws -> MnemonicType {
-        let variant: Int32 = try buf.readInt()
-        switch variant {
-        
-        case 1: return .words12
-        case 2: return .words15
-        case 3: return .words18
-        case 4: return .words21
-        case 5: return .words24
-        default: throw UniffiInternalError.unexpectedEnumCase
-        }
-    }
-
-    fileprivate func write(into buf: Writer) {
-        switch self {
-        
-        
-        case .words12:
-            buf.writeInt(Int32(1))
-        
-        
-        case .words15:
-            buf.writeInt(Int32(2))
-        
-        
-        case .words18:
-            buf.writeInt(Int32(3))
-        
-        
-        case .words21:
-            buf.writeInt(Int32(4))
-        
-        
-        case .words24:
-            buf.writeInt(Int32(5))
-        
-        }
-    }
-}
-
-
-extension MnemonicType: Equatable, Hashable {}
-
-
-
-public func generateExtendedKey(network: Network, mnemonicType: MnemonicType, password: String? ) throws -> ExtendedKeyInfo {
-    let _retval = try
-    
-    
-    rustCallWithError(BdkError.self) {
-    
-    bdk_62af_generate_extended_key(network.lower(), mnemonicType.lower(), FfiConverterOptionString.lower(password) , $0)
-}
-    return try ExtendedKeyInfo.lift(_retval)
-}
-
-
-
-public func restoreExtendedKey(network: Network, mnemonic: String, password: String? ) throws -> ExtendedKeyInfo {
-    let _retval = try
-    
-    
-    rustCallWithError(BdkError.self) {
-    
-    bdk_62af_restore_extended_key(network.lower(), mnemonic.lower(), FfiConverterOptionString.lower(password) , $0)
-}
-    return try ExtendedKeyInfo.lift(_retval)
-}
-
-
-
-public protocol OfflineWalletProtocol {
-    func getNewAddress()  -> String
-    func getBalance() throws -> UInt64
-    func sign(psbt: PartiallySignedBitcoinTransaction ) throws
-    func getTransactions() throws -> [Transaction]
-    
-}
-
-public class OfflineWallet: OfflineWalletProtocol {
-    fileprivate let pointer: UnsafeMutableRawPointer
-
-    // TODO: We'd like this to be `private` but for Swifty reasons,
-    // we can't implement `ViaFfi` without making this `required` and we can't
-    // make it `required` without making it `public`.
-    required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) {
-        self.pointer = pointer
-    }
-    public convenience init(descriptor: String, network: Network, databaseConfig: DatabaseConfig ) throws {
-        self.init(unsafeFromRawPointer: try
-    
-    
-    rustCallWithError(BdkError.self) {
-    
-    bdk_62af_OfflineWallet_new(descriptor.lower(), network.lower(), databaseConfig.lower() , $0)
-})
-    }
-
-    deinit {
-        try! rustCall { ffi_bdk_62af_OfflineWallet_object_free(pointer, $0) }
-    }
-
-    
-
-    
-    public func getNewAddress()  -> String {
-        let _retval = try!
-    rustCall() {
-    
-    bdk_62af_OfflineWallet_get_new_address(self.pointer,  $0
-    )
-}
-        return try! String.lift(_retval)
-    }
-    public func getBalance() throws -> UInt64 {
-        let _retval = try
-    rustCallWithError(BdkError.self) {
-    
-    bdk_62af_OfflineWallet_get_balance(self.pointer,  $0
-    )
-}
-        return try UInt64.lift(_retval)
-    }
-    public func sign(psbt: PartiallySignedBitcoinTransaction ) throws {
-        try
-    rustCallWithError(BdkError.self) {
-    
-    bdk_62af_OfflineWallet_sign(self.pointer, psbt.lower() , $0
-    )
-}
-    }
-    public func getTransactions() throws -> [Transaction] {
-        let _retval = try
-    rustCallWithError(BdkError.self) {
-    
-    bdk_62af_OfflineWallet_get_transactions(self.pointer,  $0
-    )
-}
-        return try FfiConverterSequenceEnumTransaction.lift(_retval)
-    }
-    
-}
-
-
-fileprivate extension OfflineWallet {
-    fileprivate typealias FfiType = UnsafeMutableRawPointer
-
-    fileprivate static func read(from buf: Reader) throws -> Self {
-        let v: UInt64 = try buf.readInt()
-        // The Rust code won't compile if a pointer won't fit in a UInt64.
-        // We have to go via `UInt` because that's the thing that's the size of a pointer.
-        let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v))
-        if (ptr == nil) {
-            throw UniffiInternalError.unexpectedNullPointer
-        }
-        return try self.lift(ptr!)
-    }
-
-    fileprivate func write(into buf: Writer) {
-        // This fiddling is because `Int` is the thing that's the same size as a pointer.
-        // The Rust code won't compile if a pointer won't fit in a `UInt64`.
-        buf.writeInt(UInt64(bitPattern: Int64(Int(bitPattern: self.lower()))))
-    }
-
-    fileprivate static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Self {
-        return Self(unsafeFromRawPointer: pointer)
-    }
-
-    fileprivate func lower() -> UnsafeMutableRawPointer {
-        return self.pointer
-    }
-}
-
-// Ideally this would be `fileprivate`, but Swift says:
-// """
-// 'private' modifier cannot be used with extensions that declare protocol conformances
-// """
-extension OfflineWallet : ViaFfi, Serializable {}
-
-
-public protocol OnlineWalletProtocol {
-    func getNewAddress()  -> String
-    func getBalance() throws -> UInt64
-    func sign(psbt: PartiallySignedBitcoinTransaction ) throws
-    func getTransactions() throws -> [Transaction]
-    func getNetwork()  -> Network
-    func sync(progressUpdate: BdkProgress, maxAddressParam: UInt32? ) throws
-    func broadcast(psbt: PartiallySignedBitcoinTransaction ) throws -> String
-    
-}
-
-public class OnlineWallet: OnlineWalletProtocol {
-    fileprivate let pointer: UnsafeMutableRawPointer
-
-    // TODO: We'd like this to be `private` but for Swifty reasons,
-    // we can't implement `ViaFfi` without making this `required` and we can't
-    // make it `required` without making it `public`.
-    required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) {
-        self.pointer = pointer
-    }
-    public convenience init(descriptor: String, changeDescriptor: String?, network: Network, databaseConfig: DatabaseConfig, blockchainConfig: BlockchainConfig ) throws {
-        self.init(unsafeFromRawPointer: try
-    
-    
-    rustCallWithError(BdkError.self) {
-    
-    bdk_62af_OnlineWallet_new(descriptor.lower(), FfiConverterOptionString.lower(changeDescriptor), network.lower(), databaseConfig.lower(), blockchainConfig.lower() , $0)
-})
-    }
-
-    deinit {
-        try! rustCall { ffi_bdk_62af_OnlineWallet_object_free(pointer, $0) }
-    }
-
-    
-
-    
-    public func getNewAddress()  -> String {
-        let _retval = try!
-    rustCall() {
-    
-    bdk_62af_OnlineWallet_get_new_address(self.pointer,  $0
-    )
-}
-        return try! String.lift(_retval)
-    }
-    public func getBalance() throws -> UInt64 {
-        let _retval = try
-    rustCallWithError(BdkError.self) {
-    
-    bdk_62af_OnlineWallet_get_balance(self.pointer,  $0
-    )
-}
-        return try UInt64.lift(_retval)
-    }
-    public func sign(psbt: PartiallySignedBitcoinTransaction ) throws {
-        try
-    rustCallWithError(BdkError.self) {
-    
-    bdk_62af_OnlineWallet_sign(self.pointer, psbt.lower() , $0
-    )
-}
-    }
-    public func getTransactions() throws -> [Transaction] {
-        let _retval = try
-    rustCallWithError(BdkError.self) {
-    
-    bdk_62af_OnlineWallet_get_transactions(self.pointer,  $0
-    )
-}
-        return try FfiConverterSequenceEnumTransaction.lift(_retval)
-    }
-    public func getNetwork()  -> Network {
-        let _retval = try!
-    rustCall() {
-    
-    bdk_62af_OnlineWallet_get_network(self.pointer,  $0
-    )
-}
-        return try! Network.lift(_retval)
-    }
-    public func sync(progressUpdate: BdkProgress, maxAddressParam: UInt32? ) throws {
-        try
-    rustCallWithError(BdkError.self) {
-    
-    bdk_62af_OnlineWallet_sync(self.pointer, ffiConverterCallbackInterfaceBdkProgress.lower(progressUpdate), FfiConverterOptionUInt32.lower(maxAddressParam) , $0
-    )
-}
-    }
-    public func broadcast(psbt: PartiallySignedBitcoinTransaction ) throws -> String {
-        let _retval = try
-    rustCallWithError(BdkError.self) {
-    
-    bdk_62af_OnlineWallet_broadcast(self.pointer, psbt.lower() , $0
-    )
-}
-        return try String.lift(_retval)
-    }
-    
-}
-
-
-fileprivate extension OnlineWallet {
-    fileprivate typealias FfiType = UnsafeMutableRawPointer
-
-    fileprivate static func read(from buf: Reader) throws -> Self {
-        let v: UInt64 = try buf.readInt()
-        // The Rust code won't compile if a pointer won't fit in a UInt64.
-        // We have to go via `UInt` because that's the thing that's the size of a pointer.
-        let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v))
-        if (ptr == nil) {
-            throw UniffiInternalError.unexpectedNullPointer
-        }
-        return try self.lift(ptr!)
-    }
-
-    fileprivate func write(into buf: Writer) {
-        // This fiddling is because `Int` is the thing that's the same size as a pointer.
-        // The Rust code won't compile if a pointer won't fit in a `UInt64`.
-        buf.writeInt(UInt64(bitPattern: Int64(Int(bitPattern: self.lower()))))
-    }
-
-    fileprivate static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Self {
-        return Self(unsafeFromRawPointer: pointer)
-    }
-
-    fileprivate func lower() -> UnsafeMutableRawPointer {
-        return self.pointer
-    }
-}
-
-// Ideally this would be `fileprivate`, but Swift says:
-// """
-// 'private' modifier cannot be used with extensions that declare protocol conformances
-// """
-extension OnlineWallet : ViaFfi, Serializable {}
-
-
-public protocol PartiallySignedBitcoinTransactionProtocol {
-    
-}
-
-public class PartiallySignedBitcoinTransaction: PartiallySignedBitcoinTransactionProtocol {
-    fileprivate let pointer: UnsafeMutableRawPointer
-
-    // TODO: We'd like this to be `private` but for Swifty reasons,
-    // we can't implement `ViaFfi` without making this `required` and we can't
-    // make it `required` without making it `public`.
-    required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) {
-        self.pointer = pointer
-    }
-    public convenience init(wallet: OnlineWallet, recipient: String, amount: UInt64 ) throws {
-        self.init(unsafeFromRawPointer: try
-    
-    
-    rustCallWithError(BdkError.self) {
-    
-    bdk_62af_PartiallySignedBitcoinTransaction_new(wallet.lower(), recipient.lower(), amount.lower() , $0)
-})
-    }
-
-    deinit {
-        try! rustCall { ffi_bdk_62af_PartiallySignedBitcoinTransaction_object_free(pointer, $0) }
-    }
-
-    
-
-    
-    
-}
-
-
-fileprivate extension PartiallySignedBitcoinTransaction {
-    fileprivate typealias FfiType = UnsafeMutableRawPointer
-
-    fileprivate static func read(from buf: Reader) throws -> Self {
-        let v: UInt64 = try buf.readInt()
-        // The Rust code won't compile if a pointer won't fit in a UInt64.
-        // We have to go via `UInt` because that's the thing that's the size of a pointer.
-        let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v))
-        if (ptr == nil) {
-            throw UniffiInternalError.unexpectedNullPointer
-        }
-        return try self.lift(ptr!)
-    }
-
-    fileprivate func write(into buf: Writer) {
-        // This fiddling is because `Int` is the thing that's the same size as a pointer.
-        // The Rust code won't compile if a pointer won't fit in a `UInt64`.
-        buf.writeInt(UInt64(bitPattern: Int64(Int(bitPattern: self.lower()))))
-    }
-
-    fileprivate static func lift(_ pointer: UnsafeMutableRawPointer) throws -> Self {
-        return Self(unsafeFromRawPointer: pointer)
-    }
-
-    fileprivate func lower() -> UnsafeMutableRawPointer {
-        return self.pointer
-    }
-}
-
-// Ideally this would be `fileprivate`, but Swift says:
-// """
-// 'private' modifier cannot be used with extensions that declare protocol conformances
-// """
-extension PartiallySignedBitcoinTransaction : ViaFfi, Serializable {}
-
-public struct SledDbConfiguration {
-    public var path: String
-    public var treeName: String
-
-    // Default memberwise initializers are never public by default, so we
-    // declare one manually.
-    public init(path: String, treeName: String ) {
-        self.path = path
-        self.treeName = treeName
-    }
-}
-
-
-extension SledDbConfiguration: Equatable, Hashable {
-    public static func ==(lhs: SledDbConfiguration, rhs: SledDbConfiguration) -> Bool {
-        if lhs.path != rhs.path {
-            return false
-        }
-        if lhs.treeName != rhs.treeName {
-            return false
-        }
-        return true
-    }
-
-    public func hash(into hasher: inout Hasher) {
-        hasher.combine(path)
-        hasher.combine(treeName)
-    }
-}
-
-
-fileprivate extension SledDbConfiguration {
-    static func read(from buf: Reader) throws -> SledDbConfiguration {
-        return try SledDbConfiguration(
-            path: String.read(from: buf),
-            treeName: String.read(from: buf)
-        )
-    }
-
-    func write(into buf: Writer) {
-        self.path.write(into: buf)
-        self.treeName.write(into: buf)
-    }
-}
-
-extension SledDbConfiguration: ViaFfiUsingByteBuffer, ViaFfi {}
-
-public struct TransactionDetails {
-    public var fees: UInt64?
-    public var received: UInt64
-    public var sent: UInt64
-    public var id: String
-
-    // Default memberwise initializers are never public by default, so we
-    // declare one manually.
-    public init(fees: UInt64?, received: UInt64, sent: UInt64, id: String ) {
-        self.fees = fees
-        self.received = received
-        self.sent = sent
-        self.id = id
-    }
-}
-
-
-extension TransactionDetails: Equatable, Hashable {
-    public static func ==(lhs: TransactionDetails, rhs: TransactionDetails) -> Bool {
-        if lhs.fees != rhs.fees {
-            return false
-        }
-        if lhs.received != rhs.received {
-            return false
-        }
-        if lhs.sent != rhs.sent {
-            return false
-        }
-        if lhs.id != rhs.id {
-            return false
-        }
-        return true
-    }
-
-    public func hash(into hasher: inout Hasher) {
-        hasher.combine(fees)
-        hasher.combine(received)
-        hasher.combine(sent)
-        hasher.combine(id)
-    }
-}
-
-
-fileprivate extension TransactionDetails {
-    static func read(from buf: Reader) throws -> TransactionDetails {
-        return try TransactionDetails(
-            fees: FfiConverterOptionUInt64.read(from: buf),
-            received: UInt64.read(from: buf),
-            sent: UInt64.read(from: buf),
-            id: String.read(from: buf)
-        )
-    }
-
-    func write(into buf: Writer) {
-        FfiConverterOptionUInt64.write(self.fees, into: buf)
-        self.received.write(into: buf)
-        self.sent.write(into: buf)
-        self.id.write(into: buf)
-    }
-}
-
-extension TransactionDetails: ViaFfiUsingByteBuffer, ViaFfi {}
-
-public struct Confirmation {
-    public var height: UInt32
-    public var timestamp: UInt64
-
-    // Default memberwise initializers are never public by default, so we
-    // declare one manually.
-    public init(height: UInt32, timestamp: UInt64 ) {
-        self.height = height
-        self.timestamp = timestamp
-    }
-}
-
-
-extension Confirmation: Equatable, Hashable {
-    public static func ==(lhs: Confirmation, rhs: Confirmation) -> Bool {
-        if lhs.height != rhs.height {
-            return false
-        }
-        if lhs.timestamp != rhs.timestamp {
-            return false
-        }
-        return true
-    }
-
-    public func hash(into hasher: inout Hasher) {
-        hasher.combine(height)
-        hasher.combine(timestamp)
-    }
-}
-
-
-fileprivate extension Confirmation {
-    static func read(from buf: Reader) throws -> Confirmation {
-        return try Confirmation(
-            height: UInt32.read(from: buf),
-            timestamp: UInt64.read(from: buf)
-        )
-    }
-
-    func write(into buf: Writer) {
-        self.height.write(into: buf)
-        self.timestamp.write(into: buf)
-    }
-}
-
-extension Confirmation: ViaFfiUsingByteBuffer, ViaFfi {}
-
-public struct ElectrumConfig {
-    public var url: String
-    public var socks5: String?
-    public var retry: UInt8
-    public var timeout: UInt8?
-    public var stopGap: UInt64
-
-    // Default memberwise initializers are never public by default, so we
-    // declare one manually.
-    public init(url: String, socks5: String?, retry: UInt8, timeout: UInt8?, stopGap: UInt64 ) {
-        self.url = url
-        self.socks5 = socks5
-        self.retry = retry
-        self.timeout = timeout
-        self.stopGap = stopGap
-    }
-}
-
-
-extension ElectrumConfig: Equatable, Hashable {
-    public static func ==(lhs: ElectrumConfig, rhs: ElectrumConfig) -> Bool {
-        if lhs.url != rhs.url {
-            return false
-        }
-        if lhs.socks5 != rhs.socks5 {
-            return false
-        }
-        if lhs.retry != rhs.retry {
-            return false
-        }
-        if lhs.timeout != rhs.timeout {
-            return false
-        }
-        if lhs.stopGap != rhs.stopGap {
-            return false
-        }
-        return true
-    }
-
-    public func hash(into hasher: inout Hasher) {
-        hasher.combine(url)
-        hasher.combine(socks5)
-        hasher.combine(retry)
-        hasher.combine(timeout)
-        hasher.combine(stopGap)
-    }
-}
-
-
-fileprivate extension ElectrumConfig {
-    static func read(from buf: Reader) throws -> ElectrumConfig {
-        return try ElectrumConfig(
-            url: String.read(from: buf),
-            socks5: FfiConverterOptionString.read(from: buf),
-            retry: UInt8.read(from: buf),
-            timeout: FfiConverterOptionUInt8.read(from: buf),
-            stopGap: UInt64.read(from: buf)
-        )
-    }
-
-    func write(into buf: Writer) {
-        self.url.write(into: buf)
-        FfiConverterOptionString.write(self.socks5, into: buf)
-        self.retry.write(into: buf)
-        FfiConverterOptionUInt8.write(self.timeout, into: buf)
-        self.stopGap.write(into: buf)
-    }
-}
-
-extension ElectrumConfig: ViaFfiUsingByteBuffer, ViaFfi {}
-
-public struct EsploraConfig {
-    public var baseUrl: String
-    public var proxy: String?
-    public var timeoutRead: UInt64
-    public var timeoutWrite: UInt64
-    public var stopGap: UInt64
-
-    // Default memberwise initializers are never public by default, so we
-    // declare one manually.
-    public init(baseUrl: String, proxy: String?, timeoutRead: UInt64, timeoutWrite: UInt64, stopGap: UInt64 ) {
-        self.baseUrl = baseUrl
-        self.proxy = proxy
-        self.timeoutRead = timeoutRead
-        self.timeoutWrite = timeoutWrite
-        self.stopGap = stopGap
-    }
-}
-
-
-extension EsploraConfig: Equatable, Hashable {
-    public static func ==(lhs: EsploraConfig, rhs: EsploraConfig) -> Bool {
-        if lhs.baseUrl != rhs.baseUrl {
-            return false
-        }
-        if lhs.proxy != rhs.proxy {
-            return false
-        }
-        if lhs.timeoutRead != rhs.timeoutRead {
-            return false
-        }
-        if lhs.timeoutWrite != rhs.timeoutWrite {
-            return false
-        }
-        if lhs.stopGap != rhs.stopGap {
-            return false
-        }
-        return true
-    }
-
-    public func hash(into hasher: inout Hasher) {
-        hasher.combine(baseUrl)
-        hasher.combine(proxy)
-        hasher.combine(timeoutRead)
-        hasher.combine(timeoutWrite)
-        hasher.combine(stopGap)
-    }
-}
-
-
-fileprivate extension EsploraConfig {
-    static func read(from buf: Reader) throws -> EsploraConfig {
-        return try EsploraConfig(
-            baseUrl: String.read(from: buf),
-            proxy: FfiConverterOptionString.read(from: buf),
-            timeoutRead: UInt64.read(from: buf),
-            timeoutWrite: UInt64.read(from: buf),
-            stopGap: UInt64.read(from: buf)
-        )
-    }
-
-    func write(into buf: Writer) {
-        self.baseUrl.write(into: buf)
-        FfiConverterOptionString.write(self.proxy, into: buf)
-        self.timeoutRead.write(into: buf)
-        self.timeoutWrite.write(into: buf)
-        self.stopGap.write(into: buf)
-    }
-}
-
-extension EsploraConfig: ViaFfiUsingByteBuffer, ViaFfi {}
-
-public struct ExtendedKeyInfo {
-    public var mnemonic: String
-    public var xprv: String
-    public var fingerprint: String
-
-    // Default memberwise initializers are never public by default, so we
-    // declare one manually.
-    public init(mnemonic: String, xprv: String, fingerprint: String ) {
-        self.mnemonic = mnemonic
-        self.xprv = xprv
-        self.fingerprint = fingerprint
-    }
-}
-
-
-extension ExtendedKeyInfo: Equatable, Hashable {
-    public static func ==(lhs: ExtendedKeyInfo, rhs: ExtendedKeyInfo) -> Bool {
-        if lhs.mnemonic != rhs.mnemonic {
-            return false
-        }
-        if lhs.xprv != rhs.xprv {
-            return false
-        }
-        if lhs.fingerprint != rhs.fingerprint {
-            return false
-        }
-        return true
-    }
-
-    public func hash(into hasher: inout Hasher) {
-        hasher.combine(mnemonic)
-        hasher.combine(xprv)
-        hasher.combine(fingerprint)
-    }
-}
-
-
-fileprivate extension ExtendedKeyInfo {
-    static func read(from buf: Reader) throws -> ExtendedKeyInfo {
-        return try ExtendedKeyInfo(
-            mnemonic: String.read(from: buf),
-            xprv: String.read(from: buf),
-            fingerprint: String.read(from: buf)
-        )
-    }
-
-    func write(into buf: Writer) {
-        self.mnemonic.write(into: buf)
-        self.xprv.write(into: buf)
-        self.fingerprint.write(into: buf)
-    }
-}
-
-extension ExtendedKeyInfo: ViaFfiUsingByteBuffer, ViaFfi {}
-
-public enum BdkError {
-
-    
-    
-    // Simple error enums only carry a message
-    case InvalidU32Bytes(message: String)
-    
-    // Simple error enums only carry a message
-    case Generic(message: String)
-    
-    // Simple error enums only carry a message
-    case ScriptDoesntHaveAddressForm(message: String)
-    
-    // Simple error enums only carry a message
-    case NoRecipients(message: String)
-    
-    // Simple error enums only carry a message
-    case NoUtxosSelected(message: String)
-    
-    // Simple error enums only carry a message
-    case OutputBelowDustLimit(message: String)
-    
-    // Simple error enums only carry a message
-    case InsufficientFunds(message: String)
-    
-    // Simple error enums only carry a message
-    case BnBTotalTriesExceeded(message: String)
-    
-    // Simple error enums only carry a message
-    case BnBNoExactMatch(message: String)
-    
-    // Simple error enums only carry a message
-    case UnknownUtxo(message: String)
-    
-    // Simple error enums only carry a message
-    case TransactionNotFound(message: String)
-    
-    // Simple error enums only carry a message
-    case TransactionConfirmed(message: String)
-    
-    // Simple error enums only carry a message
-    case IrreplaceableTransaction(message: String)
-    
-    // Simple error enums only carry a message
-    case FeeRateTooLow(message: String)
-    
-    // Simple error enums only carry a message
-    case FeeTooLow(message: String)
-    
-    // Simple error enums only carry a message
-    case FeeRateUnavailable(message: String)
-    
-    // Simple error enums only carry a message
-    case MissingKeyOrigin(message: String)
-    
-    // Simple error enums only carry a message
-    case Key(message: String)
-    
-    // Simple error enums only carry a message
-    case ChecksumMismatch(message: String)
-    
-    // Simple error enums only carry a message
-    case SpendingPolicyRequired(message: String)
-    
-    // Simple error enums only carry a message
-    case InvalidPolicyPathError(message: String)
-    
-    // Simple error enums only carry a message
-    case Signer(message: String)
-    
-    // Simple error enums only carry a message
-    case InvalidNetwork(message: String)
-    
-    // Simple error enums only carry a message
-    case InvalidProgressValue(message: String)
-    
-    // Simple error enums only carry a message
-    case ProgressUpdateError(message: String)
-    
-    // Simple error enums only carry a message
-    case InvalidOutpoint(message: String)
-    
-    // Simple error enums only carry a message
-    case Descriptor(message: String)
-    
-    // Simple error enums only carry a message
-    case AddressValidator(message: String)
-    
-    // Simple error enums only carry a message
-    case Encode(message: String)
-    
-    // Simple error enums only carry a message
-    case Miniscript(message: String)
-    
-    // Simple error enums only carry a message
-    case Bip32(message: String)
-    
-    // Simple error enums only carry a message
-    case Secp256k1(message: String)
-    
-    // Simple error enums only carry a message
-    case Json(message: String)
-    
-    // Simple error enums only carry a message
-    case Hex(message: String)
-    
-    // Simple error enums only carry a message
-    case Psbt(message: String)
-    
-    // Simple error enums only carry a message
-    case PsbtParse(message: String)
-    
-    // Simple error enums only carry a message
-    case Electrum(message: String)
-    
-    // Simple error enums only carry a message
-    case Esplora(message: String)
-    
-    // Simple error enums only carry a message
-    case Sled(message: String)
-    
-}
-
-extension BdkError: ViaFfiUsingByteBuffer, ViaFfi {
-    fileprivate static func read(from buf: Reader) throws -> BdkError {
-        let variant: Int32 = try buf.readInt()
-        switch variant {
-
-        
-
-        
-        case 1: return .InvalidU32Bytes(
-            message: try String.read(from: buf)
-        )
-        
-        case 2: return .Generic(
-            message: try String.read(from: buf)
-        )
-        
-        case 3: return .ScriptDoesntHaveAddressForm(
-            message: try String.read(from: buf)
-        )
-        
-        case 4: return .NoRecipients(
-            message: try String.read(from: buf)
-        )
-        
-        case 5: return .NoUtxosSelected(
-            message: try String.read(from: buf)
-        )
-        
-        case 6: return .OutputBelowDustLimit(
-            message: try String.read(from: buf)
-        )
-        
-        case 7: return .InsufficientFunds(
-            message: try String.read(from: buf)
-        )
-        
-        case 8: return .BnBTotalTriesExceeded(
-            message: try String.read(from: buf)
-        )
-        
-        case 9: return .BnBNoExactMatch(
-            message: try String.read(from: buf)
-        )
-        
-        case 10: return .UnknownUtxo(
-            message: try String.read(from: buf)
-        )
-        
-        case 11: return .TransactionNotFound(
-            message: try String.read(from: buf)
-        )
-        
-        case 12: return .TransactionConfirmed(
-            message: try String.read(from: buf)
-        )
-        
-        case 13: return .IrreplaceableTransaction(
-            message: try String.read(from: buf)
-        )
-        
-        case 14: return .FeeRateTooLow(
-            message: try String.read(from: buf)
-        )
-        
-        case 15: return .FeeTooLow(
-            message: try String.read(from: buf)
-        )
-        
-        case 16: return .FeeRateUnavailable(
-            message: try String.read(from: buf)
-        )
-        
-        case 17: return .MissingKeyOrigin(
-            message: try String.read(from: buf)
-        )
-        
-        case 18: return .Key(
-            message: try String.read(from: buf)
-        )
-        
-        case 19: return .ChecksumMismatch(
-            message: try String.read(from: buf)
-        )
-        
-        case 20: return .SpendingPolicyRequired(
-            message: try String.read(from: buf)
-        )
-        
-        case 21: return .InvalidPolicyPathError(
-            message: try String.read(from: buf)
-        )
-        
-        case 22: return .Signer(
-            message: try String.read(from: buf)
-        )
-        
-        case 23: return .InvalidNetwork(
-            message: try String.read(from: buf)
-        )
-        
-        case 24: return .InvalidProgressValue(
-            message: try String.read(from: buf)
-        )
-        
-        case 25: return .ProgressUpdateError(
-            message: try String.read(from: buf)
-        )
-        
-        case 26: return .InvalidOutpoint(
-            message: try String.read(from: buf)
-        )
-        
-        case 27: return .Descriptor(
-            message: try String.read(from: buf)
-        )
-        
-        case 28: return .AddressValidator(
-            message: try String.read(from: buf)
-        )
-        
-        case 29: return .Encode(
-            message: try String.read(from: buf)
-        )
-        
-        case 30: return .Miniscript(
-            message: try String.read(from: buf)
-        )
-        
-        case 31: return .Bip32(
-            message: try String.read(from: buf)
-        )
-        
-        case 32: return .Secp256k1(
-            message: try String.read(from: buf)
-        )
-        
-        case 33: return .Json(
-            message: try String.read(from: buf)
-        )
-        
-        case 34: return .Hex(
-            message: try String.read(from: buf)
-        )
-        
-        case 35: return .Psbt(
-            message: try String.read(from: buf)
-        )
-        
-        case 36: return .PsbtParse(
-            message: try String.read(from: buf)
-        )
-        
-        case 37: return .Electrum(
-            message: try String.read(from: buf)
-        )
-        
-        case 38: return .Esplora(
-            message: try String.read(from: buf)
-        )
-        
-        case 39: return .Sled(
-            message: try String.read(from: buf)
-        )
-        
-
-         default: throw UniffiInternalError.unexpectedEnumCase
-        }
-    }
-
-    fileprivate func write(into buf: Writer) {
-        switch self {
-
-        
-
-        
-        case let .InvalidU32Bytes(message):
-            buf.writeInt(Int32(1))
-            message.write(into: buf)
-        case let .Generic(message):
-            buf.writeInt(Int32(2))
-            message.write(into: buf)
-        case let .ScriptDoesntHaveAddressForm(message):
-            buf.writeInt(Int32(3))
-            message.write(into: buf)
-        case let .NoRecipients(message):
-            buf.writeInt(Int32(4))
-            message.write(into: buf)
-        case let .NoUtxosSelected(message):
-            buf.writeInt(Int32(5))
-            message.write(into: buf)
-        case let .OutputBelowDustLimit(message):
-            buf.writeInt(Int32(6))
-            message.write(into: buf)
-        case let .InsufficientFunds(message):
-            buf.writeInt(Int32(7))
-            message.write(into: buf)
-        case let .BnBTotalTriesExceeded(message):
-            buf.writeInt(Int32(8))
-            message.write(into: buf)
-        case let .BnBNoExactMatch(message):
-            buf.writeInt(Int32(9))
-            message.write(into: buf)
-        case let .UnknownUtxo(message):
-            buf.writeInt(Int32(10))
-            message.write(into: buf)
-        case let .TransactionNotFound(message):
-            buf.writeInt(Int32(11))
-            message.write(into: buf)
-        case let .TransactionConfirmed(message):
-            buf.writeInt(Int32(12))
-            message.write(into: buf)
-        case let .IrreplaceableTransaction(message):
-            buf.writeInt(Int32(13))
-            message.write(into: buf)
-        case let .FeeRateTooLow(message):
-            buf.writeInt(Int32(14))
-            message.write(into: buf)
-        case let .FeeTooLow(message):
-            buf.writeInt(Int32(15))
-            message.write(into: buf)
-        case let .FeeRateUnavailable(message):
-            buf.writeInt(Int32(16))
-            message.write(into: buf)
-        case let .MissingKeyOrigin(message):
-            buf.writeInt(Int32(17))
-            message.write(into: buf)
-        case let .Key(message):
-            buf.writeInt(Int32(18))
-            message.write(into: buf)
-        case let .ChecksumMismatch(message):
-            buf.writeInt(Int32(19))
-            message.write(into: buf)
-        case let .SpendingPolicyRequired(message):
-            buf.writeInt(Int32(20))
-            message.write(into: buf)
-        case let .InvalidPolicyPathError(message):
-            buf.writeInt(Int32(21))
-            message.write(into: buf)
-        case let .Signer(message):
-            buf.writeInt(Int32(22))
-            message.write(into: buf)
-        case let .InvalidNetwork(message):
-            buf.writeInt(Int32(23))
-            message.write(into: buf)
-        case let .InvalidProgressValue(message):
-            buf.writeInt(Int32(24))
-            message.write(into: buf)
-        case let .ProgressUpdateError(message):
-            buf.writeInt(Int32(25))
-            message.write(into: buf)
-        case let .InvalidOutpoint(message):
-            buf.writeInt(Int32(26))
-            message.write(into: buf)
-        case let .Descriptor(message):
-            buf.writeInt(Int32(27))
-            message.write(into: buf)
-        case let .AddressValidator(message):
-            buf.writeInt(Int32(28))
-            message.write(into: buf)
-        case let .Encode(message):
-            buf.writeInt(Int32(29))
-            message.write(into: buf)
-        case let .Miniscript(message):
-            buf.writeInt(Int32(30))
-            message.write(into: buf)
-        case let .Bip32(message):
-            buf.writeInt(Int32(31))
-            message.write(into: buf)
-        case let .Secp256k1(message):
-            buf.writeInt(Int32(32))
-            message.write(into: buf)
-        case let .Json(message):
-            buf.writeInt(Int32(33))
-            message.write(into: buf)
-        case let .Hex(message):
-            buf.writeInt(Int32(34))
-            message.write(into: buf)
-        case let .Psbt(message):
-            buf.writeInt(Int32(35))
-            message.write(into: buf)
-        case let .PsbtParse(message):
-            buf.writeInt(Int32(36))
-            message.write(into: buf)
-        case let .Electrum(message):
-            buf.writeInt(Int32(37))
-            message.write(into: buf)
-        case let .Esplora(message):
-            buf.writeInt(Int32(38))
-            message.write(into: buf)
-        case let .Sled(message):
-            buf.writeInt(Int32(39))
-            message.write(into: buf)
-        }
-    }
-}
-
-
-extension BdkError: Equatable, Hashable {}
-
-extension BdkError: Error { }
-
-
-// Declaration and FfiConverters for BdkProgress Callback Interface
-
-public protocol BdkProgress : AnyObject {
-    func update(progress: Float, message: String? ) 
-    
-}
-
-// The ForeignCallback that is passed to Rust.
-fileprivate let foreignCallbackCallbackInterfaceBdkProgress : ForeignCallback =
-    { (handle: Handle, method: Int32, args: RustBuffer) -> RustBuffer in
-        func invokeUpdate(_ swiftCallbackInterface: BdkProgress, _ args: RustBuffer) throws -> RustBuffer {
-        defer { args.deallocate() }
-
-            let reader = Reader(data: Data(rustBuffer: args))
-              swiftCallbackInterface.update(
-                    progress: try Float.read(from: reader), 
-                    message: try FfiConverterOptionString.read(from: reader) 
-                    )
-            return RustBuffer()
-                // TODO catch errors and report them back to Rust.
-                // https://github.com/mozilla/uniffi-rs/issues/351
-
-    }
-    
-
-        let cb = try! ffiConverterCallbackInterfaceBdkProgress.lift(handle)
-        switch method {
-            case IDX_CALLBACK_FREE:
-                ffiConverterCallbackInterfaceBdkProgress.drop(handle: handle)
-                return RustBuffer()
-            case 1: return try! invokeUpdate(cb, args)
-            
-            // This should never happen, because an out of bounds method index won't
-            // ever be used. Once we can catch errors, we should return an InternalError.
-            // https://github.com/mozilla/uniffi-rs/issues/351
-            default: return RustBuffer()
-        }
-    }
-
-// The ffiConverter which transforms the Callbacks in to Handles to pass to Rust.
-private let ffiConverterCallbackInterfaceBdkProgress: FfiConverterCallbackInterface<BdkProgress> = {
-    try! rustCall { (err: UnsafeMutablePointer<RustCallStatus>) in
-            ffi_bdk_62af_BdkProgress_init_callback(foreignCallbackCallbackInterfaceBdkProgress, err)
-    }
-    return FfiConverterCallbackInterface<BdkProgress>()
-}()
-extension UInt8: Primitive, ViaFfi {
-    fileprivate static func read(from buf: Reader) throws -> Self {
-        return try self.lift(buf.readInt())
-    }
-
-    fileprivate func write(into buf: Writer) {
-        buf.writeInt(self.lower())
-    }
-}
-extension UInt32: Primitive, ViaFfi {
-    fileprivate static func read(from buf: Reader) throws -> Self {
-        return try self.lift(buf.readInt())
-    }
-
-    fileprivate func write(into buf: Writer) {
-        buf.writeInt(self.lower())
-    }
-}
-extension UInt64: Primitive, ViaFfi {
-    fileprivate static func read(from buf: Reader) throws -> Self {
-        return try self.lift(buf.readInt())
-    }
-
-    fileprivate func write(into buf: Writer) {
-        buf.writeInt(self.lower())
-    }
-}
-extension Float: Primitive, ViaFfi {
-    fileprivate static func read(from buf: Reader) throws -> Self {
-        return try self.lift(buf.readFloat())
-    }
-
-    fileprivate func write(into buf: Writer) {
-        buf.writeFloat(self.lower())
-    }
-}
-extension String: ViaFfi {
-    fileprivate typealias FfiType = RustBuffer
-
-    fileprivate static func lift(_ v: FfiType) throws -> Self {
-        defer {
-            v.deallocate()
-        }
-        if v.data == nil {
-            return String()
-        }
-        let bytes = UnsafeBufferPointer<UInt8>(start: v.data!, count: Int(v.len))
-        return String(bytes: bytes, encoding: String.Encoding.utf8)!
-    }
-
-    fileprivate func lower() -> FfiType {
-        return self.utf8CString.withUnsafeBufferPointer { ptr in
-            // The swift string gives us int8_t, we want uint8_t.
-            ptr.withMemoryRebound(to: UInt8.self) { ptr in
-                // The swift string gives us a trailing null byte, we don't want it.
-                let buf = UnsafeBufferPointer(rebasing: ptr.prefix(upTo: ptr.count - 1))
-                return RustBuffer.from(buf)
-            }
-        }
-    }
-
-    fileprivate static func read(from buf: Reader) throws -> Self {
-        let len: Int32 = try buf.readInt()
-        return String(bytes: try buf.readBytes(count: Int(len)), encoding: String.Encoding.utf8)!
-    }
-
-    fileprivate func write(into buf: Writer) {
-        let len = Int32(self.utf8.count)
-        buf.writeInt(len)
-        buf.writeBytes(self.utf8)
-    }
-}
-// Helper code for OfflineWallet class is found in ObjectTemplate.swift
-// Helper code for OnlineWallet class is found in ObjectTemplate.swift
-// Helper code for PartiallySignedBitcoinTransaction class is found in ObjectTemplate.swift
-// Helper code for Confirmation record is found in RecordTemplate.swift
-// Helper code for ElectrumConfig record is found in RecordTemplate.swift
-// Helper code for EsploraConfig record is found in RecordTemplate.swift
-// Helper code for ExtendedKeyInfo record is found in RecordTemplate.swift
-// Helper code for SledDbConfiguration record is found in RecordTemplate.swift
-// Helper code for TransactionDetails record is found in RecordTemplate.swift
-// Helper code for BlockchainConfig enum is found in EnumTemplate.swift
-// Helper code for DatabaseConfig enum is found in EnumTemplate.swift
-// Helper code for MnemonicType enum is found in EnumTemplate.swift
-// Helper code for Network enum is found in EnumTemplate.swift
-// Helper code for Transaction enum is found in EnumTemplate.swift
-// Helper code for BdkError error is found in ErrorTemplate.swift
-
-fileprivate enum FfiConverterOptionUInt8: FfiConverterUsingByteBuffer {
-    typealias SwiftType = UInt8?
-
-    static func write(_ value: SwiftType, into buf: Writer) {
-        FfiConverterOptional.write(value, into: buf) { item, buf in
-            item.write(into: buf)
-        }
-    }
-
-    static func read(from buf: Reader) throws -> SwiftType {
-        try FfiConverterOptional.read(from: buf) { buf in
-            try UInt8.read(from: buf)
-        }
-    }
-}
-
-fileprivate enum FfiConverterOptionUInt32: FfiConverterUsingByteBuffer {
-    typealias SwiftType = UInt32?
-
-    static func write(_ value: SwiftType, into buf: Writer) {
-        FfiConverterOptional.write(value, into: buf) { item, buf in
-            item.write(into: buf)
-        }
-    }
-
-    static func read(from buf: Reader) throws -> SwiftType {
-        try FfiConverterOptional.read(from: buf) { buf in
-            try UInt32.read(from: buf)
-        }
-    }
-}
-
-fileprivate enum FfiConverterOptionUInt64: FfiConverterUsingByteBuffer {
-    typealias SwiftType = UInt64?
-
-    static func write(_ value: SwiftType, into buf: Writer) {
-        FfiConverterOptional.write(value, into: buf) { item, buf in
-            item.write(into: buf)
-        }
-    }
-
-    static func read(from buf: Reader) throws -> SwiftType {
-        try FfiConverterOptional.read(from: buf) { buf in
-            try UInt64.read(from: buf)
-        }
-    }
-}
-
-fileprivate enum FfiConverterOptionString: FfiConverterUsingByteBuffer {
-    typealias SwiftType = String?
-
-    static func write(_ value: SwiftType, into buf: Writer) {
-        FfiConverterOptional.write(value, into: buf) { item, buf in
-            item.write(into: buf)
-        }
-    }
-
-    static func read(from buf: Reader) throws -> SwiftType {
-        try FfiConverterOptional.read(from: buf) { buf in
-            try String.read(from: buf)
-        }
-    }
-}
-
-fileprivate enum FfiConverterSequenceEnumTransaction: FfiConverterUsingByteBuffer {
-    typealias SwiftType = [Transaction]
-
-    static func write(_ value: SwiftType, into buf: Writer) {
-        FfiConverterSequence.write(value, into: buf) { (item, buf) in
-            item.write(into: buf)
-        }
-    }
-
-    static func read(from buf: Reader) throws -> SwiftType {
-        try FfiConverterSequence.read(from: buf) { buf in
-            try Transaction.read(from: buf)
-        }
-    }
-}
-
-
-/**
- * Top level initializers and tear down methods.
- *
- * This is generated by uniffi.
- */
-public enum BdkLifecycle {
-    /**
-     * Initialize the FFI and Rust library. This should be only called once per application.
-     */
-    func initialize() {
-        
-        // No initialization code needed
-        
-    }
-}
\ No newline at end of file
diff --git a/bindings/bdk-swift/bdk.swiftmodule b/bindings/bdk-swift/bdk.swiftmodule
deleted file mode 100644
index e1acf60b..00000000
Binary files a/bindings/bdk-swift/bdk.swiftmodule and /dev/null differ
diff --git a/bindings/bdk-swift/bdkFFI.h b/bindings/bdk-swift/bdkFFI.h
deleted file mode 100644
index 00941c22..00000000
--- a/bindings/bdk-swift/bdkFFI.h
+++ /dev/null
@@ -1,144 +0,0 @@
-// This file was autogenerated by some hot garbage in the `uniffi` crate.
-// Trust me, you don't want to mess with it!
-
-#pragma once
-
-#include <stdbool.h>
-#include <stdint.h>
-
-// The following structs are used to implement the lowest level
-// of the FFI, and thus useful to multiple uniffied crates.
-// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H.
-#ifdef UNIFFI_SHARED_H
-    // We also try to prevent mixing versions of shared uniffi header structs.
-    // If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V3
-    #ifndef UNIFFI_SHARED_HEADER_V3
-        #error Combining helper code from multiple versions of uniffi is not supported
-    #endif // ndef UNIFFI_SHARED_HEADER_V3
-#else
-#define UNIFFI_SHARED_H
-#define UNIFFI_SHARED_HEADER_V3
-// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️
-// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V3 in this file.           ⚠️
-
-typedef struct RustBuffer
-{
-    int32_t capacity;
-    int32_t len;
-    uint8_t *_Nullable data;
-} RustBuffer;
-
-typedef RustBuffer (*ForeignCallback)(uint64_t, int32_t, RustBuffer);
-
-typedef struct ForeignBytes
-{
-    int32_t len;
-    const uint8_t *_Nullable data;
-} ForeignBytes;
-
-// Error definitions
-typedef struct RustCallStatus {
-    int8_t code;
-    RustBuffer errorBuf;
-} RustCallStatus;
-
-// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️
-// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V3 in this file.           ⚠️
-#endif // def UNIFFI_SHARED_H
-
-void ffi_bdk_62af_OfflineWallet_object_free(
-      void*_Nonnull ptr,
-    RustCallStatus *_Nonnull out_status
-    );
-void*_Nonnull bdk_62af_OfflineWallet_new(
-      RustBuffer descriptor,RustBuffer network,RustBuffer database_config,
-    RustCallStatus *_Nonnull out_status
-    );
-RustBuffer bdk_62af_OfflineWallet_get_new_address(
-      void*_Nonnull ptr,
-    RustCallStatus *_Nonnull out_status
-    );
-uint64_t bdk_62af_OfflineWallet_get_balance(
-      void*_Nonnull ptr,
-    RustCallStatus *_Nonnull out_status
-    );
-void bdk_62af_OfflineWallet_sign(
-      void*_Nonnull ptr,void*_Nonnull psbt,
-    RustCallStatus *_Nonnull out_status
-    );
-RustBuffer bdk_62af_OfflineWallet_get_transactions(
-      void*_Nonnull ptr,
-    RustCallStatus *_Nonnull out_status
-    );
-void ffi_bdk_62af_OnlineWallet_object_free(
-      void*_Nonnull ptr,
-    RustCallStatus *_Nonnull out_status
-    );
-void*_Nonnull bdk_62af_OnlineWallet_new(
-      RustBuffer descriptor,RustBuffer change_descriptor,RustBuffer network,RustBuffer database_config,RustBuffer blockchain_config,
-    RustCallStatus *_Nonnull out_status
-    );
-RustBuffer bdk_62af_OnlineWallet_get_new_address(
-      void*_Nonnull ptr,
-    RustCallStatus *_Nonnull out_status
-    );
-uint64_t bdk_62af_OnlineWallet_get_balance(
-      void*_Nonnull ptr,
-    RustCallStatus *_Nonnull out_status
-    );
-void bdk_62af_OnlineWallet_sign(
-      void*_Nonnull ptr,void*_Nonnull psbt,
-    RustCallStatus *_Nonnull out_status
-    );
-RustBuffer bdk_62af_OnlineWallet_get_transactions(
-      void*_Nonnull ptr,
-    RustCallStatus *_Nonnull out_status
-    );
-RustBuffer bdk_62af_OnlineWallet_get_network(
-      void*_Nonnull ptr,
-    RustCallStatus *_Nonnull out_status
-    );
-void bdk_62af_OnlineWallet_sync(
-      void*_Nonnull ptr,uint64_t progress_update,RustBuffer max_address_param,
-    RustCallStatus *_Nonnull out_status
-    );
-RustBuffer bdk_62af_OnlineWallet_broadcast(
-      void*_Nonnull ptr,void*_Nonnull psbt,
-    RustCallStatus *_Nonnull out_status
-    );
-void ffi_bdk_62af_PartiallySignedBitcoinTransaction_object_free(
-      void*_Nonnull ptr,
-    RustCallStatus *_Nonnull out_status
-    );
-void*_Nonnull bdk_62af_PartiallySignedBitcoinTransaction_new(
-      void*_Nonnull wallet,RustBuffer recipient,uint64_t amount,
-    RustCallStatus *_Nonnull out_status
-    );
-void ffi_bdk_62af_BdkProgress_init_callback(
-      ForeignCallback  _Nonnull callback_stub,
-    RustCallStatus *_Nonnull out_status
-    );
-RustBuffer bdk_62af_generate_extended_key(
-      RustBuffer network,RustBuffer mnemonic_type,RustBuffer password,
-    RustCallStatus *_Nonnull out_status
-    );
-RustBuffer bdk_62af_restore_extended_key(
-      RustBuffer network,RustBuffer mnemonic,RustBuffer password,
-    RustCallStatus *_Nonnull out_status
-    );
-RustBuffer ffi_bdk_62af_rustbuffer_alloc(
-      int32_t size,
-    RustCallStatus *_Nonnull out_status
-    );
-RustBuffer ffi_bdk_62af_rustbuffer_from_bytes(
-      ForeignBytes bytes,
-    RustCallStatus *_Nonnull out_status
-    );
-void ffi_bdk_62af_rustbuffer_free(
-      RustBuffer buf,
-    RustCallStatus *_Nonnull out_status
-    );
-RustBuffer ffi_bdk_62af_rustbuffer_reserve(
-      RustBuffer buf,int32_t additional,
-    RustCallStatus *_Nonnull out_status
-    );
diff --git a/bindings/bdk-swift/bdkFFI.modulemap b/bindings/bdk-swift/bdkFFI.modulemap
deleted file mode 100644
index 1c213559..00000000
--- a/bindings/bdk-swift/bdkFFI.modulemap
+++ /dev/null
@@ -1,6 +0,0 @@
-// This file was autogenerated by some hot garbage in the `uniffi` crate.
-// Trust me, you don't want to mess with it!
-module bdkFFI {
-    header "bdkFFI.h"
-    export *
-}
\ No newline at end of file
diff --git a/build.sh b/build.sh
index 0eb41ba2..89b786d4 100755
--- a/build.sh
+++ b/build.sh
@@ -7,7 +7,7 @@ set -eo pipefail
 help()
 {
    # Display Help
-   echo "Build bdk-uniffi and related libraries."
+   echo "Build bdk-ffi and related libraries."
    echo
    echo "Syntax: build [-a|h|k|s]"
    echo "options:"
@@ -33,12 +33,12 @@ copy_lib_kotlin() {
     "Darwin")
       echo -n "darwin "
       mkdir -p bindings/bdk-kotlin/jvm/src/main/resources/darwin-x86-64
-      cp target/debug/libuniffi_bdk.dylib bindings/bdk-kotlin/jvm/src/main/resources/darwin-x86-64
+      cp target/debug/libbdkffi.dylib bindings/bdk-kotlin/jvm/src/main/resources/darwin-x86-64
       ;;
     "Linux")
       echo -n "linux "
       mkdir -p bindings/bdk-kotlin/jvm/src/main/resources/linux-x86-64
-      cp target/debug/libuniffi_bdk.so bindings/bdk-kotlin/jvm/src/main/resources/linux-x86-64
+      cp target/debug/libbdkffi.so bindings/bdk-kotlin/jvm/src/main/resources/linux-x86-64
       ;;
   esac
   echo "libs to kotlin sub-project"
@@ -53,10 +53,10 @@ build_kotlin() {
 ## bdk swift
 build_swift() {
   uniffi-bindgen generate src/bdk.udl --no-format --out-dir bindings/bdk-swift/ --language swift
-  swiftc -module-name bdk -emit-library -o libuniffi_bdk.dylib -emit-module -emit-module-path ./bindings/bdk-swift/ -parse-as-library -L ./target/debug/ -luniffi_bdk -Xcc -fmodule-map-file=./bindings/bdk-swift/bdkFFI.modulemap ./bindings/bdk-swift/bdk.swift
+  swiftc -module-name bdk -emit-library -o libbdkffi.dylib -emit-module -emit-module-path ./bindings/bdk-swift/ -parse-as-library -L ./target/debug/ -lbdkffi -Xcc -fmodule-map-file=./bindings/bdk-swift/bdkFFI.modulemap ./bindings/bdk-swift/bdk.swift
   TARGETDIR=target
   RELDIR=debug
-  STATIC_LIB_NAME=libuniffi_bdk.a
+  STATIC_LIB_NAME=libbdkffi.a
 
   # We can't use cargo lipo because we can't link to universal libraries :(
   # https://github.com/rust-lang/rust/issues/55235
@@ -106,19 +106,19 @@ build_android() {
 
   if echo $BUILD_TARGETS | grep "aarch64"; then
       CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="aarch64-linux-android21-clang" CC="aarch64-linux-android21-clang" cargo build --target=aarch64-linux-android
-      cp target/aarch64-linux-android/debug/libuniffi_bdk.so bindings/bdk-kotlin/android/src/main/jniLibs/arm64-v8a
+      cp target/aarch64-linux-android/debug/libbdkffi.so bindings/bdk-kotlin/android/src/main/jniLibs/arm64-v8a
   fi
   if echo $BUILD_TARGETS | grep "x86_64"; then
       CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER="x86_64-linux-android21-clang" CC="x86_64-linux-android21-clang" cargo build --target=x86_64-linux-android
-      cp target/x86_64-linux-android/debug/libuniffi_bdk.so bindings/bdk-kotlin/android/src/main/jniLibs/x86_64
+      cp target/x86_64-linux-android/debug/libbdkffi.so bindings/bdk-kotlin/android/src/main/jniLibs/x86_64
   fi
   if echo $BUILD_TARGETS | grep "armv7"; then
       CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="armv7a-linux-androideabi21-clang" CC="armv7a-linux-androideabi21-clang" cargo build --target=armv7-linux-androideabi
-      cp target/armv7-linux-androideabi/debug/libuniffi_bdk.so bindings/bdk-kotlin/android/src/main/jniLibs/armeabi-v7a
+      cp target/armv7-linux-androideabi/debug/libbdkffi.so bindings/bdk-kotlin/android/src/main/jniLibs/armeabi-v7a
   fi
   if echo $BUILD_TARGETS | grep "i686"; then
       CARGO_TARGET_I686_LINUX_ANDROID_LINKER="i686-linux-android21-clang" CC="i686-linux-android21-clang" cargo build --target=i686-linux-android
-      cp target/i686-linux-android/debug/libuniffi_bdk.so bindings/bdk-kotlin/android/src/main/jniLibs/x86
+      cp target/i686-linux-android/debug/libbdkffi.so bindings/bdk-kotlin/android/src/main/jniLibs/x86
   fi
 
   # copy sources
diff --git a/examples/ios/IOSBdkAppSample.xcodeproj/project.pbxproj b/examples/ios/IOSBdkAppSample.xcodeproj/project.pbxproj
index a881ec09..07927274 100644
--- a/examples/ios/IOSBdkAppSample.xcodeproj/project.pbxproj
+++ b/examples/ios/IOSBdkAppSample.xcodeproj/project.pbxproj
@@ -7,6 +7,7 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		AA8DC1642730D7A00084BAA2 /* libbdkffi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA8DC1632730D7A00084BAA2 /* libbdkffi.a */; };
 		C03BFB93272C68C7003AE940 /* IOSBdkAppSampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = C03BFB92272C68C7003AE940 /* IOSBdkAppSampleApp.swift */; };
 		C03BFB95272C68C7003AE940 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C03BFB94272C68C7003AE940 /* ContentView.swift */; };
 		C03BFB97272C68CB003AE940 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C03BFB96272C68CB003AE940 /* Assets.xcassets */; };
@@ -15,17 +16,16 @@
 		C03BFBA6272C6AD5003AE940 /* bdk.swiftmodule in Resources */ = {isa = PBXBuildFile; fileRef = C03BFBA4272C6AD4003AE940 /* bdk.swiftmodule */; };
 		C03BFBA8272C6AF4003AE940 /* WalletViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C03BFBA7272C6AF4003AE940 /* WalletViewModel.swift */; };
 		C03BFBAA272C6B7E003AE940 /* WalletView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C03BFBA9272C6B7E003AE940 /* WalletView.swift */; };
-		C03BFBAB272C6CA7003AE940 /* libuniffi_bdk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C03BFBA2272C6AB8003AE940 /* libuniffi_bdk.a */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
+		AA8DC1632730D7A00084BAA2 /* libbdkffi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbdkffi.a; path = ../../target/ios/universal/debug/libbdkffi.a; sourceTree = "<group>"; };
 		C03BFB8F272C68C7003AE940 /* IOSBdkAppSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = IOSBdkAppSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		C03BFB92272C68C7003AE940 /* IOSBdkAppSampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IOSBdkAppSampleApp.swift; sourceTree = "<group>"; };
 		C03BFB94272C68C7003AE940 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
 		C03BFB96272C68CB003AE940 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
 		C03BFB99272C68CB003AE940 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
 		C03BFBA0272C6A04003AE940 /* BridgingHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BridgingHeader.h; sourceTree = "<group>"; };
-		C03BFBA2272C6AB8003AE940 /* libuniffi_bdk.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuniffi_bdk.a; path = ../../target/ios/universal/debug/libuniffi_bdk.a; sourceTree = "<group>"; };
 		C03BFBA3272C6AD4003AE940 /* bdk.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = bdk.swift; path = "../../../bindings/bdk-swift/bdk.swift"; sourceTree = "<group>"; };
 		C03BFBA4272C6AD4003AE940 /* bdk.swiftmodule */ = {isa = PBXFileReference; lastKnownFileType = file; name = bdk.swiftmodule; path = "../../../bindings/bdk-swift/bdk.swiftmodule"; sourceTree = "<group>"; };
 		C03BFBA7272C6AF4003AE940 /* WalletViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletViewModel.swift; sourceTree = "<group>"; };
@@ -37,7 +37,7 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				C03BFBAB272C6CA7003AE940 /* libuniffi_bdk.a in Frameworks */,
+				AA8DC1642730D7A00084BAA2 /* libbdkffi.a in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -88,7 +88,7 @@
 		C03BFBA1272C6AB7003AE940 /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
-				C03BFBA2272C6AB8003AE940 /* libuniffi_bdk.a */,
+				AA8DC1632730D7A00084BAA2 /* libbdkffi.a */,
 			);
 			name = Frameworks;
 			sourceTree = "<group>";
@@ -299,6 +299,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_ASSET_PATHS = "\"IOSBdkAppSample/Preview Content\"";
+				DEVELOPMENT_TEAM = GAU324YPR8;
 				ENABLE_PREVIEWS = YES;
 				GENERATE_INFOPLIST_FILE = YES;
 				HEADER_SEARCH_PATHS = "$(SRCROOT)/../../bindings/bdk-swift";
@@ -330,6 +331,7 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_ASSET_PATHS = "\"IOSBdkAppSample/Preview Content\"";
+				DEVELOPMENT_TEAM = GAU324YPR8;
 				ENABLE_PREVIEWS = YES;
 				GENERATE_INFOPLIST_FILE = YES;
 				HEADER_SEARCH_PATHS = "$(SRCROOT)/../../bindings/bdk-swift";
diff --git a/uniffi.toml b/uniffi.toml
new file mode 100644
index 00000000..767e0322
--- /dev/null
+++ b/uniffi.toml
@@ -0,0 +1,12 @@
+[bindings.kotlin]
+package_name = "org.bitcoindevkit"
+cdylib_name = "bdkffi"
+
+[bindings.python]
+cdylib_name = "bdkffi"
+
+[bindings.ruby]
+cdylib_name = "bdkffi"
+
+[bindings.swift]
+cdylib_name = "bdkffi"


Test patch:
diff --git a/bindings/bdk-kotlin/jvm/src/test/kotlin/org/bitcoindevkit/bdk/JvmLibTest.kt b/bindings/bdk-kotlin/jvm/src/test/kotlin/org/bitcoindevkit/JvmLibTest.kt
similarity index 91%
rename from bindings/bdk-kotlin/jvm/src/test/kotlin/org/bitcoindevkit/bdk/JvmLibTest.kt
rename to bindings/bdk-kotlin/jvm/src/test/kotlin/org/bitcoindevkit/JvmLibTest.kt
index ceea526c..c0170928 100644
--- a/bindings/bdk-kotlin/jvm/src/test/kotlin/org/bitcoindevkit/bdk/JvmLibTest.kt
+++ b/bindings/bdk-kotlin/jvm/src/test/kotlin/org/bitcoindevkit/JvmLibTest.kt
@@ -1,4 +1,4 @@
-package org.bitcoindevkit.bdk
+package org.bitcoindevkit
 
 import java.nio.file.Files
 
diff --git a/bindings/bdk-kotlin/jvm/src/testFixtures/kotlin/org/bitcoindevkit/bdk/LibTest.kt b/bindings/bdk-kotlin/jvm/src/testFixtures/kotlin/org/bitcoindevkit/LibTest.kt
similarity index 98%
rename from bindings/bdk-kotlin/jvm/src/testFixtures/kotlin/org/bitcoindevkit/bdk/LibTest.kt
rename to bindings/bdk-kotlin/jvm/src/testFixtures/kotlin/org/bitcoindevkit/LibTest.kt
index 0811c8a2..f6bf1d93 100644
--- a/bindings/bdk-kotlin/jvm/src/testFixtures/kotlin/org/bitcoindevkit/bdk/LibTest.kt
+++ b/bindings/bdk-kotlin/jvm/src/testFixtures/kotlin/org/bitcoindevkit/LibTest.kt
@@ -1,10 +1,10 @@
-package org.bitcoindevkit.bdk
+package org.bitcoindevkit
 
 import org.junit.Assert.*
 import org.junit.Test
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
-import uniffi.bdk.*
+import org.bitcoindevkit.*
 import java.io.File
 
 /**