Docs
Docs
Home
Getting Started
Agent Tooling
CLI
Supported Chains
Acala
Aptos
Arbitrum
Arc
Asset Hub
Astar
Avalanche
Base
Berachain
Bifrost
Binance Smart Chain
Bittensor
Blast
Boba Network
Bridge Hub
Celo
Centrifuge
Chiliz
Cronos
Enjin
Ethereum
Etherlink
Flow EVM Gateway
Gnosis
Hydration
Hyperliquid
Immutable
Ink
IoTeX
Kusama
Linea
LISK
Manta Atlantic
Manta Pacific
Mantle
MegaETH
Monad
Movement
Neuroweb
opBNB
Optimism
Plasma
Polkadot
Polygon
Pulsechain
Robinhood
Ronin
Scroll
Sonic
Starknet
Taiko
Tempo
Sui
TRON
Unichain
Viction
World Chain
XDC Network
XX Network
Zetachain
zkSync Era
Zora
Supported ChainsTRONTRON HTTP API

wallet/getaccount - Get TRON Account Information

Get comprehensive TRON account information including TRX balance, resources, TRC20 tokens, and account permissions via Dwellir's optimized RPC endpoint.

TRON RPC endpoint: endpoint URLs, plans and pricing.

Ultra-Fast Account Queries

Dwellir's TRON endpoints deliver account information in under 50ms with 99.99% uptime. Get comprehensive account data including balance, resources, and token holdings instantly.

Start building with free API access

Get comprehensive information about a TRON account including TRX balance, bandwidth, energy, TRC20 tokens, and account permissions.

When to Use This Method

wallet/getaccount is essential for:

  • Balance Checks - Display TRX balance in wallets and apps
  • Resource Monitoring - Track bandwidth and energy consumption
  • Token Holdings - View all TRC20/TRC721 tokens owned
  • Account Validation - Verify account exists and activation status
  • Permission Analysis - Check multi-signature and account permissions
JSON-RPC request
{
  "address": "TNPdqto8HiuMzoG7Vv9wyyYhWzCojLeHAF",
  "visible": true
}

Implementation Examples

Response Examples

Successful Response (Active Account)

JSON
{
  "address": "TNPdqto8HiuMzoG7Vv9wyyYhWzCojLeHAF",
  "balance": 1500000000,
  "create_time": 1547736132000,
  "latest_opration_time": 1734567890000,
  "free_net_usage": 0,
  "free_net_limit": 600,
  "net_limit": 10000,
  "net_usage": 1234,
  "energy_limit": 50000,
  "energy_usage": 5000,
  "assetV2": [
    {
      "key": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "value": 100000000
    }
  ],
  "owner_permission": {
    "type": 0,
    "id": 0,
    "permission_name": "owner",
    "threshold": 1,
    "keys": [
      {
        "address": "TNPdqto8HiuMzoG7Vv9wyyYhWzCojLeHAF",
        "weight": 1
      }
    ]
  },
  "active_permission": [
    {
      "type": 2,
      "id": 2,
      "permission_name": "active0",
      "threshold": 1,
      "operations": "7fff1fc0037e0000000000000000000000000000000000000000000000000000",
      "keys": [
        {
          "address": "TNPdqto8HiuMzoG7Vv9wyyYhWzCojLeHAF",
          "weight": 1
        }
      ]
    }
  ]
}

Empty Response (Non-existent Account)

JSON
{}

Common Use Cases

1. Wallet Balance Display

JavaScript
async function getWalletBalance(address) {
  const account = await getAccountInfo(address);
  
  if (!account.exists) {
    return {
      status: 'inactive',
      balance: 0,
      message: 'Account not activated. Send TRX to activate.'
    };
  }
  
  return {
    status: 'active',
    balance: account.balance.trx,
    freeTransactions: account.resources.freeNetLimit - account.resources.freeNetUsed,
    lastActive: new Date(account.timestamps.lastActive).toLocaleString()
  };
}

2. Account Validation

