Skip to content

Mnemonic.validate

Checks if a mnemonic is valid, given a wordlist.

Imports

Named
import { Mnemonic } from 'ox'

Examples

import { Mnemonic } from 'ox'
 
const mnemonic = Mnemonic.validate(
  'buyer zoo end danger ice capable shrug naive twist relief mass bonus',
  Mnemonic.english
)
true

Definition

function validate(
  mnemonic: string,
  wordlist: string[],
): boolean

Source: src/Mnemonic.ts

Parameters

mnemonic

  • Type: string

The mnemonic to validate.

wordlist

  • Type: string[]

The wordlist to use.

Return Type

Whether the mnemonic is valid.

boolean