as you see in below, i the raw transaction has been set by the gas simplify value, the returned value is an implemented transaction hashcode, but never assumed result by this transaction figure out
function sendTransaction(_privateKey,_from,_to,_value)
{
return new Promise(function(resolve,reject){
try {
web3.eth.getBlock("latest", false, (error, result) => {
var _gasLimit = result.gasLimit;
web3.eth.getGasPrice(function(error,result){
var _gasPrice = result;
const Tx = require('ethereumjs-tx');
const privateKey = Buffer.from(_privateKey, 'hex')
var _hex_gasLimit = web3.utils.toHex(_gasLimit.toString());
var _hex_gasPrice = web3.utils.toHex(_gasPrice.toString());
var _hex_value = web3.utils.toHex(web3.utils.toWei(_value,'ether'));
var _trx_count = web3.eth.getTransactionCount(_from);
var _hex_Gas = web3.utils.toHex('50000');
const rawTx = {
nonce: web3.utils.toHex(web3.eth.getTransactionCount(_from)),
to: _to,
from:_from,
gasLimit:_hex_gasLimit,
gas:50000,
gasPrice:_hex_gasPrice,
value: _hex_value,
data: '0x00'
}
const tx = new Tx(rawTx);
tx.sign(privateKey);
var serializedTx = '0x'+tx.serialize().toString('hex');
web3.eth.sendSignedTransaction(serializedTx.toString('hex'),function(err,hash){
if(err)
{
resolve(err);
}
else
{
resolve('Txn Sent and hash is '+hash);
}
});
});
});
} catch (error) {
resolve(error);
}
})}
here is a returned transaction hash code
0xa1338065afcfa20e4062a25892d79ad7137af2b631fc15c4a37977938562396c
as you see the two first transaction resolved as soon as possible and under the 1 hour thank you again
– Hamid Jolany May 28 '19 at 19:17