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

431
Views
Cómo enviar NFT ya acuñado usando alquimia

He acuñado algunos NFT en mar abierto. Estos están en la red Polygon Mumbai. Ahora quiero transferirlos al token a otras direcciones usando alchemy web3. Aquí está el código que estoy usando.

Nota : se supone que esto se ejecuta en la API tranquila de nodejs, por lo que no hay una billetera disponible, por eso estoy firmando manualmente la transacción.

 async function main() { require('dotenv').config(); const { API_URL,API_URL_TEST, PRIVATE_KEY } = process.env; const { createAlchemyWeb3 } = require("@alch/alchemy-web3"); const web3 = createAlchemyWeb3(API_URL_TEST); const myAddress = '*************************' const nonce = await web3.eth.getTransactionCount(myAddress, 'latest'); const transaction = { //I believe transaction object is not correct, and I dont know what to put here 'asset': { 'tokenId': '******************************',//NFT token id in opensea }, 'gas': 53000, 'to': '***********************', //metamask address of the user which I want to send the NFT 'quantity': 1, 'nonce': nonce, } const signedTx = await web3.eth.accounts.signTransaction(transaction, PRIVATE_KEY); web3.eth.sendSignedTransaction(signedTx.rawTransaction, function(error, hash) { if (!error) { console.log("🎉 The hash of your transaction is: ", hash, "\n Check Alchemy's Mempool to view the status of your transaction!"); } else { console.log("❗Something went wrong while submitting your transaction:", error) } }); } main();
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Asumió que tiene Metamask instalado en su navegador y que el contrato inteligente NFT sigue el estándar ERC721

 const { API_URL,API_URL_TEST, PRIVATE_KEY } = process.env; const { createAlchemyWeb3 } = require("@alch/alchemy-web3"); const {abi} = YOUR_CONTRACT_ABI const contract_address = CONTRACT ADDRESS require('dotenv').config(); async function main() { const web3 = createAlchemyWeb3(API_URL_TEST); web3.eth.getAccounts().then(accounts => { const account = account[0] const nameContract = web3.eth.Contract(abi, contract_address); nameContract.methods.transfer(account, ADDRESS_OF_WALLET_YOU_WANT_TO_SEND_TO, TOKEN_ID).send(); }) .catch(e => console.log(e)); } main();
over 4 years ago · Santiago Trujillo Report
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!