0.4.2 • Published 4 years ago

@atomicloans/loan-client v0.4.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@liquality/client

Build Status Coverage Status Standard Code Style MIT License @liquality/client Gitter Telegram Greenkeeper badge

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

:pencil: Introductory Blog Post: The Missing Tool to Cross-Chain Development

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

Installation

npm i @liquality/client

or

<script src="https://cdn.jsdelivr.net/npm/@liquality/client@0.2.3/dist/client.min.js"></script>
<!-- sourceMap at https://cdn.jsdelivr.net/npm/@liquality/client@0.2.3/dist/client.min.js.map -->
<!-- available as window.Client -->

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.address
)
const signedMessageEthereum = await ethereum.wallet.signMessage(
  'The Times 3 January 2009 Chancellor on brink of second bailout for banks', ethereumAddress.address
)

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

License

MIT

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.2-beta.2

5 years ago

0.3.2-beta.1

5 years ago

0.3.2-beta.0

5 years ago

0.3.2-alpha.2

5 years ago

0.3.2-alpha.1

5 years ago

0.3.2-alpha.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.48

5 years ago

0.2.47

5 years ago

0.2.45

5 years ago

0.2.44

5 years ago

0.2.43

5 years ago

0.2.38

5 years ago

0.2.37

5 years ago

0.2.33

5 years ago

0.2.32

5 years ago