Compare commits
2 Commits
release/0.
...
v0.8.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
138200db07 | ||
|
|
f1eb8c678d |
101
.github/ISSUE_TEMPLATE/minor_release.md
vendored
101
.github/ISSUE_TEMPLATE/minor_release.md
vendored
@@ -1,101 +0,0 @@
|
||||
---
|
||||
name: Minor Release
|
||||
about: Create a new minor release [for release managers only]
|
||||
title: 'Release MAJOR.MINOR+1.0'
|
||||
labels: 'release'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Create a new minor release
|
||||
|
||||
### Summary
|
||||
|
||||
<--release summary to be used in announcements-->
|
||||
|
||||
### Commit
|
||||
|
||||
<--latest commit ID to include in this release-->
|
||||
|
||||
### Changelog
|
||||
|
||||
<--add notices from PRs merged since the prior release, see ["keep a changelog"]-->
|
||||
|
||||
### Checklist
|
||||
|
||||
Release numbering must follow [Semantic Versioning]. These steps assume the current `master`
|
||||
branch **development** version is *MAJOR.MINOR.0*.
|
||||
|
||||
#### On the day of the feature freeze
|
||||
|
||||
Change the `master` branch to the next MINOR+1 version:
|
||||
|
||||
- [ ] Switch to the `master` branch.
|
||||
- [ ] Create a new PR branch called `bump_dev_MAJOR_MINOR+1`, eg. `bump_dev_0_22`.
|
||||
- [ ] Bump the `bump_dev_MAJOR_MINOR+1` branch to the next development MINOR+1 version.
|
||||
- Change the `Cargo.toml` version value to `MAJOR.MINOR+1.0`.
|
||||
- The commit message should be "Bump version to MAJOR.MINOR+1.0".
|
||||
- [ ] Create PR and merge the `bump_dev_MAJOR_MINOR+1` branch to `master`.
|
||||
- Title PR "Bump version to MAJOR.MINOR+1.0".
|
||||
|
||||
Create a new release branch:
|
||||
|
||||
- [ ] Double check that your local `master` is up-to-date with the upstream repo.
|
||||
- [ ] Create a new branch called `release/MAJOR.MINOR+1` from `master`.
|
||||
|
||||
Add a release candidate tag, this is optional and only needed for major `bdk-ffi` changes that
|
||||
require a longer testing cycle:
|
||||
|
||||
- [ ] Bump the `release/MAJOR.MINOR+1` branch to `MAJOR.MINOR+1.0-rc.1` version.
|
||||
- Change the `Cargo.toml` version value to `MAJOR.MINOR+1.0-rc.1`.
|
||||
- The commit message should be "Bump version to MAJOR.MINOR+1.0-rc.1".
|
||||
- [ ] Add a tag to the `HEAD` commit in the `release/MAJOR.MINOR+1` branch.
|
||||
- The tag name should be `vMAJOR.MINOR+1.0-rc.1`
|
||||
- Use message "Release MAJOR.MINOR+1.0 rc.1".
|
||||
- Make sure the tag is signed, for extra safety use the explicit `--sign` flag.
|
||||
- [ ] Push the `release/MAJOR.MINOR` branch and new tag to the `bitcoindevkit/bdk` repo.
|
||||
- Use `git push --tags` option to push the new `vMAJOR.MINOR+1.0-rc.1` tag.
|
||||
|
||||
If any issues need to be fixed before the *MAJOR.MINOR+1.0* version is released:
|
||||
|
||||
- [ ] Merge fix PRs to the `master` branch.
|
||||
- [ ] Git cherry-pick fix commits to the `release/MAJOR.MINOR+1` branch.
|
||||
- [ ] Verify fixes in `release/MAJOR.MINOR+1` branch.
|
||||
- [ ] Bump the `release/MAJOR.MINOR+1` branch to `MAJOR.MINOR+1.0-rc.x+1` version.
|
||||
- Change the `Cargo.toml` version value to `MAJOR.MINOR+1.0-rc.x+1`.
|
||||
- The commit message should be "Bump version to MAJOR.MINOR+1.0-rc.x+1".
|
||||
- [ ] Add a tag to the `HEAD` commit in the `release/MAJOR.MINOR+1` branch.
|
||||
- The tag name should be `vMAJOR.MINOR+1.0-rc.x+1`, where x is the current release candidate number.
|
||||
- Use tag message "Release MAJOR.MINOR+1.0 rc.x+1".
|
||||
- Make sure the tag is signed, for extra safety use the explicit `--sign` flag.
|
||||
- [ ] Push the new tag to the `bitcoindevkit/bdk` repo.
|
||||
- Use `git push --tags` option to push the new `vMAJOR.MINOR+1.0-rc.x+1` tag.
|
||||
|
||||
#### On the day of the release
|
||||
|
||||
Tag and publish new release:
|
||||
|
||||
- [ ] Bump the `release/MAJOR.MINOR+1` branch to `MAJOR.MINOR+1.0` version.
|
||||
- Change the `Cargo.toml` version value to `MAJOR.MINOR+1.0`.
|
||||
- The commit message should be "Bump version to MAJOR.MINOR+1.0".
|
||||
- [ ] Add a tag to the `HEAD` commit in the `release/MAJOR.MINOR+1` branch.
|
||||
- The tag name should be `vMAJOR.MINOR+1.0`
|
||||
- The first line of the tag message should be "Release MAJOR.MINOR+1.0".
|
||||
- In the body of the tag message put a copy of the **Summary** and **Changelog** for the release.
|
||||
- Make sure the tag is signed, for extra safety use the explicit `--sign` flag.
|
||||
- [ ] Wait for the CI to finish one last time.
|
||||
- [ ] Push the new tag to the `bitcoindevkit/bdk` repo.
|
||||
- [ ] Create the release on GitHub.
|
||||
- Go to "tags", click on the dots on the right and select "Create Release".
|
||||
- Set the title to `Release MAJOR.MINOR+1.0`.
|
||||
- In the release notes body put the **Summary** and **Changelog**.
|
||||
- Use the "+ Auto-generate release notes" button to add details from included PRs.
|
||||
- Until we reach a `1.0.0` release check the "Pre-release" box.
|
||||
- [ ] After downstream language repos are also updated announce the release, using the **Summary**,
|
||||
on Discord, Twitter and Mastodon.
|
||||
- [ ] Celebrate 🎉
|
||||
|
||||
[Semantic Versioning]: https://semver.org/
|
||||
[crates.io]: https://crates.io/crates/bdk
|
||||
[docs.rs]: https://docs.rs/bdk/latest/bdk
|
||||
["keep a changelog"]: https://keepachangelog.com/en/1.0.0/
|
||||
69
.github/ISSUE_TEMPLATE/patch_release.md
vendored
69
.github/ISSUE_TEMPLATE/patch_release.md
vendored
@@ -1,69 +0,0 @@
|
||||
---
|
||||
name: Patch Release
|
||||
about: Create a new patch release [for release managers only]
|
||||
title: 'Release MAJOR.MINOR.PATCH+1'
|
||||
labels: 'release'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Create a new patch release
|
||||
|
||||
### Summary
|
||||
|
||||
<--release summary to be used in announcements-->
|
||||
|
||||
### Commit
|
||||
|
||||
<--latest commit ID to include in this release-->
|
||||
|
||||
### Changelog
|
||||
|
||||
<--add notices from PRs merged since the prior release, see ["keep a changelog"]-->
|
||||
|
||||
### Checklist
|
||||
|
||||
Release numbering must follow [Semantic Versioning]. These steps assume the current `master`
|
||||
branch **development** version is *MAJOR.MINOR.PATCH*.
|
||||
|
||||
### On the day of the patch release
|
||||
|
||||
Change the `master` branch to the new PATCH+1 version:
|
||||
|
||||
- [ ] Switch to the `master` branch.
|
||||
- [ ] Create a new PR branch called `bump_dev_MAJOR_MINOR_PATCH+1`, eg. `bump_dev_0_22_1`.
|
||||
- [ ] Bump the `bump_dev_MAJOR_MINOR` branch to the next development PATCH+1 version.
|
||||
- Change the `Cargo.toml` version value to `MAJOR.MINOR.PATCH+1`.
|
||||
- The commit message should be "Bump version to MAJOR.MINOR.PATCH+1".
|
||||
- [ ] Create PR and merge the `bump_dev_MAJOR_MINOR_PATCH+1` branch to `master`.
|
||||
- Title PR "Bump version to MAJOR.MINOR.PATCH+1".
|
||||
|
||||
Cherry-pick, tag and publish new PATCH+1 release:
|
||||
|
||||
- [ ] Merge fix PRs to the `master` branch.
|
||||
- [ ] Git cherry-pick fix commits to the `release/MAJOR.MINOR` branch to be patched.
|
||||
- [ ] Verify fixes in `release/MAJOR.MINOR` branch.
|
||||
- [ ] Bump the `release/MAJOR.MINOR.PATCH+1` branch to `MAJOR.MINOR.PATCH+1` version.
|
||||
- Change the `Cargo.toml` version value to `MAJOR.MINOR.MINOR.PATCH+1`.
|
||||
- The commit message should be "Bump version to MAJOR.MINOR.PATCH+1".
|
||||
- [ ] Add a tag to the `HEAD` commit in the `release/MAJOR.MINOR` branch.
|
||||
- The tag name should be `vMAJOR.MINOR.PATCH+1`
|
||||
- The first line of the tag message should be "Release MAJOR.MINOR.PATCH+1".
|
||||
- In the body of the tag message put a copy of the **Summary** and **Changelog** for the release.
|
||||
- Make sure the tag is signed, for extra safety use the explicit `--sign` flag.
|
||||
- [ ] Wait for the CI to finish one last time.
|
||||
- [ ] Push the new tag to the `bitcoindevkit/bdk` repo.
|
||||
- [ ] Create the release on GitHub.
|
||||
- Go to "tags", click on the dots on the right and select "Create Release".
|
||||
- Set the title to `Release MAJOR.MINOR.PATCH+1`.
|
||||
- In the release notes body put the **Summary** and **Changelog**.
|
||||
- Use the "+ Auto-generate release notes" button to add details from included PRs.
|
||||
- Until we reach a `1.0.0` release check the "Pre-release" box.
|
||||
- [ ] After downstream language repos are also updated announce the release, using the **Summary**,
|
||||
on Discord, Twitter and Mastodon.
|
||||
- [ ] Celebrate 🎉
|
||||
|
||||
[Semantic Versioning]: https://semver.org/
|
||||
[crates.io]: https://crates.io/crates/bdk
|
||||
[docs.rs]: https://docs.rs/bdk/latest/bdk
|
||||
["keep a changelog"]: https://keepachangelog.com/en/1.0.0/
|
||||
6
.github/pull_request_template.md
vendored
6
.github/pull_request_template.md
vendored
@@ -9,11 +9,6 @@
|
||||
<!-- In this section you can include notes directed to the reviewers, like explaining why some parts
|
||||
of the PR were done in a specific way -->
|
||||
|
||||
### Changelog notice
|
||||
|
||||
<!-- Notice the release manager should include in the release tag message changelog -->
|
||||
<!-- See https://keepachangelog.com/en/1.0.0/ for examples -->
|
||||
|
||||
### Checklists
|
||||
|
||||
#### All Submissions:
|
||||
@@ -26,6 +21,7 @@ of the PR were done in a specific way -->
|
||||
|
||||
* [ ] I've added tests for the new feature
|
||||
* [ ] I've added docs for the new feature
|
||||
* [ ] I've updated `CHANGELOG.md`
|
||||
|
||||
#### Bugfixes:
|
||||
|
||||
|
||||
4
.github/workflows/cont_integration.yml
vendored
4
.github/workflows/cont_integration.yml
vendored
@@ -10,9 +10,9 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
rust:
|
||||
- version: 1.63.0 # STABLE
|
||||
- version: 1.60.0 # STABLE
|
||||
clippy: true
|
||||
- version: 1.61.0 # MSRV
|
||||
- version: 1.57.0 # MSRV
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
44
CHANGELOG.md
44
CHANGELOG.md
@@ -1,49 +1,11 @@
|
||||
# Changelog
|
||||
All notable changes to this project prior to release **0.9.0** are documented in this file. Future
|
||||
changelog information can be found in each release's git tag and can be viewed with `git tag -ln100 "v*"`.
|
||||
Changelog info is also documented on the [GitHub releases](https://github.com/bitcoindevkit/bdk-ffi/releases)
|
||||
page. See [DEVELOPMENT_CYCLE.md](DEVELOPMENT_CYCLE.md) for more details.
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [v0.9.0]
|
||||
- Breaking Changes
|
||||
- Rename `get_network()` method on `Wallet` interface to `network()` [#185]
|
||||
- Rename `get_transactions()` method on `Wallet` interface to `list_transactions()` [#185]
|
||||
- Remove `generate_extended_key`, returned ExtendedKeyInfo [#154]
|
||||
- Remove `restore_extended_key`, returned ExtendedKeyInfo [#154]
|
||||
- Remove dictionary `ExtendedKeyInfo {mnenonic, xprv, fingerprint}` [#154]
|
||||
- Remove interface `Transaction` [#190]
|
||||
- Changed `Wallet` interface `list_transaction()` to return array of `TransactionDetails` [#190]
|
||||
- Update `bdk` dependency version to 0.22 [#193]
|
||||
- APIs Added [#154]
|
||||
- `generate_mnemonic()`, returns string mnemonic
|
||||
- `interface DescriptorSecretKey`
|
||||
- `new(Network, string_mnenoinc, password)`, contructs DescriptorSecretKey
|
||||
- `derive(DerivationPath)`, derives and returns child DescriptorSecretKey
|
||||
- `extend(DerivationPath)`, extends and returns DescriptorSecretKey
|
||||
- `as_public()`, returns DescriptorSecretKey as DescriptorPublicKey
|
||||
- `as_string()`, returns DescriptorSecretKey as String
|
||||
- `interface DescriptorPublicKey`
|
||||
- `derive(DerivationPath)` derives and returns child DescriptorPublicKey
|
||||
- `extend(DerivationPath)` extends and returns DescriptorPublicKey
|
||||
- `as_string()` returns DescriptorPublicKey as String
|
||||
- Add to `interface Blockchain` the `get_height()` and `get_block_hash()` methods [#184]
|
||||
- Add to `interface TxBuilder` the `set_recipients(recipient: Vec<AddressAmount>)` method [#186]
|
||||
- Add to `dictionary TransactionDetails` the `confirmation_time` field [#190]
|
||||
- Interfaces Added [#154]
|
||||
- `DescriptorSecretKey`
|
||||
- `DescriptorPublicKey`
|
||||
- `DerivationPath`
|
||||
|
||||
[#154]: https://github.com/bitcoindevkit/bdk-ffi/pull/154
|
||||
[#184]: https://github.com/bitcoindevkit/bdk-ffi/pull/184
|
||||
[#185]: https://github.com/bitcoindevkit/bdk-ffi/pull/185
|
||||
[#193]: https://github.com/bitcoindevkit/bdk-ffi/pull/193
|
||||
|
||||
## [v0.8.0]
|
||||
- Update BDK to version 0.20.0 [#169]
|
||||
- APIs Added
|
||||
@@ -55,7 +17,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
[#158]: https://github.com/bitcoindevkit/bdk-ffi/pull/158
|
||||
[#164]: https://github.com/bitcoindevkit/bdk-ffi/pull/164
|
||||
[#169]: https://github.com/bitcoindevkit/bdk-ffi/pull/169
|
||||
[#190]: https://github.com/bitcoindevkit/bdk-ffi/pull/190
|
||||
|
||||
## [v0.7.0]
|
||||
- Update BDK to version 0.19.0
|
||||
@@ -104,8 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [v0.2.0]
|
||||
|
||||
[unreleased]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.9.0...HEAD
|
||||
[v0.9.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.8.0...v0.9.0
|
||||
[unreleased]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.8.0...HEAD
|
||||
[v0.8.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.7.0...v0.8.0
|
||||
[v0.7.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.6.0...v0.7.0
|
||||
[v0.6.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.5.0...v0.6.0
|
||||
|
||||
10
Cargo.toml
10
Cargo.toml
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bdk-ffi"
|
||||
version = "0.10.0"
|
||||
version = "0.8.0"
|
||||
authors = ["Steve Myers <steve@notmandatory.org>", "Sudarsan Balaji <sudarsan.balaji@artfuldev.com>"]
|
||||
edition = "2018"
|
||||
|
||||
@@ -14,10 +14,10 @@ crate-type = ["staticlib", "cdylib"]
|
||||
name = "bdkffi"
|
||||
|
||||
[dependencies]
|
||||
bdk = { version = "0.23", features = ["all-keys", "use-esplora-ureq", "sqlite-bundled"] }
|
||||
bdk = { version = "0.20", features = ["all-keys", "use-esplora-ureq", "sqlite-bundled"] }
|
||||
|
||||
uniffi_macros = { version = "0.21.0", features = ["builtin-bindgen"] }
|
||||
uniffi = { version = "0.21.0", features = ["builtin-bindgen"] }
|
||||
uniffi_macros = { version = "0.19.3", features = ["builtin-bindgen"] }
|
||||
uniffi = { version = "0.19.3", features = ["builtin-bindgen"] }
|
||||
|
||||
[build-dependencies]
|
||||
uniffi_build = { version = "0.21.0", features = ["builtin-bindgen"] }
|
||||
uniffi_build = { version = "0.19.3", features = ["builtin-bindgen"] }
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
# Development Cycle
|
||||
|
||||
This project follows a regular releasing schedule similar to the one [used by the Rust language]
|
||||
except releases always follow the latest [`bdk`] release by one to two weeks. In short, this means
|
||||
that a new release is made at a regular cadence, with all the feature/bugfixes that made it to
|
||||
`master` in time. This ensures that we don't keep delaying releases waiting for
|
||||
"just one more little thing".
|
||||
|
||||
After making a new `bdk-ffi` release tag all downstream language bindings should also be updated.
|
||||
|
||||
This project uses [Semantic Versioning], but is currently at MAJOR version zero (0.y.z) meaning it
|
||||
is still in initial development. Anything MAY change at any time. The public API SHOULD NOT be
|
||||
considered stable. Until we reach version `1.0.0` we will do our best to document any breaking API
|
||||
changes in the changelog info attached to each release tag.
|
||||
|
||||
We decided to maintain a faster release cycle while the library is still in "beta", i.e. before
|
||||
release `1.0.0`: since we are constantly adding new features and, even more importantly, fixing
|
||||
issues, we want developers to have access to those updates as fast as possible. For this reason we
|
||||
will make a release **every 4 weeks**.
|
||||
|
||||
Once the project reaches a more mature state (>= `1.0.0`), we will very likely switch to longer
|
||||
release cycles of **6 weeks**.
|
||||
|
||||
The "feature freeze" will happen when [`bdk`] releases a release candidate. This project will then
|
||||
be updated and tested with [`bdk`] release candidates until a final release is published. This
|
||||
means a new branch will be created originating from the `master` tip at that time, and in that
|
||||
branch we will stop adding new features and only focus on ensuring the ones we've added are working
|
||||
properly.
|
||||
|
||||
To create a new release a release manager will create a new issue using a `Release` template and
|
||||
follow the template instructions.
|
||||
|
||||
[used by the Rust language]: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html
|
||||
[Semantic Versioning]: https://semver.org/
|
||||
[`bdk`]: https://github.com/bitcoindevkit/bdk
|
||||
@@ -1,12 +1,5 @@
|
||||
# Native language bindings for BDK
|
||||
|
||||
<p>
|
||||
<a href="https://github.com/bitcoindevkit/bdk-ffi/blob/master/LICENSE"><img alt="MIT or Apache-2.0 Licensed" src="https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg"/></a>
|
||||
<a href="https://github.com/bitcoindevkit/bdk-ffi/actions?query=workflow%3ACI"><img alt="CI Status" src="https://github.com/bitcoindevkit/bdk-ffi/workflows/CI/badge.svg"></a>
|
||||
<a href="https://blog.rust-lang.org/2022/05/19/Rust-1.61.0.html"><img alt="Rustc Version 1.61.0+" src="https://img.shields.io/badge/rustc-1.61.0%2B-lightgrey.svg"/></a>
|
||||
<a href="https://discord.gg/d7NkDKm"><img alt="Chat on Discord" src="https://img.shields.io/discord/753336465005608961?logo=discord"></a>
|
||||
</p>
|
||||
|
||||
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.
|
||||
@@ -42,7 +35,7 @@ cargo run -p bdk-ffi-bindgen -- --help
|
||||
|
||||
[bdk-kotlin]: https://github.com/bitcoindevkit/bdk-kotlin
|
||||
[bdk-swift]: https://github.com/bitcoindevkit/bdk-swift
|
||||
[bdk-python]: https://github.com/bitcoindevkit/bdk-python
|
||||
[bdk-python]: https://github.com/thunderbiscuit/bdk-python
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ version = "0.2.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.45" # remove after upgrading to next version of uniffi
|
||||
anyhow = "=1.0.45" # remove after upgrading to next version of uniffi
|
||||
structopt = "0.3"
|
||||
uniffi_bindgen = "0.21.0"
|
||||
uniffi_bindgen = "0.19.3"
|
||||
camino = "1.0.9"
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::path::{Path, PathBuf};
|
||||
use std::str::FromStr;
|
||||
use structopt::StructOpt;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum Language {
|
||||
Kotlin,
|
||||
Python,
|
||||
@@ -52,7 +52,6 @@ fn generate_bindings(opt: &Opt) -> anyhow::Result<(), anyhow::Error> {
|
||||
None,
|
||||
vec![opt.language.to_string().as_str()],
|
||||
Some(out_dir),
|
||||
None,
|
||||
false,
|
||||
)?;
|
||||
|
||||
|
||||
104
src/bdk.udl
104
src/bdk.udl
@@ -1,13 +1,15 @@
|
||||
namespace bdk {
|
||||
[Throws=BdkError]
|
||||
string generate_mnemonic(WordCount word_count);
|
||||
ExtendedKeyInfo generate_extended_key(Network network, WordCount word_count, string? password);
|
||||
|
||||
[Throws=BdkError]
|
||||
ExtendedKeyInfo restore_extended_key(Network network, string mnemonic, string? password);
|
||||
};
|
||||
|
||||
[Error]
|
||||
enum BdkError {
|
||||
"InvalidU32Bytes",
|
||||
"Generic",
|
||||
"MissingCachedScripts",
|
||||
"ScriptDoesntHaveAddressForm",
|
||||
"NoRecipients",
|
||||
"NoUtxosSelected",
|
||||
@@ -74,15 +76,6 @@ dictionary SqliteDbConfiguration {
|
||||
string path;
|
||||
};
|
||||
|
||||
dictionary Balance {
|
||||
u64 immature;
|
||||
u64 trusted_pending;
|
||||
u64 untrusted_pending;
|
||||
u64 confirmed;
|
||||
u64 spendable;
|
||||
u64 total;
|
||||
};
|
||||
|
||||
[Enum]
|
||||
interface DatabaseConfig {
|
||||
Memory();
|
||||
@@ -95,7 +88,6 @@ dictionary TransactionDetails {
|
||||
u64 received;
|
||||
u64 sent;
|
||||
string txid;
|
||||
BlockTime? confirmation_time;
|
||||
};
|
||||
|
||||
dictionary BlockTime {
|
||||
@@ -103,6 +95,18 @@ dictionary BlockTime {
|
||||
u64 timestamp;
|
||||
};
|
||||
|
||||
[Enum]
|
||||
interface Transaction {
|
||||
Unconfirmed(TransactionDetails details);
|
||||
Confirmed(TransactionDetails details, BlockTime confirmation);
|
||||
};
|
||||
|
||||
dictionary ExtendedKeyInfo {
|
||||
string mnemonic;
|
||||
string xprv;
|
||||
string fingerprint;
|
||||
};
|
||||
|
||||
enum WordCount {
|
||||
"Words12",
|
||||
"Words15",
|
||||
@@ -139,12 +143,6 @@ interface Blockchain {
|
||||
|
||||
[Throws=BdkError]
|
||||
void broadcast([ByRef] PartiallySignedBitcoinTransaction psbt);
|
||||
|
||||
[Throws=BdkError]
|
||||
u32 get_height();
|
||||
|
||||
[Throws=BdkError]
|
||||
string get_block_hash(u32 height);
|
||||
};
|
||||
|
||||
callback interface Progress {
|
||||
@@ -173,11 +171,6 @@ dictionary LocalUtxo {
|
||||
boolean is_spent;
|
||||
};
|
||||
|
||||
dictionary ScriptAmount {
|
||||
Script script;
|
||||
u64 amount;
|
||||
};
|
||||
|
||||
interface Wallet {
|
||||
[Throws=BdkError]
|
||||
constructor(string descriptor, string? change_descriptor, Network network, DatabaseConfig database_config);
|
||||
@@ -186,15 +179,15 @@ interface Wallet {
|
||||
AddressInfo get_address(AddressIndex address_index);
|
||||
|
||||
[Throws=BdkError]
|
||||
Balance get_balance();
|
||||
u64 get_balance();
|
||||
|
||||
[Throws=BdkError]
|
||||
boolean sign([ByRef] PartiallySignedBitcoinTransaction psbt);
|
||||
|
||||
[Throws=BdkError]
|
||||
sequence<TransactionDetails> list_transactions();
|
||||
sequence<Transaction> get_transactions();
|
||||
|
||||
Network network();
|
||||
Network get_network();
|
||||
|
||||
[Throws=BdkError]
|
||||
void sync([ByRef] Blockchain blockchain, Progress? progress);
|
||||
@@ -210,22 +203,12 @@ interface PartiallySignedBitcoinTransaction {
|
||||
string serialize();
|
||||
|
||||
string txid();
|
||||
|
||||
sequence<u8> extract_tx();
|
||||
|
||||
[Throws=BdkError]
|
||||
PartiallySignedBitcoinTransaction combine(PartiallySignedBitcoinTransaction other);
|
||||
};
|
||||
|
||||
dictionary TxBuilderResult {
|
||||
PartiallySignedBitcoinTransaction psbt;
|
||||
TransactionDetails transaction_details;
|
||||
};
|
||||
|
||||
interface TxBuilder {
|
||||
constructor();
|
||||
|
||||
TxBuilder add_recipient(Script script, u64 amount);
|
||||
TxBuilder add_recipient(string address, u64 amount);
|
||||
|
||||
TxBuilder add_unspendable(OutPoint unspendable);
|
||||
|
||||
@@ -254,11 +237,9 @@ interface TxBuilder {
|
||||
TxBuilder enable_rbf_with_sequence(u32 nsequence);
|
||||
|
||||
TxBuilder add_data(sequence<u8> data);
|
||||
|
||||
TxBuilder set_recipients(sequence<ScriptAmount> recipients);
|
||||
|
||||
|
||||
[Throws=BdkError]
|
||||
TxBuilderResult finish([ByRef] Wallet wallet);
|
||||
PartiallySignedBitcoinTransaction finish([ByRef] Wallet wallet);
|
||||
};
|
||||
|
||||
interface BumpFeeTxBuilder {
|
||||
@@ -273,44 +254,3 @@ interface BumpFeeTxBuilder {
|
||||
[Throws=BdkError]
|
||||
PartiallySignedBitcoinTransaction finish([ByRef] Wallet wallet);
|
||||
};
|
||||
|
||||
interface DerivationPath {
|
||||
[Throws=BdkError]
|
||||
constructor(string path);
|
||||
};
|
||||
|
||||
interface DescriptorSecretKey {
|
||||
[Throws=BdkError]
|
||||
constructor(Network network, string mnemonic, string? password);
|
||||
|
||||
[Throws=BdkError]
|
||||
DescriptorSecretKey derive(DerivationPath path);
|
||||
|
||||
DescriptorSecretKey extend(DerivationPath path);
|
||||
|
||||
DescriptorPublicKey as_public();
|
||||
|
||||
sequence<u8> secret_bytes();
|
||||
|
||||
string as_string();
|
||||
};
|
||||
|
||||
interface DescriptorPublicKey {
|
||||
[Throws=BdkError]
|
||||
DescriptorPublicKey derive(DerivationPath path);
|
||||
|
||||
DescriptorPublicKey extend(DerivationPath path);
|
||||
|
||||
string as_string();
|
||||
};
|
||||
|
||||
interface Address {
|
||||
[Throws=BdkError]
|
||||
constructor(string address);
|
||||
|
||||
Script script_pubkey();
|
||||
};
|
||||
|
||||
interface Script {
|
||||
constructor(sequence<u8> raw_output_script);
|
||||
};
|
||||
|
||||
705
src/lib.rs
705
src/lib.rs
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user