@metamask/keyring-api 14.0.0 → 16.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.
- package/CHANGELOG.md +28 -1
- package/dist/api/account.cjs +2 -2
- package/dist/api/account.cjs.map +1 -1
- package/dist/api/account.d.cts +2 -2
- package/dist/api/account.d.cts.map +1 -1
- package/dist/api/account.d.mts +2 -2
- package/dist/api/account.d.mts.map +1 -1
- package/dist/api/account.mjs +5 -5
- package/dist/api/account.mjs.map +1 -1
- package/dist/api/address.cjs +14 -0
- package/dist/api/address.cjs.map +1 -0
- package/dist/api/address.d.cts +19 -0
- package/dist/api/address.d.cts.map +1 -0
- package/dist/api/address.d.mts +19 -0
- package/dist/api/address.d.mts.map +1 -0
- package/dist/api/address.mjs +11 -0
- package/dist/api/address.mjs.map +1 -0
- package/dist/api/asset.cjs +15 -9
- package/dist/api/asset.cjs.map +1 -1
- package/dist/api/asset.d.cts +25 -9
- package/dist/api/asset.d.cts.map +1 -1
- package/dist/api/asset.d.mts +25 -9
- package/dist/api/asset.d.mts.map +1 -1
- package/dist/api/asset.mjs +14 -8
- package/dist/api/asset.mjs.map +1 -1
- package/dist/api/index.cjs +1 -1
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.d.cts +1 -1
- package/dist/api/index.d.cts.map +1 -1
- package/dist/api/index.d.mts +1 -1
- package/dist/api/index.d.mts.map +1 -1
- package/dist/api/index.mjs +1 -1
- package/dist/api/index.mjs.map +1 -1
- package/dist/api/keyring.cjs.map +1 -1
- package/dist/api/keyring.d.cts +16 -2
- package/dist/api/keyring.d.cts.map +1 -1
- package/dist/api/keyring.d.mts +16 -2
- package/dist/api/keyring.d.mts.map +1 -1
- package/dist/api/keyring.mjs.map +1 -1
- package/dist/api/transaction.d.cts +30 -30
- package/dist/api/transaction.d.mts +30 -30
- package/dist/btc/constants.cjs +9 -10
- package/dist/btc/constants.cjs.map +1 -1
- package/dist/btc/constants.d.cts +1 -2
- package/dist/btc/constants.d.cts.map +1 -1
- package/dist/btc/constants.d.mts +1 -2
- package/dist/btc/constants.d.mts.map +1 -1
- package/dist/btc/constants.mjs +8 -9
- package/dist/btc/constants.mjs.map +1 -1
- package/dist/btc/types.cjs +7 -0
- package/dist/btc/types.cjs.map +1 -1
- package/dist/btc/types.d.cts +7 -2
- package/dist/btc/types.d.cts.map +1 -1
- package/dist/btc/types.d.mts +7 -2
- package/dist/btc/types.d.mts.map +1 -1
- package/dist/btc/types.mjs +8 -1
- package/dist/btc/types.mjs.map +1 -1
- package/dist/eth/constants.cjs +7 -6
- package/dist/eth/constants.cjs.map +1 -1
- package/dist/eth/constants.d.cts +4 -3
- package/dist/eth/constants.d.cts.map +1 -1
- package/dist/eth/constants.d.mts +4 -3
- package/dist/eth/constants.d.mts.map +1 -1
- package/dist/eth/constants.mjs +6 -5
- package/dist/eth/constants.mjs.map +1 -1
- package/dist/eth/types.cjs +7 -2
- package/dist/eth/types.cjs.map +1 -1
- package/dist/eth/types.d.cts +9 -6
- package/dist/eth/types.d.cts.map +1 -1
- package/dist/eth/types.d.mts +9 -6
- package/dist/eth/types.d.mts.map +1 -1
- package/dist/eth/types.mjs +8 -3
- package/dist/eth/types.mjs.map +1 -1
- package/dist/events.cjs +75 -1
- package/dist/events.cjs.map +1 -1
- package/dist/events.d.cts +248 -9
- package/dist/events.d.cts.map +1 -1
- package/dist/events.d.mts +248 -9
- package/dist/events.d.mts.map +1 -1
- package/dist/events.mjs +78 -4
- package/dist/events.mjs.map +1 -1
- package/dist/rpc.cjs +18 -4
- package/dist/rpc.cjs.map +1 -1
- package/dist/rpc.d.cts +77 -29
- package/dist/rpc.d.cts.map +1 -1
- package/dist/rpc.d.mts +77 -29
- package/dist/rpc.d.mts.map +1 -1
- package/dist/rpc.mjs +18 -4
- package/dist/rpc.mjs.map +1 -1
- package/dist/sol/constants.cjs +7 -8
- package/dist/sol/constants.cjs.map +1 -1
- package/dist/sol/constants.d.cts +1 -2
- package/dist/sol/constants.d.cts.map +1 -1
- package/dist/sol/constants.d.mts +1 -2
- package/dist/sol/constants.d.mts.map +1 -1
- package/dist/sol/constants.mjs +6 -7
- package/dist/sol/constants.mjs.map +1 -1
- package/dist/sol/types.cjs +5 -0
- package/dist/sol/types.cjs.map +1 -1
- package/dist/sol/types.d.cts +5 -2
- package/dist/sol/types.d.cts.map +1 -1
- package/dist/sol/types.d.mts +5 -2
- package/dist/sol/types.d.mts.map +1 -1
- package/dist/sol/types.mjs +6 -1
- package/dist/sol/types.mjs.map +1 -1
- package/package.json +4 -4
- package/dist/api/caip.cjs +0 -21
- package/dist/api/caip.cjs.map +0 -1
- package/dist/api/caip.d.cts +0 -21
- package/dist/api/caip.d.cts.map +0 -1
- package/dist/api/caip.d.mts +0 -21
- package/dist/api/caip.d.mts.map +0 -1
- package/dist/api/caip.mjs +0 -18
- package/dist/api/caip.mjs.map +0 -1
package/dist/events.d.cts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
1
2
|
/**
|
2
3
|
* Supported keyring events.
|
3
4
|
*/
|
@@ -6,7 +7,10 @@ export declare enum KeyringEvent {
|
|
6
7
|
AccountUpdated = "notify:accountUpdated",
|
7
8
|
AccountDeleted = "notify:accountDeleted",
|
8
9
|
RequestApproved = "notify:requestApproved",
|
9
|
-
RequestRejected = "notify:requestRejected"
|
10
|
+
RequestRejected = "notify:requestRejected",
|
11
|
+
AccountBalancesUpdated = "notify:accountBalancesUpdated",
|
12
|
+
AccountAssetListUpdated = "notify:accountAssetListUpdated",
|
13
|
+
AccountTransactionsUpdated = "notify:accountTransactionsUpdated"
|
10
14
|
}
|
11
15
|
export declare const AccountCreatedEventStruct: import("@metamask/superstruct").Struct<{
|
12
16
|
method: "notify:accountCreated";
|
@@ -16,7 +20,7 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
|
|
16
20
|
id: string;
|
17
21
|
options: Record<string, import("@metamask/utils").Json>;
|
18
22
|
address: string;
|
19
|
-
scopes: string[];
|
23
|
+
scopes: `${string}:${string}`[];
|
20
24
|
methods: string[];
|
21
25
|
};
|
22
26
|
accountNameSuggestion?: string;
|
@@ -30,7 +34,7 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
|
|
30
34
|
id: string;
|
31
35
|
options: Record<string, import("@metamask/utils").Json>;
|
32
36
|
address: string;
|
33
|
-
scopes: string[];
|
37
|
+
scopes: `${string}:${string}`[];
|
34
38
|
methods: string[];
|
35
39
|
};
|
36
40
|
accountNameSuggestion?: string;
|
@@ -44,7 +48,7 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
|
|
44
48
|
id: string;
|
45
49
|
options: Record<string, import("@metamask/utils").Json>;
|
46
50
|
address: string;
|
47
|
-
scopes: string[];
|
51
|
+
scopes: `${string}:${string}`[];
|
48
52
|
methods: string[];
|
49
53
|
}, {
|
50
54
|
id: import("@metamask/superstruct").Struct<string, null>;
|
@@ -55,7 +59,7 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
|
|
55
59
|
"solana:data-account": "solana:data-account";
|
56
60
|
}>;
|
57
61
|
address: import("@metamask/superstruct").Struct<string, null>;
|
58
|
-
scopes: import("@metamask/superstruct").Struct
|
62
|
+
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
|
59
63
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
60
64
|
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
61
65
|
}>;
|
@@ -82,7 +86,7 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
|
|
82
86
|
id: string;
|
83
87
|
options: Record<string, import("@metamask/utils").Json>;
|
84
88
|
address: string;
|
85
|
-
scopes: string[];
|
89
|
+
scopes: `${string}:${string}`[];
|
86
90
|
methods: string[];
|
87
91
|
};
|
88
92
|
};
|
@@ -94,7 +98,7 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
|
|
94
98
|
id: string;
|
95
99
|
options: Record<string, import("@metamask/utils").Json>;
|
96
100
|
address: string;
|
97
|
-
scopes: string[];
|
101
|
+
scopes: `${string}:${string}`[];
|
98
102
|
methods: string[];
|
99
103
|
};
|
100
104
|
}, {
|
@@ -106,7 +110,7 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
|
|
106
110
|
id: string;
|
107
111
|
options: Record<string, import("@metamask/utils").Json>;
|
108
112
|
address: string;
|
109
|
-
scopes: string[];
|
113
|
+
scopes: `${string}:${string}`[];
|
110
114
|
methods: string[];
|
111
115
|
}, {
|
112
116
|
id: import("@metamask/superstruct").Struct<string, null>;
|
@@ -117,7 +121,7 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
|
|
117
121
|
"solana:data-account": "solana:data-account";
|
118
122
|
}>;
|
119
123
|
address: import("@metamask/superstruct").Struct<string, null>;
|
120
|
-
scopes: import("@metamask/superstruct").Struct
|
124
|
+
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
|
121
125
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
122
126
|
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
123
127
|
}>;
|
@@ -177,4 +181,239 @@ export declare const RequestRejectedEventStruct: import("@metamask/superstruct")
|
|
177
181
|
id: import("@metamask/superstruct").Struct<string, null>;
|
178
182
|
}>;
|
179
183
|
}>;
|
184
|
+
export declare const AccountBalancesUpdatedEventStruct: import("@metamask/superstruct").Struct<{
|
185
|
+
method: "notify:accountBalancesUpdated";
|
186
|
+
params: {
|
187
|
+
balances: Record<string, Record<`${string}:${string}/${string}:${string}`, {
|
188
|
+
unit: string;
|
189
|
+
amount: string;
|
190
|
+
}>>;
|
191
|
+
};
|
192
|
+
}, {
|
193
|
+
method: import("@metamask/superstruct").Struct<"notify:accountBalancesUpdated", "notify:accountBalancesUpdated">;
|
194
|
+
params: import("@metamask/superstruct").Struct<{
|
195
|
+
balances: Record<string, Record<`${string}:${string}/${string}:${string}`, {
|
196
|
+
unit: string;
|
197
|
+
amount: string;
|
198
|
+
}>>;
|
199
|
+
}, {
|
200
|
+
/**
|
201
|
+
* Balances updates of accounts owned by the Snap.
|
202
|
+
*/
|
203
|
+
balances: import("@metamask/superstruct").Struct<Record<string, Record<`${string}:${string}/${string}:${string}`, {
|
204
|
+
unit: string;
|
205
|
+
amount: string;
|
206
|
+
}>>, null>;
|
207
|
+
}>;
|
208
|
+
}>;
|
209
|
+
/**
|
210
|
+
* Event emitted when the balances of an account are updated.
|
211
|
+
*
|
212
|
+
* Only changes are reported.
|
213
|
+
*
|
214
|
+
* The Snap can choose to emit this event for multiple accounts at once.
|
215
|
+
*/
|
216
|
+
export type AccountBalancesUpdatedEvent = Infer<typeof AccountBalancesUpdatedEventStruct>;
|
217
|
+
export type AccountBalancesUpdatedEventPayload = AccountBalancesUpdatedEvent['params'];
|
218
|
+
export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/superstruct").Struct<{
|
219
|
+
method: "notify:accountTransactionsUpdated";
|
220
|
+
params: {
|
221
|
+
transactions: Record<string, {
|
222
|
+
type: "send" | "receive";
|
223
|
+
id: string;
|
224
|
+
from: {
|
225
|
+
address: string;
|
226
|
+
asset: {
|
227
|
+
unit: string;
|
228
|
+
type: `${string}:${string}/${string}:${string}`;
|
229
|
+
amount: string;
|
230
|
+
fungible: true;
|
231
|
+
} | {
|
232
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
233
|
+
fungible: false;
|
234
|
+
} | null;
|
235
|
+
}[];
|
236
|
+
events: {
|
237
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
238
|
+
timestamp: number | null;
|
239
|
+
}[];
|
240
|
+
chain: `${string}:${string}`;
|
241
|
+
account: string;
|
242
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
243
|
+
timestamp: number | null;
|
244
|
+
to: {
|
245
|
+
address: string;
|
246
|
+
asset: {
|
247
|
+
unit: string;
|
248
|
+
type: `${string}:${string}/${string}:${string}`;
|
249
|
+
amount: string;
|
250
|
+
fungible: true;
|
251
|
+
} | {
|
252
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
253
|
+
fungible: false;
|
254
|
+
} | null;
|
255
|
+
}[];
|
256
|
+
fees: {
|
257
|
+
type: "base" | "priority";
|
258
|
+
asset: {
|
259
|
+
unit: string;
|
260
|
+
type: `${string}:${string}/${string}:${string}`;
|
261
|
+
amount: string;
|
262
|
+
fungible: true;
|
263
|
+
} | {
|
264
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
265
|
+
fungible: false;
|
266
|
+
};
|
267
|
+
}[];
|
268
|
+
}[]>;
|
269
|
+
};
|
270
|
+
}, {
|
271
|
+
method: import("@metamask/superstruct").Struct<"notify:accountTransactionsUpdated", "notify:accountTransactionsUpdated">;
|
272
|
+
params: import("@metamask/superstruct").Struct<{
|
273
|
+
transactions: Record<string, {
|
274
|
+
type: "send" | "receive";
|
275
|
+
id: string;
|
276
|
+
from: {
|
277
|
+
address: string;
|
278
|
+
asset: {
|
279
|
+
unit: string;
|
280
|
+
type: `${string}:${string}/${string}:${string}`;
|
281
|
+
amount: string;
|
282
|
+
fungible: true;
|
283
|
+
} | {
|
284
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
285
|
+
fungible: false;
|
286
|
+
} | null;
|
287
|
+
}[];
|
288
|
+
events: {
|
289
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
290
|
+
timestamp: number | null;
|
291
|
+
}[];
|
292
|
+
chain: `${string}:${string}`;
|
293
|
+
account: string;
|
294
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
295
|
+
timestamp: number | null;
|
296
|
+
to: {
|
297
|
+
address: string;
|
298
|
+
asset: {
|
299
|
+
unit: string;
|
300
|
+
type: `${string}:${string}/${string}:${string}`;
|
301
|
+
amount: string;
|
302
|
+
fungible: true;
|
303
|
+
} | {
|
304
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
305
|
+
fungible: false;
|
306
|
+
} | null;
|
307
|
+
}[];
|
308
|
+
fees: {
|
309
|
+
type: "base" | "priority";
|
310
|
+
asset: {
|
311
|
+
unit: string;
|
312
|
+
type: `${string}:${string}/${string}:${string}`;
|
313
|
+
amount: string;
|
314
|
+
fungible: true;
|
315
|
+
} | {
|
316
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
317
|
+
fungible: false;
|
318
|
+
};
|
319
|
+
}[];
|
320
|
+
}[]>;
|
321
|
+
}, {
|
322
|
+
/**
|
323
|
+
* Transactions updates of accounts owned by the Snap.
|
324
|
+
*/
|
325
|
+
transactions: import("@metamask/superstruct").Struct<Record<string, {
|
326
|
+
type: "send" | "receive";
|
327
|
+
id: string;
|
328
|
+
from: {
|
329
|
+
address: string;
|
330
|
+
asset: {
|
331
|
+
unit: string;
|
332
|
+
type: `${string}:${string}/${string}:${string}`;
|
333
|
+
amount: string;
|
334
|
+
fungible: true;
|
335
|
+
} | {
|
336
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
337
|
+
fungible: false;
|
338
|
+
} | null;
|
339
|
+
}[];
|
340
|
+
events: {
|
341
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
342
|
+
timestamp: number | null;
|
343
|
+
}[];
|
344
|
+
chain: `${string}:${string}`;
|
345
|
+
account: string;
|
346
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
347
|
+
timestamp: number | null;
|
348
|
+
to: {
|
349
|
+
address: string;
|
350
|
+
asset: {
|
351
|
+
unit: string;
|
352
|
+
type: `${string}:${string}/${string}:${string}`;
|
353
|
+
amount: string;
|
354
|
+
fungible: true;
|
355
|
+
} | {
|
356
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
357
|
+
fungible: false;
|
358
|
+
} | null;
|
359
|
+
}[];
|
360
|
+
fees: {
|
361
|
+
type: "base" | "priority";
|
362
|
+
asset: {
|
363
|
+
unit: string;
|
364
|
+
type: `${string}:${string}/${string}:${string}`;
|
365
|
+
amount: string;
|
366
|
+
fungible: true;
|
367
|
+
} | {
|
368
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
369
|
+
fungible: false;
|
370
|
+
};
|
371
|
+
}[];
|
372
|
+
}[]>, null>;
|
373
|
+
}>;
|
374
|
+
}>;
|
375
|
+
/**
|
376
|
+
* Event emitted when the transactions of an account are updated (added or
|
377
|
+
* changed).
|
378
|
+
*
|
379
|
+
* Only changes are reported.
|
380
|
+
*
|
381
|
+
* The Snap can choose to emit this event for multiple accounts at once.
|
382
|
+
*/
|
383
|
+
export type AccountTransactionsUpdatedEvent = Infer<typeof AccountTransactionsUpdatedEventStruct>;
|
384
|
+
export type AccountTransactionsUpdatedEventPayload = AccountTransactionsUpdatedEvent['params'];
|
385
|
+
export declare const AccountAssetListUpdatedEventStruct: import("@metamask/superstruct").Struct<{
|
386
|
+
method: "notify:accountAssetListUpdated";
|
387
|
+
params: {
|
388
|
+
assets: Record<string, {
|
389
|
+
added: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
390
|
+
removed: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
391
|
+
}>;
|
392
|
+
};
|
393
|
+
}, {
|
394
|
+
method: import("@metamask/superstruct").Struct<"notify:accountAssetListUpdated", "notify:accountAssetListUpdated">;
|
395
|
+
params: import("@metamask/superstruct").Struct<{
|
396
|
+
assets: Record<string, {
|
397
|
+
added: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
398
|
+
removed: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
399
|
+
}>;
|
400
|
+
}, {
|
401
|
+
/**
|
402
|
+
* Asset list update of accounts owned by the Snap.
|
403
|
+
*/
|
404
|
+
assets: import("@metamask/superstruct").Struct<Record<string, {
|
405
|
+
added: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
406
|
+
removed: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
407
|
+
}>, null>;
|
408
|
+
}>;
|
409
|
+
}>;
|
410
|
+
/**
|
411
|
+
* Event emitted when the assets of an account are updated.
|
412
|
+
*
|
413
|
+
* Only changes are reported.
|
414
|
+
*
|
415
|
+
* The Snap can choose to emit this event for multiple accounts at once.
|
416
|
+
*/
|
417
|
+
export type AccountAssetListUpdatedEvent = Infer<typeof AccountAssetListUpdatedEventStruct>;
|
418
|
+
export type AccountAssetListUpdatedEventPayload = AccountAssetListUpdatedEvent['params'];
|
180
419
|
//# sourceMappingURL=events.d.cts.map
|
package/dist/events.d.cts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"events.d.cts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,oBAAY,YAAY;IAEtB,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IAGxC,eAAe,2BAA2B;IAC1C,eAAe,2BAA2B;
|
1
|
+
{"version":3,"file":"events.d.cts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAcnD;;GAEG;AACH,oBAAY,YAAY;IAEtB,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IAGxC,eAAe,2BAA2B;IAC1C,eAAe,2BAA2B;IAG1C,sBAAsB,kCAAkC;IACxD,uBAAuB,mCAAmC;IAC1D,0BAA0B,sCAAsC;CACjE;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAGlC;;WAEG;;;;;;;;;;;;;;;;;;;;;QAGH;;;;;;WAMG;;QAGH;;;WAGG;;;EAGL,CAAC;AAEH,eAAO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Infer } from "@metamask/superstruct";
|
1
2
|
/**
|
2
3
|
* Supported keyring events.
|
3
4
|
*/
|
@@ -6,7 +7,10 @@ export declare enum KeyringEvent {
|
|
6
7
|
AccountUpdated = "notify:accountUpdated",
|
7
8
|
AccountDeleted = "notify:accountDeleted",
|
8
9
|
RequestApproved = "notify:requestApproved",
|
9
|
-
RequestRejected = "notify:requestRejected"
|
10
|
+
RequestRejected = "notify:requestRejected",
|
11
|
+
AccountBalancesUpdated = "notify:accountBalancesUpdated",
|
12
|
+
AccountAssetListUpdated = "notify:accountAssetListUpdated",
|
13
|
+
AccountTransactionsUpdated = "notify:accountTransactionsUpdated"
|
10
14
|
}
|
11
15
|
export declare const AccountCreatedEventStruct: import("@metamask/superstruct").Struct<{
|
12
16
|
method: "notify:accountCreated";
|
@@ -16,7 +20,7 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
|
|
16
20
|
id: string;
|
17
21
|
options: Record<string, import("@metamask/utils").Json>;
|
18
22
|
address: string;
|
19
|
-
scopes: string[];
|
23
|
+
scopes: `${string}:${string}`[];
|
20
24
|
methods: string[];
|
21
25
|
};
|
22
26
|
accountNameSuggestion?: string;
|
@@ -30,7 +34,7 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
|
|
30
34
|
id: string;
|
31
35
|
options: Record<string, import("@metamask/utils").Json>;
|
32
36
|
address: string;
|
33
|
-
scopes: string[];
|
37
|
+
scopes: `${string}:${string}`[];
|
34
38
|
methods: string[];
|
35
39
|
};
|
36
40
|
accountNameSuggestion?: string;
|
@@ -44,7 +48,7 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
|
|
44
48
|
id: string;
|
45
49
|
options: Record<string, import("@metamask/utils").Json>;
|
46
50
|
address: string;
|
47
|
-
scopes: string[];
|
51
|
+
scopes: `${string}:${string}`[];
|
48
52
|
methods: string[];
|
49
53
|
}, {
|
50
54
|
id: import("@metamask/superstruct").Struct<string, null>;
|
@@ -55,7 +59,7 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
|
|
55
59
|
"solana:data-account": "solana:data-account";
|
56
60
|
}>;
|
57
61
|
address: import("@metamask/superstruct").Struct<string, null>;
|
58
|
-
scopes: import("@metamask/superstruct").Struct
|
62
|
+
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
|
59
63
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
60
64
|
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
61
65
|
}>;
|
@@ -82,7 +86,7 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
|
|
82
86
|
id: string;
|
83
87
|
options: Record<string, import("@metamask/utils").Json>;
|
84
88
|
address: string;
|
85
|
-
scopes: string[];
|
89
|
+
scopes: `${string}:${string}`[];
|
86
90
|
methods: string[];
|
87
91
|
};
|
88
92
|
};
|
@@ -94,7 +98,7 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
|
|
94
98
|
id: string;
|
95
99
|
options: Record<string, import("@metamask/utils").Json>;
|
96
100
|
address: string;
|
97
|
-
scopes: string[];
|
101
|
+
scopes: `${string}:${string}`[];
|
98
102
|
methods: string[];
|
99
103
|
};
|
100
104
|
}, {
|
@@ -106,7 +110,7 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
|
|
106
110
|
id: string;
|
107
111
|
options: Record<string, import("@metamask/utils").Json>;
|
108
112
|
address: string;
|
109
|
-
scopes: string[];
|
113
|
+
scopes: `${string}:${string}`[];
|
110
114
|
methods: string[];
|
111
115
|
}, {
|
112
116
|
id: import("@metamask/superstruct").Struct<string, null>;
|
@@ -117,7 +121,7 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
|
|
117
121
|
"solana:data-account": "solana:data-account";
|
118
122
|
}>;
|
119
123
|
address: import("@metamask/superstruct").Struct<string, null>;
|
120
|
-
scopes: import("@metamask/superstruct").Struct
|
124
|
+
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
|
121
125
|
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
|
122
126
|
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
123
127
|
}>;
|
@@ -177,4 +181,239 @@ export declare const RequestRejectedEventStruct: import("@metamask/superstruct")
|
|
177
181
|
id: import("@metamask/superstruct").Struct<string, null>;
|
178
182
|
}>;
|
179
183
|
}>;
|
184
|
+
export declare const AccountBalancesUpdatedEventStruct: import("@metamask/superstruct").Struct<{
|
185
|
+
method: "notify:accountBalancesUpdated";
|
186
|
+
params: {
|
187
|
+
balances: Record<string, Record<`${string}:${string}/${string}:${string}`, {
|
188
|
+
unit: string;
|
189
|
+
amount: string;
|
190
|
+
}>>;
|
191
|
+
};
|
192
|
+
}, {
|
193
|
+
method: import("@metamask/superstruct").Struct<"notify:accountBalancesUpdated", "notify:accountBalancesUpdated">;
|
194
|
+
params: import("@metamask/superstruct").Struct<{
|
195
|
+
balances: Record<string, Record<`${string}:${string}/${string}:${string}`, {
|
196
|
+
unit: string;
|
197
|
+
amount: string;
|
198
|
+
}>>;
|
199
|
+
}, {
|
200
|
+
/**
|
201
|
+
* Balances updates of accounts owned by the Snap.
|
202
|
+
*/
|
203
|
+
balances: import("@metamask/superstruct").Struct<Record<string, Record<`${string}:${string}/${string}:${string}`, {
|
204
|
+
unit: string;
|
205
|
+
amount: string;
|
206
|
+
}>>, null>;
|
207
|
+
}>;
|
208
|
+
}>;
|
209
|
+
/**
|
210
|
+
* Event emitted when the balances of an account are updated.
|
211
|
+
*
|
212
|
+
* Only changes are reported.
|
213
|
+
*
|
214
|
+
* The Snap can choose to emit this event for multiple accounts at once.
|
215
|
+
*/
|
216
|
+
export type AccountBalancesUpdatedEvent = Infer<typeof AccountBalancesUpdatedEventStruct>;
|
217
|
+
export type AccountBalancesUpdatedEventPayload = AccountBalancesUpdatedEvent['params'];
|
218
|
+
export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/superstruct").Struct<{
|
219
|
+
method: "notify:accountTransactionsUpdated";
|
220
|
+
params: {
|
221
|
+
transactions: Record<string, {
|
222
|
+
type: "send" | "receive";
|
223
|
+
id: string;
|
224
|
+
from: {
|
225
|
+
address: string;
|
226
|
+
asset: {
|
227
|
+
unit: string;
|
228
|
+
type: `${string}:${string}/${string}:${string}`;
|
229
|
+
amount: string;
|
230
|
+
fungible: true;
|
231
|
+
} | {
|
232
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
233
|
+
fungible: false;
|
234
|
+
} | null;
|
235
|
+
}[];
|
236
|
+
events: {
|
237
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
238
|
+
timestamp: number | null;
|
239
|
+
}[];
|
240
|
+
chain: `${string}:${string}`;
|
241
|
+
account: string;
|
242
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
243
|
+
timestamp: number | null;
|
244
|
+
to: {
|
245
|
+
address: string;
|
246
|
+
asset: {
|
247
|
+
unit: string;
|
248
|
+
type: `${string}:${string}/${string}:${string}`;
|
249
|
+
amount: string;
|
250
|
+
fungible: true;
|
251
|
+
} | {
|
252
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
253
|
+
fungible: false;
|
254
|
+
} | null;
|
255
|
+
}[];
|
256
|
+
fees: {
|
257
|
+
type: "base" | "priority";
|
258
|
+
asset: {
|
259
|
+
unit: string;
|
260
|
+
type: `${string}:${string}/${string}:${string}`;
|
261
|
+
amount: string;
|
262
|
+
fungible: true;
|
263
|
+
} | {
|
264
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
265
|
+
fungible: false;
|
266
|
+
};
|
267
|
+
}[];
|
268
|
+
}[]>;
|
269
|
+
};
|
270
|
+
}, {
|
271
|
+
method: import("@metamask/superstruct").Struct<"notify:accountTransactionsUpdated", "notify:accountTransactionsUpdated">;
|
272
|
+
params: import("@metamask/superstruct").Struct<{
|
273
|
+
transactions: Record<string, {
|
274
|
+
type: "send" | "receive";
|
275
|
+
id: string;
|
276
|
+
from: {
|
277
|
+
address: string;
|
278
|
+
asset: {
|
279
|
+
unit: string;
|
280
|
+
type: `${string}:${string}/${string}:${string}`;
|
281
|
+
amount: string;
|
282
|
+
fungible: true;
|
283
|
+
} | {
|
284
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
285
|
+
fungible: false;
|
286
|
+
} | null;
|
287
|
+
}[];
|
288
|
+
events: {
|
289
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
290
|
+
timestamp: number | null;
|
291
|
+
}[];
|
292
|
+
chain: `${string}:${string}`;
|
293
|
+
account: string;
|
294
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
295
|
+
timestamp: number | null;
|
296
|
+
to: {
|
297
|
+
address: string;
|
298
|
+
asset: {
|
299
|
+
unit: string;
|
300
|
+
type: `${string}:${string}/${string}:${string}`;
|
301
|
+
amount: string;
|
302
|
+
fungible: true;
|
303
|
+
} | {
|
304
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
305
|
+
fungible: false;
|
306
|
+
} | null;
|
307
|
+
}[];
|
308
|
+
fees: {
|
309
|
+
type: "base" | "priority";
|
310
|
+
asset: {
|
311
|
+
unit: string;
|
312
|
+
type: `${string}:${string}/${string}:${string}`;
|
313
|
+
amount: string;
|
314
|
+
fungible: true;
|
315
|
+
} | {
|
316
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
317
|
+
fungible: false;
|
318
|
+
};
|
319
|
+
}[];
|
320
|
+
}[]>;
|
321
|
+
}, {
|
322
|
+
/**
|
323
|
+
* Transactions updates of accounts owned by the Snap.
|
324
|
+
*/
|
325
|
+
transactions: import("@metamask/superstruct").Struct<Record<string, {
|
326
|
+
type: "send" | "receive";
|
327
|
+
id: string;
|
328
|
+
from: {
|
329
|
+
address: string;
|
330
|
+
asset: {
|
331
|
+
unit: string;
|
332
|
+
type: `${string}:${string}/${string}:${string}`;
|
333
|
+
amount: string;
|
334
|
+
fungible: true;
|
335
|
+
} | {
|
336
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
337
|
+
fungible: false;
|
338
|
+
} | null;
|
339
|
+
}[];
|
340
|
+
events: {
|
341
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
342
|
+
timestamp: number | null;
|
343
|
+
}[];
|
344
|
+
chain: `${string}:${string}`;
|
345
|
+
account: string;
|
346
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
347
|
+
timestamp: number | null;
|
348
|
+
to: {
|
349
|
+
address: string;
|
350
|
+
asset: {
|
351
|
+
unit: string;
|
352
|
+
type: `${string}:${string}/${string}:${string}`;
|
353
|
+
amount: string;
|
354
|
+
fungible: true;
|
355
|
+
} | {
|
356
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
357
|
+
fungible: false;
|
358
|
+
} | null;
|
359
|
+
}[];
|
360
|
+
fees: {
|
361
|
+
type: "base" | "priority";
|
362
|
+
asset: {
|
363
|
+
unit: string;
|
364
|
+
type: `${string}:${string}/${string}:${string}`;
|
365
|
+
amount: string;
|
366
|
+
fungible: true;
|
367
|
+
} | {
|
368
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
369
|
+
fungible: false;
|
370
|
+
};
|
371
|
+
}[];
|
372
|
+
}[]>, null>;
|
373
|
+
}>;
|
374
|
+
}>;
|
375
|
+
/**
|
376
|
+
* Event emitted when the transactions of an account are updated (added or
|
377
|
+
* changed).
|
378
|
+
*
|
379
|
+
* Only changes are reported.
|
380
|
+
*
|
381
|
+
* The Snap can choose to emit this event for multiple accounts at once.
|
382
|
+
*/
|
383
|
+
export type AccountTransactionsUpdatedEvent = Infer<typeof AccountTransactionsUpdatedEventStruct>;
|
384
|
+
export type AccountTransactionsUpdatedEventPayload = AccountTransactionsUpdatedEvent['params'];
|
385
|
+
export declare const AccountAssetListUpdatedEventStruct: import("@metamask/superstruct").Struct<{
|
386
|
+
method: "notify:accountAssetListUpdated";
|
387
|
+
params: {
|
388
|
+
assets: Record<string, {
|
389
|
+
added: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
390
|
+
removed: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
391
|
+
}>;
|
392
|
+
};
|
393
|
+
}, {
|
394
|
+
method: import("@metamask/superstruct").Struct<"notify:accountAssetListUpdated", "notify:accountAssetListUpdated">;
|
395
|
+
params: import("@metamask/superstruct").Struct<{
|
396
|
+
assets: Record<string, {
|
397
|
+
added: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
398
|
+
removed: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
399
|
+
}>;
|
400
|
+
}, {
|
401
|
+
/**
|
402
|
+
* Asset list update of accounts owned by the Snap.
|
403
|
+
*/
|
404
|
+
assets: import("@metamask/superstruct").Struct<Record<string, {
|
405
|
+
added: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
406
|
+
removed: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
407
|
+
}>, null>;
|
408
|
+
}>;
|
409
|
+
}>;
|
410
|
+
/**
|
411
|
+
* Event emitted when the assets of an account are updated.
|
412
|
+
*
|
413
|
+
* Only changes are reported.
|
414
|
+
*
|
415
|
+
* The Snap can choose to emit this event for multiple accounts at once.
|
416
|
+
*/
|
417
|
+
export type AccountAssetListUpdatedEvent = Infer<typeof AccountAssetListUpdatedEventStruct>;
|
418
|
+
export type AccountAssetListUpdatedEventPayload = AccountAssetListUpdatedEvent['params'];
|
180
419
|
//# sourceMappingURL=events.d.mts.map
|
package/dist/events.d.mts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"events.d.mts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAM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