@metamask/snaps-sdk 7.0.0 → 8.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 (74) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/dist/error-wrappers.d.cts +192 -192
  3. package/dist/error-wrappers.d.mts +192 -192
  4. package/dist/errors.cjs +12 -25
  5. package/dist/errors.cjs.map +1 -1
  6. package/dist/errors.mjs +12 -25
  7. package/dist/errors.mjs.map +1 -1
  8. package/dist/internals/error-wrappers.d.cts +12 -12
  9. package/dist/internals/error-wrappers.d.mts +12 -12
  10. package/dist/jsx/components/form/AccountSelector.cjs +32 -0
  11. package/dist/jsx/components/form/AccountSelector.cjs.map +1 -0
  12. package/dist/jsx/components/form/AccountSelector.d.cts +53 -0
  13. package/dist/jsx/components/form/AccountSelector.d.cts.map +1 -0
  14. package/dist/jsx/components/form/AccountSelector.d.mts +53 -0
  15. package/dist/jsx/components/form/AccountSelector.d.mts.map +1 -0
  16. package/dist/jsx/components/form/AccountSelector.mjs +29 -0
  17. package/dist/jsx/components/form/AccountSelector.mjs.map +1 -0
  18. package/dist/jsx/components/form/Field.cjs.map +1 -1
  19. package/dist/jsx/components/form/Field.d.cts +2 -1
  20. package/dist/jsx/components/form/Field.d.cts.map +1 -1
  21. package/dist/jsx/components/form/Field.d.mts +2 -1
  22. package/dist/jsx/components/form/Field.d.mts.map +1 -1
  23. package/dist/jsx/components/form/Field.mjs.map +1 -1
  24. package/dist/jsx/components/form/index.cjs +2 -1
  25. package/dist/jsx/components/form/index.cjs.map +1 -1
  26. package/dist/jsx/components/form/index.d.cts +4 -2
  27. package/dist/jsx/components/form/index.d.cts.map +1 -1
  28. package/dist/jsx/components/form/index.d.mts +4 -2
  29. package/dist/jsx/components/form/index.d.mts.map +1 -1
  30. package/dist/jsx/components/form/index.mjs +2 -1
  31. package/dist/jsx/components/form/index.mjs.map +1 -1
  32. package/dist/jsx/validation.cjs +16 -2
  33. package/dist/jsx/validation.cjs.map +1 -1
  34. package/dist/jsx/validation.d.cts +8 -4
  35. package/dist/jsx/validation.d.cts.map +1 -1
  36. package/dist/jsx/validation.d.mts +8 -4
  37. package/dist/jsx/validation.d.mts.map +1 -1
  38. package/dist/jsx/validation.mjs +14 -0
  39. package/dist/jsx/validation.mjs.map +1 -1
  40. package/dist/types/handlers/user-input.cjs +18 -3
  41. package/dist/types/handlers/user-input.cjs.map +1 -1
  42. package/dist/types/handlers/user-input.d.cts +32 -0
  43. package/dist/types/handlers/user-input.d.cts.map +1 -1
  44. package/dist/types/handlers/user-input.d.mts +32 -0
  45. package/dist/types/handlers/user-input.d.mts.map +1 -1
  46. package/dist/types/handlers/user-input.mjs +19 -4
  47. package/dist/types/handlers/user-input.mjs.map +1 -1
  48. package/dist/types/interface.cjs +1 -0
  49. package/dist/types/interface.cjs.map +1 -1
  50. package/dist/types/interface.d.cts +13 -1
  51. package/dist/types/interface.d.cts.map +1 -1
  52. package/dist/types/interface.d.mts +13 -1
  53. package/dist/types/interface.d.mts.map +1 -1
  54. package/dist/types/interface.mjs +2 -1
  55. package/dist/types/interface.mjs.map +1 -1
  56. package/dist/types/methods/get-background-events.cjs.map +1 -1
  57. package/dist/types/methods/get-background-events.d.cts +7 -4
  58. package/dist/types/methods/get-background-events.d.cts.map +1 -1
  59. package/dist/types/methods/get-background-events.d.mts +7 -4
  60. package/dist/types/methods/get-background-events.d.mts.map +1 -1
  61. package/dist/types/methods/get-background-events.mjs.map +1 -1
  62. package/dist/types/methods/get-client-status.cjs.map +1 -1
  63. package/dist/types/methods/get-client-status.d.cts +1 -0
  64. package/dist/types/methods/get-client-status.d.cts.map +1 -1
  65. package/dist/types/methods/get-client-status.d.mts +1 -0
  66. package/dist/types/methods/get-client-status.d.mts.map +1 -1
  67. package/dist/types/methods/get-client-status.mjs.map +1 -1
  68. package/dist/types/permissions.cjs.map +1 -1
  69. package/dist/types/permissions.d.cts +9 -2
  70. package/dist/types/permissions.d.cts.map +1 -1
  71. package/dist/types/permissions.d.mts +9 -2
  72. package/dist/types/permissions.d.mts.map +1 -1
  73. package/dist/types/permissions.mjs.map +1 -1
  74. package/package.json +2 -2
@@ -8,6 +8,9 @@ import type { Component } from "../ui/index.cjs";
8
8
  * either the value of an input or a sub-state of a form.
9
9
  */
10
10
  export declare const StateStruct: import("@metamask/superstruct").Struct<string | boolean | {
11
+ addresses: `${string}:${string}:${string}`[];
12
+ accountId: string;
13
+ } | {
11
14
  name: string;
12
15
  size: number;
13
16
  contentType: string;
@@ -18,6 +21,9 @@ export declare const StateStruct: import("@metamask/superstruct").Struct<string
18
21
  asset: `${string}:${string}/${string}:${string}`;
19
22
  }, null>;
20
23
  export declare const FormStateStruct: import("@metamask/superstruct").Struct<Record<string, string | boolean | {
24
+ addresses: `${string}:${string}:${string}`[];
25
+ accountId: string;
26
+ } | {
21
27
  name: string;
22
28
  size: number;
23
29
  contentType: string;
@@ -28,6 +34,9 @@ export declare const FormStateStruct: import("@metamask/superstruct").Struct<Rec
28
34
  asset: `${string}:${string}/${string}:${string}`;
29
35
  } | null>, null>;
