Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

264
Visualizações
TypeError: (0 , ipfs_1.uploadIpfsManifest) is not a function

My calls to uploadManifiest in MutationService keep failing with the error: info: Egg upgrade failed with error: TypeError: (0 , ipfs_1.uploadIpfsManifest) is not a function.

I'm not sure what the cause of this is, below my set up of the file causing the issue:

mutation.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;
}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda