@metamask/keyring-api 21.4.0 → 21.6.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 (52) hide show
  1. package/CHANGELOG.md +30 -2
  2. package/dist/api/transaction.cjs +64 -1
  3. package/dist/api/transaction.cjs.map +1 -1
  4. package/dist/api/transaction.d.cts +135 -0
  5. package/dist/api/transaction.d.cts.map +1 -1
  6. package/dist/api/transaction.d.mts +135 -0
  7. package/dist/api/transaction.d.mts.map +1 -1
  8. package/dist/api/transaction.mjs +64 -1
  9. package/dist/api/transaction.mjs.map +1 -1
  10. package/dist/api/v2/create-account/index.cjs +34 -0
  11. package/dist/api/v2/create-account/index.cjs.map +1 -1
  12. package/dist/api/v2/create-account/index.d.cts +29 -0
  13. package/dist/api/v2/create-account/index.d.cts.map +1 -1
  14. package/dist/api/v2/create-account/index.d.mts +29 -0
  15. package/dist/api/v2/create-account/index.d.mts.map +1 -1
  16. package/dist/api/v2/create-account/index.mjs +33 -0
  17. package/dist/api/v2/create-account/index.mjs.map +1 -1
  18. package/dist/api/v2/keyring-type.cjs +4 -0
  19. package/dist/api/v2/keyring-type.cjs.map +1 -1
  20. package/dist/api/v2/keyring-type.d.cts +5 -1
  21. package/dist/api/v2/keyring-type.d.cts.map +1 -1
  22. package/dist/api/v2/keyring-type.d.mts +5 -1
  23. package/dist/api/v2/keyring-type.d.mts.map +1 -1
  24. package/dist/api/v2/keyring-type.mjs +4 -0
  25. package/dist/api/v2/keyring-type.mjs.map +1 -1
  26. package/dist/eth/erc4337/types.d.cts +4 -4
  27. package/dist/eth/erc4337/types.d.mts +4 -4
  28. package/dist/eth/rpc/params.cjs +1 -1
  29. package/dist/eth/rpc/params.cjs.map +1 -1
  30. package/dist/eth/rpc/params.d.cts +16 -16
  31. package/dist/eth/rpc/params.d.cts.map +1 -1
  32. package/dist/eth/rpc/params.d.mts +16 -16
  33. package/dist/eth/rpc/params.d.mts.map +1 -1
  34. package/dist/eth/rpc/params.mjs +2 -2
  35. package/dist/eth/rpc/params.mjs.map +1 -1
  36. package/dist/eth/types.cjs +5 -2
  37. package/dist/eth/types.cjs.map +1 -1
  38. package/dist/eth/types.d.cts +6 -5
  39. package/dist/eth/types.d.cts.map +1 -1
  40. package/dist/eth/types.d.mts +6 -5
  41. package/dist/eth/types.d.mts.map +1 -1
  42. package/dist/eth/types.mjs +4 -1
  43. package/dist/eth/types.mjs.map +1 -1
  44. package/dist/events.d.cts +12 -0
  45. package/dist/events.d.cts.map +1 -1
  46. package/dist/events.d.mts +12 -0
  47. package/dist/events.d.mts.map +1 -1
  48. package/dist/rpc.d.cts +23 -0
  49. package/dist/rpc.d.cts.map +1 -1
  50. package/dist/rpc.d.mts +23 -0
  51. package/dist/rpc.d.mts.map +1 -1
  52. package/package.json +1 -1
@@ -17,22 +17,22 @@ export declare const EthTransactionDataStruct: import("@metamask/superstruct").S
17
17
  value?: string | number | undefined;
18
18
  type?: string | number | undefined;
19
19
  data?: string | undefined;
20
- from?: `0x${string}` | undefined;
20
+ from?: string | undefined;
21
21
  chainId?: string | number | undefined;
22
22
  accessList?: {
23
- address: `0x${string}`;
23
+ address: string;
24
24
  storageKeys: string[];
25
25
  }[] | undefined;
26
26
  nonce?: string | number | undefined;
27
- to?: `0x${string}` | null | undefined;
27
+ to?: string | null | undefined;
28
28
  maxFeePerGas?: string | number | undefined;
29
29
  maxPriorityFeePerGas?: string | number | undefined;
30
30
  gas?: string | number | undefined;
31
31
  gasLimit?: string | number | undefined;
32
32
  gasPrice?: string | number | undefined;
