Skip to content

example: Fix wallet examples #1434

Closed

Description

@ValuedMammal

These are some fixes that can be implemented for the wallet_* examples in the example-crates dir.

  • Print balances either in BTC or sats (but not both)
  • wallet_esplora_async appears to be printing the KeychainKind twice, and forgets to print spk0
  • Use tempfile instead of std::env::tempdir, as this should automatically clean up temporary files
  • Consider changing wallet examples to use signet and possibly a different server URL to fix rate limiting issues
  • Try to recycle the sats so that running an example doesn't result in a net loss of "funds"

Activity

  1. added
    documentation
    on May 9, 2024
  2. storopoli commented on May 9, 2024

    @storopoli

    You can assign this to me.
    I am eager to help.

  3. storopoli commented on May 14, 2024

    @storopoli

    @ValuedMammal the problem with

    • Consider moving these smaller examples to the bdk/examples folder

    is that we cannot add them to the wallet/examples folder is due to the fact that bdk_esplora and bdk_electrum crates are not dependencies for bdk_wallet.
    Hence we cannot add them to the cargo examples.

    However we can circumvent this by adding both bdk_electrum and bdk_esplora to the dev-depencies of bdk_wallet.
    Which I think is not worth it the extra overhead.

    Source: https://users.rust-lang.org/t/cargo-example-only-dependencies/3215

  4. ValuedMammal commented on May 14, 2024

    @ValuedMammal
    ContributorAuthor

    we cannot add them to the wallet/examples folder is due to the fact that bdk_esplora and bdk_electrum crates are not dependencies for bdk_wallet.

    you're right, they will probably have to stay in example-crates

  5. added this to the 1.0.0-beta milestone on Jun 23, 2024
  6. moved this from Needs Review to Done in BDK Walleton Sep 9, 2024
  7. added a commit that references this issue on Sep 9, 2024
    90a89bf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentation

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions