Skip to content

Transaction memo types, export integrity checks, rebalancer precision, and monthly budget breakdown - #994

Merged
k-deejah merged 5 commits into
Sorokit:mainfrom
iamthebestofcourse:fix/sorokit-ui-assigned-batch
Oct 24, 2026
Merged

k-deejah merged 5 commits into
Sorokit:mainfrom
iamthebestofcourse:fix/sorokit-ui-assigned-batch

Conversation

@iamthebestofcourse

Copy link
Copy Markdown
Contributor

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

validateStellarAddress already accepted both G- and SEP-23 M-addresses, and friendlyError already mapped op_underfunded to 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 both TransactionPanel and client.ts's TransactionParams.memoType. Added both memo types with 64-character hex validation, and fixed a bug where isMemoIdValid was computed but never actually included in canSubmit, allowing an invalid Memo ID through.

Added integration tests in payment-flow.test.tsx for muxed destinations, both new memo types, and underfunded-payment recovery.

#969: Circular dependency check and export completeness test

GovernanceDashboard, SwapSimulator, and PortfolioRebalancer were already exported from components/index.ts; added them to verify-exports.ts's explicit import list for consistency. Built findCircularDependencies() using the TypeScript compiler API (no new dependency) to walk the components/context import graph and detect cycles via DFS. Added a test asserting dist/components/index.d.ts declares every public component with no unresolved-type markers, and a test calling findCircularDependencies() directly.

#970: Decimal precision in rebalancer allocations

computeCurrentAllocations used parseFloat on raw balance strings, silently losing low-order digits once multiplied by price for realistic high-decimal balances. Added an optional decimals field to PortfolioAsset and 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 when decimals is 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, and budget.ts had 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. computeBudgetBreakdown is untouched.

Verification

  • npm run lint clean
  • npm run typecheck clean
  • npm run build succeeds
  • npm run test:exports clean
  • npm test: 1937 passed (100 files)
  • npm run size: ES module and CommonJS bundles both within the configured gzip budget

closes #968
closes #969
closes #970
closes #971

…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.
@drips-wave

drips-wave Bot commented Oct 16, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@k-deejah
k-deejah merged commit 8db8083 into Sorokit:main Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants