@metamask-previews/account-tree-controller 0.6.0-preview-ed2a2e6 → 0.6.0-preview-b3ea3f86
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 +0 -12
- package/dist/AccountTreeController.cjs +25 -86
- package/dist/AccountTreeController.cjs.map +1 -1
- package/dist/AccountTreeController.d.cts +1 -3
- package/dist/AccountTreeController.d.cts.map +1 -1
- package/dist/AccountTreeController.d.mts +1 -3
- package/dist/AccountTreeController.d.mts.map +1 -1
- package/dist/AccountTreeController.mjs +26 -87
- package/dist/AccountTreeController.mjs.map +1 -1
- package/dist/AccountTreeGroup.cjs +35 -51
- package/dist/AccountTreeGroup.cjs.map +1 -1
- package/dist/AccountTreeGroup.d.cts +22 -15
- package/dist/AccountTreeGroup.d.cts.map +1 -1
- package/dist/AccountTreeGroup.d.mts +22 -15
- package/dist/AccountTreeGroup.d.mts.map +1 -1
- package/dist/AccountTreeGroup.mjs +33 -49
- package/dist/AccountTreeGroup.mjs.map +1 -1
- package/dist/AccountTreeWallet.cjs +27 -61
- package/dist/AccountTreeWallet.cjs.map +1 -1
- package/dist/AccountTreeWallet.d.cts +17 -24
- package/dist/AccountTreeWallet.d.cts.map +1 -1
- package/dist/AccountTreeWallet.d.mts +17 -24
- package/dist/AccountTreeWallet.d.mts.map +1 -1
- package/dist/AccountTreeWallet.mjs +26 -60
- package/dist/AccountTreeWallet.mjs.map +1 -1
- package/dist/rules/EntropySourceWalletRule.cjs +100 -0
- package/dist/rules/EntropySourceWalletRule.cjs.map +1 -0
- package/dist/rules/EntropySourceWalletRule.d.cts +19 -0
- package/dist/rules/EntropySourceWalletRule.d.cts.map +1 -0
- package/dist/rules/EntropySourceWalletRule.d.mts +19 -0
- package/dist/rules/EntropySourceWalletRule.d.mts.map +1 -0
- package/dist/rules/EntropySourceWalletRule.mjs +95 -0
- package/dist/rules/EntropySourceWalletRule.mjs.map +1 -0
- package/dist/rules/KeyringWalletRule.cjs +99 -0
- package/dist/rules/KeyringWalletRule.cjs.map +1 -0
- package/dist/rules/KeyringWalletRule.d.cts +18 -0
- package/dist/rules/KeyringWalletRule.d.cts.map +1 -0
- package/dist/rules/KeyringWalletRule.d.mts +18 -0
- package/dist/rules/KeyringWalletRule.d.mts.map +1 -0
- package/dist/rules/KeyringWalletRule.mjs +94 -0
- package/dist/rules/KeyringWalletRule.mjs.map +1 -0
- package/dist/rules/SnapWalletRule.cjs +70 -0
- package/dist/rules/SnapWalletRule.cjs.map +1 -0
- package/dist/rules/SnapWalletRule.d.cts +10 -0
- package/dist/rules/SnapWalletRule.d.cts.map +1 -0
- package/dist/rules/SnapWalletRule.d.mts +10 -0
- package/dist/rules/SnapWalletRule.d.mts.map +1 -0
- package/dist/rules/SnapWalletRule.mjs +66 -0
- package/dist/rules/SnapWalletRule.mjs.map +1 -0
- package/dist/rules/WalletRule.cjs +13 -0
- package/dist/rules/WalletRule.cjs.map +1 -0
- package/dist/rules/WalletRule.d.cts +37 -0
- package/dist/rules/WalletRule.d.cts.map +1 -0
- package/dist/rules/WalletRule.d.mts +37 -0
- package/dist/rules/WalletRule.d.mts.map +1 -0
- package/dist/rules/WalletRule.mjs +9 -0
- package/dist/rules/WalletRule.mjs.map +1 -0
- package/dist/rules/index.cjs +4 -4
- package/dist/rules/index.cjs.map +1 -1
- package/dist/rules/index.d.cts +4 -4
- package/dist/rules/index.d.cts.map +1 -1
- package/dist/rules/index.d.mts +4 -4
- package/dist/rules/index.d.mts.map +1 -1
- package/dist/rules/index.mjs +4 -4
- package/dist/rules/index.mjs.map +1 -1
- package/dist/rules/utils.cjs +15 -0
- package/dist/rules/utils.cjs.map +1 -0
- package/dist/rules/utils.d.cts +11 -0
- package/dist/rules/utils.d.cts.map +1 -0
- package/dist/rules/utils.d.mts +11 -0
- package/dist/rules/utils.d.mts.map +1 -0
- package/dist/rules/utils.mjs +11 -0
- package/dist/rules/utils.mjs.map +1 -0
- package/package.json +3 -3
- package/dist/rules/entropy.cjs +0 -57
- package/dist/rules/entropy.cjs.map +0 -1
- package/dist/rules/entropy.d.cts +0 -13
- package/dist/rules/entropy.d.cts.map +0 -1
- package/dist/rules/entropy.d.mts +0 -13
- package/dist/rules/entropy.d.mts.map +0 -1
- package/dist/rules/entropy.mjs +0 -53
- package/dist/rules/entropy.mjs.map +0 -1
- package/dist/rules/keyring.cjs +0 -80
- package/dist/rules/keyring.cjs.map +0 -1
- package/dist/rules/keyring.d.cts +0 -20
- package/dist/rules/keyring.d.cts.map +0 -1
- package/dist/rules/keyring.d.mts +0 -20
- package/dist/rules/keyring.d.mts.map +0 -1
- package/dist/rules/keyring.mjs +0 -75
- package/dist/rules/keyring.mjs.map +0 -1
- package/dist/rules/rule.cjs +0 -10
- package/dist/rules/rule.cjs.map +0 -1
- package/dist/rules/rule.d.cts +0 -42
- package/dist/rules/rule.d.cts.map +0 -1
- package/dist/rules/rule.d.mts +0 -42
- package/dist/rules/rule.d.mts.map +0 -1
- package/dist/rules/rule.mjs +0 -6
- package/dist/rules/rule.mjs.map +0 -1
- package/dist/rules/snap.cjs +0 -53
- package/dist/rules/snap.cjs.map +0 -1
- package/dist/rules/snap.d.cts +0 -23
- package/dist/rules/snap.d.cts.map +0 -1
- package/dist/rules/snap.d.mts +0 -23
- package/dist/rules/snap.d.mts.map +0 -1
- package/dist/rules/snap.mjs +0 -49
- package/dist/rules/snap.mjs.map +0 -1
- package/dist/types.cjs +0 -3
- package/dist/types.cjs.map +0 -1
- package/dist/types.d.cts +0 -15
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.mts +0 -15
- package/dist/types.d.mts.map +0 -1
- package/dist/types.mjs +0 -2
- package/dist/types.mjs.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { KeyringTypes } from "@metamask/keyring-controller";
|
|
2
|
+
import type { InternalAccount } from "@metamask/keyring-internal-api";
|
|
3
|
+
import type { WalletRuleMatch } from "./WalletRule.mjs";
|
|
4
|
+
import { BaseWalletRule } from "./WalletRule.mjs";
|
|
5
|
+
import type { AccountTreeControllerMessenger } from "../AccountTreeController.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* Get wallet name from a keyring type.
|
|
8
|
+
*
|
|
9
|
+
* @param type - Keyring's type.
|
|
10
|
+
* @returns Wallet name.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getAccountWalletNameFromKeyringType(type: KeyringTypes): "Imported accounts" | "Trezor" | "OneKey" | "Ledger" | "Lattice" | "QR" | "HD Wallet" | "Snap Wallet" | "Unknown";
|
|
13
|
+
export declare class KeyringWalletRule extends BaseWalletRule {
|
|
14
|
+
#private;
|
|
15
|
+
constructor(messenger: AccountTreeControllerMessenger);
|
|
16
|
+
match(account: InternalAccount): WalletRuleMatch | undefined;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=KeyringWalletRule.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyringWalletRule.d.mts","sourceRoot":"","sources":["../../src/rules/KeyringWalletRule.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,qCAAqC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AAEtE,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAqB;AACpD,OAAO,EAAE,cAAc,EAAE,yBAAqB;AAC9C,OAAO,KAAK,EAAE,8BAA8B,EAAE,qCAAiC;AAG/E;;;;;GAKG;AACH,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,YAAY,qHAiCrE;AAmBD,qBAAa,iBAAkB,SAAQ,cAAc;;gBAGvC,SAAS,EAAE,8BAA8B;IAMrD,KAAK,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,GAAG,SAAS;CAsB7D"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _KeyringWalletRule_wallets;
|
|
13
|
+
import { AccountWalletCategory, toAccountWalletId } from "@metamask/account-api";
|
|
14
|
+
import { KeyringTypes } from "@metamask/keyring-controller";
|
|
15
|
+
import { BaseWalletRule } from "./WalletRule.mjs";
|
|
16
|
+
import { MutableAccountTreeWallet } from "../AccountTreeWallet.mjs";
|
|
17
|
+
/**
|
|
18
|
+
* Get wallet name from a keyring type.
|
|
19
|
+
*
|
|
20
|
+
* @param type - Keyring's type.
|
|
21
|
+
* @returns Wallet name.
|
|
22
|
+
*/
|
|
23
|
+
export function getAccountWalletNameFromKeyringType(type) {
|
|
24
|
+
switch (type) {
|
|
25
|
+
case KeyringTypes.simple: {
|
|
26
|
+
return 'Imported accounts';
|
|
27
|
+
}
|
|
28
|
+
case KeyringTypes.trezor: {
|
|
29
|
+
return 'Trezor';
|
|
30
|
+
}
|
|
31
|
+
case KeyringTypes.oneKey: {
|
|
32
|
+
return 'OneKey';
|
|
33
|
+
}
|
|
34
|
+
case KeyringTypes.ledger: {
|
|
35
|
+
return 'Ledger';
|
|
36
|
+
}
|
|
37
|
+
case KeyringTypes.lattice: {
|
|
38
|
+
return 'Lattice';
|
|
39
|
+
}
|
|
40
|
+
case KeyringTypes.qr: {
|
|
41
|
+
return 'QR';
|
|
42
|
+
}
|
|
43
|
+
// Those keyrings should never really be used in such context since they
|
|
44
|
+
// should be used by other grouping rules.
|
|
45
|
+
case KeyringTypes.hd: {
|
|
46
|
+
return 'HD Wallet';
|
|
47
|
+
}
|
|
48
|
+
case KeyringTypes.snap: {
|
|
49
|
+
return 'Snap Wallet';
|
|
50
|
+
}
|
|
51
|
+
// ------------------------------------------------------------------------
|
|
52
|
+
default: {
|
|
53
|
+
return 'Unknown';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
class KeyringTypeWallet extends MutableAccountTreeWallet {
|
|
58
|
+
constructor(messenger, type) {
|
|
59
|
+
super(messenger, AccountWalletCategory.Keyring, type);
|
|
60
|
+
this.type = type;
|
|
61
|
+
}
|
|
62
|
+
static toAccountWalletId(type) {
|
|
63
|
+
return toAccountWalletId(AccountWalletCategory.Keyring, type);
|
|
64
|
+
}
|
|
65
|
+
getDefaultName() {
|
|
66
|
+
return getAccountWalletNameFromKeyringType(this.type);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export class KeyringWalletRule extends BaseWalletRule {
|
|
70
|
+
constructor(messenger) {
|
|
71
|
+
super(messenger);
|
|
72
|
+
_KeyringWalletRule_wallets.set(this, void 0);
|
|
73
|
+
__classPrivateFieldSet(this, _KeyringWalletRule_wallets, new Map(), "f");
|
|
74
|
+
}
|
|
75
|
+
match(account) {
|
|
76
|
+
const { type } = account.metadata.keyring;
|
|
77
|
+
// We assume that `type` is really a `KeyringTypes`.
|
|
78
|
+
const keyringType = type;
|
|
79
|
+
// Check if a wallet already exists for that keyring type.
|
|
80
|
+
let wallet = __classPrivateFieldGet(this, _KeyringWalletRule_wallets, "f").get(KeyringTypeWallet.toAccountWalletId(keyringType));
|
|
81
|
+
if (!wallet) {
|
|
82
|
+
wallet = new KeyringTypeWallet(this.messenger, keyringType);
|
|
83
|
+
__classPrivateFieldGet(this, _KeyringWalletRule_wallets, "f").set(wallet.id, wallet);
|
|
84
|
+
}
|
|
85
|
+
// This will automatically creates the group if it's missing.
|
|
86
|
+
const group = wallet.addAccount(account);
|
|
87
|
+
return {
|
|
88
|
+
wallet,
|
|
89
|
+
group,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
_KeyringWalletRule_wallets = new WeakMap();
|
|
94
|
+
//# sourceMappingURL=KeyringWalletRule.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyringWalletRule.mjs","sourceRoot":"","sources":["../../src/rules/KeyringWalletRule.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EAClB,8BAA8B;AAC/B,OAAO,EAAE,YAAY,EAAE,qCAAqC;AAI5D,OAAO,EAAE,cAAc,EAAE,yBAAqB;AAE9C,OAAO,EAAE,wBAAwB,EAAE,iCAA6B;AAEhE;;;;;GAKG;AACH,MAAM,UAAU,mCAAmC,CAAC,IAAkB;IACpE,QAAQ,IAAI,EAAE;QACZ,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC;YACxB,OAAO,mBAAmB,CAAC;SAC5B;QACD,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC;YACxB,OAAO,QAAQ,CAAC;SACjB;QACD,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC;YACxB,OAAO,QAAQ,CAAC;SACjB;QACD,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC;YACxB,OAAO,QAAQ,CAAC;SACjB;QACD,KAAK,YAAY,CAAC,OAAO,CAAC,CAAC;YACzB,OAAO,SAAS,CAAC;SAClB;QACD,KAAK,YAAY,CAAC,EAAE,CAAC,CAAC;YACpB,OAAO,IAAI,CAAC;SACb;QACD,wEAAwE;QACxE,0CAA0C;QAC1C,KAAK,YAAY,CAAC,EAAE,CAAC,CAAC;YACpB,OAAO,WAAW,CAAC;SACpB;QACD,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;YACtB,OAAO,aAAa,CAAC;SACtB;QACD,2EAA2E;QAC3E,OAAO,CAAC,CAAC;YACP,OAAO,SAAS,CAAC;SAClB;KACF;AACH,CAAC;AAED,MAAM,iBAAkB,SAAQ,wBAAwB;IAGtD,YAAY,SAAyC,EAAE,IAAkB;QACvE,KAAK,CAAC,SAAS,EAAE,qBAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,IAAkB;QACzC,OAAO,iBAAiB,CAAC,qBAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAChE,CAAC;IAED,cAAc;QACZ,OAAO,mCAAmC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC;CACF;AAED,MAAM,OAAO,iBAAkB,SAAQ,cAAc;IAGnD,YAAY,SAAyC;QACnD,KAAK,CAAC,SAAS,CAAC,CAAC;QAHV,6CAAkD;QAKzD,uBAAA,IAAI,8BAAY,IAAI,GAAG,EAAE,MAAA,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,OAAwB;QAC5B,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC1C,oDAAoD;QACpD,MAAM,WAAW,GAAG,IAAoB,CAAC;QAEzC,0DAA0D;QAC1D,IAAI,MAAM,GAAG,uBAAA,IAAI,kCAAS,CAAC,GAAG,CAC5B,iBAAiB,CAAC,iBAAiB,CAAC,WAAW,CAAC,CACjD,CAAC;QACF,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;YAC5D,uBAAA,IAAI,kCAAS,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;SACtC;QAED,6DAA6D;QAC7D,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAEzC,OAAO;YACL,MAAM;YACN,KAAK;SACN,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { AccountWalletId } from '@metamask/account-api';\nimport {\n AccountWalletCategory,\n toAccountWalletId,\n} from '@metamask/account-api';\nimport { KeyringTypes } from '@metamask/keyring-controller';\nimport type { InternalAccount } from '@metamask/keyring-internal-api';\n\nimport type { WalletRuleMatch } from './WalletRule';\nimport { BaseWalletRule } from './WalletRule';\nimport type { AccountTreeControllerMessenger } from '../AccountTreeController';\nimport { MutableAccountTreeWallet } from '../AccountTreeWallet';\n\n/**\n * Get wallet name from a keyring type.\n *\n * @param type - Keyring's type.\n * @returns Wallet name.\n */\nexport function getAccountWalletNameFromKeyringType(type: KeyringTypes) {\n switch (type) {\n case KeyringTypes.simple: {\n return 'Imported accounts';\n }\n case KeyringTypes.trezor: {\n return 'Trezor';\n }\n case KeyringTypes.oneKey: {\n return 'OneKey';\n }\n case KeyringTypes.ledger: {\n return 'Ledger';\n }\n case KeyringTypes.lattice: {\n return 'Lattice';\n }\n case KeyringTypes.qr: {\n return 'QR';\n }\n // Those keyrings should never really be used in such context since they\n // should be used by other grouping rules.\n case KeyringTypes.hd: {\n return 'HD Wallet';\n }\n case KeyringTypes.snap: {\n return 'Snap Wallet';\n }\n // ------------------------------------------------------------------------\n default: {\n return 'Unknown';\n }\n }\n}\n\nclass KeyringTypeWallet extends MutableAccountTreeWallet {\n readonly type: KeyringTypes;\n\n constructor(messenger: AccountTreeControllerMessenger, type: KeyringTypes) {\n super(messenger, AccountWalletCategory.Keyring, type);\n this.type = type;\n }\n\n static toAccountWalletId(type: KeyringTypes) {\n return toAccountWalletId(AccountWalletCategory.Keyring, type);\n }\n\n getDefaultName(): string {\n return getAccountWalletNameFromKeyringType(this.type);\n }\n}\n\nexport class KeyringWalletRule extends BaseWalletRule {\n readonly #wallets: Map<AccountWalletId, KeyringTypeWallet>;\n\n constructor(messenger: AccountTreeControllerMessenger) {\n super(messenger);\n\n this.#wallets = new Map();\n }\n\n match(account: InternalAccount): WalletRuleMatch | undefined {\n const { type } = account.metadata.keyring;\n // We assume that `type` is really a `KeyringTypes`.\n const keyringType = type as KeyringTypes;\n\n // Check if a wallet already exists for that keyring type.\n let wallet = this.#wallets.get(\n KeyringTypeWallet.toAccountWalletId(keyringType),\n );\n if (!wallet) {\n wallet = new KeyringTypeWallet(this.messenger, keyringType);\n this.#wallets.set(wallet.id, wallet);\n }\n\n // This will automatically creates the group if it's missing.\n const group = wallet.addAccount(account);\n\n return {\n wallet,\n group,\n };\n }\n}\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _SnapWalletRule_wallets;
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SnapWalletRule = void 0;
|
|
16
|
+
const account_api_1 = require("@metamask/account-api");
|
|
17
|
+
const keyring_controller_1 = require("@metamask/keyring-controller");
|
|
18
|
+
const snaps_utils_1 = require("@metamask/snaps-utils");
|
|
19
|
+
const utils_1 = require("./utils.cjs");
|
|
20
|
+
const WalletRule_1 = require("./WalletRule.cjs");
|
|
21
|
+
const AccountTreeWallet_1 = require("../AccountTreeWallet.cjs");
|
|
22
|
+
class SnapWallet extends AccountTreeWallet_1.MutableAccountTreeWallet {
|
|
23
|
+
constructor(messenger, snapId) {
|
|
24
|
+
super(messenger, account_api_1.AccountWalletCategory.Snap, snapId);
|
|
25
|
+
this.snapId = snapId;
|
|
26
|
+
}
|
|
27
|
+
static toAccountWalletId(snapId) {
|
|
28
|
+
return (0, account_api_1.toAccountWalletId)(account_api_1.AccountWalletCategory.Snap, snapId);
|
|
29
|
+
}
|
|
30
|
+
getDefaultName() {
|
|
31
|
+
const snap = this.messenger.call('SnapController:get', this.snapId);
|
|
32
|
+
const snapName = snap
|
|
33
|
+
? // TODO: Handle localization here, but that's a "client thing", so we don't have a `core` controller
|
|
34
|
+
// to refer to.
|
|
35
|
+
snap.manifest.proposedName
|
|
36
|
+
: (0, snaps_utils_1.stripSnapPrefix)(this.snapId);
|
|
37
|
+
return snapName;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
class SnapWalletRule extends WalletRule_1.BaseWalletRule {
|
|
41
|
+
constructor(messenger) {
|
|
42
|
+
super(messenger);
|
|
43
|
+
_SnapWalletRule_wallets.set(this, void 0);
|
|
44
|
+
__classPrivateFieldSet(this, _SnapWalletRule_wallets, new Map(), "f");
|
|
45
|
+
}
|
|
46
|
+
match(account) {
|
|
47
|
+
if ((0, utils_1.hasKeyringType)(account, keyring_controller_1.KeyringTypes.snap) &&
|
|
48
|
+
account.metadata.snap &&
|
|
49
|
+
account.metadata.snap.enabled) {
|
|
50
|
+
const { id } = account.metadata.snap;
|
|
51
|
+
const snapId = id;
|
|
52
|
+
// Check if a wallet already exists for that Snap ID.
|
|
53
|
+
let wallet = __classPrivateFieldGet(this, _SnapWalletRule_wallets, "f").get(SnapWallet.toAccountWalletId(snapId));
|
|
54
|
+
if (!wallet) {
|
|
55
|
+
wallet = new SnapWallet(this.messenger, snapId);
|
|
56
|
+
__classPrivateFieldGet(this, _SnapWalletRule_wallets, "f").set(wallet.id, wallet);
|
|
57
|
+
}
|
|
58
|
+
// This will automatically creates the group if it's missing.
|
|
59
|
+
const group = wallet.addAccount(account);
|
|
60
|
+
return {
|
|
61
|
+
wallet,
|
|
62
|
+
group,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.SnapWalletRule = SnapWalletRule;
|
|
69
|
+
_SnapWalletRule_wallets = new WeakMap();
|
|
70
|
+
//# sourceMappingURL=SnapWalletRule.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SnapWalletRule.cjs","sourceRoot":"","sources":["../../src/rules/SnapWalletRule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,uDAG+B;AAC/B,qEAA4D;AAG5D,uDAAwD;AAExD,uCAAyC;AAEzC,iDAA8C;AAE9C,gEAAgE;AAEhE,MAAM,UAAW,SAAQ,4CAAwB;IAG/C,YAAY,SAAyC,EAAE,MAAc;QACnE,KAAK,CAAC,SAAS,EAAE,mCAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACrD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,MAAc;QACrC,OAAO,IAAA,+BAAiB,EAAC,mCAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED,cAAc;QACZ,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACpE,MAAM,QAAQ,GAAG,IAAI;YACnB,CAAC,CAAC,oGAAoG;gBACpG,eAAe;gBACf,IAAI,CAAC,QAAQ,CAAC,YAAY;YAC5B,CAAC,CAAC,IAAA,6BAAe,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAED,MAAa,cAAe,SAAQ,2BAAc;IAGhD,YAAY,SAAyC;QACnD,KAAK,CAAC,SAAS,CAAC,CAAC;QAHV,0CAA2C;QAKlD,uBAAA,IAAI,2BAAY,IAAI,GAAG,EAAE,MAAA,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,OAAwB;QAC5B,IACE,IAAA,sBAAc,EAAC,OAAO,EAAE,iCAAY,CAAC,IAAI,CAAC;YAC1C,OAAO,CAAC,QAAQ,CAAC,IAAI;YACrB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAC7B;YACA,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;YACrC,MAAM,MAAM,GAAG,EAAY,CAAC;YAE5B,qDAAqD;YACrD,IAAI,MAAM,GAAG,uBAAA,IAAI,+BAAS,CAAC,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;YACrE,IAAI,CAAC,MAAM,EAAE;gBACX,MAAM,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;gBAChD,uBAAA,IAAI,+BAAS,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;aACtC;YAED,6DAA6D;YAC7D,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAEzC,OAAO;gBACL,MAAM;gBACN,KAAK;aACN,CAAC;SACH;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AApCD,wCAoCC","sourcesContent":["import type { AccountWalletId } from '@metamask/account-api';\nimport {\n AccountWalletCategory,\n toAccountWalletId,\n} from '@metamask/account-api';\nimport { KeyringTypes } from '@metamask/keyring-controller';\nimport type { InternalAccount } from '@metamask/keyring-internal-api';\nimport type { SnapId } from '@metamask/snaps-sdk';\nimport { stripSnapPrefix } from '@metamask/snaps-utils';\n\nimport { hasKeyringType } from './utils';\nimport type { WalletRuleMatch } from './WalletRule';\nimport { BaseWalletRule } from './WalletRule';\nimport type { AccountTreeControllerMessenger } from '../AccountTreeController';\nimport { MutableAccountTreeWallet } from '../AccountTreeWallet';\n\nclass SnapWallet extends MutableAccountTreeWallet {\n readonly snapId: SnapId;\n\n constructor(messenger: AccountTreeControllerMessenger, snapId: SnapId) {\n super(messenger, AccountWalletCategory.Snap, snapId);\n this.snapId = snapId;\n }\n\n static toAccountWalletId(snapId: SnapId) {\n return toAccountWalletId(AccountWalletCategory.Snap, snapId);\n }\n\n getDefaultName(): string {\n const snap = this.messenger.call('SnapController:get', this.snapId);\n const snapName = snap\n ? // TODO: Handle localization here, but that's a \"client thing\", so we don't have a `core` controller\n // to refer to.\n snap.manifest.proposedName\n : stripSnapPrefix(this.snapId);\n\n return snapName;\n }\n}\n\nexport class SnapWalletRule extends BaseWalletRule {\n readonly #wallets: Map<AccountWalletId, SnapWallet>;\n\n constructor(messenger: AccountTreeControllerMessenger) {\n super(messenger);\n\n this.#wallets = new Map();\n }\n\n match(account: InternalAccount): WalletRuleMatch | undefined {\n if (\n hasKeyringType(account, KeyringTypes.snap) &&\n account.metadata.snap &&\n account.metadata.snap.enabled\n ) {\n const { id } = account.metadata.snap;\n const snapId = id as SnapId;\n\n // Check if a wallet already exists for that Snap ID.\n let wallet = this.#wallets.get(SnapWallet.toAccountWalletId(snapId));\n if (!wallet) {\n wallet = new SnapWallet(this.messenger, snapId);\n this.#wallets.set(wallet.id, wallet);\n }\n\n // This will automatically creates the group if it's missing.\n const group = wallet.addAccount(account);\n\n return {\n wallet,\n group,\n };\n }\n\n return undefined;\n }\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { InternalAccount } from "@metamask/keyring-internal-api";
|
|
2
|
+
import type { WalletRuleMatch } from "./WalletRule.cjs";
|
|
3
|
+
import { BaseWalletRule } from "./WalletRule.cjs";
|
|
4
|
+
import type { AccountTreeControllerMessenger } from "../AccountTreeController.cjs";
|
|
5
|
+
export declare class SnapWalletRule extends BaseWalletRule {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(messenger: AccountTreeControllerMessenger);
|
|
8
|
+
match(account: InternalAccount): WalletRuleMatch | undefined;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=SnapWalletRule.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SnapWalletRule.d.cts","sourceRoot":"","sources":["../../src/rules/SnapWalletRule.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AAKtE,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAqB;AACpD,OAAO,EAAE,cAAc,EAAE,yBAAqB;AAC9C,OAAO,KAAK,EAAE,8BAA8B,EAAE,qCAAiC;AA2B/E,qBAAa,cAAe,SAAQ,cAAc;;gBAGpC,SAAS,EAAE,8BAA8B;IAMrD,KAAK,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,GAAG,SAAS;CA2B7D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { InternalAccount } from "@metamask/keyring-internal-api";
|
|
2
|
+
import type { WalletRuleMatch } from "./WalletRule.mjs";
|
|
3
|
+
import { BaseWalletRule } from "./WalletRule.mjs";
|
|
4
|
+
import type { AccountTreeControllerMessenger } from "../AccountTreeController.mjs";
|
|
5
|
+
export declare class SnapWalletRule extends BaseWalletRule {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(messenger: AccountTreeControllerMessenger);
|
|
8
|
+
match(account: InternalAccount): WalletRuleMatch | undefined;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=SnapWalletRule.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SnapWalletRule.d.mts","sourceRoot":"","sources":["../../src/rules/SnapWalletRule.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AAKtE,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAqB;AACpD,OAAO,EAAE,cAAc,EAAE,yBAAqB;AAC9C,OAAO,KAAK,EAAE,8BAA8B,EAAE,qCAAiC;AA2B/E,qBAAa,cAAe,SAAQ,cAAc;;gBAGpC,SAAS,EAAE,8BAA8B;IAMrD,KAAK,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,GAAG,SAAS;CA2B7D"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _SnapWalletRule_wallets;
|
|
13
|
+
import { AccountWalletCategory, toAccountWalletId } from "@metamask/account-api";
|
|
14
|
+
import { KeyringTypes } from "@metamask/keyring-controller";
|
|
15
|
+
import { stripSnapPrefix } from "@metamask/snaps-utils";
|
|
16
|
+
import { hasKeyringType } from "./utils.mjs";
|
|
17
|
+
import { BaseWalletRule } from "./WalletRule.mjs";
|
|
18
|
+
import { MutableAccountTreeWallet } from "../AccountTreeWallet.mjs";
|
|
19
|
+
class SnapWallet extends MutableAccountTreeWallet {
|
|
20
|
+
constructor(messenger, snapId) {
|
|
21
|
+
super(messenger, AccountWalletCategory.Snap, snapId);
|
|
22
|
+
this.snapId = snapId;
|
|
23
|
+
}
|
|
24
|
+
static toAccountWalletId(snapId) {
|
|
25
|
+
return toAccountWalletId(AccountWalletCategory.Snap, snapId);
|
|
26
|
+
}
|
|
27
|
+
getDefaultName() {
|
|
28
|
+
const snap = this.messenger.call('SnapController:get', this.snapId);
|
|
29
|
+
const snapName = snap
|
|
30
|
+
? // TODO: Handle localization here, but that's a "client thing", so we don't have a `core` controller
|
|
31
|
+
// to refer to.
|
|
32
|
+
snap.manifest.proposedName
|
|
33
|
+
: stripSnapPrefix(this.snapId);
|
|
34
|
+
return snapName;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export class SnapWalletRule extends BaseWalletRule {
|
|
38
|
+
constructor(messenger) {
|
|
39
|
+
super(messenger);
|
|
40
|
+
_SnapWalletRule_wallets.set(this, void 0);
|
|
41
|
+
__classPrivateFieldSet(this, _SnapWalletRule_wallets, new Map(), "f");
|
|
42
|
+
}
|
|
43
|
+
match(account) {
|
|
44
|
+
if (hasKeyringType(account, KeyringTypes.snap) &&
|
|
45
|
+
account.metadata.snap &&
|
|
46
|
+
account.metadata.snap.enabled) {
|
|
47
|
+
const { id } = account.metadata.snap;
|
|
48
|
+
const snapId = id;
|
|
49
|
+
// Check if a wallet already exists for that Snap ID.
|
|
50
|
+
let wallet = __classPrivateFieldGet(this, _SnapWalletRule_wallets, "f").get(SnapWallet.toAccountWalletId(snapId));
|
|
51
|
+
if (!wallet) {
|
|
52
|
+
wallet = new SnapWallet(this.messenger, snapId);
|
|
53
|
+
__classPrivateFieldGet(this, _SnapWalletRule_wallets, "f").set(wallet.id, wallet);
|
|
54
|
+
}
|
|
55
|
+
// This will automatically creates the group if it's missing.
|
|
56
|
+
const group = wallet.addAccount(account);
|
|
57
|
+
return {
|
|
58
|
+
wallet,
|
|
59
|
+
group,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
_SnapWalletRule_wallets = new WeakMap();
|
|
66
|
+
//# sourceMappingURL=SnapWalletRule.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SnapWalletRule.mjs","sourceRoot":"","sources":["../../src/rules/SnapWalletRule.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EAClB,8BAA8B;AAC/B,OAAO,EAAE,YAAY,EAAE,qCAAqC;AAG5D,OAAO,EAAE,eAAe,EAAE,8BAA8B;AAExD,OAAO,EAAE,cAAc,EAAE,oBAAgB;AAEzC,OAAO,EAAE,cAAc,EAAE,yBAAqB;AAE9C,OAAO,EAAE,wBAAwB,EAAE,iCAA6B;AAEhE,MAAM,UAAW,SAAQ,wBAAwB;IAG/C,YAAY,SAAyC,EAAE,MAAc;QACnE,KAAK,CAAC,SAAS,EAAE,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACrD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,MAAc;QACrC,OAAO,iBAAiB,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED,cAAc;QACZ,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACpE,MAAM,QAAQ,GAAG,IAAI;YACnB,CAAC,CAAC,oGAAoG;gBACpG,eAAe;gBACf,IAAI,CAAC,QAAQ,CAAC,YAAY;YAC5B,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAED,MAAM,OAAO,cAAe,SAAQ,cAAc;IAGhD,YAAY,SAAyC;QACnD,KAAK,CAAC,SAAS,CAAC,CAAC;QAHV,0CAA2C;QAKlD,uBAAA,IAAI,2BAAY,IAAI,GAAG,EAAE,MAAA,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,OAAwB;QAC5B,IACE,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC;YAC1C,OAAO,CAAC,QAAQ,CAAC,IAAI;YACrB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAC7B;YACA,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;YACrC,MAAM,MAAM,GAAG,EAAY,CAAC;YAE5B,qDAAqD;YACrD,IAAI,MAAM,GAAG,uBAAA,IAAI,+BAAS,CAAC,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;YACrE,IAAI,CAAC,MAAM,EAAE;gBACX,MAAM,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;gBAChD,uBAAA,IAAI,+BAAS,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;aACtC;YAED,6DAA6D;YAC7D,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAEzC,OAAO;gBACL,MAAM;gBACN,KAAK;aACN,CAAC;SACH;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["import type { AccountWalletId } from '@metamask/account-api';\nimport {\n AccountWalletCategory,\n toAccountWalletId,\n} from '@metamask/account-api';\nimport { KeyringTypes } from '@metamask/keyring-controller';\nimport type { InternalAccount } from '@metamask/keyring-internal-api';\nimport type { SnapId } from '@metamask/snaps-sdk';\nimport { stripSnapPrefix } from '@metamask/snaps-utils';\n\nimport { hasKeyringType } from './utils';\nimport type { WalletRuleMatch } from './WalletRule';\nimport { BaseWalletRule } from './WalletRule';\nimport type { AccountTreeControllerMessenger } from '../AccountTreeController';\nimport { MutableAccountTreeWallet } from '../AccountTreeWallet';\n\nclass SnapWallet extends MutableAccountTreeWallet {\n readonly snapId: SnapId;\n\n constructor(messenger: AccountTreeControllerMessenger, snapId: SnapId) {\n super(messenger, AccountWalletCategory.Snap, snapId);\n this.snapId = snapId;\n }\n\n static toAccountWalletId(snapId: SnapId) {\n return toAccountWalletId(AccountWalletCategory.Snap, snapId);\n }\n\n getDefaultName(): string {\n const snap = this.messenger.call('SnapController:get', this.snapId);\n const snapName = snap\n ? // TODO: Handle localization here, but that's a \"client thing\", so we don't have a `core` controller\n // to refer to.\n snap.manifest.proposedName\n : stripSnapPrefix(this.snapId);\n\n return snapName;\n }\n}\n\nexport class SnapWalletRule extends BaseWalletRule {\n readonly #wallets: Map<AccountWalletId, SnapWallet>;\n\n constructor(messenger: AccountTreeControllerMessenger) {\n super(messenger);\n\n this.#wallets = new Map();\n }\n\n match(account: InternalAccount): WalletRuleMatch | undefined {\n if (\n hasKeyringType(account, KeyringTypes.snap) &&\n account.metadata.snap &&\n account.metadata.snap.enabled\n ) {\n const { id } = account.metadata.snap;\n const snapId = id as SnapId;\n\n // Check if a wallet already exists for that Snap ID.\n let wallet = this.#wallets.get(SnapWallet.toAccountWalletId(snapId));\n if (!wallet) {\n wallet = new SnapWallet(this.messenger, snapId);\n this.#wallets.set(wallet.id, wallet);\n }\n\n // This will automatically creates the group if it's missing.\n const group = wallet.addAccount(account);\n\n return {\n wallet,\n group,\n };\n }\n\n return undefined;\n }\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseWalletRule = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Abstract base class for {@link WalletRule}.
|
|
6
|
+
*/
|
|
7
|
+
class BaseWalletRule {
|
|
8
|
+
constructor(messenger) {
|
|
9
|
+
this.messenger = messenger;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.BaseWalletRule = BaseWalletRule;
|
|
13
|
+
//# sourceMappingURL=WalletRule.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletRule.cjs","sourceRoot":"","sources":["../../src/rules/WalletRule.ts"],"names":[],"mappings":";;;AAgCA;;GAEG;AACH,MAAsB,cAAc;IAGlC,YAAY,SAAyC;QACnD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CAGF;AARD,wCAQC","sourcesContent":["import type { InternalAccount } from '@metamask/keyring-internal-api';\nimport type { AccountTreeControllerMessenger } from 'src/AccountTreeController';\n\nimport type { AccountTreeGroup } from '../AccountTreeGroup';\nimport type { AccountTreeWallet } from '../AccountTreeWallet';\n\nexport type WalletRuleMatch = {\n wallet: AccountTreeWallet;\n group: AccountTreeGroup;\n};\n\n/**\n * A rule that can be used to group account in their proper account wallet/group.\n */\nexport type WalletRule = {\n /**\n * Apply the rule and check if the account matches.\n *\n * If the account matches, then the rule will return a {@link WalletRuleMatch} which means\n * this account needs to be grouped within a wallet associated with this rule.\n *\n * If a wallet already exists for this account (based on {@link WalletRuleMatch}) then\n * the account will be added to that wallet instance into its proper group (different for\n * every wallets).\n *\n * @param account - The account to match.\n * @returns A {@link WalletRuleMatch} if this account is part of that rule/wallet, returns\n * `undefined` otherwise.\n */\n match(account: InternalAccount): WalletRuleMatch | undefined;\n};\n\n/**\n * Abstract base class for {@link WalletRule}.\n */\nexport abstract class BaseWalletRule implements WalletRule {\n protected readonly messenger: AccountTreeControllerMessenger;\n\n constructor(messenger: AccountTreeControllerMessenger) {\n this.messenger = messenger;\n }\n\n abstract match(account: InternalAccount): WalletRuleMatch | undefined;\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { InternalAccount } from "@metamask/keyring-internal-api";
|
|
2
|
+
import type { AccountTreeControllerMessenger } from "src/AccountTreeController";
|
|
3
|
+
import type { AccountTreeGroup } from "../AccountTreeGroup.cjs";
|
|
4
|
+
import type { AccountTreeWallet } from "../AccountTreeWallet.cjs";
|
|
5
|
+
export type WalletRuleMatch = {
|
|
6
|
+
wallet: AccountTreeWallet;
|
|
7
|
+
group: AccountTreeGroup;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A rule that can be used to group account in their proper account wallet/group.
|
|
11
|
+
*/
|
|
12
|
+
export type WalletRule = {
|
|
13
|
+
/**
|
|
14
|
+
* Apply the rule and check if the account matches.
|
|
15
|
+
*
|
|
16
|
+
* If the account matches, then the rule will return a {@link WalletRuleMatch} which means
|
|
17
|
+
* this account needs to be grouped within a wallet associated with this rule.
|
|
18
|
+
*
|
|
19
|
+
* If a wallet already exists for this account (based on {@link WalletRuleMatch}) then
|
|
20
|
+
* the account will be added to that wallet instance into its proper group (different for
|
|
21
|
+
* every wallets).
|
|
22
|
+
*
|
|
23
|
+
* @param account - The account to match.
|
|
24
|
+
* @returns A {@link WalletRuleMatch} if this account is part of that rule/wallet, returns
|
|
25
|
+
* `undefined` otherwise.
|
|
26
|
+
*/
|
|
27
|
+
match(account: InternalAccount): WalletRuleMatch | undefined;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Abstract base class for {@link WalletRule}.
|
|
31
|
+
*/
|
|
32
|
+
export declare abstract class BaseWalletRule implements WalletRule {
|
|
33
|
+
protected readonly messenger: AccountTreeControllerMessenger;
|
|
34
|
+
constructor(messenger: AccountTreeControllerMessenger);
|
|
35
|
+
abstract match(account: InternalAccount): WalletRuleMatch | undefined;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=WalletRule.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletRule.d.cts","sourceRoot":"","sources":["../../src/rules/WalletRule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AACtE,OAAO,KAAK,EAAE,8BAA8B,EAAE,kCAAkC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,GAAG,SAAS,CAAC;CAC9D,CAAC;AAEF;;GAEG;AACH,8BAAsB,cAAe,YAAW,UAAU;IACxD,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,8BAA8B,CAAC;gBAEjD,SAAS,EAAE,8BAA8B;IAIrD,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,GAAG,SAAS;CACtE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { InternalAccount } from "@metamask/keyring-internal-api";
|
|
2
|
+
import type { AccountTreeControllerMessenger } from "src/AccountTreeController";
|
|
3
|
+
import type { AccountTreeGroup } from "../AccountTreeGroup.mjs";
|
|
4
|
+
import type { AccountTreeWallet } from "../AccountTreeWallet.mjs";
|
|
5
|
+
export type WalletRuleMatch = {
|
|
6
|
+
wallet: AccountTreeWallet;
|
|
7
|
+
group: AccountTreeGroup;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A rule that can be used to group account in their proper account wallet/group.
|
|
11
|
+
*/
|
|
12
|
+
export type WalletRule = {
|
|
13
|
+
/**
|
|
14
|
+
* Apply the rule and check if the account matches.
|
|
15
|
+
*
|
|
16
|
+
* If the account matches, then the rule will return a {@link WalletRuleMatch} which means
|
|
17
|
+
* this account needs to be grouped within a wallet associated with this rule.
|
|
18
|
+
*
|
|
19
|
+
* If a wallet already exists for this account (based on {@link WalletRuleMatch}) then
|
|
20
|
+
* the account will be added to that wallet instance into its proper group (different for
|
|
21
|
+
* every wallets).
|
|
22
|
+
*
|
|
23
|
+
* @param account - The account to match.
|
|
24
|
+
* @returns A {@link WalletRuleMatch} if this account is part of that rule/wallet, returns
|
|
25
|
+
* `undefined` otherwise.
|
|
26
|
+
*/
|
|
27
|
+
match(account: InternalAccount): WalletRuleMatch | undefined;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Abstract base class for {@link WalletRule}.
|
|
31
|
+
*/
|
|
32
|
+
export declare abstract class BaseWalletRule implements WalletRule {
|
|
33
|
+
protected readonly messenger: AccountTreeControllerMessenger;
|
|
34
|
+
constructor(messenger: AccountTreeControllerMessenger);
|
|
35
|
+
abstract match(account: InternalAccount): WalletRuleMatch | undefined;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=WalletRule.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletRule.d.mts","sourceRoot":"","sources":["../../src/rules/WalletRule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AACtE,OAAO,KAAK,EAAE,8BAA8B,EAAE,kCAAkC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,GAAG,SAAS,CAAC;CAC9D,CAAC;AAEF;;GAEG;AACH,8BAAsB,cAAe,YAAW,UAAU;IACxD,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,8BAA8B,CAAC;gBAEjD,SAAS,EAAE,8BAA8B;IAIrD,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,GAAG,SAAS;CACtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletRule.mjs","sourceRoot":"","sources":["../../src/rules/WalletRule.ts"],"names":[],"mappings":"AAgCA;;GAEG;AACH,MAAM,OAAgB,cAAc;IAGlC,YAAY,SAAyC;QACnD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CAGF","sourcesContent":["import type { InternalAccount } from '@metamask/keyring-internal-api';\nimport type { AccountTreeControllerMessenger } from 'src/AccountTreeController';\n\nimport type { AccountTreeGroup } from '../AccountTreeGroup';\nimport type { AccountTreeWallet } from '../AccountTreeWallet';\n\nexport type WalletRuleMatch = {\n wallet: AccountTreeWallet;\n group: AccountTreeGroup;\n};\n\n/**\n * A rule that can be used to group account in their proper account wallet/group.\n */\nexport type WalletRule = {\n /**\n * Apply the rule and check if the account matches.\n *\n * If the account matches, then the rule will return a {@link WalletRuleMatch} which means\n * this account needs to be grouped within a wallet associated with this rule.\n *\n * If a wallet already exists for this account (based on {@link WalletRuleMatch}) then\n * the account will be added to that wallet instance into its proper group (different for\n * every wallets).\n *\n * @param account - The account to match.\n * @returns A {@link WalletRuleMatch} if this account is part of that rule/wallet, returns\n * `undefined` otherwise.\n */\n match(account: InternalAccount): WalletRuleMatch | undefined;\n};\n\n/**\n * Abstract base class for {@link WalletRule}.\n */\nexport abstract class BaseWalletRule implements WalletRule {\n protected readonly messenger: AccountTreeControllerMessenger;\n\n constructor(messenger: AccountTreeControllerMessenger) {\n this.messenger = messenger;\n }\n\n abstract match(account: InternalAccount): WalletRuleMatch | undefined;\n}\n"]}
|
package/dist/rules/index.cjs
CHANGED
|
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
20
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./WalletRule.cjs"), exports);
|
|
18
|
+
__exportStar(require("./EntropySourceWalletRule.cjs"), exports);
|
|
19
|
+
__exportStar(require("./SnapWalletRule.cjs"), exports);
|
|
20
|
+
__exportStar(require("./KeyringWalletRule.cjs"), exports);
|
|
21
21
|
//# sourceMappingURL=index.cjs.map
|
package/dist/rules/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAA6B;AAC7B,gEAA0C;AAC1C,uDAAiC;AACjC,0DAAoC","sourcesContent":["export * from './WalletRule';\nexport * from './EntropySourceWalletRule';\nexport * from './SnapWalletRule';\nexport * from './KeyringWalletRule';\n"]}
|
package/dist/rules/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
1
|
+
export * from "./WalletRule.cjs";
|
|
2
|
+
export * from "./EntropySourceWalletRule.cjs";
|
|
3
|
+
export * from "./SnapWalletRule.cjs";
|
|
4
|
+
export * from "./KeyringWalletRule.cjs";
|
|
5
5
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,iCAA6B;AAC7B,8CAA0C;AAC1C,qCAAiC;AACjC,wCAAoC"}
|
package/dist/rules/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
1
|
+
export * from "./WalletRule.mjs";
|
|
2
|
+
export * from "./EntropySourceWalletRule.mjs";
|
|
3
|
+
export * from "./SnapWalletRule.mjs";
|
|
4
|
+
export * from "./KeyringWalletRule.mjs";
|
|
5
5
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,iCAA6B;AAC7B,8CAA0C;AAC1C,qCAAiC;AACjC,wCAAoC"}
|
package/dist/rules/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
1
|
+
export * from "./WalletRule.mjs";
|
|
2
|
+
export * from "./EntropySourceWalletRule.mjs";
|
|
3
|
+
export * from "./SnapWalletRule.mjs";
|
|
4
|
+
export * from "./KeyringWalletRule.mjs";
|
|
5
5
|
//# sourceMappingURL=index.mjs.map
|
package/dist/rules/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,iCAA6B;AAC7B,8CAA0C;AAC1C,qCAAiC;AACjC,wCAAoC","sourcesContent":["export * from './WalletRule';\nexport * from './EntropySourceWalletRule';\nexport * from './SnapWalletRule';\nexport * from './KeyringWalletRule';\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasKeyringType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Check if an account uses the same keyring type.
|
|
6
|
+
*
|
|
7
|
+
* @param account - The account.
|
|
8
|
+
* @param type - The keyring type.
|
|
9
|
+
* @returns True if the account uses the same keyring type, false otherwise.
|
|
10
|
+
*/
|
|
11
|
+
function hasKeyringType(account, type) {
|
|
12
|
+
return account.metadata.keyring.type === type;
|
|
13
|
+
}
|
|
14
|
+
exports.hasKeyringType = hasKeyringType;
|
|
15
|
+
//# sourceMappingURL=utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.cjs","sourceRoot":"","sources":["../../src/rules/utils.ts"],"names":[],"mappings":";;;AAGA;;;;;;GAMG;AACH,SAAgB,cAAc,CAC5B,OAAwB,EACxB,IAAkB;IAElB,OAAO,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAM,IAAe,CAAC;AAC5D,CAAC;AALD,wCAKC","sourcesContent":["import type { KeyringTypes } from '@metamask/keyring-controller';\nimport type { InternalAccount } from '@metamask/keyring-internal-api';\n\n/**\n * Check if an account uses the same keyring type.\n *\n * @param account - The account.\n * @param type - The keyring type.\n * @returns True if the account uses the same keyring type, false otherwise.\n */\nexport function hasKeyringType(\n account: InternalAccount,\n type: KeyringTypes,\n): boolean {\n return account.metadata.keyring.type === (type as string);\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { KeyringTypes } from "@metamask/keyring-controller";
|
|
2
|
+
import type { InternalAccount } from "@metamask/keyring-internal-api";
|
|
3
|
+
/**
|
|
4
|
+
* Check if an account uses the same keyring type.
|
|
5
|
+
*
|
|
6
|
+
* @param account - The account.
|
|
7
|
+
* @param type - The keyring type.
|
|
8
|
+
* @returns True if the account uses the same keyring type, false otherwise.
|
|
9
|
+
*/
|
|
10
|
+
export declare function hasKeyringType(account: InternalAccount, type: KeyringTypes): boolean;
|
|
11
|
+
//# sourceMappingURL=utils.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.cts","sourceRoot":"","sources":["../../src/rules/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,qCAAqC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AAEtE;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,YAAY,GACjB,OAAO,CAET"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { KeyringTypes } from "@metamask/keyring-controller";
|
|
2
|
+
import type { InternalAccount } from "@metamask/keyring-internal-api";
|
|
3
|
+
/**
|
|
4
|
+
* Check if an account uses the same keyring type.
|
|
5
|
+
*
|
|
6
|
+
* @param account - The account.
|
|
7
|
+
* @param type - The keyring type.
|
|
8
|
+
* @returns True if the account uses the same keyring type, false otherwise.
|
|
9
|
+
*/
|
|
10
|
+
export declare function hasKeyringType(account: InternalAccount, type: KeyringTypes): boolean;
|
|
11
|
+
//# sourceMappingURL=utils.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.mts","sourceRoot":"","sources":["../../src/rules/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,qCAAqC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AAEtE;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,YAAY,GACjB,OAAO,CAET"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if an account uses the same keyring type.
|
|
3
|
+
*
|
|
4
|
+
* @param account - The account.
|
|
5
|
+
* @param type - The keyring type.
|
|
6
|
+
* @returns True if the account uses the same keyring type, false otherwise.
|
|
7
|
+
*/
|
|
8
|
+
export function hasKeyringType(account, type) {
|
|
9
|
+
return account.metadata.keyring.type === type;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.mjs","sourceRoot":"","sources":["../../src/rules/utils.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAwB,EACxB,IAAkB;IAElB,OAAO,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAM,IAAe,CAAC;AAC5D,CAAC","sourcesContent":["import type { KeyringTypes } from '@metamask/keyring-controller';\nimport type { InternalAccount } from '@metamask/keyring-internal-api';\n\n/**\n * Check if an account uses the same keyring type.\n *\n * @param account - The account.\n * @param type - The keyring type.\n * @returns True if the account uses the same keyring type, false otherwise.\n */\nexport function hasKeyringType(\n account: InternalAccount,\n type: KeyringTypes,\n): boolean {\n return account.metadata.keyring.type === (type as string);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/account-tree-controller",
|
|
3
|
-
"version": "0.6.0-preview-
|
|
3
|
+
"version": "0.6.0-preview-b3ea3f86",
|
|
4
4
|
"description": "Controller to group account together based on some pre-defined rules",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"lodash": "^4.17.21"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@metamask/account-api": "^0.
|
|
56
|
+
"@metamask/account-api": "^0.2.0",
|
|
57
57
|
"@metamask/accounts-controller": "^32.0.0",
|
|
58
58
|
"@metamask/auto-changelog": "^3.4.4",
|
|
59
59
|
"@metamask/keyring-api": "^19.0.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"webextension-polyfill": "^0.12.0"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@metamask/account-api": "^0.
|
|
73
|
+
"@metamask/account-api": "^0.2.0",
|
|
74
74
|
"@metamask/accounts-controller": "^32.0.0",
|
|
75
75
|
"@metamask/keyring-controller": "^22.0.0",
|
|
76
76
|
"@metamask/providers": "^22.0.0",
|