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/delegateresource - Delegate TRX Resources

Delegate staked TRX resources (bandwidth/energy) to other TRON accounts via Dwellir's high-performance RPC endpoint.

TRON RPC endpoint: endpoint URLs, plans and pricing.

Delegate staked bandwidth or energy resources to another TRON account.

Endpoint

Text
POST /wallet/delegateresource
cURL request
# Basic energy delegation
    curl -X POST https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/delegateresource \
      -H "Content-Type: application/json" \
      -d '{
        "owner_address": "TOwnerAddress...",
        "receiver_address": "TReceiverAddress...",
        "balance": 1000000000,
        "resource": "ENERGY",
        "visible": true
      }'

    # Delegate bandwidth with 3-day lock
    curl -X POST https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/delegateresource \
      -H "Content-Type: application/json" \
      -d '{
        "owner_address": "TOwnerAddress...",
        "receiver_address": "TReceiverAddress...",
        "balance": 500000000,
        "resource": "BANDWIDTH",
        "lock": true,
        "lock_period": 86400,
        "visible": true
      }'

    # Check delegation index
    curl -X POST https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/getdelegatedresourceaccountindex \
      -H "Content-Type: application/json" \
      -d '{
        "value": "TOwnerAddress...",
        "visible": true
      }'

    # Get delegation details between accounts
    curl -X POST https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/getdelegatedresource \
      -H "Content-Type: application/json" \
      -d '{
        "fromAddress": "TOwnerAddress...",
        "toAddress": "TReceiverAddress...",
        "visible": true
      }'

Important Notes

Delegation Rules

  1. Must Stake First: Resources must be staked before delegation
  2. Immediate Effect: Delegation takes effect immediately after transaction confirmation
  3. Lock Period: Optional lock prevents reclaim until it ends. lock_period counts blocks of 3 seconds (28,800 blocks is 1 day). With lock: true and no period, java-tron locks for 3 days (86,400 blocks). The maximum is getMaxDelegateLockPeriod, 864,000 blocks (30 days)
  4. Resource Ownership: Delegated resources remain owned by delegator
  5. Reclaim Process: Use undelegateresource to reclaim delegated resources

Resource Calculations

  • Energy delegation helps with smart contract execution
  • Bandwidth delegation helps with transactions and transfers
  • Receiver pays no TRX but can use delegated resources

Implementation Examples

Delegation Flow

mermaid
graph LR
    A[Owner Stakes TRX] --> B[Resources Available]
    B --> C[Delegate to Receiver]
    C --> D[Receiver Uses Resources]
    D --> E[Resources Consumed]
    E --> F[Owner Can Reclaim]
    
    style A fill:#4CAF50
    style C fill:#2196F3
    style D fill:#FF9800

Best Practices

1. Calculate Before Delegating

JavaScript
// Always analyze needs first
const needs = await analyzeNeeds(receiverAddress);
const delegateAmount = Math.ceil(needs.energy.deficit / 9.7383); // energy per staked TRX per day, 3 Nov 2026

2. Use Locks Strategically

  • Lock for stable, long-term delegations
  • Keep unlocked for flexible, short-term needs
  • Consider 3-day default lock period

3. Monitor Resource Usage

  • Track receiver's consumption patterns
  • Adjust delegations based on actual usage
  • Implement alerts for high usage

4. Batch Operations

  • Group multiple delegations together
  • Reduces transaction overhead
  • Easier management and tracking

Common Errors

ErrorDescriptionSolution
Insufficient staked balanceNot enough staked resourcesStake more TRX first
Invalid resource typeMust be BANDWIDTH or ENERGYUse correct resource string
Receiver address invalidMalformed receiver addressVerify base58 format
Already delegatedResources already delegated to receiverCheck existing delegations

Use Cases

  • DApp Support: Provide resources for users to interact with your DApp
  • Gaming: Enable free gameplay by covering resource costs
  • DeFi Trading: Support traders with energy for smart contract calls
  • Onboarding: Help new users get started without staking
  • Resource Rental: Commercial resource delegation services

Related Methods

  • wallet/undelegateresource - Reclaim delegated resources
  • wallet/freezebalancev2 - Stake TRX for resources
  • wallet/getaccountresource - View resource limits

wallet/unfreezebalancev2

Unstake TRX to reclaim resources (bandwidth/energy) on TRON network via Dwellir's optimized RPC endpoint with Stake 2.0 support.

wallet/undelegateresource

Reclaim delegated TRX resources (bandwidth/energy) from other TRON accounts via Dwellir's high-performance RPC endpoint.

On this page

EndpointImportant NotesDelegation RulesResource CalculationsImplementation ExamplesDelegation FlowBest Practices1. Calculate Before Delegating2. Use Locks Strategically3. Monitor Resource Usage4. Batch OperationsCommon ErrorsUse CasesRelated Methods