Add Energy & Bandwidth Manager skill#6
Add Energy & Bandwidth Manager skill#6M2M-TRC8004-Registry wants to merge 4 commits intoBofAI:mainfrom
Conversation
|
Great concept! Automatically managing Energy and Bandwidth can effectively reduce long-term TRX burn costs, and we’ve been looking for a best practice like this. This PR is on our high-priority watch list. Once the underlying asynchronous call mechanics are finalized, we will look into merging it. To improve it further, could you add a "Safe Guard" configuration? For instance, defining a minimum required TRX balance (e.g., the account must always retain at least 50 TRX for basic fees and cannot stake its entire balance). This ensures the agent doesn't accidentally brick the account due to a flawed strategy. |
|
Updated to address review feedback:
|
|
Thanks for the update. I re-checked the latest head after your comment. I still see two unresolved issues:
Please fix those and I can re-review. |
1. estimate.js: pass callValue into triggerConstantContract options so payable-call estimates are accurate. Also fix parameter type parsing to extract types from the function selector instead of using invalid "auto" type. 2. status.js: use getTronWebReadOnly() when an address argument is provided so read-only resource queries don't require TRON_PRIVATE_KEY. 3. utils.js: add getTronWebReadOnly() function.
|
Also fixed a related bug in |
- SKILL.md: cd energy-bandwidth -> cd energy-bandwidth-skill - README.md: cd energy-bandwidth -> cd energy-bandwidth-skill
|
Thanks for the latest updates. I re-checked the current head and the code changes appear to address the issues I previously flagged. The remaining concern is runtime verification. Since this skill affects resource estimation and staking-related flows, could you provide a reproducible E2E test transcript covering:
Please include exact commands, network used, and which steps were executed live. |
|
Wallet used: 1.
|
|
I was able to validate installation, read-only flows, and A real This suggests the real write path or result-handling logic still needs work before this PR can be considered fully validated. |
boboliu-1010
left a comment
There was a problem hiding this comment.
Static review found one blocking issue:
delegate.jsapplies the minimum TRX reserve check before resource delegation, but delegation consumes already-staked ENERGY/BANDWIDTH rather than spending liquid TRX. As written, accounts with low available TRX but sufficient staked resources will be incorrectly blocked from delegating. Please remove or rework this safeguard so it validates the actual delegation preconditions instead of liquid balance.
Summary
energy-bandwidth-skillfor monitoring and managing TRON Energy and Bandwidth resourcesScripts
status.js— View current resource balances and usageestimate.js— Estimate energy/bandwidth costsstake.js— Stake TRX for energy or bandwidthunstake.js— Unstake TRXdelegate.js— Delegate resources to other accountsSource: https://github.com/M2M-TRC8004-Registry/energy-bandwidth-skill