Compare commits
98 Commits
release/0.
...
v0.10.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6cf423721 | ||
|
|
c7d0803000 | ||
|
|
1a4b9b440d | ||
|
|
1f914c2b4d | ||
|
|
fadb316451 | ||
|
|
3fefd3c1fb | ||
|
|
2cbb314d0b | ||
|
|
535fc70433 | ||
|
|
10fa276bec | ||
|
|
1cc9afaeb3 | ||
|
|
6f5e621561 | ||
|
|
1dd6f2d9f8 | ||
|
|
f92b45db6a | ||
|
|
c971d54aea | ||
|
|
2abccafb8f | ||
|
|
75d0415bec | ||
|
|
485f4f72ce | ||
|
|
37dddd05f6 | ||
|
|
dfb350e206 | ||
|
|
3c6075ad96 | ||
|
|
4e15badb14 | ||
|
|
f05a6648a7 | ||
|
|
297680b7c2 | ||
|
|
8166f820b4 | ||
|
|
4f20966ddd | ||
|
|
d447aac9ae | ||
|
|
159e7ab4af | ||
|
|
bfe03b91b2 | ||
|
|
3b028ecab1 | ||
|
|
aa004201b2 | ||
|
|
eed5554551 | ||
|
|
88427e4a05 | ||
|
|
8248660c52 | ||
|
|
25963ec982 | ||
|
|
7da28658a5 | ||
|
|
5944756b78 | ||
|
|
58fea6b205 | ||
|
|
4977cb6d68 | ||
|
|
930a1f1eb4 | ||
|
|
973013cbdf | ||
|
|
d38737669d | ||
|
|
6896097eb7 | ||
|
|
7d95433c28 | ||
|
|
6d53cbeb25 | ||
|
|
1a12f37a2f | ||
|
|
04022787c4 | ||
|
|
46850ed471 | ||
|
|
49da6fcbae | ||
|
|
075510d6e4 | ||
|
|
fa5c67cd05 | ||
|
|
1a20d0a6c2 | ||
|
|
a3ae4635eb | ||
|
|
5f12900c6d | ||
|
|
1a5a628a5d | ||
|
|
d8c8261e44 | ||
|
|
692904df1e | ||
|
|
2ac42b3ae0 | ||
|
|
6be22daf84 | ||
|
|
fad5e3cefd | ||
|
|
28a9b302d5 | ||
|
|
8f5ca7f0fc | ||
|
|
80ed21e4c9 | ||
|
|
f2efcb6196 | ||
|
|
cc8a17ef86 | ||
|
|
5ffe9ff331 | ||
|
|
9a3d609826 | ||
|
|
bf8fef807d | ||
|
|
e469dcd32c | ||
|
|
0a3347b85a | ||
|
|
f40ab551b6 | ||
|
|
efc475e33f | ||
|
|
cdea6dc0bf | ||
|
|
6beb98ca4c | ||
|
|
04d538ad45 | ||
|
|
c074a92e0c | ||
|
|
ff260edb3c | ||
|
|
15a0795626 | ||
|
|
e5cd7cb3a2 | ||
|
|
30e54ac067 | ||
|
|
71583eca7f | ||
|
|
0787d9c446 | ||
|
|
390d12703e | ||
|
|
9f903932dc | ||
|
|
3b243efefd | ||
|
|
f38f4c6197 | ||
|
|
11ba16ec1b | ||
|
|
4665c551dd | ||
|
|
907540d214 | ||
|
|
e6a6be5b60 | ||
|
|
c722223b49 | ||
|
|
236360e8c4 | ||
|
|
220835cffd | ||
|
|
b3c93b0435 | ||
|
|
a12e5ed396 | ||
|
|
fc00d0d38c | ||
|
|
7ea5e75bc4 | ||
|
|
a5bd16db4d | ||
|
|
d72905168b |
26
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
26
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: 'bug'
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
<!-- A clear and concise description of what the bug is. -->
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
<!-- Steps or code to reproduce the behavior. -->
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
<!-- A clear and concise description of what you expected to happen. -->
|
||||||
|
|
||||||
|
**Build environment**
|
||||||
|
- BDK tag/commit: <!-- e.g. v0.13.0, 3a07614 -->
|
||||||
|
- OS+version: <!-- e.g. ubuntu 20.04.01, macOS 12.0.1, windows -->
|
||||||
|
- Rust/Cargo version: <!-- e.g. 1.56.0 -->
|
||||||
|
- Rust/Cargo target: <!-- e.g. x86_64-apple-darwin, x86_64-unknown-linux-gnu, etc. -->
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
<!-- Add any other context about the problem here. -->
|
||||||
101
.github/ISSUE_TEMPLATE/minor_release.md
vendored
Normal file
101
.github/ISSUE_TEMPLATE/minor_release.md
vendored
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
---
|
||||||
|
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
Normal file
69
.github/ISSUE_TEMPLATE/patch_release.md
vendored
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
---
|
||||||
|
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/
|
||||||
77
.github/ISSUE_TEMPLATE/summer_project.md
vendored
Normal file
77
.github/ISSUE_TEMPLATE/summer_project.md
vendored
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
---
|
||||||
|
name: Summer of Bitcoin Project
|
||||||
|
about: Template to suggest a new https://www.summerofbitcoin.org/ project.
|
||||||
|
title: ''
|
||||||
|
labels: 'summer-of-bitcoin'
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Project ideas are scoped for a university-level student with a basic background in CS and bitcoin
|
||||||
|
fundamentals - achievable over 12-weeks. Below are just a few types of ideas:
|
||||||
|
|
||||||
|
- Low-hanging fruit: Relatively short projects with clear goals; requires basic technical knowledge
|
||||||
|
and minimal familiarity with the codebase.
|
||||||
|
- Core development: These projects derive from the ongoing work from the core of your development
|
||||||
|
team. The list of features and bugs is never-ending, and help is always welcome.
|
||||||
|
- Risky/Exploratory: These projects push the scope boundaries of your development effort. They
|
||||||
|
might require expertise in an area not covered by your current development team. They might take
|
||||||
|
advantage of a new technology. There is a reasonable chance that the project might be less
|
||||||
|
successful, but the potential rewards make it worth the attempt.
|
||||||
|
- Infrastructure/Automation: These projects are the code that your organization uses to get its
|
||||||
|
development work done; for example, projects that improve the automation of releases, regression
|
||||||
|
tests and automated builds. This is a category where a Summer of Bitcoin student can be really
|
||||||
|
helpful, doing work that the development team has been putting off while they focus on core
|
||||||
|
development.
|
||||||
|
- Quality Assurance/Testing: Projects that work on and test your project's software development
|
||||||
|
process. Additionally, projects that involve a thorough test and review of individual PRs.
|
||||||
|
- Fun/Peripheral: These projects might not be related to the current core development focus, but
|
||||||
|
create new innovations and new perspectives for your project.
|
||||||
|
-->
|
||||||
|
|
||||||
|
**Description**
|
||||||
|
<!-- Description: 3-7 sentences describing the project background and tasks to be done. -->
|
||||||
|
|
||||||
|
**Expected Outcomes**
|
||||||
|
<!-- Short bullet list describing what is to be accomplished -->
|
||||||
|
|
||||||
|
**Resources**
|
||||||
|
<!-- 2-3 reading materials for candidate to learn about the repo, project, scope etc -->
|
||||||
|
<!-- Recommended reading such as a developer/contributor guide -->
|
||||||
|
<!-- [Another example a paper citation](https://arxiv.org/pdf/1802.08091.pdf) -->
|
||||||
|
<!-- [Another example an existing issue](https://github.com/opencv/opencv/issues/11013) -->
|
||||||
|
<!-- [An existing related module](https://github.com/opencv/opencv_contrib/tree/master/modules/optflow) -->
|
||||||
|
|
||||||
|
**Skills Required**
|
||||||
|
<!-- 3-4 technical skills that the candidate should know -->
|
||||||
|
<!-- hands on experience with git -->
|
||||||
|
<!-- mastery plus experience coding in C++ -->
|
||||||
|
<!-- basic knowledge in matrix and tensor computations, college course work in cryptography -->
|
||||||
|
<!-- strong mathematical background -->
|
||||||
|
<!-- Bonus - has experience with React Native. Best if you have also worked with OSSFuzz -->
|
||||||
|
|
||||||
|
**Mentor(s)**
|
||||||
|
<!-- names of mentor(s) for this project go here -->
|
||||||
|
|
||||||
|
**Difficulty**
|
||||||
|
<!-- Easy, Medium, Hard -->
|
||||||
|
|
||||||
|
**Competency Test (optional)**
|
||||||
|
<!-- 2-3 technical tasks related to the project idea or repository you’d like a candidate to
|
||||||
|
perform in order to demonstrate competency, good first bugs, warm-up exercises -->
|
||||||
|
<!-- ex. Read the instructions here to get Bitcoin core running on your machine -->
|
||||||
|
<!-- ex. pick an issue labeled as “newcomer” in the repository, and send a merge request to the
|
||||||
|
repository. You can also suggest some other improvement that we did not think of yet, or
|
||||||
|
something that you find interesting or useful -->
|
||||||
|
<!-- ex. fixes for coding style are usually easy to do, and are good issues for first time
|
||||||
|
contributions for those learning how to interact with the project. After you are done with the
|
||||||
|
coding style issue, try making a different contribution. -->
|
||||||
|
<!-- ex. setup a full Debian packaging development environment and learn the basics of Debian
|
||||||
|
packaging. Then identify and package the missing dependencies to package Specter Desktop -->
|
||||||
|
<!-- ex. write a pull parser for CSV files. You'll be judged by the decisions to store the parser
|
||||||
|
state and how flexible it is to wrap this parser in other scenarios. -->
|
||||||
|
<!-- ex. Stretch Goal: Implement some basic metaprogram/app to prove you're very familiar with BDK.
|
||||||
|
Be prepared to make adjustments as we judge your solution. -->
|
||||||
34
.github/pull_request_template.md
vendored
Normal file
34
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
<!-- Describe the purpose of this PR, what's being adding and/or fixed -->
|
||||||
|
|
||||||
|
### Notes to the reviewers
|
||||||
|
|
||||||
|
<!-- 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:
|
||||||
|
|
||||||
|
* [ ] I've signed all my commits
|
||||||
|
* [ ] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
|
||||||
|
* [ ] I ran `cargo fmt` and `cargo clippy` before committing
|
||||||
|
|
||||||
|
#### New Features:
|
||||||
|
|
||||||
|
* [ ] I've added tests for the new feature
|
||||||
|
* [ ] I've added docs for the new feature
|
||||||
|
|
||||||
|
#### Bugfixes:
|
||||||
|
|
||||||
|
* [ ] This pull request breaks the existing API
|
||||||
|
* [ ] I've added tests to reproduce the issue which are now passing
|
||||||
|
* [ ] I'm linking the issue being fixed by this PR
|
||||||
19
.github/workflows/audit.yml
vendored
Normal file
19
.github/workflows/audit.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Audit
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- '**/Cargo.toml'
|
||||||
|
- '**/Cargo.lock'
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * 0' # Once per week
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
security_audit:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions-rs/audit-check@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
61
.github/workflows/cont_integration.yml
vendored
Normal file
61
.github/workflows/cont_integration.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
build-test:
|
||||||
|
name: Build and test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
rust:
|
||||||
|
- version: 1.63.0 # STABLE
|
||||||
|
clippy: true
|
||||||
|
- version: 1.61.0 # MSRV
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Generate cache key
|
||||||
|
run: echo "${{ matrix.rust.version }} ${{ matrix.features }}" | tee .cache_key
|
||||||
|
- name: cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
target
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
|
||||||
|
- name: Set default toolchain
|
||||||
|
run: rustup default ${{ matrix.rust.version }}
|
||||||
|
- name: Set profile
|
||||||
|
run: rustup set profile minimal
|
||||||
|
- name: Add clippy
|
||||||
|
if: ${{ matrix.rust.clippy }}
|
||||||
|
run: rustup component add clippy
|
||||||
|
- name: Update toolchain
|
||||||
|
run: rustup update
|
||||||
|
- name: Build
|
||||||
|
run: cargo build
|
||||||
|
- name: Clippy
|
||||||
|
if: ${{ matrix.rust.clippy }}
|
||||||
|
run: cargo clippy --all-targets -- -D warnings
|
||||||
|
- name: Test
|
||||||
|
run: cargo test
|
||||||
|
|
||||||
|
fmt:
|
||||||
|
name: Rust fmt
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Set default toolchain
|
||||||
|
run: rustup default nightly
|
||||||
|
- name: Set profile
|
||||||
|
run: rustup set profile minimal
|
||||||
|
- name: Add rustfmt
|
||||||
|
run: rustup component add rustfmt
|
||||||
|
- name: Update toolchain
|
||||||
|
run: rustup update
|
||||||
|
- name: Check fmt
|
||||||
|
run: cargo fmt --all -- --config format_code_in_doc_comments=true --check
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -14,3 +14,4 @@ testdb
|
|||||||
xcuserdata
|
xcuserdata
|
||||||
.lsp
|
.lsp
|
||||||
.clj-kondo
|
.clj-kondo
|
||||||
|
.idea/
|
||||||
|
|||||||
83
CHANGELOG.md
83
CHANGELOG.md
@@ -1,13 +1,83 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
All notable changes to this project will be documented in this file.
|
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.
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
## [v0.5.0]
|
## [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
|
||||||
|
- `TxBuilder.add_data(data: Vec<u8>)` [#163]
|
||||||
|
- `Wallet.list_unspent()` returns `Vec<LocalUtxo>` [#158]
|
||||||
|
- Add coin control methods on TxBuilder [#164]
|
||||||
|
|
||||||
|
[#163]: https://github.com/bitcoindevkit/bdk-ffi/pull/163
|
||||||
|
[#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
|
||||||
|
- fixes sqlite-db issue causing wrong balance
|
||||||
|
- adds experimental taproot descriptor and PSBT support
|
||||||
|
- APIs Removed
|
||||||
|
- `Wallet.get_new_address()`, returned String, [#137]
|
||||||
|
- `Wallet.get_last_unused_address()`, returned String [#137]
|
||||||
|
- APIs Added
|
||||||
|
- `Wallet.get_address(AddressIndex)`, returns `AddressInfo` [#137]
|
||||||
|
- APIs Changed
|
||||||
|
- `Wallet.sign(PartiallySignedBitcoinTransaction)` now returns a bool, true if finalized [#161]
|
||||||
|
|
||||||
|
[#137]: https://github.com/bitcoindevkit/bdk-ffi/pull/137
|
||||||
|
[#161]: https://github.com/bitcoindevkit/bdk-ffi/pull/161
|
||||||
|
|
||||||
|
## [v0.6.0]
|
||||||
|
- Update BDK to version 0.18.0
|
||||||
|
- Add BumpFeeTxBuilder to bump the fee on an unconfirmed tx created by the Wallet
|
||||||
|
- Change TxBuilder.build() to TxBuilder.finish() to align with bdk function name
|
||||||
|
|
||||||
|
## [v0.5.0]
|
||||||
- Fix Wallet.broadcast function, now returns a tx id as a hex string
|
- Fix Wallet.broadcast function, now returns a tx id as a hex string
|
||||||
- Remove creating a new spending Transaction via the PartiallySignedBitcoinTransaction constructor
|
- Remove creating a new spending Transaction via the PartiallySignedBitcoinTransaction constructor
|
||||||
- Add TxBuilder for creating new spending PartiallySignedBitcoinTransaction
|
- Add TxBuilder for creating new spending PartiallySignedBitcoinTransaction
|
||||||
@@ -16,17 +86,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Update generate cli tool to generate all binding languages and rename to bdk-ffi-bindgen
|
- Update generate cli tool to generate all binding languages and rename to bdk-ffi-bindgen
|
||||||
|
|
||||||
## [v0.4.0]
|
## [v0.4.0]
|
||||||
|
|
||||||
- Add dual license MIT and Apache 2.0
|
- Add dual license MIT and Apache 2.0
|
||||||
- Add sqlite database support
|
- Add sqlite database support
|
||||||
- Fix memory database configuration enum, remove junk field
|
- Fix memory database configuration enum, remove junk field
|
||||||
|
|
||||||
## [v0.3.1]
|
## [v0.3.1]
|
||||||
|
|
||||||
- Remove hard coded sync progress value (was always returning 21.0)
|
- Remove hard coded sync progress value (was always returning 21.0)
|
||||||
|
|
||||||
## [v0.3.0]
|
## [v0.3.0]
|
||||||
|
|
||||||
- Move bdk-kotlin bindings and ios example to separate repos
|
- Move bdk-kotlin bindings and ios example to separate repos
|
||||||
- Add bin to generate Python bindings
|
- Add bin to generate Python bindings
|
||||||
- Add `PartiallySignedBitcoinTransaction::deserialize` function as named constructor to decode from a string per [BIP 0174]
|
- Add `PartiallySignedBitcoinTransaction::deserialize` function as named constructor to decode from a string per [BIP 0174]
|
||||||
@@ -37,7 +104,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [v0.2.0]
|
## [v0.2.0]
|
||||||
|
|
||||||
[unreleased]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.5.0...HEAD
|
[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
|
||||||
|
[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
|
||||||
[v0.5.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.4.0...v0.5.0
|
[v0.5.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.4.0...v0.5.0
|
||||||
[v0.4.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.3.1...v0.4.0
|
[v0.4.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.3.1...v0.4.0
|
||||||
[v0.3.1]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.3.0...v0.3.1
|
[v0.3.1]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.3.0...v0.3.1
|
||||||
|
|||||||
13
Cargo.toml
13
Cargo.toml
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "bdk-ffi"
|
name = "bdk-ffi"
|
||||||
version = "0.5.0"
|
version = "0.10.0"
|
||||||
authors = ["Steve Myers <steve@notmandatory.org>", "Sudarsan Balaji <sudarsan.balaji@artfuldev.com>"]
|
authors = ["Steve Myers <steve@notmandatory.org>", "Sudarsan Balaji <sudarsan.balaji@artfuldev.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
@@ -14,13 +14,10 @@ crate-type = ["staticlib", "cdylib"]
|
|||||||
name = "bdkffi"
|
name = "bdkffi"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bdk = { version = "0.14", features = ["all-keys", "use-esplora-ureq", "sqlite"] }
|
bdk = { version = "0.23", features = ["all-keys", "use-esplora-ureq", "sqlite-bundled"] }
|
||||||
|
|
||||||
# TODO remove when bdk "sqlite-bundled" feature added
|
uniffi_macros = { version = "0.21.0", features = ["builtin-bindgen"] }
|
||||||
rusqlite = { version = "0.25.3", features = ["bundled"] }
|
uniffi = { version = "0.21.0", features = ["builtin-bindgen"] }
|
||||||
|
|
||||||
uniffi_macros = { version = "0.16.0", features = ["builtin-bindgen"] }
|
|
||||||
uniffi = { version = "0.16.0", features = ["builtin-bindgen"] }
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
uniffi_build = { version = "0.16.0", features = ["builtin-bindgen"] }
|
uniffi_build = { version = "0.21.0", features = ["builtin-bindgen"] }
|
||||||
|
|||||||
35
DEVELOPMENT_CYCLE.md
Normal file
35
DEVELOPMENT_CYCLE.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# 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,5 +1,12 @@
|
|||||||
# Native language bindings for BDK
|
# 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
|
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
|
[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.
|
generating the actual language binding code used to access the `libbdkffi` library.
|
||||||
@@ -35,7 +42,7 @@ cargo run -p bdk-ffi-bindgen -- --help
|
|||||||
|
|
||||||
[bdk-kotlin]: https://github.com/bitcoindevkit/bdk-kotlin
|
[bdk-kotlin]: https://github.com/bitcoindevkit/bdk-kotlin
|
||||||
[bdk-swift]: https://github.com/bitcoindevkit/bdk-swift
|
[bdk-swift]: https://github.com/bitcoindevkit/bdk-swift
|
||||||
[bdk-python]: https://github.com/thunderbiscuit/bdk-python
|
[bdk-python]: https://github.com/bitcoindevkit/bdk-python
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ name = "bdk-ffi-bindgen"
|
|||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
[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"
|
structopt = "0.3"
|
||||||
uniffi_bindgen = "0.16.0"
|
uniffi_bindgen = "0.21.0"
|
||||||
|
camino = "1.0.9"
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
|
use camino::Utf8Path;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::path::PathBuf;
|
use std::path::{Path, PathBuf};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use structopt::StructOpt;
|
use structopt::StructOpt;
|
||||||
use uniffi_bindgen;
|
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
pub enum Language {
|
pub enum Language {
|
||||||
KOTLIN,
|
Kotlin,
|
||||||
PYTHON,
|
Python,
|
||||||
SWIFT,
|
Swift,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for Language {
|
impl fmt::Display for Language {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Language::KOTLIN => write!(f, "kotlin"),
|
Language::Kotlin => write!(f, "kotlin"),
|
||||||
Language::SWIFT => write!(f, "swift"),
|
Language::Swift => write!(f, "swift"),
|
||||||
Language::PYTHON => write!(f, "python"),
|
Language::Python => write!(f, "python"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,20 +36,23 @@ impl FromStr for Language {
|
|||||||
type Err = Error;
|
type Err = Error;
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
match s {
|
match s {
|
||||||
"kotlin" => Ok(Language::KOTLIN),
|
"kotlin" => Ok(Language::Kotlin),
|
||||||
"python" => Ok(Language::PYTHON),
|
"python" => Ok(Language::Python),
|
||||||
"swift" => Ok(Language::SWIFT),
|
"swift" => Ok(Language::Swift),
|
||||||
_ => Err(Error::UnsupportedLanguage),
|
_ => Err(Error::UnsupportedLanguage),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn generate_bindings(opt: &Opt) -> anyhow::Result<(), anyhow::Error> {
|
fn generate_bindings(opt: &Opt) -> anyhow::Result<(), anyhow::Error> {
|
||||||
|
let path: &Utf8Path = Utf8Path::from_path(&opt.udl_file).unwrap();
|
||||||
|
let out_dir: &Utf8Path = Utf8Path::from_path(&opt.out_dir).unwrap();
|
||||||
uniffi_bindgen::generate_bindings(
|
uniffi_bindgen::generate_bindings(
|
||||||
&opt.udl_file,
|
path,
|
||||||
None,
|
None,
|
||||||
vec![opt.language.to_string().as_str()],
|
vec![opt.language.to_string().as_str()],
|
||||||
Some(&opt.out_dir),
|
Some(out_dir),
|
||||||
|
None,
|
||||||
false,
|
false,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
@@ -57,8 +60,8 @@ fn generate_bindings(opt: &Opt) -> anyhow::Result<(), anyhow::Error> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn fixup_python_lib_path(
|
fn fixup_python_lib_path(
|
||||||
out_dir: &PathBuf,
|
out_dir: &Path,
|
||||||
lib_name: &PathBuf,
|
lib_name: &Path,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
@@ -68,10 +71,9 @@ fn fixup_python_lib_path(
|
|||||||
let bindings_file = out_dir.join("bdk.py");
|
let bindings_file = out_dir.join("bdk.py");
|
||||||
let mut data = fs::read_to_string(&bindings_file)?;
|
let mut data = fs::read_to_string(&bindings_file)?;
|
||||||
|
|
||||||
let pos = data.find(LOAD_INDIRECT_DEF).expect(&format!(
|
let pos = data
|
||||||
"loadIndirect not found in `{}`",
|
.find(LOAD_INDIRECT_DEF)
|
||||||
bindings_file.display()
|
.unwrap_or_else(|| panic!("loadIndirect not found in `{}`", bindings_file.display()));
|
||||||
));
|
|
||||||
let range = pos..pos + LOAD_INDIRECT_DEF.len();
|
let range = pos..pos + LOAD_INDIRECT_DEF.len();
|
||||||
|
|
||||||
let replacement = format!(
|
let replacement = format!(
|
||||||
@@ -89,7 +91,7 @@ def _loadIndirectOld():"#,
|
|||||||
.write(true)
|
.write(true)
|
||||||
.truncate(true)
|
.truncate(true)
|
||||||
.open(&bindings_file)?;
|
.open(&bindings_file)?;
|
||||||
file.write(data.as_bytes())?;
|
file.write_all(data.as_bytes())?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -126,7 +128,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
generate_bindings(&opt)?;
|
generate_bindings(&opt)?;
|
||||||
|
|
||||||
if opt.language == Language::PYTHON {
|
if opt.language == Language::Python {
|
||||||
if let Some(path) = opt.python_fixup_path {
|
if let Some(path) = opt.python_fixup_path {
|
||||||
println!("Fixing up python lib path, {:?}", &path);
|
println!("Fixing up python lib path, {:?}", &path);
|
||||||
fixup_python_lib_path(&opt.out_dir, &path)?;
|
fixup_python_lib_path(&opt.out_dir, &path)?;
|
||||||
|
|||||||
225
src/bdk.udl
225
src/bdk.udl
@@ -1,14 +1,13 @@
|
|||||||
namespace bdk {
|
namespace bdk {
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
ExtendedKeyInfo generate_extended_key(Network network, WordCount word_count, string? password);
|
string generate_mnemonic(WordCount word_count);
|
||||||
[Throws=BdkError]
|
|
||||||
ExtendedKeyInfo restore_extended_key(Network network, string mnemonic, string? password);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
[Error]
|
[Error]
|
||||||
enum BdkError {
|
enum BdkError {
|
||||||
"InvalidU32Bytes",
|
"InvalidU32Bytes",
|
||||||
"Generic",
|
"Generic",
|
||||||
|
"MissingCachedScripts",
|
||||||
"ScriptDoesntHaveAddressForm",
|
"ScriptDoesntHaveAddressForm",
|
||||||
"NoRecipients",
|
"NoRecipients",
|
||||||
"NoUtxosSelected",
|
"NoUtxosSelected",
|
||||||
@@ -49,6 +48,16 @@ enum BdkError {
|
|||||||
"Rusqlite",
|
"Rusqlite",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dictionary AddressInfo {
|
||||||
|
u32 index;
|
||||||
|
string address;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum AddressIndex {
|
||||||
|
"New",
|
||||||
|
"LastUnused",
|
||||||
|
};
|
||||||
|
|
||||||
enum Network {
|
enum Network {
|
||||||
"Bitcoin",
|
"Bitcoin",
|
||||||
"Testnet",
|
"Testnet",
|
||||||
@@ -65,6 +74,15 @@ dictionary SqliteDbConfiguration {
|
|||||||
string path;
|
string path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dictionary Balance {
|
||||||
|
u64 immature;
|
||||||
|
u64 trusted_pending;
|
||||||
|
u64 untrusted_pending;
|
||||||
|
u64 confirmed;
|
||||||
|
u64 spendable;
|
||||||
|
u64 total;
|
||||||
|
};
|
||||||
|
|
||||||
[Enum]
|
[Enum]
|
||||||
interface DatabaseConfig {
|
interface DatabaseConfig {
|
||||||
Memory();
|
Memory();
|
||||||
@@ -73,21 +91,24 @@ interface DatabaseConfig {
|
|||||||
};
|
};
|
||||||
|
|
||||||
dictionary TransactionDetails {
|
dictionary TransactionDetails {
|
||||||
u64? fees;
|
u64? fee;
|
||||||
u64 received;
|
u64 received;
|
||||||
u64 sent;
|
u64 sent;
|
||||||
string txid;
|
string txid;
|
||||||
|
BlockTime? confirmation_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary BlockTime {
|
dictionary BlockTime {
|
||||||
u32 height;
|
u32 height;
|
||||||
u64 timestamp;
|
u64 timestamp;
|
||||||
};
|
};
|
||||||
|
|
||||||
[Enum]
|
enum WordCount {
|
||||||
interface Transaction {
|
"Words12",
|
||||||
Unconfirmed(TransactionDetails details);
|
"Words15",
|
||||||
Confirmed(TransactionDetails details, BlockTime confirmation);
|
"Words18",
|
||||||
|
"Words21",
|
||||||
|
"Words24",
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary ElectrumConfig {
|
dictionary ElectrumConfig {
|
||||||
@@ -101,9 +122,9 @@ dictionary ElectrumConfig {
|
|||||||
dictionary EsploraConfig {
|
dictionary EsploraConfig {
|
||||||
string base_url;
|
string base_url;
|
||||||
string? proxy;
|
string? proxy;
|
||||||
u64 timeout_read;
|
u8? concurrency;
|
||||||
u64 timeout_write;
|
|
||||||
u64 stop_gap;
|
u64 stop_gap;
|
||||||
|
u64? timeout;
|
||||||
};
|
};
|
||||||
|
|
||||||
[Enum]
|
[Enum]
|
||||||
@@ -112,54 +133,184 @@ interface BlockchainConfig {
|
|||||||
Esplora(EsploraConfig config);
|
Esplora(EsploraConfig config);
|
||||||
};
|
};
|
||||||
|
|
||||||
callback interface BdkProgress {
|
interface Blockchain {
|
||||||
|
[Throws=BdkError]
|
||||||
|
constructor(BlockchainConfig config);
|
||||||
|
|
||||||
|
[Throws=BdkError]
|
||||||
|
void broadcast([ByRef] PartiallySignedBitcoinTransaction psbt);
|
||||||
|
|
||||||
|
[Throws=BdkError]
|
||||||
|
u32 get_height();
|
||||||
|
|
||||||
|
[Throws=BdkError]
|
||||||
|
string get_block_hash(u32 height);
|
||||||
|
};
|
||||||
|
|
||||||
|
callback interface Progress {
|
||||||
void update(f32 progress, string? message);
|
void update(f32 progress, string? message);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dictionary OutPoint {
|
||||||
|
string txid;
|
||||||
|
u32 vout;
|
||||||
|
};
|
||||||
|
|
||||||
|
dictionary TxOut {
|
||||||
|
u64 value;
|
||||||
|
string address;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum KeychainKind {
|
||||||
|
"External",
|
||||||
|
"Internal",
|
||||||
|
};
|
||||||
|
|
||||||
|
dictionary LocalUtxo {
|
||||||
|
OutPoint outpoint;
|
||||||
|
TxOut txout;
|
||||||
|
KeychainKind keychain;
|
||||||
|
boolean is_spent;
|
||||||
|
};
|
||||||
|
|
||||||
|
dictionary ScriptAmount {
|
||||||
|
Script script;
|
||||||
|
u64 amount;
|
||||||
|
};
|
||||||
|
|
||||||
interface Wallet {
|
interface Wallet {
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
constructor(string descriptor, string? change_descriptor, Network network, DatabaseConfig database_config, BlockchainConfig blockchain_config);
|
constructor(string descriptor, string? change_descriptor, Network network, DatabaseConfig database_config);
|
||||||
string get_new_address();
|
|
||||||
string get_last_unused_address();
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
u64 get_balance();
|
AddressInfo get_address(AddressIndex address_index);
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
void sign([ByRef] PartiallySignedBitcoinTransaction psbt);
|
Balance get_balance();
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
sequence<Transaction> get_transactions();
|
boolean sign([ByRef] PartiallySignedBitcoinTransaction psbt);
|
||||||
Network get_network();
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
void sync(BdkProgress progress_update, u32? max_address_param);
|
sequence<TransactionDetails> list_transactions();
|
||||||
|
|
||||||
|
Network network();
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
string broadcast([ByRef] PartiallySignedBitcoinTransaction psbt);
|
void sync([ByRef] Blockchain blockchain, Progress? progress);
|
||||||
|
|
||||||
|
[Throws=BdkError]
|
||||||
|
sequence<LocalUtxo> list_unspent();
|
||||||
};
|
};
|
||||||
|
|
||||||
interface PartiallySignedBitcoinTransaction {
|
interface PartiallySignedBitcoinTransaction {
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
constructor(string psbt_base64);
|
constructor(string psbt_base64);
|
||||||
|
|
||||||
string serialize();
|
string serialize();
|
||||||
|
|
||||||
|
string txid();
|
||||||
|
|
||||||
|
sequence<u8> extract_tx();
|
||||||
|
|
||||||
|
[Throws=BdkError]
|
||||||
|
PartiallySignedBitcoinTransaction combine(PartiallySignedBitcoinTransaction other);
|
||||||
|
};
|
||||||
|
|
||||||
|
dictionary TxBuilderResult {
|
||||||
|
PartiallySignedBitcoinTransaction psbt;
|
||||||
|
TransactionDetails transaction_details;
|
||||||
};
|
};
|
||||||
|
|
||||||
interface TxBuilder {
|
interface TxBuilder {
|
||||||
constructor();
|
constructor();
|
||||||
TxBuilder add_recipient(string address, u64 amount);
|
|
||||||
|
TxBuilder add_recipient(Script script, u64 amount);
|
||||||
|
|
||||||
|
TxBuilder add_unspendable(OutPoint unspendable);
|
||||||
|
|
||||||
|
TxBuilder add_utxo(OutPoint outpoint);
|
||||||
|
|
||||||
|
TxBuilder add_utxos(sequence<OutPoint> outpoints);
|
||||||
|
|
||||||
|
TxBuilder do_not_spend_change();
|
||||||
|
|
||||||
|
TxBuilder manually_selected_only();
|
||||||
|
|
||||||
|
TxBuilder only_spend_change();
|
||||||
|
|
||||||
|
TxBuilder unspendable(sequence<OutPoint> unspendable);
|
||||||
|
|
||||||
TxBuilder fee_rate(float sat_per_vbyte);
|
TxBuilder fee_rate(float sat_per_vbyte);
|
||||||
|
|
||||||
|
TxBuilder fee_absolute(u64 fee_amount);
|
||||||
|
|
||||||
TxBuilder drain_wallet();
|
TxBuilder drain_wallet();
|
||||||
|
|
||||||
TxBuilder drain_to(string address);
|
TxBuilder drain_to(string address);
|
||||||
|
|
||||||
|
TxBuilder enable_rbf();
|
||||||
|
|
||||||
|
TxBuilder enable_rbf_with_sequence(u32 nsequence);
|
||||||
|
|
||||||
|
TxBuilder add_data(sequence<u8> data);
|
||||||
|
|
||||||
|
TxBuilder set_recipients(sequence<ScriptAmount> recipients);
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
PartiallySignedBitcoinTransaction build([ByRef] Wallet wallet);
|
TxBuilderResult finish([ByRef] Wallet wallet);
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary ExtendedKeyInfo {
|
interface BumpFeeTxBuilder {
|
||||||
string mnemonic;
|
constructor(string txid, float new_fee_rate);
|
||||||
string xprv;
|
|
||||||
string fingerprint;
|
BumpFeeTxBuilder allow_shrinking(string address);
|
||||||
|
|
||||||
|
BumpFeeTxBuilder enable_rbf();
|
||||||
|
|
||||||
|
BumpFeeTxBuilder enable_rbf_with_sequence(u32 nsequence);
|
||||||
|
|
||||||
|
[Throws=BdkError]
|
||||||
|
PartiallySignedBitcoinTransaction finish([ByRef] Wallet wallet);
|
||||||
};
|
};
|
||||||
|
|
||||||
enum WordCount {
|
interface DerivationPath {
|
||||||
"Words12",
|
[Throws=BdkError]
|
||||||
"Words15",
|
constructor(string path);
|
||||||
"Words18",
|
};
|
||||||
"Words21",
|
|
||||||
"Words24",
|
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);
|
||||||
};
|
};
|
||||||
|
|||||||
1237
src/lib.rs
1237
src/lib.rs
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user