@holochain/lair-client

0.1.2 • Public • Published

Lair Client for Node.js

Javascript implementation of client for Lair Keystore.

Overview

This module provides APIs for

  • connecting to Lair
  • receiving and responding to messages
  • sending requests and awaiting response
  • constructing messages using wire type structs

Basic Usage

const { structs, ...lair } = require("@holochain/lair-client");

(async () {
    const client = lair.connect( <path to a Lair unix domain socket> );

    client.on('UnlockPassphrase', req => {
	req.reply( "Passw0rd!" );
    });

    let resp = await client.request( new structs.TLS.CreateCert.Request( 512 ) );

    resp[0];     // LairType  -> LairKeystoreIndex<Uint8Array>
    resp.get(0); // number    -> <LairType>.value()

    resp[1];     // LairType  -> LairCertSNI<Uint8Array>
    resp.get(1); // Buffer    -> <LairType>.value()

    resp[2];     // LairType  -> LairDigest<Uint8Array>
    resp.get(2); // Buffer    -> <LairType>.value()
})();

API Reference

See docs/API.md

Contributing

See CONTRIBUTING.md

Readme

Keywords

none

Package Sidebar

Install

npm i @holochain/lair-client

Weekly Downloads

8

Version

0.1.2

License

Apache-2.0

Unpacked Size

50.4 kB

Total Files

8

Last publish

Collaborators

  • thetasinner
  • matthme
  • jost-s
  • guillem.cordoba
  • neonphog
  • connoropolous
  • lucksus
  • zippy314
  • thedavidmeister
  • maackle
  • peeech
  • zo-el
  • brisebom