@metamask/snaps-rpc-methods 8.0.0 → 8.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 +6 -1
- package/dist/{chunk-JQ456NCC.mjs → chunk-3W4SMZFD.mjs} +3 -3
- package/dist/{chunk-WLDEPJGG.mjs → chunk-634BK2VP.mjs} +3 -3
- package/dist/chunk-634BK2VP.mjs.map +1 -0
- package/dist/{chunk-GP5KW5FU.js → chunk-D5WQBUZB.js} +2 -2
- package/dist/chunk-D5WQBUZB.js.map +1 -0
- package/dist/{chunk-6UY23OOZ.js → chunk-GP6TDVNT.js} +3 -3
- package/dist/{chunk-YS6TYXCP.mjs → chunk-GVJLWGSI.mjs} +3 -3
- package/dist/chunk-GVJLWGSI.mjs.map +1 -0
- package/dist/{chunk-GYZV5UBD.js → chunk-I7DR6BFO.js} +4 -4
- package/dist/chunk-I7DR6BFO.js.map +1 -0
- package/dist/{chunk-D6MUXDVI.js → chunk-INB4AX37.js} +5 -5
- package/dist/{chunk-AMBEX4N4.mjs → chunk-L675SYPP.mjs} +2 -2
- package/dist/{chunk-SU6KOIVB.mjs → chunk-PG32JMWC.mjs} +2 -2
- package/dist/{chunk-RZXF4KSR.js → chunk-RIALLTR7.js} +3 -3
- package/dist/{chunk-EGKFC56F.js → chunk-RX7WZZ32.js} +3 -3
- package/dist/{chunk-3LPBU737.js → chunk-UDB4MUXI.js} +2 -2
- package/dist/chunk-UDB4MUXI.js.map +1 -0
- package/dist/{chunk-7OMVZR5X.mjs → chunk-VNH2GKLV.mjs} +2 -2
- package/dist/{chunk-4SQWLI2S.mjs → chunk-X247BMMW.mjs} +6 -6
- package/dist/chunk-X247BMMW.mjs.map +1 -0
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/permissions.js +4 -4
- package/dist/permissions.mjs +3 -3
- package/dist/permitted/createInterface.js +2 -2
- package/dist/permitted/createInterface.mjs +1 -1
- package/dist/permitted/handlers.js +4 -4
- package/dist/permitted/handlers.mjs +3 -3
- package/dist/permitted/index.js +5 -5
- package/dist/permitted/index.mjs +4 -4
- package/dist/permitted/middleware.js +5 -5
- package/dist/permitted/middleware.mjs +4 -4
- package/dist/permitted/updateInterface.js +2 -2
- package/dist/permitted/updateInterface.mjs +1 -1
- package/dist/restricted/dialog.js +2 -2
- package/dist/restricted/dialog.mjs +1 -1
- package/dist/restricted/index.js +3 -3
- package/dist/restricted/index.mjs +2 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/permitted/createInterface.d.ts +41 -41
- package/dist/types/permitted/updateInterface.d.ts +42 -42
- package/dist/types/restricted/dialog.d.ts +316 -148
- package/dist/types/restricted/manageAccounts.d.ts +1 -1
- package/package.json +3 -3
- package/dist/chunk-3LPBU737.js.map +0 -1
- package/dist/chunk-4SQWLI2S.mjs.map +0 -1
- package/dist/chunk-GP5KW5FU.js.map +0 -1
- package/dist/chunk-GYZV5UBD.js.map +0 -1
- package/dist/chunk-WLDEPJGG.mjs.map +0 -1
- package/dist/chunk-YS6TYXCP.mjs.map +0 -1
- /package/dist/{chunk-JQ456NCC.mjs.map → chunk-3W4SMZFD.mjs.map} +0 -0
- /package/dist/{chunk-6UY23OOZ.js.map → chunk-GP6TDVNT.js.map} +0 -0
- /package/dist/{chunk-D6MUXDVI.js.map → chunk-INB4AX37.js.map} +0 -0
- /package/dist/{chunk-AMBEX4N4.mjs.map → chunk-L675SYPP.mjs.map} +0 -0
- /package/dist/{chunk-SU6KOIVB.mjs.map → chunk-PG32JMWC.mjs.map} +0 -0
- /package/dist/{chunk-RZXF4KSR.js.map → chunk-RIALLTR7.js.map} +0 -0
- /package/dist/{chunk-EGKFC56F.js.map → chunk-RX7WZZ32.js.map} +0 -0
- /package/dist/{chunk-7OMVZR5X.mjs.map → chunk-VNH2GKLV.mjs.map} +0 -0
|
@@ -1,48 +1,16 @@
|
|
|
1
1
|
import type { PermittedHandlerExport } from '@metamask/permission-controller';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CreateInterfaceParams, CreateInterfaceResult, ComponentOrElement } from '@metamask/snaps-sdk';
|
|
3
3
|
import { type InferMatching } from '@metamask/snaps-utils';
|
|
4
4
|
export declare type CreateInterfaceMethodHooks = {
|
|
5
5
|
/**
|
|
6
6
|
* @param ui - The UI components.
|
|
7
7
|
* @returns The unique identifier of the interface.
|
|
8
8
|
*/
|
|
9
|
-
createInterface: (ui:
|
|
9
|
+
createInterface: (ui: ComponentOrElement) => Promise<string>;
|
|
10
10
|
};
|
|
11
11
|
export declare const createInterfaceHandler: PermittedHandlerExport<CreateInterfaceMethodHooks, CreateInterfaceParameters, CreateInterfaceResult>;
|
|
12
12
|
declare const CreateInterfaceParametersStruct: import("superstruct").Struct<{
|
|
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
|
-
} | {
|
|
13
|
+
ui: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
|
|
46
14
|
value: string;
|
|
47
15
|
type: import("@metamask/snaps-sdk").NodeType.Copyable;
|
|
48
16
|
sensitive?: boolean | undefined;
|
|
@@ -78,16 +46,14 @@ declare const CreateInterfaceParametersStruct: import("superstruct").Struct<{
|
|
|
78
46
|
type: import("@metamask/snaps-sdk").NodeType.Row;
|
|
79
47
|
label: string;
|
|
80
48
|
variant?: "default" | "warning" | "critical" | undefined;
|
|
81
|
-
}
|
|
82
|
-
}, {
|
|
83
|
-
ui: import("superstruct").Struct<import("@metamask/snaps-sdk").Panel | {
|
|
49
|
+
} | {
|
|
84
50
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
85
51
|
name: string;
|
|
86
52
|
value?: string | undefined;
|
|
87
53
|
error?: string | undefined;
|
|
88
|
-
inputType?: "number" | "text" | "password" | undefined;
|
|
89
54
|
placeholder?: string | undefined;
|
|
90
55
|
label?: string | undefined;
|
|
56
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
91
57
|
} | {
|
|
92
58
|
value: string;
|
|
93
59
|
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
@@ -102,9 +68,9 @@ declare const CreateInterfaceParametersStruct: import("superstruct").Struct<{
|
|
|
102
68
|
name: string;
|
|
103
69
|
value?: string | undefined;
|
|
104
70
|
error?: string | undefined;
|
|
105
|
-
inputType?: "number" | "text" | "password" | undefined;
|
|
106
71
|
placeholder?: string | undefined;
|
|
107
72
|
label?: string | undefined;
|
|
73
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
108
74
|
} | {
|
|
109
75
|
value: string;
|
|
110
76
|
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
@@ -112,7 +78,9 @@ declare const CreateInterfaceParametersStruct: import("superstruct").Struct<{
|
|
|
112
78
|
variant?: "primary" | "secondary" | undefined;
|
|
113
79
|
buttonType?: "button" | "submit" | undefined;
|
|
114
80
|
})[];
|
|
115
|
-
}
|
|
81
|
+
};
|
|
82
|
+
}, {
|
|
83
|
+
ui: import("superstruct").Struct<import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
|
|
116
84
|
value: string;
|
|
117
85
|
type: import("@metamask/snaps-sdk").NodeType.Copyable;
|
|
118
86
|
sensitive?: boolean | undefined;
|
|
@@ -148,6 +116,38 @@ declare const CreateInterfaceParametersStruct: import("superstruct").Struct<{
|
|
|
148
116
|
type: import("@metamask/snaps-sdk").NodeType.Row;
|
|
149
117
|
label: string;
|
|
150
118
|
variant?: "default" | "warning" | "critical" | undefined;
|
|
119
|
+
} | {
|
|
120
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
121
|
+
name: string;
|
|
122
|
+
value?: string | undefined;
|
|
123
|
+
error?: string | undefined;
|
|
124
|
+
placeholder?: string | undefined;
|
|
125
|
+
label?: string | undefined;
|
|
126
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
127
|
+
} | {
|
|
128
|
+
value: string;
|
|
129
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
130
|
+
name?: string | undefined;
|
|
131
|
+
variant?: "primary" | "secondary" | undefined;
|
|
132
|
+
buttonType?: "button" | "submit" | undefined;
|
|
133
|
+
} | {
|
|
134
|
+
type: import("@metamask/snaps-sdk").NodeType.Form;
|
|
135
|
+
name: string;
|
|
136
|
+
children: ({
|
|
137
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
138
|
+
name: string;
|
|
139
|
+
value?: string | undefined;
|
|
140
|
+
error?: string | undefined;
|
|
141
|
+
placeholder?: string | undefined;
|
|
142
|
+
label?: string | undefined;
|
|
143
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
144
|
+
} | {
|
|
145
|
+
value: string;
|
|
146
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
147
|
+
name?: string | undefined;
|
|
148
|
+
variant?: "primary" | "secondary" | undefined;
|
|
149
|
+
buttonType?: "button" | "submit" | undefined;
|
|
150
|
+
})[];
|
|
151
151
|
}, null>;
|
|
152
152
|
}>;
|
|
153
153
|
export declare type CreateInterfaceParameters = InferMatching<typeof CreateInterfaceParametersStruct, CreateInterfaceParams>;
|
|
@@ -1,49 +1,17 @@
|
|
|
1
1
|
import type { PermittedHandlerExport } from '@metamask/permission-controller';
|
|
2
|
-
import type {
|
|
2
|
+
import type { UpdateInterfaceParams, UpdateInterfaceResult, ComponentOrElement } from '@metamask/snaps-sdk';
|
|
3
3
|
import { type InferMatching } from '@metamask/snaps-utils';
|
|
4
4
|
export declare type UpdateInterfaceMethodHooks = {
|
|
5
5
|
/**
|
|
6
6
|
* @param id - The interface ID.
|
|
7
7
|
* @param ui - The UI components.
|
|
8
8
|
*/
|
|
9
|
-
updateInterface: (id: string, ui:
|
|
9
|
+
updateInterface: (id: string, ui: ComponentOrElement) => Promise<void>;
|
|
10
10
|
};
|
|
11
11
|
export declare const updateInterfaceHandler: PermittedHandlerExport<UpdateInterfaceMethodHooks, UpdateInterfaceParameters, UpdateInterfaceResult>;
|
|
12
12
|
declare const UpdateInterfaceParametersStruct: import("superstruct").Struct<{
|
|
13
13
|
id: string;
|
|
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
|
-
} | {
|
|
14
|
+
ui: import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
|
|
47
15
|
value: string;
|
|
48
16
|
type: import("@metamask/snaps-sdk").NodeType.Copyable;
|
|
49
17
|
sensitive?: boolean | undefined;
|
|
@@ -79,17 +47,14 @@ declare const UpdateInterfaceParametersStruct: import("superstruct").Struct<{
|
|
|
79
47
|
type: import("@metamask/snaps-sdk").NodeType.Row;
|
|
80
48
|
label: string;
|
|
81
49
|
variant?: "default" | "warning" | "critical" | undefined;
|
|
82
|
-
}
|
|
83
|
-
}, {
|
|
84
|
-
id: import("superstruct").Struct<string, null>;
|
|
85
|
-
ui: import("superstruct").Struct<import("@metamask/snaps-sdk").Panel | {
|
|
50
|
+
} | {
|
|
86
51
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
87
52
|
name: string;
|
|
88
53
|
value?: string | undefined;
|
|
89
54
|
error?: string | undefined;
|
|
90
|
-
inputType?: "number" | "text" | "password" | undefined;
|
|
91
55
|
placeholder?: string | undefined;
|
|
92
56
|
label?: string | undefined;
|
|
57
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
93
58
|
} | {
|
|
94
59
|
value: string;
|
|
95
60
|
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
@@ -104,9 +69,9 @@ declare const UpdateInterfaceParametersStruct: import("superstruct").Struct<{
|
|
|
104
69
|
name: string;
|
|
105
70
|
value?: string | undefined;
|
|
106
71
|
error?: string | undefined;
|
|
107
|
-
inputType?: "number" | "text" | "password" | undefined;
|
|
108
72
|
placeholder?: string | undefined;
|
|
109
73
|
label?: string | undefined;
|
|
74
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
110
75
|
} | {
|
|
111
76
|
value: string;
|
|
112
77
|
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
@@ -114,7 +79,10 @@ declare const UpdateInterfaceParametersStruct: import("superstruct").Struct<{
|
|
|
114
79
|
variant?: "primary" | "secondary" | undefined;
|
|
115
80
|
buttonType?: "button" | "submit" | undefined;
|
|
116
81
|
})[];
|
|
117
|
-
}
|
|
82
|
+
};
|
|
83
|
+
}, {
|
|
84
|
+
id: import("superstruct").Struct<string, null>;
|
|
85
|
+
ui: import("superstruct").Struct<import("@metamask/snaps-sdk/jsx-runtime").JSXElement | import("@metamask/snaps-sdk").Panel | {
|
|
118
86
|
value: string;
|
|
119
87
|
type: import("@metamask/snaps-sdk").NodeType.Copyable;
|
|
120
88
|
sensitive?: boolean | undefined;
|
|
@@ -150,6 +118,38 @@ declare const UpdateInterfaceParametersStruct: import("superstruct").Struct<{
|
|
|
150
118
|
type: import("@metamask/snaps-sdk").NodeType.Row;
|
|
151
119
|
label: string;
|
|
152
120
|
variant?: "default" | "warning" | "critical" | undefined;
|
|
121
|
+
} | {
|
|
122
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
123
|
+
name: string;
|
|
124
|
+
value?: string | undefined;
|
|
125
|
+
error?: string | undefined;
|
|
126
|
+
placeholder?: string | undefined;
|
|
127
|
+
label?: string | undefined;
|
|
128
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
129
|
+
} | {
|
|
130
|
+
value: string;
|
|
131
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
132
|
+
name?: string | undefined;
|
|
133
|
+
variant?: "primary" | "secondary" | undefined;
|
|
134
|
+
buttonType?: "button" | "submit" | undefined;
|
|
135
|
+
} | {
|
|
136
|
+
type: import("@metamask/snaps-sdk").NodeType.Form;
|
|
137
|
+
name: string;
|
|
138
|
+
children: ({
|
|
139
|
+
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
140
|
+
name: string;
|
|
141
|
+
value?: string | undefined;
|
|
142
|
+
error?: string | undefined;
|
|
143
|
+
placeholder?: string | undefined;
|
|
144
|
+
label?: string | undefined;
|
|
145
|
+
inputType?: "number" | "text" | "password" | undefined;
|
|
146
|
+
} | {
|
|
147
|
+
value: string;
|
|
148
|
+
type: import("@metamask/snaps-sdk").NodeType.Button;
|
|
149
|
+
name?: string | undefined;
|
|
150
|
+
variant?: "primary" | "secondary" | undefined;
|
|
151
|
+
buttonType?: "button" | "submit" | undefined;
|
|
152
|
+
})[];
|
|
153
153
|
}, null>;
|
|
154
154
|
}>;
|
|
155
155
|
export declare type UpdateInterfaceParameters = InferMatching<typeof UpdateInterfaceParametersStruct, UpdateInterfaceParams>;
|