Skip to content

Commit

Permalink
Merge pull request #61 from LtbLightning/updgrade-v0.27.1
Browse files Browse the repository at this point in the history
Upgrade to bdk ffi v0.27.1
  • Loading branch information
StaxoLotl authored Mar 7, 2023
2 parents 13fbbf3 + d024607 commit 6bb09ef
Show file tree
Hide file tree
Showing 36 changed files with 4,343 additions and 2,374 deletions.
18 changes: 15 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
## [0.3.2]
## [0.27.1]
Updated Rust ( Bdk to latest version 0.27.1 ) and Flutter dependencies.

#### APIs added
- New `Transaction` class that can be created from or serialized to consensus encoded bytes.
- Add estimateFee(int Target) function for `Blockchain`
- Add getInternalAddress() function for `Wallet`
- Add AddressIndex.reset(int index) & AddressIndex.peek(int index)

#### APIs changed
- partiallySignedTransaction.extractTx() returns a `Transaction` instead of a the transaction bytes.
- blockchain.broadcast() takes a `Transaction` instead of a `PartiallySignedTransaction`

## [0.3.2]
### Fixed
- iOS build issue when using flovors
- iOS build issue when using flavors
- Added toString method for all objects
## [0.3.1]

## [0.3.1]
### Fixed
- Pub.dev analysis score
- Type mismatch for descriptorSecretKey
Expand Down
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@ To use the `bdk_flutter` package in your project, add it as a dependency in your

```dart
dependencies:
bdk_flutter: ^0.3.2
bdk_flutter: ^0.27.1
```

`bdk-flutter` can then be imported and used in your Flutter code. For example:
### Examples

### Create a Wallet & sync the balance of a descriptor

```dart
import 'package:bdk_flutter/bdk_flutter.dart';
// ....
final mnemonic = await Mnemonic.create(WordCount.Words12);
final mnemonic = await Mnemonic.create(WordCount.Words12);
final descriptorSecretKey = await DescriptorSecretKey.create( network: Network.Testnet,
mnemonic: mnemonic );
final externalDescriptor = await Descriptor.newBip44( descriptorSecretKey: descriptorSecretKey,
Expand All @@ -45,8 +46,26 @@ final wallet = await Wallet.create( descriptor: externalDescriptor,
changeDescriptor: internalDescriptor,
network: Network.TESTNET,
databaseConfig: const DatabaseConfig.memory() );
final addressInfo = await wallet.getAddress( addressIndex: AddressIndex.New );
await wallet.sync( blockchain );
final _ = await wallet.sync( blockchain );
```

### Create a `public` wallet descriptor

```dart
import 'package:bdk_flutter/bdk_flutter.dart';
// ....
final mnemonic = await Mnemonic.create(WordCount.Words12);
final descriptorSecretKey = await DescriptorSecretKey.create( network: Network.Testnet,
mnemonic: mnemonic );
final externalDescriptor = await Descriptor.newBip44( descriptorSecretKey: descriptorSecretKey,
network: Network.Testnet,
keychain: KeyChainKind.External );
final externalPublicDescriptorStr = await externalDescriptor.asString();
final externalPublicDescriptor = await Descriptor.( descriptor: externalPublicDescriptorStr,
network: Network.Testnet);
```

### API Documentation
Expand Down
11 changes: 11 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ include: package:lints/recommended.yaml
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

linter:
rules:
prefer_single_quotes: false
avoid_void_async: false
prefer_interpolation_to_compose_strings: false
avoid_print: false
use_build_context_synchronously: false
unnecessary_string_escapes: false
avoid_dynamic_calls: false
non_constant_identifier_names: false

analyzer:
exclude:
- lib/src/generated/bindings.dart
Expand Down
Binary file modified android/src/main/jniLibs/arm64-v8a/librust.so
Binary file not shown.
Binary file modified android/src/main/jniLibs/armeabi-v7a/librust.so
Binary file not shown.
Binary file modified android/src/main/jniLibs/x86/librust.so
Binary file not shown.
3 changes: 1 addition & 2 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'
platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- bdk_flutter (0.3.0):
- bdk_flutter (0.27.1):
- Flutter
- Flutter (1.0.0)

Expand All @@ -14,9 +14,9 @@ EXTERNAL SOURCES:
:path: Flutter

SPEC CHECKSUMS:
bdk_flutter: e07886d29c53a9c7deba3bec3b20418ce5bd9787
bdk_flutter: 45bcefee47c051c8c42e507d6a3a708bdd0aadea
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
PODFILE CHECKSUM: 6998435987a000fdec9b2e1b5b1eef6d54bdba77

COCOAPODS: 1.11.3
4 changes: 3 additions & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -220,6 +220,7 @@
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand All @@ -234,6 +235,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down
Loading

0 comments on commit 6bb09ef

Please sign in to comment.