RAILGUN Reloaded
    Preparing search index...

    RPC-backed DataSource that fetches RAILGUN contract events directly from a JSON-RPC endpoint and formats them into EVMBlocks.

    Historical range sync: uses eth_getLogs against the connection manager so requests are batched / queued. Live sync: subscribes via watchEvent and pushes new blocks through an async iterator.

    Always treated as a live provider, suitable as the tail source in a SourceAggregator after a historical indexer like Subsquid.

    Type Parameters

    Implements

    Index
    • get client(): {}

      Underlying viem public client, exposed for callers that need direct chain access (e.g. reading tx calldata for boundParamsHash).

      Returns {}

      The viem PublicClient bound to the configured RPC URL

    • Build an RPCProvider bound to a specific contract and RPC endpoint.

      Type Parameters

      Parameters

      • railgunProxyAddress: `0x${string}`

        Address of the RAILGUN proxy contract to watch

      • rpcURL: string

        HTTP(S) JSON-RPC endpoint

      • abi: Abi

        Contract ABI used to decode event logs

      • chain: Chain

        Viem chain descriptor (e.g. mainnet, sepolia, arbitrum); must match the network rpcURL points at, otherwise viem will reject requests on chain-id mismatch

      • connectionManager: RPCConnectionManager

        Shared rate-limiter / batcher for outbound requests

      • options: { fetchFn?: FetchLike } = {}

        Optional settings

        • OptionalfetchFn?: FetchLike

          Network call for every JSON-RPC request. Defaults to the global fetch

      Returns RPCProvider<T>

    • Finalized block number on the chain, used by SourceAggregator and from() to decide how far this source can cover.

      Returns Promise<bigint>

      Finalized block number as bigint

    • Stream EVMBlocks for the requested height range. Fetches historical logs in chunks of chunkSize (default 500), yielding blocks in order. The history ends at the finalized block. When liveSync is true and no endHeight is set, the live watcher starts at the head, so the blocks between finalized and the head are not returned.

      Parameters

      • options: SyncOptions

        Sync options (start/end height, chunk size, live flag)

      Returns AsyncGenerator<T>

      Each EVMBlock in ascending order

    • Stop all active live-event iterators created by this provider. Must be called to release watchEvent subscriptions.

      Returns void

    isLiveProvider: boolean = true

    Declares this source as live-capable for SourceAggregator.