Git Product home page Git Product logo

credo-universal-resolver's Introduction

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

credo-universal-resolver's People

Contributors

berendsliedrecht avatar animo-bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.