MoralisFile Upload using ERC1155 substitution

Hello,

I am using code similar to the following.

In ERC1155, token substitution is used.

Moralis File doesn’t seem suited to handle these types of uploads.

// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string private _uri;

How would anyone handle this scenario? ERC1155 has fixed url and incremented tokenId.

How do i match my token metadata to the upload path? I assume i upload first, then mint the token.


 const file = {
                base64: btoa(JSON.stringify(json_obj)),
              };
              saveFile("something.json", file, {
                saveIPFS: true,
                onComplete: () => {
                  console.log("Complete");
                },
                onSuccess: (res: any) => {
                  console.log("Success");
                  console.log(res);
                },
                onError: (err: any) => {
                  console.log("Error");
                  console.log(err);
                },
              });

Regards,

Daniel

One option is to use upload folder functionality to upload all the metadata(json) files to IPFS with the same prefix, you can find that in web3api tab in admin interface