cruzawl 1.0.5+5

cruzawl pub package Build Status


Dart package for CRUZ cryptocurrency wallet cruzall and block explorer cruzweb. See the documentation.

Build #

Follow the same procedure as the continuous integration

Architecture #

License #

cruzawl is released under the terms of the MIT license. See LICENSE for more information or see https://opensource.org/licenses/MIT.

Discussion #

  • Discord server for general chat as well as updates, including development status.

1.0.0+0 #

  • Initial release.

1.0.1+1 #

  • pub.dev Health suggestions.

1.0.2+2 #

  • Add ExchangeRates and HttpRequest.
  • Upgrade sembast to ^2.0.1

1.0.3+3 #

  • Add [CruzTransaction.computeHashListRoot]

1.0.4+4 #

  • Add [FileSystem] interface
  • Remove dart:io import

1.0.5+5 #

  • Update tweetnacl.

example/example.dart

// Copyright 2019 cruzawl developers
// Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

import 'dart:io';

import 'package:cruzawl/currency.dart';
import 'package:cruzawl/preferences.dart';

// bash-3.2$ dart example.dart 
// *** Latest Block ***
// Height: 19527
// Id: 00000000000466a45c60eb8f69345ec3d64af44fad31eccb3cc922faef27fdb2
// Previous: 000000000002b57d4e0db7eb1209b289112bc4af5d81e15d5ce3700ee646f28b
// Transactions: 4
void main() {

  /// Print the latest [BlockHeader] in the block chain.
  cruz.network.tipChanged = () {
    BlockHeader block = cruz.network.tip;
    print('*** Latest Block ***');
    print('Height: ${block.height}');
    print('Id: ${cruz.network.tipId.toJson()}');
    print('Previous: ${block.previous.toJson()}');
    print('Transactions: ${block.transactionCount}');
    exit(0);
  };

  /// Connect [CruzNetwork] to public seeder.
  cruz.network
      .addPeer(cruz.network.createPeerWithSpec(
          PeerPreference('SatoshiLocomoco', 'wallet.cruzbit.xyz', 'CRUZ', '',
              debugPrint: (x) { /* print('DEBUG: $x'); */ }),
          cruz.genesisBlock().id().toJson()))
      .connect();
}

Use this package as a library

1. Depend on it

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


dependencies:
  cruzawl: ^1.0.5+5

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:cruzawl/cruz.dart';
import 'package:cruzawl/cruz.g.dart';
import 'package:cruzawl/currency.dart';
import 'package:cruzawl/exchange.dart';
import 'package:cruzawl/http.dart';
import 'package:cruzawl/http_html.dart';
import 'package:cruzawl/http_io.dart';
import 'package:cruzawl/network.dart';
import 'package:cruzawl/preferences.dart';
import 'package:cruzawl/preferences.g.dart';
import 'package:cruzawl/sembast.dart';
import 'package:cruzawl/sha3.dart';
import 'package:cruzawl/test.dart';
import 'package:cruzawl/util.dart';
import 'package:cruzawl/wallet.dart';
import 'package:cruzawl/wallet.g.dart';
import 'package:cruzawl/websocket.dart';
import 'package:cruzawl/websocket_html.dart';
import 'package:cruzawl/websocket_io.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
6
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
53
Learn more about scoring.

We analyzed this package on Aug 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: web

Platform components identified in package: html, io.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
bip39 ^1.0.3 1.0.3
collection ^1.14.11 1.14.12
convert ^2.1.1 2.1.1
ed25519_hd_key ^1.0.1 1.0.1
fixnum ^0.10.9 0.10.9
json_annotation ^3.0.0 3.0.0
pointycastle ^1.0.1 1.0.1
sembast ^2.0.1 2.0.1
tweetnacl ^0.3.2 0.3.2
Transitive dependencies
charcode 1.1.2
crypto 2.1.1+1
hex 0.1.2
logging 0.11.3+2
meta 1.1.7
path 1.6.4
synchronized 2.1.0+1
typed_data 1.1.6
Dev dependencies
build_runner ^1.4.0
json_serializable ^3.2.0
test ^1.6.5