@metamask/claims-controller 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +24 -1
  2. package/dist/ClaimsController.cjs +88 -1
  3. package/dist/ClaimsController.cjs.map +1 -1
  4. package/dist/ClaimsController.d.cts +34 -3
  5. package/dist/ClaimsController.d.cts.map +1 -1
  6. package/dist/ClaimsController.d.mts +34 -3
  7. package/dist/ClaimsController.d.mts.map +1 -1
  8. package/dist/ClaimsController.mjs +90 -3
  9. package/dist/ClaimsController.mjs.map +1 -1
  10. package/dist/ClaimsService.cjs +24 -5
  11. package/dist/ClaimsService.cjs.map +1 -1
  12. package/dist/ClaimsService.d.cts +15 -5
  13. package/dist/ClaimsService.d.cts.map +1 -1
  14. package/dist/ClaimsService.d.mts +15 -5
  15. package/dist/ClaimsService.d.mts.map +1 -1
  16. package/dist/ClaimsService.mjs +25 -6
  17. package/dist/ClaimsService.mjs.map +1 -1
  18. package/dist/constants.cjs +16 -7
  19. package/dist/constants.cjs.map +1 -1
  20. package/dist/constants.d.cts +9 -5
  21. package/dist/constants.d.cts.map +1 -1
  22. package/dist/constants.d.mts +9 -5
  23. package/dist/constants.d.mts.map +1 -1
  24. package/dist/constants.mjs +15 -6
  25. package/dist/constants.mjs.map +1 -1
  26. package/dist/index.cjs +4 -1
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +3 -3
  29. package/dist/index.d.cts.map +1 -1
  30. package/dist/index.d.mts +3 -3
  31. package/dist/index.d.mts.map +1 -1
  32. package/dist/index.mjs +1 -1
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/types.cjs.map +1 -1
  35. package/dist/types.d.cts +35 -4
  36. package/dist/types.d.cts.map +1 -1
  37. package/dist/types.d.mts +35 -4
  38. package/dist/types.d.mts.map +1 -1
  39. package/dist/types.mjs.map +1 -1
  40. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Hex } from '@metamask/utils';\n\nimport type { ClaimStatusEnum } from './constants';\n\nexport type Attachment = {\n publicUrl: string;\n contentType: string;\n originalname: string;\n};\n\nexport type Claim = {\n id: string;\n shortId: string;\n chainId: string;\n email: string;\n impactedWalletAddress: Hex;\n impactedTxHash: Hex;\n reimbursementWalletAddress: Hex;\n description: string;\n signature: Hex;\n attachments?: Attachment[];\n status: ClaimStatusEnum;\n createdAt: string;\n updatedAt: string;\n intercomId?: string;\n};\n\nexport type CreateClaimRequest = Omit<\n Claim,\n 'id' | 'shortId' | 'createdAt' | 'updatedAt' | 'intercomId' | 'status'\n>;\n\nexport type ClaimsControllerState = {\n claims: Claim[];\n};\n\nexport type SubmitClaimConfig = {\n /**\n * The sanitized and validated data to be submitted.\n */\n data: CreateClaimRequest;\n /**\n * The headers to be used in the request.\n */\n headers: Record<string, string>;\n /**\n * The HTTP method to submit.\n */\n method: 'POST';\n /**\n * The URL to submit the claim to.\n */\n url: string;\n};\n\nexport type GenerateSignatureMessageResponse = {\n message: string;\n nonce: string;\n};\n\nexport type VerifyClaimSignatureResponse = {\n message: string;\n success: boolean;\n};\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Hex } from '@metamask/utils';\n\nimport type { ClaimStatusEnum } from './constants';\n\nexport type Attachment = {\n publicUrl: string;\n contentType: string;\n originalname: string;\n};\n\nexport type ClaimsConfigurations = {\n /**\n * The number of days the claim is valid for submission.\n */\n validSubmissionWindowDays: number;\n\n /**\n * List of supported chain IDs in hexadecimal format.\n */\n supportedNetworks: `0x${string}`[];\n};\n\nexport type ClaimsConfigurationsResponse = Omit<\n ClaimsConfigurations,\n 'supportedNetworks'\n> & {\n /**\n * List of supported chain IDs.\n * Claims API response for `supportedNetworks` field (in decimal format).\n */\n networks: number[];\n};\n\nexport type Claim = {\n id: string;\n shortId: string;\n chainId: string;\n email: string;\n impactedWalletAddress: Hex;\n impactedTxHash: Hex;\n reimbursementWalletAddress: Hex;\n description: string;\n signature: Hex;\n attachments?: Attachment[];\n status: ClaimStatusEnum;\n createdAt: string;\n updatedAt: string;\n intercomId?: string;\n};\n\nexport type ClaimDraft = Partial<\n Omit<\n Claim,\n | 'id'\n | 'shortId'\n | 'createdAt'\n | 'updatedAt'\n | 'intercomId'\n | 'status'\n | 'attachments'\n >\n> & {\n /**\n * The draft ID.\n */\n draftId: string;\n};\n\nexport type CreateClaimRequest = Omit<\n Claim,\n 'id' | 'shortId' | 'createdAt' | 'updatedAt' | 'intercomId' | 'status'\n>;\n\nexport type ClaimsControllerState = {\n /**\n * List of claims.\n */\n claims: Claim[];\n\n /**\n * The claims configurations.\n * This is used to store the claims configurations fetched from the backend.\n */\n claimsConfigurations: ClaimsConfigurations;\n\n /**\n * List of claim drafts before submission.\n */\n drafts: ClaimDraft[];\n};\n\nexport type SubmitClaimConfig = {\n /**\n * The sanitized and validated data to be submitted.\n */\n data: CreateClaimRequest;\n /**\n * The headers to be used in the request.\n */\n headers: Record<string, string>;\n /**\n * The HTTP method to submit.\n */\n method: 'POST';\n /**\n * The URL to submit the claim to.\n */\n url: string;\n};\n\nexport type GenerateSignatureMessageResponse = {\n message: string;\n nonce: string;\n};\n"]}
