ethers.js 创建钱包,导入助记词,导入私钥)
npm install ethers@5.4.0
// 引入
import { ethers } from 'ethers'
创建新钱包
this.provider = new ethers.providers.Web3Provider(window.ethereum);
let wallet = ethers.Wallet.createRandom();
// wallet 创建以太坊钱包,助记词,私钥,地址
console.log('地址:', wallet.address);
console.log('私钥:', wallet.privateKey);
console.log('助记词:', wallet.mnemonic.phrase);