UNPKG

@sybil-center/zkc-core

Version:
43 lines (42 loc) 1.56 kB
import { type Challenge, type HttpClient, type IssuerTypes } from "zkc-core"; import { Schema } from "../type/schemas.js"; import { ISybilIssuer, SybilChallengeReq, type SybilCred } from "../type/cred.js"; import { SybilWalletProof } from "../type/index.js"; export declare const GOVERNMENT_ID_TYPES: readonly [1, 2, 3, 4, 0]; export type GovernmentIdType = typeof GOVERNMENT_ID_TYPES[number]; export type PassportCred = SybilCred<{ fn: string; ln: string; bd: number; cc: number; doc: { t: GovernmentIdType; id: string; }; }>; export interface PassportChallenge extends Challenge { verifyURL: string; } export interface PassportChallengeReq extends SybilChallengeReq { } export type PassportOptions = PassportChallengeReq["options"]; export interface PassportIT extends IssuerTypes { ChallengeReq: PassportChallengeReq; Challenge: PassportChallenge; Cred: PassportCred; Options: PassportOptions & { windowFeature?: string; }; } export declare class PassportIssuer implements ISybilIssuer<PassportIT> { private readonly client; constructor(client: HttpClient); get providedSchema(): Schema; getChallenge(challengeReq: PassportIT["ChallengeReq"]): Promise<PassportIT["Challenge"]>; canIssue(entry: PassportIT["CanIssueReq"]): Promise<PassportIT["CanIssueResp"]>; issue(issueReq: PassportIT["IssueReq"]): Promise<PassportIT["Cred"]>; issueCred(args: { proof: SybilWalletProof; options?: PassportIT["Options"]; }): Promise<PassportIT["Cred"]>; }