0.0.2 • Published 9 months ago

ridojs v0.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

RIDO-Js

The JS dev kit for RIDO

Quick Start

Example of Usage

npm i -S ridojs

// 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 NameDescription
ridoClient.jsInitialization of all clients
vosbtClient.jsBasic methods for VONFT and VOSBT
vonftClient.jsOperate the VONFTs
actClient.jsOperate the ACTs
variableClient.jsOperate the Variables
noCacheVariable.jsOperate the No-Cache variables
relayerClient.jsCall the APIs provided by RIDO relayer

helper/

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

File NameDescription
identity.jsTo 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.

0.0.2

9 months ago

0.0.1

10 months ago

0.0.0

10 months ago