@metamask/snaps-sdk 3.0.1 → 3.1.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.
@@ -13,6 +13,7 @@ export declare const InputStruct: import("superstruct").Struct<{
13
13
  type: NodeType.Input;
14
14
  name: string;
15
15
  value?: string | undefined;
16
+ error?: string | undefined;
16
17
  label?: string | undefined;
17
18
  inputType?: "number" | "text" | "password" | undefined;
18
19
  placeholder?: string | undefined;
@@ -23,6 +24,7 @@ export declare const InputStruct: import("superstruct").Struct<{
23
24
  inputType: import("superstruct").Struct<"number" | "text" | "password" | undefined, null>;
24
25
  placeholder: import("superstruct").Struct<string | undefined, null>;
25
26
  label: import("superstruct").Struct<string | undefined, null>;
27
+ error: import("superstruct").Struct<string | undefined, null>;
26
28
  }>;
27
29
  /**
28
30
  * An input node, that renders an input.
@@ -33,6 +35,7 @@ export declare const InputStruct: import("superstruct").Struct<{
33
35
  * @property inputType - An optional type, either `text`, `password` or `number`.
34
36
  * @property placeholder - An optional input placeholder.
35
37
  * @property label - An optional input label.
38
+ * @property error - An optional error text.
36
39
  */
37
40
  export declare type Input = Infer<typeof InputStruct>;
38
41
  /**
@@ -45,6 +48,7 @@ export declare type Input = Infer<typeof InputStruct>;
45
48
  * @param args.inputType - An optional type, either `text`, `password` or `number`.
46
49
  * @param args.placeholder - An optional input placeholder.
47
50
  * @param args.label - An optional input label.
51
+ * @param args.error - An optional error text.
48
52
  * @returns The input node as an object.
49
53
  * @example
50
54
  * const node = input('myInput');
@@ -56,6 +60,7 @@ export declare const input: (...args: (string | undefined)[] | [Omit<{
56
60
  type: NodeType.Input;
57
61
  name: string;
58
62
  value?: string | undefined;
63
+ error?: string | undefined;
59
64
  label?: string | undefined;
60
65
  inputType?: "number" | "text" | "password" | undefined;
61
66
  placeholder?: string | undefined;
@@ -63,6 +68,7 @@ export declare const input: (...args: (string | undefined)[] | [Omit<{
63
68
  type: NodeType.Input;
64
69
  name: string;
65
70
  value?: string | undefined;
71
+ error?: string | undefined;
66
72
  label?: string | undefined;
67
73
  inputType?: "number" | "text" | "password" | undefined;
68
74
  placeholder?: string | undefined;
@@ -24,7 +24,7 @@ export declare const ParentStruct: Struct<{
24
24
  type: NodeType.Text;
25
25
  markdown?: boolean | undefined;
26
26
  } | {
27
- value: string;
27
+ value: `0x${string}`;
28
28
  type: NodeType.Address;
29
29
  } | {
30
30
  value: {
@@ -35,7 +35,7 @@ export declare const ParentStruct: Struct<{
35
35
  type: NodeType.Text;
36
36
  markdown?: boolean | undefined;
37
37
  } | {
38
- value: string;
38
+ value: `0x${string}`;
39
39
  type: NodeType.Address;
40
40
  };
41
41
  type: NodeType.Row;
@@ -45,6 +45,7 @@ export declare const ParentStruct: Struct<{
45
45
  type: NodeType.Input;
46
46
  name: string;
47
47
  value?: string | undefined;
48
+ error?: string | undefined;
48
49
  label?: string | undefined;
49
50
  inputType?: "number" | "text" | "password" | undefined;
50
51
  placeholder?: string | undefined;
@@ -61,6 +62,7 @@ export declare const ParentStruct: Struct<{
61
62
  type: NodeType.Input;
62
63
  name: string;
63
64
  value?: string | undefined;
65
+ error?: string | undefined;
64
66
  label?: string | undefined;
65
67
  inputType?: "number" | "text" | "password" | undefined;
66
68
  placeholder?: string | undefined;
@@ -92,7 +94,7 @@ export declare const ParentStruct: Struct<{
92
94
  type: NodeType.Text;
93
95
  markdown?: boolean | undefined;
94
96
  } | {
95
- value: string;
97
+ value: `0x${string}`;
96
98
  type: NodeType.Address;
97
99
  } | {
98
100
  value: {
@@ -103,7 +105,7 @@ export declare const ParentStruct: Struct<{
103
105
  type: NodeType.Text;
104
106
  markdown?: boolean | undefined;
105
107
  } | {
106
- value: string;
108
+ value: `0x${string}`;
107
109
  type: NodeType.Address;
108
110
  };
109
111
  type: NodeType.Row;
@@ -113,6 +115,7 @@ export declare const ParentStruct: Struct<{
113
115
  type: NodeType.Input;
114
116
  name: string;
115
117
  value?: string | undefined;
118
+ error?: string | undefined;
116
119
  label?: string | undefined;
117
120
  inputType?: "number" | "text" | "password" | undefined;
118
121
  placeholder?: string | undefined;
@@ -129,6 +132,7 @@ export declare const ParentStruct: Struct<{
129
132
  type: NodeType.Input;
130
133
  name: string;
131
134
  value?: string | undefined;
135
+ error?: string | undefined;
132
136
  label?: string | undefined;
133
137
  inputType?: "number" | "text" | "password" | undefined;
134
138
  placeholder?: string | undefined;
@@ -158,7 +162,7 @@ export declare const ParentStruct: Struct<{
158
162
  type: NodeType.Text;
159
163
  markdown?: boolean | undefined;
160
164
  } | {
161
- value: string;
165
+ value: `0x${string}`;
162
166
  type: NodeType.Address;
163
167
  } | {
164
168
  value: {
@@ -169,7 +173,7 @@ export declare const ParentStruct: Struct<{
169
173
  type: NodeType.Text;
170
174
  markdown?: boolean | undefined;
171
175
  } | {
172
- value: string;
176
+ value: `0x${string}`;
173
177
  type: NodeType.Address;
174
178
  };
175
179
  type: NodeType.Row;
@@ -179,6 +183,7 @@ export declare const ParentStruct: Struct<{
179
183
  type: NodeType.Input;
180
184
  name: string;
181
185
  value?: string | undefined;
186
+ error?: string | undefined;
182
187
  label?: string | undefined;
183
188
  inputType?: "number" | "text" | "password" | undefined;
184
189
  placeholder?: string | undefined;
@@ -195,6 +200,7 @@ export declare const ParentStruct: Struct<{
195
200
  type: NodeType.Input;
196
201
  name: string;
197
202
  value?: string | undefined;
203
+ error?: string | undefined;
198
204
  label?: string | undefined;
199
205
  inputType?: "number" | "text" | "password" | undefined;
200
206
  placeholder?: string | undefined;
@@ -272,7 +278,7 @@ export declare const panel: (...args: [Omit<Panel, "type">] | ({
272
278
  type: NodeType.Text;
273
279
  markdown?: boolean | undefined;
274
280
  } | {
275
- value: string;
281
+ value: `0x${string}`;
276
282
  type: NodeType.Address;
277
283
  } | {
278
284
  value: {
@@ -283,7 +289,7 @@ export declare const panel: (...args: [Omit<Panel, "type">] | ({
283
289
  type: NodeType.Text;
284
290
  markdown?: boolean | undefined;
285
291
  } | {
286
- value: string;
292
+ value: `0x${string}`;
287
293
  type: NodeType.Address;
288
294
  };
289
295
  type: NodeType.Row;
@@ -293,6 +299,7 @@ export declare const panel: (...args: [Omit<Panel, "type">] | ({
293
299
  type: NodeType.Input;
294
300
  name: string;
295
301
  value?: string | undefined;
302
+ error?: string | undefined;
296
303
  label?: string | undefined;
297
304
  inputType?: "number" | "text" | "password" | undefined;
298
305
  placeholder?: string | undefined;
@@ -309,6 +316,7 @@ export declare const panel: (...args: [Omit<Panel, "type">] | ({
309
316
  type: NodeType.Input;
310
317
  name: string;
311
318
  value?: string | undefined;
319
+ error?: string | undefined;
312
320
  label?: string | undefined;
313
321
  inputType?: "number" | "text" | "password" | undefined;
314
322
  placeholder?: string | undefined;
@@ -339,7 +347,7 @@ export declare const ComponentStruct: Struct<{
339
347
  type: NodeType.Text;
340
348
  markdown?: boolean | undefined;
341
349
  } | {
342
- value: string;
350
+ value: `0x${string}`;
343
351
  type: NodeType.Address;
344
352
  } | {
345
353
  value: {
@@ -350,7 +358,7 @@ export declare const ComponentStruct: Struct<{
350
358
  type: NodeType.Text;
351
359
  markdown?: boolean | undefined;
352
360
  } | {
353
- value: string;
361
+ value: `0x${string}`;
354
362
  type: NodeType.Address;
355
363
  };
356
364
  type: NodeType.Row;
@@ -360,6 +368,7 @@ export declare const ComponentStruct: Struct<{
360
368
  type: NodeType.Input;
361
369
  name: string;
362
370
  value?: string | undefined;
371
+ error?: string | undefined;
363
372
  label?: string | undefined;
364
373
  inputType?: "number" | "text" | "password" | undefined;
365
374
  placeholder?: string | undefined;
@@ -376,6 +385,7 @@ export declare const ComponentStruct: Struct<{
376
385
  type: NodeType.Input;
377
386
  name: string;
378
387
  value?: string | undefined;
388
+ error?: string | undefined;
379
389
  label?: string | undefined;
380
390
  inputType?: "number" | "text" | "password" | undefined;
381
391
  placeholder?: string | undefined;
@@ -14,7 +14,7 @@ export declare const RowStruct: import("superstruct").Struct<{
14
14
  type: NodeType.Text;
15
15
  markdown?: boolean | undefined;
16
16
  } | {
17
- value: string;
17
+ value: `0x${string}`;
18
18
  type: NodeType.Address;
19
19
  };
20
20
  type: NodeType.Row;
@@ -32,7 +32,7 @@ export declare const RowStruct: import("superstruct").Struct<{
32
32
  type: NodeType.Text;
33
33
  markdown?: boolean | undefined;
34
34
  } | {
35
- value: string;
35
+ value: `0x${string}`;
36
36
  type: NodeType.Address;
37
37
  }, null>;
38
38
  }>;
@@ -70,7 +70,7 @@ export declare const row: (...args: [Omit<{
70
70
  type: NodeType.Text;
71
71
  markdown?: boolean | undefined;
72
72
  } | {
73
- value: string;
73
+ value: `0x${string}`;
74
74
  type: NodeType.Address;
75
75
  };
76
76
  type: NodeType.Row;
@@ -84,7 +84,7 @@ export declare const row: (...args: [Omit<{
84
84
  type: NodeType.Text;
85
85
  markdown?: boolean | undefined;
86
86
  } | {
87
- value: string;
87
+ value: `0x${string}`;
88
88
  type: NodeType.Address;
89
89
  } | undefined)[]) => {
90
90
  value: {
@@ -95,7 +95,7 @@ export declare const row: (...args: [Omit<{
95
95
  type: NodeType.Text;
96
96
  markdown?: boolean | undefined;
97
97
  } | {
98
- value: string;
98
+ value: `0x${string}`;
99
99
  type: NodeType.Address;
100
100
  };
101
101
  type: NodeType.Row;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/snaps-sdk",
3
- "version": "3.0.1",
3
+ "version": "3.1.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/MetaMask/snaps.git"
@@ -39,14 +39,14 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@metamask/key-tree": "^9.0.0",
42
- "@metamask/providers": "^14.0.2",
42
+ "@metamask/providers": "^15.0.0",
43
43
  "@metamask/rpc-errors": "^6.2.1",
44
44
  "@metamask/utils": "^8.3.0",
45
45
  "fast-xml-parser": "^4.3.4",
46
46
  "superstruct": "^1.0.3"
47
47
  },
48
48
  "devDependencies": {
49
- "@lavamoat/allow-scripts": "^3.0.2",
49
+ "@lavamoat/allow-scripts": "^3.0.3",
50
50
  "@metamask/auto-changelog": "^3.4.4",
51
51
  "@metamask/eslint-config": "^12.1.0",
52
52
  "@metamask/eslint-config-jest": "^12.1.0",