Skip to content

Simplify fetching of chain metadata including logos #554

@jmrossy

Description

@jmrossy

Chain metadata doesn't necessarily include a logoURI, but we do require a logo.svg for chain entries in the registry. So it's possible to get all the chain info including all the logos but atm it looks like this code in the explorer:

  // Ensure that by the before this code is done, the registry classes content caches will be filled
  await registry.listRegistryContent();
  // Get the chain metadata, most of which don't have logos yet
  const registryChainMetadata = await registry.getMetadata();
  // Merge the registry-based logo URIs into the metadata
  const metadataWithLogos = await promiseObjAll(
    objMap(
      registryChainMetadata,
      async (chainName, metadata): Promise<ChainMetadata> => ({
        ...metadata,
        logoURI: (await registry.getChainLogoUri(chainName)) || undefined,
      }),
    ),
  );

We should improve the interface so that logos 'just work'.

It may make sense to do this at the same time as #534

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog (old, unrefined)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions