Giter Site home page Giter Site logo

chainabstractionlayer's Introduction

Chain Abstraction Layer

Build Status Coverage Status Standard Code Style MIT License Gitter Telegram Greenkeeper badge

โš ๏ธ This project is under heavy development. Expect bugs & breaking changes.

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

Packages

Package Version
@liquality/bitcoin-bitcoinjs-lib-swap-provider ChainAbstractionLayer
@liquality/bitcoin-ledger-provider ChainAbstractionLayer
@liquality/bitcoin-networks ChainAbstractionLayer
@liquality/bitcoin-rpc-provider ChainAbstractionLayer
@liquality/bitcoin-wallet-node-provider ChainAbstractionLayer
@liquality/bitcoin-swap-provider ChainAbstractionLayer
@liquality/bitcoin-esplora-api-provider ChainAbstractionLayer
@liquality/bitcoin-esplora-swap-find-provider ChainAbstractionLayer
@liquality/bitcoin-utils ChainAbstractionLayer
@liquality/bundle ChainAbstractionLayer
@liquality/client ChainAbstractionLayer
@liquality/crypto ChainAbstractionLayer
@liquality/debug ChainAbstractionLayer
@liquality/errors ChainAbstractionLayer
@liquality/ethereum-erc20-provider ChainAbstractionLayer
@liquality/ethereum-erc20-swap-provider ChainAbstractionLayer
@liquality/ethereum-ledger-provider ChainAbstractionLayer
@liquality/ethereum-metamask-provider ChainAbstractionLayer
@liquality/ethereum-networks ChainAbstractionLayer
@liquality/ethereum-rpc-provider ChainAbstractionLayer
@liquality/ethereum-swap-provider ChainAbstractionLayer
@liquality/ethereum-blockscout-swap-find-provider ChainAbstractionLayer
@liquality/ethereum-scraper-swap-find-provider ChainAbstractionLayer
@liquality/ethereum-utils ChainAbstractionLayer
@liquality/jsonrpc-provider ChainAbstractionLayer
@liquality/ledger-provider ChainAbstractionLayer
@liquality/metamask-provider ChainAbstractionLayer
@liquality/provider ChainAbstractionLayer
@liquality/schema ChainAbstractionLayer
@liquality/utils ChainAbstractionLayer
@liquality/wallet-provider ChainAbstractionLayer

Usage

import Client from '@liquality/client'
import BitcoinRpcProvider from '@liquality/bitcoin-rpc-provider'
import EthereumRpcProvider from '@liquality/ethereum-rpc-provider'

import BitcoinLedgerProvider from '@liquality/bitcoin-ledger-provider'
import EthereumLedgerProvider from '@liquality/ethereum-ledger-provider'

import BitcoinNetworks from '@liquality/bitcoin-networks'
import EthereumNetworks from '@liquality/ethereum-networks'

const bitcoin = new Client()
const ethereum = new Client()

bitcoin.addProvider(new BitcoinRpcProvider(
  'https://liquality.io/bitcointestnetrpc/', 'bitcoin', 'local321'
))
ethereum.addProvider(new EthereumRpcProvider(
  'https://rinkeby.infura.io/v3/xxx'
))

bitcoin.addProvider(new BitcoinLedgerProvider(
  { network: BitcoinNetworks.bitcoin_testnet }
))
ethereum.addProvider(new EthereumLedgerProvider(
  { network: EthereumNetworks.rinkeby }
))

// Fetch addresses from Ledger wallet using a single-unified API
const [ bitcoinAddress ] = await bitcoin.wallet.getAddresses(0, 1)
const [ ethereumAddress ] = await ethereum.wallet.getAddresses(0, 1)

// Sign a message
const signedMessageBitcoin = await bitcoin.wallet.signMessage(
  'The Times 3 January 2009 Chancellor on brink of second bailout for banks', bitcoinAddress
)
const signedMessageEthereum = await ethereum.wallet.signMessage(
  'The Times 3 January 2009 Chancellor on brink of second bailout for banks', ethereumAddress
)

// Send a transaction
await bitcoin.chain.sendTransaction(<to>, 1000)
await ethereum.chain.sendTransaction(<to>, 1000)

Development

npm install
npm run bootstrap
npm run watch

Production

npm run build

Publish

npm run new:version # prepare
npm run publish:all # publish

License

MIT

chainabstractionlayer's People

Contributors

gr0kchain avatar grandsmarquis avatar greenkeeper[bot] avatar harshjv avatar i3wgnit avatar jesseabram avatar matthewjablack avatar mintheredonethat avatar monokh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.