How does provider integration with web3 library work now?
In v6 web3 used to be part of the hook useWeb3React as Library
Then something like:
{library} = useWeb3React
Allowed us to (for example) sign a message:
library.eth.personal.sign(...)
Now when using the web3 library somewhat detached from the react-web3/core, the library does not have a provider.
signature error Error: Provider not set or invalid
at Object.InvalidProvider (errors.js:39:1)
at RequestManager.push.Fm6o.RequestManager.send (index.js:147:1)
at sendRequest (index.js:624:1)
at Personal.send [as sign] (index.js:656:1)
at _callee$ (web3Adapter.ts:8:1)
at tryCatch (runtime.js:63:1)
at Generator.invoke [as _invoke] (runtime.js:294:1)
at Generator.next (runtime.js:119:1)
at bn.js:3547:1
at new Promise (<anonymous>)
at push.vL4m.__awaiter (bn.js:3547:1)
at Object.web3Sign (web3Adapter.ts:3:1)
at _callee$ (authService.ts:83:1)
at tryCatch (runtime.js:63:1)
at Generator.invoke [as _invoke] (runtime.js:294:1)
at Generator.next (runtime.js:119:1)
at fulfilled (batch.js:72:1)
I tried using my library instance:
import web3 from 'web3'
new web3().setProvider(connector.provider)
But the types are incompatible.
TS2345: Argument of type 'Provider | undefined' is not assignable to parameter of type 'provider'. Type 'undefined' is not assignable to type 'provider'.
What is the v8 way to integrate the provider into other functions of the web3 lib?
Same issue here !
v8 doesn't support web3.js because it's based on ethers. Use ethers instead.
Sir please help me please how recovery my money fraud
On Thu, Aug 18, 2022 at 10:58 v 1 r t l @.***> wrote:
v8 doesn't support web3.js because it's based on ethers. Use ethers instead.
— Reply to this email directly, view it on GitHub https://github.com/Uniswap/web3-react/issues/580#issuecomment-1219158676, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYCRSP2DLZ2TGLVX4YRKFVDVZXUL3ANCNFSM5YYL2B6A . You are receiving this because you are subscribed to this thread.Message ID: @.***>
try const { provider } = useWeb3React();