0.17.0-rc8.17 • Published 2 years ago
@ximingwang/hd-cache v0.17.0-rc8.17
@ximingwang/hd-cache
HD Cache manager for lumos.
Usage
const {
CacheManager,
CellCollector,
CellCollectorWithQueryOptions,
getBalance,
} = require("@ximingwang/hd-cache");
const { Indexer } = require("@ximingwang/ckb-indexer");
const indexer = new Indexer("http://localhost:8114");
const cacheManger = CacheManager.loadFromKeystore(
indexer,
"You keystore path",
"You password"
);
// start to sync cache from indexer
cacheManager.startForever();
// if your keystore is from ckb-cli or you set needMasterPublicKey to true, you can get you master public key info by
cacheManager.getMasterPublicKeyInfo(); // ckb-cli using this key by default
// now you can using following methods
cacheManager.getNextReceivingPublicKeyInfo();
cacheManager.getNextChangePublicKeyInfo();
// or collect cells by CellCollectors
const cellCollector = new CellCollector(cacheManager);
// or with queryOptions
const cellCollector = new CellCollectorWithQueryOptions(
new CellCollector(cacheManger),
queryOptions
);
for await (const cell of cellCollector.collect()) {
console.log(cell);
}
// get HD wallet balance
await getBalance(cellCollector);
0.18.0-rc5.1
2 years ago
0.16.1-next.105
2 years ago
0.17.0-rc8.17
2 years ago
0.17.0-rc8.16
2 years ago
0.17.0-rc8.15
2 years ago
0.17.0-rc8.14
2 years ago
0.17.0-rc8.13
2 years ago
0.17.0-rc8.11
2 years ago
0.17.0-rc8.10
2 years ago