IpfsStorage class
IPFS Storage implementation, accepts custom IPFS gateways
Signature:
export declare class IpfsStorage implements IStorage
Implements: IStorage
Remarks
By default, thirdweb automatically uploads files to IPFS when you perform operations such as minting, this class allows you to do it manually.
Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(gatewayUrl, uploader) | Constructs a new instance of the IpfsStorage class |
Methods
| Method | Modifiers | Description |
|---|---|---|
| get(hash) | Fetches data from storage. This method expects to fetch JSON formatted data | |
| getRaw(hash) | Fetches data from storage. This method does not make any assumptions on the retrieved data format | |
| upload(data, contractAddress, signerAddress, options) | Upload a file to IPFS and return the hash | |
| uploadBatch(files, fileStartNumber, contractAddress, signerAddress, options) | Uploads a folder to storage. | |
| uploadMetadata(metadata, contractAddress, signerAddress, options) | Uploads JSON metadata to IPFS | |
| uploadMetadataBatch(metadatas, fileStartNumber, contractAddress, signerAddress, options) | Uploads JSON metadata to IPFS |