# TransactionEnvelope Errors

## `TransactionEnvelope.FeeCapTooHighError`

Thrown when a fee cap is too high.

### Examples

```ts twoslash
import { TxEnvelopeEip1559 } from 'ox'

TxEnvelopeEip1559.assert({
  maxFeePerGas: 2n ** 256n - 1n + 1n,
  chainId: 1
})
// @error: TransactionEnvelope.FeeCapTooHighError: The fee cap (`maxFeePerGas`/`maxPriorityFeePerGas` = 115792089237316195423570985008687907853269984665640564039457584007913.129639936 gwei) cannot be higher than the maximum allowed value (2^256-1).
```

**Source:** [src/core/TxEnvelope.ts](https://github.com/wevm/ox/blob/main/src/core/TxEnvelope.ts#L952)

## `TransactionEnvelope.GasPriceTooHighError`

Thrown when a gas price is too high.

### Examples

```ts twoslash
import { TxEnvelopeLegacy } from 'ox'

TxEnvelopeLegacy.assert({
  gasPrice: 2n ** 256n - 1n + 1n,
  chainId: 1
})
// @error: TransactionEnvelope.GasPriceTooHighError: The gas price (`gasPrice` = 115792089237316195423570985008687907853269984665640564039457584007913.129639936 gwei) cannot be higher than the maximum allowed value (2^256-1).
```

**Source:** [src/core/TxEnvelope.ts](https://github.com/wevm/ox/blob/main/src/core/TxEnvelope.ts#L952)

## `TransactionEnvelope.InvalidChainIdError`

Thrown when a chain ID is invalid.

### Examples

```ts twoslash
import { TxEnvelopeEip1559 } from 'ox'

TxEnvelopeEip1559.assert({ chainId: 0 })
// @error: TransactionEnvelope.InvalidChainIdError: Chain ID "0" is invalid.
```

**Source:** [src/core/TxEnvelope.ts](https://github.com/wevm/ox/blob/main/src/core/TxEnvelope.ts#L952)

## `TransactionEnvelope.InvalidSerializedError`

Thrown when a serialized transaction is invalid.

### Examples

```ts twoslash
import { TxEnvelopeEip1559 } from 'ox'

TxEnvelopeEip1559.deserialize('0x02c0')
// @error: TransactionEnvelope.InvalidSerializedError: Invalid serialized transaction of type "eip1559" was provided.
// @error: Serialized Transaction: "0x02c0"
// @error: Missing Attributes: chainId, nonce, maxPriorityFeePerGas, maxFeePerGas, gas, to, value, data, accessList
```

**Source:** [src/core/TxEnvelope.ts](https://github.com/wevm/ox/blob/main/src/core/TxEnvelope.ts#L952)

## `TransactionEnvelope.InvalidSerializedTypeError`

Thrown when a serialized transaction type cannot be resolved.

**Source:** [src/core/TxEnvelope.ts](https://github.com/wevm/ox/blob/main/src/core/TxEnvelope.ts#L952)

## `TransactionEnvelope.InvalidTypeError`

Thrown when a transaction envelope type cannot be resolved.

**Source:** [src/core/TxEnvelope.ts](https://github.com/wevm/ox/blob/main/src/core/TxEnvelope.ts#L952)

## `TransactionEnvelope.TipAboveFeeCapError`

Thrown when a tip is higher than a fee cap.

### Examples

```ts twoslash
import { TxEnvelopeEip1559 } from 'ox'

TxEnvelopeEip1559.assert({
  chainId: 1,
  maxFeePerGas: 10n,
  maxPriorityFeePerGas: 11n
})
// @error: TransactionEnvelope.TipAboveFeeCapError: The provided tip (`maxPriorityFeePerGas` = 11 gwei) cannot be higher than the fee cap (`maxFeePerGas` = 10 gwei).
```

**Source:** [src/core/TxEnvelope.ts](https://github.com/wevm/ox/blob/main/src/core/TxEnvelope.ts#L952)
