import detectEthereumProvider from '@metamask/detect-provider'
const provider = detectEthereumProvider();
if (provider) {
console.log('Ethereum successfully detected!')
} else {
// if the provider is not detected, detectEthereumProvider resolves to null
console.error('Please install MetaMask!')
}
使用之前需要npm install @metamask/detect-provider
html使用欢迎分享,转载请注明来源:内存溢出
评论列表(0条)