mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
Fixes for litecoin transactions. Change fixed rate mode for exchange.
This commit is contained in:
parent
18a1f60433
commit
989ef442ac
5 changed files with 45 additions and 77 deletions
23
cw_bitcoin/lib/address_from_output.dart
Normal file
23
cw_bitcoin/lib/address_from_output.dart
Normal file
|
@ -0,0 +1,23 @@
|
|||
import 'dart:typed_data';
|
||||
import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin;
|
||||
import 'package:bitcoin_flutter/src/payments/index.dart' show PaymentData;
|
||||
|
||||
String addressFromOutput(Uint8List script, bitcoin.NetworkType networkType) {
|
||||
try {
|
||||
return bitcoin.P2PKH(
|
||||
data: PaymentData(output: script),
|
||||
network: networkType)
|
||||
.data
|
||||
.address;
|
||||
} catch (_) {}
|
||||
|
||||
try {
|
||||
return bitcoin.P2WPKH(
|
||||
data: PaymentData(output: script),
|
||||
network: networkType)
|
||||
.data
|
||||
.address;
|
||||
} catch(_) {}
|
||||
|
||||
return null;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue