[英]How can I connect to a Metamask wallet using ethers.js from a standalone node.js application?
我不知道該怎么做。 我看過一些關於 ethers.Wallet.fromMnemonic 的文檔,但是 ethers 如何知道我的錢包是元掩碼錢包? 或者,如果錢包提供商無關緊要(是嗎?),它如何知道其地址?
然后我想與 BSC 上的流動性池進行交互有什么不同嗎? 我的意思是在錢包方面。 錢包可以在 multiple.networks 上使用嗎?
var web3 = require("web3")
var ethers = require("ethers")
async function MetaMask() {
privateKey = "Your wallet privateKey";
account = new ethers.Wallet(privateKey)
console.log(account)
//from mnemonic
mnemonic = "Your Mnemonic"
const wallet = new ethers.Wallet.fromMnemonic(mnemonic)
console.log(wallet)
}
MetaMaskAddress = MetaMask()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.