feat: add Tron chain definitions for currency package#1688
feat: add Tron chain definitions for currency package#1688rodrigopavezi merged 1 commit intomasterfrom
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds Tron network configuration files to the SDK's currency module. Introduces the Nile testnet configuration with chainId and testnet flag, alongside Tron mainnet configuration with testnet flag and TRC20 token currency mappings (USDT-TRC20 and USDC). Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile OverviewGreptile SummaryAdded comprehensive support for Tron blockchain to the currency package, enabling the system to handle Tron mainnet and Nile testnet chains.
The implementation follows the existing architectural patterns and is consistent with how other blockchain networks are integrated into the system. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant App as Application
participant TronChains as TronChains
participant ChainsAbstract as ChainsAbstract
participant TronDef as Tron/Nile Definitions
participant Types as Currency Types
App->>Types: Import TronChainName type
App->>TronChains: Import TronChains instance
TronChains->>TronDef: Load chain definitions (tron, nile)
TronChains->>ChainsAbstract: Initialize with chains & CURRENCY.ETH
ChainsAbstract->>ChainsAbstract: Register chain names
ChainsAbstract->>ChainsAbstract: Attempt to add native currencies
Note over ChainsAbstract: No native TRX currencies defined,<br/>so none are added
App->>TronChains: isChainSupported('tron')
TronChains-->>App: true
App->>TronChains: getChainId('tron')
TronChains->>TronDef: Access tron.chainId
TronDef-->>TronChains: 'tron'
TronChains-->>App: 'tron'
App->>TronChains: Access currencies for tron
TronChains->>TronDef: Access tron.currencies
TronDef-->>App: {USDT, USDC definitions}
|
6567549 to
5897325
Compare
62d10a1 to
2496888
Compare
2496888 to
80b8f33
Compare
MantisClone
left a comment
There was a problem hiding this comment.
Looks good to me so far.
Reviewed with Claude Code Opus 4.5
MantisClone
left a comment
There was a problem hiding this comment.
LGTM — clean chain definitions. The temporary placement in declarative chains is properly resolved by #1687 which moves Tron to its own TronChains class.
ba62981 to
a2cb3db
Compare
988cd5c to
2374a54
Compare
2374a54 to
fc2b3fd
Compare
16a0c76 to
709f9ba
Compare
fc2b3fd to
21c3cc0
Compare
709f9ba to
934ffe1
Compare
1ead8ab to
fb04b23
Compare
934ffe1 to
2f3f7ae
Compare
Merge activity
|
- Add Tron mainnet and Nile testnet chain configurations - Add TronChains types and exports - Update currency-types with Tron chain support
2f3f7ae to
82fc70d
Compare

Description of the changes
Added support for Tron blockchain and its Nile testnet:
Closes RequestNetwork/private-issues#223
Closes RequestNetwork/private-issues#224
Summary by CodeRabbit