Skip to content

Commit

Permalink
Merge pull request #305 from Tonomy-Foundation/feature/301-data-shari…
Browse files Browse the repository at this point in the history
…ng-class

created class for data sharing
  • Loading branch information
sadiabbasi authored Oct 2, 2023
2 parents 1be0108 + 44678c8 commit 44fab37
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
23 changes: 23 additions & 0 deletions src/sdk/util/dataSharingRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { VerifiableCredentialOptions, VerifiableCredentialWithType } from './ssi/vc';
import { Issuer } from '@tonomy/did-jwt-vc';

export type DataSharingRequestPayload = {
username: boolean;
};

export class DataSharingRequest extends VerifiableCredentialWithType<DataSharingRequestPayload> {
protected static type = 'DataSharingRequest';

/**
* Alternative constructor that returns type DataSharingRequest
*/
static async signRequest(
payload: DataSharingRequestPayload,
issuer: Issuer,
options: VerifiableCredentialOptions = {}
) {
const vc = await super.sign<DataSharingRequestPayload>(payload, issuer, options);

return new DataSharingRequest(vc);
}
}
1 change: 1 addition & 0 deletions src/sdk/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ export * from './ssi/types';
export * from './time';
export * from './username';
export * from './qr-code';
export * from './dataSharingRequest';

0 comments on commit 44fab37

Please sign in to comment.