Skip to content

TxEnvelopeLegacy.validate

Validates a TxEnvelopeLegacy.TxEnvelopeLegacy. Returns true if the envelope is valid, false otherwise.

Imports

Named
import { TxEnvelopeLegacy } from 'ox'

Examples

import { TxEnvelopeLegacy, Value } from 'ox'
 
const valid = TxEnvelopeLegacy.assert({
  gasPrice: 2n ** 256n - 1n + 1n,
  chainId: 1,
  to: '0x0000000000000000000000000000000000000000',
  value: Value.fromEther('1'),
})
false

Definition

function validate(
  envelope: PartialBy<TxEnvelopeLegacy, 'type'>,
): boolean

Source: src/core/TxEnvelopeLegacy.ts

Parameters

envelope

  • Type: PartialBy<TxEnvelopeLegacy, 'type'>

The transaction envelope to validate.

Return Type

boolean