888 Commits

Author SHA1 Message Date
Kirill Zhukov
16e6a4b170
Update README and build.sh script to use latest env var naming.
ANDROID_HOME, ANDROID_SDK_HOME, and ANDROID_NDK_HOME are not used by the Android platform and SDK tools so these are considered deprecated/invalid.

Google recommends using ANDROID_SDK_ROOT and ANDROID_NDK_ROOT instead:
- https://groups.google.com/g/android-ndk/c/qZjhOaynHXc/m/2ux2ZZdxy2MJ
- https://developer.android.com/studio/command-line/variables
2022-03-20 16:52:56 -07:00
Kirill Zhukov
aea8d703e1
Enable publishing sources and javadocs for bdk-android.
This resolves bitcoindevkit#32.
Using new API from AGP 7.1.0 to generate and publish Android sources and javadocs.

https://developer.android.com/studio/releases/gradle-plugin#publish-javadoc-jar
https://developer.android.com/studio/releases/gradle-plugin#publish-sources-jar
2022-03-20 15:47:21 -07:00
Kirill Zhukov
bb9d0869ac
Update AGP to 7.1.2.
AGP 7.1.0 adds maven-publish APIs for making publishing javadocs and sources for Android libraries very easy. We can use that to resolve #32.

Changelog: https://developer.android.com/studio/releases/gradle-plugin#versioning-update.
2022-03-20 15:47:19 -07:00
thunderbiscuit
aa13e113fa
Add required files for API docs 0.5.1 2022-03-19 11:11:44 -04:00
thunderbiscuit
6332e78375
Add ability to generate dokka docs 2022-03-19 11:11:25 -04:00
thunderbiscuit
f1f69c6fdf
Add basic CI workflow that runs tests on pull requests
Fixes #27
2022-03-18 14:10:34 -04:00
thunderbiscuit
e139e3d999
Merge pull request #26 from thunderbiscuit/fix/memory
Fix database memory test
2022-03-17 17:23:27 -04:00
thunderbiscuit
fadaef5105
Fix database memory test 2022-03-17 17:19:17 -04:00
Steve Myers
bb1e69e73f
Increment version to 0.6.0-SNAPSHOT 2022-03-17 16:10:23 -05:00
Steve Myers
dc9ad20d99
Add javadocs to jvm build 2022-03-17 16:06:12 -05:00
Steve Myers
e9111f74c5
Update bdk-ffi to 0.4.1 2022-03-17 13:38:59 -05:00
Steve Myers
b1d483463f
Merge bitcoindevkit/bdk-ffi#120: Fix Wallet.broadcast function, now returns a tx id as a hex string
851f61296a16fb9dfbcad00e3e3f11331a56eb12 Fix Wallet.broadcast function, now returns a tx id as a hex string (Steve Myers)

Pull request description:

ACKs for top commit:
  thunderbiscuit:
    Tested ACK 851f612.

Tree-SHA512: 86e1d39029924e4fa3a0c21e9f45c1ba0694f4db9d1cfd8dee25a5675d5a8b7851a7c712ce57fb74382a7428fcecbe8ecee4b7b87b9245672bbd6ccea63dfc13
2022-03-16 16:53:20 -05:00
Steve Myers
851f61296a
Fix Wallet.broadcast function, now returns a tx id as a hex string 2022-03-15 20:50:12 -05:00
thunderbiscuit
322b5b4343
Merge pull request #14 from thunderbiscuit/community
Add community related files
2022-03-15 19:08:32 -04:00
thunderbiscuit
4e4d2c64b4
Add documentation on how to skip signing task for local Maven 2022-03-15 13:47:08 -04:00
Steve Myers
a1b4d66f47
Fix README example 2022-03-15 08:59:58 -05:00
Steve Myers
a495bd9605
Update bdk-ffi to v0.4.0 2022-03-14 15:24:10 -05:00
Steve Myers
b0b44550a1
Add sqlite database option 2022-03-14 15:15:13 -05:00
Steve Myers
5128ce8d5b
Bump version to 0.4.1 2022-03-14 14:46:31 -05:00
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