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)?