0.24.0-next.0 • Published 2 years ago
@yadomi29/transaction-manager v0.24.0-next.0
@yadomi29/transaction-manager
TransactionManager is a tool for manager uncommitted cells, you can send_transaction
via this tool and get uncommitted outputs by collector
.
Usage
const TransactionManager = require("@yadomi29/transaction-manager");
const { Indexer } = require("@yadomi29/ckb-indexer");
// generate a new `TransactionManager` instance and start.
const indexer = new Indexer("http://127.0.0.1:8114");
const transactionManager = new TransactionManager(indexer);
transactionManager.start();
// now you send transaction via `transactionManager`.
const txHash = await transactionManager.send_transaction(transaction);
// you can get uncommitted cells by `transactionManager.collector`.
const collector = transactionManager.collector({ lock });
for await (const cell of collector.collect()) {
console.log(cell);
}