Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mobula.io/llms.txt

Use this file to discover all available pages before exploring further.

Subscriptions use the WebSocket endpoint wss://api.mobula.io/graphql/subscriptions with the graphql-transport-ws protocol.

Returns

onTokenLifecycleEventsCreated
AddTokenLifecycleEventsOutput!
Batched mint/burn events delivered as they are produced upstream. See AddTokenLifecycleEventsOutput.

Arguments

networkId
Int!
required
Network id to scope the subscription to (e.g. 1 for Ethereum, 56 for BNB Chain, 1399811149 for Solana). Required — there is no cross-network firehose.
address
String
Token contract address. Optional:
  • Provide an address to receive only that token’s mint/burn events on the given network.
  • Omit address to receive every mint/burn event on the entire network (per-network firehose).

Behavior

  • Fires for ERC-20 Transfer(from = 0x0) / Transfer(to = 0x0) events on EVM chains and for SPL mintTo / burn instructions on Solana. The mint/burn classification is performed upstream in the transfer extractor.
  • totalSupply and circulatingSupply are looked up from the token storage cache at fan-out time, but only when the GraphQL selection set requests them — selecting only amount skips the lookup entirely.
  • Multiple events can be delivered in one push: the resolver returns { id, events: [...] }, where events may contain several mint/burn events that landed in the same upstream batch.
  • The same event reaches both token-scoped subscribers (tokenAddress + networkId) and the network-firehose subscribers (networkId only) on that chain.

Example — single token on a specific network

Stream mint/burn events for one token on BNB Chain (networkId: 56):
subscription {
  onTokenLifecycleEventsCreated(
    networkId: 56
    address: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"
  ) {
    id
    events {
      tokenAddress
      networkId
      blockHash
      blockNumber
      id
      logIndex
      maker
      timestamp
      transactionHash
      transactionIndex
      eventType
      data {
        __typename
        ... on TokenMintEventData {
          amount
          totalSupply
          circulatingSupply
        }
        ... on TokenBurnEventData {
          amount
          totalSupply
          circulatingSupply
        }
      }
    }
  }
}

Example — every mint/burn on a network (firehose)

Omit address to receive every mint/burn event on the network. This subscribes to all token lifecycle activity on BNB Chain:
subscription {
  onTokenLifecycleEventsCreated(networkId: 56) {
    id
    events {
      tokenAddress
      networkId
      blockHash
      blockNumber
      id
      logIndex
      maker
      timestamp
      transactionHash
      transactionIndex
      eventType
      data {
        __typename
        ... on TokenMintEventData {
          amount
          totalSupply
          circulatingSupply
        }
        ... on TokenBurnEventData {
          amount
          totalSupply
          circulatingSupply
        }
      }
    }
  }
}

Example — JSON request body

The same firehose query as a JSON-encoded subscription frame (e.g. for graphql-transport-ws):
{
  "query": "subscription { onTokenLifecycleEventsCreated(networkId: 56) { id events { tokenAddress networkId blockHash blockNumber id logIndex maker timestamp transactionHash transactionIndex eventType data { __typename ... on TokenMintEventData { amount totalSupply circulatingSupply } ... on TokenBurnEventData { amount totalSupply circulatingSupply } } } } }"
}