Getting Started
Connect to TRON using OneKey's TronLink-compatible provider
Learn how to detect, connect, and interact with TRON using OneKey's provider.
OneKey's TRON provider is fully compatible with TronLink, including TronWeb and SunWeb instances.
Provider Detection
// OneKey injects both the provider and TronWeb instances
const provider = window.$onekey?.tron
// TronWeb is available globally after connection
const tronWeb = window.tronWeb
if (!provider) {
throw new Error('OneKey TRON provider not detected')
}
// Check if it's TronLink compatible
console.log('isTronLink:', provider.isTronLink) // trueRequest Accounts
Check Connection Status
Using TronWeb
After connection, TronWeb instance is available globally:
Get Balance
Send TRX
Send TRC20 Token
Event Handling
Listen for Account Changes
Listen for Network Changes
Window Events (TronLink Compatible)
Migration from TronLink
OneKey is TronLink-compatible. Update your detection logic:
Last updated
Was this helpful?