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

@t402/wdk-tron-gasfree

v2.9.0

Published

Gas-free USDT payments on TRON with Tether WDK

Downloads

70

Readme

@t402/wdk-tron-gasfree

Gas-free TRC-20 USDT payments on TRON using the WDK's relay.

Installation

pnpm add @t402/wdk-tron-gasfree

Usage

import { createWdkTronGasfreeClient } from '@t402/wdk-tron-gasfree';

const client = await createWdkTronGasfreeClient({
  wdkInstance: myTronGasfreeWallet, // from @tetherto/wdk-wallet-tron-gasfree
});

// Check balance
const balance = await client.getBalance();
console.log('USDT:', client.getFormattedBalance(balance));

// Execute gas-free payment (no TRX needed for bandwidth/energy)
const result = await client.pay({
  to: 'TAddress...',
  amount: 1000000n, // 1 USDT (6 decimals)
});

console.log('Transaction ID:', result.txId);
console.log('Gas-free:', result.sponsored); // true

API

createWdkTronGasfreeClient(config)

Creates a WdkTronGasfreeClient from a WdkTronGasfreeConfig.

WdkTronGasfreeClient

| Method | Returns | Description | |--------|---------|-------------| | pay(params) | Promise<GasfreePaymentResult> | Execute a gas-free TRC-20 transfer | | getBalance(token?) | Promise<bigint> | Get USDT or USDT0 balance | | getFormattedBalance(balance, decimals?) | string | Human-readable balance (e.g. "1.5") | | getAddress() | Promise<string> | Wallet address | | canSponsor(params) | Promise<boolean> | Check if gas-free transfer is available |

Adapter Layer

The package auto-detects the upstream @tetherto/wdk-wallet-tron-gasfree interface and adapts alternative method signatures:

  • adaptTronGasfreeWallet(instance) -- Wrap any compatible WDK instance
  • isUpstreamTronGasfreeWallet(instance) -- Type guard for upstream interface
  • tryLoadUpstreamModule() -- Dynamically load the upstream module

Supported Tokens

| Token | Network | Address | |-------|---------|---------| | USDT | Mainnet | TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t | | USDT0 | Mainnet | TKiUqMmnCBPqRfREwNExNYKG2KQqj5Gd2m | | USDT | Shasta | TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs |

Constants

  • TRON_USDT_ADDRESS / TRON_USDT0_ADDRESS -- Mainnet token addresses
  • TRON_USDT_TESTNET_ADDRESS -- Shasta testnet USDT
  • TRON_USDT_DECIMALS -- 6
  • TOKEN_ADDRESSES -- Lookup by network and token type
  • getTokenAddress(token, network?) -- Resolve token type to address

Related Packages

License

Apache-2.0

Trademark Notice

T402 is an independent open-source project. It is not affiliated with, endorsed by, sponsored by, or in any way officially connected with Tether Operations Limited, Tether Holdings, or any of their affiliates.

"Tether", "USDT", "USDT0", "USDC", and other token names and trademarks referenced are the property of their respective owners and are used nominatively to describe token interoperability or to reference public open-source products (Apache 2.0). Compatibility with Tether's open-source WDK is at the user's option and does not represent a formal partnership.