8000
Skip to content

Feature request: add on-demand fungible token metadata refetch #14574

Description

@everythingtokenonRH

Problem

Blockscout periodically refreshes metadata for cataloged fungible tokens. If a token's
on-chain name() or symbol() changes between scheduled runs, the API and explorer can
continue showing the previous values until the next metadata update.

There is already a public, rate-limited refresh endpoint for individual NFT instances.
The existing fungible-token alternative is the sensitive admin DELETE token-info
operation, which is not suitable for public use because it also clears imported token
information before triggering a refresh.

Proposal

Add a public API v2 endpoint for one cataloged fungible token:

PATCH /api/v2/tokens/:address_hash/refetch-metadata

The endpoint would:

  • accept ERC-20 and ZRC-2 tokens only;
  • asynchronously reuse the existing token updater;
  • re-read name, symbol, decimals, and totalSupply from the contract;
  • preserve icon and admin-curated token information;
  • return 200 OK when the refresh has been queued; and
  • use an isolated IP rate limit plus the existing on-demand rate limiter.

The first implementation intentionally preserves Blockscout's current precedence for
admin-curated name and symbol values. Guidance would be welcome on a supported
opt-in for tokens that need fixed visual/social metadata while keeping those two
contract fields mutable on-chain.

This avoids lowering the global metadata interval for every token and provides parity
with Blockscout's existing single-NFT refresh workflow.

I have a small implementation with OpenAPI documentation and controller integration
tests ready and can open it as a draft PR.

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

    0