Repository navigation
[pull] main from MetaMask:main - #235
Merged
Merged
Conversation
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> Major release of SeedlessOnboardingController v6 ~ - Added new public method, `checkIsSeedlessOnboardingUserAuthenticated` to validate the controller authenticate tokens state. ([#6998](#6998)) - **BREAKING** Update `refreshToken` and `revokeToken` params as required in `Authenticate` method. ([#6998](#6998)) - Refactor `refreshAuthTokens` method, separately catch refreshJWTToken and authenticate errors. ([#6998](#6998)) - Bump `@metamask/toprf-secure-backup` package to `0.10.0`. ([#6998](#6998)) - Fixed `Invalid Access Token` error during rehydration. ([#6998](#6998)) ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> * Fix: MetaMask/metamask-extension#37337 ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Publishes monorepo 652.0.0 and releases `@metamask/seedless-onboarding-controller` v6.0.0 with a new auth check method, breaking auth parameter changes, token refresh refactor, dependency bump, and an access token fix. > > - **`@metamask/seedless-onboarding-controller` v6.0.0**: > - Added `checkIsSeedlessOnboardingUserAuthenticated`. > - BREAKING: `authenticate` now requires `refreshToken` and `revokeToken` params. > - Refactored `refreshAuthTokens` to separately handle refresh/auth errors. > - Bumped `@metamask/toprf-secure-backup` to `0.10.0`. > - Fixed `Invalid Access Token` during rehydration. > - **Monorepo**: > - Bumped root `version` to `652.0.0`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9851013. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…nsion (#6938) ## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> Adds optional callback to disable fetching balances in AccountTrackerController. Attempts to refresh balance when a network is added and when the keyring is unlocked. ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> * Related to https://consensyssoftware.atlassian.net/browse/ASSETS-1368 ## Checklist - [X] I've updated the test suite for new or updated code as appropriate - [X] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [X] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [X] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds optional fetchingEnabled gate, refreshes on networkAdded/unlock, and updates tx handlers to refresh both from/to addresses via new refreshAddresses; updates tests and changelog with breaking notes. > > - **AccountTrackerController**: > - Add optional `fetchingEnabled` constructor callback; `refresh` short-circuits when disabled. > - Subscribe to `NetworkController:networkAdded` and `KeyringController:unlock` to trigger balance refreshes. > - Update tx event handlers to refresh both `from` and `to` via new `refreshAddresses`; remove single-address refresh path. > - Adjust allowed actions/events and inline `PreferencesController:getState` typing; remove legacy `AccountsController:selectedAccountChange` reference. > - **Tests**: > - Add cases for `networkAdded`, `unlock`, and disabled fetching; address checksum fixes. > - **Changelog**: > - Document breaking event/action changes and the new `fetchingEnabled` option. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 878ed7e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds OP Stack operator fee to `layer1GasFee` by querying the oracle (`getOperatorFee`) and summing with `getL1Fee`, plus BN utilities and tests. > > - **Layer 1 Gas Fee (oracle flow)**: > - Sum oracle `getL1Fee` with operator fee from `getOperatorFee(gasUsed)`; default operator fee to zero on failure/undefined; output normalized hex via `add0x` + `padHexToEvenLength`. > - Refactor to BN-based math and value coercion via new `toBN`; extract `#getGasPriceOracleContract`; keep default OP Stack oracle address and optional signing. > - Extend ABI with `getOperatorFee`. > - **Utils**: > - Add `bnFromHex` and `toBN` helpers for parsing/converting to `BN`. > - **Tests**: > - Update `OracleLayer1GasFeeFlow.test.ts` to mock BN returns and cover operator fee present/failure/undefined paths. > - Add tests for `bnFromHex` and `toBN`. > - **Docs**: > - Update `CHANGELOG.md` to note inclusion of operator fee in `layer1GasFee`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6e8d304. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## Explanation
**What is the current state of things and why does it need to change?**
Currently, the assets-controllers package provides functionality to
fetch token lists and metadata for individual networks, but lacks the
ability to search for tokens across multiple blockchain networks
simultaneously. Users and applications need to search for tokens by
name, symbol, or address across different chains (Ethereum, Polygon,
Solana, etc.) in a unified way, which requires multiple separate API
calls with the existing implementation.
**What is the solution your changes offer and how does it work?**
This PR introduces a new `searchTokens` function that enables
cross-chain token search functionality using CAIP (Chain Agnostic
Improvement Proposal) format chain IDs. The solution includes:
1. **New `searchTokens` function**: Accepts an array of CAIP chain IDs
(e.g., `['eip155:1', 'eip155:137',
'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp']`) and a search query string
2. **URL construction helper**: `getTokenSearchURL` function that
properly encodes chain IDs and query parameters
3. **Structured response**: Returns `{ count: number, data: unknown[] }`
format for consistent API responses
4. **Error handling**: Gracefully handles API failures by returning
empty results instead of throwing errors
5. **Configurable limits**: Supports customizable result limits
(default: 10)
The function makes a single API call to the `/tokens/search` endpoint,
making it more efficient than multiple individual network searches.
**Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?**
- **CAIP format requirement**: The function specifically requires CAIP
format chain IDs rather than hex chain IDs to support multi-chain
protocols including non-EVM chains like Solana
- **Error handling strategy**: The function returns `{ count: 0, data:
[] }` on errors rather than throwing, which prevents search failures
from breaking the user experience
- **Response normalization**: The function handles both new API response
format (object with count/data) and legacy format (direct array) for
backwards compatibility
## References
* Implements search token service functionality for cross-chain token
discovery
* Related to MetaMask's multi-chain token support initiative
## Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Introduces `searchTokens` to query tokens across multiple networks
using CAIP chain IDs, exports it, and adds comprehensive tests and
changelog entry.
>
> - **Token service (`src/token-service.ts`)**:
> - Add `searchTokens(chainIds: CaipChainId[], query, { limit })` using
`/tokens/search` and `handleFetch`; returns `{ count, data }` with
graceful error handling.
> - Add helper `getTokenSearchURL` and CAIP chain ID support; import
`CaipChainId`.
> - **Exports**:
> - Export `searchTokens` from `src/index.ts`.
> - **Tests (`src/token-service.test.ts`)**:
> - Add coverage for single/multi-chain searches, custom `limit`, query
encoding, empty/invalid responses, and network/HTTP errors.
> - **Changelog**:
> - Document addition of `searchTokens` for multi-network searches via
CAIP IDs.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
bf6224c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## Explanation Bridge API used to have a `noFee` parameter that was changed to `fee` parameter. For some time api will support both, however to eventually sunset a less flexible `noFee` parameter controller had to be changed. ## References Associated bridge-api [PR](consensys-vertical-apps/va-mmcx-bridge-api#610). ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Replaces `noFee` with numeric `fee` across request types, validators, request formatting, and tests, and documents the breaking change. > > - **Breaking change** > - Replace `noFee` flag with numeric `fee` in bridge API requests and feature flag overrides. > - **Core updates** > - Types: Update `QuoteRequest` to use optional `fee?: number` (`src/types.ts`). > - Validation: Update `GenericQuoteRequestSchema` to accept `fee` (`src/utils/validators.ts`). > - Request formatting: Map `fee` into normalized query params; remove `noFee` handling (`src/utils/fetch.ts`). > - **Tests** > - Update expectations and snapshots to use `fee` (e.g., URL query `fee=0`) and feature flag overrides (`src/bridge-controller.test.ts`, `src/utils/fetch.test.ts`). > - **Docs** > - Add changelog entry noting the breaking replacement (`CHANGELOG.md`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9afac58. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Bryan Fullam <bryan.fullam@consensys.net>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )