2.5.5 • Published 23 days ago

@web3-onboard/walletconnect v2.5.5

Weekly downloads
-
License
MIT
Repository
github
Last release
23 days ago

@web3-onboard/walletconnect

Wallet module for connecting Wallet Connect to web3-onboard

Install

npm i @web3-onboard/core @web3-onboard/walletconnect

Options

type WalletConnectOptions = {
  /**
   * Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
   */
  projectId: string
  /**
   * Defaults to `appMetadata.explore` that is supplied to the web3-onboard init
   * Strongly recommended to provide atleast one URL as it is required by some wallets (i.e. MetaMask)
   * To connect with walletconnect
   */
  dappUrl?: string
  /**
   * List of Required Chain(s) ID for wallets to support in number format (integer or hex)
   * Defaults to [1] - Ethereum
   */
  requiredChains?: number[] | undefined
  /**
   * List of Optional Chain(s) ID for wallets to support in number format (integer or hex)
   * Defaults to the chains provided within the web3-onboard init chain property
   */
  optionalChains?: number[] | undefined
  /**
   * `undefined` by default, see https://docs.walletconnect.com/2.0/web/walletConnectModal/options
   */
  qrModalOptions?: EthereumProviderOptions['qrModalOptions']
  /**
   * Additional required methods to be added to the default list of ['eth_sendTransaction', 'personal_sign']
   * Passed methods to be included along with the defaults methods - see https://docs.walletconnect.com/2.0/advanced/providers/ethereum#required-and-optional-methods
   */
  additionalRequiredMethods?: string[] | undefined
  /**
   * Additional methods to be added to the default list of ['eth_sendTransaction',  'eth_signTransaction',  'personal_sign',  'eth_sign',  'eth_signTypedData',  'eth_signTypedData_v4']
   * Passed methods to be included along with the defaults methods - see https://docs.walletconnect.com/2.0/web/walletConnectModal/options
   */
  additionalOptionalMethods?: string[] | undefined
  /**
   * Optional function to handle WalletConnect URI when it becomes available
   */
  handleUri?: (uri: string) => Promise<unknown>
)

Usage

import Onboard from '@web3-onboard/core'
import walletConnectModule from '@web3-onboard/walletconnect'

const wcInitOptions = {
  /**
   * Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
   */
  projectId: 'abc123...',
  /**
   * Chains required to be supported by all wallets connecting to your DApp
   */
  requiredChains: [1],
  /**
   * Chains required to be supported by all wallets connecting to your DApp
   */
  optionalChains: [42161, 8453, 10, 137, 56],
  /**
   * Defaults to `appMetadata.explore` that is supplied to the web3-onboard init
   * Strongly recommended to provide atleast one URL as it is required by some wallets (i.e. MetaMask)
   * To connect with WalletConnect
   */
  dappUrl: 'http://YourAwesomeDapp.com'
}

// initialize the module with options
const walletConnect = walletConnectModule(wcInitOptions)

// can also initialize with no options...

const onboard = Onboard({
  // ... other Onboard options
  wallets: [
    walletConnect
    //... other wallets
  ]
})

const connectedWallets = await onboard.connectWallet()

// Assuming only wallet connect is connected, index 0
// `instance` will give insight into the WalletConnect info
// such as namespaces, methods, chains, etc per wallet connected
const { instance } = connectedWallets[0]

console.log(connectedWallets)
2.5.5

23 days ago

2.5.5-alpha.1

23 days ago

2.5.4

2 months ago

2.5.4-alpha.1

2 months ago

2.5.3

4 months ago

2.5.3-alpha.1

4 months ago

2.5.2

5 months ago

2.5.2-alpha.1

5 months ago

2.4.0-alpha.2

10 months ago

2.4.0-alpha.1

11 months ago

2.4.2-alpha.1

10 months ago

2.4.1

10 months ago

2.4.0

10 months ago

2.4.3

10 months ago

2.4.2

10 months ago

2.4.5

9 months ago

2.4.4

9 months ago

2.4.5-alpha.1

9 months ago

2.4.3-alpha.1

10 months ago

2.5.1-alpha.1

5 months ago

2.4.7-alpha.4

7 months ago

2.4.7-alpha.2

7 months ago

2.4.7-alpha.3

7 months ago

2.4.7-alpha.1

7 months ago

2.4.1-alpha.1

10 months ago

2.5.0

7 months ago

2.5.1

5 months ago

2.4.1-alpha.2

10 months ago

2.4.7

7 months ago

2.4.6

8 months ago

2.5.0-alpha.1

7 months ago

2.4.4-alpha.1

10 months ago

2.4.6-alpha.1

8 months ago

2.3.10-alpha.1

11 months ago

2.3.6-alpha.1

1 year ago

2.3.4-alpha.1

1 year ago

2.3.4-alpha.2

1 year ago

2.3.8-alpha.2

12 months ago

2.3.8-alpha.1

12 months ago

2.3.0-alpha.3

1 year ago

2.3.8

12 months ago

2.3.7

12 months ago

2.3.2-alpha.1

1 year ago

2.3.9

11 months ago

2.3.5-alpha.1

1 year ago

2.3.9-alpha.1

11 months ago

2.3.0

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

2.3.4

1 year ago

2.3.3

1 year ago

2.3.6

1 year ago

2.3.5

1 year ago

2.3.7-alpha.3

1 year ago

2.3.7-alpha.2

1 year ago

2.3.7-alpha.1

1 year ago

2.3.1-alpha.1

1 year ago

2.3.3-alpha.2

1 year ago

2.3.3-alpha.1

1 year ago

2.2.1-alpha.1

1 year ago

2.2.2-alpha.1

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.2.2

1 year ago

2.2.0-alpha.1

1 year ago

2.3.0-alpha.2

1 year ago

2.3.0-alpha.1

1 year ago

2.0.3-alpha.1

2 years ago

2.0.4-alpha.1

2 years ago

2.0.4-alpha.2

2 years ago

2.0.5-alpha.1

2 years ago

2.1.2

2 years ago

2.0.3

2 years ago

2.1.1

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.1.3

2 years ago

2.0.4

2 years ago

2.0.1-alpha.1

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.8

2 years ago

2.1.0

2 years ago

2.0.2-alpha.1

2 years ago

2.1.2-alpha.1

2 years ago

2.1.3-alpha.1

2 years ago

2.0.9-alpha.1

2 years ago

2.0.8-alpha.1

2 years ago

2.0.7-alpha.1

2 years ago

2.0.1-alpha

2 years ago

2.1.1-alpha.1

2 years ago

2.0.1

2 years ago

2.0.0-alpha.4

2 years ago

2.0.0

2 years ago

2.0.0-alpha.3

2 years ago

2.0.0-alpha.2

2 years ago

2.0.0-alpha.1

2 years ago