rudimentary history command

This commit is contained in:
Florian Dold 2019-09-04 14:28:22 +02:00
parent 82591a9ba9
commit 604a74007d
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -77,6 +77,22 @@ program
process.exit(0); process.exit(0);
}); });
program
.command("history")
.description("show wallet history")
.action(async () => {
applyVerbose(program.verbose);
console.log("history command called");
const wallet = await getDefaultNodeWallet({
persistentStoragePath: walletDbPath,
});
console.log("got wallet");
const history = await wallet.getHistory();
console.log(JSON.stringify(history, undefined, 2));
process.exit(0);
});
async function asyncSleep(milliSeconds: number): Promise<void> { async function asyncSleep(milliSeconds: number): Promise<void> {
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve, reject) => {
setTimeout(() => resolve(), milliSeconds); setTimeout(() => resolve(), milliSeconds);