1

I'm getting a

The MetaMask Web3 object does not support synchronous methods like eth_gasPrice without a callback parameter.

even though I'm providing that callback parameter:

web3.eth.gasPrice((err, gasPrice) => {
  if (err) {
    console.log(err)
  } else {
    store.dispatch('pollWeb3', {gasPrice: gasPrice})
  }
})

According to the doc this should be working. Am I mistaken?

4

1 回答 1

1

在我提交问题的那一刻...

如果与回调一起使用,方法名称必须是 web3.eth。获取天然气价格(...

于 2018-07-21T01:01:02.217 回答