diff --git a/apps/shared/src/events/credentialEvents.ts b/apps/shared/src/events/credentialEvents.ts index e52cdbf812ad908da705d976dbf5eaab48be7ad3..a3980307cdaf6f99c66dbd35a8069cfafb6e1a13 100644 --- a/apps/shared/src/events/credentialEvents.ts +++ b/apps/shared/src/events/credentialEvents.ts @@ -50,6 +50,27 @@ export class EventAnonCredsCredentialsGetById extends BaseEvent<CredentialExchan } } +export type EventDidcommAnonCredsCredentialsAcceptOfferInput = BaseEventInput<{ + credentialId: string; +}>; +export class EventDidcommAnonCredsCredentialsAcceptOffer extends BaseEvent<CredentialExchangeRecord> { + public static token = 'didcomm.anoncreds.credentials.acceptOffer'; + + public get instance() { + return JsonTransformer.fromJSON(this.data, CredentialExchangeRecord); + } + + public static fromEvent(e: EventDidcommAnonCredsCredentialsOffer) { + return new EventDidcommAnonCredsCredentialsOffer( + e.data, + e.tenantId, + e.id, + e.type, + e.timestamp, + ); + } +} + export type EventDidcommAnonCredsCredentialsOfferInput = BaseEventInput<{ connectionId: string; credentialDefinitionId: string; diff --git a/apps/shared/src/events/proofEvents.ts b/apps/shared/src/events/proofEvents.ts index 414c62a7b8da62e3fa21aef5477d05a9c56602d4..b7acdb236e6e24335ebc0ba0bf46ed4642e8d93f 100644 --- a/apps/shared/src/events/proofEvents.ts +++ b/apps/shared/src/events/proofEvents.ts @@ -106,3 +106,24 @@ export class EventAnonCredsProofsDeleteById extends BaseEvent { ); } } + +export type EventDidcommAnonCredsProofsAcceptRequestInput = BaseEventInput<{ + proofRecordId: string; +}>; +export class EventDidcommAnonCredsProofsAcceptRequest extends BaseEvent<ProofExchangeRecord> { + public static token = 'didcomm.anoncreds.proofs.acceptRequest'; + + public get instance() { + return JsonTransformer.fromJSON(this.data, ProofExchangeRecord); + } + + public static fromEvent(e: EventDidcommAnonCredsProofsRequest) { + return new EventDidcommAnonCredsProofsRequest( + e.data, + e.tenantId, + e.id, + e.type, + e.timestamp, + ); + } +}