Skip to content

Commit 7de3af4

Browse files
committed
Merge branch 'main' into data-attestation-cred
2 parents ccde9bd + fa8b5f1 commit 7de3af4

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/client.ts

+28
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,34 @@ export class ExtensionClient {
312312
return this.sendMessage("/signify/authorize/credential", { payload });
313313
};
314314

315+
/**
316+
* Sends a /signify/get-session-info message to the extension.
317+
* prereq:
318+
* once webapp has received an authorized result, a session is created on the extension
319+
*
320+
* Upon successfull session, this method is used to receive previously
321+
* selected signature conditioned to its session validity. If session is expired this would throw an error.
322+
* Otherwise, it returns AuthorizeResult
323+
*
324+
* @param payload The arguments to pass to the extension.
325+
* @returns {AuthorizeResult}
326+
*/
327+
getSessionInfo = async (payload?: AuthorizeArgs): Promise<AuthorizeResult> => {
328+
return this.sendMessage("/signify/get-session-info", { payload });
329+
};
330+
331+
/**
332+
* Sends a /signify/clear-session message to the extension.
333+
*
334+
* This method is used to clear session with extension if exist.
335+
*
336+
* @param payload The arguments to pass to the extension.
337+
* @returns {AuthorizeResult}
338+
*/
339+
clearSession = async (payload?: AuthorizeArgs): Promise<AuthorizeResult> => {
340+
return this.sendMessage("/signify/clear-session", { payload });
341+
};
342+
315343
/**
316344
* Sends a /signify/credential/create/data-attestation message to the extension.
317345
*

0 commit comments

Comments
 (0)