CosmWasm Indexer

Why?

Rather than indexing the transactions and events that end up in a block like most indexers, this indexer only cares about the state in smart contracts.

Most indexers cannot access CW20 token balances. This one can.

This allows for:

  • Contract-to-contract (submessage) support
  • Blazing fast UI via contract query replacement
  • Instant historical data

This indexer is the reason DAO DAO is so fast.

What?

This indexer supports:

  • Current and historical smart contract state queries.
  • Webhooks that fire when state changes.
  • WebSockets that send real-time state updates to an app.

Where?

This indexer currently runs on Juno.

Want it on another chain? Email me or DM me on Twitter.

Try it out

Use the widget below to try querying state from a smart contract.

Contract address

State Key Type

State Key

How?

The contract API is very straightforward and documented below.

To perform more complex queries or write custom formulas, such as aggregated contract state for a specific wallet (like cw20 token balances), contact me using one of the links above.

This indexer runs on Juno mainnet and testnet. It is accessible via:

  • https://juno-mainnet.indexer.zone
  • https://juno-testnet.indexer.zone

When you create a key, you will be shown a one-time API key to put in the X-API-Key header of your requests. Once you fund it with credits, it will work immediately.

Contract API

/contract/address/item

This endpoint takes either key or keys in its query string and returns the value from an Item or value at a specific key in a Map.

key is used to access state from a smart contract Item. The query that gets the value of the item with key config from the smart contract with address address would look like this:

/contract/address/item?key=config

keys is used to access state from a smart contract Map. The query that gets the value of the wallet key in a map with key balances would look like this:

/contract/address/item?keys="balances":"wallet"

/contract/address/map

This endpoint takes either key or keys in its query string, as well as an optional numeric field, and returns the entire contents of a Map.

key is used to access a single-keyed Map. The query that gets the map with key balances from the smart contract with address address would look like this:

/contract/address/map?key=balances

keys is used to access a multi-keyed Map. The query that gets the map at the address key prefix in a multi-keyed map with key allowance would look like this:

/contract/address/map?keys="allowance":"address"

numeric tells the map decoder if the keys are numbers. If omitted or empty, the keys are treated as strings. If defined, the keys are treated as numbers. The query that gets the map with key proposals whose keys are numeric IDs that map to objects would look like this:

/contract/address/map?key=proposals&numeric=true