im using web3j with angular 5 connection working perfectly and balance showing perfectly. but when i write transfer function it throw error
var tx = this._web3.eth.sendTransaction({
from: this._account,
gasPrice: "20000000000",
gas: "21000",
to: textetheraddress,
value: textetheramount,
data: ""
}).then(function(err, transactionHash) {
if (!err)
console.log(transactionHash);
});
error
ERROR Error: The MetaMask Web3 object does not support synchronous methods like personal_newAccount without a callback parameter. See https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md#dizzy-all-async—think-of-metamask-as-a-light-client for details.
Best Answer
You are trying to make a synchronous call and expect to receive a promise.
It's probably just exactly as the error says:
Since sync functions are not supported you need to use the async one.
So I suppose in this case your code needs to pass a callback instead of waiting for a promise and should look something like this: