mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-04 12:34:14 +01:00
fix: walletconnect fee refresh (#3153)
* fix: refresh EIP-1559 fees before sign for walletconnect transactions * fix: add missing data to configure file --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
co-authored by
Omar Hatem
parent
fd62cd5b52
commit
ef752c747e
@@ -22,6 +22,22 @@ class EVMChainUtils {
|
||||
};
|
||||
}
|
||||
|
||||
static int computeBufferedMaxFeePerGasWei({
|
||||
required int? gasBaseFee,
|
||||
required int gasPrice,
|
||||
required int priorityFeeWei,
|
||||
required bool chainHasPriorityFee,
|
||||
}) {
|
||||
if (gasBaseFee != null && gasBaseFee > 0) {
|
||||
final baseFeeWithPriority = gasBaseFee + priorityFeeWei;
|
||||
final bufferMultiplier = chainHasPriorityFee ? 115 : 105;
|
||||
final bufferPercent = (baseFeeWithPriority * bufferMultiplier) ~/ 100;
|
||||
final bufferMin = baseFeeWithPriority + (baseFeeWithPriority ~/ 100);
|
||||
return bufferPercent > bufferMin ? bufferPercent : bufferMin;
|
||||
}
|
||||
return gasPrice + priorityFeeWei;
|
||||
}
|
||||
|
||||
static String getErc20TokensBoxName(String walletName, int chainId) {
|
||||
final sanitizedName = walletName.replaceAll(" ", "_");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user