mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
fix: add UR to cw_bitcoin, fix payjoin issue
This commit is contained in:
parent
a5b6ae6475
commit
355218753d
5 changed files with 38 additions and 1 deletions
|
@ -181,6 +181,7 @@ class BitcoinWalletService extends WalletService<
|
||||||
unspentCoinsInfo: unspentCoinsInfoSource,
|
unspentCoinsInfo: unspentCoinsInfoSource,
|
||||||
networkParam: network,
|
networkParam: network,
|
||||||
encryptionFileUtils: encryptionFileUtilsFor(isDirect),
|
encryptionFileUtils: encryptionFileUtilsFor(isDirect),
|
||||||
|
payjoinBox: payjoinSessionSource,
|
||||||
);
|
);
|
||||||
|
|
||||||
await wallet.save();
|
await wallet.save();
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:typed_data';
|
||||||
|
|
||||||
import 'package:cw_bitcoin/electrum_wallet.dart';
|
import 'package:cw_bitcoin/electrum_wallet.dart';
|
||||||
import 'package:grpc/grpc.dart';
|
import 'package:grpc/grpc.dart';
|
||||||
import 'package:cw_bitcoin/exceptions.dart';
|
import 'package:cw_bitcoin/exceptions.dart';
|
||||||
|
@ -11,6 +14,9 @@ import 'package:cw_core/transaction_direction.dart';
|
||||||
import 'package:cw_core/wallet_type.dart';
|
import 'package:cw_core/wallet_type.dart';
|
||||||
import 'package:cw_mweb/cw_mweb.dart';
|
import 'package:cw_mweb/cw_mweb.dart';
|
||||||
import 'package:cw_mweb/mwebd.pb.dart';
|
import 'package:cw_mweb/mwebd.pb.dart';
|
||||||
|
import 'package:ur/cbor_lite.dart';
|
||||||
|
import 'package:ur/ur.dart';
|
||||||
|
import 'package:ur/ur_encoder.dart';
|
||||||
|
|
||||||
class PendingBitcoinTransaction with PendingTransaction {
|
class PendingBitcoinTransaction with PendingTransaction {
|
||||||
PendingBitcoinTransaction(
|
PendingBitcoinTransaction(
|
||||||
|
@ -165,6 +171,11 @@ class PendingBitcoinTransaction with PendingTransaction {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<String?> commitUR() {
|
Future<String?> commitUR() {
|
||||||
return Future.value("test");
|
var sourceBytes = Uint8List.fromList(utf8.encode(hex));
|
||||||
|
var cborEncoder = CBOREncoder();
|
||||||
|
cborEncoder.encodeBytes(sourceBytes);
|
||||||
|
var ur = UR("psbt", cborEncoder.getBytes());
|
||||||
|
var encoded = UREncoder.encode(ur);
|
||||||
|
return Future.value(encoded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1101,6 +1101,23 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.0"
|
version: "0.3.0"
|
||||||
|
ur:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
path: "."
|
||||||
|
ref: "5738f70d0ec3d50977ac3dd01fed62939600238b"
|
||||||
|
resolved-ref: "5738f70d0ec3d50977ac3dd01fed62939600238b"
|
||||||
|
url: "https://github.com/bukata-sa/bc-ur-dart"
|
||||||
|
source: git
|
||||||
|
version: "0.1.0"
|
||||||
|
uuid:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: uuid
|
||||||
|
sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.5.1"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -58,6 +58,10 @@ dependencies:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/sneurlax/socks_socket
|
url: https://github.com/sneurlax/socks_socket
|
||||||
ref: e6232c53c1595469931ababa878759a067c02e94
|
ref: e6232c53c1595469931ababa878759a067c02e94
|
||||||
|
ur:
|
||||||
|
git:
|
||||||
|
url: https://github.com/bukata-sa/bc-ur-dart
|
||||||
|
ref: 5738f70d0ec3d50977ac3dd01fed62939600238b
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
|
@ -130,6 +130,10 @@ dependencies:
|
||||||
url: https://github.com/MrCyjaneK/flutter_daemon
|
url: https://github.com/MrCyjaneK/flutter_daemon
|
||||||
ref: c24ee99f2f3070ea02d8108bbdd7727d73f7e5f1
|
ref: c24ee99f2f3070ea02d8108bbdd7727d73f7e5f1
|
||||||
flutter_local_notifications: ^19.0.0
|
flutter_local_notifications: ^19.0.0
|
||||||
|
ur:
|
||||||
|
git:
|
||||||
|
url: https://github.com/bukata-sa/bc-ur-dart
|
||||||
|
ref: 5738f70d0ec3d50977ac3dd01fed62939600238b
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue