Skip to main content

index/functions/validateWalletInput.md

validateWalletInput(input): WalletInputValidation

Which kind of wallet input input is, without deriving anything: a private key (64 hex digits, 0x optional) or a mnemonic (12 or 24 words of letters). It checks the FORM only: a mnemonic with an unknown word or a wrong checksum is still mnemonic here (createWallet refuses it).

Parameters​

ParameterType
inputstring

Returns​

WalletInputValidation

Example​

validateWalletInput('0x' + '11'.repeat(32)); // { valid: true, format: 'private_key' }