Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

273
Views
Web3.js: remitente no válido

Estoy tratando de hacer un programa para transferir a granel todos los nft de una billetera a otra. Sin embargo, parece que no puedo hacer que el proceso de firma funcione. Estoy tratando de usar un fragmento de código de este tutorial sobre cómo hacer esto, pero me da un error que dice:

 Error: Returned error: invalid sender at Object.ErrorResponse (C:\Users\x\Desktop) at C:\Users\x\Desktop\nft-transfer\node_modules\web3-core-requestmanager\lib\index.js:300:36 at XMLHttpRequest.request.onreadystatechange (C:\Users\Gibbo\Desktop\nft-transfer\node_modules\web3-providers-http\lib\index.js:98:13)

Código:

 async function transfer(token, tokenId) { const contract = new web3.eth.Contract(abi, token); const nonce = await web3.eth.getTransactionCount(publicKey); try { const tx = { from: publicKey, to: token, gas: web3.utils.toHex(gasPrice), value: 0, chainId: 4, nonce: nonce, chain: "rinkeby", baseChain: "rinkeby", hardfork: "berlin", data: contract.methods .transferFrom(publicKey, toAddress, tokenId) .encodeABI(), }; const signedTx = await web3.eth.accounts.signTransaction(tx, privateKey); const hash = await sendTx(signedTx); return hash; } catch (e) { console.log(e) } } const sendTx = (signedTx) => new Promise((resolve, reject) => { web3.eth.sendSignedTransaction(signedTx.rawTransaction, (err, hash) => { if (!err) { console.log('The hash of your transaction is: ', hash); return resolve(hash); } console.log( 'Something went wrong when submitting your transaction:', err, ); return reject(err); }); });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!