feat(express): add typed routes for TRX delegation APIs#8344
Merged
bhavidhingra merged 2 commits intomasterfrom Apr 7, 2026
Merged
feat(express): add typed routes for TRX delegation APIs#8344bhavidhingra merged 2 commits intomasterfrom
bhavidhingra merged 2 commits intomasterfrom
Conversation
1dce693 to
335e26d
Compare
e708f00 to
bf85e1c
Compare
44de9a1 to
32d3271
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces new typed Express v2 endpoints for TRX account resource lookup and resource delegation querying, and updates the sdk-core wallet method used to fetch account resources to use a POST body.
Changes:
- Updated
Wallet#getAccountResourcesin sdk-core to POST a request body (and adjusted its unit tests accordingly). - Added new io-ts typed route specs for account resources and resource delegations and registered them in the Express API spec.
- Implemented Express route handlers/wiring for the new typed endpoints.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/sdk-core/test/unit/bitgo/wallet/getAccountResources.ts | Updates unit tests to reflect POST+body behavior for getAccountResources. |
| modules/sdk-core/src/bitgo/wallet/wallet.ts | Switches getAccountResources from GET+query to POST+body. |
| modules/express/src/typedRoutes/api/v2/resourceDelegations.ts | Adds typed route definition for resource delegations endpoint. |
| modules/express/src/typedRoutes/api/v2/accountResources.ts | Adds typed route definition for account resources endpoint. |
| modules/express/src/typedRoutes/api/index.ts | Registers the new typed routes in the Express API spec/types. |
| modules/express/src/clientRoutes.ts | Adds handlers and route wiring for the new typed endpoints. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add dedicated Express routes for accountresources and activedelegations endpoints with io-ts validation. TICKET: CHALO-346
32d3271 to
ebfd681
Compare
02edda9 to
fd11a9b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…resource delegations handler Agent-Logs-Url: https://github.com/BitGo/BitGoJS/sessions/c1f514f3-1017-413f-90a9-4de5a30f1f0e Co-authored-by: bhavidhingra <17147510+bhavidhingra@users.noreply.github.com> TICKET: CHALO-346
fd11a9b to
784adf4
Compare
Contributor
parasgarg-bitgo
approved these changes
Apr 7, 2026
MohammedRyaan786
approved these changes
Apr 7, 2026
kaustubhbitgo
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /api/v2/{coin}/wallet/{id}/getaccountresources— query BANDWIDTH/ENERGY resources for wallet addressesGET /api/v2/{coin}/wallet/{id}/resourcedelegations— query active outgoing/incoming resource delegationsDetails
getaccountresourcesis a POST endpoint;addresses(and optionaldestinationAddress) are provided in the request bodyresourcedelegationssupports optional filters:type(outgoing/incoming),resource(case-insensitive: ENERGY/BANDWIDTH),limit,nextBatchPrevIdsendManyrouteTest plan
npx lerna run build --scope @bitgo/express)POST /getaccountresourcesvia Express on stagingGET /resourcedelegationsvia Express on stagingPOST /sendmanyon stagingTICKET: CHALO-346