@metamask/snaps-rpc-methods 7.0.1 → 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 (31) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/dist/{chunk-AKRFLGOS.mjs → chunk-AMBEX4N4.mjs} +2 -2
  3. package/dist/{chunk-FBOZCV3C.js → chunk-EGKFC56F.js} +3 -3
  4. package/dist/{chunk-7NBRKDKJ.mjs → chunk-NESDQ4PF.mjs} +9 -54
  5. package/dist/chunk-NESDQ4PF.mjs.map +1 -0
  6. package/dist/{chunk-KO4MKRYZ.js → chunk-R2M4YLJ7.js} +7 -52
  7. package/dist/chunk-R2M4YLJ7.js.map +1 -0
  8. package/dist/{chunk-LVTN25J2.js → chunk-RZXF4KSR.js} +3 -3
  9. package/dist/{chunk-LVTN25J2.js.map → chunk-RZXF4KSR.js.map} +1 -1
  10. package/dist/{chunk-3S7DJI4I.mjs → chunk-SU6KOIVB.mjs} +2 -2
  11. package/dist/chunk-SU6KOIVB.mjs.map +1 -0
  12. package/dist/index.js +4 -4
  13. package/dist/index.mjs +5 -5
  14. package/dist/permissions.js +4 -4
  15. package/dist/permissions.mjs +3 -3
  16. package/dist/restricted/index.js +3 -3
  17. package/dist/restricted/index.mjs +4 -4
  18. package/dist/restricted/manageState.js +2 -2
  19. package/dist/restricted/manageState.mjs +3 -3
  20. package/dist/tsconfig.build.tsbuildinfo +1 -1
  21. package/dist/types/permitted/createInterface.d.ts +44 -40
  22. package/dist/types/permitted/updateInterface.d.ts +45 -41
  23. package/dist/types/restricted/dialog.d.ts +190 -166
  24. package/dist/types/restricted/index.d.ts +1 -1
  25. package/dist/types/restricted/manageState.d.ts +5 -31
  26. package/package.json +6 -7
  27. package/dist/chunk-3S7DJI4I.mjs.map +0 -1
  28. package/dist/chunk-7NBRKDKJ.mjs.map +0 -1
  29. package/dist/chunk-KO4MKRYZ.js.map +0 -1
  30. /package/dist/{chunk-AKRFLGOS.mjs.map → chunk-AMBEX4N4.mjs.map} +0 -0
  31. /package/dist/{chunk-FBOZCV3C.js.map → chunk-EGKFC56F.js.map} +0 -0
