skalenetwork / docs.skale.space

https://docs.skale.space/
MIT License
0 stars 2 forks source link

Using Wallet Connect #35

Closed manuelbarbas closed 4 months ago

manuelbarbas commented 9 months ago

Wallet Connect

The Wallet Connect is an open source protocol to link dApps to mobile wallets using deep linking, and allows you to integrate your dApp with SKALE.

For more information and support, see https://docs.walletconnect.com/getting-started

Install NPM Packages

npm install --save web3 @walletconnect/web3-provider

Example Code

import WalletConnectProvider from "@walletconnect/web3-provider";
import Web3 from 'web3';

// Your setup information
const endpoint = 'https://your.skale.endpoint';             // your SKALE Chain endpoint
const ethereumEndpoint = 'https://your.ethereum.endpoint'   // your Ethereum endpoint
const skaleChainId = 123456                                 // chainId of your SKALE Chain

const provider = new WalletConnectProvider({
    rpc: {
      skaleChainId: endpoint,
      4: ethereumEndpoint
    }
  });
  await provider.enable();
  const web3 = new Web3(provider);

Example Sandbox

https://codesandbox.io/s/wallet-connect-wallet-integration-skale-dev-docs-forked-5xq08

manuelbarbas commented 8 months ago

What is: Wallet Language: Javascript, Typescript, Flutter, Swift, Kotlin Target: Web, Mobile