### Interact with Solana Blockchain using @solana/web3.js Source: https://docs.reown.com/walletkit/javascript/installation/appkit/javascript/core/installation Provides examples for sending transactions and getting account balances on the Solana blockchain using the `@solana/web3.js` library. It demonstrates setting up a connection, constructing a transfer transaction, and querying an account's SOL balance. ```javascript import { PublicKey, LAMPORTS_PER_SOL, Transaction, SystemProgram } from "@solana/web3.js"; import type { Provider } from '@reown/appkit-adapter-solana' const solanaProvider = {}; const solanaConnection = {}; modal.subscribeProviders(state => { solanaProvider = state['solana']; const url = solanaProvider.getActiveChain().rpcUrls.default.http[0]; const solanaConnection = new Connection(url); }) const addressFrom = await modal.subscribeAccount(state => { return state; }) const sendTransaction = async () => { if (!addressFrom || !solanaConnection) throw Error('user is disconnected'); const wallet = new PublicKey(addressFrom); if (!wallet) throw Error('wallet provider is not available'); const latestBlockhash = await solanaConnection.getLatestBlockhash(); const transaction = new Transaction({ feePayer: wallet, recentBlockhash: latestBlockhash?.blockhash }).add( SystemProgram.transfer({ fromPubkey: wallet, toPubkey: new PublicKey(address), // destination address lamports: 1000 }) ); return await provider.sendTransaction(transaction, solanaConnection); } const getBalance = async () => { if (!addressFrom || !solanaConnection) throw Error('user is disconnected'); const wallet = new PublicKey(addressFrom); const balance = await solanaConnection?.getBalance(wallet); if (balance !== undefined) { return `${balance / LAMPORTS_PER_SOL}`; } else { return '-'; } } ``` -------------------------------- ### Install Recommended Packages for AppKit SIWE Source: https://docs.reown.com/walletkit/javascript/installation/appkit/next/core/siwe This snippet provides the recommended installation command for AppKit SIWE, including `siwe` to abstract required logic and `viem` for enhanced functionality. This setup is recommended for a better user experience. ```npm npm install @reown/appkit-siwe siwe next-auth viem ``` -------------------------------- ### Install AppKit SIWE and NextAuth Source: https://docs.reown.com/walletkit/javascript/installation/appkit/next/core/siwe This snippet provides the basic installation command for the core AppKit SIWE and NextAuth packages, which are essential for integrating Sign In With Ethereum functionality. It supports both One-Click Auth and Legacy setups. ```npm npm install @reown/appkit-siwe next-auth ``` -------------------------------- ### Initialize AppKit with Ethers and Solana Adapters Source: https://docs.reown.com/walletkit/javascript/installation/appkit/next/core/multichain Comprehensive example demonstrating the initialization of @reown/appkit, including importing necessary modules, creating EthersAdapter and SolanaAdapter instances, defining networks, metadata, and the project ID for a multi-chain setup. ```javascript import { createAppKit } from '@reown/appkit' import { SolanaAdapter } from '@reown/appkit-adapter-solana' import { EthersAdapter } from '@reown/appkit-adapter-ethers' import { solana, solanaTestnet, solanaDevnet } from '@reown/appkit/networks' import { mainnet, arbitrum, sepolia } from '@reown/appkit/networks' // 0. Create the Ethers adapter export const ethersAdapter = new EthersAdapter() // 1. Create Solana adapter const solanaWeb3JsAdapter = new SolanaAdapter() // 2. Get projectId from https://cloud.reown.com const projectId = 'YOUR_PROJECT_ID' // 3. Set up the metadata - Optional const metadata = { name: 'AppKit', description: 'AppKit Example', url: 'https://example.com', // origin must match your domain & subdomain icons: ['https://avatars.githubusercontent.com/u/179229932'] } // 4. Create the AppKit instance const modal = createAppKit({ adapters: [ethersAdapter, solanaWeb3JsAdapter], networks: [mainnet, arbitrum, sepolia, solana, solanaTestnet, solanaDevnet], metadata, projectId, features: { analytics: true, } }) ``` -------------------------------- ### Install AppKit SIWE and SIWE packages Source: https://docs.reown.com/walletkit/javascript/installation/appkit/vue/core/siwe This command installs the `@reown/appkit-siwe` package, which provides AppKit's integration with Sign In With Ethereum (SIWE). It also installs the `siwe` package, recommended for abstracting much of the required logic for SIWE authentication. This setup is crucial for both One-Click Auth and Legacy SIWE implementations. ```npm npm install @reown/appkit-siwe siwe ``` -------------------------------- ### Install Reown AppKit with Bitcoin Adapter for Svelte Source: https://docs.reown.com/walletkit/javascript/installation/appkit/svelte/core/installation Installs the core Reown AppKit and the Bitcoin adapter. This setup is for Svelte projects integrating with the Bitcoin blockchain. ```npm npm install @reown/appkit @reown/appkit-adapter-bitcoin ``` -------------------------------- ### Install Reown AppKit with Wagmi Adapter for Svelte Source: https://docs.reown.com/walletkit/javascript/installation/appkit/svelte/core/installation Installs the core Reown AppKit, the Wagmi adapter, Wagmi, and Viem. This setup is recommended for SvelteKit projects integrating with Ethereum using Wagmi. ```npm npm install @reown/appkit @reown/appkit-adapter-wagmi wagmi viem ``` -------------------------------- ### Install Reown AppKit with Solana Adapter for Svelte Source: https://docs.reown.com/walletkit/javascript/installation/appkit/svelte/core/installation Installs the core Reown AppKit and the Solana adapter. This setup is for Svelte projects integrating with the Solana blockchain. ```npm npm install @reown/appkit @reown/appkit-adapter-solana ``` -------------------------------- ### Initialize AppKit with Configuration (ethers5-react-native) Source: https://docs.reown.com/walletkit/javascript/installation/appkit/react-native/core/installation Provides a comprehensive example for initializing AppKit in a React Native application using `@reown/appkit-ethers5-react-native`. It covers importing necessary shims, defining project ID, metadata, supported blockchain chains, and passing the configuration to `createAppKit` for a full setup. ```javascript import "@walletconnect/react-native-compat"; import "@ethersproject/shims"; import { createAppKit, defaultConfig, AppKit, } from "@reown/appkit-ethers5-react-native"; // 1. Get projectId from https://cloud.reown.com const projectId = "YOUR_PROJECT_ID"; // 2. Create config const metadata = { name: "AppKit RN", description: "AppKit RN Example", url: "https://reown.com/appkit", icons: ["https://avatars.githubusercontent.com/u/179229932"], redirect: { native: "YOUR_APP_SCHEME://", }, }; const config = defaultConfig({ metadata }); // 3. Define your chains const mainnet = { chainId: 1, name: "Ethereum", currency: "ETH", explorerUrl: "https://etherscan.io", rpcUrl: "https://cloudflare-eth.com", }; const polygon = { chainId: 137, name: "Polygon", currency: "MATIC", explorerUrl: "https://polygonscan.com", rpcUrl: "https://polygon-rpc.com", }; const chains = [mainnet, polygon]; // 4. Create modal createAppKit({ projectId, chains, config, enableAnalytics: true, // Optional - defaults to your Cloud configuration }); export default function App() { return ( <> // Rest of your app... ); } ``` -------------------------------- ### Install Core AppKit SIWE Packages Source: https://docs.reown.com/walletkit/javascript/installation/appkit/react/core/siwe Install the fundamental `@reown/appkit-siwe` and `siwe` packages. This provides the core logic for integrating Sign In With Ethereum without the additional `viem` dependency, suitable for basic or legacy setups. ```JavaScript npm install @reown/appkit-siwe siwe ``` -------------------------------- ### Install Reown AppKit CLI Source: https://docs.reown.com/walletkit/javascript/installation/appkit/next/core/installation Run this command to install the Reown AppKit CLI, which provides an interactive setup for a minimal AppKit project. It prompts for project name, preferred framework (React, Next.js, Vue), and network-specific libraries (Wagmi, Ethers, Solana, Multichain). ```Shell npx @reown/appkit-cli ``` -------------------------------- ### Install Reown AppKit CLI Source: https://docs.reown.com/walletkit/javascript/installation/appkit/react/core/installation Run this command to install the Reown AppKit CLI, which provides an interactive setup for a minimal AppKit project. It prompts for project name, framework (React, Next.js, Vue), and network-specific libraries. ```Shell npx @reown/appkit-cli ``` -------------------------------- ### Initialize and Connect WalletConnectUnity Source: https://docs.reown.com/walletkit/javascript/installation/advanced/api/sign/dapp-usage Provides examples for initializing the WalletConnect singleton or a manual instance, attempting to resume a previous session, and initiating a new connection flow including QR code generation and awaiting wallet approval. ```C# // Initialize singleton await WalletConnect.Instance.InitializeAsync(); // Or handle instancing manually var walletConnectUnity = new WalletConnect(); await walletConnectUnity.InitializeAsync(); // Try to resume the last session var sessionResumed = await WalletConnect.Instance.TryResumeSessionAsync(); if (!sessionResumed) { var connectedData = await WalletConnect.Instance.ConnectAsync(connectOptions); // Create QR code texture var texture = WalletConnectUnity.Core.Utils.QRCode.EncodeTexture(connectedData.Uri); // ... Display QR code texture // Wait for wallet approval await connectedData.Approval; } ``` -------------------------------- ### Configure Reown AppKit for Solana Source: https://docs.reown.com/walletkit/javascript/installation/appkit/javascript/core/installation Details the setup of Reown AppKit for Solana, utilizing `SolanaAdapter` and Solana-specific networks like `solana`, `solanaTestnet`, and `solanaDevnet`. It covers initializing the adapter, obtaining a project ID, and defining optional metadata. ```JavaScript import { createAppKit } from "@reown/appkit"; import { SolanaAdapter } from "@reown/appkit-adapter-solana"; import { solana, solanaTestnet, solanaDevnet } from "@reown/appkit/networks"; // 0. Set up Solana Adapter const solanaWeb3JsAdapter = new SolanaAdapter(); // 1. Get projectId from https://cloud.reown.com const projectId = "YOUR_PROJECT_ID"; // 2. Create a metadata object - optional const metadata = { name: "AppKit", description: "AppKit Solana Example", url: "https://example.com", // origin must match your domain & subdomain icons: ["https://avatars.githubusercontent.com/u/179229932"] }; // 3. Create modal createAppKit({ adapters: [solanaWeb3JsAdapter], networks: [solana, solanaTestnet, solanaDevnet], metadata: metadata, projectId, features: { analytics: true // Optional - defaults to your Cloud configuration } }); ``` -------------------------------- ### Install WalletConnectModal via NPM Source: https://docs.reown.com/walletkit/javascript/installation/advanced/walletconnectmodal/about Add the WalletConnectModal package to your project using npm. This command is applicable for projects using npm, Yarn, Bun, or pnpm, with the example specifically showing the npm command. ```npm npm install @walletconnect/modal ``` -------------------------------- ### Install Reown AppKit CLI Source: https://docs.reown.com/walletkit/javascript/installation/appkit/vue/core/installation Run this command to initialize a new Reown AppKit project. The CLI will guide you through selecting your project name, framework (React, Next.js, Vue), and network-specific libraries (Wagmi, Ethers, Solana, Multichain). ```Shell npx @reown/appkit-cli ``` -------------------------------- ### Migrating User Registration with Prepare and Register Hooks Source: https://docs.reown.com/walletkit/javascript/installation/appkit/next/notifications/frontend-integration/migration-guide This snippet illustrates the refactored user registration process, moving from a single `register` call to a more granular approach using `usePrepareRegistration` and `useRegister`. It outlines the steps for preparing a message, signing it asynchronously, and then completing the registration. ```JavaScript - const handleRegistration = () => { - register(signMessageAsync) - } + const { prepareRegistration } = usePrepareRegistration(); + const { register, isLoading: isLoadingRegister } = useRegister(); + const handleRegistration = async () => { + try { + const { message, registerParams } = await prepareRegistration(); + const signature = await signMessageAsync({ message: message }); + await register({ registerParams, signature }); + } catch (registerIdentityError: any) { + console.error(registerIdentityError) + } + }; ``` -------------------------------- ### Install Reown AppKit with Ethers Adapter for Svelte Source: https://docs.reown.com/walletkit/javascript/installation/appkit/svelte/core/installation Installs the core Reown AppKit and the Ethers adapter. This setup is for Svelte projects integrating with Ethereum using Ethers v6. ```npm npm install @reown/appkit @reown/appkit-adapter-ethers ethers ``` -------------------------------- ### Initialize AppKit with Networks and Metadata Source: https://docs.reown.com/walletkit/javascript/installation/appkit/vue/core/multichain This example shows a simpler initialization of the Reown AppKit instance, focusing on configuring supported networks and providing application metadata. This setup is suitable when specific blockchain adapters are not explicitly required or are handled implicitly. ```JavaScript import { createAppKit } from "@reown/appkit"; import { solana, solanaTestnet, solanaDevnet } from "@reown/appkit/networks"; import { mainnet, arbitrum, sepolia } from "@reown/appkit/networks"; // 1. Get projectId from https://cloud.reown.com const projectId = "YOUR_PROJECT_ID"; // 2. Set up the metadata - Optional const metadata = { name: "AppKit", description: "AppKit Example", url: "https://example.com", // origin must match your domain & subdomain icons: ["https://avatars.githubusercontent.com/u/179229932"], }; // 3. Create the AppKit instance const modal = createAppKit({ networks: [mainnet, arbitrum, sepolia, solana, solanaTestnet, solanaDevnet], metadata: metadata, projectId, features: { analytics: true, }, }); ``` -------------------------------- ### Instantiate WalletConnect Core and WalletKit Source: https://docs.reown.com/walletkit/javascript/installation/advanced/multichain/polkadot/wallet-integration-guide Shows how to initialize the WalletConnect Core with a unique `projectId` and then instantiate WalletKit, providing essential metadata such as the wallet's name, description, URL, and icons. ```TypeScript const core = new Core({ projectId: "fgu234234njbhvhv23525bj" }); const walletKit = await WalletKit.init({ core: core, metadata: { name: "Example WalletConnect Wallet", description: "Example WalletConnect Integration", url: "myexamplewallet.com", icons: [], }, }); ``` -------------------------------- ### Configure Reown AppKit with Ethers v5 Adapter in React Source: https://docs.reown.com/walletkit/javascript/installation/appkit/react/core/installation This example shows the setup of Reown AppKit in a React application using the `Ethers5Adapter`. It includes steps for obtaining a project ID, creating metadata, and configuring networks, ensuring the setup is outside React components to prevent re-renders. ```javascript import { createAppKit } from "@reown/appkit/react"; import { Ethers5Adapter } from "@reown/appkit-adapter-ethers5"; import { mainnet, arbitrum } from "@reown/appkit/networks"; // 1. Get projectId const projectId = "YOUR_PROJECT_ID"; // 2. Create a metadata object - optional const metadata = { name: "My Website", description: "My Website description", url: "https://mywebsite.com", // origin must match your domain & subdomain icons: ["https://avatars.mywebsite.com/"], }; // 3. Create the AppKit instance createAppKit({ adapters: [new Ethers5Adapter()], metadata: metadata, networks: [mainnet, arbitrum], projectId, features: { analytics: true, // Optional - defaults to your Cloud configuration }, }); export default function App() { return ; //make sure you have configured the inside } ``` -------------------------------- ### Initialize AppKit with EthersAdapter Source: https://docs.reown.com/walletkit/javascript/installation/appkit/upgrade/to-reown-appkit-ethers-web Set up the `EthersAdapter` and initialize AppKit by calling `createAppKit`. This function requires parameters such as `adapters`, `networks`, `metadata`, and `projectId` to properly configure the AppKit instance for your application. This is the final step to enable AppKit's features. ```React // Remove the following code line -createWeb3Modal({ ethersConfig, projectId, chains }) // Add the following code lines createAppKit({ adapters: [new EthersAdapter()], networks: [mainnet, arbitrum], metadata, projectId, features: { analytics: true, }, }); ``` ```Vue // Remove the following code line - createWeb3Modal({ ethersConfig, projectId, chains }) // Add the following code lines const modal = createAppKit({ ``` -------------------------------- ### Prepare Namespaces for WalletConnect Sign Client Connection Source: https://docs.reown.com/walletkit/javascript/installation/advanced/api/sign/dapp-usage Before connecting, define the required namespaces that specify the minimal methods and blockchains your dApp needs. This example sets up `eth_sendTransaction`, `personal_sign`, `eth_signTypedData` methods and `eip155:1`, `eip155:137` blockchains. ```Swift let methods: Set = ["eth_sendTransaction", "personal_sign", "eth_signTypedData"] let blockchains: Set = [Blockchain("eip155:1")!, Blockchain("eip155:137")!] let namespaces: [String: ProposalNamespace] = ["eip155": ProposalNamespace(chains: blockchains, methods: methods, events: [])] ``` -------------------------------- ### Initialize AppKit Outside React Component Source: https://docs.reown.com/walletkit/javascript/installation/appkit/faq Provides an example of correctly initializing AppKit by calling `createAppKit` outside of a React component. This ensures proper setup and prevents issues related to wallet visibility or functionality within the application. ```JavaScript // Create modal createAppKit({ adapters: [wagmiAdapter], ...generalConfig, features: { analytics: true // Optional - defaults to your Cloud configuration } }) export function App() { return ( ) } ``` -------------------------------- ### Install AppKit SIWE, SIWE, and Viem for One-Click Auth Source: https://docs.reown.com/walletkit/javascript/installation/appkit/javascript/core/siwe This command installs the `@reown/appkit-siwe` and `siwe` packages, along with `viem`. The `viem` library is specifically recommended for a better user experience when implementing One-Click Authentication with Sign In With Ethereum. ```npm npm install @reown/appkit-siwe siwe viem ``` -------------------------------- ### Initialize AppKit and Render Default Button Source: https://docs.reown.com/walletkit/javascript/installation/appkit/svelte/core/installation Illustrates the recommended way to initialize AppKit with your project ID using `initializeAppKit` and render the default AppKit button using the `appkit-button` web component. This setup is crucial for AppKit functionality. ```typescript
``` -------------------------------- ### Define WalletConnect Connection Options Source: https://docs.reown.com/walletkit/javascript/installation/advanced/api/sign/dapp-usage Shows how to configure `ConnectOptions` for the WalletConnect SDK, defining required namespaces like 'eip155' with their supported methods, chains, and events. Examples are provided for both constructor and builder-style initialization. ```C# var dappConnectOptions = new ConnectOptions() { RequiredNamespaces = new RequiredNamespaces() { { "eip155", new RequiredNamespace() { Methods = new[] { "eth_sendTransaction", "eth_signTransaction", "eth_sign", "personal_sign", "eth_signTypedData" }, Chains = new[] { "eip155:1" }, Events = new[] { "chainChanged", "accountsChanged" } } } } }; ``` ```C# var dappConnectOptions1 = new ConnectOptions() .RequireNamespace("eip155", new RequiredNamespace() .WithMethod("eth_sendTransaction") .WithMethod("eth_signTransaction") .WithMethod("eth_sign") .WithMethod("personal_sign") .WithMethod("eth_signTypedData") .WithChain("eip155:1") .WithEvent("chainChanged") .WithEvent("accountsChanged") ); ``` -------------------------------- ### Install WalletConnect SignClient for Web Projects Source: https://docs.reown.com/walletkit/javascript/installation/advanced/api/sign/overview Instructions for installing the WalletConnect SignClient library for web projects using various JavaScript package managers like npm, Yarn, Bun, and pnpm. ```bash npm install @walletconnect/sign-client ``` ```bash yarn add @walletconnect/sign-client ``` ```bash bun add @walletconnect/sign-client ``` ```bash pnpm add @walletconnect/sign-client ``` -------------------------------- ### Install Wagmi Core for Blockchain Interaction Source: https://docs.reown.com/walletkit/javascript/installation/appkit/javascript/core/installation Instructions on how to install the `@wagmi/core` package using npm, Yarn, Bun, or pnpm to enable smart contract interaction. ```bash npm install @wagmi/core ``` -------------------------------- ### Send Blockchain Transaction with Ethers.js Source: https://docs.reown.com/walletkit/javascript/installation/appkit/svelte/core/installation This example shows how to send a transaction using Ethers.js. It initializes a `BrowserProvider` from an AppKit provider, obtains a signer, and then sends a simple value transfer transaction. Error handling for missing provider or address is included. ```JavaScript import { BrowserProvider, Contract, parseEther } from "ethers"; const provider = await appKit.subscribeProviders((state) => { return state["eip155"]; }); const addressFrom = await appKit.subscribeAccount((state) => { return state; }); 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); } ``` -------------------------------- ### Configure Reown AppKit with Ethers5 Adapter Source: https://docs.reown.com/walletkit/javascript/installation/appkit/javascript/core/installation Illustrates the setup of Reown AppKit in a `main.js` file using `Ethers5Adapter`. It includes steps for obtaining a project ID, defining application metadata, and initializing AppKit with specified networks and optional features like analytics. ```JavaScript import { createAppKit } from "@reown/appkit"; import { Ethers5Adapter } from "@reown/appkit-adapter-ethers5"; import { mainnet, arbitrum } from "@reown/appkit/networks"; // 1. Get projectId at https://cloud.reown.com const projectId = "YOUR_PROJECT_ID"; // 2. Create your application's metadata object const metadata = { name: "My Website", description: "My Website description", url: "https://mywebsite.com", // url must match your domain & subdomain icons: ["https://avatars.mywebsite.com/"], }; // 3. Create a AppKit instance const modal = createAppKit({ adapters: [new Ethers5Adapter()], metadata: metadata, networks: [mainnet, arbitrum], projectId, features: { analytics: true // Optional - defaults to your Cloud configuration } }); ``` -------------------------------- ### Install Wagmi Core for Blockchain Interaction Source: https://docs.reown.com/walletkit/javascript/installation/appkit/svelte/core/installation This command installs the `@wagmi/core` package, which is essential for interacting with smart contracts and wallets in JavaScript applications. ```Shell npm install @wagmi/core ``` -------------------------------- ### Interact with ERC-20 Contracts using Ethers.js Source: https://docs.reown.com/walletkit/javascript/installation/appkit/react/core/installation This example illustrates how to use Ethers.js to interact with an ERC-20 smart contract. It shows how to initialize a `BrowserProvider`, obtain a signer, create a `Contract` instance with a Human-Readable ABI, and call a view function like `balanceOf` to get a user's token balance. ```JavaScript 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 ; } ``` -------------------------------- ### Install Reown WalletKit Client Package for .NET Source: https://docs.reown.com/walletkit/javascript/installation/walletkit/c-sharp/installation Use the .NET CLI to add the Reown.WalletKit NuGet package to your project. This command integrates the WalletKit SDK, allowing you to begin using its functionalities in your .NET application. ```bash dotnet add package Reown.WalletKit ``` -------------------------------- ### Configure Reown AppKit in Vue with Ethers5 Adapter Source: https://docs.reown.com/walletkit/javascript/installation/appkit/vue/core/installation This example shows the complete setup of Reown AppKit within a Vue `App.vue` file using the `Ethers5Adapter`. It includes initializing `createAppKit` with a `projectId`, defining application `metadata`, and specifying supported networks. Ensure the `url` in metadata matches your domain for verification. ```vue ``` -------------------------------- ### Web3InboxClient Initialization Parameters API Reference Source: https://docs.reown.com/walletkit/javascript/installation/appkit/javascript/notifications/frontend-integration/api Details the parameters required for initializing the Web3InboxClient, including their types and descriptions. ```APIDOC Web3InboxClient.init(options: object) options: projectId: string - Your WalletConnect project ID (Required) domain: string - Your app’s domain. Defaults to `window.location.host`. (Optional) allApps: boolean - Set to `false` to request access to all of the user’s notification subscriptions for all apps, instead of only `domain`. Defaults to `true`. (Optional) ``` -------------------------------- ### Install Reown AppKit Core Package Source: https://docs.reown.com/walletkit/javascript/installation/appkit/upgrade/wcm Use npm to install the `@reown/appkit` package. Ensure the installed version is v1.7.0 or higher for compatibility with AppKit Core features. ```shell npm install @reown/appkit ``` -------------------------------- ### Install AppKit SIWE and SIWE Libraries Source: https://docs.reown.com/walletkit/javascript/installation/appkit/javascript/core/siwe This command installs the core `@reown/appkit-siwe` package for integrating Sign In With Ethereum (SIWE) and the `siwe` library, which abstracts much of the required SIWE logic. This is a foundational step for both One-Click Auth and Legacy SIWE implementations. ```npm npm install @reown/appkit-siwe siwe ``` -------------------------------- ### Programmatically Open AppKit Modals and Specific Views Source: https://docs.reown.com/walletkit/javascript/installation/appkit/svelte/core/installation Demonstrates how to control the AppKit modal programmatically using the `appKit` instance. This includes opening the default modal, or specific views like 'Connect' or 'Account', typically triggered by user interactions like button clicks. Examples are provided for both TypeScript and JavaScript. ```typescript ``` ```javascript ``` -------------------------------- ### Install Reown Appkit Experimental Library Source: https://docs.reown.com/walletkit/javascript/installation/appkit/javascript/early-access/smart-session Instructions for installing the `@reown/appkit-experimental` package, which includes support for Smart Sessions, using the npm package manager. ```npm npm install @reown/appkit-experimental ``` -------------------------------- ### Install WalletConnect Solana Adapter Source: https://docs.reown.com/walletkit/javascript/installation/advanced/providers/solana-adapter Instructions for installing the WalletConnect Solana Adapter using common JavaScript package managers. ```bash npm install @walletconnect/solana-adapter yarn add @walletconnect/solana-adapter bun add @walletconnect/solana-adapter pnpm add @walletconnect/solana-adapter ``` -------------------------------- ### Initialize AppKit with Solana Adapter in SvelteKit Source: https://docs.reown.com/walletkit/javascript/installation/appkit/svelte/core/installation This TypeScript snippet demonstrates how to initialize the Reown AppKit for Solana within a SvelteKit application. It imports necessary modules like `createAppKit`, `SolanaAdapter`, and Solana networks, ensuring the initialization only occurs in the browser environment for SSR compatibility. A `VITE_PROJECT_ID` is required for proper setup. ```TypeScript // lib/appkit.ts import { browser } from '$app/environment' import { createAppKit } from '@reown/appkit' import { SolanaAdapter } from '@reown/appkit-adapter-solana' import { solana, solanaTestnet, solanaDevnet } from '@reown/appkit/networks' // Only initialize in browser environment let appKit: ReturnType | undefined = undefined if (browser) { const projectId = import.meta.env.VITE_PROJECT_ID if (!projectId) { throw new Error('VITE_PROJECT_ID is not set') } const networks = [solana, solanaTestnet, solanaDevnet] // Create adapter const solanaAdapter = new SolanaAdapter() // Initialize AppKit appKit = createAppKit({ adapters: [solanaAdapter], networks: [solana, solanaTestnet, solanaDevnet], defaultNetwork: solana, projectId, metadata: { name: 'SvelteKit Example', description: 'SvelteKit Example using Solana adapter', url: 'https://reown.com/appkit', icons: ['https://avatars.githubusercontent.com/u/179229932?s=200&v=4'] } }) } export { appKit } ``` -------------------------------- ### Install WalletKit with Ethers for React Native CLI Source: https://docs.reown.com/walletkit/javascript/installation/appkit/react-native/core/installation Instructions for installing @reown/appkit-ethers-react-native and its dependencies for React Native CLI projects, including core packages, common async storage, polyfills, and SVG packages, and CocoaPods setup for iOS. ```Shell yarn add @reown/appkit-ethers-react-native ethers ``` ```Shell yarn add @react-native-async-storage/async-storage react-native-get-random-values react-native-svg react-native-modal @react-native-community/netinfo @walletconnect/react-native-compat ``` ```Shell npx pod-install ``` -------------------------------- ### Install WalletKit with Wagmi for React Native CLI Source: https://docs.reown.com/walletkit/javascript/installation/appkit/react-native/core/installation Instructions for installing @reown/appkit-wagmi-react-native and its dependencies for React Native CLI projects, including core packages, common async storage, polyfills, and SVG packages, and CocoaPods setup for iOS. ```Shell yarn add @reown/appkit-wagmi-react-native wagmi viem @tanstack/react-query ``` ```Shell yarn add @react-native-async-storage/async-storage react-native-get-random-values react-native-svg react-native-modal @react-native-community/netinfo @walletconnect/react-native-compat ``` ```Shell npx pod-install ``` -------------------------------- ### JavaScript Example Call for wallet_prepareCalls Source: https://docs.reown.com/walletkit/javascript/installation/appkit/react/early-access/smart-session Provides a practical JavaScript example demonstrating how to invoke the `wallet_prepareCalls` JSON RPC method. It illustrates the required structure for the input parameters, including a sample `capabilities` object with a `permissions` context for session keys. ```JavaScript wallet_prepareCalls([{ from: '0x...', chainId: '0x...', calls: [{ to: '0x...' data: '0x...' value: '0x...' }], capabilities: { permissions: { context: '...' // Importantly for session keys, wallets will likely need the ERC-7715 (https://eip.tools/eip/7715) permissions context for userOp construction } } }]) ``` -------------------------------- ### Example `params` for `eth_sendTransaction` JSON-RPC Source: https://docs.reown.com/walletkit/javascript/installation/advanced/api/sign/dapp-usage Provides an example of the `params` field structure for an `eth_sendTransaction` JSON-RPC request, which is an array of transaction objects. ```JSON params: [ { from: "0xb60e8dd61c5d32be8058bb8eb970870f07233155", to: "0xd46e8dd67c5d32be8058bb8eb970870f07244567", gas: "0x76c0", // 30400 gasPrice: "0x9184e72a000", // 10000000000000 value: "0x9184e72a", // 2441406250 data: "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675" } ] ``` -------------------------------- ### Initialize AppKit with Ethers Adapter in SvelteKit Source: https://docs.reown.com/walletkit/javascript/installation/appkit/svelte/core/installation This JavaScript snippet shows how to initialize the AppKit library within a SvelteKit application using the Ethers adapter. Similar to the Wagmi setup, it configures networks, a project ID, and application metadata, ensuring browser-only initialization for SSR compatibility. A `VITE_PROJECT_ID` environment variable is essential. ```JavaScript // lib/appkit.ts import { browser } from '$app/environment' import { createAppKit } from '@reown/appkit' import { EthersAdapter } from '@reown/appkit-adapter-ethers' import { arbitrum, mainnet } from '@reown/appkit/networks' // Only initialize in browser environment let appKit: ReturnType | undefined = undefined if (browser) { const projectId = import.meta.env.VITE_PROJECT_ID if (!projectId) { throw new Error('VITE_PROJECT_ID is not set') } const networks = [arbitrum, mainnet] // Create adapter const ethersAdapter = new EthersAdapter() // Initialize AppKit appKit = createAppKit({ adapters: [ethersAdapter], networks: [arbitrum, mainnet], defaultNetwork: arbitrum, projectId, metadata: { name: 'SvelteKit Example', description: 'SvelteKit Example using Ethers adapter', url: 'https://reown.com/appkit', icons: ['https://avatars.githubusercontent.com/u/179229932?s=200&v=4'] } ``` -------------------------------- ### Initialize WalletKit Core with Options (C#) Source: https://docs.reown.com/walletkit/javascript/installation/walletkit/c-sharp/usage First you must setup a `Core` instance with a specific `Name` and `ProjectId`. You may optionally specify other `CoreOption` values, such as `RelayUrl` and `Storage`. ```C# var options = new CoreOptions() { ProjectId = "...", Name = "my-app", } var core = new CoreClient(options); ``` -------------------------------- ### Install WalletKit with Ethers v5 for React Native CLI Source: https://docs.reown.com/walletkit/javascript/installation/appkit/react-native/core/installation Instructions for installing @reown/appkit-ethers5-react-native and its dependencies for React Native CLI projects, including core packages, Ethers v5 specific shims, async storage, polyfills, and SVG packages, and CocoaPods setup for iOS. ```Shell yarn add @reown/appkit-ethers5-react-native ethers@5.7.2 ``` ```Shell yarn add @ethersproject/shims@5.7.0 @react-native-async-storage/async-storage react-native-get-random-values react-native-svg react-native-modal @react-native-community/netinfo @walletconnect/react-native-compat ``` ```Shell npx pod-install ``` -------------------------------- ### Initialize Reown AppKit Instance Source: https://docs.reown.com/walletkit/javascript/installation/advanced/providers/ethereum Demonstrates how to create an AppKit instance using `createAppKit`, configuring networks and a project ID to enable the QRModal. ```JavaScript import { createAppKit } from "@reown/appkit"; import { mainnet, arbitrum, sepolia } from "@reown/appkit/networks"; // 1. Get projectId from https://cloud.reown.com const projectId = "YOUR_PROJECT_ID"; // 2. Create the AppKit instance const modal = createAppKit({ networks: [mainnet, arbitrum, sepolia], projectId, }); ``` -------------------------------- ### Explorer API: Get All Listings Source: https://docs.reown.com/walletkit/javascript/installation/cloud/explorer Describes the GET /v3/all endpoint, which returns a JSON object containing all entries listed in the public cloud explorer. Includes an example for paginated requests. ```APIDOC Endpoint: GET /v3/all Description: Returns a JSON object containing all entries listed in the public cloud explorer. Examples: - GET https://explorer-api.walletconnect.com/v3/all?projectId=YOUR_PROJECT_ID&entries=5&page=1 ``` -------------------------------- ### Initialize Web3Inbox Client Source: https://docs.reown.com/walletkit/javascript/installation/appkit/next/notifications/frontend-integration/migration-guide This snippet demonstrates the new way to initialize the Web3Inbox client. Previously, a hook was required for initialization, but now it's done with a simple function call. A separate hook is still recommended for checking the client's ready status. ```JavaScript import { useInitWeb3InboxClient } from '@web3inbox/widget-react' import { initWeb3InboxClient } from '@web3inbox/react' useInitWeb3inboxClient({ projectId, domain, isLimited }) initWeb3inboxClient({ projectId, domain, allApps }) ``` -------------------------------- ### Setting Up Reown AppKit with Wagmi and React Source: https://docs.reown.com/walletkit/javascript/installation/appkit/react/core/installation Illustrates the complete setup of Reown AppKit in a React application using the Wagmi adapter. This includes initializing `QueryClient`, obtaining a `projectId`, defining metadata, setting up networks, creating a `WagmiAdapter`, and finally configuring `createAppKit`. It also shows how to wrap the application with `WagmiProvider` and `QueryClientProvider`. ```JavaScript import { createAppKit } from '@reown/appkit/react' import { WagmiProvider } from 'wagmi' import { arbitrum, mainnet } from '@reown/appkit/networks' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' // 0. Setup queryClient const queryClient = new QueryClient() // 1. Get projectId from https://cloud.reown.com const projectId = 'YOUR_PROJECT_ID' // 2. Create a metadata object - optional const metadata = { name: 'AppKit', description: 'AppKit Example', url: 'https://example.com', // origin must match your domain & subdomain icons: ['https://avatars.githubusercontent.com/u/179229932'] } // 3. Set the networks const networks = [mainnet, arbitrum] // 4. Create Wagmi Adapter const wagmiAdapter = new WagmiAdapter({ networks, projectId, ssr: true }) // 5. Create modal createAppKit({ adapters: [wagmiAdapter], networks, projectId, metadata, features: { analytics: true // Optional - defaults to your Cloud configuration } }) export function AppKitProvider({ children }) { return ( {children} ) } ``` -------------------------------- ### Explorer API: Get DApps Listing Source: https://docs.reown.com/walletkit/javascript/installation/cloud/explorer Describes the GET /v3/dapps endpoint, which returns a JSON object containing all dApps listed in the public cloud explorer. Includes an example for paginated requests. ```APIDOC Endpoint: GET /v3/dapps Description: Returns a JSON object containing all dApps listed in the public cloud explorer. Examples: - GET https://explorer-api.walletconnect.com/v3/dapps?projectId=YOUR_PROJECT_ID&entries=5&page=1 ``` -------------------------------- ### Initialize AppKit with Core Options Source: https://docs.reown.com/walletkit/javascript/installation/appkit/javascript/core/options Shows the fundamental structure for initializing the AppKit library. It highlights the primary parameters like `adapters`, `projectId`, and `networks` that can be configured upon instantiation, along with other general options. ```JavaScript createAppKit({ adapters, projectId, networks, ...options }); ``` -------------------------------- ### Explorer API: Get Wallets Listing Source: https://docs.reown.com/walletkit/javascript/installation/cloud/explorer Describes the GET /v3/wallets endpoint, which returns a JSON object containing all wallets listed in the cloud explorer. Includes examples for paginated and platform-filtered requests. ```APIDOC Endpoint: GET /v3/wallets Description: Returns a JSON object containing all wallets listed in the cloud explorer. Examples: - GET https://explorer-api.walletconnect.com/v3/wallets?projectId=YOUR_PROJECT_ID&entries=5&page=1 (will return the first 5 wallets from the first page) - GET https://explorer-api.walletconnect.com/v3/wallets?projectId=YOUR_PROJECT_ID&platforms=injected (will only return injected wallets) ``` -------------------------------- ### Initialize New Expo WalletKit Project Source: https://docs.reown.com/walletkit/javascript/installation/walletkit/react-native/resources This experimental npx starter command downloads an Expo template with WalletKit pre-installed. Replace `newWallet` with the desired name for your project. More information is available in the linked tutorial. ```Shell npx create-wc-wallet-expo@latest newWallet ``` -------------------------------- ### JavaScript Example for wallet_prepareCalls RPC Call Source: https://docs.reown.com/walletkit/javascript/installation/appkit/javascript/early-access/smart-session Provides a practical JavaScript example demonstrating how to invoke the `wallet_prepareCalls` JSON RPC method with sample values for `from`, `chainId`, `calls`, and `capabilities`, highlighting the `permissions.context` for session keys. ```JavaScript wallet_prepareCalls([{ from: '0x...', chainId: '0x...', calls: [{ to: '0x...' data: '0x...' value: '0x...' }], capabilities: { permissions: { context: '...' // Importantly for session keys, wallets will likely need the ERC-7715 (https://eip.tools/eip/7715) permissions context for userOp construction } } }]) ``` -------------------------------- ### Explorer API: Get Hybrid Listings Source: https://docs.reown.com/walletkit/javascript/installation/cloud/explorer Describes the GET /v3/hybrid endpoint, which returns a JSON object containing all hybrid entries listed in the public cloud explorer. Includes an example for paginated requests. ```APIDOC Endpoint: GET /v3/hybrid Description: Returns a JSON object containing all hybrids listed in the public cloud explorer. Examples: - GET https://explorer-api.walletconnect.com/v3/hybrid?projectId=YOUR_PROJECT_ID&entries=5&page=1 ``` -------------------------------- ### Install Solana Web3.js Library Source: https://docs.reown.com/walletkit/javascript/installation/appkit/recipes/solana-send-transaction Install the required @solana/web3.js library to enable interactions with the Solana blockchain and wallet within your JavaScript/React project. ```Shell npm install @solana/web3.js ``` -------------------------------- ### Install WalletConnect Core via Git URL (Unity) Source: https://docs.reown.com/walletkit/javascript/installation/advanced/api/core/pairing Provides the Git URL for installing the com.walletconnect.core package directly through Unity's Package Manager. It also demonstrates how to specify a particular version by appending a git tag to the URL. ```Unity https://github.com/WalletConnect/WalletConnectUnity.git?path=Packages/com.walletconnect.core ``` ```Unity https://github.com/WalletConnect/WalletConnectUnity.git?path=Packages/com.walletconnect.core#core/1.0.1 ``` -------------------------------- ### Initialize Reown AppKit Source: https://docs.reown.com/walletkit/javascript/installation/appkit/svelte/core/options Demonstrates the basic structure for initializing the Reown AppKit by passing configuration options. ```JavaScript createAppKit({ adapters, projectId, networks, ...options }); ``` -------------------------------- ### Get Hedera Node Addresses Request Example Source: https://docs.reown.com/walletkit/javascript/installation/advanced/multichain/rpc-reference/hedera-rpc Example JSON payload for requesting a list of Hedera network node addresses using the `hedera_getNodeAddresses` method. This request does not require any parameters. ```JSON { "id": 1, "jsonrpc": "2.0", "method": "hedera_getNodeAddresses" } ``` -------------------------------- ### Import WalletConnect Core and WalletKit Modules Source: https://docs.reown.com/walletkit/javascript/installation/advanced/multichain/polkadot/wallet-integration-guide Demonstrates how to import the necessary Core and WalletKit modules from the `@walletconnect` package, which are fundamental for building a WalletConnect-enabled wallet. ```TypeScript import { Core } from "@walletconnect/core"; import { WalletKit } from "@walletconnect/wallekit"; ``` -------------------------------- ### Install AppKit with Wagmi and Solana Adapter Source: https://docs.reown.com/walletkit/javascript/installation/appkit/next/core/multichain Installs the core AppKit library along with the Wagmi adapter and the Solana-specific adapter. This setup enables integration with the Solana blockchain within your AppKit project using Wagmi. ```npm npm install @reown/appkit @reown/appkit-adapter-wagmi @reown/appkit-adapter-solana ``` -------------------------------- ### Install Reown AppKit with Wagmi and Viem Source: https://docs.reown.com/walletkit/javascript/installation/appkit/javascript/core/installation Provides the installation command for Reown AppKit, its Wagmi adapter, Wagmi, and Viem, compatible with various JavaScript package managers. ```npm npm install @reown/appkit @reown/appkit-adapter-wagmi wagmi viem ``` ```Yarn npm install @reown/appkit @reown/appkit-adapter-wagmi wagmi viem ``` ```Bun npm install @reown/appkit @reown/appkit-adapter-wagmi wagmi viem ``` ```pnpm npm install @reown/appkit @reown/appkit-adapter-wagmi wagmi viem ``` -------------------------------- ### Create and Trigger WalletKit Modal in JavaScript Source: https://docs.reown.com/walletkit/javascript/installation/appkit/javascript/core/installation This JavaScript snippet demonstrates how to initialize the WalletKit modal using `createAppKit` with adapters, networks, metadata, and project ID. It also shows how to programmatically open the modal for connection or network selection by attaching event listeners to HTML elements. ```javascript // 5. Create modal const modal = createAppKit({ adapters: [bitcoinAdapter], networks, metadata, projectId, features: { analytics: true // Optional - defaults to your Cloud configuration, email: false, socials: [] } }) // 6. Trigger modal programaticaly const openConnectModalBtn = document.getElementById('open-connect-modal') const openNetworkModalBtn = document.getElementById('open-network-modal') openConnectModalBtn.addEventListener('click', () => modal.open()) openNetworkModalBtn.addEventListener('click', () => modal.open({ view: 'Networks' })) ```