loginExternalSigner method

void loginExternalSigner({
  1. required EventSigner signer,
})

adds a new read-only Account and sets the logged pubkey

Implementation

void loginExternalSigner({required EventSigner signer}) {
  final pubkey = signer.getPublicKey();
  if (accounts.containsKey(pubkey)) {
    throw Exception("Cannot login, pubkey already logged in");
  }
  addAccount(
      pubkey: pubkey, type: AccountType.externalSigner, signer: signer);
  _loggedPubkey = pubkey;
  _notifyAuthStateChange();
}