2

How do you get the value of a key in a big map using tezos-client? I don’t get the parameter « identifier of big_map » of « get element of big map , or how to find this identifier. The « get big map value for» is simpler to understand but deprecated.

And how do you discover the indexes of the big maps of a contract? It seems you would have to inspect the storage, and correlate with the type of the storage, and pick out the numbers that correspond to big_maps.

1 Answer 1

2

The problem with the old route is that it used POST to simplify the fact it was sending a JSON body, but semantically POST was incorrect because it was not changing anything. The current version requires the key to be in script_expr form. The big map id is an integer. When you originate a contract it will give you the ids of its big maps. When you query the store of a contract, instead of returning [] for the big map like it did before, now it returns the big map id. You can also view this thread: How to get big map value on Babylon

regarding the second question: If you don't mind using an API other then the node RPC you can find this in the new version of the tzstats indexer (GET /explorer/contract/{hash} returns an object with a key bigmap_ids which is an array) see https://api.babylonnet.tzstats.com/explorer/contract/KT1E5toJrALhVPuKpHWTbRVjgEvWWR98sVKj for an example, the id is also part of the decoded/unboxed storage endpoint at https://api.babylonnet.tzstats.com/explorer/contract/KT1E5toJrALhVPuKpHWTbRVjgEvWWR98sVKj/storage

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.