Skip to content

Commit

Permalink
fix: Types for IW3c
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat authored and mirceanis committed Sep 7, 2020
1 parent e319c41 commit 56cf141
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
40 changes: 18 additions & 22 deletions packages/daf-w3c/src/action-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,25 @@ import {
import Debug from 'debug'
const debug = Debug('daf:w3c:action-handler')

export interface ICreateVerifiablePresentationArgs {
presentation: W3CPresentation
save?: boolean
proofFormat: 'jwt'
}

export interface ICreateVerifiableCredentialArgs {
credential: W3CCredential
save?: boolean
proofFormat: 'jwt'
}

export interface IW3c extends IPluginMethodMap {
createVerifiablePresentation: (
args: {
presentation: W3CPresentation
save?: boolean
proofFormat: 'jwt'
},
createVerifiablePresentation(
args: ICreateVerifiablePresentationArgs,
context: IContext,
) => Promise<VerifiablePresentation>
): Promise<VerifiablePresentation>
createVerifiableCredential(
args: {
credential: W3CCredential
save?: boolean
proofFormat: 'jwt'
},
args: ICreateVerifiableCredentialArgs,
context: IContext,
): Promise<VerifiableCredential>
}
Expand All @@ -59,11 +63,7 @@ export class W3c implements IAgentPlugin {
}

async createVerifiablePresentation(
args: {
presentation: W3CPresentation
save?: boolean
proofFormat: 'jwt'
},
args: ICreateVerifiablePresentationArgs,
context: IContext,
): Promise<VerifiablePresentation> {
try {
Expand All @@ -86,11 +86,7 @@ export class W3c implements IAgentPlugin {
}

async createVerifiableCredential(
args: {
credential: W3CCredential
save?: boolean
proofFormat: 'jwt'
},
args: ICreateVerifiableCredentialArgs,
context: IContext,
): Promise<VerifiableCredential> {
try {
Expand Down
7 changes: 6 additions & 1 deletion packages/daf-w3c/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import { IAgentPlugin, IPluginMethodMap } from 'daf-core'
export { W3cMessageHandler, MessageTypes } from './message-handler'
export { W3c, IW3c } from './action-handler'
export {
W3c,
IW3c,
ICreateVerifiableCredentialArgs,
ICreateVerifiablePresentationArgs,
} from './action-handler'

0 comments on commit 56cf141

Please sign in to comment.