Skip to content

Commit

Permalink
add w3c signedCredentail & storedCredential
Browse files Browse the repository at this point in the history
Signed-off-by: Poonam Ghewande <poonam.ghewande@ayanworks.com>
  • Loading branch information
poonam-ghewande committed Apr 15, 2024
1 parent 18f952b commit 4732b16
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/ssi/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export * from './basicMessages'
export * from './pushNotifications'
export * from './genericRecords'
export * from './questionAnswer'
export * from './w3cCredentials'
// Core
export {
LogLevel,
Expand Down
1 change: 1 addition & 0 deletions packages/ssi/src/w3cCredentials/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './w3cCredentials'
25 changes: 25 additions & 0 deletions packages/ssi/src/w3cCredentials/w3cCredentials.ts
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)
}

0 comments on commit 4732b16

Please sign in to comment.