diff --git a/package.json b/package.json index 326b68f058b..b2f6cdae934 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/core-monorepo", - "version": "236.0.0", + "version": "237.0.0", "private": true, "description": "Monorepo for packages shared between MetaMask clients", "repository": { diff --git a/packages/assets-controllers/src/TokenDetectionController.test.ts b/packages/assets-controllers/src/TokenDetectionController.test.ts index 7dc2fd66162..7413ad9ff2f 100644 --- a/packages/assets-controllers/src/TokenDetectionController.test.ts +++ b/packages/assets-controllers/src/TokenDetectionController.test.ts @@ -2931,6 +2931,7 @@ async function withController( trackMetaMetricsEvent: jest.fn(), messenger: buildTokenDetectionControllerMessenger(controllerMessenger), useAccountsAPI: false, + platform: 'extension', ...options, }); try { diff --git a/packages/assets-controllers/src/TokenDetectionController.ts b/packages/assets-controllers/src/TokenDetectionController.ts index e5846abb4a8..52a84bfc019 100644 --- a/packages/assets-controllers/src/TokenDetectionController.ts +++ b/packages/assets-controllers/src/TokenDetectionController.ts @@ -201,6 +201,8 @@ export class TokenDetectionController extends StaticIntervalPollingController void; messenger: TokenDetectionControllerMessenger; useAccountsAPI?: boolean; + platform: 'extension' | 'mobile'; }) { super({ name: controllerName, @@ -315,6 +324,7 @@ export class TokenDetectionController extends StaticIntervalPollingController { it('should successfully return balances response', async () => { const mockAPI = createMockAPI().reply(200, MOCK_GET_BALANCES_RESPONSE); - const result = await fetchMultiChainBalances(MOCK_ADDRESS); + const result = await fetchMultiChainBalances(MOCK_ADDRESS, {}, 'extension'); expect(result).toBeDefined(); expect(result).toStrictEqual(MOCK_GET_BALANCES_RESPONSE); expect(mockAPI.isDone()).toBe(true); @@ -59,9 +59,13 @@ describe('fetchMultiChainBalances()', () => { }) .reply(200, MOCK_GET_BALANCES_RESPONSE); - const result = await fetchMultiChainBalances(MOCK_ADDRESS, { - networks: [1, 10], - }); + const result = await fetchMultiChainBalances( + MOCK_ADDRESS, + { + networks: [1, 10], + }, + 'extension', + ); expect(result).toBeDefined(); expect(result).toStrictEqual(MOCK_GET_BALANCES_RESPONSE); expect(mockAPI.isDone()).toBe(true); @@ -79,7 +83,8 @@ describe('fetchMultiChainBalances()', () => { const mockAPI = createMockAPI().reply(httpCode); await expect( - async () => await fetchMultiChainBalances(MOCK_ADDRESS), + async () => + await fetchMultiChainBalances(MOCK_ADDRESS, {}, 'extension'), ).rejects.toThrow(expect.any(Error)); expect(mockAPI.isDone()).toBe(true); }, diff --git a/packages/assets-controllers/src/multi-chain-accounts-service/multi-chain-accounts.ts b/packages/assets-controllers/src/multi-chain-accounts-service/multi-chain-accounts.ts index f40afd2809f..8723a7e9ead 100644 --- a/packages/assets-controllers/src/multi-chain-accounts-service/multi-chain-accounts.ts +++ b/packages/assets-controllers/src/multi-chain-accounts-service/multi-chain-accounts.ts @@ -38,15 +38,21 @@ export async function fetchSupportedNetworks(): Promise { * @param address - address to fetch balances from * @param options - params to pass down for a more refined search * @param options.networks - the networks (in decimal) that you want to filter by + * @param platform - indicates whether the platform is extension or mobile * @returns a Balances Response */ export async function fetchMultiChainBalances( address: string, - options?: { networks?: number[] }, + options: { networks?: number[] }, + platform: 'extension' | 'mobile', ) { const url = getBalancesUrl(address, { networks: options?.networks?.join(), }); - const response: GetBalancesResponse = await handleFetch(url); + const response: GetBalancesResponse = await handleFetch(url, { + headers: { + 'x-metamask-clientproduct': `metamask-${platform}`, + }, + }); return response; } diff --git a/packages/transaction-controller/CHANGELOG.md b/packages/transaction-controller/CHANGELOG.md index ac9999f5238..8723f4ac3db 100644 --- a/packages/transaction-controller/CHANGELOG.md +++ b/packages/transaction-controller/CHANGELOG.md @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [38.2.0] + +### Added + +- Add staking transaction types ([#4874](https://github.com/MetaMask/core/pull/4874)) + - `stakingClaim` + - `stakingDeposit` + - `stakingUnstake` + +### Changed + +- Bump `@metamask/controller-utils` from `^11.4.1` to `^11.4.2` ([#4870](https://github.com/MetaMask/core/pull/4870)) +- Bump `@metamask/accounts-controller` from `^18.2.2` to `^18.2.3` ([#4870](https://github.com/MetaMask/core/pull/4870)) +- Bump `@metamask/network-controller` from `^22.0.0` to `^22.0.1` ([#4870](https://github.com/MetaMask/core/pull/4870)) + ## [38.1.0] ### Added @@ -1088,7 +1103,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@38.1.0...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@38.2.0...HEAD +[38.2.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@38.1.0...@metamask/transaction-controller@38.2.0 [38.1.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@38.0.0...@metamask/transaction-controller@38.1.0 [38.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@37.3.0...@metamask/transaction-controller@38.0.0 [37.3.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@37.2.0...@metamask/transaction-controller@37.3.0 diff --git a/packages/transaction-controller/package.json b/packages/transaction-controller/package.json index 0c09c02d6fa..c583c4f79c2 100644 --- a/packages/transaction-controller/package.json +++ b/packages/transaction-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/transaction-controller", - "version": "38.1.0", + "version": "38.2.0", "description": "Stores transactions alongside their periodically updated statuses and manages interactions such as approval and cancellation", "keywords": [ "MetaMask", diff --git a/packages/user-operation-controller/package.json b/packages/user-operation-controller/package.json index f648735945c..edb30db36ab 100644 --- a/packages/user-operation-controller/package.json +++ b/packages/user-operation-controller/package.json @@ -66,7 +66,7 @@ "@metamask/gas-fee-controller": "^22.0.0", "@metamask/keyring-controller": "^17.3.1", "@metamask/network-controller": "^22.0.1", - "@metamask/transaction-controller": "^38.1.0", + "@metamask/transaction-controller": "^38.2.0", "@types/jest": "^27.4.1", "deepmerge": "^4.2.2", "jest": "^27.5.1", diff --git a/yarn.lock b/yarn.lock index 9f7c47be2f4..90e4e4bf230 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3677,7 +3677,7 @@ __metadata: languageName: node linkType: hard -"@metamask/transaction-controller@npm:^38.1.0, @metamask/transaction-controller@workspace:packages/transaction-controller": +"@metamask/transaction-controller@npm:^38.2.0, @metamask/transaction-controller@workspace:packages/transaction-controller": version: 0.0.0-use.local resolution: "@metamask/transaction-controller@workspace:packages/transaction-controller" dependencies: @@ -3745,7 +3745,7 @@ __metadata: "@metamask/polling-controller": "npm:^12.0.1" "@metamask/rpc-errors": "npm:^7.0.1" "@metamask/superstruct": "npm:^3.1.0" - "@metamask/transaction-controller": "npm:^38.1.0" + "@metamask/transaction-controller": "npm:^38.2.0" "@metamask/utils": "npm:^10.0.0" "@types/jest": "npm:^27.4.1" bn.js: "npm:^5.2.1"