504: Bump bdk from 0.6.0 to 0.7.0 r=thomaseizinger a=dependabot[bot]

Bumps [bdk](https://github.com/bitcoindevkit/bdk) from 0.6.0 to 0.7.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/bitcoindevkit/bdk/blob/v0.7.0/CHANGELOG.md">bdk's changelog</a>.</em></p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="766570abfd"><code>766570a</code></a> Bump version to 0.7.0</li>
<li><a href="934ec366d9"><code>934ec36</code></a> Use the released <code>testutils-macros</code></li>
<li><a href="d0733e9496"><code>d0733e9</code></a> Bump version in <code>src/lib.rs</code></li>
<li><a href="3c7a1f5918"><code>3c7a1f5</code></a> Bump <code>testutils-macros</code> to <code>v0.6.0</code></li>
<li><a href="85aadaccd2"><code>85aadac</code></a> Update changelog in preparation of <code>v0.7.0</code></li>
<li><a href="fad0fe9f30"><code>fad0fe9</code></a> Update create transaction example code</li>
<li><a href="47f26447da"><code>47f2644</code></a> continue signing when finding already finalized inputs</li>
<li><a href="3608ff9f14"><code>3608ff9</code></a> Merge commit 'refs/pull/341/head' of github.com:bitcoindevkit/bdk into releas...</li>
<li><a href="898dfe6cf1"><code>898dfe6</code></a> get psbt inputs with bounds check</li>
<li><a href="7961ae7f8e"><code>7961ae7</code></a> Check index out of bound also for tx inputs not only for psbt inputs</li>
<li>Additional commits viewable in <a href="https://github.com/bitcoindevkit/bdk/compare/v0.6.0...v0.7.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bdk&package-manager=cargo&previous-version=0.6.0&new-version=0.7.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

547: Print the Bitcoin address to the terminal as a QR code r=thomaseizinger a=xscd

It helps to fund the Bitcoin address with your mobile device without a need to copy-paste the receive address. 

Here is how it looks like under different terminals:
1) Gnome Terminal:
![1](https://user-images.githubusercontent.com/46658470/120103390-0e87dd80-c158-11eb-9e0f-da5af89ea8d7.png)
2) Alacritty:
![2](https://user-images.githubusercontent.com/46658470/120103398-1ba4cc80-c158-11eb-89c0-8a54e8902658.png)
3) Kitty:
![3](https://user-images.githubusercontent.com/46658470/120103411-265f6180-c158-11eb-95e1-b37c2d16c2b6.png)
4) Konsole:
![4](https://user-images.githubusercontent.com/46658470/120103421-2f503300-c158-11eb-83bf-82d55b6e2dd8.png)



556: Bump rust_decimal from 1.14.1 to 1.14.2 r=thomaseizinger a=dependabot[bot]

Bumps [rust_decimal](https://github.com/paupino/rust-decimal) from 1.14.1 to 1.14.2.
<details>
<summary>Commits</summary>
<ul>
<li><a href="16b41cc58c"><code>16b41cc</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/paupino/rust-decimal/issues/394">#394</a> from paupino/version/1.14.2</li>
<li><a href="c7bd3bf987"><code>c7bd3bf</code></a> Version 1.14.2</li>
<li><a href="c0117ddc36"><code>c0117dd</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/paupino/rust-decimal/issues/393">#393</a> from paupino/issue/392</li>
<li><a href="a231fbf12c"><code>a231fbf</code></a> Fixes issue with remainder overflow</li>
<li>See full diff in <a href="https://github.com/paupino/rust-decimal/compare/1.14.1...1.14.2">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rust_decimal&package-manager=cargo&previous-version=1.14.1&new-version=1.14.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

563: Bump tokio from 1.6.0 to 1.7.0 r=thomaseizinger a=dependabot[bot]

Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.6.0 to 1.7.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/tokio-rs/tokio/releases">tokio's releases</a>.</em></p>
<blockquote>
<h2>Tokio v1.7.0</h2>
<h1>1.7.0 (June 15, 2021)</h1>
<h3>Added</h3>
<ul>
<li>net: add named pipes on windows (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3760">#3760</a>)</li>
<li>net: add <code>TcpSocket</code> from <code>std::net::TcpStream</code> conversion (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3838">#3838</a>)</li>
<li>sync: add <code>receiver_count</code> to <code>watch::Sender</code> (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3729">#3729</a>)</li>
<li>sync: export <code>sync::notify::Notified</code> future publicly (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3840">#3840</a>)</li>
<li>tracing: instrument task wakers (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3836">#3836</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>macros: suppress <code>clippy::default_numeric_fallback</code> lint in generated code (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3831">#3831</a>)</li>
<li>runtime: immediately drop new tasks when runtime is shut down (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3752">#3752</a>)</li>
<li>sync: deprecate unused <code>mpsc::RecvError</code> type (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3833">#3833</a>)</li>
</ul>
<h3>Documented</h3>
<ul>
<li>io: clarify EOF condition for <code>AsyncReadExt::read_buf</code> (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3850">#3850</a>)</li>
<li>io: clarify limits on return values of <code>AsyncWrite::poll_write</code> (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3820">#3820</a>)</li>
<li>sync: add examples to Semaphore (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3808">#3808</a>)</li>
</ul>
<h2>Tokio v1.6.2</h2>
<h3>Fixes</h3>
<ul>
<li>test: sub-ms <code>time:advance</code> regression introduced in 1.6 (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3852">#3852</a>)</li>
</ul>
<p><a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3852">#3852</a>: <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/pull/3852">tokio-rs/tokio#3852</a></p>
<h2>Tokio v1.6.1</h2>
<p>This release reverts <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3518">#3518</a> because it doesn't work on some kernels due to
a kernel bug. (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3803">#3803</a>)</p>
<p><a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3518">#3518</a>: <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3518">tokio-rs/tokio#3518</a>
<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3803">#3803</a>: <a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3803">tokio-rs/tokio#3803</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="34c6a26c01"><code>34c6a26</code></a> chore: prepare Tokio v1.7.0 (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3863">#3863</a>)</li>
<li><a href="97e7830364"><code>97e7830</code></a> net: provide NamedPipe{Client, Server} types and builders (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3760">#3760</a>)</li>
<li><a href="606206ecad"><code>606206e</code></a> Merge branch 'tokio-1.6.x' into merge-1.6.x</li>
<li><a href="dfe4013ff2"><code>dfe4013</code></a> chore: prepare Tokio 1.6.2 release (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3859">#3859</a>)</li>
<li><a href="18779aa2e2"><code>18779aa</code></a> time: fix time::advance() with sub-ms durations (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3852">#3852</a>)</li>
<li><a href="2c24a028f6"><code>2c24a02</code></a> chore: re-enable test_socket_pair on FreeBSD (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3844">#3844</a>)</li>
<li><a href="f55b77aadd"><code>f55b77a</code></a> tracing: emit waker op as str instead as Debug (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3853">#3853</a>)</li>
<li><a href="21de476ae7"><code>21de476</code></a> sync: export sync::notify::Notified future publicly (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3840">#3840</a>)</li>
<li><a href="cb147a2b3f"><code>cb147a2</code></a> sync: deprecate mpsc::RecvError (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3833">#3833</a>)</li>
<li><a href="f759240254"><code>f759240</code></a> chore: update version in README.md (<a href="https://github-redirect.dependabot.com/tokio-rs/tokio/issues/3851">#3851</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/tokio-rs/tokio/compare/tokio-1.6.0...tokio-1.7.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tokio&package-manager=cargo&previous-version=1.6.0&new-version=1.7.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

564: Bump thomaseizinger/create-pull-request from 1.0.0 to 1.1.0 r=thomaseizinger a=dependabot[bot]

Bumps [thomaseizinger/create-pull-request](https://github.com/thomaseizinger/create-pull-request) from 1.0.0 to 1.1.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/thomaseizinger/create-pull-request/blob/master/CHANGELOG.md">thomaseizinger/create-pull-request's changelog</a>.</em></p>
<blockquote>
<h2>[1.1.0] - 2021-06-16</h2>
<h3>Added</h3>
<ul>
<li>Git hook to make sure we always run <code>yarn build</code> before committing any Typescript changes. This should prevent dist/index.js from getting out of date.</li>
<li>Support for setting a proxy using the <code>HTTPS_PROXY</code> environment variable</li>
<li>Support for GitHub Enterprise by reading <code>process.env.GITHUB_REPOSITORY</code></li>
</ul>
<h3>Fixed</h3>
<ul>
<li>action.yml suggested to use <code>github-token</code> as the input where as in reality, we are looking for an input <code>github_token</code> (note the underscore!)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="285345fb83"><code>285345f</code></a> Add support for creating PR's in ghes and behind proxy (<a href="https://github-redirect.dependabot.com/thomaseizinger/create-pull-request/issues/41">#41</a>)</li>
<li><a href="13c98abb44"><code>13c98ab</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/thomaseizinger/create-pull-request/issues/37">#37</a> from orestesgaolin/patch-1</li>
<li><a href="5c8c2b6c09"><code>5c8c2b6</code></a> Fix parameters in the example</li>
<li><a href="1dde00b9ad"><code>1dde00b</code></a> Adapt LICENSE</li>
<li><a href="655db51f4a"><code>655db51</code></a> Automatically set the hookspath to our git hooks</li>
<li><a href="cedbbbb2ba"><code>cedbbbb</code></a> Update README.md</li>
<li><a href="2cd3e70bc6"><code>2cd3e70</code></a> Add readme note about inputs</li>
<li><a href="faf5ed2aa5"><code>faf5ed2</code></a> Define Inputs type through type magic on payloads types</li>
<li><a href="3fb1c8b1be"><code>3fb1c8b</code></a> Fixing git url in package.json</li>
<li><a href="e46f94e6ae"><code>e46f94e</code></a> Add git hook for making sure we update index.js</li>
<li>Additional commits viewable in <a href="https://github.com/thomaseizinger/create-pull-request/compare/1.0.0...1.1.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=thomaseizinger/create-pull-request&package-manager=github_actions&previous-version=1.0.0&new-version=1.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: xscd <xscd@pm.me>
pull/561/head
bors[bot] 3 years ago committed by GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -54,7 +54,7 @@ jobs:
run: git push origin release/${{ github.event.inputs.version }} --force
- name: Create pull request
uses: thomaseizinger/create-pull-request@1.0.0
uses: thomaseizinger/create-pull-request@1.1.0
with:
GITHUB_TOKEN: ${{ secrets.BOTTY_GITHUB_TOKEN }}
head: release/${{ github.event.inputs.version }}

@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- Printing the deposit address to the terminal as a QR code.
To not break automated scripts or integrations with other software, this behaviour is disabled if `--json` is passed to the application.
## [0.7.0] - 2021-05-28
### Fixed

68
Cargo.lock generated

@ -237,9 +237,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[package]]
name = "bdk"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51dcf686dfc6200d641e8619019c027976533b7e2d5c00de2b4182c88287a18b"
checksum = "d85959e6883d0286e39e89aa7791b2edc2b8712f0f7152fda43b692c4db96c06"
dependencies = [
"async-trait",
"bdk-macros",
@ -486,6 +486,12 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
[[package]]
name = "bytemuck"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bed57e2090563b83ba8f83366628ce535a7584c9afa4c9fc0612a03925c6df58"
[[package]]
name = "byteorder"
version = "1.4.3"
@ -568,6 +574,12 @@ dependencies = [
"zeroize",
]
[[package]]
name = "checked_int_cast"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17cc5e6b5ab06331c33589842070416baa137e8b0eb912b008cfd4a78ada7919"
[[package]]
name = "chrono"
version = "0.4.19"
@ -614,6 +626,12 @@ dependencies = [
"bitflags",
]
[[package]]
name = "color_quant"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
[[package]]
name = "config"
version = "0.11.0"
@ -1550,6 +1568,20 @@ dependencies = [
"libc",
]
[[package]]
name = "image"
version = "0.23.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1"
dependencies = [
"bytemuck",
"byteorder",
"color_quant",
"num-iter",
"num-rational 0.3.2",
"num-traits",
]
[[package]]
name = "indexmap"
version = "1.6.2"
@ -2362,7 +2394,7 @@ dependencies = [
"num-complex",
"num-integer",
"num-iter",
"num-rational",
"num-rational 0.1.42",
"num-traits",
]
@ -2421,6 +2453,17 @@ dependencies = [
"rustc-serialize",
]
[[package]]
name = "num-rational"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07"
dependencies = [
"autocfg 1.0.1",
"num-integer",
"num-traits",
]
[[package]]
name = "num-traits"
version = "0.2.14"
@ -2823,6 +2866,16 @@ dependencies = [
"prost",
]
[[package]]
name = "qrcode"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16d2f1455f3630c6e5107b4f2b94e74d76dea80736de0981fd27644216cff57f"
dependencies = [
"checked_int_cast",
"image",
]
[[package]]
name = "quick-error"
version = "1.2.3"
@ -3230,9 +3283,9 @@ dependencies = [
[[package]]
name = "rust_decimal"
version = "1.14.1"
version = "1.14.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d52f6513cf330c84095570b1f3ac073d718a50541c8392a98eaac9c6333324bf"
checksum = "9787e62372fc0c5a0f3af64c392652db72d3ec1cc0cff1becc175d2c11e6fbcc"
dependencies = [
"arrayvec",
"num-traits",
@ -3903,6 +3956,7 @@ dependencies = [
"port_check",
"prettytable-rs",
"proptest",
"qrcode",
"rand 0.8.3",
"rand_chacha 0.3.0",
"reqwest",
@ -4150,9 +4204,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
version = "1.6.0"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd3076b5c8cc18138b8f8814895c11eb4de37114a5d127bafdc5e55798ceef37"
checksum = "c79ba603c337335df6ba6dd6afc38c38a7d5e1b0c871678439ea973cd62a118e"
dependencies = [
"autocfg 1.0.1",
"bytes 1.0.1",

@ -15,7 +15,7 @@ async-trait = "0.1"
atty = "0.2"
backoff = { version = "0.3", features = [ "tokio" ] }
base64 = "0.13"
bdk = "0.6"
bdk = "0.7"
big-bytes = "1"
bitcoin = { version = "0.26", features = [ "rand", "use-serde" ] }
bmrng = "0.5"
@ -37,6 +37,7 @@ monero-rpc = { path = "../monero-rpc" }
pem = "0.8"
prettytable-rs = "0.8"
proptest = "1"
qrcode = "0.12"
rand = "0.8"
rand_chacha = "0.3"
reqwest = { version = "0.11", features = [ "rustls-tls", "stream", "socks" ], default-features = false }

@ -14,6 +14,8 @@
use anyhow::{bail, Context, Result};
use prettytable::{row, Table};
use qrcode::render::unicode;
use qrcode::QrCode;
use std::cmp::min;
use std::env;
use std::future::Future;
@ -101,6 +103,7 @@ async fn main() -> Result<()> {
let max_givable = || bitcoin_wallet.max_giveable(TxLock::script_size());
let (amount, fees) = determine_btc_to_swap(
json,
event_loop_handle.request_quote(),
bitcoin_wallet.new_address(),
|| bitcoin_wallet.balance(),
@ -325,7 +328,18 @@ async fn init_monero_wallet(
Ok((monero_wallet, monero_wallet_rpc_process))
}
fn qr_code(value: &impl ToString) -> Result<String> {
let code = QrCode::new(value.to_string())?;
let qr_code = code
.render::<unicode::Dense1x2>()
.dark_color(unicode::Dense1x2::Light)
.light_color(unicode::Dense1x2::Dark)
.build();
Ok(qr_code)
}
async fn determine_btc_to_swap<FB, TB, FMG, TMG, FS, TS>(
json: bool,
bid_quote: impl Future<Output = Result<BidQuote>>,
get_new_address: impl Future<Output = Result<bitcoin::Address>>,
balance: FB,
@ -358,6 +372,10 @@ where
let minimum_amount = bid_quote.min_quantity;
let maximum_amount = bid_quote.max_quantity;
if !json {
eprintln!("{}", qr_code(&deposit_address)?);
}
info!(
%deposit_address,
%current_maximum_giveable,
@ -449,6 +467,7 @@ mod tests {
])));
let (amount, fees) = determine_btc_to_swap(
true,
async { Ok(quote_with_max(0.01)) },
get_dummy_address(),
|| async { Ok(Amount::from_btc(0.001)?) },
@ -475,6 +494,7 @@ mod tests {
])));
let (amount, fees) = determine_btc_to_swap(
true,
async { Ok(quote_with_max(0.01)) },
get_dummy_address(),
|| async { Ok(Amount::from_btc(0.1001)?) },
@ -502,6 +522,7 @@ mod tests {
])));
let (amount, fees) = determine_btc_to_swap(
true,
async { Ok(quote_with_max(0.01)) },
async { panic!("should not request new address when initial balance is > 0") },
|| async { Ok(Amount::from_btc(0.005)?) },
@ -529,6 +550,7 @@ mod tests {
])));
let (amount, fees) = determine_btc_to_swap(
true,
async { Ok(quote_with_max(0.01)) },
async { panic!("should not request new address when initial balance is > 0") },
|| async { Ok(Amount::from_btc(0.1001)?) },
@ -556,6 +578,7 @@ mod tests {
])));
let (amount, fees) = determine_btc_to_swap(
true,
async { Ok(quote_with_min(0.01)) },
get_dummy_address(),
|| async { Ok(Amount::from_btc(0.0101)?) },
@ -583,6 +606,7 @@ mod tests {
])));
let (amount, fees) = determine_btc_to_swap(
true,
async { Ok(quote_with_min(0.01)) },
get_dummy_address(),
|| async { Ok(Amount::from_btc(0.0101)?) },
@ -615,6 +639,7 @@ mod tests {
let error = tokio::time::timeout(
Duration::from_secs(1),
determine_btc_to_swap(
true,
async { Ok(quote_with_min(0.1)) },
get_dummy_address(),
|| async { Ok(Amount::from_btc(0.0101)?) },

@ -10,7 +10,7 @@ use bdk::descriptor::Segwitv0;
use bdk::electrum_client::{ElectrumApi, GetHistoryRes};
use bdk::keys::DerivableKey;
use bdk::wallet::AddressIndex;
use bdk::{FeeRate, KeychainKind};
use bdk::{FeeRate, KeychainKind, SignOptions};
use bitcoin::{Network, Script};
use reqwest::Url;
use rust_decimal::prelude::*;
@ -246,14 +246,21 @@ where
C: EstimateFeeRate,
D: BatchDatabase,
{
pub async fn sign_and_finalize(&self, psbt: PartiallySignedTransaction) -> Result<Transaction> {
let (signed_psbt, finalized) = self.wallet.lock().await.sign(psbt, None)?;
pub async fn sign_and_finalize(
&self,
mut psbt: PartiallySignedTransaction,
) -> Result<Transaction> {
let finalized = self
.wallet
.lock()
.await
.sign(&mut psbt, SignOptions::default())?;
if !finalized {
bail!("PSBT is not finalized")
}
let tx = signed_psbt.extract_tx();
let tx = psbt.extract_tx();
Ok(tx)
}

Loading…
Cancel
Save