Skip to content

Commit ac8d102

Browse files
Merge pull request #168 from LtbLightning/frb-upgrade
Frb upgrade
2 parents 2b3dcee + 6643ec1 commit ac8d102

33 files changed

Lines changed: 25080 additions & 46465 deletions

.github/workflows/precompile_binaries.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
os:
14-
- ubuntu-20.04
14+
- ubuntu-latest
1515
- macOS-latest
1616
steps:
1717
- uses: actions/checkout@v4
@@ -33,11 +33,11 @@ jobs:
3333
with:
3434
channel: 'stable'
3535
- name: Set up Android SDK
36-
if: (matrix.os == 'ubuntu-20.04')
37-
uses: android-actions/setup-android@v2
36+
if: (matrix.os == 'ubuntu-latest')
37+
uses: android-actions/setup-android@v2
3838
- name: Install Specific NDK
39-
if: (matrix.os == 'ubuntu-20.04')
40-
run: sdkmanager --install "ndk;25.1.8937393"
39+
if: (matrix.os == 'ubuntu-latest')
40+
run: sdkmanager --install "ndk;26.3.11579264"
4141
- name: Precompile (with iOS)
4242
if: (matrix.os == 'macOS-latest')
4343
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/bdk-flutter
@@ -46,8 +46,8 @@ jobs:
4646
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
4747
PRIVATE_KEY: ${{ secrets.CARGOKIT_PRIVATE_KEY }}
4848
- name: Precompile (with Android)
49-
if: (matrix.os == 'ubuntu-20.04')
50-
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/bdk-flutter --android-sdk-location=/usr/local/lib/android/sdk --android-ndk-version=25.1.8937393 --android-min-sdk-version=23
49+
if: (matrix.os == 'ubuntu-latest')
50+
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/bdk-flutter --android-sdk-location=/usr/local/lib/android/sdk --android-ndk-version=26.3.11579264 --android-min-sdk-version=23
5151
working-directory: cargokit/build_tool
5252
env:
5353
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

CHANGELOG.md

Lines changed: 85 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,172 +1,243 @@
11
## [0.31.3]
2+
23
#### Upgrades
3-
- Updated `Flutter` dependencies to the latest version.
4-
- Upgraded `Gradle` to version 8.4 and `Java` to version 17.
5-
- Upgraded `android-ndk` to `25.1.8937393`.
4+
5+
- Updated `Flutter` and `Rust` dependencies to the latest version.
6+
- Upgraded `Gradle` to version 8.4.0 and `Java` to version 17.
7+
- Upgraded `android-ndk` to `26.3.11579264`.
8+
69
#### Fixed
10+
711
- Removed unnecessary class exports.
812
- Resolved the `txBuilder.setRecipients` error.
13+
- Resolved class incompatibility issues and renamed conflicting classes.
914

1015
## [0.31.2]
16+
1117
Updated `flutter_rust_bridge` to `2.0.0`.
18+
1219
#### APIs added
20+
1321
- Exposed `createTestnet` & `createMutinynet` to `Blockchain`.
14-
- Exposed `policies` in `Wallet`.
22+
- Exposed `policies` in `Wallet`.
1523
- Exposed `policyPath` in `TxBuilder`.
1624
- Exposed `id`, `requiresPath`, `item`, `satisfaction`, `contribution` in `Policy` class.
1725
- Overrode `toString()` for `Address`, `DerivationPath`, `Descriptor`, `DescriptorPublicKey` , `DescriptorSecretKey`, `Mnemonic`,
1826
- `PartiallySignedTransaction`, `ScriptBuf` & `Transaction`.
27+
1928
#### Changed
29+
2030
- `partiallySignedTransaction.serialize()` serialize the data as raw binary.
31+
2132
#### Fixed
33+
2234
- Thread `frb_workerpool` panicked on Sql database access.
2335

