@metamask/keyring-api 6.2.0 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/CHANGELOG.md +32 -1
  2. package/dist/KeyringClient.js +9 -9
  3. package/dist/KeyringClient.js.map +1 -1
  4. package/dist/api/account.d.ts +62 -0
  5. package/dist/api/account.js +56 -0
  6. package/dist/api/account.js.map +1 -0
  7. package/dist/api/balance.d.ts +9 -0
  8. package/dist/api/balance.js +11 -0
  9. package/dist/api/balance.js.map +1 -0
  10. package/dist/api/export.d.ts +8 -0
  11. package/dist/api/export.js +7 -0
  12. package/dist/api/export.js.map +1 -0
  13. package/dist/api/index.d.ts +6 -0
  14. package/dist/api/index.js +23 -0
  15. package/dist/api/index.js.map +1 -0
  16. package/dist/{api.d.ts → api/keyring.d.ts} +34 -125
  17. package/dist/api/keyring.js +3 -0
  18. package/dist/api/keyring.js.map +1 -0
  19. package/dist/api/request.d.ts +39 -0
  20. package/dist/api/request.js +29 -0
  21. package/dist/api/request.js.map +1 -0
  22. package/dist/api/response.d.ts +24 -0
  23. package/dist/api/response.js +44 -0
  24. package/dist/api/response.js.map +1 -0
  25. package/dist/btc/types.d.ts +4 -7
  26. package/dist/btc/types.js +10 -12
  27. package/dist/btc/types.js.map +1 -1
  28. package/dist/eth/erc4337/types.d.ts +1 -1
  29. package/dist/eth/erc4337/types.js +2 -1
  30. package/dist/eth/erc4337/types.js.map +1 -1
  31. package/dist/eth/types.d.ts +9 -15
  32. package/dist/eth/types.js +23 -29
  33. package/dist/eth/types.js.map +1 -1
  34. package/dist/eth/utils.d.ts +3 -2
  35. package/dist/eth/utils.js +3 -2
  36. package/dist/eth/utils.js.map +1 -1
  37. package/dist/internal/api.d.ts +94 -112
  38. package/dist/internal/api.js +35 -22
  39. package/dist/internal/api.js.map +1 -1
  40. package/dist/internal/events.d.ts +44 -96
  41. package/dist/internal/events.js +10 -10
  42. package/dist/internal/events.js.map +1 -1
  43. package/dist/internal/rpc.d.ts +1 -0
  44. package/dist/internal/rpc.js +1 -0
  45. package/dist/internal/rpc.js.map +1 -1
  46. package/dist/internal/types.d.ts +65 -6
  47. package/dist/internal/types.js +7 -9
  48. package/dist/internal/types.js.map +1 -1
  49. package/dist/rpc-handler.d.ts +12 -0
  50. package/dist/rpc-handler.js +40 -2
  51. package/dist/rpc-handler.js.map +1 -1
  52. package/dist/superstruct.d.ts +9 -4
  53. package/dist/superstruct.js +14 -14
  54. package/dist/superstruct.js.map +1 -1
  55. package/dist/utils/caip.d.ts +37 -0
  56. package/dist/utils/caip.js +48 -0
  57. package/dist/utils/caip.js.map +1 -0
  58. package/dist/utils/index.d.ts +3 -0
  59. package/dist/utils/index.js +20 -0
  60. package/dist/utils/index.js.map +1 -0
  61. package/dist/utils/types.d.ts +17 -0
  62. package/dist/utils/types.js +29 -0
  63. package/dist/utils/types.js.map +1 -0
  64. package/dist/utils/typing.d.ts +32 -0
  65. package/dist/utils/typing.js +21 -0
  66. package/dist/utils/typing.js.map +1 -0
  67. package/package.json +26 -26
  68. package/dist/api.js +0 -108
  69. package/dist/api.js.map +0 -1
  70. package/dist/base-types.d.ts +0 -62
  71. package/dist/base-types.js +0 -32
  72. package/dist/base-types.js.map +0 -1
  73. package/dist/utils.d.ts +0 -26
  74. package/dist/utils.js +0 -26
  75. package/dist/utils.js.map +0 -1
