Skip to content

Commit

Permalink
feat: getInvestorUniquenessClaims
Browse files Browse the repository at this point in the history
  • Loading branch information
shuffledex committed Dec 18, 2020
1 parent ea97ccc commit b84940f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/Claims.ts
Expand Up @@ -251,6 +251,32 @@ export class Claims {
return result;
}

/**
* Retrieve the list of InvestorUniqueness claims for a target Identity
*
* @param opts.target - identity for which to fetch CDD claims (optional, defaults to the current Identity)
* @param opts.includeExpired - whether to include expired claims. Defaults to true
*/
public async getInvestorUniquenessClaims(
opts: {
target?: string | Identity;
includeExpired?: boolean;
} = {}
): Promise<ClaimData[]> {
const { context } = this;
const { target, includeExpired = true } = opts;

const did = await getDid(target, context);

const result = await context.getIdentityClaimsFromChain({
targets: [did],
claimTypes: [ClaimType.CustomerDueDiligence],
includeExpired,
});

return result;
}

/**
* Retrieve all claims issued about an Identity, grouped by claim issuer
*
Expand Down

0 comments on commit b84940f

Please sign in to comment.