我正在尝试为rinkeby广播构建的交易。Web3似乎总是返回错误,有时是
gas 资金不足 * 价格 + 价值
和其他时间
气体限制太高
var Web3 = require("web3")
var web3 = new Web3("https://rinkeby.infura.io/TOKEN")
var privateKey =
"PRIVATE_KEY"
var tx = {
chainId: 4,
from: "22dd8860db83a962e8d2ec734eae62fab63e73ae",
gas: "128028",
gasPrice: web3.utils.toWei("0.00000002", "ether"),
nonce: "0x0",
to: "0x8a09e76a5255E3d07854647f4DBef7323F98323d",
value: web3.utils.toWei(".000001", "ether")
}
var signed = web3.eth.accounts.signTransaction(tx, privateKey)
web3.eth.sendSignedTransaction(signed.rawTransaction).then(console.log)
未处理的拒绝错误:返回错误:gas 资金不足 * 价格 + 价值