# WalletConnect Agents SDK (/agents/overview)
The **WalletConnect Agents SDK** is a monorepo of CLI tools and libraries that bring WalletConnect capabilities to the terminal and AI agent environments. It enables wallet connection, message signing, cross-chain bridging, and WCT staking without a browser UI.
**Beta (v0.1.x)** — This project is under active development. APIs and CLI interfaces may change between releases. Not yet recommended for production use.
## Packages [#packages]
WCT staking on Optimism — stake, unstake, claim rewards
## Install [#install]
```bash
npm install -g @walletconnect/cli-sdk @walletconnect/staking-cli
```
Get a Project ID from [WalletConnect Cloud](https://cloud.walletconnect.com), then configure it:
```bash
walletconnect config set project-id
# or
export WALLETCONNECT_PROJECT_ID=
```
---
## WalletConnect Pay CLI [#walletconnect-pay-cli]
**Experimental** — This package is under active development. APIs, commands, and behavior may change significantly between releases.
Create and complete WalletConnect Pay payments from the terminal. Supports proxy mode (no API keys needed) and direct API mode.
### Commands [#commands]
```
Usage: walletconnect-pay [options]
Commands:
status Check the status of a payment
create Create a new payment (merchant credentials required)
checkout Complete a payment using a connected wallet
Options:
--staging Use the staging API
--proxy Proxy through frontend (no API keys needed)
--help Show this help message
```
### Authentication [#authentication]
By default, the CLI proxies through the WalletConnect Pay frontend — no API keys needed. For direct API access:
```bash
export WC_PAY_WALLET_API_KEY=
# Required for merchant operations
export WC_PAY_PARTNER_API_KEY=
export WC_PAY_MERCHANT_ID=
```
### Travel Rule compliance [#travel-rule-compliance]
Some payments require Information Capture data. Provide via CLI flags or environment variables:
```bash
walletconnect-pay checkout \
--name "John Doe" \
--dob "1990-01-15" \
--pob-country "US" \
--pob-address "New York, NY"
```
Or via environment variables:
```bash
export WC_PAY_NAME="John Doe"
export WC_PAY_DOB="1990-01-15"
export WC_PAY_POB_COUNTRY="US"
export WC_PAY_POB_ADDRESS="New York, NY"
```
### Examples [#examples]
```bash
# Check a payment's status
walletconnect-pay status pay_abc123 --staging
# Create a $10 payment (1000 = minor units / cents)
walletconnect-pay create 1000 --staging
# Complete a payment with a connected wallet
walletconnect-pay checkout pay_abc123 --staging
```
### Programmatic usage [#programmatic-usage]
```typescript
import { createPayClient, createFrontendPayClient } from "@walletconnect/pay-cli";
// Direct API client
const client = createPayClient({
walletApiKey: "your-wallet-api-key",
sdkVersion: "0.5.0",
staging: true,
});
// Proxy through the frontend (no API keys needed)
const proxyClient = createFrontendPayClient({
frontendUrl: "https://staging.pay.walletconnect.com",
});
const payment = await client.getPayment("pay_abc123");
```
---
## WalletConnect CLI [#walletconnect-cli]
Connect a wallet, sign messages, send transactions, and bridge tokens across chains from the terminal.
### Commands [#commands-1]
```
Usage: walletconnect [options]
Commands:
connect Connect to a wallet via QR code
whoami Show current session info
sign Sign a message with the connected wallet
sign-typed-data Sign EIP-712 typed data (JSON string)
send-transaction Send a transaction (EVM or Solana)
swidge Bridge/swap tokens across chains via LI.FI
disconnect Disconnect the current session
config set Set a config value (e.g. project-id)
config get Get a config value
Options:
--browser Use browser UI instead of terminal QR code
--json Output as JSON (for whoami)
--chain Specify chain (e.g. evm, solana, eip155:10) for connect
--version Show version number
--help Show this help message
```
### Examples [#examples-1]
```bash
# Connect a wallet (shows QR code in terminal)
walletconnect connect
# Connect using a browser-based QR code
walletconnect connect --browser
# Sign a message
walletconnect sign "Hello from the terminal"
# Check connected wallet
walletconnect whoami
# Send a transaction on Optimism
walletconnect send-transaction '{"to":"0x...","value":"0x0","chainId":"eip155:10"}'
# Disconnect
walletconnect disconnect
```
### Swidge (Cross-Chain Bridge/Swap) [#swidge-cross-chain-bridgeswap]
Bridge or swap tokens across EVM chains, powered by [LI.FI](https://li.fi). The connected wallet approves and executes each transaction.
```bash
# Bridge 5 WCT from Optimism to Ethereum mainnet
walletconnect swidge --from-chain eip155:10 --to-chain eip155:1 \
--from-token WCT --to-token WCT --amount 5
# Swap USDC on Base to ETH on Optimism
walletconnect swidge --from-chain eip155:8453 --to-chain eip155:10 \
--from-token USDC --to-token ETH --amount 10
# Bridge ETH from Ethereum to Base
walletconnect swidge --from-chain eip155:1 --to-chain eip155:8453 \
--amount 0.01
```
When sending a transaction, the CLI automatically checks if the connected wallet has sufficient ETH on the target chain. If funds are insufficient:
- **Interactive (TTY):** Prompts you to bridge from another chain
- **Pipe / agent mode:** Auto-bridges from the chain with the most funds
### Programmatic usage [#programmatic-usage-1]
```typescript
import { WalletConnectCLI, withWallet } from "@walletconnect/cli-sdk";
// High-level helper — connect → use → cleanup
await withWallet(
{
projectId: "your-project-id",
metadata: { name: "My App", description: "...", url: "...", icons: [] },
},
async (wallet, { accounts }) => {
const txHash = await wallet.request({
chainId: "eip155:1",
request: {
method: "eth_sendTransaction",
params: [{ from: accounts[0].split(":").pop(), to: "0x...", value: "0x0" }],
},
});
},
);
// Direct client usage
const wallet = new WalletConnectCLI({
projectId: "your-project-id",
metadata: { name: "My App", description: "...", url: "...", icons: [] },
chains: ["eip155:1", "eip155:10"],
ui: "browser", // or "terminal" (default)
});
const { accounts } = await wallet.connect();
const signature = await wallet.request({
chainId: "eip155:1",
request: { method: "personal_sign", params: ["0x48656c6c6f", accounts[0]] },
});
await wallet.disconnect();
await wallet.destroy();
```
---
## WalletConnect Staking CLI [#walletconnect-staking-cli]
Stake WCT tokens on Optimism, check staking positions, and claim rewards.
### Commands [#commands-2]
```
Usage: walletconnect-staking [options]
Commands:
stake Stake WCT (approve + createLock/updateLock)
unstake Withdraw all staked WCT (after lock expires)
claim Claim staking rewards
status Show staking position, rewards, and APY
balance Show WCT token balance
Options:
--address=0x... Use address directly (for read-only commands)
--browser Use browser UI for wallet connection
--help Show this help message
```
### Examples [#examples-2]
```bash
# Stake 1000 WCT for 52 weeks
walletconnect-staking stake 1000 52
# Check staking position and rewards (read-only, no wallet needed)
walletconnect-staking status --address=0x...
# Check WCT balance
walletconnect-staking balance --address=0x...
# Claim staking rewards (requires wallet)
walletconnect-staking claim
# Withdraw all staked WCT (after lock expires)
walletconnect-staking unstake
```
### Programmatic usage [#programmatic-usage-2]
```typescript
import { stake, status, balance, fetchStaking, formatWCT } from "@walletconnect/staking-cli";
```
The staking package exports transaction builders, formatting utilities, and API helpers for building custom staking integrations.
---
## Agent Skills [#agent-skills]
Install the accompanying Claude Code / agent skills:
```bash
npx skills add WalletConnect/agent-sdk
```
This adds the `walletconnect-pay`, `walletconnect`, and `walletconnect-staking` skills to your Claude Code environment, enabling AI agents to interact with wallets and payments directly from the terminal.
## Source [#source]
} href="https://github.com/walletconnect/agent-sdk">
View the source, file issues, and contribute on GitHub.
# TON Connect WalletConnect Integration (/apps/guides/tonconnect-walletconnect)
This guide explains how to enable WalletConnect support in your [TON Connect](https://www.npmjs.com/package/@tonconnect/sdk) application, allowing users to connect with WalletConnect-compatible wallets.
## Prerequisites [#prerequisites]
Before enabling WalletConnect in your TON Connect application, ensure you have the following:
### 1. TON Connect Project [#1-ton-connect-project]
You should have an existing TON Connect project initialized with the [@tonconnect/sdk](https://www.npmjs.com/package/@tonconnect/sdk) package. If you haven't set up TON Connect yet, please refer to the [TON Connect documentation](https://docs.ton.org/develop/dapps/ton-connect/overview) to get started.
### 2. WalletConnect Project ID [#2-walletconnect-project-id]
Create a new project on the WalletConnect Dashboard at https://dashboard.walletconnect.com and obtain a new project ID. You will need this project ID to initialize WalletConnect in your application.
### 3. Allowlist Your Domains [#3-allowlist-your-domains]
To help prevent malicious use of your project ID, you are strongly encouraged to set an allowlist of [origins](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) where your project ID is used. You can manage your allowlist in the [WalletConnect Dashboard](https://dashboard.walletconnect.com) under the project settings.
The allowlist supports a list of origins in the format `[scheme://]`. Using `localhost` (or `127.0.0.1`) is always permitted, and if the allowlist is empty, all origins are allowed. Updates take 15 minutes to apply.
Examples of possible origins in the allowlist:
- `example.com` - allows `https://example.com` or `http://example.com` but not `https://www.example.com`
- `https://example.com` - allows `https://example.com` but not `http://example.com`
- `https://*.example.com` - allows `https://www.example.com` but not `https://example.com`
Requests from origins not in the allowlist will be denied. Make sure to add all domains where your app will be deployed.
## Enable WalletConnect [#enable-walletconnect]
To enable WalletConnect in your TON Connect application, use the `initializeWalletConnect()` function from the `@tonconnect/sdk` package along with the `UniversalConnector` from `@reown/appkit-universal-connector`.
```typescript
import { initializeWalletConnect } from '@tonconnect/sdk';
import { UniversalConnector } from '@reown/appkit-universal-connector';
initializeWalletConnect(UniversalConnector, {
projectId: 'YOUR_PROJECT_ID',
metadata: {
name: 'My DApp',
description: 'My awesome DApp',
url: 'https://mydapp.com',
icons: ['https://mydapp.com/icon.png']
}
});
```
### Configuration Options [#configuration-options]
The `initializeWalletConnect` function accepts the following configuration options:
| Option | Type | Required | Description |
|--------|------|----------|-------------|
| `projectId` | `string` | Yes | Your WalletConnect project ID from the [Dashboard](https://dashboard.walletconnect.com) |
| `metadata.name` | `string` | Yes | The name of your application |
| `metadata.description` | `string` | Yes | A brief description of your application |
| `metadata.url` | `string` | Yes | The URL of your application |
| `metadata.icons` | `string[]` | Yes | An array of icon URLs for your application |
### Example Implementation [#example-implementation]
Here's a complete example of integrating WalletConnect into a TON Connect application:
```typescript
import { TonConnect } from '@tonconnect/sdk';
import { initializeWalletConnect } from '@tonconnect/sdk';
import { UniversalConnector } from '@reown/appkit-universal-connector';
import {
TonConnectUIProvider,
TonConnectButton,
} from '@tonconnect/ui-react';
// Initialize WalletConnect support
initializeWalletConnect(UniversalConnector, {
projectId: 'YOUR_PROJECT_ID',
metadata: {
name: 'My TON DApp',
description: 'A decentralized application on TON',
url: 'https://mytonapp.com',
icons: ['https://mytonapp.com/icon.png']
}
});
export function App() {
// Create TON Connect instance
const tonConnect = new TonConnect({
manifestUrl: 'https://mytonapp.com/tonconnect-manifest.json'
});
return (
WalletConnect + TON React Example
)
}
```
## Handling `ton_proof` [#handling-ton_proof]
When using TON Connect with WalletConnect, `ton_proof` is requested and returned as part of the connection response using the [CAIP-222](https://chainagnostic.org/CAIPs/caip-222) authentication flow. The proof payload is passed via the `authentication` parameter during `connect()`, and the signed proof is available on `session.authentication` after the connection is established.
### Requesting `ton_proof` During Connection [#requesting-ton_proof-during-connection]
To request `ton_proof` during the WalletConnect session establishment, pass the `authentication` parameter when calling `connect()` on the underlying `UniversalConnector` provider:
```typescript
import { UniversalConnector } from '@reown/appkit-universal-connector';
const connector = await UniversalConnector.init({
projectId: 'YOUR_PROJECT_ID',
metadata: {
name: 'My TON DApp',
description: 'A decentralized application on TON',
url: 'https://mytonapp.com',
icons: ['https://mytonapp.com/icon.png']
},
networks: [{
namespace: 'ton',
chains: [tonMainnet],
methods: ['ton_sendMessage', 'ton_signData'],
events: []
}]
});
const session = await connector.provider.connect({
optionalNamespaces: {
ton: {
methods: ['ton_sendMessage', 'ton_signData'],
chains: ['ton:-239'],
events: []
}
},
authentication: [{
uri: 'https://mytonapp.com',
domain: 'mytonapp.com',
chains: ['ton:-239'],
nonce: '',
ttl: 86400,
statement: ''
}]
});
```
### Reading the Proof Result [#reading-the-proof-result]
After a successful connection, the proof result is available on `session.authentication` as an array of [CAIP-222 Cacao](https://chainagnostic.org/CAIPs/caip-222) objects:
```typescript
const authenticationResults = session?.authentication;
if (authenticationResults && authenticationResults.length > 0) {
// Each result is a Cacao object containing the signed proof
const proof = authenticationResults[0];
console.log('ton_proof result:', proof);
}
```
The `ton_proof` result is **not** available in `onStatusChange` when using WalletConnect. You must read it from `session.authentication` directly after the connection is established.
## Next Steps [#next-steps]
After integrating WalletConnect into your TON Connect application, users will be able to connect using any WalletConnect-compatible wallet. For more information about TON-specific RPC methods supported by WalletConnect, see the [TON Chain Support](/wallets/chains/ton) documentation.
# WalletConnect for Apps (/apps)
## **Your Gateway to the WalletConnect Network** [#your-gateway-to-the-walletconnect-network]
**We highly recommend using one of our SDK partners to integrate WalletConnect into your app.**
The **WalletConnect App SDK** is the foundational gateway for apps to access the **WalletConnect Network,** the decentralized connectivity layer for the financial internet.
With a single integration, developers can connect to **700+ wallets** and **65,000+ apps** across **EVM, Solana, Bitcoin**, and **any network with a CAIP-25 namespace**, while preserving privacy, composability, and user choice.
**Built on open standards** and powered by a decentralized relay network, WalletConnect unlocks secure and cross-chain wallet connections for apps across devices and platforms.
Whether you’re building for DeFi, gaming, payments, or identity, WalletConnect provides the essential building block for **trusted wallet-to-app experiences**, all backed by the **infrastructure that powers the financial internet**.
## **Powering leading SDKs across Web3** [#powering-leading-sdks-across-web3]
The WalletConnect App SDK is already embedded in some of the most widely-used SDKs in the ecosystem - powering everything from onboarding to payments.
## **Who is it for?** [#who-is-it-for]
- **App developers** who want to connect wallets quickly and securely
- **SDK builders** who want a powerful foundation for wallet connectivity
- **Web3 platforms** scaling across chains and wallets
If your product needs to talk to wallets, the App SDK is your starting point.
## What does WalletConnect have to offer for Apps? [#what-does-walletconnect-have-to-offer-for-apps]
At its core, the WalletConnect handles the most critical UX layer of any onchain app: **wallet connection**.
✅ **Prebuilt modal UX** for connecting wallets
✅ **Chain-agnostic support** across EVM, Solana, Bitcoin, and more
✅ **Built-in compatibility** with 500+ wallets
✅ **Native, embedded UI** - no iframes, no redirects
✅ **Customizable and composable** - use standalone or extend with your own flows
It’s the fastest way to build reliable wallet connectivity, with none of the versioning, RPC mismatches, or fragmented logic that plague homegrown solutions.
## Demo [#demo]
---
## How to Integrate WalletConnect into your App [#how-to-integrate-walletconnect-into-your-app]
There are **two core pathways to integrate WalletConnect** into your app:
1. Via an SDK partner that has already integrated WalletConnect into their SDK.
2. Standalone integration of WalletConnect.
Below, you can find instructions and information for both pathways.
## Integrate WalletConnect via an SDK Partner [#integrate-walletconnect-via-an-sdk-partner]
First, we need to cover what exactly is an SDK and how projects can use them to integrate WalletConnect into their app.
### What is an SDK? [#what-is-an-sdk]
An SDK is a software development kit that provides a set of tools, libraries, and documentation for developers to build applications. It is a collection of code, tools, and resources that help developers build applications faster and easier.
In this context, SDKs are pre-packaged developer tools that abstract away the underlying protocol, i.e. WalletConnect, and provide a simplified integration path for apps and wallets, making wallet connectivity fast, reliable, and developer-friendly.
### 🛠 Most Popular SDKs built on top of WalletConnect [#-most-popular-sdks-built-on-top-of-walletconnect]
- [**Reown AppKit**](https://reown.com/appkit) - A modular UX engine for onboarding, payments, and wallet interaction. Used in 286M+ sessions and 10B+ RPC calls .
- [**Privy**](https://www.privy.io/) - Secure wallet infrastructure that simplifies identity, session handling, and embedded wallets.
- [**Dynamic**](https://www.dynamic.xyz/) - All-in-one authentication and wallet SDK for web3 apps across mobile and web.
- [**ConnectKit**](https://family.co/connectkit) - Beautiful React components built for WalletConnect connections.
- [**RainbowKit**](https://www.rainbowkit.com/) - Customizable wallet connection UI optimized for Ethereum and WalletConnect.
- [**Canton dApp SDK**](https://github.com/hyperledger-labs/splice-wallet-kernel/tree/main/sdk/dapp-sdk) - Browser SDK from the [Splice Wallet Kernel](https://github.com/hyperledger-labs/splice-wallet-kernel) for building dApps on the [Canton Network](https://www.canton.network/). Implements the [CIP-103](https://github.com/canton-foundation/cips/blob/main/cip-0103/cip-0103.md) dApp API with multi-transport support (HTTP, `postMessage`) and an EIP-1193-style `window.canton` provider.
These SDKs demonstrate what’s possible with the App SDK as a base layer and how it can be extended to suit your product, stack, and user flow.
### SDK Chain Compatibility [#sdk-chain-compatibility]
Below you can find the chain compatibility for the most popular SDKs built on top of WalletConnect.
| SDK | Networks / Chains Supported |
|------------------|----------------------------------------------------|
| **Reown AppKit** | EVM, Solana, Bitcoin, Polkadot, Cosmos and all other networks with a CAIP-25 namespace |
| **Privy** | EVM, Solana, Bitcoin |
| **Dynamic** | EVM, Solana, Bitcoin, Flow, StarkNet, Sui, Cosmos, Algorand, Spark |
| **ConnectKit** | EVM |
| **RainbowKit** | EVM |
| **Canton dApp SDK** | Canton Network |
## Standalone Integration of WalletConnect as an App [#standalone-integration-of-walletconnect-as-an-app]
If you do not wish to use an SDK partner, you can integrate WalletConnect directly into your app. Please refer to the corresponding installation guide for each framework given below.
} href="/apps/react/installation">
Get started with WalletConnect as an App in React.
} href="/apps/next/installation">
Get started with WalletConnect as an App in Next.js.
} href="/apps/vue/installation">
Get started with WalletConnect as an App in Vue.
} href="/apps/javascript/installation">
Get started with WalletConnect as an App in JavaScript.
### Chains Supported by WalletConnect [#chains-supported-by-walletconnect]
Please refer to the [Chains Supported](https://docs.reown.com/cloud/chains/chain-list) page for the list of chains supported by WalletConnect.
### RPCs and Chain Specific Methods [#rpcs-and-chain-specific-methods]
Please refer to the **RPC Reference** dropdown under the [Multi-Chain](https://docs.reown.com/advanced/multichain/rpc-reference/) section for the list of RPCs and chain specific methods supported by WalletConnect.
# Installation (/apps/javascript/installation)
WalletConnect App SDK is chain agnostic and provides seamless integration with several blockchain ecosystems. WalletConnect App SDK when combined with Universal Provider library enables compatibility across any blockchain protocol.
## Pre-requisites [#pre-requisites]
This section is to inform you about the pre-requisites for integrating WalletConnect as an App with JavaScript (vanilla JS).
### Cloud Configuration [#cloud-configuration]
Create a new project on WalletConnect Dashboard at https://dashboard.walletconnect.com and obtain a new project ID. You will need this project ID to initialize WalletConnect in your project (app).
### Allowlist [#allowlist]
To help prevent malicious use of your project ID, you are strongly encouraged to set an allowlist of [origins](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) where your project ID is used. You can manage your allowlist in the [WalletConnect Dashboard](https://dashboard.walletconnect.com) under the project settings.
The allowlist supports a list of origins in the format `[scheme://]`. Using `localhost` (or `127.0.0.1`) is always permitted, and if the allowlist is empty, all origins are allowed. Updates take 15 minutes to apply.
Examples of possible origins in the allowlist:
- `example.com` - allows `https://example.com` or `http://example.com` but not `https://www.example.com`
- `https://example.com` - allows `https://example.com` but not `http://example.com`
- `https://*.example.com` - allows `https://www.example.com` but not `https://example.com`
Requests from origins not in the allowlist will be denied. Make sure to add all domains where your app will be deployed.
## Installation [#installation]
```bash tab="npm"
npm install @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
```bash tab="Yarn"
yarn add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
```bash tab="Bun"
bun add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
```bash tab="pnpm"
pnpm add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
## Implementation [#implementation]
Here is a sample implementation of WalletConnect App SDK with JavaScript. You can also check the example repository below.
} href="https://github.com/reown-com/appkit-web-examples/tree/main/javascript/javascript-core-universal-connector">
Check the WalletConnect App SDK JavaScript example
For a quick integration of WalletConnect App SDK you can use the `UniversalConnector` class. Which simplifies the integration of WalletConnect App SDK by providing a single interface for all the blockchain protocols.
You can configure the Universal Connector with the networks you want to support.
For more information, please visit [RPC Reference](https://docs.reown.com/advanced/multichain/rpc-reference/cosmos-rpc) section from our docs.
We recommend creating a config file to establish a singleton instance for the Universal Connector:
```tsx tab="Generic Example"
import { UniversalConnector } from '@reown/appkit-universal-connector'
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
// you can configure your own network
const suiMainnet = {
id: 784,
chainNamespace: 'sui',
caipNetworkId: 'sui:mainnet',
name: 'Sui',
nativeCurrency: { name: 'SUI', symbol: 'SUI', decimals: 9 },
rpcUrls: { default: { http: ['https://fullnode.mainnet.sui.io:443'] } }
}
export const networks = [suiMainnet]
export let universalConnector
export async function getUniversalConnector() {
if (!universalConnector) {
universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['sui_signPersonalMessage'],
chains: [suiMainnet],
events: [],
namespace: 'sui'
}
]
})
}
return universalConnector
}
```
```tsx tab="Stacks Example"
import { UniversalConnector } from '@reown/appkit-universal-connector'
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
// you can configure your own network
const stacksMainnet = {
id: 'stacks-mainnet',
chainNamespace: 'stacks',
caipNetworkId: 'stacks:1',
name: 'Stacks Mainnet',
nativeCurrency: { name: 'STX', symbol: 'STX', decimals: 6 },
rpcUrls: { default: { http: ['https://stacks-node-api.mainnet.stacks.co'] } } // Example Stacks Mainnet RPC URL
}
export const networks = [stacksMainnet]
export let universalConnector
export async function getUniversalConnector() {
if (!universalConnector) {
universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['stx_signMessage', 'stx_signTransaction', 'stx_getAccounts', 'stx_getAddresses', 'stx_callContract', 'stx_deployContract', 'sendTransfer', 'getAddresses'],
chains: [stacksMainnet],
events: ['stx_chainChanged', 'stx_accountsChanged'],
namespace: 'stacks'
}
]
})
}
return universalConnector
}
```
```tsx tab="TON Example"
import type { AppKitNetwork } from '@reown/appkit/networks'
import type { CustomCaipNetwork } from '@reown/appkit-common'
import { UniversalConnector } from '@reown/appkit-universal-connector'
// Get projectId from https://dashboard.walletconnect.com
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
const tonMainnet: CustomCaipNetwork<'ton'> = {
id: -239,
chainNamespace: 'ton' as const,
caipNetworkId: 'ton:-239',
name: 'TON',
nativeCurrency: { name: 'TON', symbol: 'TON', decimals: 9 },
rpcUrls: { default: { http: ['https://toncenter.com/api/v2/jsonRPC'] } }
}
export const networks = [tonMainnet] as [AppKitNetwork, ...AppKitNetwork[]]
export async function getUniversalConnector() {
const universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['ton_signData'],
chains: [tonMainnet as CustomCaipNetwork],
events: [],
namespace: 'ton'
}
]
})
return universalConnector
}
```
```tsx tab="TRON Example"
import { UniversalConnector } from '@reown/appkit-universal-connector'
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
const tronMainnet = {
id: '0x2b6653dc',
chainNamespace: 'tron',
caipNetworkId: 'tron:0x2b6653dc',
name: 'Tron Mainnet',
nativeCurrency: { name: 'TRX', symbol: 'TRX', decimals: 6 },
rpcUrls: { default: { http: ['https://api.trongrid.io'] } }
}
export const networks = [tronMainnet]
export let universalConnector
export async function getUniversalConnector() {
if (!universalConnector) {
universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['tron_signTransaction', 'tron_signMessage'],
chains: [tronMainnet],
events: [],
namespace: 'tron'
}
]
})
}
return universalConnector
}
```
In the main.js file you can add:
```tsx
import { getUniversalConnector } from './config/appKit.js'
async function setup() {
const universalConnector = await getUniversalConnector()
// check if session is already connected
if (universalConnector?.provider.session) {
session = universalConnector?.provider.session
}
}
setup()
```
## Trigger the modal [#trigger-the-modal]
To open the WalletConnect modal you need to call the `connect` function from the Universal Connector.
For more information, please visit [RPC Reference](https://docs.reown.com/advanced/multichain/rpc-reference/cosmos-rpc) section from our docs.
```tsx
....
```
## Smart Contract Interaction [#smart-contract-interaction]
[Wagmi hooks](https://wagmi.sh/react/api/hooks/useReadContract) can help us interact with wallets and smart contracts:
```tsx
import { useReadContract } from "wagmi";
import { USDTAbi } from "../abi/USDTAbi";
const USDTAddress = "0x...";
function App() {
const result = useReadContract({
abi: USDTAbi,
address: USDTAddress,
functionName: "totalSupply",
});
}
```
Read more about Wagmi hooks for smart contract interaction [here](https://wagmi.sh/react/hooks/useReadContract).
[Ethers](https://docs.ethers.org/v6/) can help us interact with wallets and smart contracts:
```tsx
import { useAppKitProvider, useAppKitAccount } from "@reown/appkit/react";
import { BrowserProvider, Contract, formatUnits } from "ethers";
const USDTAddress = "0x617f3112bf5397D0467D315cC709EF968D9ba546";
// The ERC-20 Contract ABI, which is a common contract interface
// for tokens (this is the Human-Readable ABI format)
const USDTAbi = [
"function name() view returns (string)",
"function symbol() view returns (string)",
"function balanceOf(address) view returns (uint)",
"function transfer(address to, uint amount)",
"event Transfer(address indexed from, address indexed to, uint amount)",
];
function Components() {
const { address, isConnected } = useAppKitAccount();
const { walletProvider } = useAppKitProvider("eip155");
async function getBalance() {
if (!isConnected) throw Error("User disconnected");
const ethersProvider = new BrowserProvider(walletProvider);
const signer = await ethersProvider.getSigner();
// The Contract object
const USDTContract = new Contract(USDTAddress, USDTAbi, signer);
const USDTBalance = await USDTContract.balanceOf(address);
console.log(formatUnits(USDTBalance, 18));
}
return ;
}
```
[@Solana/web3.js](https://solana.com/docs/clients/javascript) library allows for seamless interaction with wallets and smart contracts on the Solana blockchain.
For a practical example of how it works, you can refer to our [lab dApp](https://lab.reown.com/appkit/?name=solana).
```tsx
import {
SystemProgram,
PublicKey,
Keypair,
Transaction,
TransactionInstruction,
LAMPORTS_PER_SOL
} from '@solana/web3.js'
import { useAppKitAccount, useAppKitProvider } from '@reown/appkit/react'
import { useAppKitConnection, type Provider } from '@reown/appkit-adapter-solana/react'
function deserializeCounterAccount(data?: Buffer): { count: number } {
if (data?.byteLength !== 8) {
throw Error('Need exactly 8 bytes to deserialize counter')
}
return {
count: Number(data[0])
}
}
const { address } = useAppKitAccount()
const { connection } = useAppKitConnection()
const { walletProvider } = useAppKitProvider('solana')
async function onIncrementCounter() {
const PROGRAM_ID = new PublicKey('Cb5aXEgXptKqHHWLifvXu5BeAuVLjojQ5ypq6CfQj1hy')
const counterKeypair = Keypair.generate()
const counter = counterKeypair.publicKey
const balance = await connection.getBalance(walletProvider.publicKey)
if (balance < LAMPORTS_PER_SOL / 100) {
throw Error('Not enough SOL in wallet')
}
const COUNTER_ACCOUNT_SIZE = 8
const allocIx: TransactionInstruction = SystemProgram.createAccount({
fromPubkey: walletProvider.publicKey,
newAccountPubkey: counter,
lamports: await connection.getMinimumBalanceForRentExemption(COUNTER_ACCOUNT_SIZE),
space: COUNTER_ACCOUNT_SIZE,
programId: PROGRAM_ID
})
const incrementIx: TransactionInstruction = new TransactionInstruction({
programId: PROGRAM_ID,
keys: [
{
pubkey: counter,
isSigner: false,
isWritable: true
}
],
data: Buffer.from([0x0])
})
const tx = new Transaction().add(allocIx).add(incrementIx)
tx.feePayer = walletProvider.publicKey
tx.recentBlockhash = (await connection.getLatestBlockhash('confirmed')).blockhash
await walletProvider.signAndSendTransaction(tx, [counterKeypair])
const counterAccountInfo = await connection.getAccountInfo(counter, {
commitment: 'confirmed'
})
if (!counterAccountInfo) {
throw new Error('Expected counter account to have been created')
}
const counterAccount = deserializeCounterAccount(counterAccountInfo?.data)
if (counterAccount.count !== 1) {
throw new Error('Expected count to have been 1')
}
console.log(`[alloc+increment] count is: ${counterAccount.count}`);
}
```
# Installation (/apps/next/installation)
WalletConnect App SDK is chain agnostic and provides seamless integration with several blockchain ecosystems. WalletConnect App SDK when combined with Universal Provider library enables compatibility across any blockchain protocol.
## Pre-requisites [#pre-requisites]
This section is to inform you about the pre-requisites for integrating WalletConnect as an App with Next.js.
### Cloud Configuration [#cloud-configuration]
Create a new project on WalletConnect Dashboard at https://dashboard.walletconnect.com and obtain a new project ID. You will need this project ID to initialize WalletConnect in your project (app).
### Allowlist [#allowlist]
To help prevent malicious use of your project ID, you are strongly encouraged to set an allowlist of [origins](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) where your project ID is used. You can manage your allowlist in the [WalletConnect Dashboard](https://dashboard.walletconnect.com) under the project settings.
The allowlist supports a list of origins in the format `[scheme://]`. Using `localhost` (or `127.0.0.1`) is always permitted, and if the allowlist is empty, all origins are allowed. Updates take 15 minutes to apply.
Examples of possible origins in the allowlist:
- `example.com` - allows `https://example.com` or `http://example.com` but not `https://www.example.com`
- `https://example.com` - allows `https://example.com` but not `http://example.com`
- `https://*.example.com` - allows `https://www.example.com` but not `https://example.com`
Requests from origins not in the allowlist will be denied. Make sure to add all domains where your app will be deployed.
## Installation [#installation]
```bash tab="npm"
npm install @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
```bash tab="Yarn"
yarn add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
```bash tab="Bun"
bun add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
```bash tab="pnpm"
pnpm add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
## Implementation [#implementation]
For a quick integration of WalletConnect App SDK you can use the `UniversalConnector` class. Which simplifies the integration of WalletConnect App SDK by providing a single interface for all the blockchain protocols.
You can configure the Universal Connector with the networks you want to support.
For more information, please visit [RPC Reference](https://docs.reown.com/advanced/multichain/rpc-reference/cosmos-rpc) section from our docs.
We recommend creating a config file to establish a singleton instance for the Universal Connector:
```tsx tab="Generic Example"
import type { AppKitNetwork } from '@reown/appkit/networks'
import type { CustomCaipNetwork } from '@reown/appkit-common'
import { UniversalConnector } from '@reown/appkit-universal-connector'
// Get projectId from https://dashboard.walletconnect.com
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
// you can configure your own network
const suiMainnet: CustomCaipNetwork<'sui'> = {
id: 784,
chainNamespace: 'sui' as const,
caipNetworkId: 'sui:mainnet',
name: 'Sui',
nativeCurrency: { name: 'SUI', symbol: 'SUI', decimals: 9 },
rpcUrls: { default: { http: ['https://fullnode.mainnet.sui.io:443'] } }
}
export const networks = [suiMainnet] as [AppKitNetwork, ...AppKitNetwork[]]
export async function getUniversalConnector() {
const universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['sui_signPersonalMessage'],
chains: [suiMainnet as CustomCaipNetwork],
events: [],
namespace: 'sui'
}
]
})
return universalConnector
}
```
```tsx tab="Stacks Example"
import type { AppKitNetwork } from '@reown/appkit/networks'
import type { InferredCaipNetwork } from '@reown/appkit-common'
import { UniversalConnector } from '@reown/appkit-universal-connector'
// Get projectId from https://dashboard.walletconnect.com
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
// you can configure your own network
const stacksMainnet: InferredCaipNetwork = {
id: 'stacks-mainnet',
chainNamespace: 'stacks' as const,
caipNetworkId: 'stacks:1',
name: 'Stacks Mainnet',
nativeCurrency: { name: 'STX', symbol: 'STX', decimals: 6 },
rpcUrls: { default: { http: ['https://stacks-node-api.mainnet.stacks.co'] } } // Example Stacks Mainnet RPC URL
}
export const networks = [stacksMainnet] as [AppKitNetwork, ...AppKitNetwork[]]
export async function getUniversalConnector() {
const universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['stx_signMessage', 'stx_signTransaction', 'stx_getAccounts', 'stx_getAddresses', 'stx_callContract', 'stx_deployContract', 'sendTransfer', 'getAddresses'],
chains: [stacksMainnet as InferredCaipNetwork],
events: ['stx_chainChanged', 'stx_accountsChanged'],
namespace: 'stacks'
}
]
})
return universalConnector
}
```
```tsx tab="TON Example"
import type { AppKitNetwork } from '@reown/appkit/networks'
import type { CustomCaipNetwork } from '@reown/appkit-common'
import { UniversalConnector } from '@reown/appkit-universal-connector'
// Get projectId from https://dashboard.walletconnect.com
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
const tonMainnet: CustomCaipNetwork<'ton'> = {
id: -239,
chainNamespace: 'ton' as const,
caipNetworkId: 'ton:-239',
name: 'TON',
nativeCurrency: { name: 'TON', symbol: 'TON', decimals: 9 },
rpcUrls: { default: { http: ['https://toncenter.com/api/v2/jsonRPC'] } }
}
export const networks = [tonMainnet] as [AppKitNetwork, ...AppKitNetwork[]]
export async function getUniversalConnector() {
const universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['ton_signData'],
chains: [tonMainnet as CustomCaipNetwork],
events: [],
namespace: 'ton'
}
]
})
return universalConnector
}
```
```tsx tab="TRON Example"
import type { AppKitNetwork } from '@reown/appkit/networks'
import type { CustomCaipNetwork } from '@reown/appkit-common'
import { UniversalConnector } from '@reown/appkit-universal-connector'
// Get projectId from https://dashboard.walletconnect.com
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
const tronMainnet: CustomCaipNetwork<'tron'> = {
id: '0x2b6653dc',
chainNamespace: 'tron' as const,
caipNetworkId: 'tron:0x2b6653dc',
name: 'Tron Mainnet',
nativeCurrency: { name: 'TRX', symbol: 'TRX', decimals: 6 },
rpcUrls: { default: { http: ['https://api.trongrid.io'] } }
}
export const networks = [tronMainnet] as [AppKitNetwork, ...AppKitNetwork[]]
export async function getUniversalConnector() {
const universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['tron_signTransaction', 'tron_signMessage'],
chains: [tronMainnet as CustomCaipNetwork],
events: [],
namespace: 'tron'
}
]
})
return universalConnector
}
```
In the App.tsx file you can add :
```tsx
import { useState, useEffect } from 'react'
import { getUniversalConnector } from './config' // previous config file
import { UniversalConnector } from '@reown/appkit-universal-connector'
export function App() {
const [universalConnector, setUniversalConnector] = useState()
const [session, setSession] = useState()
// Initialize the Universal Connector on component mount
useEffect(() => {
getUniversalConnector().then(setUniversalConnector)
}, [])
// Set the session state in case it changes
useEffect(() => {
setSession(universalConnector?.provider.session)
}, [universalConnector?.provider.session])
```
## Trigger the modal [#trigger-the-modal]
To open the WalletConnect modal you need to call the `connect` function from the Universal Connector.
```tsx
// get the session from the universal connector
const handleConnect = async () => {
if (!universalConnector) {
return
}
const { session: providerSession } = await universalConnector.connect()
setSession(providerSession)
};
// disconnect the universal connector
const handleDisconnect = async () => {
if (!universalConnector) {
return
}
await universalConnector.disconnect()
setSession(null)
};
...
return (
(
)
```
## Smart Contract Interaction [#smart-contract-interaction]
[Wagmi hooks](https://wagmi.sh/react/api/hooks/useReadContract) can help us interact with wallets and smart contracts:
```tsx
import { useReadContract } from "wagmi";
import { USDTAbi } from "../abi/USDTAbi";
const USDTAddress = "0x...";
function App() {
const result = useReadContract({
abi: USDTAbi,
address: USDTAddress,
functionName: "totalSupply",
});
}
```
Read more about Wagmi hooks for smart contract interaction [here](https://wagmi.sh/react/hooks/useReadContract).
[Ethers](https://docs.ethers.org/v6/) can help us interact with wallets and smart contracts:
```tsx
import { useAppKitProvider, useAppKitAccount } from "@reown/appkit/react";
import { BrowserProvider, Contract, formatUnits } from "ethers";
const USDTAddress = "0x617f3112bf5397D0467D315cC709EF968D9ba546";
// The ERC-20 Contract ABI, which is a common contract interface
// for tokens (this is the Human-Readable ABI format)
const USDTAbi = [
"function name() view returns (string)",
"function symbol() view returns (string)",
"function balanceOf(address) view returns (uint)",
"function transfer(address to, uint amount)",
"event Transfer(address indexed from, address indexed to, uint amount)",
];
function Components() {
const { address, isConnected } = useAppKitAccount();
const { walletProvider } = useAppKitProvider("eip155");
async function getBalance() {
if (!isConnected) throw Error("User disconnected");
const ethersProvider = new BrowserProvider(walletProvider);
const signer = await ethersProvider.getSigner();
// The Contract object
const USDTContract = new Contract(USDTAddress, USDTAbi, signer);
const USDTBalance = await USDTContract.balanceOf(address);
console.log(formatUnits(USDTBalance, 18));
}
return ;
}
```
[@Solana/web3.js](https://solana.com/docs/clients/javascript) library allows for seamless interaction with wallets and smart contracts on the Solana blockchain.
For a practical example of how it works, you can refer to our [lab dApp](https://lab.reown.com/appkit/?name=solana).
```tsx
import {
SystemProgram,
PublicKey,
Keypair,
Transaction,
TransactionInstruction,
LAMPORTS_PER_SOL
} from '@solana/web3.js'
import { useAppKitAccount, useAppKitProvider } from '@reown/appkit/react'
import { useAppKitConnection, type Provider } from '@reown/appkit-adapter-solana/react'
function deserializeCounterAccount(data?: Buffer): { count: number } {
if (data?.byteLength !== 8) {
throw Error('Need exactly 8 bytes to deserialize counter')
}
return {
count: Number(data[0])
}
}
const { address } = useAppKitAccount()
const { connection } = useAppKitConnection()
const { walletProvider } = useAppKitProvider('solana')
async function onIncrementCounter() {
const PROGRAM_ID = new PublicKey('Cb5aXEgXptKqHHWLifvXu5BeAuVLjojQ5ypq6CfQj1hy')
const counterKeypair = Keypair.generate()
const counter = counterKeypair.publicKey
const balance = await connection.getBalance(walletProvider.publicKey)
if (balance < LAMPORTS_PER_SOL / 100) {
throw Error('Not enough SOL in wallet')
}
const COUNTER_ACCOUNT_SIZE = 8
const allocIx: TransactionInstruction = SystemProgram.createAccount({
fromPubkey: walletProvider.publicKey,
newAccountPubkey: counter,
lamports: await connection.getMinimumBalanceForRentExemption(COUNTER_ACCOUNT_SIZE),
space: COUNTER_ACCOUNT_SIZE,
programId: PROGRAM_ID
})
const incrementIx: TransactionInstruction = new TransactionInstruction({
programId: PROGRAM_ID,
keys: [
{
pubkey: counter,
isSigner: false,
isWritable: true
}
],
data: Buffer.from([0x0])
})
const tx = new Transaction().add(allocIx).add(incrementIx)
tx.feePayer = walletProvider.publicKey
tx.recentBlockhash = (await connection.getLatestBlockhash('confirmed')).blockhash
await walletProvider.signAndSendTransaction(tx, [counterKeypair])
const counterAccountInfo = await connection.getAccountInfo(counter, {
commitment: 'confirmed'
})
if (!counterAccountInfo) {
throw new Error('Expected counter account to have been created')
}
const counterAccount = deserializeCounterAccount(counterAccountInfo?.data)
if (counterAccount.count !== 1) {
throw new Error('Expected count to have been 1')
}
console.log(`[alloc+increment] count is: ${counterAccount.count}`);
}
```
# Installation (/apps/react/installation)
WalletConnect App SDK is chain agnostic and provides seamless integration with several blockchain ecosystems. WalletConnect App SDK when combined with Universal Provider library enables compatibility across any blockchain protocol.
## Pre-requisites [#pre-requisites]
This section is to inform you about the pre-requisites for integrating WalletConnect as an App with React.
### Cloud Configuration [#cloud-configuration]
Create a new project on WalletConnect Dashboard at https://dashboard.walletconnect.com and obtain a new project ID. You will need this project ID to initialize WalletConnect in your project (app).
### Allowlist [#allowlist]
To help prevent malicious use of your project ID, you are strongly encouraged to set an allowlist of [origins](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) where your project ID is used. You can manage your allowlist in the [WalletConnect Dashboard](https://dashboard.walletconnect.com) under the project settings.
The allowlist supports a list of origins in the format `[scheme://]`. Using `localhost` (or `127.0.0.1`) is always permitted, and if the allowlist is empty, all origins are allowed. Updates take 15 minutes to apply.
Examples of possible origins in the allowlist:
- `example.com` - allows `https://example.com` or `http://example.com` but not `https://www.example.com`
- `https://example.com` - allows `https://example.com` but not `http://example.com`
- `https://*.example.com` - allows `https://www.example.com` but not `https://example.com`
Requests from origins not in the allowlist will be denied. Make sure to add all domains where your app will be deployed.
## Installation [#installation]
If you are setting up your React app, please **do not use** `npx create-react-app`, as it has been deprecated. Using it may cause dependency
issues. Instead, please use [Vite](https://vitejs.dev/guide/#scaffolding-your-first-vite-project) to
create your React app. You can set it up by running `npm create vite@latest`.
```bash tab="npm"
npm install @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
```bash tab="Yarn"
yarn add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
```bash tab="Bun"
bun add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
```bash tab="pnpm"
pnpm add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
## Implementation [#implementation]
Here is a sample implementation of WalletConnect App SDK with React. You can also check the example repository below.
} href="https://github.com/reown-com/appkit-web-examples/tree/main/react/react-core-universal-connector">
Check the WalletConnect App SDK React example
For a quick integration of WalletConnect App SDK you can use the `UniversalConnector` class. Which simplifies the integration of WalletConnect App SDK by providing a single interface for all the blockchain protocols.
You can configure the Universal Connector with the networks you want to support.
For more information, please visit [RPC Reference](https://docs.reown.com/advanced/multichain/rpc-reference/cosmos-rpc) section from our docs.
We recommend creating a config file to establish a singleton instance for the Universal Connector:
```tsx tab="Generic Example"
import type { AppKitNetwork } from '@reown/appkit/networks'
import type { CustomCaipNetwork } from '@reown/appkit-common'
import { UniversalConnector } from '@reown/appkit-universal-connector'
// Get projectId from https://dashboard.walletconnect.com
export const projectId = import.meta.env.VITE_PROJECT_ID || "b56e18d47c72ab683b10814fe9495694" // this is a public projectId only to use on localhost
if (!projectId) {
throw new Error('Project ID is not defined')
}
// you can configure your own network
const suiMainnet: CustomCaipNetwork<'sui'> = {
id: 784,
chainNamespace: 'sui' as const,
caipNetworkId: 'sui:mainnet',
name: 'Sui',
nativeCurrency: { name: 'SUI', symbol: 'SUI', decimals: 9 },
rpcUrls: { default: { http: ['https://fullnode.mainnet.sui.io:443'] } }
}
export const networks = [suiMainnet] as [AppKitNetwork, ...AppKitNetwork[]]
export async function getUniversalConnector() {
const universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['sui_signPersonalMessage'],
chains: [suiMainnet as CustomCaipNetwork],
events: [],
namespace: 'sui'
}
]
})
return universalConnector
}
```
```tsx tab="Stacks Example"
import type { AppKitNetwork } from '@reown/appkit/networks'
import type { InferredCaipNetwork } from '@reown/appkit-common'
import { UniversalConnector } from '@reown/appkit-universal-connector'
// Get projectId from https://dashboard.walletconnect.com
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
// you can configure your own network
const stacksMainnet: InferredCaipNetwork = {
id: 'stacks-mainnet',
chainNamespace: 'stacks' as const,
caipNetworkId: 'stacks:1',
name: 'Stacks Mainnet',
nativeCurrency: { name: 'STX', symbol: 'STX', decimals: 6 },
rpcUrls: { default: { http: ['https://stacks-node-api.mainnet.stacks.co'] } } // Example Stacks Mainnet RPC URL
}
export const networks = [stacksMainnet] as [AppKitNetwork, ...AppKitNetwork[]]
export async function getUniversalConnector() {
const universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['stx_signMessage', 'stx_signTransaction', 'stx_getAccounts', 'stx_getAddresses', 'stx_callContract', 'stx_deployContract', 'sendTransfer', 'getAddresses'],
chains: [stacksMainnet as InferredCaipNetwork],
events: ['stx_chainChanged', 'stx_accountsChanged'],
namespace: 'stacks'
}
]
})
return universalConnector
}
```
```tsx tab="TON Example"
import type { AppKitNetwork } from '@reown/appkit/networks'
import type { CustomCaipNetwork } from '@reown/appkit-common'
import { UniversalConnector } from '@reown/appkit-universal-connector'
// Get projectId from https://dashboard.walletconnect.com
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
const tonMainnet: CustomCaipNetwork<'ton'> = {
id: -239,
chainNamespace: 'ton' as const,
caipNetworkId: 'ton:-239',
name: 'TON',
nativeCurrency: { name: 'TON', symbol: 'TON', decimals: 9 },
rpcUrls: { default: { http: ['https://toncenter.com/api/v2/jsonRPC'] } }
}
export const networks = [tonMainnet] as [AppKitNetwork, ...AppKitNetwork[]]
export async function getUniversalConnector() {
const universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['ton_signData'],
chains: [tonMainnet as CustomCaipNetwork],
events: [],
namespace: 'ton'
}
]
})
return universalConnector
}
```
```tsx tab="TRON Example"
import type { AppKitNetwork } from '@reown/appkit/networks'
import type { CustomCaipNetwork } from '@reown/appkit-common'
import { UniversalConnector } from '@reown/appkit-universal-connector'
// Get projectId from https://dashboard.walletconnect.com
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
const tronMainnet: CustomCaipNetwork<'tron'> = {
id: '0x2b6653dc',
chainNamespace: 'tron' as const,
caipNetworkId: 'tron:0x2b6653dc',
name: 'Tron Mainnet',
nativeCurrency: { name: 'TRX', symbol: 'TRX', decimals: 6 },
rpcUrls: { default: { http: ['https://api.trongrid.io'] } }
}
export const networks = [tronMainnet] as [AppKitNetwork, ...AppKitNetwork[]]
export async function getUniversalConnector() {
const universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['tron_signTransaction', 'tron_signMessage'],
chains: [tronMainnet as CustomCaipNetwork],
events: [],
namespace: 'tron'
}
]
})
return universalConnector
}
```
In the App.tsx file you can add :
```tsx
import { useState, useEffect } from 'react'
import { getUniversalConnector } from './config' // previous config file
import { UniversalConnector } from '@reown/appkit-universal-connector'
export function App() {
const [universalConnector, setUniversalConnector] = useState()
const [session, setSession] = useState()
// Initialize the Universal Connector on component mount
useEffect(() => {
getUniversalConnector().then(setUniversalConnector)
}, [])
// Set the session state in case it changes
useEffect(() => {
setSession(universalConnector?.provider.session)
}, [universalConnector?.provider.session])
```
## Trigger the modal [#trigger-the-modal]
To open the WalletConnect modal you need to call the `connect` function from the Universal Connector.
```tsx
// get the session from the universal connector
const handleConnect = async () => {
if (!universalConnector) {
return
}
const { session: providerSession } = await universalConnector.connect()
setSession(providerSession)
};
// disconnect the universal connector
const handleDisconnect = async () => {
if (!universalConnector) {
return
}
await universalConnector.disconnect()
setSession(null)
};
...
return (
(
)
```
## Smart Contract Interaction [#smart-contract-interaction]
[Wagmi hooks](https://wagmi.sh/react/api/hooks/useReadContract) can help us interact with wallets and smart contracts:
```tsx
import { useReadContract } from "wagmi";
import { USDTAbi } from "../abi/USDTAbi";
const USDTAddress = "0x...";
function App() {
const result = useReadContract({
abi: USDTAbi,
address: USDTAddress,
functionName: "totalSupply",
});
}
```
Read more about Wagmi hooks for smart contract interaction [here](https://wagmi.sh/react/hooks/useReadContract).
[Ethers](https://docs.ethers.org/v6/) can help us interact with wallets and smart contracts:
```tsx
import { useAppKitProvider, useAppKitAccount } from "@reown/appkit/react";
import { BrowserProvider, Contract, formatUnits } from "ethers";
const USDTAddress = "0x617f3112bf5397D0467D315cC709EF968D9ba546";
// The ERC-20 Contract ABI, which is a common contract interface
// for tokens (this is the Human-Readable ABI format)
const USDTAbi = [
"function name() view returns (string)",
"function symbol() view returns (string)",
"function balanceOf(address) view returns (uint)",
"function transfer(address to, uint amount)",
"event Transfer(address indexed from, address indexed to, uint amount)",
];
function Components() {
const { address, isConnected } = useAppKitAccount();
const { walletProvider } = useAppKitProvider("eip155");
async function getBalance() {
if (!isConnected) throw Error("User disconnected");
const ethersProvider = new BrowserProvider(walletProvider);
const signer = await ethersProvider.getSigner();
// The Contract object
const USDTContract = new Contract(USDTAddress, USDTAbi, signer);
const USDTBalance = await USDTContract.balanceOf(address);
console.log(formatUnits(USDTBalance, 18));
}
return ;
}
```
[@Solana/web3.js](https://solana.com/docs/clients/javascript) library allows for seamless interaction with wallets and smart contracts on the Solana blockchain.
For a practical example of how it works, you can refer to our [lab dApp](https://lab.reown.com/appkit/?name=solana).
```tsx
import {
SystemProgram,
PublicKey,
Keypair,
Transaction,
TransactionInstruction,
LAMPORTS_PER_SOL
} from '@solana/web3.js'
import { useAppKitAccount, useAppKitProvider } from '@reown/appkit/react'
import { useAppKitConnection, type Provider } from '@reown/appkit-adapter-solana/react'
function deserializeCounterAccount(data?: Buffer): { count: number } {
if (data?.byteLength !== 8) {
throw Error('Need exactly 8 bytes to deserialize counter')
}
return {
count: Number(data[0])
}
}
const { address } = useAppKitAccount()
const { connection } = useAppKitConnection()
const { walletProvider } = useAppKitProvider('solana')
async function onIncrementCounter() {
const PROGRAM_ID = new PublicKey('Cb5aXEgXptKqHHWLifvXu5BeAuVLjojQ5ypq6CfQj1hy')
const counterKeypair = Keypair.generate()
const counter = counterKeypair.publicKey
const balance = await connection.getBalance(walletProvider.publicKey)
if (balance < LAMPORTS_PER_SOL / 100) {
throw Error('Not enough SOL in wallet')
}
const COUNTER_ACCOUNT_SIZE = 8
const allocIx: TransactionInstruction = SystemProgram.createAccount({
fromPubkey: walletProvider.publicKey,
newAccountPubkey: counter,
lamports: await connection.getMinimumBalanceForRentExemption(COUNTER_ACCOUNT_SIZE),
space: COUNTER_ACCOUNT_SIZE,
programId: PROGRAM_ID
})
const incrementIx: TransactionInstruction = new TransactionInstruction({
programId: PROGRAM_ID,
keys: [
{
pubkey: counter,
isSigner: false,
isWritable: true
}
],
data: Buffer.from([0x0])
})
const tx = new Transaction().add(allocIx).add(incrementIx)
tx.feePayer = walletProvider.publicKey
tx.recentBlockhash = (await connection.getLatestBlockhash('confirmed')).blockhash
await walletProvider.signAndSendTransaction(tx, [counterKeypair])
const counterAccountInfo = await connection.getAccountInfo(counter, {
commitment: 'confirmed'
})
if (!counterAccountInfo) {
throw new Error('Expected counter account to have been created')
}
const counterAccount = deserializeCounterAccount(counterAccountInfo?.data)
if (counterAccount.count !== 1) {
throw new Error('Expected count to have been 1')
}
console.log(`[alloc+increment] count is: ${counterAccount.count}`);
}
```
# Installation (/apps/vue/installation)
WalletConnect App SDK is chain agnostic and provides seamless integration with several blockchain ecosystems. WalletConnect App SDK when combined with Universal Provider library enables compatibility across any blockchain protocol.
## Pre-requisites [#pre-requisites]
This section is to inform you about the pre-requisites for integrating WalletConnect as an App with Vue
### Cloud Configuration [#cloud-configuration]
Create a new project on WalletConnect Dashboard at https://dashboard.walletconnect.com and obtain a new project ID. You will need this project ID to initialize WalletConnect in your project (app).
### Allowlist [#allowlist]
To help prevent malicious use of your project ID, you are strongly encouraged to set an allowlist of [origins](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) where your project ID is used. You can manage your allowlist in the [WalletConnect Dashboard](https://dashboard.walletconnect.com) under the project settings.
The allowlist supports a list of origins in the format `[scheme://]`. Using `localhost` (or `127.0.0.1`) is always permitted, and if the allowlist is empty, all origins are allowed. Updates take 15 minutes to apply.
Examples of possible origins in the allowlist:
- `example.com` - allows `https://example.com` or `http://example.com` but not `https://www.example.com`
- `https://example.com` - allows `https://example.com` but not `http://example.com`
- `https://*.example.com` - allows `https://www.example.com` but not `https://example.com`
Requests from origins not in the allowlist will be denied. Make sure to add all domains where your app will be deployed.
## Installation [#installation]
```bash tab="npm"
npm install @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
```bash tab="Yarn"
yarn add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
```bash tab="Bun"
bun add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
```bash tab="pnpm"
pnpm add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
```
## Implementation [#implementation]
Here is a sample implementation of WalletConnect App SDK with Vue. You can also check the example repository below.
} href="https://github.com/reown-com/appkit-web-examples/tree/main/vue/vue-universal-connector">
Check the WalletConnect App SDK Vue example
For a quick integration of WalletConnect App SDK you can use the `UniversalConnector` class. Which simplifies the integration of WalletConnect App SDK by providing a single interface for all the blockchain protocols.
You can configure the Universal Connector with the networks you want to support.
For more information, please visit [RPC Reference](https://docs.reown.com/advanced/multichain/rpc-reference/cosmos-rpc) section from our docs.
We recommend creating a config file to establish a singleton instance for the Universal Connector:
```tsx tab="Generic Example"
import type { AppKitNetwork } from '@reown/appkit/networks'
import type { CustomCaipNetwork } from '@reown/appkit-common'
import { UniversalConnector } from '@reown/appkit-universal-connector'
// Get projectId from https://dashboard.walletconnect.com
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
const suiMainnet: CustomCaipNetwork<'sui'> = {
id: 784,
chainNamespace: 'sui' as const,
caipNetworkId: 'sui:mainnet',
name: 'Sui',
nativeCurrency: { name: 'SUI', symbol: 'SUI', decimals: 9 },
rpcUrls: { default: { http: ['https://fullnode.mainnet.sui.io:443'] } }
}
export const networks = [suiMainnet] as [AppKitNetwork, ...AppKitNetwork[]]
export async function getUniversalConnector() {
const universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['sui_signPersonalMessage'],
chains: [suiMainnet as CustomCaipNetwork],
events: [],
namespace: 'sui'
}
]
})
return universalConnector
}
```
```tsx tab="Stacks Example"
import type { AppKitNetwork } from '@reown/appkit/networks'
import type { InferredCaipNetwork } from '@reown/appkit-common'
import { UniversalConnector } from '@reown/appkit-universal-connector'
// Get projectId from https://dashboard.walletconnect.com
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
// you can configure your own network
const stacksMainnet: InferredCaipNetwork = {
id: 'stacks-mainnet',
chainNamespace: 'stacks' as const,
caipNetworkId: 'stacks:1',
name: 'Stacks Mainnet',
nativeCurrency: { name: 'STX', symbol: 'STX', decimals: 6 },
rpcUrls: { default: { http: ['https://stacks-node-api.mainnet.stacks.co'] } } // Example Stacks Mainnet RPC URL
}
export const networks = [stacksMainnet] as [AppKitNetwork, ...AppKitNetwork[]]
export async function getUniversalConnector() {
const universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['stx_signMessage', 'stx_signTransaction', 'stx_getAccounts', 'stx_getAddresses', 'stx_callContract', 'stx_deployContract', 'sendTransfer', 'getAddresses'],
chains: [stacksMainnet as InferredCaipNetwork],
events: ['stx_chainChanged', 'stx_accountsChanged'],
namespace: 'stacks'
}
]
})
return universalConnector
}
```
```tsx tab="TON Example"
import type { AppKitNetwork } from '@reown/appkit/networks'
import type { CustomCaipNetwork } from '@reown/appkit-common'
import { UniversalConnector } from '@reown/appkit-universal-connector'
// Get projectId from https://dashboard.walletconnect.com
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
const tonMainnet: CustomCaipNetwork<'ton'> = {
id: -239,
chainNamespace: 'ton' as const,
caipNetworkId: 'ton:-239',
name: 'TON',
nativeCurrency: { name: 'TON', symbol: 'TON', decimals: 9 },
rpcUrls: { default: { http: ['https://toncenter.com/api/v2/jsonRPC'] } }
}
export const networks = [tonMainnet] as [AppKitNetwork, ...AppKitNetwork[]]
export async function getUniversalConnector() {
const universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['ton_signData'],
chains: [tonMainnet as CustomCaipNetwork],
events: [],
namespace: 'ton'
}
]
})
return universalConnector
}
```
```tsx tab="TRON Example"
import type { AppKitNetwork } from '@reown/appkit/networks'
import type { CustomCaipNetwork } from '@reown/appkit-common'
import { UniversalConnector } from '@reown/appkit-universal-connector'
// Get projectId from https://dashboard.walletconnect.com
export const projectId = import.meta.env.VITE_PROJECT_ID || "YOUR_PROJECT_ID_HERE" // Replace with your actual project ID
if (!projectId || projectId === "YOUR_PROJECT_ID_HERE") {
throw new Error('Project ID is not defined. Please set your project ID from the WalletConnect Dashboard.')
}
const tronMainnet: CustomCaipNetwork<'tron'> = {
id: '0x2b6653dc',
chainNamespace: 'tron' as const,
caipNetworkId: 'tron:0x2b6653dc',
name: 'Tron Mainnet',
nativeCurrency: { name: 'TRX', symbol: 'TRX', decimals: 6 },
rpcUrls: { default: { http: ['https://api.trongrid.io'] } }
}
export const networks = [tronMainnet] as [AppKitNetwork, ...AppKitNetwork[]]
export async function getUniversalConnector() {
const universalConnector = await UniversalConnector.init({
projectId,
metadata: {
name: 'Universal Connector',
description: 'Universal Connector',
url: 'https://www.walletconnect.com',
icons: ['https://www.walletconnect.com/icon.png']
},
networks: [
{
methods: ['tron_signTransaction', 'tron_signMessage'],
chains: [tronMainnet as CustomCaipNetwork],
events: [],
namespace: 'tron'
}
]
})
return universalConnector
}
```
In de App.vue file you can add :
```tsx
```
## Trigger the modal [#trigger-the-modal]
To open the WalletConnect modal you need to call the `connect` function from the Universal Connector.
```tsx
...
async handleConnect() {
if (!universalConnector) {
return
}
const { session: providerSession } = await universalConnector.connect()
}
```
## Smart Contract Interaction [#smart-contract-interaction]
[Wagmi actions](https://wagmi.sh/core/api/actions/readContract) can help us interact with wallets and smart contracts:
```html
```
Read more about Wagmi actions for smart contract interaction [here](https://wagmi.sh/core/actions/readContract).
[Ethers](https://docs.ethers.org/v6/) can help us interact with wallets and smart contracts:
```html
```
[@Solana/web3.js](https://solana.com/docs/clients/javascript) library allows for seamless interaction with wallets and smart contracts on the Solana blockchain.
For a practical example of how it works, you can refer to our [lab dApp](https://lab.reown.com/appkit/?name=solana).
```tsx
import { ref } from 'vue';
import {
SystemProgram,
PublicKey,
Keypair,
Transaction,
TransactionInstruction,
LAMPORTS_PER_SOL
} from '@solana/web3.js';
import { useAppKitAccount, useAppKitProvider } from '@reown/appkit/vue'
import { useAppKitConnection, type Provider } from '@reown/appkit-adapter-solana/vue'
export default {
setup() {
const counterMessage = ref('');
const { address } = useAppKitAccount();
const { connection } = useAppKitConnection()
const { walletProvider } = useAppKitProvider('solana')
function deserializeCounterAccount(data) {
if (data?.byteLength !== 8) {
throw Error('Need exactly 8 bytes to deserialize counter');
}
return {
count: Number(data[0])
};
}
async function onIncrementCounter() {
try {
const PROGRAM_ID = new PublicKey('Cb5aXEgXptKqHHWLifvXu5BeAuVLjojQ5ypq6CfQj1hy');
const counterKeypair = Keypair.generate();
const counter = counterKeypair.publicKey;
const balance = await connection.getBalance(walletProvider.publicKey);
if (balance < LAMPORTS_PER_SOL / 100) {
throw Error('Not enough SOL in wallet');
}
const COUNTER_ACCOUNT_SIZE = 8;
const allocIx = SystemProgram.createAccount({
fromPubkey: walletProvider.publicKey,
newAccountPubkey: counter,
lamports: await connection.getMinimumBalanceForRentExemption(COUNTER_ACCOUNT_SIZE),
space: COUNTER_ACCOUNT_SIZE,
programId: PROGRAM_ID
});
const incrementIx = new TransactionInstruction({
programId: PROGRAM_ID,
keys: [
{
pubkey: counter,
isSigner: false,
isWritable: true
}
],
data: Buffer.from([0x0])
});
const tx = new Transaction().add(allocIx).add(incrementIx);
tx.feePayer = walletProvider.publicKey;
tx.recentBlockhash = (await connection.getLatestBlockhash('confirmed')).blockhash;
await walletProvider.signAndSendTransaction(tx, [counterKeypair]);
const counterAccountInfo = await connection.getAccountInfo(counter, {
commitment: 'confirmed'
});
if (!counterAccountInfo) {
throw new Error('Expected counter account to have been created');
}
const counterAccount = deserializeCounterAccount(counterAccountInfo?.data);
if (counterAccount.count !== 1) {
throw new Error('Expected count to have been 1');
}
counterMessage.value = `[alloc+increment] count is: ${counterAccount.count}`;
} catch (error) {
console.error(error);
counterMessage.value = `Error: ${error.message}`;
}
}
return {
onIncrementCounter,
counterMessage
};
}
};
```
# WalletConnect Documentation (/)
WalletConnect Ecosystem Quickstart
WalletConnect powers apps, wallets and end-users via the WalletConnect network.
Resources
}
href="https://walletconnect.com/blog"
>
Read the latest news and updates from the WalletConnect team
}
href="https://discord.walletconnect.network/"
>
Discord community for WalletConnect Network and WCT Token
}
href="https://x.com/WalletConnect"
>
Follow WalletConnect on X (Twitter) to stay updated on the announcements
# License Update (/license-update)
WalletConnect SDKs are now offered under the [WalletConnect Community License](https://github.com/WalletConnect/walletconnect-monorepo/blob/v2.0/LICENSE.md).
The Community License keeps the same open access for developers while adding clear terms that help keep the WalletConnect experience reliable, sustainable, and consistent for developers and end users alike.
Developers may still integrate, experiment, and ship freely. The Community License simply adds clear conditions (like attribution and reasonable infrastructure usage thresholds) to protect service quality and maintain a great developer experience across the WalletConnect ecosystem.
For larger-scale commercial developers, there's a clear path to supplemental licenses for expanded use.
These updates make it easier for everyone to build confidently on stable infrastructure.
See the individual SDKs' READMEs and LICENSEs (e.g., [walletconnect-monorepo](https://github.com/WalletConnect/walletconnect-monorepo)) for more details.
# WCT Smart Contracts (/network/WCT-token/contracts)
Below you can find all the contract addresses for the WalletConnect Token (WCT).
## Deployment Addresses [#deployment-addresses]
### Ethereum Mainnet (Chain ID: 1) [#ethereum-mainnet-chain-id-1]
| Contract | Address | Description |
|----------|---------|-------------|
| WCT Token | [`0xeF4461891DfB3AC8572cCf7C794664A8DD927945`](https://etherscan.io/address/0xeF4461891DfB3AC8572cCf7C794664A8DD927945) | Main WCT token contract |
### Optimism (Chain ID: 10) [#optimism-chain-id-10]
| Contract | Address | Description |
|----------|---------|-------------|
| L2WCT Token | [`0xeF4461891DfB3AC8572cCf7C794664A8DD927945`](https://optimistic.etherscan.io/address/0xeF4461891DfB3AC8572cCf7C794664A8DD927945) | WCT token on Optimism |
| Admin Timelock | [`0x61cc6aF18C351351148815c5F4813A16DEe7A7E4`](https://optimistic.etherscan.io/address/0x61cc6aF18C351351148815c5F4813A16DEe7A7E4) | Admin timelock controller |
| Manager Timelock | [`0xB5EFe3783Db55B913C79CBdB81C9d2C0a993f5f0`](https://optimistic.etherscan.io/address/0xB5EFe3783Db55B913C79CBdB81C9d2C0a993f5f0) | Manager timelock controller |
| WalletConnectConfig | [`0xd2f149fAA66DC4448176123f850C14Ff14f978B3`](https://optimistic.etherscan.io/address/0xd2f149fAA66DC4448176123f850C14Ff14f978B3) | Protocol configuration |
| Pauser | [`0x9163de7F22A9f3ad261B3dBfbB9A42886816adE7`](https://optimistic.etherscan.io/address/0x9163de7F22A9f3ad261B3dBfbB9A42886816adE7) | Emergency pause mechanism |
| StakeWeight | [`0x521B4C065Bbdbe3E20B3727340730936912DfA46`](https://optimistic.etherscan.io/address/0x521B4C065Bbdbe3E20B3727340730936912DfA46) | Manages staking positions |
| StakingRewardDistributor | [`0xF368F535e329c6d08DFf0d4b2dA961C4e7F3fCAF`](https://optimistic.etherscan.io/address/0xF368F535e329c6d08DFf0d4b2dA961C4e7F3fCAF) | Handles rewards distribution |
| Airdrop | [`0x4ee97a759AACa2EdF9c1445223b6Cd17c2eD3fb4`](https://optimistic.etherscan.io/address/0x4ee97a759AACa2EdF9c1445223b6Cd17c2eD3fb4) | Season 1 airdrop distribution |
### Base Mainnet (Chain ID: 8453) [#base-mainnet-chain-id-8453]
| Contract | Address | Description |
|----------|---------|-------------|
| WCT Token | [`0xeF4461891DfB3AC8572cCf7C794664A8DD927945`](https://basescan.org/address/0xeF4461891DfB3AC8572cCf7C794664A8DD927945) | WCT token on Base |
### Solana [#solana]
| Contract | Address | Description |
|----------|---------|-------------|
| WCT Token | [`WCTk5xWdn5SYg56twGj32sUF3W4WFQ48ogezLBuYTBY`](https://explorer.solana.com/address/WCTk5xWdn5SYg56twGj32sUF3W4WFQ48ogezLBuYTBY) | WCT token on Solana |
## Token Information [#token-information]
- Total Supply: 1,000,000,000 WCT (1e27 wei)
# FAQ (/network/WCT-token/faq)
## Frequently Asked Questions [#frequently-asked-questions]
### How does staking work? [#how-does-staking-work]
When you stake WCT, you lock tokens in the protocol to earn rewards and voting power.
Your position remains fully locked and at **constant stakeweight** until you choose to **initiate an unlock**.
Once unlocking begins, your stakeweight **decays linearly** over the selected duration until your tokens become withdrawable.
---
### How do I unstake or exit? [#how-do-i-unstake-or-exit]
You can exit anytime by **initiating an unlocking period**.
Select one of the available durations (e.g., 4, 26, or 52 weeks).
During this time, stakeweight and rewards gradually decrease.
When the period ends, your tokens become **fully withdrawable**.
---
### Which unlock durations are available? [#which-unlock-durations-are-available]
You can choose from predefined options:
**4, 8, 12, 26, 52, 78, or 104 weeks** (≈ 1–24 months).
Shorter unlocks provide flexibility; longer ones grant higher rewards.
---
### How are rewards calculated and distributed? [#how-are-rewards-calculated-and-distributed]
Rewards are distributed **weekly** (Thursday–Thursday) based on your **share of total stakeweight**:
$$
\text{Reward Share} = \frac{\text{Position Stakeweight}}{\text{Total Network Stakeweight}}
$$
Positions created or updated after Thursday 00:00 GMT become eligible in the **next** reward cycle.
---
### How can I increase my rewards? [#how-can-i-increase-my-rewards]
You can earn more by:
- Staking **more WCT**
- Choosing a **longer unlock duration**
- **Re-staking** your weekly rewards to compound your position
- Keeping your position locked (not unlocking) to maintain full stakeweight
---
### What happens if I don’t claim rewards immediately? [#what-happens-if-i-dont-claim-rewards-immediately]
Unclaimed rewards **accumulate automatically** and can be claimed anytime.
There’s **no expiry** or penalty for delayed claiming.
---
### Can I partially unstake my position? [#can-i-partially-unstake-my-position]
No. Partial unstaking is **not supported** — you must withdraw the full position once it’s fully unlocked.
---
### Can I change or extend my staking position? [#can-i-change-or-extend-my-staking-position]
Yes. While locked, you can:
- **Add more WCT** to your existing position
- **Change your unlock preset** to a longer duration
Both actions update your stakeweight accordingly.
Changes made mid-week take effect in the **next reward period**.
---
### Are there any fees? [#are-there-any-fees]
Only regular **gas fees** apply for on-chain transactions such as staking, updating, claiming, or unstaking.
The cost depends on current network conditions.
---
### Can I have multiple staking positions? [#can-i-have-multiple-staking-positions]
Each address can hold **one active position**.
If you want multiple positions with different durations, use multiple wallet accounts or addresses.
---
### Can locked tokens participate in staking? [#can-locked-tokens-participate-in-staking]
Yes. Certain locked allocations (e.g., team or contributor tokens) can be staked and earn rewards even while non-transferable, under their original vesting terms.
This applies only to long-term allocation contracts.
---
### What happens after my unlock finishes? [#what-happens-after-my-unlock-finishes]
When the unlock period ends:
- Your stakeweight and voting power drop to **0**
- You can **withdraw** your full amount
- To continue earning, simply **stake again**
# Governance (/network/WCT-token/governance)
The governance of the WalletConnect Network is structured to facilitate decentralization, transparency, and community participation. This section outlines the roles and responsibilities of the WalletConnect Foundation and the community governance model that guides the Network.
## Foundation [#foundation]
The WalletConnect Foundation is tasked with stewarding the Network by promoting its adoption, use, and growth. The Foundation's responsibilities include overview of grants to stakeholders, supporting applications, sdk and wallet development teams, and managing partnerships.
## Councils [#councils]
The Councils includes several curated groups of individuals who are responsible for the different functions that are either part of the foundation, core development teams, node operator teams or work independently. Envisioned Councils include:
- **Technical Council** - responsible for the technology & infrastructure
- **Partnerships Council** - responsible for the partnerships & growth
This structure is projected to be implemented during the constitution of the community governance.
## Community Governance [#community-governance]
The WalletConnect Network is designed for a fully decentralized governance model managed by community governance. Further decentralization is expected to be facilitated by approved proposals of WCT tokenholders participating in the Network governance.
Optimally this transition occurs through planned, multiple phases. An example of such planned multiple phases follows, though the actual transition will depend on input and approval from WCT tokenholders:
1. **Phase 1 - TGE Preparation:**
- The WalletConnect Foundation was established and began operations.
- The Foundation and reown collaborate on the Network's technical, community, partnerships, and administrative governance.
2. **Phase 2 - Foundation Transition:**
- The Foundation establishes different councils to eventually take over various governance functions.
- The Foundation expands its programs and responsibilities over community, partnerships, and administration considerations for the Network.
- The community governance arises from WCT token stakers who participate in the Network and its governance.
3. **Phase 3 - Partnerships Transition:**
- The Partnerships Council, elected by the community governance, assumes a more prominent role in community initiatives, including marketing, business development, grants programs, education, developer relations, and events.
4. **Phase 4 - Technology Transition:**
- The Technical Council, elected by the community governance, assumes responsibility for technical governance as the Network becomes permissionless.
- The Foundation coordinates this transition.
5. **Phase 5 - Administration Transition:**
- The Foundation requires community governance approval to establish annual budgets, review and elect councils, and handle other administrative responsibilities through voting by community governance delegates.
Token holders can participate in governance starting in Phase 2 after TGE by staking their WCT tokens, proposing changes, and voting on key issues, thereby shaping the future of the WalletConnect Network.
# WCT Token (/network/WCT-token/overview)
The WCT token powers the WalletConnect ecosystem, acting as both a reward and governance mechanism.
## Token Functions [#token-functions]
The WCT token has three primary functions within the WalletConnect Network:
1. **Rewards**: WCT tokens are distributed as cashback, staking rewards, and node operator rewards.
2. **Staking**: Participants can stake WCT tokens to earn rewards and participate in governance.
3. **Governance**: WCT holders can vote on proposals and changes, giving the community control over the Network's development through decentralized governance.
## WCT Allocation [#wct-allocation]
The initial supply of WCT tokens is capped at 1 billion, with the following allocations:
- WalletConnect Foundation: 27%
- Airdrops: 18.5%
- Team: 18.5%
- Rewards: 17.5%
- Previous Backers: 11.5%
- Core Development: 7%
Tokens allocated to core development, team and previous backers will be subject to a 4-year unlock including a 1 year cliff starting at the token generation event (TGE).
## Fixed Supply [#fixed-supply]
The initial design of the WalletConnect Network's tokenomics does not include token inflation. The current model focuses on utilizing existing token allocations such that inflation is not envisioned within the first 3-4 years.
Introduction of an inflationary design would follow only after the token holders' vote to approval following careful consideration of Network metrics, participant feedback, and overall ecosystem health, with specific parameters to be determined through Network governance processes.
## Token Flow [#token-flow]
Payments represent one of the largest economic opportunities in crypto. Global card networks generate hundreds of billions in fee revenue annually — funding rewards programs, interchange, and network operations for every participant. WalletConnect Pay is designed to bring that same model onchain: generate real transaction revenue from real commerce, powered by the WalletConnect Network.
The Network is the primary engine of WalletConnect Pay. The WCT token sits at the centre, connecting payment activity to staking rewards, governance weight, and long-term token value.
### How the Network Powers Value Flows [#how-the-network-powers-value-flows]
Every payment powered by WalletConnect Pay generates transaction fees. Those fees flow back into the Network through multiple mechanisms. Additional mechanisms are expected to be implemented.
**Rewards Distribution** — Fee revenue funds rewards across all four stakeholder groups in the payment flow:
| Stakeholder | How They Earn |
| --- | --- |
| Wallets | Earn interchange on every payment routed through WalletConnect Pay — modelled on card network interchange |
| End Users | Earn cashback-style rewards on every purchase |
### Why This Model Works [#why-this-model-works]
Most alternative payment methods have failed not for technical reasons, but because they gave users no reason to switch. UK Open Banking was technically superior to cards but offered consumers zero upside. CurrentC was backed by the largest US retailers but built solely to save merchants on fees — and died before launch because users had nothing to gain.
WalletConnect Pay is designed around the opposite principle: lead with incentives on every side. The result is a self-reinforcing flywheel — more payments generate more fees, more fees fund better rewards, better rewards drive more payments.
WCT is what holds this flywheel together. Stakers benefit as volume grows. Governance shapes how rewards and buybacks are calibrated over time. The token is not waiting for utility — it is the connective tissue between a payments network and its community of participants.
Merchants pay transaction fees — not users. The end-user experience remains frictionless by design.
# Rewards (/network/WCT-token/rewards)
The WalletConnect Network implements a strategic reward system to incentivize network participants and ensure the network's growth and stability.
## Reward Allocation [#reward-allocation]
17.5% of the initial token supply is allocated for rewards to incentivize Network participants over the first few years of operations. This allocation is strategically phased:
- **First Year**: Only 5% will be distributed to test Network assumptions
- **Subsequent Years**: The remaining 12.5% is reserved
## Phased Distribution [#phased-distribution]
The reward distribution is strategically phased to allow for testing and long-term sustainability:
1. **First Year**: A conservative 5% distribution to test network assumptions and reward mechanisms.
2. **Subsequent Years**: A larger 12.5% allocation, designated as a "flexible incentive" for ongoing distribution.
:::note
The larger portion (12.5%) is a "flexible incentive" and may be subject to change to maintain the reward mechanism's support of Network goals and benefits to all participants. This flexibility ensures that the reward system can adapt to the evolving needs of the Network and its participants.
:::
## Purpose of Rewards [#purpose-of-rewards]
The reward system is designed to:
1. Incentivize active participation in the network
2. Encourage long-term commitment from participants
3. Ensure network security and efficiency
4. Support the overall growth and sustainability of the WalletConnect ecosystem
## Types of Rewards [#types-of-rewards]
The Network includes various types of rewards:
1. **Staking Rewards**: Participants can earn rewards by staking WCT tokens.
2. **Node Rewards**: Service Node operators receive rewards based on their performance and activity.
3. **Wallet Performance Rewards**: Wallets can earn rewards based on their performance and certification status.
4. **End-user Cashback**: Cashback rewards for using WalletConnect Pay.
## Related Topics [#related-topics]
To learn more about specific aspects of the reward system and participation in the WalletConnect Network, please refer to the following sections:
- [Staking](../wct-staking)
- [Service Node Performance Rewards](./service-node-rewards)
# Service Node Rewards (/network/WCT-token/service-node-rewards)
The WalletConnect Network implements a carefully structured reward system for node operators, designed to incentivize high performance and long-term commitment. The node rewards budget is split into two phases, with the first phase addressing the unique challenges of the WCT token non-transferability period.
## Phase 1: Non-Transferability Period [#phase-1-non-transferability-period]
During this initial phase, a fixed-base reward structure is implemented, resulting in the following token-base revenues:
1. **Initial Allocation**: 100,000 WCT are distributed as initial allocation and can be staked. These tokens are locked for the entire period of non-transferability.
2. **Performance Boost (B_n)**: A boost given to nodes to reflect their performance and activity that is not based on WCT price.
### Boost Calculation [#boost-calculation]
The performance boost (B_n) is calculated as follows:
$$B_n = \alpha + (weight \cdot performance score)$$
A multiplicator (M_n) is also applied:
$$M_n = \frac{100000}{T}$$
Where T is the period on which the initial allocation is locked.
### Weight Distribution [#weight-distribution]
The boost is based on the weight of the node relative to other nodes. Initially, if there are 15 nodes, each getting 100,000 WCT, they would each get 6.67% weight. This stake weight evolves if some nodes do not restake their boost.
## Performance-Based Rewards [#performance-based-rewards]
Individual node rewards are conditional on the performance factor $U(i,t) \in [0, 1]$. In line with the performance factors for other groups, there is a set of KPIs defining this. Initially, it will be based on uptime and latency.
For a detailed explanation of how these factors are calculated and weighted, please refer to the [Performance Evaluation](../service-nodes/#performance-evaluation) section.
The reward structure is subject to adjustment through network governance to ensure it continues to align with the network's goals and economic sustainability.
# WCT Staking (/network/WCT-token/staking)
Staking WCT is the primary mechanism through which token holders engage with and support the network by locking their tokens in the protocol's smart contracts. This alignment of interests creates a more secure and participatory ecosystem.
Staking WCT provides three key benefits: voting rights in protocol governance, eligibility for performance rewards programs, and weekly WCT token rewards distributions. These mechanisms allow token holders to participate actively in the protocol while earning additional rewards.
The staking model now uses perpetual positions with user-triggered unlocking. You select an unlock duration up front (from a discrete set of options), but your position stays fully locked and at full stakeweight until you decide to initiate unlock. When you initiate unlock, stakeweight decays linearly over the chosen duration.
## Stake Weight [#stake-weight]
Stakeweight is the measure used to determine a staker's position within the network at any given time. It is derived from two factors: the amount of WCT staked and the remaining lock time of the position. Rewards are distributed proportionally to each staker's share of total network stakeweight, and governance voting power is directly proportional to stakeweight.
### States [#states]
- **Locked (Perpetual):** Your position is active and not unlocking. While locked, the remaining lock time is fixed at your selected unlock duration, so stakeweight does not decay.
- **Unlocking:** You've initiated an unstake. Remaining lock time decreases linearly to zero over the selected unlock duration; stakeweight decays accordingly. When it reaches zero, the position becomes fully withdrawable.
### Calculating Stake Weight [#calculating-stake-weight]
The stakeweight calculation is:
$$
\text{Stakeweight} = \frac{\text{Amount of WCT} \times \text{Remaining Lock Time}}{209}
$$
Where:
- **Amount of WCT:** Number of WCT tokens staked.
- **Remaining Lock Time:**
- **Locked state:** fixed at the **selected unlock duration** (e.g., 52 weeks).
- **Unlocking state:** decays linearly from the selected duration down to 0.
- **209:** Normalization constant for maximum stakeweight.
For example, if a user stakes **1,000 WCT** and has selected a **40-week** unlock duration:
- **Locked:**
$$
\text{Stakeweight} = \frac{1000 \times 40}{209} \approx 191.39
$$
- **Unlocking (halfway through, 20 weeks remaining):**
$$
\text{Stakeweight} = \frac{1000 \times 20}{209} \approx 95.69
$$
While the stakeweight formula uses 209 weeks as the denominator, the current maximum unlock duration you can select is 104 weeks (≈ 2 years).
Due to timestamp rounding, 104 weeks is used to represent 2 years.
### Stakeweight Decay (only during Unlocking) [#stakeweight-decay-only-during-unlocking]
In the **Locked** state, stakeweight remains constant (no decay).
In the **Unstaking** state, **remaining lock time**—and thus stakeweight—decays linearly week by week until it reaches 0 at the end of the unlock duration.
## How to Stake WCT [#how-to-stake-wct]
To stake WCT, visit [**https://app.walletconnect.com/stake**](https://app.walletconnect.com/stake)
The staking flow involves:
- Connect your wallet.
- Select **Stake**.
- Enter the **amount** you want to stake.
- Set the **duration** (this sets the **unstaking period** used when you later exit. The longer the duration, the higher the APY).
- **Approve** the amount — sign the approval with your wallet.
- **Stake** — sign the staking transaction with your wallet.
Your position is perpetually locked until you initiate unstaking. Choosing the unlock duration does not exit you; it sets the duration for a future exit.
## Discrete Unlock Duration Options [#discrete-unlock-duration-options]
To simplify decisions, the unlock duration must be one of:
- **4, 8, 12, 26, 52, 78, or 104 weeks** (≈ 1–24 months)
You can change your preset **while Locked**. The preset determines the **remaining lock time** used for stakeweight in the Locked state and the **length of the decay** once you initiate unstaking.
## Staking Rewards Eligibility [#staking-rewards-eligibility]
Rewards are distributed **weekly**. Each reward period **starts and ends on Thursday (00:00 GMT)**.
To be eligible for a given week:
- Your position must **exist before Thursday 00:00 GMT** of that week; and
- Your position must have **Remaining Lock Time > 0**:
- **Locked:** always eligible.
- **Unlocking:** eligible while **≥ 1 week** remains (once it hits 0, eligibility ends).
### Examples [#examples]
#### Eligible (Locked) [#eligible-locked]
Created on **Wednesday 23:00 GMT**, preset **4 weeks**, not unlocking yet → Eligible for the week starting Thursday 00:00 GMT (position existed before the cutoff and is Locked).
#### Eligible (Unlocking with ≥ 1 week) [#eligible-unlocking-with--1-week]
Initiate unlock on **Monday** with preset **12 weeks** → For subsequent Thursdays while ≥ 1 week remains, the position is eligible (with a decaying stakeweight).
#### Ineligible (Too late) [#ineligible-too-late]
Create a new position at **Thursday 01:00 GMT** → Not eligible for that week (created after the cutoff).
## Position Lifecycle [#position-lifecycle]
### Initiating Unstake (Exit) [#initiating-unstake-exit]
When you're ready to exit:
1. Go to [**https://app.walletconnect.com/stake**](https://app.walletconnect.com/stake)
2. Connect your wallet
3. Click **Unstake**
4. After the unstaking duration ends, you will be able to withdraw your locked tokens.
From that point:
- Remaining lock time **decays linearly** from the unstaking duration selected when the position was created to **0**.
- Stakeweight decays accordingly.
- When it reaches **0**, the position becomes **fully withdrawable**.
### Re-Locking (Stop Decay) [#re-locking-stop-decay]
- While **Unstaking**, you can **Update** your position to return to the **Locked** state.
- When updating your position, you must select a preset that is **≥ the current remaining time** (you can make it **longer**, but not shorter).
- Decay stops immediately; stakeweight snaps back to the fixed value using the new preset.
### Completed Unstake [#completed-unstake]
When remaining lock time reaches **0**:
- Stakeweight and voting power become **0**.
- The position becomes **withdrawable** (full amount; partial withdrawals are not supported).
- After withdrawing, you may create a **new** staking position at any time.
## Updating Your Position [#updating-your-position]
Users can update **active staking** positions at any time:
### Adding WCT [#adding-wct]
Increase your position by depositing more WCT. The added tokens adopt your position's current preset.
### Changing the Unlock Duration Preset [#changing-the-unlock-duration-preset]
While **Staked**, you can change your duration to any of the discrete options **greater than or equal to** your current remaining time. This **does not** initiate unlocking; it only changes the **fixed remaining lock time** used for stakeweight in the Locked state and sets the future unlock duration.
## Claiming Rewards [#claiming-rewards]
Every Thursday, WCT rewards are distributed to eligible positions based on their proportional share of total network stakeweight. If your position's stakeweight represents 5% of the total, you'll receive approximately 5% of that week's distribution.
$$
\text{Reward Share} = \frac{\text{Position Stakeweight}}{\text{Total Network Stakeweight}}
$$
You can claim rewards on your dashboard at any time. When claiming, you may **re-stake** rewards back into the position to grow stakeweight.
Checking in weekly lets you claim and optionally re-stake rewards and adjust your preset, helping you maintain optimal stakeweight.
## Migration Path (Existing Positions) [#migration-path-existing-positions]
To avoid disrupting existing positions at upgrade time:
- Existing positions were treated as **already unlocking** under the new contracts, so they continue to decay and become withdrawable on their original timelines without action required.
- If you prefer the new **perpetual** behavior, select **Update**, choose a duration (you'll be able to select only durations **greater than or equal to** your current remaining lock), then remain **Locked** until you choose to initiate a new unlock.
## Backwards Compatibility / Optionality [#backwards-compatibility--optionality]
Power users can still mimic the old behavior by **initiating unlock immediately after staking**, which starts decay from day one (as before). Otherwise, you enjoy constant stakeweight until you decide to exit.
# Network (/network)
The WalletConnect Network is a network of apps, wallets and chains, facilitating end-users to connect to apps using any supported wallet on any supported chain. It is chain agnostic, working across ecosystems from EVM and its L2s, to Solana, Cosmos, Polkadot, Bitcoin and more. To date, it has facilitated more than 300+ million connections for 50+ million users between over 700+ different wallets and 80,000+ applications.
Since its inception in 2018, the Network's design emphasizes interoperability and composability to efficiently enable interoperability between apps, wallets, fintechs, chains and TradFi.
## Technology [#technology]
The WalletConnect Network's key components include:
1. **Service Nodes**; database nodes that form the backbone of the network's storage layer. They operate on a consistent-hashing based distributed database.
2. **Gateway Nodes**; responsible for facilitating encrypted communications and data routing between wallets and applications.
3. **Relay Service**; connects users' wallets to dapps.
## Permissioned Network [#permissioned-network]
The WalletConnect Network operates in a permissioned environment. This means:
* Specific node operators manage the Service Nodes under service-level agreements.
* The Gateway Nodes are centralized and managed by WalletConnect.
This allows WalletConnect to provide a secure and reliable service for enterprise-grade apps and wallets.
## Network Participants [#network-participants]
The WalletConnect Network comprises various participants, each playing a crucial role in maintaining functionality and security:
1. **Service Node Operators**: They run the service nodes (database nodes) that form the backbone of the network's storage layer. These nodes operate on a consistent-hashing based distributed database.
2. **Gateway Node Operators**: They manage the gateway nodes, which are the entry points for apps and SDKs. Gateways facilitate encrypted communications and data routing between wallets and applications.
3. **Wallets**: These allow end-users to manage their blockchain keys and interact with apps via the WalletConnect protocol. Most wallets integrate with the network using the WalletKit SDK.
4. **Apps**: These are the products and services in the web3 space that drive traffic to the network. They can integrate directly or via available SDKs.
5. **SDKs**: Software Development Kits that simplify the integration process for apps and wallets.
6. **End Users**: The consumers of all services within the network, from wallets to apps, going through the relay and database nodes.
Each of these participants contributes to the ecosystem in unique ways, ensuring the network's functionality, security, and continued growth. Their roles and interactions form the foundation of the WalletConnect Network's robust and interconnected infrastructure.
## Learn more about the WalletConnect Network [#learn-more-about-the-walletconnect-network]
Learn about the WalletConnect network's governance model.
Learn how WCT powers the network's governance and incentivizes participants.
Read more about the network's design, architecture, and core principles.
Read WCT Issuer's MiCA whitepaper for admission to trading.
# Service Nodes (/network/service-nodes)
Service nodes form the backbone of the WalletConnect Network, serving as crucial infrastructure for persisting and managing end-to-end encrypted network messages. These nodes employ rendezvous hashing, a sophisticated method that ensures even distribution of data across the network. This approach not only enhances reliability and fault tolerance but also maintains user privacy by design - service nodes cannot decrypt or read the content of the messages they handle.
## Technical Architecture [#technical-architecture]
The network's architecture is built on the premise that clients may be offline for extended periods. To address this, a "mailbox" system persists messages, allowing clients to retrieve data upon reconnection. This system is underpinned by a database utilizing rendezvous hashing, a concept that has proven its scalability in modern databases including Cassandra, DynamoDB, MongoDB, and others.
The nodes are primarily constructed in Rust, chosen for its performance and safety features. For critical lower-level operations such as bloom-filters and I/O, the nodes integrate RocksDB, an industry-standard implementation maintained by Facebook/Meta. This hybrid approach leverages the strengths of custom-built solutions and battle-tested components.
Current research focuses on evolving the rendezvous hashing-based database into a fully permissionless system. The next milestone is to publish a comprehensive technical design for community review, a crucial step before implementation. In the interim, node access to the network remains permissioned to ensure stability and security.
## Service Node Operators [#service-node-operators]
Service Node Operators play a vital role in the WalletConnect ecosystem. Their responsibilities extend beyond mere node management to include proactive maintenance of high uptime and consistent performance optimization. The barrier to entry - staking WCT tokens - serves a dual purpose: it demonstrates the operator's commitment and aligns their interests with the network's success.
The reward structure for operators is carefully designed to promote both long-term commitment and high-quality service. Staking rewards incentivize sustained participation, while performance-based incentives, calculated using key metrics like uptime and latency, encourage continuous improvement and innovation in node operation.
## Node Statuses [#node-statuses]
The WalletConnect Network implements a dynamic node status system, allowing for flexible and responsive network management:
- **Active**: These nodes are the workhorses of the network, directly processing user requests within their assigned region. The initial target of 15 active nodes balances network robustness with economic efficiency.
- **Reserve**: Operating similarly to active nodes, reserve nodes ensure network resilience. They participate in the replication process and stand ready to step into an active role when needed, maintaining a pool of qualified nodes.
- **Jailed**: This status serves as a temporary penalty for nodes that fail to meet performance standards. The 24-hour exclusion period provides operators time to address issues while protecting the network from underperforming nodes.
- **Standby**: Representing potential capacity, standby nodes have staked tokens but are not actively running. This status allows the network to scale rapidly when demand increases.
- **Deactivated**: This status accommodates operators who choose to cease support, ensuring an orderly exit process that protects both the operator's interests and the network's stability.
| Status | Target Number |
|-------------|----------------|
| Active | 15 |
| Reserve | 6 |
| Jailed | No target |
| Standby | No target |
| Deactivated | No target |
Target numbers are initial values and may be adjusted through governance decisions to optimize network performance and economic sustainability.
## Performance Evaluation [#performance-evaluation]
The sophisticated performance evaluation system is a cornerstone of maintaining the WalletConnect Network's high standards. The performance coefficient $U(i,t) \in [0, 1]$ provides a nuanced measure of each node's contribution:
$$\text{Performance} = (W_u \cdot U_i) \cdot (W_l \cdot L_i)$$
Where $U_i$ represents uptime, $L_i$ denotes latency, and $W_u$ and $W_l$ are adjustable weights. This formula allows for fine-tuning of performance priorities as the network evolves.
## Performance Verification [#performance-verification]
The transition from a permissioned to a permissionless verification system represents a key evolution in the network's maturity:
1. Permissioned Network (Phase 1):
* Trusted oracle nodes conduct performance verification, ensuring a controlled and stable initial environment.
* The oracle node plays a crucial role within the Network. It functions as both a data collector and a regular service operator.
2. Permissionless Network (Phase 2):
* All nodes engage in mutual performance measurement, creating a more decentralized and robust verification system.
* Every node pings and reports on every other node operator, replacing the need for a central oracle.
* This distributed approach enhances the network's resilience and reduces single points of failure.
Key Transition:
* Phase 1: Trusted nodes (oracles) verify performance
* Phase 2: Every node participates in performance measurement
This phased approach allows for gradual decentralization while maintaining network integrity throughout the transition. It enables the network to start with a controlled, easily manageable system and evolve into a more decentralized, robust structure as it matures.
## Slashing Mechanism [#slashing-mechanism]
The slashing mechanism is a critical component in maintaining high network standards:
1. Performance threshold $\tau$ (where $0 < \tau < 1$) is set through governance.
2. Nodes with $U(i,t) < \tau$ trigger a slashing event.
3. The underperforming node is moved to "jailed" status and replaced by a reserve node.
4. Jailed nodes may face a reduction in staked tokens, with the percentage determined by governance.
5. After the jailing period, nodes return to standby status, with the opportunity to re-enter active service.
# WalletConnect Specs (/network/specs)
The WalletConnect Specs document the core WalletConnect protocol — how it's built underneath, at a level of technical detail beyond what's covered in this documentation.
} href="https://specs.walletconnect.com/">
Read the protocol specification.
# Wallets (/network/wallets)
Wallets enable users to manage their blockchain keys and interact with applications via the WalletConnect protocol. They play a vital role in the Network by enabling end-users to securely access and utilize blockchain services on any network. Wallets are responsible for integrating with the WalletConnect Network and providing a seamless user experience for managing digital assets and performing blockchain transactions. Today, reown provides the WalletKit SDK to enable simple integrations for wallets to the Network.
## Certified Wallets [#certified-wallets]
The [WalletConnect Certified](https://walletconnect.com/blog/walletguide-and-walletconnect-certified-the-future-of-digital-wallets) program offers additional incentives for wallets that meet high standards of UX and integration, further encouraging wallets to stay up-to-date with the latest network features and best practices.
## Wallet Rewards [#wallet-rewards]
Wallets participating in the WalletConnect network can earn rewards through staking and performance incentives. To qualify, wallets must stake WCT tokens, which enables them to participate in the Network's governance and earn staking rewards.
For a closer look at the WalletConnect network's wallet rewards system, refer to the [Wallet Rewards](/network/WCT-token/rewards) documentation.
# Get the payment status (/payments/api-reference/2026-02-18/get-v1-gateway-payment-id-status)
# Get a payment (/payments/api-reference/2026-02-18/get-v1-gateway-payment-id)
# Get the payment status (/payments/api-reference/2026-02-18/get-v1-payments-id-status)
# Get payment details (/payments/api-reference/2026-02-18/get-v1-payments-id)
# POST /v1/gateway/payment/{id}/cancel (/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-cancel)
# Confirm a payment (/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-confirm)
# Fetches an action (/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-fetch)
# Get payment options (/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-options)
# POST /v1/gateway/payment/{id}/transition (/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-transition)
# POST /v1/payments/{id}/cancel (/payments/api-reference/2026-02-18/post-v1-payments-id-cancel)
# POST /v1/payments/{id}/transition (/payments/api-reference/2026-02-18/post-v1-payments-id-transition)
# Create a new payment (/payments/api-reference/2026-02-18/post-v1-payments)
# Binance Pay Onchain order-status webhook (/payments/api-reference/2026-02-18/post-v1-webhooks-binance-pay-onchain)
# Binance Pay webhook (single callback) (/payments/api-reference/2026-02-18/post-v1-webhooks-binance-pay)
# Bybit Pay PSP order webhook (/payments/api-reference/2026-02-18/post-v1-webhooks-bybit-pay)
# Get the payment status (/payments/api-reference/2026-02-19.preview/get-v1-gateway-payment-id-status)
# Get a payment (/payments/api-reference/2026-02-19.preview/get-v1-gateway-payment-id)
# Get the payment status (/payments/api-reference/2026-02-19.preview/get-v1-payments-id-status)
# Get payment details (/payments/api-reference/2026-02-19.preview/get-v1-payments-id)
# POST /v1/gateway/payment/{id}/cancel (/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-cancel)
# Confirm a payment (/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-confirm)
# Fetches an action (/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-fetch)
# Get payment options (/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-options)
# POST /v1/gateway/payment/{id}/transition (/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-transition)
# POST /v1/payments/{id}/cancel (/payments/api-reference/2026-02-19.preview/post-v1-payments-id-cancel)
# POST /v1/payments/{id}/transition (/payments/api-reference/2026-02-19.preview/post-v1-payments-id-transition)
# Create a new payment (/payments/api-reference/2026-02-19.preview/post-v1-payments)
# Binance Pay Onchain order-status webhook (/payments/api-reference/2026-02-19.preview/post-v1-webhooks-binance-pay-onchain)
# Binance Pay webhook (single callback) (/payments/api-reference/2026-02-19.preview/post-v1-webhooks-binance-pay)
# Bybit Pay PSP order webhook (/payments/api-reference/2026-02-19.preview/post-v1-webhooks-bybit-pay)
# Authentication (/payments/api-reference/authentication)
Every request to the WalletConnect Pay API is authenticated with an API key, passed in the `Api-Key` header:
```bash
curl "https://api.pay.walletconnect.com/v1/merchants" \
-H "Api-Key: $WCP_API_KEY"
```
API keys are created and managed in the [dashboard](https://merchant.pay.walletconnect.com/en/api-keys). A key is shown only once at creation — store it in a secret manager. Anyone with the key can act on behalf of your account.
## Test and live keys [#test-and-live-keys]
Your account has two kinds of keys, one for each mode:
| Key prefix | Mode | Behavior |
|---|---|---|
| `wcp_test_` | **Test** | Payments are simulated; no funds move. See [Test mode](/payments/test-mode). |
| `wcp_` | **Live** | Real payments with on-chain settlement. |
The key is the **only** thing that selects test or live. Both key types work against the same base URL and the same endpoints, and there is no test flag or mode parameter on any request.
Responses do not say whether a resource is test or live — that's determined by the key that created it.
## Errors [#errors]
| Status | Meaning |
|---|---|
| `401 Unauthorized` | The key is missing, malformed, or revoked. |
| `403 Forbidden` | The key is valid but lacks permission for this account or resource. |
## Key safety [#key-safety]
- **Never expose keys in client-side code.** All API calls should be made from your backend.
- **Use test keys everywhere except production.** Development, CI, and staging should use `wcp_test_` keys.
- **Rotate compromised keys immediately** from the [dashboard](https://merchant.pay.walletconnect.com/en/api-keys).
# API Reference (/payments/api-reference)
This section contains the full WalletConnect Pay API reference, organized by service area.
## Gateway [#gateway]
Endpoints for wallets to fulfill payments (API-first / non-SDK flow): get payment options, fetch actions, confirm payments, check status, and cancel.
If you're looking for the integration overview, start with **[API-first integration (Non-SDK wallets)](/payments/wallets/api-first)**.
## Payments [#payments]
Merchant-facing endpoints for creating and managing payments.
## Webhooks [#webhooks]
Endpoints that payment providers (Binance Pay, Binance Pay Onchain and Bybit Pay) call to report order status. Each request is verified with the provider's signature instead of an API key.
To receive payment events in your own backend, see **[Webhooks](/payments/webhooks)**.
# API Versioning (/payments/api-reference/versioning)
The WalletConnect Pay API uses date-based versions in `YYYY-MM-DD` format. Each version is a stable snapshot of the API's behavior and response shapes.
## How it works [#how-it-works]
When a merchant account is created, it gets pinned to the current API version. All requests from that account use the pinned version by default, so existing integrations keep working without any changes.
You can override the version on any request with the `WCP-Version` header:
```http title="Request header"
POST /v1/payments HTTP/1.1
WCP-Version: 2026-02-04
```
If you omit the header, the request uses your account's pinned version. Overrides can only target versions newer than your pinned version.
To permanently upgrade your pinned version, use the merchant dashboard. Downgrades are not supported.
Use the version selector at the top of these docs to browse the API reference for a specific version.
## Preview versions [#preview-versions]
Preview versions let you test upcoming changes before they reach GA. They use a `.preview` suffix:
```http title="Preview version header"
WCP-Version: 2026-06-01.preview
```
Previews require an explicit header on every request. They are not covered by the same stability guarantees as GA versions, and breaking changes may land with minimal notice.
## Client compatibility requirements [#client-compatibility-requirements]
For the stability guarantees to hold, your client must:
- Ignore unknown fields in API responses. New fields can appear in any version.
- Tolerate unknown enum values. New statuses and types ship without a version bump.
- Handle unknown webhook event types without crashing.
- Treat unrecognized error codes as generic errors rather than hard-failing.
These are all additive, non-breaking changes that apply across versions.
## Breaking vs non-breaking changes [#breaking-vs-non-breaking-changes]
Breaking changes only ship in new dated versions. A change is breaking if it removes or renames a field, changes a field's type, alters default behavior, removes an endpoint, or makes an optional parameter required.
Non-breaking changes apply to all versions: new endpoints, optional parameters, response fields, enum values, webhook types, and error codes. No version bump needed.
# CEX Exchange Integrations (/payments/cex-coverage)
This page outlines the centralized exchanges WalletConnect Pay supports for **Pay with CEX**. When a user selects a supported exchange at checkout, WalletConnect Pay creates the payment order and deeplinks the user into the exchange app to review and approve the payment. The exchange executes the transaction internally and settles funds directly into the merchant's own exchange account. WalletConnect Pay never holds, custodies, or moves funds in this flow. Compliance, KYC, and settlement are handled end-to-end by the exchange.
For merchants, enabling a CEX integration requires onboarding directly with each exchange and activating it via the WalletConnect Pay Merchant Dashboard.
## Supported Exchanges [#supported-exchanges]
| Exchange | Status | Website |
|----------------|---------------|----------------------------------------------|
| Binance Pay | Live | [pay.binance.com](https://pay.binance.com) |
| Crypto.com Pay | Coming Soon | [crypto.com](https://crypto.com) |
| Bybit Pay | Coming Soon | [bybit.com](https://bybit.com) |
| Coinbase | Coming Soon | [coinbase.com](https://coinbase.com) |
| KuCoin Pay | Coming Soon | [kucoin.com](https://kucoin.com) |
| OKX | Coming Soon | [okx.com](https://okx.com) |
| Gate Pay | Coming Soon | [gate.io](https://gate.io) |
| Bitget Pay | Coming Soon | [bitget.com](https://bitget.com) |
| Kraken | Coming Soon | [kraken.com](https://kraken.com) |
| Bitfinex | Coming Soon | [bitfinex.com](https://bitfinex.com) |
| Luno | Coming Soon | [luno.com](https://luno.com) |
## Adding more Central Exchange Integrations [#adding-more-central-exchange-integrations]
WalletConnect Pay can enable additional integrations based on merchant demand and expected volume. If your business needs a specific integration not listed above, [contact us](https://share.hsforms.com/19Dpp4ayYR9uriB3xNAh0JAnxw6s) and we will work with you to enable it.
# Merchant API Reference (/payments/ecommerce/api-reference)
## Authentication [#authentication]
Every request to the Merchant API requires the following headers:
| Header | Required | Description |
|--------|----------|-------------|
| `Content-Type` | Conditional | Must be `application/json` for requests with a JSON body |
| `Api-Key` | Yes | Partner API key from the [Merchant Dashboard](/payments/merchant/onboarding) |
| `Merchant-Id` | Yes | Merchant identifier from the [Merchant Dashboard](/payments/merchant/onboarding) |
Keep your `Api-Key` secret. Never expose it in client-side code — all API calls should be made from your backend server.
## Base URLs [#base-urls]
| Environment | URL |
|-------------|-----|
| Production | `https://api.pay.walletconnect.com` |
| Staging | `https://staging.api.pay.walletconnect.com` |
---
## Create Payment [#create-payment]
Creates a new payment for the buyer to complete on the WalletConnect Pay checkout portal.
```
POST /v1/merchant/payment
```
### Request Body [#request-body]
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `amount` | object | Yes | The payment amount |
| `amount.unit` | string | Yes | Currency in `iso4217/{CODE}` format (e.g., `iso4217/USD`) |
| `amount.value` | string | Yes | Amount in minor units as a string (e.g., `"5000"` for $50.00) |
| `referenceId` | string | Yes | Your internal order or reference identifier |
| `checkout` | object | No | Checkout redirect configuration |
| `checkout.successUrl` | string | No | HTTPS URL to redirect the buyer after a successful payment |
| `checkout.errorUrl` | string | No | HTTPS URL to redirect the buyer after a failed payment |
The `amount.value` is expressed in the currency's **minor units**. For USD, `"5000"` equals $50.00 (5000 cents). For JPY (which has no minor unit), `"5000"` equals ¥5,000.
Both `successUrl` and `errorUrl` must be valid HTTPS URLs. If either is missing or invalid, the redirect feature is disabled entirely for that payment — the checkout portal will show generic terminal views instead.
### Request Example [#request-example]
```json
{
"amount": {
"unit": "iso4217/USD",
"value": "5000"
},
"referenceId": "order_abc123",
"checkout": {
"successUrl": "https://yourstore.com/order/abc123/success",
"errorUrl": "https://yourstore.com/order/abc123/failed"
}
}
```
### Response [#response]
| Field | Type | Description |
|-------|------|-------------|
| `paymentId` | string | Unique payment identifier (e.g., `pay_xxx`) |
| `gatewayUrl` | string | URL to the checkout portal for this payment — use this to redirect the buyer |
| `status` | string | Initial payment status (typically `pending`) |
| `expiresAt` | integer | Unix timestamp (seconds) when the payment expires |
| `isFinal` | boolean | Whether the payment is already in a terminal state |
| `pollInMs` | integer | Suggested polling interval in milliseconds for status checks |
### Response Example [#response-example]
```json
{
"paymentId": "pay_abc123def456",
"gatewayUrl": "https://pay.walletconnect.com/?pid=pay_abc123def456",
"status": "pending",
"expiresAt": 1709831400,
"isFinal": false,
"pollInMs": 1000
}
```
### Code Examples [#code-examples]
```bash tab="cURL"
curl -X POST https://api.pay.walletconnect.com/v1/merchant/payment \
-H "Content-Type: application/json" \
-H "Api-Key: YOUR_API_KEY" \
-H "Merchant-Id: YOUR_MERCHANT_ID" \
-d '{
"amount": {
"unit": "iso4217/USD",
"value": "5000"
},
"referenceId": "order_abc123",
"checkout": {
"successUrl": "https://yourstore.com/order/abc123/success",
"errorUrl": "https://yourstore.com/order/abc123/failed"
}
}'
```
```typescript tab="TypeScript"
const response = await fetch(
"https://api.pay.walletconnect.com/v1/merchant/payment",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"Api-Key": process.env.WCP_API_KEY,
"Merchant-Id": process.env.WCP_MERCHANT_ID,
},
body: JSON.stringify({
amount: {
unit: "iso4217/USD",
value: String(order.totalCents),
},
referenceId: order.id,
checkout: {
successUrl: `${process.env.BASE_URL}/order/${order.id}/success`,
errorUrl: `${process.env.BASE_URL}/order/${order.id}/failed`,
},
}),
}
);
const { paymentId, gatewayUrl } = await response.json();
```
### Error Responses [#error-responses]
| Status Code | Description |
|-------------|-------------|
| `400` | Invalid request — check required fields and format |
| `401` | Invalid or missing API key |
| `404` | Merchant not found for the given `Merchant-Id` |
| `500` | Internal server error |
---
## Verify Payment Status [#verify-payment-status]
After the buyer completes (or abandons) the checkout, verify the payment status from your backend.
```
GET /v1/merchant/payment/{id}/status
```
### Path Parameters [#path-parameters]
| Parameter | Type | Description |
|-----------|------|-------------|
| `id` | string | The `paymentId` returned when creating the payment |
### Headers [#headers]
| Header | Required | Description |
|--------|----------|-------------|
| `Api-Key` | Yes | Partner API key |
| `Merchant-Id` | Yes | Merchant identifier |
### Response [#response-1]
| Field | Type | Description |
|-------|------|-------------|
| `status` | string | Payment status (see below) |
| `isFinal` | boolean | Whether the payment has reached a terminal state |
### Payment Statuses [#payment-statuses]
| Status | Terminal | Description |
|--------|----------|-------------|
| `pending` | No | Payment created, waiting for buyer action |
| `processing` | No | Transaction submitted, awaiting on-chain confirmation |
| `succeeded` | Yes | Payment completed successfully |
| `failed` | Yes | Payment failed or was rejected |
| `expired` | Yes | Payment window closed without completion |
### Code Example [#code-example]
```bash tab="cURL"
curl https://api.pay.walletconnect.com/v1/merchant/payment/pay_abc123def456/status \
-H "Api-Key: YOUR_API_KEY" \
-H "Merchant-Id: YOUR_MERCHANT_ID"
```
```typescript tab="TypeScript"
async function verifyPaymentStatus(paymentId: string): Promise {
const response = await fetch(
`https://api.pay.walletconnect.com/v1/merchant/payment/${paymentId}/status`,
{
headers: {
"Api-Key": process.env.WCP_API_KEY,
"Merchant-Id": process.env.WCP_MERCHANT_ID,
},
}
);
const { status, isFinal } = await response.json();
return status;
}
```
# Online Checkout Integration Guide (/payments/ecommerce/integration)
Integrate WalletConnect Pay into your online checkout so buyers can pay with crypto from any wallet, using the assets they already hold.
## Prerequisites [#prerequisites]
Before you begin, make sure you have:
- **Completed merchant onboarding** — sign up and complete KYB verification on the [Merchant Dashboard](/payments/merchant/onboarding)
- **API Key** — available in your Merchant Dashboard after onboarding (used as the `Api-Key` header)
- **Merchant ID** — your merchant identifier from the Merchant Dashboard
- **A backend server** — all API calls must be made server-side to keep your API Key secure
## How It Works [#how-it-works]
The checkout integration follows a redirect-based flow. Your backend creates a payment, redirects the buyer to the WalletConnect Pay checkout portal, and verifies the result after the buyer returns.
```mermaid
sequenceDiagram
participant B as Buyer
participant MF as Merchant Frontend
participant MB as Merchant Backend
participant API as WalletConnect Pay API
participant BX as Checkout Portal
B->>MF: Click "Pay with Crypto"
MF->>MB: Create payment request
MB->>API: POST /v1/merchant/payment
API-->>MB: { paymentId, gatewayUrl }
MB-->>MF: gatewayUrl
MF->>BX: Redirect buyer to checkout portal
Note over BX,B: Buyer connects wallet, selects payment option, and signs the transaction
alt Payment succeeds
BX->>MF: Redirect to successUrl?payment_id={paymentId}
else Payment fails
BX->>MF: Redirect to errorUrl?payment_id={paymentId}
end
MF->>MB: Verify payment status
MB->>API: GET /v1/merchant/payment/{paymentId}/status
API-->>MB: { status: "succeeded" }
MB-->>MF: Order confirmed
MF->>B: Show order confirmation
```
## Integration Steps [#integration-steps]
### Create a Payment [#create-a-payment]
From your backend, call the Merchant API to create a payment with the order amount and redirect URLs.
```typescript
// Server-side only
const response = await fetch(
"https://api.pay.walletconnect.com/v1/merchant/payment",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"Api-Key": process.env.WCP_API_KEY,
"Merchant-Id": process.env.WCP_MERCHANT_ID,
},
body: JSON.stringify({
amount: {
unit: "iso4217/USD",
value: String(order.totalCents), // e.g., "5000" for $50.00
},
referenceId: order.id,
checkout: {
successUrl: `${process.env.BASE_URL}/order/${order.id}/success`,
errorUrl: `${process.env.BASE_URL}/order/${order.id}/failed`,
},
}),
}
);
const { paymentId, gatewayUrl } = await response.json();
```
Store the `paymentId` in your database alongside the order so you can verify the payment later.
The `amount.value` is in **minor currency units** — for USD, `"5000"` equals $50.00. See the [API Reference](/payments/ecommerce/api-reference) for details.
### Redirect the Buyer [#redirect-the-buyer]
Redirect the buyer to the `gatewayUrl` returned by the API. This takes them to the WalletConnect Pay checkout portal where they can connect their wallet, choose a payment option, and complete the transaction.
```typescript
// Client-side: redirect to checkout portal
window.location.href = gatewayUrl;
```
The checkout portal handles the entire buyer-side payment flow — no additional integration is needed on your end for this step.
### Handle the Return [#handle-the-return]
After the payment completes (or fails), the checkout portal redirects the buyer back to your site:
- **Success**: `{successUrl}?payment_id={paymentId}`
- **Failure**: `{errorUrl}?payment_id={paymentId}`
The redirect happens automatically after a 3-second countdown on the checkout portal.
```typescript
const url = new URL(window.location.href);
const paymentId = url.searchParams.get("payment_id");
if (!paymentId) {
throw new Error("Missing payment_id in redirect URL");
}
const status = await verifyPayment(paymentId);
```
**Never trust the redirect URL alone.** Always look up the expected `paymentId` for the order from your own database and verify it matches the redirect parameter. Verify the payment status server-side before fulfilling any order.
### Verify Payment Status [#verify-payment-status]
From your backend, call the status endpoint to get the authoritative payment result.
```typescript
const order = await getOrderByPaymentId(paymentId);
const response = await fetch(
`https://api.pay.walletconnect.com/v1/merchant/payment/${paymentId}/status`,
{
headers: {
"Api-Key": process.env.WCP_API_KEY,
"Merchant-Id": process.env.WCP_MERCHANT_ID,
},
}
);
const { status, isFinal } = await response.json();
if (status === "succeeded") {
await fulfillOrder(order.id);
} else if (status === "processing") {
// Transaction submitted but not yet confirmed — check again shortly
} else {
// "failed" or "expired" — inform the buyer
}
```
If `isFinal` is `false` (status is `processing`), poll the endpoint at a reasonable interval until the payment reaches a terminal state.
| Status | Terminal | Action |
|--------|----------|--------|
| `succeeded` | Yes | Fulfill the order |
| `failed` | Yes | Show error, offer retry |
| `expired` | Yes | Show expiry message, offer new payment |
| `processing` | No | Poll again after a short delay |
See the full [API Reference](/payments/ecommerce/api-reference) for endpoint details and error codes.
## Checkout URL Requirements [#checkout-url-requirements]
Both `successUrl` and `errorUrl` must be valid **HTTPS** URLs. If either is missing or fails validation, the redirect feature is disabled for that payment — the checkout portal will show a generic success or error message instead.
- The checkout portal appends `?payment_id={id}` to your callback URLs automatically
- There is no `cancelUrl` — if the buyer abandons the flow, they simply close the tab
- Include your order reference in the URL path (e.g., `/order/{orderId}/success`) so you can correlate the redirect with the right order
## Merchant Branding [#merchant-branding]
The checkout portal displays your merchant name and icon to the buyer during the payment flow. These are configured in the [Merchant Dashboard](/payments/merchant/onboarding):
- **`merchant.name`** — displayed in the payment summary
- **`merchant.iconUrl`** — displayed alongside your name
For best results, use a square icon with a minimum size of 72x72px in PNG, SVG, or WebP format.
## Testing [#testing]
Use the staging environment to test your integration before going live:
| Environment | API Base URL |
|-------------|-------------|
| Production | `https://api.pay.walletconnect.com` |
| Staging | `https://staging.api.pay.walletconnect.com` |
Contact the WalletConnect team to obtain staging credentials.
## Example Implementation [#example-implementation]
Complete working reference checkouts are available in the WalletConnect Pay examples repository:
} href="https://github.com/WalletConnect/walletconnect-pay-examples/tree/main/gateway/headless-checkout">
Next.js checkout showing payment creation, checkout redirect, and order verification.
} href="https://github.com/WalletConnect/walletconnect-pay-examples/tree/main/gateway/headless-checkout-vanilla">
Framework-neutral checkout driving the payment flow with vanilla TypeScript.
The example includes:
- **API client** — payment creation with checkout URLs
- **Checkout route** — creates a payment and redirects the buyer
- **Order confirmation page** — receives the redirect and displays order status
# WalletConnect Pay for Ecommerce and Online Checkout (/payments/ecommerce/overview)
WalletConnect Pay enables you to add crypto and stablecoin payments to your online checkout with a single integration, offering a familiar, wallet-based experience for customers worldwide.
Before integrating, complete [merchant onboarding](/payments/merchant/onboarding) to obtain your API Key and Merchant ID.
## How It Works [#how-it-works]
Your backend creates a payment via a single API call and redirects the buyer to the WalletConnect Pay checkout portal. The buyer connects their wallet, selects a payment option, and completes the transaction. After payment, the buyer is redirected back to your site and you verify the result server-side.
1. Your backend calls `POST /v1/merchant/payment` with the order amount and redirect URLs
2. You redirect the buyer to the checkout portal using the `gatewayUrl` from the response
3. The buyer connects their wallet, picks a token and network, and signs the transaction
4. The checkout portal redirects the buyer back to your `successUrl` or `errorUrl`
5. Your backend verifies the payment status via `GET /v1/merchant/payment/{id}/status`
## What does WalletConnect Pay offer for ecommerce? [#what-does-walletconnect-pay-offer-for-ecommerce]
### Any wallet. Any asset. One checkout flow. [#any-wallet-any-asset-one-checkout-flow]
Let customers pay online using the wallets and assets they already use, all through a single, consistent checkout experience.
### A checkout flow that fits existing stacks [#a-checkout-flow-that-fits-existing-stacks]
WalletConnect Pay is designed to fit cleanly into existing checkout and operations workflows. It can align with PSP compliance requirements (like required information capture and screening steps) and follows payment patterns customers already recognize and trust.
### Built-in incentives to encourage usage [#built-in-incentives-to-encourage-usage]
WalletConnect Pay can provide rewards that give customers a reason to choose WalletConnect Pay at checkout—supporting adoption with no added effort from merchants or PSPs.
### Smarter economics for online payments [#smarter-economics-for-online-payments]
Support higher-value online transactions, reduce acceptance costs, and settle faster with flexible crypto or fiat payouts.
### Bring your wallet or pay product to everyday commerce [#bring-your-wallet-or-pay-product-to-everyday-commerce]
Integrate WalletConnect Pay to let your users pay across POS and ecommerce. You keep custody and control of the experience—while WalletConnect Pay handles PSP compatibility behind the scenes.
## Get Started [#get-started]
} href="/payments/ecommerce/integration">
Step-by-step guide to integrate WalletConnect Pay checkout into your site.
} href="/payments/ecommerce/api-reference">
Merchant API endpoint reference for creating and verifying payments.
} href="/payments/merchant/onboarding">
Set up your merchant account and obtain your API credentials.
} href="https://github.com/WalletConnect/walletconnect-pay-examples/tree/main/gateway/headless-checkout">
Next.js reference checkout implementation.
} href="https://github.com/WalletConnect/walletconnect-pay-examples/tree/main/gateway/headless-checkout-vanilla">
Framework-neutral vanilla TypeScript checkout.
# Fiat Coverage (/payments/fiat-coverage)
This page outlines the fiat currencies WalletConnect Pay currently supports for **settlement via offramp**. When a merchant or customer is configured to receive fiat instead of crypto, accepted crypto is converted and paid out in one of the currencies listed below.
For the tokens and chains that can be accepted from the buyer (and which combinations settle to fiat versus direct crypto), see [Token and Chain Coverage](/payments/token-and-chain-coverage).
## Supported fiat currencies [#supported-fiat-currencies]
| Currency | ISO Code | Region |
|----------------|----------|----------|
| US Dollar | USD | Global |
| Euro | EUR | Europe |
| British Pound | GBP | UK |
## Coming soon [#coming-soon]
The following currencies are planned and can be enabled for merchants on request, subject to expected volume.
| Currency | ISO Code | Region |
|----------------------|----------|---------------|
| UAE Dirham | AED | UAE |
| Argentine Peso | ARS | Argentina |
| Australian Dollar | AUD | Australia |
| Bangladeshi Taka | BDT | Bangladesh |
| Brazilian Real | BRL | Brazil |
| Canadian Dollar | CAD | Canada |
| Chilean Peso | CLP | Chile |
| Colombian Peso | COP | Colombia |
| Costa Rican Colón | CRC | Costa Rica |
| Ghanaian Cedi | GHS | Ghana |
| Hong Kong Dollar | HKD | Hong Kong |
| Indonesian Rupiah | IDR | Indonesia |
| Israeli Shekel | ILS | Israel |
| Indian Rupee | INR | India |
| Japanese Yen | JPY | Japan |
| Kenyan Shilling | KES | Kenya |
| South Korean Won | KRW | South Korea |
| Mexican Peso | MXN | Mexico |
| Malaysian Ringgit | MYR | Malaysia |
| Nigerian Naira | NGN | Nigeria |
| Nepalese Rupee | NPR | Nepal |
| Philippine Peso | PHP | Philippines |
| Pakistani Rupee | PKR | Pakistan |
| Singapore Dollar | SGD | Singapore |
| Thai Baht | THB | Thailand |
| Turkish Lira | TRY | Turkey |
| South African Rand | ZAR | South Africa |
## Adding more currencies [#adding-more-currencies]
WalletConnect Pay can enable additional fiat corridors based on merchant demand and expected volume. If your business needs a currency not listed above — for example PLN, CHF, SEK, NOK, DKK, RON, or others — [contact us](https://share.hsforms.com/19Dpp4ayYR9uriB3xNAh0JAnxw6s) with your expected monthly volume and target markets, and we will work with you to enable it.
Fiat coverage will continue to expand as additional offramp corridors are activated and as new partner relationships are integrated.
# How to Pay with WalletConnect Pay (/payments/for-users)
WalletConnect Pay lets you pay with crypto from any wallet, any asset, and on any network.
## What you’ll see at checkout [#what-youll-see-at-checkout]
When a store supports WalletConnect Pay, you’ll typically see a **“Pay with Crypto”** option and one of the following:
- **A WalletConnect QR code** shown on the POS device. You can use any wallet that supports WalletConnect Pay to scan the QR code directly from within the wallet and make the payment.
- **A QR code you can scan with your phone camera**, which opens a payment page on your mobile browser where you can connect your wallet with WalletConnect and make the payment.
## How paying works [#how-paying-works]
1. Scan the QR code with a mobile wallet that supports WalletConnect Pay
1. Or scan the QR code with your mobile camera to open the payment page on your mobile browser and connect your wallet.
2. Your wallet shows the **payment intent** (what you’re paying, how much, and where it’s going).
3. Choose the **token** and **network** you want to use (for example, USDC on Ethereum).
4. Approve the payment in your wallet.
5. Wait for the transaction result and confirmation.
## What to double-check before you approve [#what-to-double-check-before-you-approve]
- **Amount and currency**: make sure it matches what you expect.
- **Network and fees**: fees and confirmation times depend on the network you choose.
- **Where you’re sending funds**: only approve if the payment details look right.
## Your security [#your-security]
WalletConnect Pay never requires your seed phrase. If any page or app asks for it, don’t proceed.
# WalletConnect Pay Documentation (/payments)
WalletConnect Pay
WalletConnect Pay is a complete, end-to-end stablecoin and crypto payment solution that allows PSPs and merchants to enable crypto payments from any wallet and any asset through a single, familiar integration. Choose your integration method below to quickstart.
How does WalletConnect Pay work?
## The merchant presents a WalletConnect QR code with the payment intent. [#the-merchant-presents-a-walletconnect-qr-code-with-the-payment-intent]
## The customer scans the QR code, either with their wallet or with a standard QR scanner [#the-customer-scans-the-qr-code-either-with-their-wallet-or-with-a-standard-qr-scanner]
Scanning with a wallet opens the wallet directly on the payment intent.
Scanning with a QR scanner opens a payment gateway URL pre-filled with the payment intent, where the customer connects their wallet using WalletConnect.
## The wallet displays the payment intent. [#the-wallet-displays-the-payment-intent]
## The customer picks the token and network of their choice and approves the payment. [#the-customer-picks-the-token-and-network-of-their-choice-and-approves-the-payment]
(e.g. The customer may pick USDC on Ethereum or USDT on Arbitrum)
## The wallet builds the transaction and sends it to the network. [#the-wallet-builds-the-transaction-and-sends-it-to-the-network]
## The merchant receives the transaction result and the customer is notified. [#the-merchant-receives-the-transaction-result-and-the-customer-is-notified]
## The merchant then receives stablecoin or fiat settlement from the PSP. [#the-merchant-then-receives-stablecoin-or-fiat-settlement-from-the-psp]
Resources
Learn more about WalletConnect Pay and the wider WalletConnect brand.
}
href="/payments/api-reference"
>
Dive into the API reference to explore more
}
href="https://walletconnect.com/blog"
>
Read the latest news and updates from the WalletConnect team
# Merchant logo specification (/payments/merchant-api/logo-specification)
The `iconUrl` field on the Merchant API accepts a public HTTPS URL pointing to a merchant logo. The logo renders at the moment of payment, so dimensions and format are a direct trust signal. A stretched or pixelated logo undermines buyer confidence at the exact step where confidence matters most.
This guide covers the recommended specification for the `iconUrl` field used by [`POST /v1/merchants`](/payments/api-reference/2026-02-18/post-v1-merchants) (create) and [`PATCH /v1/merchants/{merchantId}`](/payments/api-reference/2026-02-18/patch-v1-merchants-merchantid) (update).
## Where the logo appears [#where-the-logo-appears]
The merchant logo is surfaced at the two main moments of the buyer's payment flow:
### Wallet payment screen [#wallet-payment-screen]
When the buyer scans the WalletConnect QR code, the wallet opens a payment screen with the merchant logo as the primary visual anchor above the amount and selected payment method.
Logos and brands shown are for illustrative purposes only and do not imply affiliation or endorsement.
### Buyer checkout [#buyer-checkout]
On the WalletConnect Pay buyer checkout page (opened when a buyer scans the payment QR with a generic camera or QR scanner), the merchant logo anchors the "Pay X to <Merchant>" headline above the payment options.
Logos and brands shown are for illustrative purposes only and do not imply affiliation or endorsement.
Because the logo renders inside different container shapes across surfaces (square cards on web, rounded squares in wallets), the asset needs to work across all of them. The specification below is designed for that.
## Specification [#specification]
| Field | Value |
|-------|-------|
| Aspect ratio | 1:1 (square), ±5% tolerance |
| Minimum dimensions | 500 × 500 px |
| Recommended dimensions | 1024 × 1024 px |
| Maximum dimensions | 4096 × 4096 px |
| Accepted formats | JPEG, PNG, WebP, AVIF |
| Max file size | 2 MB |
| Transparency | Allowed in PNG and WebP |
### Format guidance [#format-guidance]
- **PNG** or **WebP** for logos with transparent backgrounds.
- **JPEG** for flat photographic logos with no transparency.
- **AVIF** if your asset pipeline already produces it; otherwise prefer PNG.
- **1024 × 1024 px** is the recommended size: it gives retina headroom across surfaces while staying well under the 2 MB cap.
### Why square [#why-square]
Logos render inside square and rounded-square containers across surfaces. Non-square images get center-cropped, and the result is unpredictable: a tall rectangle that looks fine in one wallet may have its bottom half clipped in another. Square assets with the ±5% tolerance render consistently everywhere.
Create a merchant with a logo hosted on your own CDN:
```http
POST /v1/merchants HTTP/1.1
Host: api.pay.walletconnect.com
Authorization: Bearer
Idempotency-Key: 9f1c2e8a-3b6d-4e2a-b1d4-2f0a7c5e8e11
Content-Type: application/json
{
"merchantName": "Acme Store",
"merchantEmail": "billing@acme.store",
"iconUrl": "https://cdn.acme.store/brand/logo-1024.png"
}
```
```http
HTTP/1.1 201 Created
Content-Type: application/json
{
"merchant": {
"id": "mrch_7kBz2qR9xPvLmN4Yw",
"name": "Acme Store",
"email": "billing@acme.store",
"status": "active",
"createdAt": "2026-05-14T10:30:00.000Z"
}
}
```
The URL must be publicly reachable over HTTPS at the time of the call. To change the logo later, call `PATCH /v1/merchants/{merchantId}` with a new `iconUrl`. Simply swapping the asset at your CDN URL will not update what buyers see at checkout.
# Merchant FAQs (/payments/merchant/faqs)
# Quickstart (/payments/merchant/quickstart)
This guide takes you from zero to your first payment in six steps.
Every account has two modes: **test**, where payments are simulated and no funds move, and **live**, where payments execute on-chain for real. Both use the same API — the only difference is which API key you use (`wcp_test_…` vs `wcp_…`). This guide runs through the flow in **test mode first**, so you can build and verify everything safely. See [Test mode](/payments/test-mode) for the full picture.
1. **Create a test API key** in the dashboard.
2. **Authenticate** your requests with the key.
3. **Create your first merchant** via `POST /v1/merchants`.
4. **Configure crypto settlement** via `POST /v1/merchants/{merchantId}/settlements/crypto`.
5. **Create your first payment** via `POST /v1/payments`.
6. **Check the payment status** via `GET /v1/payments/{id}/status`.
Don't have access to the dashboard yet? [Contact sales](https://share.hsforms.com/19Dpp4ayYR9uriB3xNAh0JAnxw6s) to get started.
## Create a test API key [#create-a-test-api-key]
1. Open [**API Keys**](https://merchant.pay.walletconnect.com/en/api-keys) in the dashboard and sign in if prompted.
2. Create a **test key** — it starts with `wcp_test_`. Copy the key — it is shown only once.
3. Store it in a secret manager. Anyone with this key can act on behalf of your account.
With a test key, everything in this guide behaves like production except that no funds move. See [Test mode](/payments/test-mode) for exactly what test payments do and don't do.
## Authenticate [#authenticate]
Every request to the Merchant API uses the `Api-Key` header.
```bash
export WCP_API_KEY="wcp_test_…" # the test key you just created
export WCP_BASE="https://api.pay.walletconnect.com"
```
A quick sanity check — list your merchants:
```bash
curl "$WCP_BASE/v1/merchants" \
-H "Api-Key: $WCP_API_KEY"
```
A `200 OK` with a (possibly empty) `data` array confirms the key works. A `401` means the key is wrong; a `403` means the key is valid but lacks permission for this account.
Pin requests to a specific API version with the `WCP-Version` header (for example, `WCP-Version: 2026-02-18`). Without it, your account's default version is used. See [Versioning](/payments/api-reference/versioning) for the full policy.
## Create your first merchant [#create-your-first-merchant]
A **merchant** is the entity that receives payments. One account can hold many merchants — typically one per brand, storefront, or legal entity.
```bash
curl -X POST "$WCP_BASE/v1/merchants" \
-H "Api-Key: $WCP_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"merchantName": "Acme Store",
"merchantEmail": "billing@acme.store"
}'
```
The response includes the merchant `id` — save it, you'll need it for every payment.
```json
{
"merchant": {
"id": "mrch_7kBz2qR9xPvLmN4Yw",
"name": "Acme Store",
"email": "billing@acme.store",
"status": "active",
"createdAt": "2026-02-18T10:30:00.000Z"
}
}
```
```bash
export WCP_MERCHANT_ID="mrch_7kBz2qR9xPvLmN4Yw"
```
`Idempotency-Key` is required on this endpoint. Use a fresh UUID per merchant — replays with the same key return the original result instead of creating a duplicate.
See the full schema and field reference in [Create a merchant](/payments/api-reference/latest/post-v1-merchants).
## Configure crypto settlement [#configure-crypto-settlement]
Before you can accept payments, tell us where to deliver settled funds. Each settlement entry pairs a [CAIP-19](https://chainagnostic.org/CAIPs/caip-19) `asset` (the token you want to settle in) with a [CAIP-10](https://chainagnostic.org/CAIPs/caip-10) `destination` wallet on the same chain.
```bash
curl -X POST "$WCP_BASE/v1/merchants/$WCP_MERCHANT_ID/settlements/crypto" \
-H "Api-Key: $WCP_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"settlements": [
{
"asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"destination": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678"
}
]
}'
```
The example above registers USDC on Base. For the full list of supported `asset` values and the chains we settle to, see [Token & Chain Coverage](/payments/token-and-chain-coverage).
Each `(merchant, asset)` pair must be unique — registering the same asset twice returns `settlement_asset_conflict`. To change a destination, use [Update a crypto settlement](/payments/api-reference/latest/put-v1-merchants-merchantid-settlements-crypto-id) instead.
See the full schema in [Create crypto settlements](/payments/api-reference/latest/post-v1-merchants-merchantid-settlements-crypto).
## Create your first payment [#create-your-first-payment]
A **payment** is a request for funds against one of your merchants. You pass the merchant via the `Merchant-Id` header and your own order identifier as `referenceId`.
```bash
curl -X POST "$WCP_BASE/v1/payments" \
-H "Api-Key: $WCP_API_KEY" \
-H "Merchant-Id: $WCP_MERCHANT_ID" \
-H "Content-Type: application/json" \
-d '{
"referenceId": "ORDER-123",
"amount": {
"unit": "iso4217/USD",
"value": "100"
}
}'
```
The response includes the payment `id` and a link your buyer can open in any WalletConnect-compatible wallet. Hand that link to your checkout, share it directly, or render it as a QR code.
```bash
export WCP_PAYMENT_ID="pay_…" # from the response above
```
## Check the payment status [#check-the-payment-status]
Poll the status endpoint to know when the payment has completed:
```bash
curl "$WCP_BASE/v1/payments/$WCP_PAYMENT_ID/status" \
-H "Api-Key: $WCP_API_KEY" \
-H "Merchant-Id: $WCP_MERCHANT_ID"
```
```json
{
"status": "succeeded",
"isFinal": true,
"pollInMs": null,
"info": {
"txId": "test:pay_…",
"optionAmount": {
"unit": "caip19/eip155:8453/erc20:0x...",
"value": "1000000"
}
}
}
```
Use `isFinal` to decide when to stop polling. While the payment is still in flight, the response returns `isFinal: false` and a `pollInMs` hint for how long to wait before polling again. Once `isFinal` is `true`, `status` is one of `succeeded`, `failed`, `cancelled`, or `expired` and `pollInMs` is `null`.
In test mode the `txId` is synthetic (`test:{paymentId}`) — no transaction is executed on-chain. Live payments return a real transaction hash.
See the full response schema in [Get the payment status](/payments/api-reference/latest/get-v1-payments-id-status).
## From test to live [#from-test-to-live]
That's the whole flow. Repeating these same six steps with a **live key** (`wcp_` prefix) means every payment you create is a **real payment** — on-chain execution, real funds, real settlement. Nothing else changes: same API, same endpoints, same code. Test-mode data doesn't carry over, so you'll create your merchants and settlement configuration again with the live key.
# How it works (/payments/psps/headless-sdk/how-it-works)
Before you install anything, it helps to understand the shape of the SDK: the stages a payment moves through, how the runtime plugs into your app, and why your WCP API key never reaches the browser.
## The payment lifecycle [#the-payment-lifecycle]
Whatever UI you build, the runtime moves a payment through the same stages. Your job is to render each stage and call the matching action.
### Load the payment [#load-the-payment]
The buyer arrives with a payment ID (from a QR code, link, or your checkout). The runtime fetches the payment intent — amount, merchant, accepted tokens.
### Connect a wallet [#connect-a-wallet]
The buyer connects a wallet through the `WalletProvider` seam. The runtime reads their accounts across the supported networks.
### Fetch payment options [#fetch-payment-options]
Given the connected accounts, WCP returns the concrete ways to pay — token, network, amount, fees, and whether compliance data is required.
### Select & build [#select--build]
The buyer picks an option. The runtime builds the transaction(s) and the exact wallet-RPC actions to sign.
### Sign [#sign]
The `Signer` drives the wallet through the required signatures (e.g. a permit + the payment).
### Confirm & settle [#confirm--settle]
Signed results are submitted to confirm the payment. The runtime then polls status until the payment succeeds, fails, or expires.
## How it fits together [#how-it-fits-together]
The Headless SDK follows a **headless runtime + host** model. The payment flow lives entirely in the SDK; your application is the **host** that consumes it. The runtime reaches the outside world only through five injectable **seams** — so you can swap in your own transport, wallet, timing, and analytics, and reuse the exact same payment machine.
```mermaid
flowchart TD
Host["Your gateway — the host your UI, branding, routing"]
React["@walletconnect/pay-react usePaymentSession"]
State["@walletconnect/pay-state payment runtime"]
Host -->|consumes| React
React -->|drives| State
State -->|reaches the outside world only through seams| Seams
subgraph Seams["Injectable seams"]
direction LR
Transport["Transport"]
Wallet["WalletProvider"]
Signer["Signer"]
Clock["Clock"]
Telemetry["Telemetry"]
end
Transport --> T2["your server → WCP API"]
Wallet --> W2["AppKit / your wallet"]
Signer --> S2["signing strategy"]
Clock --> C2["timers / polling"]
Telemetry --> A2["analytics"]
```
The five seams the runtime depends on:
| Seam | What it abstracts | Provided by |
| ---------------- | ------------------------------------------ | ---------------------------------------------------- |
| `Transport` | WCP HTTP calls | `pay-core` `createHttpTransport` → your server route |
| `WalletProvider` | connect / accounts / provider / switch | `pay-appkit`, or your own wallet integration |
| `Signer` | sign a payment option's wallet-RPC actions | `pay-appkit` `createAppKitSigner` — one call (wraps `pay-state`'s signing; drop to its raw strategies only for a custom, non-AppKit wallet) |
| `Clock` | intervals + page visibility (for polling) | browser timers (the SDK ships a default) |
| `Telemetry` | analytics breadcrumbs | your analytics pipeline (optional) |
`@walletconnect/pay-state` ships browser-ready `Clock` and `Telemetry` defaults (`browserClock`, `noopTelemetry`). In practice a React/Next.js gateway wires just the `Transport` (pointed at your server route); the `WalletProvider` and `Signer` come ready-made from `pay-appkit` (`` + `createAppKitSigner`), and it reuses `browserClock` for the rest. `Telemetry` is optional.
## The WCP API key never reaches the browser [#the-wcp-api-key-never-reaches-the-browser]
The WCP API is authenticated with a secret API key that **must stay server-side**. The SDK enforces this split: the browser talks to *your* server, and your server talks to WCP.
```mermaid
flowchart LR
Browser["Browser Transport seam (no secret)"]
Server["Your server route createEngineClient (holds the API key)"]
Wcp["WalletConnect Pay API"]
Browser -->|"fetch /api/wcp/payment/:id/*"| Server
Server -->|"Api-Key header"| Wcp
```
`pay-core` exposes two entry points for exactly this: `createHttpTransport` for the browser (talks to *your* server) and `createEngineClient` (imported from `@walletconnect/pay-core/server`) which holds the API key and talks to WCP. In a Next.js app, your Route Handler sits in the middle.
## Next steps [#next-steps]
} href="/payments/psps/headless-sdk/implementation">
Build a complete checkout in React / Next.js, step by step.
} href="/payments/psps/headless-sdk/packages-reference">
The public API of pay-core, pay-state, pay-react, and pay-appkit.
# Implementation (/payments/psps/headless-sdk/implementation)
**Prefer to let an AI agent build this?** Install the WalletConnect Pay Headless [skill](https://github.com/WalletConnect/skills/tree/main/skills/walletconnect-pay-headless) — with it loaded, Claude Code, Cursor, Codex, and other agents can scaffold the steps below directly in your codebase:
```bash
npx skills add WalletConnect/skills --skill walletconnect-pay-headless
```
This page walks through building a complete checkout on the Headless SDK, with **React / Next.js** and **JavaScript** examples side by side. New to the SDK? Read [How it works](/payments/psps/headless-sdk/how-it-works) first for the architecture and the role of each seam.
Wallet connection is now **zero-config**: the SDK owns the entire Reown AppKit setup. You install only the `@walletconnect/pay-*` packages and never touch `@reown/*`, `wagmi`, or `viem` directly.
You build three things:
1. A **server proxy** — routes that forward to WCP with your secret key.
2. A **browser transport** — points the runtime at those routes.
3. The **AppKit provider** — one component (`` in React) or one factory call (`createPayAppKit` in JavaScript).
The wallet seam, the signer, and the clock all come from the SDK. Then `usePaymentSession` (React) or `createPaymentController` (JavaScript) ties everything together and gives you a snapshot to render.
The browser never holds the WCP API key. It talks to *your* server, and your server talks to WCP — see [The WCP API key never reaches the browser](/payments/psps/headless-sdk/how-it-works#the-wcp-api-key-never-reaches-the-browser).
## Prerequisites [#prerequisites]
- **Node 18+**. The React example uses **Next.js** (App Router); the JavaScript example is framework-neutral.
- **Headless checkout access** on your WalletConnect Pay account — request it from **Developers → API Keys** in the [dashboard](https://merchant.pay.walletconnect.com/en/api-keys). See [Request access and collect the keys](/payments/psps/headless-sdk/overview#request-access-and-collect-the-keys).
- A **Reown project ID**, shown on the **Headless checkout** card once access is granted (public).
- A **Gateway wallet key** (prefix `wcw_`), created from the same card. Secret — server-side only.
- A **WalletConnect Pay key** (prefix `wcp_`, or `wcp_test_` for [test mode](/payments/test-mode)) from the same **API Keys** section, for creating payments through the Merchant API.
## Install [#install]
Install only the Headless SDK. Wallet connectivity (`@reown/appkit`, `wagmi`, `viem`, `@solana/web3.js`, `@tanstack/react-query`) comes transitively through `@walletconnect/pay-appkit` — you don't add or configure any of it.
```bash
npm install @walletconnect/pay-core @walletconnect/pay-state \
@walletconnect/pay-appkit @walletconnect/pay-react
```
`@walletconnect/pay-react` is the React hook binding — omit it if you're not using React.
## Step 1 — Server proxy (keep the API key server-side) [#step-1--server-proxy-keep-the-api-key-server-side]
Create a server-only module that constructs the WCP client once and forwards calls. The key comes from server env and never ships to the browser. This is framework-agnostic — any server works; the example uses Next.js Route Handlers.
```typescript title="lib/server/wcp.ts"
import 'server-only'
import { createEngineClient } from '@walletconnect/pay-core/server'
const client = createEngineClient({
apiUrl: process.env.WCP_API_URL ?? 'https://staging.api.pay.walletconnect.org',
apiKey: process.env.WCP_WALLET_API_KEY ?? '' // secret — server-side only
})
/** Forward a browser call to WCP and return a WcpResponse-shaped Response. */
export async function callWcp(
path: string,
init: { method: 'GET' | 'POST'; body?: unknown }
): Promise {
const paymentId = path.split('/')[4]! // /v1/gateway/payment/:id/...
let result
if (path.endsWith('/options')) {
result = await client.getPaymentOptions(paymentId, init.body as never)
} else if (path.endsWith('/fetch')) {
result = await client.fetchOptionActions(paymentId, init.body as never)
} else if (path.endsWith('/confirm')) {
result = await client.confirmPayment(paymentId, init.body as never)
} else if (path.endsWith('/status')) {
result = await client.getPaymentStatus(paymentId)
} else {
result = await client.getPayment(paymentId)
}
return Response.json(result)
}
```
Then expose one route per WCP call under `/api/wcp/payment/[id]`. The browser transport (Step 2) calls exactly these paths:
```typescript title="app/api/wcp/payment/[id]/options/route.ts"
import { callWcp } from '@/lib/server/wcp'
export async function POST(req: Request, { params }: { params: Promise<{ id: string }> }) {
const { id } = await params
const body = await req.json()
return callWcp(`/v1/gateway/payment/${id}/options`, { method: 'POST', body })
}
```
```typescript title="app/api/wcp/payment/[id]/status/route.ts"
import { callWcp } from '@/lib/server/wcp'
export async function GET(_req: Request, { params }: { params: Promise<{ id: string }> }) {
const { id } = await params
return callWcp(`/v1/gateway/payment/${id}/status`, { method: 'GET' })
}
```
Create the same handler for each route the transport uses:
| Route Handler | Method | WCP call |
| -------------------------------------- | ------ | ------------------- |
| `app/api/wcp/payment/[id]/route.ts` | `GET` | `getPayment` |
| `app/api/wcp/payment/[id]/options/route.ts` | `POST` | `getPaymentOptions` |
| `app/api/wcp/payment/[id]/fetch/route.ts` | `POST` | `fetchOptionActions` |
| `app/api/wcp/payment/[id]/confirm/route.ts` | `POST` | `confirmPayment` |
| `app/api/wcp/payment/[id]/status/route.ts` | `GET` | `getPaymentStatus` |
These proxy routes are a **starting point**, not production-ready — add your own origin allowlist, rate limiting, and auth before shipping. Their only job here is to keep the WCP key off the browser.
## Step 2 — Browser transport [#step-2--browser-transport]
On the client, point the runtime at your proxy. `createHttpTransport` issues requests to `${baseUrl}/payment/:id/...`, matching the routes above.
```typescript
import { createHttpTransport } from '@walletconnect/pay-core'
const transport = createHttpTransport({ baseUrl: '/api/wcp' })
```
That's the entire `Transport` seam. It speaks the same five methods as the server client, but routes through your origin — no key, no CORS.
## Step 3 — Set up AppKit (zero-config) [#step-3--set-up-appkit-zero-config]
The SDK constructs the AppKit instance, the Wagmi/Solana adapters, and the WalletConnect-owned network set for you, in headless mode (no built-in modal — you render your own wallet picker). You supply only your `projectId` and `metadata`.
In **React**, render `` once near the root. It owns AppKit's client-only construction, the `WagmiProvider` + `QueryClientProvider` tree, and an SSR-safe context. In **JavaScript**, call `createPayAppKit` and `await` its async construction.
```tsx tab="React — components/providers.tsx"
'use client'
import { PayAppKitProvider } from '@walletconnect/pay-appkit/react'
const projectId = process.env.NEXT_PUBLIC_APPKIT_PROJECT_ID ?? ''
export function Providers({ children }: { children: React.ReactNode }) {
return (
{children}
)
}
```
```typescript tab="JavaScript — appkit.ts"
import { createPayAppKit } from '@walletconnect/pay-appkit'
const payAppKit = createPayAppKit({
projectId: import.meta.env.VITE_APPKIT_PROJECT_ID ?? '',
metadata: {
name: 'Acme Pay',
description: 'Headless checkout',
url: window.location.origin,
icons: []
}
})
// Construction is client-only and async — await it before reading the instance.
await payAppKit.whenReady()
export const appKit = payAppKit.getInstance()
```
`` accepts an optional `queryClient` (a host with its own passes it to share one cache; omit it for a fully internal one) and optional `themeVariables` (e.g. a host font). Both `createPayAppKit` and the provider load the Reown modules through a client-only dynamic import, so AppKit's UI never enters your SSR bundle.
## Step 4 — Build the checkout [#step-4--build-the-checkout]
Assemble the seams and drive the session. The **wallet seam** comes from the SDK's wallet-list hook/controller, and the **signer** is a single built-in call — `createAppKitSigner(wallet)` — so you no longer wire up signing strategies by hand. `clock` is `browserClock`.
In React, `useAppKitWalletProvider` turns the AppKit instance into the `WalletProvider` seam **and** a ready-made picker controller (list, search, pagination, the pairing QR URI). Read the instance from `getPayAppKitInstance()` once `usePayAppKit().isReady` is true. In JavaScript, `createAppKitWalletList` is the framework-neutral equivalent.
```tsx tab="React — components/checkout.tsx"
'use client'
import { createHttpTransport } from '@walletconnect/pay-core'
import { createAppKitSigner } from '@walletconnect/pay-appkit'
import {
getPayAppKitInstance,
useAppKitWalletProvider,
usePayAppKit
} from '@walletconnect/pay-appkit/react'
import { browserClock } from '@walletconnect/pay-state'
import { usePaymentSession } from '@walletconnect/pay-react'
import { useMemo } from 'react'
export function Checkout({ paymentId }: { paymentId: string }) {
// The provider constructs AppKit asynchronously; read the instance once it's ready.
const { isReady } = usePayAppKit()
const appKit = isReady ? getPayAppKitInstance() : undefined
// The wallet seam + a ready-made picker (list, search, pagination, QR URI).
const { wallet, wallets, wcUri, getWcUri } = useAppKitWalletProvider(appKit, {
wcPayUrl: typeof window !== 'undefined' ? window.location.href : undefined
})
// Assemble the runtime seams. The signer is one built-in call.
const seams = useMemo(
() => ({
transport: createHttpTransport({ baseUrl: '/api/wcp' }),
clock: browserClock,
signer: createAppKitSigner(wallet)
}),
[wallet]
)
const {
snapshot,
connectWallet,
disconnectWallet,
selectOption,
confirmSelection,
submitInfoCapture
} = usePaymentSession({ paymentId, seams, wallet })
return
{/* render per snapshot.state — see Step 5 */}
}
```
```typescript tab="JavaScript — main.ts"
import { createHttpTransport } from '@walletconnect/pay-core'
import { createAppKitSigner, createAppKitWalletList } from '@walletconnect/pay-appkit'
import { browserClock, createPaymentController } from '@walletconnect/pay-state'
import { appKit } from './appkit'
// The framework-neutral wallet-list controller: list / search / paginate / QR URI /
// connect — and `walletList.wallet`, the seam the runtime drives.
const walletList = createAppKitWalletList(appKit, {
wcPayUrl: window.location.href
})
const wallet = walletList.wallet
const controller = createPaymentController({
paymentId,
wallet,
seams: {
transport: createHttpTransport({ baseUrl: '/api/wcp' }),
clock: browserClock,
signer: createAppKitSigner(wallet)
}
})
controller.subscribe(() => render(controller.getSnapshot()))
controller.start()
```
In React, render the checkout from a route wrapped in your providers:
```tsx title="app/[paymentId]/page.tsx"
import { Checkout } from '@/components/checkout'
import { Providers } from '@/components/providers'
export default async function PaymentPage({ params }: { params: Promise<{ paymentId: string }> }) {
const { paymentId } = await params
return
}
```
## Step 5 — Render the snapshot [#step-5--render-the-snapshot]
`snapshot.state` is a single string you switch on. Each state maps to one piece of UI; the named actions advance the flow. The logic is the same for React and JavaScript — the only difference is where the snapshot comes from (`usePaymentSession` vs `controller.getSnapshot()`).
```tsx
switch (snapshot.state) {
case 'ReadyForWallet':
// Show the QR (from getWcUri/wcUri) and a wallet picker. On pick:
return connectWallet(w, w.namespaces[0])} />
case 'ConnectingWallet':
return
case 'LoadingOptions':
return
case 'OptionsReady':
return (
selectOption(opt, rank)}
/>
)
case 'NoOptions':
return
case 'InformationCapture':
// Render snapshot.collectData.fields, then:
return
case 'OptionSelected':
case 'RequiresApproval':
return (
)
case 'AwaitingWalletApproval':
return
case 'WaitingForConfirmation':
return
case 'Succeeded':
return
case 'Failed':
case 'PaymentExpired':
case 'PaymentCancelled':
case 'InvalidPayment':
case 'SanctionedUser':
return
}
```
That's a full gateway. Connect → options → (optional KYC) → confirm → sign → settle, all driven by the runtime; you only render and call actions. Once a wallet is connected, `disconnectWallet(namespace?)` drops one namespace or all of them.
## Environment variables [#environment-variables]
```bash title=".env.local"
# Reown project ID from the Headless checkout card — wallet connection / QR pairing (public)
NEXT_PUBLIC_APPKIT_PROJECT_ID=
# Gateway wallet key (wcw_…) — server-side only, NEVER exposed to the browser
WCP_API_URL=https://staging.api.pay.walletconnect.org
WCP_WALLET_API_KEY=
```
In a Vite / non-Next.js host, expose the project ID under that toolchain's client env convention (e.g. `VITE_APPKIT_PROJECT_ID`) and keep `WCP_WALLET_API_KEY` on the server only.
## Reference apps [#reference-apps]
} href="https://github.com/WalletConnect/walletconnect-pay-examples/tree/main/gateway/headless-checkout">
The full React checkout — `` + `usePaymentSession`, no `@reown/*` in the app.
} href="https://github.com/WalletConnect/walletconnect-pay-examples/tree/main/gateway/headless-checkout-vanilla">
The same checkout with no framework — `createPaymentController` + manual subscribe + imperative render.
## Next steps [#next-steps]
} href="/payments/psps/headless-sdk/packages-reference">
The full public API of pay-core, pay-state, pay-react, and pay-appkit.
} href="/payments/api-reference/index">
The Gateway and Payments endpoints behind the SDK.
# Headless SDK (/payments/psps/headless-sdk/overview)
**Building with an AI coding agent?** Install the WalletConnect Pay Headless [skill](https://github.com/WalletConnect/skills/tree/main/skills/walletconnect-pay-headless) and your agent (Claude Code, Cursor, Codex, and others) can scaffold this integration for you:
```bash
npx skills add WalletConnect/skills --skill walletconnect-pay-headless
```
The Headless SDK is a set of framework-agnostic [`@walletconnect/pay-*`](https://www.npmjs.com/org/walletconnect) packages that own the WalletConnect Pay (WCP) payment flow while you own the UI. It's the exact runtime that powers our own hosted Buyer Experience — extracted so you can build a fully branded, fully owned checkout on the same runtime.
You get the payment state machine, WCP API client, and wallet orchestration; you bring your own UI, branding, routing, and infrastructure.
**Beta (v0.1.x)** — The Headless SDK is under active development. Public APIs may change between minor releases until 1.0. [Talk to us](https://share.hsforms.com/1XsMCkUxFT2Cte8SCeAh89wnxw6s) before going to production.
## Who is it for? [#who-is-it-for]
- **Payment Service Providers & Acquirers** who want crypto checkout inside their own product, with their own design system and domain — not a redirect to a third-party page.
- **Platforms & marketplaces** embedding pay-with-crypto directly into an existing checkout flow.
- **Teams that need control** over every step of the UX: wallet selection, network/token choice, compliance prompts, success and error states.
If you just want to accept payments with the least effort, use the [hosted gateway](/payments) or the [Ecommerce integration](/payments/ecommerce/overview) instead. Reach for the Headless SDK when you need to **own the experience**.
## What you get [#what-you-get]
}>
The full payment state machine (load → connect → quote → sign → confirm → settle), fully framework-agnostic. No UI imposed.
}>
A zero-dependency client for the WalletConnect Pay API, with the secret API key safely held server-side.
}>
A single `usePaymentSession` hook that projects the runtime into a clean, serializable snapshot plus named actions — zero state-machine internals leak into your components.
}>
A ready-made adapter over [Reown AppKit](https://reown.com/appkit) for wallet connection across EVM and Solana — or bring your own.
## Supported networks & tokens [#supported-networks--tokens]
The Headless SDK supports the full WalletConnect Pay token and network coverage — USDC, USDT, EURC, PYUSD and more across Ethereum, Polygon, Base, Optimism, Arbitrum (and Solana, rolling out). See [Token & chain coverage](/payments/token-and-chain-coverage) for the live list.
## Request access and collect the keys [#request-access-and-collect-the-keys]
The Headless SDK is gated. Access is granted per account from the [WalletConnect Pay dashboard](https://merchant.pay.walletconnect.com/).
### Open Developers → API Keys [#open-developers--api-keys]
Go to **Developers → API Keys** in the dashboard and sign in if prompted.
### Request access on the Headless checkout card [#request-access-on-the-headless-checkout-card]
Find the **Headless checkout** card and click **Request access**. The WalletConnect Pay team reviews the request and gets back to you.
### Collect your credentials [#collect-your-credentials]
Once access is granted, the **Headless checkout** card exposes the credentials for embedding the SDK:
- A **Reown project ID** — used to configure the Headless feature in Reown AppKit. It is public.
- A **Gateway wallet key** button — each key (prefix `wcw_`) authenticates your server against the WalletConnect Pay API.
### Grab your WalletConnect Pay key [#grab-your-walletconnect-pay-key]
In the same **API Keys** section, copy your **WalletConnect Pay key** (prefix `wcp_` for live, `wcp_test_` for test) — the Merchant API key used to create payments. See [Test mode](/payments/test-mode) for the difference between the two.
With the Reown project ID, a Gateway wallet key, and a WalletConnect Pay key, you have everything needed to run the Headless SDK end to end. Map them to environment variables as shown in [Implementation](/payments/psps/headless-sdk/implementation#environment-variables).
## Full example [#full-example]
The fastest way to learn the SDK is to read the reference checkout it's extracted from. Every snippet in these docs comes from it.
} href="https://github.com/WalletConnect/walletconnect-pay-examples/tree/main/gateway/headless-checkout">
A complete, branded Next.js checkout built on the four packages.
## Next steps [#next-steps]
} href="/payments/psps/headless-sdk/how-it-works">
The payment lifecycle, the host + seams model, and how the API key stays server-side.
} href="/payments/psps/headless-sdk/implementation">
Build a complete checkout in React / Next.js, step by step.
# Packages Reference (/payments/psps/headless-sdk/packages-reference)
The runtime is split into layered packages. Each is independently consumable, and lower layers never depend on higher ones — so you can take only what you need.
WCP API client — contract types, CAIP utilities, the browser Transport seam (createHttpTransport), and the server-side createEngineClient that holds your API key. The foundation.
The headless runtime — the payment state machine, orchestration, the injectable seam contracts, the session factory, and the public PaymentSnapshot view-model. No React, no HTTP client, no wallet SDK.
Reown AppKit adapter — implements the WalletProvider seam over a Reown AppKit instance (plus the Solana web3 loader). A /react subpath ships the wallet-connection hook.
pay-state
## `@walletconnect/pay-core` [#walletconnectpay-core]
The foundation: WCP contract types, CAIP utilities, and the `Transport` seam. Zero runtime dependencies. Two entry points — a browser-safe main entry and a server-only `/server` entry that holds the key.
### Browser entry — `@walletconnect/pay-core` [#browser-entry--walletconnectpay-core]
```typescript
import { createHttpTransport, type Transport, type HttpTransportConfig } from '@walletconnect/pay-core'
interface HttpTransportConfig {
baseUrl?: string // default '/api/wcp'
fetch?: typeof fetch
timeoutMs?: number // default 30_000
}
function createHttpTransport(config?: HttpTransportConfig): Transport
```
The `Transport` contract (the seam the runtime depends on) — five methods, each resolving to a `WcpResponse` envelope (never throwing):
```typescript
interface Transport {
getPayment(paymentId): Promise>
getPaymentOptions(paymentId, request): Promise>
fetchOptionActions(paymentId, request): Promise>
confirmPayment(paymentId, request): Promise>
getPaymentStatus(paymentId): Promise>
}
```
Also exported: all WCP contract types (`GetPaymentResponse`, `PaymentOptionExtended`, `Amount`, `CollectData`, `PaymentStatus`, …), CAIP utilities (`parseCaip2`, `parseCaip10`, …), and transport error helpers (`TRANSPORT_ERROR_CODES`, `isAbortError`, `DEFAULT_TIMEOUT_MS`).
### Server entry — `@walletconnect/pay-core/server` [#server-entry--walletconnectpay-coreserver]
```typescript
import { createEngineClient, type EngineClient, type EngineClientConfig, DEFAULT_VERSION } from '@walletconnect/pay-core/server'
interface EngineClientConfig {
apiUrl: string // e.g. https://staging.api.pay.walletconnect.org (no trailing slash)
apiKey: string // your Gateway Api-Key — keep secret, server-side only
version?: string // WCP API version; defaults to DEFAULT_VERSION
fetch?: typeof fetch
timeoutMs?: number // default 30_000
}
function createEngineClient(config: EngineClientConfig): EngineClient
```
`EngineClient` exposes the same five methods as `Transport`, but attaches the secret `Api-Key` and `Wcp-Version` headers and calls WCP directly. Use it only on the server.
## `@walletconnect/pay-state` [#walletconnectpay-state]
The headless runtime: the payment state machine, the injectable seam contracts, the framework-agnostic `PaymentController`, the signing strategies, and the public `PaymentSnapshot` view-model.
### `createPaymentController` [#createpaymentcontroller]
The framework-agnostic binding (the React hook wraps this). Use it directly in a non-React host.
```typescript
import { createPaymentController, type PaymentController, type PaymentControllerOptions } from '@walletconnect/pay-state'
interface PaymentControllerOptions {
paymentId: string
seams: PaymentSessionSeams // { transport, clock, signer?, telemetry? }
wallet: WalletProvider
initialPayment?: GetPaymentResponse
signingTimeoutMs?: number
onMachineEvent?: MachineEventObserver // read-only analytics observer
}
function createPaymentController(options: PaymentControllerOptions): PaymentController
```
```typescript
interface PaymentController {
getSnapshot(): PaymentSnapshot
subscribe(listener: () => void): () => void
start(): void
destroy(): void
// domain actions (see the React hook below for the full list)
connectWallet(wallet, namespace?, options?): void
// …
}
```
### Seams [#seams]
The runtime reaches the outside world only through these contracts:
```typescript
interface PaymentSessionSeams {
transport: Transport // WCP calls (from pay-core)
clock: Clock // intervals + page visibility (for status polling)
signer?: Signer // signing capability — required for an end-to-end payment
telemetry?: Telemetry // optional analytics breadcrumbs
}
interface WalletProvider {
getAccounts(): Partial>
getProvider(network: Caip2 & { namespace: T }): ProviderForNamespace | null
connect(wallet: WalletRef, namespace: Namespace, options?: WalletConnectOptions): Promise
disconnect(namespace?: Namespace): Promise
switchNetwork(caipNetworkId: string): Promise
subscribe(listener: () => void): () => void
}
interface Signer {
signActions(option: PaymentOptionExtended, range?: ActionRange): Promise
}
```
Browser defaults are provided so you only have to inject `transport`, `wallet`, and `signer`:
```typescript
import { browserClock, noopTelemetry, browserDefaults } from '@walletconnect/pay-state'
```
### Signing strategies [#signing-strategies]
AppKit hosts don't need these directly — `@walletconnect/pay-appkit` exports a zero-config `createAppKitSigner(wallet)` that wraps them with the bundled Solana codec. These are the low-level primitives, for a custom wallet integration.
```typescript
import { EvmSigningStrategy, SolanaSigningStrategy, signOptionActions } from '@walletconnect/pay-state'
// Dispatch each of an option's actions to the matching strategy:
signOptionActions(option: PaymentOptionExtended, strategies: SigningStrategy[], range?: ActionRange): Promise
```
### `PaymentSnapshot` [#paymentsnapshot]
The public, serializable view-model. `state` is one of:
| Group | States |
| ----------- | ---------------------------------------------------------------------------------------- |
| Loading | `Initializing` |
| Wallet | `ReadyForWallet`, `ConnectingWallet` |
| Options | `LoadingOptions`, `OptionsReady`, `NoOptions`, `OptionSelected` |
| Compliance | `InformationCapture` |
| Approval | `RequiresApproval`, `AwaitingWalletApproval`, `WaitingForConfirmation` |
| Terminal | `Succeeded`, `Failed`, `PaymentExpired`, `PaymentCancelled`, `InvalidPayment`, `SanctionedUser` |
```typescript
interface PaymentSnapshot {
state: PaymentState
payment?: GetPaymentResponse
options: PaymentOptionExtended[]
selectedOption?: PaymentOptionExtended
collectData?: CollectData | null
wallet: { isConnected: boolean; accounts: string[] }
requiresApproval: boolean
signingError?: { code: string; message?: string }
isQuoteExpired: boolean
profileId?: string
profileNotFound: boolean
// …diagnostic fields
}
```
## `@walletconnect/pay-react` [#walletconnectpay-react]
A single hook — `usePaymentSession` — a `useSyncExternalStore`-based binding over the controller. SSR-safe, tear-free, zero XState leak.
```typescript
import { usePaymentSession, type UsePaymentSessionOptions, type PaymentSessionApi } from '@walletconnect/pay-react'
function usePaymentSession(options: UsePaymentSessionOptions): PaymentSessionApi
```
`UsePaymentSessionOptions` matches `PaymentControllerOptions` (`paymentId`, `seams`, `wallet`, `initialPayment?`, `signingTimeoutMs?`, `onMachineEvent?`). The return is `{ snapshot }` plus the named actions:
| Action | Drives |
| ----------------------------------------------- | ----------------------------------------------- |
| `connectWallet(wallet, namespace?, options?)` | Begin connecting a wallet |
| `disconnectWallet(namespace?)` | Disconnect one namespace, or all |
| `selectOption(option, rank)` | Pick a payment option |
| `confirmSelection()` | Confirm and move toward signing |
| `unselectOption()` | Return to the option list |
| `submitInfoCapture(data)` | Submit collected KYC/contact data |
| `navigateBack()` | Step back |
Plus a **host-orchestration channel** for signals the runtime can't observe itself — `refreshOptions`, `notifyQuoteExpired`, `acknowledgeQuoteExpiry`, `markUserSanctioned`, `setProfileLookup`, `notifyPaymentExpired`, `failWalletConnection`. Most gateways won't need these to start.
## `@walletconnect/pay-appkit` [#walletconnectpay-appkit]
The Reown AppKit adapter — it owns the entire AppKit setup so a host stays `@reown/*`-free. It constructs the instance, implements the `WalletProvider` seam over it, provides a zero-config `Signer`, and ships a headless wallet-picker controller. The main entry is framework-neutral; the React provider + hooks live on `/react`.
### Main entry — `@walletconnect/pay-appkit` [#main-entry--walletconnectpay-appkit]
```typescript
import {
createPayAppKit, // ({ projectId, metadata, themeVariables? }) => PayAppKit (one-call setup)
createAppKitSigner, // (wallet) => Signer (zero-config, bundles the Solana codec)
createAppKitWalletList, // (appKit, options?) => AppKitWalletList (framework-neutral picker)
createAppKitWalletProvider, // (appKit, options?) => WalletProvider
SUPPORTED_NETWORKS, EVM_NETWORKS, // the WC-owned network set (baked in, not host config)
loadSolanaWeb3, // lazy @solana/web3.js codec loader for the Solana signing strategy
applyPlacements, resolvePlacements, // wallet-ordering helpers
type AppKit, // re-exported AppKit instance type — don't import @reown/appkit directly
type PayAppKit, type CreatePayAppKitOptions, type PayAppKitMetadata,
type WalletListItem, type ConnectedWallet, type WalletListState, type WalletListOptions
} from '@walletconnect/pay-appkit'
```
`createPayAppKit` builds the instance with the WC-owned networks + adapters in headless mode. It's **client-only and async** — `await payAppKit.whenReady()`, then read `getInstance()` / `getWagmiConfig()` / `getHooks()` / `getError()` / `isInitialized()`.
`createAppKitWalletList` returns a controller — `wallet` (the seam), `getState()`, `subscribe()`, `fetchWallets()`, `search()`, `loadMore()`, `getWcUri()` — for non-React hosts.
### React entry — `@walletconnect/pay-appkit/react` [#react-entry--walletconnectpay-appkitreact]
The zero-config provider that owns AppKit's construction + the Wagmi/Query tree + an SSR-safe context, plus the state hook and the imperative instance accessor:
```typescript
import {
PayAppKitProvider, //
usePayAppKit, // SSR-safe hook: isReady / account / network / walletConnection / connect / disconnect / …
getPayAppKitInstance, // module-level accessor to the same AppKit instance (for non-hook consumers)
useAppKitWalletProvider,
type AppKitWalletProviderHandle,
type UseAppKitWalletProviderOptions
} from '@walletconnect/pay-appkit/react'
function useAppKitWalletProvider(appKit: AppKit | undefined, options?: UseAppKitWalletProviderOptions): AppKitWalletProviderHandle
```
`useAppKitWalletProvider`'s handle extends `WalletListState` and adds `wallet` (the seam to hand `usePaymentSession`), `searchQuery`/`setSearchQuery` (debounced), `fetchWallets`, `loadMore`, and `getWcUri` for the pairing QR.
## Next steps [#next-steps]
} href="/payments/psps/headless-sdk/implementation">
The step-by-step React / Next.js walkthrough.
} href="/payments/api-reference/index">
The Gateway and Payments endpoints behind the SDK.
# WalletConnect Pay for PSPs (/payments/psps/overview)
WalletConnect Pay lets Payment Service Providers, acquirers, and platforms accept crypto payments on the same runtime that powers our hosted gateway. You choose how much of the experience you own — from a redirect to a hosted page, all the way to a fully branded checkout built inside your own product.
## Two ways to integrate [#two-ways-to-integrate]
}>
Send buyers to `pay.walletconnect.com` and let WalletConnect Pay handle the whole experience — wallet selection, quoting, signing, and settlement. The fastest path to accepting payments, with no UI to build.
} href="/payments/psps/headless-sdk/overview">
Build a **fully branded, fully owned checkout** inside your own product. You get the payment runtime, WCP client, and wallet orchestration as framework-agnostic packages; you bring the UI, branding, and domain.
## Which one is for me? [#which-one-is-for-me]
Reach for the **hosted gateway** if you want to accept payments with the least effort and are happy to send buyers to a WalletConnect-hosted page. See the [hosted gateway overview](/payments) or the [Ecommerce integration](/payments/ecommerce/overview).
Reach for the **Headless SDK** when you need to **own the experience** end to end — wallet selection, network and token choice, compliance prompts, success and error states — all inside your own design system and domain, with no redirect to a third-party page.
The Headless SDK is gated: request access from **Developers → API Keys** in the [dashboard](https://merchant.pay.walletconnect.com/en/api-keys) — see [Request access and collect the keys](/payments/psps/headless-sdk/overview#request-access-and-collect-the-keys).
Both paths run on the same WCP backend and share the same token and network coverage. You can start with the hosted gateway and move to the Headless SDK later without re-doing your backend integration.
## Who is it for? [#who-is-it-for]
- **Payment Service Providers & Acquirers** offering crypto checkout inside their own product, with their own design system and domain.
- **Platforms & marketplaces** embedding pay-with-crypto directly into an existing checkout flow.
- **Teams that need control** over every step of the UX.
## Next steps [#next-steps]
} href="/payments/psps/headless-sdk/overview">
Own the full checkout experience with the `@walletconnect/pay-*` packages.
} href="/payments/api-reference/index">
The Gateway and Payments endpoints behind WalletConnect Pay.
}>
Are you a PSP or acquirer? Tell us what you're building and we'll help you get set up.
# Report an Issue (/payments/report-an-issue)
The WalletConnect Pay Dashboard is your single place to report bugs and share feedback.
## How to Report an Issue [#how-to-report-an-issue]
Follow these steps to get in touch with our support team:
### Log in to the WalletConnect Pay Dashboard [#log-in-to-the-walletconnect-pay-dashboard]
Go to [merchant.pay.walletconnect.com](https://merchant.pay.walletconnect.com/) and log in with your account.
### Open the Help Center [#open-the-help-center]
Once logged in, click the chat bubble in the bottom-right corner of the page, or choose **Report a bug** from the Help Center sidebar.
### Report the issue [#report-the-issue]
From the help desk modal, select:
- **File a bug report** - Submit the issue to our support team.
- **Check our docs** - Browse through our documentation for answers.
Our team will review your submission and get back to you as soon as possible.
## Support Response Times [#support-response-times]
We don't offer guaranteed response times. Our team answers general issues as capacity allows, so replies may take anywhere from a few hours to several days. Thanks for your patience.
# Test mode (/payments/test-mode)
Every WalletConnect Pay account has two modes: **test** and **live**. Test mode lets you build and verify your full integration — merchants, settlement configuration, and payments — without executing anything on-chain.
Throughout these docs and on the hosted payment page, purple indicates test mode. In the dashboard, the **Test / Live** selector at the top shows which mode you're working in.
## How test mode works [#how-test-mode-works]
Test and live are separated at the **account level**, and you choose the mode by **which API key you use**. There is no `test` flag or mode parameter on any request — a payment created with a test key is a test payment, and a payment created with a live key is a live payment.
```mermaid
flowchart LR
subgraph test ["Test mode"]
TK["wcp_test_… key"] --> TP["Test payment"]
TP --> TS["Synthetic settlement (no on-chain execution)"]
end
subgraph live ["Live mode"]
LK["wcp_… key"] --> LP["Live payment"]
LP --> LS["Real on-chain settlement"]
end
API["Same API api.pay.walletconnect.com"] --> TK
API --> LK
style test fill:#F5F3FF,stroke:#7C3AED,color:#5B21B6
style TK fill:#EDE9FE,stroke:#7C3AED,color:#5B21B6
style TP fill:#EDE9FE,stroke:#7C3AED,color:#5B21B6
style TS fill:#EDE9FE,stroke:#7C3AED,color:#5B21B6
```
Both modes use the **same API, the same base URL, and the same endpoints**. Nothing about your code changes between test and live except the key.
| | Test mode | Live mode |
|---|---|---|
| **API key prefix** | `wcp_test_` | `wcp_` |
| **Base URL** | `https://api.pay.walletconnect.com` | `https://api.pay.walletconnect.com` |
| **On-chain execution** | None — settlement is simulated | Real transactions |
| **Transaction hash** | Synthetic (`test:{paymentId}`) | Real on-chain hash |
| **Payment limit** | None | Pilot limit until your account goes live |
| **Data** | Fully separate from live data | Fully separate from test data |
## Test API keys [#test-api-keys]
Test keys are created in the [dashboard](https://merchant.pay.walletconnect.com/en/api-keys), alongside live keys. You can tell them apart by the prefix: test keys always start with `wcp_test_`.
```bash
export WCP_API_KEY="wcp_test_…" # test key — safe to experiment with
export WCP_BASE="https://api.pay.walletconnect.com"
```
Merchants, settlement configurations, and payments created with a test key exist only in test mode. They are never visible to live requests, and vice versa.
API responses do **not** say whether a resource is test or live. The mode is determined entirely by the key that created the resource — if you need to tell test and live data apart in your systems, track which key produced it.
## What test payments do [#what-test-payments-do]
A test payment moves through the same lifecycle as a live payment — created, processing, succeeded — so you can exercise your full integration, including status polling. The differences:
- **No funds move.** Nothing is executed on-chain and no settlement is delivered.
- **The transaction hash is synthetic.** Completed test payments report a `txId` of the form `test:{paymentId}` instead of a real on-chain hash.
- **Amounts are realistic.** Payment options are quoted from the amount you request, converted per token at current exchange rates — the same way live payments are priced.
## Test mode in the dashboard [#test-mode-in-the-dashboard]
You can run the whole test flow from the [dashboard](https://merchant.pay.walletconnect.com) without writing any code.
### Create a test payment [#create-a-test-payment]
1. Switch the dashboard to **Test** with the selector in the top-right corner.
2. If you don't have any merchants in test mode yet, open **Merchants** and click **Create merchant** — give it a name and a contact email. Merchants are separate between test and live, so your live merchants don't appear in test.
3. Open **Payments** and click **Create payment**.
4. Select a merchant and enter any amount — test mode has no payment limit.
5. Click **Create payment**, then **Copy link** to share the payment link or open it yourself.

Create payment in test mode (note the selector on Test, top right) — pick a merchant and enter any amount.
### Simulate status changes [#simulate-status-changes]
Test payments don't move through their lifecycle on their own — you drive them, from either of two places:
- **The hosted payment page** — open the generated payment link. In test mode the page shows a purple banner ("You're in test mode. No real funds move.") and lets you pay with a simulated **Test Wallet**. A floating **Test Console** lets you simulate the transition: **Confirm success**, **Simulate failure**, **Expire payment**, or **Cancel payment**.
- **The dashboard payments list** — in test mode, each payment row has a **Simulation actions** menu (three dots): pick **Mark as [status]** to transition it.

The hosted payment page in test mode — purple banner, Test Wallet, and the Test Console at the bottom.

The Test Console — available actions depend on the payment's current status.

Simulation actions in the dashboard — a processing payment can be marked as succeeded, failed, or expired.
### Allowed status transitions [#allowed-status-transitions]
Whichever surface you use, a test payment can only move along these paths:
```mermaid
stateDiagram-v2
direction LR
requires_action --> processing
requires_action --> expired
requires_action --> cancelled
processing --> succeeded
processing --> failed
processing --> expired
```
Terminal states (`succeeded`, `failed`, `expired`, `cancelled`) have no further actions. This lets you exercise every status your integration needs to handle — including the failure paths that are hard to produce on demand with real payments.
## The pilot limit [#the-pilot-limit]
Test mode has no payment limit — build and verify as much as you need.
**Live mode** starts in **pilot**: live payments are real, but they count toward a total payment limit until your account is taken off pilot. In live mode, the dashboard home shows a **Pilot to Live** card with the limit you have left. When you're ready to process real volume, click **Request to go live** — our team reviews the request and removes the limit.
Switching from test to live is just a key swap: create a **live key** (prefix `wcp_`) in the [dashboard](https://merchant.pay.walletconnect.com/en/api-keys) and use it instead — same API, same endpoints, no code changes. Test-mode data does not carry over, so re-create your merchants and settlement configuration with the live key.
## Next steps [#next-steps]
} href="/payments/merchant/quickstart">
Create your first test payment in six steps.
} href="/payments/api-reference/authentication">
How API keys and the Api-Key header work.
# Token and Chain Coverage (/payments/token-and-chain-coverage)
This page outlines the tokens and blockchains currently supported in General Availability within WalletConnect Pay. It provides a clear view of:
- **Acceptance** — whether a token on a given chain can be accepted from the buyer.
- **Settlement** — what the merchant or customer receives after acceptance, either direct crypto or fiat via an offramp, depending on the customer configuration.
This list will be updated over time as assets move from beta into General Availability and as settlement coverage expands.
## Supported tokens and chains [#supported-tokens-and-chains]
When creating crypto settlements, use the CAIP-19 token identifier below when specifying the settlement token contract. See the [Create crypto settlements](/payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-crypto) endpoint for details.
| Token | Chain | CAIP-19 | Acceptance | Settlement |
|---------|-----------------|---------|:----------:|------------|
| USDC | Arbitrum | `eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831` | ✅ | Direct Crypto or Fiat (USD, EUR) |
| USDC | Base | `eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` | ✅ | Direct Crypto or Fiat (USD, EUR) |
| USDC | Polygon | `eip155:137/erc20:0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359` | ✅ | Direct Crypto or Fiat (USD, EUR) |
| USDC | Ethereum | `eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48` | ✅ | Direct Crypto or Fiat (USD, EUR) |
| USDC | Optimism | `eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85` | ✅ | Direct Crypto |
| USDC | BSC | `eip155:56/erc20:0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d` | ✅ | Direct Crypto |
| USDC | Celo | `eip155:42220/erc20:0xcebA9300f2b948710d2653dD7B07f33A8B32118C` | ✅ | Direct Crypto |
| USDC | Monad | `eip155:143/erc20:0x754704Bc059F8C67012fEd69BC8A327a5aafb603` | ✅ | Direct Crypto |
| USDC | Arc | `eip155:5042/erc20:0x3600000000000000000000000000000000000000` | ✅ | Direct Crypto |
| USDC | Solana | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v` | ✅ | Direct Crypto or Fiat (USD, EUR) |
| USDC | Stellar | `stellar:pubnet/asset:USDC-GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN` | ✅ | Direct Crypto |
| EURC | Base | `eip155:8453/erc20:0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42` | ✅ | Direct Crypto or Fiat (USD, EUR) |
| EURC | Ethereum | `eip155:1/erc20:0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c` | ✅ | Direct Crypto or Fiat (USD, EUR) |
| EURC | Solana | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr` | ✅ | Direct Crypto |
| EURe | Polygon | `eip155:137/erc20:0xE0aEa583266584DafBB3f9C3211d5588c73fEa8d` | ✅ | Direct Crypto |
| EURAU | Ethereum | `eip155:1/erc20:0x4933A85b5b5466Fbaf179F72D3DE273c287EC2c2` | ✅ | Direct Crypto |
| EURAU | Polygon | `eip155:137/erc20:0x4933A85b5b5466Fbaf179F72D3DE273c287EC2c2` | ✅ | Direct Crypto |
| EURAU | Base | `eip155:8453/erc20:0x4933A85b5b5466Fbaf179F72D3DE273c287EC2c2` | ✅ | Direct Crypto |
| EURAU | Arbitrum | `eip155:42161/erc20:0x4933A85b5b5466Fbaf179F72D3DE273c287EC2c2` | ✅ | Direct Crypto |
| EURAU | Optimism | `eip155:10/erc20:0x4933A85b5b5466Fbaf179F72D3DE273c287EC2c2` | ✅ | Direct Crypto |
| CHFAU | Ethereum | `eip155:1/erc20:0xBD4DfC058eb95b8De5ceAF39966A1a70F5556F78` | ✅ | Direct Crypto |
| CHFAU | Polygon | `eip155:137/erc20:0xBD4DfC058eb95b8De5ceAF39966A1a70F5556F78` | ✅ | Direct Crypto |
| CHFAU | Base | `eip155:8453/erc20:0xBD4DfC058eb95b8De5ceAF39966A1a70F5556F78` | ✅ | Direct Crypto |
| AUSD | Ethereum | `eip155:1/erc20:0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a` | ✅ | Direct Crypto |
| AUSD | Arbitrum | `eip155:42161/erc20:0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a` | ✅ | Direct Crypto |
| AUSD | Base | `eip155:8453/erc20:0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a` | ✅ | Direct Crypto |
| AUSD | BSC | `eip155:56/erc20:0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a` | ✅ | Direct Crypto |
| USDG | Ethereum | `eip155:1/erc20:0xe343167631d89B6Ffc58B88d6b7fB0228795491D` | ✅ | Direct Crypto |
| USDG | Robinhood Chain | `eip155:4663/erc20:0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168` | ✅ | Direct Crypto |
| OUSD | Ethereum | `eip155:1/erc20:0x9f6F3991D525015a6F8CaF062C83b62fD3AC4436` | ✅ | Direct Crypto |
| OUSD | Base | `eip155:8453/erc20:0xB2000000000000000000002fEb517dFeC7415344` | ✅ | Direct Crypto |
| PYUSD | Ethereum | `eip155:1/erc20:0x6c3ea9036406852006290770bedfcaba0e23a0e8` | ✅ | Direct Crypto |
| PYUSD | Arbitrum | `eip155:42161/erc20:0x46850ad61c2b7d64d08c9c754f45254596696984` | ✅ | Direct Crypto |
| SoFiUSD | Ethereum | `eip155:1/erc20:0x0CB6d03B0aC88A463F67B7Ad99f9f3ec4678092E` | ✅ | Direct Crypto |
| USAT | Ethereum | `eip155:1/erc20:0x07041776f5007ACa2A54844F50503a18A72A8b68` | ✅ | Direct Crypto |
| USDT | Ethereum | `eip155:1/erc20:0xdAC17F958D2ee523a2206206994597C13D831ec7` | ✅ | Direct Crypto or Fiat (USD, EUR) |
| USDT | Polygon | `eip155:137/erc20:0xc2132D05D31c914a87C6611C10748AEb04B58e8F` | ✅ | Direct Crypto or Fiat (USD, EUR) |
| USDT | Arbitrum | `eip155:42161/erc20:0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9` | ✅ | Direct Crypto |
| USDT | BSC | `eip155:56/erc20:0x55d398326f99059fF775485246999027B3197955` | ✅ | Direct Crypto |
| USDT | Solana | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB` | ✅ | Direct Crypto or Fiat (USD, EUR) |
| USDT | Tron | `tron:0x2b6653dc/trc20:TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t` | ✅ | Direct Crypto |
| ETH | Ethereum | `eip155:1/slip44:60` | ✅ | Direct Crypto |
| ETH | Optimism | `eip155:10/slip44:60` | ✅ | Direct Crypto |
| ETH | Base | `eip155:8453/slip44:60` | ✅ | Direct Crypto |
| ETH | Arbitrum | `eip155:42161/slip44:60` | ✅ | Direct Crypto |
| ETH | Robinhood Chain | `eip155:4663/slip44:60` | ✅ | Direct Crypto |
| BNB | BSC | `eip155:56/slip44:714` | ✅ | Direct Crypto |
| POL | Polygon | `eip155:137/slip44:966` | ✅ | Direct Crypto |
| MON | Monad | `eip155:143/slip44:268435779` | ✅ | Direct Crypto |
| SOL | Solana | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501` | ✅ | Direct Crypto |
| WETH | Ethereum | `eip155:1/erc20:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2` | ✅ | Direct Crypto |
| WETH | Optimism | `eip155:10/erc20:0x4200000000000000000000000000000000000006` | ✅ | Direct Crypto |
| WETH | Base | `eip155:8453/erc20:0x4200000000000000000000000000000000000006` | ✅ | Direct Crypto |
| WETH | Arbitrum | `eip155:42161/erc20:0x82aF49447D8a07e3bd95BD0d56f35241523fBab1` | ✅ | Direct Crypto |
| WPOL | Polygon | `eip155:137/erc20:0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270` | ✅ | Direct Crypto |
| WCT | Ethereum | `eip155:1/erc20:0xeF4461891DfB3AC8572cCf7C794664A8DD927945` | ✅ | Direct Crypto |
| WCT | Optimism | `eip155:10/erc20:0xeF4461891DfB3AC8572cCf7C794664A8DD927945` | ✅ | Direct Crypto |
| WCT | Base | `eip155:8453/erc20:0xeF4461891DfB3AC8572cCf7C794664A8DD927945` | ✅ | Direct Crypto |
| WCT | Solana | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:WCTk5xWdn5SYg56twGj32sUF3W4WFQ48ogezLBuYTBY` | ✅ | Direct Crypto |
## Definitions [#definitions]
### Acceptance [#acceptance]
WalletConnect Pay accepts the token on the specified chain from the buyer as part of the payment flow.
### Settlement [#settlement]
After acceptance, WalletConnect Pay delivers funds to the merchant or customer in one of the following ways:
- **Direct Crypto** — the payment is settled in crypto to the merchant's or customer's wallet. Settlement may involve bridging or swapping before delivery.
- **Fiat (USD, EUR)** — the accepted token can be converted (offramp) into fiat currency (USD or EUR) via partners, with fiat then delivered to the merchant.
Fiat settlement availability depends on offramp partner support per token and chain. Over time, fiat coverage will expand as WalletConnect Pay introduces internal swaps, allowing a broader set of tokens to be converted into supported offramp assets before payout.
# Wallet Coverage (/payments/wallet-coverage)
WalletConnect Pay works with **every WalletConnect-compatible wallet**. Any wallet that has integrated WalletConnect — over 700 today — can be used by a buyer to pay a WCP merchant.
For the full, always-current directory, point your customers at [WalletGuide](https://walletguide.walletconnect.network/).
## Top wallets by usage and volume [#top-wallets-by-usage-and-volume]
The wallets below cover the majority of WCP buyer activity today across EVM, Solana, and Bitcoin ecosystems.
- [MetaMask](https://metamask.io/)
- [Trust Wallet](https://trustwallet.com/)
- [Binance Web3 Wallet](https://www.binance.com/en/web3wallet)
- [Kraken Wallet](https://www.kraken.com/wallet)
- [Ledger](https://www.ledger.com/)
- [SafePal](https://www.safepal.com/)
- [Rainbow](https://rainbow.me/)
- [TokenPocket](https://www.tokenpocket.pro/)
- [Timeless X](https://timelesswallet.xyz/)
- [Safe](https://safe.global/)
- [Zerion](https://zerion.io/)
- [1inch Wallet](https://1inch.io/wallet/)
- [Crypto.com DeFi Wallet](https://crypto.com/defi-wallet)
- [Ronin Wallet](https://roninchain.com/)
- [OKX Wallet](https://www.okx.com/web3)
- [Bitget Wallet](https://web3.bitget.com/)
- [Uniswap Wallet](https://wallet.uniswap.org/)
- [Bybit Wallet](https://www.bybit.com/web3)
- [imToken](https://token.im/)
- [Fireblocks](https://www.fireblocks.com/)
- [CTRL](https://ctrl.xyz/)
- [Blockchain.com Wallet](https://www.blockchain.com/wallet)
- [Rakuten Wallet](https://wallet.rakuten.co.jp/)
- [BitPay](https://bitpay.com/wallet/)
- [xPortal](https://xportal.com/)
- [Bitcoin.com Wallet](https://www.bitcoin.com/wallet)
- [Bifrost](https://bifrostwallet.com/)
- [Best Wallet](https://bestwallet.com/)
- [Phantom](https://phantom.com/)
- [Solflare](https://www.solflare.com/)
## Wallet support is chain-dependent [#wallet-support-is-chain-dependent]
Wallet support is chain-dependent. Even when a wallet is listed on WalletGuide, it only works on the chains the wallet itself supports. When picking a wallet for a specific buyer cohort, always check the wallet's chain coverage against the chains your merchant accepts. See [Token and Chain Coverage](/payments/token-and-chain-coverage) for the chains WCP accepts today.
## Find a wallet [#find-a-wallet]
} href="https://walletguide.walletconnect.network/">
Browse 700+ WalletConnect-compatible wallets and filter by chain or device.
# API-first integration (Non-SDK wallets) (/payments/wallets/api-first)
If you're integrating WalletConnect Pay into a wallet **without using the Wallet Pay SDK**, you can use an API-first approach via the **Gateway API**.
This flow is centered around **three Gateway calls**:
- **Get payment options**: list options the user can complete with their wallet/accounts
- **Fetch an action**: resolve "build" actions into wallet RPC actions when needed
- **Confirm a payment**: submit the selected option and the executed action results
## Prerequisites [#prerequisites]
- **API key**: request access from WalletConnect
- You can do this by filling out [**this form**](https://share.hsforms.com/19Dpp4ayYR9uriB3xNAh0JAnxw6s) and getting in touch with our team.
- **Required headers** on each request:
- `Api-Key` — your API key
## Payment flow [#payment-flow]
The payment flow mirrors the SDK flow, but you call the Gateway API directly:
**Get Options → (Collect Data) → (Fetch Actions) → Execute Wallet RPC → Confirm Payment**
```mermaid
sequenceDiagram
participant User
participant Wallet
participant Gateway as WalletConnect Pay (Gateway API)
participant Chain as Wallet RPC / Chain
User->>Wallet: Scan QR / Open payment link
Wallet->>Gateway: POST /v1/gateway/payment/{id}/options (accounts)
Gateway-->>Wallet: options[] (+ optional info/collectData)
Wallet->>User: Display payment options
User->>Wallet: Select payment option
alt Selected option requires data collection
Wallet->>User: Load selectedOption.collectData.url in WebView
User->>Wallet: Fill form & accept T&C (IC_COMPLETE)
end
alt Option includes a build action
Wallet->>Gateway: POST /v1/gateway/payment/{id}/fetch (optionId, data)
Gateway-->>Wallet: actions[] (walletRpc)
end
Wallet->>User: Request signature(s) / transaction(s)
User->>Wallet: Approve
Wallet->>Chain: Execute wallet RPC actions (in order)
Chain-->>Wallet: Results (e.g., signature(s) / tx hash(es))
Wallet->>Gateway: POST /v1/gateway/payment/{id}/confirm (optionId, results, collectedData?)
Gateway-->>Wallet: status + isFinal (+ pollInMs)
Wallet->>User: Show result / status
```
## Understanding `actions` [#understanding-actions]
Payment options can include an `actions[]` array. Each action tells your wallet what needs to happen next.
- **`walletRpc` actions**
- The Gateway gives you a wallet RPC payload (`chain_id`, `method`, `params`)
- Your wallet should execute it (sign / send), then record the output to submit in `results[]`
- **`build` actions**
- The action is not directly executable by the wallet
- Call **Fetch an action** to convert the `build` payload into one or more **`walletRpc`** actions
Maintain action ordering. The `results[]` you submit in **Confirm a payment** must correspond to the actions you executed, in order.
## High-level steps [#high-level-steps]
### 1) Get payment options [#1-get-payment-options]
Call **Get payment options** for the given `paymentId`, passing a list of accounts (CAIP-10 / chain namespace format as provided by your wallet).
- Use this response to render:
- payment details (optionally, if `includePaymentInfo=true`)
- available `options[]` the user can pick from
- required `actions[]` for the chosen option
### 2) Fetch an action (only if required) [#2-fetch-an-action-only-if-required]
If an option contains an action of type **`build`**, call **Fetch an action** with that `optionId` and the `data` payload to resolve it into one or more executable actions (typically `walletRpc`).
### 3) Confirm a payment [#3-confirm-a-payment]
After your wallet executes the required `walletRpc` actions (sign/submit), call **Confirm a payment** with:
- the selected `optionId`
- `results[]`: the output from each executed action (in the same order you performed them)
- optional `collectedData` if the options response requested additional user info
If you used the **WebView-based data collection** flow (i.e., displayed `collectData.url` in a WebView), there is no need to send `collectedData` in the confirm request — the WebView submits user data directly to the backend.
If `isFinal` is `false`, the response may include `pollInMs`. Use it to decide when to check again (see the API Reference for status/polling behavior).
The WalletConnect Pay SDKs support **WebView-based data collection**. Each payment option may have its own `collectData.url`. When present on a selected option, wallets can display this URL in a WebView instead of building native forms. The WebView handles form rendering, validation, and T&C acceptance, and submits data directly to the backend. See the [platform-specific SDK documentation](/payments/wallets/overview) for implementation details.
## Integration guidelines [#integration-guidelines]
These guidelines reflect the patterns used internally by the WalletConnect Pay SDK. Following them ensures a smooth, reliable UX.
### Payment link detection [#payment-link-detection]
Payment links can arrive in several formats. Your wallet should detect and extract the `paymentId` from:
| Format | Example |
|--------|---------|
| WC Pay URL (path) | `https://pay.walletconnect.com/pay_123` |
| WC Pay URL (query) | `https://pay.walletconnect.com/?pid=pay_123` |
| `wc:` URI with `pay=` param | `wc:abc@2?pay=https%3A%2F%2Fpay.walletconnect.com%2F%3Fpid%3Dpay_123` |
| Bare payment ID | `pay_123` |
Only trust `pay.walletconnect.com` and `*.pay.walletconnect.com` as valid WC Pay hosts. Always validate the domain before extracting a payment ID.
Check for payment links **before** handling generic URLs or WalletConnect pairing URIs. Payment links are HTTPS URLs that would otherwise open in a browser.
### Providing accounts [#providing-accounts]
Pass all of the user's accounts in **CAIP-10 format** (`eip155:{chainId}:{address}`) when calling **Get payment options**. Include accounts for every supported chain to maximize the number of payment options returned.
### Resolving `build` actions [#resolving-build-actions]
When an option's `actions[]` contains a `build` action, it cannot be executed directly. Call **Fetch an action** (`POST /v1/gateway/payment/{id}/fetch`) with the `optionId` and the build action's `data` string. The response will contain one or more `walletRpc` actions that your wallet can execute.
A single `build` action may resolve into multiple `walletRpc` actions. Always iterate over the full response.
### Executing wallet RPC actions [#executing-wallet-rpc-actions]
Each `walletRpc` action contains:
- `chain_id` — the chain to execute on (CAIP-2 format, e.g., `eip155:8453`)
- `method` — the RPC method (e.g., `eth_signTypedData_v4`, `eth_sendTransaction`, `personal_sign`)
- `params` — JSON-encoded parameters
Execute each action in order using your wallet's signing or transaction implementation. For signing methods (e.g., `eth_signTypedData_v4`), collect the signature hex string. For transaction methods (e.g., `eth_sendTransaction`), collect the transaction hash. Store each result for submission.
Payment options may include multiple actions with different RPC methods. For example, a Permit2 payment where the user lacks sufficient token allowance for Permit2 returns two actions: an `eth_sendTransaction` to approve the token allowance, followed by an `eth_signTypedData_v4` to sign the Permit2 transfer. Your wallet must check each action's `method` field and dispatch to the appropriate handler. For full implementation guidance, see [USDT support](/payments/wallets/token-chain-support/usdt-support).
Actions are not limited to the `eip155` (EVM) namespace. **Solana** actions arrive as `walletRpc` actions with `chain_id` in the `solana:` namespace and `method: solana_signTransaction`. Route each action by the namespace in its `chain_id`, sign with the matching wallet, and return the **base64-encoded signed transaction** (not a detached signature) in `results[]`. Do not broadcast — the backend submits the transaction. For full implementation guidance, see [Solana support](/payments/wallets/token-chain-support/solana-support).
### Submitting results [#submitting-results]
When calling **Confirm a payment**, wrap each signature as a `walletRpc` result:
```json
{
"optionId": "opt_123",
"results": [
{ "type": "walletRpc", "data": ["0x"] },
{ "type": "walletRpc", "data": ["0x"] }
]
}
```
The `results[]` array **must** match the `actions[]` array in both length and order. Misalignment causes payment failures.
### Polling for final status [#polling-for-final-status]
After **Confirm a payment** returns, check the `isFinal` field:
- **`isFinal: true`** — the payment has reached a terminal state (`succeeded`, `failed`, or `expired`). No further action needed.
- **`isFinal: false`** — the payment is still processing. Use the `pollInMs` value from the response as the delay before your next confirm call.
Use the `maxPollMs` query parameter on the confirm request to enable **server-side long-polling** — the server will hold the connection and return as soon as the status changes or the timeout expires, reducing the number of round-trips.
```
POST /v1/gateway/payment/{id}/confirm?maxPollMs=30000
```
### Retry strategy [#retry-strategy]
Implement retries with **exponential backoff and jitter** for resilience:
- **Retry only on** server errors (5xx) and network failures (connection refused, timeout)
- **Do not retry** client errors (4xx) — these indicate invalid input and won't succeed on retry
- **Recommended**: 3 retries with 100ms initial backoff, doubling each attempt, plus random jitter
### Data collection [#data-collection]
Data collection is per-option — each payment option may independently have a `collectData` object. When the user selects an option, check `option.collectData`:
| Response `collectData` | `option.collectData` | Behavior |
|---|---|---|
| present | present | Option requires IC — use `option.collectData.url` |
| present | `null` | Option does NOT require IC (others might) — skip IC for this option |
| `null` | `null` | No IC needed for any option |
If the selected option's `collectData` has a `url` field, display it in a WebView before confirming. The URL is already scoped to that option's account. The WebView handles form rendering, validation, and T&C acceptance. When the WebView signals completion (`IC_COMPLETE` via JS bridge), proceed to confirm — no need to include `collectedData` in the request.
If you choose not to use the WebView and instead build your own form, use the `collectData.schema` JSON schema to determine the required fields, collect the values, and pass them as `collectedData` in the confirm request.
### Expiration handling [#expiration-handling]
Payments have an expiration timestamp (`expiresAt` in the payment info). Display a countdown or warning to the user when time is running low, and prevent submission after expiry.
If a payment or route expires mid-flow, the API returns a `410` (payment expired) or `409` (route expired) error. Handle these gracefully by informing the user and offering to start over if a new payment link is available.
## API Reference [#api-reference]
For request/response schemas and examples for each Gateway endpoint, see the **[API Reference](/payments/api-reference)**.
# WalletConnect Pay - Wallet Integration (/payments/wallets/overview)
Your users hold crypto and stablecoins. WalletConnect Pay gives them somewhere to spend it.
One integration connects your wallet to a global network of PSPs and merchants — online and in-store. You control the experience. WalletConnect Pay handles the rest: payment execution, compliance, settlement, and gas.
What's included
- Consistent, compliant payment flows across ecommerce and point of sale
- Interchange revenue for your wallet on every eligible transaction, settled in $WCT
- Cashback in $WCT for your users on every purchase
- Check [Token and Chain coverage](/payments/token-and-chain-coverage) for supported tokens and chains
WalletConnect provides three integration approaches for enabling WalletConnect Pay in your wallet:
## Integration Options [#integration-options]
### Integrate using the Wallet SDK (Recommended) [#integrate-using-the-wallet-sdk-recommended]
If your wallet already uses the WalletConnect Wallet SDK (WalletKit), WalletConnect Pay is automatically available when you initialize WalletKit. This is the recommended approach as it provides a unified API and automatic configuration.
} href="/payments/wallets/walletkit/kotlin">
WalletKit integration for Android wallets.
} href="/payments/wallets/walletkit/swift">
WalletKit integration for iOS wallets.
} href="/payments/wallets/walletkit/react-native">
WalletKit integration for React Native wallets.
} href="/payments/wallets/walletkit/flutter">
WalletKit integration for Flutter wallets.
} href="/payments/wallets/walletkit/web">
WalletKit integration for Web/Node.js wallets.
### Standalone Integration [#standalone-integration]
For wallets that don't currently use the WalletConnect Wallet SDK, you can integrate the standalone Pay SDK directly. This approach requires configuring the SDK with your WalletConnect Project ID.
} href="/payments/wallets/standalone/kotlin">
Standalone Pay SDK for Android wallets.
} href="/payments/wallets/standalone/swift">
Standalone Pay SDK for iOS wallets.
} href="/payments/wallets/standalone/react-native">
Standalone Pay SDK for React Native wallets.
} href="/payments/wallets/standalone/flutter">
Standalone Pay SDK for Flutter wallets.
} href="/payments/wallets/standalone/web">
Standalone Pay SDK for Web/Node.js wallets.
### API-First Integration [#api-first-integration]
For wallets that prefer direct API integration without using an SDK, you can use the Gateway API directly.
} href="/payments/wallets/api-first">
Integrate WalletConnect Pay using the Gateway API.
### WebView Integration [#webview-integration]
For apps that want to embed the full WalletConnect Pay checkout UI inside a native WebView — without redirecting to an external browser. The hosted checkout handles everything; your app supplies two query parameters and listens for bridge messages.
} href="/payments/wallets/webview">
Embed the checkout portal in a native WebView (iOS, Android, React Native, Flutter).
## Getting Started [#getting-started]
To get started with WalletConnect Pay integration:
1. **Get a Project ID**: Create a wallet project at the [WalletConnect Dashboard](https://dashboard.walletconnect.com) to obtain your Project ID.
2. **Choose your integration approach**: Select either the WalletKit integration (if you already use WalletKit) or the standalone Pay SDK integration.
3. **Follow the platform-specific guide**: Use the documentation for your platform to implement the payment flow.
## Payment Flow Overview [#payment-flow-overview]
Regardless of which integration approach you choose, the payment flow follows the same pattern:
1. **Detect Payment Link**: Identify when a user scans or opens a WalletConnect Pay link
2. **Get Payment Options**: Fetch available payment options based on user's accounts
3. **Collect User Data** (if required for selected option): If the selected payment option requires compliance information, display a WebView for the user to provide it. This must happen **before** fetching the required actions — the WebView submits the data directly to the backend
4. **Get Required Actions**: Retrieve the signing actions for the selected payment option
5. **Sign Actions**: Sign the required permits/transactions using your wallet's signing infrastructure
6. **Confirm Payment**: Submit the wallet RPC results (`data`) and complete the payment
## Recommended Implementation [#recommended-implementation]
For best user experience, follow the recommended implementation below.
## Testing [#testing]
Test your WalletConnect Pay integration with the Point-of-Sale app in the WalletConnect Dashboard. To enable the app, configure a mock-merchant recipient address. Payments will arrive to this address and you won't lose any testing funds.
On Solana, payment options for non-native tokens only appear once this address has an associated token account (ATA) for that token. The easiest way to create one is to send a small amount of the token to this address — the transfer covers the SOL needed to create the account. Alternatively, send a create-account transaction and pay for it with SOL.
## Earn Revenue [#earn-revenue]
Wallets can earn interchange-like revenue on eligible WalletConnect Pay payments. To activate, make sure to complete a successful payment with your integration, then submit the Form found in the WalletConnect Dashboard. We will review the submission and confirm the results to the submitted contact email.
## User Information FAQs [#user-information-faqs]
No. The process is optimised so users don't have to re-enter information for each transaction. Once collected, the information will be reused.
Wallets that already have verified user PII (e.g. a neobank, a card issuing wallet) can prefill the WebView form by appending a `?prefill=` query parameter to the WebView URL. The `required` list from the `collectDataAction.schema` tells you which fields the form expects (e.g., `fullName`, `dob`, `pobAddress`). The user will still see the form but with pre-populated fields, reducing friction.
When processing a payment:
1. Call `getPaymentOptions` and display all available options to the user
2. When the user selects an option, check `selectedOption.collectData` — if it has a `url` field, data collection is required for that specific option
3. Display the URL in a WebView — the hosted form handles rendering, validation, and T&C acceptance
4. The WebView communicates completion via JavaScript bridge messages (`IC_COMPLETE` / `IC_ERROR`)
5. When the WebView completes, proceed to confirm the payment — no `collectedData` needs to be passed since the WebView submits data directly
WalletConnect Pay complies with Travel Rule regulations to ensure the payment flow is scalable and future-proof across all regions. This requires capturing some user information like name and date of birth.
The WebView-based data collection form handles Terms & Conditions and Privacy Policy acceptance as part of the form flow. The user must accept these before the form can be submitted.
SDKs support a WebView-based approach for collecting user information. When `selectedOption.collectData.url` is present on a payment option, wallets display this URL in a WebView instead of building native forms. The hosted form handles:
- Form rendering and field validation
- Terms & Conditions and Privacy Policy acceptance
- Data submission directly to the backend
The WebView communicates with the wallet via JavaScript bridge messages (`IC_COMPLETE` when done, `IC_ERROR` on failure). See the platform-specific documentation for implementation details.
We strongly recommend using the WebView-based flow over building custom native UI. Data collection requirements are driven by regulation and can evolve. The hosted WebView form is maintained and updated centrally so that wallets can automatically pick up changes.
No. Information capture (IC) is per-option — some payment options may require it while others don't. Each payment option has its own `collectData` field. When `option.collectData` is present, the user must complete data collection before confirming that option. When it's `null`, no IC is needed for that option.
Wallets should display all options upfront and show a visual indicator (e.g., "Info required" badge) on options that require data collection. Only open the WebView when the user selects an option with `collectData` present.
Yes, with a caveat.
Wallets that choose to implement custom UI assume responsibility for keeping their forms in sync with these changes. When changes are rolled out, wallets must implement them immediately. If the provided data is not what is requested, users in the relevant jurisdiction(s) will be unable to pay until the custom integration is updated. The WebView approach eliminates this overhead and ensures a consistent, up-to-date experience with minimal integration effort.
Wallets also must ensure the user has accepted:
- [WalletConnect Terms and Conditions](https://walletconnect.com/terms)
- [WalletConnect Privacy Policy](https://walletconnect.com/privacy)
The required user information can be sent to WalletConnect using schema in the `collect_data` object.
We strongly recommend using the WebView-based flow over building custom native UI. Data collection requirements are driven by regulation and can evolve. The hosted WebView form is maintained and updated centrally so that wallets can automatically pick up changes.
Yes.
Wallets can pre-fill user information and it will be shown in the WebView form.
If wallets choose to skip the WebView form, they must ensure the user has accepted:
- [WalletConnect Terms and Conditions](https://walletconnect.com/terms)
- [WalletConnect Privacy Policy](https://walletconnect.com/privacy)
Yes. The hosted form accepts two optional appearance parameters on its URL:
- `theme=light` or `theme=dark` — sets the form's base color mode. Match it to your wallet's active mode.
- `themeVariables=` — overrides design tokens (font, font size, some colors, button border radius, and input border radius). Generate and export this value from the [WalletConnect Pay Dashboard](https://dashboard.walletconnect.com) and append it to the form URL verbatim.
Both are optional and independent — when omitted, the form uses its default styling. See your platform's integration guide for the URL-building code.
# WalletConnect Pay SDK - Flutter (/payments/wallets/standalone/flutter)
The WalletConnect Pay SDK allows wallet users to pay merchants using their crypto assets. The SDK handles payment option discovery, permit signing coordination, and payment confirmation while leveraging your wallet's existing signing infrastructure.
## Sample Wallet [#sample-wallet]
For a complete working example, check out our sample wallet implementation:
} href="https://github.com/reown-com/reown_flutter/tree/develop/packages/reown_walletkit/example">
A reference Flutter wallet app demonstrating WalletConnect Pay integration.
## Requirements [#requirements]
- Flutter 3.0+
- iOS 13.0+
- Android API 23+
- `walletconnect_pay` 1.1.0 or later
## Installation [#installation]
Add `walletconnect_pay` package to your `pubspec.yaml` or simply run:
```bash
flutter pub add walletconnect_pay
```
## Initialization [#initialization]
Initialize the `WalletConnectPay` client with your WCP ID and client ID or API key:
```dart
import 'package:walletconnect_pay/walletconnect_pay.dart';
// Initialize WalletConnect Pay. Either apiKey or appId must be passed
final payClient = WalletConnectPay(
apiKey: 'YOUR_API_KEY', // Optional
appId: 'YOUR_WCP_ID', // Optional
clientId: 'OPTIONAL_CLIENT_ID', // Optional
baseUrl: 'https://api.pay.walletconnect.com', // Optional
);
// Initialize the SDK
try {
await payClient.init();
} on PayInitializeError catch (e) {
// Handle initialization error
}
```
**Configuration Parameters**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `apiKey` | `String?` | No* | WalletConnect Pay API key |
| `appId` | `String?` | No* | WCP ID |
| `clientId` | `String?` | No | Client identifier |
| `baseUrl` | `String?` | No | Base URL for the API (defaults to production) |
Either `apiKey` or `appId` must be provided for authentication.
Don't have a project ID? Create one at the [WalletConnect Dashboard](https://dashboard.walletconnect.com) by signing up and creating a new project.
## Supported Networks & Tokens [#supported-networks--tokens]
WalletConnect Pay currently supports the following tokens and networks:
| Token | Network | Chain ID | CAIP-10 Format |
|-------|---------|----------|----------------|
| USDC | Arbitrum | 42161 | `eip155:42161:{address}` |
| USDC | Base | 8453 | `eip155:8453:{address}` |
| USDC | Polygon | 137 | `eip155:137:{address}` |
| USDC | Ethereum | 1 | `eip155:1:{address}` |
| USDC | Optimism | 10 | `eip155:10:{address}` |
| USDC | Monad | 143 | `eip155:143:{address}` |
| USDC | Celo | 42220 | `eip155:42220:{address}` |
| USDC | BSC | 56 | `eip155:56:{address}` |
| EURC | Ethereum | 1 | `eip155:1:{address}` |
| EURC | Base | 8453 | `eip155:8453:{address}` |
| USDT0 | Arbitrum | 42161 | `eip155:42161:{address}` |
| PYUSD | Ethereum | 1 | `eip155:1:{address}` |
| PYUSD | Arbitrum | 42161 | `eip155:42161:{address}` |
| USDG | Ethereum | 1 | `eip155:1:{address}` |
| USDT | Ethereum | 1 | `eip155:1:{address}` |
| USDT | Polygon | 137 | `eip155:137:{address}` |
| USDT | BSC | 56 | `eip155:56:{address}` |
Include accounts for all supported networks to maximize payment options for your users.
## Payment Flow [#payment-flow]
The payment flow consists of five main steps:
**Get Options -> Collect Data (if required) -> Get Actions -> Sign Actions -> Confirm Payment**
```mermaid
sequenceDiagram
participant User
participant Wallet
participant PaySDK as Pay SDK
participant Backend as WalletConnect Pay
participant WebView
User->>Wallet: Scan QR / Open payment link
Wallet->>PaySDK: getPaymentOptions(link, accounts)
PaySDK->>Backend: Fetch payment options
Backend-->>PaySDK: Payment options + merchant info
PaySDK-->>Wallet: PaymentOptionsResponse
Wallet->>User: Display payment options
User->>Wallet: Select payment option
alt Data collection required
Wallet->>WebView: Load collectDataAction.url in WebView
WebView->>User: Display data collection form
User->>WebView: Fill form & accept T&C
WebView-->>Wallet: IC_COMPLETE message
end
Wallet->>PaySDK: getRequiredPaymentActions(paymentId, optionId)
PaySDK->>Backend: Get signing actions
Backend-->>PaySDK: Required wallet RPC actions
PaySDK-->>Wallet: List of actions to sign
Wallet->>User: Request signature(s)
User->>Wallet: Approve & sign
Wallet->>PaySDK: confirmPayment(data)
PaySDK->>Backend: Submit payment
Backend-->>PaySDK: Payment status
PaySDK-->>Wallet: ConfirmPaymentResponse
Wallet->>User: Show result
```
### Get Payment Options [#get-payment-options]
Retrieve available payment options for a payment link:
```dart
final request = GetPaymentOptionsRequest(
paymentLink: 'https://pay.walletconnect.com/pay_123',
accounts: ['eip155:1:0x...', 'eip155:137:0x...'], // User's wallet CAIP-10 accounts
includePaymentInfo: true, // Include payment details in response
);
final response = await payClient.getPaymentOptions(request: request);
// Access payment information
print('Payment ID: ${response.paymentId}');
print('Options available: ${response.options.length}');
if (response.info != null) {
print('Amount: ${response.info!.amount.formatAmount()}');
print('Status: ${response.info!.status}');
print('Merchant: ${response.info!.merchant.name}');
}
// Check which options require data collection (per-option)
for (final option in response.options) {
if (option.collectData != null) {
print('Option ${option.id} requires info capture');
}
}
```
### Collect User Data (If Required) [#collect-user-data-if-required]
After the user selects an option, check for `collectData` on it. If present, collect the data **before** fetching the required actions.
```dart
if (selectedOption.collectData?.url != null) {
// Use the "required" list from selectedOption.collectData.schema to determine which fields to prefill
final prefillData = {
'fullName': 'John Doe',
'dob': '1990-01-15',
'pobAddress': '123 Main St, New York, NY 10001',
};
// Encode prefill as base64url
final prefillBase64 = base64Url.encode(utf8.encode(jsonEncode(prefillData))).replaceAll('=', '');
final uri = Uri.parse(selectedOption.collectData!.url);
final webViewUrl = uri.replace(
queryParameters: {
...uri.queryParameters,
'prefill': prefillBase64,
// Optional appearance params (see "Form URL parameters"):
'theme': 'dark', // "light" | "dark"
// themeVariables is a base64url string exported from the Pay Dashboard:
// 'themeVariables': themeVariables,
},
).toString();
// Show WebView — see Data Collection Implementation section below
showDataCollectionWebView(webViewUrl);
}
```
### Get Required Actions [#get-required-actions]
Get the required wallet actions (e.g., transactions to sign) for a selected payment option:
```dart
final actionsRequest = GetRequiredPaymentActionsRequest(
optionId: response.options.first.id, // Or whatever other option chosen by the user
paymentId: response.paymentId,
);
final actions = await payClient.getRequiredPaymentActions(
request: actionsRequest,
);
// Process each action (e.g., sign transactions)
for (final action in actions) {
final walletRpc = action.walletRpc;
print('Chain ID: ${walletRpc.chainId}');
print('Method: ${walletRpc.method}');
print('Params: ${walletRpc.params}');
// Dispatch based on walletRpc.method — see Sign Actions below
}
```
### Sign Actions [#sign-actions]
Sign each action using your wallet's signing implementation, dispatching on the RPC method:
```dart
// Sign each action based on its RPC method
final data =
### Confirm Payment [#confirm-payment]
Confirm the payment with the wallet RPC results (`data`) collected in the previous step. Each element of `data` is either a plain `String` (a signature or transaction hash) or, for chains like Tron, a `Map` JSON object; the SDK forwards each element verbatim. See [Tron support](/payments/wallets/token-chain-support/tron-support) for the Tron payload.
```dart
final confirmRequest = ConfirmPaymentRequest(
paymentId: response.paymentId,
optionId: response.options.first.id,
data: data, // Wallet RPC results from the Sign Actions step
maxPollMs: 60000, // Optional: max polling time in milliseconds
);
final confirmResponse = await payClient.confirmPayment(request: confirmRequest);
print('Payment Status: ${confirmResponse.status}');
print('Is Final status: ${confirmResponse.isFinal}');
if (!confirmResponse.isFinal && confirmResponse.pollInMs != null) {
// Poll again after the specified interval
await Future.delayed(Duration(milliseconds: confirmResponse.pollInMs!));
// Re-confirm or check status
}
```
The `signatures` parameter is deprecated in favor of `data` and will be removed in a future major version. Existing integrations that pass `signatures` keep working; the SDK uses it as a fallback when `data` is null.
When using the WebView data-collection approach, you do **not** pass `collectedData` to `confirmPayment`. The WebView submits the collected data directly to the backend during the earlier Collect User Data step.
## Data Collection Implementation [#data-collection-implementation]
When `selectedOption.collectData.url` is present, display the URL in a WebView using the `webview_flutter` package (v4.10.0+). Add it to your `pubspec.yaml`:
```yaml
dependencies:
webview_flutter: ^4.10.0
url_launcher: ^6.1.0
```
```dart
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:url_launcher/url_launcher.dart';
class PayDataCollectionWebView extends StatefulWidget {
final String url;
final VoidCallback onComplete;
final ValueChanged onError;
const PayDataCollectionWebView({
super.key,
required this.url,
required this.onComplete,
required this.onError,
});
@override
State createState() =>
_PayDataCollectionWebViewState();
}
class _PayDataCollectionWebViewState extends State {
late final WebViewController _controller;
bool _isLoading = true;
@override
void initState() {
super.initState();
_controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setNavigationDelegate(NavigationDelegate(
onPageFinished: (_) => setState(() => _isLoading = false),
onNavigationRequest: (request) {
if (!request.url.contains('pay.walletconnect.com')) {
launchUrl(Uri.parse(request.url),
mode: LaunchMode.externalApplication);
return NavigationDecision.prevent;
}
return NavigationDecision.navigate;
},
))
..addJavaScriptChannel(
'ReactNativeWebView',
onMessageReceived: (message) {
try {
final data = jsonDecode(message.message) as Map;
switch (data['type']) {
case 'IC_COMPLETE':
widget.onComplete();
break;
case 'IC_ERROR':
widget.onError(data['error'] ?? 'Unknown error');
break;
}
} catch (_) {
// Ignore non-JSON messages
}
},
)
..loadRequest(Uri.parse(widget.url));
// Inject JS bridge for compatibility
_controller.runJavaScript('''
window.ReactNativeWebView = {
postMessage: function(data) {
ReactNativeWebView.postMessage(data);
}
};
''');
}
@override
Widget build(BuildContext context) {
return Stack(
children: [
WebViewWidget(controller: _controller),
if (_isLoading)
const Center(child: CircularProgressIndicator()),
],
);
}
}
String buildFormUrl(
String baseUrl, {
Map prefillData = const {},
String? theme, // "light" or "dark"
String? themeVariables, // base64url string exported from the Pay Dashboard
}) {
final uri = Uri.parse(baseUrl);
final params = {...uri.queryParameters};
if (prefillData.isNotEmpty) {
params['prefill'] = base64Url.encode(utf8.encode(jsonEncode(prefillData))).replaceAll('=', '');
}
if (theme != null) params['theme'] = theme;
if (themeVariables != null) params['themeVariables'] = themeVariables;
return uri.replace(queryParameters: params).toString();
}
```
## Complete Example [#complete-example]
Here's a complete implementation example:
```dart
import 'package:walletconnect_pay/walletconnect_pay.dart';
class PaymentService {
late final WalletConnectPay _payClient;
Future initialize() async {
_payClient = WalletConnectPay(
appId: 'YOUR_WCP_ID',
);
await _payClient.init();
}
Future processPayment(
String paymentLink,
List accounts,
) async {
// Step 1: Get payment options
final optionsResponse = await _payClient.getPaymentOptions(
request: GetPaymentOptionsRequest(
paymentLink: paymentLink,
accounts: accounts,
includePaymentInfo: true,
),
);
if (optionsResponse.options.isEmpty) {
throw Exception('No payment options available');
}
// Step 2: Select payment option (simplified - use first option)
final selectedOption = optionsResponse.options.first;
// Step 3: Collect data via WebView if required.
// This must happen BEFORE fetching the required payment actions —
// the backend rejects the actions request with 400 "IC data required"
// for options needing Information Capture if data wasn't collected first.
// The WebView submits the data directly to the backend, so it is NOT
// passed to confirmPayment later.
if (selectedOption.collectData?.url != null) {
// Show WebView and wait for IC_COMPLETE
await showDataCollectionWebView(selectedOption.collectData!.url);
}
// Step 4: Get required payment actions
final actions = await _payClient.getRequiredPaymentActions(
request: GetRequiredPaymentActionsRequest(
optionId: selectedOption.id,
paymentId: optionsResponse.paymentId,
),
);
// Step 5: Sign all actions
final data =