Introduction
The Web3Wallet SDK allows you to easily connect your Web3 wallet with dapps. It provides a simple and intuitive interface for dapps to request actions such as signing transactions and interacting with smart contracts on the blockchain. The SDK is designed to work with any blockchain, making it easy to support multiple chains without the need for separate integration code.
Features​
Some of the key features of the Web3Wallet SDK include:
- Sign API: Allows dapps to request that the user sign a transaction or message.
- Auth API: Allows dapps to verify wallet address ownership through a single signature request, realizing login in one action.
- Chain agnostic: The Web3Wallet SDK is designed to work with any blockchain, so you can easily support multiple chains without having to write separate integration code.
Getting Started​
To get started with the Web3Wallet SDK, choose the programming language you'll be using to build your project. The SDK is available in JavaScript, Swift, Kotlin, Flutter, and C# so you can choose the language that best fits your development needs.
Installation​
- Web
- iOS
- Android
- Flutter
- React Native
- C#
Install the Web3Wallet SDK using npm or yarn.
- npm
- Yarn
- Bun
- pnpm
npm install @walletconnect/web3wallet
yarn add @walletconnect/web3wallet
bun add @walletconnect/web3wallet
pnpm add @walletconnect/web3wallet
WalletConnect SDK is available via Swift Package Manager or Cocoapods.
- SwiftPackageManager
- Cocoapods
You can add a WalletConnect SDK to your project with Swift Package Manager. In order to do that:
- Open XCode
- Go to File -> Add Packages
- Paste the repo GitHub URL: https://github.com/WalletConnect/WalletConnectSwiftV2
- Tap Add Package
- Select WalletConnect check mark
- Update Cocoapods spec repos. Type in terminal
pod repo update
- Initialize Podfile if needed with
pod init
- Add pod to your Podfile:
pod 'WalletConnectSwiftV2'
- Install pods with
pod install
If you encounter any problems during package installation, you can specify the exact path to the repository
pod 'WalletConnectSwiftV2', :git => 'https://github.com/WalletConnect/WalletConnectSwiftV2.git', :tag => '1.0.5'
Add the jitpack.io
Maven repository to your root/build.gradle.kts
file. For example:
allprojects {
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
}
In app/build.gradle.kts
add the web3wallet package and its dependencies:
implementation("com.walletconnect:android-core:release_version")
implementation("com.walletconnect:web3wallet:release_version")
flutter pub add walletconnect_flutter_v2
Depending on your platform, you will have to add different permissions to get the package to work.
MacOS
Add the following to your DebugProfile.entitlements
and Release.entitlements
files so that it can connect to the WebSocket server.
<key>com.apple.security.network.client</key>
<true/>
Install the Web3Wallet SDK package.
- npm
- Yarn
- Bun
- pnpm
npm install @walletconnect/web3wallet @walletconnect/react-native-compat
yarn add @walletconnect/web3wallet @walletconnect/react-native-compat
bun add @walletconnect/web3wallet @walletconnect/react-native-compat
pnpm add @walletconnect/web3wallet @walletconnect/react-native-compat
Additionally add these extra packages to help with async storage, polyfills and the instance of ethers.
- npm
- Yarn
- Bun
- pnpm
npm install @react-native-async-storage/async-storage @react-native-community/netinfo react-native-get-random-values fast-text-encoding @ethersproject/shims ethers@5.7.2 @json-rpc-tools/utils
yarn add @react-native-async-storage/async-storage @react-native-community/netinfo react-native-get-random-values fast-text-encoding @ethersproject/shims ethers@5.7.2 @json-rpc-tools/utils
bun add @react-native-async-storage/async-storage @react-native-community/netinfo react-native-get-random-values fast-text-encoding @ethersproject/shims ethers@5.7.2 @json-rpc-tools/utils
pnpm add @react-native-async-storage/async-storage @react-native-community/netinfo react-native-get-random-values fast-text-encoding @ethersproject/shims ethers@5.7.2 @json-rpc-tools/utils
For those using Typescript, we recommend adding these dev dependencies:
- npm
- Yarn
- Bun
- pnpm
npm install --save-dev @walletconnect/jsonrpc-types
yarn add --dev @walletconnect/jsonrpc-types
bun add --save-dev @walletconnect/jsonrpc-types
pnpm add --save-dev @walletconnect/jsonrpc-types
Install the WalletConnect client package via Nuget.
dotnet add package WalletConnect.Web3Wallet
Next Steps​
Now that you've installed Web3Wallet SDK, you're ready to start integrating it. The next section will walk you through the process of setting up your project to use the SDK.
Was this helpful?