πŸ› οΈUsing the SDK

Installation

VeraxSDK is a npm package.

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

Getting Started

1. Import VeraxSdk

// CommonJS
var VeraxSdk = require("@verax-attestation-registry/verax-sdk");
// ES6
import { VeraxSdk } from "@verax-attestation-registry/verax-sdk";

2. Instantiate VeraxSdk

// Default configuration for Linea Sepolia

// Frontend
const veraxSdk = new VeraxSdk(VeraxSdk.DEFAULT_LINEA_SEPOLIA_FRONTEND);
// Backend
const veraxSdk = new VeraxSdk(VeraxSdk.DEFAULT_LINEA_SEPOLIA);

Or:

Or:


Read and write objects

1. Get DataMappers

2. Read content (one object)

Each DataMapper comes with the method findOneById to get one object by ID.

3. Read content (list / many objects)

Each DataMapper comes with the method findBy to get objects by criteria. Each DataMapper comes with the method findBy to get objects by criteria.

4. Write content

Each dataMapper comes with methods to write data that may vary depending on the class. See the detail of write method per class dataMapper.


Other operations

[Work in progress] The class veraxSdk.utils extends the capabilities:

  • precompute the ID of an attestation

  • encode decode payload

Last updated