libkarai-js

1.0.0 • Public • Published

libkarai-js

npm version

A library to interact with karai channels in javascript.

This library provides three exported classes.

  • KeyRing class, which contains a pair of ed25519 keys and sign / verify methods
  • Channel class, which you can use to interact with a channel
  • Utils class, which contains a couple useful type conversion functions

Install

yarn add libkarai-js

Documentation

You can find a link to the documentation here

Quickstart

import { Channel, KeyRing, Utils } from "libkarai-js";
 
const keyring = new KeyRing(":memory:");
const channel = new Channel("zeus.karai.io:4200", keyring, false);
 
channel.on("ready", async () => {
  console.log("Channel info: ", channel.info());
  console.log("My public key is " + Utils.toHexString(keyring.getPub()));
});
 
channel.on("error", (error) => {
  // do something with the error
});

Readme

Keywords

none

Package Sidebar

Install

npm i libkarai-js

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

31.3 kB

Total Files

13

Last publish

Collaborators

  • extrahash