@metamask/keyring-api 15.0.0 → 16.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 (88) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/dist/api/account.cjs +2 -2
  3. package/dist/api/account.cjs.map +1 -1
  4. package/dist/api/account.d.cts +3 -3
  5. package/dist/api/account.d.cts.map +1 -1
  6. package/dist/api/account.d.mts +3 -3
  7. package/dist/api/account.d.mts.map +1 -1
  8. package/dist/api/account.mjs +4 -4
  9. package/dist/api/account.mjs.map +1 -1
  10. package/dist/api/address.cjs +14 -0
  11. package/dist/api/address.cjs.map +1 -0
  12. package/dist/api/address.d.cts +19 -0
  13. package/dist/api/address.d.cts.map +1 -0
  14. package/dist/api/address.d.mts +19 -0
  15. package/dist/api/address.d.mts.map +1 -0
  16. package/dist/api/address.mjs +11 -0
  17. package/dist/api/address.mjs.map +1 -0
  18. package/dist/api/index.cjs +1 -1
  19. package/dist/api/index.cjs.map +1 -1
  20. package/dist/api/index.d.cts +1 -1
  21. package/dist/api/index.d.cts.map +1 -1
  22. package/dist/api/index.d.mts +1 -1
  23. package/dist/api/index.d.mts.map +1 -1
  24. package/dist/api/index.mjs +1 -1
  25. package/dist/api/index.mjs.map +1 -1
  26. package/dist/api/keyring.cjs.map +1 -1
  27. package/dist/api/keyring.d.cts +16 -2
  28. package/dist/api/keyring.d.cts.map +1 -1
  29. package/dist/api/keyring.d.mts +16 -2
  30. package/dist/api/keyring.d.mts.map +1 -1
  31. package/dist/api/keyring.mjs.map +1 -1
  32. package/dist/btc/constants.cjs +9 -10
  33. package/dist/btc/constants.cjs.map +1 -1
  34. package/dist/btc/constants.d.cts +1 -2
  35. package/dist/btc/constants.d.cts.map +1 -1
  36. package/dist/btc/constants.d.mts +1 -2
  37. package/dist/btc/constants.d.mts.map +1 -1
  38. package/dist/btc/constants.mjs +8 -9
  39. package/dist/btc/constants.mjs.map +1 -1
  40. package/dist/eth/constants.cjs +7 -7
  41. package/dist/eth/constants.cjs.map +1 -1
  42. package/dist/eth/constants.d.cts +2 -2
  43. package/dist/eth/constants.d.cts.map +1 -1
  44. package/dist/eth/constants.d.mts +2 -2
  45. package/dist/eth/constants.d.mts.map +1 -1
  46. package/dist/eth/constants.mjs +6 -6
  47. package/dist/eth/constants.mjs.map +1 -1
  48. package/dist/eth/types.cjs +2 -2
  49. package/dist/eth/types.cjs.map +1 -1
  50. package/dist/eth/types.d.cts +4 -4
  51. package/dist/eth/types.d.cts.map +1 -1
  52. package/dist/eth/types.d.mts +4 -4
  53. package/dist/eth/types.d.mts.map +1 -1
  54. package/dist/eth/types.mjs +3 -3
  55. package/dist/eth/types.mjs.map +1 -1
  56. package/dist/events.cjs +2 -2
  57. package/dist/events.cjs.map +1 -1
  58. package/dist/events.d.cts +8 -8
  59. package/dist/events.d.cts.map +1 -1
  60. package/dist/events.d.mts +8 -8
  61. package/dist/events.d.mts.map +1 -1
  62. package/dist/events.mjs +2 -2
  63. package/dist/events.mjs.map +1 -1
  64. package/dist/rpc.cjs +18 -4
  65. package/dist/rpc.cjs.map +1 -1
  66. package/dist/rpc.d.cts +59 -11
  67. package/dist/rpc.d.cts.map +1 -1
  68. package/dist/rpc.d.mts +59 -11
  69. package/dist/rpc.d.mts.map +1 -1
  70. package/dist/rpc.mjs +18 -4
  71. package/dist/rpc.mjs.map +1 -1
  72. package/dist/sol/constants.cjs +7 -8
  73. package/dist/sol/constants.cjs.map +1 -1
  74. package/dist/sol/constants.d.cts +1 -2
  75. package/dist/sol/constants.d.cts.map +1 -1
  76. package/dist/sol/constants.d.mts +1 -2
  77. package/dist/sol/constants.d.mts.map +1 -1
  78. package/dist/sol/constants.mjs +6 -7
  79. package/dist/sol/constants.mjs.map +1 -1
  80. package/package.json +4 -4
  81. package/dist/api/caip.cjs +0 -21
  82. package/dist/api/caip.cjs.map +0 -1
  83. package/dist/api/caip.d.cts +0 -21
  84. package/dist/api/caip.d.cts.map +0 -1
  85. package/dist/api/caip.d.mts +0 -21
  86. package/dist/api/caip.d.mts.map +0 -1
  87. package/dist/api/caip.mjs +0 -18
  88. package/dist/api/caip.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [16.0.0]
