Skip to content

chore: tron snap code quality improvements#212

Open
ulissesferreira wants to merge 1 commit intomainfrom
chore/tron-snap-improvements
Open

chore: tron snap code quality improvements#212
ulissesferreira wants to merge 1 commit intomainfrom
chore/tron-snap-improvements

Conversation

@ulissesferreira
Copy link
Contributor

Summary

  • Remove entities/index.ts barrel file and use direct module imports for better clarity and tree-shaking
  • Add limit parameter to TrongridApiClient.getTransactionInfoByAddress to support lightweight queries
  • Add checkAddressActivity method to TransactionsService for efficient account discovery (queries with limit=1 instead of downloading full transaction history)
  • Use checkAddressActivity in discoverAccounts instead of fetchNewTransactionsForAccount
  • Fix cursor handling in listAccountTransactions — return empty results when cursor is not found instead of starting from index -1
  • Move account sync earlier in trackTransaction so it still runs even if the sender account lookup fails
  • Remove unused params: { accountIds } from setSelectedAccounts background event call
  • Narrow findByIds return type from TronKeyringAccount[] | null to TronKeyringAccount[] (removing impossible null)
  • Narrow synchronize* method parameters from KeyringAccount to TronKeyringAccount
  • Remove unnecessary type cast account as TronKeyringAccount in TransactionsMapper call

Test plan

  • Verify all existing tests pass
  • Verify checkAddressActivity tests cover true/false/error cases
  • Verify discoverAccounts tests use the new checkAddressActivity mock
  • Verify no functional regressions in account discovery, transaction tracking, or pagination

Made with Cursor

@ulissesferreira ulissesferreira requested a review from a team as a code owner February 20, 2026 12:03
@ulissesferreira ulissesferreira force-pushed the chore/tron-snap-improvements branch 2 times, most recently from e9fb3ee to 3949ebc Compare February 20, 2026 13:06
@ulissesferreira ulissesferreira force-pushed the chore/tron-snap-improvements branch 3 times, most recently from e0c3b18 to 5835933 Compare March 9, 2026 10:35
- Remove entities barrel file and use direct imports for clarity
- Add limit parameter to TrongridApiClient.getTransactionInfoByAddress
- Add lightweight checkAddressActivity method for account discovery
- Use checkAddressActivity in discoverAccounts instead of full tx fetch
- Fix cursor handling in listAccountTransactions for missing cursors
- Move account sync earlier in trackTransaction for reliability
- Remove unused params from setSelectedAccounts background event
- Narrow findByIds return type from nullable to empty array
- Narrow synchronize* method params to TronKeyringAccount
- Remove unnecessary type cast in TransactionsMapper call

Co-authored-by: Cursor <cursoragent@cursor.com>
@ulissesferreira ulissesferreira force-pushed the chore/tron-snap-improvements branch from 5835933 to 73e1b2b Compare March 9, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant