Ok, Iām trying to break out a web3 provider/signer to sign gener[ic || ated] transactions on Matic.
This looks like fun:
useEffect(() => {
Moralis.web3Library
.then((e) => new e.providers.Web3Provider(window.ethereum))
.then((p) => {
setProvider(p);
return provider.getSigner();
})
.then((s) => {
setSigner(s);
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [Moralis.web3Library]);
But for various reasons like Moralis.web3Library not actually returning the promise I was expecting in this configuration: not as fun as I wanted.
Any ideas to get me there? Obviously Iām trying to initialize the provider and its signer then store them away for later use in the component.