30
36
  export declare const InterfaceStateStruct: import("@metamask/superstruct").Struct<Record<string, string | boolean | {
37
+ addresses: `${string}:${string}:${string}`[];
38
+ accountId: string;
39
+ } | {
31
40
  name: string;
32
41
  size: number;
33
42
  contentType: string;
@@ -37,6 +46,9 @@ export declare const InterfaceStateStruct: import("@metamask/superstruct").Struc
37
46
  name: string;
38
47
  asset: `${string}:${string}/${string}:${string}`;
39
48
  } | Record<string, string | boolean | {
49
+ addresses: `${string}:${string}:${string}`[];
50
+ accountId: string;
51
+ } | {
40
52
  name: string;
41
53
  size: number;
42
54
  contentType: string;
@@ -118,7 +130,7 @@ export declare const ComponentOrElementStruct: import("@metamask/superstruct").S
118
130
  variant?: "primary" | "secondary" | undefined;
119
131
  buttonType?: "button" | "submit" | undefined;
120
132
  })[];
121
- } | import("../jsx/index.cjs").SnapElement<import("../jsx/index.cjs").AssetSelectorProps, "AssetSelector"> | import("../jsx/index.cjs").SnapElement<import("../jsx/index.cjs").AddressInputProps, "AddressInput"> | import("../jsx/index.cjs").SnapElement<import("../jsx/index.cjs").IconProps, "Icon"> | import("../jsx/index.cjs").SnapElement<{
133
+ } | import("../jsx/index.cjs").SnapElement<import("../jsx/index.cjs").AccountSelectorProps, "AccountSelector"> | import("../jsx/index.cjs").SnapElement<import("../jsx/index.cjs").AddressInputProps, "AddressInput"> | import("../jsx/index.cjs").SnapElement<import("../jsx/index.cjs").AssetSelectorProps, "AssetSelector"> | import("../jsx/index.cjs").SnapElement<import("../jsx/index.cjs").IconProps, "Icon"> | import("../jsx/index.cjs").SnapElement<{
122
134
  src: string;
123
135
  alt?: string | undefined;
124
136
  borderRadius?: import("../jsx/index.cjs").BorderRadius;
@@ -1 +1 @@
1
- {"version":3,"file":"interface.d.cts","sourceRoot":"","sources":["../../src/types/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAiBnD,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAe;AAEzC,OAAO,KAAK,EAAE,SAAS,EAAE,wBAAc;AAGvC;;;;;GAKG;AAEH,eAAO,MAAM,WAAW;;;;;;;;;QAMtB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;gBAA0C,CAAC;AAEvE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;wBAGhC,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAC9C,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACtD,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEhE,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,UAAU,CAAC;AACxD,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAY,iBAAiB;IAC7B,QAAQ,aAAa;CACtB"}
@@ -8,6 +8,9 @@ import type { Component } from "../ui/index.mjs";
8
8
  * either the value of an input or a sub-state of a form.
9
9
  */
10
10
  export declare const StateStruct: import("@metamask/superstruct").Struct<string | boolean | {
11
+ addresses: `${string}:${string}:${string}`[];
12
+ accountId: string;
13
+ } | {
11
14
  name: string;
12
15
  size: number;
13
16
  contentType: string;
@@ -18,6 +21,9 @@ export declare const StateStruct: import("@metamask/superstruct").Struct<string
18
21
  asset: `${string}:${string}/${string}:${string}`;
19
22
  }, null>;
20
23
  export declare const FormStateStruct: import("@metamask/superstruct").Struct<Record<string, string | boolean | {
24
+ addresses: `${string}:${string}:${string}`[];
25
+ accountId: string;
26
+ } | {
21
27
  name: string;
22
28
  size: number;
23
29
  contentType: string;
@@ -28,6 +34,9 @@ export declare const FormStateStruct: import("@metamask/superstruct").Struct<Rec
28
34
  asset: `${string}:${string}/${string}:${string}`;
29
35
  } | null>, null>;
30
36
  export declare const InterfaceStateStruct: import("@metamask/superstruct").Struct<Record<string, string | boolean | {
37
+ addresses: `${string}:${string}:${string}`[];
38
+ accountId: string;
39
+ } | {
31
40
  name: string;
32
41
  size: number;
33
42
  contentType: string;
@@ -37,6 +46,9 @@ export declare const InterfaceStateStruct: import("@metamask/superstruct").Struc
37
46
  name: string;
38
47
  asset: `${string}:${string}/${string}:${string}`;
39
48
  } | Record<string, string | boolean | {
49
+ addresses: `${string}:${string}:${string}`[];
50
+ accountId: string;
51
+ } | {
40
52
  name: string;
41
53
  size: number;
42
54
  contentType: string;
@@ -118,7 +130,7 @@ export declare const ComponentOrElementStruct: import("@metamask/superstruct").S
118
130
  variant?: "primary" | "secondary" | undefined;
119
131
  buttonType?: "button" | "submit" | undefined;
120
132
  })[];
121
- } | import("../jsx/index.mjs").SnapElement<import("../jsx/index.mjs").AssetSelectorProps, "AssetSelector"> | import("../jsx/index.mjs").SnapElement<import("../jsx/index.mjs").AddressInputProps, "AddressInput"> | import("../jsx/index.mjs").SnapElement<import("../jsx/index.mjs").IconProps, "Icon"> | import("../jsx/index.mjs").SnapElement<{
133
+ } | import("../jsx/index.mjs").SnapElement<import("../jsx/index.mjs").AccountSelectorProps, "AccountSelector"> | import("../jsx/index.mjs").SnapElement<import("../jsx/index.mjs").AddressInputProps, "AddressInput"> | import("../jsx/index.mjs").SnapElement<import("../jsx/index.mjs").AssetSelectorProps, "AssetSelector"> | import("../jsx/index.mjs").SnapElement<import("../jsx/index.mjs").IconProps, "Icon"> | import("../jsx/index.mjs").SnapElement<{
122
134
  src: string;
123
135
  alt?: string | undefined;
124
136
  borderRadius?: import("../jsx/index.mjs").BorderRadius;
@@ -1 +1 @@
1
- {"version":3,"file":"interface.d.mts","sourceRoot":"","sources":["../../src/types/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAiBnD,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAe;AAEzC,OAAO,KAAK,EAAE,SAAS,EAAE,wBAAc;AAGvC;;;;;GAKG;AAEH,eAAO,MAAM,WAAW;;;;;;;;;QAMtB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;gBAA0C,CAAC;AAEvE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;wBAGhC,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAC9C,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACtD,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEhE,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,UAAU,CAAC;AACxD,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+WAKnC,CAAC;AAEH,eAAO,MAAM,sBAA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
  import { boolean, nullable, record, string, union } from "@metamask/superstruct";
2
2
  import { CaipAccountIdStruct, JsonStruct, hasProperty, isObject } from "@metamask/utils";
3
- import { AssetSelectorStateStruct, FileStruct } from "./handlers/index.mjs";
3
+ import { AssetSelectorStateStruct, FileStruct, AccountSelectorStateStruct } from "./handlers/index.mjs";
4
4
  import { selectiveUnion } from "../internals/index.mjs";
5
5
  import { RootJSXElementStruct } from "../jsx/index.mjs";
6
6
  import { ComponentStruct } from "../ui/index.mjs";
@@ -11,6 +11,7 @@ import { ComponentStruct } from "../ui/index.mjs";
11
11
  * either the value of an input or a sub-state of a form.
12
12
  */
13
13
  export const StateStruct = union([
14
+ AccountSelectorStateStruct,
14
15
  AssetSelectorStateStruct,
15
16
  FileStruct,
16
17
  string(),
@@ -1 +1 @@
1
- {"version":3,"file":"interface.mjs","sourceRoot":"","sources":["../../src/types/interface.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,MAAM,EACN,KAAK,EACN,8BAA8B;AAC/B,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,QAAQ,EACT,wBAAwB;AAEzB,OAAO,EAAE,wBAAwB,EAAE,UAAU,EAAE,6BAAmB;AAClE,OAAO,EAAE,cAAc,EAAE,+BAAqB;AAE9C,OAAO,EAAE,oBAAoB,EAAE,yBAAe;AAE9C,OAAO,EAAE,eAAe,EAAE,wBAAc;AAExC;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC;IAC/B,wBAAwB;IACxB,UAAU;IACV,MAAM,EAAE;IACR,OAAO,EAAE;IACT,mBAAmB;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;AAEvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CACxC,MAAM,EAAE,EACR,KAAK,CAAC,CAAC,eAAe,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAChD,CAAC;AAOF,MAAM,CAAC,MAAM,wBAAwB,GAAG,cAAc,CAAC,CAAC,KAAK,EAAE,EAAE;IAC/D,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;QACpD,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC;AAGnE,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,gCAAiB,CAAA;IACjB,4CAA6B,CAAA;IAC7B,oCAAqB,CAAA;AACvB,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n boolean,\n nullable,\n record,\n string,\n union,\n} from '@metamask/superstruct';\nimport {\n CaipAccountIdStruct,\n JsonStruct,\n hasProperty,\n isObject,\n} from '@metamask/utils';\n\nimport { AssetSelectorStateStruct, FileStruct } from './handlers';\nimport { selectiveUnion } from '../internals';\nimport type { JSXElement } from '../jsx';\nimport { RootJSXElementStruct } from '../jsx';\nimport type { Component } from '../ui';\nimport { ComponentStruct } from '../ui';\n\n/**\n * To avoid typing problems with the interface state when manipulating it we\n * have to differentiate the state of a form (that will be contained inside the\n * root state) and the root state since a key in the root stat can contain\n * either the value of an input or a sub-state of a form.\n */\n\nexport const StateStruct = union([\n AssetSelectorStateStruct,\n FileStruct,\n string(),\n boolean(),\n CaipAccountIdStruct,\n]);\n\nexport const FormStateStruct = record(string(), nullable(StateStruct));\n\nexport const InterfaceStateStruct = record(\n string(),\n union([FormStateStruct, nullable(StateStruct)]),\n);\n\nexport type State = Infer<typeof StateStruct>;\nexport type FormState = Infer<typeof FormStateStruct>;\nexport type InterfaceState = Infer<typeof InterfaceStateStruct>;\n\nexport type ComponentOrElement = Component | JSXElement;\nexport const ComponentOrElementStruct = selectiveUnion((value) => {\n if (isObject(value) && !hasProperty(value, 'props')) {\n return ComponentStruct;\n }\n return RootJSXElementStruct;\n});\n\nexport const InterfaceContextStruct = record(string(), JsonStruct);\nexport type InterfaceContext = Infer<typeof InterfaceContextStruct>;\n\nexport enum ContentType {\n Insight = 'Insight',\n Dialog = 'Dialog',\n Notification = 'Notification',\n HomePage = 'HomePage',\n}\n"]}
1
+ {"version":3,"file":"interface.mjs","sourceRoot":"","sources":["../../src/types/interface.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,MAAM,EACN,KAAK,EACN,8BAA8B;AAC/B,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,QAAQ,EACT,wBAAwB;AAEzB,OAAO,EACL,wBAAwB,EACxB,UAAU,EACV,0BAA0B,EAC3B,6BAAmB;AACpB,OAAO,EAAE,cAAc,EAAE,+BAAqB;AAE9C,OAAO,EAAE,oBAAoB,EAAE,yBAAe;AAE9C,OAAO,EAAE,eAAe,EAAE,wBAAc;AAExC;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC;IAC/B,0BAA0B;IAC1B,wBAAwB;IACxB,UAAU;IACV,MAAM,EAAE;IACR,OAAO,EAAE;IACT,mBAAmB;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;AAEvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CACxC,MAAM,EAAE,EACR,KAAK,CAAC,CAAC,eAAe,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAChD,CAAC;AAOF,MAAM,CAAC,MAAM,wBAAwB,GAAG,cAAc,CAAC,CAAC,KAAK,EAAE,EAAE;IAC/D,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;QACpD,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC;AAGnE,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,gCAAiB,CAAA;IACjB,4CAA6B,CAAA;IAC7B,oCAAqB,CAAA;AACvB,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n boolean,\n nullable,\n record,\n string,\n union,\n} from '@metamask/superstruct';\nimport {\n CaipAccountIdStruct,\n JsonStruct,\n hasProperty,\n isObject,\n} from '@metamask/utils';\n\nimport {\n AssetSelectorStateStruct,\n FileStruct,\n AccountSelectorStateStruct,\n} from './handlers';\nimport { selectiveUnion } from '../internals';\nimport type { JSXElement } from '../jsx';\nimport { RootJSXElementStruct } from '../jsx';\nimport type { Component } from '../ui';\nimport { ComponentStruct } from '../ui';\n\n/**\n * To avoid typing problems with the interface state when manipulating it we\n * have to differentiate the state of a form (that will be contained inside the\n * root state) and the root state since a key in the root stat can contain\n * either the value of an input or a sub-state of a form.\n */\n\nexport const StateStruct = union([\n AccountSelectorStateStruct,\n AssetSelectorStateStruct,\n FileStruct,\n string(),\n boolean(),\n CaipAccountIdStruct,\n]);\n\nexport const FormStateStruct = record(string(), nullable(StateStruct));\n\nexport const InterfaceStateStruct = record(\n string(),\n union([FormStateStruct, nullable(StateStruct)]),\n);\n\nexport type State = Infer<typeof StateStruct>;\nexport type FormState = Infer<typeof FormStateStruct>;\nexport type InterfaceState = Infer<typeof InterfaceStateStruct>;\n\nexport type ComponentOrElement = Component | JSXElement;\nexport const ComponentOrElementStruct = selectiveUnion((value) => {\n if (isObject(value) && !hasProperty(value, 'props')) {\n return ComponentStruct;\n }\n return RootJSXElementStruct;\n});\n\nexport const InterfaceContextStruct = record(string(), JsonStruct);\nexport type InterfaceContext = Infer<typeof InterfaceContextStruct>;\n\nexport enum ContentType {\n Insight = 'Insight',\n Dialog = 'Dialog',\n Notification = 'Notification',\n HomePage = 'HomePage',\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"get-background-events.cjs","sourceRoot":"","sources":["../../../src/types/methods/get-background-events.ts"],"names":[],"mappings":"","sourcesContent":["import type { Json } from '@metamask/utils';\n\nimport type { SnapId } from '../snap';\n\n/**\n * Background event type\n *\n * Note: The date generated when scheduling an event with a duration will be represented in UTC.\n *\n * @property id - The unique id representing the event.\n * @property scheduledAt - The ISO 8601 time stamp of when the event was scheduled.\n * @property snapId - The id of the snap that scheduled the event.\n * @property date - The ISO 8601 date of when the event is scheduled for.\n * @property request - The request that is supplied to the `onCronjob` handler when the event is fired.\n */\nexport type BackgroundEvent = {\n id: string;\n scheduledAt: string;\n snapId: SnapId;\n date: string;\n request: {\n method: string;\n jsonrpc?: '2.0' | undefined;\n id?: string | number | null | undefined;\n params?: Json[] | Record<string, Json> | undefined;\n };\n};\n\n/**\n * The result returned by the `snap_getBackgroundEvents` method.\n *\n * It consists of an array background events (if any) for a snap.\n */\nexport type GetBackgroundEventsResult = BackgroundEvent[];\n\n/**\n * The request parameters for the `snap_getBackgroundEvents` method.\n *\n * This method does not accept any parameters.\n */\nexport type GetBackgroundEventsParams = never;\n"]}
1
+ {"version":3,"file":"get-background-events.cjs","sourceRoot":"","sources":["../../../src/types/methods/get-background-events.ts"],"names":[],"mappings":"","sourcesContent":["import type { Json } from '@metamask/utils';\n\nimport type { SnapId } from '../snap';\n\n/**\n * Background event type.\n *\n * Note: The date generated when scheduling an event with a duration will be\n * represented in UTC.\n *\n * @property id - The unique id representing the event.\n * @property scheduledAt - The ISO 8601 time stamp of when the event was\n * scheduled.\n * @property snapId - The id of the snap that scheduled the event.\n * @property date - The ISO 8601 date of when the event is scheduled for.\n * @property request - The request that is supplied to the `onCronjob` handler\n * when the event is fired.\n */\nexport type BackgroundEvent = {\n id: string;\n scheduledAt: string;\n snapId: SnapId;\n date: string;\n request: {\n method: string;\n jsonrpc?: '2.0' | undefined;\n id?: string | number | null | undefined;\n params?: Json[] | Record<string, Json> | undefined;\n };\n};\n\n/**\n * The result returned by the `snap_getBackgroundEvents` method.\n *\n * It consists of an array background events (if any) for a snap.\n */\nexport type GetBackgroundEventsResult = BackgroundEvent[];\n\n/**\n * The request parameters for the `snap_getBackgroundEvents` method.\n *\n * This method does not accept any parameters.\n */\nexport type GetBackgroundEventsParams = never;\n"]}
@@ -1,15 +1,18 @@
1
1
  import type { Json } from "@metamask/utils";
2
2
  import type { SnapId } from "../snap.cjs";
3
3
  /**
4
- * Background event type
4
+ * Background event type.
5
5
  *
6
- * Note: The date generated when scheduling an event with a duration will be represented in UTC.
6
+ * Note: The date generated when scheduling an event with a duration will be
7
+ * represented in UTC.
7
8
  *
8
9
  * @property id - The unique id representing the event.
9
- * @property scheduledAt - The ISO 8601 time stamp of when the event was scheduled.
10
+ * @property scheduledAt - The ISO 8601 time stamp of when the event was
11
+ * scheduled.
10
12
  * @property snapId - The id of the snap that scheduled the event.
11
13
  * @property date - The ISO 8601 date of when the event is scheduled for.
12
- * @property request - The request that is supplied to the `onCronjob` handler when the event is fired.
14
+ * @property request - The request that is supplied to the `onCronjob` handler
15
+ * when the event is fired.
13
16
  */
14
17
  export type BackgroundEvent = {
15
18
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"get-background-events.d.cts","sourceRoot":"","sources":["../../../src/types/methods/get-background-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,oBAAgB;AAEtC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;QAC5B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QACxC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,SAAS,CAAC;KACpD,CAAC;CACH,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,eAAe,EAAE,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC"}
1
+ {"version":3,"file":"get-background-events.d.cts","sourceRoot":"","sources":["../../../src/types/methods/get-background-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,oBAAgB;AAEtC;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;QAC5B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QACxC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,SAAS,CAAC;KACpD,CAAC;CACH,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,eAAe,EAAE,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC"}
@@ -1,15 +1,18 @@
1
1
  import type { Json } from "@metamask/utils";
2
2
  import type { SnapId } from "../snap.mjs";
3
3
  /**
4
- * Background event type
4
+ * Background event type.
5
5
  *
6
- * Note: The date generated when scheduling an event with a duration will be represented in UTC.
6
+ * Note: The date generated when scheduling an event with a duration will be
7
+ * represented in UTC.
7
8
  *
8
9
  * @property id - The unique id representing the event.
9
- * @property scheduledAt - The ISO 8601 time stamp of when the event was scheduled.
10
+ * @property scheduledAt - The ISO 8601 time stamp of when the event was
11
+ * scheduled.
10
12
  * @property snapId - The id of the snap that scheduled the event.
11
13
  * @property date - The ISO 8601 date of when the event is scheduled for.
12
- * @property request - The request that is supplied to the `onCronjob` handler when the event is fired.
14
+ * @property request - The request that is supplied to the `onCronjob` handler
15
+ * when the event is fired.
13
16
  */
14
17
  export type BackgroundEvent = {
15
18
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"get-background-events.d.mts","sourceRoot":"","sources":["../../../src/types/methods/get-background-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,oBAAgB;AAEtC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;QAC5B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QACxC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,SAAS,CAAC;KACpD,CAAC;CACH,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,eAAe,EAAE,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC"}
1
+ {"version":3,"file":"get-background-events.d.mts","sourceRoot":"","sources":["../../../src/types/methods/get-background-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,oBAAgB;AAEtC;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;QAC5B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QACxC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,SAAS,CAAC;KACpD,CAAC;CACH,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,eAAe,EAAE,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-background-events.mjs","sourceRoot":"","sources":["../../../src/types/methods/get-background-events.ts"],"names":[],"mappings":"","sourcesContent":["import type { Json } from '@metamask/utils';\n\nimport type { SnapId } from '../snap';\n\n/**\n * Background event type\n *\n * Note: The date generated when scheduling an event with a duration will be represented in UTC.\n *\n * @property id - The unique id representing the event.\n * @property scheduledAt - The ISO 8601 time stamp of when the event was scheduled.\n * @property snapId - The id of the snap that scheduled the event.\n * @property date - The ISO 8601 date of when the event is scheduled for.\n * @property request - The request that is supplied to the `onCronjob` handler when the event is fired.\n */\nexport type BackgroundEvent = {\n id: string;\n scheduledAt: string;\n snapId: SnapId;\n date: string;\n request: {\n method: string;\n jsonrpc?: '2.0' | undefined;\n id?: string | number | null | undefined;\n params?: Json[] | Record<string, Json> | undefined;\n };\n};\n\n/**\n * The result returned by the `snap_getBackgroundEvents` method.\n *\n * It consists of an array background events (if any) for a snap.\n */\nexport type GetBackgroundEventsResult = BackgroundEvent[];\n\n/**\n * The request parameters for the `snap_getBackgroundEvents` method.\n *\n * This method does not accept any parameters.\n */\nexport type GetBackgroundEventsParams = never;\n"]}
1
+ {"version":3,"file":"get-background-events.mjs","sourceRoot":"","sources":["../../../src/types/methods/get-background-events.ts"],"names":[],"mappings":"","sourcesContent":["import type { Json } from '@metamask/utils';\n\nimport type { SnapId } from '../snap';\n\n/**\n * Background event type.\n *\n * Note: The date generated when scheduling an event with a duration will be\n * represented in UTC.\n *\n * @property id - The unique id representing the event.\n * @property scheduledAt - The ISO 8601 time stamp of when the event was\n * scheduled.\n * @property snapId - The id of the snap that scheduled the event.\n * @property date - The ISO 8601 date of when the event is scheduled for.\n * @property request - The request that is supplied to the `onCronjob` handler\n * when the event is fired.\n */\nexport type BackgroundEvent = {\n id: string;\n scheduledAt: string;\n snapId: SnapId;\n date: string;\n request: {\n method: string;\n jsonrpc?: '2.0' | undefined;\n id?: string | number | null | undefined;\n params?: Json[] | Record<string, Json> | undefined;\n };\n};\n\n/**\n * The result returned by the `snap_getBackgroundEvents` method.\n *\n * It consists of an array background events (if any) for a snap.\n */\nexport type GetBackgroundEventsResult = BackgroundEvent[];\n\n/**\n * The request parameters for the `snap_getBackgroundEvents` method.\n *\n * This method does not accept any parameters.\n */\nexport type GetBackgroundEventsParams = never;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"get-client-status.cjs","sourceRoot":"","sources":["../../../src/types/methods/get-client-status.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * The request parameters for the `snap_getClientStatus` method.\n *\n * This method does not accept any parameters.\n */\nexport type GetClientStatusParams = never;\n\n/**\n * The result returned by the `snap_getClientStatus` method.\n *\n * It returns an object containing useful information about the client.\n */\nexport type GetClientStatusResult = { locked: boolean };\n"]}
1
+ {"version":3,"file":"get-client-status.cjs","sourceRoot":"","sources":["../../../src/types/methods/get-client-status.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * The request parameters for the `snap_getClientStatus` method.\n *\n * This method does not accept any parameters.\n */\nexport type GetClientStatusParams = never;\n\n/**\n * The result returned by the `snap_getClientStatus` method.\n *\n * It returns an object containing useful information about the client.\n */\nexport type GetClientStatusResult = { locked: boolean; active: boolean };\n"]}
@@ -11,5 +11,6 @@ export type GetClientStatusParams = never;
11
11
  */
12
12
  export type GetClientStatusResult = {
13
13
  locked: boolean;
14
+ active: boolean;
14
15
  };
15
16
  //# sourceMappingURL=get-client-status.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-client-status.d.cts","sourceRoot":"","sources":["../../../src/types/methods/get-client-status.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAE1C;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"get-client-status.d.cts","sourceRoot":"","sources":["../../../src/types/methods/get-client-status.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAE1C;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC"}
@@ -11,5 +11,6 @@ export type GetClientStatusParams = never;
11
11
  */
12
12
  export type GetClientStatusResult = {
13
13
  locked: boolean;
14
+ active: boolean;
14
15
  };
15
16
  //# sourceMappingURL=get-client-status.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-client-status.d.mts","sourceRoot":"","sources":["../../../src/types/methods/get-client-status.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAE1C;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"get-client-status.d.mts","sourceRoot":"","sources":["../../../src/types/methods/get-client-status.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAE1C;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-client-status.mjs","sourceRoot":"","sources":["../../../src/types/methods/get-client-status.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * The request parameters for the `snap_getClientStatus` method.\n *\n * This method does not accept any parameters.\n */\nexport type GetClientStatusParams = never;\n\n/**\n * The result returned by the `snap_getClientStatus` method.\n *\n * It returns an object containing useful information about the client.\n */\nexport type GetClientStatusResult = { locked: boolean };\n"]}
1
+ {"version":3,"file":"get-client-status.mjs","sourceRoot":"","sources":["../../../src/types/methods/get-client-status.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * The request parameters for the `snap_getClientStatus` method.\n *\n * This method does not accept any parameters.\n */\nexport type GetClientStatusParams = never;\n\n/**\n * The result returned by the `snap_getClientStatus` method.\n *\n * It returns an object containing useful information about the client.\n */\nexport type GetClientStatusResult = { locked: boolean; active: boolean };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.cjs","sourceRoot":"","sources":["../../src/types/permissions.ts"],"names":[],"mappings":"","sourcesContent":["import type { SupportedCurve } from '@metamask/key-tree';\nimport type { CaipChainId, JsonRpcRequest } from '@metamask/utils';\n\nexport type EmptyObject = Record<string, never>;\n\nexport type Cronjob = {\n expression: string;\n request: Omit<JsonRpcRequest, 'jsonrpc' | 'id'>;\n};\n\nexport type NameLookupMatchers =\n | {\n tlds: string[];\n }\n | {\n schemes: string[];\n }\n | {\n tlds: string[];\n schemes: string[];\n };\n\nexport type Bip32Entropy = {\n curve: SupportedCurve;\n path: string[];\n};\n\nexport type Bip44Entropy = {\n coinType: number;\n};\n\nexport type RequestedSnap = {\n version?: string;\n};\n\nexport type InitialPermissions = Partial<{\n 'endowment:cronjob': {\n jobs?: Cronjob[];\n maxRequestTime?: number;\n };\n 'endowment:ethereum-provider': EmptyObject;\n 'endowment:keyring': {\n allowedOrigins?: string[];\n maxRequestTime?: number;\n };\n 'endowment:lifecycle-hooks'?: {\n maxRequestTime?: number;\n };\n 'endowment:name-lookup': {\n chains?: CaipChainId[];\n matchers?: NameLookupMatchers;\n maxRequestTime?: number;\n };\n 'endowment:network-access': EmptyObject;\n 'endowment:page-home'?: {\n maxRequestTime?: number;\n };\n 'endowment:page-settings'?: {\n maxRequestTime?: number;\n };\n 'endowment:rpc': {\n dapps?: boolean;\n snaps?: boolean;\n allowedOrigins?: string[];\n maxRequestTime?: number;\n };\n 'endowment:signature-insight': {\n allowSignatureOrigin?: boolean;\n maxRequestTime?: number;\n };\n 'endowment:transaction-insight': {\n allowTransactionOrigin?: boolean;\n maxRequestTime?: number;\n };\n 'endowment:webassembly': EmptyObject;\n\n /* eslint-disable @typescript-eslint/naming-convention */\n snap_dialog: EmptyObject;\n snap_getBip32Entropy: Bip32Entropy[];\n snap_getBip32PublicKey: Bip32Entropy[];\n snap_getBip44Entropy: Bip44Entropy[];\n snap_getEntropy: EmptyObject;\n snap_getLocale: EmptyObject;\n snap_manageAccounts: EmptyObject;\n snap_manageState: EmptyObject;\n snap_notify: EmptyObject;\n wallet_snap: Record<string, RequestedSnap>;\n /* eslint-enable @typescript-eslint/naming-convention */\n}>;\n"]}
1
+ {"version":3,"file":"permissions.cjs","sourceRoot":"","sources":["../../src/types/permissions.ts"],"names":[],"mappings":"","sourcesContent":["import type { SupportedCurve } from '@metamask/key-tree';\nimport type { CaipChainId, JsonRpcRequest } from '@metamask/utils';\n\nexport type EmptyObject = Record<string, never>;\n\ntype CronjobRequest = {\n request: Omit<JsonRpcRequest, 'jsonrpc' | 'id'>;\n};\n\ntype CronjobWithExpression = CronjobRequest & {\n expression: string;\n};\n\ntype CronjobWithDuration = CronjobRequest & {\n duration: string;\n};\n\nexport type Cronjob = CronjobWithExpression | CronjobWithDuration;\n\nexport type NameLookupMatchers =\n | {\n tlds: string[];\n }\n | {\n schemes: string[];\n }\n | {\n tlds: string[];\n schemes: string[];\n };\n\nexport type Bip32Entropy = {\n curve: SupportedCurve;\n path: string[];\n};\n\nexport type Bip44Entropy = {\n coinType: number;\n};\n\nexport type RequestedSnap = {\n version?: string;\n};\n\nexport type InitialPermissions = Partial<{\n 'endowment:cronjob': {\n jobs?: Cronjob[];\n maxRequestTime?: number;\n };\n 'endowment:ethereum-provider': EmptyObject;\n 'endowment:keyring': {\n allowedOrigins?: string[];\n maxRequestTime?: number;\n };\n 'endowment:lifecycle-hooks'?: {\n maxRequestTime?: number;\n };\n 'endowment:name-lookup': {\n chains?: CaipChainId[];\n matchers?: NameLookupMatchers;\n maxRequestTime?: number;\n };\n 'endowment:network-access': EmptyObject;\n 'endowment:page-home'?: {\n maxRequestTime?: number;\n };\n 'endowment:page-settings'?: {\n maxRequestTime?: number;\n };\n 'endowment:rpc': {\n dapps?: boolean;\n snaps?: boolean;\n allowedOrigins?: string[];\n maxRequestTime?: number;\n };\n 'endowment:signature-insight': {\n allowSignatureOrigin?: boolean;\n maxRequestTime?: number;\n };\n 'endowment:transaction-insight': {\n allowTransactionOrigin?: boolean;\n maxRequestTime?: number;\n };\n 'endowment:webassembly': EmptyObject;\n\n /* eslint-disable @typescript-eslint/naming-convention */\n snap_dialog: EmptyObject;\n snap_getBip32Entropy: Bip32Entropy[];\n snap_getBip32PublicKey: Bip32Entropy[];\n snap_getBip44Entropy: Bip44Entropy[];\n snap_getEntropy: EmptyObject;\n snap_getLocale: EmptyObject;\n snap_manageAccounts: EmptyObject;\n snap_manageState: EmptyObject;\n snap_notify: EmptyObject;\n wallet_snap: Record<string, RequestedSnap>;\n /* eslint-enable @typescript-eslint/naming-convention */\n}>;\n"]}
@@ -1,10 +1,16 @@
1
1
  import type { SupportedCurve } from "@metamask/key-tree";
2
2
  import type { CaipChainId, JsonRpcRequest } from "@metamask/utils";
3
3
  export type EmptyObject = Record<string, never>;
4
- export type Cronjob = {
5
- expression: string;
4
+ type CronjobRequest = {
6
5
  request: Omit<JsonRpcRequest, 'jsonrpc' | 'id'>;
7
6
  };
7
+ type CronjobWithExpression = CronjobRequest & {
8
+ expression: string;
9
+ };
10
+ type CronjobWithDuration = CronjobRequest & {
11
+ duration: string;
12
+ };
13
+ export type Cronjob = CronjobWithExpression | CronjobWithDuration;
8
14
  export type NameLookupMatchers = {
9
15
  tlds: string[];
10
16
  } | {
@@ -74,4 +80,5 @@ export type InitialPermissions = Partial<{
74
80
  snap_notify: EmptyObject;
75
81
  wallet_snap: Record<string, RequestedSnap>;
76
82
  }>;
83
+ export {};
77
84
  //# sourceMappingURL=permissions.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.d.cts","sourceRoot":"","sources":["../../src/types/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,2BAA2B;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,wBAAwB;AAEnE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEhD,MAAM,MAAM,OAAO,GAAG;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,IAAI,CAAC,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B;IACE,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,GACD;IACE,O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AAO,CAAC;QAChB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,6BAA6B,EAAE;QAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,+BAA+B,EAAE;QAC/B,sBAAsB,CAAC,EAAE,OAAO,CAAC;QACjC,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,uBAAuB,EAAE,WAAW,CAAC;IAGrC,WAAW,EAAE,WAAW,CAAC;IACzB,oBAAoB,EAAE,YAAY,EAAE,CAAC;IACrC,sBAAsB,EAAE,YAAY,EAAE,CAAC;IACvC,oBAAoB,EAAE,YAAY,EAAE,CAAC;IACrC,eAAe,EAAE,WAAW,CAAC;IAC7B,cAAc,EAAE,WAAW,CAAC;IAC5B,mBAAmB,EAAE,WAAW,CAAC;IACjC,gBAAgB,EAAE,WAAW,CAAC;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CAE5C,CAAC,CAAC"}
@@ -1,10 +1,16 @@
1
1
  import type { SupportedCurve } from "@metamask/key-tree";
2
2
  import type { CaipChainId, JsonRpcRequest } from "@metamask/utils";
3
3
  export type EmptyObject = Record<string, never>;
4
- export type Cronjob = {
5
- expression: string;
4
+ type CronjobRequest = {
6
5
  request: Omit<JsonRpcRequest, 'jsonrpc' | 'id'>;
7
6
  };
7
+ type CronjobWithExpression = CronjobRequest & {
8
+ expression: string;
9
+ };
10
+ type CronjobWithDuration = CronjobRequest & {
11
+ duration: string;
12
+ };
13
+ export type Cronjob = CronjobWithExpression | CronjobWithDuration;
8
14
  export type NameLookupMatchers = {
9
15
  tlds: string[];
10
16
  } | {
@@ -74,4 +80,5 @@ export type InitialPermissions = Partial<{
74
80
  snap_notify: EmptyObject;
75
81
  wallet_snap: Record<string, RequestedSnap>;
76
82
  }>;
83
+ export {};
77
84
  //# sourceMappingURL=permissions.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.d.mts","sourceRoot":"","sources":["../../src/types/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,2BAA2B;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,wBAAwB;AAEnE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEhD,MAAM,MAAM,OAAO,GAAG;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,IAAI,CAAC,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B;IACE,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,GACD;IACE,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,GACD;IACE,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEN,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC;IACvC,mBAAmB,EAAE;QACnB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;QACjB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,6BAA6B,EAAE,WAAW,CAAC;IAC3C,mBAAmB,EAAE;QACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAC1B,c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EAAE,WAAW,CAAC;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CAE5C,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.mjs","sourceRoot":"","sources":["../../src/types/permissions.ts"],"names":[],"mappings":"","sourcesContent":["import type { SupportedCurve } from '@metamask/key-tree';\nimport type { CaipChainId, JsonRpcRequest } from '@metamask/utils';\n\nexport type EmptyObject = Record<string, never>;\n\nexport type Cronjob = {\n expression: string;\n request: Omit<JsonRpcRequest, 'jsonrpc' | 'id'>;\n};\n\nexport type NameLookupMatchers =\n | {\n tlds: string[];\n }\n | {\n schemes: string[];\n }\n | {\n tlds: string[];\n schemes: string[];\n };\n\nexport type Bip32Entropy = {\n curve: SupportedCurve;\n path: string[];\n};\n\nexport type Bip44Entropy = {\n coinType: number;\n};\n\nexport type RequestedSnap = {\n version?: string;\n};\n\nexport type InitialPermissions = Partial<{\n 'endowment:cronjob': {\n jobs?: Cronjob[];\n maxRequestTime?: number;\n };\n 'endowment:ethereum-provider': EmptyObject;\n 'endowment:keyring': {\n allowedOrigins?: string[];\n maxRequestTime?: number;\n };\n 'endowment:lifecycle-hooks'?: {\n maxRequestTime?: number;\n };\n 'endowment:name-lookup': {\n chains?: CaipChainId[];\n matchers?: NameLookupMatchers;\n maxRequestTime?: number;\n };\n 'endowment:network-access': EmptyObject;\n 'endowment:page-home'?: {\n maxRequestTime?: number;\n };\n 'endowment:page-settings'?: {\n maxRequestTime?: number;\n };\n 'endowment:rpc': {\n dapps?: boolean;\n snaps?: boolean;\n allowedOrigins?: string[];\n maxRequestTime?: number;\n };\n 'endowment:signature-insight': {\n allowSignatureOrigin?: boolean;\n maxRequestTime?: number;\n };\n 'endowment:transaction-insight': {\n allowTransactionOrigin?: boolean;\n maxRequestTime?: number;\n };\n 'endowment:webassembly': EmptyObject;\n\n /* eslint-disable @typescript-eslint/naming-convention */\n snap_dialog: EmptyObject;\n snap_getBip32Entropy: Bip32Entropy[];\n snap_getBip32PublicKey: Bip32Entropy[];\n snap_getBip44Entropy: Bip44Entropy[];\n snap_getEntropy: EmptyObject;\n snap_getLocale: EmptyObject;\n snap_manageAccounts: EmptyObject;\n snap_manageState: EmptyObject;\n snap_notify: EmptyObject;\n wallet_snap: Record<string, RequestedSnap>;\n /* eslint-enable @typescript-eslint/naming-convention */\n}>;\n"]}
1
+ {"version":3,"file":"permissions.mjs","sourceRoot":"","sources":["../../src/types/permissions.ts"],"names":[],"mappings":"","sourcesContent":["import type { SupportedCurve } from '@metamask/key-tree';\nimport type { CaipChainId, JsonRpcRequest } from '@metamask/utils';\n\nexport type EmptyObject = Record<string, never>;\n\ntype CronjobRequest = {\n request: Omit<JsonRpcRequest, 'jsonrpc' | 'id'>;\n};\n\ntype CronjobWithExpression = CronjobRequest & {\n expression: string;\n};\n\ntype CronjobWithDuration = CronjobRequest & {\n duration: string;\n};\n\nexport type Cronjob = CronjobWithExpression | CronjobWithDuration;\n\nexport type NameLookupMatchers =\n | {\n tlds: string[];\n }\n | {\n schemes: string[];\n }\n | {\n tlds: string[];\n schemes: string[];\n };\n\nexport type Bip32Entropy = {\n curve: SupportedCurve;\n path: string[];\n};\n\nexport type Bip44Entropy = {\n coinType: number;\n};\n\nexport type RequestedSnap = {\n version?: string;\n};\n\nexport type InitialPermissions = Partial<{\n 'endowment:cronjob': {\n jobs?: Cronjob[];\n maxRequestTime?: number;\n };\n 'endowment:ethereum-provider': EmptyObject;\n 'endowment:keyring': {\n allowedOrigins?: string[];\n maxRequestTime?: number;\n };\n 'endowment:lifecycle-hooks'?: {\n maxRequestTime?: number;\n };\n 'endowment:name-lookup': {\n chains?: CaipChainId[];\n matchers?: NameLookupMatchers;\n maxRequestTime?: number;\n };\n 'endowment:network-access': EmptyObject;\n 'endowment:page-home'?: {\n maxRequestTime?: number;\n };\n 'endowment:page-settings'?: {\n maxRequestTime?: number;\n };\n 'endowment:rpc': {\n dapps?: boolean;\n snaps?: boolean;\n allowedOrigins?: string[];\n maxRequestTime?: number;\n };\n 'endowment:signature-insight': {\n allowSignatureOrigin?: boolean;\n maxRequestTime?: number;\n };\n 'endowment:transaction-insight': {\n allowTransactionOrigin?: boolean;\n maxRequestTime?: number;\n };\n 'endowment:webassembly': EmptyObject;\n\n /* eslint-disable @typescript-eslint/naming-convention */\n snap_dialog: EmptyObject;\n snap_getBip32Entropy: Bip32Entropy[];\n snap_getBip32PublicKey: Bip32Entropy[];\n snap_getBip44Entropy: Bip44Entropy[];\n snap_getEntropy: EmptyObject;\n snap_getLocale: EmptyObject;\n snap_manageAccounts: EmptyObject;\n snap_manageState: EmptyObject;\n snap_notify: EmptyObject;\n wallet_snap: Record<string, RequestedSnap>;\n /* eslint-enable @typescript-eslint/naming-convention */\n}>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/snaps-sdk",
3
- "version": "7.0.0",
3
+ "version": "8.0.0",
4
4
  "description": "A library containing the core functionality for building MetaMask Snaps",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -115,7 +115,7 @@
115
115
  "typescript": "~5.3.3"
116
116
  },
117
117
  "engines": {
118
- "node": "^18.16 || >=20"
118
+ "node": "^20 || >=22"
119
119
  },
120
120
  "publishConfig": {
121
121
  "access": "public",