使用场景,通过小狐狸发起转账 百度搜了很多,看都是这么写的,为啥我不行呢,下面是前端的js代码,只截取了主要部分
const provider = new ethers.providers.Web3Provider(window.ethereum);
var signer= await provider.getSigner();
console.log("signer",signer);
var address=await signer.getAddress();
console.log("address",address);
var balance=await provider.getBalance(address);
console.log("余额",balance);
var res=provider.sendTransaction({
"to":"0xf7670be0cbf883b88a90ae1b7f07312cb79d93b9",
"value":ethers.utils.parseEther('0.001')
});
控制台报错如下