@@ -24,6 +24,10 @@ const isHexPrefixed = /^0x/;
24export const validateMnemonic = v =>
24export const validateMnemonic = v =>
25 !bip39.validateMnemonic(v) && 'This is not a valid mnemonic.';
25 !bip39.validateMnemonic(v) && 'This is not a valid mnemonic.';
27+const isHdPath = /^m(\/[0-9]+'?)*$/;
28+export const validateHdPath = v =>
29+ !isHdPath.test(v) && 'Invalid HD derivation path.';
27// Checks an empty field
31// Checks an empty field
28export const validateNotEmpty = v =>
32export const validateNotEmpty = v =>
29 (v === undefined || v.length === 0) && 'This field is required.';
33 (v === undefined || v.length === 0) && 'This field is required.';