Repository navigation
feat(money): loosen money account api response validation - #10538
Merged
Merged
Conversation
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
ffmcgee725
force-pushed
the
jc/refactor-money-account-data-service-structs
branch
from
September 28, 2026 15:32
59f86d7 to
96bff01
Compare
ffmcgee725
added this pull request to stack #10540
September 28, 2026 15:35
ffmcgee725
marked this pull request as ready for review
September 28, 2026 15:39
4 tasks done
Matt561
previously approved these changes
Sep 28, 2026
ffmcgee725
force-pushed
the
jc/refactor-money-account-data-service-structs
branch
from
September 28, 2026 19:03
73e06c1 to
8b2cfeb
Compare
Matt561
approved these changes
Sep 28, 2026
ffmcgee725
deleted the
jc/refactor-money-account-data-service-structs
branch
September 28, 2026 19:09
Member
Author
|
@metamaskbot publish-preview |
Merged
pull Bot
pushed a commit
to Reality2byte/core
that referenced
this pull request
Sep 29, 2026
## @metamask/money-account-api-data-service ## [2.1.0] ### Added - Add `fetchVaultRate`, which reads a vault's current Accountant exchange rate from `GET /v1/vaults/:address/rate` and is exposed as the `MoneyAccountApiDataService:fetchVaultRate` action. Export `VaultRateResponse`, `VaultRateOptions`, and `MoneyAccountApiDataServiceFetchVaultRateAction` ([MetaMask#10504](MetaMask#10504)) ### Changed - Response validation now tolerates unknown fields returned by the Money Account API instead of throwing `MoneyAccountApiResponseValidationError`, so additive backend changes no longer break clients ([MetaMask#10538](MetaMask#10538)) - Bump `@tanstack/query-core` from `^5.89.0` to `^5.103.2` ([MetaMask#10511](MetaMask#10511)) ## @metamask/money-account-balance-service ## [3.1.1] ### Changed - Bump `@metamask/money-account-api-data-service` from `^2.0.0` to `^2.1.0` ([MetaMask#10544](MetaMask#10544)) --------- Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Explanation
@metamask/money-account-api-data-serviceby switching all ten superstruct schemas fromobject()totype().MoneyAccountApiResponseValidationError; unknown keys are passed through at runtime and are not part of the exported response types.Changelog
@metamask/money-account-api-data-service
[Unreleased]
Changed
MoneyAccountApiResponseValidationError, so additive backend changes no longer break clients (#0)Test plan
yarn workspace @metamask/money-account-api-data-service run test --coverage(100% statements, branches, functions, lines)yarn workspace @metamask/money-account-api-data-service run changelog:validateyarn oxlint packages/money-account-api-data-service(Node 24+)Note
Low Risk
Forward-compatible validation loosening only; malformed or missing required fields still fail validation as before.
Overview
@metamask/money-account-api-data-service now treats additive Money Account API JSON as valid instead of failing client fetches.
All response superstruct schemas in
structs.tsswitch fromobject()totype(), so extra keys no longer triggerMoneyAccountApiResponseValidationError. Unknown properties are returned on the parsed result (not stripped); exported TypeScript response types are unchanged. Required fields, types, and enum values are still enforced.New integration tests cover positions, interest, history, rate-history, and vault-rate responses with nested unknown fields. The package changelog documents the behavior under [Unreleased] → Changed.
Reviewed by Cursor Bugbot for commit 8b2cfeb. Bugbot is set up for automated code reviews on this repo. Configure here.