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
POST /wallet/undelegateresource# 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
- Lock Period Check: Cannot undelegate if resources are locked
- Immediate Effect: Resources return to owner immediately after confirmation
- Partial Undelegation: Can undelegate portions of delegated amount
- Resource Availability: Reclaimed resources are immediately available to owner
- 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
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:#4CAF50Best Practices
1. Check Lock Status First
// 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
| Error | Description | Solution |
|---|---|---|
No delegation found | No resources delegated to receiver | Check delegation status first |
Delegation is locked | Resources are locked for period | Wait for lock period to expire |
Insufficient delegated balance | Trying to undelegate more than delegated | Check current delegation amount |
Invalid resource type | Must be BANDWIDTH or ENERGY | Use 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