6d53cbeb2502602d1bab0fd11f63d203f61b507a Fix fmt error (Steve Myers) 1a12f37a2f1c5f99e3b590b3ba070859120a9f8e Set MSRV to 1.57.0 (Steve Myers) Pull request description: ### Description The `master` branch is currently not passing the new github checks. A required dependency of `bdk-ffi-bindgen` is `uniffi_bindgen` and it depends on `os_str_bytes` v6.2.0 which has a MSRV of 1.57.0. I therefore had to make the MSRV of `bdk-ffi` also 1.57.0 and update the github actions. This PR also fixes a small `cargo fmt` warning. ### Notes to the reviewers ```shell % cargo +1.56.1 build error: package `os_str_bytes v6.2.0` cannot be built because it requires rustc 1.57.0 or newer, while the currently active rustc version is 1.56.1 ``` ```shell % cargo tree -i os_str_bytes os_str_bytes v6.2.0 └── clap_lex v0.2.4 └── clap v3.1.18 └── uniffi_bindgen v0.19.3 └── bdk-ffi-bindgen v0.2.0 (/Users/steve/git/notmandatory/bdk-ffi/bdk-ffi-bindgen) ``` ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing Top commit has no ACKs. Tree-SHA512: 87ad4a02d91184b421871354b1f5c31d906bf7460fe992db15666da32a65f13d8fbaf4ae53928f410a7206b195c8dff76af07210c144a4d02854ceb6af265f7e
Native language bindings for BDK
The workspace in this repository creates the libbdkffi
multi-language library for the rust based
bdk library from the Bitcoin Dev Kit project. The bdk-ffi-bindgen
package builds a tool for
generating the actual language binding code used to access the libbdkffi
library.
Each supported language has its own repository that includes this project as a git submodule. The rust code in this project is a wrapper around the bdk library to expose it's APIs in a uniform way using the mozilla/uniffi-rs bindings generator for each supported target language.
Supported target languages and platforms
The below repositories include instructions for using, building, and publishing the native language binding for bdk supported by this project.
Language | Platform | Repository |
---|---|---|
Kotlin | jvm | bdk-kotlin |
Kotlin | android | bdk-kotlin |
Swift | iOS, macOS | bdk-swift |
Python | linux, macOS | bdk-python |
Language bindings generator tool
Use the bdk-ffi-bindgen
tool to generate language binding code for the above supported languages.
To run bdk-ffi-bindgen
and see the available options use the command:
cargo run -p bdk-ffi-bindgen -- --help
Contributing
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
Goals
- Language bindings should feel idiomatic in target languages/platforms
- Adding new targets should be easy
- Getting up and running should be easy
- Contributing should be easy
- Get it right, then automate
Thanks
This project is made possible thanks to the wonderful work by the mozilla/uniffi-rs team.