Iâve made the code to send eth moralis using the video tutorial https://youtu.be/suZYvqrc_Hg but the code doesnât work can anyone explain
Can you share your code that you wrote?
You will also have to add await Moralis.enableWeb3()
now to your code before calling Moralis.transfer, this is something that changed in Moralis SDK since that tutorial was filmed.
Did you get any errors in your browser console?
You should see something like:
Uncaught Error: Missing web3 instance, make sure to call Moralis.enableWeb3() or Moralis.authenticate()
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
claim eth
That doesnât look like the code for a button.
I have the same error. I used the vue starter template and the problem arises when I refresh the page, the user stays âlogged inâ but the calls to the contracts not going trough. Calling await Moralis.enableWeb3()
before the executeFunction doesnât solve the issue. In that case it says:
TypeError: Cannot read properties of null (reading âonâ)
when i put await Moralis.authenticate()
before the executeFunction it works but that brings up the authentication page after each refresh.
any idea how to keep the user âreallyâ authenticated?
FYI: when i try to access moralis.User.current()
after refresh it logs the user for me, however the _localId field is undefined and when I log the user after authentication that field is not present.
maybe this error is related to recent update to the sdk: Moralis JS-SDK v1.0.0 [beta] (Ethers.js support)