-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #305 from Tonomy-Foundation/feature/301-data-shari…
…ng-class created class for data sharing
- Loading branch information
Showing
3 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
Submodule Tonomy-Communication
updated
10 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters