diff --git a/advanced/providers/solana-adapter.mdx b/advanced/providers/solana-adapter.mdx
index 12c494ee6..e7e7e9c87 100644
--- a/advanced/providers/solana-adapter.mdx
+++ b/advanced/providers/solana-adapter.mdx
@@ -2,30 +2,28 @@
title: Solana Adapter
---
-import CloudBanner from "/snippets/cloud-banner.mdx";
+import CloudBanner from '/snippets/cloud-banner.mdx'
The WalletConnect Solana Adapter allows you to integrate the WalletConnect protocol into the Wallet Adapter library.
- If you are not familiar with the Wallet Adapter library it is recommended to
- use [AppKit instead](../../appkit//overview). AppKit now supports
- multichain, which means you can choose and configure multiple blockchain
- networks within your instance of AppKit, extending beyond just Ethereum-based
- (EVM) networks.
+ If you are not familiar with the Wallet Adapter library it is recommended to use [AppKit
+ instead](../../appkit//overview). AppKit now supports multichain, which means you can choose and
+ configure multiple blockchain networks within your instance of AppKit, extending beyond just
+ Ethereum-based (EVM) networks.
## Installation
- ```bash npm npm install @walletconnect/solana-adapter ``` ```bash Yarn yarn
- add @walletconnect/solana-adapter ``` ```bash Bun bun add
- @walletconnect/solana-adapter ``` ```bash pnpm pnpm add
- @walletconnect/solana-adapter ```
+ ```bash npm npm install @walletconnect/solana-adapter ``` ```bash Yarn yarn add
+ @walletconnect/solana-adapter ``` ```bash Bun bun add @walletconnect/solana-adapter ``` ```bash
+ pnpm pnpm add @walletconnect/solana-adapter ```
## Cloud Configuration
-Create a new project on Reown Dashboard at https://dashboard.reown.com and obtain a new project ID.
+Create a new project on [Reown Dashboard](https://dashboard.reown.com) and obtain a new project ID.
@@ -34,37 +32,31 @@ Create a new project on Reown Dashboard at https://dashboard.reown.com and obtai
Add the `WalletConnectAdapter` to your wallets list.
```tsx {12, 22-27}
-import { ReactNode, useMemo, useState } from "react";
-import {
- ConnectionProvider,
- WalletProvider,
-} from "@solana/wallet-adapter-react";
-import { WalletAdapterNetwork } from "@solana/wallet-adapter-base";
-import { WalletModalProvider } from "@solana/wallet-adapter-react-ui";
-import { clusterApiUrl } from "@solana/web3.js";
+import { ReactNode, useMemo, useState } from 'react'
+import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react'
+import { WalletAdapterNetwork } from '@solana/wallet-adapter-base'
+import { WalletModalProvider } from '@solana/wallet-adapter-react-ui'
+import { clusterApiUrl } from '@solana/web3.js'
-import "@solana/wallet-adapter-react-ui/styles.css";
+import '@solana/wallet-adapter-react-ui/styles.css'
-import { WalletConnectWalletAdapter } from "@walletconnect/solana-adapter";
+import { WalletConnectWalletAdapter } from '@walletconnect/solana-adapter'
export const SolanaContext = ({ children }: { children: ReactNode }) => {
- const endpoint = useMemo(
- () => clusterApiUrl(WalletAdapterNetwork.Mainnet),
- []
- );
+ const endpoint = useMemo(() => clusterApiUrl(WalletAdapterNetwork.Mainnet), [])
const wallets = useMemo(
() => [
new WalletConnectWalletAdapter({
network: WalletAdapterNetwork.Mainnet,
options: {
- projectId: "YOUR_PROJECT_ID",
- },
- }),
+ projectId: 'YOUR_PROJECT_ID'
+ }
+ })
],
// eslint-disable-next-line react-hooks/exhaustive-deps
[]
- );
+ )
return (
@@ -72,6 +64,6 @@ export const SolanaContext = ({ children }: { children: ReactNode }) => {
{children}
- );
-};
+ )
+}
```
diff --git a/appkit/javascript/core/installation.mdx b/appkit/javascript/core/installation.mdx
index ca03a0eb0..23569dd44 100644
--- a/appkit/javascript/core/installation.mdx
+++ b/appkit/javascript/core/installation.mdx
@@ -2,33 +2,29 @@
title: Installation
---
-import CloudBanner from "/snippets/cloud-banner.mdx";
+import CloudBanner from '/snippets/cloud-banner.mdx'
-import WagmiImplementation from "/snippets/appkit/javascript/wagmi/about/implementation.mdx";
-import WagmiModal from "/snippets/appkit/javascript/wagmi/about/triggermodal.mdx";
+import WagmiImplementation from '/snippets/appkit/javascript/wagmi/about/implementation.mdx'
-import Ethers5Implementation from "/snippets/appkit/javascript/ethers5/implementation.mdx";
+import Ethers5Implementation from '/snippets/appkit/javascript/ethers5/implementation.mdx'
-import EthersImplementation from "/snippets/appkit/javascript/ethers/about/implementation.mdx";
-import EthersModal from "/snippets/appkit/javascript/ethers/about/triggermodal.mdx";
+import EthersImplementation from '/snippets/appkit/javascript/ethers/about/implementation.mdx'
-import SolanaImplementation from "/snippets/appkit/javascript/solana/about/implementation.mdx";
-import SolanaModal from "/snippets/appkit/javascript/solana/about/triggermodal.mdx";
-import SolanaPrograms from "/snippets/appkit/javascript/solana/about/programs.mdx";
+import SolanaImplementation from '/snippets/appkit/javascript/solana/about/implementation.mdx'
+import SolanaPrograms from '/snippets/appkit/javascript/solana/about/programs.mdx'
-import BitcoinImplementation from "/snippets/appkit/javascript/bitcoin/about/implementation.mdx";
-import BitcoinModal from "/snippets/appkit/javascript/bitcoin/about/triggermodal.mdx";
+import BitcoinImplementation from '/snippets/appkit/javascript/bitcoin/about/implementation.mdx'
-import CoreImplementation from "/snippets/appkit/javascript/core/about/implementation.mdx";
-import CoreModal from "/snippets/appkit/javascript/core/about/triggermodal.mdx";
+import TonImplementation from '/snippets/appkit/javascript/ton/about/implementation.mdx'
-AppKit provides seamless integration with multiple blockchain ecosystems. . It supports [Wagmi](https://wagmi.sh/) and [Ethers v6](https://docs.ethers.org/v6/) on Ethereum,
-[@solana/web3.js](https://solana-labs.github.io/solana-web3.js/) on Solana, as well as Bitcoin and other networks. AppKit Core with Universal Provider library, enable compatibility across any blockchain protocol.
+import CoreImplementation from '/snippets/appkit/javascript/core/about/implementation.mdx'
+
+AppKit provides seamless integration with multiple blockchain ecosystems. . It supports [Wagmi](https://wagmi.sh/) and [Ethers v6](https://docs.ethers.org/v6/) on Ethereum,
+[@solana/web3.js](https://solana-labs.github.io/solana-web3.js/) on Solana, as well as Bitcoin, TON and other networks. AppKit Core with Universal Provider library, enable compatibility across any blockchain protocol.
Choose one of these to get started.
- We recommend using
- [Vite](https://vitejs.dev/guide/#scaffolding-your-first-vite-project) to get
+ We recommend using [Vite](https://vitejs.dev/guide/#scaffolding-your-first-vite-project) to get
started with AppKit JavaScript.
@@ -153,6 +149,29 @@ pnpm add @reown/appkit @reown/appkit-adapter-bitcoin
+
+
+
+
+
+```bash npm
+npm install @reown/appkit @reown/appkit-adapter-ton
+```
+
+```bash Yarn
+yarn add @reown/appkit @reown/appkit-adapter-ton
+```
+
+```bash Bun
+bun add @reown/appkit @reown/appkit-adapter-ton
+```
+
+```bash pnpm
+pnpm add @reown/appkit @reown/appkit-adapter-ton
+```
+
+
+
@@ -181,7 +200,7 @@ pnpm add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common et
## Cloud Configuration
-Create a new project on Reown Dashboard at https://dashboard.reown.com and obtain a new project ID.
+Create a new project on [Reown Dashboard](https://dashboard.reown.com) and obtain a new project ID.
@@ -224,6 +243,14 @@ Check the JavaScript Bitcoin example
+
+
+
+Check the JavaScript TON example
+
+
+
+
@@ -238,34 +265,76 @@ Check the JavaScript AppKit Core example for Sui and Stacks
## Trigger the modal
-
+
-
+To open AppKit you can use our [**web component**](/appkit/javascript/core/components) or build your own button with AppKit [**actions**](/appkit/javascript/core/actions#open-and-close-the-modal).
-
-
+
-
+```tsx ConnectButton.html
+
+
+
+
+ HTML AppKit Example
+
+
+
+
+
+
+```
-
-
+You can trigger the modal by calling the `open` function from the modal instance.
-
+```js ConnectButtonWithFunctions.js
+const modal = createAppKit({
+ adapters: [wagmiAdapter],
+ networks: [mainnet, arbitrum],
+ projectId
+})
-
-
+modal.open()
+```
-
+
-
-
-
+
-
-
+To open AppKit Core you need to call the `connect` function from the Universal Connector.
-
+```tsx
+
+
+
+
+
+
+```
@@ -294,6 +363,7 @@ bun a @wagmi/core
```bash pnpm
pnpm add @wagmi/core
```
+
[Wagmi actions](https://wagmi.sh/core/api/actions/readContract) can help us interact with wallets and smart contracts:
@@ -301,17 +371,17 @@ pnpm add @wagmi/core
For this use case, we need to import the `wagmiConfig`from our AppKit WagmiAdapter configuration.
```tsx
-import { readContract } from "@wagmi/core";
-import { USDTAbi } from "../abi/USDTAbi";
+import { readContract } from '@wagmi/core'
+import { USDTAbi } from '../abi/USDTAbi'
-const USDTAddress = "0x...";
+const USDTAddress = '0x...'
const data = readContract(wagmiConfig, {
address: USDTAddress,
abi: USDTAbi,
- functionName: "totalSupply",
- args: [],
-});
+ functionName: 'totalSupply',
+ args: []
+})
```
Read more about Wagmi actions for smart contract interaction [here](https://wagmi.sh/core/actions/readContract).
@@ -322,29 +392,29 @@ Read more about Wagmi actions for smart contract interaction [here](https://wagm
[Ethers](https://docs.ethers.org/v6/) can help us interact with wallets and smart contracts:
```tsx
-import { BrowserProvider, Contract, parseEther } from "ethers";
+import { BrowserProvider, Contract, parseEther } from 'ethers'
-const provider = await modal.subscribeProviders((state) => {
- return state["eip155"];
-});
+const provider = await modal.subscribeProviders(state => {
+ return state['eip155']
+})
-const addressFrom = await modal.subscribeAccount((state) => {
- return state;
-});
+const addressFrom = await modal.subscribeAccount(state => {
+ return state
+})
-if (!provider) throw Error("No provider found");
-if (!addressFrom) throw Error("No address found");
+if (!provider) throw Error('No provider found')
+if (!addressFrom) throw Error('No address found')
function sendTransaction() {
const tx = {
from: addressFrom,
- to: "0x...", // any address
- value: parseEther("0.0001"),
- };
- const ethersProvider = new BrowserProvider(provider);
- const signer = await ethersProvider.getSigner();
- const tx = await signer.sendTransaction(tx);
- console.log("transaction:", tx);
+ to: '0x...', // any address
+ value: parseEther('0.0001')
+ }
+ const ethersProvider = new BrowserProvider(provider)
+ const signer = await ethersProvider.getSigner()
+ const tx = await signer.sendTransaction(tx)
+ console.log('transaction:', tx)
}
```
@@ -362,33 +432,35 @@ If you are starting from scratch, you can use the following methods to set up yo
If you're using Cursor IDE (or another AI based IDE) to build a project with Reown AppKit, Reown provides a `.mdc` file that enhances your development experience. The `reown-appkit.mdc` [file here](https://github.com/reown-com/reown-docs/blob/main/reown-appkit.mdc) contains Cursor-specific rules and type hints for Reown AppKit.
- To use it in your project:
+To use it in your project:
+
+1. Copy the `reown-appkit.mdc` file from this repository
+2. Create a `.cursor/rules` folder in your project's root directory (if it doesn't exist)
+3. Place the `.mdc` file in your project's `.cursor/rules` folder
- 1. Copy the `reown-appkit.mdc` file from this repository
- 2. Create a `.cursor/rules` folder in your project's root directory (if it doesn't exist)
- 3. Place the `.mdc` file in your project's `.cursor/rules` folder
+For more info, refer to [Cursor's documentation](https://docs.cursor.com/context/rules#project-rules).
- For more info, refer to [Cursor's documentation](https://docs.cursor.com/context/rules#project-rules).
Reown offers a dedicated CLI to set up a minimal version of AppKit in the easiest and quickest way possible.
- To do this, please run the command below.
+To do this, please run the command below.
+
+```bash
+npx @reown/appkit-cli
+```
- ```bash
- npx @reown/appkit-cli
- ```
+After running the command, you will be prompted to confirm the installation of the CLI. Upon your confirmation, the CLI will request the following details:
- After running the command, you will be prompted to confirm the installation of the CLI. Upon your confirmation, the CLI will request the following details:
+1. **Project Name**: Enter the name for your project.
+2. **Framework**: Select your preferred framework or library. Currently, you have three options: React, Next.js, and Vue.
+3. **Network-Specific libraries**: Choose whether you want to install Wagmi, Ethers, Solana, or Multichain (EVM + Solana).
- 1. **Project Name**: Enter the name for your project.
- 2. **Framework**: Select your preferred framework or library. Currently, you have three options: React, Next.js, and Vue.
- 3. **Network-Specific libraries**: Choose whether you want to install Wagmi, Ethers, Solana, or Multichain (EVM + Solana).
+After providing the project name and selecting your preferences, the CLI will install a minimal example of AppKit with your preferred blockchain library. The example will be pre-configured with a `projectId` that will only work on `localhost`.
- After providing the project name and selecting your preferences, the CLI will install a minimal example of AppKit with your preferred blockchain library. The example will be pre-configured with a `projectId` that will only work on `localhost`.
+To fully configure your project, please obtain a `projectId` from the Reown Dashboard and update your project accordingly.
- To fully configure your project, please obtain a `projectId` from the Reown Dashboard and update your project accordingly.
+**Refer to [this section](#cloud-configuration) for more information.**
- **Refer to [this section](#cloud-configuration) for more information.**
-
\ No newline at end of file
+
diff --git a/appkit/next/core/installation.mdx b/appkit/next/core/installation.mdx
index fbacc9dc4..c31d6f345 100644
--- a/appkit/next/core/installation.mdx
+++ b/appkit/next/core/installation.mdx
@@ -2,34 +2,29 @@
title: Installation
---
-import CloudBanner from "/snippets/cloud-banner.mdx";
+import CloudBanner from '/snippets/cloud-banner.mdx'
-import WagmiImplementation from "/snippets/appkit/next/wagmi/about/implementation.mdx";
-import WagmiModal from "/snippets/appkit/next/wagmi/about/triggermodal.mdx";
+import WagmiImplementation from '/snippets/appkit/next/wagmi/about/implementation.mdx'
-import Ethers5Implementation from "/snippets/appkit/next/ethers5/implementation.mdx";
-import Ethers5Modal from "/snippets/appkit/next/ethers5/triggermodal.mdx";
+import Ethers5Implementation from '/snippets/appkit/next/ethers5/implementation.mdx'
-import EthersImplementation from "/snippets/appkit/next/ethers/about/implementation.mdx";
-import EthersModal from "/snippets/appkit/next/ethers/about/triggermodal.mdx";
+import EthersImplementation from '/snippets/appkit/next/ethers/about/implementation.mdx'
-import SolanaImplementation from "/snippets/appkit/next/solana/about/implementation.mdx";
-import SolanaModal from "/snippets/appkit/next/solana/about/triggermodal.mdx";
-import SolanaPrograms from "/snippets/appkit/next/solana/about/programs.mdx";
+import SolanaImplementation from '/snippets/appkit/next/solana/about/implementation.mdx'
+import SolanaPrograms from '/snippets/appkit/next/solana/about/programs.mdx'
-import BitcoinImplementation from "/snippets/appkit/next/bitcoin/about/implementation.mdx";
-import BitcoinModal from "/snippets/appkit/next/bitcoin/about/triggermodal.mdx";
+import BitcoinImplementation from '/snippets/appkit/next/bitcoin/about/implementation.mdx'
-import CoreImplementation from "/snippets/appkit/react/core/about/implementation.mdx";
-import CoreModal from "/snippets/appkit/react/core/about/triggermodal.mdx";
+import TonImplementation from '/snippets/appkit/next/ton/about/implementation.mdx'
-AppKit provides seamless integration with multiple blockchain ecosystems. . It supports [Wagmi](https://wagmi.sh/) and [Ethers v6](https://docs.ethers.org/v6/) on Ethereum,
-[@solana/web3.js](https://solana-labs.github.io/solana-web3.js/) on Solana, as well as Bitcoin and other networks. AppKit Core with Universal Provider library, enable compatibility across any blockchain protocol.
+import CoreImplementation from '/snippets/appkit/react/core/about/implementation.mdx'
+
+AppKit provides seamless integration with multiple blockchain ecosystems. . It supports [Wagmi](https://wagmi.sh/) and [Ethers v6](https://docs.ethers.org/v6/) on Ethereum,
+[@solana/web3.js](https://solana-labs.github.io/solana-web3.js/) on Solana, as well as Bitcoin, TON and other networks. AppKit Core with Universal Provider library, enable compatibility across any blockchain protocol.
- These steps are specific to [Next.js](https://nextjs.org/) app router. For
- other React frameworks read the [React
- documentation](../../react/core/installation).
+ These steps are specific to [Next.js](https://nextjs.org/) app router. For other React frameworks
+ read the [React documentation](../../react/core/installation).
## Installation
@@ -155,6 +150,29 @@ pnpm add @reown/appkit @reown/appkit-adapter-bitcoin
+
+
+
+
+
+```bash npm
+npm install @reown/appkit @reown/appkit-adapter-ton
+```
+
+```bash Yarn
+yarn add @reown/appkit @reown/appkit-adapter-ton
+```
+
+```bash Bun
+bun add @reown/appkit @reown/appkit-adapter-ton
+```
+
+```bash pnpm
+pnpm add @reown/appkit @reown/appkit-adapter-ton
+```
+
+
+
@@ -183,7 +201,7 @@ pnpm add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common et
## Cloud Configuration
-Create a new project on Reown Dashboard at https://dashboard.reown.com and obtain a new project ID.
+Create a new project on [Reown Dashboard](https://dashboard.reown.com) and obtain a new project ID.
@@ -225,6 +243,13 @@ Check the Next Bitcoin example
+
+
+
+Check the Next TON example
+
+
+
@@ -236,34 +261,71 @@ Check the Next Bitcoin example
## Trigger the modal
-
+
-
+To open AppKit you can use our [**React components**](/appkit/react/core/components) or build your own button with AppKit [**hooks**](/appkit/react/core/hooks#useAppKit).
-
-
+
-
+```tsx ConnectButton.tsx
+import { AppKitButton } from '@reown/appkit/react'
-
-
+export default function ConnectButton() {
+ return
+}
+```
-
+```tsx ConnectButtonWithHooks.tsx
+import { useAppKit } from '@reown/appkit/react'
-
-
+export default function ConnectButton() {
+ const { open } = useAppKit()
-
+ return (
+ <>
+
+
+ >
+ )
+}
+```
+
+
-
+
-
+To open AppKit Core 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 (
+
+
+
+
+)
+```
@@ -276,17 +338,17 @@ Check the Next Bitcoin example
[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";
+import { useReadContract } from 'wagmi'
+import { USDTAbi } from '../abi/USDTAbi'
-const USDTAddress = "0x...";
+const USDTAddress = '0x...'
function App() {
const result = useReadContract({
abi: USDTAbi,
address: USDTAddress,
- functionName: "totalSupply",
- });
+ functionName: 'totalSupply'
+ })
}
```
@@ -298,38 +360,38 @@ Read more about Wagmi hooks for smart contract interaction [here](https://wagmi.
[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";
+import { useAppKitProvider, useAppKitAccount } from '@reown/appkit/react'
+import { BrowserProvider, Contract, formatUnits } from 'ethers'
-const USDTAddress = "0x617f3112bf5397D0467D315cC709EF968D9ba546";
+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 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, caipAddress, isConnected } = useAppKitAccount();
- const { walletProvider } = useAppKitProvider("eip155");
+ const { address, caipAddress, isConnected } = useAppKitAccount()
+ const { walletProvider } = useAppKitProvider('eip155')
async function getBalance() {
- if (!isConnected) throw Error("User disconnected");
+ if (!isConnected) throw Error('User disconnected')
- const ethersProvider = new BrowserProvider(walletProvider);
- const signer = await ethersProvider.getSigner();
+ 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);
+ const USDTContract = new Contract(USDTAddress, USDTAbi, signer)
+ const USDTBalance = await USDTContract.balanceOf(address)
- console.log(formatUnits(USDTBalance, 18));
+ console.log(formatUnits(USDTBalance, 18))
}
- return ;
+ return
}
```
@@ -348,11 +410,11 @@ Next.js relies on [SSR](https://nextjs.org/docs/pages/building-your-application/
```ts
// Path: next.config.js
const nextConfig = {
- webpack: (config) => {
- config.externals.push("pino-pretty", "lokijs", "encoding");
- return config;
- },
-};
+ webpack: config => {
+ config.externals.push('pino-pretty', 'lokijs', 'encoding')
+ return config
+ }
+}
```
- [Learn more about SSR with Wagmi](https://wagmi.sh/react/guides/ssr)
@@ -360,7 +422,7 @@ const nextConfig = {
## Video Tutorial
-
- );
+ )
}
- return ;
+ return
}
-export default ConnectButton;
+export default ConnectButton
```
+
For detailed examples on specific actions like signing messages, sending transactions, or switching networks, please refer to the [Hooks](./hooks#useprovider) and [Examples](#examples) sections.
**Pre-built Components**
@@ -480,6 +504,7 @@ For detailed information about all available components, hooks, and examples for
- Prioritizing installed wallets at the top of the wallet selection list
All 600+ wallets in the AppKit ecosystem work via WalletConnect protocol regardless of this configuration. You only need to add the wallets your users most commonly have installed.
+
To enable AppKit to detect wallets installed on the device, you can make specific changes to the native code of your project.
@@ -487,8 +512,10 @@ To enable AppKit to detect wallets installed on the device, you can make specifi
-
+
+
+
To enable AppKit to detect wallets installed on the device in your Expo project for iOS, follow these steps:
1. Open your `app.json` (or `app.config.js`) file.
@@ -539,48 +566,44 @@ To enable AppKit to detect wallets installed on the device in your Expo project
```js
// based on https://github.com/expo/config-plugins/issues/123#issuecomment-1746757954
-const {
- AndroidConfig,
- withAndroidManifest,
- createRunOncePlugin,
-} = require("expo/config-plugins");
+const { AndroidConfig, withAndroidManifest, createRunOncePlugin } = require('expo/config-plugins')
const queries = {
package: [
- { $: { "android:name": "com.wallet.crypto.trustapp" } },
- { $: { "android:name": "io.metamask" } },
- { $: { "android:name": "me.rainbow" } },
- { $: { "android:name": "io.zerion.android" } },
- { $: { "android:name": "io.gnosis.safe" } },
- { $: { "android:name": "com.uniswap.mobile" } },
+ { $: { 'android:name': 'com.wallet.crypto.trustapp' } },
+ { $: { 'android:name': 'io.metamask' } },
+ { $: { 'android:name': 'me.rainbow' } },
+ { $: { 'android:name': 'io.zerion.android' } },
+ { $: { 'android:name': 'io.gnosis.safe' } },
+ { $: { 'android:name': 'com.uniswap.mobile' } }
// Add other wallet package names here
- ],
-};
+ ]
+}
/**
* @param {import('@expo/config-plugins').ExportedConfig} config
*/
-const withAndroidManifestService = (config) => {
- return withAndroidManifest(config, (config) => {
+const withAndroidManifestService = config => {
+ return withAndroidManifest(config, config => {
config.modResults.manifest = {
...config.modResults.manifest,
- queries,
- };
+ queries
+ }
- return config;
- });
-};
+ return config
+ })
+}
module.exports = createRunOncePlugin(
withAndroidManifestService,
- "withAndroidManifestService",
- "1.0.0"
-);
+ 'withAndroidManifestService',
+ '1.0.0'
+)
```
5. Add the wallet package names you want to be detected by your app.
+
-
@@ -637,7 +660,9 @@ Example:
## Connectors
-**Optional feature** - These connectors are only needed if you want to support specific wallets that use custom connection protocols. All 600+ wallets in the AppKit ecosystem work via WalletConnect protocol regardless of this configuration.
+ **Optional feature** - These connectors are only needed if you want to support specific wallets
+ that use custom connection protocols. All 600+ wallets in the AppKit ecosystem work via
+ WalletConnect protocol regardless of this configuration.
AppKit supports various custom connectors for specific wallets that use their own connection protocols. These connectors allow you to integrate popular wallets like Coinbase and Phantom directly into your AppKit configuration.
@@ -647,7 +672,9 @@ AppKit supports various custom connectors for specific wallets that use their ow
Coinbase Wallet is a popular wallet that uses a custom connection protocol. To enable it in your AppKit configuration, you'll need to install the Coinbase SDK and add a specific connector.
-**Expo Compatibility:** Coinbase SDK works with [Expo Prebuild](https://docs.expo.dev/workflow/prebuild/) but not with Expo Go. You'll need to use `expo prebuild` to generate native code before building your app.
+ **Expo Compatibility:** Coinbase SDK works with [Expo
+ Prebuild](https://docs.expo.dev/workflow/prebuild/) but not with Expo Go. You'll need to use `expo
+ prebuild` to generate native code before building your app.
To enable Coinbase Wallet, follow these steps:
@@ -697,42 +724,39 @@ npx pod-install
```typescript {4-5,9-11}
// src/AppKitConfig.ts (or wherever you prefer to configure it)
-import "@walletconnect/react-native-compat";
+import '@walletconnect/react-native-compat'
-import { createAppKit } from '@reown/appkit-react-native';
-import { MMKV } from 'react-native-mmkv';
-import { CoinbaseConnector } from '@reown/appkit-coinbase-react-native';
+import { createAppKit } from '@reown/appkit-react-native'
+import { MMKV } from 'react-native-mmkv'
+import { CoinbaseConnector } from '@reown/appkit-coinbase-react-native'
export const appKit = createAppKit({
// ...
- extraConnectors: [
- new CoinbaseConnector({ storage: new MMKV() })
- ],
+ extraConnectors: [new CoinbaseConnector({ storage: new MMKV() })]
// ...
-});
+})
```
7. Add the Coinbase response handler to process wallet responses:
```tsx
-import { handleResponse } from "@coinbase/wallet-mobile-sdk";
+import { handleResponse } from '@coinbase/wallet-mobile-sdk'
// Add this to your app's deeplink handling code
useEffect(() => {
- const sub = Linking.addEventListener("url", ({ url }) => {
- const handledBySdk = handleResponse(new URL(url));
+ const sub = Linking.addEventListener('url', ({ url }) => {
+ const handledBySdk = handleResponse(new URL(url))
if (!handledBySdk) {
// Handle other deeplinks
}
- });
+ })
- return () => sub.remove();
-}, []);
+ return () => sub.remove()
+}, [])
```
For more detailed information, check the [Coinbase docs](https://mobilewalletprotocol.github.io/wallet-mobile-sdk/docs/client-sdk/rn-install).
-
### Phantom & Solflare
Phantom and Solflare are popular wallets on the Solana blockchain. Because they use a custom connection protocol, it requires a specific connector to be added to your AppKit configuration.
@@ -743,26 +767,26 @@ Here's how to update your `AppKitConfig.ts` file, using the example from the [Im
```typescript {4,8-11}
// src/AppKitConfig.ts (or wherever you prefer to configure it)
-import "@walletconnect/react-native-compat";
+import '@walletconnect/react-native-compat'
-import { createAppKit } from '@reown/appkit-react-native';
-import { SolanaAdapter, PhantomConnector, Solflare } from '@reown/appkit-solana-react-native';
+import { createAppKit } from '@reown/appkit-react-native'
+import { SolanaAdapter, PhantomConnector, Solflare } from '@reown/appkit-solana-react-native'
export const appKit = createAppKit({
// ...
extraConnectors: [
new PhantomConnector({ cluster: 'mainnet-beta' }), // Or 'devnet', 'testnet'
new SolflareConnector({ cluster: 'mainnet-beta' }) // Or 'devnet', 'testnet'
- ],
+ ]
// ...
-});
+})
```
-The `cluster` option can be set to `'mainnet-beta'`, `'devnet'`, or `'testnet'` depending on which Solana cluster you want to connect to.
+ The `cluster` option can be set to `'mainnet-beta'`, `'devnet'`, or `'testnet'` depending on which
+ Solana cluster you want to connect to.
-
## Examples
diff --git a/appkit/react/core/installation.mdx b/appkit/react/core/installation.mdx
index 22ca7f93e..f0835dc4c 100644
--- a/appkit/react/core/installation.mdx
+++ b/appkit/react/core/installation.mdx
@@ -2,29 +2,25 @@
title: Installation
---
-import CloudBanner from "/snippets/cloud-banner.mdx";
+import CloudBanner from '/snippets/cloud-banner.mdx'
-import WagmiImplementation from "/snippets/appkit/react/wagmi/about/implementation.mdx";
-import WagmiModal from "/snippets/appkit/react/wagmi/about/triggermodal.mdx";
+import WagmiImplementation from '/snippets/appkit/react/wagmi/about/implementation.mdx'
-import Ethers5Implementation from "/snippets/appkit/react/ethers5/implementation.mdx";
-import Ethers5Modal from "/snippets/appkit/react/ethers5/triggermodal.mdx";
+import Ethers5Implementation from '/snippets/appkit/react/ethers5/implementation.mdx'
-import EthersImplementation from "/snippets/appkit/react/ethers/about/implementation.mdx";
-import EthersModal from "/snippets/appkit/react/ethers/about/triggermodal.mdx";
+import EthersImplementation from '/snippets/appkit/react/ethers/about/implementation.mdx'
-import SolanaImplementation from "/snippets/appkit/react/solana/about/implementation.mdx";
-import SolanaModal from "/snippets/appkit/react/solana/about/triggermodal.mdx";
-import SolanaPrograms from "/snippets/appkit/react/solana/about/programs.mdx";
+import SolanaImplementation from '/snippets/appkit/react/solana/about/implementation.mdx'
+import SolanaPrograms from '/snippets/appkit/react/solana/about/programs.mdx'
-import BitcoinImplementation from "/snippets/appkit/react/bitcoin/about/implementation.mdx";
-import BitcoinModal from "/snippets/appkit/react/bitcoin/about/triggermodal.mdx";
+import BitcoinImplementation from '/snippets/appkit/react/bitcoin/about/implementation.mdx'
-import CoreImplementation from "/snippets/appkit/react/core/about/implementation.mdx";
-import CoreModal from "/snippets/appkit/react/core/about/triggermodal.mdx";
+import TonImplementation from '/snippets/appkit/react/ton/about/implementation.mdx'
-AppKit provides seamless integration with multiple blockchain ecosystems. It supports [Wagmi](https://wagmi.sh/) and [Ethers v6](https://docs.ethers.org/v6/) on Ethereum,
-[@solana/web3.js](https://solana-labs.github.io/solana-web3.js/) on Solana, as well as Bitcoin and other networks. AppKit Core with Universal Provider library, enable compatibility across any blockchain protocol.
+import CoreImplementation from '/snippets/appkit/react/core/about/implementation.mdx'
+
+AppKit provides seamless integration with multiple blockchain ecosystems. It supports [Wagmi](https://wagmi.sh/) and [Ethers v6](https://docs.ethers.org/v6/) on Ethereum,
+[@solana/web3.js](https://solana-labs.github.io/solana-web3.js/) on Solana, as well as Bitcoin, TON and other networks. AppKit Core with Universal Provider library, enable compatibility across any blockchain protocol.
Choose one of these to get started.
@@ -37,11 +33,10 @@ Choose one of these to get started.
## Custom 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`.
+ 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`.
@@ -159,6 +154,29 @@ pnpm add @reown/appkit @reown/appkit-adapter-bitcoin
+
+
+
+
+
+```bash npm
+npm install @reown/appkit @reown/appkit-adapter-ton
+```
+
+```bash Yarn
+yarn add @reown/appkit @reown/appkit-adapter-ton
+```
+
+```bash Bun
+bun add @reown/appkit @reown/appkit-adapter-ton
+```
+
+```bash pnpm
+pnpm add @reown/appkit @reown/appkit-adapter-ton
+```
+
+
+
@@ -187,13 +205,13 @@ pnpm add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common et
## Cloud Configuration
-Create a new project on Reown Dashboard at https://dashboard.reown.com and obtain a new project ID.
+Create a new project on [Reown Dashboard](https://dashboard.reown.com) and obtain a new project ID.
## Implementation
-### AppKitProvider Component
+### `AppKitProvider` Component
AppKit now provides an `AppKitProvider` React component for easy integration in React applications. This component wraps your app and provides the AppKit context to all child components.
@@ -204,9 +222,11 @@ function App() {
return (
{/* Your App */}
@@ -214,7 +234,7 @@ function App() {
}
```
-### Framework-Specific Implementation
+### Framework Specific Implementation
@@ -256,6 +276,11 @@ Check the React Bitcoin example
+
+
+
+
+
@@ -270,34 +295,71 @@ Check the React AppKit Core example for Sui
## Trigger the modal
-
+
-
+To open AppKit you can use our [**React components**](/appkit/react/core/components) or build your own button with AppKit [**hooks**](/appkit/react/core/hooks#useAppKit).
-
-
+
-
+```tsx ConnectButton.tsx
+import { AppKitButton } from '@reown/appkit/react'
-
-
+export default function ConnectButton() {
+ return
+}
+```
-
+```tsx ConnectButtonWithHooks.tsx
+import { useAppKit } from '@reown/appkit/react'
-
-
+export default function ConnectButton() {
+ const { open } = useAppKit()
-
+ return (
+ <>
+
+
+ >
+ )
+}
+```
+
+
-
+
-
+To open AppKit Core 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 (
+
+
+
+
+)
+```
@@ -310,17 +372,17 @@ Check the React AppKit Core example for Sui
[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";
+import { useReadContract } from 'wagmi'
+import { USDTAbi } from '../abi/USDTAbi'
-const USDTAddress = "0x...";
+const USDTAddress = '0x...'
function App() {
const result = useReadContract({
abi: USDTAbi,
address: USDTAddress,
- functionName: "totalSupply",
- });
+ functionName: 'totalSupply'
+ })
}
```
@@ -332,38 +394,38 @@ Read more about Wagmi hooks for smart contract interaction [here](https://wagmi.
[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";
+import { useAppKitProvider, useAppKitAccount } from '@reown/appkit/react'
+import { BrowserProvider, Contract, formatUnits } from 'ethers'
-const USDTAddress = "0x617f3112bf5397D0467D315cC709EF968D9ba546";
+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 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");
+ const { address, isConnected } = useAppKitAccount()
+ const { walletProvider } = useAppKitProvider('eip155')
async function getBalance() {
- if (!isConnected) throw Error("User disconnected");
+ if (!isConnected) throw Error('User disconnected')
- const ethersProvider = new BrowserProvider(walletProvider);
- const signer = await ethersProvider.getSigner();
+ 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);
+ const USDTContract = new Contract(USDTAddress, USDTAbi, signer)
+ const USDTBalance = await USDTContract.balanceOf(address)
- console.log(formatUnits(USDTBalance, 18));
+ console.log(formatUnits(USDTBalance, 18))
}
- return ;
+ return
}
```
@@ -377,7 +439,7 @@ function Components() {
## Video Tutorial