Skip to main content
@tevm/voltaire
@tevm/voltaire / primitives/MaxPriorityFeePerGas

primitives/MaxPriorityFeePerGas

Type Aliases

MaxPriorityFeePerGasType

MaxPriorityFeePerGasType = bigint & object
Defined in: src/primitives/MaxPriorityFeePerGas/MaxPriorityFeePerGasType.ts:10 Branded MaxPriorityFeePerGas type - EIP-1559 maximum priority fee (tip) Represents the maximum tip user is willing to pay to miner/validator Incentivizes transaction inclusion in blocks

Type Declaration

[brand]
readonly [brand]: "MaxPriorityFeePerGas"

See

https://eips.ethereum.org/EIPS/eip-1559

Variables

MaxPriorityFeePerGas

const MaxPriorityFeePerGas: object
Defined in: src/primitives/MaxPriorityFeePerGas/index.ts:53

Type Declaration

compare()
compare: (priorityFee1, priorityFee2) => number
Parameters
priorityFee1
string | number | bigint
priorityFee2
string | number | bigint
Returns
number
equals()
equals: (priorityFee1, priorityFee2) => boolean
Parameters
priorityFee1
string | number | bigint
priorityFee2
string | number | bigint
Returns
boolean
from()
from: (value) => MaxPriorityFeePerGasType
Create MaxPriorityFeePerGas from bigint, number, or hex string
Parameters
value
Priority fee in Wei string | number | bigint
Returns
MaxPriorityFeePerGasType Branded priority fee
Throws
If value is negative or invalid format
Example
const priorityFee = MaxPriorityFeePerGas.from(2000000000n); // 2 Gwei
const priorityFee2 = MaxPriorityFeePerGas.from("0x77359400");
fromGwei()
fromGwei: (gwei) => MaxPriorityFeePerGasType
Create MaxPriorityFeePerGas from Gwei value
Parameters
gwei
Value in Gwei number | bigint
Returns
MaxPriorityFeePerGasType Priority fee in Wei
Example
const priorityFee = MaxPriorityFeePerGas.fromGwei(2n); // 2 Gwei = 2000000000 Wei
fromWei()
fromWei: (wei) => MaxPriorityFeePerGasType
Create MaxPriorityFeePerGas from Wei value (alias for from)
Parameters
wei
Value in Wei string | number | bigint
Returns
MaxPriorityFeePerGasType Priority fee
Example
const priorityFee = MaxPriorityFeePerGas.fromWei(2000000000n);
toBigInt()
toBigInt: (priorityFee) => bigint
Parameters
priorityFee
string | number | bigint
Returns
bigint
toGwei()
toGwei: (priorityFee) => bigint
Parameters
priorityFee
string | number | bigint
Returns
bigint
toNumber()
toNumber: (priorityFee) => number
Parameters
priorityFee
string | number | bigint
Returns
number
toWei()
toWei: (priorityFee) => bigint
Parameters
priorityFee
string | number | bigint
Returns
bigint

Functions

_compare()

_compare(this, other): number
Defined in: src/primitives/MaxPriorityFeePerGas/compare.js:15 Compare two MaxPriorityFeePerGas values

Parameters

this
MaxPriorityFeePerGasType
other
MaxPriorityFeePerGasType Value to compare

Returns

number -1 if this < other, 0 if equal, 1 if this > other

Example

const fee1 = MaxPriorityFeePerGas.from(2000000000n);
const fee2 = MaxPriorityFeePerGas.from(5000000000n);
MaxPriorityFeePerGas.compare(fee1, fee2); // -1

_equals()

_equals(this, other): boolean
Defined in: src/primitives/MaxPriorityFeePerGas/equals.js:15 Check if two MaxPriorityFeePerGas values are equal

Parameters

this
MaxPriorityFeePerGasType
other
MaxPriorityFeePerGasType Value to compare

Returns

boolean True if equal

Example

const fee1 = MaxPriorityFeePerGas.from(2000000000n);
const fee2 = MaxPriorityFeePerGas.from(2000000000n);
MaxPriorityFeePerGas.equals(fee1, fee2); // true

_toBigInt()

_toBigInt(this): bigint
Defined in: src/primitives/MaxPriorityFeePerGas/toBigInt.js:13 Convert MaxPriorityFeePerGas to bigint (identity function)

Parameters

