typescript-sdk

Home > @3rdweb/sdk > IStorage

IStorage interface

Signature:

export interface IStorage 

Methods

Method Description
canResolve(uri) Returns true if the URI is resolvable by the current storage interface.For example: If the storage is configured to point to IPFS, passing in ipfs://SOME_HASH will return true in this function because that is a valid IPFS URI.
get(hash) Fetches data from storage. This method does not handle any deserialization. Its up to the caller to determine what the type of the data is.
getUploadToken(contractAddress) Fetches a one-time-use upload token that can used to upload a file to storage.
resolveFullUrl(hash) Resolves the full URL of a file for a given gateway.For example, if the hash of a file is ipfs://bafkreib3u2u6ir2fsl5nkuwixfsb3l4xehri3psjv5yga4inuzsjunk2sy, then the URL will be: “https://cloudflare-ipfs.com/ipfs/bafkreibnwjhx5s3r2rggdoy3hw7lr7wmgy4bas35oky3ed6eijklk2oyvq” if the gateway is cloudflare-ipfs.com.
upload(data, contractAddress, signerAddress) Uploads a file to the storage.
uploadBatch(files, contractAddress, uploadFileStartNumber) Uploads a folder to storage.
uploadMetadata(metadata, contractAddress, signerAddress) Uploads metadata to IPFS
uploadMetadataBatch(metadatas, contractAddress, fileStartNumber) Uploads metadata to IPFS