@metamask-previews/account-api 0.5.0-0e28ac0 → 0.7.0-4fa71d1

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/dist/api/bip44.cjs +12 -0
  3. package/dist/api/bip44.cjs.map +1 -1
  4. package/dist/api/bip44.d.cts +7 -0
  5. package/dist/api/bip44.d.cts.map +1 -1
  6. package/dist/api/bip44.d.mts +7 -0
  7. package/dist/api/bip44.d.mts.map +1 -1
  8. package/dist/api/bip44.mjs +11 -0
  9. package/dist/api/bip44.mjs.map +1 -1
  10. package/dist/api/multichain/group.cjs +2 -2
  11. package/dist/api/multichain/group.cjs.map +1 -1
  12. package/dist/api/multichain/group.d.cts +1 -1
  13. package/dist/api/multichain/group.d.cts.map +1 -1
  14. package/dist/api/multichain/group.d.mts +1 -1
  15. package/dist/api/multichain/group.d.mts.map +1 -1
  16. package/dist/api/multichain/group.mjs +1 -1
  17. package/dist/api/multichain/group.mjs.map +1 -1
  18. package/dist/api/provider.cjs.map +1 -1
  19. package/dist/api/provider.d.cts +30 -2
  20. package/dist/api/provider.d.cts.map +1 -1
  21. package/dist/api/provider.d.mts +30 -2
  22. package/dist/api/provider.d.mts.map +1 -1
  23. package/dist/api/provider.mjs.map +1 -1
  24. package/dist/index.cjs +2 -0
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.mjs +2 -0
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/tests/accounts.cjs +199 -0
  29. package/dist/tests/accounts.cjs.map +1 -0
  30. package/dist/tests/accounts.d.cts +166 -0
  31. package/dist/tests/accounts.d.cts.map +1 -0
  32. package/dist/tests/accounts.d.mts +166 -0
  33. package/dist/tests/accounts.d.mts.map +1 -0
  34. package/dist/tests/accounts.mjs +195 -0
  35. package/dist/tests/accounts.mjs.map +1 -0
  36. package/dist/tests/index.cjs +18 -0
  37. package/dist/tests/index.cjs.map +1 -0
  38. package/dist/tests/index.d.cts +2 -0
  39. package/dist/tests/index.d.cts.map +1 -0
  40. package/dist/tests/index.d.mts +2 -0
  41. package/dist/tests/index.d.mts.map +1 -0
  42. package/dist/tests/index.mjs +2 -0
  43. package/dist/tests/index.mjs.map +1 -0
  44. package/package.json +14 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.cjs","sourceRoot":"","sources":["../../src/tests/accounts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,uDAW+B;AAC/B,+BAAkC;AAElC,0CAA2D;AAE3D,MAAM,eAAe,GAAG;IACtB,uBAAS,CAAC,YAAY;IACtB,uBAAS,CAAC,IAAI;IACd,uBAAS,CAAC,eAAe;IACzB,uBAAS,CAAC,eAAe;IACzB,uBAAS,CAAC,eAAe;IACzB,uBAAS,CAAC,eAAe;CACjB,CAAC;AAEX,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,uBAAS,CAAC,CAAC;AAEhC,QAAA,WAAW,GAAG;IACzB,EAAE,EAAE,sBAAsB;IAC1B,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE;QACR,YAAY,EAAE,aAAa;KAC5B;CACF,CAAC;AAEW,QAAA,WAAW,GAAG;IACzB,EAAE,EAAE,sBAAsB;IAC1B,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE;QACR,YAAY,EAAE,aAAa;KAC5B;CACF,CAAC;AAEW,QAAA,qBAAqB,GAAG,mBAAmB,CAAC;AAC5C,QAAA,qBAAqB,GAAG,mBAAmB,CAAC;AAE5C,QAAA,iBAAiB,GAAiC;IAC7D,EAAE,EAAE,WAAW;IACf,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,6CAA+B,CAAC,QAAQ;YAC9C,EAAE,EAAE,6BAAqB;YACzB,UAAU,EAAE,CAAC;YACb,cAAc,EAAE,EAAE;SACnB;KACF;IACD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,CAAC,CAAC;KACjB,GAAG,EAAE,CAAC;AACI,QAAA,yBAAyB,GAAG,kBAAkB,CAAC,IAAI,CAC9D,0BAAkB,CACnB;KACE,iBAAiB,CAAC,oCAA4B,CAAC;KAC/C,cAAc,CAAC,CAAC,CAAC;KACjB,GAAG,EAAE,CAAC;AACI,QAAA,gCAAgC,GAAG,kBAAkB,CAAC,IAAI,CACrE,iCAAyB,CAC1B;KACE,iBAAiB,CAAC,oCAA4B,CAAC;KAC/C,cAAc,CAAC,CAAC,CAAC;KACjB,GAAG,EAAE,CAAC;AACI,QAAA,8BAA8B,GAAG,kBAAkB,CAAC,IAAI,CACnE,+BAAuB,CACxB;KACE,iBAAiB,CAAC,oCAA4B,CAAC;KAC/C,cAAc,CAAC,CAAC,CAAC;KACjB,GAAG,EAAE,CAAC","sourcesContent":["import type { EntropySourceId, KeyringAccount } from '@metamask/keyring-api';\nimport {\n BtcAccountType,\n BtcMethod,\n BtcScope,\n EthAccountType,\n EthMethod,\n EthScope,\n KeyringAccountEntropyTypeOption,\n SolAccountType,\n SolMethod,\n SolScope,\n} from '@metamask/keyring-api';\nimport { v4 as uuid } from 'uuid';\n\nimport { isBip44Account, type Bip44Account } from '../api';\n\nconst ETH_EOA_METHODS = [\n EthMethod.PersonalSign,\n EthMethod.Sign,\n EthMethod.SignTransaction,\n EthMethod.SignTypedDataV1,\n EthMethod.SignTypedDataV3,\n EthMethod.SignTypedDataV4,\n] as const;\n\nconst SOL_METHODS = Object.values(SolMethod);\n\nexport const MOCK_SNAP_1 = {\n id: 'local:mock-snap-id-1',\n name: 'Mock Snap 1',\n enabled: true,\n manifest: {\n proposedName: 'Mock Snap 1',\n },\n};\n\nexport const MOCK_SNAP_2 = {\n id: 'local:mock-snap-id-2',\n name: 'Mock Snap 2',\n enabled: true,\n manifest: {\n proposedName: 'Mock Snap 2',\n },\n};\n\nexport const MOCK_ENTROPY_SOURCE_1 = 'mock-keyring-id-1';\nexport const MOCK_ENTROPY_SOURCE_2 = 'mock-keyring-id-2';\n\nexport const MOCK_HD_ACCOUNT_1: Bip44Account<KeyringAccount> = {\n id: 'mock-id-1',\n address: '0x123',\n options: {\n entropy: {\n type: KeyringAccountEntropyTypeOption.Mnemonic,\n id: MOCK_ENTROPY_SOURCE_1,\n groupIndex: 0,\n derivationPath: '',\n },\n },\n methods: [...ETH_EOA_METHODS],\n type: EthAccountType.Eoa,\n scopes: [EthScope.Eoa],\n};\n\nexport const MOCK_HD_ACCOUNT_2: Bip44Account<KeyringAccount> = {\n id: 'mock-id-2',\n address: '0x456',\n options: {\n entropy: {\n type: KeyringAccountEntropyTypeOption.Mnemonic,\n id: MOCK_ENTROPY_SOURCE_2,\n groupIndex: 0,\n derivationPath: '',\n },\n },\n methods: [...ETH_EOA_METHODS],\n type: EthAccountType.Eoa,\n scopes: [EthScope.Eoa],\n};\n\nexport const MOCK_SOL_ACCOUNT_1: Bip44Account<KeyringAccount> = {\n id: 'mock-snap-id-1',\n address: 'aabbccdd',\n options: {\n entropy: {\n type: KeyringAccountEntropyTypeOption.Mnemonic,\n // NOTE: shares entropy with MOCK_HD_ACCOUNT_2\n id: MOCK_ENTROPY_SOURCE_2,\n groupIndex: 0,\n derivationPath: '',\n },\n },\n methods: SOL_METHODS,\n type: SolAccountType.DataAccount,\n scopes: [SolScope.Mainnet, SolScope.Testnet, SolScope.Devnet],\n};\n\nexport const MOCK_BTC_P2WPKH_ACCOUNT_1: Bip44Account<KeyringAccount> = {\n id: 'b0f030d8-e101-4b5a-a3dd-13f8ca8ec1db',\n type: BtcAccountType.P2wpkh,\n methods: [BtcMethod.SendBitcoin],\n address: 'bc1qx8ls07cy8j8nrluy2u0xwn7gh8fxg0rg4s8zze',\n options: {\n entropy: {\n type: KeyringAccountEntropyTypeOption.Mnemonic,\n // NOTE: shares entropy with MOCK_HD_ACCOUNT_2\n id: MOCK_ENTROPY_SOURCE_2,\n groupIndex: 0,\n derivationPath: '',\n },\n },\n scopes: [BtcScope.Mainnet],\n};\n\nexport const MOCK_BTC_P2TR_ACCOUNT_1: Bip44Account<KeyringAccount> = {\n id: 'a20c2e1a-6ff6-40ba-b8e0-ccdb6f9933bb',\n type: BtcAccountType.P2tr,\n methods: [BtcMethod.SendBitcoin],\n address: 'tb1p5cyxnuxmeuwuvkwfem96lxx9wex9kkf4mt9ll6q60jfsnrzqg4sszkqjnh',\n options: {\n entropy: {\n type: KeyringAccountEntropyTypeOption.Mnemonic,\n // NOTE: shares entropy with MOCK_HD_ACCOUNT_2\n id: MOCK_ENTROPY_SOURCE_2,\n groupIndex: 0,\n derivationPath: '',\n },\n },\n scopes: [BtcScope.Testnet],\n};\n\nexport const MOCK_SNAP_ACCOUNT_1 = MOCK_SOL_ACCOUNT_1;\n\nexport const MOCK_SNAP_ACCOUNT_2: KeyringAccount = {\n id: 'mock-snap-id-2',\n address: '0x789',\n options: {},\n methods: [...ETH_EOA_METHODS],\n type: EthAccountType.Eoa,\n scopes: [EthScope.Eoa],\n};\n\nexport const MOCK_SNAP_ACCOUNT_3 = MOCK_BTC_P2WPKH_ACCOUNT_1;\nexport const MOCK_SNAP_ACCOUNT_4 = MOCK_BTC_P2TR_ACCOUNT_1;\n\nexport const MOCK_HARDWARE_ACCOUNT_1: KeyringAccount = {\n id: 'mock-hardware-id-1',\n address: '0xABC',\n options: {},\n methods: [...ETH_EOA_METHODS],\n type: EthAccountType.Eoa,\n scopes: [EthScope.Eoa],\n};\n\nexport class MockAccountBuilder<Account extends KeyringAccount> {\n readonly #account: Account;\n\n constructor(account: Account) {\n // Make a deep-copy to avoid mutating the same ref.\n this.#account = JSON.parse(JSON.stringify(account));\n }\n\n static from<Account extends KeyringAccount>(\n account: Account,\n ): MockAccountBuilder<Account> {\n return new MockAccountBuilder(account);\n }\n\n withId(id: KeyringAccount['id']): MockAccountBuilder<Account> {\n this.#account.id = id;\n return this;\n }\n\n withUuid(): MockAccountBuilder<Account> {\n this.#account.id = uuid();\n return this;\n }\n\n withAddressSuffix(suffix: string): MockAccountBuilder<Account> {\n this.#account.address += suffix;\n return this;\n }\n\n withEntropySource(\n entropySource: EntropySourceId,\n ): MockAccountBuilder<Account> {\n if (isBip44Account(this.#account)) {\n this.#account.options.entropy.id = entropySource;\n }\n return this;\n }\n\n withGroupIndex(groupIndex: number): MockAccountBuilder<Account> {\n if (isBip44Account(this.#account)) {\n this.#account.options.entropy.groupIndex = groupIndex;\n }\n return this;\n }\n\n get(): Account {\n return this.#account;\n }\n}\n\nexport const MOCK_WALLET_1_ENTROPY_SOURCE = MOCK_ENTROPY_SOURCE_1;\n\nexport const MOCK_WALLET_1_EVM_ACCOUNT = MockAccountBuilder.from(\n MOCK_HD_ACCOUNT_1,\n)\n .withEntropySource(MOCK_WALLET_1_ENTROPY_SOURCE)\n .withGroupIndex(0)\n .get();\nexport const MOCK_WALLET_1_SOL_ACCOUNT = MockAccountBuilder.from(\n MOCK_SOL_ACCOUNT_1,\n)\n .withEntropySource(MOCK_WALLET_1_ENTROPY_SOURCE)\n .withGroupIndex(0)\n .get();\nexport const MOCK_WALLET_1_BTC_P2WPKH_ACCOUNT = MockAccountBuilder.from(\n MOCK_BTC_P2WPKH_ACCOUNT_1,\n)\n .withEntropySource(MOCK_WALLET_1_ENTROPY_SOURCE)\n .withGroupIndex(0)\n .get();\nexport const MOCK_WALLET_1_BTC_P2TR_ACCOUNT = MockAccountBuilder.from(\n MOCK_BTC_P2TR_ACCOUNT_1,\n)\n .withEntropySource(MOCK_WALLET_1_ENTROPY_SOURCE)\n .withGroupIndex(0)\n .get();\n"]}
@@ -0,0 +1,166 @@
1
+ import type { EntropySourceId, KeyringAccount } from "@metamask/keyring-api";
2
+ import { type Bip44Account } from "../api/index.cjs";
3
+ export declare const MOCK_SNAP_1: {
4
+ id: string;
5
+ name: string;
6
+ enabled: boolean;
7
+ manifest: {
8
+ proposedName: string;
9
+ };
10
+ };
11
+ export declare const MOCK_SNAP_2: {
12
+ id: string;
13
+ name: string;
14
+ enabled: boolean;
15
+ manifest: {
16
+ proposedName: string;
17
+ };
18
+ };
19
+ export declare const MOCK_ENTROPY_SOURCE_1 = "mock-keyring-id-1";
20
+ export declare const MOCK_ENTROPY_SOURCE_2 = "mock-keyring-id-2";
21
+ export declare const MOCK_HD_ACCOUNT_1: Bip44Account<KeyringAccount>;
22
+ export declare const MOCK_HD_ACCOUNT_2: Bip44Account<KeyringAccount>;
23
+ export declare const MOCK_SOL_ACCOUNT_1: Bip44Account<KeyringAccount>;
24
+ export declare const MOCK_BTC_P2WPKH_ACCOUNT_1: Bip44Account<KeyringAccount>;
25
+ export declare const MOCK_BTC_P2TR_ACCOUNT_1: Bip44Account<KeyringAccount>;
26
+ export declare const MOCK_SNAP_ACCOUNT_1: Bip44Account<{
27
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
28
+ id: string;
29
+ options: Record<string, import("@metamask/utils").Json> & {
30
+ entropy?: {
31
+ type: "mnemonic";
32
+ id: string;
33
+ derivationPath: string;
34
+ groupIndex: number;
35
+ } | {
36
+ type: "private-key";
37
+ };
38
+ exportable?: boolean;
39
+ };
40
+ address: string;
41
+ scopes: `${string}:${string}`[];
42
+ methods: string[];
43
+ }>;
44
+ export declare const MOCK_SNAP_ACCOUNT_2: KeyringAccount;
45
+ export declare const MOCK_SNAP_ACCOUNT_3: Bip44Account<{
46
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
47
+ id: string;
48
+ options: Record<string, import("@metamask/utils").Json> & {
49
+ entropy?: {
50
+ type: "mnemonic";
51
+ id: string;
52
+ derivationPath: string;
53
+ groupIndex: number;
54
+ } | {
55
+ type: "private-key";
56
+ };
57
+ exportable?: boolean;
58
+ };
59
+ address: string;
60
+ scopes: `${string}:${string}`[];
61
+ methods: string[];
62
+ }>;
63
+ export declare const MOCK_SNAP_ACCOUNT_4: Bip44Account<{
64
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
65
+ id: string;
66
+ options: Record<string, import("@metamask/utils").Json> & {
67
+ entropy?: {
68
+ type: "mnemonic";
69
+ id: string;
70
+ derivationPath: string;
71
+ groupIndex: number;
72
+ } | {
73
+ type: "private-key";
74
+ };
75
+ exportable?: boolean;
76
+ };
77
+ address: string;
78
+ scopes: `${string}:${string}`[];
79
+ methods: string[];
80
+ }>;
81
+ export declare const MOCK_HARDWARE_ACCOUNT_1: KeyringAccount;
82
+ export declare class MockAccountBuilder<Account extends KeyringAccount> {
83
+ #private;
84
+ constructor(account: Account);
85
+ static from<Account extends KeyringAccount>(account: Account): MockAccountBuilder<Account>;
86
+ withId(id: KeyringAccount['id']): MockAccountBuilder<Account>;
87
+ withUuid(): MockAccountBuilder<Account>;
88
+ withAddressSuffix(suffix: string): MockAccountBuilder<Account>;
89
+ withEntropySource(entropySource: EntropySourceId): MockAccountBuilder<Account>;
90
+ withGroupIndex(groupIndex: number): MockAccountBuilder<Account>;
91
+ get(): Account;
92
+ }
93
+ export declare const MOCK_WALLET_1_ENTROPY_SOURCE = "mock-keyring-id-1";
94
+ export declare const MOCK_WALLET_1_EVM_ACCOUNT: Bip44Account<{
95
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
96
+ id: string;
97
+ options: Record<string, import("@metamask/utils").Json> & {
98
+ entropy?: {
99
+ type: "mnemonic";
100
+ id: string;
101
+ derivationPath: string;
102
+ groupIndex: number;
103
+ } | {
104
+ type: "private-key";
105
+ };
106
+ exportable?: boolean;
107
+ };
108
+ address: string;
109
+ scopes: `${string}:${string}`[];
110
+ methods: string[];
111
+ }>;
112
+ export declare const MOCK_WALLET_1_SOL_ACCOUNT: Bip44Account<{
113
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
114
+ id: string;
115
+ options: Record<string, import("@metamask/utils").Json> & {
116
+ entropy?: {
117
+ type: "mnemonic";
118
+ id: string;
119
+ derivationPath: string;
120
+ groupIndex: number;
121
+ } | {
122
+ type: "private-key";
123
+ };
124
+ exportable?: boolean;
125
+ };
126
+ address: string;
127
+ scopes: `${string}:${string}`[];
128
+ methods: string[];
129
+ }>;
130
+ export declare const MOCK_WALLET_1_BTC_P2WPKH_ACCOUNT: Bip44Account<{
131
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
132
+ id: string;
133
+ options: Record<string, import("@metamask/utils").Json> & {
134
+ entropy?: {
135
+ type: "mnemonic";
136
+ id: string;
137
+ derivationPath: string;
138
+ groupIndex: number;
139
+ } | {
140
+ type: "private-key";
141
+ };
142
+ exportable?: boolean;
143
+ };
144
+ address: string;
145
+ scopes: `${string}:${string}`[];
146
+ methods: string[];
147
+ }>;
148
+ export declare const MOCK_WALLET_1_BTC_P2TR_ACCOUNT: Bip44Account<{
149
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
150
+ id: string;
151
+ options: Record<string, import("@metamask/utils").Json> & {
152
+ entropy?: {
153
+ type: "mnemonic";
154
+ id: string;
155
+ derivationPath: string;
156
+ groupIndex: number;
157
+ } | {
158
+ type: "private-key";
159
+ };
160
+ exportable?: boolean;
161
+ };
162
+ address: string;
163
+ scopes: `${string}:${string}`[];
164
+ methods: string[];
165
+ }>;
166
+ //# sourceMappingURL=accounts.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.d.cts","sourceRoot":"","sources":["../../src/tests/accounts.ts"],"names":[],"mappings":"AAA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B,CAAC,OAAO,CAAC;IAKvC,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,kBAAkB,CAAC,OAAO,CAAC;IAK9D,iBAAiB,CACf,aAAa,EAAE,eAAe,GAC7B,kBAAkB,CAAC,OAAO,CAAC;IAO9B,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,CAAC,OAAO,CAAC;IAO/D,GAAG,IAAI,OAAO;CAGf;AAED,eAAO,MAAM,4BAA4B,sBAAwB,CAAC;AAElE,eAAO,MAAM,yBAAyB;;;;eAzIR,CAAC;;;;;;;;kBAS/B,CAAC;;;;;EAqIO,CAAC;AACT,eAAO,MAAM,yBAAyB;;;;eA/IR,CAAC;;;;;;;;kBAS/B,CAAC;;;;;EA2IO,CAAC;AACT,eAAO,MAAM,gCAAgC;;;;eArJf,CAAC;;;;;;;;kBAS/B,CAAC;;;;;EAiJO,CAAC;AACT,eAAO,MAAM,8BAA8B;;;;eA3Jb,CAAC;;;;;;;;kBAS/B,CAAC;;;;;EAuJO,CAAC"}
@@ -0,0 +1,166 @@
1
+ import type { EntropySourceId, KeyringAccount } from "@metamask/keyring-api";
2
+ import { type Bip44Account } from "../api/index.mjs";
3
+ export declare const MOCK_SNAP_1: {
4
+ id: string;
5
+ name: string;
6
+ enabled: boolean;
7
+ manifest: {
8
+ proposedName: string;
9
+ };
10
+ };
11
+ export declare const MOCK_SNAP_2: {
12
+ id: string;
13
+ name: string;
14
+ enabled: boolean;
15
+ manifest: {
16
+ proposedName: string;
17
+ };
18
+ };
19
+ export declare const MOCK_ENTROPY_SOURCE_1 = "mock-keyring-id-1";
20
+ export declare const MOCK_ENTROPY_SOURCE_2 = "mock-keyring-id-2";
21
+ export declare const MOCK_HD_ACCOUNT_1: Bip44Account<KeyringAccount>;
22
+ export declare const MOCK_HD_ACCOUNT_2: Bip44Account<KeyringAccount>;
23
+ export declare const MOCK_SOL_ACCOUNT_1: Bip44Account<KeyringAccount>;
24
+ export declare const MOCK_BTC_P2WPKH_ACCOUNT_1: Bip44Account<KeyringAccount>;
25
+ export declare const MOCK_BTC_P2TR_ACCOUNT_1: Bip44Account<KeyringAccount>;
26
+ export declare const MOCK_SNAP_ACCOUNT_1: Bip44Account<{
27
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
28
+ id: string;
29
+ options: Record<string, import("@metamask/utils").Json> & {
30
+ entropy?: {
31
+ type: "mnemonic";
32
+ id: string;
33
+ derivationPath: string;
34
+ groupIndex: number;
35
+ } | {
36
+ type: "private-key";
37
+ };
38
+ exportable?: boolean;
39
+ };
40
+ address: string;
41
+ scopes: `${string}:${string}`[];
42
+ methods: string[];
43
+ }>;
44
+ export declare const MOCK_SNAP_ACCOUNT_2: KeyringAccount;
45
+ export declare const MOCK_SNAP_ACCOUNT_3: Bip44Account<{
46
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
47
+ id: string;
48
+ options: Record<string, import("@metamask/utils").Json> & {
49
+ entropy?: {
50
+ type: "mnemonic";
51
+ id: string;
52
+ derivationPath: string;
53
+ groupIndex: number;
54
+ } | {
55
+ type: "private-key";
56
+ };
57
+ exportable?: boolean;
58
+ };
59
+ address: string;
60
+ scopes: `${string}:${string}`[];
61
+ methods: string[];
62
+ }>;
63
+ export declare const MOCK_SNAP_ACCOUNT_4: Bip44Account<{
64
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
65
+ id: string;
66
+ options: Record<string, import("@metamask/utils").Json> & {
67
+ entropy?: {
68
+ type: "mnemonic";
69
+ id: string;
70
+ derivationPath: string;
71
+ groupIndex: number;
72
+ } | {
73
+ type: "private-key";
74
+ };
75
+ exportable?: boolean;
76
+ };
77
+ address: string;
78
+ scopes: `${string}:${string}`[];
79
+ methods: string[];
80
+ }>;
81
+ export declare const MOCK_HARDWARE_ACCOUNT_1: KeyringAccount;
82
+ export declare class MockAccountBuilder<Account extends KeyringAccount> {
83
+ #private;
84
+ constructor(account: Account);
85
+ static from<Account extends KeyringAccount>(account: Account): MockAccountBuilder<Account>;
86
+ withId(id: KeyringAccount['id']): MockAccountBuilder<Account>;
87
+ withUuid(): MockAccountBuilder<Account>;
88
+ withAddressSuffix(suffix: string): MockAccountBuilder<Account>;
89
+ withEntropySource(entropySource: EntropySourceId): MockAccountBuilder<Account>;
90
+ withGroupIndex(groupIndex: number): MockAccountBuilder<Account>;
91
+ get(): Account;
92
+ }
93
+ export declare const MOCK_WALLET_1_ENTROPY_SOURCE = "mock-keyring-id-1";
94
+ export declare const MOCK_WALLET_1_EVM_ACCOUNT: Bip44Account<{
95
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
96
+ id: string;
97
+ options: Record<string, import("@metamask/utils").Json> & {
98
+ entropy?: {
99
+ type: "mnemonic";
100
+ id: string;
101
+ derivationPath: string;
102
+ groupIndex: number;
103
+ } | {
104
+ type: "private-key";
105
+ };
106
+ exportable?: boolean;
107
+ };
108
+ address: string;
109
+ scopes: `${string}:${string}`[];
110
+ methods: string[];
111
+ }>;
112
+ export declare const MOCK_WALLET_1_SOL_ACCOUNT: Bip44Account<{
113
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
114
+ id: string;
115
+ options: Record<string, import("@metamask/utils").Json> & {
116
+ entropy?: {
117
+ type: "mnemonic";
118
+ id: string;
119
+ derivationPath: string;
120
+ groupIndex: number;
121
+ } | {
122
+ type: "private-key";
123
+ };
124
+ exportable?: boolean;
125
+ };
126
+ address: string;
127
+ scopes: `${string}:${string}`[];
128
+ methods: string[];
129
+ }>;
130
+ export declare const MOCK_WALLET_1_BTC_P2WPKH_ACCOUNT: Bip44Account<{
131
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
132
+ id: string;
133
+ options: Record<string, import("@metamask/utils").Json> & {
134
+ entropy?: {
135
+ type: "mnemonic";
136
+ id: string;
137
+ derivationPath: string;
138
+ groupIndex: number;
139
+ } | {
140
+ type: "private-key";
141
+ };
142
+ exportable?: boolean;
143
+ };
144
+ address: string;
145
+ scopes: `${string}:${string}`[];
146
+ methods: string[];
147
+ }>;
148
+ export declare const MOCK_WALLET_1_BTC_P2TR_ACCOUNT: Bip44Account<{
149
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
150
+ id: string;
151
+ options: Record<string, import("@metamask/utils").Json> & {
152
+ entropy?: {
153
+ type: "mnemonic";
154
+ id: string;
155
+ derivationPath: string;
156
+ groupIndex: number;
157
+ } | {
158
+ type: "private-key";
159
+ };
160
+ exportable?: boolean;
161
+ };
162
+ address: string;
163
+ scopes: `${string}:${string}`[];
164
+ methods: string[];
165
+ }>;
166
+ //# sourceMappingURL=accounts.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.d.mts","sourceRoot":"","sources":["../../src/tests/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,8BAA8B;AAe7E,OAAO,EAAkB,KAAK,YAAY,EAAE,yBAAe;AAa3D,eAAO,MAAM,WAAW;;;;;;;CAOvB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;CAOvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AAEzD,eAAO,MAAM,iBAAiB,EA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AAC;AAElE,eAAO,MAAM,yBAAyB;;;;eAzIR,CAAC;;;;;;;;kBAS/B,CAAC;;;;;EAqIO,CAAC;AACT,eAAO,MAAM,yBAAyB;;;;eA/IR,CAAC;;;;;;;;kBAS/B,CAAC;;;;;EA2IO,CAAC;AACT,eAAO,MAAM,gCAAgC;;;;eArJf,CAAC;;;;;;;;kBAS/B,CAAC;;;;;EAiJO,CAAC;AACT,eAAO,MAAM,8BAA8B;;;;eA3Jb,CAAC;;;;;;;;kBAS/B,CAAC;;;;;EAuJO,CAAC"}
@@ -0,0 +1,195 @@
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 _MockAccountBuilder_account;
13
+ import { BtcAccountType, BtcMethod, BtcScope, EthAccountType, EthMethod, EthScope, KeyringAccountEntropyTypeOption, SolAccountType, SolMethod, SolScope } from "@metamask/keyring-api";
14
+ import { v4 as uuid } from "uuid";
15
+ import { isBip44Account } from "../api/index.mjs";
16
+ const ETH_EOA_METHODS = [
17
+ EthMethod.PersonalSign,
18
+ EthMethod.Sign,
19
+ EthMethod.SignTransaction,
20
+ EthMethod.SignTypedDataV1,
21
+ EthMethod.SignTypedDataV3,
22
+ EthMethod.SignTypedDataV4,
23
+ ];
24
+ const SOL_METHODS = Object.values(SolMethod);
25
+ export const MOCK_SNAP_1 = {
26
+ id: 'local:mock-snap-id-1',
27
+ name: 'Mock Snap 1',
28
+ enabled: true,
29
+ manifest: {
30
+ proposedName: 'Mock Snap 1',
31
+ },
32
+ };
33
+ export const MOCK_SNAP_2 = {
34
+ id: 'local:mock-snap-id-2',
35
+ name: 'Mock Snap 2',
36
+ enabled: true,
37
+ manifest: {
38
+ proposedName: 'Mock Snap 2',
39
+ },
40
+ };
41
+ export const MOCK_ENTROPY_SOURCE_1 = 'mock-keyring-id-1';
42
+ export const MOCK_ENTROPY_SOURCE_2 = 'mock-keyring-id-2';
43
+ export const MOCK_HD_ACCOUNT_1 = {
44
+ id: 'mock-id-1',
45
+ address: '0x123',
46
+ options: {
47
+ entropy: {
48
+ type: KeyringAccountEntropyTypeOption.Mnemonic,
49
+ id: MOCK_ENTROPY_SOURCE_1,
50
+ groupIndex: 0,
51
+ derivationPath: '',
52
+ },
53
+ },
54
+ methods: [...ETH_EOA_METHODS],
55
+ type: EthAccountType.Eoa,
56
+ scopes: [EthScope.Eoa],
57
+ };
58
+ export const MOCK_HD_ACCOUNT_2 = {
59
+ id: 'mock-id-2',
60
+ address: '0x456',
61
+ options: {
62
+ entropy: {
63
+ type: KeyringAccountEntropyTypeOption.Mnemonic,
64
+ id: MOCK_ENTROPY_SOURCE_2,
65
+ groupIndex: 0,
66
+ derivationPath: '',
67
+ },
68
+ },
69
+ methods: [...ETH_EOA_METHODS],
70
+ type: EthAccountType.Eoa,
71
+ scopes: [EthScope.Eoa],
72
+ };
73
+ export const MOCK_SOL_ACCOUNT_1 = {
74
+ id: 'mock-snap-id-1',
75
+ address: 'aabbccdd',
76
+ options: {
77
+ entropy: {
78
+ type: KeyringAccountEntropyTypeOption.Mnemonic,
79
+ // NOTE: shares entropy with MOCK_HD_ACCOUNT_2
80
+ id: MOCK_ENTROPY_SOURCE_2,
81
+ groupIndex: 0,
82
+ derivationPath: '',
83
+ },
84
+ },
85
+ methods: SOL_METHODS,
86
+ type: SolAccountType.DataAccount,
87
+ scopes: [SolScope.Mainnet, SolScope.Testnet, SolScope.Devnet],
88
+ };
89
+ export const MOCK_BTC_P2WPKH_ACCOUNT_1 = {
90
+ id: 'b0f030d8-e101-4b5a-a3dd-13f8ca8ec1db',
91
+ type: BtcAccountType.P2wpkh,
92
+ methods: [BtcMethod.SendBitcoin],
93
+ address: 'bc1qx8ls07cy8j8nrluy2u0xwn7gh8fxg0rg4s8zze',
94
+ options: {
95
+ entropy: {
96
+ type: KeyringAccountEntropyTypeOption.Mnemonic,
97
+ // NOTE: shares entropy with MOCK_HD_ACCOUNT_2
98
+ id: MOCK_ENTROPY_SOURCE_2,
99
+ groupIndex: 0,
100
+ derivationPath: '',
101
+ },
102
+ },
103
+ scopes: [BtcScope.Mainnet],
104
+ };
105
+ export const MOCK_BTC_P2TR_ACCOUNT_1 = {
106
+ id: 'a20c2e1a-6ff6-40ba-b8e0-ccdb6f9933bb',
107
+ type: BtcAccountType.P2tr,
108
+ methods: [BtcMethod.SendBitcoin],
109
+ address: 'tb1p5cyxnuxmeuwuvkwfem96lxx9wex9kkf4mt9ll6q60jfsnrzqg4sszkqjnh',
110
+ options: {
111
+ entropy: {
112
+ type: KeyringAccountEntropyTypeOption.Mnemonic,
113
+ // NOTE: shares entropy with MOCK_HD_ACCOUNT_2
114
+ id: MOCK_ENTROPY_SOURCE_2,
115
+ groupIndex: 0,
116
+ derivationPath: '',
117
+ },
118
+ },
119
+ scopes: [BtcScope.Testnet],
120
+ };
121
+ export const MOCK_SNAP_ACCOUNT_1 = MOCK_SOL_ACCOUNT_1;
122
+ export const MOCK_SNAP_ACCOUNT_2 = {
123
+ id: 'mock-snap-id-2',
124
+ address: '0x789',
125
+ options: {},
126
+ methods: [...ETH_EOA_METHODS],
127
+ type: EthAccountType.Eoa,
128
+ scopes: [EthScope.Eoa],
129
+ };
130
+ export const MOCK_SNAP_ACCOUNT_3 = MOCK_BTC_P2WPKH_ACCOUNT_1;
131
+ export const MOCK_SNAP_ACCOUNT_4 = MOCK_BTC_P2TR_ACCOUNT_1;
132
+ export const MOCK_HARDWARE_ACCOUNT_1 = {
133
+ id: 'mock-hardware-id-1',
134
+ address: '0xABC',
135
+ options: {},
136
+ methods: [...ETH_EOA_METHODS],
137
+ type: EthAccountType.Eoa,
138
+ scopes: [EthScope.Eoa],
139
+ };
140
+ export class MockAccountBuilder {
141
+ constructor(account) {
142
+ _MockAccountBuilder_account.set(this, void 0);
143
+ // Make a deep-copy to avoid mutating the same ref.
144
+ __classPrivateFieldSet(this, _MockAccountBuilder_account, JSON.parse(JSON.stringify(account)), "f");
145
+ }
146
+ static from(account) {
147
+ return new MockAccountBuilder(account);
148
+ }
149
+ withId(id) {
150
+ __classPrivateFieldGet(this, _MockAccountBuilder_account, "f").id = id;
151
+ return this;
152
+ }
153
+ withUuid() {
154
+ __classPrivateFieldGet(this, _MockAccountBuilder_account, "f").id = uuid();
155
+ return this;
156
+ }
157
+ withAddressSuffix(suffix) {
158
+ __classPrivateFieldGet(this, _MockAccountBuilder_account, "f").address += suffix;
159
+ return this;
160
+ }
161
+ withEntropySource(entropySource) {
162
+ if (isBip44Account(__classPrivateFieldGet(this, _MockAccountBuilder_account, "f"))) {
163
+ __classPrivateFieldGet(this, _MockAccountBuilder_account, "f").options.entropy.id = entropySource;
164
+ }
165
+ return this;
166
+ }
167
+ withGroupIndex(groupIndex) {
168
+ if (isBip44Account(__classPrivateFieldGet(this, _MockAccountBuilder_account, "f"))) {
169
+ __classPrivateFieldGet(this, _MockAccountBuilder_account, "f").options.entropy.groupIndex = groupIndex;
170
+ }
171
+ return this;
172
+ }
173
+ get() {
174
+ return __classPrivateFieldGet(this, _MockAccountBuilder_account, "f");
175
+ }
176
+ }
177
+ _MockAccountBuilder_account = new WeakMap();
178
+ export const MOCK_WALLET_1_ENTROPY_SOURCE = MOCK_ENTROPY_SOURCE_1;
179
+ export const MOCK_WALLET_1_EVM_ACCOUNT = MockAccountBuilder.from(MOCK_HD_ACCOUNT_1)
180
+ .withEntropySource(MOCK_WALLET_1_ENTROPY_SOURCE)
181
+ .withGroupIndex(0)
182
+ .get();
183
+ export const MOCK_WALLET_1_SOL_ACCOUNT = MockAccountBuilder.from(MOCK_SOL_ACCOUNT_1)
184
+ .withEntropySource(MOCK_WALLET_1_ENTROPY_SOURCE)
185
+ .withGroupIndex(0)
186
+ .get();
187
+ export const MOCK_WALLET_1_BTC_P2WPKH_ACCOUNT = MockAccountBuilder.from(MOCK_BTC_P2WPKH_ACCOUNT_1)
188
+ .withEntropySource(MOCK_WALLET_1_ENTROPY_SOURCE)
189
+ .withGroupIndex(0)
190
+ .get();
191
+ export const MOCK_WALLET_1_BTC_P2TR_ACCOUNT = MockAccountBuilder.from(MOCK_BTC_P2TR_ACCOUNT_1)
192
+ .withEntropySource(MOCK_WALLET_1_ENTROPY_SOURCE)
193
+ .withGroupIndex(0)
194
+ .get();
195
+ //# sourceMappingURL=accounts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.mjs","sourceRoot":"","sources":["../../src/tests/accounts.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EACL,cAAc,EACd,SAAS,EACT,QAAQ,EACR,cAAc,EACd,SAAS,EACT,QAAQ,EACR,+BAA+B,EAC/B,cAAc,EACd,SAAS,EACT,QAAQ,EACT,8BAA8B;AAC/B,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,aAAa;AAElC,OAAO,EAAE,cAAc,EAAqB,yBAAe;AAE3D,MAAM,eAAe,GAAG;IACtB,SAAS,CAAC,YAAY;IACtB,SAAS,CAAC,IAAI;IACd,SAAS,CAAC,eAAe;IACzB,SAAS,CAAC,eAAe;IACzB,SAAS,CAAC,eAAe;IACzB,SAAS,CAAC,eAAe;CACjB,CAAC;AAEX,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAE7C,MAAM,CAAC,MAA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AA4B,CAAC;KAC/C,cAAc,CAAC,CAAC,CAAC;KACjB,GAAG,EAAE,CAAC","sourcesContent":["import type { EntropySourceId, KeyringAccount } from '@metamask/keyring-api';\nimport {\n BtcAccountType,\n BtcMethod,\n BtcScope,\n EthAccountType,\n EthMethod,\n EthScope,\n KeyringAccountEntropyTypeOption,\n SolAccountType,\n SolMethod,\n SolScope,\n} from '@metamask/keyring-api';\nimport { v4 as uuid } from 'uuid';\n\nimport { isBip44Account, type Bip44Account } from '../api';\n\nconst ETH_EOA_METHODS = [\n EthMethod.PersonalSign,\n EthMethod.Sign,\n EthMethod.SignTransaction,\n EthMethod.SignTypedDataV1,\n EthMethod.SignTypedDataV3,\n EthMethod.SignTypedDataV4,\n] as const;\n\nconst SOL_METHODS = Object.values(SolMethod);\n\nexport const MOCK_SNAP_1 = {\n id: 'local:mock-snap-id-1',\n name: 'Mock Snap 1',\n enabled: true,\n manifest: {\n proposedName: 'Mock Snap 1',\n },\n};\n\nexport const MOCK_SNAP_2 = {\n id: 'local:mock-snap-id-2',\n name: 'Mock Snap 2',\n enabled: true,\n manifest: {\n proposedName: 'Mock Snap 2',\n },\n};\n\nexport const MOCK_ENTROPY_SOURCE_1 = 'mock-keyring-id-1';\nexport const MOCK_ENTROPY_SOURCE_2 = 'mock-keyring-id-2';\n\nexport const MOCK_HD_ACCOUNT_1: Bip44Account<KeyringAccount> = {\n id: 'mock-id-1',\n address: '0x123',\n options: {\n entropy: {\n type: KeyringAccountEntropyTypeOption.Mnemonic,\n id: MOCK_ENTROPY_SOURCE_1,\n groupIndex: 0,\n derivationPath: '',\n },\n },\n methods: [...ETH_EOA_METHODS],\n type: EthAccountType.Eoa,\n scopes: [EthScope.Eoa],\n};\n\nexport const MOCK_HD_ACCOUNT_2: Bip44Account<KeyringAccount> = {\n id: 'mock-id-2',\n address: '0x456',\n options: {\n entropy: {\n type: KeyringAccountEntropyTypeOption.Mnemonic,\n id: MOCK_ENTROPY_SOURCE_2,\n groupIndex: 0,\n derivationPath: '',\n },\n },\n methods: [...ETH_EOA_METHODS],\n type: EthAccountType.Eoa,\n scopes: [EthScope.Eoa],\n};\n\nexport const MOCK_SOL_ACCOUNT_1: Bip44Account<KeyringAccount> = {\n id: 'mock-snap-id-1',\n address: 'aabbccdd',\n options: {\n entropy: {\n type: KeyringAccountEntropyTypeOption.Mnemonic,\n // NOTE: shares entropy with MOCK_HD_ACCOUNT_2\n id: MOCK_ENTROPY_SOURCE_2,\n groupIndex: 0,\n derivationPath: '',\n },\n },\n methods: SOL_METHODS,\n type: SolAccountType.DataAccount,\n scopes: [SolScope.Mainnet, SolScope.Testnet, SolScope.Devnet],\n};\n\nexport const MOCK_BTC_P2WPKH_ACCOUNT_1: Bip44Account<KeyringAccount> = {\n id: 'b0f030d8-e101-4b5a-a3dd-13f8ca8ec1db',\n type: BtcAccountType.P2wpkh,\n methods: [BtcMethod.SendBitcoin],\n address: 'bc1qx8ls07cy8j8nrluy2u0xwn7gh8fxg0rg4s8zze',\n options: {\n entropy: {\n type: KeyringAccountEntropyTypeOption.Mnemonic,\n // NOTE: shares entropy with MOCK_HD_ACCOUNT_2\n id: MOCK_ENTROPY_SOURCE_2,\n groupIndex: 0,\n derivationPath: '',\n },\n },\n scopes: [BtcScope.Mainnet],\n};\n\nexport const MOCK_BTC_P2TR_ACCOUNT_1: Bip44Account<KeyringAccount> = {\n id: 'a20c2e1a-6ff6-40ba-b8e0-ccdb6f9933bb',\n type: BtcAccountType.P2tr,\n methods: [BtcMethod.SendBitcoin],\n address: 'tb1p5cyxnuxmeuwuvkwfem96lxx9wex9kkf4mt9ll6q60jfsnrzqg4sszkqjnh',\n options: {\n entropy: {\n type: KeyringAccountEntropyTypeOption.Mnemonic,\n // NOTE: shares entropy with MOCK_HD_ACCOUNT_2\n id: MOCK_ENTROPY_SOURCE_2,\n groupIndex: 0,\n derivationPath: '',\n },\n },\n scopes: [BtcScope.Testnet],\n};\n\nexport const MOCK_SNAP_ACCOUNT_1 = MOCK_SOL_ACCOUNT_1;\n\nexport const MOCK_SNAP_ACCOUNT_2: KeyringAccount = {\n id: 'mock-snap-id-2',\n address: '0x789',\n options: {},\n methods: [...ETH_EOA_METHODS],\n type: EthAccountType.Eoa,\n scopes: [EthScope.Eoa],\n};\n\nexport const MOCK_SNAP_ACCOUNT_3 = MOCK_BTC_P2WPKH_ACCOUNT_1;\nexport const MOCK_SNAP_ACCOUNT_4 = MOCK_BTC_P2TR_ACCOUNT_1;\n\nexport const MOCK_HARDWARE_ACCOUNT_1: KeyringAccount = {\n id: 'mock-hardware-id-1',\n address: '0xABC',\n options: {},\n methods: [...ETH_EOA_METHODS],\n type: EthAccountType.Eoa,\n scopes: [EthScope.Eoa],\n};\n\nexport class MockAccountBuilder<Account extends KeyringAccount> {\n readonly #account: Account;\n\n constructor(account: Account) {\n // Make a deep-copy to avoid mutating the same ref.\n this.#account = JSON.parse(JSON.stringify(account));\n }\n\n static from<Account extends KeyringAccount>(\n account: Account,\n ): MockAccountBuilder<Account> {\n return new MockAccountBuilder(account);\n }\n\n withId(id: KeyringAccount['id']): MockAccountBuilder<Account> {\n this.#account.id = id;\n return this;\n }\n\n withUuid(): MockAccountBuilder<Account> {\n this.#account.id = uuid();\n return this;\n }\n\n withAddressSuffix(suffix: string): MockAccountBuilder<Account> {\n this.#account.address += suffix;\n return this;\n }\n\n withEntropySource(\n entropySource: EntropySourceId,\n ): MockAccountBuilder<Account> {\n if (isBip44Account(this.#account)) {\n this.#account.options.entropy.id = entropySource;\n }\n return this;\n }\n\n withGroupIndex(groupIndex: number): MockAccountBuilder<Account> {\n if (isBip44Account(this.#account)) {\n this.#account.options.entropy.groupIndex = groupIndex;\n }\n return this;\n }\n\n get(): Account {\n return this.#account;\n }\n}\n\nexport const MOCK_WALLET_1_ENTROPY_SOURCE = MOCK_ENTROPY_SOURCE_1;\n\nexport const MOCK_WALLET_1_EVM_ACCOUNT = MockAccountBuilder.from(\n MOCK_HD_ACCOUNT_1,\n)\n .withEntropySource(MOCK_WALLET_1_ENTROPY_SOURCE)\n .withGroupIndex(0)\n .get();\nexport const MOCK_WALLET_1_SOL_ACCOUNT = MockAccountBuilder.from(\n MOCK_SOL_ACCOUNT_1,\n)\n .withEntropySource(MOCK_WALLET_1_ENTROPY_SOURCE)\n .withGroupIndex(0)\n .get();\nexport const MOCK_WALLET_1_BTC_P2WPKH_ACCOUNT = MockAccountBuilder.from(\n MOCK_BTC_P2WPKH_ACCOUNT_1,\n)\n .withEntropySource(MOCK_WALLET_1_ENTROPY_SOURCE)\n .withGroupIndex(0)\n .get();\nexport const MOCK_WALLET_1_BTC_P2TR_ACCOUNT = MockAccountBuilder.from(\n MOCK_BTC_P2TR_ACCOUNT_1,\n)\n .withEntropySource(MOCK_WALLET_1_ENTROPY_SOURCE)\n .withGroupIndex(0)\n .get();\n"]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./accounts.cjs"), exports);
18
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/tests/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA2B","sourcesContent":["export * from './accounts';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from "./accounts.cjs";
2
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/tests/index.ts"],"names":[],"mappings":"AAAA,+BAA2B"}
@@ -0,0 +1,2 @@
1
+ export * from "./accounts.mjs";
2
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/tests/index.ts"],"names":[],"mappings":"AAAA,+BAA2B"}
@@ -0,0 +1,2 @@
1
+ export * from "./accounts.mjs";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/tests/index.ts"],"names":[],"mappings":"AAAA,+BAA2B","sourcesContent":["export * from './accounts';\n"]}