taquito
taquito copied to clipboard
SPIKE: Get BigMap Keys & Values
As a Taquito user that has an Operation Hash I want an API that I can use to fetch the Operation's bigmaps and keys so that I can inspect the content.
Background
Storage of smart contracts can contain BigMap structures. bigmap is a key/value type. bigmaps have identifiers and can be queried by id. bigmaps can contain any key/value data including different primitive types, maps, Michelson code, etc. Keys can be compound.
Note, this is a spike, aka a prototype of implementation
Acceptance criteria:
- For each of the below smart contract operations, retrieve storage bigmap ids, keys and full content by contract address using API for each of the indexers:
- https://tzstats.com/docs/api/index.html
- https://better-call.dev/docs
- Document bigmap data available through each indexer api for each kind of operation on smart contracts
- Define TypeScript type definition for the generalized properties for operation's BigMap.
OUT OF SCOPE: bigmap history
Examples (mainnet)
Batch operation w/ cContract call and transfer https://tzstats.com/onsZtZR1xWQ3Un8zpJUadaTRbxJfMjaL343TdZQg3zbPYvJXU8Q/39938569 This operation has two items. A contract call, and a transfer of 0.005 XTZ tokens from an originated account (KT1) to an implicit account (TZ1).
Batch with reveal and contract origination https://tzstats.com/ooQfLJHv9k5upzZ8JKsXh8X2Cdef9FCur6Fz4ytFMkomo8mgzS7 This has operation has two items in its batch. A Public Key Reveal and a "New delegator" contract (an origination).
Example contract with a map and a bigmap defined in storage https://better-call.dev/edo2net/KT1HBAKtTECxgK1SEy2UqgZxKGL1hiGxJywZ
kUSD contract on better-call-dev, has three bigmaps https://better-call.dev/mainnet/KT1K9gCRgaLRFKTErYt1wVxA3Frb9FjasjTV/storage