Skip to content

Commit

Permalink
DRAFT update to bdk-flutter@main
Browse files Browse the repository at this point in the history
really @b9d5af6
  • Loading branch information
DanGould committed Dec 16, 2024
1 parent 5e290ea commit 1d619ce
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
9 changes: 5 additions & 4 deletions lib/_pkg/payjoin/manager.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:isolate';

Expand Down Expand Up @@ -582,18 +583,18 @@ Future<PayjoinProposal> processPayjoinProposal(
final signed = await wallet.sign(
psbt: psbtStruct,
signOptions: const bdk.SignOptions(
trustWitnessUtxo: false,
trustWitnessUtxo: true,
allowAllSighashes: false,
removePartialSigs: true,
tryFinalize: true,
signWithTapInternalKey: true,
allowGrinding: true,
),
);
print('signed $signed');
final signedPsbt = psbtStruct.toString();
print('finalizeProposal signed $signed');
final signedPsbt = psbtStruct.serialize();
print('signedPsbt $signedPsbt');
return signedPsbt;
return base64Encode(signedPsbt);
},
maxFeeRateSatPerVb: BigInt.from(10000),
);
Expand Down
7 changes: 4 additions & 3 deletions lib/_pkg/wallet/bdk/transaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ class BDKTransactions {
for (final tx in transactions) {
if (tx.isPending() && tx.isReceived()) {
pendingTxs.add(tx);
final ip = await tx.bdkTx?.transaction?.input() ?? [];
pendingTxInputs.add(ip);
// final ip = await tx.bdkTx?.transaction?.input() ?? [];
// pendingTxInputs.add(ip);
}
}

Expand Down Expand Up @@ -593,6 +593,7 @@ class BDKTransactions {
// required String address,
}) async {
try {
print('signTx psbt: $psbt');
final psbtStruct = await bdk.PartiallySignedTransaction.fromString(psbt);
final tx = psbtStruct.extractTx();
final _ = await bdkWallet.sign(
Expand All @@ -609,7 +610,7 @@ class BDKTransactions {
);
// final extracted = await finalized;
final psbtStr = psbtStruct.serialize();

print('signTx psbtStr: ${base64Encode(psbtStr)}');
return ((tx, base64Encode(psbtStr)), null);
} on Exception catch (e) {
return (
Expand Down
11 changes: 6 additions & 5 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ packages:
bdk_flutter:
dependency: "direct main"
description:
name: bdk_flutter
sha256: ce4f6320095389ebd3eaae37e2213775de950722150d762fb9a661fd4b4eb9e0
url: "https://pub.dev"
source: hosted
version: "0.31.2"
path: "."
ref: main
resolved-ref: b9d5af6df7354063de3ad047c6b5cb95b5144f36
url: "https://github.com/LtbLightning/bdk-flutter"
source: git
version: "0.31.3"
bitcoin_utils:
dependency: "direct main"
description:
Expand Down
12 changes: 3 additions & 9 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@ dependencies:
sdk: flutter

bdk_flutter:
^0.31.2
# ^0.28.3
# path: ../bdk-flutter
# git:
# url: https://github.com/LtbLightning/bdk-flutter
# ref: pre-compiled-binaries
# git:
# url: https://github.com/LtbLightning/bdk-flutter
# ref: 6cbadd9d7267d0fbb8626dfb403fb5d562046543
git:
url: https://github.com/LtbLightning/bdk-flutter
ref: main
payjoin_flutter:
git:
url: https://github.com/LtbLightning/payjoin-flutter
Expand Down

0 comments on commit 1d619ce

Please sign in to comment.