Note: This package is currently in beta. Please test thoroughly in development environments before using in production.
A TRON wallet module for TRC20 transfers through a GasFree service provider. It derives TRON accounts from BIP-39 seed phrases, resolves their GasFree addresses, quotes provider fees, and submits signed transfer authorizations without requiring users to hold TRX for network resources.
About WDK
This module is part of the WDK (Wallet Development Kit) project, which empowers developers to build secure, non-custodial wallets with unified blockchain access, stateless architecture, and complete user control.
For detailed documentation about the complete WDK ecosystem, visit docs.wdk.tether.io.
Installation
npm install @tetherto/wdk-wallet-tron-gasfree
Quick Start
Run this example in a trusted Node.js process. Set WDK_SEED_PHRASE, obtain GASFREE_API_KEY and GASFREE_API_SECRET from the GasFree Developers Center, and set GASFREE_SERVICE_PROVIDER to an address returned by an authenticated request to /tron/api/v1/config/provider/all. See the GasFree documentation for request signing and mainnet contract addresses.
API credentials: Never embed the API secret in browser, mobile, or distributed desktop code.
GasFree TRC20 Transfers: Quote fees and submit provider-backed token transfers without requiring TRX for network resources
BIP-44 Account Derivation: Derive multiple TRON accounts from one BIP-39 seed phrase
GasFree Address Resolution: Resolve the provider-managed GasFree address associated with an owner account
TRX and TRC20 Balances: Query native and token balances for owned or read-only accounts
Per-Transfer Fee Caps: Reject a transfer when its quoted provider fee exceeds transferMaxFee
Message Signing: Sign messages and verify signatures with TRON accounts
Receipt Lookup: Resolve a GasFree trace identifier to its on-chain transaction receipt
Memory Disposal: Clear owned account key material with dispose()
Compatibility
TRON Mainnet (chainId: 728126428)
TRON Nile Testnet (chainId: 3448148188)
TRON RPC Providers supplied as an endpoint URL or TronWeb instance
GasFree Providers implementing the GasFree account, configuration, submission, and status endpoints
Node.js and Bare runtime entry points
Operational Notes
This module supports GasFree TRC20 transfers. Native quoteSendTransaction(), signTransaction(), and sendTransaction() calls are unsupported; use @tetherto/wdk-wallet-tron when you need native TRX transactions.
Retrieve serviceProvider from the selected provider and use the verifying-contract address for the target network. Do not substitute one address for the other.
Pass transferMaxFee in the second argument to account.transfer() when a transfer needs a fee cap. The current runtime does not use the constructor-level field as a default.
Supply gasFreeApiKey and gasFreeApiSecret together when authenticated requests are required. Never embed the API secret in browser, mobile, or distributed desktop code.
Verify token addresses, recipients, amounts, provider fees, and any first-transfer activation fee before submitting an authorization.