@metamask/snaps-simulation 3.6.0 → 3.8.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 +19 -1
- package/dist/constants.cjs +1 -5
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +0 -4
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.mts +0 -4
- package/dist/constants.d.mts.map +1 -1
- package/dist/constants.mjs +0 -4
- package/dist/constants.mjs.map +1 -1
- package/dist/controllers.cjs +1 -0
- package/dist/controllers.cjs.map +1 -1
- package/dist/controllers.d.cts.map +1 -1
- package/dist/controllers.d.mts.map +1 -1
- package/dist/controllers.mjs +1 -0
- package/dist/controllers.mjs.map +1 -1
- package/dist/methods/hooks/chain.cjs +29 -0
- package/dist/methods/hooks/chain.cjs.map +1 -0
- package/dist/methods/hooks/chain.d.cts +9 -0
- package/dist/methods/hooks/chain.d.cts.map +1 -0
- package/dist/methods/hooks/chain.d.mts +9 -0
- package/dist/methods/hooks/chain.d.mts.map +1 -0
- package/dist/methods/hooks/chain.mjs +25 -0
- package/dist/methods/hooks/chain.mjs.map +1 -0
- package/dist/methods/hooks/index.cjs +1 -0
- package/dist/methods/hooks/index.cjs.map +1 -1
- package/dist/methods/hooks/index.d.cts +1 -0
- package/dist/methods/hooks/index.d.cts.map +1 -1
- package/dist/methods/hooks/index.d.mts +1 -0
- package/dist/methods/hooks/index.d.mts.map +1 -1
- package/dist/methods/hooks/index.mjs +1 -0
- package/dist/methods/hooks/index.mjs.map +1 -1
- package/dist/middleware/engine.cjs +3 -9
- package/dist/middleware/engine.cjs.map +1 -1
- package/dist/middleware/engine.d.cts +1 -2
- package/dist/middleware/engine.d.cts.map +1 -1
- package/dist/middleware/engine.d.mts +1 -2
- package/dist/middleware/engine.d.mts.map +1 -1
- package/dist/middleware/engine.mjs +3 -9
- package/dist/middleware/engine.mjs.map +1 -1
- package/dist/middleware/internal-methods/chain-id.cjs +3 -4
- package/dist/middleware/internal-methods/chain-id.cjs.map +1 -1
- package/dist/middleware/internal-methods/chain-id.d.cts +3 -1
- package/dist/middleware/internal-methods/chain-id.d.cts.map +1 -1
- package/dist/middleware/internal-methods/chain-id.d.mts +3 -1
- package/dist/middleware/internal-methods/chain-id.d.mts.map +1 -1
- package/dist/middleware/internal-methods/chain-id.mjs +3 -4
- package/dist/middleware/internal-methods/chain-id.mjs.map +1 -1
- package/dist/middleware/internal-methods/middleware.cjs +0 -2
- package/dist/middleware/internal-methods/middleware.cjs.map +1 -1
- package/dist/middleware/internal-methods/middleware.d.cts +14 -1
- package/dist/middleware/internal-methods/middleware.d.cts.map +1 -1
- package/dist/middleware/internal-methods/middleware.d.mts +14 -1
- package/dist/middleware/internal-methods/middleware.d.mts.map +1 -1
- package/dist/middleware/internal-methods/middleware.mjs +0 -2
- package/dist/middleware/internal-methods/middleware.mjs.map +1 -1
- package/dist/middleware/internal-methods/net-version.cjs +5 -4
- package/dist/middleware/internal-methods/net-version.cjs.map +1 -1
- package/dist/middleware/internal-methods/net-version.d.cts +3 -1
- package/dist/middleware/internal-methods/net-version.d.cts.map +1 -1
- package/dist/middleware/internal-methods/net-version.d.mts +3 -1
- package/dist/middleware/internal-methods/net-version.d.mts.map +1 -1
- package/dist/middleware/internal-methods/net-version.mjs +5 -4
- package/dist/middleware/internal-methods/net-version.mjs.map +1 -1
- package/dist/middleware/internal-methods/switch-ethereum-chain.cjs +7 -3
- package/dist/middleware/internal-methods/switch-ethereum-chain.cjs.map +1 -1
- package/dist/middleware/internal-methods/switch-ethereum-chain.d.cts +7 -4
- package/dist/middleware/internal-methods/switch-ethereum-chain.d.cts.map +1 -1
- package/dist/middleware/internal-methods/switch-ethereum-chain.d.mts +7 -4
- package/dist/middleware/internal-methods/switch-ethereum-chain.d.mts.map +1 -1
- package/dist/middleware/internal-methods/switch-ethereum-chain.mjs +7 -3
- package/dist/middleware/internal-methods/switch-ethereum-chain.mjs.map +1 -1
- package/dist/middleware/provider.cjs +39 -0
- package/dist/middleware/provider.cjs.map +1 -0
- package/dist/middleware/provider.d.cts +11 -0
- package/dist/middleware/provider.d.cts.map +1 -0
- package/dist/middleware/provider.d.mts +11 -0
- package/dist/middleware/provider.d.mts.map +1 -0
- package/dist/middleware/provider.mjs +35 -0
- package/dist/middleware/provider.mjs.map +1 -0
- package/dist/simulation.cjs +6 -2
- package/dist/simulation.cjs.map +1 -1
- package/dist/simulation.d.cts +17 -3
- package/dist/simulation.d.cts.map +1 -1
- package/dist/simulation.d.mts +17 -3
- package/dist/simulation.d.mts.map +1 -1
- package/dist/simulation.mjs +7 -3
- package/dist/simulation.mjs.map +1 -1
- package/dist/store/chain.cjs +29 -0
- package/dist/store/chain.cjs.map +1 -0
- package/dist/store/chain.d.cts +18 -0
- package/dist/store/chain.d.cts.map +1 -0
- package/dist/store/chain.d.mts +18 -0
- package/dist/store/chain.d.mts.map +1 -0
- package/dist/store/chain.mjs +26 -0
- package/dist/store/chain.mjs.map +1 -0
- package/dist/store/index.cjs +1 -0
- package/dist/store/index.cjs.map +1 -1
- package/dist/store/index.d.cts +1 -0
- package/dist/store/index.d.cts.map +1 -1
- package/dist/store/index.d.mts +1 -0
- package/dist/store/index.d.mts.map +1 -1
- package/dist/store/index.mjs +1 -0
- package/dist/store/index.mjs.map +1 -1
- package/dist/store/notifications.d.cts +1 -0
- package/dist/store/notifications.d.cts.map +1 -1
- package/dist/store/notifications.d.mts +1 -0
- package/dist/store/notifications.d.mts.map +1 -1
- package/dist/store/state.d.cts +2 -0
- package/dist/store/state.d.cts.map +1 -1
- package/dist/store/state.d.mts +2 -0
- package/dist/store/state.d.mts.map +1 -1
- package/dist/store/store.cjs +2 -0
- package/dist/store/store.cjs.map +1 -1
- package/dist/store/store.d.cts +1 -0
- package/dist/store/store.d.cts.map +1 -1
- package/dist/store/store.d.mts +1 -0
- package/dist/store/store.d.mts.map +1 -1
- package/dist/store/store.mjs +2 -0
- package/dist/store/store.mjs.map +1 -1
- package/dist/store/trackables.d.cts +3 -0
- package/dist/store/trackables.d.cts.map +1 -1
- package/dist/store/trackables.d.mts +3 -0
- package/dist/store/trackables.d.mts.map +1 -1
- package/dist/store/ui.d.cts +1 -0
- package/dist/store/ui.d.cts.map +1 -1
- package/dist/store/ui.d.mts +1 -0
- package/dist/store/ui.d.mts.map +1 -1
- package/dist/structs.d.cts +51 -51
- package/dist/structs.d.mts +51 -51
- package/package.json +10 -9
- package/dist/middleware/internal-methods/provider-state.cjs +0 -28
- package/dist/middleware/internal-methods/provider-state.cjs.map +0 -1
- package/dist/middleware/internal-methods/provider-state.d.cts +0 -16
- package/dist/middleware/internal-methods/provider-state.d.cts.map +0 -1
- package/dist/middleware/internal-methods/provider-state.d.mts +0 -16
- package/dist/middleware/internal-methods/provider-state.d.mts.map +0 -1
- package/dist/middleware/internal-methods/provider-state.mjs +0 -24
- package/dist/middleware/internal-methods/provider-state.mjs.map +0 -1
package/dist/structs.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { SnapResponse, SnapResponseWithInterface } from "./types.mjs";
|
|
2
2
|
export declare const TransactionOptionsStruct: import("@metamask/superstruct").Struct<{
|
|
3
|
-
data: `0x${string}`;
|
|
4
3
|
chainId: string;
|
|
5
4
|
origin: string;
|
|
6
5
|
from: `0x${string}`;
|
|
@@ -10,6 +9,7 @@ export declare const TransactionOptionsStruct: import("@metamask/superstruct").S
|
|
|
10
9
|
maxFeePerGas: `0x${string}`;
|
|
11
10
|
maxPriorityFeePerGas: `0x${string}`;
|
|
12
11
|
nonce: `0x${string}`;
|
|
12
|
+
data: `0x${string}`;
|
|
13
13
|
}, {
|
|
14
14
|
/**
|
|
15
15
|
* The CAIP-2 chain ID to send the transaction on. Defaults to `eip155:1`.
|
|
@@ -63,9 +63,9 @@ export declare const TransactionOptionsStruct: import("@metamask/superstruct").S
|
|
|
63
63
|
data: import("@metamask/superstruct").Struct<`0x${string}`, null>;
|
|
64
64
|
}>;
|
|
65
65
|
export declare const SignatureOptionsStruct: import("@metamask/superstruct").Struct<{
|
|
66
|
-
data: `0x${string}` | Record<string, any> | Record<string, any>[];
|
|
67
66
|
origin: string;
|
|
68
67
|
from: `0x${string}`;
|
|
68
|
+
data: `0x${string}` | Record<string, any> | Record<string, any>[];
|
|
69
69
|
signatureMethod: "eth_signTypedData" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "personal_sign";
|
|
70
70
|
}, {
|
|
71
71
|
/**
|
|
@@ -126,29 +126,29 @@ export declare const InterfaceStruct: import("@metamask/superstruct").Struct<{
|
|
|
126
126
|
}>;
|
|
127
127
|
export declare const SnapResponseWithoutInterfaceStruct: import("@metamask/superstruct").Struct<{
|
|
128
128
|
id: string;
|
|
129
|
+
response: {
|
|
130
|
+
result: import("@metamask/snaps-sdk").Json;
|
|
131
|
+
} | {
|
|
132
|
+
error: import("@metamask/snaps-sdk").Json;
|
|
133
|
+
};
|
|
129
134
|
notifications: {
|
|
130
135
|
id: string;
|
|
131
136
|
message: string;
|
|
132
137
|
type: "inApp" | "native";
|
|
133
|
-
title?: string | undefined;
|
|
134
138
|
content?: string | undefined;
|
|
139
|
+
title?: string | undefined;
|
|
135
140
|
footerLink?: {
|
|
136
|
-
text: string;
|
|
137
141
|
href: string;
|
|
142
|
+
text: string;
|
|
138
143
|
} | undefined;
|
|
139
144
|
}[];
|
|
140
|
-
response: {
|
|
141
|
-
result: import("@metamask/snaps-sdk").Json;
|
|
142
|
-
} | {
|
|
143
|
-
error: import("@metamask/snaps-sdk").Json;
|
|
144
|
-
};
|
|
145
145
|
tracked: {
|
|
146
|
+
errors: import("@metamask/snaps-sdk").TrackableError[];
|
|
146
147
|
events: {
|
|
147
148
|
event: string;
|
|
148
149
|
properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
|
|
149
150
|
sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
|
|
150
151
|
}[];
|
|
151
|
-
errors: import("@metamask/snaps-sdk").TrackableError[];
|
|
152
152
|
traces: {
|
|
153
153
|
name: string;
|
|
154
154
|
id?: string | undefined;
|
|
@@ -169,21 +169,21 @@ export declare const SnapResponseWithoutInterfaceStruct: import("@metamask/super
|
|
|
169
169
|
id: string;
|
|
170
170
|
message: string;
|
|
171
171
|
type: "inApp" | "native";
|
|
172
|
-
title?: string | undefined;
|
|
173
172
|
content?: string | undefined;
|
|
173
|
+
title?: string | undefined;
|
|
174
174
|
footerLink?: {
|
|
175
|
-
text: string;
|
|
176
175
|
href: string;
|
|
176
|
+
text: string;
|
|
177
177
|
} | undefined;
|
|
178
178
|
}[], import("@metamask/superstruct").Struct<{
|
|
179
179
|
id: string;
|
|
180
180
|
message: string;
|
|
181
181
|
type: "inApp" | "native";
|
|
182
|
-
title?: string | undefined;
|
|
183
182
|
content?: string | undefined;
|
|
183
|
+
title?: string | undefined;
|
|
184
184
|
footerLink?: {
|
|
185
|
-
text: string;
|
|
186
185
|
href: string;
|
|
186
|
+
text: string;
|
|
187
187
|
} | undefined;
|
|
188
188
|
}, {
|
|
189
189
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -192,20 +192,20 @@ export declare const SnapResponseWithoutInterfaceStruct: import("@metamask/super
|
|
|
192
192
|
title: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
193
193
|
content: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
194
194
|
footerLink: import("@metamask/superstruct").Struct<{
|
|
195
|
-
text: string;
|
|
196
195
|
href: string;
|
|
196
|
+
text: string;
|
|
197
197
|
} | undefined, {
|
|
198
198
|
href: import("@metamask/superstruct").Struct<string, null>;
|
|
199
199
|
text: import("@metamask/superstruct").Struct<string, null>;
|
|
200
200
|
}>;
|
|
201
201
|
}>>;
|
|
202
202
|
tracked: import("@metamask/superstruct").Struct<{
|
|
203
|
+
errors: import("@metamask/snaps-sdk").TrackableError[];
|
|
203
204
|
events: {
|
|
204
205
|
event: string;
|
|
205
206
|
properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
|
|
206
207
|
sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
|
|
207
208
|
}[];
|
|
208
|
-
errors: import("@metamask/snaps-sdk").TrackableError[];
|
|
209
209
|
traces: {
|
|
210
210
|
name: string;
|
|
211
211
|
id?: string | undefined;
|
|
@@ -255,29 +255,29 @@ export declare const SnapResponseWithoutInterfaceStruct: import("@metamask/super
|
|
|
255
255
|
}>;
|
|
256
256
|
export declare const SnapResponseWithInterfaceStruct: import("@metamask/superstruct").Struct<{
|
|
257
257
|
id: string;
|
|
258
|
+
response: {
|
|
259
|
+
result: import("@metamask/snaps-sdk").Json;
|
|
260
|
+
} | {
|
|
261
|
+
error: import("@metamask/snaps-sdk").Json;
|
|
262
|
+
};
|
|
258
263
|
notifications: {
|
|
259
264
|
id: string;
|
|
260
265
|
message: string;
|
|
261
266
|
type: "inApp" | "native";
|
|
262
|
-
title?: string | undefined;
|
|
263
267
|
content?: string | undefined;
|
|
268
|
+
title?: string | undefined;
|
|
264
269
|
footerLink?: {
|
|
265
|
-
text: string;
|
|
266
270
|
href: string;
|
|
271
|
+
text: string;
|
|
267
272
|
} | undefined;
|
|
268
273
|
}[];
|
|
269
|
-
response: {
|
|
270
|
-
result: import("@metamask/snaps-sdk").Json;
|
|
271
|
-
} | {
|
|
272
|
-
error: import("@metamask/snaps-sdk").Json;
|
|
273
|
-
};
|
|
274
274
|
tracked: {
|
|
275
|
+
errors: import("@metamask/snaps-sdk").TrackableError[];
|
|
275
276
|
events: {
|
|
276
277
|
event: string;
|
|
277
278
|
properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
|
|
278
279
|
sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
|
|
279
280
|
}[];
|
|
280
|
-
errors: import("@metamask/snaps-sdk").TrackableError[];
|
|
281
281
|
traces: {
|
|
282
282
|
name: string;
|
|
283
283
|
id?: string | undefined;
|
|
@@ -291,25 +291,30 @@ export declare const SnapResponseWithInterfaceStruct: import("@metamask/superstr
|
|
|
291
291
|
}, {
|
|
292
292
|
getInterface: import("@metamask/superstruct").Struct<Function, null>;
|
|
293
293
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
294
|
+
response: import("@metamask/superstruct").Struct<{
|
|
295
|
+
result: import("@metamask/snaps-sdk").Json;
|
|
296
|
+
} | {
|
|
297
|
+
error: import("@metamask/snaps-sdk").Json;
|
|
298
|
+
}, null>;
|
|
294
299
|
notifications: import("@metamask/superstruct").Struct<{
|
|
295
300
|
id: string;
|
|
296
301
|
message: string;
|
|
297
302
|
type: "inApp" | "native";
|
|
298
|
-
title?: string | undefined;
|
|
299
303
|
content?: string | undefined;
|
|
304
|
+
title?: string | undefined;
|
|
300
305
|
footerLink?: {
|
|
301
|
-
text: string;
|
|
302
306
|
href: string;
|
|
307
|
+
text: string;
|
|
303
308
|
} | undefined;
|
|
304
309
|
}[], import("@metamask/superstruct").Struct<{
|
|
305
310
|
id: string;
|
|
306
311
|
message: string;
|
|
307
312
|
type: "inApp" | "native";
|
|
308
|
-
title?: string | undefined;
|
|
309
313
|
content?: string | undefined;
|
|
314
|
+
title?: string | undefined;
|
|
310
315
|
footerLink?: {
|
|
311
|
-
text: string;
|
|
312
316
|
href: string;
|
|
317
|
+
text: string;
|
|
313
318
|
} | undefined;
|
|
314
319
|
}, {
|
|
315
320
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -318,25 +323,20 @@ export declare const SnapResponseWithInterfaceStruct: import("@metamask/superstr
|
|
|
318
323
|
title: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
319
324
|
content: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
320
325
|
footerLink: import("@metamask/superstruct").Struct<{
|
|
321
|
-
text: string;
|
|
322
326
|
href: string;
|
|
327
|
+
text: string;
|
|
323
328
|
} | undefined, {
|
|
324
329
|
href: import("@metamask/superstruct").Struct<string, null>;
|
|
325
330
|
text: import("@metamask/superstruct").Struct<string, null>;
|
|
326
331
|
}>;
|
|
327
332
|
}>>;
|
|
328
|
-
response: import("@metamask/superstruct").Struct<{
|
|
329
|
-
result: import("@metamask/snaps-sdk").Json;
|
|
330
|
-
} | {
|
|
331
|
-
error: import("@metamask/snaps-sdk").Json;
|
|
332
|
-
}, null>;
|
|
333
333
|
tracked: import("@metamask/superstruct").Struct<{
|
|
334
|
+
errors: import("@metamask/snaps-sdk").TrackableError[];
|
|
334
335
|
events: {
|
|
335
336
|
event: string;
|
|
336
337
|
properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
|
|
337
338
|
sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
|
|
338
339
|
}[];
|
|
339
|
-
errors: import("@metamask/snaps-sdk").TrackableError[];
|
|
340
340
|
traces: {
|
|
341
341
|
name: string;
|
|
342
342
|
id?: string | undefined;
|
|
@@ -386,29 +386,29 @@ export declare const SnapResponseWithInterfaceStruct: import("@metamask/superstr
|
|
|
386
386
|
}>;
|
|
387
387
|
export declare const SnapResponseStruct: import("@metamask/superstruct").Struct<{
|
|
388
388
|
id: string;
|
|
389
|
+
response: {
|
|
390
|
+
result: import("@metamask/snaps-sdk").Json;
|
|
391
|
+
} | {
|
|
392
|
+
error: import("@metamask/snaps-sdk").Json;
|
|
393
|
+
};
|
|
389
394
|
notifications: {
|
|
390
395
|
id: string;
|
|
391
396
|
message: string;
|
|
392
397
|
type: "inApp" | "native";
|
|
393
|
-
title?: string | undefined;
|
|
394
398
|
content?: string | undefined;
|
|
399
|
+
title?: string | undefined;
|
|
395
400
|
footerLink?: {
|
|
396
|
-
text: string;
|
|
397
401
|
href: string;
|
|
402
|
+
text: string;
|
|
398
403
|
} | undefined;
|
|
399
404
|
}[];
|
|
400
|
-
response: {
|
|
401
|
-
result: import("@metamask/snaps-sdk").Json;
|
|
402
|
-
} | {
|
|
403
|
-
error: import("@metamask/snaps-sdk").Json;
|
|
404
|
-
};
|
|
405
405
|
tracked: {
|
|
406
|
+
errors: import("@metamask/snaps-sdk").TrackableError[];
|
|
406
407
|
events: {
|
|
407
408
|
event: string;
|
|
408
409
|
properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
|
|
409
410
|
sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
|
|
410
411
|
}[];
|
|
411
|
-
errors: import("@metamask/snaps-sdk").TrackableError[];
|
|
412
412
|
traces: {
|
|
413
413
|
name: string;
|
|
414
414
|
id?: string | undefined;
|
|
@@ -420,29 +420,29 @@ export declare const SnapResponseStruct: import("@metamask/superstruct").Struct<
|
|
|
420
420
|
};
|
|
421
421
|
} | {
|
|
422
422
|
id: string;
|
|
423
|
+
response: {
|
|
424
|
+
result: import("@metamask/snaps-sdk").Json;
|
|
425
|
+
} | {
|
|
426
|
+
error: import("@metamask/snaps-sdk").Json;
|
|
427
|
+
};
|
|
423
428
|
notifications: {
|
|
424
429
|
id: string;
|
|
425
430
|
message: string;
|
|
426
431
|
type: "inApp" | "native";
|
|
427
|
-
title?: string | undefined;
|
|
428
432
|
content?: string | undefined;
|
|
433
|
+
title?: string | undefined;
|
|
429
434
|
footerLink?: {
|
|
430
|
-
text: string;
|
|
431
435
|
href: string;
|
|
436
|
+
text: string;
|
|
432
437
|
} | undefined;
|
|
433
438
|
}[];
|
|
434
|
-
response: {
|
|
435
|
-
result: import("@metamask/snaps-sdk").Json;
|
|
436
|
-
} | {
|
|
437
|
-
error: import("@metamask/snaps-sdk").Json;
|
|
438
|
-
};
|
|
439
439
|
tracked: {
|
|
440
|
+
errors: import("@metamask/snaps-sdk").TrackableError[];
|
|
440
441
|
events: {
|
|
441
442
|
event: string;
|
|
442
443
|
properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
|
|
443
444
|
sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
|
|
444
445
|
}[];
|
|
445
|
-
errors: import("@metamask/snaps-sdk").TrackableError[];
|
|
446
446
|
traces: {
|
|
447
447
|
name: string;
|
|
448
448
|
id?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/snaps-simulation",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0",
|
|
4
4
|
"description": "A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -55,21 +55,22 @@
|
|
|
55
55
|
"test:watch": "jest --watch"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@metamask/eth-json-rpc-middleware": "^17.0.1",
|
|
59
58
|
"@metamask/json-rpc-engine": "^10.1.0",
|
|
60
59
|
"@metamask/json-rpc-middleware-stream": "^8.0.8",
|
|
61
60
|
"@metamask/key-tree": "^10.1.1",
|
|
62
61
|
"@metamask/messenger": "^0.3.0",
|
|
63
|
-
"@metamask/permission-controller": "^12.
|
|
64
|
-
"@metamask/phishing-controller": "^
|
|
65
|
-
"@metamask/
|
|
62
|
+
"@metamask/permission-controller": "^12.2.0",
|
|
63
|
+
"@metamask/phishing-controller": "^16.1.0",
|
|
64
|
+
"@metamask/rpc-errors": "^7.0.3",
|
|
65
|
+
"@metamask/snaps-controllers": "^17.2.1",
|
|
66
66
|
"@metamask/snaps-execution-environments": "^10.3.0",
|
|
67
67
|
"@metamask/snaps-rpc-methods": "^14.1.1",
|
|
68
|
-
"@metamask/snaps-sdk": "^10.
|
|
69
|
-
"@metamask/snaps-utils": "^11.
|
|
68
|
+
"@metamask/snaps-sdk": "^10.3.0",
|
|
69
|
+
"@metamask/snaps-utils": "^11.7.1",
|
|
70
70
|
"@metamask/superstruct": "^3.2.1",
|
|
71
|
-
"@metamask/utils": "^11.
|
|
71
|
+
"@metamask/utils": "^11.9.0",
|
|
72
72
|
"@reduxjs/toolkit": "^1.9.5",
|
|
73
|
+
"ethers": "^6.16.0",
|
|
73
74
|
"fast-deep-equal": "^3.1.3",
|
|
74
75
|
"immer": "^9.0.21",
|
|
75
76
|
"mime": "^3.0.0",
|
|
@@ -77,7 +78,7 @@
|
|
|
77
78
|
"redux-saga": "^1.2.3"
|
|
78
79
|
},
|
|
79
80
|
"devDependencies": {
|
|
80
|
-
"@lavamoat/allow-scripts": "^3.4.
|
|
81
|
+
"@lavamoat/allow-scripts": "^3.4.1",
|
|
81
82
|
"@metamask/auto-changelog": "^5.0.2",
|
|
82
83
|
"@ts-bridge/cli": "^0.6.1",
|
|
83
84
|
"@types/express": "^5.0.1",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getProviderStateHandler = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* A mock handler for metamask_getProviderState that always returns a specific
|
|
6
|
-
* hardcoded result.
|
|
7
|
-
*
|
|
8
|
-
* @param _request - Incoming JSON-RPC request. Ignored for this specific
|
|
9
|
-
* handler.
|
|
10
|
-
* @param response - The outgoing JSON-RPC response, modified to return the
|
|
11
|
-
* result.
|
|
12
|
-
* @param _next - The `json-rpc-engine` middleware next handler.
|
|
13
|
-
* @param end - The `json-rpc-engine` middleware end handler.
|
|
14
|
-
* @returns The JSON-RPC response.
|
|
15
|
-
*/
|
|
16
|
-
async function getProviderStateHandler(_request, response, _next, end) {
|
|
17
|
-
// For now this will return a mocked result, this should probably match
|
|
18
|
-
// whatever network the simulation is using.
|
|
19
|
-
response.result = {
|
|
20
|
-
isUnlocked: true,
|
|
21
|
-
chainId: '0x01',
|
|
22
|
-
networkVersion: '0x01',
|
|
23
|
-
accounts: [],
|
|
24
|
-
};
|
|
25
|
-
return end();
|
|
26
|
-
}
|
|
27
|
-
exports.getProviderStateHandler = getProviderStateHandler;
|
|
28
|
-
//# sourceMappingURL=provider-state.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider-state.cjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":";;;AAMA;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,uBAAuB,CAC3C,QAAwB,EACxB,QAAgC,EAChC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG;QAChB,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,MAAM;QACtB,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAhBD,0DAgBC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';\n\n/**\n * A mock handler for metamask_getProviderState that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getProviderStateHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = {\n isUnlocked: true,\n chainId: '0x01',\n networkVersion: '0x01',\n accounts: [],\n };\n\n return end();\n}\n"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
|
|
2
|
-
import type { JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
|
|
3
|
-
/**
|
|
4
|
-
* A mock handler for metamask_getProviderState that always returns a specific
|
|
5
|
-
* hardcoded result.
|
|
6
|
-
*
|
|
7
|
-
* @param _request - Incoming JSON-RPC request. Ignored for this specific
|
|
8
|
-
* handler.
|
|
9
|
-
* @param response - The outgoing JSON-RPC response, modified to return the
|
|
10
|
-
* result.
|
|
11
|
-
* @param _next - The `json-rpc-engine` middleware next handler.
|
|
12
|
-
* @param end - The `json-rpc-engine` middleware end handler.
|
|
13
|
-
* @returns The JSON-RPC response.
|
|
14
|
-
*/
|
|
15
|
-
export declare function getProviderStateHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
|
|
16
|
-
//# sourceMappingURL=provider-state.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider-state.d.cts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,wBAAwB;AAE9E;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAY9B"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
|
|
2
|
-
import type { JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
|
|
3
|
-
/**
|
|
4
|
-
* A mock handler for metamask_getProviderState that always returns a specific
|
|
5
|
-
* hardcoded result.
|
|
6
|
-
*
|
|
7
|
-
* @param _request - Incoming JSON-RPC request. Ignored for this specific
|
|
8
|
-
* handler.
|
|
9
|
-
* @param response - The outgoing JSON-RPC response, modified to return the
|
|
10
|
-
* result.
|
|
11
|
-
* @param _next - The `json-rpc-engine` middleware next handler.
|
|
12
|
-
* @param end - The `json-rpc-engine` middleware end handler.
|
|
13
|
-
* @returns The JSON-RPC response.
|
|
14
|
-
*/
|
|
15
|
-
export declare function getProviderStateHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
|
|
16
|
-
//# sourceMappingURL=provider-state.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider-state.d.mts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,wBAAwB;AAE9E;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAY9B"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A mock handler for metamask_getProviderState that always returns a specific
|
|
3
|
-
* hardcoded result.
|
|
4
|
-
*
|
|
5
|
-
* @param _request - Incoming JSON-RPC request. Ignored for this specific
|
|
6
|
-
* handler.
|
|
7
|
-
* @param response - The outgoing JSON-RPC response, modified to return the
|
|
8
|
-
* result.
|
|
9
|
-
* @param _next - The `json-rpc-engine` middleware next handler.
|
|
10
|
-
* @param end - The `json-rpc-engine` middleware end handler.
|
|
11
|
-
* @returns The JSON-RPC response.
|
|
12
|
-
*/
|
|
13
|
-
export async function getProviderStateHandler(_request, response, _next, end) {
|
|
14
|
-
// For now this will return a mocked result, this should probably match
|
|
15
|
-
// whatever network the simulation is using.
|
|
16
|
-
response.result = {
|
|
17
|
-
isUnlocked: true,
|
|
18
|
-
chainId: '0x01',
|
|
19
|
-
networkVersion: '0x01',
|
|
20
|
-
accounts: [],
|
|
21
|
-
};
|
|
22
|
-
return end();
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=provider-state.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider-state.mjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,QAAwB,EACxB,QAAgC,EAChC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG;QAChB,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,MAAM;QACtB,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,OAAO,GAAG,EAAE,CAAC;AACf,CAAC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';\n\n/**\n * A mock handler for metamask_getProviderState that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getProviderStateHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = {\n isUnlocked: true,\n chainId: '0x01',\n networkVersion: '0x01',\n accounts: [],\n };\n\n return end();\n}\n"]}
|