Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/animo/afj-universal-resolver
Universal Resolver integration for AFJ
https://github.com/animo/afj-universal-resolver
Last synced: 3 days ago
JSON representation
Universal Resolver integration for AFJ
- Host: GitHub
- URL: https://github.com/animo/afj-universal-resolver
- Owner: animo
- License: apache-2.0
- Created: 2023-11-24T11:30:28.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2023-11-24T14:18:02.000Z (12 months ago)
- Last Synced: 2023-11-25T12:35:17.339Z (12 months ago)
- Language: TypeScript
- Size: 354 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Univeral Resolver integration for Aries Framework JavaScript
Powered by
Getting started
|
Usage
|
Contributing
|
License---
## Getting Started
Yarn
```console
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.```typescript
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](./CONTRIBUTING.md).## License
[Apache 2.0](./LICENSE)