class

ExplorerApi

Inherits Reference < Object

Reads transaction history from an Etherscan-style explorer API. Works with Blockscout's public instance (no key, but rate-limited to ~10 req/min) or Etherscan API V2 (free API key, much higher limits).

Both expose the same account fields: from, to, value, blockNumber, timeStamp, hash, tokenSymbol, tokenDecimal, contractAddress, ...

Constructors

new(base : String = "https://eth.blockscout.com/api", api_key : String | Nil = nil, proxy : String | Nil = nil, interval : Time::Span = 6.seconds, timeout : Time::Span = 60.seconds, max_retries : Int32 = 5)

Optional HTTP proxy prefix (e.g. https://r.jina.ai) for environments where the explorer host is unreachable directly (Cloudflare-gated networks). The request is then sent to proxy + / + base + ?query.

Source

Instance methods

account_all(module_name : String, action : String, address : String, offset : Int32 = 100, max_pages : Int32 = 20000) : Array(Hash(String, JSON::Any))

Fetches every record across all pages for an account action.

Pagination stops only on an EMPTY page, never on a short one: Blockscout caps a page below the requested offset, so a short page does not mean the last page. This is defensive — it was not the cause of the missing recipient documented in AIRDROP.md ("Open question" under step 1).

Source
account_page(module_name : String, action : String, address : String, page : Int32, offset : Int32) : Array(Hash(String, JSON::Any))
Source
balance_wei(address : String) : BigInt
Source
base
Source
close
Source
interval
Source
progress=(reporter : Progress | Nil)

Ticked once per explorer HTTP request (one request = one page); see Progress. The request is counted when the response arrives, so a run stuck inside throttle's sleep stays visible as a run that has not progressed.

Source

Nested types