# ridojs

> JS Dev Kit for RIDO

Latest version **0.0.2** (published 2023-07-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install ridojs
pnpm add ridojs
yarn add ridojs
bun add ridojs
```

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2023-07-31 |
| First published | 2023-07-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 30.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Monstea |
| Maintainers | monstea |
| Keywords | RIDO |

## Links

- npm: https://www.npmjs.com/package/ridojs
- npm.io page: https://npm.io/package/ridojs

## Dependencies (4)

- [axios](https://npm.io/package/axios.md) ^1.4.0
- [ethers](https://npm.io/package/ethers.md) 5.4.5
- [@dfinity/agent](https://npm.io/package/@dfinity/agent.md) ^0.18.1
- [js-metamask-ii](https://npm.io/package/js-metamask-ii.md) ^0.0.3

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2023-07-31
- 0.0.1 — 2023-07-27
- 0.0.0 — 2023-07-27

## README

# RIDO-Js

The JS dev kit for RIDO

## Quick Start

### Example of Usage

`npm i -S ridojs`

```js
// import Client Classes you need
import { NoCacheVariableClient, Auth } from 'ridojs';

// setIdentity is a callback to return the principal
Auth.logIn(setIdentity);

// this function should be called in useEffect hook once authClient is ready
const initClient = async () => {
  if (identity) {
    const vosbtClient = await NoCacheVariableClient.create({
      identity,
      canisterId: '5oghd-zqaaa-aaaal-qcada-cai',
    });
    console.log({ vosbtClient });
    // save Client to memory for future use
    setClient(vosbtClient);
  }
};

// invoke specific method of RIDO
const call = async () => {
  const result = await client.get(BigInt(2));
  return result;
};
```

## Features

### client/

This folder contains all clients to interact with RIDO.

| File Name          | Description                            |
| ------------------ | -------------------------------------- |
| ridoClient.js      | Initialization of all clients          |
| vosbtClient.js     | Basic methods for VONFT and VOSBT      |
| vonftClient.js     | Operate the VONFTs                     |
| actClient.js       | Operate the ACTs                        |
| variableClient.js  | Operate the Variables                  |
| noCacheVariable.js | Operate the No-Cache variables         |
| relayerClient.js   | Call the APIs provided by RIDO relayer |

### helper/

This folder contains some tools you can use to interact with RIDO.

| File Name   | Description                                                                                                                       |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------- |
| identity.js | To generate the identity required by the construction of clients, you can also generate identity by yourself with other libraries. |

### did/

This folder contains all candid files of RIDO.

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