Repository navigation
feat(money): add support for GET /v1/vaults/:address/rate - #10504
Merged
Merged
Conversation
ffmcgee725
marked this pull request as ready for review
September 28, 2026 11:24
ffmcgee725
temporarily deployed
to
default-branch
September 28, 2026 11:25 — with
GitHub Actions
Inactive
Matt561
previously approved these changes
Sep 28, 2026
| indexer_lag_seconds: number(), | ||
| }); | ||
|
|
||
| export const VaultRateResponseStruct = object({ |
Contributor
There was a problem hiding this comment.
Should we use type (if available) here just in case new properties are added to the response later?
Suggested change
| export const VaultRateResponseStruct = object({ | |
| export const VaultRateResponseStruct = type({ |
Member
Author
There was a problem hiding this comment.
we do that in here, which is meant to be merged right afterwards and released at the same time #10538
👍🏾
ffmcgee725
force-pushed
the
jc/MUSD-1376
branch
from
September 28, 2026 18:40
47d9792 to
c422c50
Compare
Matt561
approved these changes
Sep 28, 2026
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
fetchVaultRateto@metamask/money-account-api-data-serviceso clients can read a vault's current Accountant exchange rate fromGET /v1/vaults/:address/rate.chain_id, validates the response, and caches it for 5 minutes (the server TTL). It is exposed asMoneyAccountApiDataService:fetchVaultRate.VaultRateResponse,VaultRateOptions, andMoneyAccountApiDataServiceFetchVaultRateAction.Changelog
@metamask/money-account-api-data-service
[Unreleased]
Added
fetchVaultRate, which reads a vault's current Accountant exchange rate fromGET /v1/vaults/:address/rateand is exposed as theMoneyAccountApiDataService:fetchVaultRateaction. ExportVaultRateResponse,VaultRateOptions, andMoneyAccountApiDataServiceFetchVaultRateAction(feat(money): add support for GET /v1/vaults/:address/rate #10504)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 messenger-action-types:checkyarn workspace @metamask/money-account-api-data-service run changelog:validateyarn oxlint packages/money-account-api-data-serviceNote
Low Risk
Additive client API with no breaking changes; behavior mirrors existing fetch methods and is covered by tests.
Overview
Adds
fetchVaultRateto@metamask/money-account-api-data-serviceso clients can read a vault’s current Accountant exchange rate fromGET /v1/vaults/:address/rate, alongside existing rate-history support.The method follows the same patterns as other Money Account API calls: lowercases the vault address, optional
chain_id, profile JWT when available, superstruct validation, TanStack Query caching with a 5-minute stale time (VAULT_RATE_STALE_TIME_MS), tracing, and messenger exposure asMoneyAccountApiDataService:fetchVaultRate. New public types includeVaultRateResponse,VaultRateOptions, andMoneyAccountApiDataServiceFetchVaultRateAction.Tests cover auth headers, cache/dedup keyed by chain, 404
HttpError, malformed responses, and messenger invocation.Reviewed by Cursor Bugbot for commit c422c50. Bugbot is set up for automated code reviews on this repo. Configure here.