-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add w3c signedCredentail & storedCredential
Signed-off-by: Poonam Ghewande <poonam.ghewande@ayanworks.com>
- Loading branch information
1 parent
18f952b
commit 4732b16
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './w3cCredentials' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { Agent, StoreCredentialOptions, W3cJsonLdSignCredentialOptions } from '@credo-ts/core' | ||
|
||
// W3C Credential | ||
|
||
/** | ||
* Signed a W3C credential. | ||
* | ||
* @param agent The agent instance to use for retrieving the credential record. | ||
* @param W3cJsonLdSignCredentialOptions The format of the credential to be signed. | ||
* @returns A Promise that resolves to signed w3c credential . | ||
*/ | ||
export const signCredential = async (agent: Agent, options: W3cJsonLdSignCredentialOptions) => { | ||
return await agent.w3cCredentials.signCredential(options) | ||
} | ||
|
||
/** | ||
* Store a W3C credential. | ||
* | ||
* @param agent The agent instance to use for retrieving the credential record. | ||
* @param StoreCredentialOptions The format of the credential to be stored. | ||
* @returns A Promise that resolves to stored w3c credential. | ||
*/ | ||
export const storeCredential = async (agent: Agent, options: StoreCredentialOptions) => { | ||
return await agent.w3cCredentials.storeCredential(options) | ||
} |