Browse documentation

GUIDES / INDEXED HISTORY

Read history in bounded pages.

Query indexed transactions, native TEL movements, ERC20 event-shaped transfers and raw logs through the authenticated API. History is available in Adiri staging and SDK 0.2.0.

Check coverage first

GET /adiri/api/v1/history/status returns the network identity, source generation and each dataset's status and covered range. Adiri coverage starts at block 1; use the reported coveredEnd rather than assuming every observed head is already indexed.

DatasetMeaning
TransactionsIndexed calls, including failed and zero-value transactions; creation recipients can be null.
Native transfersSuccessful positive-value top-level TEL sends and creation funding. Fees, rewards and internal movements are excluded.
ERC20 transfersSuccessful Transfer-event shape, including zero values and mint/burn addresses. This is not token-standard verification or metadata.
Raw logsReceipt log address, topics and hex data, without ABI decoding.

Historical balances, internal traces, ERC721 and ERC1155 transfers are unsupported. Transfer values are exact base-unit strings; no token decimals, symbols or prices are inferred. Native transfer contractAddress is null and logIndex is -1.

Choose a range and first page

Set OPRAIL_ADDRESS to the address you want to inspect. Ranges are inclusive and contain at most 10,000 blocks: 1..10000 is valid; 1..10001 is too wide. The default page size is 50, maximum 100.

First transaction page
cURL
curl --fail-with-body --get \
  "$OPRAIL_API_ORIGIN/adiri/api/v1/addresses/$OPRAIL_ADDRESS/transactions" \
  -H "X-API-Key: $OPRAIL_API_KEY" \
  --data-urlencode "fromBlock=1" \
  --data-urlencode "toBlock=10000" \
  --data-urlencode "limit=50"

Transactions/transfers accept direction=both|in|out and order=asc|desc. Transfers also accept kind=both|native|erc20. Raw logs require one contract address and optionally exact topic0 through topic3 filters, combined with AND.

Continue with the returned cursor

A page contains data, nextCursor, network identity, generation, a pinned snapshotBlock and coverage. Set OPRAIL_CURSOR to nextCursor and send only the cursor at the same address and endpoint. Log continuations also retain their address parameter.

Continue the same query
cURL
curl --fail-with-body --get \
  "$OPRAIL_API_ORIGIN/adiri/api/v1/addresses/$OPRAIL_ADDRESS/transactions" \
  -H "X-API-Key: $OPRAIL_API_KEY" \
  --data-urlencode "cursor=$OPRAIL_CURSOR"

The authenticated cursor binds your account, network, address, range and filters. Do not edit it or resend the range, page size or filters. A null cursor marks the end. Its fixed lifetime is 60 minutes; changing source generation or expiry requires an explicit restart/reconciliation, not a silent reset.

Empty is different from unavailable. A successful covered page can have an empty data array. Out-of-coverage requests, unsupported datasets, bootstrapping, halted sources and stale cursors return explicit errors; the SDK does not turn them into empty results.

Use typed page methods

Start with the client in the SDK quickstart, then read a page and its continuation:

TypeScript history pages
TypeScript
// Use the client from the TypeScript quickstart.
const address = process.env.OPRAIL_ADDRESS!;
const status = await client.history.getStatus();
console.log(status.coverage);

const page = await client.history.getTransactionsPage(address, {
  fromBlock: 1, toBlock: 10000, limit: 50
});
console.log(page.data);
if (page.nextCursor) {
  const next = await client.history.getTransactionsPage(address, {
    cursor: page.nextCursor
  });
  console.log(next.data);
}
.NET history pages
C#
// Also add: using OpRail.Sdk.Models;
// Use the client from the .NET quickstart.
var address = Environment.GetEnvironmentVariable("OPRAIL_ADDRESS")!;
using var stop = new CancellationTokenSource(TimeSpan.FromSeconds(20));
var page = await client.GetAddressTransactionsPageAsync(address,
    new HistoryQuery { FromBlock = 1, ToBlock = 10000, Limit = 50 },
    stop.Token);
if (page.NextCursor is { } cursor)
{
    var next = await client.GetAddressTransactionsPageAsync(address,
        new HistoryQuery { Cursor = cursor }, stop.Token);
    Console.WriteLine(next.Data.Count);
}

Bound your work and checkpoints

Lazy iterators default to 100 pages, with a hard maximum of 1,000. Item iterators default to 10,000 items and allow at most 100,000. Set a smaller page/item budget and a cancellation signal for your task. There is no automatic prefetch, retry, cursor reset, deduplication or network fallback.

Use complete page envelopes and persist their nextCursor for resumable work. An item limit can stop inside a fetched page; it does not make the remaining page items a new bookmark. Every admitted page and status request consumes one credit. Cancellation or a lost response may follow admission.

An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.