> ## Documentation Index
> Fetch the complete documentation index at: https://voltaire.tevm.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# primitives/MaxPriorityFeePerGas

> Auto-generated API documentation

[**@tevm/voltaire**](../index.mdx)

***

[@tevm/voltaire](../index.mdx) / primitives/MaxPriorityFeePerGas

# primitives/MaxPriorityFeePerGas

## Type Aliases

### MaxPriorityFeePerGasType

> **MaxPriorityFeePerGasType** = `bigint` & `object`

Defined in: [src/primitives/MaxPriorityFeePerGas/MaxPriorityFeePerGasType.ts:10](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/MaxPriorityFeePerGasType.ts#L10)

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](https://eips.ethereum.org/EIPS/eip-1559)

## Variables

### MaxPriorityFeePerGas

> `const` **MaxPriorityFeePerGas**: `object`

Defined in: [src/primitives/MaxPriorityFeePerGas/index.ts:53](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/index.ts#L53)

#### 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`](#maxpriorityfeepergastype)

Create MaxPriorityFeePerGas from bigint, number, or hex string

###### Parameters

###### value

Priority fee in Wei

`string` | `number` | `bigint`

###### Returns

[`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

Branded priority fee

###### Throws

If value is negative or invalid format

###### Example

```typescript theme={null}
const priorityFee = MaxPriorityFeePerGas.from(2000000000n); // 2 Gwei
const priorityFee2 = MaxPriorityFeePerGas.from("0x77359400");
```

##### fromGwei()

> **fromGwei**: (`gwei`) => [`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

Create MaxPriorityFeePerGas from Gwei value

###### Parameters

###### gwei

Value in Gwei

`number` | `bigint`

###### Returns

[`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

Priority fee in Wei

###### Example

```typescript theme={null}
const priorityFee = MaxPriorityFeePerGas.fromGwei(2n); // 2 Gwei = 2000000000 Wei
```

##### fromWei()

> **fromWei**: (`wei`) => [`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

Create MaxPriorityFeePerGas from Wei value (alias for from)

###### Parameters

###### wei

Value in Wei

`string` | `number` | `bigint`

###### Returns

[`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

Priority fee

###### Example

```typescript theme={null}
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](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/compare.js#L15)

Compare two MaxPriorityFeePerGas values

#### Parameters

##### this

[`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

##### other

[`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

Value to compare

#### Returns

`number`

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

#### Example

```typescript theme={null}
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](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/equals.js#L15)

Check if two MaxPriorityFeePerGas values are equal

#### Parameters

##### this

[`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

##### other

[`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

Value to compare

#### Returns

`boolean`

True if equal

#### Example

```typescript theme={null}
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](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/toBigInt.js#L13)

Convert MaxPriorityFeePerGas to bigint (identity function)

#### Parameters

##### this

[`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

#### Returns

`bigint`

Value as bigint

#### Example

```typescript theme={null}
const priorityFee = MaxPriorityFeePerGas.from(2000000000n);
MaxPriorityFeePerGas.toBigInt(priorityFee); // 2000000000n
```

***

### \_toGwei()

> **\_toGwei**(`this`): `bigint`

Defined in: [src/primitives/MaxPriorityFeePerGas/toGwei.js:13](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/toGwei.js#L13)

Convert MaxPriorityFeePerGas to Gwei

#### Parameters

##### this

[`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

#### Returns

`bigint`

Value in Gwei

#### Example

```typescript theme={null}
const priorityFee = MaxPriorityFeePerGas.from(2000000000n);
MaxPriorityFeePerGas.toGwei(priorityFee); // 2n Gwei
```

***

### \_toNumber()

> **\_toNumber**(`this`): `number`

Defined in: [src/primitives/MaxPriorityFeePerGas/toNumber.js:14](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/toNumber.js#L14)

Convert MaxPriorityFeePerGas to number
WARNING: May lose precision for large values

#### Parameters

##### this

[`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

#### Returns

`number`

Value as number

#### Example

```typescript theme={null}
const priorityFee = MaxPriorityFeePerGas.from(2000000000n);
MaxPriorityFeePerGas.toNumber(priorityFee); // 2000000000
```

***

### \_toWei()

> **\_toWei**(`this`): `bigint`

Defined in: [src/primitives/MaxPriorityFeePerGas/toWei.js:13](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/toWei.js#L13)

Convert MaxPriorityFeePerGas to Wei (identity function)

#### Parameters

##### this

[`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

#### Returns

`bigint`

Value in Wei

#### Example

```typescript theme={null}
const priorityFee = MaxPriorityFeePerGas.from(2000000000n);
MaxPriorityFeePerGas.toWei(priorityFee); // 2000000000n Wei
```

***

### compare()

> **compare**(`priorityFee1`, `priorityFee2`): `number`

Defined in: [src/primitives/MaxPriorityFeePerGas/index.ts:42](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/index.ts#L42)

#### Parameters

##### priorityFee1

`string` | `number` | `bigint`

##### priorityFee2

`string` | `number` | `bigint`

#### Returns

`number`

***

### equals()

> **equals**(`priorityFee1`, `priorityFee2`): `boolean`

Defined in: [src/primitives/MaxPriorityFeePerGas/index.ts:35](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/index.ts#L35)

#### Parameters

##### priorityFee1

`string` | `number` | `bigint`

##### priorityFee2

`string` | `number` | `bigint`

#### Returns

`boolean`

***

### from()

> **from**(`value`): [`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

Defined in: [src/primitives/MaxPriorityFeePerGas/from.js:16](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/from.js#L16)

Create MaxPriorityFeePerGas from bigint, number, or hex string

#### Parameters

##### value

Priority fee in Wei

`string` | `number` | `bigint`

#### Returns

[`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

Branded priority fee

#### Throws

If value is negative or invalid format

#### Example

```typescript theme={null}
const priorityFee = MaxPriorityFeePerGas.from(2000000000n); // 2 Gwei
const priorityFee2 = MaxPriorityFeePerGas.from("0x77359400");
```

***

### fromGwei()

> **fromGwei**(`gwei`): [`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

Defined in: [src/primitives/MaxPriorityFeePerGas/fromGwei.js:12](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/fromGwei.js#L12)

Create MaxPriorityFeePerGas from Gwei value

#### Parameters

##### gwei

Value in Gwei

`number` | `bigint`

#### Returns

[`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

Priority fee in Wei

#### Example

```typescript theme={null}
const priorityFee = MaxPriorityFeePerGas.fromGwei(2n); // 2 Gwei = 2000000000 Wei
```

***

### fromWei()

> **fromWei**(`wei`): [`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

Defined in: [src/primitives/MaxPriorityFeePerGas/fromWei.js:12](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/fromWei.js#L12)

Create MaxPriorityFeePerGas from Wei value (alias for from)

#### Parameters

##### wei

Value in Wei

`string` | `number` | `bigint`

#### Returns

[`MaxPriorityFeePerGasType`](#maxpriorityfeepergastype)

Priority fee

#### Example

```typescript theme={null}
const priorityFee = MaxPriorityFeePerGas.fromWei(2000000000n);
```

***

### toBigInt()

> **toBigInt**(`priorityFee`): `bigint`

Defined in: [src/primitives/MaxPriorityFeePerGas/index.ts:31](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/index.ts#L31)

#### Parameters

##### priorityFee

`string` | `number` | `bigint`

#### Returns

`bigint`

***

### toGwei()

> **toGwei**(`priorityFee`): `bigint`

Defined in: [src/primitives/MaxPriorityFeePerGas/index.ts:19](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/index.ts#L19)

#### Parameters

##### priorityFee

`string` | `number` | `bigint`

#### Returns

`bigint`

***

### toNumber()

> **toNumber**(`priorityFee`): `number`

Defined in: [src/primitives/MaxPriorityFeePerGas/index.ts:27](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/index.ts#L27)

#### Parameters

##### priorityFee

`string` | `number` | `bigint`

#### Returns

`number`

***

### toWei()

> **toWei**(`priorityFee`): `bigint`

Defined in: [src/primitives/MaxPriorityFeePerGas/index.ts:23](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/MaxPriorityFeePerGas/index.ts#L23)

#### Parameters

##### priorityFee

`string` | `number` | `bigint`

#### Returns

`bigint`
