还有另外的问题啊,需要用到WalletConnectProvider 这个库,不知道怎么引用,下面的就会出来一大堆错误。
麻烦大佬帮我看看。
import * as web3Modal from ‘web3modal’;
import WalletConnectProvider from “@walletconnect/web3-provider/dist/cjs/index.js”; //这句和这个都不行"import WalletConnectProvider from “@walletconnect/web3-provider”; //已经npm 引入了
const providerOptions = {
walletconnect: {
package: WalletConnectProvider, // required
options: {
infuraId: "bb8e8583fc324bcdb1ba2e6a5294e098", // required
},
},
};
let web3Modalx = new web3Modal.default.ProviderController({
network:"mainnet",
cacheProvider:true,
providerOptions:providerOptions,
disableInjectedProvider:false
});