How to use walletconnect - 4 common examples

To help you get started, we’ve selected a few walletconnect examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WalletConnect / walletconnect-example-dapp / src / helpers / walletconnect.js View on Github external
import WalletConnect from "walletconnect";

const defaultConfig = {
  bridgeUrl: "https://test-bridge.walletconnect.org",
  dappName: "Example Dapp"
};

export let webConnector = new WalletConnect(defaultConfig);

/**
 * @desc Initiate WalletConnect Session
 * @return {Object}
 */
export async function walletConnectInitSession() {
  try {
    await webConnector.initSession();
  } catch (error) {
    console.error(error);
  }
}

/**
 * @desc Get WalletConnect Accounts
 * @return {Array}
github NoahZinsmeister / web3-react / src / connectors.js View on Github external
throw Error(`Required parameter 'providerURL' was not provided.`)
    if (typeof providerURL !== 'string')
      throw Error(`Passed 'providerURL' parameter ${providerURL} is not a string.`)
    if (!bridgeURL)
      throw Error(`Required parameter 'bridgeURL' was not provided.`)
    if (typeof bridgeURL !== 'string')
      throw Error(`Passed 'bridgeURL' parameter ${bridgeURL} is not a string.`)
    if (!dappName)
      throw Error(`Required parameter 'dappName' was not provided.`)
    if (typeof dappName !== 'string')
      throw Error(`Passed 'dappName' parameter ${dappName} is not a string.`)

    this.providerURL = providerURL
    this.bridgeURL = bridgeURL
    this.dappName = dappName
    this.webConnector = new WalletConnect({ bridgeUrl: this.bridgeURL, dappName: this.dappName })
  }
github balance-io / balance-manager / src / handlers / walletconnect.js View on Github external
export const walletConnectGetSession = async () => {
  const webConnector = new WalletConnect({ bridgeUrl, dappName });
  await webConnector.initSession();
  return webConnector;
};
github WalletConnect / walletconnect-example-dapp / src / helpers / walletconnect.js View on Github external
export async function walletConnectResetSession() {
  webConnector = new WalletConnect(defaultConfig);
}

walletconnect

WalletConnect SDK

Apache-2.0
Latest version published 3 years ago

Package Health Score

58 / 100
Full package analysis

Popular walletconnect functions