Skip to content

Commit

Permalink
add Iden3BasicDisplayMethodV1 (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmidyllic authored Jun 14, 2024
1 parent a803979 commit 318dc7a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xpolygonid/js-sdk",
"version": "1.15.2",
"version": "1.15.3",
"description": "SDK to work with Polygon ID",
"main": "dist/node/cjs/index.js",
"module": "dist/node/esm/index.js",
Expand Down
9 changes: 9 additions & 0 deletions src/verifiable/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,12 @@ export enum PaymentType {
export enum SupportedCurrencies {
ETH = 'ETH'
}

/**
* DisplayMethodType type for display method
*
* @enum {string}
*/
export enum DisplayMethodType {
Iden3BasicDisplayMethodV1 = 'Iden3BasicDisplayMethodV1'
}
4 changes: 3 additions & 1 deletion src/verifiable/credential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
BJJSignatureProof2021,
Iden3SparseMerkleTreeProof,
CredentialStatus,
RefreshService
RefreshService,
DisplayMethod
} from './proof';
import {
Claim,
Expand Down Expand Up @@ -42,6 +43,7 @@ export class W3CCredential {
type: string[] = [];
expirationDate?: string;
refreshService?: RefreshService;
displayMethod?: DisplayMethod;
issuanceDate?: string;
credentialSubject: { [key: string]: object | string | number | boolean } = {};
credentialStatus!: CredentialStatus;
Expand Down
17 changes: 16 additions & 1 deletion src/verifiable/proof.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Hash, Proof } from '@iden3/js-merkletree';
import { ProofType, CredentialStatusType, RefreshServiceType } from './constants';
import {
ProofType,
CredentialStatusType,
RefreshServiceType,
DisplayMethodType
} from './constants';
import { TreeState } from '../circuits';
import { Hex, Signature } from '@iden3/js-crypto';
import { Claim, DID } from '@iden3/js-iden3-core';
Expand Down Expand Up @@ -260,3 +265,13 @@ export interface RefreshService {
id: string;
type: RefreshServiceType | string;
}

/**
* DisplayMethod contains type and id
* @public
* @interface DisplayMethod
*/
export interface DisplayMethod {
id: string;
type: DisplayMethodType | string;
}

0 comments on commit 318dc7a

Please sign in to comment.