2436
## [0.31.2-dev.2]
37+
2538
#### Fixed
26-
- Thread `frb_workerpool` panicked on invalid `Fingerprint`.
39+
40+
- Thread `frb_workerpool` panicked on invalid `Fingerprint`.
2741
- `SignOptions` issue to accept `witness-utxo` while signing.
2842

2943
#### Changed
44+
3045
- Removed `multiSig` variable from `SignOptions`.
3146
- Updated example app to support `mutinynet`.
32-
- Mapped `Hex`, `Address`, `Descriptor` & `Consensus` exceptions.
47+
- Mapped `Hex`, `Address`, `Descriptor` & `Consensus` exceptions.
3348

3449
## [0.31.2-dev.1]
50+
3551
#### Fixed
52+
3653
- Invalid `Bip49Public`, `Bip84Public` & `Bip86Public`.
3754

3855
## [0.31.2-dev]
56+
3957
Updated Rust and Flutter dependencies.
58+
4059
#### APIs added
60+
4161
- Add `InvalidInputException`, `InvalidLockTimeException` & `InvalidTransactionException` .
62+
4263
#### Fixed
64+
4365
- Thread `frb_workerpool` panic on `UnknownUtxo` and `InvalidPsbtInput`.
4466

4567
## [0.31.1-dev]
68+
4669
#### Fixed
70+
4771
- Failed to load `.so` files in android.
4872

4973
## [0.31.0-dev]
74+
5075
Updated Rust and Flutter dependencies.
76+
5177
#### APIs added
78+
5279
- Add sealed class `Auth` in `RpcConfig`.
5380
- Made `PartiallySignedTransaction` class mutable.
5481

5582
#### Changed
83+
5684
- Replace `AddressIndex`'s `new` with`increase`.
5785
- Renamed `Address`'s create to `fromString`.
5886
- `txBuilder.finish` returns a tuple.
5987
- Added `cargokit` to handle rust binary build
6088

6189
#### Fixed
90+
6291
- Functions hang indefinitely on iOS devices.
6392
- Thread `frb_workerpool` panicked.
6493

6594
## [0.30.0]
95+
6696
Updated Rust and Flutter dependencies.
6797
MacOS support bug resolved
98+
6899
#### APIs added
100+
69101
- Add BIP-86 descriptor template
70102

71103
## [0.29.2]
104+
72105
Support MacOS and unit testing.
73106
Updated flutter dependencies.
74107

75108
## [0.29.1]
109+
76110
Updated Rust and Flutter dependencies.
77111
Exposed strongly-typed exceptions.
78112

79113
## [0.29.0]
114+
80115
Support Dart 3.
81116
Updated Rust and Flutter dependencies.
117+
82118
#### APIs added
119+
83120
- Add `isMine` method to `Wallet`.
84121
- Expose script.toBytes() method.
85122

86123
## [0.28.3]
124+
87125
### Fixed
126+
88127
- Multisig issue resolved by adding isMultiSig to signOptions.
89128

90129
## [0.28.2]
130+
91131
#### APIs added
132+
92133
- Expose `Wallet` class's `getDescriptorForKeyChain` and `getPsbtInput` functions.
93134
- Expose `TxBuilder` class's `addForeignUtxo` function.
94135
- Add `Input` class.
95136
- Expose `Descriptor` class's `maxSatisfactionWeight` function.
96137

97138
## [0.28.1]
139+
98140
### Fixed
141+
99142
- Invalid UTF-8 error for txansaction.input().
100143

101144
## [0.28.0]
145+
102146
Updated Rust ( Bdk to latest version 0.28.0 ) and Flutter dependencies.
147+
103148
#### APIs added
149+
104150
- Expose `Address` class's `payload` and `network` functions
105151
- Add `fromScript` constructor to `Address` class
106152
- Add `SignOptions` to Wallet.sign() params.
107153
- Add `jsonSerialize` function to `PartiallySignedTransaction`, to get the JSON serialized value of all PSBT fields.
108-
- Expose `Transaction` class's `txid`, `weight`, `size`, `vsize`, `isCoinBase`, `isExplicitlyRbf`, `version`, `isLockTimeEnabled`, `lockTime`, `input` and `output` functions.
154+
- Expose `Transaction` class's `txid`, `weight`, `size`, `vsize`, `isCoinBase`, `isExplicitlyRbf`, `version`, `isLockTimeEnabled`, `lockTime`, `input` and `output` functions.
109155

