Skip to content

Commit eb88a82

Browse files
committed
chore(suite): remove unused
1 parent 79d25fc commit eb88a82

File tree

2 files changed

+6
-30
lines changed

2 files changed

+6
-30
lines changed

packages/connect/src/api/ethereum/EthereumFees.ts

+4-22
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { BigNumber } from '@trezor/utils/src/bigNumber';
22

33
import { Blockchain } from '../../backend/BlockchainLink';
44
import type { EthereumNetworkInfo, FeeLevel } from '../../types';
5-
import { Blocks, MiscFeeLevels, findBlocksForFee } from '../common/MiscFees';
5+
import { Blocks, MiscFeeLevels } from '../common/MiscFees';
66

77
type EipResponse1559Level = 'low' | 'medium' | 'high';
88
type Eip1559Level = 'low' | 'normal' | 'high';
@@ -32,7 +32,7 @@ export class EthereumFeeLevels extends MiscFeeLevels {
3232
const level = eip1559[levelKey];
3333

3434
// 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(
3636
new BigNumber(level?.maxFeePerGas || '0'),
3737
new BigNumber(eip1559.baseFeePerGas || '0').plus(
3838
level?.maxPriorityFeePerGas || '0',
@@ -46,8 +46,8 @@ export class EthereumFeeLevels extends MiscFeeLevels {
4646

4747
return {
4848
label,
49-
maxFeePerGas: level?.maxFeePerGas || '0',
50-
effectiveGasPrice: calculatedMaxFeePerGas,
49+
maxFeePerGas: level?.maxFeePerGas,
50+
effectiveGasPrice: calculatedMaxBaseFeePerGas,
5151
maxPriorityFeePerGas: level?.maxPriorityFeePerGas || '0',
5252
baseFeePerGas: eip1559.baseFeePerGas,
5353
minWaitTimeEstimate: level?.minWaitTimeEstimate
@@ -72,22 +72,4 @@ export class EthereumFeeLevels extends MiscFeeLevels {
7272

7373
return this.levels;
7474
}
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-
}
9375
}

packages/connect/src/types/fees.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ export const FeeInfo = Type.Object({
88
dustLimit: Type.Number(),
99
});
1010

11-
export type PriorityFeeEstimationDetails = Static<typeof PriorityFeeEstimationDetails>;
12-
export const PriorityFeeEstimationDetails = Type.Object({
13-
maxFeePerGas: Type.String(),
14-
maxPriorityFeePerGas: Type.String(),
15-
maxWaitTimeEstimate: Type.Optional(Type.Number()),
16-
minWaitTimeEstimate: Type.Optional(Type.Number()),
17-
});
18-
1911
export type FeeLevel = Static<typeof FeeLevel>;
2012
export const FeeLevel = Type.Object({
2113
label: Type.Union([
@@ -32,6 +24,8 @@ export const FeeLevel = Type.Object({
3224
baseFeePerGas: Type.Optional(Type.String()),
3325
maxFeePerGas: Type.Optional(Type.String()),
3426
effectiveGasPrice: Type.Optional(Type.String()),
27+
customMaxBaseFeePerGas: Type.Optional(Type.String()),
28+
customMaxPriorityFeePerGas: Type.Optional(Type.String()),
3529
maxPriorityFeePerGas: Type.Optional(Type.String()),
3630
maxWaitTimeEstimate: Type.Optional(Type.Number()),
3731
minWaitTimeEstimate: Type.Optional(Type.Number()),

0 commit comments

Comments
 (0)