blockcypher 0.3.0

  • Readme
  • Changelog
  • Installing
  • 76

Blockcypher library #

pub package CircleCI

A library for communicating with the Blockcypher API. Only some websocket calls are implemented.

Examples #

Listen for all new blocks:

  var client =
      Client(websocketUrl :"wss://", token: "YOUR-TOKEN");

  Stream<String> blocks = await client.newBlocks();
  await for (String block in blocks) {
    print("new block: $block");

For more examples see the example directory.

Please note that the library treats the token argument as optional. This should work but experience has shown that the Blockcypher API does not always handle this particularly well. If you run into weird issues please use a valid token. Especially with the websocket stuff.

Installing #

Add it to your pubspec.yaml:

  blockcypher: 0.3.0

Licence overview #

All files in this repository fall under the license specified in COPYING. The project is licensed as AGPL with a lesser clause. It may be used within a proprietary project, but the core library and any changes to it must be published online. Source code for this library must always remain free for everybody to access.


  • Made token optional


  • Add tx endpoint


  • Change constructor interface, there's now only one constructor with the signature Client(token, httpUrl: "", websocketUrl: "").
  • Add blockchain example
  • Some clean up
  • Update dependencies


  • Add blockchain call


  • Add tx-confirmation


  • Add missing import


  • Update examples
  • Remove manual ping messages


  • Initial release

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  blockcypher: ^0.3.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:blockcypher/blockcypher.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jun 4, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.2
  • pana: 0.13.8-dev

Health suggestions

Fix lib/src/client.dart. (-0.50 points)

Analysis of lib/src/client.dart reported 1 hint:

line 77 col 16: The value of the field '_token' isn't used.

Maintenance suggestions

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and blockcypher.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
http ^0.12.0 0.12.1
uuid ^2.0.4 2.0.4
web_socket_channel ^1.1.0 1.1.0
Transitive dependencies
async 2.4.1
charcode 1.1.3
collection 1.14.12
convert 2.1.1
crypto 2.1.5
http_parser 3.1.4
meta 1.1.8
path 1.7.0
source_span 1.7.0
stream_channel 2.0.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
pedantic ^1.9.0 1.9.0
test ^1.11.1