From 1d619ceceee58823e063da0016c8aa3b1bd140b4 Mon Sep 17 00:00:00 2001 From: DanGould Date: Mon, 16 Dec 2024 11:24:27 -0500 Subject: [PATCH] DRAFT update to bdk-flutter@main really @b9d5af6 --- lib/_pkg/payjoin/manager.dart | 9 +++++---- lib/_pkg/wallet/bdk/transaction.dart | 7 ++++--- pubspec.lock | 11 ++++++----- pubspec.yaml | 12 +++--------- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/lib/_pkg/payjoin/manager.dart b/lib/_pkg/payjoin/manager.dart index 8f9267c8..82ca7b67 100644 --- a/lib/_pkg/payjoin/manager.dart +++ b/lib/_pkg/payjoin/manager.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'dart:isolate'; @@ -582,7 +583,7 @@ Future processPayjoinProposal( final signed = await wallet.sign( psbt: psbtStruct, signOptions: const bdk.SignOptions( - trustWitnessUtxo: false, + trustWitnessUtxo: true, allowAllSighashes: false, removePartialSigs: true, tryFinalize: true, @@ -590,10 +591,10 @@ Future processPayjoinProposal( 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), ); diff --git a/lib/_pkg/wallet/bdk/transaction.dart b/lib/_pkg/wallet/bdk/transaction.dart index 095fe3b8..9b5c56b4 100644 --- a/lib/_pkg/wallet/bdk/transaction.dart +++ b/lib/_pkg/wallet/bdk/transaction.dart @@ -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); } } @@ -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( @@ -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 ( diff --git a/pubspec.lock b/pubspec.lock index 254e0d50..e2166ce1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: diff --git a/pubspec.yaml b/pubspec.yaml index 41fb5f7f..714d8808 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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