Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5587761
feat(wallet): wire ClaimsService and ClaimsController initialization
tuna1207 Jul 22, 2026
4285b44
docs(wallet): add Claims initialization changelog entry
tuna1207 Jul 22, 2026
be1ebc7
refactor: claim controller export env
tuna1207 Jul 22, 2026
8be9983
Merge branch 'main' into feat/claim-controller-mm-wallet
tuna1207 Jul 22, 2026
84750e0
refactor(wallet): nest ClaimsService under claims-controller init
tuna1207 Jul 22, 2026
7dc5df2
refactor(wallet): re-export claims Env as ClaimsEnv
tuna1207 Jul 22, 2026
19de465
docs(wallet-cli): note claimsService instance options wiring
tuna1207 Jul 22, 2026
8a31a85
fix: lint
tuna1207 Jul 23, 2026
0efe75a
Merge branch 'main' into feat/claim-controller-mm-wallet
tuna1207 Jul 23, 2026
4446ad5
fix: changelog
tuna1207 Jul 23, 2026
745fd37
fix: lint
tuna1207 Jul 23, 2026
17bf62a
Merge branch 'main' into feat/claim-controller-mm-wallet
tuna1207 Jul 29, 2026
588cda9
Merge branch 'main' into feat/claim-controller-mm-wallet
tuna1207 Jul 30, 2026
458c94b
refactor(claims-controller): update ClaimsService environment handling
tuna1207 Jul 30, 2026
a93ecdb
chore: update changelog
tuna1207 Jul 30, 2026
022dd84
fix: remove unneeded import
tuna1207 Jul 30, 2026
e799716
feat(claims-controller): add ClaimsControllerOptions and ClaimsServic…
tuna1207 Jul 30, 2026
6af6ff4
chore: update changelog
tuna1207 Jul 30, 2026
9edc0c4
Merge branch 'main' into feat/claim-controller-mm-wallet
tuna1207 Aug 1, 2026
063e097
feat: enhance Claims Service Integration
tuna1207 Aug 2, 2026
99dba27
fix: lint
tuna1207 Aug 2, 2026
5f5394d
feat: enhance ClaimsService with bearer token handling and caching logic
tuna1207 Aug 2, 2026
c0be717
test: add handling for malformed GET responses in ClaimsService tests
tuna1207 Aug 2, 2026
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
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@
/packages/wallet/src/initialization/instances/accounts-controller/ @MetaMask/accounts-engineers
/packages/wallet/src/initialization/instances/address-book-controller/ @MetaMask/confirmations
/packages/wallet/src/initialization/instances/approval-controller/ @MetaMask/confirmations
/packages/wallet/src/initialization/instances/claims-controller/ @MetaMask/web3auth
/packages/wallet/src/initialization/instances/claims-service/ @MetaMask/web3auth
/packages/wallet/src/initialization/instances/connectivity-controller/ @MetaMask/core-platform
/packages/wallet/src/initialization/instances/gas-fee-controller/ @MetaMask/confirmations
/packages/wallet/src/initialization/instances/keyring-controller/ @MetaMask/accounts-engineers @MetaMask/core-platform
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ linkStyle default opacity:0.5
chomp_api_service --> controller_utils;
chomp_api_service --> messenger;
claims_controller --> base_controller;
claims_controller --> base_data_service;
claims_controller --> controller_utils;
claims_controller --> keyring_controller;
claims_controller --> messenger;
Expand Down Expand Up @@ -655,6 +656,7 @@ linkStyle default opacity:0.5
wallet --> address_book_controller;
wallet --> approval_controller;
wallet --> base_controller;
wallet --> claims_controller;
wallet --> connectivity_controller;
wallet --> controller_utils;
wallet --> gas_fee_controller;
Expand Down
5 changes: 5 additions & 0 deletions codeowners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ const PACKAGES: Record<string, PackageInfo> = {
},
'claims-controller': {
teams: ['@MetaMask/web3auth'],
initializationPath: 'claims-controller',
},
'claims-service': {
teams: ['@MetaMask/web3auth'],
initializationPath: 'claims-service',
},
'client-controller': {
teams: [
Expand Down
8 changes: 8 additions & 0 deletions packages/claims-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Export `ClaimsControllerOptions` and `ClaimsServiceConfig` types ([#9588](https://github.com/MetaMask/core/pull/9588))
- Add `ClaimsService-method-action-types.ts` with generated method action types for `ClaimsService` ([#9588](https://github.com/MetaMask/core/pull/9588))
- Add `ClaimsService:invalidateQueries` action and `ClaimsService:cacheUpdated` events via `BaseDataService` ([#9588](https://github.com/MetaMask/core/pull/9588))

### Changed

- Migrate `ClaimsService` to `BaseDataService` with TanStack Query caching, circuit-breaker policy support, and response validation ([#9588](https://github.com/MetaMask/core/pull/9588))
- Add `@metamask/base-data-service` `^0.1.3`, `@metamask/superstruct` `^3.1.0`, and `@tanstack/query-core` `^4.43.0` as dependencies ([#9588](https://github.com/MetaMask/core/pull/9588))
- Bump `@metamask/utils` from `^11.9.0` to `^11.11.0` ([#9074](https://github.com/MetaMask/core/pull/9074))
- Bump `@metamask/controller-utils` from `^12.1.1` to `^12.3.0` ([#9083](https://github.com/MetaMask/core/pull/9083), [#9218](https://github.com/MetaMask/core/pull/9218))
- Bump `@metamask/profile-sync-controller` from `^28.1.1` to `^28.3.0` ([#9119](https://github.com/MetaMask/core/pull/9119), [#9463](https://github.com/MetaMask/core/pull/9463))
Expand Down
5 changes: 4 additions & 1 deletion packages/claims-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,14 @@
},
"dependencies": {
"@metamask/base-controller": "^9.1.0",
"@metamask/base-data-service": "^0.1.3",
"@metamask/controller-utils": "^12.3.0",
"@metamask/keyring-controller": "^27.1.0",
"@metamask/messenger": "^2.0.0",
"@metamask/profile-sync-controller": "^28.3.0",
"@metamask/utils": "^11.11.0"
"@metamask/superstruct": "^3.1.0",
"@metamask/utils": "^11.11.0",
"@tanstack/query-core": "^4.43.0"
},
"devDependencies": {
"@metamask/auto-changelog": "^6.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/claims-controller/src/ClaimsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type {
ClaimsServiceGetClaimsAction,
ClaimsServiceGetClaimsApiUrlAction,
ClaimsServiceGetRequestHeadersAction,
} from './ClaimsService.js';
} from './ClaimsService-method-action-types.js';
import {
ClaimsControllerErrorMessages,
CONTROLLER_NAME,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/**
* This file is auto generated.
* Do not edit manually.
*/

import type { ClaimsService } from './ClaimsService.js';

/**
* Fetch required configurations for the claims service.
*
* @returns The required configurations for the claims service.
*/
export type ClaimsServiceFetchClaimsConfigurationsAction = {
type: `ClaimsService:fetchClaimsConfigurations`;
handler: ClaimsService['fetchClaimsConfigurations'];
};

/**
* Get the claims for the current user.
*
* @returns The claims for the current user.
*/
export type ClaimsServiceGetClaimsAction = {
type: `ClaimsService:getClaims`;
handler: ClaimsService['getClaims'];
};

/**
* Get the claim by id.
*
* @param id - The id of the claim to get.
* @returns The claim by id.
*/
export type ClaimsServiceGetClaimByIdAction = {
type: `ClaimsService:getClaimById`;
handler: ClaimsService['getClaimById'];
};

/**
* Generate a message to be signed by the user for the claim request.
*
* @param chainId - The chain id of the claim.
* @param walletAddress - The impacted wallet address of the claim.
* @returns The message for the claim signature.
*/
export type ClaimsServiceGenerateMessageForClaimSignatureAction = {
type: `ClaimsService:generateMessageForClaimSignature`;
handler: ClaimsService['generateMessageForClaimSignature'];
};

/**
* Create the headers for the current request.
*
* @returns The headers for the current request.
*/
export type ClaimsServiceGetRequestHeadersAction = {
type: `ClaimsService:getRequestHeaders`;
handler: ClaimsService['getRequestHeaders'];
};

/**
* Get the URL for the claims API for the current environment.
*
* @returns The URL for the claims API for the current environment.
*/
export type ClaimsServiceGetClaimsApiUrlAction = {
type: `ClaimsService:getClaimsApiUrl`;
handler: ClaimsService['getClaimsApiUrl'];
};

/**
* Union of all ClaimsService action types.
*/
export type ClaimsServiceMethodActions =
| ClaimsServiceFetchClaimsConfigurationsAction
| ClaimsServiceGetClaimsAction
| ClaimsServiceGetClaimByIdAction
| ClaimsServiceGenerateMessageForClaimSignatureAction
| ClaimsServiceGetRequestHeadersAction
| ClaimsServiceGetClaimsApiUrlAction;
45 changes: 45 additions & 0 deletions packages/claims-controller/src/ClaimsService-structs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import {
array,
enums,
integer,
object,
optional,
string,
} from '@metamask/superstruct';

import { ClaimStatusEnum } from './constants.js';

const HexStringStruct = string();

const AttachmentStruct = object({
publicUrl: string(),
contentType: string(),
originalname: string(),
});

export const ClaimStruct = object({
id: string(),
shortId: string(),
chainId: string(),
email: string(),
impactedWalletAddress: HexStringStruct,
impactedTxHash: HexStringStruct,
reimbursementWalletAddress: HexStringStruct,
description: string(),
signature: HexStringStruct,
attachments: optional(array(AttachmentStruct)),
status: enums(Object.values(ClaimStatusEnum)),
createdAt: string(),
updatedAt: string(),
intercomId: optional(string()),
});

export const ClaimsConfigurationsResponseStruct = object({
validSubmissionWindowDays: integer(),
networks: array(integer()),
});

export const GenerateSignatureMessageResponseStruct = object({
message: string(),
nonce: string(),
});
Loading