> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# TxEnvelopeLegacy.assert

:::info
`TxEnvelopeLegacy.assert` is a re-export of ox's [`TxEnvelopeLegacy.assert`](https://oxlib.sh/api/TxEnvelopeLegacy/assert). Refer to the ox documentation for the full reference.
:::

Asserts a [`TxEnvelopeLegacy.TxEnvelopeLegacy`](/docs/utilities/txenvelopelegacy/types#txenvelopelegacy) is valid.

## Imports

```ts
import { TxEnvelopeLegacy } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { TxEnvelopeLegacy, Value } from 'viem/utils'

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

## Definition

```ts
function assert(
  envelope: PartialBy<TxEnvelopeLegacy, 'type'>,
): void
```

## Parameters

### envelope

* **Type:** `PartialBy<TxEnvelopeLegacy, 'type'>`

The transaction envelope to assert.

## Return Type

`void`
