The workspace in this repository creates the libbbqrffi
multi-language library for the Rust-based
bbqr library.
Each supported language and the platform(s) it's packaged for has its own directory. The Rust code in this project is in the bbqr-ffi
directory and is a wrapper around the bbqr library to expose its APIs in a uniform way using the mozilla/uniffi-rs bindings generator for each supported target language.
The below directories (a separate repository in the case of bdk-swift) include instructions for using, building, and publishing the native language binding for bbqr.
Language | Platform | Published Package | Building Documentation | API Docs |
---|---|---|---|---|
Swift | iOS, macOS | bbqr-swift (GitHub) | README bbqr-swift | |
Kotlin | Android | bbqr-android (Central Maven) | README bbqr-android |
- iOS/MacOs: examples/apple-multiplatform-spm
- Android: examples/android
If you are familiar with the build tools for the specific languages you wish to build the libraries for, you can use their normal build/test workflows. We also include some just files to simplify the work across different languages. If you have the just tool installed on your system, you can simply call the commands defined in the justfile
s, for example:
cd bbqr-swift
just build
This library should compile with any combination of features with Rust 1.78.0.
To add new structs and functions, see the UniFFI User Guide and the uniffi-examples repository.
If you are interested in better understanding the base structure we use here in order to build your own Rust-to-Kotlin/Swift/Python language bindings, check out the uniffi-bindings-template repository. We maintain it as an example and starting point for other projects that wish to leverage the tech stack used in producing the BDK language bindings.
- This project is made possible thanks to the wonderful work by the mozilla/uniffi-rs team.
- Thanks to SatoshiPortal/bbqr-rust for the rust implementation
- Thanks to bdk-ffi, it was used as a template for publishing uniffi bindings