Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Quick Start For Wallets Using Swift Client \(iOS\)
You can use the Example Dapp to test your integration at example.walletconnect.org (Source code)
This quick start is currently incomplete.
There are two swift clients available at the moment:
wallet-connect-swift maintained by Trust Wallet team
WalletConnectSwift maintained by Gnosis Safe team
Please check the repositories for more details.
Quick Start For Dapps using Standalone Client
You can use the Test Wallet to test your integration at test.walletconnect.org (Source code). Keep in mind that this is not a secure wallet - Do not store funds.
Syntax shown below is Javascript ES6 which requires bundling and transpiling to run in web browsers. If unfamiliar we recommend setting up an environment using Webpack Starter or Create React App
Quick Start For Wallets Using Kotlin Client \(Android\)
You can use the Example Dapp to test your integration at example.walletconnect.org (Source code)
This quick start is currently incomplete, please check the Github repository for this Client
Quick Start For Wallets Using React-Native Client
You can use the Example Dapp to test your integration at example.walletconnect.org (Source code)
Install NPM Package
Polyfill NodeJS modules for React-Native
Install NPM Package
Polyfill NodeJS modules for React-Native
Quick Start For Dapps using Web3 Provider
First, instantiate your WalletConnect web3-provider using the following options: Infura or Custom RPC mapping
Then you can integrate your dapp using your favorite Ethereum library: ethers.js or web3.js
After setting up your provider you should listen to EIP-1193 events to detect accounts and chain change and also disconnection.
In order to resolve non-signing requests you need to provide one of the following:
The infuraId will support the following chainId's: Mainnet (1), Ropsten (3), Rinkeby(4), Goerli (5) and Kovan (42)
The RPC URL mapping should be indexed by chainId and it requires at least one value.
You can also customize the connector through the provider using the following options
Use your own hosted bridge by providing the url
Use your own custom qrcode modal and disable the built-in one
If you would like to reduce the number of mobile linking options or customize its order, you can provide an array of wallet names
You can use the Test Wallet to test your integration at (). Keep in mind that this is not a secure wallet - Do not store funds.
Syntax shown below is Javascript ES6 which requires bundling and transpiling to run in web browsers. If unfamiliar we recommend setting up an environment using or
Quick Start For Dapps using React-Native
A drop-in library which helps easily connect your React Native dapps to Ethereum Wallets on Android, iOS and the Web.
Notice: This library assumes you have already enabled prerequisite support for Web3 inside your application. This can be done by creating a new project using
npx create-react-native-dapp
, or by introducing support for Web3 in an existing project by usingnpx rn-nodeify --install --hack
.
For more details, check out the documentation.
To get started, install @walletconnect/react-native-dapp
:
If you haven't already, you may also need to install react-native-svg
alongside a persistent storage provider such as @react-native-async-storage/async-storage
:
This library is implemented using the React Context API, which is used to help make an instance of a connector
accessible globally throughout your application. This permits you to use a uniform instance within even deeply nested components, and ensures your rendered application is always synchronized against the connector state.
WalletConnectProvider
At the root of your application, you can declare a WalletConnectProvider
which controls access and persistence to a connector instance:
Above, we pass the WalletConnectProvider
two required parameters; redirectUrl
and storageOptions
:
The redirectUrl
is used to help control navigation between external wallets and your application. On the web
, you only need to specify a valid application route; whereas on mobile platforms, you must specify a deep link URI scheme.
The storageOptions
prop allows you to specify the storage engine which must be used to persist session data.
Although in our examples we use @react-native-async-storage/async-storage
, this can be which engine you please, provided it conforms to the IAsyncStorage
generic storage interface declaration.
Notably, the WalletConnectProvider
optionally accepts WalletConnect
configuration arguments as defined by the IWalletConnectOptions
interface:
In the snippet above, aside from the required props, we can see the default configuration of the WalletConnectProvider
.
Tip: Your custom options are merged deeply against this default configuration. Therefore it's possible to override individual nested properties without being required to define all of them.
withWalletConnect
Alternatively to manually using the WalletConnectProvider
, you can use the withWalletConnect
higher order component which will wrap your root application in a WalletConnectProvider
for you:
This is almost identical in functionality to the manual implementation of a WalletConnectProvider
, with the key difference that we're able to make a call to useWalletConnect
directly from the App
component. By contrast, in the previous example only child components of the WalletConnectProvider
may be able to invoke this hook.
useWalletConnect
The useWalletConnect
hook provides access to a WalletConnect
connector
instance which is accessible on Android, iOS and the Web. This conforms to the original specification:
@walletconnect/react-native-dapp
also permits you to customize the presentation of the QrcodeModal
. This is achieved by passing the Render Callback prop, renderQrcodeModal
, to our calls to withWalletConnect
or instances of WalletConnectProvider
.
For example, you could choose to render a wallet selection using a BottomSheet
opposed to a Modal
: