@verida/vda-did-resolver
TypeScript icon, indicating that this package has built-in type declarations

3.0.2 • Public • Published

VDA DID Resolver

Provides a simple getResolver() method that supports resolving Verida DID's.

Installation

yarn add @verida/vda-did-resolver

Usage

import { Resolver } from 'did-resolver'
import { getResolver } from '@verida/did-resolver'

const vdaDidResolver = getResolver()
const didResolver = new Resolver(vdaDidResolver)

const did = 'did:vda:testnet:0x....'

try {
    const response = await didResolver.resolve(did)
    const didDocument = response.didDocument
} catch (err) {
    console.error(err.message)
}

Configuration

getResolver(Web3ResolverConfigurationOptions: {}) supports the following configuration:

export interface Web3ResolverConfigurationOptions {
    rpcUrl?: string;
    timeout?: number;
}

Where:

  • rpcUrl - An optional Polygon RPC_URL to use (a default public RPC_URL is set as default)
  • timeout - An optional timeout (in milliseconds) to wait before failing HTTP requests to API endpoints hosting copies of the DID Document

Readme

Keywords

none

Package Sidebar

Install

npm i @verida/vda-did-resolver

Weekly Downloads

159

Version

3.0.2

License

ISC

Unpacked Size

51 kB

Total Files

30

Last publish

Collaborators

  • verida-engineering
  • nlothian
  • tahpot