@@ -11,6 +11,38 @@ export declare type CreateInterfaceMethodHooks = {
11
11
  export declare const createInterfaceHandler: PermittedHandlerExport<CreateInterfaceMethodHooks, CreateInterfaceParameters, CreateInterfaceResult>;
12
12
  declare const CreateInterfaceParametersStruct: import("superstruct").Struct<{
13
13
  ui: import("@metamask/snaps-sdk").Panel | {
14
+ type: import("@metamask/snaps-sdk").NodeType.Input;
15
+ name: string;
16
+ value?: string | undefined;
17
+ error?: string | undefined;
18
+ inputType?: "number" | "text" | "password" | undefined;
19
+ placeholder?: string | undefined;
20
+ label?: string | undefined;
21
+ } | {
22
+ value: string;
23
+ type: import("@metamask/snaps-sdk").NodeType.Button;
24
+ name?: string | undefined;
25
+ variant?: "primary" | "secondary" | undefined;
26
+ buttonType?: "button" | "submit" | undefined;
27
+ } | {
28
+ type: import("@metamask/snaps-sdk").NodeType.Form;
29
+ name: string;
30
+ children: ({
31
+ type: import("@metamask/snaps-sdk").NodeType.Input;
32
+ name: string;
33
+ value?: string | undefined;
34
+ error?: string | undefined;
35
+ inputType?: "number" | "text" | "password" | undefined;
36
+ placeholder?: string | undefined;
37
+ label?: string | undefined;
38
+ } | {
39
+ value: string;
40
+ type: import("@metamask/snaps-sdk").NodeType.Button;
41
+ name?: string | undefined;
42
+ variant?: "primary" | "secondary" | undefined;
43
+ buttonType?: "button" | "submit" | undefined;
44
+ })[];
45
+ } | {
14
46
  value: string;
15
47
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
16
48
  sensitive?: boolean | undefined;
@@ -29,7 +61,7 @@ declare const CreateInterfaceParametersStruct: import("superstruct").Struct<{
29
61
  type: import("@metamask/snaps-sdk").NodeType.Text;
30
62
  markdown?: boolean | undefined;
31
63
  } | {
32
- value: string;
64
+ value: `0x${string}`;
33
65
  type: import("@metamask/snaps-sdk").NodeType.Address;
34
66
  } | {
35
67
  value: {
@@ -40,19 +72,22 @@ declare const CreateInterfaceParametersStruct: import("superstruct").Struct<{
40
72
  type: import("@metamask/snaps-sdk").NodeType.Text;
41
73
  markdown?: boolean | undefined;
42
74
  } | {
43
- value: string;
75
+ value: `0x${string}`;
44
76
  type: import("@metamask/snaps-sdk").NodeType.Address;
45
77
  };
46
78
  type: import("@metamask/snaps-sdk").NodeType.Row;
47
79
  label: string;
48
80
  variant?: "default" | "warning" | "critical" | undefined;
49
- } | {
81
+ };
82
+ }, {
83
+ ui: import("superstruct").Struct<import("@metamask/snaps-sdk").Panel | {
50
84
  type: import("@metamask/snaps-sdk").NodeType.Input;
51
85
  name: string;
52
86
  value?: string | undefined;
53
- label?: string | undefined;
87
+ error?: string | undefined;
54
88
  inputType?: "number" | "text" | "password" | undefined;
55
89
  placeholder?: string | undefined;
90
+ label?: string | undefined;
56
91
  } | {
57
92
  value: string;
58
93
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -66,9 +101,10 @@ declare const CreateInterfaceParametersStruct: import("superstruct").Struct<{
66
101
  type: import("@metamask/snaps-sdk").NodeType.Input;
67
102
  name: string;
68
103
  value?: string | undefined;
69
- label?: string | undefined;
104
+ error?: string | undefined;
70
105
  inputType?: "number" | "text" | "password" | undefined;
71
106
  placeholder?: string | undefined;
107
+ label?: string | undefined;
72
108
  } | {
73
109
  value: string;
74
110
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -76,9 +112,7 @@ declare const CreateInterfaceParametersStruct: import("superstruct").Struct<{
76
112
  variant?: "primary" | "secondary" | undefined;
77
113
  buttonType?: "button" | "submit" | undefined;
78
114
  })[];
79
- };
80
- }, {
81
- ui: import("superstruct").Struct<import("@metamask/snaps-sdk").Panel | {
115
+ } | {
82
116
  value: string;
83
117
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
84
118
  sensitive?: boolean | undefined;
@@ -97,7 +131,7 @@ declare const CreateInterfaceParametersStruct: import("superstruct").Struct<{
97
131
  type: import("@metamask/snaps-sdk").NodeType.Text;
98
132
  markdown?: boolean | undefined;
99
133
  } | {
100
- value: string;
134
+ value: `0x${string}`;
101
135
  type: import("@metamask/snaps-sdk").NodeType.Address;
102
136
  } | {
103
137
  value: {
@@ -108,42 +142,12 @@ declare const CreateInterfaceParametersStruct: import("superstruct").Struct<{
108
142
  type: import("@metamask/snaps-sdk").NodeType.Text;
109
143
  markdown?: boolean | undefined;
110
144
  } | {
111
- value: string;
145
+ value: `0x${string}`;
112
146
  type: import("@metamask/snaps-sdk").NodeType.Address;
113
147
  };
114
148
  type: import("@metamask/snaps-sdk").NodeType.Row;
115
149
  label: string;
116
150
  variant?: "default" | "warning" | "critical" | undefined;
117
- } | {
118
- type: import("@metamask/snaps-sdk").NodeType.Input;
119
- name: string;
120
- value?: string | undefined;
121
- label?: string | undefined;
122
- inputType?: "number" | "text" | "password" | undefined;
123
- placeholder?: string | undefined;
124
- } | {
125
- value: string;
126
- type: import("@metamask/snaps-sdk").NodeType.Button;
127
- name?: string | undefined;
128
- variant?: "primary" | "secondary" | undefined;
129
- buttonType?: "button" | "submit" | undefined;
130
- } | {
131
- type: import("@metamask/snaps-sdk").NodeType.Form;
132
- name: string;
133
- children: ({
134
- type: import("@metamask/snaps-sdk").NodeType.Input;
135
- name: string;
136
- value?: string | undefined;
137
- label?: string | undefined;
138
- inputType?: "number" | "text" | "password" | undefined;
139
- placeholder?: string | undefined;
140
- } | {
141
- value: string;
142
- type: import("@metamask/snaps-sdk").NodeType.Button;
143
- name?: string | undefined;
144
- variant?: "primary" | "secondary" | undefined;
145
- buttonType?: "button" | "submit" | undefined;
146
- })[];
147
151
  }, null>;
148
152
  }>;
149
153
  export declare type CreateInterfaceParameters = InferMatching<typeof CreateInterfaceParametersStruct, CreateInterfaceParams>;
@@ -12,6 +12,38 @@ export declare const updateInterfaceHandler: PermittedHandlerExport<UpdateInterf
12
12
  declare const UpdateInterfaceParametersStruct: import("superstruct").Struct<{
13
13
  id: string;
14
14
  ui: import("@metamask/snaps-sdk").Panel | {
15
+ type: import("@metamask/snaps-sdk").NodeType.Input;
16
+ name: string;
17
+ value?: string | undefined;
18
+ error?: string | undefined;
19
+ inputType?: "number" | "text" | "password" | undefined;
20
+ placeholder?: string | undefined;
21
+ label?: string | undefined;
22
+ } | {
23
+ value: string;
24
+ type: import("@metamask/snaps-sdk").NodeType.Button;
25
+ name?: string | undefined;
26
+ variant?: "primary" | "secondary" | undefined;
27
+ buttonType?: "button" | "submit" | undefined;
28
+ } | {
29
+ type: import("@metamask/snaps-sdk").NodeType.Form;
30
+ name: string;
31
+ children: ({
32
+ type: import("@metamask/snaps-sdk").NodeType.Input;
33
+ name: string;
34
+ value?: string | undefined;
35
+ error?: string | undefined;
36
+ inputType?: "number" | "text" | "password" | undefined;
37
+ placeholder?: string | undefined;
38
+ label?: string | undefined;
39
+ } | {
40
+ value: string;
41
+ type: import("@metamask/snaps-sdk").NodeType.Button;
42
+ name?: string | undefined;
43
+ variant?: "primary" | "secondary" | undefined;
44
+ buttonType?: "button" | "submit" | undefined;
45
+ })[];
46
+ } | {
15
47
  value: string;
16
48
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
17
49
  sensitive?: boolean | undefined;
@@ -30,7 +62,7 @@ declare const UpdateInterfaceParametersStruct: import("superstruct").Struct<{
30
62
  type: import("@metamask/snaps-sdk").NodeType.Text;
31
63
  markdown?: boolean | undefined;
32
64
  } | {
33
- value: string;
65
+ value: `0x${string}`;
34
66
  type: import("@metamask/snaps-sdk").NodeType.Address;
35
67
  } | {
36
68
  value: {
@@ -41,19 +73,23 @@ declare const UpdateInterfaceParametersStruct: import("superstruct").Struct<{
41
73
  type: import("@metamask/snaps-sdk").NodeType.Text;
42
74
  markdown?: boolean | undefined;
43
75
  } | {
44
- value: string;
76
+ value: `0x${string}`;
45
77
  type: import("@metamask/snaps-sdk").NodeType.Address;
46
78
  };
47
79
  type: import("@metamask/snaps-sdk").NodeType.Row;
48
80
  label: string;
49
81
  variant?: "default" | "warning" | "critical" | undefined;
50
- } | {
82
+ };
83
+ }, {
84
+ id: import("superstruct").Struct<string, null>;
85
+ ui: import("superstruct").Struct<import("@metamask/snaps-sdk").Panel | {
51
86
  type: import("@metamask/snaps-sdk").NodeType.Input;
52
87
  name: string;
53
88
  value?: string | undefined;
54
- label?: string | undefined;
89
+ error?: string | undefined;
55
90
  inputType?: "number" | "text" | "password" | undefined;
56
91
  placeholder?: string | undefined;
92
+ label?: string | undefined;
57
93
  } | {
58
94
  value: string;
59
95
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -67,9 +103,10 @@ declare const UpdateInterfaceParametersStruct: import("superstruct").Struct<{
67
103
  type: import("@metamask/snaps-sdk").NodeType.Input;
68
104
  name: string;
69
105
  value?: string | undefined;
70
- label?: string | undefined;
106
+ error?: string | undefined;
71
107
  inputType?: "number" | "text" | "password" | undefined;
72
108
  placeholder?: string | undefined;
109
+ label?: string | undefined;
73
110
  } | {
74
111
  value: string;
75
112
  type: import("@metamask/snaps-sdk").NodeType.Button;
@@ -77,10 +114,7 @@ declare const UpdateInterfaceParametersStruct: import("superstruct").Struct<{
77
114
  variant?: "primary" | "secondary" | undefined;
78
115
  buttonType?: "button" | "submit" | undefined;
79
116
  })[];
80
- };
81
- }, {
82
- id: import("superstruct").Struct<string, null>;
83
- ui: import("superstruct").Struct<import("@metamask/snaps-sdk").Panel | {
117
+ } | {
84
118
  value: string;
85
119
  type: import("@metamask/snaps-sdk").NodeType.Copyable;
86
120
  sensitive?: boolean | undefined;
@@ -99,7 +133,7 @@ declare const UpdateInterfaceParametersStruct: import("superstruct").Struct<{
99
133
  type: import("@metamask/snaps-sdk").NodeType.Text;
100
134
  markdown?: boolean | undefined;
101
135
  } | {
102
- value: string;
136
+ value: `0x${string}`;
103
137
  type: import("@metamask/snaps-sdk").NodeType.Address;
104
138
  } | {
105
139
  value: {
@@ -110,42 +144,12 @@ declare const UpdateInterfaceParametersStruct: import("superstruct").Struct<{
110
144
  type: import("@metamask/snaps-sdk").NodeType.Text;
111
145
  markdown?: boolean | undefined;
112
146
  } | {
113
- value: string;
147
+ value: `0x${string}`;
114
148
  type: import("@metamask/snaps-sdk").NodeType.Address;
115
149
  };
116
150
  type: import("@metamask/snaps-sdk").NodeType.Row;
117
151
  label: string;
118
152
  variant?: "default" | "warning" | "critical" | undefined;
119
- } | {
120
- type: import("@metamask/snaps-sdk").NodeType.Input;
121
- name: string;
122
- value?: string | undefined;
123
- label?: string | undefined;
124
- inputType?: "number" | "text" | "password" | undefined;
125
- placeholder?: string | undefined;
126
- } | {
127
- value: string;
128
- type: import("@metamask/snaps-sdk").NodeType.Button;
129
- name?: string | undefined;
130
- variant?: "primary" | "secondary" | undefined;
131
- buttonType?: "button" | "submit" | undefined;
132
- } | {
133
- type: import("@metamask/snaps-sdk").NodeType.Form;
134
- name: string;
135
- children: ({
136
- type: import("@metamask/snaps-sdk").NodeType.Input;
137
- name: string;
138
- value?: string | undefined;
139
- label?: string | undefined;
140
- inputType?: "number" | "text" | "password" | undefined;
141
- placeholder?: string | undefined;
142
- } | {
143
- value: string;
144
- type: import("@metamask/snaps-sdk").NodeType.Button;
145
- name?: string | undefined;
146
- variant?: "primary" | "secondary" | undefined;
147
- buttonType?: "button" | "submit" | undefined;
148
- })[];
149
153
  }, null>;
150
154
  }>;
151
155
  export declare type UpdateInterfaceParameters = InferMatching<typeof UpdateInterfaceParametersStruct, UpdateInterfaceParams>;