Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ linkStyle default opacity:0.5
network_enablement_controller --> multichain_network_controller;
network_enablement_controller --> network_controller;
network_enablement_controller --> transaction_controller;
notification_services_controller --> authenticated_user_storage;
notification_services_controller --> base_controller;
notification_services_controller --> controller_utils;
notification_services_controller --> keyring_controller;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/core-monorepo",
"version": "980.0.0",
"version": "982.0.0",
"private": true,
"description": "Monorepo for packages shared between MetaMask clients",
"repository": {
Expand Down
7 changes: 6 additions & 1 deletion packages/authenticated-user-storage/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.0.0]

### Changed

- Bump `@metamask/controller-utils` from `^12.0.0` to `^12.1.0` ([#8774](https://github.com/MetaMask/core/pull/8774))
- Bump `@metamask/base-data-service` from `^0.1.2` to `^0.1.3` ([#8799](https://github.com/MetaMask/core/pull/8799))
- **BREAKING:** Replace `enabled` by `inAppNotificationsEnabled` and `pushNotificationsEnabled` in all the `NotificationPreferences` type fields and validation to match the API payload. ([#8784](https://github.com/MetaMask/core/pull/8784))

## [1.0.1]

Expand All @@ -30,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- **BREAKING**: Rename `SocialAIPreference.traderProfileIds` to `mutedTraderProfileIds` in types and notification-preferences validation to match the API payload. ([#8536](https://github.com/MetaMask/core/pull/8536))

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/authenticated-user-storage@1.0.1...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/authenticated-user-storage@2.0.0...HEAD
[2.0.0]: https://github.com/MetaMask/core/compare/@metamask/authenticated-user-storage@1.0.1...@metamask/authenticated-user-storage@2.0.0
[1.0.1]: https://github.com/MetaMask/core/compare/@metamask/authenticated-user-storage@1.0.0...@metamask/authenticated-user-storage@1.0.1
[1.0.0]: https://github.com/MetaMask/core/releases/tag/@metamask/authenticated-user-storage@1.0.0
4 changes: 2 additions & 2 deletions packages/authenticated-user-storage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/authenticated-user-storage",
"version": "1.0.1",
"version": "2.0.0",
"description": "SDK for authenticated (non-encrypted) user storage endpoints",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -53,7 +53,7 @@
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"dependencies": {
"@metamask/base-data-service": "^0.1.2",
"@metamask/base-data-service": "^0.1.3",
"@metamask/controller-utils": "^12.1.0",
"@metamask/messenger": "^1.2.0",
"@metamask/superstruct": "^3.1.0",
Expand Down
12 changes: 8 additions & 4 deletions packages/authenticated-user-storage/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ export type WalletActivityAccount = {
};

export type WalletActivityPreference = {
enabled: boolean;
inAppNotificationsEnabled: boolean;
pushNotificationsEnabled: boolean;
accounts: WalletActivityAccount[];
};

export type MarketingPreference = {
enabled: boolean;
inAppNotificationsEnabled: boolean;
pushNotificationsEnabled: boolean;
};

export type PerpsWatchlistExchange = {
Expand All @@ -89,12 +91,14 @@ export type PerpsWatchlistMarkets = {
};

export type PerpsPreference = {
enabled: boolean;
inAppNotificationsEnabled: boolean;
pushNotificationsEnabled: boolean;
watchlistMarkets?: PerpsWatchlistMarkets;
};

export type SocialAIPreference = {
enabled: boolean;
inAppNotificationsEnabled: boolean;
pushNotificationsEnabled: boolean;
txAmountLimit?: number;
mutedTraderProfileIds: string[];
};
Expand Down
12 changes: 8 additions & 4 deletions packages/authenticated-user-storage/src/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ const WalletActivityAccountSchema = type({
});

const WalletActivityPreferenceSchema = type({
enabled: boolean(),
inAppNotificationsEnabled: boolean(),
pushNotificationsEnabled: boolean(),
accounts: array(WalletActivityAccountSchema),
});

const MarketingPreferenceSchema = type({
enabled: boolean(),
inAppNotificationsEnabled: boolean(),
pushNotificationsEnabled: boolean(),
});

const PerpsWatchlistExchangeSchema = type({
Expand All @@ -73,12 +75,14 @@ const PerpsWatchlistMarketsSchema = type({
});

const PerpsPreferenceSchema = type({
enabled: boolean(),
inAppNotificationsEnabled: boolean(),
pushNotificationsEnabled: boolean(),
watchlistMarkets: optional(PerpsWatchlistMarketsSchema),
});

const SocialAIPreferenceSchema = type({
enabled: boolean(),
inAppNotificationsEnabled: boolean(),
pushNotificationsEnabled: boolean(),
txAmountLimit: optional(number()),
mutedTraderProfileIds: array(string()),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,26 @@ export const MOCK_DELEGATION_RESPONSE: DelegationResponse =

export const MOCK_NOTIFICATION_PREFERENCES: NotificationPreferences = {
walletActivity: {
enabled: true,
inAppNotificationsEnabled: true,
pushNotificationsEnabled: true,
accounts: [
{
address: '0x1234567890abcdef1234567890abcdef12345678',
enabled: true,
},
],
},
marketing: { enabled: false },
perps: { enabled: true },
marketing: {
inAppNotificationsEnabled: false,
pushNotificationsEnabled: false,
},
perps: {
inAppNotificationsEnabled: true,
pushNotificationsEnabled: true,
},
socialAI: {
enabled: true,
inAppNotificationsEnabled: true,
pushNotificationsEnabled: true,
txAmountLimit: 100,
mutedTraderProfileIds: [
'b3a7c9d1-4e2f-4a8b-9c6d-1f2e3a4b5c6d',
Expand Down
5 changes: 4 additions & 1 deletion packages/base-data-service/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.3]

### Changed

- Bump `@metamask/controller-utils` from `^12.0.0` to `^12.1.0` ([#8774](https://github.com/MetaMask/core/pull/8774))
Expand All @@ -30,7 +32,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release ([#8039](https://github.com/MetaMask/core/pull/8039), [#8292](https://github.com/MetaMask/core/pull/8292))

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/base-data-service@0.1.2...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/base-data-service@0.1.3...HEAD
[0.1.3]: https://github.com/MetaMask/core/compare/@metamask/base-data-service@0.1.2...@metamask/base-data-service@0.1.3
[0.1.2]: https://github.com/MetaMask/core/compare/@metamask/base-data-service@0.1.1...@metamask/base-data-service@0.1.2
[0.1.1]: https://github.com/MetaMask/core/compare/@metamask/base-data-service@0.1.0...@metamask/base-data-service@0.1.1
[0.1.0]: https://github.com/MetaMask/core/releases/tag/@metamask/base-data-service@0.1.0
2 changes: 1 addition & 1 deletion packages/base-data-service/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/base-data-service",
"version": "0.1.2",
"version": "0.1.3",
"description": "Provides utilities for building data services",
"keywords": [
"Ethereum",
Expand Down
1 change: 1 addition & 0 deletions packages/chomp-api-service/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Bump `@metamask/controller-utils` from `^12.0.0` to `^12.1.0` ([#8774](https://github.com/MetaMask/core/pull/8774))
- Bump `@metamask/base-data-service` from `^0.1.2` to `^0.1.3` ([#8799](https://github.com/MetaMask/core/pull/8799))

## [3.1.0]

Expand Down
2 changes: 1 addition & 1 deletion packages/chomp-api-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"dependencies": {
"@metamask/base-data-service": "^0.1.2",
"@metamask/base-data-service": "^0.1.3",
"@metamask/controller-utils": "^12.1.0",
"@metamask/messenger": "^1.2.0",
"@metamask/superstruct": "^3.1.0",
Expand Down
5 changes: 5 additions & 0 deletions packages/core-backend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Bump `@metamask/controller-utils` from `^12.0.0` to `^12.1.0` ([#8774](https://github.com/MetaMask/core/pull/8774))
- Bump `@metamask/profile-sync-controller` from `^28.0.2` to `^28.1.0` ([#8783](https://github.com/MetaMask/core/pull/8783))

### Fixed

- Update HTTP headers from `X-Client-Product`/`X-Client-Version` to `x-metamask-clientproduct`/`x-metamask-clientversion` ([#8798](https://github.com/MetaMask/core/pull/8798))
- Remove default `clientVersion` value of `1.0.0`; the `x-metamask-clientversion` header is now only sent when `clientVersion` is explicitly provided ([#8798](https://github.com/MetaMask/core/pull/8798))

## [6.2.2]

### Changed
Expand Down
10 changes: 5 additions & 5 deletions packages/core-backend/src/api/ApiPlatformClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('ApiPlatformClient', () => {
expect(instance.tokens.queryClient).toBe(customQueryClient);
});

it('uses default version when not provided', async () => {
it('omits clientversion header when not provided', async () => {
const instance = new ApiPlatformClient({
clientProduct: 'test-client',
queryClient: new QueryClient({
Expand All @@ -108,8 +108,8 @@ describe('ApiPlatformClient', () => {
expect(mockFetch).toHaveBeenCalledWith(
expect.any(String),
expect.objectContaining({
headers: expect.objectContaining({
'X-Client-Version': '1.0.0',
headers: expect.not.objectContaining({
'x-metamask-clientversion': expect.any(String),
}),
}),
);
Expand Down Expand Up @@ -145,8 +145,8 @@ describe('ApiPlatformClient', () => {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'X-Client-Product': 'test-client',
'X-Client-Version': '1.0.0',
'x-metamask-clientproduct': 'test-client',
'x-metamask-clientversion': '1.0.0',
},
}),
);
Expand Down
11 changes: 7 additions & 4 deletions packages/core-backend/src/api/base-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export type InternalFetchOptions = {
export class BaseApiClient {
protected readonly clientProduct: string;

protected readonly clientVersion: string;
protected readonly clientVersion?: string;

protected readonly getBearerToken?: () => Promise<string | undefined>;

Expand Down Expand Up @@ -71,7 +71,7 @@ export class BaseApiClient {

constructor(options: ApiPlatformClientOptions) {
this.clientProduct = options.clientProduct;
this.clientVersion = options.clientVersion ?? '1.0.0';
this.clientVersion = options.clientVersion;
this.getBearerToken = options.getBearerToken;

this.#queryClientInstance =
Expand Down Expand Up @@ -121,10 +121,13 @@ export class BaseApiClient {

const headers: Record<string, string> = {
'Content-Type': 'application/json',
'X-Client-Product': this.clientProduct,
'X-Client-Version': this.clientVersion,
'x-metamask-clientproduct': this.clientProduct,
};

if (this.clientVersion) {
headers['x-metamask-clientversion'] = this.clientVersion;
}

// Get bearer token using fetchQuery for automatic deduplication
if (this.getBearerToken) {
const queryKey = authQueryKeys.bearerToken();
Expand Down
5 changes: 4 additions & 1 deletion packages/eip-5792-middleware/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [3.0.4]

### Changed

- Bump `@metamask/keyring-controller` from `^25.3.0` to `^25.4.0` ([#8665](https://github.com/MetaMask/core/pull/8665))
Expand Down Expand Up @@ -111,7 +113,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release ([#6458](https://github.com/MetaMask/core/pull/6458))

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/eip-5792-middleware@3.0.3...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/eip-5792-middleware@3.0.4...HEAD
[3.0.4]: https://github.com/MetaMask/core/compare/@metamask/eip-5792-middleware@3.0.3...@metamask/eip-5792-middleware@3.0.4
[3.0.3]: https://github.com/MetaMask/core/compare/@metamask/eip-5792-middleware@3.0.2...@metamask/eip-5792-middleware@3.0.3
[3.0.2]: https://github.com/MetaMask/core/compare/@metamask/eip-5792-middleware@3.0.1...@metamask/eip-5792-middleware@3.0.2
[3.0.1]: https://github.com/MetaMask/core/compare/@metamask/eip-5792-middleware@3.0.0...@metamask/eip-5792-middleware@3.0.1
Expand Down
2 changes: 1 addition & 1 deletion packages/eip-5792-middleware/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/eip-5792-middleware",
"version": "3.0.3",
"version": "3.0.4",
"description": "Implements the JSON-RPC methods for sending multiple calls from the user's wallet, and checking their status, as referenced in EIP-5792",
"keywords": [
"Ethereum",
Expand Down
4 changes: 4 additions & 0 deletions packages/money-account-balance-service/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Bump `@metamask/base-data-service` from `^0.1.2` to `^0.1.3` ([#8799](https://github.com/MetaMask/core/pull/8799))

## [1.0.2]

### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/money-account-balance-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"dependencies": {
"@ethersproject/contracts": "^5.7.0",
"@ethersproject/providers": "^5.7.0",
"@metamask/base-data-service": "^0.1.2",
"@metamask/base-data-service": "^0.1.3",
"@metamask/controller-utils": "^12.1.0",
"@metamask/messenger": "^1.2.0",
"@metamask/metamask-eth-abis": "^3.1.1",
Expand Down
9 changes: 8 additions & 1 deletion packages/money-account-upgrade-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.0.2]

### Changed

- Bump `@metamask/authenticated-user-storage` from `^1.0.1` to `^2.0.0` ([#8802](https://github.com/MetaMask/core/pull/8802))

## [2.0.1]

### Changed
Expand Down Expand Up @@ -85,7 +91,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add `MoneyAccountUpgradeController` with `upgradeAccount` method ([#8426](https://github.com/MetaMask/core/pull/8426))

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/money-account-upgrade-controller@2.0.1...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/money-account-upgrade-controller@2.0.2...HEAD
[2.0.2]: https://github.com/MetaMask/core/compare/@metamask/money-account-upgrade-controller@2.0.1...@metamask/money-account-upgrade-controller@2.0.2
[2.0.1]: https://github.com/MetaMask/core/compare/@metamask/money-account-upgrade-controller@2.0.0...@metamask/money-account-upgrade-controller@2.0.1
[2.0.0]: https://github.com/MetaMask/core/compare/@metamask/money-account-upgrade-controller@1.3.2...@metamask/money-account-upgrade-controller@2.0.0
[1.3.2]: https://github.com/MetaMask/core/compare/@metamask/money-account-upgrade-controller@1.3.1...@metamask/money-account-upgrade-controller@1.3.2
Expand Down
4 changes: 2 additions & 2 deletions packages/money-account-upgrade-controller/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/money-account-upgrade-controller",
"version": "2.0.1",
"version": "2.0.2",
"description": "MetaMask Money account upgrade controller",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -53,7 +53,7 @@
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"dependencies": {
"@metamask/authenticated-user-storage": "^1.0.1",
"@metamask/authenticated-user-storage": "^2.0.0",
"@metamask/base-controller": "^9.1.0",
"@metamask/chomp-api-service": "^3.1.0",
"@metamask/delegation-controller": "^3.0.0",
Expand Down
Loading
Loading