SDK for communicating with the agent's remote signing functionality
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Small updates to docs Dec 16, 2018
src Fixes API to always return a consistently formatted object via client… Dec 9, 2018
support Updates everything to use the new public dependency packages Nov 7, 2018
test Fixes API to always return a consistently formatted object via client… Dec 9, 2018
.DS_Store Starts docs Oct 28, 2018
.babelrc adding mocha to devDependencies & adding npm test target. adding in m… Jul 11, 2018
.eslintrc refactoring network providers to classes, passed in via ctor Jul 17, 2018
.gitignore Cleans up the docs a bit Nov 12, 2018
.meta including new libs in meta repo Aug 5, 2018
Dockerfile enable overriding bitcoin node host via env var. creating and publish… Aug 10, 2018
Jenkinsfile Updates jenkins to use build-cluster Nov 14, 2018
LICENSE updates license, removes empty files, and adds dist to npm distribution Nov 12, 2018
Makefile Splits bitcoin live testnet tests into two files - neither is working… Sep 25, 2018
README.md Remove greenkeeper badge Nov 13, 2018
bcoin.Dockerfile Updates makefile to contain bcoin fork Jul 12, 2018
docker-compose.builder.yml working with make install, will allow creating an integration test ru… Aug 3, 2018
docker-compose.integration.yml Adds an ETH send script and fixes a few things wrt the docker containers Sep 17, 2018
docker-compose.mac.yml Adds an ETH send script and fixes a few things wrt the docker containers Sep 17, 2018
docker-compose.providers.yml Adds parameterizable config options to provider constructors Sep 5, 2018
docker-compose.staging.yml Adds an ETH send script and fixes a few things wrt the docker containers Sep 17, 2018
jest.integration.json Moves agent-rest-client into this repo and gets pairing, permission, … Jul 9, 2018
jest.json Moves agent-rest-client into this repo and gets pairing, permission, … Jul 9, 2018
package.json Fixes API to always return a consistently formatted object via client… Dec 9, 2018

README.md

GridPlus Lattice1 SDK

WARNING: This is early alpha software and is subject to change. It is recommended that any mainnet usage be restricted to small amounts.

The Grid+ SDK allows any application to establish a connection and interact with a Grid+ Lattice1 device as a remote signer. With the Lattice1 as an extremely secure, connected keystore with signing capabilities, this SDK gives users the following functionality:

  • Pair (exchange keys and establish encrypted communication channel) with a user's Lattice1 device using a serial
  • Get addresses from the paired device (Bitcoin or Ethereum)
  • Request ETH, ERC20, and BTC signatures, which the Lattice1 owner must authorize on the device
  • Create a permission giving your app the ability to request automated signatures based on rules accepted by the user
  • Request automated signatures against a permission

Documentation

The documentation for this SDK can be found here. There you will find a complete quickstart guide (a shorter version of which is available in the next section) as well as a full API reference and schema enumerations. Please consider that document the source of truth for all things SDK.

Installation and Setup

This SDK is currently only available as a node.js module. You can add it to your project with:

npm install gridplus-sdk

You can then import a new client with:

import { Client } from 'gridplus-sdk';

or, for older style syntax:

const Sdk = require('gridplus-sdk').Client;

Initializing a Client

Once imported, you can initialize your SDK client with a clientConfig object, which at minimum requires the name of your app (name) and a private key with which to sign requests (privKey). The latter is not meant to e.g. hold onto any cryptocurrencies; it is simply a way of maintaining a secure communication channel between the device and your application.

const clientConfig = {
    name: 'MyApp',
    privKey: crypto.randomBytes(32).toString('hex')
}

Adding Providers

To connect the SDK to supported cryptocurrency networks, you will need to add providers to the clientConfig. We have two from which to choose:

import { providers } from `gridplus-sdk`;
const eth = new providers.Ethereum({ 
    network: 'rinkeby' 
    etherscan: true, 
});
const btc = new providers.Bitcoin({
    network: 'test3',
    blockcypher: true,
    coin: 'btc',
});

clientConfig.providers = [ eth, btc ];

Initialize!

With the clientConfig filled out, you can initialize a new SDK object:

const client = new Client({ clientConfig: clientConfig });
client.initialize((err, connections) => { })

Bug Testing and Contributing

We welcome UX-related pull requests and any feedback from Lattice1 developers. To learn more about the Lattice1, please visit our website.