Mis llamadas a uploadManifiest en MutationService siguen fallando con el error: información: La actualización de Egg falló con el error: TypeError: (0, ipfs_1.uploadIpfsManifest) no es una función .
No estoy seguro de cuál es la causa de esto, debajo de mi configuración del archivo que causa el problema:
mutación.ts
import { uploadManifest } from '../utils/ipfs'; export class MutationService { public async eggUpgrade(nftAddress: string) { try { const updatedManifest = this.addExchangeAttributes(manifest); const mediaUri = await this.uploadManifest(updatedManifest); logger.info(`mediaUri: ${JSON.stringify(mediaUri)}`); } catch (e) { logger.info(`Egg upgrade failed with error: ${e}`); return { success: false, tx_id: null }; } } async uploadManifest(manifest: any) { const manifestBuffer = Buffer.from(JSON.stringify(manifest)); return await uploadManifest( { projectId: process.env.IPFS_INFURA_PROJECT_ID as string, secretKey: process.env.IPFS_INFURA_SECRET as string, }, manifestBuffer, ); } }ipfs.ts
export async function uploadManifest( ipfsCredentials: IIpfsCredentials, manifestBuffer: Buffer, ) { const tokenIpfs = `${ipfsCredentials.projectId}:${ipfsCredentials.secretKey}`; const ipfs = create(INFURA_IPFS_URI as Options); const authIpfs = Buffer.from(tokenIpfs).toString('base64'); const manifestJson = JSON.parse(manifestBuffer.toString('utf8')); const manifestHash = await uploadToIpfs( ipfs, Buffer.from(JSON.stringify(manifestJson)), ); await fetch(`${INFURA_IPFS_API_URI}/pin/add?arg=${manifestHash}`, { headers: { Authorization: `Basic ${authIpfs}`, }, method: 'POST', }); await sleep(500); const link = `https://ipfs.io/ipfs/${manifestHash}`; logger.debug(`uploaded manifest: ${link}`); return link; }