5. Track a transfer

fetchTransferStatus in @gibs/bridge-indexer takes { chainId, txHash } for the transaction that started a transfer. It returns:

  • state: one of sent, confirmed-not-final, validators-confirming, ready-delivery-service, ready-your-turn, delivered, entry-reached, stranded, failed and unknown. transferStateNames holds the words to show.
  • claimable: true in both ready states.
  • destinationTxHash: the transaction that settled the destination side.
  • aggregatorStatus: the aggregator's own answer, for a route that starts with an aggregator.

Every option is optional: fetch, endpoint, signal, aggregator, aggregatorFinalLeg and originClient. The function works around every known indexer defect: it lowercases hex filters, and it avoids the one-way joins and the relations that are always null.

What you pass:

  • originClient, your viem client on the origin chain. Without it, a transaction that the indexer has not recorded yet is unknown, not sent.
  • aggregator, for a route that starts with an aggregator. Relay's status endpoint answers 400 without your Relay key.