Skip to content

BaojunCZ/ckb_generate_hd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generate CKB HD Wallet

Usage

A simple usage example:

import 'package:ckb_generate_hd/ckb_generate_hd.dart';
import 'package:ckb_sdk/ckb-utils/network.dart';

main() async {
  final generation = CKBHDGeneration.createNew(Network.TestNet, "http://localhost:8114");
  await generation.init();
  final receive = generation.receiveByIndex(0);
  print(generation.mnemonic);
  print(receive.toJson());
}

HDIndexWallet

Map<String, dynamic> toJson() => <String, dynamic>{
        'privateKey': hex.encode(privateKey),
        'publicKey': hex.encode(publicKey),
        'type': isReceive ? 'Receive' : 'Change',
        'index': index,
        'path': path,
        'lockHash': lockHash,
        'address': getAddress(Constant.netWork),
        'blake160': blake160
      };

About

generate CKB HD Wallet

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages