BDK UniFFI Language Bindings
Setup Android build environment
- Add Android rust targets
rustup target add x86_64-apple-darwin x86_64-unknown-linux-gnu x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android
- Set ANDROID_NDK_HOME
export ANDROID_NDK_HOME=/home/<user>/Android/Sdk/ndk/<NDK version, ie. 21.4.7075529>
Setup Swift build environment
1. install Swift, see ["Download Swift"](https://swift.org/download/) page
(or on Mac OSX install the latest Xcode)
Setup UniFFI
1. `cargo install uniffi_bindgen`
Adding new structs and functions
See the UniFFI User Guide
For pass by value objects
- create new rust struct with only fields that are supported UniFFI types
- update mapping
bdk.udl
file with newdictionary
For pass by reference values
- create wrapper rust struct/impl with only fields that are
Sync + Send
- update mapping
bdk.udl
file with newinterface
Build and test
- Use
build.sh
script (TODO do it all in build.rs instead) - Create tests in
bindings/bdk-kotlin
and/orbindings/bdk-swift
- Use
test.sh
to run all bindings tests
Languages
Rust
64.6%
Kotlin
18.1%
Swift
9.5%
Python
4.6%
Shell
2.2%
Other
1%