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

@0xtrails/tvm

v0.2.3

Published

Tron (TVM) plugin for the 0xtrails SDK

Readme

@0xtrails/tvm

Tron (TVM) adapter for the Trails SDK. Enables funding from a Tron wallet into any EVM chain via Relay edge payments.

Install

npm install 0xtrails @0xtrails/tvm

Required: polyfill Buffer

This package pulls in TronWeb (via @tronweb3/tronwallet-adapters), which references the Node Buffer global at module-evaluation time. Browsers don't provide it, and modern bundlers (Vite, Rollup, webpack 5+) do not auto-polyfill Node globals. Without a polyfill your app throws Uncaught ReferenceError: Buffer is not defined on load and renders blank.

Install the polyfill and import it before any module that loads @0xtrails/tvm:

npm install buffer
// polyfills.ts — must be imported first, before your app entry
import { Buffer } from "buffer"

if (typeof globalThis.Buffer === "undefined") {
  globalThis.Buffer = Buffer
}
// index.tsx (app entry)
import "./polyfills"
// ...the rest of your app

With Vite you can alternatively use vite-plugin-node-polyfills to provide Buffer globally.

Quick start

import { TrailsWidget, evmAdapter } from '0xtrails'
import { tronAdapter } from '@0xtrails/tvm'

const adapters = [
  evmAdapter({ wallets: [{ id: 'injected', name: 'MetaMask' }] }),
  // Auto-detect installed Tron wallets (TronLink, etc.).
  tronAdapter(),
]

export function App() {
  return (
    <TrailsWidget
      apiKey="YOUR_TRAILS_API_KEY"
      adapters={adapters}
      fundOptions={{ fundMethodsList: ['connected-wallet'] }}
      renderInline
    />
  )
}

tronAdapter

import { tronAdapter } from '@0xtrails/tvm'

tronAdapter(options?: TronAdapterOptions): TrailsAdapterConfig

Returns a TrailsAdapterConfig for use in the adapters prop of TrailsWidget or TrailsProvider. Auto-registers the TVM edge plugin.

Options

| Option | Type | Description | |--------|------|-------------| | wallet | TronWalletContextValue \| null | Optional pre-built Tron wallet source. Omit to auto-detect installed Tron wallets. | | preferredWalletId | string | Optional auto-detected wallet id to prefer. | | silentReconnect | boolean | Whether to silently reconnect previously trusted wallets. Defaults to true. |

Enabling Tron funding

Tron funding is available through the connected-wallet funding path when tronAdapter is configured:

<TrailsWidget
  apiKey={apiKey}
  adapters={[tronAdapter()]}
  fundOptions={{
    fundMethodsList: ['connected-wallet', 'crypto-transfer'],
  }}
  renderInline
/>

Supported origin token: USDT (TRC-20).

Wallet inputs

Usually omit wallet and let the adapter auto-detect installed Tron wallets:

tronAdapter()

To bridge a host-managed wallet, pass a TronWalletContextValue:

import { createTronWallet } from '@0xtrails/tvm'

const tronWallet = createTronWallet({
  connected,
  address,                 // base58 T-format
  signTransaction,         // (tx) => Promise<tx>
  tronWeb,                 // TronWeb instance
})

const adapters = [tronAdapter({ wallet: tronWallet })]

License

Apache-2.0