@metamask/keyring-api 1.0.0 → 2.0.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 (55) hide show
  1. package/CHANGELOG.md +43 -1
  2. package/README.md +38 -34
  3. package/dist/KeyringClient.js +13 -13
  4. package/dist/KeyringClient.js.map +1 -1
  5. package/dist/KeyringSnapControllerClient.d.ts +3 -2
  6. package/dist/KeyringSnapControllerClient.js.map +1 -1
  7. package/dist/api.d.ts +13 -7
  8. package/dist/api.js +10 -2
  9. package/dist/api.js.map +1 -1
  10. package/dist/eth/erc4337/index.d.ts +1 -0
  11. package/dist/eth/erc4337/index.js +18 -0
  12. package/dist/eth/erc4337/index.js.map +1 -0
  13. package/dist/eth/erc4337/types.d.ts +90 -0
  14. package/dist/eth/erc4337/types.js +58 -0
  15. package/dist/eth/erc4337/types.js.map +1 -0
  16. package/dist/eth/index.d.ts +2 -0
  17. package/dist/eth/index.js +19 -0
  18. package/dist/eth/index.js.map +1 -0
  19. package/dist/eth/types.d.ts +3 -0
  20. package/dist/eth/types.js +8 -0
  21. package/dist/eth/types.js.map +1 -0
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.js +1 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/internal/api.d.ts +62 -50
  26. package/dist/internal/api.js +8 -8
  27. package/dist/internal/api.js.map +1 -1
  28. package/dist/internal/eth/EthKeyring.d.ts +29 -0
  29. package/dist/internal/eth/EthKeyring.js +3 -0
  30. package/dist/internal/eth/EthKeyring.js.map +1 -0
  31. package/dist/internal/eth/index.d.ts +1 -0
  32. package/dist/internal/eth/index.js +18 -0
  33. package/dist/internal/eth/index.js.map +1 -0
  34. package/dist/internal/events.d.ts +30 -20
  35. package/dist/internal/index.d.ts +2 -0
  36. package/dist/internal/index.js +2 -0
  37. package/dist/internal/index.js.map +1 -1
  38. package/dist/internal/rpc.d.ts +24 -0
  39. package/dist/internal/rpc.js +32 -0
  40. package/dist/internal/rpc.js.map +1 -0
  41. package/dist/internal/types.d.ts +8 -5
  42. package/dist/rpc-handler.d.ts +0 -21
  43. package/dist/rpc-handler.js +14 -38
  44. package/dist/rpc-handler.js.map +1 -1
  45. package/dist/snap-utils.d.ts +2 -2
  46. package/dist/snap-utils.js.map +1 -1
  47. package/dist/superstruct.d.ts +14 -0
  48. package/dist/superstruct.js +18 -1
  49. package/dist/superstruct.js.map +1 -1
  50. package/dist/utils.js +2 -1
  51. package/dist/utils.js.map +1 -1
  52. package/package.json +7 -7
  53. package/dist/superstruct.test-d.d.ts +0 -1
  54. package/dist/superstruct.test-d.js +0 -17
  55. package/dist/superstruct.test-d.js.map +0 -1
