This commit is contained in:
julian 2023-10-17 14:34:15 -06:00
parent 9d01f0beaa
commit 65882b66e1

View file

@ -11,6 +11,7 @@
import 'dart:async'; import 'dart:async';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:bitbox/bitbox.dart' as bb;
import 'package:bitcoindart/bitcoindart.dart'; import 'package:bitcoindart/bitcoindart.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
@ -478,20 +479,26 @@ class HiddenSettings extends StatelessWidget {
final p2pkh = final p2pkh =
P2PKH(data: pd, network: bitcoincash); P2PKH(data: pd, network: bitcoincash);
final addr = p2pkh.data.address!; // final addr = p2pkh.data.address!;
final addr = bb.Address.toLegacyAddress(
"bitcoincash:qp352c2skpdxwzzd090mec3v37au5dmfwgwfw686sz",
);
final scripthash = final scripthash =
AddressUtils.convertToScriptHash( AddressUtils.convertToScriptHash(
addr, bitcoincash); addr, bitcoincash);
final hist = await e.getHistory(
scripthash: scripthash);
Util.printJson(hist, "HISTORY for $address");
final utxos = final utxos =
await e.getUTXOs(scripthash: scripthash); await e.getUTXOs(scripthash: scripthash);
Util.printJson(utxos, "UTXOS for $address"); Util.printJson(utxos, "UTXOS for $address");
final hist = await e.getTransaction(
txHash: utxos.first["tx_hash"] as String,
);
Util.printJson(hist, "HISTORY for $address");
} catch (e, s) { } catch (e, s) {
print("$e\n$s"); print("$e\n$s");
} }