How to use the @polkadot/ui-keyring.addExternal function in @polkadot/ui-keyring

To help you get started, we’ve selected a few @polkadot/ui-keyring examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github polkadot-js / apps / packages / app-accounts / src / modals / Qr.tsx View on Github external
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();
  };
github polkadot-js / extension / packages / extension / src / background / handlers / Extension.ts View on Github external
private accountsCreateExternal ({ address, genesisHash, name }: RequestAccountCreateExternal): boolean {
    keyring.addExternal(address, { name, genesisHash });

    return true;
  }