open-index/open-npm huggingface dataset:
npm package: @red-isbe/did-isbe-registry
Description: A library for interacting with the ISBE DID Registry smart contract.
Author: ISBE
Latest version: 2.0.1

# DID ISBE TS Library
TypeScript library to interact with the ISBE DID Registry contract from Node.js. It provides utilities to build transactions, query data, and convert formats used by the DID registry.

## Requirements

- Node.js 18 or higher
- npm 9 or higher
- TypeScript 5.9 or higher

## Build

```bash
npm install
npm run build
npm run test
```

## Main exported classes

- `DidRegistryContext`: Initializes and maintains the connection context (provider, deployment model, and DID Registry contract).
- `DidRegistryQueries`: Provides read-only methods to query DIDs and DID Documents in the contract.
- `DidRegistryTransactions`: Builds transactions for write operations on DIDs.
- `BlockchainTransactionExecutor`: Sends signed transactions and allows waiting for blockchain confirmation.

## Basic usage
Example: querying a DID Document

### 1) Install package

```bash
npm install @red-isbe/did-isbe-registry
```

### 2) Import and initialize

```ts
import { JsonRpcProvider } from "ethers";
import { DidRegistryContext } from "@red-isbe/did-isbe-registry";

const rpcUrl = "http://your-rpc-url";
const modelDeployId = "uc-dev";
const didRegistryAddress = "0x00000000000000000000000000000000000015BE";

const provider = new JsonRpcProvider(rpcUrl);
const context = new DidRegistryContext(
  provider,
  modelDeployId,
  didRegistryAddress,
);
```

### 3) Usage

```ts
import { DidRegistryQueries } from "@red-isbe/did-isbe-registry";

const did = "did:isbe:uc-dev:z1VDuuYvwpXRNoi9HG9gYga1nPfG";
const queries = new DidRegistryQueries(context);

const doc = await queries.getDidDocument(did);
console.log("DID Document:", doc);
```

## License

Apache-2.0

Copyright © 2025
Comunidad de Madrid & Alastria
npm package: @red-isbe/did-isbe-resolver
Description: TypeScript/ESM library to resolve `did:isbe` DIDs through the ISBE public registry API.
Author: ISBE
Latest version: 2.0.1

# DID ISBE Resolver

TypeScript/ESM library to resolve `did:isbe` DIDs through the ISBE public registry API.

## Build requirements

- Node.js 18+
- npm

```sh
npm install
npm run build
```

## Usage

### ResolverConfig

This class lets you define one or more DID Registry API instances.
Each key is the model deploy/network segment used in the DID (the third segment in `did:isbe:<modelDeploy>:<id>`), and each value contains the base API URL for that deploy.

Structure:

```ts
type ResolverConfig = Record<string, { url: string }>;
```

Example with multiple registries:

```ts
const resolverConfig: ResolverConfig = {
  "uc-dev": {
    url: "https://identity-did-api.dev.cloud-w.envs.redisbe.com/api/v1",
  },
  "uc-pre": {
    url: "https://identity-did-api.pre.cloud-w.envs.redisbe.com/api/v1",
  },
};
```

### Example

```ts
import { getResolver } from "./index.js";
import process from "process";
import type { ResolverConfig } from "./src/types.js";
import { Resolver } from "did-resolver";

const DEV_API_URL =
  "https://identity-did-api.dev.cloud-w.envs.redisbe.com/api/v1";
const DID_URL = "did:isbe:uc-dev:z1VDuuYvwpXRNoi9HG9gYga1nPfG";

async function main() {
  const resolverConfig: ResolverConfig = {
    "uc-dev": {
      url: DEV_API_URL,
    },
  };
  const isbeResolver = getResolver(resolverConfig);
  const didResolver = new Resolver(isbeResolver);

  const didDocument = await didResolver.resolve(DID_URL);

  console.dir(didDocument, { depth: null, colors: true });
}

main().catch((err) => {
  console.error(" Error al resolver:", err);
  process.exit(1);
});
```