@@ -19,12 +19,12 @@ import dynamic from "next/dynamic";
1919// @ts -ignore
2020// const ethProvider = dynamic(() => import('eth-provider'), { ssr: false })
2121// @ts -ignore
22- // const MewConnect = dynamic(() => import('@myetherwallet/mewconnect-web-client'), { ssr: false })
22+ const MewConnect = dynamic ( ( ) => import ( '@myetherwallet/mewconnect-web-client' ) , { ssr : false } )
2323
2424// @ts -ignore
2525// const WalletConnect = dynamic(() => import('@walletconnect/web3-provider'), { ssr: false })
2626// @ts -ignore
27- // const Torus = dynamic(() => import('@toruslabs/torus-embed'), { ssr: false })
27+ const Torus = dynamic ( ( ) => import ( '@toruslabs/torus-embed' ) , { ssr : false } )
2828// @ts -ignore
2929// const WalletLink = dynamic(() => import('walletlink'), { ssr: false })
3030
@@ -45,11 +45,11 @@ export default function WalletConnectWidget() {
4545 const [ selectedInstance , setSelectedInstance ] = useState ( null as any ) ;
4646
4747 const [ web3Modal , setWeb3Modal ] = useState ( null as any ) ;
48- const [ ethProvider , setEthProvider ] = useState ( null as any ) ;
49- const [ mewConnect , setMewConnect ] = useState ( null as any ) ;
50- const [ walletConnect , setWalletConnect ] = useState ( null as any ) ;
51- const [ torus , setTorus ] = useState ( null as any ) ;
52- const [ walletLink , setWalletLink ] = useState ( null as any ) ;
48+ // const [ethProvider, setEthProvider] = useState(null as any);
49+ // const [mewConnect, setMewConnect] = useState(null as any);
50+ // const [walletConnect, setWalletConnect] = useState(null as any);
51+ // const [Torus , setTorus] = useState(null as unknown as Torus );
52+ // const [walletLink, setWalletLink] = useState(null as any);
5353
5454 useEffect ( ( ) => {
5555 // if (!ethProvider) {
@@ -79,15 +79,15 @@ export default function WalletConnectWidget() {
7979 // console.log('Error while creating Web3Modal');
8080 // }
8181 // }
82- if ( ! torus ) {
83- try {
84- import ( "@toruslabs/torus-embed" ) . then ( Torus => {
85- setTorus ( Torus )
86- } )
87- } catch ( e ) {
88- console . log ( 'Error while creating Web3Modal' ) ;
89- }
90- }
82+ // if (!Torus ) {
83+ // try {
84+ // import("@toruslabs/torus-embed").then(Torus => {
85+ // setTorus(Torus)
86+ // })
87+ // } catch (e) {
88+ // console.log('Error while creating Web3Modal');
89+ // }
90+ // }
9191
9292 // if (!walletLink) {
9393 // try {
@@ -134,7 +134,7 @@ export default function WalletConnectWidget() {
134134 } ) ;
135135 } ;
136136
137-
137+ console . log ( 'torus:: ' , Torus )
138138 const getProviderOptions = ( ) => {
139139 const chainId : ChainId = 1 ;
140140 const networkConfig = getNetworkConfig ( chainId ) ;
@@ -153,17 +153,30 @@ export default function WalletConnectWidget() {
153153 preferredNetworkId : chainId ,
154154 }
155155 } ,
156+ torus : {
157+ package : Torus ,
158+ // options: {
159+ // chainId,
160+ // initOptions: {
161+ // network: {
162+ // host: chainId === ChainId.polygon ? 'matic' : chainId,
163+ // },
164+ // showTorusButton: false,
165+ // enableLogging: false,
166+ // enabledVerifiers: false,
167+ // }
168+ // }
169+ } ,
156170 // torus: {
157- // package: torus,
171+ // package: Torus, // required
158172 // options: {
159- // chainId,
160- // initOptions: {
161- // network: {
162- // host: chainId === ChainId.polygon ? 'matic' : chainId,
163- // },
164- // showTorusButton: false,
165- // enableLogging: false,
166- // enabledVerifiers: false,
173+ // networkParams: {
174+ // host: "https://localhost:8545", // optional
175+ // chainId: 1337, // optional
176+ // networkId: 1337 // optional
177+ // },
178+ // config: {
179+ // buildEnv: "development" // optional
167180 // }
168181 // }
169182 // },
@@ -176,19 +189,19 @@ export default function WalletConnectWidget() {
176189 }
177190 } ,
178191 // mewconnect: {
179- // package: mewConnect , // required
192+ // package: MewConnect , // required
180193 // options: {
181194 // url:
182195 // networkConfig.privateJsonRPCWSUrl ||
183196 // networkConfig.privateJsonRPCUrl ||
184197 // networkConfig.publicJsonRPCWSUrl ||
185198 // networkConfig.publicJsonRPCUrl[0],
186- // windowClosedError: true,
199+ // // windowClosedError: true,
187200 // }
188201 // },
189202 frame : {
190203 package : ethProvider , // required
191- options : { supportedChainIds }
204+ // options: { supportedChainIds }
192205 }
193206 } ;
194207 return providerOptions ;
@@ -220,8 +233,8 @@ export default function WalletConnectWidget() {
220233
221234
222235 const provider = new ethers . providers . Web3Provider ( instance ) ;
223- setSelectedProvider ( provider ) ;
224- setSelectedInstance ( instance ) ;
236+ // setSelectedProvider(provider);
237+ // setSelectedInstance(instance);
225238 }
226239 } ;
227240
0 commit comments