Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
fix: remove zkpass
Browse files Browse the repository at this point in the history
  • Loading branch information
EjembiEmmanuel committed Oct 27, 2024
1 parent e14fdf7 commit aa0d4ac
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 26 deletions.
3 changes: 1 addition & 2 deletions frontend/src/app/components/Scan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
StarIcon2,
} from '@/assets/icons/icons';
import { abi } from '@/lib/abi';
import { CONTRACT_ADDR, formatIpfsHash, zkPassVerify } from '@/lib/config';
import { CONTRACT_ADDR, formatIpfsHash } from '@/lib/config';
import { fetchIpfsFile } from '@/services/apiService';
import {
useAccount,
Expand Down Expand Up @@ -51,7 +51,6 @@ export default function ScanProduct() {
const fetchData = async () => {
try {
if (data) {
zkPassVerify();
const ipfsResults = await fetchIpfsFile(
formatIpfsHash(data.toString())
);
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/components/Scan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
CONTRACT_ADDR,
formatDate,
formatIpfsHash,
zkPassVerify,
} from '@/lib/config';
import { fetchIpfsFile } from '@/services/apiService';
import { useAccount, useContractRead } from '@starknet-react/core';
Expand Down Expand Up @@ -56,7 +55,6 @@ export default function ScanProduct() {
try {
if (data) {
let hash: string = (data as any).ipfs_hash;
// zkPassVerify();
const ipfsResults = await fetchIpfsFile(hash);
setProduct(ipfsResults);
}
Expand Down
22 changes: 0 additions & 22 deletions frontend/src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import TransgateConnect from '@zkpass/transgate-js-sdk';

export const CONTRACT_ADDR =
'0x77d35c666955199a1ebf7424089f29f48a635b349a95614a763a63d62f61779';

Expand All @@ -11,25 +9,5 @@ export const formatIpfsHash = (hash: string) => {
return hash.replace(/,/g, '');
};

export const zkPassVerify = async () => {
try {
const appid = '8fb9d43c-2f24-424e-a98d-7ba34a5532f5';

const connector = new TransgateConnect(appid);

const isAvailable = await connector.isTransgateAvailable();

if (isAvailable) {
const schemaId = '516a720e-29a4-4307-ae7b-5aec286e446e';

const res = await connector.launch(schemaId);
} else {
console.log('Please install TransGate');
}
} catch (error) {
console.log('transgate error', error);
}
};

export const formatDate = (date: string) =>
date.split('-').reverse().join('. ');

0 comments on commit aa0d4ac

Please sign in to comment.