mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
implement AttestationVerifier.ts
This commit is contained in:
@@ -337,7 +337,11 @@ export const countryCodes = {
|
||||
"ZMB": "Zambia",
|
||||
"ZWE": "Zimbabwe"
|
||||
}
|
||||
|
||||
export function getCountryCode(countryName: string): string | string {
|
||||
const entries = Object.entries(countryCodes);
|
||||
const found = entries.find(([_, name]) => name.toLowerCase() === countryName.toLowerCase());
|
||||
return found ? found[0] : 'undefined';
|
||||
}
|
||||
export const countryNames = [
|
||||
"Afghanistan",
|
||||
"Aland Islands",
|
||||
|
||||
@@ -17,7 +17,7 @@ export interface OpenPassportAppPartial {
|
||||
}
|
||||
|
||||
export interface OpenPassportApp extends OpenPassportAppPartial {
|
||||
args: ArgumentsProveOffChain | ArgumentsProveOnChain | ArgumentsRegisterOffChain | ArgumentsRegisterOnChain | ArgumentsDisclose
|
||||
args: ArgumentsProveOffChain | ArgumentsProveOnChain | ArgumentsRegister | ArgumentsDisclose
|
||||
}
|
||||
|
||||
export interface ArgumentsProveOffChain {
|
||||
@@ -31,14 +31,11 @@ export interface ArgumentsProveOnChain {
|
||||
rpcUrl: string,
|
||||
}
|
||||
|
||||
export interface ArgumentsRegisterOffChain {
|
||||
export interface ArgumentsRegister {
|
||||
cscaMerkleTreeUrl: string,
|
||||
modalServerUrl: string,
|
||||
}
|
||||
|
||||
export interface ArgumentsRegisterOnChain extends ArgumentsRegisterOffChain {
|
||||
rpcUrl: string,
|
||||
}
|
||||
|
||||
export interface ArgumentsDisclose {
|
||||
disclosureOptions: DisclosureOptions,
|
||||
|
||||
@@ -39,6 +39,8 @@ export interface OpenPassportAttestation {
|
||||
nullifier?: string;
|
||||
};
|
||||
proof: {
|
||||
circuit: string;
|
||||
signatureAlgorithm: string;
|
||||
type: string;
|
||||
verificationMethod: string;
|
||||
value: {
|
||||
@@ -48,6 +50,8 @@ export interface OpenPassportAttestation {
|
||||
vkey: string;
|
||||
};
|
||||
dscProof: {
|
||||
circuit: string;
|
||||
signatureAlgorithm: string;
|
||||
type: string;
|
||||
verificationMethod: string;
|
||||
value: {
|
||||
@@ -161,6 +165,8 @@ export function buildAttestation(options: {
|
||||
issuanceDate: new Date().toISOString(),
|
||||
credentialSubject: credentialSubject,
|
||||
proof: {
|
||||
circuit: '',
|
||||
signatureAlgorithm: '',
|
||||
type: 'ZeroKnowledgeProof',
|
||||
verificationMethod:
|
||||
'https://github.com/zk-passport/openpassport',
|
||||
@@ -171,6 +177,8 @@ export function buildAttestation(options: {
|
||||
vkey: '',
|
||||
},
|
||||
dscProof: {
|
||||
circuit: '',
|
||||
signatureAlgorithm: '',
|
||||
type: 'ZeroKnowledgeProof',
|
||||
verificationMethod:
|
||||
'https://github.com/zk-passport/openpassport',
|
||||
@@ -217,6 +225,8 @@ export class OpenPassportDynamicAttestation implements OpenPassportAttestation {
|
||||
nullifier?: string;
|
||||
};
|
||||
proof: {
|
||||
circuit: string;
|
||||
signatureAlgorithm: string;
|
||||
type: string;
|
||||
verificationMethod: string;
|
||||
value: {
|
||||
@@ -226,6 +236,8 @@ export class OpenPassportDynamicAttestation implements OpenPassportAttestation {
|
||||
vkey;
|
||||
};
|
||||
dscProof: {
|
||||
circuit: string;
|
||||
signatureAlgorithm: string;
|
||||
type: string;
|
||||
verificationMethod: string;
|
||||
value: {
|
||||
|
||||
Reference in New Issue
Block a user