> ## Documentation Index
> Fetch the complete documentation index at: https://reown-5552f0bb-devin-1759771246-appkit-1-8-9-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

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.
Choose one of these to get started.

<Note>
  We recommend using
  [Vite](https://vitejs.dev/guide/#scaffolding-your-first-vite-project) to get
  started with AppKit JavaScript.
</Note>

## Installation

**Setting up from scratch? → Try out the [AppKit CLI templates](#alternative-installation) or the [AI-assisted setup](#alternative-installation).**

## Custom Installation

<Tabs>
  <Tab title="Wagmi">
    <CodeGroup>
      ```bash npm theme={null}
      npm install @reown/appkit @reown/appkit-adapter-wagmi wagmi viem
      ```

      ```bash Yarn theme={null}
      yarn add @reown/appkit @reown/appkit-adapter-wagmi wagmi viem
      ```

      ```bash Bun theme={null}
      bun add @reown/appkit @reown/appkit-adapter-wagmi wagmi viem
      ```

      ```bash pnpm theme={null}
      pnpm add @reown/appkit @reown/appkit-adapter-wagmi wagmi viem
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Ethers v5">
    <CodeGroup>
      ```bash npm theme={null}
      npm install @reown/appkit @reown/appkit-adapter-ethers5 ethers@5.7.2
      ```

      ```bash Yarn theme={null}
      yarn add @reown/appkit @reown/appkit-adapter-ethers5 ethers@5.7.2
      ```

      ```bash Bun theme={null}
      bun add @reown/appkit @reown/appkit-adapter-ethers5 ethers@5.7.2
      ```

      ```bash pnpm theme={null}
      pnpm add @reown/appkit @reown/appkit-adapter-ethers5 ethers@5.7.2
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Ethers">
    <CodeGroup>
      ```bash npm theme={null}
      npm install @reown/appkit @reown/appkit-adapter-ethers ethers
      ```

      ```bash Yarn theme={null}
      yarn add @reown/appkit @reown/appkit-adapter-ethers ethers
      ```

      ```bash Bun theme={null}
      bun add @reown/appkit @reown/appkit-adapter-ethers ethers
      ```

      ```bash pnpm theme={null}
      pnpm add @reown/appkit @reown/appkit-adapter-ethers ethers
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Solana">
    <CodeGroup>
      ```bash npm theme={null}
      npm install @reown/appkit @reown/appkit-adapter-solana
      ```

      ```bash Yarn theme={null}
      yarn add @reown/appkit @reown/appkit-adapter-solana
      ```

      ```bash Bun theme={null}
      bun add @reown/appkit @reown/appkit-adapter-solana
      ```

      ```bash pnpm theme={null}
      pnpm add @reown/appkit @reown/appkit-adapter-solana
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Bitcoin">
    <CodeGroup>
      ```bash npm theme={null}
      npm install @reown/appkit @reown/appkit-adapter-bitcoin
      ```

      ```bash Yarn theme={null}
      yarn add @reown/appkit @reown/appkit-adapter-bitcoin
      ```

      ```bash Bun theme={null}
      bun add @reown/appkit @reown/appkit-adapter-bitcoin
      ```

      ```bash pnpm theme={null}
      pnpm add @reown/appkit @reown/appkit-adapter-bitcoin
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Others networks (AppKit Core)">
    <CodeGroup>
      ```bash npm theme={null}
      npm install @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
      ```

      ```bash Yarn theme={null}
      yarn add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
      ```

      ```bash Bun theme={null}
      bun add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
      ```

      ```bash pnpm theme={null}
      pnpm add @reown/appkit @reown/appkit-universal-connector @reown/appkit-common ethers
      ```
    </CodeGroup>
  </Tab>
</Tabs>

## Cloud Configuration

Create a new project on Reown Dashboard at [https://dashboard.reown.com](https://dashboard.reown.com) and obtain a new project ID.

<Info>
  **Don't have a project ID?**

  Head over to Reown Dashboard and create a new project now!

  <Card title="Get started" href="https://dashboard.reown.com/?utm_source=cloud_banner&utm_medium=docs&utm_campaign=backlinks" />
</Info>

## Implementation

<Tabs>
  <Tab title="Wagmi">
    <Card title="wagmi Example" icon="github" href="https://github.com/reown-com/appkit-web-examples/tree/main/javascript/javascript-wagmi">
      Check the JavaScript wagmi example
    </Card>

    For a quick integration, you can use the `createAppKit` function with a unified configuration. This automatically applies the predefined configurations for different adapters like Wagmi, Ethers, or Solana, so you no longer need to manually configure each one individually. Simply pass the common parameters such as `projectId`, `chains`, `metadata`, etc., and the function will handle the adapter-specific configurations under the hood.

    This includes WalletConnect, Coinbase and Injected connectors, and the [Blockchain API](../../../../cloud/blockchain-api) as a [transport](https://wagmi.sh/core/api/createConfig#transports)

    In your `main.js` file set up the following configuration.

    ```ts theme={null}
    import { createAppKit } from '@reown/appkit'
    import { mainnet, arbitrum } from '@reown/appkit/networks'
    import { WagmiAdapter } from '@reown/appkit-adapter-wagmi'

    // 1. Get a project ID at https://dashboard.reown.com
    const projectId = 'YOUR_PROJECT_ID'

    export const networks = [mainnet, arbitrum]

    // 2. Set up Wagmi adapter
    const wagmiAdapter = new WagmiAdapter({
      projectId,
      networks
    })

    // 3. Configure the metadata
    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 modal
    const modal = createAppKit({
      adapters: [wagmiAdapter],
      networks: [mainnet, arbitrum],
      metadata,
      projectId,
      features: {
        analytics: true // Optional - defaults to your Cloud configuration
      }
    })

    // 4. 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' }))

    // 5. Alternatively use w3m component buttons within the index.html file
    ```

    ## Importing networks

    Reown AppKit use [Viem](https://viem.sh/) networks under the hood, which provide a wide variety of networks for EVM chains. You can find all the networks supported by Viem within the `@reown/appkit/networks` path.

    ```js {2} theme={null}
    import { createAppKit } from '@reown/appkit'
    import { mainnet, arbitrum, base, scroll, polygon } from '@reown/appkit/networks'
    ```

    <Note>
      Looking to add a custom network? Check out the [custom networks](/appkit/javascript/core/custom-networks) section.
    </Note>
  </Tab>

  <Tab title="Ethers v5">
    In your `main.js` file set up the following configuration.

    ```ts theme={null}
    import { createAppKit } from "@reown/appkit";
    import { Ethers5Adapter } from "@reown/appkit-adapter-ethers5";
    import { mainnet, arbitrum } from "@reown/appkit/networks";

    // 1. Get projectId at https://dashboard.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
      },
    });
    ```

    <Warning>
      Make sure that the `url` from the `metadata` matches your domain and subdomain. This will later be used by the **Verify API** to tell wallets if your application has been verified or not.
    </Warning>
  </Tab>

  <Tab title="Ethers">
    <Card title="ethers Example" icon="github" href="https://github.com/reown-com/appkit-web-examples/tree/main/javascript/javascript-ethers">
      Check the JavaScript ethers example
    </Card>

    In your `main.js` file set up the following configuration.

    ```ts theme={null}
    import { createAppKit } from "@reown/appkit";
    import { EthersAdapter } from "@reown/appkit-adapter-ethers";
    import { mainnet, arbitrum } from "@reown/appkit/networks";

    // 1. Get projectId from https://dashboard.reown.com
    const projectId = "YOUR_PROJECT_ID";

    // 2. Create your application's metadata object
    const metadata = {
      name: "AppKit",
      description: "AppKit Example",
      url: "https://reown.com/appkit", // origin must match your domain & subdomain
      icons: ["https://avatars.githubusercontent.com/u/179229932"],
    };

    // 3. Create a AppKit instance
    const modal = createAppKit({
      adapters: [new EthersAdapter()],
      networks: [mainnet, arbitrum],
      metadata,
      projectId,
      features: {
        analytics: true, // Optional - defaults to your Cloud configuration
      },
    });
    ```

    <Warning>
      Make sure that the `url` from the `metadata` matches your domain and subdomain. This will later be used by the **Verify API** to tell wallets if your application has been verified or not.
    </Warning>
  </Tab>

  <Tab title="Solana">
    <Card title="Solana Example" icon="github" href="https://github.com/reown-com/appkit-web-examples/tree/main/javascript/javascript-solana">
      Check the JavaScript Solana example
    </Card>

    AppKit Solana is built on top of the AppKit library and provides a set of components and actions to easily connect Solana wallets with your application.

    On top of your app set up the following configuration.

    ```tsx theme={null}
    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://dashboard.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
      },
    });
    ```
  </Tab>

  <Tab title="Bitcoin">
    <Card title="Bitcoin Example" icon="github" href="https://github.com/reown-com/appkit-web-examples/tree/main/javascript/javascript-bitcoin">
      Check the JavaScript Bitcoin example
    </Card>

    AppKit Bitcoin is built on top of the AppKit library and provides a set of components and actions to easily connect Bitcoin wallets with your decentralized application.

    On top of your app set up the following configuration.

    ```tsx theme={null}
    // App.tsx
    import { createAppKit } from '@reown/appkit'
    import { BitcoinAdapter } from '@reown/appkit-adapter-bitcoin'
    import { bitcoin, bitcoinTestnet, bitcoinSignet } from '@reown/appkit/networks'

    // 1. Get projectId from https://dashboard.reown.com
    const projectId = 'YOUR_PROJECT_ID'

    // 2. Set the networks
    const networks = [bitcoin, bitcoinTestnet, bitcoinSignet]

    // 3. Set up Bitcoin Adapter
    const bitcoinAdapter = new BitcoinAdapter({
      projectId
    })

    // 4. Create a metadata object - optional
    const metadata = {
      name: 'AppKit',
      description: 'AppKit Bitcoin Example',
      url: 'https://example.com', // origin must match your domain & subdomain
      icons: ['https://avatars.githubusercontent.com/u/179229932']
    }

    // 5. Create modal
    const modal = createAppKit({
      adapters: [bitcoinAdapter],
      networks,
      metadata,
      projectId,
      features: {
        analytics: true // Optional - defaults to your Dashboard 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' }))
    ```

    ## Bitcoin Provider Interface

    ```ts theme={null}
    export interface BitcoinConnector extends ChainAdapterConnector, Provider {
      getAccountAddresses(): Promise<BitcoinConnector.AccountAddress[]>;
      signMessage(params: BitcoinConnector.SignMessageParams): Promise<string>;
      sendTransfer(params: BitcoinConnector.SendTransferParams): Promise<string>;
      signPSBT(
        params: BitcoinConnector.SignPSBTParams
      ): Promise<BitcoinConnector.SignPSBTResponse>;
    }
    ```

    ### Parameters

    <Tabs>
      <Tab title="SignMessageParams">
        ```ts theme={null}
          export type SignMessageParams = {
            /**
             * The message to be signed
             */
            message: string
            /**
             * The address to sign the message with
             */
            address: string
          }
        ```
      </Tab>

      <Tab title="SendTransferParams">
        ```ts theme={null}
          export type SendTransferParams = {
            /**
             * The amount to be sent in satoshis
             */
            amount: string
            /**
             * The address to send the transfer to
             */
            recipient: string
          }
        ```
      </Tab>

      <Tab title="SignPSBTParams">
        ```ts theme={null}
          export type SignPSBTParams = {
            /**
             * The PSBT to be signed, string base64 encoded
             */
            psbt: string
            signInputs: {
              /**
               * The address whose private key to use for signing.
               */
              address: string
              /**
               * Specifies which input to sign
               */
              index: number
              /**
               * Specifies which part(s) of the transaction the signature commits to
               */
              sighashTypes: number[]
            }[]

            /**
             * If `true`, the PSBT will be broadcasted after signing. Default is `false`.
             */
            broadcast?: boolean

        }

        ```
      </Tab>
    </Tabs>

    ### Responses

    <Tabs>
      <Tab title="AccountAddress">
        ```ts theme={null}
          export type AccountAddress = {
            /**
             * Public address belonging to the account.
             */
            address: string
            /**
             * Public key for the derivation path in hex, without 0x prefix
             */
            publicKey?: string
            /**
             * The derivation path of the address e.g. "m/84'/0'/0'/0/0"
             */
            path?: string
            /**
             * The purpose of the address
             */
            purpose: 'payment' | 'ordinal' | 'stx'
          }
        ```
      </Tab>

      <Tab title="SignPSBTResponse">
        ```ts theme={null}
          export type SignPSBTResponse = {
            /**
             * The signed PSBT, string base64 encoded
             */
            psbt: string
            /**
             * The `string` transaction id of the broadcasted transaction or `undefined` if not broadcasted
             */
            txid?: string
          }
        ```
      </Tab>
    </Tabs>
  </Tab>

  <Tab title="Others networks (AppKit Core)">
    <Card title="AppKit Core Example" icon="github" href="https://github.com/reown-com/appkit-web-examples/tree/main/javascript/javascript-core-universal-connector">
      Check the JavaScript AppKit Core example for Sui and Stacks
    </Card>

    For a quick integration of Appkit Core you can use the `UniversalConnector` class. Which simplifies the integration of Appkit Core 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 theme={null}
    import { UniversalConnector } from '@reown/appkit-universal-connector'

    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 = {
      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'] } }
    }

    const stacksMainnet = {
      id: 1,
      chainNamespace: 'stacks',
      caipNetworkId: 'stacks:1',
      name: 'Stacks',
      nativeCurrency: { name: 'STX', symbol: 'STX', decimals: 6 },
      rpcUrls: { default: { http: ['https://stacks-node-mainnet.stacks.co'] } }
    }


    export const networks = [suiMainnet, stacksMainnet]

    export let universalConnector

    export async function getUniversalConnector() {
      if (!universalConnector) {
        universalConnector = await UniversalConnector.init({
          projectId,
          metadata: {
            name: 'Universal Connector',
            description: 'Universal Connector',
            url: 'https://appkit.reown.com',
            icons: ['https://appkit.reown.com/icon.png']
          },
          networks: [
            {
              methods: ['sui_signPersonalMessage'],
              chains: [suiMainnet],
              events: [],
              namespace: 'sui'
            },
            {
              methods: ['stx_signMessage'],
              chains: [stacksMainnet],
              events: ['stx_chainChanged'],
              namespace: 'stacks'
            }
          ]
        })
      }
      return universalConnector
    }
    ```

    In de main.js file you can add :

    ```tsx theme={null}
    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() 
    ```
  </Tab>
</Tabs>

## Trigger the modal

<Tabs>
  <Tab title="Wagmi">
    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).
    In this example we are going to use the `<appkit-button>` component.

    Web components are global html elements that don't require importing.

    ```html {11,12} theme={null}
    <!doctype html>
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <title>HTML Example</title>
      </head>
      <body>
        <div id="app">
          <button id="open-connect-modal">Open Modal</button>
          <button id="open-network-modal">Open Networks</button>
          <appkit-button />
          <appkit-network-button />
        </div>
        <script type="module" src="main.js"></script>
      </body>
    </html>
    ```

    Learn more about the AppKit web components [here](/appkit/javascript/core/components)
  </Tab>

  <Tab title="Ethers v5">
    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).

    <Tabs>
      <Tab title="Web Component">
        ```html {3,4} theme={null}
          <body>
            <div id="app">
              <appkit-button />
              <appkit-network-button />
            </div>
            <script type="module" src="/src/main.js"></script>
          </body>
        </html>
        ```

        Learn more about the AppKit web components [here](/appkit/javascript/core/components)

        <Info>
          Web components are global html elements that don't require importing.
        </Info>
      </Tab>

      <Tab title="Actions">
        You can trigger the modal by calling the `open` function from a modal instance returned by `createAppKit`.

        Let's first add two html button elements into our `index.html` file:

        ```html {9,10} theme={null}
        <!DOCTYPE html>
        <html lang="en">
          <head>
            <meta charset="UTF-8" />
            <title>HTML Example</title>
          </head>
          <body>
            <div id="app">
              <button id="open-connect-modal">Open Modal</button>
              <button id="open-network-modal">Open Networks</button>
            </div>
            <script type="module" src="main.js"></script>
          </body>
        </html>
        ```

        Following with our `main.js` file, we can now add the needed logic to open the modal:

        ```ts theme={null}
        // Trigger modal programaticaly
        // Add this code inside `main.js` file at the end of the code file
        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" })
        );
        ```

        Learn more about the AppKit actions [here](/appkit/javascript/core/actions)
      </Tab>
    </Tabs>
  </Tab>

  <Tab title="Ethers">
    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).

    <Tabs>
      <Tab title="Web Component">
        ```html {3,4} theme={null}
          <body>
            <div id="app">
              <appkit-button />
              <appkit-network-button />
            </div>
            <script type="module" src="/src/main.js"></script>
          </body>
        </html>
        ```

        Learn more about the AppKit web components [here](/appkit/javascript/core/components)

        <Info>
          Web components are global html elements that don't require importing.
        </Info>
      </Tab>

      <Tab title="Actions">
        You can trigger the modal by calling the `open` function from a modal instance returned by `createAppKit`.

        Let's first add two html button elements into our `index.html` file:

        ```html {9,10} theme={null}
        <!DOCTYPE html>
        <html lang="en">
          <head>
            <meta charset="UTF-8" />
            <title>HTML Example</title>
          </head>
          <body>
            <div id="app">
              <button id="open-connect-modal">Open Modal</button>
              <button id="open-network-modal">Open Networks</button>
            </div>
            <script type="module" src="main.js"></script>
          </body>
        </html>
        ```

        Following with our `main.js` file, we can now add the needed logic to open the modal:

        ```ts theme={null}
        // Trigger modal programaticaly
        // Add this code inside `main.js` file at the end of the code file
        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" })
        );
        ```

        Learn more about the AppKit actions [here](/appkit/javascript/core/actions)
      </Tab>
    </Tabs>
  </Tab>

  <Tab title="Solana">
    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).
    In this example we are going to use the `<appkit-button>` component.

    Web components are global html elements that don't require importing.

    ```html {8} theme={null}
    <!doctype html>
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <title>HTML Example</title>
      </head>
      <body>
        <appkit-button />
        <script type="module" src="main.js"></script>
      </body>
    </html>
    ```

    Learn more about the AppKit web components [here](/appkit/javascript/core/components)
  </Tab>

  <Tab title="Bitcoin">
    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).
    In this example we are going to use the `<appkit-button>` component.

    Web components are global html elements that don't require importing.

    ```tsx theme={null}
    <!doctype html>
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <title>HTML AppKit Example</title>
      </head>
      <body>
        <appkit-button />
        <script type="module" src="main.js"></script>
      </body>
    </html>
    ```
  </Tab>

  <Tab title="Others networks (AppKit Core)">
    To open AppKit you need to call the `connect` function from the Provider, sending the namespace, methods, the full chain Namespace and the events available.
    For more information, please visit [RPC Reference](https://docs.reown.com/advanced/multichain/rpc-reference/cosmos-rpc) section from our docs.

    ```tsx theme={null}
    <script>
        let address = null
        let addressStacks = null
        let session = null

        async function handleConnect() {
          // universalConnector is the universal connector instance from the implementation section
          if (!universalConnector) {
            return
          }

          const { session: providerSession } = await universalConnector.connect()
          // get the address from the session
          if (providerSession?.namespaces?.sui?.accounts?.[0]?.split(':')[2]) {
            address = providerSession?.namespaces?.sui?.accounts?.[0]?.split(':')[2]
          } else if (providerSession?.namespaces?.stacks?.accounts?.[0]?.split(':')[2]) {
            addressStacks = providerSession?.namespaces?.stacks?.accounts?.[0]?.split(':')[2]
          }
          // update the session
          session = providerSession;
        }

        document.getElementById('open-connect-modal').addEventListener('click', handleConnect);
    </script>
    .... 

    <div> 
      <button id="open-connect-modal">Open AppKit Core</button>
    </div>

    ```
  </Tab>
</Tabs>

## Blockchain Interaction

<Tabs>
  <Tab title="Wagmi">
    You need to install @wagmi/core to interact with smart contracts:

    <CodeGroup>
      ```bash npm theme={null}
      npm install @wagmi/core
      ```

      ```bash Yarn theme={null}
      yarn add @wagmi/core
      ```

      ```bash Bun theme={null}
      bun a @wagmi/core
      ```

      ```bash pnpm theme={null}
      pnpm add @wagmi/core
      ```
    </CodeGroup>

    [Wagmi actions](https://wagmi.sh/core/api/actions/readContract) can help us interact with wallets and smart contracts:

    For this use case, we need to import the `wagmiConfig`from our AppKit WagmiAdapter configuration.

    ```tsx theme={null}
    import { readContract } from "@wagmi/core";
    import { USDTAbi } from "../abi/USDTAbi";

    const USDTAddress = "0x...";

    const data = readContract(wagmiConfig, {
      address: USDTAddress,
      abi: USDTAbi,
      functionName: "totalSupply",
      args: [],
    });
    ```

    Read more about Wagmi actions for smart contract interaction [here](https://wagmi.sh/core/actions/readContract).
  </Tab>

  <Tab title="Ethers">
    [Ethers](https://docs.ethers.org/v6/) can help us interact with wallets and smart contracts:

    ```tsx theme={null}
    import { BrowserProvider, Contract, parseEther } from "ethers";

    const provider = await modal.subscribeProviders((state) => {
      return state["eip155"];
    });

    const addressFrom = await modal.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);
    }
    ```
  </Tab>

  <Tab title="Solana">
    [@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://appkit-lab.reown.com/appkit/?name=solana).

    ```js theme={null}
    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 '-';
      }
    }
    ```
  </Tab>
</Tabs>

## Alternative Installation

If you are starting from scratch, you can use the following methods to set up your project with Reown AppKit.

<AccordionGroup>
  <Accordion title="Set up Reown AppKit using AI">
    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:

    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).
  </Accordion>

  <Accordion title="AppKit CLI">
    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.

    ```bash theme={null}
    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:

    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`.

    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.**
  </Accordion>
</AccordionGroup>
