Docs

wallet/undelegateresource - Reclaim Delegated R...

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

Reclaim previously delegated bandwidth or energy resources from another account.

Endpoint

Text
POST /wallet/undelegateresource

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