React Native language bindings for the Bitcoin Development Kit.
The code in this repository is mostly comprised of:
- Build tools and workflows
- CI workflows
- Tests
- Docs
The core Rust code that is exposed to the React Native language bindings actually resides in the bdk-ffi repository. This repo pulls it in as a submodule.
Using docs at https://jhugman.github.io/uniffi-bindgen-react-native/guides/rn/getting-started.html to build this library.
To build the library and start testing locally, you must have:
- The Rust toolchain installed on your machine
- Set the default Rust toolchain to
1.90.0(currently Rust stable) - The just cli tool
- Initiated the submodule (
just submodule-init) - Installed your Rust compilation targets
# Clone the repo and install prerequisites
git clone [email protected]:bitcoindevkit/bdk-react-native.git
cargo install cargo-ndk
yarn install
# Install compilation targets, for example:
rustup target add aarch64-linux-android aarch64-apple-ios aarch64-apple-ios-sim
# Build the library
just rename-library
just build-android
# Start an Android emulator and run the example app
yarn example start # In terminal 1
yarn example android # In terminal 2- The
cargo-ndklibrary removed the--no-stripargument and this is creating a build error when using the latest release ofuniffi-bindgen-react-native(0.29.3-1). We are currently building using a commit on theirmainbranch which contains the patch. See thepackage.jsonfile. - For some reason the example app doesn't work on my Pixel 8 API 35 emulator, but does work on the Pixel 5 API 31 and the Pixel 9 API 36. If you get a red banner at the top of the app when launching saying
Unable to load script...and asking you to start Metro, try the example in a different emulator!