wallet/delegateresource - Delegate TRX Resources
Delegate staked TRX resources (bandwidth/energy) to other TRON accounts via Dwellir's high-performance RPC endpoint.
Delegate staked bandwidth or energy resources to another TRON account.
Endpoint
POST /wallet/delegateresourceImportant Notes
Delegation Rules
- Must Stake First: Resources must be staked before delegation
- Immediate Effect: Delegation takes effect immediately after transaction confirmation
- Lock Period: Optional 3-day lock prevents immediate reclaim
- Resource Ownership: Delegated resources remain owned by delegator
- Reclaim Process: Use
undelegateresourceto 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
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:#FF9800Best Practices
1. Calculate Before Delegating
// Always analyze needs first
const needs = await analyzeNeeds(receiverAddress);
const delegateAmount = Math.ceil(needs.energy.deficit / 28.5);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
| Error | Description | Solution |
|---|---|---|
Insufficient staked balance | Not enough staked resources | Stake more TRX first |
Invalid resource type | Must be BANDWIDTH or ENERGY | Use correct resource string |
Receiver address invalid | Malformed receiver address | Verify base58 format |
Already delegated | Resources already delegated to receiver | Check 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