Socket
Socket
Sign inDemoInstall

@animo-id/afj-universal-resolver

Package Overview
Dependencies
0
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @animo-id/afj-universal-resolver

AFJ Universal DID Resolver integration


Version published
Maintainers
4
Install size
19.8 kB
Created

Readme

Source

Animo Logo

Univeral Resolver integration for Aries Framework JavaScript

Powered by   Animo Logo

Getting started  |  Usage  |  Contributing  |  License


Getting Started

Yarn
yarn add @animo-id/afj-universal-resolver

Usage

NOTE: it is recommended to use a self-hosted universal resolver and only use the development hosted one for development.

import { UniversalDidResolver } from "@animo-id/afj-universal-resolver"
import { agentDependencies } from "@aries-framework/node"
import { Agent, DidsModule } from "@aries-framework/core"
import { AskarModule } from "@aries-framework/askar"
import { ariesAskar } from "@hyperledger/aries-askar-nodejs"

const devUniResolverUrl = "https://dev.uniresolver.io/1.0"
const didKey =
  "did:key:z4MXj1wBzi9jUstyPMS4jQqB6KdJaiatPkAtVtGc6bQEQEEsKTic4G7Rou3iBf9vPmT5dbkm9qsZsuVNjq8HCuW1w24nhBFGkRE4cd2Uf2tfrB3N7h4mnyPp1BF3ZttHTYv3DLUPi1zMdkULiow3M1GfXkoC6DoxDUm1jmN6GBj22SjVsr6dxezRVQc7aj9TxE7JLbMH1wh5X3kA58H3DFW8rnYMakFGbca5CB2Jf6CnGQZmL7o5uJAdTwXfy2iiiyPxXEGerMhHwhjTA1mKYobyk2CpeEcmvynADfNZ5MBvcCS7m3XkFCMNUYBS9NQ3fze6vMSUPsNa6GVYmKx2x6JrdEjCk3qRMMmyjnjCMfR4pXbRMZa3i"

const uni = await UniversalDidResolver.initializeWithDynamicMethods(
  agentDependencies,
  `${devUniResolverUrl}/methods`,
  `${devUniResolverUrl}/identifiers`
)

const agent = new Agent({
  config: {
    label: "my-agent",
    walletConfig: { id: "some-id", key: "some-key" }
  },
  modules: {
    askar: new AskarModule({ ariesAskar }),
    dids: new DidsModule({ resolvers: [uni] })
  },
  dependencies: agentDependencies
})

await agent.initialize()

const { didDocument } = await agent.dids.resolve(didKey)

Contributing

Is there something you'd like to fix or add? Great, we love community contributions! To get involved, please follow our contribution guidelines.

License

Apache 2.0

FAQs

Last updated on 24 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc