Hello ethereum experts,
I got the following error in the Chrome's Javascript Console:
ethereum_web3.js?hash=ee8d37819d18de934b202361e374522a33bbd060:3783 Uncaught TypeError: Cannot create property 'from' on string..
I'm on an MacOS(10.12.6) and using using Meteor (1.5) + Metamask. I started geth(1.6.7-stable) with the following commandline: geth --datadir "net_a" --networkid 1234 --rpc --rpcport "8545" --rpccorsdomain "*" --rpcapi "eth,net,web3,personal" console 2>console.log
And the followings are my attempt to send a transaction:
// Transaction object
var tnxObj = '{from: "'+fromAddr+'", to: "'+toAddr+'", value: "' + amount + '"}';
web3.personal.unlockAccount(fromAddr, "pwd123", function(err, result) {
if (err != null) {
console.error("Error while unlocking account: "+err);
}
else{
console.log("Account unlocked!");
web3.eth.sendTransaction({tnxObj} , function(err, result) {
if (err != null) {
console.error("Error while sending transaction: "+err);
}
else{
console.log("Transaction Sent!");
}
});
}
});
Any idea what I did wrong?