Add transaction result decoder, predicate builder, rate cache, and account flags inspector - #576
Merged
Kingsman-99 merged 4 commits intoJul 30, 2026
Conversation
…currencyConverter
|
@whisper011 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
Adds four small, independent SDK features requested in issues #516–#519:
src/txResultDecoder.ts) — parses the base64-encodedTransactionResultXDR returned by Horizon into a typedDecodedTransactionResult, including per-operation results and fee-bump inner/outer results. Wired intosrc/receipt.tsasPaymentReceipt.decodedResult.src/predicateBuilder.ts) — fluentPredicateBuilderfor composing unconditional, absolute-window, relative-window, and AND/OR claim predicates without touching the rawClaimant/xdr.ClaimPredicateAPI. Wired intosrc/claimableBalanceFallback.ts.src/rateCache.ts) —RateCacheserves rates from memory until TTL expiry, with a background refresh at 80% of TTL to avoid cold-fetch latency, plusinvalidate/invalidateAll. Wired intosrc/currencyConverter.ts.src/accountFlagsInspector.ts) —inspectFlags()decodes a Stellar account'sAUTH_*flags into a typedAccountFlagSetwith anisCompatibleWith(operation)check and ahasAnyRestrictiveFlag()convenience helper. Wired intosrc/preflightChecker.tsascheckRecipientFlags()so callers can preflight-check a recipient's flags before sending a payment or opening a trustline.Each feature is scoped to its own commit.
Closes
Closes #516
Closes #517
Closes #518
Closes #519
Test plan
npm run buildnpm testTransactionResultXDR fixturecreateClaimableBalanceRateCacheserves cached rate within TTL and refetches after expiryinspectFlags()against anAUTH_REQUIREDissuer account returnsisCompatibleWith("payment") === falseNote: this repo currently has pre-existing TypeScript/build errors unrelated to this change (e.g. in
client.ts,preflightChecker.ts's existing sponsor-reserve check, several__tests__files) — these were present before this branch and are out of scope here.