React Native language bindings for the Bitcoin Development Kit. Read our documentation for this library here.
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.
To take a look at the API exposed in this library, you can run our example applications. Read the docs on this here, and find our example apps here.
Take a look at our docs here for more complete information on building, testing, CI, releases, etc.
You can easily build the library from source for quick development and iteration with only a few prerequisites:
- Rust toolchain (stable 1.91.1)
justCLI tool: https://github.com/casey/justcargo-ndk(cargo install cargo-ndk)- For iOS: CocoaPods >= 1.13: ()
brew install cocoapods)
# Clone the repo and install prerequisites
git clone [email protected]:bitcoindevkit/bdk-rn.git
cd bdk-rn
# Install compilation targets
rustup target add aarch64-linux-android aarch64-apple-ios aarch64-apple-ios-sim
# Build the library and create tarball (includes both Android and iOS)
just rename-library
# Build both platforms and creates bdk-rn-VERSION.tgz
just build-tarballThe IntegrationTestingApp/ directory contains a standalone test app that uses the library as a tarball dependency (similar to how end-users would consume it). This app is not part of the workspace and is completely decoupled from the library development.
You can use the following workflow to run the tests locally on an Android emulator, or to develop features on the library by first making changes to the local bdk-ffi repository and then running through the workflow with new/modified tests.
# Build and package the library
just build-android
# Create the tarball bdk-rn-<version>-next.tgz
npm pack
# Install dependencies in the IntegrationTestingApp
cd IntegrationTestingApp
# Make sure your package.json file references the ../bdk-rn-<version>-next.tgz
npm install
# To see tests results in your shell, run this prior to starting the app
adb logcat -c && adb logcat -s ReactNativeJS | tee tests.log
# Run the app
npm run android- Make changes to
bdk-ffior the library code - Build and package:
just build-android && npm pack - Update IntegrationTestingApp:
cd IntegrationTestingApp && npm install - Add or modify tests in the IntegrationTestingApp
- Run the app and verify test results in logcat or in the emulator