Skip to content

Commit

Permalink
Add handleLogout
Browse files Browse the repository at this point in the history
  • Loading branch information
apporc committed May 1, 2024
1 parent edc8f89 commit 72cdf51
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
Chains,
Checksum256,
LoginContext,
LogoutContext,
PermissionLevel,
ResolvedSigningRequest,
Serializer,
Expand Down Expand Up @@ -83,6 +84,14 @@ export async function handleLogin(context: LoginContext): Promise<WalletPluginLo
}
}

export async function handleLogout(context: LogoutContext): Promise<void> {
if (context.session === undefined) {
throw new Error('Unknown session')
}
const {scatter} = await getScatter({appName: context.appName, chain: context.session.chain})
await scatter.logout()
}

export async function handleSignatureRequest(
resolved: ResolvedSigningRequest,
context: TransactContext
Expand Down

0 comments on commit 72cdf51

Please sign in to comment.