2

I am currently writing tests for a contract and for one of those tests, I would like to get the number of entries in a bigmap field of the contract's storage. I am using JavaScript with Taquito and Truffle for these tests.

1 Answer 1

4

This is not something you will be able to achieve with Taquito (at least not for now, that will change in the future) and you have to use an indexer API. I recommend Better Call Dev API, you can easily get the number of keys with a fetch call to api.better-call.dev/v1/bigmap/${network}/${big_map_id}/keys (the big map ID should be available in Taquito by calling the toString method on the big map abstraction object).

Your Answer

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

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