@@ -2,7 +2,7 @@ import { BigNumber } from '@trezor/utils/src/bigNumber';
2
2
3
3
import { Blockchain } from '../../backend/BlockchainLink' ;
4
4
import type { EthereumNetworkInfo , FeeLevel } from '../../types' ;
5
- import { Blocks , MiscFeeLevels , findBlocksForFee } from '../common/MiscFees' ;
5
+ import { Blocks , MiscFeeLevels } from '../common/MiscFees' ;
6
6
7
7
type EipResponse1559Level = 'low' | 'medium' | 'high' ;
8
8
type Eip1559Level = 'low' | 'normal' | 'high' ;
@@ -32,7 +32,7 @@ export class EthereumFeeLevels extends MiscFeeLevels {
32
32
const level = eip1559 [ levelKey ] ;
33
33
34
34
// We can't pass BaseFeePerGas to firmware, so we calculate the effective gas price here
35
- const calculatedMaxFeePerGas = BigNumber . minimum (
35
+ const calculatedMaxBaseFeePerGas = BigNumber . minimum (
36
36
new BigNumber ( level ?. maxFeePerGas || '0' ) ,
37
37
new BigNumber ( eip1559 . baseFeePerGas || '0' ) . plus (
38
38
level ?. maxPriorityFeePerGas || '0' ,
@@ -46,8 +46,8 @@ export class EthereumFeeLevels extends MiscFeeLevels {
46
46
47
47
return {
48
48
label,
49
- maxFeePerGas : level ?. maxFeePerGas || '0' ,
50
- effectiveGasPrice : calculatedMaxFeePerGas ,
49
+ maxFeePerGas : level ?. maxFeePerGas ,
50
+ effectiveGasPrice : calculatedMaxBaseFeePerGas ,
51
51
maxPriorityFeePerGas : level ?. maxPriorityFeePerGas || '0' ,
52
52
baseFeePerGas : eip1559 . baseFeePerGas ,
53
53
minWaitTimeEstimate : level ?. minWaitTimeEstimate
@@ -72,22 +72,4 @@ export class EthereumFeeLevels extends MiscFeeLevels {
72
72
73
73
return this . levels ;
74
74
}
75
-
76
- updateEthereumCustomFee (
77
- feePerUnit : string ,
78
- effectiveGasPrice ?: string ,
79
- maxPriorityFeePerGas ?: string ,
80
- ) {
81
- // remove "custom" level from list
82
- this . levels = this . levels . filter ( l => l . label !== 'custom' ) ;
83
- // recreate "custom" level
84
- const blocks = findBlocksForFee ( feePerUnit , this . blocks ) ;
85
- this . levels . push ( {
86
- label : 'custom' ,
87
- feePerUnit,
88
- blocks,
89
- maxPriorityFeePerGas,
90
- effectiveGasPrice,
91
- } ) ;
92
- }
93
75
}
0 commit comments