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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tron-wallet-kit/react

v0.1.0

Published

React integration for TRON Wallet Kit.

Readme

@tron-wallet-kit/react

React integration for TRON Wallet Kit. This package provides the ConnectKit-style public API for TRON dapps: provider, connect button, hooks, and theme factories.

Install

pnpm add @tron-wallet-kit/react@latest

Peer dependency:

pnpm add react

Quick Start

import { createRoot } from "react-dom/client";
import {
  TronKitProvider,
  TronConnectButton,
  getDefaultConfig,
  lightTheme
} from "@tron-wallet-kit/react";

const config = getDefaultConfig({
  metadata: {
    name: "My TRON dApp",
    description: "Wallet connection for My TRON dApp",
    url: window.location.origin,
    icons: [`${window.location.origin}/icon.png`]
  },
  network: "mainnet",
  walletConnectProjectId: import.meta.env.VITE_WALLETCONNECT_PROJECT_ID
});

function App() {
  return (
    <TronKitProvider config={config} theme={lightTheme({ accentColor: "#0988f0" })}>
      <TronConnectButton />
    </TronKitProvider>
  );
}

createRoot(document.getElementById("root")!).render(<App />);

walletConnectProjectId is optional. If it is omitted, WalletConnect is not shown in the default wallet list.

metadata identifies your dApp in WalletConnect and Sign-In with TRON prompts. appName still works as a shorthand for metadata.name.

GasFree

GasFree is optional and appears as a GasFree mode switch in the connected account panel. It keeps the normal wallet session while showing the deterministic GasFree address and USDT balance.

pnpm add @gasfree/gasfree-sdk
const config = getDefaultConfig({
  metadata: { name: "My TRON dApp" },
  network: "mainnet",
  gasFree: {
    enabled: true,
    apiBaseUrl: "/api/gasfree"
  }
});

apiBaseUrl should point to your backend proxy or trusted GasFree provider API. The provider API requires signed headers, so do not ship API secrets in browser code.

Custom UI can use useGasFree():

import { useGasFree } from "@tron-wallet-kit/react";

function GasFreeBadge() {
  const gasFree = useGasFree();
  if (!gasFree.configured) return null;
  return <button onClick={() => gasFree.setMode("gasfree")}>GasFree</button>;
}

Sign-In with TRON

Install the optional auth package and pass an adapter to TronKitProvider. The provider shows a sign-in step after wallet connect and exposes the state through useTronAuth().

pnpm add @tron-wallet-kit/auth@latest
import { createTronAuthenticationAdapter } from "@tron-wallet-kit/auth";

const authenticationAdapter = createTronAuthenticationAdapter({
  getNonce: () => fetch("/auth/nonce").then((r) => r.text()),
  verify: (input) =>
    fetch("/auth/verify", {
      method: "POST",
      headers: { "content-type": "application/json" },
      body: JSON.stringify(input)
    }).then((r) => r.json())
});

<TronKitProvider
  config={config}
  authenticationAdapter={authenticationAdapter}
  authenticationOptions={{
    domain: window.location.host,
    uri: window.location.origin,
    statement: "Sign in to My TRON dApp"
  }}
>
  <TronConnectButton />
</TronKitProvider>;

Exports

  • getDefaultConfig
  • TronKitProvider
  • TronConnectButton
  • TronWalletProvider
  • WalletButton
  • ConnectModal
  • AccountPanel
  • lightTheme
  • darkTheme
  • useTronAccount
  • useTronConnect
  • useTronDisconnect
  • useTronBalance
  • useSignMessage
  • useTronAuth
  • useTrxName
  • useGasFree
  • useConnectModal
  • useAccountModal
  • useTronKit

Custom UI

import { useTronAccount, useTronConnect, useTronDisconnect } from "@tron-wallet-kit/react";

export function CustomWalletControls() {
  const { address, isConnected } = useTronAccount();
  const { openConnectModal } = useTronConnect();
  const { disconnect } = useTronDisconnect();

  if (!isConnected) return <button onClick={openConnectModal}>Connect wallet</button>;
  return <button onClick={disconnect}>{address}</button>;
}

Theme Factories

import { darkTheme, lightTheme } from "@tron-wallet-kit/react";

const light = lightTheme({
  accentColor: "#0988f0",
  accentColorForeground: "#ffffff",
  borderRadius: "medium",
  fontStack: "system"
});

const dark = darkTheme({
  accentColor: "#00e5a8",
  borderRadius: "large"
});

The factories generate TRON Wallet Kit theme config on top of the --twk-* token system.

System-adaptive themes are supported at the provider:

<TronKitProvider
  config={config}
  theme={{
    light: lightTheme({ accentColor: "#0988f0" }),
    dark: darkTheme({ accentColor: "#00e5a8" })
  }}
>
  <TronConnectButton />
</TronKitProvider>

Status

This package is part of the TRON Wallet Kit 0.1.0 release line and is intended for the npm latest tag.

License

MIT