# @hypercerts-org/sdk

> SDK for hypercerts protocol

Latest version **2.9.1** (published 2025-11-05) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @hypercerts-org/sdk
pnpm add @hypercerts-org/sdk
yarn add @hypercerts-org/sdk
bun add @hypercerts-org/sdk
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.9.1 |
| Published | 2025-11-05 |
| First published | 2023-06-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 420.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Hypercerts team |
| Maintainers | jipperism, ryscheng, bitbeckers |

## Links

- npm: https://www.npmjs.com/package/@hypercerts-org/sdk
- Repository: https://github.com/hypercerts-org/hypercerts-sdk
- Homepage: https://github.com/hypercerts-org/hypercerts-sdk#readme
- Issues: https://github.com/hypercerts-org/hypercerts-sdk/issues
- npm.io page: https://npm.io/package/@hypercerts-org/sdk

## Dependencies (10)

- [ajv](https://npm.io/package/ajv.md) ^8.11.2
- [zod](https://npm.io/package/zod.md) ^3.25.76
- [viem](https://npm.io/package/viem.md) ^2.38.6
- [axios](https://npm.io/package/axios.md) ^1.13.2
- [dotenv](https://npm.io/package/dotenv.md) ^16.6.1
- [@swc/core](https://npm.io/package/@swc/core.md) ^1.15.0
- [rollup-plugin-swc3](https://npm.io/package/rollup-plugin-swc3.md) ^0.11.2
- [@hypercerts-org/contracts](https://npm.io/package/@hypercerts-org/contracts.md) 2.0.0-alpha.12
- [@openzeppelin/merkle-tree](https://npm.io/package/@openzeppelin/merkle-tree.md) ^1.0.8
- [@graphql-typed-document-node/core](https://npm.io/package/@graphql-typed-document-node/core.md) ^3.2.0

## Recent versions

- 2.9.1 (latest) — 2025-11-05
- 2.5.0-beta.6 (develop) — 2025-02-03
- 2.1.1 (next) — 2024-08-21
- 2.9.0-alpha.1 — 2025-06-06
- 2.9.0 — 2025-05-29
- 2.8.1 — 2025-05-29
- 2.2.1 — 2025-05-29
- 2.8.0 — 2025-04-07
- 2.7.0 — 2025-04-03
- 2.6.0 — 2025-03-11
- 2.5.0 — 2025-03-05
- 2.5.0-beta.5 — 2025-02-03
- 2.5.0-beta.4 — 2025-02-03
- 2.5.0-beta.3 — 2025-01-27
- 2.5.0-beta.2 — 2025-01-26
- … 112 more at https://npm.io/package/@hypercerts-org/sdk/versions

## README

# Hypercerts SDK

## Quickstart Guide

1. Install the SDK using npm or yarn:

```bash
pnpm install @hypercerts-org/sdk
```

or

```bash
 pnpm add @hypercerts-org/sdk
```

2. Import the SDK into your project:

```bash
import { HypercertClient } from "@hypercerts-org/sdk";
```

3. Create a new instance of the HypercertClient class with your configuration options:

```js
const client = new HypercertClient({
  environment: "test",
  walletClient, // optional, client will default to read-only mode if not provided
  publicClient, // optional, can be infered from walletClient if present
});
```

> **Note** If there's no `walletClient` provided the client will run in [read-only mode](#read-only-mode)

4. Use the client object to interact with the Hypercert network.

For example, you can use the `client.mintClaim` method to create a new claim:

```ts
const hash = await client.mintHypercert({
  metaData: { ... },
  totalUnits: 1000n,
  transferRestriction: TransferRestrictions.AllowAll,
});
```

This will validate the metadata, store it on IPFS, create a new hypercert on-chain and return a transaction receipt.

For more information on how to use the SDK, check out the
[developer documentation](https://hypercerts.org/docs/developer/) and the
[Graph playground](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-testnet).

That's it! With these simple steps, you can start using the Hypercert SDK in your own projects.

## Config

HypercertClientConfig is a configuration object used when initializing a new instance of the HypercertClient. It allows
you to customize the client by setting your own providers or deployments. At it's simplest, you only need to provide
`chain.id` to initalize the client in `readonly` mode.

| Field          | Type                     | Description                                                                                  |
| -------------- | ------------------------ | -------------------------------------------------------------------------------------------- |
| `environment`  | `'test' \| 'production'` | Defines the environment the client will connect with.                                        |
| `deployments`  | Object                   | The deployments of the contracts on various networks.                                        |
| `readOnly`     | Boolean                  | Boolean to assert if the client is in read-only mode.                                        |
| `graphUrl`     | String                   | The URL of the graph endpoint.                                                               |
| `publicClient` | Object                   | The `PublicClient` is inherently read-only and is used for reading data from the blockchain. |
| `walletClient` | Object                   | The `WalletClient` is used for signing and sending transactions.                             |

### Read-only mode

The SDK client will be in read-only mode if any of the following conditions are true:

- The client was initialized without a wallet client.
- The client was initialized with a wallet client connected to a chain that is not supported in the environment.

### Logging

The logger for the SDK uses the log level based on the value of the LOG_LEVEL environment variable. The log level
determines which log messages are printed to the console. By default, the logger is configured to log messages with a
level of info or higher to the console.

## Modules

### Storage

The `storage` module is an utility service for easy access to the hypercerts API. It's built based on the OpenAPI spec
exposed by the hypercerts API.

```js
 const client = new HypercertClient({
  environment: "test",
  walletClient, // optional, client will default to read-only mode if not provided
  publicClient, // optional, can be infered from walletClient if present
});

const storage = client.storage;

const storageRequest = { metadata: {...}}
const storageResponse = await client.storage.storeMetadata(storageRequest);
```

---
_Source: https://npm.io/package/@hypercerts-org/sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
