0.1.2 • Published 3 years ago

@holochain/lair-client v0.1.2

Weekly downloads
33
License
Apache-2.0
Repository
github
Last release
3 years ago

npm.io npm.io

Lair Client for Node.js

Javascript implementation of client for Lair Keystore.

npm.io npm.io npm.io

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

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago