Skip to content

bitcoindevkit/bdk-rn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Bitcoin Dev Kit — React Native

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.

Exploring the Example Apps

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.


Building the Library and Running the Tests

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)
  • just CLI tool: https://github.com/casey/just
  • cargo-ndk (cargo install cargo-ndk)
  • For iOS: CocoaPods >= 1.13: ()brew install cocoapods)

Build Instructions

# 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-tarball

Running the Test Suite

The 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

Test Development Workflow

  1. Make changes to bdk-ffi or the library code
  2. Build and package: just build-android && npm pack
  3. Update IntegrationTestingApp: cd IntegrationTestingApp && npm install
  4. Add or modify tests in the IntegrationTestingApp
  5. Run the app and verify test results in logcat or in the emulator

About

Uniffi-based React Native bindings for the Bitcoin Development Kit

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE.txt
Apache-2.0
LICENSE-APACHE.txt
MIT
LICENSE-MIT.txt

Stars

Watchers

Forks

Packages

No packages published