typescript-sdk

Home > @3rdweb/sdk > ModuleWithRoles > prepareMetadata

ModuleWithRoles.prepareMetadata() method

Prepares any set of metadata for uploading by recursively converting all Buffer|Blob|File objects into a hash of the object after its been uploaded to distributed storage (e.g. IPFS). After uploading any File|Buffer|Blob, the metadata is serialized to a string.

Signature:

prepareMetadata(metadata: MetadataURIOrObject): Promise<string>;

Parameters

Parameter Type Description
metadata MetadataURIOrObject The list of metadata to prepare for upload.

Returns:

Promise<string>