JSPM

@walletconnect/web3-provider

1.0.0-beta.26
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 24929
    • Score
      100M100P100Q14800F
    • License LGPL-3.0

    Web3 Provider for WalletConnect

    Package Exports

    • @walletconnect/web3-provider

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@walletconnect/web3-provider) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    WalletConnect Web3 Provider

    Web3 Provider for WalletConnect

    For more details, read the documentation

    Example

    import Web3 from "web3";
    import WalletConnectProvider from "@walletconnect/web3-provider";
    
    /**
     *  Create WalletConnect Provider (qrcode modal will be displayed automatically)
     */
    const provider = new WalletConnectProvider({
      bridge: "https://bridge.walletconnect.org" // Required
    });
    
    /**
     *  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);