Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Rust
/target
native/target/
**/*.rs.bk
Cargo.lock

Expand All @@ -25,7 +26,8 @@ Thumbs.db
*.log

# Native libs built locally
libbdkffi.*
*.dylib
*.so
*.dll
test_output.txt
test output.txt
lib/bdk.dart
50 changes: 30 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,45 +1,55 @@
[package]
name = "bdk-dart"
version = "2.0.0-alpha.0"
version = "2.3.0-alpha.0"
homepage = "https://bitcoindevkit.org"
repository = "https://github.com/bitcoindevkit/bdk-dart"
edition = "2021"
license = "MIT OR Apache-2.0"

[lib]
crate-type = ["lib", "staticlib", "cdylib"]
name = "bdkffi"
name = "bdk_ffi"
path = "bdk-ffi/bdk-ffi/src/lib.rs"

[[bin]]
name = "uniffi-bindgen"
path = "uniffi-bindgen.rs"

[features]
default = ["uniffi/cli"]

[dependencies]
bdk_wallet = { version = "2.2.0", features = ["all-keys", "keys-bip39", "rusqlite"] }
bdk_esplora = { version = "0.22.1", default-features = false, features = ["std", "blocking", "blocking-https-rustls"] }
bdk_electrum = { version = "0.23.2", default-features = false, features = ["use-rustls-ring"] }
bdk_kyoto = { version = "0.15.1" }

uniffi = { version = "=0.29.4" }
uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart.git", rev = "946c5642c0521a184c4b52dcf0d203edb97f1ffc" }
bdk_wallet = { version = "2.2.0", features = [
"all-keys",
"keys-bip39",
"rusqlite",
] }
bdk_esplora = { version = "0.22.1", default-features = false, features = [
"std",
"blocking",
"blocking-https-rustls",
] }
bdk_electrum = { version = "0.23.2", default-features = false, features = [
"use-rustls-ring",
] }
bdk_kyoto = { version = "0.15.3" }

uniffi = { version = "=0.30.0", features = ["cli"] }
uniffi-dart = { git = "https://github.com/kumulynja/uniffi-dart" }
camino = "1.2"
thiserror = "1.0.65"

[build-dependencies]
uniffi = { version = "=0.29.4", features = ["build"] }
uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart.git", rev = "946c5642c0521a184c4b52dcf0d203edb97f1ffc", features = ["build"] }
uniffi = { version = "=0.30.0", features = ["build"] }
uniffi-dart = { git = "https://github.com/kumulynja/uniffi-dart", features = [
"build",
] }

[dev-dependencies]
uniffi = { version = "=0.29.4", features = ["bindgen-tests"] }
uniffi = { version = "=0.30.0", features = ["bindgen-tests"] }
assert_matches = "1.5.0"

[profile.release-smaller]
inherits = "release"
opt-level = 'z' # Optimize for size.
lto = true # Enable Link Time Optimization
codegen-units = 1 # Reduce number of codegen units to increase optimizations.
panic = "abort" # Abort on panic
strip = "debuginfo" # Partially strip symbols from binary
opt-level = 'z' # Optimize for size.
lto = true # Enable Link Time Optimization
codegen-units = 1 # Reduce number of codegen units to increase optimizations.
panic = "abort" # Abort on panic
strip = "debuginfo" # Partially strip symbols from binary
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# BDK Dart Bindings

Welcome to the Dart language bindings for the [Bitcoin Dev Kit](https://bitcoindevkit.org/)!

## Running Tests

Follow these steps to clone the repository and run the tests.

```shell
git clone https://github.com/bitcoindevkit/bdk-dart.git
cd bdk-dart

# Generate the bindings
bash ./scripts/generate_bindings.sh

# Run all tests
dart test
```
2 changes: 1 addition & 1 deletion bdk_demo/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>12.0</string>
<string>13.0</string>
</dict>
</plist>
1 change: 1 addition & 0 deletions bdk_demo/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions bdk_demo/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
43 changes: 43 additions & 0 deletions bdk_demo/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Uncomment this line to define a global platform for your project
platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
16 changes: 16 additions & 0 deletions bdk_demo/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
PODS:
- Flutter (1.0.0)

DEPENDENCIES:
- Flutter (from `Flutter`)

EXTERNAL SOURCES:
Flutter:
:path: Flutter

SPEC CHECKSUMS:
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467

PODFILE CHECKSUM: 251cb053df7158f337c0712f2ab29f4e0fa474ce

COCOAPODS: 1.16.2
Loading