Torus

The Torus Wallet provides a non-custodial OAuth-based wallet Web3 interface that works with an iframe, and allows you to integrate your dApp with your SKALE Chain.

Install the NPM Packages

npm install --save web3 @toruslabs/torus-embed

Example Code

import Torus from '@toruslabs/torus-embed';
import Web3 from 'web3';


// Your setup information
const endpoint = 'https://your.skale.endpoint'; // your SKALE Chain endpoint
const skaleChainId = 123456                     // Optional SKALE Chain chainId
const network = "SKALE Network";                // Optional network name

// Setting network
const torus = new Torus()
await torus.init(
    {
        network: {
            host: endpoint,
            chainId: skaleChainId,
            networkName: network
        }
    }
);
await torus.login(); // await torus.ethereum.enable()
const web3 = new Web3(torus.provider);