@metamask-previews/keyring-api 8.1.0-preview-e65b905 → 8.1.3-84e4c35

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 (76) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/dist/JsonRpcRequest.d.ts +2 -2
  3. package/dist/JsonRpcRequest.js +3 -3
  4. package/dist/JsonRpcRequest.js.map +1 -1
  5. package/dist/KeyringClient.d.ts +1 -1
  6. package/dist/KeyringClient.js +10 -10
  7. package/dist/KeyringClient.js.map +1 -1
  8. package/dist/KeyringSnapRpcClient.js.map +1 -1
  9. package/dist/api/account.d.ts +3 -3
  10. package/dist/api/account.js +6 -5
  11. package/dist/api/account.js.map +1 -1
  12. package/dist/api/balance.d.ts +1 -1
  13. package/dist/api/balance.js +4 -3
  14. package/dist/api/balance.js.map +1 -1
  15. package/dist/api/caip.d.ts +2 -2
  16. package/dist/api/caip.js +3 -3
  17. package/dist/api/caip.js.map +1 -1
  18. package/dist/api/export.d.ts +1 -1
  19. package/dist/api/index.d.ts +1 -1
  20. package/dist/api/index.js +0 -1
  21. package/dist/api/index.js.map +1 -1
  22. package/dist/api/keyring.d.ts +1 -1
  23. package/dist/api/request.d.ts +2 -2
  24. package/dist/api/request.js +7 -6
  25. package/dist/api/request.js.map +1 -1
  26. package/dist/api/response.d.ts +1 -1
  27. package/dist/api/response.js +6 -6
  28. package/dist/api/response.js.map +1 -1
  29. package/dist/btc/types.d.ts +2 -2
  30. package/dist/btc/types.js +3 -3
  31. package/dist/btc/types.js.map +1 -1
  32. package/dist/contexts.d.ts +1 -1
  33. package/dist/eth/erc4337/types.d.ts +10 -9
  34. package/dist/eth/erc4337/types.js +12 -10
  35. package/dist/eth/erc4337/types.js.map +1 -1
  36. package/dist/eth/types.d.ts +4 -4
  37. package/dist/eth/types.js +7 -7
  38. package/dist/eth/types.js.map +1 -1
  39. package/dist/events.js +1 -1
  40. package/dist/events.js.map +1 -1
  41. package/dist/index.d.ts +2 -1
  42. package/dist/index.js +1 -1
  43. package/dist/index.js.map +1 -1
  44. package/dist/internal/api.d.ts +36 -36
  45. package/dist/internal/api.js +34 -33
  46. package/dist/internal/api.js.map +1 -1
  47. package/dist/internal/eth/EthKeyring.d.ts +1 -1
  48. package/dist/internal/eth/index.d.ts +1 -1
  49. package/dist/internal/eth/index.js +0 -15
  50. package/dist/internal/eth/index.js.map +1 -1
  51. package/dist/internal/events.d.ts +8 -8
  52. package/dist/internal/events.js +17 -16
  53. package/dist/internal/events.js.map +1 -1
  54. package/dist/internal/index.d.ts +1 -1
  55. package/dist/internal/index.js +0 -1
  56. package/dist/internal/index.js.map +1 -1
  57. package/dist/internal/rpc.js +1 -1
  58. package/dist/internal/rpc.js.map +1 -1
  59. package/dist/internal/types.d.ts +58 -61
  60. package/dist/internal/types.js +20 -23
  61. package/dist/internal/types.js.map +1 -1
  62. package/dist/rpc-handler.js +13 -13
  63. package/dist/rpc-handler.js.map +1 -1
  64. package/dist/superstruct.d.ts +83 -0
  65. package/dist/superstruct.js +81 -0
  66. package/dist/superstruct.js.map +1 -0
  67. package/dist/utils/index.d.ts +2 -0
  68. package/dist/utils/index.js +19 -0
  69. package/dist/utils/index.js.map +1 -0
  70. package/dist/utils/types.d.ts +17 -0
  71. package/dist/utils/types.js +29 -0
  72. package/dist/utils/types.js.map +1 -0
  73. package/dist/utils/typing.d.ts +32 -0
  74. package/dist/utils/typing.js +21 -0
  75. package/dist/utils/typing.js.map +1 -0
  76. package/package.json +16 -14
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Context used by a Keyring implementation.
3
3
  */
