Read account history
Safety: blockchain-query
Use this recipe when you need an account-centered audit trail: transfers, votes, comments, rewards and other operations that touched one account.
For block-centered parsing, use Parse recent blocks or Parse blockchain history.
Read recent account operations
import { Client } from '@beblurt/dblurt';
const client = new Client(['https://rpc.blurt.blog']);
const history = await client.condenser.getAccountHistory('alice', -1, 20);
for (const [index, entry] of history) {
console.log(index, entry.op[0]);
}getAccountHistory() is useful when the account is the primary filter. It returns operation entries newest/oldest according to the supplied start and limit parameters owned by the Layer 1 condenser API.
Inspect operations in a block
const { ops } = await client.accountHistory.getOpsInBlock(61_000_000, false);
for (const operation of ops) {
console.log(operation.block, operation.op[0]);
}Use only_virtual: true when you want protocol-generated virtual operations only:
const { ops } = await client.accountHistory.getOpsInBlock(61_000_000, true);Page virtual operations
enumVirtualOps() reads protocol-generated effects across a block range. It is useful for indexers that care about rewards, power-down fills, proposal payments and producer rewards.
let blockRangeBegin = 61_000_000;
let operationBegin: number | undefined;
const page = await client.accountHistory.enumVirtualOps({
block_range_begin: blockRangeBegin,
block_range_end: blockRangeBegin + 100,
operation_begin: operationBegin,
limit: 100
});
console.log(page.ops.length);
blockRangeBegin = page.next_block_range_begin;
operationBegin = page.next_operation_begin;Persist both cursors if your parser resumes later.
Choosing account history or block parsing
| Task | Use |
|---|---|
| Show one account's recent actions | client.condenser.getAccountHistory() |
| Audit all operations in a known block | client.accountHistory.getOpsInBlock() |
| Page virtual operations across blocks | client.accountHistory.enumVirtualOps() |
| Build a bounded block/operation parser | client.blockchain.getBlocks() / getOperations() |
