0

Assume I have a table deployed on chain. I know if I have a key, I can lookup the value like this:

Given a key, how do I read the value from a table via the API?

But what if I don't know the key? How do I lookup all the keys in a table via the API?

Daniel Porteous
  • 5,536
  • 3
  • 25
  • 44

1 Answers1

0

Unfortunately with regular tables there is no way to do this via the API right now.

Alternative options include:

  • Query an indexer (guide on this coming soon).
  • Use IterableTable. This is not deployed on mainnet in the core framework right now, but you could experiment with it on devnet / testnet.
  • If you know you'll only have a small number of items, you could use SimpleMap.
Daniel Porteous
  • 5,536
  • 3
  • 25
  • 44