use electrum_adapter getTransaction

This commit is contained in:
sneurlax 2024-02-13 18:28:20 -06:00
parent ceec698a44
commit 13a50cdace
3 changed files with 17 additions and 3 deletions

View file

@ -743,6 +743,19 @@ class ElectrumXClient {
bool verbose = true,
String? requestID,
}) async {
// Use electrum_adapter package's getTransaction method.
Logging.instance.log("attempting to fetch blockchain.transaction.get...",
level: LogLevel.Info);
var channel =
await electrum_adapter.connect(host, port: port); // TODO pass useSLL.
var client = electrum_adapter.ElectrumClient(channel, host, port);
dynamic response = await client.getTransaction(txHash);
Logging.instance.log("Fetching blockchain.transaction.get finished",
level: LogLevel.Info);
return Map<String, dynamic>.from(response as Map);
/*
// Original ElectrumXClient:
dynamic response;
try {
response = await request(
@ -778,6 +791,7 @@ class ElectrumXClient {
level: LogLevel.Error);
rethrow;
}
*/
}
/// Returns the whole Lelantus anonymity set for denomination in the groupId.

View file

@ -528,8 +528,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "1c4962bf6fa8fe639be8540f8c61e89e625c7034"
resolved-ref: "1c4962bf6fa8fe639be8540f8c61e89e625c7034"
ref: "72f5801f78b6e73165c44d349a514badf0ee0d78"
resolved-ref: "72f5801f78b6e73165c44d349a514badf0ee0d78"
url: "https://github.com/cypherstack/electrum_adapter.git"
source: git
version: "3.0.0"

View file

@ -176,7 +176,7 @@ dependencies:
electrum_adapter:
git:
url: https://github.com/cypherstack/electrum_adapter.git
ref: 1c4962bf6fa8fe639be8540f8c61e89e625c7034
ref: 80d28a8b033af7bcf90cd6c7a3ee74160dc791a1
dev_dependencies:
flutter_test: