Ethereum 无法进行令牌传输
我试图在ropsten上简单地将令牌从一个地址转移到另一个地址,但我一直遇到这个错误Ethereum 无法进行令牌传输,ethereum,web3,Ethereum,Web3,我试图在ropsten上简单地将令牌从一个地址转移到另一个地址,但我一直遇到这个错误 Returned error: The method eth_sendTransaction does not exist/is not available 代码如下: const cacheAddress_ = "0xDD963fCdD32ccC802470CdB85A634dE8A47E9257" const circulationAddress_ = "0x2dA320D8efF599f11Fe575
Returned error: The method eth_sendTransaction does not exist/is not available
代码如下:
const cacheAddress_ = "0xDD963fCdD32ccC802470CdB85A634dE8A47E9257"
const circulationAddress_ = "0x2dA320D8efF599f11Fe575124020743c9c2E8088"
var web3 = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/v3/API_KEY"))
async function transfer() {
const contract = new web3.eth.Contract(lvn.ABI, lvn.address)
const block = await contract.methods.transfer(circulationAddress_, new BigNumber(10**9*10**18)).send({ from: cacheAddress_ })
const circulationBalance = await contract.methods.balanceOf(circulationAddress_).call()
const cacheBalance = await getCacheBalance()
console.log({ circulationBalance, cacheBalance })
}
transfer()
我知道这不是infura的问题,infura肯定公开了进行事务所需的API。我用rinkeby在一个本地节点上进行了尝试,我也遇到了同样的问题。这不是的重复,因为web3.eth.personal.unlockAccount出现相同的错误,仍然显示为不可用(与上面的错误相同)
在此方面的任何帮助都将不胜感激
一个解决方案可能是,如果有人知道如何签署令牌转让(我知道如何签署常规eth交易,但不知道如何签署令牌转让)您使用的是什么版本的web3?除非最近发生了变化,否则Infura不支持
eth\u sendTransaction
。它不知道您的私钥,因此它不支持任何需要私钥的方法。