JavaScript
async function validateTronAddress(address) {
  // Basic format validation
  if (!address.startsWith('T') || address.length !== 34) {
    return { valid: false, reason: 'Invalid address format' };
  }
  
  try {
    const account = await getAccount(address);
    return {
      valid: true,
      exists: !!account.address,
      activated: !!account.balance || account.balance === 0
    };
  } catch (error) {
    return { valid: false, reason: 'Address lookup failed' };
  }
}

3. Resource Monitoring Dashboard

JavaScript
async function getResourceStatus(address) {
  const account = await getAccountInfo(address);
  
  if (!account.exists) {
    return { error: 'Account not found' };
  }
  
  const bandwidthUsage = (account.resources.freeNetUsed / account.resources.freeNetLimit) * 100;
  const energyUsage = account.resources.energy > 0 
    ? (account.resources.energyUsed / account.resources.energy) * 100 
    : 0;
  
  return {
    bandwidth: {
      used: account.resources.freeNetUsed,
      limit: account.resources.freeNetLimit,
      usage_percent: bandwidthUsage.toFixed(2),
      status: bandwidthUsage > 80 ? 'high' : bandwidthUsage > 50 ? 'medium' : 'low'
    },
    energy: {
      used: account.resources.energyUsed || 0,
      limit: account.resources.energy,
      usage_percent: energyUsage.toFixed(2),
      status: energyUsage > 80 ? 'high' : energyUsage > 50 ? 'medium' : 'low'
    },
    recommendations: generateResourceRecommendations(bandwidthUsage, energyUsage)
  };
}

function generateResourceRecommendations(bandwidthUsage, energyUsage) {
  const recommendations = [];
  
  if (bandwidthUsage > 80) {
    recommendations.push('Consider freezing TRX for bandwidth');
  }
  
  if (energyUsage > 80) {
    recommendations.push('Freeze TRX for energy or rent energy');
  }
  
  if (bandwidthUsage < 20 && energyUsage < 20) {
    recommendations.push('Resources are well managed');
  }
  
  return recommendations;
}

4. Multi-Signature Account Analysis

JavaScript
async function analyzeAccountPermissions(address) {
  const account = await getAccount(address);
  
  if (!account.address) {
    return { error: 'Account not found' };
  }
  
  const isMultiSig = account.owner_permission?.threshold > 1 || 
                     account.active_permission?.some(p => p.threshold > 1);
  
  return {
    address: account.address,
    isMultiSignature: isMultiSig,
    ownerPermission: {
      threshold: account.owner_permission?.threshold || 1,
      keyCount: account.owner_permission?.keys?.length || 1
    },
    activePermissions: account.active_permission?.map(p => ({
      id: p.id,
      name: p.permission_name,
      threshold: p.threshold,
      keyCount: p.keys?.length || 0
    })) || []
  };
}

Performance Tips

  1. Batch Requests - Query multiple accounts concurrently but respect rate limits
  2. Cache Results - Cache account data for 30-60 seconds to reduce API calls
  3. Selective Queries - Only fetch account data when needed, not on every page load
  4. Error Boundaries - Implement proper error handling for non-existent accounts
JavaScript
// Simple caching example
class AccountCache {
  constructor(ttl = 60000) { // 1 minute TTL
    this.cache = new Map();
    this.ttl = ttl;
  }
  
  async get(address) {
    const cached = this.cache.get(address);
    if (cached && Date.now() - cached.timestamp < this.ttl) {
      return cached.data;
    }
    
    const account = await getAccountInfo(address);
    this.cache.set(address, {
      data: account,
      timestamp: Date.now()
    });
    
    return account;
  }
}

Need help? Contact our support team or check the TRON documentation.

TRON

TRON API and RPC reference for Dwellir: wallet and walletsolidity HTTP endpoints, JSON-RPC, TRC-20 calls, and the energy cost of USDT transfers.

wallet/getaccountbalance

Retrieve the native TRX balance of a TRON account at a specific block height. This endpoint returns TRX balance only — it does not return TRC-10 or TRC-20 token balances.

On this page

When to Use This MethodImplementation ExamplesResponse ExamplesSuccessful Response (Active Account)Empty Response (Non-existent Account)Common Use Cases1. Wallet Balance Display2. Account Validation3. Resource Monitoring Dashboard4. Multi-Signature Account AnalysisPerformance Tips