This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Readable } = require("stream"); | |
const buffer = await getWnft(args, { size: IMAGE_SIZE }); // returns Buffer | |
const fileData = Readable.from(buffer) | |
// we are calling the function below with `fileData: buffer` | |
static async uploadFileToIPFS({ fileData, metadata = {} }) { | |
const pinataOptions = { | |
cidVersion: PINATA_CID_VERSION, | |
wrapWithDirectory: false, |