GithubHelp home page GithubHelp logo

isabella232 / web3modal-vanilla-js-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from walletconnect/web3modal-vanilla-js-example

0.0 0.0 0.0 196 KB

An example application how to use Web3modal from vanilla JavaScript

JavaScript 65.26% HTML 34.74%

web3modal-vanilla-js-example's Introduction

This is a vanilla JavaScript example how to use Web3modal with different wallet providers.

The purpose of this example is how to connect a cryptocurrency wallet to a website that is build on traditional HTML technologies and does not use any modern JavaScript framework. Uses cases would include: static HTML sites, WordPress, content management systems, tutorials and education.

The example works with

  • In-browser wallets (MetaMask, Opera, Brave),

  • Mobile wallets through QR code scanning (WalletConnect)

  • Account-based wallets (Fortmatic, others)

The code uses simple unprocessed in-browser JavaScript. Dependencies, like the Web3Modal library itself, are loaded over Unpkg CDN. The code is extensively commented and short.

screenshot2

screenshot

What should I do with this

Web3modal) is a vendor-neutral project offering an easy integration of cryptocurrency and decentralised finance for websites. For example, you can use this to start accepting cryptocurrency payments on your site or to start building a decentralised finance application.

Support

Go to Web3modal main Github repository.

Reach to us in Web3modal Discord or open a Github issue.

Web3 wallets and HTTPS hosting limitations

Because of limitations how wallet operate within a web browser and web security, you should not run this example, or any Web3modal code, out of your file system or insecure HTTP protocol (even using localhost).

The APIs of different wallet providers may fail in funny and obscure way. MetaMask does not even show up if you load it over file:// protocol.

The easiest way to get local HTTPS development is to use https-localhost.

Assuming you have a working Node environment set up on a UNIX system you can do:

npm i -g --only=prod https-localhost
sudo serve .

... in the folder of index.html file.

Then you can visit https://localhost to open the example.

Publishing example on Github

To republish the example:

git push origin master:gh-pages

This will push index.html to https://web3modal.github.io/web3modal-vanilla-js-example/

web3modal-vanilla-js-example's People

Contributors

crisgarner avatar miohtama avatar octavioamu avatar pedrouid avatar polats avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.