4
- export declare type KeyringExecutionContext = {
4
+ export type KeyringExecutionContext = {
5
5
  /** The chain ID. */
6
6
  chainId: string;
7
7
  };
@@ -1,6 +1,7 @@
1
1
  import { type Infer } from '@metamask/superstruct';
2
2
  /**
3
3
  * Struct of a UserOperation as defined by ERC-4337.
4
+ *
4
5
  * @see https://eips.ethereum.org/EIPS/eip-4337#definitions
5
6
  */
6
7
  export declare const EthUserOperationStruct: import("@metamask/superstruct").Struct<{
@@ -28,14 +29,14 @@ export declare const EthUserOperationStruct: import("@metamask/superstruct").Str
28
29
  paymasterAndData: import("@metamask/superstruct").Struct<string, null>;
29
30
  signature: import("@metamask/superstruct").Struct<string, null>;
30
31
  }>;
31
- export declare type EthUserOperation = Infer<typeof EthUserOperationStruct>;
32
+ export type EthUserOperation = Infer<typeof EthUserOperationStruct>;
32
33
  /**
33
34
  * Struct containing the most basic transaction information required to
34
35
  * construct a UserOperation.
35
36
  */
36
37
  export declare const EthBaseTransactionStruct: import("@metamask/superstruct").Struct<{
37
- data: string;
38
38
  value: string;
39
+ data: string;
39
40
  to: string;
40
41
  }, {
41
42
  /**
@@ -51,7 +52,7 @@ export declare const EthBaseTransactionStruct: import("@metamask/superstruct").S
51
52
  */
52
53
  data: import("@metamask/superstruct").Struct<string, null>;
53
54
  }>;
54
- export declare type EthBaseTransaction = Infer<typeof EthBaseTransactionStruct>;
55
+ export type EthBaseTransaction = Infer<typeof EthBaseTransactionStruct>;
55
56
  export declare const EthBaseUserOperationStruct: import("@metamask/superstruct").Struct<{
56
57
  nonce: string;
57
58
  initCode: string;
@@ -68,7 +69,7 @@ export declare const EthBaseUserOperationStruct: import("@metamask/superstruct")
68
69
  nonce: import("@metamask/superstruct").Struct<string, null>;
69
70
  initCode: import("@metamask/superstruct").Struct<string, null>;
70
71
  callData: import("@metamask/superstruct").Struct<string, null>;
71
- gasLimits: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
72
+ gasLimits: import("@metamask/superstruct").Struct<import("../../superstruct").ExactOptionalTag | {
72
73
  callGasLimit: string;
73
74
  verificationGasLimit: string;
74
75
  preVerificationGas: string;
@@ -81,7 +82,7 @@ export declare const EthBaseUserOperationStruct: import("@metamask/superstruct")
81
82
  dummySignature: import("@metamask/superstruct").Struct<string, null>;
82
83
  bundlerUrl: import("@metamask/superstruct").Struct<string, null>;
83
84
  }>;
84
- export declare type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>;
85
+ export type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>;
85
86
  export declare const EthUserOperationPatchStruct: import("@metamask/superstruct").Struct<{
86
87
  paymasterAndData: string;
87
88
  callGasLimit?: string;
@@ -89,8 +90,8 @@ export declare const EthUserOperationPatchStruct: import("@metamask/superstruct"
89
90
  preVerificationGas?: string;
90
91
  }, {
91
92
  paymasterAndData: import("@metamask/superstruct").Struct<string, null>;
92
- callGasLimit: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
93
- verificationGasLimit: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
94
- preVerificationGas: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
93
+ callGasLimit: import("@metamask/superstruct").Struct<string | import("../../superstruct").ExactOptionalTag, null>;
94
+ verificationGasLimit: import("@metamask/superstruct").Struct<string | import("../../superstruct").ExactOptionalTag, null>;
95
+ preVerificationGas: import("@metamask/superstruct").Struct<string | import("../../superstruct").ExactOptionalTag, null>;
95
96
  }>;
96
- export declare type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;
97
+ export type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EthUserOperationPatchStruct = exports.EthBaseUserOperationStruct = exports.EthBaseTransactionStruct = exports.EthUserOperationStruct = void 0;
4
- const keyring_utils_1 = require("@metamask/keyring-utils");
4
+ const superstruct_1 = require("../../superstruct");
5
+ const utils_1 = require("../../utils");
5
6
  const types_1 = require("../types");
6
7
  /**
7
8
  * Struct of a UserOperation as defined by ERC-4337.
9
+ *
8
10
  * @see https://eips.ethereum.org/EIPS/eip-4337#definitions
9
11
  */
10
- exports.EthUserOperationStruct = (0, keyring_utils_1.object)({
12
+ exports.EthUserOperationStruct = (0, superstruct_1.object)({
11
13
  sender: types_1.EthAddressStruct,
12
14
  nonce: types_1.EthUint256Struct,
13
15
  initCode: types_1.EthBytesStruct,
@@ -24,7 +26,7 @@ exports.EthUserOperationStruct = (0, keyring_utils_1.object)({
24
26
  * Struct containing the most basic transaction information required to
25
27
  * construct a UserOperation.
26
28
  */
27
- exports.EthBaseTransactionStruct = (0, keyring_utils_1.object)({
29
+ exports.EthBaseTransactionStruct = (0, superstruct_1.object)({
28
30
  /**
29
31
  * Address of the transaction recipient.
30
32
  */
@@ -38,23 +40,23 @@ exports.EthBaseTransactionStruct = (0, keyring_utils_1.object)({
38
40
  */
39
41
  data: types_1.EthBytesStruct,
40
42
  });
41
- exports.EthBaseUserOperationStruct = (0, keyring_utils_1.object)({
43
+ exports.EthBaseUserOperationStruct = (0, superstruct_1.object)({
42
44
  nonce: types_1.EthUint256Struct,
43
45
  initCode: types_1.EthBytesStruct,
44
46
  callData: types_1.EthBytesStruct,
45
- gasLimits: (0, keyring_utils_1.exactOptional)((0, keyring_utils_1.object)({
47
+ gasLimits: (0, superstruct_1.exactOptional)((0, superstruct_1.object)({
46
48
  callGasLimit: types_1.EthUint256Struct,
47
49
  verificationGasLimit: types_1.EthUint256Struct,
48
50
  preVerificationGas: types_1.EthUint256Struct,
49
51
  })),
50
52
  dummyPaymasterAndData: types_1.EthBytesStruct,
51
53
  dummySignature: types_1.EthBytesStruct,
52
- bundlerUrl: keyring_utils_1.UrlStruct,
54
+ bundlerUrl: utils_1.UrlStruct,
53
55
  });
54
- exports.EthUserOperationPatchStruct = (0, keyring_utils_1.object)({
56
+ exports.EthUserOperationPatchStruct = (0, superstruct_1.object)({
55
57
  paymasterAndData: types_1.EthBytesStruct,
56
- callGasLimit: (0, keyring_utils_1.exactOptional)(types_1.EthUint256Struct),
57
- verificationGasLimit: (0, keyring_utils_1.exactOptional)(types_1.EthUint256Struct),
58
- preVerificationGas: (0, keyring_utils_1.exactOptional)(types_1.EthUint256Struct),
58
+ callGasLimit: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct),
59
+ verificationGasLimit: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct),
60
+ preVerificationGas: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct),
59
61
  });
60
62
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":";;;AAEA,2DAA2E;AAC3E,oCAA8E;AAE9E;;;GAGG;AACU,QAAA,sBAAsB,GAAG,IAAA,sBAAM,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,sBAAM,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,sBAAM,EAAC;IAC/C,KAAK,EAAE,wBAAgB;IACvB,QAAQ,EAAE,sBAAc;IACxB,QAAQ,EAAE,sBAAc;IACxB,SAAS,EAAE,IAAA,6BAAa,EACtB,IAAA,sBAAM,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,yBAAS;CACtB,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,IAAA,sBAAM,EAAC;IAChD,gBAAgB,EAAE,sBAAc;IAChC,YAAY,EAAE,IAAA,6BAAa,EAAC,wBAAgB,CAAC;IAC7C,oBAAoB,EAAE,IAAA,6BAAa,EAAC,wBAAgB,CAAC;IACrD,kBAAkB,EAAE,IAAA,6BAAa,EAAC,wBAAgB,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import { type Infer } from '@metamask/superstruct';\n\nimport { exactOptional, object, UrlStruct } from '@metamask/keyring-utils';\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: UrlStruct,\n});\n\nexport type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>;\n\nexport const EthUserOperationPatchStruct = object({\n paymasterAndData: EthBytesStruct,\n callGasLimit: exactOptional(EthUint256Struct),\n verificationGasLimit: exactOptional(EthUint256Struct),\n preVerificationGas: exactOptional(EthUint256Struct),\n});\n\nexport type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":";;;AAEA,mDAA0D;AAC1D,uCAAwC;AACxC,oCAA8E;AAE9E;;;;GAIG;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,iBAAS;CACtB,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,IAAA,oBAAM,EAAC;IAChD,gBAAgB,EAAE,sBAAc;IAChC,YAAY,EAAE,IAAA,2BAAa,EAAC,wBAAgB,CAAC;IAC7C,oBAAoB,EAAE,IAAA,2BAAa,EAAC,wBAAgB,CAAC;IACrD,kBAAkB,EAAE,IAAA,2BAAa,EAAC,wBAAgB,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import { type Infer } from '@metamask/superstruct';\n\nimport { exactOptional, object } from '../../superstruct';\nimport { UrlStruct } from '../../utils';\nimport { EthAddressStruct, EthBytesStruct, EthUint256Struct } from '../types';\n\n/**\n * Struct of a UserOperation as defined by ERC-4337.\n *\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: UrlStruct,\n});\n\nexport type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>;\n\nexport const EthUserOperationPatchStruct = object({\n paymasterAndData: EthBytesStruct,\n callGasLimit: exactOptional(EthUint256Struct),\n verificationGasLimit: exactOptional(EthUint256Struct),\n preVerificationGas: exactOptional(EthUint256Struct),\n});\n\nexport type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;\n"]}
@@ -17,8 +17,8 @@ export declare enum EthMethod {
17
17
  SignUserOperation = "eth_signUserOperation"
18
18
  }
19
19
  export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct<{
20
- id: string;
21
20
  type: "eip155:eoa";
21
+ id: string;
22
22
  address: string;
23
23
  options: Record<string, import("@metamask/utils").Json>;
24
24
  methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
@@ -45,10 +45,10 @@ export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct
45
45
  id: import("@metamask/superstruct").Struct<string, null>;
46
46
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
47
47
  }>;
48
- export declare type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;
48
+ export type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;
49
49
  export declare const EthErc4337AccountStruct: import("@metamask/superstruct").Struct<{
50
- id: string;
51
50
  type: "eip155:erc4337";
51
+ id: string;
52
52
  address: string;
53
53
  options: Record<string, import("@metamask/utils").Json>;
54
54
  methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
@@ -77,4 +77,4 @@ export declare const EthErc4337AccountStruct: import("@metamask/superstruct").St
77
77
  id: import("@metamask/superstruct").Struct<string, null>;
78
78
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
79
79
  }>;
80
- export declare type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;
80
+ export type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;
package/dist/eth/types.js CHANGED
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EthErc4337AccountStruct = exports.EthEoaAccountStruct = exports.EthMethod = exports.EthUint256Struct = exports.EthAddressStruct = exports.EthBytesStruct = void 0;
4
4
  const superstruct_1 = require("@metamask/superstruct");
5
5
  const api_1 = require("../api");
6
- const keyring_utils_1 = require("@metamask/keyring-utils");
7
- exports.EthBytesStruct = (0, keyring_utils_1.definePattern)('EthBytes', /^0x[0-9a-f]*$/iu);
8
- exports.EthAddressStruct = (0, keyring_utils_1.definePattern)('EthAddress', /^0x[0-9a-f]{40}$/iu);
9
- exports.EthUint256Struct = (0, keyring_utils_1.definePattern)('EthUint256', /^0x([1-9a-f][0-9a-f]*|0)$/iu);
6
+ const superstruct_2 = require("../superstruct");
7
+ exports.EthBytesStruct = (0, superstruct_2.definePattern)('EthBytes', /^0x[0-9a-f]*$/iu);
8
+ exports.EthAddressStruct = (0, superstruct_2.definePattern)('EthAddress', /^0x[0-9a-f]{40}$/iu);
9
+ exports.EthUint256Struct = (0, superstruct_2.definePattern)('EthUint256', /^0x([1-9a-f][0-9a-f]*|0)$/iu);
10
10
  /**
11
11
  * Supported Ethereum methods.
12
12
  */
@@ -23,8 +23,8 @@ var EthMethod;
23
23
  EthMethod["PrepareUserOperation"] = "eth_prepareUserOperation";
24
24
  EthMethod["PatchUserOperation"] = "eth_patchUserOperation";
25
25
  EthMethod["SignUserOperation"] = "eth_signUserOperation";
26
- })(EthMethod = exports.EthMethod || (exports.EthMethod = {}));
27
- exports.EthEoaAccountStruct = (0, keyring_utils_1.object)({
26
+ })(EthMethod || (exports.EthMethod = EthMethod = {}));
27
+ exports.EthEoaAccountStruct = (0, superstruct_2.object)({
28
28
  ...api_1.KeyringAccountStruct.schema,
29
29
  /**
30
30
  * Account address.
@@ -46,7 +46,7 @@ exports.EthEoaAccountStruct = (0, keyring_utils_1.object)({
46
46
  `${EthMethod.SignTypedDataV4}`,
47
47
  ])),
48
48
  });
49
- exports.EthErc4337AccountStruct = (0, keyring_utils_1.object)({
49
+ exports.EthErc4337AccountStruct = (0, superstruct_2.object)({
50
50
  ...api_1.KeyringAccountStruct.schema,
51
51
  /**
52
52
  * Account address.
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":";;;AACA,uDAA8D;AAE9D,gCAA8D;AAC9D,2DAAgE;AAEnD,QAAA,cAAc,GAAG,IAAA,6BAAa,EAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE9D,QAAA,gBAAgB,GAAG,IAAA,6BAAa,EAC3C,YAAY,EACZ,oBAAoB,CACrB,CAAC;AAEW,QAAA,gBAAgB,GAAG,IAAA,6BAAa,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,GAAT,iBAAS,KAAT,iBAAS,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,CAAC,GAAG,EAAE,CAAC;IAEtC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EACZ,IAAA,mBAAK,EAAC;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;AAIU,QAAA,uBAAuB,GAAG,IAAA,sBAAM,EAAC;IAC5C,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,OAAO,EAAE,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EACZ,IAAA,mBAAK,EAAC;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 type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal } from '@metamask/superstruct';\n\nimport { EthAccountType, KeyringAccountStruct } from '../api';\nimport { object, definePattern } from '@metamask/keyring-utils';\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\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 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 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.js","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":";;;AACA,uDAA8D;AAE9D,gCAA8D;AAC9D,gDAAuD;AAE1C,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;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,oBAAM,EAAC;IACxC,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,GAAG,EAAE,CAAC;IAEtC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EACZ,IAAA,mBAAK,EAAC;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;AAIU,QAAA,uBAAuB,GAAG,IAAA,oBAAM,EAAC;IAC5C,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,OAAO,EAAE,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EACZ,IAAA,mBAAK,EAAC;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 type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal } from '@metamask/superstruct';\n\nimport { EthAccountType, KeyringAccountStruct } from '../api';\nimport { object, 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\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 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 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.js CHANGED
@@ -13,5 +13,5 @@ var KeyringEvent;
13
13
  // Request events
14
14
  KeyringEvent["RequestApproved"] = "notify:requestApproved";
15
15
  KeyringEvent["RequestRejected"] = "notify:requestRejected";
16
- })(KeyringEvent = exports.KeyringEvent || (exports.KeyringEvent = {}));
16
+ })(KeyringEvent || (exports.KeyringEvent = KeyringEvent = {}));
17
17
  //# sourceMappingURL=events.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,YASX;AATD,WAAY,YAAY;IACtB,iBAAiB;IACjB,wDAAwC,CAAA;IACxC,wDAAwC,CAAA;IACxC,wDAAwC,CAAA;IAExC,iBAAiB;IACjB,0DAA0C,CAAA;IAC1C,0DAA0C,CAAA;AAC5C,CAAC,EATW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QASvB","sourcesContent":["/**\n * Supported keyring events.\n */\nexport enum KeyringEvent {\n // Account events\n AccountCreated = 'notify:accountCreated',\n AccountUpdated = 'notify:accountUpdated',\n AccountDeleted = 'notify:accountDeleted',\n\n // Request events\n RequestApproved = 'notify:requestApproved',\n RequestRejected = 'notify:requestRejected',\n}\n"]}
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,YASX;AATD,WAAY,YAAY;IACtB,iBAAiB;IACjB,wDAAwC,CAAA;IACxC,wDAAwC,CAAA;IACxC,wDAAwC,CAAA;IAExC,iBAAiB;IACjB,0DAA0C,CAAA;IAC1C,0DAA0C,CAAA;AAC5C,CAAC,EATW,YAAY,4BAAZ,YAAY,QASvB","sourcesContent":["/**\n * Supported keyring events.\n */\nexport enum KeyringEvent {\n // Account events\n AccountCreated = 'notify:accountCreated',\n AccountUpdated = 'notify:accountUpdated',\n AccountDeleted = 'notify:accountDeleted',\n\n // Request events\n RequestApproved = 'notify:requestApproved',\n RequestRejected = 'notify:requestRejected',\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from './api';
2
2
  export * from './btc';
3
- export * from './contexts';
3
+ export type * from './contexts';
4
4
  export * from './eth';
5
5
  export * from './events';
6
6
  export * from './internal';
@@ -8,3 +8,4 @@ export * from './KeyringClient';
8
8
  export * from './KeyringSnapRpcClient';
9
9
  export * from './rpc-handler';
10
10
  export * from './snap-utils';
11
+ export * from './superstruct';
package/dist/index.js CHANGED
@@ -16,7 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./api"), exports);
18
18
  __exportStar(require("./btc"), exports);
19
- __exportStar(require("./contexts"), exports);
20
19
  __exportStar(require("./eth"), exports);
21
20
  __exportStar(require("./events"), exports);
22
21
  __exportStar(require("./internal"), exports);
@@ -24,4 +23,5 @@ __exportStar(require("./KeyringClient"), exports);
24
23
  __exportStar(require("./KeyringSnapRpcClient"), exports);
25
24
  __exportStar(require("./rpc-handler"), exports);
26
25
  __exportStar(require("./snap-utils"), exports);
26
+ __exportStar(require("./superstruct"), exports);
27
27
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,wCAAsB;AACtB,6CAA2B;AAC3B,wCAAsB;AACtB,2CAAyB;AACzB,6CAA2B;AAC3B,kDAAgC;AAChC,yDAAuC;AACvC,gDAA8B;AAC9B,+CAA6B","sourcesContent":["export * from './api';\nexport * from './btc';\nexport * from './contexts';\nexport * from './eth';\nexport * from './events';\nexport * from './internal';\nexport * from './KeyringClient';\nexport * from './KeyringSnapRpcClient';\nexport * from './rpc-handler';\nexport * from './snap-utils';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,wCAAsB;AAEtB,wCAAsB;AACtB,2CAAyB;AACzB,6CAA2B;AAC3B,kDAAgC;AAChC,yDAAuC;AACvC,gDAA8B;AAC9B,+CAA6B;AAC7B,gDAA8B","sourcesContent":["export * from './api';\nexport * from './btc';\nexport type * from './contexts';\nexport * from './eth';\nexport * from './events';\nexport * from './internal';\nexport * from './KeyringClient';\nexport * from './KeyringSnapRpcClient';\nexport * from './rpc-handler';\nexport * from './snap-utils';\nexport * from './superstruct';\n"]}
@@ -8,16 +8,16 @@ export declare const ListAccountsRequestStruct: import("@metamask/superstruct").
8
8
  jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
9
9
  id: import("@metamask/superstruct").Struct<string | number | null, null>;
10
10
  }>;
11
- export declare type ListAccountsRequest = Infer<typeof ListAccountsRequestStruct>;
11
+ export type ListAccountsRequest = Infer<typeof ListAccountsRequestStruct>;
12
12
  export declare const ListAccountsResponseStruct: import("@metamask/superstruct").Struct<{
13
- id: string;
14
13
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
14
+ id: string;
15
15
  address: string;
16
16
  options: Record<string, import("@metamask/utils").Json>;
17
17
  methods: string[];
18
18
  }[], import("@metamask/superstruct").Struct<{
19
- id: string;
20
19
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
20
+ id: string;
21
21
  address: string;
22
22
  options: Record<string, import("@metamask/utils").Json>;
23
23
  methods: string[];
@@ -32,7 +32,7 @@ export declare const ListAccountsResponseStruct: import("@metamask/superstruct")
32
32
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
33
33
  methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
34
34
  }>>;
35
- export declare type ListAccountsResponse = Infer<typeof ListAccountsResponseStruct>;
35
+ export type ListAccountsResponse = Infer<typeof ListAccountsResponseStruct>;
36
36
  export declare const GetAccountRequestStruct: import("@metamask/superstruct").Struct<{
37
37
  jsonrpc: "2.0";
38
38
  id: string | number | null;
@@ -50,10 +50,10 @@ export declare const GetAccountRequestStruct: import("@metamask/superstruct").St
50
50
  jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
51
51
  id: import("@metamask/superstruct").Struct<string | number | null, null>;
52
52
  }>;
53
- export declare type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;
53
+ export type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;
54
54
  export declare const GetAccountResponseStruct: import("@metamask/superstruct").Struct<{
55
- id: string;
56
55
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
56
+ id: string;
57
57
  address: string;
58
58
  options: Record<string, import("@metamask/utils").Json>;
59
59
  methods: string[];
@@ -68,7 +68,7 @@ export declare const GetAccountResponseStruct: import("@metamask/superstruct").S
68
68
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
69
69
  methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
70
70
  }>;
71
- export declare type GetAccountResponse = Infer<typeof GetAccountResponseStruct>;
71
+ export type GetAccountResponse = Infer<typeof GetAccountResponseStruct>;
72
72
  export declare const CreateAccountRequestStruct: import("@metamask/superstruct").Struct<{
73
73
  jsonrpc: "2.0";
74
74
  id: string | number | null;
@@ -86,10 +86,10 @@ export declare const CreateAccountRequestStruct: import("@metamask/superstruct")
86
86
  jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
87
87
  id: import("@metamask/superstruct").Struct<string | number | null, null>;
88
88
  }>;
89
- export declare type CreateAccountRequest = Infer<typeof CreateAccountRequestStruct>;
89
+ export type CreateAccountRequest = Infer<typeof CreateAccountRequestStruct>;
90
90
  export declare const CreateAccountResponseStruct: import("@metamask/superstruct").Struct<{
91
- id: string;
92
91
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
92
+ id: string;
93
93
  address: string;
94
94
  options: Record<string, import("@metamask/utils").Json>;
95
95
  methods: string[];
@@ -104,7 +104,7 @@ export declare const CreateAccountResponseStruct: import("@metamask/superstruct"
104
104
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
105
105
  methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
106
106
  }>;
107
- export declare type CreateAccountResponse = Infer<typeof CreateAccountResponseStruct>;
107
+ export type CreateAccountResponse = Infer<typeof CreateAccountResponseStruct>;
108
108
  export declare const GetAccountBalancesRequestStruct: import("@metamask/superstruct").Struct<{
109
109
  jsonrpc: "2.0";
110
110
  id: string | number | null;
@@ -125,12 +125,12 @@ export declare const GetAccountBalancesRequestStruct: import("@metamask/superstr
125
125
  jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
126
126
  id: import("@metamask/superstruct").Struct<string | number | null, null>;
127
127
  }>;
128
- export declare type GetAccountBalancesRequest = Infer<typeof GetAccountBalancesRequestStruct>;
128
+ export type GetAccountBalancesRequest = Infer<typeof GetAccountBalancesRequestStruct>;
129
129
  export declare const GetAccountBalancesResponseStruct: import("@metamask/superstruct").Struct<Record<string, {
130
130
  amount: string;
131
131
  unit: string;
132
132
  }>, null>;
133
- export declare type GetAccountBalancesResponse = Infer<typeof GetAccountBalancesResponseStruct>;
133
+ export type GetAccountBalancesResponse = Infer<typeof GetAccountBalancesResponseStruct>;
134
134
  export declare const FilterAccountChainsStruct: import("@metamask/superstruct").Struct<{
135
135
  jsonrpc: "2.0";
136
136
  id: string | number | null;
@@ -151,17 +151,17 @@ export declare const FilterAccountChainsStruct: import("@metamask/superstruct").
151
151
  jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
152
152
  id: import("@metamask/superstruct").Struct<string | number | null, null>;
153
153
  }>;
154
- export declare type FilterAccountChainsRequest = Infer<typeof FilterAccountChainsStruct>;
154
+ export type FilterAccountChainsRequest = Infer<typeof FilterAccountChainsStruct>;
155
155
  export declare const FilterAccountChainsResponseStruct: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
156
- export declare type FilterAccountChainsResponse = Infer<typeof FilterAccountChainsResponseStruct>;
156
+ export type FilterAccountChainsResponse = Infer<typeof FilterAccountChainsResponseStruct>;
157
157
  export declare const UpdateAccountRequestStruct: import("@metamask/superstruct").Struct<{
158
158
  jsonrpc: "2.0";
159
159
  id: string | number | null;
160
160
  method: "keyring_updateAccount";
161
161
  params: {
162
162
  account: {
163
- id: string;
164
163
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
164
+ id: string;
165
165
  address: string;
166
166
  options: Record<string, import("@metamask/utils").Json>;
167
167
  methods: string[];
@@ -171,16 +171,16 @@ export declare const UpdateAccountRequestStruct: import("@metamask/superstruct")
171
171
  method: import("@metamask/superstruct").Struct<"keyring_updateAccount", "keyring_updateAccount">;
172
172
  params: import("@metamask/superstruct").Struct<{
173
173
  account: {
174
- id: string;
175
174
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
175
+ id: string;
176
176
  address: string;
177
177
  options: Record<string, import("@metamask/utils").Json>;
178
178
  methods: string[];
179
179
  };
180
180
  }, {
181
181
  account: import("@metamask/superstruct").Struct<{
182
- id: string;
183
182
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh";
183
+ id: string;
184
184
  address: string;
185
185
  options: Record<string, import("@metamask/utils").Json>;
186
186
  methods: string[];
@@ -199,9 +199,9 @@ export declare const UpdateAccountRequestStruct: import("@metamask/superstruct")
199
199
  jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
200
200
  id: import("@metamask/superstruct").Struct<string | number | null, null>;
201
201
  }>;
202
- export declare type UpdateAccountRequest = Infer<typeof UpdateAccountRequestStruct>;
202
+ export type UpdateAccountRequest = Infer<typeof UpdateAccountRequestStruct>;
203
203
  export declare const UpdateAccountResponseStruct: import("@metamask/superstruct").Struct<null, null>;
204
- export declare type UpdateAccountResponse = Infer<typeof UpdateAccountResponseStruct>;
204
+ export type UpdateAccountResponse = Infer<typeof UpdateAccountResponseStruct>;
205
205
  export declare const DeleteAccountRequestStruct: import("@metamask/superstruct").Struct<{
206
206
  jsonrpc: "2.0";
207
207
  id: string | number | null;
@@ -219,9 +219,9 @@ export declare const DeleteAccountRequestStruct: import("@metamask/superstruct")
219
219
  jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
220
220
  id: import("@metamask/superstruct").Struct<string | number | null, null>;
221
221
  }>;
222
- export declare type DeleteAccountRequest = Infer<typeof DeleteAccountRequestStruct>;
222
+ export type DeleteAccountRequest = Infer<typeof DeleteAccountRequestStruct>;
223
223
  export declare const DeleteAccountResponseStruct: import("@metamask/superstruct").Struct<null, null>;
224
- export declare type DeleteAccountResponse = Infer<typeof DeleteAccountResponseStruct>;
224
+ export type DeleteAccountResponse = Infer<typeof DeleteAccountResponseStruct>;
225
225
  export declare const ExportAccountRequestStruct: import("@metamask/superstruct").Struct<{
226
226
  jsonrpc: "2.0";
227
227
  id: string | number | null;
@@ -239,9 +239,9 @@ export declare const ExportAccountRequestStruct: import("@metamask/superstruct")
239
239
  jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
240
240
  id: import("@metamask/superstruct").Struct<string | number | null, null>;
241
241
  }>;
242
- export declare type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;
242
+ export type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;
243
243
  export declare const ExportAccountResponseStruct: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
244
- export declare type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;
244
+ export type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;
245
245
  export declare const ListRequestsRequestStruct: import("@metamask/superstruct").Struct<{
246
246
  jsonrpc: "2.0";
247
247
  id: string | number | null;
@@ -251,7 +251,7 @@ export declare const ListRequestsRequestStruct: import("@metamask/superstruct").
251
251
  jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
252
252
  id: import("@metamask/superstruct").Struct<string | number | null, null>;
253
253
  }>;
254
- export declare type ListRequestsRequest = Infer<typeof ListRequestsRequestStruct>;
254
+ export type ListRequestsRequest = Infer<typeof ListRequestsRequestStruct>;
255
255
  export declare const ListRequestsResponseStruct: import("@metamask/superstruct").Struct<{
256
256
  id: string;
257
257
  scope: string;
@@ -277,10 +277,10 @@ export declare const ListRequestsResponseStruct: import("@metamask/superstruct")
277
277
  params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
278
278
  }, {
279
279
  method: import("@metamask/superstruct").Struct<string, null>;
280
- params: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
280
+ params: import("@metamask/superstruct").Struct<import("../superstruct").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
281
281
  }>;
282
282
  }>>;
283
- export declare type ListRequestsResponse = Infer<typeof ListRequestsResponseStruct>;
283
+ export type ListRequestsResponse = Infer<typeof ListRequestsResponseStruct>;
284
284
  export declare const GetRequestRequestStruct: import("@metamask/superstruct").Struct<{
285
285
  jsonrpc: "2.0";
286
286
  id: string | number | null;
@@ -298,7 +298,7 @@ export declare const GetRequestRequestStruct: import("@metamask/superstruct").St
298
298
  jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
299
299
  id: import("@metamask/superstruct").Struct<string | number | null, null>;
300
300
  }>;
301
- export declare type GetRequestRequest = Infer<typeof GetRequestRequestStruct>;
301
+ export type GetRequestRequest = Infer<typeof GetRequestRequestStruct>;
302
302
  export declare const GetRequestResponseStruct: import("@metamask/superstruct").Struct<{
303
303
  id: string;
304
304
  scope: string;
@@ -316,10 +316,10 @@ export declare const GetRequestResponseStruct: import("@metamask/superstruct").S
316
316
  params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
317
317
  }, {
318
318
  method: import("@metamask/superstruct").Struct<string, null>;
319
- params: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
319
+ params: import("@metamask/superstruct").Struct<import("../superstruct").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
320
320
  }>;
321
321
  }>;
322
- export declare type GetRequestResponse = Infer<typeof GetRequestResponseStruct>;
322
+ export type GetRequestResponse = Infer<typeof GetRequestResponseStruct>;
323
323
  export declare const SubmitRequestRequestStruct: import("@metamask/superstruct").Struct<{
324
324
  jsonrpc: "2.0";
325
325
  id: string | number | null;
@@ -352,13 +352,13 @@ export declare const SubmitRequestRequestStruct: import("@metamask/superstruct")
352
352
  params?: import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>;
353
353
  }, {
354
354
  method: import("@metamask/superstruct").Struct<string, null>;
355
- params: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
355
+ params: import("@metamask/superstruct").Struct<import("../superstruct").ExactOptionalTag | import("@metamask/utils").Json[] | Record<string, import("@metamask/utils").Json>, null>;
356
356
  }>;
357
357
  }>;
358
358
  jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
359
359
  id: import("@metamask/superstruct").Struct<string | number | null, null>;
360
360
  }>;
361
- export declare type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;
361
+ export type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;
362
362
  export declare const SubmitRequestResponseStruct: import("@metamask/superstruct").Struct<{
363
363
  pending: true;
364
364
  redirect?: {
@@ -369,7 +369,7 @@ export declare const SubmitRequestResponseStruct: import("@metamask/superstruct"
369
369
  pending: false;
370
370
  result: import("@metamask/utils").Json;
371
371
  }, null>;
372
- export declare type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;
372
+ export type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;
373
373
  export declare const ApproveRequestRequestStruct: import("@metamask/superstruct").Struct<{
374
374
  jsonrpc: "2.0";
375
375
  id: string | number | null;
@@ -390,9 +390,9 @@ export declare const ApproveRequestRequestStruct: import("@metamask/superstruct"
390
390
  jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
391
391
  id: import("@metamask/superstruct").Struct<string | number | null, null>;
392
392
  }>;
393
- export declare type ApproveRequestRequest = Infer<typeof ApproveRequestRequestStruct>;
393
+ export type ApproveRequestRequest = Infer<typeof ApproveRequestRequestStruct>;
394
394
  export declare const ApproveRequestResponseStruct: import("@metamask/superstruct").Struct<null, null>;
395
- export declare type ApproveRequestResponse = Infer<typeof ApproveRequestResponseStruct>;
395
+ export type ApproveRequestResponse = Infer<typeof ApproveRequestResponseStruct>;
396
396
  export declare const RejectRequestRequestStruct: import("@metamask/superstruct").Struct<{
397
397
  jsonrpc: "2.0";
398
398
  id: string | number | null;
@@ -410,6 +410,6 @@ export declare const RejectRequestRequestStruct: import("@metamask/superstruct")
410
410
  jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
411
411
  id: import("@metamask/superstruct").Struct<string | number | null, null>;
412
412
  }>;
413
- export declare type RejectRequestRequest = Infer<typeof RejectRequestRequestStruct>;
413
+ export type RejectRequestRequest = Infer<typeof RejectRequestRequestStruct>;
414
414
  export declare const RejectRequestResponseStruct: import("@metamask/superstruct").Struct<null, null>;
415
- export declare type RejectRequestResponse = Infer<typeof RejectRequestResponseStruct>;
415
+ export type RejectRequestResponse = Infer<typeof RejectRequestResponseStruct>;