UniFFI
- cargo install uniffi_bindgen
- cargo build
- uniffi-bindgen generate --no-format --out-dir targets/kotlin/src/main/kotlin src/bdk.udl --language kotlin
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
- Install Swift, see "Download Swift" page
Adding new structs and functions
-
Create C safe Rust structs and related functions using safer-ffi
-
Test generated library and
bdk_ffi.h
file with c language tests incc/bdk_ffi_test.c
-
Use
build.sh
andtest.sh
to build c test program and verify functionality and memory de-allocation viavalgrind
-
Update the kotlin native interface LibJna.kt in the
bdk-kotlin
jvm
module to matchbdk_ffi.h
-
Create kotlin wrapper classes and interfaces as needed
-
Add tests to
bdk-kotlin
test-fixtures
module -
Use
build.sh
andtest.sh
to build and testbdk-kotlin
jvm
andandroid
modules
Languages
Rust
64.6%
Kotlin
18.1%
Swift
9.5%
Python
4.6%
Shell
2.2%
Other
1%