Verifying Siwe

This flow diagram illustrates the process of Verifying Siwe

Step 1: Set Up Details

Replace the placeholder values with your actual details:

const siweDto = {
    siweMessage: "YOUR_SIWE_MESSAGE",
    siweSignature: "YOUR_SIWE_SIGNATURE"
}

Step 2: Verify Siwe

Verify Siwe using try and catch:

try {
  verifier.verifySiwe(siweDTO);
} catch (error) {
  throw "Message or signature is invalid";
}

Final Code

Here's the complete code:

import type { Verifier } from "@didpass/verifier-sdk";

async function verifySiwe(){
  const siweDto = {
    siweMessage: "YOUR_SIWE_MESSAGE",
    siweSignature: "YOUR_SIWE_SIGNATURE"
  }
  const verifier = new Verifier();
  try {
    verifier.verifySiwe(siweDTO);
  } catch (error) {
    throw "Message or signature is invalid";
  }
}

Last updated