https://github.com/bitcoindevkit/bitcoin-ffi
https://github.com/bitcoindevkit/bitcoin-ffi
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bitcoindevkit/bitcoin-ffi
- Owner: bitcoindevkit
- License: other
- Created: 2024-05-30T16:52:54.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-10-20T23:32:38.000Z (6 months ago)
- Last Synced: 2024-10-21T02:45:45.554Z (6 months ago)
- Language: Rust
- Size: 122 KB
- Stars: 12
- Watchers: 9
- Forks: 7
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Readme
This crate does the light wrapping on [rust-bitcoin](https://github.com/rust-bitcoin/rust-bitcoin/) required for use in [uniffi](https://github.com/mozilla/uniffi-rs)-based libraries.
## Usage
To leverage these types in your uniffi library, simply:
1. Add a dependency on this crate:
```toml
bitcoin-ffi = { git = "https://github.com/bitcoindevkit/bitcoin-ffi.git", tag = "v0.1.2" }
```2. Add the following declarations to your UDL file for the types you wish to import. To read more about external type definitions, see [this page on the Uniffi documentation](https://mozilla.github.io/uniffi-rs/latest/udl/ext_types_external.html).
```idl
[ExternalInterface="bitcoin_ffi"]
typedef extern Script;[External="bitcoin_ffi"]
typedef extern Network;
```3. Add the following to your uniffi.toml config:
```toml
[bindings.kotlin.external_packages]
# Map the crate names from [External={name}] into Kotlin package names
bitcoin_ffi = "org.bitcoindevkit.bitcoin"
```