mirror of
https://github.com/selfxyz/self.git
synced 2026-01-10 07:08:10 -05:00
fix sdk
This commit is contained in:
@@ -94,6 +94,20 @@ export const getCircuitName = (
|
||||
keyLength
|
||||
);
|
||||
};
|
||||
export const getCircuitNameOld = (circuitMode: Mode, signatureAlgorithm: string, hashFunction: string) => {
|
||||
const circuit = circuitNameFromMode[circuitMode];
|
||||
if (circuit == 'vc_and_disclose') {
|
||||
return 'vc_and_disclose';
|
||||
}
|
||||
else if (signatureAlgorithm === 'ecdsa') {
|
||||
return circuit + "_" + signatureAlgorithm + "_secp256r1_" + hashFunction;
|
||||
}
|
||||
else {
|
||||
return circuit + "_" + signatureAlgorithm + "_65537_" + hashFunction;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function getSignatureAlgorithmDetails(oid: string): {
|
||||
signatureAlgorithm: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openpassport/core",
|
||||
"version": "0.0.11",
|
||||
"version": "0.0.12",
|
||||
"main": "dist/sdk/core/index.js",
|
||||
"types": "dist/sdk/core/index.d.ts",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
vkey_dsc_rsapss_65537_sha256,
|
||||
vkey_vc_and_disclose,
|
||||
} from '../../../common/src/constants/vkey';
|
||||
import { getCircuitName } from '../../../common/src/utils/certificates/handleCertificate';
|
||||
import { getCircuitNameOld } from '../../../common/src/utils/certificates/handleCertificate';
|
||||
import { Mode } from 'fs';
|
||||
|
||||
export function getCurrentDateFormatted() {
|
||||
@@ -35,7 +35,7 @@ export function getVkeyFromArtifacts(
|
||||
if (circuit === 'vc_and_disclose') {
|
||||
circuitName = circuit;
|
||||
} else {
|
||||
circuitName = getCircuitName(circuit, signatureAlgorithm, hashFunction);
|
||||
circuitName = getCircuitNameOld(circuit, signatureAlgorithm, hashFunction);
|
||||
}
|
||||
// console.log('\x1b[90m%s\x1b[0m', 'circuit name:', circuitName);
|
||||
switch (circuitName) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openpassport/qrcode",
|
||||
"version": "0.0.14",
|
||||
"version": "0.0.15",
|
||||
"main": "dist/sdk/qrcode/index.js",
|
||||
"types": "dist/sdk/qrcode/index.d.ts",
|
||||
"license": "MIT",
|
||||
@@ -10,7 +10,7 @@
|
||||
},
|
||||
"author": "turnoffthiscomputer",
|
||||
"dependencies": {
|
||||
"@openpassport/core": "0.0.11",
|
||||
"@openpassport/core": "0.0.12",
|
||||
"@types/react": "^18.3.4",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@types/uuid": "^10.0.0",
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
'use client';
|
||||
|
||||
import { OpenPassportQRcode } from '@openpassport/qrcode';
|
||||
// import { OpenPassportQRcode } from '../../../../../qrcode/index';
|
||||
import { OpenPassportVerifier } from '@openpassport/core';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
|
||||
import { OpenPassportVerifier, OpenPassportDynamicAttestation } from '@openpassport/core';
|
||||
// import { OpenPassportVerifier, OpenPassportDynamicAttestation } from '@openpassport/core';
|
||||
// import { OpenPassportVerifier, OpenPassportDynamicAttestation } from '@openpassport/core';
|
||||
export default function Prove() {
|
||||
const userId = uuidv4();
|
||||
const scope = 'scope';
|
||||
|
||||
const openPassportVerifier: OpenPassportVerifier = new OpenPassportVerifier('prove_onchain', scope)
|
||||
const openPassportVerifier: OpenPassportVerifier = new OpenPassportVerifier('prove_offchain', scope)
|
||||
.enableOFACCheck()
|
||||
.excludeCountries('Iran (Islamic Republic of)');
|
||||
.excludeCountries('Iran (Islamic Republic of)').setMinimumAge(55).allowMockPassports();
|
||||
|
||||
return (
|
||||
<div className="h-screen w-full bg-white flex flex-col items-center justify-center gap-4">
|
||||
|
||||
Reference in New Issue
Block a user