@metamask/snaps-sdk 6.1.1 → 6.2.1

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 (102) hide show
  1. package/CHANGELOG.md +13 -2
  2. package/dist/index.js +17 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +17 -1
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/jsx/index.js +71 -43
  7. package/dist/jsx/index.js.map +1 -1
  8. package/dist/jsx/index.mjs +71 -43
  9. package/dist/jsx/index.mjs.map +1 -1
  10. package/dist/jsx/jsx-dev-runtime.js +17 -1
  11. package/dist/jsx/jsx-dev-runtime.js.map +1 -1
  12. package/dist/jsx/jsx-dev-runtime.mjs +17 -1
  13. package/dist/jsx/jsx-dev-runtime.mjs.map +1 -1
  14. package/dist/tsconfig.build.tsbuildinfo +1 -1
  15. package/dist/types/errors.d.ts +1 -1
  16. package/dist/types/images.d.ts +1 -1
  17. package/dist/types/internals/error-wrappers.d.ts +1 -1
  18. package/dist/types/internals/helpers.d.ts +2 -2
  19. package/dist/types/internals/jsx.d.ts +3 -3
  20. package/dist/types/jsx/component.d.ts +9 -9
  21. package/dist/types/jsx/components/Address.d.ts +2 -2
  22. package/dist/types/jsx/components/Box.d.ts +2 -2
  23. package/dist/types/jsx/components/Card.d.ts +2 -2
  24. package/dist/types/jsx/components/Container.d.ts +2 -2
  25. package/dist/types/jsx/components/Copyable.d.ts +2 -2
  26. package/dist/types/jsx/components/Divider.d.ts +1 -1
  27. package/dist/types/jsx/components/Footer.d.ts +2 -2
  28. package/dist/types/jsx/components/Heading.d.ts +2 -2
  29. package/dist/types/jsx/components/Image.d.ts +2 -2
  30. package/dist/types/jsx/components/Link.d.ts +3 -3
  31. package/dist/types/jsx/components/Row.d.ts +3 -3
  32. package/dist/types/jsx/components/Spinner.d.ts +1 -1
  33. package/dist/types/jsx/components/Text.d.ts +3 -3
  34. package/dist/types/jsx/components/Tooltip.d.ts +3 -3
  35. package/dist/types/jsx/components/Value.d.ts +2 -2
  36. package/dist/types/jsx/components/form/Button.d.ts +2 -2
  37. package/dist/types/jsx/components/form/Checkbox.d.ts +2 -2
  38. package/dist/types/jsx/components/form/Dropdown.d.ts +2 -2
  39. package/dist/types/jsx/components/form/Field.d.ts +4 -3
  40. package/dist/types/jsx/components/form/FileInput.d.ts +2 -2
  41. package/dist/types/jsx/components/form/Form.d.ts +2 -2
  42. package/dist/types/jsx/components/form/Input.d.ts +2 -2
  43. package/dist/types/jsx/components/form/Option.d.ts +2 -2
  44. package/dist/types/jsx/components/form/Radio.d.ts +35 -0
  45. package/dist/types/jsx/components/form/RadioGroup.d.ts +29 -0
  46. package/dist/types/jsx/components/form/index.d.ts +5 -1
  47. package/dist/types/jsx/components/formatting/Bold.d.ts +3 -3
  48. package/dist/types/jsx/components/formatting/Italic.d.ts +3 -3
  49. package/dist/types/jsx/components/formatting/index.d.ts +1 -1
  50. package/dist/types/jsx/components/index.d.ts +1 -1
  51. package/dist/types/jsx/validation.d.ts +33 -4
  52. package/dist/types/types/caip.d.ts +2 -2
  53. package/dist/types/types/handlers/cronjob.d.ts +1 -1
  54. package/dist/types/types/handlers/home-page.d.ts +2 -2
  55. package/dist/types/types/handlers/keyring.d.ts +1 -1
  56. package/dist/types/types/handlers/lifecycle.d.ts +3 -3
  57. package/dist/types/types/handlers/name-lookup.d.ts +8 -8
  58. package/dist/types/types/handlers/rpc-request.d.ts +1 -1
  59. package/dist/types/types/handlers/signature.d.ts +8 -8
  60. package/dist/types/types/handlers/transaction.d.ts +5 -5
  61. package/dist/types/types/handlers/user-input.d.ts +7 -7
  62. package/dist/types/types/interface.d.ts +13 -6
  63. package/dist/types/types/methods/create-interface.d.ts +2 -2
  64. package/dist/types/types/methods/dialog.d.ts +6 -6
  65. package/dist/types/types/methods/get-bip32-entropy.d.ts +2 -2
  66. package/dist/types/types/methods/get-bip32-public-key.d.ts +2 -2
  67. package/dist/types/types/methods/get-bip44-entropy.d.ts +2 -2
  68. package/dist/types/types/methods/get-client-status.d.ts +2 -2
  69. package/dist/types/types/methods/get-entropy.d.ts +2 -2
  70. package/dist/types/types/methods/get-file.d.ts +2 -2
  71. package/dist/types/types/methods/get-interface-state.d.ts +2 -2
  72. package/dist/types/types/methods/get-locale.d.ts +2 -2
  73. package/dist/types/types/methods/get-preferences.d.ts +15 -0
  74. package/dist/types/types/methods/get-snaps.d.ts +2 -2
  75. package/dist/types/types/methods/index.d.ts +1 -0
  76. package/dist/types/types/methods/invoke-keyring.d.ts +2 -2
  77. package/dist/types/types/methods/invoke-snap.d.ts +2 -2
  78. package/dist/types/types/methods/manage-accounts.d.ts +2 -2
  79. package/dist/types/types/methods/manage-state.d.ts +5 -5
  80. package/dist/types/types/methods/methods.d.ts +4 -2
  81. package/dist/types/types/methods/notify.d.ts +2 -2
  82. package/dist/types/types/methods/request-snaps.d.ts +2 -2
  83. package/dist/types/types/methods/resolve-interface.d.ts +2 -2
  84. package/dist/types/types/methods/update-interface.d.ts +2 -2
  85. package/dist/types/types/permissions.d.ts +7 -7
  86. package/dist/types/types/provider.d.ts +3 -3
  87. package/dist/types/types/snap.d.ts +2 -2
  88. package/dist/types/ui/builder.d.ts +2 -2
  89. package/dist/types/ui/components/address.d.ts +1 -1
  90. package/dist/types/ui/components/button.d.ts +1 -1
  91. package/dist/types/ui/components/copyable.d.ts +1 -1
  92. package/dist/types/ui/components/divider.d.ts +1 -1
  93. package/dist/types/ui/components/form.d.ts +2 -2
  94. package/dist/types/ui/components/heading.d.ts +1 -1
  95. package/dist/types/ui/components/image.d.ts +1 -1
  96. package/dist/types/ui/components/input.d.ts +1 -1
  97. package/dist/types/ui/components/panel.d.ts +3 -3
  98. package/dist/types/ui/components/row.d.ts +1 -1
  99. package/dist/types/ui/components/spinner.d.ts +1 -1
  100. package/dist/types/ui/components/text.d.ts +1 -1
  101. package/dist/types/ui/nodes.d.ts +2 -2
  102. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [6.2.1]
