xpx_crypto 0.0.2+2

  • Readme
  • Changelog
  • Example
  • Installing
  • 47

Vue logo

ProximaX Sirius Blockchain Catapult Crypto Dart

Official ProximaX Sirius Blockchain Catapult implementation ed26619 encryption modules for Dart.

The ProximaX Sirius Catapult Crypto Dart works as a lightweight Dart library for interacting with the Sirius Blockchain. It provides a complete library set coverage, and supports synchronous and asynchronous requests.

1. Depend on it

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

dependencies:
  xpx_crypto: ^0.0.2+2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:

import 'package:xpx_crypto/xpx_crypto.dart';

Wiki and Examples #

Examples are in the examples folder

Contribution #

We'd love to get more people involved in the project. Please feel free to raise any issues or PR and we'll review your contribution.

Copyright (c) 2019 ProximaX Limited

0.0.2+2 #

  • Initial version, created by Eleazar Garrido.

Updates #

[UPDATE] Documentation fixes.

[UPDATE] Reformat style.

[UPDATE] dependencies.

[UPDATE] examples.

Fixed bugs #

[FIXED] Undefined name 'hex'.

[FIXED] fixed bug in sign data.

example/xpx_crypto_example.dart

import 'dart:convert';
import 'dart:typed_data';
import 'package:xpx_crypto/xpx_crypto.dart';
import 'package:convert/convert.dart';

void main() {
  /// New KeyPair from PrivateKey Hex String
  const String skHex =
      '68f50e10e5b8be2b7e9ddb687a667d6e94dd55fe02b4aed8195f51f9a242558b';
  final KeyPair kp = new KeyPair.fromHexString(skHex);

  print('privateKey: \"${kp.privateKey}\"\n');
  print('publicKey: \"${kp.publicKey}\"\n');

  final Uint8List payload = utf8.encode('ProximaX Limited');

  final sing = kp.sign(payload);
  print('Signature: \"${hex.encode(sing).toUpperCase()}\"\n');

  final bool result = kp.verify(payload, sing);
  print('Verify: \"$result\"');
}

Use this package as a library

1. Depend on it

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


dependencies:
  xpx_crypto: ^0.0.2+2

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

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

  • Dart: 2.6.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:xpx_crypto/xpx_crypto.dart.

Health suggestions

Fix lib/imp/catapult_nacl.dart. (-15.25 points)

Analysis of lib/imp/catapult_nacl.dart reported 33 hints, including:

line 669 col 9: DO use curly braces for all flow control structures.

line 683 col 9: DO use curly braces for all flow control structures.

line 694 col 30: DO use curly braces for all flow control structures.

line 695 col 29: DO use curly braces for all flow control structures.

line 698 col 32: DO use curly braces for all flow control structures.

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

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

line 20 col 5: DO use curly braces for all flow control structures.

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://github.com/proximax-storage/xpx_crypto-dart was unreachable.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
convert ^2.1.1 2.1.1
fixnum ^0.10.9 0.10.11
pointycastle ^1.0.1 1.0.1
Transitive dependencies
charcode 1.1.2
typed_data 1.1.6
Dev dependencies
test ^1.5.3