Skip to content

feat: add support for tron ecosystem#356

Merged
chybisov merged 22 commits intomainfrom
feature/emb-178-add-support-for-tron-ecosystem
Apr 15, 2026
Merged

feat: add support for tron ecosystem#356
chybisov merged 22 commits intomainfrom
feature/emb-178-add-support-for-tron-ecosystem

Conversation

@tomiiide
Copy link
Copy Markdown
Contributor

@tomiiide tomiiide commented Mar 9, 2026

Which Jira task is linked to this PR?

https://linear.app/lifi-linear/issue/EMB-178/add-support-for-tron-ecosystem

Why was it implemented this way?

  • DUP_TRANSACTION_ERROR treated as success to avoid false failures on broadcast retries
  • Multicall batched at 50 to avoid Tron CPU timeouts on large token lists; failed batches skipped gracefully to not block the whole fetch

Visual showcase (Screenshots or Videos)

If applicable, attach screenshots, GIFs, or videos to showcase the functionality, UI changes, or bug fixes.

Checklist before requesting a review

  • I have performed a self-review and testing of my code.
  • This pull request is focused and addresses a single problem.
  • If this PR modifies the SDK API or adds new features that require documentation, I have updated the documentation in the public-docs repository.

@tomiiide tomiiide changed the title Feature/emb 178 add support for tron ecosystem feat: add support for tron ecosystem Mar 9, 2026
@tomiiide tomiiide force-pushed the feature/emb-178-add-support-for-tron-ecosystem branch 4 times, most recently from 5aaac66 to 2a625c7 Compare March 13, 2026 11:34
@tomiiide tomiiide force-pushed the feature/emb-178-add-support-for-tron-ecosystem branch 2 times, most recently from 5157cec to e8ac163 Compare March 24, 2026 10:24
@tomiiide tomiiide force-pushed the feature/emb-178-add-support-for-tron-ecosystem branch 3 times, most recently from c345616 to ae27bff Compare April 9, 2026 11:32
tomiiide added 8 commits April 9, 2026 12:44
Changes:
- Add TronProvider with wallet integration, balance fetching, and address resolution
- Add TronStepExecutor with sign, broadcast, and confirmation tasks
- Add RPC retry with multi-URL fallback
- Add Tron-specific error parsing for wallet and transaction errors
- Add unit tests for error parsing, address resolution, and zero address utils
- Register ChainType.TVM in SDK client storage
- Add TronCheckAllowanceTask and TronSetAllowanceTask for TRC-20 approval flow
- Refactor TronSignAndExecuteTask to deserialize raw tx data from the API
- Separate build, sign, and broadcast phases in approval to avoid re-signing on RPC retry
- Add bandwidth error handling in parseTronErrors
- Add stripHexPrefix utility and shared polling constants
- Pass `from` address in TRC-20 balanceOf calls
- Use callTronRpcsWithRetry for broadcast in WaitForTransactionTask
- Treat DUP_TRANSACTION_ERROR as success in both broadcast tasks
- Remove unused getTronWebInstance
- Add empty URLs guard in callTronRpcsWithRetry
- Chunk multicall aggregate3 calls to avoid Tron CPU timeouts
- Failed batches are skipped gracefully (tokens get no amount)
- Add multicallBatchSize option to TronProviderOptions (default: 50)
@tomiiide tomiiide force-pushed the feature/emb-178-add-support-for-tron-ecosystem branch from ae27bff to 8724e88 Compare April 9, 2026 11:48
@tomiiide tomiiide marked this pull request as ready for review April 13, 2026 10:01
@tomiiide tomiiide self-assigned this Apr 13, 2026
@tomiiide tomiiide added the v4 label Apr 13, 2026
Changes:
- Cache TronWeb per RPC URL with LruMap to avoid re-allocating axios instances
- Replace manual waitForTronConfirmation loop with waitForResult in WaitForTransactionTask
- Remove unnecessary executionOptions spread in TronProvider.getStepExecutor
Changes:
- Document no-amount contract on RPC failure in getTronBalance (aligns with Solana)
- Explain toEvmHex 41-prefix convention in address.ts
- Note tronweb@^6 source for string error literals in parseTronErrors
- Add base58 explanation for TronAddressZero constant
Comment thread packages/sdk-provider-tron/src/rpc/callTronRpcsWithRetry.ts Outdated
tomiiide and others added 5 commits April 13, 2026 16:47
- Extract waitForTronTxConfirmation with poll budget and error retry cap
- Guard toEvmHex against unexpected hex prefix
- Preserve original cause in bandwidth error rewrapping
- Return undefined instead of BigInt(0) for missing block numbers
- Move transactionRequest check before wallet pause point
- Move DEFAULT_MULTICALL_BATCH_SIZE to shared constants
- Export tronWebCache for test isolation
- Add unit tests for address, callTronRpcsWithRetry, getTronBalance,
  and expanded parseTronErrors coverage
- Annotate axios override with CVE context
- New getTronTxLink util returns undefined if no explorer URL is set,
  rather than producing a malformed link
- Both TronSetAllowanceTask and TronWaitForTransactionTask use it
- Remove duplicate !src/**/*.spec.ts entry in package.json
- Strip trailing slash from explorer URL before building tx link
- Use pre-increment so exactly TRON_POLL_MAX_POLLS RPC calls are made
- Guard results[i] access in getTronBalanceMulticall against length mismatch
- Explain DUP_TRANSACTION_ERROR txID fallback in allowance/execute tasks
- Add waitForTronTxConfirmation unit spec (6 cases)
@chybisov chybisov merged commit bacd925 into main Apr 15, 2026
2 checks passed
@chybisov chybisov deleted the feature/emb-178-add-support-for-tron-ecosystem branch April 15, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants