@metamask/snaps-utils 5.2.0 → 6.1.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.
- package/CHANGELOG.md +23 -3
- package/dist/cjs/caveats.js +6 -0
- package/dist/cjs/caveats.js.map +1 -1
- package/dist/cjs/eval-worker.js +3 -1
- package/dist/cjs/eval-worker.js.map +1 -1
- package/dist/cjs/handler-types.js +1 -0
- package/dist/cjs/handler-types.js.map +1 -1
- package/dist/cjs/handlers.js +74 -3
- package/dist/cjs/handlers.js.map +1 -1
- package/dist/cjs/icon.js +38 -9
- package/dist/cjs/icon.js.map +1 -1
- package/dist/cjs/manifest/manifest.js +8 -0
- package/dist/cjs/manifest/manifest.js.map +1 -1
- package/dist/cjs/manifest/validation.js +50 -14
- package/dist/cjs/manifest/validation.js.map +1 -1
- package/dist/cjs/post-process.js +1 -1
- package/dist/cjs/post-process.js.map +1 -1
- package/dist/cjs/structs.js +86 -17
- package/dist/cjs/structs.js.map +1 -1
- package/dist/esm/caveats.js +6 -0
- package/dist/esm/caveats.js.map +1 -1
- package/dist/esm/eval-worker.js +3 -1
- package/dist/esm/eval-worker.js.map +1 -1
- package/dist/esm/handler-types.js +1 -0
- package/dist/esm/handler-types.js.map +1 -1
- package/dist/esm/handlers.js +45 -4
- package/dist/esm/handlers.js.map +1 -1
- package/dist/esm/icon.js +43 -3
- package/dist/esm/icon.js.map +1 -1
- package/dist/esm/manifest/manifest.js +8 -0
- package/dist/esm/manifest/manifest.js.map +1 -1
- package/dist/esm/manifest/validation.js +38 -16
- package/dist/esm/manifest/validation.js.map +1 -1
- package/dist/esm/post-process.js +1 -1
- package/dist/esm/post-process.js.map +1 -1
- package/dist/esm/structs.js +133 -21
- package/dist/esm/structs.js.map +1 -1
- package/dist/types/caveats.d.ts +9 -1
- package/dist/types/handler-types.d.ts +2 -1
- package/dist/types/handlers.d.ts +349 -10
- package/dist/types/icon.d.ts +16 -1
- package/dist/types/localization.d.ts +33 -13
- package/dist/types/manifest/validation.d.ts +230 -75
- package/dist/types/post-process.d.ts +1 -1
- package/dist/types/structs.d.ts +61 -7
- package/package.json +5 -6
package/dist/types/handlers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OnCronjobHandler, OnHomePageHandler, OnKeyringRequestHandler, OnNameLookupHandler, OnRpcRequestHandler, OnSignatureHandler, OnTransactionHandler } from '@metamask/snaps-sdk';
|
|
1
|
+
import type { OnCronjobHandler, OnHomePageHandler, OnKeyringRequestHandler, OnNameLookupHandler, OnRpcRequestHandler, OnSignatureHandler, OnTransactionHandler, OnUserInputHandler } from '@metamask/snaps-sdk';
|
|
2
2
|
import { SeverityLevel } from '@metamask/snaps-sdk';
|
|
3
3
|
import type { SnapHandler } from './handler-types';
|
|
4
4
|
import { HandlerType } from './handler-types';
|
|
@@ -53,8 +53,25 @@ export declare const SNAP_EXPORTS: {
|
|
|
53
53
|
readonly required: true;
|
|
54
54
|
readonly validator: (snapExport: unknown) => snapExport is OnSignatureHandler;
|
|
55
55
|
};
|
|
56
|
+
readonly onUserInput: {
|
|
57
|
+
readonly type: HandlerType.OnUserInput;
|
|
58
|
+
readonly required: true;
|
|
59
|
+
readonly validator: (snapExport: unknown) => snapExport is OnUserInputHandler;
|
|
60
|
+
};
|
|
56
61
|
};
|
|
57
|
-
export declare const
|
|
62
|
+
export declare const OnTransactionSeverityResponseStruct: import("superstruct").Struct<{
|
|
63
|
+
severity?: SeverityLevel | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
severity: import("superstruct").Struct<SeverityLevel | undefined, SeverityLevel>;
|
|
66
|
+
}>;
|
|
67
|
+
export declare const OnTransactionResponseWithIdStruct: import("superstruct").Struct<{
|
|
68
|
+
id: string;
|
|
69
|
+
severity?: SeverityLevel | undefined;
|
|
70
|
+
}, {
|
|
71
|
+
id: import("superstruct").Struct<string, null>;
|
|
72
|
+
severity: import("superstruct").Struct<SeverityLevel | undefined, SeverityLevel>;
|
|
73
|
+
}>;
|
|
74
|
+
export declare const OnTransactionResponseWithContentStruct: import("superstruct").Struct<{
|
|
58
75
|
content: import("@metamask/snaps-sdk").Panel | {
|
|
59
76
|
value: string;
|
|
60
77
|
type: import("@metamask/snaps-sdk").NodeType.Copyable;
|
|
@@ -91,9 +108,39 @@ export declare const OnTransactionResponseStruct: import("superstruct").Struct<{
|
|
|
91
108
|
type: import("@metamask/snaps-sdk").NodeType.Row;
|
|
92
109
|
label: string;
|
|
93
110
|
variant?: "default" | "warning" | "critical" | undefined;
|
|
111
|
+
} | {
|
|
112
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
113
|
+
name: string;
|
|
114
|
+
value?: string | undefined;
|
|
115
|
+
label?: string | undefined;
|
|
116
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
117
|
+
placeholder?: string | undefined;
|
|
118
|
+
} | {
|
|
119
|
+
value: string;
|
|
120
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
121
|
+
name?: string | undefined;
|
|
122
|
+
variant?: "primary" | "secondary" | undefined;
|
|
123
|
+
buttonType?: "button" | "submit" | undefined;
|
|
124
|
+
} | {
|
|
125
|
+
type: import("@metamask/snaps-sdk").NodeType.Form;
|
|
126
|
+
name: string;
|
|
127
|
+
children: ({
|
|
128
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
129
|
+
name: string;
|
|
130
|
+
value?: string | undefined;
|
|
131
|
+
label?: string | undefined;
|
|
132
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
133
|
+
placeholder?: string | undefined;
|
|
134
|
+
} | {
|
|
135
|
+
value: string;
|
|
136
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
137
|
+
name?: string | undefined;
|
|
138
|
+
variant?: "primary" | "secondary" | undefined;
|
|
139
|
+
buttonType?: "button" | "submit" | undefined;
|
|
140
|
+
})[];
|
|
94
141
|
};
|
|
95
142
|
severity?: SeverityLevel | undefined;
|
|
96
|
-
}
|
|
143
|
+
}, {
|
|
97
144
|
content: import("superstruct").Struct<import("@metamask/snaps-sdk").Panel | {
|
|
98
145
|
value: string;
|
|
99
146
|
type: import("@metamask/snaps-sdk").NodeType.Copyable;
|
|
@@ -130,10 +177,43 @@ export declare const OnTransactionResponseStruct: import("superstruct").Struct<{
|
|
|
130
177
|
type: import("@metamask/snaps-sdk").NodeType.Row;
|
|
131
178
|
label: string;
|
|
132
179
|
variant?: "default" | "warning" | "critical" | undefined;
|
|
180
|
+
} | {
|
|
181
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
182
|
+
name: string;
|
|
183
|
+
value?: string | undefined;
|
|
184
|
+
label?: string | undefined;
|
|
185
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
186
|
+
placeholder?: string | undefined;
|
|
187
|
+
} | {
|
|
188
|
+
value: string;
|
|
189
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
190
|
+
name?: string | undefined;
|
|
191
|
+
variant?: "primary" | "secondary" | undefined;
|
|
192
|
+
buttonType?: "button" | "submit" | undefined;
|
|
193
|
+
} | {
|
|
194
|
+
type: import("@metamask/snaps-sdk").NodeType.Form;
|
|
195
|
+
name: string;
|
|
196
|
+
children: ({
|
|
197
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
198
|
+
name: string;
|
|
199
|
+
value?: string | undefined;
|
|
200
|
+
label?: string | undefined;
|
|
201
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
202
|
+
placeholder?: string | undefined;
|
|
203
|
+
} | {
|
|
204
|
+
value: string;
|
|
205
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
206
|
+
name?: string | undefined;
|
|
207
|
+
variant?: "primary" | "secondary" | undefined;
|
|
208
|
+
buttonType?: "button" | "submit" | undefined;
|
|
209
|
+
})[];
|
|
133
210
|
}, null>;
|
|
134
211
|
severity: import("superstruct").Struct<SeverityLevel | undefined, SeverityLevel>;
|
|
135
212
|
}>;
|
|
136
|
-
export declare const
|
|
213
|
+
export declare const OnTransactionResponseStruct: import("superstruct").Struct<{
|
|
214
|
+
id: string;
|
|
215
|
+
severity?: SeverityLevel | undefined;
|
|
216
|
+
} | {
|
|
137
217
|
content: import("@metamask/snaps-sdk").Panel | {
|
|
138
218
|
value: string;
|
|
139
219
|
type: import("@metamask/snaps-sdk").NodeType.Copyable;
|
|
@@ -170,10 +250,44 @@ export declare const OnSignatureResponseStruct: import("superstruct").Struct<{
|
|
|
170
250
|
type: import("@metamask/snaps-sdk").NodeType.Row;
|
|
171
251
|
label: string;
|
|
172
252
|
variant?: "default" | "warning" | "critical" | undefined;
|
|
253
|
+
} | {
|
|
254
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
255
|
+
name: string;
|
|
256
|
+
value?: string | undefined;
|
|
257
|
+
label?: string | undefined;
|
|
258
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
259
|
+
placeholder?: string | undefined;
|
|
260
|
+
} | {
|
|
261
|
+
value: string;
|
|
262
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
263
|
+
name?: string | undefined;
|
|
264
|
+
variant?: "primary" | "secondary" | undefined;
|
|
265
|
+
buttonType?: "button" | "submit" | undefined;
|
|
266
|
+
} | {
|
|
267
|
+
type: import("@metamask/snaps-sdk").NodeType.Form;
|
|
268
|
+
name: string;
|
|
269
|
+
children: ({
|
|
270
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
271
|
+
name: string;
|
|
272
|
+
value?: string | undefined;
|
|
273
|
+
label?: string | undefined;
|
|
274
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
275
|
+
placeholder?: string | undefined;
|
|
276
|
+
} | {
|
|
277
|
+
value: string;
|
|
278
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
279
|
+
name?: string | undefined;
|
|
280
|
+
variant?: "primary" | "secondary" | undefined;
|
|
281
|
+
buttonType?: "button" | "submit" | undefined;
|
|
282
|
+
})[];
|
|
173
283
|
};
|
|
174
284
|
severity?: SeverityLevel | undefined;
|
|
175
|
-
} | null,
|
|
176
|
-
|
|
285
|
+
} | null, null>;
|
|
286
|
+
export declare const OnSignatureResponseStruct: import("superstruct").Struct<{
|
|
287
|
+
id: string;
|
|
288
|
+
severity?: SeverityLevel | undefined;
|
|
289
|
+
} | {
|
|
290
|
+
content: import("@metamask/snaps-sdk").Panel | {
|
|
177
291
|
value: string;
|
|
178
292
|
type: import("@metamask/snaps-sdk").NodeType.Copyable;
|
|
179
293
|
sensitive?: boolean | undefined;
|
|
@@ -209,10 +323,40 @@ export declare const OnSignatureResponseStruct: import("superstruct").Struct<{
|
|
|
209
323
|
type: import("@metamask/snaps-sdk").NodeType.Row;
|
|
210
324
|
label: string;
|
|
211
325
|
variant?: "default" | "warning" | "critical" | undefined;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
326
|
+
} | {
|
|
327
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
328
|
+
name: string;
|
|
329
|
+
value?: string | undefined;
|
|
330
|
+
label?: string | undefined;
|
|
331
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
332
|
+
placeholder?: string | undefined;
|
|
333
|
+
} | {
|
|
334
|
+
value: string;
|
|
335
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
336
|
+
name?: string | undefined;
|
|
337
|
+
variant?: "primary" | "secondary" | undefined;
|
|
338
|
+
buttonType?: "button" | "submit" | undefined;
|
|
339
|
+
} | {
|
|
340
|
+
type: import("@metamask/snaps-sdk").NodeType.Form;
|
|
341
|
+
name: string;
|
|
342
|
+
children: ({
|
|
343
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
344
|
+
name: string;
|
|
345
|
+
value?: string | undefined;
|
|
346
|
+
label?: string | undefined;
|
|
347
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
348
|
+
placeholder?: string | undefined;
|
|
349
|
+
} | {
|
|
350
|
+
value: string;
|
|
351
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
352
|
+
name?: string | undefined;
|
|
353
|
+
variant?: "primary" | "secondary" | undefined;
|
|
354
|
+
buttonType?: "button" | "submit" | undefined;
|
|
355
|
+
})[];
|
|
356
|
+
};
|
|
357
|
+
severity?: SeverityLevel | undefined;
|
|
358
|
+
} | null, null>;
|
|
359
|
+
export declare const OnHomePageResponseWithContentStruct: import("superstruct").Struct<{
|
|
216
360
|
content: import("@metamask/snaps-sdk").Panel | {
|
|
217
361
|
value: string;
|
|
218
362
|
type: import("@metamask/snaps-sdk").NodeType.Copyable;
|
|
@@ -249,6 +393,36 @@ export declare const OnHomePageResponseStruct: import("superstruct").Struct<{
|
|
|
249
393
|
type: import("@metamask/snaps-sdk").NodeType.Row;
|
|
250
394
|
label: string;
|
|
251
395
|
variant?: "default" | "warning" | "critical" | undefined;
|
|
396
|
+
} | {
|
|
397
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
398
|
+
name: string;
|
|
399
|
+
value?: string | undefined;
|
|
400
|
+
label?: string | undefined;
|
|
401
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
402
|
+
placeholder?: string | undefined;
|
|
403
|
+
} | {
|
|
404
|
+
value: string;
|
|
405
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
406
|
+
name?: string | undefined;
|
|
407
|
+
variant?: "primary" | "secondary" | undefined;
|
|
408
|
+
buttonType?: "button" | "submit" | undefined;
|
|
409
|
+
} | {
|
|
410
|
+
type: import("@metamask/snaps-sdk").NodeType.Form;
|
|
411
|
+
name: string;
|
|
412
|
+
children: ({
|
|
413
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
414
|
+
name: string;
|
|
415
|
+
value?: string | undefined;
|
|
416
|
+
label?: string | undefined;
|
|
417
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
418
|
+
placeholder?: string | undefined;
|
|
419
|
+
} | {
|
|
420
|
+
value: string;
|
|
421
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
422
|
+
name?: string | undefined;
|
|
423
|
+
variant?: "primary" | "secondary" | undefined;
|
|
424
|
+
buttonType?: "button" | "submit" | undefined;
|
|
425
|
+
})[];
|
|
252
426
|
};
|
|
253
427
|
}, {
|
|
254
428
|
content: import("superstruct").Struct<import("@metamask/snaps-sdk").Panel | {
|
|
@@ -287,8 +461,173 @@ export declare const OnHomePageResponseStruct: import("superstruct").Struct<{
|
|
|
287
461
|
type: import("@metamask/snaps-sdk").NodeType.Row;
|
|
288
462
|
label: string;
|
|
289
463
|
variant?: "default" | "warning" | "critical" | undefined;
|
|
464
|
+
} | {
|
|
465
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
466
|
+
name: string;
|
|
467
|
+
value?: string | undefined;
|
|
468
|
+
label?: string | undefined;
|
|
469
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
470
|
+
placeholder?: string | undefined;
|
|
471
|
+
} | {
|
|
472
|
+
value: string;
|
|
473
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
474
|
+
name?: string | undefined;
|
|
475
|
+
variant?: "primary" | "secondary" | undefined;
|
|
476
|
+
buttonType?: "button" | "submit" | undefined;
|
|
477
|
+
} | {
|
|
478
|
+
type: import("@metamask/snaps-sdk").NodeType.Form;
|
|
479
|
+
name: string;
|
|
480
|
+
children: ({
|
|
481
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
482
|
+
name: string;
|
|
483
|
+
value?: string | undefined;
|
|
484
|
+
label?: string | undefined;
|
|
485
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
486
|
+
placeholder?: string | undefined;
|
|
487
|
+
} | {
|
|
488
|
+
value: string;
|
|
489
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
490
|
+
name?: string | undefined;
|
|
491
|
+
variant?: "primary" | "secondary" | undefined;
|
|
492
|
+
buttonType?: "button" | "submit" | undefined;
|
|
493
|
+
})[];
|
|
290
494
|
}, null>;
|
|
291
495
|
}>;
|
|
496
|
+
export declare const OnHomePageResponseWithIdStruct: import("superstruct").Struct<{
|
|
497
|
+
id: string;
|
|
498
|
+
}, {
|
|
499
|
+
id: import("superstruct").Struct<string, null>;
|
|
500
|
+
}>;
|
|
501
|
+
export declare const OnHomePageResponseStruct: import("superstruct").Struct<{
|
|
502
|
+
content: import("@metamask/snaps-sdk").Panel | {
|
|
503
|
+
value: string;
|
|
504
|
+
type: import("@metamask/snaps-sdk").NodeType.Copyable;
|
|
505
|
+
sensitive?: boolean | undefined;
|
|
506
|
+
} | {
|
|
507
|
+
type: import("@metamask/snaps-sdk").NodeType.Divider;
|
|
508
|
+
} | {
|
|
509
|
+
value: string;
|
|
510
|
+
type: import("@metamask/snaps-sdk").NodeType.Heading;
|
|
511
|
+
} | {
|
|
512
|
+
value: string;
|
|
513
|
+
type: import("@metamask/snaps-sdk").NodeType.Image;
|
|
514
|
+
} | {
|
|
515
|
+
type: import("@metamask/snaps-sdk").NodeType.Spinner;
|
|
516
|
+
} | {
|
|
517
|
+
value: string;
|
|
518
|
+
type: import("@metamask/snaps-sdk").NodeType.Text;
|
|
519
|
+
markdown?: boolean | undefined;
|
|
520
|
+
} | {
|
|
521
|
+
value: string;
|
|
522
|
+
type: import("@metamask/snaps-sdk").NodeType.Address;
|
|
523
|
+
} | {
|
|
524
|
+
value: {
|
|
525
|
+
value: string;
|
|
526
|
+
type: import("@metamask/snaps-sdk").NodeType.Image;
|
|
527
|
+
} | {
|
|
528
|
+
value: string;
|
|
529
|
+
type: import("@metamask/snaps-sdk").NodeType.Text;
|
|
530
|
+
markdown?: boolean | undefined;
|
|
531
|
+
} | {
|
|
532
|
+
value: string;
|
|
533
|
+
type: import("@metamask/snaps-sdk").NodeType.Address;
|
|
534
|
+
};
|
|
535
|
+
type: import("@metamask/snaps-sdk").NodeType.Row;
|
|
536
|
+
label: string;
|
|
537
|
+
variant?: "default" | "warning" | "critical" | undefined;
|
|
538
|
+
} | {
|
|
539
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
540
|
+
name: string;
|
|
541
|
+
value?: string | undefined;
|
|
542
|
+
label?: string | undefined;
|
|
543
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
544
|
+
placeholder?: string | undefined;
|
|
545
|
+
} | {
|
|
546
|
+
value: string;
|
|
547
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
548
|
+
name?: string | undefined;
|
|
549
|
+
variant?: "primary" | "secondary" | undefined;
|
|
550
|
+
buttonType?: "button" | "submit" | undefined;
|
|
551
|
+
} | {
|
|
552
|
+
type: import("@metamask/snaps-sdk").NodeType.Form;
|
|
553
|
+
name: string;
|
|
554
|
+
children: ({
|
|
555
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
556
|
+
name: string;
|
|
557
|
+
value?: string | undefined;
|
|
558
|
+
label?: string | undefined;
|
|
559
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
560
|
+
placeholder?: string | undefined;
|
|
561
|
+
} | {
|
|
562
|
+
value: string;
|
|
563
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
564
|
+
name?: string | undefined;
|
|
565
|
+
variant?: "primary" | "secondary" | undefined;
|
|
566
|
+
buttonType?: "button" | "submit" | undefined;
|
|
567
|
+
})[];
|
|
568
|
+
};
|
|
569
|
+
} | {
|
|
570
|
+
id: string;
|
|
571
|
+
}, null>;
|
|
572
|
+
export declare const AddressResolutionStruct: import("superstruct").Struct<{
|
|
573
|
+
protocol: string;
|
|
574
|
+
resolvedDomain: string;
|
|
575
|
+
}, {
|
|
576
|
+
protocol: import("superstruct").Struct<string, null>;
|
|
577
|
+
resolvedDomain: import("superstruct").Struct<string, null>;
|
|
578
|
+
}>;
|
|
579
|
+
export declare const DomainResolutionStruct: import("superstruct").Struct<{
|
|
580
|
+
protocol: string;
|
|
581
|
+
resolvedAddress: string;
|
|
582
|
+
}, {
|
|
583
|
+
protocol: import("superstruct").Struct<string, null>;
|
|
584
|
+
resolvedAddress: import("superstruct").Struct<string, null>;
|
|
585
|
+
}>;
|
|
586
|
+
export declare const AddressResolutionResponseStruct: import("superstruct").Struct<{
|
|
587
|
+
resolvedDomains: {
|
|
588
|
+
protocol: string;
|
|
589
|
+
resolvedDomain: string;
|
|
590
|
+
}[];
|
|
591
|
+
}, {
|
|
592
|
+
resolvedDomains: import("superstruct").Struct<{
|
|
593
|
+
protocol: string;
|
|
594
|
+
resolvedDomain: string;
|
|
595
|
+
}[], import("superstruct").Struct<{
|
|
596
|
+
protocol: string;
|
|
597
|
+
resolvedDomain: string;
|
|
598
|
+
}, {
|
|
599
|
+
protocol: import("superstruct").Struct<string, null>;
|
|
600
|
+
resolvedDomain: import("superstruct").Struct<string, null>;
|
|
601
|
+
}>>;
|
|
602
|
+
}>;
|
|
603
|
+
export declare const DomainResolutionResponseStruct: import("superstruct").Struct<{
|
|
604
|
+
resolvedAddresses: {
|
|
605
|
+
protocol: string;
|
|
606
|
+
resolvedAddress: string;
|
|
607
|
+
}[];
|
|
608
|
+
}, {
|
|
609
|
+
resolvedAddresses: import("superstruct").Struct<{
|
|
610
|
+
protocol: string;
|
|
611
|
+
resolvedAddress: string;
|
|
612
|
+
}[], import("superstruct").Struct<{
|
|
613
|
+
protocol: string;
|
|
614
|
+
resolvedAddress: string;
|
|
615
|
+
}, {
|
|
616
|
+
protocol: import("superstruct").Struct<string, null>;
|
|
617
|
+
resolvedAddress: import("superstruct").Struct<string, null>;
|
|
618
|
+
}>>;
|
|
619
|
+
}>;
|
|
620
|
+
export declare const OnNameLookupResponseStruct: import("superstruct").Struct<{
|
|
621
|
+
resolvedDomains: {
|
|
622
|
+
protocol: string;
|
|
623
|
+
resolvedDomain: string;
|
|
624
|
+
}[];
|
|
625
|
+
} | {
|
|
626
|
+
resolvedAddresses: {
|
|
627
|
+
protocol: string;
|
|
628
|
+
resolvedAddress: string;
|
|
629
|
+
}[];
|
|
630
|
+
} | null, null>;
|
|
292
631
|
/**
|
|
293
632
|
* Utility type for getting the handler function type from a handler type.
|
|
294
633
|
*/
|
package/dist/types/icon.d.ts
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import type { VirtualFile } from './virtual-file';
|
|
2
2
|
export declare const SVG_MAX_BYTE_SIZE = 100000;
|
|
3
3
|
export declare const SVG_MAX_BYTE_SIZE_TEXT: string;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Assert that a virtual file containing a Snap icon is valid.
|
|
6
|
+
*
|
|
7
|
+
* @param icon - A virtual file containing a Snap icon.
|
|
8
|
+
*/
|
|
9
|
+
export declare function assertIsSnapIcon(icon: VirtualFile): void;
|
|
10
|
+
/**
|
|
11
|
+
* Extract the dimensions of an image from an SVG string if possible.
|
|
12
|
+
*
|
|
13
|
+
* @param svg - An SVG string.
|
|
14
|
+
* @returns The height and width of the SVG or null.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getSvgDimensions(svg: string): {
|
|
17
|
+
height: number;
|
|
18
|
+
width: number;
|
|
19
|
+
} | null;
|
|
@@ -100,15 +100,6 @@ export declare function getLocalizedSnapManifest(snapManifest: SnapManifest, loc
|
|
|
100
100
|
wallet_snap?: Record<string, {
|
|
101
101
|
version?: string | undefined;
|
|
102
102
|
}> | undefined;
|
|
103
|
-
'endowment:ethereum-provider'?: {} | undefined;
|
|
104
|
-
'endowment:network-access'?: {} | undefined;
|
|
105
|
-
'endowment:webassembly'?: {} | undefined;
|
|
106
|
-
'endowment:signature-insight'?: {
|
|
107
|
-
allowSignatureOrigin?: boolean | undefined;
|
|
108
|
-
} | undefined;
|
|
109
|
-
'endowment:transaction-insight'?: {
|
|
110
|
-
allowTransactionOrigin?: boolean | undefined;
|
|
111
|
-
} | undefined;
|
|
112
103
|
'endowment:cronjob'?: {
|
|
113
104
|
jobs: {
|
|
114
105
|
request: {
|
|
@@ -119,17 +110,46 @@ export declare function getLocalizedSnapManifest(snapManifest: SnapManifest, loc
|
|
|
119
110
|
};
|
|
120
111
|
expression: string;
|
|
121
112
|
}[];
|
|
113
|
+
maxRequestTime?: number | undefined;
|
|
114
|
+
} | undefined;
|
|
115
|
+
'endowment:ethereum-provider'?: {} | undefined;
|
|
116
|
+
'endowment:keyring'?: {
|
|
117
|
+
allowedOrigins?: string[] | undefined;
|
|
118
|
+
maxRequestTime?: number | undefined;
|
|
119
|
+
} | undefined;
|
|
120
|
+
'endowment:lifecycle-hooks'?: {
|
|
121
|
+
maxRequestTime?: number | undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
'endowment:name-lookup'?: {
|
|
124
|
+
chains?: `${string}:${string}`[] | undefined;
|
|
125
|
+
maxRequestTime?: number | undefined;
|
|
126
|
+
matchers?: {
|
|
127
|
+
tlds: string[];
|
|
128
|
+
} | {
|
|
129
|
+
schemes: string[];
|
|
130
|
+
} | {
|
|
131
|
+
tlds: string[];
|
|
132
|
+
schemes: string[];
|
|
133
|
+
} | undefined;
|
|
134
|
+
} | undefined;
|
|
135
|
+
'endowment:network-access'?: {} | undefined;
|
|
136
|
+
'endowment:page-home'?: {
|
|
137
|
+
maxRequestTime?: number | undefined;
|
|
122
138
|
} | undefined;
|
|
123
139
|
'endowment:rpc'?: {
|
|
124
140
|
dapps?: boolean | undefined;
|
|
125
141
|
snaps?: boolean | undefined;
|
|
126
142
|
allowedOrigins?: string[] | undefined;
|
|
127
143
|
} | undefined;
|
|
128
|
-
'endowment:
|
|
129
|
-
|
|
130
|
-
|
|
144
|
+
'endowment:signature-insight'?: {
|
|
145
|
+
maxRequestTime?: number | undefined;
|
|
146
|
+
allowSignatureOrigin?: boolean | undefined;
|
|
147
|
+
} | undefined;
|
|
148
|
+
'endowment:transaction-insight'?: {
|
|
149
|
+
maxRequestTime?: number | undefined;
|
|
150
|
+
allowTransactionOrigin?: boolean | undefined;
|
|
131
151
|
} | undefined;
|
|
132
|
-
|
|
152
|
+
'endowment:webassembly'?: {} | undefined;
|
|
133
153
|
};
|
|
134
154
|
manifestVersion: "0.1";
|
|
135
155
|
repository?: {
|