This repository was archived by the owner on Jul 31, 2026. It is now read-only.
feat: support TRC20 token balances for inactive accounts - #190
Merged
ulissesferreira merged 6 commits intoFeb 13, 2026
Conversation
ulissesferreira
marked this pull request as draft
February 3, 2026 14:24
ulissesferreira
force-pushed
the
NEB-461-feat-inactive-account-trc20-balances
branch
2 times, most recently
from
February 4, 2026 12:51
beea8e5 to
82f12a3
Compare
ulissesferreira
marked this pull request as ready for review
February 4, 2026 12:58
mikesposito
reviewed
Feb 4, 2026
ulissesferreira
force-pushed
the
NEB-461-feat-inactive-account-trc20-balances
branch
4 times, most recently
from
February 4, 2026 23:31
38156a6 to
cd1e61d
Compare
ulissesferreira
commented
Feb 4, 2026
| }); | ||
|
|
||
| describe('extreme values (original bug scenarios)', () => { | ||
| describe('values out of `Number` 64-bit size', () => { |
Contributor
Author
There was a problem hiding this comment.
The nit: @mikesposito, didn't forget about it
ulissesferreira
commented
Feb 4, 2026
Contributor
Author
There was a problem hiding this comment.
Particularly happy with the structure here. I am going for a method that orchestrates the whole thing, doing the data fetching at first, data parsing, enriching and finally returning. The fallbacks are handled right at the start and everything else is shared. Took some iterations to get here, feel free to suggest even more improvements
ulissesferreira
commented
Feb 4, 2026
| * Get TRC20 token balances for an account address. | ||
| * This endpoint works for inactive accounts that haven't been activated yet. | ||
| * | ||
| * @see https://developers.tron.network/reference/get-trc20-token-holder-balances |
Contributor
Author
There was a problem hiding this comment.
This was the key endpoint missing for us to be able to offer this feature
ulissesferreira
commented
Feb 4, 2026
ulissesferreira
commented
Feb 5, 2026
ulissesferreira
force-pushed
the
NEB-461-feat-inactive-account-trc20-balances
branch
3 times, most recently
from
February 9, 2026 17:42
a3724b5 to
5f60ff6
Compare
mikesposito
reviewed
Feb 9, 2026
ulissesferreira
force-pushed
the
NEB-461-feat-inactive-account-trc20-balances
branch
from
February 11, 2026 15:10
5f60ff6 to
688d3f9
Compare
4 tasks
ulissesferreira
force-pushed
the
NEB-461-feat-inactive-account-trc20-balances
branch
2 times, most recently
from
February 12, 2026 12:22
0a02e10 to
5361765
Compare
Add fallback TRC20 balance fetching for inactive Tron accounts using the
`/v1/accounts/{address}/trc20/balance` endpoint when the main account
info endpoint returns no data (inactive accounts that haven't paid the
1 TRX activation fee).
- Add `getTrc20BalancesByAddress()` method to TrongridApiClient
- Implement fallback logic in AssetsService for inactive accounts
- Add helper methods for zero-balance native assets and TRC20 extraction
- Add comprehensive unit tests for new functionality
Use InMemoryCache in TrongridApiClient tests and drop redundant section comments in AssetsService.
ulissesferreira
force-pushed
the
NEB-461-feat-inactive-account-trc20-balances
branch
from
February 12, 2026 15:08
5361765 to
f21970f
Compare
ulissesferreira
force-pushed
the
NEB-461-feat-inactive-account-trc20-balances
branch
from
February 12, 2026 15:09
f21970f to
98c7dd6
Compare
ulissesferreira
deleted the
NEB-461-feat-inactive-account-trc20-balances
branch
February 13, 2026 09:44
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
fetchAssetsAndBalancesForAccountto improve code organization and readabilityChanges
New TRC20 fallback for inactive accounts:
getTrc20BalancesByAddressclient method that works for inactive accounts (unlikegetAccountInfoByAddresswhich throws)getAccountInfoByAddressandgetAccountResourcesto document their behavior with inactive accountsAsset extraction refactor:
NormalizedAccountDatatype to provide a consistent data shape for both active and inactive accounts#buildAccountDatato normalize API responses, centralizing active/inactive branching logic#extractAssetscoordinator that calls all individual extractors uniformly#enrichAssetsWithMetadatato encapsulate metadata enrichment logic#getPriceableAssetTypeshelper for filtering assets that can be priced#createZeroBalanceNativeAsset(no longer needed after normalization)