Repository navigation
Transaction memo types, export integrity checks, rebalancer precision, and monthly budget breakdown - #994
Merged
k-deejah merged 5 commits intoOct 24, 2026
Conversation
…ation test coverage (Sorokit#968) Adds the two missing memo types to the memo-type selector and submission payload, and fixes a bug where an invalid Memo ID could still pass canSubmit. Covers muxed (M...) destinations, both new memo types, and op_underfunded recovery with integration tests; those paths already worked but had no coverage.
…ts completeness test (Sorokit#969) GovernanceDashboard, SwapSimulator, and PortfolioRebalancer were already exported; this adds them to verify-exports.ts's explicit import list for consistency. Adds findCircularDependencies() using the TypeScript compiler API to walk the components/context import graph via DFS, and a test asserting dist/components/index.d.ts declares every public component with no unresolved-type markers.
…lances (Sorokit#970) computeCurrentAllocations used parseFloat on the raw balance string, silently dropping low-order digits for balances near or beyond Number.MAX_SAFE_INTEGER once scaled by price. Adds an optional decimals field to PortfolioAsset and a BigInt-based exact parser with a dynamic scale that keeps as much precision as fits in a safe double, used whenever decimals is supplied; the untyped float path is unchanged for callers that don't have it.
…C month bucketing (Sorokit#971) Builds the monthly spending breakdown described in the issue: UTC-based month bucketing (monthKeyUtc) to avoid local-timezone-dependent month boundaries, memo normalization that strips emoji/punctuation before keyword matching, and per-category totals with an optional limit and a single currency-conversion rate applied uniformly across categories. Existing computeBudgetBreakdown is untouched.
|
@iamthebestofcourse 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
Batches four assigned issues: MEMO_HASH/MEMO_RETURN support in the transaction panel, an AST-based circular dependency check plus a .d.ts completeness test in verify-exports, a decimal-precision fix for the portfolio rebalancer, and a new monthly spending breakdown in the budget module.
#968: Transaction panel memo types and integration coverage
validateStellarAddressalready accepted both G- and SEP-23 M-addresses, andfriendlyErroralready mappedop_underfundedto a readable message, but neither path had test coverage. The memo type selector only supported none/text/id; MEMO_HASH and MEMO_RETURN were missing from bothTransactionPanelandclient.ts'sTransactionParams.memoType. Added both memo types with 64-character hex validation, and fixed a bug whereisMemoIdValidwas computed but never actually included incanSubmit, allowing an invalid Memo ID through.Added integration tests in
payment-flow.test.tsxfor muxed destinations, both new memo types, and underfunded-payment recovery.#969: Circular dependency check and export completeness test
GovernanceDashboard,SwapSimulator, andPortfolioRebalancerwere already exported fromcomponents/index.ts; added them toverify-exports.ts's explicit import list for consistency. BuiltfindCircularDependencies()using the TypeScript compiler API (no new dependency) to walk the components/context import graph and detect cycles via DFS. Added a test assertingdist/components/index.d.tsdeclares every public component with no unresolved-type markers, and a test callingfindCircularDependencies()directly.#970: Decimal precision in rebalancer allocations
computeCurrentAllocationsusedparseFloaton raw balance strings, silently losing low-order digits once multiplied by price for realistic high-decimal balances. Added an optionaldecimalsfield toPortfolioAssetand a BigInt-based exact parser with a dynamic scale: it measures the exact product's digit count and divides down only as far as needed to fit a safe double, maximizing retained precision. Used only whendecimalsis supplied; the existing float path is unchanged for callers without it.#971: Monthly spending breakdown
calculateMonthlySpending, the function named in the issue, did not exist anywhere in the codebase under any name, andbudget.tshad no per-category limits, date bucketing, or memo-based categorization. Built it from scratch: UTC-based month bucketing (monthKeyUtc) so a transaction's month doesn't depend on the viewer's timezone, memo normalization (normalizeMemoForMatching) that strips emoji/punctuation before keyword matching, and per-category totals with an optional limit and a single currency-conversion rate applied uniformly.computeBudgetBreakdownis untouched.Verification
npm run lintcleannpm run typecheckcleannpm run buildsucceedsnpm run test:exportscleannpm test: 1937 passed (100 files)npm run size: ES module and CommonJS bundles both within the configured gzip budgetcloses #968
closes #969
closes #970
closes #971