10
+ ### Fixed
11
+ - Add structs to `typedUnion` schema ([#2623](https://github.com/MetaMask/snaps/pull/2623))
12
+
13
+ ## [6.2.0]
14
+ ### Added
15
+ - Add `snap_getPreferences` ([#2607](https://github.com/MetaMask/snaps/pull/2607))
16
+ - Add `RadioGroup` component ([#2592](https://github.com/MetaMask/snaps/pull/2592))
17
+
9
18
  ## [6.1.1]
10
19
  ### Changed
11
20
  - Bump `@metamask/providers` from `17.0.0` to `^17.1.2` ([#2598](https://github.com/metamask/snaps/pull/2598))
@@ -13,7 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
22
  ## [6.1.0]
14
23
  ### Added
15
24
  - Add non-restricted RPC method `snap_resolveInterface` ([#2509](https://github.com/metamask/snaps/pull/2509))
16
- - This method allows a Snap to resolve a given user interface bound to a `snap_dialog` with a custom value.
25
+ - This method allows a Snap to resolve a given user interface bound to a `snap_dialog` with a custom value.
17
26
  - Add new types `ResolveInterfaceParams`, `ResolveInterfaceResult`.
18
27
  - Add `Card` component ([#2480](https://github.com/metamask/snaps/pull/2480))
19
28
  - Add `BoxChildStruct`, `FormChildStruct`, `FieldChildUnionStruct` ([#2409](https://github.com/metamask/snaps/pull/2409))
@@ -206,7 +215,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
206
215
  ### Added
207
216
  - Initial release of this package.
208
217
 
209
- [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.1.1...HEAD
218
+ [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.2.1...HEAD
219
+ [6.2.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.2.0...@metamask/snaps-sdk@6.2.1
220
+ [6.2.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.1.1...@metamask/snaps-sdk@6.2.0
210
221
  [6.1.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.1.0...@metamask/snaps-sdk@6.1.1
211
222
  [6.1.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.0.0...@metamask/snaps-sdk@6.1.0
212
223
  [6.0.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@5.0.0...@metamask/snaps-sdk@6.0.0
package/dist/index.js CHANGED
@@ -311,7 +311,7 @@ function enumValue(constant) {
311
311
  function typedUnion(structs) {
312
312
  return new import_superstruct.Struct({
313
313
  type: "union",
314
- schema: null,
314
+ schema: structs,
315
315
  *entries(value, context) {
316
316
  if (!(0, import_utils2.isPlainObject)(value) || !(0, import_utils2.hasProperty)(value, "type")) {
317
317
  return;
@@ -905,6 +905,18 @@ var DropdownStruct = element("Dropdown", {
905
905
  value: (0, import_superstruct18.optional)((0, import_superstruct18.string)()),
906
906
  children: children([OptionStruct])
907
907
  });
908
+ var RadioStruct = element("Radio", {
909
+ value: (0, import_superstruct18.string)(),
910
+ children: (0, import_superstruct18.string)()
911
+ });
912
+ var RadioGroupStruct = element(
913
+ "RadioGroup",
914
+ {
915
+ name: (0, import_superstruct18.string)(),
916
+ value: (0, import_superstruct18.optional)((0, import_superstruct18.string)()),
917
+ children: children([RadioStruct])
918
+ }
919
+ );
908
920
  var FileInputStruct = element(
909
921
  "FileInput",
910
922
  {
@@ -917,6 +929,7 @@ var BUTTON_INPUT = [InputStruct2, ButtonStruct2];
917
929
  var FIELD_CHILDREN_ARRAY = [
918
930
  InputStruct2,
919
931
  DropdownStruct,
932
+ RadioGroupStruct,
920
933
  FileInputStruct,
921
934
  CheckboxStruct
922
935
  ];
@@ -1065,6 +1078,7 @@ var BoxChildStruct = typedUnion([
1065
1078
  CopyableStruct2,
1066
1079
  DividerStruct2,
1067
1080
  DropdownStruct,
1081
+ RadioGroupStruct,
1068
1082
  FileInputStruct,
1069
1083
  FormStruct2,
1070
1084
  HeadingStruct2,
@@ -1103,6 +1117,8 @@ var JSXElementStruct = typedUnion([
1103
1117
  TextStruct2,
1104
1118
  DropdownStruct,
1105
1119
  OptionStruct,
1120
+ RadioGroupStruct,
1121
+ RadioStruct,
1106
1122
  ValueStruct,
1107
1123
  TooltipStruct,
1108
1124
  CheckboxStruct,