How to use the @polkadot/ui-keyring.forgetAccount 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 / extension / packages / extension / src / background / handlers / Extension.ts View on Github external
private accountsForget ({ address }: RequestAccountForget): boolean {
    keyring.forgetAccount(address);

    return true;
  }
github polkadot-js / apps / packages / app-accounts / src / Account.tsx View on Github external
const _onForget = (): void => {
    if (!address) {
      return;
    }

    const status: Partial = {
      account: address,
      action: 'forget'
    };

    try {
      keyring.forgetAccount(address);
      status.status = 'success';
      status.message = t('account forgotten');
    } catch (error) {
      status.status = 'error';
      status.message = error.message;
    }
  };
  const _onGenesisChange = (genesisHash: string | null): void => {
github polkadot-js / apps / packages / app-accounts / src / Editor.tsx View on Github external
() => {
        const status = {
          account: current.address(),
          action: 'forget'
        } as ActionStatus;

        try {
          keyring.forgetAccount(
            current.address()
          );
          status.status = 'success';
          status.message = t('account forgotten');
        } catch (error) {
          status.status = 'error';
          status.message = error.message;
        }

        onStatusChange(status);
      }
    );