How to use the @toruslabs/torus-embed function in @toruslabs/torus-embed

To help you get started, we’ve selected a few @toruslabs/torus-embed 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 torusresearch / torus-embed / examples / vue-app / src / App.vue View on Github external
async login() {
      try {
        const torus = new Torus({
          buttonPosition: 'bottom-left'
        })
        window.torus = torus
        await torus.init({
          buildEnv: this.buildEnv,
          enabledVerifiers: {
            reddit: false
          },
          enableLogging: true,
          network: {
            host: 'rinkeby', // mandatory
            chainId: 4
          },
          showTorusButton: true
        })
        await torus.login() // await torus.ethereum.enable()
github AugurProject / augur / packages / augur-ui / src / modules / auth / actions / login-with-torus.ts View on Github external
export const loginWithTorus = () => async (
  dispatch: ThunkDispatch
) => {
  const networkId = getNetworkId();
  const torusNetwork = getTorusNetwork(networkId);
  let accountObject: Partial = {};

  if (torusNetwork) {
    const torus: any = new Torus({});

    try {
      await torus.init({
        network: { host: torusNetwork },
        showTorusButton: false,
      });

      await torus.login();

      const web3 = new Web3(torus.provider);
      const provider = new Web3Provider(torus.provider);
      const isWeb3 = true;
      windowRef.torus = torus;

      const accounts = await web3.eth.getAccounts();
      const account = accounts[0];
github torusresearch / torus-embed / examples / react-basic-app / src / helper.js View on Github external
initialize: async function() {
    const torus = new Torus()
    await torus.init()
    await torus.login()
    web3Obj.setweb3(torus.provider)
  }
}

@toruslabs/torus-embed

Embed script for Torus

MIT
Latest version published 9 months ago

Package Health Score

65 / 100
Full package analysis

Popular @toruslabs/torus-embed functions