2.1.28 • Published 11 days ago

@trezor/blockchain-link v2.1.28

Weekly downloads
538
License
SEE LICENSE IN LI...
Repository
github
Last release
11 days ago

@trezor/blockchain-link

blockchain-link is a client and unified interface for several backends (BE further on) of various blockchain networks. Currently, there are implementations for

  • blockbook: BE developed and deployed by SatoshiLabs. Provides access to Bitcoin(like) and Ethereum(like) networks.
  • ripple: third party BE that provides access to the Ripple network.
  • blockfrost: third party BE that provides access to the Cardano network.

Usage

Add blockchain-link to your dependencies.

yarn add @trezor/blockchain-link

And use it.

import BlockchainLink from '@trezor/blockchain-link';

const link = new BlockchainLink({
    name: 'Name used in logs.';
    worker: 'path/to/the/worker.js';
    server: ['url1.of.the.be', 'url2.of.the.be'];
    debug: true;
});

try {
    const resp = link.getInfo();
} catch(error) {

}

For complete API see the methods of BlockchainLink class in index.ts.

Workers

Minified workers built for various environments are available in subdirectories of @trezor/blockchain-link/build/.

  • module: Workers wrapped by primitive self-written webpack plugin into javascript module which can be used as regular module on the main thread. Useful in environments where Worker API is not available like react-native. See this webpack config for example integration.
  • web: Workers for browser based environments. See this webpack config.
  • node: Workers for node based environments. See this webpack config.

All workers can be also built from source. For example using webpack worker-loader:

import BlockbookWorker from 'worker-loader?filename=workers/blockbook-worker.[hash].js!@trezor/blockchain-link/lib/workers/blockbook/index.js';

Development

This package provides a simple testing UI for playing around with various implementations and BEs. Run it with

yarn
yarn dev

Build

yarn lint
yarn test
yarn build

Publishing

Prerequisites

  1. Make sure you have a npm account with write access to @trezor/blockchain-link package.
  2. Update CHANGELOG.md and list all changes since the last release.
  3. Bump the version in packages/blockchain-link/package.json. Use the semver convention.

Production

  1. cd packages/blockchain-link cd into the root of blockchain-link package.
  2. yarn build:lib Build the library.
  3. npm publish Publish!

Beta

If you want to publish to npm as beta (from any branch) do the following:

  1. cd packages/blockchain-link cd into the root of blockchain-link package.
  2. Change the version in packages/blockchain-link/package.json from X.X.X to X.X.(X + 1)-beta.1. The -beta.<n> suffix is important because NPM registry doesn't allow overriding already published versions. With this suffix we can publish multiple beta versions for a single patch.
  3. yarn build:lib Build the library.
  4. npm publish --tag beta Publish!
2.1.29

11 days ago

2.1.29-beta.0

16 days ago

2.1.28

1 month ago

2.1.27

2 months ago

2.1.26

2 months ago

2.1.25

3 months ago

2.1.23

3 months ago

2.1.22

4 months ago

2.1.21

4 months ago

2.1.20

5 months ago

2.1.19

5 months ago

2.1.16

9 months ago

2.1.17

8 months ago

2.1.14

10 months ago

2.1.15

9 months ago

2.1.18

7 months ago

2.1.12

12 months ago

2.1.13

12 months ago

2.1.11

1 year ago

2.1.9

1 year ago

2.1.10

1 year ago

2.1.8

1 year ago

2.1.6

1 year ago

2.1.7

1 year ago

2.1.5

1 year ago

2.1.4

2 years ago

2.1.2

2 years ago

2.1.3

2 years ago

2.1.3-beta.1

2 years ago

2.1.3-beta.2

2 years ago

2.1.3-beta.3

2 years ago

2.1.3-beta.4

2 years ago

1.1.0

2 years ago

2.1.1

2 years ago

2.0.0-beta.1

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.1.0-beta.2

2 years ago

1.0.18

2 years ago

1.1.0-beta.1

2 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0-rc3

5 years ago

1.0.0-rc2

5 years ago

1.0.0-rc1

5 years ago