# @jolocom/jolo-did-resolver

> This module encapsulates the logic required to resolve Jolocom Identities using an instance of the Jolocom [registry smart contract](../registry-contract) and an IPFS gateway. The exported interface is compatible with the [DIF DID-Resolver](https://github

Latest version **1.0.0** (published 2020-11-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jolocom/jolo-did-resolver
pnpm add @jolocom/jolo-did-resolver
yarn add @jolocom/jolo-did-resolver
bun add @jolocom/jolo-did-resolver
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-11-16 |
| First published | 2020-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 16.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | chunningham, mnzaki, jolocom-dev |

## Links

- npm: https://www.npmjs.com/package/@jolocom/jolo-did-resolver
- npm.io page: https://npm.io/package/@jolocom/jolo-did-resolver

## Dependencies (3)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1
- [detect-node](https://npm.io/package/detect-node.md) ^2.0.4
- [@jolocom/registry-contract](https://npm.io/package/@jolocom/registry-contract.md) ^1.0.0

## Recent versions

- 1.0.0 (latest) — 2020-11-16
- 1.0.0-rc6 — 2020-10-14
- 1.0.0-rc5 — 2020-08-25
- 1.0.0-rc4 — 2020-08-23
- 1.0.0-rc3 — 2020-08-23
- 1.0.0-rc2 — 2020-08-23
- 1.0.0-rc.0.1 — 2020-08-22

## README

# @jolocom/jolo-did-resolver
This module encapsulates the logic required to resolve Jolocom Identities using an instance of the Jolocom [registry smart contract](../registry-contract) and an IPFS gateway.
The exported interface is compatible with the [DIF DID-Resolver](https://github.com/decentralized-identity/did-resolver) module.

*Please note that this module is not meant to be used directly, but rather through an integration with either the Jolocom Library ([source](https://github.com/jolocom/jolocom-lib/blob/next/ts/didMethods/jolo/resolver.ts#L31)), or the DIF DID-Resolver module (as shown in the example below)*

## Usage examples
In combination with the [DIF DID-Resolver](https://github.com/decentralized-identity/did-resolver):

```typescript
import { getResolver } from "@jolocom/jolo-did-resolver";
import { Resolver } from "did-resolver";

const resolver = new Resolver(getResolver());
const didDocument = await resolver.resolve(did);
// didDocument now contains the corresponding Did Document in JSON form.
```

A number of configuration options can be passed to the `getResolver` function, as shown in this example:

```typescript
import { getResolver } from "@jolocom/jolo-did-resolver";
import { Resolver } from "did-resolver";

// The Ethereum gateway to use for reading the registry contract state and broadcasting transactions
const ethGatewayEndpoint = 'https://rinkeby.infura.io/v3/000085cafc1934feaa09ccb83630d5d8'

// The Ethereum address of a instance of the registry smart contract to use for anchoring / resolution
const registryContractAddress = '0xD333333333333333333AAAAAAAAAAFFFFFFFFF20'

// A public IPFS gateway which can be used to store and retrieve documents
const ipfsGatewayEndpoint = 'https://ipfs.example.com:443'

const resolver = new Resolver(getResolver(ethGatewayEndpoint, registryContractAddress, ipfsGatewayEndpoint));
const didDocument = await resolver.resolve(did);
// didDocument now contains the corresponding Did Document in JSON form.
```

If no arguments are passed to the `getResolver()` function, [default arguments are used](https://github.com/jolocom/jolo-did-method/blob/master/packages/jolo-did-resolver/ts/index.ts#L5).

---
_Source: https://npm.io/package/@jolocom/jolo-did-resolver · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