33
33
  }, {
34
- to: import("@metamask/superstruct").Struct<`0x${string}` | null | undefined, null>;
35
- from: import("@metamask/superstruct").Struct<`0x${string}` | undefined, null>;
34
+ to: import("@metamask/superstruct").Struct<string | null | undefined, null>;
35
+ from: import("@metamask/superstruct").Struct<string | undefined, null>;
36
36
  nonce: import("@metamask/superstruct").Struct<string | number | undefined, null>;
37
37
  value: import("@metamask/superstruct").Struct<string | number | undefined, null>;
38
38
  data: import("@metamask/superstruct").Struct<string | undefined, null>;
@@ -42,13 +42,13 @@ export declare const EthTransactionDataStruct: import("@metamask/superstruct").S
42
42
  maxFeePerGas: import("@metamask/superstruct").Struct<string | number | undefined, null>;
43
43
  maxPriorityFeePerGas: import("@metamask/superstruct").Struct<string | number | undefined, null>;
44
44
  accessList: import("@metamask/superstruct").Struct<{
45
- address: `0x${string}`;
45
+ address: string;
46
46
  storageKeys: string[];
47
47
  }[] | undefined, import("@metamask/superstruct").Struct<{
48
- address: `0x${string}`;
48
+ address: string;
49
49
  storageKeys: string[];
50
50
  }, {
51
- address: import("@metamask/superstruct").Struct<`0x${string}`, null>;
51
+ address: import("@metamask/superstruct").Struct<string, null>;
52
52
  storageKeys: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
53
53
  }>>;
54
54
  type: import("@metamask/superstruct").Struct<string | number | undefined, null>;
@@ -136,14 +136,14 @@ export declare const EthSignTransactionParamsStruct: import("@metamask/superstru
136
136
  value?: string | number | undefined;
137
137
  type?: string | number | undefined;
138
138
  data?: string | undefined;
139
- from?: `0x${string}` | undefined;
139
+ from?: string | undefined;
140
140
  chainId?: string | number | undefined;
141
141
  accessList?: {
142
- address: `0x${string}`;
142
+ address: string;
143
143
  storageKeys: string[];
144
144
  }[] | undefined;
145
145
  nonce?: string | number | undefined;
146
- to?: `0x${string}` | null | undefined;
146
+ to?: string | null | undefined;
147
147
  maxFeePerGas?: string | number | undefined;
148
148
  maxPriorityFeePerGas?: string | number | undefined;
149
149
  gas?: string | number | undefined;
@@ -154,17 +154,17 @@ export type EthSignTransactionParams = Infer<typeof EthSignTransactionParamsStru
154
154
  /**
155
155
  * Parameters for `eth_sign`.
156
156
  */
157
- export declare const EthSignParamsStruct: import("@metamask/superstruct").Struct<[`0x${string}`, string], null>;
157
+ export declare const EthSignParamsStruct: import("@metamask/superstruct").Struct<[string, string], null>;
158
158
  export type EthSignParams = Infer<typeof EthSignParamsStruct>;
159
159
  /**
160
160
  * Parameters for `personal_sign`.
161
161
  */
162
- export declare const EthPersonalSignParamsStruct: import("@metamask/superstruct").Struct<[string] | [string, `0x${string}`], null>;
162
+ export declare const EthPersonalSignParamsStruct: import("@metamask/superstruct").Struct<[string, string] | [string], null>;
163
163
  export type EthPersonalSignParams = Infer<typeof EthPersonalSignParamsStruct>;
164
164
  /**
165
165
  * Parameters for `eth_signTypedData_v1`.
166
166
  */
167
- export declare const EthSignTypedDataV1ParamsStruct: import("@metamask/superstruct").Struct<[`0x${string}`, {
167
+ export declare const EthSignTypedDataV1ParamsStruct: import("@metamask/superstruct").Struct<[string, {
168
168
  name: string;
169
169
  value: unknown;
170
170
  type: string;
@@ -173,7 +173,7 @@ export type EthSignTypedDataV1Params = Infer<typeof EthSignTypedDataV1ParamsStru
173
173
  /**
174
174
  * Parameters for `eth_signTypedData_v3` and `eth_signTypedData_v4`.
175
175
  */
176
- export declare const EthSignTypedDataParamsStruct: import("@metamask/superstruct").Struct<[`0x${string}`, {
176
+ export declare const EthSignTypedDataParamsStruct: import("@metamask/superstruct").Struct<[string, {
177
177
  message: Record<string, any>;
178
178
  domain: Record<string, any>;
179
179
  types: Record<string, {
@@ -211,5 +211,5 @@ export type EthSignEip7702AuthorizationParams = Infer<typeof EthSignEip7702Autho
211
211
  /**
212
212
  * Parameters for `eth_getEncryptionPublicKey`.
213
213
  */
214
- export declare const EthGetEncryptionPublicKeyParamsStruct: import("@metamask/superstruct").Struct<[`0x${string}`, Record<string, unknown> | undefined], null>;
214
+ export declare const EthGetEncryptionPublicKeyParamsStruct: import("@metamask/superstruct").Struct<[string, Record<string, unknown> | undefined], null>;
215
215
  //# sourceMappingURL=params.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"params.d.cts","sourceRoot":"","sources":["../../../src/eth/rpc/params.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAkBnD;;;;;;GAMG;AACH,eAAO,M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AEtE,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,+BAA+B,wDAE1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAC3C,OAAO,+BAA+B,CACvC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uCAAuC,iFAElD,CAAC;AAEH,MAAM,MAAM,iCAAiC,GAAG,KAAK,CACnD,OAAO,uCAAuC,CAC/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qCAAqC,6FAGhD,CAAC"}
@@ -17,22 +17,22 @@ export declare const EthTransactionDataStruct: import("@metamask/superstruct").S
17
17
  value?: string | number | undefined;
18
18
  type?: string | number | undefined;
19
19
  data?: string | undefined;
20
- from?: `0x${string}` | undefined;
20
+ from?: string | undefined;
21
21
  chainId?: string | number | undefined;
22
22
  accessList?: {
23
- address: `0x${string}`;
23
+ address: string;
24
24
  storageKeys: string[];
25
25
  }[] | undefined;
26
26
  nonce?: string | number | undefined;
27
- to?: `0x${string}` | null | undefined;
27
+ to?: string | null | undefined;
28
28
  maxFeePerGas?: string | number | undefined;
29
29
  maxPriorityFeePerGas?: string | number | undefined;
30
30
  gas?: string | number | undefined;
31
31
  gasLimit?: string | number | undefined;
32
32
  gasPrice?: string | number | undefined;
33
33
  }, {
34
- to: import("@metamask/superstruct").Struct<`0x${string}` | null | undefined, null>;
35
- from: import("@metamask/superstruct").Struct<`0x${string}` | undefined, null>;
34
+ to: import("@metamask/superstruct").Struct<string | null | undefined, null>;
35
+ from: import("@metamask/superstruct").Struct<string | undefined, null>;
36
36
  nonce: import("@metamask/superstruct").Struct<string | number | undefined, null>;
37
37
  value: import("@metamask/superstruct").Struct<string | number | undefined, null>;
38
38
  data: import("@metamask/superstruct").Struct<string | undefined, null>;
@@ -42,13 +42,13 @@ export declare const EthTransactionDataStruct: import("@metamask/superstruct").S
42
42
  maxFeePerGas: import("@metamask/superstruct").Struct<string | number | undefined, null>;
43
43
  maxPriorityFeePerGas: import("@metamask/superstruct").Struct<string | number | undefined, null>;
44
44
  accessList: import("@metamask/superstruct").Struct<{
45
- address: `0x${string}`;
45
+ address: string;
46
46
  storageKeys: string[];
47
47
  }[] | undefined, import("@metamask/superstruct").Struct<{
48
- address: `0x${string}`;
48
+ address: string;
49
49
  storageKeys: string[];
50
50
  }, {
51
- address: import("@metamask/superstruct").Struct<`0x${string}`, null>;
51
+ address: import("@metamask/superstruct").Struct<string, null>;
52
52
  storageKeys: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
53
53
  }>>;
54
54
  type: import("@metamask/superstruct").Struct<string | number | undefined, null>;
@@ -136,14 +136,14 @@ export declare const EthSignTransactionParamsStruct: import("@metamask/superstru
136
136
  value?: string | number | undefined;
137
137
  type?: string | number | undefined;
138
138
  data?: string | undefined;
139
- from?: `0x${string}` | undefined;
139
+ from?: string | undefined;
140
140
  chainId?: string | number | undefined;
141
141
  accessList?: {
142
- address: `0x${string}`;
142
+ address: string;
143
143
  storageKeys: string[];
144
144
  }[] | undefined;
145
145
  nonce?: string | number | undefined;
146
- to?: `0x${string}` | null | undefined;
146
+ to?: string | null | undefined;
147
147
  maxFeePerGas?: string | number | undefined;
148
148
  maxPriorityFeePerGas?: string | number | undefined;
149
149
  gas?: string | number | undefined;
@@ -154,17 +154,17 @@ export type EthSignTransactionParams = Infer<typeof EthSignTransactionParamsStru
154
154
  /**
155
155
  * Parameters for `eth_sign`.
156
156
  */
157
- export declare const EthSignParamsStruct: import("@metamask/superstruct").Struct<[`0x${string}`, string], null>;
157
+ export declare const EthSignParamsStruct: import("@metamask/superstruct").Struct<[string, string], null>;
158
158
  export type EthSignParams = Infer<typeof EthSignParamsStruct>;
159
159
  /**
160
160
  * Parameters for `personal_sign`.
161
161
  */
162
- export declare const EthPersonalSignParamsStruct: import("@metamask/superstruct").Struct<[string] | [string, `0x${string}`], null>;
162
+ export declare const EthPersonalSignParamsStruct: import("@metamask/superstruct").Struct<[string, string] | [string], null>;
163
163
  export type EthPersonalSignParams = Infer<typeof EthPersonalSignParamsStruct>;
164
164
  /**
165
165
  * Parameters for `eth_signTypedData_v1`.
166
166
  */
167
- export declare const EthSignTypedDataV1ParamsStruct: import("@metamask/superstruct").Struct<[`0x${string}`, {
167
+ export declare const EthSignTypedDataV1ParamsStruct: import("@metamask/superstruct").Struct<[string, {
168
168
  name: string;
169
169
  value: unknown;
170
170
  type: string;
@@ -173,7 +173,7 @@ export type EthSignTypedDataV1Params = Infer<typeof EthSignTypedDataV1ParamsStru
173
173
  /**
174
174
  * Parameters for `eth_signTypedData_v3` and `eth_signTypedData_v4`.
175
175
  */
176
- export declare const EthSignTypedDataParamsStruct: import("@metamask/superstruct").Struct<[`0x${string}`, {
176
+ export declare const EthSignTypedDataParamsStruct: import("@metamask/superstruct").Struct<[string, {
177
177
  message: Record<string, any>;
178
178
  domain: Record<string, any>;
179
179
  types: Record<string, {
@@ -211,5 +211,5 @@ export type EthSignEip7702AuthorizationParams = Infer<typeof EthSignEip7702Autho
211
211
  /**
212
212
  * Parameters for `eth_getEncryptionPublicKey`.
213
213
  */
214
- export declare const EthGetEncryptionPublicKeyParamsStruct: import("@metamask/superstruct").Struct<[`0x${string}`, Record<string, unknown> | undefined], null>;
214
+ export declare const EthGetEncryptionPublicKeyParamsStruct: import("@metamask/superstruct").Struct<[string, Record<string, unknown> | undefined], null>;
215
215
  //# sourceMappingURL=params.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"params.d.mts","sourceRoot":"","sources":["../../../src/eth/rpc/params.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAkBnD;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,w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AEH,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAC3C,OAAO,+BAA+B,CACvC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uCAAuC,iFAElD,CAAC;AAEH,MAAM,MAAM,iCAAiC,GAAG,KAAK,CACnD,OAAO,uCAAuC,CAC/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qCAAqC,6FAGhD,CAAC"}
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { object } from "@metamask/keyring-utils";
9
9
  import { any, array, literal, nullable, number, optional, record, string, tuple, type, union, unknown } from "@metamask/superstruct";
10
- import { EthAddressStruct, EthBytesStruct } from "../types.mjs";
10
+ import { EthAddressStrictStruct, EthAddressStruct, EthBytesStruct } from "../types.mjs";
11
11
  /**
12
12
  * A struct for validating Ethereum transaction data.
13
13
  *
@@ -75,7 +75,7 @@ export const EthEncryptedDataStruct = object({
75
75
  */
76
76
  export const EthEip7702AuthorizationStruct = tuple([
77
77
  number(), // chainId
78
- EthAddressStruct, // address (contract to delegate to)
78
+ EthAddressStrictStruct, // address (contract to delegate to)
79
79
  number(), // nonce
80
80
  ]);
81
81
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"params.mjs","sourceRoot":"","sources":["../../../src/eth/rpc/params.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,gCAAgC;AAEjD,OAAO,EACL,GAAG,EACH,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACN,KAAK,EACL,IAAI,EACJ,KAAK,EACL,OAAO,EACR,8BAA8B;AAE/B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,qBAAiB;AAE5D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;IAC3C,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IACxC,IAAI,EAAE,QAAQ,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CAAC;IACvC,gBAAgB,EAAE,UAAU;IAC5B,cAAc,EAAE,kCAAkC;CACnD,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,CAAC;IAC/C,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC,EAAE,SAAS;IAClC,KAAK,CAAC,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC,EAAE,kBAAkB;CAC9D,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,KAAK,CAAC;IAClD,gBAAgB,EAAE,UAAU;IAC5B,oBAAoB,EAAE,mBAAmB;CAC1C,CAAC,CAAC;AAMH;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,CAAC;IAChD,gBAAgB,EAAE,UAAU;IAC5B,qBAAqB,EAAE,oBAAoB;CAC5C,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC;AAItE;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,KAAK,CAAC;IACnD,MAAM,EAAE,EAAE,aAAa;CACxB,CAAC,CAAC;AAMH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,KAAK,CAAC;IAC3D,6BAA6B;CAC9B,CAAC,CAAC;AAMH;;GAEG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,KAAK,CAAC;IACzD,gBAAgB,EAAE,UAAU;IAC5B,QAAQ,CAAC,sCAAsC,CAAC,EAAE,UAAU;CAC7D,CAAC,CAAC","sourcesContent":["/**\n * Superstruct validation schemas for Ethereum JSON-RPC method parameters.\n *\n * These structs provide runtime validation for the parameters passed to various\n * Ethereum RPC methods. They can be used by keyring implementations to validate\n * incoming requests before processing.\n */\n\nimport { object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport {\n any,\n array,\n literal,\n nullable,\n number,\n optional,\n record,\n string,\n tuple,\n type,\n union,\n unknown,\n} from '@metamask/superstruct';\n\nimport { EthAddressStruct, EthBytesStruct } from '../types';\n\n/**\n * A struct for validating Ethereum transaction data.\n *\n * This uses `type()` instead of `object()` to allow extra properties,\n * since transaction formats can vary and include additional fields.\n * The actual transaction validation is performed by the transaction library.\n */\nexport const EthTransactionDataStruct = type({\n to: optional(nullable(EthAddressStruct)),\n from: optional(EthAddressStruct),\n nonce: optional(union([string(), number()])),\n value: optional(union([string(), number()])),\n data: optional(EthBytesStruct),\n gas: optional(union([string(), number()])),\n gasLimit: optional(union([string(), number()])),\n gasPrice: optional(union([string(), number()])),\n maxFeePerGas: optional(union([string(), number()])),\n maxPriorityFeePerGas: optional(union([string(), number()])),\n accessList: optional(\n array(\n type({\n address: EthAddressStruct,\n storageKeys: array(string()),\n }),\n ),\n ),\n type: optional(union([string(), number()])),\n chainId: optional(union([string(), number()])),\n});\n\nexport type EthTransactionData = Infer<typeof EthTransactionDataStruct>;\n\n/**\n * A struct for TypedDataV1 format (legacy typed data).\n * This is an array of { type, name, value } objects.\n */\nexport const EthTypedDataV1Struct = array(\n object({\n type: string(),\n name: string(),\n value: unknown(),\n }),\n);\n\nexport type EthTypedDataV1 = Infer<typeof EthTypedDataV1Struct>;\n\n/**\n * A struct for TypedData types definition.\n * Maps type names to arrays of { name, type } definitions.\n */\nexport const EthTypedDataTypesStruct = record(\n string(),\n array(\n object({\n name: string(),\n type: string(),\n }),\n ),\n);\n\nexport type EthTypedDataTypes = Infer<typeof EthTypedDataTypesStruct>;\n\n/**\n * A struct for TypedMessage format (EIP-712 V3/V4).\n * Contains types, domain, primaryType, and message.\n */\nexport const EthTypedMessageStruct = object({\n types: EthTypedDataTypesStruct,\n primaryType: string(),\n domain: record(string(), any()),\n message: record(string(), any()),\n});\n\nexport type EthTypedMessage = Infer<typeof EthTypedMessageStruct>;\n\n/**\n * A struct for EIP-1024 encrypted data format (x25519-xsalsa20-poly1305).\n */\nexport const EthEncryptedDataStruct = object({\n version: literal('x25519-xsalsa20-poly1305'),\n nonce: string(),\n ephemPublicKey: string(),\n ciphertext: string(),\n});\n\nexport type EthEncryptedData = Infer<typeof EthEncryptedDataStruct>;\n\n/**\n * A struct for EIP-7702 authorization tuple.\n * Format: [chainId, address, nonce]\n */\nexport const EthEip7702AuthorizationStruct = tuple([\n number(), // chainId\n EthAddressStruct, // address (contract to delegate to)\n number(), // nonce\n]);\n\nexport type EthEip7702Authorization = Infer<\n typeof EthEip7702AuthorizationStruct\n>;\n\n/**\n * A struct for getEncryptionPublicKey options.\n */\nexport const EthGetEncryptionPublicKeyOptionsStruct = record(\n string(),\n unknown(),\n);\n\n// ============================================================================\n// RPC Method Parameter Structs\n// ============================================================================\n\n/**\n * Parameters for `eth_signTransaction`.\n */\nexport const EthSignTransactionParamsStruct = tuple([EthTransactionDataStruct]);\n\nexport type EthSignTransactionParams = Infer<\n typeof EthSignTransactionParamsStruct\n>;\n\n/**\n * Parameters for `eth_sign`.\n */\nexport const EthSignParamsStruct = tuple([\n EthAddressStruct, // address\n EthBytesStruct, // data (hex-encoded message hash)\n]);\n\nexport type EthSignParams = Infer<typeof EthSignParamsStruct>;\n\n/**\n * Parameters for `personal_sign`.\n */\nexport const EthPersonalSignParamsStruct = union([\n tuple([EthBytesStruct]), // [data]\n tuple([EthBytesStruct, EthAddressStruct]), // [data, address]\n]);\n\nexport type EthPersonalSignParams = Infer<typeof EthPersonalSignParamsStruct>;\n\n/**\n * Parameters for `eth_signTypedData_v1`.\n */\nexport const EthSignTypedDataV1ParamsStruct = tuple([\n EthAddressStruct, // address\n EthTypedDataV1Struct, // typed data array\n]);\n\nexport type EthSignTypedDataV1Params = Infer<\n typeof EthSignTypedDataV1ParamsStruct\n>;\n\n/**\n * Parameters for `eth_signTypedData_v3` and `eth_signTypedData_v4`.\n */\nexport const EthSignTypedDataParamsStruct = tuple([\n EthAddressStruct, // address\n EthTypedMessageStruct, // typed data object\n]);\n\nexport type EthSignTypedDataParams = Infer<typeof EthSignTypedDataParamsStruct>;\n\n/**\n * Parameters for `eth_decrypt`.\n */\nexport const EthDecryptParamsStruct = tuple([EthEncryptedDataStruct]);\n\nexport type EthDecryptParams = Infer<typeof EthDecryptParamsStruct>;\n\n/**\n * Parameters for `eth_getAppKeyAddress`.\n */\nexport const EthGetAppKeyAddressParamsStruct = tuple([\n string(), // origin URL\n]);\n\nexport type EthGetAppKeyAddressParams = Infer<\n typeof EthGetAppKeyAddressParamsStruct\n>;\n\n/**\n * Parameters for `eth_signEip7702Authorization`.\n *\n * @example\n * ```ts\n * const params = [[1, '0xContractAddress', 0]];\n * ```\n */\nexport const EthSignEip7702AuthorizationParamsStruct = tuple([\n EthEip7702AuthorizationStruct,\n]);\n\nexport type EthSignEip7702AuthorizationParams = Infer<\n typeof EthSignEip7702AuthorizationParamsStruct\n>;\n\n/**\n * Parameters for `eth_getEncryptionPublicKey`.\n */\nexport const EthGetEncryptionPublicKeyParamsStruct = tuple([\n EthAddressStruct, // address\n optional(EthGetEncryptionPublicKeyOptionsStruct), // options\n]);\n"]}
1
+ {"version":3,"file":"params.mjs","sourceRoot":"","sources":["../../../src/eth/rpc/params.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,gCAAgC;AAEjD,OAAO,EACL,GAAG,EACH,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACN,KAAK,EACL,IAAI,EACJ,KAAK,EACL,OAAO,EACR,8BAA8B;AAE/B,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACf,qBAAiB;AAElB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;IAC3C,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IACxC,IAAI,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAChC,KAAK,EA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AC5B,cAAc,EAAE,kCAAkC;CACnD,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,CAAC;IAC/C,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC,EAAE,SAAS;IAClC,KAAK,CAAC,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC,EAAE,kBAAkB;CAC9D,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,KAAK,CAAC;IAClD,gBAAgB,EAAE,UAAU;IAC5B,oBAAoB,EAAE,mBAAmB;CAC1C,CAAC,CAAC;AAMH;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,CAAC;IAChD,gBAAgB,EAAE,UAAU;IAC5B,qBAAqB,EAAE,oBAAoB;CAC5C,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC;AAItE;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,KAAK,CAAC;IACnD,MAAM,EAAE,EAAE,aAAa;CACxB,CAAC,CAAC;AAMH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,KAAK,CAAC;IAC3D,6BAA6B;CAC9B,CAAC,CAAC;AAMH;;GAEG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,KAAK,CAAC;IACzD,gBAAgB,EAAE,UAAU;IAC5B,QAAQ,CAAC,sCAAsC,CAAC,EAAE,UAAU;CAC7D,CAAC,CAAC","sourcesContent":["/**\n * Superstruct validation schemas for Ethereum JSON-RPC method parameters.\n *\n * These structs provide runtime validation for the parameters passed to various\n * Ethereum RPC methods. They can be used by keyring implementations to validate\n * incoming requests before processing.\n */\n\nimport { object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport {\n any,\n array,\n literal,\n nullable,\n number,\n optional,\n record,\n string,\n tuple,\n type,\n union,\n unknown,\n} from '@metamask/superstruct';\n\nimport {\n EthAddressStrictStruct,\n EthAddressStruct,\n EthBytesStruct,\n} from '../types';\n\n/**\n * A struct for validating Ethereum transaction data.\n *\n * This uses `type()` instead of `object()` to allow extra properties,\n * since transaction formats can vary and include additional fields.\n * The actual transaction validation is performed by the transaction library.\n */\nexport const EthTransactionDataStruct = type({\n to: optional(nullable(EthAddressStruct)),\n from: optional(EthAddressStruct),\n nonce: optional(union([string(), number()])),\n value: optional(union([string(), number()])),\n data: optional(EthBytesStruct),\n gas: optional(union([string(), number()])),\n gasLimit: optional(union([string(), number()])),\n gasPrice: optional(union([string(), number()])),\n maxFeePerGas: optional(union([string(), number()])),\n maxPriorityFeePerGas: optional(union([string(), number()])),\n accessList: optional(\n array(\n type({\n address: EthAddressStruct,\n storageKeys: array(string()),\n }),\n ),\n ),\n type: optional(union([string(), number()])),\n chainId: optional(union([string(), number()])),\n});\n\nexport type EthTransactionData = Infer<typeof EthTransactionDataStruct>;\n\n/**\n * A struct for TypedDataV1 format (legacy typed data).\n * This is an array of { type, name, value } objects.\n */\nexport const EthTypedDataV1Struct = array(\n object({\n type: string(),\n name: string(),\n value: unknown(),\n }),\n);\n\nexport type EthTypedDataV1 = Infer<typeof EthTypedDataV1Struct>;\n\n/**\n * A struct for TypedData types definition.\n * Maps type names to arrays of { name, type } definitions.\n */\nexport const EthTypedDataTypesStruct = record(\n string(),\n array(\n object({\n name: string(),\n type: string(),\n }),\n ),\n);\n\nexport type EthTypedDataTypes = Infer<typeof EthTypedDataTypesStruct>;\n\n/**\n * A struct for TypedMessage format (EIP-712 V3/V4).\n * Contains types, domain, primaryType, and message.\n */\nexport const EthTypedMessageStruct = object({\n types: EthTypedDataTypesStruct,\n primaryType: string(),\n domain: record(string(), any()),\n message: record(string(), any()),\n});\n\nexport type EthTypedMessage = Infer<typeof EthTypedMessageStruct>;\n\n/**\n * A struct for EIP-1024 encrypted data format (x25519-xsalsa20-poly1305).\n */\nexport const EthEncryptedDataStruct = object({\n version: literal('x25519-xsalsa20-poly1305'),\n nonce: string(),\n ephemPublicKey: string(),\n ciphertext: string(),\n});\n\nexport type EthEncryptedData = Infer<typeof EthEncryptedDataStruct>;\n\n/**\n * A struct for EIP-7702 authorization tuple.\n * Format: [chainId, address, nonce]\n */\nexport const EthEip7702AuthorizationStruct = tuple([\n number(), // chainId\n EthAddressStrictStruct, // address (contract to delegate to)\n number(), // nonce\n]);\n\nexport type EthEip7702Authorization = Infer<\n typeof EthEip7702AuthorizationStruct\n>;\n\n/**\n * A struct for getEncryptionPublicKey options.\n */\nexport const EthGetEncryptionPublicKeyOptionsStruct = record(\n string(),\n unknown(),\n);\n\n// ============================================================================\n// RPC Method Parameter Structs\n// ============================================================================\n\n/**\n * Parameters for `eth_signTransaction`.\n */\nexport const EthSignTransactionParamsStruct = tuple([EthTransactionDataStruct]);\n\nexport type EthSignTransactionParams = Infer<\n typeof EthSignTransactionParamsStruct\n>;\n\n/**\n * Parameters for `eth_sign`.\n */\nexport const EthSignParamsStruct = tuple([\n EthAddressStruct, // address\n EthBytesStruct, // data (hex-encoded message hash)\n]);\n\nexport type EthSignParams = Infer<typeof EthSignParamsStruct>;\n\n/**\n * Parameters for `personal_sign`.\n */\nexport const EthPersonalSignParamsStruct = union([\n tuple([EthBytesStruct]), // [data]\n tuple([EthBytesStruct, EthAddressStruct]), // [data, address]\n]);\n\nexport type EthPersonalSignParams = Infer<typeof EthPersonalSignParamsStruct>;\n\n/**\n * Parameters for `eth_signTypedData_v1`.\n */\nexport const EthSignTypedDataV1ParamsStruct = tuple([\n EthAddressStruct, // address\n EthTypedDataV1Struct, // typed data array\n]);\n\nexport type EthSignTypedDataV1Params = Infer<\n typeof EthSignTypedDataV1ParamsStruct\n>;\n\n/**\n * Parameters for `eth_signTypedData_v3` and `eth_signTypedData_v4`.\n */\nexport const EthSignTypedDataParamsStruct = tuple([\n EthAddressStruct, // address\n EthTypedMessageStruct, // typed data object\n]);\n\nexport type EthSignTypedDataParams = Infer<typeof EthSignTypedDataParamsStruct>;\n\n/**\n * Parameters for `eth_decrypt`.\n */\nexport const EthDecryptParamsStruct = tuple([EthEncryptedDataStruct]);\n\nexport type EthDecryptParams = Infer<typeof EthDecryptParamsStruct>;\n\n/**\n * Parameters for `eth_getAppKeyAddress`.\n */\nexport const EthGetAppKeyAddressParamsStruct = tuple([\n string(), // origin URL\n]);\n\nexport type EthGetAppKeyAddressParams = Infer<\n typeof EthGetAppKeyAddressParamsStruct\n>;\n\n/**\n * Parameters for `eth_signEip7702Authorization`.\n *\n * @example\n * ```ts\n * const params = [[1, '0xContractAddress', 0]];\n * ```\n */\nexport const EthSignEip7702AuthorizationParamsStruct = tuple([\n EthEip7702AuthorizationStruct,\n]);\n\nexport type EthSignEip7702AuthorizationParams = Infer<\n typeof EthSignEip7702AuthorizationParamsStruct\n>;\n\n/**\n * Parameters for `eth_getEncryptionPublicKey`.\n */\nexport const EthGetEncryptionPublicKeyParamsStruct = tuple([\n EthAddressStruct, // address\n optional(EthGetEncryptionPublicKeyOptionsStruct), // options\n]);\n"]}
@@ -1,13 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EthErc4337AccountStruct = exports.EthEoaAccountStruct = exports.EthMethod = exports.EthUint256Struct = exports.EthAddressStruct = exports.EthBytesStruct = void 0;
3
+ exports.EthErc4337AccountStruct = exports.EthEoaAccountStruct = exports.EthMethod = exports.EthUint256Struct = exports.EthAddressStrictStruct = exports.EthAddressStruct = exports.EthBytesStruct = void 0;
4
4
  const keyring_utils_1 = require("@metamask/keyring-utils");
5
5
  const superstruct_1 = require("@metamask/superstruct");
6
6
  const utils_1 = require("@metamask/utils");
7
7
  const _1 = require("./index.cjs");
8
8
  const api_1 = require("../api/index.cjs");
9
9
  exports.EthBytesStruct = (0, utils_1.definePattern)('EthBytes', /^0x[0-9a-f]*$/iu);
10
- exports.EthAddressStruct = (0, utils_1.definePattern)('EthAddress', /^0x[0-9a-f]{40}$/iu);
10
+ const ETH_ADDRESS_REGEX = /^0x[0-9a-f]{40}$/iu;
11
+ exports.EthAddressStruct = (0, utils_1.definePattern)('EthAddress', ETH_ADDRESS_REGEX);
12
+ // Stricter struct that uses `Hex` as final type.
13
+ exports.EthAddressStrictStruct = (0, utils_1.definePattern)('EthAddressStrict', ETH_ADDRESS_REGEX);
11
14
  exports.EthUint256Struct = (0, utils_1.definePattern)('EthUint256', /^0x([1-9a-f][0-9a-f]*|0)$/iu);
12
15
  /**
13
16
  * Supported Ethereum methods.
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":";;;AAAA,2DAAiD;AAEjD,uDAAwE;AACxE,2CAA0D;AAE1D,kCAA6B;AAC7B,0CAIgB;AAEH,QAAA,cAAc,GAAG,IAAA,qBAAa,EAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE9D,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAC3C,YAAY,EACZ,oBAAoB,CACrB,CAAC;AAEW,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAC3C,YAAY,EACZ,6BAA6B,CAC9B,CAAC;AAEF;;GAEG;AACH,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,0BAA0B;IAC1B,2CAA8B,CAAA;IAC9B,8BAAiB,CAAA;IACjB,oDAAuC,CAAA;IACvC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,mBAAmB;IACnB,8DAAiD,CAAA;IACjD,0DAA6C,CAAA;IAC7C,wDAA2C,CAAA;AAC7C,CAAC,EAZW,SAAS,yBAAT,SAAS,QAYpB;AAEY,QAAA,mBAAmB,GAAG,IAAA,sBAAM,EAAC;IACxC,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,C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struct';\nimport { nonempty, array, enums, literal } from '@metamask/superstruct';\nimport { definePattern, type Hex } from '@metamask/utils';\n\nimport { EthScope } from '.';\nimport {\n CaipChainIdStruct,\n EthAccountType,\n KeyringAccountStruct,\n} from '../api';\n\nexport const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);\n\nexport const EthAddressStruct = definePattern<Hex>(\n 'EthAddress',\n /^0x[0-9a-f]{40}$/iu,\n);\n\nexport const EthUint256Struct = definePattern(\n 'EthUint256',\n /^0x([1-9a-f][0-9a-f]*|0)$/iu,\n);\n\n/**\n * Supported Ethereum methods.\n */\nexport enum EthMethod {\n // General signing methods\n PersonalSign = 'personal_sign',\n Sign = 'eth_sign',\n SignTransaction = 'eth_signTransaction',\n SignTypedDataV1 = 'eth_signTypedData_v1',\n SignTypedDataV3 = 'eth_signTypedData_v3',\n SignTypedDataV4 = 'eth_signTypedData_v4',\n // ERC-4337 methods\n PrepareUserOperation = 'eth_prepareUserOperation',\n PatchUserOperation = 'eth_patchUserOperation',\n SignUserOperation = 'eth_signUserOperation',\n}\n\nexport const EthEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Eoa}`),\n\n /**\n * Account scopes (must be ['eip155:0']).\n */\n scopes: nonempty(array(literal(EthScope.Eoa))),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTransaction}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n ]),\n ),\n});\n\nexport type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;\n\nexport const EthErc4337AccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Erc4337}`),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n `${EthMethod.PrepareUserOperation}`,\n `${EthMethod.PatchUserOperation}`,\n `${EthMethod.SignUserOperation}`,\n ]),\n ),\n});\n\nexport type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":";;;AAAA,2DAAiD;AAEjD,uDAAwE;AACxE,2CAA0D;AAE1D,kCAA6B;AAC7B,0CAIgB;AAEH,QAAA,cAAc,GAAG,IAAA,qBAAa,EAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE3E,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAClC,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;AAC/E,iDAAiD;AACpC,QAAA,sBAAsB,GAAG,IAAA,qBAAa,EACjD,kBAAkB,EAClB,iBAAiB,CAClB,CAAC;AAEW,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAC3C,YAAY,EACZ,6BAA6B,CAC9B,CAAC;AAEF;;GAEG;AACH,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,0BAA0B;IAC1B,2CAA8B,CAAA;IAC9B,8BAAiB,CAAA;IACjB,oDAAuC,CAAA;IACvC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,mBAAmB;IACnB,8DAAiD,CAAA;IACjD,0DAA6C,CAAA;IAC7C,wDAA2C,CAAA;AAC7C,CAAC,EAZW,SAAS,yBAAT,SAAS,QAYpB;AAEY,QAAA,mBAAmB,GAAG,IA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G,SAAS,CAAC,kBAAkB,EAAE;QACjC,GAAG,SAAS,CAAC,iBAAiB,EAAE;KACjC,CAAC,CACH;CACF,CAAC,CAAC","sourcesContent":["import { object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nonempty, array, enums, literal } from '@metamask/superstruct';\nimport { definePattern, type Hex } from '@metamask/utils';\n\nimport { EthScope } from '.';\nimport {\n CaipChainIdStruct,\n EthAccountType,\n KeyringAccountStruct,\n} from '../api';\n\nexport const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);\n\nconst ETH_ADDRESS_REGEX = /^0x[0-9a-f]{40}$/iu;\nexport const EthAddressStruct = definePattern('EthAddress', ETH_ADDRESS_REGEX);\n// Stricter struct that uses `Hex` as final type.\nexport const EthAddressStrictStruct = definePattern<Hex>(\n 'EthAddressStrict',\n ETH_ADDRESS_REGEX,\n);\n\nexport const EthUint256Struct = definePattern(\n 'EthUint256',\n /^0x([1-9a-f][0-9a-f]*|0)$/iu,\n);\n\n/**\n * Supported Ethereum methods.\n */\nexport enum EthMethod {\n // General signing methods\n PersonalSign = 'personal_sign',\n Sign = 'eth_sign',\n SignTransaction = 'eth_signTransaction',\n SignTypedDataV1 = 'eth_signTypedData_v1',\n SignTypedDataV3 = 'eth_signTypedData_v3',\n SignTypedDataV4 = 'eth_signTypedData_v4',\n // ERC-4337 methods\n PrepareUserOperation = 'eth_prepareUserOperation',\n PatchUserOperation = 'eth_patchUserOperation',\n SignUserOperation = 'eth_signUserOperation',\n}\n\nexport const EthEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Eoa}`),\n\n /**\n * Account scopes (must be ['eip155:0']).\n */\n scopes: nonempty(array(literal(EthScope.Eoa))),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTransaction}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n ]),\n ),\n});\n\nexport type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;\n\nexport const EthErc4337AccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Erc4337}`),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n `${EthMethod.PrepareUserOperation}`,\n `${EthMethod.PatchUserOperation}`,\n `${EthMethod.SignUserOperation}`,\n ]),\n ),\n});\n\nexport type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;\n"]}
@@ -1,7 +1,8 @@
1
1
  import type { Infer } from "@metamask/superstruct";
2
2
  import { EthScope } from "./index.cjs";
3
3
  export declare const EthBytesStruct: import("@metamask/superstruct").Struct<string, null>;
4
- export declare const EthAddressStruct: import("@metamask/superstruct").Struct<`0x${string}`, null>;
4
+ export declare const EthAddressStruct: import("@metamask/superstruct").Struct<string, null>;
5
+ export declare const EthAddressStrictStruct: import("@metamask/superstruct").Struct<`0x${string}`, null>;
5
6
  export declare const EthUint256Struct: import("@metamask/superstruct").Struct<string, null>;
6
7
  /**
7
8
  * Supported Ethereum methods.
@@ -33,14 +34,14 @@ export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct
33
34
  };
34
35
  exportable?: boolean;
35
36
  };
36
- address: `0x${string}`;
37
+ address: string;
37
38
  scopes: EthScope.Eoa[];
38
39
  methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
39
40
  }, {
40
41
  /**
41
42
  * Account address.
42
43
  */
43
- address: import("@metamask/superstruct").Struct<`0x${string}`, null>;
44
+ address: import("@metamask/superstruct").Struct<string, null>;
44
45
  /**
45
46
  * Account type.
46
47
  */
@@ -92,14 +93,14 @@ export declare const EthErc4337AccountStruct: import("@metamask/superstruct").St
92
93
  };
93
94
  exportable?: boolean;
94
95
  };
95
- address: `0x${string}`;
96
+ address: string;
96
97
  scopes: `${string}:${string}`[];
97
98
  methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
98
99
  }, {
99
100
  /**
100
101
  * Account address.
101
102
  */
102
- address: import("@metamask/superstruct").Struct<`0x${string}`, null>;
103
+ address: import("@metamask/superstruct").Struct<string, null>;
103
104
  /**
104
105
  * Account type.
105
106
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,OAAO,EAAE,QAAQ,EAAE,oBAAU;AAO7B,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,6DAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;IAG9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;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M,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import type { Infer } from "@metamask/superstruct";
2
2
  import { EthScope } from "./index.mjs";
3
3
  export declare const EthBytesStruct: import("@metamask/superstruct").Struct<string, null>;
4
- export declare const EthAddressStruct: import("@metamask/superstruct").Struct<`0x${string}`, null>;
4
+ export declare const EthAddressStruct: import("@metamask/superstruct").Struct<string, null>;
5
+ export declare const EthAddressStrictStruct: import("@metamask/superstruct").Struct<`0x${string}`, null>;
5
6
  export declare const EthUint256Struct: import("@metamask/superstruct").Struct<string, null>;
6
7
  /**
7
8
  * Supported Ethereum methods.
@@ -33,14 +34,14 @@ export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct
33
34
  };
34
35
  exportable?: boolean;
35
36
  };
36
- address: `0x${string}`;
37
+ address: string;
37
38
  scopes: EthScope.Eoa[];
38
39
  methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
39
40
  }, {
40
41
  /**
41
42
  * Account address.
42
43
  */
43
- address: import("@metamask/superstruct").Struct<`0x${string}`, null>;
44
+ address: import("@metamask/superstruct").Struct<string, null>;
44
45
  /**
45
46
  * Account type.
46
47
  */
@@ -92,14 +93,14 @@ export declare const EthErc4337AccountStruct: import("@metamask/superstruct").St
92
93
  };
93
94
  exportable?: boolean;
94
95
  };
95
- address: `0x${string}`;
96
+ address: string;
96
97
  scopes: `${string}:${string}`[];
97
98
  methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
98
99
  }, {
99
100
  /**
100
101
  * Account address.
101
102
  */
102
- address: import("@metamask/superstruct").Struct<`0x${string}`, null>;
103
+ address: import("@metamask/superstruct").Struct<string, null>;
103
104
  /**
104
105
  * Account type.
105
106
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,OAAO,EAAE,QAAQ,EAAE,oBAAU;AAO7B,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,6DAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;IAG9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;EAWH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;IAGlC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;EAaH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD,OAAO,EAAE,QAAQ,EAAE,oBAAU;AAO7B,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAG3E,eAAO,MAAM,gBAAgB,sDAAiD,CAAC;AAE/E,eAAO,MAAM,sBAAsB,6DAGlC,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;IAG9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;EAWH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;IAGlC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;EAaH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -4,7 +4,10 @@ import { definePattern } from "@metamask/utils";
4
4
  import { EthScope } from "./index.mjs";
5
5
  import { CaipChainIdStruct, EthAccountType, KeyringAccountStruct } from "../api/index.mjs";
6
6
  export const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);
7
- export const EthAddressStruct = definePattern('EthAddress', /^0x[0-9a-f]{40}$/iu);
7
+ const ETH_ADDRESS_REGEX = /^0x[0-9a-f]{40}$/iu;
8
+ export const EthAddressStruct = definePattern('EthAddress', ETH_ADDRESS_REGEX);
9
+ // Stricter struct that uses `Hex` as final type.
10
+ export const EthAddressStrictStruct = definePattern('EthAddressStrict', ETH_ADDRESS_REGEX);
8
11
  export const EthUint256Struct = definePattern('EthUint256', /^0x([1-9a-f][0-9a-f]*|0)$/iu);
9
12
  /**
10
13
  * Supported Ethereum methods.
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EG;IACH,OAAO,EAAE,KAAK,CACZ,KAAK,CAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;KAC/B,CAAC,CACH;CACF,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;IAC5C,GAAG,oBAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,gBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC;IAE1C;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,KAAK,CACZ,KAAK,CAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,oBAAoB,EAAE;QACnC,GAAG,SAAS,CAAC,kBAAkB,EAAE;QACjC,GAAG,SAAS,CAAC,iBAAiB,EAAE;KACjC,CAAC,CACH;CACF,CAAC,CAAC","sourcesContent":["import { object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nonempty, array, enums, literal } from '@metamask/superstruct';\nimport { definePattern, type Hex } from '@metamask/utils';\n\nimport { EthScope } from '.';\nimport {\n CaipChainIdStruct,\n EthAccountType,\n KeyringAccountStruct,\n} from '../api';\n\nexport const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);\n\nexport const EthAddressStruct = definePattern<Hex>(\n 'EthAddress',\n /^0x[0-9a-f]{40}$/iu,\n);\n\nexport const EthUint256Struct = definePattern(\n 'EthUint256',\n /^0x([1-9a-f][0-9a-f]*|0)$/iu,\n);\n\n/**\n * Supported Ethereum methods.\n */\nexport enum EthMethod {\n // General signing methods\n PersonalSign = 'personal_sign',\n Sign = 'eth_sign',\n SignTransaction = 'eth_signTransaction',\n SignTypedDataV1 = 'eth_signTypedData_v1',\n SignTypedDataV3 = 'eth_signTypedData_v3',\n SignTypedDataV4 = 'eth_signTypedData_v4',\n // ERC-4337 methods\n PrepareUserOperation = 'eth_prepareUserOperation',\n PatchUserOperation = 'eth_patchUserOperation',\n SignUserOperation = 'eth_signUserOperation',\n}\n\nexport const EthEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Eoa}`),\n\n /**\n * Account scopes (must be ['eip155:0']).\n */\n scopes: nonempty(array(literal(EthScope.Eoa))),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTransaction}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n ]),\n ),\n});\n\nexport type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;\n\nexport const EthErc4337AccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Erc4337}`),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n `${EthMethod.PrepareUserOperation}`,\n `${EthMethod.PatchUserOperation}`,\n `${EthMethod.SignUserOperation}`,\n ]),\n ),\n});\n\nexport type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gCAAgC;AAEjD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,8BAA8B;AACxE,OAAO,EAAE,aAAa,EAAY,wBAAwB;AAE1D,OAAO,EAAE,QAAQ,EAAE,oBAAU;AAC7B,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACrB,yBAAe;AAEhB,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE3E,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;AAC/E,iDAAiD;AACjD,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CACjD,kBAAkB,EAClB,iBAAiB,CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,YAAY,EACZ,6BAA6B,CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,0BAA0B;IAC1B,2CAA8B,CAAA;IAC9B,8BAAiB,CAAA;IACjB,oDAAuC,CAAA;IACvC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,mBAAmB;IACnB,8DAAiD,CAAA;IACjD,0DAA6C,CAAA;IAC7C,wDAA2C,CAAA;AAC7C,CAAC,EAZW,SAAS,KAAT,SAAS,QAYpB;AAED,MAAM,CAAC,MAAM,m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ACjC,CAAC,CACH;CACF,CAAC,CAAC","sourcesContent":["import { object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nonempty, array, enums, literal } from '@metamask/superstruct';\nimport { definePattern, type Hex } from '@metamask/utils';\n\nimport { EthScope } from '.';\nimport {\n CaipChainIdStruct,\n EthAccountType,\n KeyringAccountStruct,\n} from '../api';\n\nexport const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);\n\nconst ETH_ADDRESS_REGEX = /^0x[0-9a-f]{40}$/iu;\nexport const EthAddressStruct = definePattern('EthAddress', ETH_ADDRESS_REGEX);\n// Stricter struct that uses `Hex` as final type.\nexport const EthAddressStrictStruct = definePattern<Hex>(\n 'EthAddressStrict',\n ETH_ADDRESS_REGEX,\n);\n\nexport const EthUint256Struct = definePattern(\n 'EthUint256',\n /^0x([1-9a-f][0-9a-f]*|0)$/iu,\n);\n\n/**\n * Supported Ethereum methods.\n */\nexport enum EthMethod {\n // General signing methods\n PersonalSign = 'personal_sign',\n Sign = 'eth_sign',\n SignTransaction = 'eth_signTransaction',\n SignTypedDataV1 = 'eth_signTypedData_v1',\n SignTypedDataV3 = 'eth_signTypedData_v3',\n SignTypedDataV4 = 'eth_signTypedData_v4',\n // ERC-4337 methods\n PrepareUserOperation = 'eth_prepareUserOperation',\n PatchUserOperation = 'eth_patchUserOperation',\n SignUserOperation = 'eth_signUserOperation',\n}\n\nexport const EthEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Eoa}`),\n\n /**\n * Account scopes (must be ['eip155:0']).\n */\n scopes: nonempty(array(literal(EthScope.Eoa))),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTransaction}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n ]),\n ),\n});\n\nexport type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;\n\nexport const EthErc4337AccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Erc4337}`),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n `${EthMethod.PrepareUserOperation}`,\n `${EthMethod.PatchUserOperation}`,\n `${EthMethod.SignUserOperation}`,\n ]),\n ),\n});\n\nexport type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;\n"]}
package/dist/events.d.cts CHANGED
@@ -412,6 +412,10 @@ export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/su
412
412
  fungible: false;
413
413
  };
414
414
  }[];
415
+ details?: {
416
+ origin?: string;
417
+ securityAlertResponse?: "Benign" | "Warning" | "Malicious";
418
+ };
415
419
  }[]>;
416
420
  };
417
421
  }, {
@@ -464,6 +468,10 @@ export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/su
464
468
  fungible: false;
465
469
  };
466
470
  }[];
471
+ details?: {
472
+ origin?: string;
473
+ securityAlertResponse?: "Benign" | "Warning" | "Malicious";
474
+ };
467
475
  }[]>;
468
476
  }, {
469
477
  /**
@@ -516,6 +524,10 @@ export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/su
516
524
  fungible: false;
517
525
  };
518
526
  }[];
527
+ details?: {
528
+ origin?: string;
529
+ securityAlertResponse?: "Benign" | "Warning" | "Malicious";
530
+ };
519
531
  }[]>, null>;
520
532
  }>;
521
533
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.c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;;;;;;;;;;;;;;;EAaL,CAAC;AACH,MAAM,MAAM,+BAA+B,GAAG,KAAK,CACjD,OAAO,qCAAqC,CAC7C,CAAC;AACF,MAAM,MAAM,sCAAsC,GAChD,+BAA+B,CAAC,QAAQ,CAAC,CAAC;AAE5C;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;QAG3C;;WAEG;;;;;;EAuBL,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAC9C,OAAO,kCAAkC,CAC1C,CAAC;AACF,MAAM,MAAM,mCAAmC,GAC7C,4BAA4B,CAAC,QAAQ,CAAC,CAAC;AAEzC;;GAEG;AAEH,KAAK,aAAa,GACd,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,4BAA4B,GAC5B,2BAA2B,GAC3B,+BAA+B,GAC/B,oBAAoB,GACpB,oBAAoB,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,KAAK,SAAS,YAAY,IAAI,OAAO,CACnE,aAAa,EAGb;IAAE,MAAM,EAAE,GAAG,KAAK,EAAE,CAAA;CAAE,CACvB,CAAC,QAAQ,CAAC,CAAC"}
package/dist/events.d.mts CHANGED
@@ -412,6 +412,10 @@ export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/su
412
412
  fungible: false;
413
413
  };
414
414
  }[];
415
+ details?: {
416
+ origin?: string;
417
+ securityAlertResponse?: "Benign" | "Warning" | "Malicious";
418
+ };
415
419
  }[]>;
416
420
  };
417
421
  }, {
@@ -464,6 +468,10 @@ export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/su
464
468
  fungible: false;
465
469
  };
466
470
  }[];
471
+ details?: {
472
+ origin?: string;
473
+ securityAlertResponse?: "Benign" | "Warning" | "Malicious";
474
+ };
467
475
  }[]>;
468
476
  }, {
469
477
  /**
@@ -516,6 +524,10 @@ export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/su
516
524
  fungible: false;
517
525
  };
518
526
  }[];
527
+ details?: {
528
+ origin?: string;
529
+ securityAlertResponse?: "Benign" | "Warning" | "Malicious";
530
+ };
519
531
  }[]>, null>;
520
532
  }>;
521
533
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.mts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAenD;;GAEG;AACH,oBAAY,YAAY;IAEtB,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IAGxC,eAAe,2BAA2B;IAC1C,eAAe,2BAA2B;IAG1C,sBAAsB,kCAAkC;IACxD,uBAAuB,mCAAmC;IAC1D,0BAA0B,sCAAsC;CACjE;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAGlC;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAGH;;;;;;WAMG;;QAGH;;;;WAIG;;QAGH;;;;;;;WAOG;;;EAQL,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC1E,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAEvE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAGlC;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGL,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC1E,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAEvE,eAAO,MAAM,yBAAyB;;;;;;;;;;QAGlC;;WAEG;;;EAGL,CAAC;AACH,MAAM,MAAM,mBAAmB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