mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-12 21:54:31 +00:00
23 lines
613 B
Dart
23 lines
613 B
Dart
import '../../crypto_currency/interfaces/electrumx_currency_interface.dart';
|
|
import 'electrumx_interface.dart';
|
|
|
|
typedef TxSize = ({int real, int virtual});
|
|
|
|
mixin RbfInterface<T extends ElectrumXCurrencyInterface>
|
|
on ElectrumXInterface<T> {
|
|
// TODO actually save the size
|
|
Future<TxSize?> getVSize(String txid) async {
|
|
final tx = await electrumXCachedClient.getTransaction(
|
|
txHash: txid,
|
|
cryptoCurrency: cryptoCurrency,
|
|
);
|
|
|
|
try {
|
|
return (real: tx["size"] as int, virtual: tx["vsize"] as int);
|
|
} catch (_) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
// TODO more RBF specific logic
|
|
}
|