Get Ledger History
History via predefined seed
import * as KeetaNet from '@keetanetwork/keetanet-client';
import util from 'node:util';
// Demo seed β Replace with real seed
const DEMO_SEED = 'D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0D3M0';
async function main() {
// Create an account from the seed (index 0)
const account = KeetaNet.lib.Account.fromSeed(DEMO_SEED, 0);
// Connect to KeetaNet testnet using the account
const client = KeetaNet.UserClient.fromNetwork('test', account);
// Fetch the account history
const history = await client.history();
// Print the account history in readable format
console.log(
'π Account history:',
util.inspect(KeetaNet.lib.Utils.Helper.debugPrintableObject(history), {
depth: 10,
colors: true
})
);
}
main().catch((err) => {
console.error('β Error:', err);
process.exit(1);
});
History of a public account
Last updated