this
MaxPriorityFeePerGasType

Returns

bigint Value as bigint

Example

const priorityFee = MaxPriorityFeePerGas.from(2000000000n);
MaxPriorityFeePerGas.toBigInt(priorityFee); // 2000000000n

_toGwei()

_toGwei(this): bigint
Defined in: src/primitives/MaxPriorityFeePerGas/toGwei.js:13 Convert MaxPriorityFeePerGas to Gwei

Parameters

this
MaxPriorityFeePerGasType

Returns

bigint Value in Gwei

Example

const priorityFee = MaxPriorityFeePerGas.from(2000000000n);
MaxPriorityFeePerGas.toGwei(priorityFee); // 2n Gwei

_toNumber()

_toNumber(this): number
Defined in: src/primitives/MaxPriorityFeePerGas/toNumber.js:14 Convert MaxPriorityFeePerGas to number WARNING: May lose precision for large values

Parameters

this
MaxPriorityFeePerGasType

Returns

number Value as number

Example

const priorityFee = MaxPriorityFeePerGas.from(2000000000n);
MaxPriorityFeePerGas.toNumber(priorityFee); // 2000000000

_toWei()

_toWei(this): bigint
Defined in: src/primitives/MaxPriorityFeePerGas/toWei.js:13 Convert MaxPriorityFeePerGas to Wei (identity function)

Parameters

this
MaxPriorityFeePerGasType

Returns

bigint Value in Wei

Example

const priorityFee = MaxPriorityFeePerGas.from(2000000000n);
MaxPriorityFeePerGas.toWei(priorityFee); // 2000000000n Wei

compare()

compare(priorityFee1, priorityFee2): number
Defined in: src/primitives/MaxPriorityFeePerGas/index.ts:42

Parameters

priorityFee1
string | number | bigint
priorityFee2
string | number | bigint

Returns

number

equals()

equals(priorityFee1, priorityFee2): boolean
Defined in: src/primitives/MaxPriorityFeePerGas/index.ts:35

Parameters

priorityFee1
string | number | bigint
priorityFee2
string | number | bigint

Returns

boolean

from()

from(value): MaxPriorityFeePerGasType
Defined in: src/primitives/MaxPriorityFeePerGas/from.js:16 Create MaxPriorityFeePerGas from bigint, number, or hex string

Parameters

value
Priority fee in Wei string | number | bigint

Returns

MaxPriorityFeePerGasType Branded priority fee

Throws

If value is negative or invalid format

Example

const priorityFee = MaxPriorityFeePerGas.from(2000000000n); // 2 Gwei
const priorityFee2 = MaxPriorityFeePerGas.from("0x77359400");

fromGwei()

fromGwei(gwei): MaxPriorityFeePerGasType
Defined in: src/primitives/MaxPriorityFeePerGas/fromGwei.js:12 Create MaxPriorityFeePerGas from Gwei value

Parameters

gwei
Value in Gwei number | bigint

Returns

MaxPriorityFeePerGasType Priority fee in Wei

Example

const priorityFee = MaxPriorityFeePerGas.fromGwei(2n); // 2 Gwei = 2000000000 Wei

fromWei()

fromWei(wei): MaxPriorityFeePerGasType
Defined in: src/primitives/MaxPriorityFeePerGas/fromWei.js:12 Create MaxPriorityFeePerGas from Wei value (alias for from)

Parameters

wei
Value in Wei string | number | bigint

Returns

MaxPriorityFeePerGasType Priority fee

Example

const priorityFee = MaxPriorityFeePerGas.fromWei(2000000000n);

toBigInt()

toBigInt(priorityFee): bigint
Defined in: src/primitives/MaxPriorityFeePerGas/index.ts:31

Parameters

priorityFee
string | number | bigint

Returns

bigint

toGwei()

toGwei(priorityFee): bigint
Defined in: src/primitives/MaxPriorityFeePerGas/index.ts:19

Parameters

priorityFee
string | number | bigint

Returns

bigint

toNumber()

toNumber(priorityFee): number
Defined in: src/primitives/MaxPriorityFeePerGas/index.ts:27

Parameters

priorityFee
string | number | bigint

Returns

number

toWei()

toWei(priorityFee): bigint
Defined in: src/primitives/MaxPriorityFeePerGas/index.ts:23

Parameters

priorityFee
string | number | bigint

Returns

bigint