0.10.4 • Published 4 years ago

@liquality/injected-provider v0.10.4

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

@liquality/injected-provider

Build Status Coverage Status Standard Code Style MIT License @liquality/injected-provider 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/injected-provider

or

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

Usage

import Client from '@liquality/client'

import InjectedProvider from '@liquality/injected-provider'

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

bitcoin.addProvider(new InjectedProvider(window.providerManager.getProviderFor('BTC')))
ethereum.addProvider(new InjectedProvider(window.providerManager.getProviderFor('ETH')))

// 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.10.4

4 years ago

0.10.3

4 years ago

0.10.2

4 years ago

0.10.1

4 years ago

0.9.2-next.0

4 years ago

0.9.2

4 years ago

0.10.0

4 years ago

0.9.1

4 years ago

0.9.0-next.0

4 years ago

0.9.0

4 years ago

0.8.15

4 years ago

0.8.14

4 years ago

0.8.13

4 years ago

0.8.12

4 years ago

0.8.11

5 years ago

0.8.9

5 years ago

0.8.8

5 years ago

0.8.7

5 years ago

0.8.5

5 years ago

0.8.6

5 years ago

0.8.4

5 years ago

0.8.3

5 years ago

0.8.1

5 years ago

0.8.2

5 years ago

0.8.0

5 years ago

0.7.15

5 years ago

0.7.14

5 years ago

0.7.13

5 years ago

0.7.11

5 years ago

0.7.12

5 years ago

0.7.10

5 years ago

0.7.9

5 years ago

0.7.8

5 years ago

0.7.7

5 years ago

0.7.6

5 years ago

0.7.5

5 years ago

0.7.4

5 years ago

0.7.3

5 years ago

0.7.2

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.9

5 years ago

0.6.8

5 years ago

0.6.7

5 years ago

0.6.6

5 years ago

0.6.5

5 years ago

0.6.4

5 years ago

0.6.3

5 years ago

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.5.0-alpha.2

5 years ago

0.5.0-alpha.1

5 years ago

0.5.0-alpha.0

5 years ago

0.4.35

5 years ago

0.4.34

5 years ago

0.4.33

5 years ago

0.4.32

5 years ago