package/dist/types.d.cts CHANGED
@@ -5,6 +5,23 @@ export type Attachment = {
5
5
  contentType: string;
6
6
  originalname: string;
7
7
  };
8
+ export type ClaimsConfigurations = {
9
+ /**
10
+ * The number of days the claim is valid for submission.
11
+ */
12
+ validSubmissionWindowDays: number;
13
+ /**
14
+ * List of supported chain IDs in hexadecimal format.
15
+ */
16
+ supportedNetworks: `0x${string}`[];
17
+ };
18
+ export type ClaimsConfigurationsResponse = Omit<ClaimsConfigurations, 'supportedNetworks'> & {
19
+ /**
20
+ * List of supported chain IDs.
21
+ * Claims API response for `supportedNetworks` field (in decimal format).
22
+ */
23
+ networks: number[];
24
+ };
8
25
  export type Claim = {
9
26
  id: string;
10
27
  shortId: string;
@@ -21,9 +38,27 @@ export type Claim = {
21
38
  updatedAt: string;
22
39
  intercomId?: string;
23
40
  };
41
+ export type ClaimDraft = Partial<Omit<Claim, 'id' | 'shortId' | 'createdAt' | 'updatedAt' | 'intercomId' | 'status' | 'attachments'>> & {
42
+ /**
43
+ * The draft ID.
44
+ */
45
+ draftId: string;
46
+ };
24
47
  export type CreateClaimRequest = Omit<Claim, 'id' | 'shortId' | 'createdAt' | 'updatedAt' | 'intercomId' | 'status'>;
25
48
  export type ClaimsControllerState = {
49
+ /**
50
+ * List of claims.
51
+ */
26
52
  claims: Claim[];
53
+ /**
54
+ * The claims configurations.
55
+ * This is used to store the claims configurations fetched from the backend.
56
+ */
57
+ claimsConfigurations: ClaimsConfigurations;
58
+ /**
59
+ * List of claim drafts before submission.
60
+ */
61
+ drafts: ClaimDraft[];
27
62
  };
28
63
  export type SubmitClaimConfig = {
29
64
  /**
@@ -47,8 +82,4 @@ export type GenerateSignatureMessageResponse = {
47
82
  message: string;
48
83
  nonce: string;
49
84
  };
50
- export type VerifyClaimSignatureResponse = {
51
- message: string;
52
- success: boolean;
53
- };
54
85
  //# sourceMappingURL=types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAE3C,OAAO,KAAK,EAAE,eAAe,EAAE,wBAAoB;AAEnD,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,qB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AM,EAAE,KAAK,EAAE,CAAC;IAEhB;;;OAGG;IACH,oBAAoB,EAAE,oBAAoB,CAAC;IAE3C;;OAEG;IACH,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,IAAI,EAAE,kBAAkB,CAAC;IACzB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
package/dist/types.d.mts CHANGED
@@ -5,6 +5,23 @@ export type Attachment = {
5
5
  contentType: string;
6
6
  originalname: string;
7
7
  };
8
+ export type ClaimsConfigurations = {
9
+ /**
10
+ * The number of days the claim is valid for submission.
11
+ */
12
+ validSubmissionWindowDays: number;
13
+ /**
14
+ * List of supported chain IDs in hexadecimal format.
15
+ */
16
+ supportedNetworks: `0x${string}`[];
17
+ };
18
+ export type ClaimsConfigurationsResponse = Omit<ClaimsConfigurations, 'supportedNetworks'> & {
19
+ /**
20
+ * List of supported chain IDs.
21
+ * Claims API response for `supportedNetworks` field (in decimal format).
22
+ */
23
+ networks: number[];
24
+ };
8
25
  export type Claim = {
9
26
  id: string;
10
27
  shortId: string;
@@ -21,9 +38,27 @@ export type Claim = {
21
38
  updatedAt: string;
22
39
  intercomId?: string;
23
40
  };
41
+ export type ClaimDraft = Partial<Omit<Claim, 'id' | 'shortId' | 'createdAt' | 'updatedAt' | 'intercomId' | 'status' | 'attachments'>> & {
42
+ /**
43
+ * The draft ID.
44
+ */
45
+ draftId: string;
46
+ };
24
47
  export type CreateClaimRequest = Omit<Claim, 'id' | 'shortId' | 'createdAt' | 'updatedAt' | 'intercomId' | 'status'>;
25
48
  export type ClaimsControllerState = {
49
+ /**
50
+ * List of claims.
51
+ */
26
52
  claims: Claim[];
53
+ /**
54
+ * The claims configurations.
55
+ * This is used to store the claims configurations fetched from the backend.
56
+ */
57
+ claimsConfigurations: ClaimsConfigurations;
58
+ /**
59
+ * List of claim drafts before submission.
60
+ */
61
+ drafts: ClaimDraft[];
27
62
  };
28
63
  export type SubmitClaimConfig = {
29
64
  /**
@@ -47,8 +82,4 @@ export type GenerateSignatureMessageResponse = {
47
82
  message: string;
48
83
  nonce: string;
49
84
  };
50
- export type VerifyClaimSignatureResponse = {
51
- message: string;
52
- success: boolean;
53
- };
54
85
  //# sourceMappingURL=types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAE3C,OAAO,KAAK,EAAE,eAAe,EAAE,wBAAoB;AAEnD,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB,EAAE,GAAG,CAAC;IAC3B,cAAc,EAAE,GAAG,CAAC;IACpB,0BAA0B,EAAE,GAAG,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,GAAG,CAAC;IACf,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,kBAA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G,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Hex } from '@metamask/utils';\n\nimport type { ClaimStatusEnum } from './constants';\n\nexport type Attachment = {\n publicUrl: string;\n contentType: string;\n originalname: string;\n};\n\nexport type Claim = {\n id: string;\n shortId: string;\n chainId: string;\n email: string;\n impactedWalletAddress: Hex;\n impactedTxHash: Hex;\n reimbursementWalletAddress: Hex;\n description: string;\n signature: Hex;\n attachments?: Attachment[];\n status: ClaimStatusEnum;\n createdAt: string;\n updatedAt: string;\n intercomId?: string;\n};\n\nexport type CreateClaimRequest = Omit<\n Claim,\n 'id' | 'shortId' | 'createdAt' | 'updatedAt' | 'intercomId' | 'status'\n>;\n\nexport type ClaimsControllerState = {\n claims: Claim[];\n};\n\nexport type SubmitClaimConfig = {\n /**\n * The sanitized and validated data to be submitted.\n */\n data: CreateClaimRequest;\n /**\n * The headers to be used in the request.\n */\n headers: Record<string, string>;\n /**\n * The HTTP method to submit.\n */\n method: 'POST';\n /**\n * The URL to submit the claim to.\n */\n url: string;\n};\n\nexport type GenerateSignatureMessageResponse = {\n message: string;\n nonce: string;\n};\n\nexport type VerifyClaimSignatureResponse = {\n message: string;\n success: boolean;\n};\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Hex } from '@metamask/utils';\n\nimport type { ClaimStatusEnum } from './constants';\n\nexport type Attachment = {\n publicUrl: string;\n contentType: string;\n originalname: string;\n};\n\nexport type ClaimsConfigurations = {\n /**\n * The number of days the claim is valid for submission.\n */\n validSubmissionWindowDays: number;\n\n /**\n * List of supported chain IDs in hexadecimal format.\n */\n supportedNetworks: `0x${string}`[];\n};\n\nexport type ClaimsConfigurationsResponse = Omit<\n ClaimsConfigurations,\n 'supportedNetworks'\n> & {\n /**\n * List of supported chain IDs.\n * Claims API response for `supportedNetworks` field (in decimal format).\n */\n networks: number[];\n};\n\nexport type Claim = {\n id: string;\n shortId: string;\n chainId: string;\n email: string;\n impactedWalletAddress: Hex;\n impactedTxHash: Hex;\n reimbursementWalletAddress: Hex;\n description: string;\n signature: Hex;\n attachments?: Attachment[];\n status: ClaimStatusEnum;\n createdAt: string;\n updatedAt: string;\n intercomId?: string;\n};\n\nexport type ClaimDraft = Partial<\n Omit<\n Claim,\n | 'id'\n | 'shortId'\n | 'createdAt'\n | 'updatedAt'\n | 'intercomId'\n | 'status'\n | 'attachments'\n >\n> & {\n /**\n * The draft ID.\n */\n draftId: string;\n};\n\nexport type CreateClaimRequest = Omit<\n Claim,\n 'id' | 'shortId' | 'createdAt' | 'updatedAt' | 'intercomId' | 'status'\n>;\n\nexport type ClaimsControllerState = {\n /**\n * List of claims.\n */\n claims: Claim[];\n\n /**\n * The claims configurations.\n * This is used to store the claims configurations fetched from the backend.\n */\n claimsConfigurations: ClaimsConfigurations;\n\n /**\n * List of claim drafts before submission.\n */\n drafts: ClaimDraft[];\n};\n\nexport type SubmitClaimConfig = {\n /**\n * The sanitized and validated data to be submitted.\n */\n data: CreateClaimRequest;\n /**\n * The headers to be used in the request.\n */\n headers: Record<string, string>;\n /**\n * The HTTP method to submit.\n */\n method: 'POST';\n /**\n * The URL to submit the claim to.\n */\n url: string;\n};\n\nexport type GenerateSignatureMessageResponse = {\n message: string;\n nonce: string;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/claims-controller",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Controller handling shield subscription claims logic",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -49,14 +49,14 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@metamask/base-controller": "^9.0.0",
52
- "@metamask/controller-utils": "^11.15.0",
52
+ "@metamask/controller-utils": "^11.16.0",
53
53
  "@metamask/messenger": "^0.3.0",
54
54
  "@metamask/utils": "^11.8.1"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@metamask/auto-changelog": "^3.4.4",
58
- "@metamask/keyring-controller": "^24.0.0",
59
- "@metamask/profile-sync-controller": "^26.0.0",
58
+ "@metamask/keyring-controller": "^25.0.0",
59
+ "@metamask/profile-sync-controller": "^27.0.0",
60
60
  "@ts-bridge/cli": "^0.6.4",
61
61
  "@types/jest": "^27.4.1",
62
62
  "deepmerge": "^4.2.2",