web-examples
web-examples copied to clipboard
can i use walletconnect on browser(pure javascript)
hello. can i use on browser? Are there any examples? I tried to import the packages but I failed.
<script type="module">
import { Core } from 'https://unpkg.com/@walletconnect/core'
</script>
<script type="module">
import { Web3Wallet } from 'https://unpkg.com/@walletconnect/web3wallet'
</script>
<script type="text/javascript">
const core = new Core({
projectId: 'ggggggggggggggggggggggg'
})
const metadata = {
name: 'gggggg-3',
description: 'AppKit Example',
url: 'https://web3modal.com', // origin must match your domain & subdomain
icons: ['https://avatars.githubusercontent.com/u/37784886']
}
const web3wallet = await Web3Wallet.init({
core, // <- pass the shared 'core' instance
metadata
})
</script>
error on console:
Uncaught SyntaxError: The requested module 'https://unpkg.com/@walletconnect/core' does not provide an export named 'Core' (at test.html:2:12)
Uncaught SyntaxError: The requested module 'https://unpkg.com/@walletconnect/web3wallet' does not provide an export named 'Web3Wallet' (at test.html:6:12)
We don't officially support CDN ATM
too bad.
You can use Vite which supports HTML projects