Skip to main content

Get Metadata for an Hash

Allows you to retrieve metadata associated with a pool entry that matches a specific hash.

Parameter

AttributeDescription
bech32PoolAddressThe Cardano Pool Address, starts with pool...
hashThe hash associated with a metadata, also known as poolMetaData.json

What is the Metadata Hash and Where to get it ?

This is the hash of the poolMetadata.json file. It is important that the released JSON file matches the hash specified in your transaction.

CLI

It is recommended to download the remote poolMetaData.json file to avoid using an invalid hash.

cardano-cli stake-pool metadata-hash --pool-metadata-file ./poolMetaData.json

Online

You can use your favorite Cardano Explorer to fetch published metadata hashes.

Example

import { anvil } from "@ada-anvil/sdk-client";

try {
await anvil.spo.getMetadataHash({ bech32PoolAddress, hash });
} catch {
console.log("Authentication failed");
}

Curl

ENDPOINT="https://prod.api.ada-anvil.app"
BECH32_POOL_ADDRESS="pool1n3sjq3qvu5vvcd6aud6ndcwq7r3ghmkafcg60gznlwfrk2ucxku"
HASH="4f0ff94514eb878dd85a92f97282bcd189ea66eebe64312698fe30cea31c5c47"
API_KEY="XXXXXXX"

curl "${ENDPOINT}/spo/getMetadataHash?input=%7B%22bech32PoolAddress%22%3A%22${BECH32_POOL_ADDRESS}%22,%22hash%22%3A%22${HASH}%22%7D" \
--header "x-api-key: ${API_KEY}"

Return informations

No error logged

{
"result": {
"data": {
"verification": "3766280b43ed2545ea",
"name": "anvil",
"description": "Building tools for Cardano",
"ticker": "ANVIL",
"homepage": "https://ada-anvil.io",
"extended": "https://raw.githubusercontent.com/Cardano-Forge/ap/main/extended.json"
}
}
}