110156
## [0.27.2]
157+
111158
### API changed
159+
112160
- txBuilder.finish() & bumpFeeTxBuilder.finish() returns a `TxBuilderResult` instead of a `PartiallySignedTransaction`.
113161

114162
## [0.27.1]
163+
115164
Updated Rust ( Bdk to latest version 0.27.1 ) and Flutter dependencies.
165+
116166
#### APIs added
167+
117168
- New `Transaction` class that can be created from or serialized to consensus encoded bytes.
118169
- Add estimateFee(int Target) function for `Blockchain`
119170
- Add getInternalAddress() function for `Wallet`
120171
- Add AddressIndex.reset(int index) & AddressIndex.peek(int index)
172+
121173
#### APIs changed
174+
122175
- partiallySignedTransaction.extractTx() returns a `Transaction` instead of a the transaction bytes.
123176
- blockchain.broadcast() takes a `Transaction` instead of a `PartiallySignedTransaction`
124177

125178
## [0.3.2]
179+
126180
### Fixed
181+
127182
- iOS build issue when using flavors
128183
- Added toString method for all objects
129184

130185
## [0.3.1]
186+
131187
### Fixed
188+
132189
- Pub.dev analysis score
133190
- Type mismatch for descriptorSecretKey
134191

135192
## [0.3.0]
193+
136194
Updated Rust ( Bdk to latest version 0.26.0 ) and Flutter dependencies.
195+
137196
#### APIs changed
197+
138198
- The descriptor and changeDescriptor arguments on the wallet constructor now take a `Descriptor` instead of a String.
199+
139200
#### APIs added
201+
140202
- Added RpcConfig, BlockchainConfig.rpc
141203
- Added Descriptor type with the following named constructors:
142204
- Default `create` constructor, that requires a descriptor in String format and a Network
143-
- newBip44 constructor returns a Descriptor with structure pkh(key/44'/{0,1}'/0'/{0,1}/*)
144-
- newBip44Public constructor returns a Descriptor with structure pkh(key/{0,1}/*)
145-
- newBip49 constructor returns a Descriptor with structure sh(wpkh(key/49'/{0,1}'/0'/{0,1}/*))
146-
- newBip49Public constructor returns a Descriptor with structure sh(wpkh(key/{0,1}/*))
147-
- newBip84 constructor returns a Descriptor with structure wpkh(key/84'/{0,1}'/0'/{0,1}/*)
148-
- newBip84Public constructor returns a Descriptor with structure wpkh(key/{0,1}/*)
205+
- newBip44 constructor returns a Descriptor with structure pkh(key/44'/{0,1}'/0'/{0,1}/\*)
206+
- newBip44Public constructor returns a Descriptor with structure pkh(key/{0,1}/\*)
207+
- newBip49 constructor returns a Descriptor with structure sh(wpkh(key/49'/{0,1}'/0'/{0,1}/\*))
208+
- newBip49Public constructor returns a Descriptor with structure sh(wpkh(key/{0,1}/\*))
209+
- newBip84 constructor returns a Descriptor with structure wpkh(key/84'/{0,1}'/0'/{0,1}/\*)
210+
- newBip84Public constructor returns a Descriptor with structure wpkh(key/{0,1}/\*)
149211
- asString returns the public version of the output descriptor in String format
150212
- asPrivateString returns the private version of the output descriptor if available, otherwise, return the public version
151213

152214
## [0.2.3]
215+
153216
### Fixed
217+
154218
- pub.dev analysis score
155219

156220
## [0.2.2]
221+
157222
### Fixed
223+
158224
- pub.dev analysis score
159225

160226
## [0.2.1]
227+
161228
### Fixed
229+
162230
- pub.dev static analysis warning
163231
- removing internal helper functions from public api
164232

165233
## [0.2.0]
234+
166235
Updated API to match bdk-ffi
167236

168237
## [0.1.4]
238+
169239
#### Functionality Added
240+
170241
- Generate Mnemonic method
171242
- Create Descriptors
172243
- Create Extended Key
@@ -183,4 +254,4 @@ Updated API to match bdk-ffi
183254
- Create Transaction
184255
- Sign Transaction
185256
- Broadcast Transaction
186-
- Quick Send
257+
- Quick Send

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ final bdkWallet = .....
102102
final txBuilder = TxBuilder();
103103
final address = await Address.fromString(s: "mv4rnyY3Su5gjcDNzbMLKBQkBicCtHUtFB", network: Network.testnet);
104104
105-
final script = await address.scriptPubkey();
105+
final script = address.scriptPubkey();
106106
final feeRate = await blockchain.estimateFee(target: 25);
107107
108108
final (psbt, transactionDetails) = await txBuilder.feeRate( feeRate.satPerVb )
109109
.addRecipient( script, 2000 )
110110
.finish( bdkWallet );
111111
112-
final serializedPsbt = await psbt.jsonSerialize();
112+
final serializedPsbt = psbt.jsonSerialize();
113113
final jsonObject = json.decode(serializedPsbt);
114114
final outputs = jsonObject['unsigned_tx']['output'] as List;
115115
final inputs = jsonObject['inputs'][0]['non_witness_utxo']['output'] as List;
@@ -141,7 +141,7 @@ final descriptorSecretKey = await DescriptorSecretKey.create(
141141
// create external descriptor
142142
final derivationPath = await DerivationPath.create(path: "m/44h/1h/0h/0");
143143
final descriptorPrivateKey =
144-
await descriptorSecretKey.derive(derivationPath);
144+
descriptorSecretKey.derive(derivationPath);
145145
final Descriptor descriptorPrivate = await Descriptor.create(
146146
descriptor: "pkh(${descriptorPrivateKey.toString()})",
147147
network: Network.testnet,
@@ -151,7 +151,7 @@ final Descriptor descriptorPrivate = await Descriptor.create(
151151
final derivationPathInt =
152152
await DerivationPath.create(path: "m/44h/1h/0h/1");
153153
final descriptorPrivateKeyInt =
154-
await descriptorSecretKey.derive(derivationPathInt);
154+
descriptorSecretKey.derive(derivationPathInt);
155155
final Descriptor descriptorPrivateInt = await Descriptor.create(
156156
descriptor: "pkh(${descriptorPrivateKeyInt.toString()})",
157157
network: Network.testnet,
@@ -165,9 +165,9 @@ final bdkWallet = await Wallet.create(
165165
);
166166
167167
final address =
168-
await bdkWallet.getAddress(addressIndex: const AddressIndex.increase());
168+
bdkWallet.getAddress(addressIndex: const AddressIndex.increase());
169169
final internalAddress =
170-
await bdkWallet.getInternalAddress(addressIndex: const AddressIndex.increase());
170+
bdkWallet.getInternalAddress(addressIndex: const AddressIndex.increase());
171171
172172
```
173173

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
}
88

99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.2.1'
10+
classpath 'com.android.tools.build:gradle:8.4.0'
1111
}
1212
}
1313

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
android {
1010
namespace = "io.bdk.f.bdk_flutter_example"
1111
compileSdk = flutter.compileSdkVersion
12-
ndkVersion = "25.1.8937393"
12+
ndkVersion = "26.3.11579264"
1313

1414
compileOptions {
1515
sourceCompatibility JavaVersion.VERSION_17

0 commit comments

Comments
 (0)