How we can get minted image details using cardano cli or any other open source tools?

How we can get minted image details using cardano cli or any other open source tools?

You could use the Koios API:

$ curl -s "https://api.koios.rest/api/v0/asset_info?_asset_policy=43c4b46c9635b3a57c9731de817a20b3d099ee2c7f44a0e2723c4bb6&_asset_name=486570746143617264" | jq
[
  {
    "policy_id": "43c4b46c9635b3a57c9731de817a20b3d099ee2c7f44a0e2723c4bb6",
    "asset_name": "486570746143617264",
    "asset_name_ascii": "HeptaCard",
    "fingerprint": "asset10zsrgd7329r73aq7ms3hvv0k2c727q55uszdfc",
    "minting_tx_hash": "de3271da5fc532947b344f53771391370c2bd0b9a69ba0981b68b1581de6a811",
    "total_supply": "1",
    "mint_cnt": 1,
    "burn_cnt": 0,
    "creation_time": 1660335339,
    "minting_tx_metadata": [
      {
        "key": "721",
        "json": {
          "43c4b46c9635b3a57c9731de817a20b3d099ee2c7f44a0e2723c4bb6": {
            "HeptaCard": {
              "name": "HeptaSean's Card",
              "files": [
                {
                  "src": [
                    "data:text/html;base64,PCFkb2N0eXBlIGh0bWw+PGh0bWwgbGFuZz1lbj48bW",
                    […]
                    "48L2Rpdj4="
                  ],
                  "mediaType": "text/html"
                }
              ],
              "image": [
                "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyB3aW",
                    […]
                "Y3eiIvPjwvc3ZnPgo="
              ],
              "mediaType": "image/svg+xml"
            }
          }
        }
      }
    ],
    "token_registry_metadata": null
  }
]

(This is the NFT created in https://forum.cardano.org/t/minting-an-on-chain-nft-with-a-hardware-wallet/105922, which can be seen on https://pool.pm/asset10zsrgd7329r73aq7ms3hvv0k2c727q55uszdfc.)

The API also allows to filter the output to only the things you need. There are other API calls to find policy ID and asset name from addresses, accounts, or transactions.

Thanks for the reply. Do we have any way to do direct chain lookup instead of any third party?

If you look at https://api.koios.rest/#overview–how-does-koios-work, what they are doing is in essence serving https://github.com/input-output-hk/cardano-db-sync through a web API.

So, you could install that, e.g., by the guide at https://cardano-community.github.io/guild-operators/Build/dbsync/ and then querying the database.

You will need a running cardano-node instance and around the same space again for the synchronised database (since the blockchain stored by the node is not in a format that can easily be queried). So, take a server with – say – 500 GiB of disk space for it.

1 Like

Just to add, one can run exact copy of Koios locally (as that’s primary distinction) using instructions at gRest - Guild Operators to convert a dbsync instance to Koios node (and if interested can string your instance to Koios cluster)

1 Like