mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-26 21:39:21 +00:00
24 lines
613 B
Dart
24 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
|
||
|
}
|