Skip to content

Cache token metadata same as contract abi #38

@whoabuddy

Description

@whoabuddy

Docs:
https://docs.hiro.so/en/apis/token-metadata-api/reference/tokens/fungible-token-metadata

Example URL:
https://api.hiro.so/metadata/ft/SP2Z94F6QX847PMXTPJJ2ZCCN79JZDW3PJ4E6ZABY.fake-faktory

Example response:

{
  "tx_id": "0xcc8a7a2eca839a846c22cbea8b66af9a69f4e9589a6fb79b0cd65b9cf47cf843",
  "sender_address": "SP2Z94F6QX847PMXTPJJ2ZCCN79JZDW3PJ4E6ZABY",
  "asset_identifier": "SP2Z94F6QX847PMXTPJJ2ZCCN79JZDW3PJ4E6ZABY.fake-faktory::fake",
  "name": "fake",
  "symbol": "fake",
  "decimals": 8,
  "total_supply": "100000000000000000",
  "token_uri": "https://mkkhfmcrbwyuutcvtier.supabase.co/storage/v1/object/public/tokens//251.json",
  "description": "Bitcoin Faces on testnet.",
  "image_uri": "https://assets.hiro.so/api/mainnet/token-metadata-api/SP2Z94F6QX847PMXTPJJ2ZCCN79JZDW3PJ4E6ZABY.fake-faktory/1.png",
  "image_thumbnail_uri": "https://assets.hiro.so/api/mainnet/token-metadata-api/SP2Z94F6QX847PMXTPJJ2ZCCN79JZDW3PJ4E6ZABY.fake-faktory/1-thumb.png",
  "image_canonical_uri": "https://mkkhfmcrbwyuutcvtier.supabase.co/storage/v1/object/public/tokens//251.png",
  "metadata": {
    "sip": 16,
    "name": "FACES",
    "description": "Bitcoin Faces on testnet.",
    "image": "https://mkkhfmcrbwyuutcvtier.supabase.co/storage/v1/object/public/tokens//251.png",
    "cached_image": "https://assets.hiro.so/api/mainnet/token-metadata-api/SP2Z94F6QX847PMXTPJJ2ZCCN79JZDW3PJ4E6ZABY.fake-faktory/1.png",
    "cached_thumbnail_image": "https://assets.hiro.so/api/mainnet/token-metadata-api/SP2Z94F6QX847PMXTPJJ2ZCCN79JZDW3PJ4E6ZABY.fake-faktory/1-thumb.png",
    "properties": {
      "decimals": 8,
      "external_url": "https://aibtc.dev/"
    }
  }
}

Would operate the same as contract ABI with indefinite caching by default and request param to burst when needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions