ckb_sdk 0.14.0

  • Installing
  • Versions
  • 49

CKB SDK Dart #

FOSSA Status pub package

Dart SDK for CKB.Nervos test network has not been released yet,so it is very early stage.Be careful when using this library.

Prerequisites #

To build CKB SDK, you'll need:

  • Dart sdk: ">=2.2.2 <3.0.0"

Usage #


final apiClient = CKBApiClient(nodeUrl: NodeUrl);
String blockHash = await apiClient.getBlockHash("1");

You can see more JSON-RPC requests from RPC Document

Address #

 final ckbAddress = CKBAddress(Network.TestNet);
 final address = ckbAddress.generate(PublicKey);

You can find more in here.




License #

FOSSA Status

Changelog #

See file.


0.14.0 #

Support ckb release v0.14.0

Features #

  • remove the args field in cell input type(7caac4)

  • implement Secp256k1 recoverable sign(885e85)

Refactor #

Breaking Changes #

  • the type of cell input changes, its args field is removed
  • make sdk more in line with the dart rules

0.13.0 #

Support ckb release v0.13.0

Features #

  • update data type in RPC tx_pool_info (41c412)

0.12.0 #

Support ckb release v0.12.0

  • add sign transaction hash to witness
  • add RPC txPoolInfo,getPeers,epoch,dryTransaction,computeTransactionHash

0.11.0 #

Support ckb release v0.11.0

  • add RPC getBlockByBlockNumber
  • add RPC request time out
  • add parse address

0.10.1 #

Support ckb release v0.10.0

  • refactor RPCError

0.10.0 #

Support ckb release v0.10.0

  • add since to cell input

0.9.0 #

Support ckb release v0.9.0

  • add segregated witness structure
  • refactor rpc types
  • add Bech32
  • format address
  • fix hexStringToByteArray

0.8.0 #

Support ckb release v0.8.0

  • adapt CKB v0.8.0

0.7.1 #

Support ckb release v0.7.0

  • refactor script structure
  • remove wallet part

0.7.0 #

Support ckb release v0.7.0

  • add transaction trace RPC
  • replace SHA3 with Blake2b

0.6.2 #

Support ckb release v0.6.0

  • change pub name to ckb_sdk

0.6.1 #

Support ckb release v0.6.0

  • fix dart pub warning

0.6.0 #

Support ckb release v0.6.0

  • RPC
  • asw account and transfer
  • generate wallet

Use this package as a library

1. Depend on it

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

  ckb_sdk: ^0.14.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:ckb_sdk/ckb_sdk.dart';
Version Uploaded Documentation Archive
0.14.0 Jun 15, 2019 Go to the documentation of ckb_sdk 0.14.0 Download ckb_sdk 0.14.0 archive
0.13.0 Jun 1, 2019 Go to the documentation of ckb_sdk 0.13.0 Download ckb_sdk 0.13.0 archive
0.12.0 May 18, 2019 Go to the documentation of ckb_sdk 0.12.0 Download ckb_sdk 0.12.0 archive
0.11.0 May 14, 2019 Go to the documentation of ckb_sdk 0.11.0 Download ckb_sdk 0.11.0 archive
0.10.1 May 9, 2019 Go to the documentation of ckb_sdk 0.10.1 Download ckb_sdk 0.10.1 archive
0.9.0 Apr 22, 2019 Go to the documentation of ckb_sdk 0.9.0 Download ckb_sdk 0.9.0 archive
0.8.0 Apr 17, 2019 Go to the documentation of ckb_sdk 0.8.0 Download ckb_sdk 0.8.0 archive
0.7.1 Apr 2, 2019 Go to the documentation of ckb_sdk 0.7.1 Download ckb_sdk 0.7.1 archive
0.7.0 Mar 26, 2019 Go to the documentation of ckb_sdk 0.7.0 Download ckb_sdk 0.7.0 archive
0.6.4 Mar 15, 2019 Go to the documentation of ckb_sdk 0.6.4 Download ckb_sdk 0.6.4 archive

All 13 versions...

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 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18


Detected platforms: Flutter, web, other

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

Health issues and suggestions

Document public APIs. (-1 points)

472 out of 472 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/ckb_crypto/number.dart. (-1 points)

Analysis of lib/src/ckb_crypto/number.dart reported 2 hints:

line 14 col 7: DO use curly braces for all flow control structures.

line 16 col 7: DO use curly braces for all flow control structures.

Fix lib/ckb_crypto.dart. (-0.50 points)

Analysis of lib/ckb_crypto.dart reported 1 hint:

line 5 col 49: Use lowercase_with_underscores when specifying a library prefix.

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

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

line 20 col 9: Use isEmpty instead of length