@@ -0,0 +1,90 @@
1
+ import { type Infer } from 'superstruct';
2
+ /**
3
+ * Struct of a UserOperation as defined by ERC-4337.
4
+ * @see https://eips.ethereum.org/EIPS/eip-4337#definitions
5
+ */
6
+ export declare const EthUserOperationStruct: import("superstruct").Struct<{
7
+ sender: string;
8
+ nonce: string;
9
+ initCode: string;
10
+ callData: string;
11
+ callGasLimit: string;
12
+ verificationGasLimit: string;
13
+ preVerificationGas: string;
14
+ maxFeePerGas: string;
15
+ maxPriorityFeePerGas: string;
16
+ paymasterAndData: string;
17
+ signature: string;
18
+ }, {
19
+ sender: import("superstruct").Struct<string, null>;
20
+ nonce: import("superstruct").Struct<string, null>;
21
+ initCode: import("superstruct").Struct<string, null>;
22
+ callData: import("superstruct").Struct<string, null>;
23
+ callGasLimit: import("superstruct").Struct<string, null>;
24
+ verificationGasLimit: import("superstruct").Struct<string, null>;
25
+ preVerificationGas: import("superstruct").Struct<string, null>;
26
+ maxFeePerGas: import("superstruct").Struct<string, null>;
27
+ maxPriorityFeePerGas: import("superstruct").Struct<string, null>;
28
+ paymasterAndData: import("superstruct").Struct<string, null>;
29
+ signature: import("superstruct").Struct<string, null>;
30
+ }>;
31
+ export declare type EthUserOperation = Infer<typeof EthUserOperationStruct>;
32
+ /**
33
+ * Struct containing the most basic transaction information required to
34
+ * construct a UserOperation.
35
+ */
36
+ export declare const EthBaseTransactionStruct: import("superstruct").Struct<{
37
+ value: string;
38
+ data: string;
39
+ to: string;
40
+ }, {
41
+ /**
42
+ * Address of the transaction recipient.
43
+ */
44
+ to: import("superstruct").Struct<string, null>;
45
+ /**
46
+ * Amount of wei to transfer to the recipient.
47
+ */
48
+ value: import("superstruct").Struct<string, null>;
49
+ /**
50
+ * Data to pass to the recipient.
51
+ */
52
+ data: import("superstruct").Struct<string, null>;
53
+ }>;
54
+ export declare type EthBaseTransaction = Infer<typeof EthBaseTransactionStruct>;
55
+ export declare const EthBaseUserOperationStruct: import("superstruct").Struct<{
56
+ nonce: string;
57
+ initCode: string;
58
+ callData: string;
59
+ dummyPaymasterAndData: string;
60
+ dummySignature: string;
61
+ bundlerUrl: string;
62
+ gasLimits?: {
63
+ callGasLimit: string;
64
+ verificationGasLimit: string;
65
+ preVerificationGas: string;
66
+ };
67
+ }, {
68
+ nonce: import("superstruct").Struct<string, null>;
69
+ initCode: import("superstruct").Struct<string, null>;
70
+ callData: import("superstruct").Struct<string, null>;
71
+ gasLimits: import("superstruct").Struct<import("../../superstruct").ExactOptionalTag | {
72
+ callGasLimit: string;
73
+ verificationGasLimit: string;
74
+ preVerificationGas: string;
75
+ }, {
76
+ callGasLimit: import("superstruct").Struct<string, null>;
77
+ verificationGasLimit: import("superstruct").Struct<string, null>;
78
+ preVerificationGas: import("superstruct").Struct<string, null>;
79
+ }>;
80
+ dummyPaymasterAndData: import("superstruct").Struct<string, null>;
81
+ dummySignature: import("superstruct").Struct<string, null>;
82
+ bundlerUrl: import("superstruct").Struct<string, null>;
83
+ }>;
84
+ export declare type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>;
85
+ export declare const EthUserOperationPatchStruct: import("superstruct").Struct<{
86
+ paymasterAndData: string;
87
+ }, {
88
+ paymasterAndData: import("superstruct").Struct<string, null>;
89
+ }>;
90
+ export declare type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EthUserOperationPatchStruct = exports.EthBaseUserOperationStruct = exports.EthBaseTransactionStruct = exports.EthUserOperationStruct = void 0;
4
+ const superstruct_1 = require("superstruct");
5
+ const superstruct_2 = require("../../superstruct");
6
+ const types_1 = require("../types");
7
+ /**
8
+ * Struct of a UserOperation as defined by ERC-4337.
9
+ * @see https://eips.ethereum.org/EIPS/eip-4337#definitions
10
+ */
11
+ exports.EthUserOperationStruct = (0, superstruct_2.object)({
12
+ sender: types_1.EthAddressStruct,
13
+ nonce: types_1.EthUint256Struct,
14
+ initCode: types_1.EthBytesStruct,
15
+ callData: types_1.EthBytesStruct,
16
+ callGasLimit: types_1.EthUint256Struct,
17
+ verificationGasLimit: types_1.EthUint256Struct,
18
+ preVerificationGas: types_1.EthUint256Struct,
19
+ maxFeePerGas: types_1.EthUint256Struct,
20
+ maxPriorityFeePerGas: types_1.EthUint256Struct,
21
+ paymasterAndData: types_1.EthBytesStruct,
22
+ signature: types_1.EthBytesStruct,
23
+ });
24
+ /**
25
+ * Struct containing the most basic transaction information required to
26
+ * construct a UserOperation.
27
+ */
28
+ exports.EthBaseTransactionStruct = (0, superstruct_2.object)({
29
+ /**
30
+ * Address of the transaction recipient.
31
+ */
32
+ to: types_1.EthAddressStruct,
33
+ /**
34
+ * Amount of wei to transfer to the recipient.
35
+ */
36
+ value: types_1.EthUint256Struct,
37
+ /**
38
+ * Data to pass to the recipient.
39
+ */
40
+ data: types_1.EthBytesStruct,
41
+ });
42
+ exports.EthBaseUserOperationStruct = (0, superstruct_2.object)({
43
+ nonce: types_1.EthUint256Struct,
44
+ initCode: types_1.EthBytesStruct,
45
+ callData: types_1.EthBytesStruct,
46
+ gasLimits: (0, superstruct_2.exactOptional)((0, superstruct_2.object)({
47
+ callGasLimit: types_1.EthUint256Struct,
48
+ verificationGasLimit: types_1.EthUint256Struct,
49
+ preVerificationGas: types_1.EthUint256Struct,
50
+ })),
51
+ dummyPaymasterAndData: types_1.EthBytesStruct,
52
+ dummySignature: types_1.EthBytesStruct,
53
+ bundlerUrl: (0, superstruct_1.string)(),
54
+ });
55
+ exports.EthUserOperationPatchStruct = (0, superstruct_2.object)({
56
+ paymasterAndData: types_1.EthBytesStruct,
57
+ });
58
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":";;;AAAA,6CAAiD;AAEjD,mDAA0D;AAC1D,oCAA8E;AAE9E;;;GAGG;AACU,QAAA,sBAAsB,GAAG,IAAA,oBAAM,EAAC;IAC3C,MAAM,EAAE,wBAAgB;IACxB,KAAK,EAAE,wBAAgB;IACvB,QAAQ,EAAE,sBAAc;IACxB,QAAQ,EAAE,sBAAc;IACxB,YAAY,EAAE,wBAAgB;IAC9B,oBAAoB,EAAE,wBAAgB;IACtC,kBAAkB,EAAE,wBAAgB;IACpC,YAAY,EAAE,wBAAgB;IAC9B,oBAAoB,EAAE,wBAAgB;IACtC,gBAAgB,EAAE,sBAAc;IAChC,SAAS,EAAE,sBAAc;CAC1B,CAAC,CAAC;AAIH;;;GAGG;AACU,QAAA,wBAAwB,GAAG,IAAA,oBAAM,EAAC;IAC7C;;OAEG;IACH,EAAE,EAAE,wBAAgB;IAEpB;;OAEG;IACH,KAAK,EAAE,wBAAgB;IAEvB;;OAEG;IACH,IAAI,EAAE,sBAAc;CACrB,CAAC,CAAC;AAIU,QAAA,0BAA0B,GAAG,IAAA,oBAAM,EAAC;IAC/C,KAAK,EAAE,wBAAgB;IACvB,QAAQ,EAAE,sBAAc;IACxB,QAAQ,EAAE,sBAAc;IACxB,SAAS,EAAE,IAAA,2BAAa,EACtB,IAAA,oBAAM,EAAC;QACL,YAAY,EAAE,wBAAgB;QAC9B,oBAAoB,EAAE,wBAAgB;QACtC,kBAAkB,EAAE,wBAAgB;KACrC,CAAC,CACH;IACD,qBAAqB,EAAE,sBAAc;IACrC,cAAc,EAAE,sBAAc;IAC9B,UAAU,EAAE,IAAA,oBAAM,GAAE;CACrB,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,IAAA,oBAAM,EAAC;IAChD,gBAAgB,EAAE,sBAAc;CACjC,CAAC,CAAC","sourcesContent":["import { string, type Infer } from 'superstruct';\n\nimport { exactOptional, object } from '../../superstruct';\nimport { EthAddressStruct, EthBytesStruct, EthUint256Struct } from '../types';\n\n/**\n * Struct of a UserOperation as defined by ERC-4337.\n * @see https://eips.ethereum.org/EIPS/eip-4337#definitions\n */\nexport const EthUserOperationStruct = object({\n sender: EthAddressStruct,\n nonce: EthUint256Struct,\n initCode: EthBytesStruct,\n callData: EthBytesStruct,\n callGasLimit: EthUint256Struct,\n verificationGasLimit: EthUint256Struct,\n preVerificationGas: EthUint256Struct,\n maxFeePerGas: EthUint256Struct,\n maxPriorityFeePerGas: EthUint256Struct,\n paymasterAndData: EthBytesStruct,\n signature: EthBytesStruct,\n});\n\nexport type EthUserOperation = Infer<typeof EthUserOperationStruct>;\n\n/**\n * Struct containing the most basic transaction information required to\n * construct a UserOperation.\n */\nexport const EthBaseTransactionStruct = object({\n /**\n * Address of the transaction recipient.\n */\n to: EthAddressStruct,\n\n /**\n * Amount of wei to transfer to the recipient.\n */\n value: EthUint256Struct,\n\n /**\n * Data to pass to the recipient.\n */\n data: EthBytesStruct,\n});\n\nexport type EthBaseTransaction = Infer<typeof EthBaseTransactionStruct>;\n\nexport const EthBaseUserOperationStruct = object({\n nonce: EthUint256Struct,\n initCode: EthBytesStruct,\n callData: EthBytesStruct,\n gasLimits: exactOptional(\n object({\n callGasLimit: EthUint256Struct,\n verificationGasLimit: EthUint256Struct,\n preVerificationGas: EthUint256Struct,\n }),\n ),\n dummyPaymasterAndData: EthBytesStruct,\n dummySignature: EthBytesStruct,\n bundlerUrl: string(),\n});\n\nexport type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>;\n\nexport const EthUserOperationPatchStruct = object({\n paymasterAndData: EthBytesStruct,\n});\n\nexport type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './erc4337';
2
+ export * from './types';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./erc4337"), exports);
18
+ __exportStar(require("./types"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,0CAAwB","sourcesContent":["export * from './erc4337';\nexport * from './types';\n"]}
@@ -0,0 +1,3 @@
1
+ export declare const EthBytesStruct: import("superstruct").Struct<string, null>;
2
+ export declare const EthAddressStruct: import("superstruct").Struct<string, null>;
3
+ export declare const EthUint256Struct: import("superstruct").Struct<string, null>;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EthUint256Struct = exports.EthAddressStruct = exports.EthBytesStruct = void 0;
4
+ const superstruct_1 = require("../superstruct");
5
+ exports.EthBytesStruct = (0, superstruct_1.definePattern)('EthBytes', /^0x[0-9a-f]*$/iu);
6
+ exports.EthAddressStruct = (0, superstruct_1.definePattern)('EthAddress', /^0x[0-9a-f]{40}$/iu);
7
+ exports.EthUint256Struct = (0, superstruct_1.definePattern)('EthUint256', /^0x([1-9a-f][0-9a-f]*|0)$/iu);
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":";;;AAAA,gDAA+C;AAElC,QAAA,cAAc,GAAG,IAAA,2BAAa,EAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE9D,QAAA,gBAAgB,GAAG,IAAA,2BAAa,EAC3C,YAAY,EACZ,oBAAoB,CACrB,CAAC;AAEW,QAAA,gBAAgB,GAAG,IAAA,2BAAa,EAC3C,YAAY,EACZ,6BAA6B,CAC9B,CAAC","sourcesContent":["import { definePattern } from '../superstruct';\n\nexport const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);\n\nexport const EthAddressStruct = definePattern(\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"]}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './api';
2
+ export * from './eth';
2
3
  export * from './events';
3
4
  export * from './internal';
4
5
  export * from './KeyringClient';
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./api"), exports);
18
+ __exportStar(require("./eth"), exports);
18
19
  __exportStar(require("./events"), exports);
19
20
  __exportStar(require("./internal"), exports);
20
21
  __exportStar(require("./KeyringClient"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,2CAAyB;AACzB,6CAA2B;AAC3B,kDAAgC;AAChC,gEAA8C;AAC9C,yDAAuC;AACvC,gDAA8B;AAC9B,+CAA6B;AAC7B,gDAA8B","sourcesContent":["export * from './api';\nexport * from './events';\nexport * from './internal';\nexport * from './KeyringClient';\nexport * from './KeyringSnapControllerClient';\nexport * from './KeyringSnapRpcClient';\nexport * from './rpc-handler';\nexport * from './snap-utils';\nexport * from './superstruct';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,wCAAsB;AACtB,2CAAyB;AACzB,6CAA2B;AAC3B,kDAAgC;AAChC,gEAA8C;AAC9C,yDAAuC;AACvC,gDAA8B;AAC9B,+CAA6B;AAC7B,gDAA8B","sourcesContent":["export * from './api';\nexport * from './eth';\nexport * from './events';\nexport * from './internal';\nexport * from './KeyringClient';\nexport * from './KeyringSnapControllerClient';\nexport * from './KeyringSnapRpcClient';\nexport * from './rpc-handler';\nexport * from './snap-utils';\nexport * from './superstruct';\n"]}
@@ -1,47 +1,50 @@
1
1
  import type { Infer } from 'superstruct';
2
2
  export declare const ListAccountsRequestStruct: import("superstruct").Struct<{
3
3
  jsonrpc: "2.0";
4
- id: string;
4
+ id: string | number | null;
5
5
  method: "keyring_listAccounts";
6
6
  }, {
7
7
  method: import("superstruct").Struct<"keyring_listAccounts", "keyring_listAccounts">;
8
8
  jsonrpc: import("superstruct").Struct<"2.0", "2.0">;
9
- id: import("superstruct").Struct<string, null>;
9
+ id: import("superstruct").Struct<string | number | null, null>;
10
10
  }>;
11
11
  export declare type ListAccountsRequest = Infer<typeof ListAccountsRequestStruct>;
12
12
  export declare const ListAccountsResponseStruct: import("superstruct").Struct<{
13
- type: "eip155:eoa" | "eip155:eip4337";
13
+ type: "eip155:eoa" | "eip155:erc4337";
14
14
  id: string;
15
15
  address: string;
16
16
  options: Record<string, import("@metamask/utils").Json>;
17
- methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
17
+ methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
18
18
  }[], import("superstruct").Struct<{
19
- type: "eip155:eoa" | "eip155:eip4337";
19
+ type: "eip155:eoa" | "eip155:erc4337";
20
20
  id: string;
21
21
  address: string;
22
22
  options: Record<string, import("@metamask/utils").Json>;
23
- methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
23
+ methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
24
24
  }, {
25
25
  id: import("superstruct").Struct<string, null>;
26
26
  address: import("superstruct").Struct<string, null>;
27
27
  options: import("superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
28
- methods: import("superstruct").Struct<("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[], import("superstruct").Struct<"personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4", {
28
+ methods: import("superstruct").Struct<("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[], import("superstruct").Struct<"personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation", {
29
29
  personal_sign: "personal_sign";
30
30
  eth_sign: "eth_sign";
31
31
  eth_signTransaction: "eth_signTransaction";
32
32
  eth_signTypedData_v1: "eth_signTypedData_v1";
33
33
  eth_signTypedData_v3: "eth_signTypedData_v3";
34
34
  eth_signTypedData_v4: "eth_signTypedData_v4";
35
+ eth_prepareUserOperation: "eth_prepareUserOperation";
36
+ eth_patchUserOperation: "eth_patchUserOperation";
37
+ eth_signUserOperation: "eth_signUserOperation";
35
38
  }>>;
36
- type: import("superstruct").Struct<"eip155:eoa" | "eip155:eip4337", {
39
+ type: import("superstruct").Struct<"eip155:eoa" | "eip155:erc4337", {
37
40
  "eip155:eoa": "eip155:eoa";
38
- "eip155:eip4337": "eip155:eip4337";
41
+ "eip155:erc4337": "eip155:erc4337";
39
42
  }>;
40
43
  }>>;
41
44
  export declare type ListAccountsResponse = Infer<typeof ListAccountsResponseStruct>;
42
45
  export declare const GetAccountRequestStruct: import("superstruct").Struct<{
43
46
  jsonrpc: "2.0";
44
- id: string;
47
+ id: string | number | null;
45
48
  method: "keyring_getAccount";
46
49
  params: {
47
50
  id: string;
@@ -54,36 +57,39 @@ export declare const GetAccountRequestStruct: import("superstruct").Struct<{
54
57
  id: import("superstruct").Struct<string, null>;
55
58
  }>;
56
59
  jsonrpc: import("superstruct").Struct<"2.0", "2.0">;
57
- id: import("superstruct").Struct<string, null>;
60
+ id: import("superstruct").Struct<string | number | null, null>;
58
61
  }>;
59
62
  export declare type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;
60
63
  export declare const GetAccountResponseStruct: import("superstruct").Struct<{
61
- type: "eip155:eoa" | "eip155:eip4337";
64
+ type: "eip155:eoa" | "eip155:erc4337";
62
65
  id: string;
63
66
  address: string;
64
67
  options: Record<string, import("@metamask/utils").Json>;
65
- methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
68
+ methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
66
69
  }, {
67
70
  id: import("superstruct").Struct<string, null>;
68
71
  address: import("superstruct").Struct<string, null>;
69
72
  options: import("superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
70
- methods: import("superstruct").Struct<("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[], import("superstruct").Struct<"personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4", {
73
+ methods: import("superstruct").Struct<("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[], import("superstruct").Struct<"personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation", {
71
74
  personal_sign: "personal_sign";
72
75
  eth_sign: "eth_sign";
73
76
  eth_signTransaction: "eth_signTransaction";
74
77
  eth_signTypedData_v1: "eth_signTypedData_v1";
75
78
  eth_signTypedData_v3: "eth_signTypedData_v3";
76
79
  eth_signTypedData_v4: "eth_signTypedData_v4";
80
+ eth_prepareUserOperation: "eth_prepareUserOperation";
81
+ eth_patchUserOperation: "eth_patchUserOperation";
82
+ eth_signUserOperation: "eth_signUserOperation";
77
83
  }>>;
78
- type: import("superstruct").Struct<"eip155:eoa" | "eip155:eip4337", {
84
+ type: import("superstruct").Struct<"eip155:eoa" | "eip155:erc4337", {
79
85
  "eip155:eoa": "eip155:eoa";
80
- "eip155:eip4337": "eip155:eip4337";
86
+ "eip155:erc4337": "eip155:erc4337";
81
87
  }>;
82
88
  }>;
83
89
  export declare type GetAccountResponse = Infer<typeof GetAccountResponseStruct>;
84
90
  export declare const CreateAccountRequestStruct: import("superstruct").Struct<{
85
91
  jsonrpc: "2.0";
86
- id: string;
92
+ id: string | number | null;
87
93
  method: "keyring_createAccount";
88
94
  params: {
89
95
  options: Record<string, import("@metamask/utils").Json>;
@@ -96,36 +102,39 @@ export declare const CreateAccountRequestStruct: import("superstruct").Struct<{
96
102
  options: import("superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
97
103
  }>;
98
104
  jsonrpc: import("superstruct").Struct<"2.0", "2.0">;
99
- id: import("superstruct").Struct<string, null>;
105
+ id: import("superstruct").Struct<string | number | null, null>;
100
106
  }>;
101
107
  export declare type CreateAccountRequest = Infer<typeof CreateAccountRequestStruct>;
102
108
  export declare const CreateAccountResponseStruct: import("superstruct").Struct<{
103
- type: "eip155:eoa" | "eip155:eip4337";
109
+ type: "eip155:eoa" | "eip155:erc4337";
104
110
  id: string;
105
111
  address: string;
106
112
  options: Record<string, import("@metamask/utils").Json>;
107
- methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
113
+ methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
108
114
  }, {
109
115
  id: import("superstruct").Struct<string, null>;
110
116
  address: import("superstruct").Struct<string, null>;
111
117
  options: import("superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
112
- methods: import("superstruct").Struct<("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[], import("superstruct").Struct<"personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4", {
118
+ methods: import("superstruct").Struct<("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[], import("superstruct").Struct<"personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation", {
113
119
  personal_sign: "personal_sign";
114
120
  eth_sign: "eth_sign";
115
121
  eth_signTransaction: "eth_signTransaction";
116
122
  eth_signTypedData_v1: "eth_signTypedData_v1";
117
123
  eth_signTypedData_v3: "eth_signTypedData_v3";
118
124
  eth_signTypedData_v4: "eth_signTypedData_v4";
125
+ eth_prepareUserOperation: "eth_prepareUserOperation";
126
+ eth_patchUserOperation: "eth_patchUserOperation";
127
+ eth_signUserOperation: "eth_signUserOperation";
119
128
  }>>;
120
- type: import("superstruct").Struct<"eip155:eoa" | "eip155:eip4337", {
129
+ type: import("superstruct").Struct<"eip155:eoa" | "eip155:erc4337", {
121
130
  "eip155:eoa": "eip155:eoa";
122
- "eip155:eip4337": "eip155:eip4337";
131
+ "eip155:erc4337": "eip155:erc4337";
123
132
  }>;
124
133
  }>;
125
134
  export declare type CreateAccountResponse = Infer<typeof CreateAccountResponseStruct>;
126
135
  export declare const FilterAccountChainsStruct: import("superstruct").Struct<{
127
136
  jsonrpc: "2.0";
128
- id: string;
137
+ id: string | number | null;
129
138
  method: "keyring_filterAccountChains";
130
139
  params: {
131
140
  id: string;
@@ -141,68 +150,71 @@ export declare const FilterAccountChainsStruct: import("superstruct").Struct<{
141
150
  chains: import("superstruct").Struct<string[], import("superstruct").Struct<string, null>>;
142
151
  }>;
143
152
  jsonrpc: import("superstruct").Struct<"2.0", "2.0">;
144
- id: import("superstruct").Struct<string, null>;
153
+ id: import("superstruct").Struct<string | number | null, null>;
145
154
  }>;
146
155
  export declare type FilterAccountChainsRequest = Infer<typeof FilterAccountChainsStruct>;
147
156
  export declare const FilterAccountChainsResponseStruct: import("superstruct").Struct<string[], import("superstruct").Struct<string, null>>;
148
157
  export declare type FilterAccountChainsResponse = Infer<typeof FilterAccountChainsResponseStruct>;
149
158
  export declare const UpdateAccountRequestStruct: import("superstruct").Struct<{
150
159
  jsonrpc: "2.0";
151
- id: string;
160
+ id: string | number | null;
152
161
  method: "keyring_updateAccount";
153
162
  params: {
154
163
  account: {
155
- type: "eip155:eoa" | "eip155:eip4337";
164
+ type: "eip155:eoa" | "eip155:erc4337";
156
165
  id: string;
157
166
  address: string;
158
167
  options: Record<string, import("@metamask/utils").Json>;
159
- methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
168
+ methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
160
169
  };
161
170
  };
162
171
  }, {
163
172
  method: import("superstruct").Struct<"keyring_updateAccount", "keyring_updateAccount">;
164
173
  params: import("superstruct").Struct<{
165
174
  account: {
166
- type: "eip155:eoa" | "eip155:eip4337";
175
+ type: "eip155:eoa" | "eip155:erc4337";
167
176
  id: string;
168
177
  address: string;
169
178
  options: Record<string, import("@metamask/utils").Json>;
170
- methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
179
+ methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
171
180
  };
172
181
  }, {
173
182
  account: import("superstruct").Struct<{
174
- type: "eip155:eoa" | "eip155:eip4337";
183
+ type: "eip155:eoa" | "eip155:erc4337";
175
184
  id: string;
176
185
  address: string;
177
186
  options: Record<string, import("@metamask/utils").Json>;
178
- methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
187
+ methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
179
188
  }, {
180
189
  id: import("superstruct").Struct<string, null>;
181
190
  address: import("superstruct").Struct<string, null>;
182
191
  options: import("superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
183
- methods: import("superstruct").Struct<("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[], import("superstruct").Struct<"personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4", {
192
+ methods: import("superstruct").Struct<("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[], import("superstruct").Struct<"personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation", {
184
193
  personal_sign: "personal_sign";
185
194
  eth_sign: "eth_sign";
186
195
  eth_signTransaction: "eth_signTransaction";
187
196
  eth_signTypedData_v1: "eth_signTypedData_v1";
188
197
  eth_signTypedData_v3: "eth_signTypedData_v3";
189
198
  eth_signTypedData_v4: "eth_signTypedData_v4";
199
+ eth_prepareUserOperation: "eth_prepareUserOperation";
200
+ eth_patchUserOperation: "eth_patchUserOperation";
201
+ eth_signUserOperation: "eth_signUserOperation";
190
202
  }>>;
191
- type: import("superstruct").Struct<"eip155:eoa" | "eip155:eip4337", {
203
+ type: import("superstruct").Struct<"eip155:eoa" | "eip155:erc4337", {
192
204
  "eip155:eoa": "eip155:eoa";
193
- "eip155:eip4337": "eip155:eip4337";
205
+ "eip155:erc4337": "eip155:erc4337";
194
206
  }>;
195
207
  }>;
196
208
  }>;
197
209
  jsonrpc: import("superstruct").Struct<"2.0", "2.0">;
198
- id: import("superstruct").Struct<string, null>;
210
+ id: import("superstruct").Struct<string | number | null, null>;
199
211
  }>;
200
212
  export declare type UpdateAccountRequest = Infer<typeof UpdateAccountRequestStruct>;
201
213
  export declare const UpdateAccountResponseStruct: import("superstruct").Struct<null, null>;
202
214
  export declare type UpdateAccountResponse = Infer<typeof UpdateAccountResponseStruct>;
203
215
  export declare const DeleteAccountRequestStruct: import("superstruct").Struct<{
204
216
  jsonrpc: "2.0";
205
- id: string;
217
+ id: string | number | null;
206
218
  method: "keyring_deleteAccount";
207
219
  params: {
208
220
  id: string;
@@ -215,14 +227,14 @@ export declare const DeleteAccountRequestStruct: import("superstruct").Struct<{
215
227
  id: import("superstruct").Struct<string, null>;
216
228
  }>;
217
229
  jsonrpc: import("superstruct").Struct<"2.0", "2.0">;
218
- id: import("superstruct").Struct<string, null>;
230
+ id: import("superstruct").Struct<string | number | null, null>;
219
231
  }>;
220
232
  export declare type DeleteAccountRequest = Infer<typeof DeleteAccountRequestStruct>;
221
233
  export declare const DeleteAccountResponseStruct: import("superstruct").Struct<null, null>;
222
234
  export declare type DeleteAccountResponse = Infer<typeof DeleteAccountResponseStruct>;
223
235
  export declare const ExportAccountRequestStruct: import("superstruct").Struct<{
224
236
  jsonrpc: "2.0";
225
- id: string;
237
+ id: string | number | null;
226
238
  method: "keyring_exportAccount";
227
239
  params: {
228
240
  id: string;
@@ -235,19 +247,19 @@ export declare const ExportAccountRequestStruct: import("superstruct").Struct<{
235
247
  id: import("superstruct").Struct<string, null>;
236
248
  }>;
237
249
  jsonrpc: import("superstruct").Struct<"2.0", "2.0">;
238
- id: import("superstruct").Struct<string, null>;
250
+ id: import("superstruct").Struct<string | number | null, null>;
239
251
  }>;
240
252
  export declare type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;
241
253
  export declare const ExportAccountResponseStruct: import("superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
242
254
  export declare type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;
243
255
  export declare const ListRequestsRequestStruct: import("superstruct").Struct<{
244
256
  jsonrpc: "2.0";
245
- id: string;
257
+ id: string | number | null;
246
258
  method: "keyring_listRequests";
247
259
  }, {
248
260
  method: import("superstruct").Struct<"keyring_listRequests", "keyring_listRequests">;
249
261
  jsonrpc: import("superstruct").Struct<"2.0", "2.0">;
250
- id: import("superstruct").Struct<string, null>;
262
+ id: import("superstruct").Struct<string | number | null, null>;
251
263
  }>;
252
264
  export declare type ListRequestsRequest = Infer<typeof ListRequestsRequestStruct>;
253
265
  export declare const ListRequestsResponseStruct: import("superstruct").Struct<{
@@ -281,7 +293,7 @@ export declare const ListRequestsResponseStruct: import("superstruct").Struct<{
281
293
  export declare type ListRequestsResponse = Infer<typeof ListRequestsResponseStruct>;
282
294
  export declare const GetRequestRequestStruct: import("superstruct").Struct<{
283
295
  jsonrpc: "2.0";
284
- id: string;
296
+ id: string | number | null;
285
297
  method: "keyring_getRequest";
286
298
  params: {
287
299
  id: string;
@@ -294,7 +306,7 @@ export declare const GetRequestRequestStruct: import("superstruct").Struct<{
294
306
  id: import("superstruct").Struct<string, null>;
295
307
  }>;
296
308
  jsonrpc: import("superstruct").Struct<"2.0", "2.0">;
297
- id: import("superstruct").Struct<string, null>;
309
+ id: import("superstruct").Struct<string | number | null, null>;
298
310
  }>;
299
311
  export declare type GetRequestRequest = Infer<typeof GetRequestRequestStruct>;
300
312
  export declare const GetRequestResponseStruct: import("superstruct").Struct<{
@@ -320,7 +332,7 @@ export declare const GetRequestResponseStruct: import("superstruct").Struct<{
320
332
  export declare type GetRequestResponse = Infer<typeof GetRequestResponseStruct>;
321
333
  export declare const SubmitRequestRequestStruct: import("superstruct").Struct<{
322
334
  jsonrpc: "2.0";
323
- id: string;
335
+ id: string | number | null;
324
336
  method: "keyring_submitRequest";
325
337
  params: {
326
338
  id: string;
@@ -354,7 +366,7 @@ export declare const SubmitRequestRequestStruct: import("superstruct").Struct<{
354
366
  }>;
355
367
  }>;
356
368
  jsonrpc: import("superstruct").Struct<"2.0", "2.0">;
357
- id: import("superstruct").Struct<string, null>;
369
+ id: import("superstruct").Struct<string | number | null, null>;
358
370
  }>;
359
371
  export declare type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;
360
372
  export declare const SubmitRequestResponseStruct: import("superstruct").Struct<{
@@ -370,7 +382,7 @@ export declare const SubmitRequestResponseStruct: import("superstruct").Struct<{
370
382
  export declare type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;
371
383
  export declare const ApproveRequestRequestStruct: import("superstruct").Struct<{
372
384
  jsonrpc: "2.0";
373
- id: string;
385
+ id: string | number | null;
374
386
  method: "keyring_approveRequest";
375
387
  params: {
376
388
  id: string;
@@ -386,14 +398,14 @@ export declare const ApproveRequestRequestStruct: import("superstruct").Struct<{
386
398
  data: import("superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
387
399
  }>;
388
400
  jsonrpc: import("superstruct").Struct<"2.0", "2.0">;
389
- id: import("superstruct").Struct<string, null>;
401
+ id: import("superstruct").Struct<string | number | null, null>;
390
402
  }>;
391
403
  export declare type ApproveRequestRequest = Infer<typeof ApproveRequestRequestStruct>;
392
404
  export declare const ApproveRequestResponseStruct: import("superstruct").Struct<null, null>;
393
405
  export declare type ApproveRequestResponse = Infer<typeof ApproveRequestResponseStruct>;
394
406
  export declare const RejectRequestRequestStruct: import("superstruct").Struct<{
395
407
  jsonrpc: "2.0";
396
- id: string;
408
+ id: string | number | null;
397
409
  method: "keyring_rejectRequest";
398
410
  params: {
399
411
  id: string;
@@ -406,7 +418,7 @@ export declare const RejectRequestRequestStruct: import("superstruct").Struct<{
406
418
  id: import("superstruct").Struct<string, null>;
407
419
  }>;
408
420
  jsonrpc: import("superstruct").Struct<"2.0", "2.0">;
409
- id: import("superstruct").Struct<string, null>;
421
+ id: import("superstruct").Struct<string | number | null, null>;
410
422
  }>;
411
423
  export declare type RejectRequestRequest = Infer<typeof RejectRequestRequestStruct>;
412
424
  export declare const RejectRequestResponseStruct: import("superstruct").Struct<null, null>;