Uh oh!
There was an error while loading. Please reload this page.
feat: add Tron payment detection support - #1689
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
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 SummaryThis PR adds comprehensive support for TRON blockchain payment detection to the Request Network. The implementation follows the established architectural patterns used for EVM and NEAR chains. Key Changes:
Implementation Quality: Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant Factory as PaymentNetworkFactory
participant Detector as TronERC20FeeProxyPaymentDetector
participant Retriever as TronInfoRetriever
participant GraphQL as TheGraphClient<TronChain>
participant Subgraph as TRON Subgraph
Client->>Factory: getPaymentNetworkFromRequest(request)
Factory->>Factory: Identify TRON chain (tron/nile)
Factory->>Detector: new TronERC20FeeProxyPaymentDetector({network, getSubgraphClient})
Factory-->>Client: Return detector instance
Client->>Detector: extractEvents(eventName, toAddress, paymentReference, currency, chain)
Detector->>Detector: Validate TRON chain support
Detector->>Detector: Validate network matches detector network
Detector->>Detector: getDeploymentInformation(chain)
Note over Detector: Gets proxy contract address & creation block
Detector->>Detector: getSubgraphClient(chain)
Note over Detector: Returns TheGraphClient for tron/nile
Detector->>Retriever: new TronInfoRetriever(subgraphClient)
Detector->>Retriever: getTransferEvents({paymentReference, toAddress, contractAddress, acceptedTokens})
Retriever->>Retriever: Hash payment reference with keccak256
alt Single token filter
Retriever->>GraphQL: GetTronPayments(reference, to, tokenAddress, contractAddress)
else No token filter
Retriever->>GraphQL: GetTronPaymentsAnyToken(reference, to, contractAddress)
end
GraphQL->>Subgraph: Query payment events
Subgraph-->>GraphQL: Return payments array
GraphQL-->>Retriever: Return payments
Retriever->>Retriever: Map payments to event format
Note over Retriever: Convert amount, feeAmount to strings<br/>Add txHash, block, timestamp
Retriever-->>Detector: Return {paymentEvents}
Detector-->>Client: Return payment events
|
6567549 to
5897325Compare853297e to
5bb6ef7Compare5897325 to
6204d01Compare5bb6ef7 to
3c7d77fCompare6204d01 to
8949393Compare816af51 to
fc1128cCompare1e93add to
9005e3aComparefc1128c to
cf070e9Compare9005e3a to
168c9a6Compare62f2685 to
3bf2428Compared515038 to
6e1a893Compare3bf2428 to
f06892cCompare6e1a893 to
d327625Comparef06892c to
8456f0aCompared327625 to
add40f9Compare720a911 to
9c63452Compare
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 — good test coverage for the detector and info retriever. Follows existing patterns well.
80b8f33 to
a347f28Comparececfc7e to
6c8cb20Comparea347f28 to
ba62981Compare938afca to
c8c4b67Compareba62981 to
a2cb3dbComparec8c4b67 to
1408a38Comparea2cb3db to
16a0c76Compare1408a38 to
559e872Compare16a0c76 to
709f9baCompare559e872 to
96f878eCompare934ffe1 to
2f3f7aeCompare96f878e to
35cc88dCompareMerge activity
|
- Add TronFeeProxyDetector for detecting Tron payments - Add TronInfoRetriever for fetching payment data from TheGraph - Add GraphQL queries for Tron payments - Integrate Tron detector into payment network factory - Add unit tests for detector and retriever
- Add schema.graphql to payment-detection package for TRON types - Update codegen-tron.yml to use local schema instead of substreams - Remove conditional codegen script (schema is now always available) - Fix TronERC20FeeProxyPaymentDetector static method signature - Add explicit type annotation in tron-info-retriever
- Add contractVersion to getDeploymentInformation return type - Update getTheGraphInfoRetriever to accept TronChainName clients
35cc88d to
5fd4cfeCompareUh oh!
There was an error while loading. Please reload this page.

Description of the changes
Added support for TRON blockchain payment detection in the Request Network. This implementation includes:
TronERC20FeeProxyPaymentDetector)TronInfoRetriever) to fetch payment events from TRON subgraphsThe implementation follows the same pattern as other blockchain integrations while accounting for TRON-specific requirements.
Closes RequestNetwork/private-issues#227