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

203
Visualizações
react web3 parse and store a transaction [receipt value] from returnValues

I have a minting Dapp in progress using Hashlips github repo. I've succesfully minted using the dapp and after the mint transaction is complete, I send the transaction receipt into the console log.

Inside the transaction receipt we have the events > transfer > returnValues. I want to read a specific return value and store that so I can use this value in another function.

Essentially inside returnValues I have stored a tokenID:'xnumberhere' and I need to use that for putting together images which I'll upload to IPFS.

How do I parse through receipt to save specific object data such as TokenID or even a parent such as blockNumber / blockHash

Current functions - see line 23/24 for logging the receipt

See this image of the console log where I want to retrieve tokenID

const claimNFTs = () => {
    let cost = CONFIG.WEI_COST;
    let gasLimit = CONFIG.GAS_LIMIT;
    let totalCostWei = String(cost * mintAmount);
    let totalGasLimit = String(gasLimit * mintAmount);
    console.log("Cost: ", totalCostWei);
    console.log("Gas limit: ", totalGasLimit);
    setFeedback(`Minting your ${CONFIG.NFT_NAME}...`);
    setClaimingNft(true);
    blockchain.smartContract.methods
      .mintNFT(mintAmount)
      .send({
        gasLimit: String(totalGasLimit),
        to: CONFIG.CONTRACT_ADDRESS,
        from: blockchain.account,
        value: totalCostWei,
      })
      .once("error", (err) => {
        console.log(err);
        setFeedback("Sorry, something went wrong please try again later.");
        setClaimingNft(false);
      })
      .then((receipt) => {
        console.log(receipt);
        setFeedback(
          `WOW, the ${CONFIG.NFT_NAME} is yours! go visit Opensea.io to view it.`
        );
        setClaimingNft(false);
        dispatch(fetchData(blockchain.account));
        getData();
      });
  };

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

To retrieve the events response of my Mint transaction, I used the following:

var tokenId = receipt.events.Transfer.returnValues.tokenId
        console.log("Your NFT ID is: " + receipt.events.Transfer.returnValues.tokenId); 

about 4 years ago · Juan Pablo Isaza Relatório
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