@walletconnect/eth-provider
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

WalletConnect ETH Provider

ETH Provider for WalletConnect

For more details, read the documentation

Example

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

/**
 *  Create WalletConnect Provider (qrcode modal will be displayed automatically)
 */
const provider = new WalletConnectProvider({
  infuraId: "<INSERT_INFURA_APP_ID>",
});

/**
 *  Create Web3
 */
const web3 = new Web3(provider);

/**
 *  Get Accounts
 */
const accounts = await web3.eth.getAccounts();

/**
 * Send Transaction
 */
const txHash = await web3.eth.sendTransaction(tx);

/**
 * Sign Transaction
 */
const signedTx = await web3.eth.signTransaction(tx);

/**
 * Sign Message
 */
const signedMessage = await web3.eth.sign(msg);

/**
 * Sign Typed Data
 */
const signedTypedData = await web3.eth.signTypedData(msg);

/@walletconnect/eth-provider/

    Package Sidebar

    Install

    npm i @walletconnect/eth-provider

    Weekly Downloads

    85

    Version

    1.0.0

    License

    LGPL-3.0

    Unpacked Size

    964 kB

    Total Files

    12

    Last publish

    Collaborators

    • cyberdrk
    • nachosan
    • huxwell
    • chris13524
    • crypblizz
    • devceline
    • gancho_walletconnect
    • bkrem
    • pedrouid