Skip to content

Commit

Permalink
Added RemoveActiveAccounts to DappClient;
Browse files Browse the repository at this point in the history
  • Loading branch information
k-karuna committed Mar 28, 2023
1 parent efc1d45 commit fae59cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Beacon.Sdk.Sample.Dapp/Sample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ public async Task Run()
await BeaconDappClient.RequestOperation(operationDetails);
break;
}
case "logout":
{
BeaconDappClient.RemoveActiveAccounts();
break;
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Beacon.Sdk/BeaconClients/Abstract/IDappBeaconClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public interface IDappBeaconClient : IBaseBeaconClient
string GetPairingRequestInfo();
Peer? GetActivePeer();
PermissionInfo? GetActiveAccount();
void RemoveActiveAccounts();
Task RequestPermissions(IEnumerable<PermissionScope> permissions, Network network);
Task RequestOperation(IEnumerable<TezosBaseOperation> operations);
Task RequestSign(string payload, SignPayloadType payloadType);
Expand Down
5 changes: 5 additions & 0 deletions Beacon.Sdk/BeaconClients/DappBeaconClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public string GetPairingRequestInfo()
return PeerRepository.TryGetActive().Result;
}

public void RemoveActiveAccounts()
{
PeerRepository.MarkAllInactive();
}

public PermissionInfo? GetActiveAccount()
{
var activePeer = GetActivePeer();
Expand Down

0 comments on commit fae59cc

Please sign in to comment.