diff --git a/website/src/components/CreatePortal.tsx b/website/src/components/CreatePortal.tsx index dff8d4cf..a780e5dc 100644 --- a/website/src/components/CreatePortal.tsx +++ b/website/src/components/CreatePortal.tsx @@ -1,10 +1,11 @@ import { type FunctionComponent, useState } from "react"; import { VeraxSdk } from "@verax-attestation-registry/verax-sdk"; import { useAccount } from "wagmi"; +import { Address } from "@wagmi/core"; export type SDKDemoProps = { veraxSdk: VeraxSdk; - getTxHash: (hash: `0x${string}`) => void; + getTxHash: (hash: Address) => void; }; const CreatePortal: FunctionComponent = ({ veraxSdk, getTxHash }) => { diff --git a/website/src/components/CreateSchema.tsx b/website/src/components/CreateSchema.tsx index d8c4e276..ae26a32e 100644 --- a/website/src/components/CreateSchema.tsx +++ b/website/src/components/CreateSchema.tsx @@ -1,11 +1,12 @@ import { type FunctionComponent, useEffect, useState } from "react"; import { VeraxSdk } from "@verax-attestation-registry/verax-sdk"; import { useAccount } from "wagmi"; +import { Address } from "@wagmi/core"; export type SDKDemoProps = { veraxSdk: VeraxSdk; - getTxHash: (hash: `0x${string}`) => void; - getSchemaId: (schemaId: `0x${string}`) => void; + getTxHash: (hash: Address) => void; + getSchemaId: (schemaId: Address) => void; }; const SCHEMA = "(bool hasCompletedTutorial)"; @@ -20,7 +21,7 @@ const CreateSchema: FunctionComponent = ({ veraxSdk, getTxHash, ge useEffect(() => { const fetchSchema = async () => { - const schemaId = (await veraxSdk.schema.getIdFromSchemaString(SCHEMA)) as `0x${string}`; + const schemaId = (await veraxSdk.schema.getIdFromSchemaString(SCHEMA)) as Address; const alreadyExists = (await veraxSdk.schema.getSchema(schemaId)) as boolean; setSchemaId(schemaId); setSchemaExists(alreadyExists); diff --git a/website/src/components/IssueAttestation.tsx b/website/src/components/IssueAttestation.tsx index 46cd422c..8d8ce76c 100644 --- a/website/src/components/IssueAttestation.tsx +++ b/website/src/components/IssueAttestation.tsx @@ -1,12 +1,13 @@ import { type FunctionComponent, useState } from "react"; import { VeraxSdk } from "@verax-attestation-registry/verax-sdk"; import { useAccount } from "wagmi"; +import { Address } from "@wagmi/core"; export type SDKDemoProps = { veraxSdk: VeraxSdk; - getTxHash: (hash: `0x${string}`) => void; - schemaId: `0x${string}`; - portalId: `0x${string}`; + getTxHash: (hash: Address) => void; + schemaId: Address; + portalId: Address; }; const IssueAttestation: FunctionComponent = ({ veraxSdk, getTxHash, schemaId, portalId }) => { diff --git a/website/src/pages/Tutorials.tsx b/website/src/pages/Tutorials.tsx index bfb757ab..a87e1f32 100644 --- a/website/src/pages/Tutorials.tsx +++ b/website/src/pages/Tutorials.tsx @@ -5,7 +5,7 @@ import ConnectWallet from "../components/ConnectWallet.tsx"; import IssueAttestation from "../components/IssueAttestation.tsx"; import AttestationPreview from "../components/AttestationPreview.tsx"; import { waitForTransactionReceipt } from "viem/actions"; -import { getPublicClient } from "@wagmi/core"; +import { Address, getPublicClient } from "@wagmi/core"; import CreateSchema from "../components/CreateSchema.tsx"; import CreatePortal from "../components/CreatePortal.tsx"; import { decodeEventLog, parseAbi } from "viem"; @@ -16,8 +16,8 @@ export type SDKDemoProps = { const Tutorials: FunctionComponent = ({ title }) => { const [veraxSdk, setVeraxSdk] = useState(); - const [schemaId, setSchemaId] = useState<`0x${string}`>(); - const [portalId, setPortalId] = useState<`0x${string}`>(); + const [schemaId, setSchemaId] = useState
(); + const [portalId, setPortalId] = useState
(); const [attestationId, setAttestationId] = useState(); const { address, isConnected } = useAccount(); @@ -36,14 +36,14 @@ const Tutorials: FunctionComponent = ({ title }) => { } }, [chain, address]); - const handleSchemaTx = async (hash: `0x${string}`) => { + const handleSchemaTx = async (hash: Address) => { const receipt = await waitForTransactionReceipt(getPublicClient(), { hash, }); setSchemaId(receipt.logs[0].topics[1]); }; - const handlePortalTx = async (hash: `0x${string}`) => { + const handlePortalTx = async (hash: Address) => { const receipt = await waitForTransactionReceipt(getPublicClient(), { hash, }); @@ -55,7 +55,7 @@ const Tutorials: FunctionComponent = ({ title }) => { setPortalId(decodedLogs.args.portalAddress); }; - const handleAttestationTx = async (hash: `0x${string}`) => { + const handleAttestationTx = async (hash: Address) => { const receipt = await waitForTransactionReceipt(getPublicClient(), { hash, });