npm package: @mattblackdesign/chainabstractionlayer
Author: Liquality
Latest version: 0.1.17

# Chain Abstraction Layer <img align="right" src="https://raw.githubusercontent.com/liquality/chainabstractionlayer/master/liquality-logo.png" height="80px" />


[![Build Status](https://travis-ci.com/liquality/chainabstractionlayer.svg?branch=master)](https://travis-ci.com/liquality/chainabstractionlayer)
[![Standard Code Style](https://img.shields.io/badge/codestyle-standard-brightgreen.svg)](https://github.com/standard/standard)
[![MIT License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](./LICENSE.md)
[![ChainAbstractionLayer](https://img.shields.io/npm/dt/@liquality/chainabstractionlayer.svg)](https://npmjs.com/package/@liquality/chainabstractionlayer)
[![Gitter](https://img.shields.io/gitter/room/liquality/Lobby.svg)](https://gitter.im/liquality/Lobby?source=orgpage)
[![Telegram](https://img.shields.io/badge/chat-on%20telegram-blue.svg)](https://t.me/Liquality) [![Greenkeeper badge](https://badges.greenkeeper.io/liquality/chainabstractionlayer.svg)](https://greenkeeper.io/)

> :warning: This project is under heavy development. Expect bugs & breaking changes.

### :pencil: [Introductory Blog Post: The Missing Tool to Cross-Chain Development](https://medium.com/liquality/the-missing-tool-to-cross-chain-development-2ebfe898efa1)

Query different blockchains with account management using a single and simple interface.

## Installation

```bash
npm install @liquality/chainabstractionlayer
```

> **Error: Cannot find module 'babel-runtime/core-js/get-iterator'**
>
> Issues to track: [LedgerHQ/ledgerjs/issues/211](https://github.com/LedgerHQ/ledgerjs/issues/211), [LedgerHQ/ledgerjs/issues/218](https://github.com/LedgerHQ/ledgerjs/issues/218)
>
> `npm install babel-runtime`


## Usage

```javascript
import { Client, providers } from '@liquality/chainabstractionlayer'

const { BitcoinRPCProvider } = providers.bitcoin

const bitcoin = new Client()
bitcoin.addProvider(new BitcoinRPCProvider('http://localhost:8080', 'bitcoin', 'local321'))

bitcoin
  .generateBlock(1) // returns Promise
  .then(console.log) // Array<BlockHash>
```

### Try ChainAbstractionLayer in Browser

<table>
  <thead>
    <tr>
      <th>Chain</th>
      <th>Wallet Provider</th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td rowspan=2>Ethereum</td>
      <td>Ledger</td>
      <td>
        <a href="./examples/browser/ethereum/ledger.html">Source</a>
        &amp;
        <a href="https://liquality.github.io/chainabstractionlayer/examples/browser/ethereum/ledger.html">Demo</a>
      </td>
    </tr>
    <tr>
      <td>MetaMask</td>
      <td>
        <a href="./examples/browser/ethereum/metamask.html">Source</a>
        &amp;
        <a href="https://liquality.github.io/chainabstractionlayer/examples/browser/ethereum/metamask.html">Demo</a>
      </td>
    </tr>
    <tr>
      <td>Bitcoin</td>
      <td>Ledger</td>
      <td>
        <a href="./examples/browser/bitcoin/ledger.html">Source</a>
        &amp;
        <a href="https://liquality.github.io/chainabstractionlayer/examples/browser/bitcoin/ledger.html">Demo</a>
      </td>
    </tr>
  </tbody>
</table>


## Documentation

The documentation is being generated by [esdoc](https://www.npmjs.com/package/esdoc). Github Page hosted documentation is available at [liquality.github.io/chainabstractionlayer](https://liquality.github.io/chainabstractionlayer/)

If you want to build documentation locally;

```bash
npm run build:docs
```


## License

[MIT](./LICENSE.md)