MetadataViewsFile Interfaces

The MetadataViewsFile types in the Flooks library define structures for representing files in metadata views, specifically for HTTP and IPFS files.

MetadataViewsFile Type

export type MetadataViewsFile = MetadataViewsHTTPFile | MetadataViewsIPFSFile;


  • MetadataViewsFile is a union type that can be either a MetadataViewsHTTPFile or a MetadataViewsIPFSFile.
  • This type is used to represent file information in a flexible way, accommodating different file storage mechanisms.

MetadataViewsHTTPFile Interface

export interface MetadataViewsHTTPFile {
  url: string;


  • url: string
    • The URL of the file when it's stored on an HTTP server.

MetadataViewsIPFSFile Interface

export interface MetadataViewsIPFSFile {
  cid: string;
  path?: string;


  • cid: string
    • The Content Identifier (CID) of the file on IPFS (InterPlanetary File System).
  • path: string (optional)
    • An optional path to the file within the IPFS structure.


These interfaces are crucial for applications dealing with NFTs or other blockchain-based assets that reference external files. They provide a standardized way to represent file information, whether the files are hosted on a traditional HTTP server or on a decentralized storage system like IPFS.