Reading Attestations Off-Chain

This step-by-step guide will run you through programatically reading attestations offchain using Typescript SDKs for EAS and Verax protocols.

Verax

Find the full Verax SDK documentation herearrow-up-right.

Start by installing the Verax SDK package.

# npm
npm i --save @verax-attestation-registry/verax-sdk

Next create a typescript file in a node project and paste the following code.

// ES6
import { VeraxSdk } from "@verax-attestation-registry/verax-sdk";

const veraxSdk = new VeraxSdk(VeraxSdk.DEFAULT_LINEA_TESTNET_FRONTEND);

const attestationDataMapper = veraxSdk.attestation; // RW Attestations

const myAttestation = await attestationDataMapper.findOneById("0x000000000000000000000000000000000000000000000000000000000000109b");

// args:
// 	- criteria: object {property1: value1, property2: value2, ...}
// 	- page: integer (optional, default 0)
// 	- offset: integer (optional, default 50, max= 500)
// 	- orderBy: string (optional, default createdAt)
// 	- order(property?): enum string "ASC", "DESC" (optional, default "DESC")
//
const myAttestations = await attestationDataMapper.findBy(
  { portalId: "37773", subject: "John" },
  4,
  30,
  "schemaId",
  "ASC",
);

console.log(myAttestations);

EAS

Find the full EAS SDK documentation herearrow-up-right.

Start by installing the EAS SDK package.

Next create a typescript file and paste in the following code

Last updated