Skip to content

Instantly share code, notes, and snippets.

@pedrouid
Last active July 7, 2019 21:59
Show Gist options
  • Select an option

  • Save pedrouid/ce4c35ad587e84167cb01febdd2d3d7d to your computer and use it in GitHub Desktop.

Select an option

Save pedrouid/ce4c35ad587e84167cb01febdd2d3d7d to your computer and use it in GitHub Desktop.
Integrating Web3Connect with Core Module
import Web3Connect from "web3connect";
const web3Connect = new Web3Connect.Core({
providerOptions: {
portis: {
id: "PORTIS_ID", // required
network: "mainnet" // optional
},
fortmatic: {
key: "FORTMATIC_KEY", // required
network: "mainnet" // optional
}
}
});
// subscribe to connect
web3Connect.on("connect", (provider: any) => {
const web3 = new Web3(provider); // add provider to web3
});
// subscribe to close
web3Connect.on("close", () => {
console.log("Web3Connect Modal Closed"); // modal has closed
});
web3Connect.toggleModal(); // open modal on button click
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment