Indexer GraphQL

The bridge indexer records every bridge request, signature, delivery and fee change on PulseChain, Ethereum and BNB Smart Chain. You read it over GraphQL. It needs no key.

@gibs/bridge-indexer wraps the queries on this page. Use the package when you can. It works around the known data defects for you.

Endpoints

EndpointUse
https://next-indexer.gibs.finance/graphqlThe default of @gibs/bridge-indexer. The Gibs Finance interface reads it too.
https://indexer.gibs.finance/graphqlThe older name of the production indexer. It can lag the schema, so a query can fail with an unknown field.

Each host also answers GraphQL at /. GET /version returns the indexer version as JSON.

Send a query as an HTTP POST with a JSON body:

curl -s https://next-indexer.gibs.finance/graphql \
  -H 'content-type: application/json' \
  -d '{"query":"{ userRequests(limit: 1, orderBy: \"orderId\", orderDirection: \"desc\") { items { messageHash originationChainId destinationChainId delivered } } }"}'

Rules you must follow

  • Lowercase every address and hash in a where filter. A checksummed address matches nothing.
  • Read delivered, a boolean on the request. Do not read the delivery relation.
  • Read a Completion or Delivery by its messageHash. The join from a request to them works in one direction only.
  • BigInt fields arrive as decimal strings.

The @gibs/bridge-indexer page lists every rule.

Find the requests of one transaction

This is the query fetchTransferStatus sends. Pass the origin transaction hash, lowercased, in where.transactionHash.

query TransferStatus($where: UserRequestFilter!) {
  userRequests(where: $where, limit: 10, orderBy: "orderId", orderDirection: "asc") {
    items {
      messageHash
      originationChainId
      destinationChainId
      finishedSigning
      delivered
      feeDirector { feeType }
      block { number }
    }
  }
}
{ "where": { "transactionHash": "0x…" } }

Find the transaction that settled a request

This is the query fetchTransferStatus sends next. Pass the messageHash from the query above, lowercased. A Delivery row wins over a Completion row, because it comes later.

query TransferSettlement($messageHash: String!) {
  deliverys(where: { messageHash: $messageHash }, limit: 10) {
    items { chainId transactionHash }
  }
  completions(where: { messageHash: $messageHash }, limit: 10) {
    items { chainId transactionHash }
  }
}

Read what a claim needs

This is the query fetchClaimRecords sends. It reads the signatures and the encoded message that a claim on the destination chain submits.

query ClaimRecord($where: UserRequestFilter!) {
  userRequests(where: $where, limit: 10, orderBy: "orderId", orderDirection: "asc") {
    items {
      messageHash
      type
      encodedData
      signatures
      confirmedSignatures
      requiredSignatures { value }
      destinationAmbAddress
      destinationChainId
      finishedSigning
      delivered
    }
  }
}

List the transfers of one address

The interface's transfer history pages through userRequests with a cursor. Filter by the sender with from, lowercased.

query GetBridges($where: UserRequestFilter, $limit: Int = 10, $after: String) {
  userRequests(where: $where, limit: $limit, after: $after, orderBy: "orderId", orderDirection: "desc") {
    items {
      messageHash
      transactionHash
      originationChainId
      destinationChainId
      originationTokenAddress
      destinationTokenAddress
      amountIn
      amountOut
      finishedSigning
      delivered
      block { timestamp }
    }
    totalCount
    pageInfo { hasNextPage endCursor }
  }
}
{ "where": { "from": "0x…" }, "limit": 10 }

To read the next page, pass pageInfo.endCursor as after.