Per the BigMapAbstraction Taquito API docs, there isn't a way to fetch all the values in that map.
Is the suggested way to fetch all of values in the map by doing batch queries on it then? Or what's the recommended way to fetch these values?
Tezos Stack Exchange is a question and answer site for users, experts, and developers of the Tezos blockchain project. It only takes a minute to sign up.
Sign up to join this communityPer the BigMapAbstraction Taquito API docs, there isn't a way to fetch all the values in that map.
Is the suggested way to fetch all of values in the map by doing batch queries on it then? Or what's the recommended way to fetch these values?
You have 2 solutions for this problem:
Off-chain example:
Code with tests: https://smartpy.io/ide?cid=QmNeBqAbS4yotpDpdv7SPb7G3a3aHZpEoeKyzHnGuMHtcT&k=cb7d23e3d4856e707cba
Explorer: https://tzcomet.io/#/explorer%3Fexplorer-input%3DKT18qKjbKKAex6ubRvWnqCYjzHFgAqwCiwxs
Always use big_map
over map
when you will have many items. Otherwise, your contract will get gas locked easily.
The recommended way is to use an indexer API to fetch all the active key/value bindings in the big map. Querying the values one by one using their associated keys may be fine if you have a few entries but is going to be extremely slow when your big map starts to grow.