Merged
Conversation
Tinna23
approved these changes
Feb 26, 2026
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.
feat(core): add clawback and clawback_claimable_balance operation explainers
Closes #87Summary
Implements first-class explainers for both
clawbackandclawback_claimable_balanceoperations. These are regulated-asset operations that users often encounter without context. Both explainers include a fixed contextual note explaining what clawback means so users understand why funds were recovered.All 303 tests pass (142 lib + 146 bin + 15 doc-tests).
Changes
src/explain/operation/clawback.rs(new file)Core deliverable for Issue #28:
ClawbackExplanationstruct withsummary,issuer,from,asset_code,asset_issuer,amountClawbackClaimableBalanceExplanationstruct withsummary,issuer,balance_idexplain_clawback()— produces: "The asset issuer reclaimed 100 USDC from GHOLDER. Clawback is a feature of regulated assets that allows issuers to recover funds under specific conditions."explain_clawback_claimable_balance()— produces: "The asset issuer clawed back claimable balance 00000000...ef12. Clawback is a feature..."XXXXXXXX...XXXXin summaries for readability; full ID preserved in thebalance_idfield"Unknown issuer"fallback whensource_accountis absentsrc/models/operation.rsClawbackOperationstruct:id,source_account,from,asset_code,asset_issuer,amountClawbackClaimableBalanceOperationstruct:id,source_account,balance_idClawback(ClawbackOperation)andClawbackClaimableBalance(ClawbackClaimableBalanceOperation)variants toOperationenumid()match arms for both new variants"clawback"and"clawback_claimable_balance"arms toFrom<HorizonOperation>src/services/horizon.rsbalance_id: Option<String>toHorizonOperationso theclawback_claimable_balancemapping can read the balance ID off the Horizon responsesrc/explain/operation/mod.rspub mod clawback;Test Results
Clawback tests (15 new tests all passing)
Acceptance Criteria