Fix additional 33 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/ckb_error.dart (Run dartfmt to format lib/ckb_error.dart.)
  • lib/src/ckb_crypto/blake2b.dart (Run dartfmt to format lib/src/ckb_crypto/blake2b.dart.)
  • lib/src/ckb_crypto/signature.dart (Run dartfmt to format lib/src/ckb_crypto/signature.dart.)
  • lib/src/ckb_rpc/api_request.dart (Run dartfmt to format lib/src/ckb_rpc/api_request.dart.)
  • lib/src/ckb_rpc/ckb_api_client.dart (Run dartfmt to format lib/src/ckb_rpc/ckb_api_client.dart.)
  • lib/src/ckb_system_contract/ckb_system_contract.dart (Run dartfmt to format lib/src/ckb_system_contract/ckb_system_contract.dart.)
  • lib/src/ckb_types/blockchain_info_res.dart (Run dartfmt to format lib/src/ckb_types/blockchain_info_res.dart.)
  • lib/src/ckb_types/blockhash_res.dart (Run dartfmt to format lib/src/ckb_types/blockhash_res.dart.)
  • lib/src/ckb_types/cells_by_lock_hash_res.dart (Run dartfmt to format lib/src/ckb_types/cells_by_lock_hash_res.dart.)
  • lib/src/ckb_types/compute_transaction_hash_res.dart (Run dartfmt to format lib/src/ckb_types/compute_transaction_hash_res.dart.)
  • lib/src/ckb_types/dry_run_transaction_res.dart (Run dartfmt to format lib/src/ckb_types/dry_run_transaction_res.dart.)
  • lib/src/ckb_types/item/block.dart (Run dartfmt to format lib/src/ckb_types/item/block.dart.)
  • lib/src/ckb_types/item/blockchain_info.dart (Run dartfmt to format lib/src/ckb_types/item/blockchain_info.dart.)
  • lib/src/ckb_types/item/cell_input.dart (Run dartfmt to format lib/src/ckb_types/item/cell_input.dart.)
  • lib/src/ckb_types/item/cell_out_point.dart (Run dartfmt to format lib/src/ckb_types/item/cell_out_point.dart.)
  • lib/src/ckb_types/item/cell_output.dart (Run dartfmt to format lib/src/ckb_types/item/cell_output.dart.)
  • lib/src/ckb_types/item/cell_with_outpoint.dart (Run dartfmt to format lib/src/ckb_types/item/cell_with_outpoint.dart.)
  • lib/src/ckb_types/item/cell_with_status.dart (Run dartfmt to format lib/src/ckb_types/item/cell_with_status.dart.)
  • lib/src/ckb_types/item/epoch.dart (Run dartfmt to format lib/src/ckb_types/item/epoch.dart.)
  • lib/src/ckb_types/item/header.dart (Run dartfmt to format lib/src/ckb_types/item/header.dart.)
  • lib/src/ckb_types/item/node_info.dart (Run dartfmt to format lib/src/ckb_types/item/node_info.dart.)
  • lib/src/ckb_types/item/out_point.dart (Run dartfmt to format lib/src/ckb_types/item/out_point.dart.)
  • lib/src/ckb_types/item/transaction.dart (Run dartfmt to format lib/src/ckb_types/item/transaction.dart.)
  • lib/src/ckb_types/item/transaction_with_status.dart (Run dartfmt to format lib/src/ckb_types/item/transaction_with_status.dart.)
  • lib/src/ckb_types/item/tx_pool_info.dart (Run dartfmt to format lib/src/ckb_types/item/tx_pool_info.dart.)
  • lib/src/ckb_types/item/uncle_block.dart (Run dartfmt to format lib/src/ckb_types/item/uncle_block.dart.)
  • lib/src/ckb_types/item/witness.dart (Run dartfmt to format lib/src/ckb_types/item/witness.dart.)
  • lib/src/ckb_types/local_node_info_res.dart (Run dartfmt to format lib/src/ckb_types/local_node_info_res.dart.)
  • lib/src/ckb_types/peer_state_res.dart (Run dartfmt to format lib/src/ckb_types/peer_state_res.dart.)
  • lib/src/ckb_types/peers_res.dart (Run dartfmt to format lib/src/ckb_types/peers_res.dart.)
  • lib/src/ckb_types/send_transaction_res.dart (Run dartfmt to format lib/src/ckb_types/send_transaction_res.dart.)
  • lib/src/ckb_types/tip_block_number_res.dart (Run dartfmt to format lib/src/ckb_types/tip_block_number_res.dart.)
  • lib/src/ckb_types/transaction_res.dart (Run dartfmt to format lib/src/ckb_types/transaction_res.dart.)

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 ckb_sdk.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.2.2 <3.0.0
bip_bech32 ^0.1.3 0.1.3
convert ^2.1.1 2.1.1
http ^0.12.0+1 0.12.0+2
pointycastle ^1.0.1 1.0.1
Transitive dependencies
async 2.2.0
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
meta 1.1.7
path 1.6.2
pedantic 1.7.0
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
test ^1.5.1+1