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/undelegateresource - Reclaim Delegated R...

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

TRON RPC endpoint: endpoint URLs, plans and pricing.

Reclaim previously delegated bandwidth or energy resources from another account.

Endpoint

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

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

    # Check delegation index (to find all delegations)
    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 specific delegation details
    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
      }'

    # Check receiver's resource usage (to analyze efficiency)
    curl -X POST https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/getaccountresource \
      -H "Content-Type: application/json" \
      -d '{
        "address": "TReceiverAddress...",
        "visible": true
      }'

Important Notes

Undelegation Rules

  1. Lock Period Check: Cannot undelegate if resources are locked
  2. Immediate Effect: Resources return to owner immediately after confirmation
  3. Partial Undelegation: Can undelegate portions of delegated amount
  4. Resource Availability: Reclaimed resources are immediately available to owner
  5. No Waiting Period: Unlike unstaking, undelegation has no waiting period

Key Differences from Unstaking

  • Undelegation: Returns delegated resources to owner (immediate)
  • Unstaking: Converts staked TRX back to liquid (14-day wait)

Implementation Examples

Undelegation Process Flow

mermaid
graph LR
    A[Delegated Resources] --> B{Check Lock Status}
    B -->|Locked| C[Wait for Unlock]
    B -->|Unlocked| D[Initiate Undelegation]
    C --> D
    D --> E[Sign Transaction]
    E --> F[Broadcast]
    F --> G[Resources Returned to Owner]
    
    style A fill:#2196F3
    style B fill:#FF9800
    style G fill:#4CAF50

Best Practices

1. Check Lock Status First

JavaScript
// Always check before attempting undelegation
const status = await checkUndelegationStatus(owner, receiver, resource);
if (!status.canUndelegate) {
  console.log(`Cannot undelegate: ${status.reason}`);
  return;
}

2. Monitor Utilization

  • Regularly check delegation efficiency
  • Reclaim underutilized resources
  • Redistribute based on actual needs

3. Batch Operations

  • Group multiple undelegations together
  • Reduces transaction costs
  • Easier to manage

4. Grace Period Management

  • Track lock expiration dates
  • Set reminders for locked delegations
  • Plan undelegations in advance

Common Errors

ErrorDescriptionSolution
No delegation foundNo resources delegated to receiverCheck delegation status first
Delegation is lockedResources are locked for periodWait for lock period to expire
Insufficient delegated balanceTrying to undelegate more than delegatedCheck current delegation amount
Invalid resource typeMust be BANDWIDTH or ENERGYUse correct resource string

Use Cases

  • Resource Reallocation: Move resources to more active users
  • Cost Optimization: Reclaim resources from inactive accounts
  • Emergency Recovery: Quickly reclaim resources when needed
  • Delegation Cleanup: Remove old or unnecessary delegations
  • Efficiency Management: Optimize resource distribution based on usage

Related Methods

  • wallet/delegateresource - Delegate resources to others
  • wallet/freezebalancev2 - Stake TRX for resources
  • wallet/unfreezebalancev2 - Unstake TRX resources

wallet/delegateresource

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

wallet/listwitnesses

Get list of all TRON Super Representatives (witnesses) including votes, URLs, and block production stats via Dwellir's RPC endpoint.

On this page

EndpointImportant NotesUndelegation RulesKey Differences from UnstakingImplementation ExamplesUndelegation Process FlowBest Practices1. Check Lock Status First2. Monitor Utilization3. Batch Operations4. Grace Period ManagementCommon ErrorsUse CasesRelated Methods