Skip to content

TransactionEnvelopeLegacy.validate

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

Imports

Named
import { TransactionEnvelopeLegacy } from 'ox'

Examples

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

Definition

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

Source: src/core/TransactionEnvelopeLegacy.ts

Parameters

envelope

  • Type: PartialBy<TransactionEnvelopeLegacy, 'type'>

The transaction envelope to validate.

Return Type

boolean