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;
Description
MetadataViewsFile
is a union type that can be either aMetadataViewsHTTPFile
or aMetadataViewsIPFSFile
.- This type is used to represent file information in a flexible way, accommodating different file storage mechanisms.
MetadataViewsHTTPFile Interface
export interface MetadataViewsHTTPFile {
url: string;
}
Properties
url
:string
- The URL of the file when it's stored on an HTTP server.
MetadataViewsIPFSFile Interface
export interface MetadataViewsIPFSFile {
cid: string;
path?: string;
}
Properties
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.
Usage
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.