Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const _onSave = (): void => {
if (!scanned || !isNameValid) {
return;
}
const { address, genesisHash } = scanned;
keyring.addExternal(address, { genesisHash, name: name.trim() });
InputAddress.setLastValue('account', address);
onStatusChange({
account: address,
action: 'create',
message: t('created account'),
status: 'success'
});
onClose();
};
private accountsCreateExternal ({ address, genesisHash, name }: RequestAccountCreateExternal): boolean {
keyring.addExternal(address, { name, genesisHash });
return true;
}