Skip to content

Commit

Permalink
fix the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sadia authored and sadia committed Oct 2, 2023
1 parent 41765cd commit 44678c8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
1 change: 0 additions & 1 deletion src/sdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export * from './util/errors';
export * from './util/crypto';
export * from './util/username';
export * from './util/request';
export * from './util/dataSharingRequest';
export * from './util/base64';
export * from './util/ssi/did';
export * as util from './util';
Expand Down
18 changes: 3 additions & 15 deletions src/sdk/util/dataSharingRequest.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
import { PublicKey } from '@wharfkit/antelope';
import { VCWithTypeType, VerifiableCredentialOptions, VerifiableCredentialWithType } from './ssi/vc';
import { VerifiableCredentialOptions, VerifiableCredentialWithType } from './ssi/vc';
import { Issuer } from '@tonomy/did-jwt-vc';

export type DataSharingRequestPayload = {
username: string;
origin: string;
publicKey: PublicKey;
callbackPath: string;
username: boolean;
};

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

/**
* @override the VerifiableCredentialWithType constructor to decode the payload of type DataSharingRequestPayload
*/
constructor(vc: DataSharingRequest | VCWithTypeType<DataSharingRequestPayload>) {
super(vc);
this.decodedPayload.publicKey = PublicKey.from(super.getPayload().publicKey);
}

/**
* Alternative constructor that returns type DataSharingRequest
*/
static async createRequest(
static async signRequest(
payload: DataSharingRequestPayload,
issuer: Issuer,
options: VerifiableCredentialOptions = {}
Expand Down
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 44678c8

Please sign in to comment.