11
+
12
+ ### Added
13
+
14
+ - Add `resolveAccountAddress` keyring method ([#157](https://github.com/MetaMask/accounts/pull/157))
15
+
16
+ ### Changed
17
+
18
+ - **BREAKING:** Remove CAIP redefinitions ([#167](https://github.com/MetaMask/accounts/pull/167))
19
+ - We now rely on CAIP definitions coming `@metamask/utils`.
20
+ - **BREAKING:** Enforce that `scopes` contains CAIP-2 chain IDs ([#165](https://github.com/MetaMask/accounts/pull/165))
21
+ - Initially `scopes` accepted CAIP-2 namespaces as well to address the EVM EOA accounts that supports all EVM chains. This has been dropped in favor of `eip155:0` scope.
22
+ - **BREAKING:** Rename `*Scopes` enums to `*Scope` ([#165](https://github.com/MetaMask/accounts/pull/165))
23
+ - Bump `@metamask/utils` from `^11.0.1` to `^11.1.0` ([#167](https://github.com/MetaMask/accounts/pull/167))
24
+
10
25
  ## [15.0.0]
11
26
 
12
27
  ### Added
@@ -487,7 +502,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
487
502
  - SnapController keyring client. It is intended to be used by MetaMask to talk to the snap.
488
503
  - Helper functions to create keyring handler in the snap.
489
504
 
490
- [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@15.0.0...HEAD
505
+ [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@16.0.0...HEAD
506
+ [16.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@15.0.0...@metamask/keyring-api@16.0.0
491
507
  [15.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@14.0.0...@metamask/keyring-api@15.0.0
492
508
  [14.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@13.0.0...@metamask/keyring-api@14.0.0
493
509
  [13.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@12.0.0...@metamask/keyring-api@13.0.0
@@ -52,9 +52,9 @@ exports.KeyringAccountStruct = (0, keyring_utils_1.object)({
52
52
  */
53
53
  address: (0, superstruct_1.string)(),
54
54
  /**
55
- * Account supported scopes (CAIP-2 chain IDs or CAIP-2 namespaces).
55
+ * Account supported scopes (CAIP-2 chain IDs).
56
56
  */
57
- scopes: (0, superstruct_1.nonempty)((0, superstruct_1.array)((0, superstruct_1.union)([utils_1.CaipNamespaceStruct, utils_1.CaipChainIdStruct]))),
57
+ scopes: (0, superstruct_1.nonempty)((0, superstruct_1.array)(utils_1.CaipChainIdStruct)),
58
58
  /**
59
59
  * Account options.
60
60
  */
@@ -1 +1 @@
1
- {"version":3,"file":"account.cjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":";;;AAAA,2DAAkE;AAElE,uDAO+B;AAC/B,2CAIyB;AAEzB;;GAEG;AACH,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,0CAAwB,CAAA;AAC1B,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAWD;;;;;;GAMG;AACU,QAAA,oBAAoB,GAAG,IAAA,sBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,+BAAe;IAEnB;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,WAAW,EAAE;KAChC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;IAEjB;;OAEG;IACH,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,IAAA,mBAAK,EAAC,CAAC,2BAAmB,EAAE,yBAAiB,CAAC,CAAC,CAAC,CAAC;IAExE;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { AccountIdStruct, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport {\n nonempty,\n array,\n enums,\n record,\n string,\n union,\n} from '@metamask/superstruct';\nimport {\n CaipChainIdStruct,\n CaipNamespaceStruct,\n JsonStruct,\n} from '@metamask/utils';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2wpkh = 'bip122:p2wpkh',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2wpkh}`\n | `${SolAccountType.DataAccount}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: AccountIdStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2wpkh}`,\n `${SolAccountType.DataAccount}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs or CAIP-2 namespaces).\n */\n scopes: nonempty(array(union([CaipNamespaceStruct, CaipChainIdStruct]))),\n\n /**\n * Account options.\n */\n options: record(string(), JsonStruct),\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
1
+ {"version":3,"file":"account.cjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":";;;AAAA,2DAAkE;AAElE,uDAA+E;AAC/E,2CAAgE;AAEhE;;GAEG;AACH,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,0CAAwB,CAAA;AAC1B,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAWD;;;;;;GAMG;AACU,QAAA,oBAAoB,GAAG,IAAA,sBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,+BAAe;IAEnB;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,WAAW,EAAE;KAChC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;IAEjB;;OAEG;IACH,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,yBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { AccountIdStruct, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nonempty, array, enums, record, string } from '@metamask/superstruct';\nimport { CaipChainIdStruct, JsonStruct } from '@metamask/utils';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2wpkh = 'bip122:p2wpkh',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2wpkh}`\n | `${SolAccountType.DataAccount}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: AccountIdStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2wpkh}`,\n `${SolAccountType.DataAccount}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account options.\n */\n options: record(string(), JsonStruct),\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
@@ -34,7 +34,7 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
34
34
  id: string;
35
35
  options: Record<string, import("@metamask/utils").Json>;
36
36
  address: string;
37
- scopes: string[];
37
+ scopes: `${string}:${string}`[];
38
38
  methods: string[];
39
39
  }, {
40
40
  /**
@@ -55,9 +55,9 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
55
55
  */
56
56
  address: import("@metamask/superstruct").Struct<string, null>;
57
57
  /**
58
- * Account supported scopes (CAIP-2 chain IDs or CAIP-2 namespaces).
58
+ * Account supported scopes (CAIP-2 chain IDs).
59
59
  */
60
- scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
60
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
61
61
  /**
62
62
  * Account options.
63
63
  */
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAenD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,MAAM,kBAAkB;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,MAAM,kBAAkB;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -34,7 +34,7 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
34
34
  id: string;
35
35
  options: Record<string, import("@metamask/utils").Json>;
36
36
  address: string;
37
- scopes: string[];
37
+ scopes: `${string}:${string}`[];
38
38
  methods: string[];
39
39
  }, {
40
40
  /**
@@ -55,9 +55,9 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
55
55
  */
56
56
  address: import("@metamask/superstruct").Struct<string, null>;
57
57
  /**
58
- * Account supported scopes (CAIP-2 chain IDs or CAIP-2 namespaces).
58
+ * Account supported scopes (CAIP-2 chain IDs).
59
59
  */
60
- scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
60
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
61
61
  /**
62
62
  * Account options.
63
63
  */
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAenD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,MAAM,kBAAkB;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,MAAM,kBAAkB;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { AccountIdStruct, object } from "@metamask/keyring-utils";
2
- import { nonempty, array, enums, record, string, union } from "@metamask/superstruct";
3
- import { CaipChainIdStruct, CaipNamespaceStruct, JsonStruct } from "@metamask/utils";
2
+ import { nonempty, array, enums, record, string } from "@metamask/superstruct";
3
+ import { CaipChainIdStruct, JsonStruct } from "@metamask/utils";
4
4
  /**
5
5
  * Supported Ethereum account types.
6
6
  */
@@ -49,9 +49,9 @@ export const KeyringAccountStruct = object({
49
49
  */
50
50
  address: string(),
51
51
  /**
52
- * Account supported scopes (CAIP-2 chain IDs or CAIP-2 namespaces).
52
+ * Account supported scopes (CAIP-2 chain IDs).
53
53
  */
54
- scopes: nonempty(array(union([CaipNamespaceStruct, CaipChainIdStruct]))),
54
+ scopes: nonempty(array(CaipChainIdStruct)),
55
55
  /**
56
56
  * Account options.
57
57
  */
@@ -1 +1 @@
1
- {"version":3,"file":"account.mjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,gCAAgC;AAElE,OAAO,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACN,8BAA8B;AAC/B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACX,wBAAwB;AAEzB;;GAEG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,0CAAwB,CAAA;AAC1B,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAWD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,EAAE,EAAE,eAAe;IAEnB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,WAAW,EAAE;KAChC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE;IAEjB;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAExE;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { AccountIdStruct, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport {\n nonempty,\n array,\n enums,\n record,\n string,\n union,\n} from '@metamask/superstruct';\nimport {\n CaipChainIdStruct,\n CaipNamespaceStruct,\n JsonStruct,\n} from '@metamask/utils';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2wpkh = 'bip122:p2wpkh',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2wpkh}`\n | `${SolAccountType.DataAccount}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: AccountIdStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2wpkh}`,\n `${SolAccountType.DataAccount}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs or CAIP-2 namespaces).\n */\n scopes: nonempty(array(union([CaipNamespaceStruct, CaipChainIdStruct]))),\n\n /**\n * Account options.\n */\n options: record(string(), JsonStruct),\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
1
+ {"version":3,"file":"account.mjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,gCAAgC;AAElE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AAC/E,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,wBAAwB;AAEhE;;GAEG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,0CAAwB,CAAA;AAC1B,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAWD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,EAAE,EAAE,eAAe;IAEnB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,WAAW,EAAE;KAChC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE;IAEjB;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { AccountIdStruct, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nonempty, array, enums, record, string } from '@metamask/superstruct';\nimport { CaipChainIdStruct, JsonStruct } from '@metamask/utils';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2wpkh = 'bip122:p2wpkh',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2wpkh}`\n | `${SolAccountType.DataAccount}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: AccountIdStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2wpkh}`,\n `${SolAccountType.DataAccount}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account options.\n */\n options: record(string(), JsonStruct),\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResolvedAccountAddressStruct = void 0;
4
+ const superstruct_1 = require("@metamask/superstruct");
5
+ /**
6
+ * An account's address that has been resolved from a signing request.
7
+ */
8
+ exports.ResolvedAccountAddressStruct = (0, superstruct_1.object)({
9
+ /**
10
+ * Account main address.
11
+ */
12
+ address: (0, superstruct_1.string)(),
13
+ });
14
+ //# sourceMappingURL=address.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.cjs","sourceRoot":"","sources":["../../src/api/address.ts"],"names":[],"mappings":";;;AACA,uDAAuD;AAEvD;;GAEG;AACU,QAAA,4BAA4B,GAAG,IAAA,oBAAM,EAAC;IACjD;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;CAClB,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { object, string } from '@metamask/superstruct';\n\n/**\n * An account's address that has been resolved from a signing request.\n */\nexport const ResolvedAccountAddressStruct = object({\n /**\n * Account main address.\n */\n address: string(),\n});\n\n/**\n * Resolve account's address object.\n *\n * See {@link ResolvedAccountAddressStruct}.\n */\nexport type ResolvedAccountAddress = Infer<typeof ResolvedAccountAddressStruct>;\n"]}
@@ -0,0 +1,19 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ /**
3
+ * An account's address that has been resolved from a signing request.
4
+ */
5
+ export declare const ResolvedAccountAddressStruct: import("@metamask/superstruct").Struct<{
6
+ address: string;
7
+ }, {
8
+ /**
9
+ * Account main address.
10
+ */
11
+ address: import("@metamask/superstruct").Struct<string, null>;
12
+ }>;
13
+ /**
14
+ * Resolve account's address object.
15
+ *
16
+ * See {@link ResolvedAccountAddressStruct}.
17
+ */
18
+ export type ResolvedAccountAddress = Infer<typeof ResolvedAccountAddressStruct>;
19
+ //# sourceMappingURL=address.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.d.cts","sourceRoot":"","sources":["../../src/api/address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAGnD;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;IACvC;;OAEG;;EAEH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ /**
3
+ * An account's address that has been resolved from a signing request.
4
+ */
5
+ export declare const ResolvedAccountAddressStruct: import("@metamask/superstruct").Struct<{
6
+ address: string;
7
+ }, {
8
+ /**
9
+ * Account main address.
10
+ */
11
+ address: import("@metamask/superstruct").Struct<string, null>;
12
+ }>;
13
+ /**
14
+ * Resolve account's address object.
15
+ *
16
+ * See {@link ResolvedAccountAddressStruct}.
17
+ */
18
+ export type ResolvedAccountAddress = Infer<typeof ResolvedAccountAddressStruct>;
19
+ //# sourceMappingURL=address.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.d.mts","sourceRoot":"","sources":["../../src/api/address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAGnD;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;IACvC;;OAEG;;EAEH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { object, string } from "@metamask/superstruct";
2
+ /**
3
+ * An account's address that has been resolved from a signing request.
4
+ */
5
+ export const ResolvedAccountAddressStruct = object({
6
+ /**
7
+ * Account main address.
8
+ */
9
+ address: string(),
10
+ });
11
+ //# sourceMappingURL=address.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.mjs","sourceRoot":"","sources":["../../src/api/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AAEvD;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;IACjD;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE;CAClB,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { object, string } from '@metamask/superstruct';\n\n/**\n * An account's address that has been resolved from a signing request.\n */\nexport const ResolvedAccountAddressStruct = object({\n /**\n * Account main address.\n */\n address: string(),\n});\n\n/**\n * Resolve account's address object.\n *\n * See {@link ResolvedAccountAddressStruct}.\n */\nexport type ResolvedAccountAddress = Infer<typeof ResolvedAccountAddressStruct>;\n"]}
@@ -15,9 +15,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./account.cjs"), exports);
18
+ __exportStar(require("./address.cjs"), exports);
18
19
  __exportStar(require("./asset.cjs"), exports);
19
20
  __exportStar(require("./balance.cjs"), exports);
20
- __exportStar(require("./caip.cjs"), exports);
21
21
  __exportStar(require("./export.cjs"), exports);
22
22
  __exportStar(require("./request.cjs"), exports);
23
23
  __exportStar(require("./response.cjs"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,8CAAwB;AACxB,gDAA0B;AAC1B,6CAAuB;AACvB,+CAAyB;AACzB,gDAA0B;AAC1B,iDAA2B;AAC3B,oDAA8B;AAC9B,mDAA6B","sourcesContent":["export * from './account';\nexport * from './asset';\nexport * from './balance';\nexport * from './caip';\nexport * from './export';\nexport * from './request';\nexport * from './response';\nexport * from './transaction';\nexport * from './pagination';\nexport type * from './keyring';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,gDAA0B;AAC1B,8CAAwB;AACxB,gDAA0B;AAC1B,+CAAyB;AACzB,gDAA0B;AAC1B,iDAA2B;AAC3B,oDAA8B;AAC9B,mDAA6B","sourcesContent":["export * from './account';\nexport * from './address';\nexport * from './asset';\nexport * from './balance';\nexport * from './export';\nexport * from './request';\nexport * from './response';\nexport * from './transaction';\nexport * from './pagination';\nexport type * from './keyring';\n"]}
@@ -1,7 +1,7 @@
1
1
  export * from "./account.cjs";
2
+ export * from "./address.cjs";
2
3
  export * from "./asset.cjs";
3
4
  export * from "./balance.cjs";
4
- export * from "./caip.cjs";
5
5
  export * from "./export.cjs";
6
6
  export * from "./request.cjs";
7
7
  export * from "./response.cjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,mCAA+B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,mCAA+B"}
@@ -1,7 +1,7 @@
1
1
  export * from "./account.mjs";
2
+ export * from "./address.mjs";
2
3
  export * from "./asset.mjs";
3
4
  export * from "./balance.mjs";
4
- export * from "./caip.mjs";
5
5
  export * from "./export.mjs";
6
6
  export * from "./request.mjs";
7
7
  export * from "./response.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,mCAA+B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,mCAA+B"}
@@ -1,7 +1,7 @@
1
1
  export * from "./account.mjs";
2
+ export * from "./address.mjs";
2
3
  export * from "./asset.mjs";
3
4
  export * from "./balance.mjs";
4
- export * from "./caip.mjs";
5
5
  export * from "./export.mjs";
6
6
  export * from "./request.mjs";
7
7
  export * from "./response.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B","sourcesContent":["export * from './account';\nexport * from './asset';\nexport * from './balance';\nexport * from './caip';\nexport * from './export';\nexport * from './request';\nexport * from './response';\nexport * from './transaction';\nexport * from './pagination';\nexport type * from './keyring';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B","sourcesContent":["export * from './account';\nexport * from './address';\nexport * from './asset';\nexport * from './balance';\nexport * from './export';\nexport * from './request';\nexport * from './response';\nexport * from './transaction';\nexport * from './pagination';\nexport type * from './keyring';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,6EAA6E","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n// This rule seems to be triggering a false positive on the `KeyringAccount`.\n\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { Balance } from './balance';\nimport type { CaipAssetType, CaipAssetTypeOrId } from './caip';\nimport type { KeyringAccountData } from './export';\nimport type { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\n\n/**\n * Keyring interface.\n *\n * Represents the functionality and operations related to managing accounts and\n * handling requests.\n */\nexport type Keyring = {\n /**\n * List accounts.\n *\n * Retrieves an array of KeyringAccount objects representing the available\n * accounts.\n *\n * @returns A promise that resolves to an array of KeyringAccount objects.\n */\n listAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Get an account.\n *\n * Retrieves the KeyringAccount object for the given account ID.\n *\n * @param id - The ID of the account to retrieve.\n * @returns A promise that resolves to the KeyringAccount object if found, or\n * undefined otherwise.\n */\n getAccount(id: string): Promise<KeyringAccount | undefined>;\n\n /**\n * Create an account.\n *\n * Creates a new account with optional, keyring-defined, account options.\n *\n * @param options - Keyring-defined options for the account (optional).\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(options?: Record<string, Json>): Promise<KeyringAccount>;\n\n /**\n * Lists the assets of an account (fungibles and non-fungibles) represented\n * by their respective CAIP-19:\n * - Asset types for fungibles assets.\n * - Asset IDs for non-fungible ones.\n *\n * @param id - The ID of the account to list the assets for.\n * @returns A promise that resolves to list of assets for that account.\n */\n listAccountAssets?(id: string): Promise<CaipAssetTypeOrId[]>;\n\n /**\n * Lists the transactions of an account, paginated and ordered by the most\n * recent first.\n *\n * The pagination options are used to limit the number of transactions in the\n * response and to iterate over the results.\n *\n * @param id - The ID of the account to list the transactions for.\n * @param pagination - The pagination options.\n * @returns A promise that resolves to the next page of transactions.\n */\n listAccountTransactions?(\n id: string,\n pagination: Pagination,\n ): Promise<Paginated<Transaction>>;\n\n /**\n * Retrieve the balances of a given account.\n *\n * This method fetches the balances of specified assets for a given account\n * ID. It returns a promise that resolves to an object where the keys are\n * asset types and the values are balance objects containing the amount and\n * unit.\n *\n * @example\n * ```ts\n * await keyring.getAccountBalances(\n * '43550276-c7d6-4fac-87c7-00390ad0ce90',\n * ['bip122:000000000019d6689c085ae165831e93/slip44:0']\n * );\n * // Returns something similar to:\n * // {\n * // 'bip122:000000000019d6689c085ae165831e93/slip44:0': {\n * // amount: '0.0001',\n * // unit: 'BTC',\n * // }\n * // }\n * ```\n * @param id - ID of the account to retrieve the balances for.\n * @param assets - Array of asset types (CAIP-19) to retrieve balances for.\n * @returns A promise that resolves to an object mapping asset types to their\n * respective balances.\n */\n getAccountBalances?(\n id: string,\n assets: CaipAssetType[],\n ): Promise<Record<CaipAssetType, Balance>>;\n\n /**\n * Filter supported chains for a given account.\n *\n * @param id - ID of the account to be checked.\n * @param chains - List of chains (CAIP-2) to be checked.\n * @returns A Promise that resolves to a filtered list of CAIP-2 IDs\n * representing the supported chains.\n */\n filterAccountChains(id: string, chains: string[]): Promise<string[]>;\n\n /**\n * Update an account.\n *\n * Updates the account with the given account object. Does nothing if the\n * account does not exist.\n *\n * @param account - The updated account object.\n * @returns A promise that resolves when the account is successfully updated.\n */\n updateAccount(account: KeyringAccount): Promise<void>;\n\n /**\n * Delete an account from the keyring.\n *\n * Deletes the account with the given ID from the keyring.\n *\n * @param id - The ID of the account to delete.\n * @returns A promise that resolves when the account is successfully deleted.\n */\n deleteAccount(id: string): Promise<void>;\n\n /**\n * Exports an account's private key.\n *\n * If the keyring cannot export a private key, this function should throw an\n * error.\n *\n * @param id - The ID of the account to export.\n * @returns A promise that resolves to the exported account.\n */\n exportAccount?(id: string): Promise<KeyringAccountData>;\n\n /**\n * List all submitted requests.\n *\n * Retrieves an array of KeyringRequest objects representing the submitted\n * requests.\n *\n * @returns A promise that resolves to an array of KeyringRequest objects.\n */\n listRequests?(): Promise<KeyringRequest[]>;\n\n /**\n * Get a request.\n *\n * Retrieves the KeyringRequest object for the given request ID.\n *\n * @param id - The ID of the request to retrieve.\n * @returns A promise that resolves to the KeyringRequest object if found, or\n * undefined otherwise.\n */\n getRequest?(id: string): Promise<KeyringRequest | undefined>;\n\n /**\n * Submit a request.\n *\n * Submits the given KeyringRequest object.\n *\n * @param request - The KeyringRequest object to submit.\n * @returns A promise that resolves to the request response.\n */\n submitRequest(request: KeyringRequest): Promise<KeyringResponse>;\n\n /**\n * Approve a request.\n *\n * Approves the request with the given ID and sets the response if provided.\n *\n * @param id - The ID of the request to approve.\n * @param data - The response to the request (optional).\n * @returns A promise that resolves when the request is successfully\n * approved.\n */\n approveRequest?(id: string, data?: Record<string, Json>): Promise<void>;\n\n /**\n * Reject a request.\n *\n * Rejects the request with the given ID.\n *\n * @param id - The ID of the request to reject.\n * @returns A promise that resolves when the request is successfully\n * rejected.\n */\n rejectRequest?(id: string): Promise<void>;\n};\n"]}
1
+ {"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,6EAA6E","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n// This rule seems to be triggering a false positive on the `KeyringAccount`.\n\nimport type { JsonRpcRequest } from '@metamask/keyring-utils';\nimport type {\n Json,\n CaipChainId,\n CaipAssetType,\n CaipAssetTypeOrId,\n} from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { ResolvedAccountAddress } from './address';\nimport type { Balance } from './balance';\nimport type { KeyringAccountData } from './export';\nimport type { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\n\n/**\n * Keyring interface.\n *\n * Represents the functionality and operations related to managing accounts and\n * handling requests.\n */\nexport type Keyring = {\n /**\n * List accounts.\n *\n * Retrieves an array of KeyringAccount objects representing the available\n * accounts.\n *\n * @returns A promise that resolves to an array of KeyringAccount objects.\n */\n listAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Get an account.\n *\n * Retrieves the KeyringAccount object for the given account ID.\n *\n * @param id - The ID of the account to retrieve.\n * @returns A promise that resolves to the KeyringAccount object if found, or\n * undefined otherwise.\n */\n getAccount(id: string): Promise<KeyringAccount | undefined>;\n\n /**\n * Create an account.\n *\n * Creates a new account with optional, keyring-defined, account options.\n *\n * @param options - Keyring-defined options for the account (optional).\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(options?: Record<string, Json>): Promise<KeyringAccount>;\n\n /**\n * Lists the assets of an account (fungibles and non-fungibles) represented\n * by their respective CAIP-19:\n * - Asset types for fungibles assets.\n * - Asset IDs for non-fungible ones.\n *\n * @param id - The ID of the account to list the assets for.\n * @returns A promise that resolves to list of assets for that account.\n */\n listAccountAssets?(id: string): Promise<CaipAssetTypeOrId[]>;\n\n /**\n * Lists the transactions of an account, paginated and ordered by the most\n * recent first.\n *\n * The pagination options are used to limit the number of transactions in the\n * response and to iterate over the results.\n *\n * @param id - The ID of the account to list the transactions for.\n * @param pagination - The pagination options.\n * @returns A promise that resolves to the next page of transactions.\n */\n listAccountTransactions?(\n id: string,\n pagination: Pagination,\n ): Promise<Paginated<Transaction>>;\n\n /**\n * Retrieve the balances of a given account.\n *\n * This method fetches the balances of specified assets for a given account\n * ID. It returns a promise that resolves to an object where the keys are\n * asset types and the values are balance objects containing the amount and\n * unit.\n *\n * @example\n * ```ts\n * await keyring.getAccountBalances(\n * '43550276-c7d6-4fac-87c7-00390ad0ce90',\n * ['bip122:000000000019d6689c085ae165831e93/slip44:0']\n * );\n * // Returns something similar to:\n * // {\n * // 'bip122:000000000019d6689c085ae165831e93/slip44:0': {\n * // amount: '0.0001',\n * // unit: 'BTC',\n * // }\n * // }\n * ```\n * @param id - ID of the account to retrieve the balances for.\n * @param assets - Array of asset types (CAIP-19) to retrieve balances for.\n * @returns A promise that resolves to an object mapping asset types to their\n * respective balances.\n */\n getAccountBalances?(\n id: string,\n assets: CaipAssetType[],\n ): Promise<Record<CaipAssetType, Balance>>;\n\n /**\n * Resolves the address of an account from a signing request.\n *\n * This is required by the routing system of MetaMask to dispatch\n * incoming non-EVM dapp signing requests.\n *\n * @param scope - Request's scope (CAIP-2).\n * @param request - Signing request object.\n * @returns A Promise that resolves to the account address that must\n * be used to process this signing request, or null if none candidates\n * could be found.\n */\n resolveAccountAddress?(\n scope: CaipChainId,\n request: JsonRpcRequest,\n ): Promise<ResolvedAccountAddress | null>;\n\n /**\n * Filter supported chains for a given account.\n *\n * @param id - ID of the account to be checked.\n * @param chains - List of chains (CAIP-2) to be checked.\n * @returns A Promise that resolves to a filtered list of CAIP-2 IDs\n * representing the supported chains.\n */\n filterAccountChains(id: string, chains: string[]): Promise<string[]>;\n\n /**\n * Update an account.\n *\n * Updates the account with the given account object. Does nothing if the\n * account does not exist.\n *\n * @param account - The updated account object.\n * @returns A promise that resolves when the account is successfully updated.\n */\n updateAccount(account: KeyringAccount): Promise<void>;\n\n /**\n * Delete an account from the keyring.\n *\n * Deletes the account with the given ID from the keyring.\n *\n * @param id - The ID of the account to delete.\n * @returns A promise that resolves when the account is successfully deleted.\n */\n deleteAccount(id: string): Promise<void>;\n\n /**\n * Exports an account's private key.\n *\n * If the keyring cannot export a private key, this function should throw an\n * error.\n *\n * @param id - The ID of the account to export.\n * @returns A promise that resolves to the exported account.\n */\n exportAccount?(id: string): Promise<KeyringAccountData>;\n\n /**\n * List all submitted requests.\n *\n * Retrieves an array of KeyringRequest objects representing the submitted\n * requests.\n *\n * @returns A promise that resolves to an array of KeyringRequest objects.\n */\n listRequests?(): Promise<KeyringRequest[]>;\n\n /**\n * Get a request.\n *\n * Retrieves the KeyringRequest object for the given request ID.\n *\n * @param id - The ID of the request to retrieve.\n * @returns A promise that resolves to the KeyringRequest object if found, or\n * undefined otherwise.\n */\n getRequest?(id: string): Promise<KeyringRequest | undefined>;\n\n /**\n * Submit a request.\n *\n * Submits the given KeyringRequest object.\n *\n * @param request - The KeyringRequest object to submit.\n * @returns A promise that resolves to the request response.\n */\n submitRequest(request: KeyringRequest): Promise<KeyringResponse>;\n\n /**\n * Approve a request.\n *\n * Approves the request with the given ID and sets the response if provided.\n *\n * @param id - The ID of the request to approve.\n * @param data - The response to the request (optional).\n * @returns A promise that resolves when the request is successfully\n * approved.\n */\n approveRequest?(id: string, data?: Record<string, Json>): Promise<void>;\n\n /**\n * Reject a request.\n *\n * Rejects the request with the given ID.\n *\n * @param id - The ID of the request to reject.\n * @returns A promise that resolves when the request is successfully\n * rejected.\n */\n rejectRequest?(id: string): Promise<void>;\n};\n"]}
@@ -1,7 +1,8 @@
1
- import type { Json } from "@metamask/utils";
1
+ import type { JsonRpcRequest } from "@metamask/keyring-utils";
2
+ import type { Json, CaipChainId, CaipAssetType, CaipAssetTypeOrId } from "@metamask/utils";
2
3
  import type { KeyringAccount } from "./account.cjs";
4
+ import type { ResolvedAccountAddress } from "./address.cjs";
3
5
  import type { Balance } from "./balance.cjs";
4
- import type { CaipAssetType, CaipAssetTypeOrId } from "./caip.cjs";
5
6
  import type { KeyringAccountData } from "./export.cjs";
6
7
  import type { Paginated, Pagination } from "./pagination.cjs";
7
8
  import type { KeyringRequest } from "./request.cjs";
@@ -93,6 +94,19 @@ export type Keyring = {
93
94
  * respective balances.
94
95
  */
95
96
  getAccountBalances?(id: string, assets: CaipAssetType[]): Promise<Record<CaipAssetType, Balance>>;
97
+ /**
98
+ * Resolves the address of an account from a signing request.
99
+ *
100
+ * This is required by the routing system of MetaMask to dispatch
101
+ * incoming non-EVM dapp signing requests.
102
+ *
103
+ * @param scope - Request's scope (CAIP-2).
104
+ * @param request - Signing request object.
105
+ * @returns A Promise that resolves to the account address that must
106
+ * be used to process this signing request, or null if none candidates
107
+ * could be found.
108
+ */
109
+ resolveAccountAddress?(scope: CaipChainId, request: JsonRpcRequest): Promise<ResolvedAccountAddress | null>;
96
110
  /**
97
111
  * Filter supported chains for a given account.
98
112
  *
@@ -1 +1 @@
1
- {"version":3,"file":"keyring.d.cts","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAkB;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAe;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAiB;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,yBAAqB;AAC1D,OAAO,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IAEzC;;;;;;;;OAQG;IACH,aAAa,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAExD;;;;;;;OAOG;IACH,YAAY,CAAC,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAE3C;;;;;;;;OAQG;IACH,UAAU,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAE7D;;;;;;;OAOG;IACH,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAEjE;;;;;;;;;OASG;IACH,cAAc,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExE;;;;;;;;OAQG;IACH,aAAa,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C,CAAC"}
@@ -1,7 +1,8 @@
1
- import type { Json } from "@metamask/utils";
1
+ import type { JsonRpcRequest } from "@metamask/keyring-utils";
2
+ import type { Json, CaipChainId, CaipAssetType, CaipAssetTypeOrId } from "@metamask/utils";
2
3
  import type { KeyringAccount } from "./account.mjs";
4
+ import type { ResolvedAccountAddress } from "./address.mjs";
3
5
  import type { Balance } from "./balance.mjs";
4
- import type { CaipAssetType, CaipAssetTypeOrId } from "./caip.mjs";
5
6
  import type { KeyringAccountData } from "./export.mjs";
6
7
  import type { Paginated, Pagination } from "./pagination.mjs";
7
8
  import type { KeyringRequest } from "./request.mjs";
@@ -93,6 +94,19 @@ export type Keyring = {
93
94
  * respective balances.
94
95
  */
95
96
  getAccountBalances?(id: string, assets: CaipAssetType[]): Promise<Record<CaipAssetType, Balance>>;
97
+ /**
98
+ * Resolves the address of an account from a signing request.
99
+ *
100
+ * This is required by the routing system of MetaMask to dispatch
101
+ * incoming non-EVM dapp signing requests.
102
+ *
103
+ * @param scope - Request's scope (CAIP-2).
104
+ * @param request - Signing request object.
105
+ * @returns A Promise that resolves to the account address that must
106
+ * be used to process this signing request, or null if none candidates
107
+ * could be found.
108
+ */
109
+ resolveAccountAddress?(scope: CaipChainId, request: JsonRpcRequest): Promise<ResolvedAccountAddress | null>;
96
110
  /**
97
111
  * Filter supported chains for a given account.
98
112
  *
@@ -1 +1 @@
1
- {"version":3,"file":"keyring.d.mts","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAkB;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAe;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAiB;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,yBAAqB;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,0BAAsB;AAEjD;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB;;;;;;;OAOG;IACH,YAAY,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAE1C;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAE5D;;;;;;;;OAQG;IACH,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAEvE;;;;;;;;OAQG;IACH,iBAAiB,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAA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C,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,6EAA6E","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n// This rule seems to be triggering a false positive on the `KeyringAccount`.\n\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { Balance } from './balance';\nimport type { CaipAssetType, CaipAssetTypeOrId } from './caip';\nimport type { KeyringAccountData } from './export';\nimport type { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\n\n/**\n * Keyring interface.\n *\n * Represents the functionality and operations related to managing accounts and\n * handling requests.\n */\nexport type Keyring = {\n /**\n * List accounts.\n *\n * Retrieves an array of KeyringAccount objects representing the available\n * accounts.\n *\n * @returns A promise that resolves to an array of KeyringAccount objects.\n */\n listAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Get an account.\n *\n * Retrieves the KeyringAccount object for the given account ID.\n *\n * @param id - The ID of the account to retrieve.\n * @returns A promise that resolves to the KeyringAccount object if found, or\n * undefined otherwise.\n */\n getAccount(id: string): Promise<KeyringAccount | undefined>;\n\n /**\n * Create an account.\n *\n * Creates a new account with optional, keyring-defined, account options.\n *\n * @param options - Keyring-defined options for the account (optional).\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(options?: Record<string, Json>): Promise<KeyringAccount>;\n\n /**\n * Lists the assets of an account (fungibles and non-fungibles) represented\n * by their respective CAIP-19:\n * - Asset types for fungibles assets.\n * - Asset IDs for non-fungible ones.\n *\n * @param id - The ID of the account to list the assets for.\n * @returns A promise that resolves to list of assets for that account.\n */\n listAccountAssets?(id: string): Promise<CaipAssetTypeOrId[]>;\n\n /**\n * Lists the transactions of an account, paginated and ordered by the most\n * recent first.\n *\n * The pagination options are used to limit the number of transactions in the\n * response and to iterate over the results.\n *\n * @param id - The ID of the account to list the transactions for.\n * @param pagination - The pagination options.\n * @returns A promise that resolves to the next page of transactions.\n */\n listAccountTransactions?(\n id: string,\n pagination: Pagination,\n ): Promise<Paginated<Transaction>>;\n\n /**\n * Retrieve the balances of a given account.\n *\n * This method fetches the balances of specified assets for a given account\n * ID. It returns a promise that resolves to an object where the keys are\n * asset types and the values are balance objects containing the amount and\n * unit.\n *\n * @example\n * ```ts\n * await keyring.getAccountBalances(\n * '43550276-c7d6-4fac-87c7-00390ad0ce90',\n * ['bip122:000000000019d6689c085ae165831e93/slip44:0']\n * );\n * // Returns something similar to:\n * // {\n * // 'bip122:000000000019d6689c085ae165831e93/slip44:0': {\n * // amount: '0.0001',\n * // unit: 'BTC',\n * // }\n * // }\n * ```\n * @param id - ID of the account to retrieve the balances for.\n * @param assets - Array of asset types (CAIP-19) to retrieve balances for.\n * @returns A promise that resolves to an object mapping asset types to their\n * respective balances.\n */\n getAccountBalances?(\n id: string,\n assets: CaipAssetType[],\n ): Promise<Record<CaipAssetType, Balance>>;\n\n /**\n * Filter supported chains for a given account.\n *\n * @param id - ID of the account to be checked.\n * @param chains - List of chains (CAIP-2) to be checked.\n * @returns A Promise that resolves to a filtered list of CAIP-2 IDs\n * representing the supported chains.\n */\n filterAccountChains(id: string, chains: string[]): Promise<string[]>;\n\n /**\n * Update an account.\n *\n * Updates the account with the given account object. Does nothing if the\n * account does not exist.\n *\n * @param account - The updated account object.\n * @returns A promise that resolves when the account is successfully updated.\n */\n updateAccount(account: KeyringAccount): Promise<void>;\n\n /**\n * Delete an account from the keyring.\n *\n * Deletes the account with the given ID from the keyring.\n *\n * @param id - The ID of the account to delete.\n * @returns A promise that resolves when the account is successfully deleted.\n */\n deleteAccount(id: string): Promise<void>;\n\n /**\n * Exports an account's private key.\n *\n * If the keyring cannot export a private key, this function should throw an\n * error.\n *\n * @param id - The ID of the account to export.\n * @returns A promise that resolves to the exported account.\n */\n exportAccount?(id: string): Promise<KeyringAccountData>;\n\n /**\n * List all submitted requests.\n *\n * Retrieves an array of KeyringRequest objects representing the submitted\n * requests.\n *\n * @returns A promise that resolves to an array of KeyringRequest objects.\n */\n listRequests?(): Promise<KeyringRequest[]>;\n\n /**\n * Get a request.\n *\n * Retrieves the KeyringRequest object for the given request ID.\n *\n * @param id - The ID of the request to retrieve.\n * @returns A promise that resolves to the KeyringRequest object if found, or\n * undefined otherwise.\n */\n getRequest?(id: string): Promise<KeyringRequest | undefined>;\n\n /**\n * Submit a request.\n *\n * Submits the given KeyringRequest object.\n *\n * @param request - The KeyringRequest object to submit.\n * @returns A promise that resolves to the request response.\n */\n submitRequest(request: KeyringRequest): Promise<KeyringResponse>;\n\n /**\n * Approve a request.\n *\n * Approves the request with the given ID and sets the response if provided.\n *\n * @param id - The ID of the request to approve.\n * @param data - The response to the request (optional).\n * @returns A promise that resolves when the request is successfully\n * approved.\n */\n approveRequest?(id: string, data?: Record<string, Json>): Promise<void>;\n\n /**\n * Reject a request.\n *\n * Rejects the request with the given ID.\n *\n * @param id - The ID of the request to reject.\n * @returns A promise that resolves when the request is successfully\n * rejected.\n */\n rejectRequest?(id: string): Promise<void>;\n};\n"]}
1
+ {"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,6EAA6E","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n// This rule seems to be triggering a false positive on the `KeyringAccount`.\n\nimport type { JsonRpcRequest } from '@metamask/keyring-utils';\nimport type {\n Json,\n CaipChainId,\n CaipAssetType,\n CaipAssetTypeOrId,\n} from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { ResolvedAccountAddress } from './address';\nimport type { Balance } from './balance';\nimport type { KeyringAccountData } from './export';\nimport type { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\n\n/**\n * Keyring interface.\n *\n * Represents the functionality and operations related to managing accounts and\n * handling requests.\n */\nexport type Keyring = {\n /**\n * List accounts.\n *\n * Retrieves an array of KeyringAccount objects representing the available\n * accounts.\n *\n * @returns A promise that resolves to an array of KeyringAccount objects.\n */\n listAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Get an account.\n *\n * Retrieves the KeyringAccount object for the given account ID.\n *\n * @param id - The ID of the account to retrieve.\n * @returns A promise that resolves to the KeyringAccount object if found, or\n * undefined otherwise.\n */\n getAccount(id: string): Promise<KeyringAccount | undefined>;\n\n /**\n * Create an account.\n *\n * Creates a new account with optional, keyring-defined, account options.\n *\n * @param options - Keyring-defined options for the account (optional).\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(options?: Record<string, Json>): Promise<KeyringAccount>;\n\n /**\n * Lists the assets of an account (fungibles and non-fungibles) represented\n * by their respective CAIP-19:\n * - Asset types for fungibles assets.\n * - Asset IDs for non-fungible ones.\n *\n * @param id - The ID of the account to list the assets for.\n * @returns A promise that resolves to list of assets for that account.\n */\n listAccountAssets?(id: string): Promise<CaipAssetTypeOrId[]>;\n\n /**\n * Lists the transactions of an account, paginated and ordered by the most\n * recent first.\n *\n * The pagination options are used to limit the number of transactions in the\n * response and to iterate over the results.\n *\n * @param id - The ID of the account to list the transactions for.\n * @param pagination - The pagination options.\n * @returns A promise that resolves to the next page of transactions.\n */\n listAccountTransactions?(\n id: string,\n pagination: Pagination,\n ): Promise<Paginated<Transaction>>;\n\n /**\n * Retrieve the balances of a given account.\n *\n * This method fetches the balances of specified assets for a given account\n * ID. It returns a promise that resolves to an object where the keys are\n * asset types and the values are balance objects containing the amount and\n * unit.\n *\n * @example\n * ```ts\n * await keyring.getAccountBalances(\n * '43550276-c7d6-4fac-87c7-00390ad0ce90',\n * ['bip122:000000000019d6689c085ae165831e93/slip44:0']\n * );\n * // Returns something similar to:\n * // {\n * // 'bip122:000000000019d6689c085ae165831e93/slip44:0': {\n * // amount: '0.0001',\n * // unit: 'BTC',\n * // }\n * // }\n * ```\n * @param id - ID of the account to retrieve the balances for.\n * @param assets - Array of asset types (CAIP-19) to retrieve balances for.\n * @returns A promise that resolves to an object mapping asset types to their\n * respective balances.\n */\n getAccountBalances?(\n id: string,\n assets: CaipAssetType[],\n ): Promise<Record<CaipAssetType, Balance>>;\n\n /**\n * Resolves the address of an account from a signing request.\n *\n * This is required by the routing system of MetaMask to dispatch\n * incoming non-EVM dapp signing requests.\n *\n * @param scope - Request's scope (CAIP-2).\n * @param request - Signing request object.\n * @returns A Promise that resolves to the account address that must\n * be used to process this signing request, or null if none candidates\n * could be found.\n */\n resolveAccountAddress?(\n scope: CaipChainId,\n request: JsonRpcRequest,\n ): Promise<ResolvedAccountAddress | null>;\n\n /**\n * Filter supported chains for a given account.\n *\n * @param id - ID of the account to be checked.\n * @param chains - List of chains (CAIP-2) to be checked.\n * @returns A Promise that resolves to a filtered list of CAIP-2 IDs\n * representing the supported chains.\n */\n filterAccountChains(id: string, chains: string[]): Promise<string[]>;\n\n /**\n * Update an account.\n *\n * Updates the account with the given account object. Does nothing if the\n * account does not exist.\n *\n * @param account - The updated account object.\n * @returns A promise that resolves when the account is successfully updated.\n */\n updateAccount(account: KeyringAccount): Promise<void>;\n\n /**\n * Delete an account from the keyring.\n *\n * Deletes the account with the given ID from the keyring.\n *\n * @param id - The ID of the account to delete.\n * @returns A promise that resolves when the account is successfully deleted.\n */\n deleteAccount(id: string): Promise<void>;\n\n /**\n * Exports an account's private key.\n *\n * If the keyring cannot export a private key, this function should throw an\n * error.\n *\n * @param id - The ID of the account to export.\n * @returns A promise that resolves to the exported account.\n */\n exportAccount?(id: string): Promise<KeyringAccountData>;\n\n /**\n * List all submitted requests.\n *\n * Retrieves an array of KeyringRequest objects representing the submitted\n * requests.\n *\n * @returns A promise that resolves to an array of KeyringRequest objects.\n */\n listRequests?(): Promise<KeyringRequest[]>;\n\n /**\n * Get a request.\n *\n * Retrieves the KeyringRequest object for the given request ID.\n *\n * @param id - The ID of the request to retrieve.\n * @returns A promise that resolves to the KeyringRequest object if found, or\n * undefined otherwise.\n */\n getRequest?(id: string): Promise<KeyringRequest | undefined>;\n\n /**\n * Submit a request.\n *\n * Submits the given KeyringRequest object.\n *\n * @param request - The KeyringRequest object to submit.\n * @returns A promise that resolves to the request response.\n */\n submitRequest(request: KeyringRequest): Promise<KeyringResponse>;\n\n /**\n * Approve a request.\n *\n * Approves the request with the given ID and sets the response if provided.\n *\n * @param id - The ID of the request to approve.\n * @param data - The response to the request (optional).\n * @returns A promise that resolves when the request is successfully\n * approved.\n */\n approveRequest?(id: string, data?: Record<string, Json>): Promise<void>;\n\n /**\n * Reject a request.\n *\n * Rejects the request with the given ID.\n *\n * @param id - The ID of the request to reject.\n * @returns A promise that resolves when the request is successfully\n * rejected.\n */\n rejectRequest?(id: string): Promise<void>;\n};\n"]}
@@ -1,17 +1,16 @@
1
1
  "use strict";
2
2
  /* istanbul ignore file */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.BtcScopes = void 0;
4
+ exports.BtcScope = void 0;
5
5
  /**
6
6
  * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
7
7
  */
8
- var BtcScopes;
9
- (function (BtcScopes) {
10
- BtcScopes["Namespace"] = "bip122";
11
- BtcScopes["Mainnet"] = "bip122:000000000019d6689c085ae165831e93";
12
- BtcScopes["Testnet"] = "bip122:000000000933ea01ad0ee984209779ba";
13
- BtcScopes["Testnet4"] = "bip122:00000000da84f2bafbbc53dee25a72ae";
14
- BtcScopes["Signet"] = "bip122:00000008819873e925422c1ff0f99f7c";
15
- BtcScopes["Regtest"] = "bip122:regtest";
16
- })(BtcScopes || (exports.BtcScopes = BtcScopes = {}));
8
+ var BtcScope;
9
+ (function (BtcScope) {
10
+ BtcScope["Mainnet"] = "bip122:000000000019d6689c085ae165831e93";
11
+ BtcScope["Testnet"] = "bip122:000000000933ea01ad0ee984209779ba";
12
+ BtcScope["Testnet4"] = "bip122:00000000da84f2bafbbc53dee25a72ae";
13
+ BtcScope["Signet"] = "bip122:00000008819873e925422c1ff0f99f7c";
14
+ BtcScope["Regtest"] = "bip122:regtest";
15
+ })(BtcScope || (exports.BtcScope = BtcScope = {}));
17
16
  //# sourceMappingURL=constants.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":";AAAA,0BAA0B;;;AAE1B;;GAEG;AACH,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,iCAAoB,CAAA;IACpB,gEAAmD,CAAA;IACnD,gEAAmD,CAAA;IACnD,iEAAoD,CAAA;IACpD,+DAAkD,CAAA;IAClD,uCAA0B,CAAA;AAC5B,CAAC,EAPW,SAAS,yBAAT,SAAS,QAOpB","sourcesContent":["/* istanbul ignore file */\n\n/**\n * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.\n */\nexport enum BtcScopes {\n Namespace = 'bip122',\n Mainnet = 'bip122:000000000019d6689c085ae165831e93',\n Testnet = 'bip122:000000000933ea01ad0ee984209779ba',\n Testnet4 = 'bip122:00000000da84f2bafbbc53dee25a72ae',\n Signet = 'bip122:00000008819873e925422c1ff0f99f7c',\n Regtest = 'bip122:regtest',\n}\n"]}
1
+ {"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":";AAAA,0BAA0B;;;AAE1B;;GAEG;AACH,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,+DAAmD,CAAA;IACnD,+DAAmD,CAAA;IACnD,gEAAoD,CAAA;IACpD,8DAAkD,CAAA;IAClD,sCAA0B,CAAA;AAC5B,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB","sourcesContent":["/* istanbul ignore file */\n\n/**\n * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.\n */\nexport enum BtcScope {\n Mainnet = 'bip122:000000000019d6689c085ae165831e93',\n Testnet = 'bip122:000000000933ea01ad0ee984209779ba',\n Testnet4 = 'bip122:00000000da84f2bafbbc53dee25a72ae',\n Signet = 'bip122:00000008819873e925422c1ff0f99f7c',\n Regtest = 'bip122:regtest',\n}\n"]}
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
3
3
  */
4
- export declare enum BtcScopes {
5
- Namespace = "bip122",
4
+ export declare enum BtcScope {
6
5
  Mainnet = "bip122:000000000019d6689c085ae165831e93",
7
6
  Testnet = "bip122:000000000933ea01ad0ee984209779ba",
8
7
  Testnet4 = "bip122:00000000da84f2bafbbc53dee25a72ae",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,SAAS;IACnB,SAAS,WAAW;IACpB,OAAO,4CAA4C;IACnD,OAAO,4CAA4C;IACnD,QAAQ,4CAA4C;IACpD,MAAM,4CAA4C;IAClD,OAAO,mBAAmB;CAC3B"}
1
+ {"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,QAAQ;IAClB,OAAO,4CAA4C;IACnD,OAAO,4CAA4C;IACnD,QAAQ,4CAA4C;IACpD,MAAM,4CAA4C;IAClD,OAAO,mBAAmB;CAC3B"}
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
3
3
  */
4
- export declare enum BtcScopes {
5
- Namespace = "bip122",
4
+ export declare enum BtcScope {
6
5
  Mainnet = "bip122:000000000019d6689c085ae165831e93",
7
6
  Testnet = "bip122:000000000933ea01ad0ee984209779ba",
8
7
  Testnet4 = "bip122:00000000da84f2bafbbc53dee25a72ae",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,SAAS;IACnB,SAAS,WAAW;IACpB,OAAO,4CAA4C;IACnD,OAAO,4CAA4C;IACnD,QAAQ,4CAA4C;IACpD,MAAM,4CAA4C;IAClD,OAAO,mBAAmB;CAC3B"}
1
+ {"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,QAAQ;IAClB,OAAO,4CAA4C;IACnD,OAAO,4CAA4C;IACnD,QAAQ,4CAA4C;IACpD,MAAM,4CAA4C;IAClD,OAAO,mBAAmB;CAC3B"}
@@ -2,13 +2,12 @@
2
2
  /**
3
3
  * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
4
4
  */
5
- export var BtcScopes;
6
- (function (BtcScopes) {
7
- BtcScopes["Namespace"] = "bip122";
8
- BtcScopes["Mainnet"] = "bip122:000000000019d6689c085ae165831e93";
9
- BtcScopes["Testnet"] = "bip122:000000000933ea01ad0ee984209779ba";
10
- BtcScopes["Testnet4"] = "bip122:00000000da84f2bafbbc53dee25a72ae";
11
- BtcScopes["Signet"] = "bip122:00000008819873e925422c1ff0f99f7c";
12
- BtcScopes["Regtest"] = "bip122:regtest";
13
- })(BtcScopes || (BtcScopes = {}));
5
+ export var BtcScope;
6
+ (function (BtcScope) {
7
+ BtcScope["Mainnet"] = "bip122:000000000019d6689c085ae165831e93";
8
+ BtcScope["Testnet"] = "bip122:000000000933ea01ad0ee984209779ba";
9
+ BtcScope["Testnet4"] = "bip122:00000000da84f2bafbbc53dee25a72ae";
10
+ BtcScope["Signet"] = "bip122:00000008819873e925422c1ff0f99f7c";
11
+ BtcScope["Regtest"] = "bip122:regtest";
12
+ })(BtcScope || (BtcScope = {}));
14
13
  //# sourceMappingURL=constants.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B;;GAEG;AACH,MAAM,CAAN,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,iCAAoB,CAAA;IACpB,gEAAmD,CAAA;IACnD,gEAAmD,CAAA;IACnD,iEAAoD,CAAA;IACpD,+DAAkD,CAAA;IAClD,uCAA0B,CAAA;AAC5B,CAAC,EAPW,SAAS,KAAT,SAAS,QAOpB","sourcesContent":["/* istanbul ignore file */\n\n/**\n * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.\n */\nexport enum BtcScopes {\n Namespace = 'bip122',\n Mainnet = 'bip122:000000000019d6689c085ae165831e93',\n Testnet = 'bip122:000000000933ea01ad0ee984209779ba',\n Testnet4 = 'bip122:00000000da84f2bafbbc53dee25a72ae',\n Signet = 'bip122:00000008819873e925422c1ff0f99f7c',\n Regtest = 'bip122:regtest',\n}\n"]}
1
+ {"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B;;GAEG;AACH,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,+DAAmD,CAAA;IACnD,+DAAmD,CAAA;IACnD,gEAAoD,CAAA;IACpD,8DAAkD,CAAA;IAClD,sCAA0B,CAAA;AAC5B,CAAC,EANW,QAAQ,KAAR,QAAQ,QAMnB","sourcesContent":["/* istanbul ignore file */\n\n/**\n * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.\n */\nexport enum BtcScope {\n Mainnet = 'bip122:000000000019d6689c085ae165831e93',\n Testnet = 'bip122:000000000933ea01ad0ee984209779ba',\n Testnet4 = 'bip122:00000000da84f2bafbbc53dee25a72ae',\n Signet = 'bip122:00000008819873e925422c1ff0f99f7c',\n Regtest = 'bip122:regtest',\n}\n"]}