npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@initia/interwovenkit-react

v2.1.0

Published

Connect dApps to Initia and Interwoven Rollups

Downloads

980

Readme

@initia/interwovenkit-react

InterwovenKit is a React library that provides components and hooks to connect dApps to Initia and Interwoven Rollups.

For detailed documentation, visit https://docs.initia.xyz/interwovenkit.

Table of Contents

Features

Connect

Connect to external wallets. Supports multiple wallet providers including MetaMask and Keplr.

Wallet

Wallet interface for managing assets across Interwoven rollups:

  • View fungible tokens
  • Browse NFT items
  • Track transaction history

Bridge

Cross-chain bridge and swap functionality:

  • Transfer assets between Initia and Interwoven rollups
  • Swap tokens within and across chains
  • Automatic route optimization for best rates
  • Support for OP Bridge withdrawals

Transaction Signing

Transaction handling with detailed preview:

  • Fee estimation with multiple fee token options
  • Transaction simulation before signing
  • Detailed message breakdown

Getting Started

Installation

Install @initia/interwovenkit-react along with its peer dependencies:

pnpm add @initia/interwovenkit-react wagmi viem @tanstack/react-query

Configure Providers

Wrap your app with providers:

// providers.tsx
"use client"

import { PropsWithChildren, useEffect } from "react"
import { createConfig, http, WagmiProvider } from "wagmi"
import { mainnet } from "wagmi/chains"
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import {
  initiaPrivyWalletConnector,
  injectStyles,
  InterwovenKitProvider,
} from "@initia/interwovenkit-react"
import InterwovenKitStyles from "@initia/interwovenkit-react/styles.js"

const wagmiConfig = createConfig({
  connectors: [initiaPrivyWalletConnector],
  chains: [mainnet],
  transports: { [mainnet.id]: http() },
})
const queryClient = new QueryClient()

export default function Providers({ children }: PropsWithChildren) {
  useEffect(() => {
    // Inject styles into the shadow DOM used by Initia Wallet
    injectStyles(InterwovenKitStyles)
  }, [])

  return (
    <QueryClientProvider client={queryClient}>
      <WagmiProvider config={wagmiConfig}>
        <InterwovenKitProvider defaultChainId="YOUR_CHAIN_ID">{children}</InterwovenKitProvider>
      </WagmiProvider>
    </QueryClientProvider>
  )
}

Then wrap your application root:

// layout.tsx
import Providers from "./providers"

export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
  return (
    <html>
      <body>
        <Providers>{children}</Providers>
      </body>
    </html>
  )
}

Basic Example

Connect the wallet, check the balance, and send a transaction:

// page.tsx
"use client"

import { truncate } from "@initia/utils"
import { useInterwovenKit } from "@initia/interwovenkit-react"

export default function Home() {
  const { address, username, openConnect, openWallet, openBridge, requestTxBlock } =
    useInterwovenKit()

  const send = async () => {
    const messages = [
      {
        typeUrl: "/cosmos.bank.v1beta1.MsgSend",
        value: {
          fromAddress: address,
          toAddress: address,
          amount: [{ amount: "1000000", denom: "uinit" }],
        },
      },
    ]

    const { transactionHash } = await requestTxBlock({ messages })
    console.log("Transaction sent:", transactionHash)
  }

  const ETH = "move/edfcddacac79ab86737a1e9e65805066d8be286a37cb94f4884b892b0e39f954"
  const USDC = "ibc/6490A7EAB61059BFC1CDDEB05917DD70BDF3A611654162A1A47DB930D40D8AF4"

  const bridgeTransferDetails = {
    srcChainId: "interwoven-1",
    srcDenom: ETH,
    dstChainId: "interwoven-1",
    dstDenom: USDC,
  }

  if (!address) {
    return <button onClick={openConnect}>Connect</button>
  }

  return (
    <>
      <button onClick={send}>Send</button>
      <button onClick={() => openBridge(bridgeTransferDetails)}>Bridge</button>
      <button onClick={openWallet}>{truncate(username ?? address)}</button>
    </>
  )
}

Custom Fee Handling

When you need to bypass the fee selection UI and use pre-calculated fees directly:

// page.tsx
"use client"

import { calculateFee, GasPrice } from "@cosmjs/stargate"
import { useInterwovenKit } from "@initia/interwovenkit-react"

export default function Home() {
  const { address, estimateGas, submitTxBlock } = useInterwovenKit()

  const send = async () => {
    const messages = [
      {
        typeUrl: "/cosmos.bank.v1beta1.MsgSend",
        value: {
          fromAddress: address,
          toAddress: address,
          amount: [{ amount: "1000000", denom: "uinit" }],
        },
      },
    ]

    const gas = await estimateGas({ messages })
    const fee = calculateFee(gas, GasPrice.fromString("0.015uinit"))
    const { transactionHash } = await submitTxBlock({ messages, fee })
    console.log("Transaction sent:", transactionHash)
  }

  return <button onClick={send}>Send</button>
}

Usage on Testnet

import type { PropsWithChildren } from "react"
import { InterwovenKitProvider, TESTNET } from "@initia/interwovenkit-react"

export default function Providers({ children }: PropsWithChildren) {
  return <InterwovenKitProvider {...TESTNET}>{children}</InterwovenKitProvider>
}

Migrating From v1

To migrate from @initia/react-wallet-widget v1.x to @initia/interwovenkit-react, see our official migration guide:

https://docs.initia.xyz/interwovenkit/migration