Compare commits
7 Commits
v0.29.0
...
release/0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
790d08c4c9 | ||
|
|
ffd5a96ee0 | ||
|
|
fd02fc2a02 | ||
|
|
5c560c6013 | ||
|
|
9d1b2de29b | ||
|
|
3e3c0bf22f | ||
|
|
9b919e5ceb |
17
.github/ISSUE_TEMPLATE/enhancement_request.md
vendored
17
.github/ISSUE_TEMPLATE/enhancement_request.md
vendored
@@ -1,17 +0,0 @@
|
|||||||
---
|
|
||||||
name: Enhancement request
|
|
||||||
about: Request a new feature or change to an existing feature
|
|
||||||
title: ''
|
|
||||||
labels: 'enhancement'
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Describe the enhancement**
|
|
||||||
<!-- A clear and concise description of what you would like added or changed. -->
|
|
||||||
|
|
||||||
**Use case**
|
|
||||||
<!-- Tell us how you or others will use this new feature or change to an existing feature. -->
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
<!-- Add any other context about the enhancement here. -->
|
|
||||||
128
.github/ISSUE_TEMPLATE/minor_release.md
vendored
128
.github/ISSUE_TEMPLATE/minor_release.md
vendored
@@ -7,79 +7,77 @@ assignees: ''
|
|||||||
---
|
---
|
||||||
|
|
||||||
## Create a new minor release
|
## Create a new minor release
|
||||||
## Bumping BDK Rust Version
|
### _Main Workflow_
|
||||||
1. - [ ] Open a PR with an update to `Cargo.toml` to the new bdk release candidate and ensure all CI workflows run correctly. Fix errors if necessary.
|
1. - [ ] Open a PR with an update to `Cargo.toml` to the new bdk release candidate and ensure all CI workflows run correctly. Fix errors if necessary.
|
||||||
2. - [ ] Once the new bdk release is out, update the PR to replace the release candidate with the full release and merge.
|
2. - [ ] Once the new bdk release is out, update the PR to replace the release candidate with the full release and merge.
|
||||||
|
3. - [ ] Update the Android, JVM, Python, and Swift libraries as per the ["**_Sub-Workflows_**" section below](#Sub-Workflows). Open a single PR on master for all of these changes called `Prepare language bindings libraries for 0.X release`
|
||||||
### Specific Libraries' Workflows
|
18. - [ ] Create a new branch off of `master` called `release/version`
|
||||||
#### _Android_
|
19. - [ ] Checkout that branch and open a PR to update the Android, JVM, and Python libraries' versions
|
||||||
3. - [ ] Update the API docs to reflect the changes in the API
|
- [ ] Update bdk-android version from `SNAPSHOT` version to release version
|
||||||
4. - [ ] Delete the `target` directory in bdk-ffi and all previous artifacts to make sure you're building the library from scratch.
|
- [ ] Update bdk-jvm version from `SNAPSHOT` version to release version
|
||||||
5. - [ ] Build the library and run the tests, and adjust if necessary.
|
- [ ] Update bdk-python version from `.dev` version to release version
|
||||||
```sh
|
20. - [ ] Merge the PR updating all of the languages to their release versions
|
||||||
# start an emulator prior to running the tests
|
21. - [ ] Create the tag and make sure to add the changelog info to the tag (works better if you prepare the tag message on the side in a text editor) and push it to GitHub.
|
||||||
cd ./bdk-android/
|
|
||||||
./gradlew buildAndroidLib
|
|
||||||
./gradlew connectedAndroidTest
|
|
||||||
```
|
|
||||||
6. - [ ] Update the readme if necessary
|
|
||||||
#### _JVM_
|
|
||||||
7. - [ ] Update the API docs to reflect the changes in the API
|
|
||||||
8. - [ ] Delete the `target` directory in bdk-ffi and all previous artifacts to make sure you're building the library from scratch
|
|
||||||
9. - [ ] Build the library and run the tests, and adjust if necessary
|
|
||||||
```sh
|
|
||||||
cd ./bdk-jvm/
|
|
||||||
./gradlew buildJvmLib
|
|
||||||
./gradlew test
|
|
||||||
```
|
|
||||||
10. - [ ] Update the readme if necessary
|
|
||||||
#### _Swift_
|
|
||||||
11. - [ ] Run the tests and adjust if necessary
|
|
||||||
```sh
|
|
||||||
./bdk-swift/build-local-swift.sh
|
|
||||||
cd ./bdk-swift/
|
|
||||||
swift test
|
|
||||||
```
|
|
||||||
12. - [ ] Update the readme if necessary
|
|
||||||
#### _Python_
|
|
||||||
13. - [ ] Delete the `.tox`, `dist`, `build`, and `bdkpython.egg-info` and rust `target` directories to make sure you are building the library from scratch without any caches
|
|
||||||
14. - [ ] Build the library
|
|
||||||
```shell
|
|
||||||
cd ./bdk-python/
|
|
||||||
pip3 install --requirement requirements.txt
|
|
||||||
bash ./generate.sh
|
|
||||||
python3 setup.py --verbose bdist_wheel
|
|
||||||
```
|
|
||||||
15. - [ ] Run the tests and adjust if necessary
|
|
||||||
```shell
|
|
||||||
pip3 install ./dist/bdkpython-<yourversion>-py3-none-any.whl --force-reinstall
|
|
||||||
python -m unittest --verbose tests/test_bdk.py
|
|
||||||
```
|
|
||||||
16. - [ ] Update the readme and `setup.py` if necessary
|
|
||||||
|
|
||||||
### Release Workflow
|
|
||||||
17. - [ ] Update the Android, JVM, Python, and Swift libraries as per the _Specific Libraries' Workflows_ section above. Open a single PR on master for all of these changes called `Prepare language bindings libraries for 0.X release`. See [example PR here](https://github.com/bitcoindevkit/bdk-ffi/pull/315).
|
|
||||||
- [ ] Create a new branch off of `master` called `release/version`
|
|
||||||
18. - [ ] Open a PR to that branch to update the Android, JVM, and Python libraries' versions. See [example PR here](https://github.com/bitcoindevkit/bdk-ffi/pull/316).
|
|
||||||
- [ ] Update bdk-android version from `SNAPSHOT` version to release version
|
|
||||||
- [ ] Update bdk-jvm version from `SNAPSHOT` version to release version
|
|
||||||
- [ ] Update bdk-python version from `.dev` version to release version
|
|
||||||
19. - [ ] Merge the PR updating all the languages to their release versions
|
|
||||||
20. - [ ] Create the tag and make sure to add the changelog info to the tag (works better if you prepare the tag message on the side in a text editor) and push it to GitHub.
|
|
||||||
```sh
|
```sh
|
||||||
git tag v0.6.0 --sign --edit
|
git tag v0.6.0 --sign --edit
|
||||||
git push upstream v0.6.0
|
git push upstream v0.6.0
|
||||||
```
|
```
|
||||||
21. - [ ] Aggregate all the changelog notices from the PRs and add them to the changelog file
|
22. - [ ] Make release on GitHub (set as pre-release and generate auto release notes between the previous tag and the new one)
|
||||||
22. - [ ] Open a PR on master with the changes to the changelog file and the development versions bump. See [example PR here](https://github.com/bitcoindevkit/bdk-ffi/pull/317).
|
23. - [ ] Trigger manual releases for all 4 libraries (for Swift, simply add the version number in the text field when running the workflow manually. Note that the version number must not contain the `v`, i.e. `0.26.0`)
|
||||||
23. - [ ] Make release on GitHub (set as pre-release and generate auto release notes between the previous tag and the new one)
|
24. - [ ] Bump the versions on master from `0.9.0-SNAPSHOT` to `0.10.0-SNAPSHOT`, `0.6.0.dev0` to `0.7.0.dev0`
|
||||||
24. - [ ] Trigger manual releases for all 4 libraries (for Swift, simply add the version number in the text field when running the workflow manually. Note that the version number must not contain the `v`, i.e. `0.26.0`)
|
25. - [ ] Build and publish API docs for JVM, Android, and Java on the website
|
||||||
25. - [ ] Bump the versions on master from `0.9.0-SNAPSHOT` to `0.10.0-SNAPSHOT`, `0.6.0.dev0` to `0.7.0.dev0`
|
|
||||||
26. - [ ] Build and publish API docs for JVM, Android, and Java on the website
|
|
||||||
```bash!
|
```bash!
|
||||||
./gradlew dokkaHtml # bdk-jvm (Dokka)
|
./gradlew dokkaHtml # bdk-jvm (Dokka)
|
||||||
./gradlew dokkaJavadoc # bdk-jvm (java-style documentation)
|
./gradlew dokkaJavadoc # bdk-jvm (java-style documentation)
|
||||||
./gradlew dokkaHtml # bdk-android (Dokka)
|
./gradlew dokkaHtml # bdk-android (Dokka)
|
||||||
```
|
```
|
||||||
27. - [ ] Tweet about the library
|
26. - [ ] Tweet about the library
|
||||||
28. - [ ] Post in the announcement channel
|
27. - [ ] Post in the announcement channel
|
||||||
|
|
||||||
|
### _Sub Workflows_
|
||||||
|
#### _Android_
|
||||||
|
4. - [ ] Update the API docs to reflect the changes in the API
|
||||||
|
5. - [ ] Delete the `target` directory in bdk-ffi and all previous artifacts to make sure you're building the library from scratch
|
||||||
|
6. - [ ] Build the library and run the tests, and adjust if necessary.
|
||||||
|
```sh
|
||||||
|
# start an emulator prior to running the tests
|
||||||
|
cd bdk-android
|
||||||
|
./gradlew buildAndroidLib
|
||||||
|
./gradlew connectedAndroidTest
|
||||||
|
```
|
||||||
|
7. - [ ] Update the readme if necessary
|
||||||
|
|
||||||
|
#### _JVM_
|
||||||
|
8. - [ ] Update the API docs to reflect the changes in the API
|
||||||
|
9. - [ ] Delete the `target` directory in bdk-ffi and all previous artifacts to make sure you're building the library from scratch
|
||||||
|
10. - [ ] Build the library and run the tests, and adjust if necessary
|
||||||
|
```sh
|
||||||
|
cd bdk-jvm
|
||||||
|
./gradlew buildJvmLib
|
||||||
|
./gradlew test
|
||||||
|
```
|
||||||
|
11. - [ ] Update the readme if necessary
|
||||||
|
|
||||||
|
#### _Swift_
|
||||||
|
12. - [ ] Run the tests and adjust if necessary
|
||||||
|
```sh
|
||||||
|
./bdk-swift/build-local-swift.sh
|
||||||
|
cd bdk-swift
|
||||||
|
swift test
|
||||||
|
```
|
||||||
|
13. - [ ] Update the readme if necessary
|
||||||
|
|
||||||
|
#### _Python_
|
||||||
|
14. - [ ] Delete the `.tox`, `dist`, `build`, and `bdkpython.egg-info` and rust `target` directories to make sure you are building the library from scratch without any caches
|
||||||
|
15. - [ ] Build the library
|
||||||
|
```shell
|
||||||
|
pip3 install --requirement requirements.txt
|
||||||
|
bash ./generate.sh
|
||||||
|
python3 setup.py --verbose bdist_wheel
|
||||||
|
```
|
||||||
|
16. - [ ] Run the tests and adjust if necessary
|
||||||
|
```shell
|
||||||
|
pip3 install ./dist/bdkpython-<yourversion>-py3-none-any.whl
|
||||||
|
python -m unittest --verbose tests/test_bdk.py
|
||||||
|
```
|
||||||
|
17. - [ ] Update the readme and `setup.py` if necessary
|
||||||
|
|||||||
27
.github/ISSUE_TEMPLATE/patch_release.md
vendored
27
.github/ISSUE_TEMPLATE/patch_release.md
vendored
@@ -7,6 +7,7 @@ assignees: ''
|
|||||||
---
|
---
|
||||||
|
|
||||||
# Creating a new patch release
|
# Creating a new patch release
|
||||||
|
|
||||||
## Bumping BDK Rust Version
|
## Bumping BDK Rust Version
|
||||||
1. - [ ] Open a PR with an update to `Cargo.toml` to the new bdk release candidate and ensure all CI workflows run correctly. Fix errors if necessary.
|
1. - [ ] Open a PR with an update to `Cargo.toml` to the new bdk release candidate and ensure all CI workflows run correctly. Fix errors if necessary.
|
||||||
2. - [ ] Once the new bdk release is out, update the PR to replace the release candidate with the full release and merge.
|
2. - [ ] Once the new bdk release is out, update the PR to replace the release candidate with the full release and merge.
|
||||||
@@ -58,28 +59,26 @@ python -m unittest --verbose tests/test_bdk.py
|
|||||||
16. - [ ] Update the readme and `setup.py` if necessary
|
16. - [ ] Update the readme and `setup.py` if necessary
|
||||||
|
|
||||||
### Release Workflow
|
### Release Workflow
|
||||||
17. - [ ] Update the Android, JVM, Python, and Swift libraries as per the _Specific Libraries' Workflows_ section above. Open a single PR on master for all of these changes called `Prepare language bindings libraries for 0.X release`. See [example PR here](https://github.com/bitcoindevkit/bdk-ffi/pull/315).
|
17. - [ ] Update the Android, JVM, Python, and Swift libraries as per the _Specific Libraries' Workflows_ section above. Open a single PR on master for all of these changes called `Prepare language bindings libraries for 0.X release`
|
||||||
- [ ] Create a new branch off of `master` called `release/version`
|
- [ ] Create a new branch off of `master` called `release/version`
|
||||||
18. - [ ] Open a PR to that branch to update the Android, JVM, and Python libraries' versions. See [example PR here](https://github.com/bitcoindevkit/bdk-ffi/pull/316).
|
18. - [ ] Checkout that branch and open a PR to update the Android, JVM, and Python libraries' versions
|
||||||
- [ ] Update bdk-android version from `SNAPSHOT` version to release version
|
- [ ] Update bdk-android version from `SNAPSHOT` version to release version
|
||||||
- [ ] Update bdk-jvm version from `SNAPSHOT` version to release version
|
- [ ] Update bdk-jvm version from `SNAPSHOT` version to release version
|
||||||
- [ ] Update bdk-python version from `.dev` version to release version
|
- [ ] Update bdk-python version from `.dev` version to release version
|
||||||
19. - [ ] Merge the PR updating all the languages to their release versions
|
19. - [ ] Merge the PR updating all of the languages to their release versions
|
||||||
20. - [ ] Create the tag and make sure to add the changelog info to the tag (works better if you prepare the tag message on the side in a text editor) and push it to GitHub.
|
20. - [ ] Create the tag and make sure to add the changelog info to the tag (works better if you prepare the tag message on the side in a text editor) and push it to GitHub.
|
||||||
```sh
|
```sh
|
||||||
git tag v0.6.0 --sign --edit
|
git tag v0.6.0 --sign --edit
|
||||||
git push upstream v0.6.0
|
git push upstream v0.6.0
|
||||||
```
|
```
|
||||||
21. - [ ] Aggregate all the changelog notices from the PRs and add them to the changelog file
|
21. - [ ] Make release on GitHub (set as pre-release and generate auto release notes between the previous tag and the new one)
|
||||||
22. - [ ] Open a PR on master with the changes to the changelog file and the development versions bump. See [example PR here](https://github.com/bitcoindevkit/bdk-ffi/pull/317).
|
22. - [ ] Trigger manual releases for all 4 libraries (for Swift, simply add the version number in the text field when running the workflow manually. Note that the version number must not contain the `v`, i.e. `0.26.0`)
|
||||||
23. - [ ] Make release on GitHub (set as pre-release and generate auto release notes between the previous tag and the new one)
|
23. - [ ] Bump the versions on master from `0.9.0-SNAPSHOT` to `0.10.0-SNAPSHOT`, `0.6.0.dev0` to `0.7.0.dev0`
|
||||||
24. - [ ] Trigger manual releases for all 4 libraries (for Swift, simply add the version number in the text field when running the workflow manually. Note that the version number must not contain the `v`, i.e. `0.26.0`)
|
24. - [ ] Build and publish API docs for JVM, Android, and Java on the website
|
||||||
25. - [ ] Bump the versions on master from `0.9.0-SNAPSHOT` to `0.10.0-SNAPSHOT`, `0.6.0.dev0` to `0.7.0.dev0`
|
|
||||||
26. - [ ] Build and publish API docs for JVM, Android, and Java on the website
|
|
||||||
```bash!
|
```bash!
|
||||||
./gradlew dokkaHtml # bdk-jvm (Dokka)
|
./gradlew dokkaHtml # bdk-jvm (Dokka)
|
||||||
./gradlew dokkaJavadoc # bdk-jvm (java-style documentation)
|
./gradlew dokkaJavadoc # bdk-jvm (java-style documentation)
|
||||||
./gradlew dokkaHtml # bdk-android (Dokka)
|
./gradlew dokkaHtml # bdk-android (Dokka)
|
||||||
```
|
```
|
||||||
27. - [ ] Tweet about the library
|
25. - [ ] Tweet about the library
|
||||||
28. - [ ] Post in the announcement channel
|
26. - [ ] Post in the announcement channel
|
||||||
|
|||||||
6
.github/workflows/publish-python.yaml
vendored
6
.github/workflows/publish-python.yaml
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: "Install requirements"
|
- name: "Install requirements"
|
||||||
run: ${PYBIN}/pip install -r requirements.txt
|
run: ${PYBIN}/pip install -r requirements.txt
|
||||||
|
|
||||||
- name: "Generate bdk.py and binaries"
|
- name: "Generate bdk.py"
|
||||||
run: bash generate.sh
|
run: bash generate.sh
|
||||||
|
|
||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
@@ -73,7 +73,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: "Generate bdk.py and binaries"
|
- name: "Generate bdk.py"
|
||||||
run: |
|
run: |
|
||||||
python3 --version
|
python3 --version
|
||||||
rustup target add aarch64-apple-darwin
|
rustup target add aarch64-apple-darwin
|
||||||
@@ -113,7 +113,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: "Generate bdk.py and binaries"
|
- name: "Generate bdk.py"
|
||||||
run: |
|
run: |
|
||||||
python --version
|
python --version
|
||||||
pip install --user -r requirements.txt
|
pip install --user -r requirements.txt
|
||||||
|
|||||||
18
.github/workflows/test-python.yaml
vendored
18
.github/workflows/test-python.yaml
vendored
@@ -48,19 +48,19 @@ jobs:
|
|||||||
- name: "Install requirements"
|
- name: "Install requirements"
|
||||||
run: ${PYBIN}/pip install -r requirements.txt
|
run: ${PYBIN}/pip install -r requirements.txt
|
||||||
|
|
||||||
- name: "Generate bdk.py and binaries"
|
- name: "Generate bdk.py"
|
||||||
run: bash generate.sh
|
run: bash generate.sh
|
||||||
|
|
||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
run: ${PYBIN}/python setup.py bdist_wheel --verbose
|
||||||
# see issue #350 for more information
|
|
||||||
run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_17_x86_64 --verbose
|
|
||||||
|
|
||||||
- name: "Install wheel"
|
- name: "Install wheel"
|
||||||
run: ${PYBIN}/pip install ./dist/*.whl
|
run: ${PYBIN}/pip install ./dist/*.whl
|
||||||
|
|
||||||
- name: "Run tests"
|
- name: "Run tests"
|
||||||
run: ${PYBIN}/python -m unittest tests/test_bdk.py --verbose
|
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
||||||
|
# see issue #350 for more information
|
||||||
|
run: ${PYBIN}/python -m unittest tests/test_bdk.py --plat-name manylinux_2_17_x86_64 --verbose
|
||||||
|
|
||||||
- name: "Upload artifact test"
|
- name: "Upload artifact test"
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
@@ -77,9 +77,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python:
|
python:
|
||||||
# 3.8 returns an error for the macos-12 image when we try to install the wheel:
|
- "3.8"
|
||||||
# bdkpython-0.28.0.dev0-cp38-cp38-macosx_12_0_universal2.whl is not a supported wheel on this platform.
|
|
||||||
# - "3.8"
|
|
||||||
- "3.9"
|
- "3.9"
|
||||||
- "3.10"
|
- "3.10"
|
||||||
steps:
|
steps:
|
||||||
@@ -91,7 +89,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: "Generate bdk.py and binaries"
|
- name: "Generate bdk.py"
|
||||||
run: |
|
run: |
|
||||||
python3 --version
|
python3 --version
|
||||||
rustup target add aarch64-apple-darwin
|
rustup target add aarch64-apple-darwin
|
||||||
@@ -101,7 +99,7 @@ jobs:
|
|||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
env:
|
env:
|
||||||
ARCHFLAGS: "-arch x86_64 -arch arm64"
|
ARCHFLAGS: "-arch x86_64 -arch arm64"
|
||||||
run: python3 setup.py bdist_wheel --plat-name macosx_12_0_universal2 --verbose
|
run: python3 setup.py bdist_wheel --verbose
|
||||||
|
|
||||||
- name: "Install wheel"
|
- name: "Install wheel"
|
||||||
run: pip3 install ./dist/*.whl
|
run: pip3 install ./dist/*.whl
|
||||||
|
|||||||
2
.github/workflows/test-swift.yaml
vendored
2
.github/workflows/test-swift.yaml
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
- name: Build bdk-ffi for aarch64-apple-darwin
|
- name: Build bdk-ffi for aarch64-apple-darwin
|
||||||
run: cargo build --package bdk-ffi --profile release-smaller --target aarch64-apple-darwin
|
run: cargo build --package bdk-ffi --profile release-smaller --target aarch64-apple-darwin
|
||||||
|
|
||||||
- name: Create lipo-macos
|
- name: Create lipo-ios-sim and lipo-macos
|
||||||
run: |
|
run: |
|
||||||
mkdir -p target/lipo-macos/release-smaller
|
mkdir -p target/lipo-macos/release-smaller
|
||||||
lipo target/aarch64-apple-darwin/release-smaller/libbdkffi.a target/x86_64-apple-darwin/release-smaller/libbdkffi.a -create -output target/lipo-macos/release-smaller/libbdkffi.a
|
lipo target/aarch64-apple-darwin/release-smaller/libbdkffi.a target/x86_64-apple-darwin/release-smaller/libbdkffi.a -create -output target/lipo-macos/release-smaller/libbdkffi.a
|
||||||
|
|||||||
40
CHANGELOG.md
40
CHANGELOG.md
@@ -1,31 +1,14 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
Changelog information can also be found in each release's git tag (which can be viewed with `git tag -ln100 "v*"`), as well as 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 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).
|
||||||
|
|
||||||
## [v0.28.0]
|
|
||||||
- Update BDK to version 0.28.0 [#341]
|
|
||||||
- Drop support of pypy releases of Python libraries [#351]
|
|
||||||
- Drop support for Python 3.6 and 3.7 [#351]
|
|
||||||
- Drop support for very old Linux versions that do not support the manylinux_2_17_x86_64 platform tag [#351]
|
|
||||||
- APIs changed:
|
|
||||||
- Expose Address payload and network properties. [#325]
|
|
||||||
- Add SignOptions to Wallet.sign() params. [#326]
|
|
||||||
- address field on `AddressInfo` type is now of type `Address` [#333]
|
|
||||||
- new PartiallySignedTransaction.json_serialize() function to get JSON serialized value of all PSBT fields. [#334]
|
|
||||||
- Add from_script constructor to `Address` type [#337]
|
|
||||||
|
|
||||||
[#325]: https://github.com/bitcoindevkit/bdk-ffi/pull/325
|
|
||||||
[#326]: https://github.com/bitcoindevkit/bdk-ffi/pull/326
|
|
||||||
[#333]: https://github.com/bitcoindevkit/bdk-ffi/pull/333
|
|
||||||
[#334]: https://github.com/bitcoindevkit/bdk-ffi/pull/334
|
|
||||||
[#337]: https://github.com/bitcoindevkit/bdk-ffi/pull/337
|
|
||||||
[#341]: https://github.com/bitcoindevkit/bdk-ffi/pull/341
|
|
||||||
[#351]: https://github.com/bitcoindevkit/bdk-ffi/pull/351
|
|
||||||
|
|
||||||
## [v0.27.1]
|
## [v0.27.1]
|
||||||
- Update BDK to version 0.27.1 [#312]
|
- Update BDK to latest version 0.27.1 [#312]
|
||||||
- APIs changed
|
- APIs changed
|
||||||
- `PartiallySignedTransaction.extract_tx()` returns a `Transaction` instead of the transaction bytes. [#296]
|
- `PartiallySignedTransaction.extract_tx()` returns a `Transaction` instead of the transaction bytes. [#296]
|
||||||
- `Blockchain.broadcast()` takes a `Transaction` instead of a `PartiallySignedTransaction`. [#296]
|
- `Blockchain.broadcast()` takes a `Transaction` instead of a `PartiallySignedTransaction`. [#296]
|
||||||
@@ -40,7 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
[#312]: https://github.com/bitcoindevkit/bdk-ffi/pull/312
|
[#312]: https://github.com/bitcoindevkit/bdk-ffi/pull/312
|
||||||
|
|
||||||
## [v0.26.0]
|
## [v0.26.0]
|
||||||
- Update BDK to version 0.26.0 [#288]
|
- Update BDK to latest version 0.26.0 [#288]
|
||||||
- APIs changed
|
- APIs changed
|
||||||
- The descriptor and change_descriptor arguments on the wallet constructor now take a `Descriptor` instead of a `String`. [#260]
|
- The descriptor and change_descriptor arguments on the wallet constructor now take a `Descriptor` instead of a `String`. [#260]
|
||||||
- TxBuilder.drain_to() argument is now `Script` instead of address `String`. [#279]
|
- TxBuilder.drain_to() argument is now `Script` instead of address `String`. [#279]
|
||||||
@@ -63,7 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
[#288]: https://github.com/bitcoindevkit/bdk-ffi/pull/288
|
[#288]: https://github.com/bitcoindevkit/bdk-ffi/pull/288
|
||||||
|
|
||||||
## [v0.25.0]
|
## [v0.25.0]
|
||||||
- Update BDK to version 0.25.0 [#272]
|
- Update BDK to latest version 0.25.0 [#272]
|
||||||
- APIs Added:
|
- APIs Added:
|
||||||
- from_string() constructors now available on DescriptorSecretKey and DescriptorPublicKey [#247]
|
- from_string() constructors now available on DescriptorSecretKey and DescriptorPublicKey [#247]
|
||||||
|
|
||||||
@@ -71,7 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
[#272]: https://github.com/bitcoindevkit/bdk-ffi/pull/272
|
[#272]: https://github.com/bitcoindevkit/bdk-ffi/pull/272
|
||||||
|
|
||||||
## [v0.11.0]
|
## [v0.11.0]
|
||||||
- Update BDK to version 0.24.0 [#221]
|
- Update BDK to latest version 0.24.0 [#221]
|
||||||
- APIs changed
|
- APIs changed
|
||||||
- The constructor on the DescriptorSecretKey type now takes a Mnemonic instead of a String.
|
- The constructor on the DescriptorSecretKey type now takes a Mnemonic instead of a String.
|
||||||
- APIs added
|
- APIs added
|
||||||
@@ -87,7 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
[#221]: https://github.com/bitcoindevkit/bdk-ffi/pull/221
|
[#221]: https://github.com/bitcoindevkit/bdk-ffi/pull/221
|
||||||
|
|
||||||
## [v0.10.0]
|
## [v0.10.0]
|
||||||
- Update BDK to version 0.23.0 [#204]
|
- Update BDK to latest version 0.23.0 [#204]
|
||||||
- Update uniffi-rs to latest version 0.21.0 [#216]
|
- Update uniffi-rs to latest version 0.21.0 [#216]
|
||||||
- Breaking Changes
|
- Breaking Changes
|
||||||
- Changed `TxBuilder.finish()` to return new `TxBuilderResult` [#209]
|
- Changed `TxBuilder.finish()` to return new `TxBuilderResult` [#209]
|
||||||
@@ -120,7 +103,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- APIs Added [#154]
|
- APIs Added [#154]
|
||||||
- `generate_mnemonic()`, returns string mnemonic
|
- `generate_mnemonic()`, returns string mnemonic
|
||||||
- `interface DescriptorSecretKey`
|
- `interface DescriptorSecretKey`
|
||||||
- `new(Network, string_mnenoinc, password)`, constructs DescriptorSecretKey
|
- `new(Network, string_mnenoinc, password)`, contructs DescriptorSecretKey
|
||||||
- `derive(DerivationPath)`, derives and returns child DescriptorSecretKey
|
- `derive(DerivationPath)`, derives and returns child DescriptorSecretKey
|
||||||
- `extend(DerivationPath)`, extends and returns DescriptorSecretKey
|
- `extend(DerivationPath)`, extends and returns DescriptorSecretKey
|
||||||
- `as_public()`, returns DescriptorSecretKey as DescriptorPublicKey
|
- `as_public()`, returns DescriptorSecretKey as DescriptorPublicKey
|
||||||
@@ -200,7 +183,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
[BIP 0174]:https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#encoding
|
[BIP 0174]:https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#encoding
|
||||||
|
|
||||||
[v0.28.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.27.1...v0.28.0
|
## [v0.2.0]
|
||||||
|
|
||||||
[v0.27.1]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.26.0...v0.27.1
|
[v0.27.1]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.26.0...v0.27.1
|
||||||
[v0.26.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.25.0...v0.26.0
|
[v0.26.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.25.0...v0.26.0
|
||||||
[v0.25.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.11.0...v0.25.0
|
[v0.25.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.11.0...v0.25.0
|
||||||
|
|||||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -147,7 +147,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bdk-ffi"
|
name = "bdk-ffi"
|
||||||
version = "0.29.0"
|
version = "0.28.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"assert_matches",
|
"assert_matches",
|
||||||
"bdk",
|
"bdk",
|
||||||
|
|||||||
@@ -489,9 +489,6 @@ class Wallet(
|
|||||||
*/
|
*/
|
||||||
fun getInternalAddress(addressIndex: AddressIndex): AddressInfo {}
|
fun getInternalAddress(addressIndex: AddressIndex): AddressInfo {}
|
||||||
|
|
||||||
/** Return whether or not a script is part of this wallet (either internal or external). */
|
|
||||||
fun isMine(script: Script): Boolean {}
|
|
||||||
|
|
||||||
/** Return the wallet's balance, across different categories. See [Balance] for the categories. Note that this method only operates on the internal database, which first needs to be [Wallet.sync] manually. */
|
/** Return the wallet's balance, across different categories. See [Balance] for the categories. Note that this method only operates on the internal database, which first needs to be [Wallet.sync] manually. */
|
||||||
fun getBalance(): Balance {}
|
fun getBalance(): Balance {}
|
||||||
|
|
||||||
@@ -829,10 +826,7 @@ data class TxBuilderResult (
|
|||||||
/**
|
/**
|
||||||
* A bitcoin script.
|
* A bitcoin script.
|
||||||
*/
|
*/
|
||||||
class Script(rawOutputScript: List<UByte>) {
|
class Script(rawOutputScript: List<UByte>)
|
||||||
/** Return the script as bytes. */
|
|
||||||
fun toBytes(): List<UByte> {}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A bitcoin address.
|
* A bitcoin address.
|
||||||
|
|||||||
@@ -54,23 +54,19 @@ _Note that Kotlin version `1.6.10` or later is required to build the library._
|
|||||||
```shell
|
```shell
|
||||||
git clone https://github.com/bitcoindevkit/bdk-ffi
|
git clone https://github.com/bitcoindevkit/bdk-ffi
|
||||||
```
|
```
|
||||||
2. Follow the "General" bdk-ffi ["Getting Started (Developer)"] instructions.
|
2. Follow the "General" bdk-ffi ["Getting Started (Developer)"] instructions.
|
||||||
3. Install Rust (note that we are currently building using Rust 1.67.0):
|
3. If building on macOS install required intel and m1 jvm targets
|
||||||
```shell
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
||||||
rustup default 1.67.0
|
|
||||||
```
|
|
||||||
4. Install required targets
|
4. Install required targets
|
||||||
```sh
|
```sh
|
||||||
rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi
|
rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi
|
||||||
```
|
```
|
||||||
5. Install Android SDK and Build-Tools for API level 30+
|
5. Install Android SDK and Build-Tools for API level 30+
|
||||||
6. Setup `$ANDROID_SDK_ROOT` and `$ANDROID_NDK_ROOT` path variables (which are required by the
|
6. Setup `$ANDROID_SDK_ROOT` and `$ANDROID_NDK_ROOT` path variables (which are required by the
|
||||||
build tool), for example (note that currently, NDK version 21.4.7075529 is required):
|
build tool), for example (NDK major version 21 is required):
|
||||||
```shell
|
```shell
|
||||||
export ANDROID_SDK_ROOT=~/Android/Sdk
|
export ANDROID_SDK_ROOT=~/Android/Sdk
|
||||||
export ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/21.4.7075529
|
export ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/21.<NDK_VERSION>
|
||||||
```
|
```
|
||||||
7. Build kotlin bindings
|
7. Build kotlin bindings
|
||||||
```sh
|
```sh
|
||||||
# build Android library
|
# build Android library
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ org.gradle.jvmargs=-Xmx1536m
|
|||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
libraryVersion=0.29.0
|
libraryVersion=0.28.0
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "bdk-ffi"
|
name = "bdk-ffi"
|
||||||
version = "0.29.0"
|
version = "0.28.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"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["lib", "staticlib", "cdylib"]
|
crate-type = ["lib", "staticlib", "cdylib"]
|
||||||
|
#crate-type = ["staticlib", "cdylib"]
|
||||||
|
#crate-type = ["cdylib"]
|
||||||
name = "bdkffi"
|
name = "bdkffi"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|||||||
@@ -221,31 +221,28 @@ interface Wallet {
|
|||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
constructor(Descriptor descriptor, Descriptor? change_descriptor, Network network, DatabaseConfig database_config);
|
constructor(Descriptor descriptor, Descriptor? change_descriptor, Network network, DatabaseConfig database_config);
|
||||||
|
|
||||||
Network network();
|
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
AddressInfo get_address(AddressIndex address_index);
|
AddressInfo get_address(AddressIndex address_index);
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
AddressInfo get_internal_address(AddressIndex address_index);
|
AddressInfo get_internal_address(AddressIndex address_index);
|
||||||
|
|
||||||
[Throws=BdkError]
|
|
||||||
boolean is_mine(Script script);
|
|
||||||
|
|
||||||
[Throws=BdkError]
|
|
||||||
sequence<LocalUtxo> list_unspent();
|
|
||||||
|
|
||||||
[Throws=BdkError]
|
|
||||||
sequence<TransactionDetails> list_transactions(boolean include_raw);
|
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
Balance get_balance();
|
Balance get_balance();
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
boolean sign([ByRef] PartiallySignedTransaction psbt, SignOptions? sign_options);
|
boolean sign([ByRef] PartiallySignedTransaction psbt, SignOptions? sign_options);
|
||||||
|
|
||||||
|
[Throws=BdkError]
|
||||||
|
sequence<TransactionDetails> list_transactions(boolean include_raw);
|
||||||
|
|
||||||
|
Network network();
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
void sync([ByRef] Blockchain blockchain, Progress? progress);
|
void sync([ByRef] Blockchain blockchain, Progress? progress);
|
||||||
|
|
||||||
|
[Throws=BdkError]
|
||||||
|
sequence<LocalUtxo> list_unspent();
|
||||||
};
|
};
|
||||||
|
|
||||||
interface FeeRate {
|
interface FeeRate {
|
||||||
@@ -496,6 +493,4 @@ enum WitnessVersion {
|
|||||||
|
|
||||||
interface Script {
|
interface Script {
|
||||||
constructor(sequence<u8> raw_output_script);
|
constructor(sequence<u8> raw_output_script);
|
||||||
|
|
||||||
sequence<u8> to_bytes();
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -438,10 +438,6 @@ impl Script {
|
|||||||
let script: BdkScript = BdkScript::from(raw_output_script);
|
let script: BdkScript = BdkScript::from(raw_output_script);
|
||||||
Script { script }
|
Script { script }
|
||||||
}
|
}
|
||||||
|
|
||||||
fn to_bytes(&self) -> Vec<u8> {
|
|
||||||
self.script.to_bytes()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<BdkScript> for Script {
|
impl From<BdkScript> for Script {
|
||||||
|
|||||||
@@ -65,11 +65,6 @@ impl Wallet {
|
|||||||
self.get_wallet().network()
|
self.get_wallet().network()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return whether or not a script is part of this wallet (either internal or external).
|
|
||||||
pub(crate) fn is_mine(&self, script: Arc<Script>) -> Result<bool, BdkError> {
|
|
||||||
self.get_wallet().is_mine(&script.script)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Sync the internal database with the blockchain.
|
/// Sync the internal database with the blockchain.
|
||||||
pub(crate) fn sync(
|
pub(crate) fn sync(
|
||||||
&self,
|
&self,
|
||||||
@@ -565,13 +560,9 @@ impl BumpFeeTxBuilder {
|
|||||||
mod test {
|
mod test {
|
||||||
use crate::database::DatabaseConfig;
|
use crate::database::DatabaseConfig;
|
||||||
use crate::descriptor::Descriptor;
|
use crate::descriptor::Descriptor;
|
||||||
use crate::keys::{DescriptorSecretKey, Mnemonic};
|
|
||||||
use crate::wallet::{AddressIndex, TxBuilder, Wallet};
|
use crate::wallet::{AddressIndex, TxBuilder, Wallet};
|
||||||
use crate::Script;
|
|
||||||
use assert_matches::assert_matches;
|
|
||||||
use bdk::bitcoin::{Address, Network};
|
use bdk::bitcoin::{Address, Network};
|
||||||
use bdk::wallet::get_funded_wallet;
|
use bdk::wallet::get_funded_wallet;
|
||||||
use bdk::KeychainKind;
|
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
@@ -811,47 +802,4 @@ mod test {
|
|||||||
"bcrt1qaux734vuhykww9632v8cmdnk7z2mw5lsf74v6k"
|
"bcrt1qaux734vuhykww9632v8cmdnk7z2mw5lsf74v6k"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_is_mine() {
|
|
||||||
// is_mine should return true for addresses generated by the wallet
|
|
||||||
let mnemonic: Mnemonic = Mnemonic::from_string("chaos fabric time speed sponsor all flat solution wisdom trophy crack object robot pave observe combine where aware bench orient secret primary cable detect".to_string()).unwrap();
|
|
||||||
let secret_key: DescriptorSecretKey =
|
|
||||||
DescriptorSecretKey::new(Network::Testnet, Arc::new(mnemonic), None);
|
|
||||||
let descriptor: Descriptor = Descriptor::new_bip84(
|
|
||||||
Arc::new(secret_key),
|
|
||||||
KeychainKind::External,
|
|
||||||
Network::Testnet,
|
|
||||||
);
|
|
||||||
let wallet: Wallet = Wallet::new(
|
|
||||||
Arc::new(descriptor),
|
|
||||||
None,
|
|
||||||
Network::Testnet,
|
|
||||||
DatabaseConfig::Memory,
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let address = wallet.get_address(AddressIndex::New).unwrap();
|
|
||||||
let script: Arc<Script> = address.address.script_pubkey();
|
|
||||||
|
|
||||||
let is_mine_1: bool = wallet.is_mine(script).unwrap();
|
|
||||||
assert!(is_mine_1);
|
|
||||||
|
|
||||||
// is_mine returns false when provided a script that is not in the wallet
|
|
||||||
let other_wpkh = "wpkh(tprv8hwWMmPE4BVNxGdVt3HhEERZhondQvodUY7Ajyseyhudr4WabJqWKWLr4Wi2r26CDaNCQhhxEftEaNzz7dPGhWuKFU4VULesmhEfZYyBXdE/0/*)";
|
|
||||||
let other_descriptor = Descriptor::new(other_wpkh.to_string(), Network::Testnet).unwrap();
|
|
||||||
|
|
||||||
let other_wallet = Wallet::new(
|
|
||||||
Arc::new(other_descriptor),
|
|
||||||
None,
|
|
||||||
Network::Testnet,
|
|
||||||
DatabaseConfig::Memory,
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let other_address = other_wallet.get_address(AddressIndex::New).unwrap();
|
|
||||||
let other_script: Arc<Script> = other_address.address.script_pubkey();
|
|
||||||
let is_mine_2: bool = wallet.is_mine(other_script).unwrap();
|
|
||||||
assert_matches!(is_mine_2, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# bdk-jvm
|
# bdk-android
|
||||||
This project builds a .jar package for the JVM platform that provide Kotlin language bindings for the [`bdk`] library. The Kotlin language bindings are created by the `bdk-ffi` project which is included in the root of this repository.
|
This project builds a .jar package for the JVM platform that provide Kotlin language bindings for the [`bdk`] library. The Kotlin language bindings are created by the `bdk-ffi` project which is included in the root of this repository.
|
||||||
|
|
||||||
## How to Use
|
## How to Use
|
||||||
@@ -43,34 +43,27 @@ dependencies {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Example Projects
|
## Example Projects
|
||||||
* [Tatooine Faucet](https://github.com/thunderbiscuit/tatooine)
|
* [Tatooine Faucet](https://github.com/thunderbiscuit/tatooine)
|
||||||
|
|
||||||
## How to build
|
## How to build
|
||||||
_Note that Kotlin version `1.6.10` or later is required to build the library._
|
_Note that Kotlin version `1.6.10` or later is required to build the library._
|
||||||
1. Install JDK 11. It must be version 11 (not 17), otherwise it won't build. For example, with SDKMAN!:
|
|
||||||
```shell
|
1. Clone this repository.
|
||||||
curl -s "https://get.sdkman.io" | bash
|
|
||||||
source "$HOME/.sdkman/bin/sdkman-init.sh"
|
|
||||||
sdk install java 11.0.19-tem
|
|
||||||
```
|
|
||||||
2. Install Rust (note that we are currently building using Rust 1.67.0):
|
|
||||||
```shell
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
||||||
rustup default 1.67.0
|
|
||||||
```
|
|
||||||
3. Clone this repository.
|
|
||||||
```shell
|
```shell
|
||||||
git clone https://github.com/bitcoindevkit/bdk-ffi
|
git clone https://github.com/bitcoindevkit/bdk-ffi
|
||||||
```
|
```
|
||||||
4. If building on macOS install required intel and m1 jvm targets
|
2. Follow the "General" bdk-ffi ["Getting Started (Developer)"] instructions.
|
||||||
|
3. If building on macOS install required intel and m1 jvm targets
|
||||||
```sh
|
```sh
|
||||||
rustup target add x86_64-apple-darwin aarch64-apple-darwin
|
rustup target add x86_64-apple-darwin aarch64-apple-darwin
|
||||||
```
|
```
|
||||||
5. Build kotlin bindings
|
4. Build kotlin bindings
|
||||||
```sh
|
```sh
|
||||||
./gradlew buildJvmLib
|
# build JVM library
|
||||||
```
|
./gradlew buildJvmLib
|
||||||
|
```
|
||||||
|
|
||||||
## How to publish to your local Maven repo
|
## How to publish to your local Maven repo
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
org.gradle.jvmargs=-Xmx1536m
|
org.gradle.jvmargs=-Xmx1536m
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
libraryVersion=0.29.0
|
libraryVersion=0.28.0
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
targetCompatibility = JavaVersion.VERSION_11
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
withSourcesJar()
|
withSourcesJar()
|
||||||
withJavadocJar()
|
withJavadocJar()
|
||||||
}
|
}
|
||||||
@@ -107,8 +107,4 @@ signing {
|
|||||||
// binaries before running the tests
|
// binaries before running the tests
|
||||||
tasks.withType<KotlinCompile> {
|
tasks.withType<KotlinCompile> {
|
||||||
dependsOn("buildJvmLib")
|
dependsOn("buildJvmLib")
|
||||||
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = "11"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,11 @@ package org.bitcoindevkit.plugins
|
|||||||
val operatingSystem: OS = when {
|
val operatingSystem: OS = when {
|
||||||
System.getProperty("os.name").contains("mac", ignoreCase = true) -> OS.MAC
|
System.getProperty("os.name").contains("mac", ignoreCase = true) -> OS.MAC
|
||||||
System.getProperty("os.name").contains("linux", ignoreCase = true) -> OS.LINUX
|
System.getProperty("os.name").contains("linux", ignoreCase = true) -> OS.LINUX
|
||||||
System.getProperty("os.name").contains("windows", ignoreCase = true) -> OS.WINDOWS
|
|
||||||
else -> OS.OTHER
|
else -> OS.OTHER
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class OS {
|
enum class OS {
|
||||||
MAC,
|
MAC,
|
||||||
LINUX,
|
LINUX,
|
||||||
WINDOWS,
|
|
||||||
OTHER,
|
OTHER,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,20 +27,13 @@ internal class UniFfiJvmPlugin : Plugin<Project> {
|
|||||||
val cargoArgs: List<String> = listOf("build", "--profile", "release-smaller", "--target", "aarch64-apple-darwin")
|
val cargoArgs: List<String> = listOf("build", "--profile", "release-smaller", "--target", "aarch64-apple-darwin")
|
||||||
args(cargoArgs)
|
args(cargoArgs)
|
||||||
}
|
}
|
||||||
} else if (operatingSystem == OS.LINUX) {
|
} else if(operatingSystem == OS.LINUX) {
|
||||||
exec {
|
exec {
|
||||||
workingDir("${project.projectDir}/../../bdk-ffi")
|
workingDir("${project.projectDir}/../../bdk-ffi")
|
||||||
executable("cargo")
|
executable("cargo")
|
||||||
val cargoArgs: List<String> = listOf("build", "--profile", "release-smaller", "--target", "x86_64-unknown-linux-gnu")
|
val cargoArgs: List<String> = listOf("build", "--profile", "release-smaller", "--target", "x86_64-unknown-linux-gnu")
|
||||||
args(cargoArgs)
|
args(cargoArgs)
|
||||||
}
|
}
|
||||||
} else if (operatingSystem == OS.WINDOWS) {
|
|
||||||
exec {
|
|
||||||
workingDir("${project.projectDir}/../../bdk-ffi")
|
|
||||||
executable("cargo")
|
|
||||||
val cargoArgs: List<String> = listOf("build", "--profile", "release-smaller", "--target", "x86_64-pc-windows-msvc")
|
|
||||||
args(cargoArgs)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,25 +70,13 @@ internal class UniFfiJvmPlugin : Plugin<Project> {
|
|||||||
ext = "so"
|
ext = "so"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
} else if (operatingSystem == OS.WINDOWS) {
|
|
||||||
libsToCopy.add(
|
|
||||||
CopyMetadata(
|
|
||||||
targetDir = "x86_64-pc-windows-msvc",
|
|
||||||
resDir = "win32-x86-64",
|
|
||||||
ext = "dll"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
val libName = when (operatingSystem) {
|
|
||||||
OS.WINDOWS -> "bdkffi"
|
|
||||||
else -> "libbdkffi"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
libsToCopy.forEach {
|
libsToCopy.forEach {
|
||||||
doFirst {
|
doFirst {
|
||||||
copy {
|
copy {
|
||||||
with(it) {
|
with(it) {
|
||||||
from("${project.projectDir}/../../target/${this.targetDir}/release-smaller/${libName}.${this.ext}")
|
from("${project.projectDir}/../../target/${this.targetDir}/release-smaller/libbdkffi.${this.ext}")
|
||||||
into("${project.projectDir}/../../bdk-jvm/lib/src/main/resources/${this.resDir}/")
|
into("${project.projectDir}/../../bdk-jvm/lib/src/main/resources/${this.resDir}/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ print(f"Wallet balance is: {balance.total}")
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="bdkpython",
|
name="bdkpython",
|
||||||
version="0.29.0",
|
version="0.28.3",
|
||||||
description="The Python language bindings for the Bitcoin Development Kit",
|
description="The Python language bindings for the Bitcoin Development Kit",
|
||||||
long_description=LONG_DESCRIPTION,
|
long_description=LONG_DESCRIPTION,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
@@ -62,6 +62,7 @@ setup(
|
|||||||
url="https://github.com/bitcoindevkit/bdk-ffi",
|
url="https://github.com/bitcoindevkit/bdk-ffi",
|
||||||
author="Alekos Filini <alekos.filini@gmail.com>, Steve Myers <steve@notmandatory.org>",
|
author="Alekos Filini <alekos.filini@gmail.com>, Steve Myers <steve@notmandatory.org>",
|
||||||
license="MIT or Apache 2.0",
|
license="MIT or Apache 2.0",
|
||||||
|
|
||||||
# This is required to ensure the library name includes the python version, abi, and platform tags
|
# This is required to ensure the library name includes the python version, abi, and platform tags
|
||||||
# See issue #350 for more information
|
# See issue #350 for more information
|
||||||
has_ext_modules=lambda: True,
|
has_ext_modules=lambda: True,
|
||||||
|
|||||||
@@ -29,9 +29,7 @@ let package = Package(
|
|||||||
.binaryTarget(name: "bdkFFI", path: "./bdkFFI.xcframework"),
|
.binaryTarget(name: "bdkFFI", path: "./bdkFFI.xcframework"),
|
||||||
.target(
|
.target(
|
||||||
name: "BitcoinDevKit",
|
name: "BitcoinDevKit",
|
||||||
dependencies: ["bdkFFI"],
|
dependencies: ["bdkFFI"]),
|
||||||
swiftSettings: [.unsafeFlags(["-suppress-warnings"])]
|
|
||||||
),
|
|
||||||
.testTarget(
|
.testTarget(
|
||||||
name: "BitcoinDevKitTests",
|
name: "BitcoinDevKitTests",
|
||||||
dependencies: ["BitcoinDevKit"]),
|
dependencies: ["BitcoinDevKit"]),
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
#
|
#
|
||||||
# Run the script from the repo root directory, ie: ./bdk-swift/build-local-swift.sh
|
# Run the script from the repo root directory, ie: ./bdk-swift/build-local-swift.sh
|
||||||
|
|
||||||
rustup install nightly-2023-04-10
|
rustup install nightly-x86_64-apple-darwin
|
||||||
rustup component add rust-src --toolchain nightly-2023-04-10
|
rustup component add rust-src --toolchain nightly-x86_64-apple-darwin
|
||||||
rustup target add aarch64-apple-ios x86_64-apple-ios
|
rustup target add aarch64-apple-ios x86_64-apple-ios
|
||||||
rustup target add aarch64-apple-ios-sim --toolchain nightly-2023-04-10
|
rustup target add aarch64-apple-ios-sim --toolchain nightly
|
||||||
rustup target add aarch64-apple-darwin x86_64-apple-darwin
|
rustup target add aarch64-apple-darwin x86_64-apple-darwin
|
||||||
|
|
||||||
pushd bdk-ffi
|
pushd bdk-ffi
|
||||||
@@ -20,10 +20,10 @@ cargo build --package bdk-ffi --profile release-smaller --target x86_64-apple-da
|
|||||||
cargo build --package bdk-ffi --profile release-smaller --target aarch64-apple-darwin
|
cargo build --package bdk-ffi --profile release-smaller --target aarch64-apple-darwin
|
||||||
cargo build --package bdk-ffi --profile release-smaller --target x86_64-apple-ios
|
cargo build --package bdk-ffi --profile release-smaller --target x86_64-apple-ios
|
||||||
cargo build --package bdk-ffi --profile release-smaller --target aarch64-apple-ios
|
cargo build --package bdk-ffi --profile release-smaller --target aarch64-apple-ios
|
||||||
cargo +nightly-2023-04-10 build --package bdk-ffi --profile release-smaller --target aarch64-apple-ios-sim
|
cargo +nightly build --package bdk-ffi --release -Z build-std --target aarch64-apple-ios-sim
|
||||||
|
|
||||||
mkdir -p target/lipo-ios-sim/release-smaller
|
mkdir -p target/lipo-ios-sim/release-smaller
|
||||||
lipo target/aarch64-apple-ios-sim/release-smaller/libbdkffi.a target/x86_64-apple-ios/release-smaller/libbdkffi.a -create -output target/lipo-ios-sim/release-smaller/libbdkffi.a
|
lipo target/aarch64-apple-ios-sim/release/libbdkffi.a target/x86_64-apple-ios/release-smaller/libbdkffi.a -create -output target/lipo-ios-sim/release-smaller/libbdkffi.a
|
||||||
mkdir -p target/lipo-macos/release-smaller
|
mkdir -p target/lipo-macos/release-smaller
|
||||||
lipo target/aarch64-apple-darwin/release-smaller/libbdkffi.a target/x86_64-apple-darwin/release-smaller/libbdkffi.a -create -output target/lipo-macos/release-smaller/libbdkffi.a
|
lipo target/aarch64-apple-darwin/release-smaller/libbdkffi.a target/x86_64-apple-darwin/release-smaller/libbdkffi.a -create -output target/lipo-macos/release-smaller/libbdkffi.a
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user