cosdart 0.2.1

  • Readme
  • Changelog
  • Installing
  • new37

cosdart #

Contentos blockchain SDK for Dart.

This package is still under development.

Usage #

Connect to Contentos main net and query the chain.

// create a client that talks with main net.
final client = CosChainClient.of(Network.main);
// output current global information of the block chain.
print(await client.getChainState());
// output account information of 'initminer'.
print(await client.getAccountByName('initminer'));

[0.2.1] - 2020/1/19

  • fixed a network config bug which may lead to connection failures.

[0.2.0] - 2020/1/14

  • supports network id.
  • exposes gRPC generated types for advanced usage.

[0.1.0] - 2020/1/14

  • license and documents update.

[0.0.1] - 2020/1/13

  • A very naive implementation of gRPC client for Contentos blockchain.

Use this package as a library

1. Depend on it

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


dependencies:
  cosdart: ^0.2.1

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:cosdart/cosdart.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
75
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
37
Learn more about scoring.

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

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

Fix lib/src/grpc/generated/grpc.pbjson.dart. (-25 points)

Analysis of lib/src/grpc/generated/grpc.pbjson.dart reported 479 hints, including:

line 8 col 37: Avoid const keyword.

line 10 col 8: Avoid const keyword.

line 11 col 5: Avoid const keyword.

line 12 col 5: Avoid const keyword.

line 13 col 5: Avoid const keyword.

Fix lib/src/grpc/generated/prototype/multi_id.pbjson.dart. (-25 points)

Analysis of lib/src/grpc/generated/prototype/multi_id.pbjson.dart reported 62 hints, including:

line 8 col 32: Avoid const keyword.

line 10 col 8: Avoid const keyword.

line 11 col 5: Avoid const keyword.

line 12 col 5: Avoid const keyword.

line 16 col 33: Avoid const keyword.

Fix lib/src/grpc/generated/prototype/operation.pbjson.dart. (-25 points)

Analysis of lib/src/grpc/generated/prototype/operation.pbjson.dart reported 123 hints, including:

line 8 col 39: Avoid const keyword.

line 10 col 8: Avoid const keyword.

line 11 col 5: Avoid const keyword.

line 12 col 5: Avoid const keyword.

line 13 col 5: Avoid const keyword.

Fix additional 17 files with analysis or formatting issues. (-50 points)

Additional issues in the following files:

  • lib/src/grpc/generated/prototype/transaction.pbjson.dart (77 hints)
  • lib/src/grpc/generated/prototype/type.pbjson.dart (96 hints)
  • lib/src/grpc/client.dart (Run dartfmt to format lib/src/grpc/client.dart.)
  • lib/src/grpc/generated/grpc.pb.dart (Run dartfmt to format lib/src/grpc/generated/grpc.pb.dart.)
  • lib/src/grpc/generated/grpc.pbenum.dart (Run dartfmt to format lib/src/grpc/generated/grpc.pbenum.dart.)
  • lib/src/grpc/generated/prototype/multi_id.pb.dart (Run dartfmt to format lib/src/grpc/generated/prototype/multi_id.pb.dart.)
  • lib/src/grpc/generated/prototype/multi_id.pbenum.dart (Run dartfmt to format lib/src/grpc/generated/prototype/multi_id.pbenum.dart.)
  • lib/src/grpc/generated/prototype/multi_id.pbserver.dart (Run dartfmt to format lib/src/grpc/generated/prototype/multi_id.pbserver.dart.)
  • lib/src/grpc/generated/prototype/operation.pb.dart (Run dartfmt to format lib/src/grpc/generated/prototype/operation.pb.dart.)
  • lib/src/grpc/generated/prototype/operation.pbenum.dart (Run dartfmt to format lib/src/grpc/generated/prototype/operation.pbenum.dart.)
  • lib/src/grpc/generated/prototype/operation.pbserver.dart (Run dartfmt to format lib/src/grpc/generated/prototype/operation.pbserver.dart.)
  • lib/src/grpc/generated/prototype/transaction.pb.dart (Run dartfmt to format lib/src/grpc/generated/prototype/transaction.pb.dart.)
  • lib/src/grpc/generated/prototype/transaction.pbenum.dart (Run dartfmt to format lib/src/grpc/generated/prototype/transaction.pbenum.dart.)
  • lib/src/grpc/generated/prototype/transaction.pbserver.dart (Run dartfmt to format lib/src/grpc/generated/prototype/transaction.pbserver.dart.)
  • lib/src/grpc/generated/prototype/type.pb.dart (Run dartfmt to format lib/src/grpc/generated/prototype/type.pb.dart.)
  • lib/src/grpc/generated/prototype/type.pbenum.dart (Run dartfmt to format lib/src/grpc/generated/prototype/type.pbenum.dart.)
  • lib/src/grpc/generated/prototype/type.pbserver.dart (Run dartfmt to format lib/src/grpc/generated/prototype/type.pbserver.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

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

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
crclib ^1.0.1 1.0.1
fixnum ^0.10.11 0.10.11
grpc ^2.1.3 2.1.3
protobuf ^1.0.1 1.0.1
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
convert 2.1.1
crypto 2.1.4
googleapis_auth 0.2.11+1
http 0.12.0+4
http2 1.0.0
http_parser 3.1.3
matcher 0.12.6
meta 1.1.8
path 1.6.4
pedantic 1.9.0
quiver 2.1.2+1
source_span 1.6.0
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
tuple 1.0.3
typed_data 1.1.6
Dev dependencies
test ^1.11.0