package/dist/utils.d.ts DELETED
@@ -1,26 +0,0 @@
1
- import type { Struct } from 'superstruct';
2
- /**
3
- * UUIDv4 struct.
4
- */
5
- export declare const UuidStruct: Struct<string, null>;
6
- /**
7
- * Omit keys from a union type.
8
- *
9
- * The normal `Omit` type does not distribute over unions. So we use this
10
- * workaround that applies `Omit` to each member of the union.
11
- *
12
- * See: <https://github.com/microsoft/TypeScript/issues/31501#issuecomment-1280579305>
13
- */
14
- export declare type OmitUnion<Type, Key extends keyof any> = Type extends any ? Omit<Type, Key> : never;
15
- /**
16
- * Assert that a value is valid according to a struct.
17
- *
18
- * It is similar to superstruct's mask function, but it does not ignore extra
19
- * properties.
20
- *
21
- * @param value - Value to check.
22
- * @param struct - Struct to validate the value against.
23
- * @param message - Error message to throw if the value is not valid.
24
- * @returns The value if it is valid.
25
- */
26
- export declare function strictMask<Type, Schema>(value: unknown, struct: Struct<Type, Schema>, message?: string): Type;
package/dist/utils.js DELETED
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.strictMask = exports.UuidStruct = void 0;
4
- const superstruct_1 = require("superstruct");
5
- const superstruct_2 = require("./superstruct");
6
- /**
7
- * UUIDv4 struct.
8
- */
9
- exports.UuidStruct = (0, superstruct_2.definePattern)('UuidV4', /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu);
10
- /**
11
- * Assert that a value is valid according to a struct.
12
- *
13
- * It is similar to superstruct's mask function, but it does not ignore extra
14
- * properties.
15
- *
16
- * @param value - Value to check.
17
- * @param struct - Struct to validate the value against.
18
- * @param message - Error message to throw if the value is not valid.
19
- * @returns The value if it is valid.
20
- */
21
- function strictMask(value, struct, message) {
22
- (0, superstruct_1.assert)(value, struct, message);
23
- return value;
24
- }
25
- exports.strictMask = strictMask;
26
- //# sourceMappingURL=utils.js.map
package/dist/utils.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA,6CAAqC;AAGrC,+CAA8C;AAE9C;;GAEG;AACU,QAAA,UAAU,GAAG,IAAA,2BAAa,EACrC,QAAQ,EACR,yEAAyE,CAC1E,CAAC;AAcF;;;;;;;;;;GAUG;AACH,SAAgB,UAAU,CACxB,KAAc,EACd,MAA4B,EAC5B,OAAgB;IAEhB,IAAA,oBAAM,EAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,OAAO,KAAK,CAAC;AACf,CAAC;AAPD,gCAOC","sourcesContent":["import { assert } from 'superstruct';\nimport type { Struct } from 'superstruct';\n\nimport { definePattern } from './superstruct';\n\n/**\n * UUIDv4 struct.\n */\nexport const UuidStruct = definePattern(\n 'UuidV4',\n /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,\n);\n\n/**\n * Omit keys from a union type.\n *\n * The normal `Omit` type does not distribute over unions. So we use this\n * workaround that applies `Omit` to each member of the union.\n *\n * See: <https://github.com/microsoft/TypeScript/issues/31501#issuecomment-1280579305>\n */\nexport type OmitUnion<Type, Key extends keyof any> = Type extends any\n ? Omit<Type, Key>\n : never;\n\n/**\n * Assert that a value is valid according to a struct.\n *\n * It is similar to superstruct's mask function, but it does not ignore extra\n * properties.\n *\n * @param value - Value to check.\n * @param struct - Struct to validate the value against.\n * @param message - Error message to throw if the value is not valid.\n * @returns The value if it is valid.\n */\nexport function strictMask<Type, Schema>(\n value: unknown,\n struct: Struct<Type, Schema>,\n message?: string,\n): Type {\n assert(value, struct, message);\n return value;\n}\n"]}