feat: Add delegate filter param's to account_tx RPC#2827
Open
PeterChen13579 wants to merge 6 commits intoXRPLF:developfrom
Open
feat: Add delegate filter param's to account_tx RPC#2827PeterChen13579 wants to merge 6 commits intoXRPLF:developfrom
PeterChen13579 wants to merge 6 commits intoXRPLF:developfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #2827 +/- ##
===========================================
+ Coverage 81.84% 81.92% +0.07%
===========================================
Files 381 383 +2
Lines 14423 14504 +81
Branches 7933 7978 +45
===========================================
+ Hits 11805 11882 +77
- Misses 1447 1448 +1
- Partials 1171 1174 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
godexsoft
reviewed
Dec 2, 2025
| if (delegateFilter.has_value()) { | ||
| resultTxns.reserve(txns.size()); | ||
|
|
||
| for (auto& txn : txns) { |
Collaborator
There was a problem hiding this comment.
Looks like a good place to try and use ranges? 🙂
godexsoft
reviewed
Dec 2, 2025
|
|
||
| auto const& type = delegateType.as_string(); | ||
|
|
||
| if (type == "delegator") |
Collaborator
There was a problem hiding this comment.
Magic strings everywhere 😃 these should either be JS(...) if possible or some sort of constants 🔢
godexsoft
reviewed
Dec 2, 2025
src/rpc/common/Types.hpp
Outdated
| * @brief A delegate type used in delegate filter | ||
| */ | ||
| enum class Role { | ||
| // This account is the *active* sender, acting on behalf of another party. |
Collaborator
There was a problem hiding this comment.
This could be part of doxygen, perhaps with a trailing comment style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the ability to filter account_tx results based on transaction delegation. This is useful for scenarios where one account (the delegatee) signs and submits a transaction on behalf of another account (the delegator).
New Request Parameter:
Example: If User A submits a transaction to C on behalf of B:
User B (The account holder) can query with delegate_filter: "delegatee" to find transactions signed by others (like User A).
User A (The signer) can query with delegate_filter: "delegator" to find transactions they signed for others (like User B).
The counter_party field can be used in either case to filter by a specific valid address