Aharonla / Tea-Presale-Front

0 stars 0 forks source link

metamask/sdk not connecting #23

Closed SorooshDeveloper closed 7 months ago

SorooshDeveloper commented 7 months ago

I have problem connecting metamask sdk and also balance not showing (sometimes it works and its unstable)

shows me this error image

error is at this line : image

i didn't have any issues with my recommended tech stack on any etherum or bsc network.

Aharonla commented 7 months ago

@SorooshDeveloper
See documentation https://docs.ethers.org/v6/getting-started/#starting-glossary
Metamask-SDK docs: https://docs.metamask.io/wallet/how-to/use-sdk/javascript/ Another great way to find information and help is ethereum stack exchange https://ethereum.stackexchange.com/

SorooshDeveloper commented 7 months ago

@Aharonla ok

and what is the plan for wallet connect button?

Aharonla commented 7 months ago

@SorooshDeveloper What do you mean? The color of the button? You fixed it and I merged it. What else is wrong with it?

SorooshDeveloper commented 7 months ago

@Aharonla i mean this : image

what library this will be worked with ? and also im currently working on metamask/sdk and had no success on fixing this also why you didnt use metamask- react sdk ?

SorooshDeveloper commented 7 months ago

@Aharonla using bare metamask-sdk with no caching causes this errors that will hugely impact user experience of app using my recommended tech stak handles all kinds of issues like this and will save huge amount of time for us.

and this will only load user balance when app is launched and we don't have control on this.

image

Aharonla commented 7 months ago

@SorooshDeveloper

@Aharonla i mean this :

Remove it. We only need metamask.

using bare metamask-sdk with no caching causes this errors that will hugely impact user experience of app

This has nothing to do with anything. This error is caused by using a public Alchemy API key. You should add a designated API key to avoid this error.
If you scroll up in the console you should see this message:

צילום מסך 2024-03-28 221817

This would have happened with any SDK if no designated Alchemy API was used.
To get an API key for Alchemy follow this link: https://auth.alchemy.com/signup?redirectUrl=https%3A%2F%2Fdashboard.alchemy.com
Then go to apps -> + Create new app and create an API key (You should get two - one for sepolia for testing and one for mainnet for production).

Good luck!