From a4e691e1c544e4983193112ad10dbd30c921ae11 Mon Sep 17 00:00:00 2001 From: saeeddawod Date: Thu, 14 Aug 2025 09:56:56 +0700 Subject: [PATCH] fix(docs): correct EAS variable naming and attestation UID access - Fix variable naming conflict (const EAS = new EAS -> const eas = new EAS) - Fix attestation UID access (receipt.attestationUID -> newAttestationUID from tx.wait()) - Apply fixes to all 4 EAS documentation files for consistency - Ensures code examples work correctly when copied by developers --- .../evm-chains-guide/attestation-indexer.mdx | 11 ++++++----- .../hedera-hashgraph-guide/attestation-indexer.mdx | 11 ++++++----- .../middleware-and-api-layer/attestation-indexer.mdx | 11 ++++++----- content/docs/use-case-guides/attestation-service.mdx | 11 ++++++----- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/content/docs/building-with-settlemint/evm-chains-guide/attestation-indexer.mdx b/content/docs/building-with-settlemint/evm-chains-guide/attestation-indexer.mdx index cef50a06..bd428597 100644 --- a/content/docs/building-with-settlemint/evm-chains-guide/attestation-indexer.mdx +++ b/content/docs/building-with-settlemint/evm-chains-guide/attestation-indexer.mdx @@ -302,7 +302,7 @@ const config = { // Connect to the blockchain const provider = new ethers.JsonRpcProvider(config.rpcUrl); const signer = new ethers.Wallet(config.privateKey, provider); -const EAS = new EAS(config.easAddress); +const eas = new EAS(config.easAddress); eas.connect(signer); // Create an encoder that matches our schema structure @@ -333,11 +333,12 @@ async function createAttestation() { }, }); - // Wait for confirmation and get the result - const receipt = await tx.wait(); + // Wait for confirmation and get the full transaction receipt + const newAttestationUID = await tx.wait(); + console.log( "✅ Attestation created successfully! UID:", - receipt.attestationUID + newAttestationUID ); } catch (error) { console.error("❌ Error creating attestation:", error.message); @@ -382,7 +383,7 @@ const config = { async function verifyAttestation(attestationUID) { // Setup our blockchain connection const provider = new ethers.JsonRpcProvider(config.rpcUrl); - const EAS = new EAS(config.easAddress); + const eas = new EAS(config.easAddress); eas.connect(provider); console.log("🔍 Verifying attestation:", attestationUID); diff --git a/content/docs/building-with-settlemint/hedera-hashgraph-guide/attestation-indexer.mdx b/content/docs/building-with-settlemint/hedera-hashgraph-guide/attestation-indexer.mdx index d12adcbf..cf1862aa 100644 --- a/content/docs/building-with-settlemint/hedera-hashgraph-guide/attestation-indexer.mdx +++ b/content/docs/building-with-settlemint/hedera-hashgraph-guide/attestation-indexer.mdx @@ -302,7 +302,7 @@ const config = { // Connect to the blockchain const provider = new ethers.JsonRpcProvider(config.rpcUrl); const signer = new ethers.Wallet(config.privateKey, provider); -const EAS = new EAS(config.easAddress); +const eas = new EAS(config.easAddress); eas.connect(signer); // Create an encoder that matches our schema structure @@ -333,11 +333,12 @@ async function createAttestation() { }, }); - // Wait for confirmation and get the result - const receipt = await tx.wait(); + // Wait for confirmation and get the full transaction receipt + const newAttestationUID = await tx.wait(); + console.log( "✅ Attestation created successfully! UID:", - receipt.attestationUID + newAttestationUID ); } catch (error) { console.error("❌ Error creating attestation:", error.message); @@ -382,7 +383,7 @@ const config = { async function verifyAttestation(attestationUID) { // Setup our blockchain connection const provider = new ethers.JsonRpcProvider(config.rpcUrl); - const EAS = new EAS(config.easAddress); + const eas = new EAS(config.easAddress); eas.connect(provider); console.log("🔍 Verifying attestation:", attestationUID); diff --git a/content/docs/platform-components/middleware-and-api-layer/attestation-indexer.mdx b/content/docs/platform-components/middleware-and-api-layer/attestation-indexer.mdx index dd6a411e..41647bd6 100644 --- a/content/docs/platform-components/middleware-and-api-layer/attestation-indexer.mdx +++ b/content/docs/platform-components/middleware-and-api-layer/attestation-indexer.mdx @@ -334,7 +334,7 @@ const config = { // Connect to the blockchain const provider = new ethers.JsonRpcProvider(config.rpcUrl); const signer = new ethers.Wallet(config.privateKey, provider); -const EAS = new EAS(config.easAddress); +const eas = new EAS(config.easAddress); eas.connect(signer); // Create an encoder that matches our schema structure @@ -365,11 +365,12 @@ async function createAttestation() { }, }); - // Wait for confirmation and get the result - const receipt = await tx.wait(); + // Wait for confirmation and get the full transaction receipt + const newAttestationUID = await tx.wait(); + console.log( "✅ Attestation created successfully! UID:", - receipt.attestationUID + newAttestationUID ); } catch (error) { console.error("❌ Error creating attestation:", error.message); @@ -414,7 +415,7 @@ const config = { async function verifyAttestation(attestationUID) { // Setup our blockchain connection const provider = new ethers.JsonRpcProvider(config.rpcUrl); - const EAS = new EAS(config.easAddress); + const eas = new EAS(config.easAddress); eas.connect(provider); console.log("🔍 Verifying attestation:", attestationUID); diff --git a/content/docs/use-case-guides/attestation-service.mdx b/content/docs/use-case-guides/attestation-service.mdx index 5911fe87..c900e4b0 100644 --- a/content/docs/use-case-guides/attestation-service.mdx +++ b/content/docs/use-case-guides/attestation-service.mdx @@ -299,7 +299,7 @@ const config = { // Connect to the blockchain const provider = new ethers.JsonRpcProvider(config.rpcUrl); const signer = new ethers.Wallet(config.privateKey, provider); -const EAS = new EAS(config.easAddress); +const eas = new EAS(config.easAddress); eas.connect(signer); // Create an encoder that matches our schema structure @@ -330,11 +330,12 @@ async function createAttestation() { }, }); - // Wait for confirmation and get the result - const receipt = await tx.wait(); + // Wait for confirmation and get the full transaction receipt + const newAttestationUID = await tx.wait(); + console.log( "✅ Attestation created successfully! UID:", - receipt.attestationUID + newAttestationUID ); } catch (error) { console.error("❌ Error creating attestation:", error.message); @@ -379,7 +380,7 @@ const config = { async function verifyAttestation(attestationUID) { // Setup our blockchain connection const provider = new ethers.JsonRpcProvider(config.rpcUrl); - const EAS = new EAS(config.easAddress); + const eas = new EAS(config.easAddress); eas.connect(provider); console.log("🔍 Verifying attestation:", attestationUID);