2022-03-16 10:50:12 +00:00
|
|
|
import 'package:cw_bitcoin/electrum_wallet.dart';
|
|
|
|
import 'package:cw_core/fee_estimate.dart';
|
|
|
|
import 'package:cw_core/transaction_priority.dart';
|
|
|
|
|
|
|
|
class ElectrumFeeEstimate extends FeeEstimate {
|
|
|
|
ElectrumFeeEstimate(ElectrumWalletBase wallet)
|
|
|
|
: _wallet = wallet;
|
|
|
|
|
|
|
|
ElectrumWalletBase _wallet;
|
|
|
|
|
2022-11-21 14:44:01 +00:00
|
|
|
int get({TransactionPriority? priority, int? amount, int? outputsCount}) {
|
2022-03-16 10:50:12 +00:00
|
|
|
// Electrum doesn't require an async call to obtain the estimated fee.
|
|
|
|
// We don't bother caching and just obtain it directly.
|
|
|
|
return _wallet.calculateEstimatedFee(priority,amount, outputsCount: outputsCount);
|
|
|
|
}
|
|
|
|
|
2022-11-21 14:44:01 +00:00
|
|
|
void update({TransactionPriority? priority, int? amount, int? outputsCount}) {}
|
2022-03-16 10:50:12 +00:00
|
|
|
|
2022-11-21 14:44:01 +00:00
|
|
|
void set({TransactionPriority? priority, int? outputsCount, int? fee}) {}
|
2022-03-16 10:50:12 +00:00
|
|
|
}
|