Self hosted Moralis V1, how to use wallet connect v2 with vanilla js

I am using a Self Hosted Moralis V1, and I am trying to use wallet connect v2 and there’s this guide

But I am trying to find a solution to do it using Vanilla JS, becuz I have a django app and I am only using vanilla js and server rendering in the app

hello, does this demo help you?

Hello, No it does not as i mentionned, i need a way to integrate the same solutions but using vanilla JS

Did you read that code? that code doesn’t work with vanilla JS? at a first look it looks like a normal html file that includes a js file

Exactly my point, to simplify the problem furthermore, let’s just forget about that GitHub link, I need a vanilla js solution to integrate my self-hosted Moralis V1 and WalletConnect v2. specially that there’s 2 dependencies that their are no CDNs for that are @walletconnect/ethereum-provider and @web3modal/standalone

My understanding is that the GitHub tutorial builds a bundle that you can host as a static file and import it in your vanilla js code.

1 Like

is there a tutorial or some kind of step by step documentation to do that?

That tutorial is made before wallet connect v2 was integrated in the sdk, it could be easier now to use it with the sdk.

1 Like

i am sorry, i know my questions may seem stupid.

but how to do that? Thank you so much, is there documentation for it?

I don’t know exactly now, I’m not at computer now. Did you try to use the last version of the sdk?

Yes, but it’s not working!

What happens when it is not working?

give me 5 mins i’ll send you the error!

Did you use authenticate with similar parameters as here?

HERE’S the full code

and here’s the error

“Uncaught (in promise) Error: Cannot enable via WalletConnect: dependency “@walletconnect/ethereum-provider” is missing”

You need to do some changes:

	<script src="https://cdn.jsdelivr.net/npm/@walletconnect/[email protected]/dist/index.umd.js"></script>
	<script>window.WalletConnectProvider = window['@walletconnect/ethereum-provider'];</script>
    <moralis-sdk>
1 Like

Thank Youuuuuuuu so much, it worked.
I’ll keep you updated.

1 Like

i did integrate it, and it’s working fine, but when I auth by scanning the code, this errors occur

  1. htttp://localhost:1337/server/users 404 (Not Found)
  2. Uncaught (in promise) Error: Moralis auth failed, invalid data at handleError (Moralis.js:27019:17)

here’s the error from the moralis parse dashboard server that i self hosted

error: Moralis auth failed, invalid data {“code”:101,“stack”:“Error: Moralis auth failed, invalid data\n at /elevatex/projects/parse-server-migration/build/auth/MoralisEthAdapter.js:33:15\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async Promise.all (index 0)”}

what is the data format that was sent to the server (message and signature)?