-
Notifications
You must be signed in to change notification settings - Fork 92
feat: add Tron payment detection support #1689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/tron-currency
Are you sure you want to change the base?
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
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 |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No files reviewed, no comments
6567549 to
5897325
Compare
853297e to
5bb6ef7
Compare
5897325 to
6204d01
Compare
5bb6ef7 to
3c7d77f
Compare
6204d01 to
8949393
Compare
816af51 to
fc1128c
Compare
1e93add to
9005e3a
Compare
fc1128c to
cf070e9
Compare
9005e3a to
168c9a6
Compare
62f2685 to
3bf2428
Compare
d515038 to
6e1a893
Compare
3bf2428 to
f06892c
Compare
6e1a893 to
d327625
Compare
f06892c to
8456f0a
Compare
d327625 to
add40f9
Compare
720a911 to
9c63452
Compare
add40f9 to
20bbe1e
Compare
4770f6a to
f39a087
Compare
20bbe1e to
37b7afc
Compare
6631746 to
e0785a2
Compare
62d10a1 to
2496888
Compare
e0785a2 to
2319127
Compare
- 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
2319127 to
cecfc7e
Compare
2496888 to
80b8f33
Compare

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