@tevm/voltaire / primitives/MaxFeePerGas
primitives/MaxFeePerGas
Type Aliases
MaxFeePerGasType
MaxFeePerGasType =Defined in: src/primitives/MaxFeePerGas/MaxFeePerGasType.ts:10 Branded MaxFeePerGas type - EIP-1559 maximum fee per gas Represents the maximum total gas price user is willing to pay Must be >= baseFeePerGas + maxPriorityFeePerGas for inclusionbigint&object
Type Declaration
[brand]
readonly[brand]:"MaxFeePerGas"
See
https://eips.ethereum.org/EIPS/eip-1559Variables
MaxFeePerGas
Defined in: src/primitives/MaxFeePerGas/index.ts:53constMaxFeePerGas:object
Type Declaration
compare()
compare: (maxFee1,maxFee2) =>number
Parameters
maxFee1
string | number | bigint
maxFee2
string | number | bigint
Returns
number
equals()
equals: (maxFee1,maxFee2) =>boolean
Parameters
maxFee1
string | number | bigint
maxFee2
string | number | bigint
Returns
boolean
from()
from: (Create MaxFeePerGas from bigint, number, or hex stringvalue) =>MaxFeePerGasType
Parameters
value
Max fee in Weistring | number | bigint
Returns
MaxFeePerGasType
Branded max fee
Throws
If value is negative or invalid formatExample
fromGwei()
fromGwei: (Create MaxFeePerGas from Gwei valuegwei) =>MaxFeePerGasType
Parameters
gwei
Value in Gweinumber | bigint
Returns
MaxFeePerGasType
Max fee in Wei
Example
fromWei()
fromWei: (Create MaxFeePerGas from Wei value (alias for from)wei) =>MaxFeePerGasType
Parameters
wei
Value in Weistring | number | bigint
Returns
MaxFeePerGasType
Max fee
Example
toBigInt()
toBigInt: (maxFee) =>bigint
Parameters
maxFee
string | number | bigint
Returns
bigint
toGwei()
toGwei: (maxFee) =>bigint
Parameters
maxFee
string | number | bigint
Returns
bigint
toNumber()
toNumber: (maxFee) =>number
Parameters
maxFee
string | number | bigint
Returns
number
toWei()
toWei: (maxFee) =>bigint
Parameters
maxFee
string | number | bigint
Returns
bigint
Functions
_compare()
_compare(Defined in: src/primitives/MaxFeePerGas/compare.js:15 Compare two MaxFeePerGas valuesthis,other):number
Parameters
this
MaxFeePerGasType
other
MaxFeePerGasType
Value to compare
Returns
number
-1 if this < other, 0 if equal, 1 if this > other
Example
_equals()
_equals(Defined in: src/primitives/MaxFeePerGas/equals.js:15 Check if two MaxFeePerGas values are equalthis,other):boolean
Parameters
this
MaxFeePerGasType
other
MaxFeePerGasType
Value to compare
Returns
boolean
True if equal
Example
_toBigInt()
_toBigInt(Defined in: src/primitives/MaxFeePerGas/toBigInt.js:13 Convert MaxFeePerGas to bigint (identity function)this):bigint
Parameters
this
MaxFeePerGasType
Returns
bigint
Value as bigint
Example
_toGwei()
_toGwei(Defined in: src/primitives/MaxFeePerGas/toGwei.js:13 Convert MaxFeePerGas to Gweithis):bigint
Parameters
this
MaxFeePerGasType
Returns
bigint
Value in Gwei
Example
_toNumber()
_toNumber(Defined in: src/primitives/MaxFeePerGas/toNumber.js:14 Convert MaxFeePerGas to number WARNING: May lose precision for large valuesthis):number
Parameters
this
MaxFeePerGasType
Returns
number
Value as number
Example
_toWei()
_toWei(Defined in: src/primitives/MaxFeePerGas/toWei.js:13 Convert MaxFeePerGas to Wei (identity function)this):bigint
Parameters
this
MaxFeePerGasType
Returns
bigint
Value in Wei
Example
compare()
compare(Defined in: src/primitives/MaxFeePerGas/index.ts:42maxFee1,maxFee2):number
Parameters
maxFee1
string | number | bigint
maxFee2
string | number | bigint
Returns
number
equals()
equals(Defined in: src/primitives/MaxFeePerGas/index.ts:35maxFee1,maxFee2):boolean
Parameters
maxFee1
string | number | bigint
maxFee2
string | number | bigint
Returns
boolean
from()
from(Defined in: src/primitives/MaxFeePerGas/from.js:16 Create MaxFeePerGas from bigint, number, or hex stringvalue):MaxFeePerGasType
Parameters
value
Max fee in Weistring | number | bigint
Returns
MaxFeePerGasType
Branded max fee
Throws
If value is negative or invalid formatExample
fromGwei()
fromGwei(Defined in: src/primitives/MaxFeePerGas/fromGwei.js:12 Create MaxFeePerGas from Gwei valuegwei):MaxFeePerGasType
Parameters
gwei
Value in Gweinumber | bigint
Returns
MaxFeePerGasType
Max fee in Wei
Example
fromWei()
fromWei(Defined in: src/primitives/MaxFeePerGas/fromWei.js:12 Create MaxFeePerGas from Wei value (alias for from)wei):MaxFeePerGasType
Parameters
wei
Value in Weistring | number | bigint
Returns
MaxFeePerGasType
Max fee
Example
toBigInt()
toBigInt(Defined in: src/primitives/MaxFeePerGas/index.ts:31maxFee):bigint
Parameters
maxFee
string | number | bigint
Returns
bigint
toGwei()
toGwei(Defined in: src/primitives/MaxFeePerGas/index.ts:19maxFee):bigint
Parameters
maxFee
string | number | bigint
Returns
bigint
toNumber()
toNumber(Defined in: src/primitives/MaxFeePerGas/index.ts:27maxFee):number
Parameters
maxFee
string | number | bigint
Returns
number
toWei()
toWei(Defined in: src/primitives/MaxFeePerGas/index.ts:23maxFee):bigint
Parameters
maxFee
string | number | bigint
Returns
bigint
