Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

205
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda