-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfee.ts
36 lines (33 loc) · 1.08 KB
/
fee.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { formatGwei } from '../utils/unit/formatGwei.js'
import { BaseError } from './base.js'
export type BaseFeeScalarErrorType = BaseFeeScalarError & {
name: 'BaseFeeScalarError'
}
export class BaseFeeScalarError extends BaseError {
override name = 'BaseFeeScalarError'
constructor() {
super('`baseFeeMultiplier` must be greater than 1.')
}
}
export type Eip1559FeesNotSupportedErrorType = Eip1559FeesNotSupportedError & {
name: 'Eip1559FeesNotSupportedError'
}
export class Eip1559FeesNotSupportedError extends BaseError {
override name = 'Eip1559FeesNotSupportedError'
constructor() {
super('Chain does not support EIP-1559 fees.')
}
}
export type MaxFeePerGasTooLowErrorType = MaxFeePerGasTooLowError & {
name: 'MaxFeePerGasTooLowError'
}
export class MaxFeePerGasTooLowError extends BaseError {
override name = 'MaxFeePerGasTooLowError'
constructor({ maxPriorityFeePerGas }: { maxPriorityFeePerGas: bigint }) {
super(
`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${formatGwei(
maxPriorityFeePerGas,
)} gwei).`,
)
}
}