769 Commits

Author SHA1 Message Date
Steve Myers
c6e9a62628
Bump version to 0.4.0 v0.4.0 2022-03-14 14:40:55 -05:00
Steve Myers
5b760717bf
Merge commit 'refs/pull/17/head' of github.com:bitcoindevkit/bdk-kotlin 2022-03-14 13:46:28 -05:00
Steve Myers
e48a0d9b54
Merge commit 'refs/pull/16/head' of github.com:bitcoindevkit/bdk-kotlin 2022-03-14 12:59:56 -05:00
Steve Myers
f76f3234b4
Merge bitcoindevkit/bdk-ffi#109: Refactor memory database config enum
cc3736809a2910d3a739b37a61f1613404fba572 Fix memory database configuration enum (thunderbiscuit)

Pull request description:

  The `DatabaseConfig.Memory` enum currently requires a "junk" string argument which is not used when creating the wallet:

  ```rust
  // lib.rs line 24
  pub enum DatabaseConfig {
      Memory { junk: String },
      Sled { config: SledDbConfiguration },
  }

  // lib.rs line 209
  impl Wallet {
      fn new(
          descriptor: String,
          change_descriptor: Option<String>,
          network: Network,
          database_config: DatabaseConfig,
          blockchain_config: BlockchainConfig,
      ) -> Result<Self, BdkError> {
          let any_database_config = match database_config {
              DatabaseConfig::Memory { .. } => AnyDatabaseConfig::Memory(()),
              DatabaseConfig::Sled { config } => AnyDatabaseConfig::Sled(config),
          };
  ```

  Which translates to the udl file like this:
  ```txt
  [Enum]
  interface DatabaseConfig {
    Memory(string junk);
    Sled(SledDbConfiguration config);
  };
  ```

  According to the [docs from uniffi-rs](https://mozilla.github.io/uniffi-rs/udl/enumerations.html) the `interface` here is required because the enums have named fields. But after testing I found that we can declare the udl file like so, and remove the requirement for the `junk` argument:
  ```txt
  [Enum]
  interface DatabaseConfig {
    Memory();
    Sled(SledDbConfiguration config);
  };
  ```

  On the Rust side we then have
  ```rust
  pub enum DatabaseConfig {
      Memory,
      Sled { config: SledDbConfiguration },
  }
  ```

  And the resulting bindings go from (note that the bindings transform the enum into a sealed class rather than a Kotlin enum)
  ```kotlin
  sealed class DatabaseConfig  {

      data class Memory(
          val junk: String
          ) : DatabaseConfig()

      data class Sled(
          val config: SledDbConfiguration
          ) : DatabaseConfig()
  ```
  to
  ```kotlin
  sealed class DatabaseConfig  {
      object Memory : DatabaseConfig()

      data class Sled(
          val config: SledDbConfiguration
          ) : DatabaseConfig()
  ```

  Which makes the API simpler to use, and removes the confusion created by having to provide an empty string (or not know what we're supposed to provide) to the `Memory()` enum.

  The final call-site looks like this:
  ```kotlin
      fun onlineWalletSyncGetBalance() {
          // val db = DatabaseConfig.Memory("")
          val db = DatabaseConfig.Memory
          val client = BlockchainConfig.Electrum(
              ElectrumConfig(
                  "ssl://electrum.blockstream.info:60002",
                  null,
                  5u,
                  null,
                  100u
              )
          )
          val wallet = Wallet(descriptor, null, Network.REGTEST, databaseConfig, blockchainConfig)
          wallet.sync(LogProgress(), null)
          val balance = wallet.getBalance()
          assertTrue(balance > 0u)
      }
  ```

  All tests run well on my side of things, but I'm opening this more as a discussion piece because I wasn't sure if there were other reasons for the choice of providing the argument to the `Memory` enum, or other design choices I'm not aware of. Any thoughts on this @artfuldev? I think you were the one who wrote the initial enum.

Top commit has no ACKs.

Tree-SHA512: 135e5943039a08522773f721a7cf6bbb93bd5bb9394bf42a30bab5f3e16fd35ce078056756e020a666d4f574d74080bc3404cc81809c0d7e0afe5c9471878425
2022-03-14 10:02:04 -05:00
thunderbiscuit
cc3736809a
Fix memory database configuration enum 2022-03-14 10:01:45 -04:00
Steve Myers
4fc9fb916b
Merge bitcoindevkit/bdk-ffi#116: Add sqlite database support
12f4784b85fa2a263d9648dcccd8bac2da44644d Add sqlite database option (Steve Myers)

Pull request description:

  ### Description

  Add sqlite db database option.

  ### Notes to the reviewers

  When https://github.com/bitcoindevkit/bdk/pull/566 is released we need to updated this project to use the `sqlite-packaged` feature, see TODO in Cargo.toml.

ACKs for top commit:
  thunderbiscuit:
    Tested ACK [12f4784](12f4784b85).

Tree-SHA512: c39472507596e036dd81c22a05d424c6d363545b1a8bd622bf9647967b1b86ab44764da1a15169ac542c80a62a79331b5abcda7b657cc28d93ffdda51a62bd6e
2022-03-13 19:09:28 -05:00
Steve Myers
12f4784b85
Add sqlite database option 2022-03-11 22:45:37 -06:00
thunderbiscuit
1ff345ab1d
Merge pull request #12 from thunderbiscuit/bump-version
Bump version to v0.0.6.dev
2022-03-04 09:50:55 -05:00
thunderbiscuit
7c9a624eab
Add changelog 2022-03-04 09:07:27 -05:00
thunderbiscuit
8b50e8d3ad
Fix version numbering to comply with PEP 440 2022-03-04 08:53:11 -05:00
thunderbiscuit
6f848254bc
Add Apache 2.0 and MIT licenses 2022-03-03 16:40:51 -05:00
thunderbiscuit
680d3ccc86
Add feature request template 2022-03-03 16:28:45 -05:00
thunderbiscuit
e42e2c15e2
Add bug report template 2022-03-03 16:24:46 -05:00
thunderbiscuit
d41f787efd
Add pull request template 2022-03-03 16:06:34 -05:00
thunderbiscuit
e851f42aee
Bump version to v0.0.6-SNAPSHOT 2022-03-03 15:55:22 -05:00
thunderbiscuit
2ebd4979b0
Merge pull request #11 from thunderbiscuit/master
Bump bdk-ffi submodule to v0.3.0
2022-03-03 15:48:10 -05:00
Steve Myers
91b290e474
Bump version to 0.2.0 2022-03-02 20:29:38 -08:00
Steve Myers
61c75b24bd
Add example project to README 2022-03-02 20:17:11 -08:00
Steve Myers
2cd5fa6934
Update bdk-ffi to 0.3.1 2022-03-02 20:04:49 -08:00
Steve Myers
58e75d1a1d
Merge commit 'refs/pull/112/head' of github.com:bitcoindevkit/bdk-ffi 2022-03-02 14:49:41 -08:00
Steve Myers
89d58db02a
Bump version to 0.3.1 v0.3.1 2022-03-02 14:46:06 -08:00
Steve Myers
cda682b634
Remove hard coded sync progress value 2022-03-02 14:45:26 -08:00
Steve Myers
939a88214a
Remove hard coded sync progress value 2022-03-02 14:06:40 -08:00
thunderbiscuit
453dc6e7ea
Bump bdk-ffi submodule to v0.3.0 2022-03-01 10:37:18 -05:00
Steve Myers
1ec6d2538e
Add license files 2022-02-28 22:14:17 -08:00
Steve Myers
54a28d65b8
Merge branch 'master' into release/0.4 2022-02-28 21:49:04 -08:00
Steve Myers
9123cbbaef
Remove unused code 2022-02-28 21:43:19 -08:00
Steve Myers
9e35866a47
Merge commit 'refs/pull/10/head' of github.com:bitcoindevkit/bdk-kotlin 2022-02-28 21:39:16 -08:00
Steve Myers
a21b69a217
Fix jvm artifact version 2022-02-28 21:30:18 -08:00
Steve Myers
933af8c706
Fix jvm module junit dependency error 2022-02-28 21:11:25 -08:00
Steve Myers
5514dc577e
Bump version to 0.4.1-SNAPSHOT 2022-02-28 20:43:23 -08:00
Steve Myers
6195ba0896
Bump version to 0.4.0 2022-02-28 20:43:21 -08:00
Steve Myers
9a3f930148
Update README for bdk-jvm and bdk-android 0.4.0 2022-02-28 20:42:55 -08:00
Steve Myers
e7e4b0f48b
Update to pruned bdk-ffi v0.3.0 tag 2022-02-28 16:23:48 -08:00
Steve Myers
1bbd85378a Merge bitcoindevkit/bdk-ffi#107: Add license files
f3c6d97d818788abf562d116745effca3c734c9b Add license files (Steve Myers)
d17ea4b90c015c9a6cf5d2cf2f77e901d93fd089 Bump version to 0.3.0 (Steve Myers)
76fa9b95219945c8b92186c860e83270d0e95842 Add CHANGELOG.md (Steve Myers)

Pull request description:

  This issue is based on https://github.com/bitcoindevkit/bdk/issues/301, to be clear we should add license files to all our repositories.

  If you're on the below list and agree with this change please add a comment with "I hereby license my previous contributions to BDK under [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) and [MIT](https://choosealicense.com/licenses/mit/) licenses."

  - [x] @artfuldev
  - [x] @notmandatory
  - [x] @afilini
  - [x] @thunderbiscuit

Top commit has no ACKs.

Tree-SHA512: 7e0f2c7bf93d1cdb28cec979330790e00c1efd3ce80986e9084bc371fa73eda6413014e3ad8e598ca6ce1f797622dbfbe8339453de8d7ebefbb27fd5204bc4c6
2022-02-28 09:19:41 -08:00
thunderbiscuit
74f6d2bb9e
Remove compiler option for experimental unsigned types 2022-02-28 10:28:44 -05:00
Steve Myers
6df9a98fb6
Fix tests for bdk-ffi v0.3.0, add psbt serde test 2022-02-27 22:48:59 -08:00
Steve Myers
19e88e3e67
Update bdk-ffi to v0.3.0 2022-02-27 21:51:30 -08:00
Steve Myers
f3c6d97d81 Add license files 2022-02-27 21:26:23 -08:00
Steve Myers
d17ea4b90c Bump version to 0.3.0 v0.3.0 2022-02-27 21:18:05 -08:00
Steve Myers
76fa9b9521 Add CHANGELOG.md 2022-02-27 21:17:37 -08:00
Steve Myers
cafa8dacab Merge bitcoindevkit/bdk-ffi#104: Add PSBT deserialize and serialize functions, remove details
c039281ffcbaab8048ff87426a413c953a1e5ece Add PSBT deserialize and serialize functions, remove details (Steve Myers)
1f0b053872889f5dff340035a9e3cd3488688152 Fix bin/generate with no features (Steve Myers)

Pull request description:

  1. Fix bin/generate with no features
  2. Add `PartiallySignedBitcoinTransaction::deserialize` function as named constructor to decode from a string per [BIP 0174]
  3. Add `PartiallySignedBitcoinTransaction::serialize` function to encode to a string per [BIP 0174]
  4. Remove `PartiallySignedBitcoinTransaction.details` struct field

  [BIP 0174]:https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#encoding

  Fixes #103

Top commit has no ACKs.

Tree-SHA512: 0ba34d96625d71434d41573089a150d09fcfb6439648a7eed6e36dcdddd2682c969525b7c6efda898b2f979a7ca6ce51dc2158acf65da7f1f4c554d98b60f4ff
2022-02-25 14:47:47 -08:00
Steve Myers
c039281ffc Add PSBT deserialize and serialize functions, remove details 2022-02-24 20:49:59 -08:00
Steve Myers
1f0b053872 Fix bin/generate with no features 2022-02-24 17:17:05 -08:00
thunderbiscuit
95ef8eb3de
Migrate jvm module Gradle build script to Kotlin DSL 2022-02-23 15:19:18 -05:00
thunderbiscuit
25f5bd26b4
Migrate android module Gradle build script to Kotlin DSL 2022-02-23 15:18:13 -05:00
thunderbiscuit
4e66758048
Migrate project-level Gradle build script to Kotlin DSL 2022-02-23 15:11:05 -05:00
Steve Myers
bd13eca0f3
Add uniffi-bindgen version to README 2022-02-22 21:48:18 -08:00
Caio Faustino
4656cf50b5
Add step to install uniffi-bindgen on README
This step exists in bdk-ffi readme, but is missing in this repo,
and build.sh fails without it.
2022-02-22 21:46:23 -08:00
Steve Myers
77a5353469
Merge commit 'refs/pull/5/head' of github.com:bitcoindevkit/bdk-kotlin 2022-02-22 21:38:14 -08:00