File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,11 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
354
354
publicKeys: tx.publicKeys! ,
355
355
masterFingerprint: Uint8List (0 ));
356
356
357
+ if (isCupcake) {
358
+ tx.unsignedPsbt = transaction.serialize ();
359
+ return tx;
360
+ }
361
+
357
362
final originalPsbt =
358
363
await signPsbt (base64.encode (transaction.asPsbtV0 ()), getUtxoWithPrivateKeys ());
359
364
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class PendingBitcoinTransaction with PendingTransaction {
34
34
this .utxos = const [],
35
35
this .publicKeys,
36
36
this .commitOverride,
37
+ this .unsignedPsbt,
37
38
}) : _listeners = < void Function (ElectrumTransactionInfo transaction)> [];
38
39
39
40
final WalletType type;
@@ -55,6 +56,8 @@ class PendingBitcoinTransaction with PendingTransaction {
55
56
final Map <String , PublicKeyWithDerivationPath >? publicKeys;
56
57
Future <void > Function ()? commitOverride;
57
58
59
+ Uint8List ? unsignedPsbt;
60
+
58
61
@override
59
62
String get id => idOverride ?? _tx.txId ();
60
63
@@ -168,10 +171,10 @@ class PendingBitcoinTransaction with PendingTransaction {
168
171
inputAddresses: _tx.inputs.map ((input) => input.txId).toList (),
169
172
outputAddresses: outputAddresses,
170
173
fee: fee);
171
-
174
+
172
175
@override
173
176
Future <String ?> commitUR () {
174
- var sourceBytes = Uint8List . fromList (utf8. encode (hex)) ;
177
+ var sourceBytes = unsignedPsbt ! ;
175
178
var cborEncoder = CBOREncoder ();
176
179
cborEncoder.encodeBytes (sourceBytes);
177
180
var ur = UR ("psbt" , cborEncoder.getBytes ());
You can’t perform that action at this time.
0 commit comments