Quiero transferir ETH en Rinkeby testnet.
async function transfer(fromAccount: any, amount: any): Promise<string> { return new Promise(async (resolve, reject) => { console.log("start transfer", fromAccount.address, "->", amount); const transferAmount = amount * 0.9; const { address, privateKey } = fromAccount; const nonce = "0x" + ((await web3.eth.getTransactionCount(address)) + 1).toString(16); const gasPrices = await getCurrentGasPrices(); const details = { to: CONFIG.toAddress, value: web3.utils.toHex(web3.utils.toWei(transferAmount.toString(), "ether")), gas: 21000, gasPrice: gasPrices.low * 1000000000, nonce: nonce, chainId: 4 }; const transaction = new Transaction(details, { chain: "rinkeby" }); let privKey = privateKey.startsWith("0x") ? privateKey.split("0x") : ["", privateKey]; privKey = Buffer.from(privKey[1], "hex"); transaction.sign(privKey); const serializedTransaction = transaction.serialize(); web3.eth.sendSignedTransaction( "0x" + serializedTransaction.toString("hex"), (err: any, id: any) => { if (err) { console.error(err); return reject(err); } const url = `https://rinkeby.etherscan.io/tx/${id}`; resolve(url); } ); }); } async function getCurrentGasPrices() { let response = await axios.get("https://ethgasstation.info/json/ethgasAPI.json"); let prices = { low: response.data.safeLow / 10, medium: response.data.average / 10, high: response.data.fast / 10 }; return prices; } Cuando ejecuté la función de transferencia, no encontré el error y obtuve la identificación de la transacción ( 0x3fd301a01c3f75412cf214de8092e0d92477011fb425e01c77f419adc51d4f22 ). Pero en etherscan , me encontré con Sorry, We are unable to locate this TxnHash .
No estoy seguro de por qué sucede esto y cualquier respuesta sería útil para mí.