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

@tronweb3/tronwallet-adapters

v1.2.24

Published

Wallet adapters to help developers interact with Tron wallets using consistent API.

Readme

@tronweb3/tronwallet-adapters

@tronweb3/tronwallet-adapters provides a comprehensive suite of wallet adapters, enabling developers to connect to both Tron and EVM wallets (such as TronLink and MetaMask) through a unified and consistent API.


📦 Installation

This package is a "barrel package" that includes all individual adapters. You can install the entire suite or choose specific adapters to keep your bundle size small.

# Install the complete suite
npm install @tronweb3/tronwallet-abstract-adapter @tronweb3/tronwallet-adapters

# Or install individual adapters as needed
npm install @tronweb3/tronwallet-abstract-adapter @tronweb3/tronwallet-adapter-tronlink
npm install @tronweb3/tronwallet-abstract-adapter @tronweb3/tronwallet-adapter-walletconnect

🔌 Supported Wallets

Each adapter offers a consistent interface. You can use this collective package or import individual ones.

| Wallet | NPM Package | Description | Source | | :--- | :--- | :--- | :--- | | All-in-One | @tronweb3/tronwallet-adapters | Includes all adapters below | View | | TronLink | @tronweb3/tronwallet-adapter-tronlink | Adapter for TronLink | View | | WalletConnect| @tronweb3/tronwallet-adapter-walletconnect | Adapter for WalletConnect | View | | MetaMask | @tronweb3/tronwallet-adapter-metamask-tron | Tron support via MetaMask | View | | Ledger | @tronweb3/tronwallet-adapter-ledger | Hardware wallet support | View | | OKX Wallet | @tronweb3/tronwallet-adapter-okxwallet | Adapter for OKX Wallet | View | | TokenPocket | @tronweb3/tronwallet-adapter-tokenpocket | Adapter for TokenPocket | View | | BitGet | @tronweb3/tronwallet-adapter-bitkeep | Adapter for BitGet (BitKeep) | View | | Binance EVM | @tronweb3/tronwallet-adapter-binance-evm | Adapter for Binance Wallet (EVM) | View | | MetaMask EVM | @tronweb3/tronwallet-adapter-metamask-evm | Native EVM support | View | | TronLink EVM | @tronweb3/tronwallet-adapter-tronlink-evm | Adapter for TronLink (EVM) | View | | Trust Wallet EVM | @tronweb3/tronwallet-adapter-trust-evm | Adapter for Trust Wallet (EVM) | View |

ℹ️ For the full list of 15+ supported wallets, visit our documentation.


🚀 Usage

Note: If you are using TypeScript, ensure skipLibCheck: true is set in your tsconfig.json.

React

For React applications, while you can use the adapters directly, we highly recommend using our official React Hooks Package for the best developer experience.

Manual Usage (Low-level):

import { useMemo, useEffect, useState } from 'react';
import { TronLinkAdapter } from '@tronweb3/tronwallet-adapters';

function WalletInterface() {
    const adapter = useMemo(() => new TronLinkAdapter(), []);
    const [address, setAddress] = useState(adapter.address);

    useEffect(() => {
        const onConnect = (addr: string) => setAddress(addr);
        adapter.on('connect', onConnect);
        
        return () => {
            adapter.off('connect', onConnect);
            adapter.removeAllListeners();
        };
    }, [adapter]);

    return (
        <button onClick={() => adapter.connect()}>
            {address ? `Connected: ${address}` : 'Connect TronLink'}
        </button>
    );
}

Vue

In Vue 3, the Composition API is the recommended way to initialize and manage the adapter.

<script setup>
import { onMounted, onBeforeUnmount, ref } from 'vue';
import { TronLinkAdapter } from '@tronweb3/tronwallet-adapters';

const address = ref('');
const adapter = new TronLinkAdapter();

onMounted(() => {
    adapter.on('connect', (addr) => {
        address.value = addr;
    });
});

onBeforeUnmount(() => {
    adapter.removeAllListeners();
});

const connect = () => adapter.connect();
</script>

<template>
    <button @click="connect">
        {{ address || 'Connect Wallet' }}
    </button>
</template>

🌐 Vanilla JS / CDN

For environments without build tools, use our UMD bundle.

  1. Include the script:
<!-- peer dependency needed for LedgerAdapter -->
<script type="module">
    import bufferPolyfill from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm'
    window.Buffer = bufferPolyfill
</script>
<!-- peer dependency needed for WalletConnect -->
<script src="https://cdn.jsdelivr.net/npm/@walletconnect/sign-client/dist/index.umd.js"></script>
<!-- adapters bundle -->
<script src="https://cdn.jsdelivr.net/npm/@tronweb3/tronwallet-adapters/lib/umd/index.js"></script>
  1. Initialize:
const { TronLinkAdapter } = window['@tronweb3/tronwallet-adapters'];
const adapter = new TronLinkAdapter();

adapter.connect().then(() => {
    console.log('Connected to:', adapter.address);
});

🛠️ Configuration

WalletConnect Support

WalletConnectAdapter requires a peer dependency. If you plan to use it, please install:

npm install @walletconnect/sign-client

📘 Documentation

  • API Reference: Detailed class and method documentation is available at walletadapter.org.
  • Guide: Step-by-step integration guides for React, Vue.
  • EVM Integration: Learn how to use MetaMask and other EVM wallets on Tron here.