Cosmos Kit
Beta (Interchain Kit) ⚡️
Get Started

Getting Started with Interchain Kit

Installation

Install the required packages:

npm install @interchain-kit/react @interchain-kit/core

Basic Setup

Wrap your app with the InterchainProvider:

import { InterchainProvider } from '@interchain-kit/react'
import { chains, assets } from 'chain-registry'
 
function App() {
  return (
    <InterchainProvider
      chains={chains}
      assets={assets}
      walletConnectProjectId="your-project-id"
    >
      <YourApp />
    </InterchainProvider>
  )
}

Using Hooks

import { useChain, useConnect } from '@interchain-kit/react'
 
function WalletConnect() {
  const { connect, disconnect, isConnected } = useConnect()
  const { address } = useChain('cosmoshub')
 
  return (
    <div>
      {isConnected ? (
        <button onClick={disconnect}>Disconnect</button>
      ) : (
        <button onClick={connect}>Connect Wallet</button>
      )}
      {address && <div>Connected Address: {address}</div>}
    </div>
  )
}

Using Components

import { WalletButton, WalletModal } from '@interchain-kit/react'
 
function WalletSection() {
  return (
    <div>
      <WalletButton />
      <WalletModal />
    </div>
  )
}

Next Steps