@metamask-previews/account-api 0.9.0-a621908 → 0.10.0-8f62d3a

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 (88) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/dist/api/group.cjs +53 -1
  3. package/dist/api/group.cjs.map +1 -1
  4. package/dist/api/group.d.cts +41 -1
  5. package/dist/api/group.d.cts.map +1 -1
  6. package/dist/api/group.d.mts +41 -1
  7. package/dist/api/group.d.mts.map +1 -1
  8. package/dist/api/group.mjs +49 -0
  9. package/dist/api/group.mjs.map +1 -1
  10. package/dist/api/multichain/group.cjs +35 -10
  11. package/dist/api/multichain/group.cjs.map +1 -1
  12. package/dist/api/multichain/group.d.cts +27 -0
  13. package/dist/api/multichain/group.d.cts.map +1 -1
  14. package/dist/api/multichain/group.d.mts +27 -0
  15. package/dist/api/multichain/group.d.mts.map +1 -1
  16. package/dist/api/multichain/group.mjs +32 -9
  17. package/dist/api/multichain/group.mjs.map +1 -1
  18. package/dist/api/multichain/wallet.cjs +34 -0
  19. package/dist/api/multichain/wallet.cjs.map +1 -1
  20. package/dist/api/multichain/wallet.d.cts +27 -0
  21. package/dist/api/multichain/wallet.d.cts.map +1 -1
  22. package/dist/api/multichain/wallet.d.mts +27 -0
  23. package/dist/api/multichain/wallet.d.mts.map +1 -1
  24. package/dist/api/multichain/wallet.mjs +31 -0
  25. package/dist/api/multichain/wallet.mjs.map +1 -1
  26. package/dist/api/provider.cjs.map +1 -1
  27. package/dist/api/provider.d.cts +8 -0
  28. package/dist/api/provider.d.cts.map +1 -1
  29. package/dist/api/provider.d.mts +8 -0
  30. package/dist/api/provider.d.mts.map +1 -1
  31. package/dist/api/provider.mjs.map +1 -1
  32. package/dist/api/wallet.cjs +45 -1
  33. package/dist/api/wallet.cjs.map +1 -1
  34. package/dist/api/wallet.d.cts +35 -0
  35. package/dist/api/wallet.d.cts.map +1 -1
  36. package/dist/api/wallet.d.mts +35 -0
  37. package/dist/api/wallet.d.mts.map +1 -1
  38. package/dist/api/wallet.mjs +41 -0
  39. package/dist/api/wallet.mjs.map +1 -1
  40. package/dist/mocks/accounts.cjs +10 -27
  41. package/dist/mocks/accounts.cjs.map +1 -1
  42. package/dist/mocks/accounts.d.cts +0 -18
  43. package/dist/mocks/accounts.d.cts.map +1 -1
  44. package/dist/mocks/accounts.d.mts +0 -18
  45. package/dist/mocks/accounts.d.mts.map +1 -1
  46. package/dist/mocks/accounts.mjs +3 -20
  47. package/dist/mocks/accounts.mjs.map +1 -1
  48. package/dist/mocks/groups.cjs +9 -0
  49. package/dist/mocks/groups.cjs.map +1 -0
  50. package/dist/mocks/groups.d.cts +5 -0
  51. package/dist/mocks/groups.d.cts.map +1 -0
  52. package/dist/mocks/groups.d.mts +5 -0
  53. package/dist/mocks/groups.d.mts.map +1 -0
  54. package/dist/mocks/groups.mjs +6 -0
  55. package/dist/mocks/groups.mjs.map +1 -0
  56. package/dist/mocks/index.cjs +4 -0
  57. package/dist/mocks/index.cjs.map +1 -1
  58. package/dist/mocks/index.d.cts +4 -0
  59. package/dist/mocks/index.d.cts.map +1 -1
  60. package/dist/mocks/index.d.mts +4 -0
  61. package/dist/mocks/index.d.mts.map +1 -1
  62. package/dist/mocks/index.mjs +4 -0
  63. package/dist/mocks/index.mjs.map +1 -1
  64. package/dist/mocks/keyrings.cjs +7 -0
  65. package/dist/mocks/keyrings.cjs.map +1 -0
  66. package/dist/mocks/keyrings.d.cts +4 -0
  67. package/dist/mocks/keyrings.d.cts.map +1 -0
  68. package/dist/mocks/keyrings.d.mts +4 -0
  69. package/dist/mocks/keyrings.d.mts.map +1 -0
  70. package/dist/mocks/keyrings.mjs +4 -0
  71. package/dist/mocks/keyrings.mjs.map +1 -0
  72. package/dist/mocks/snaps.cjs +20 -0
  73. package/dist/mocks/snaps.cjs.map +1 -0
  74. package/dist/mocks/snaps.d.cts +17 -0
  75. package/dist/mocks/snaps.d.cts.map +1 -0
  76. package/dist/mocks/snaps.d.mts +17 -0
  77. package/dist/mocks/snaps.d.mts.map +1 -0
  78. package/dist/mocks/snaps.mjs +17 -0
  79. package/dist/mocks/snaps.mjs.map +1 -0
  80. package/dist/mocks/wallets.cjs +11 -0
  81. package/dist/mocks/wallets.cjs.map +1 -0
  82. package/dist/mocks/wallets.d.cts +5 -0
  83. package/dist/mocks/wallets.d.cts.map +1 -0
  84. package/dist/mocks/wallets.d.mts +5 -0
  85. package/dist/mocks/wallets.d.mts.map +1 -0
  86. package/dist/mocks/wallets.mjs +8 -0
  87. package/dist/mocks/wallets.mjs.map +1 -0
  88. package/package.json +2 -2
@@ -13,9 +13,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
13
13
  };
14
14
  var _MockAccountBuilder_account;
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.MOCK_WALLET_1_BTC_P2TR_ACCOUNT = exports.MOCK_WALLET_1_BTC_P2WPKH_ACCOUNT = exports.MOCK_WALLET_1_SOL_ACCOUNT = exports.MOCK_WALLET_1_EVM_ACCOUNT = exports.MOCK_WALLET_1_ENTROPY_SOURCE = exports.MockAccountBuilder = exports.MOCK_HARDWARE_ACCOUNT_1 = exports.MOCK_SNAP_ACCOUNT_4 = exports.MOCK_SNAP_ACCOUNT_3 = exports.MOCK_SNAP_ACCOUNT_2 = exports.MOCK_SNAP_ACCOUNT_1 = exports.MOCK_BTC_P2TR_ACCOUNT_1 = exports.MOCK_BTC_P2WPKH_ACCOUNT_1 = exports.MOCK_SOL_ACCOUNT_1 = exports.MOCK_HD_ACCOUNT_2 = exports.MOCK_HD_ACCOUNT_1 = exports.MOCK_ENTROPY_SOURCE_2 = exports.MOCK_ENTROPY_SOURCE_1 = exports.MOCK_SNAP_2 = exports.MOCK_SNAP_1 = void 0;
16
+ exports.MOCK_WALLET_1_BTC_P2TR_ACCOUNT = exports.MOCK_WALLET_1_BTC_P2WPKH_ACCOUNT = exports.MOCK_WALLET_1_SOL_ACCOUNT = exports.MOCK_WALLET_1_EVM_ACCOUNT = exports.MOCK_WALLET_1_ENTROPY_SOURCE = exports.MockAccountBuilder = exports.MOCK_HARDWARE_ACCOUNT_1 = exports.MOCK_SNAP_ACCOUNT_4 = exports.MOCK_SNAP_ACCOUNT_3 = exports.MOCK_SNAP_ACCOUNT_2 = exports.MOCK_SNAP_ACCOUNT_1 = exports.MOCK_BTC_P2TR_ACCOUNT_1 = exports.MOCK_BTC_P2WPKH_ACCOUNT_1 = exports.MOCK_SOL_ACCOUNT_1 = exports.MOCK_HD_ACCOUNT_2 = exports.MOCK_HD_ACCOUNT_1 = void 0;
17
17
  const keyring_api_1 = require("@metamask/keyring-api");
18
18
  const uuid_1 = require("uuid");
19
+ const keyrings_1 = require("./keyrings.cjs");
19
20
  const api_1 = require("../api/index.cjs");
20
21
  const ETH_EOA_METHODS = [
21
22
  keyring_api_1.EthMethod.PersonalSign,
@@ -26,31 +27,13 @@ const ETH_EOA_METHODS = [
26
27
  keyring_api_1.EthMethod.SignTypedDataV4,
27
28
  ];
28
29
  const SOL_METHODS = Object.values(keyring_api_1.SolMethod);
29
- exports.MOCK_SNAP_1 = {
30
- id: 'local:mock-snap-id-1',
31
- name: 'Mock Snap 1',
32
- enabled: true,
33
- manifest: {
34
- proposedName: 'Mock Snap 1',
35
- },
36
- };
37
- exports.MOCK_SNAP_2 = {
38
- id: 'local:mock-snap-id-2',
39
- name: 'Mock Snap 2',
40
- enabled: true,
41
- manifest: {
42
- proposedName: 'Mock Snap 2',
43
- },
44
- };
45
- exports.MOCK_ENTROPY_SOURCE_1 = 'mock-keyring-id-1';
46
- exports.MOCK_ENTROPY_SOURCE_2 = 'mock-keyring-id-2';
47
30
  exports.MOCK_HD_ACCOUNT_1 = {
48
31
  id: 'mock-id-1',
49
32
  address: '0x123',
50
33
  options: {
51
34
  entropy: {
52
35
  type: keyring_api_1.KeyringAccountEntropyTypeOption.Mnemonic,
53
- id: exports.MOCK_ENTROPY_SOURCE_1,
36
+ id: keyrings_1.MOCK_ENTROPY_SOURCE_1,
54
37
  groupIndex: 0,
55
38
  derivationPath: '',
56
39
  },
@@ -65,7 +48,7 @@ exports.MOCK_HD_ACCOUNT_2 = {
65
48
  options: {
66
49
  entropy: {
67
50
  type: keyring_api_1.KeyringAccountEntropyTypeOption.Mnemonic,
68
- id: exports.MOCK_ENTROPY_SOURCE_2,
51
+ id: keyrings_1.MOCK_ENTROPY_SOURCE_2,
69
52
  groupIndex: 0,
70
53
  derivationPath: '',
71
54
  },
@@ -81,7 +64,7 @@ exports.MOCK_SOL_ACCOUNT_1 = {
81
64
  entropy: {
82
65
  type: keyring_api_1.KeyringAccountEntropyTypeOption.Mnemonic,
83
66
  // NOTE: shares entropy with MOCK_HD_ACCOUNT_2
84
- id: exports.MOCK_ENTROPY_SOURCE_2,
67
+ id: keyrings_1.MOCK_ENTROPY_SOURCE_2,
85
68
  groupIndex: 0,
86
69
  derivationPath: '',
87
70
  },
@@ -93,13 +76,13 @@ exports.MOCK_SOL_ACCOUNT_1 = {
93
76
  exports.MOCK_BTC_P2WPKH_ACCOUNT_1 = {
94
77
  id: 'b0f030d8-e101-4b5a-a3dd-13f8ca8ec1db',
95
78
  type: keyring_api_1.BtcAccountType.P2wpkh,
96
- methods: [keyring_api_1.BtcMethod.SendBitcoin],
79
+ methods: Object.values(keyring_api_1.BtcMethod),
97
80
  address: 'bc1qx8ls07cy8j8nrluy2u0xwn7gh8fxg0rg4s8zze',
98
81
  options: {
99
82
  entropy: {
100
83
  type: keyring_api_1.KeyringAccountEntropyTypeOption.Mnemonic,
101
84
  // NOTE: shares entropy with MOCK_HD_ACCOUNT_2
102
- id: exports.MOCK_ENTROPY_SOURCE_2,
85
+ id: keyrings_1.MOCK_ENTROPY_SOURCE_2,
103
86
  groupIndex: 0,
104
87
  derivationPath: '',
105
88
  },
@@ -109,13 +92,13 @@ exports.MOCK_BTC_P2WPKH_ACCOUNT_1 = {
109
92
  exports.MOCK_BTC_P2TR_ACCOUNT_1 = {
110
93
  id: 'a20c2e1a-6ff6-40ba-b8e0-ccdb6f9933bb',
111
94
  type: keyring_api_1.BtcAccountType.P2tr,
112
- methods: [keyring_api_1.BtcMethod.SendBitcoin],
95
+ methods: Object.values(keyring_api_1.BtcMethod),
113
96
  address: 'tb1p5cyxnuxmeuwuvkwfem96lxx9wex9kkf4mt9ll6q60jfsnrzqg4sszkqjnh',
114
97
  options: {
115
98
  entropy: {
116
99
  type: keyring_api_1.KeyringAccountEntropyTypeOption.Mnemonic,
117
100
  // NOTE: shares entropy with MOCK_HD_ACCOUNT_2
118
- id: exports.MOCK_ENTROPY_SOURCE_2,
101
+ id: keyrings_1.MOCK_ENTROPY_SOURCE_2,
119
102
  groupIndex: 0,
120
103
  derivationPath: '',
121
104
  },
@@ -180,7 +163,7 @@ class MockAccountBuilder {
180
163
  }
181
164
  exports.MockAccountBuilder = MockAccountBuilder;
182
165
  _MockAccountBuilder_account = new WeakMap();
183
- exports.MOCK_WALLET_1_ENTROPY_SOURCE = exports.MOCK_ENTROPY_SOURCE_1;
166
+ exports.MOCK_WALLET_1_ENTROPY_SOURCE = keyrings_1.MOCK_ENTROPY_SOURCE_1;
184
167
  exports.MOCK_WALLET_1_EVM_ACCOUNT = MockAccountBuilder.from(exports.MOCK_HD_ACCOUNT_1)
185
168
  .withEntropySource(exports.MOCK_WALLET_1_ENTROPY_SOURCE)
186
169
  .withGroupIndex(0)
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.cjs","sourceRoot":"","sources":["../../src/mocks/accounts.ts"],"names":[],"mappings":";AAAA,uBAAuB;;;;;;;;;;;;;;;AAGvB,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,G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Id, 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"]}
1
+ {"version":3,"file":"accounts.cjs","sourceRoot":"","sources":["../../src/mocks/accounts.ts"],"names":[],"mappings":";AAAA,uBAAuB;;;;;;;;;;;;;;;AAGvB,uDAW+B;AAC/B,+BAAkC;AAElC,6CAA0E;AAC1E,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,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,gCAAqB;YACzB,UAAU,EAAE,CAAC;YACb,cAAc,EAAE,EAAE;SACnB;KACF;IACD,OAAO,EAAE,CAAC,GAAG,eAAe,CAAC;IAC7B,IAAI,EAAE,4BAAc,CAAC,GAAG;IACxB,MAAM,EAAE,CAAC,sBAAQ,CAAC,GAAG,CAAC;CACvB,CAAC;AAEW,QAAA,iBA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/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":["// istanbul ignore file\n\nimport 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 { MOCK_ENTROPY_SOURCE_1, MOCK_ENTROPY_SOURCE_2 } from './keyrings';\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_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: Object.values(BtcMethod),\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: Object.values(BtcMethod),\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"]}
@@ -1,23 +1,5 @@
1
1
  import type { EntropySourceId, KeyringAccount } from "@metamask/keyring-api";
2
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
3
  export declare const MOCK_HD_ACCOUNT_1: Bip44Account<KeyringAccount>;
22
4
  export declare const MOCK_HD_ACCOUNT_2: Bip44Account<KeyringAccount>;
23
5
  export declare const MOCK_SOL_ACCOUNT_1: Bip44Account<KeyringAccount>;
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.d.cts","sourceRoot":"","sources":["../../src/mocks/accounts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAA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
  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
3
  export declare const MOCK_HD_ACCOUNT_1: Bip44Account<KeyringAccount>;
22
4
  export declare const MOCK_HD_ACCOUNT_2: Bip44Account<KeyringAccount>;
23
5
  export declare const MOCK_SOL_ACCOUNT_1: Bip44Account<KeyringAccount>;
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.d.mts","sourceRoot":"","sources":["../../src/mocks/accounts.ts"],"names":[],"mappings":"AAEA,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,EAAE,YAAY,CAAC,cAAc,CAc1D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,cAAc,CAc1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,cAAc,CAe3D,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,YAAY,CAAC,cAAc,CAelE,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,cAAc,CAehE,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;eAxD9B,CAAF;;;;;;;;kBAOqB,CAAC;;;;;E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,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;;;;eAvH1B,CAAC;;;;;;;;kBAOkD,CAAC;;;;;EAqHxD,CAAC;AACT,eAAO,MAAM,yBAAyB;;;;eA7H1B,CAAC;;;;;;;;kBAOkD,CAAC;;;;;EA2HxD,CAAC;AACT,eAAO,MAAM,gCAAgC;;;;eAnIjC,CAAC;;;;;;;;kBAOkD,CAAC;;;;;EAiIxD,CAAC;AACT,eAAO,MAAM,8BAA8B;;;;eAzI/B,CAAC;;;;;;;;kBAOkD,CAAC;;;;;EAuIxD,CAAC"}
@@ -13,6 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
13
13
  var _MockAccountBuilder_account;
14
14
  import { BtcAccountType, BtcMethod, BtcScope, EthAccountType, EthMethod, EthScope, KeyringAccountEntropyTypeOption, SolAccountType, SolMethod, SolScope } from "@metamask/keyring-api";
15
15
  import { v4 as uuid } from "uuid";
16
+ import { MOCK_ENTROPY_SOURCE_1, MOCK_ENTROPY_SOURCE_2 } from "./keyrings.mjs";
16
17
  import { isBip44Account } from "../api/index.mjs";
17
18
  const ETH_EOA_METHODS = [
18
19
  EthMethod.PersonalSign,
@@ -23,24 +24,6 @@ const ETH_EOA_METHODS = [
23
24
  EthMethod.SignTypedDataV4,
24
25
  ];
25
26
  const SOL_METHODS = Object.values(SolMethod);
26
- export const MOCK_SNAP_1 = {
27
- id: 'local:mock-snap-id-1',
28
- name: 'Mock Snap 1',
29
- enabled: true,
30
- manifest: {
31
- proposedName: 'Mock Snap 1',
32
- },
33
- };
34
- export const MOCK_SNAP_2 = {
35
- id: 'local:mock-snap-id-2',
36
- name: 'Mock Snap 2',
37
- enabled: true,
38
- manifest: {
39
- proposedName: 'Mock Snap 2',
40
- },
41
- };
42
- export const MOCK_ENTROPY_SOURCE_1 = 'mock-keyring-id-1';
43
- export const MOCK_ENTROPY_SOURCE_2 = 'mock-keyring-id-2';
44
27
  export const MOCK_HD_ACCOUNT_1 = {
45
28
  id: 'mock-id-1',
46
29
  address: '0x123',
@@ -90,7 +73,7 @@ export const MOCK_SOL_ACCOUNT_1 = {
90
73
  export const MOCK_BTC_P2WPKH_ACCOUNT_1 = {
91
74
  id: 'b0f030d8-e101-4b5a-a3dd-13f8ca8ec1db',
92
75
  type: BtcAccountType.P2wpkh,
93
- methods: [BtcMethod.SendBitcoin],
76
+ methods: Object.values(BtcMethod),
94
77
  address: 'bc1qx8ls07cy8j8nrluy2u0xwn7gh8fxg0rg4s8zze',
95
78
  options: {
96
79
  entropy: {
@@ -106,7 +89,7 @@ export const MOCK_BTC_P2WPKH_ACCOUNT_1 = {
106
89
  export const MOCK_BTC_P2TR_ACCOUNT_1 = {
107
90
  id: 'a20c2e1a-6ff6-40ba-b8e0-ccdb6f9933bb',
108
91
  type: BtcAccountType.P2tr,
109
- methods: [BtcMethod.SendBitcoin],
92
+ methods: Object.values(BtcMethod),
110
93
  address: 'tb1p5cyxnuxmeuwuvkwfem96lxx9wex9kkf4mt9ll6q60jfsnrzqg4sszkqjnh',
111
94
  options: {
112
95
  entropy: {
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.mjs","sourceRoot":"","sources":["../../src/mocks/accounts.ts"],"names":[],"mappings":"AAAA,uBAAuB;;;;;;;;;;;;;AAGvB,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,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,GAAG,kBAAkB,CAAC,IAAI,CACrE,yBAAyB,CAC1B;KACE,iBAAiB,CAAC,4BAA4B,CAAC;KAC/C,cAAc,CAAC,CAAC,CAAC;KACjB,GAAG,EAAE,CAAC;AACT,MAAM,CAAC,MAAM,8BAA8B,GAAG,kBAAkB,CAAC,IAAI,CACnE,uBAAuB,CACxB;KACE,iBAAiB,CAAC,4BAA4B,CAAC;KAC/C,cAAc,CAAC,CAAC,CAAC;KACjB,GAAG,EAAE,CAAC","sourcesContent":["// istanbul ignore file\n\nimport 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"]}
1
+ {"version":3,"file":"accounts.mjs","sourceRoot":"","sources":["../../src/mocks/accounts.ts"],"names":[],"mappings":"AAAA,uBAAuB;;;;;;;;;;;;;AAGvB,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,qBAAqB,EAAE,qBAAqB,EAAE,uBAAmB;AAC1E,OAAO,EAAE,cAAc,EAAqB,yBAAe;AAE3D,MAAM,eAAe,GAAG;IACtB,SAAS,CAAC,YAAY;IACtB,SAAS,CAAC,IAAI;IACd,SAA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ACnD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,cAAc,CAAC,UAAkB;QAC/B,IAAI,cAAc,CAAC,uBAAA,IAAI,mCAAS,CAAC,EAAE,CAAC;YAClC,uBAAA,IAAI,mCAAS,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC;QACxD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,GAAG;QACD,OAAO,uBAAA,IAAI,mCAAS,CAAC;IACvB,CAAC;CACF;;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,qBAAqB,CAAC;AAElE,MAAM,CAAC,MAAM,yBAAyB,GAAG,kBAAkB,CAAC,IAAI,CAC9D,iBAAiB,CAClB;KACE,iBAAiB,CAAC,4BAA4B,CAAC;KAC/C,cAAc,CAAC,CAAC,CAAC;KACjB,GAAG,EAAE,CAAC;AACT,MAAM,CAAC,MAAM,yBAAyB,GAAG,kBAAkB,CAAC,IAAI,CAC9D,kBAAkB,CACnB;KACE,iBAAiB,CAAC,4BAA4B,CAAC;KAC/C,cAAc,CAAC,CAAC,CAAC;KACjB,GAAG,EAAE,CAAC;AACT,MAAM,CAAC,MAAM,gCAAgC,GAAG,kBAAkB,CAAC,IAAI,CACrE,yBAAyB,CAC1B;KACE,iBAAiB,CAAC,4BAA4B,CAAC;KAC/C,cAAc,CAAC,CAAC,CAAC;KACjB,GAAG,EAAE,CAAC;AACT,MAAM,CAAC,MAAM,8BAA8B,GAAG,kBAAkB,CAAC,IAAI,CACnE,uBAAuB,CACxB;KACE,iBAAiB,CAAC,4BAA4B,CAAC;KAC/C,cAAc,CAAC,CAAC,CAAC;KACjB,GAAG,EAAE,CAAC","sourcesContent":["// istanbul ignore file\n\nimport 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 { MOCK_ENTROPY_SOURCE_1, MOCK_ENTROPY_SOURCE_2 } from './keyrings';\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_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: Object.values(BtcMethod),\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: Object.values(BtcMethod),\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,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MOCK_KEYRING_GROUP_ID = exports.MOCK_SNAP_NPM_GROUP_ID = exports.MOCK_SNAP_LOCAL_GROUP_ID = exports.MOCK_ENTROPY_GROUP_ID = void 0;
4
+ const wallets_1 = require("./wallets.cjs");
5
+ exports.MOCK_ENTROPY_GROUP_ID = `${wallets_1.MOCK_ENTROPY_WALLET_ID}/0`;
6
+ exports.MOCK_SNAP_LOCAL_GROUP_ID = `${wallets_1.MOCK_SNAP_LOCAL_WALLET_ID}/0x123`;
7
+ exports.MOCK_SNAP_NPM_GROUP_ID = `${wallets_1.MOCK_SNAP_NPM_WALLET_ID}/0x456`;
8
+ exports.MOCK_KEYRING_GROUP_ID = `${wallets_1.MOCK_KEYRING_WALLET_ID}/0x789`;
9
+ //# sourceMappingURL=groups.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groups.cjs","sourceRoot":"","sources":["../../src/mocks/groups.ts"],"names":[],"mappings":";;;AAAA,2CAKmB;AAEN,QAAA,qBAAqB,GAAG,GAAG,gCAAsB,IAAI,CAAC;AACtD,QAAA,wBAAwB,GAAG,GAAG,mCAAyB,QAAQ,CAAC;AAChE,QAAA,sBAAsB,GAAG,GAAG,iCAAuB,QAAQ,CAAC;AAC5D,QAAA,qBAAqB,GAAG,GAAG,gCAAsB,QAAQ,CAAC","sourcesContent":["import {\n MOCK_ENTROPY_WALLET_ID,\n MOCK_KEYRING_WALLET_ID,\n MOCK_SNAP_LOCAL_WALLET_ID,\n MOCK_SNAP_NPM_WALLET_ID,\n} from './wallets';\n\nexport const MOCK_ENTROPY_GROUP_ID = `${MOCK_ENTROPY_WALLET_ID}/0`;\nexport const MOCK_SNAP_LOCAL_GROUP_ID = `${MOCK_SNAP_LOCAL_WALLET_ID}/0x123`;\nexport const MOCK_SNAP_NPM_GROUP_ID = `${MOCK_SNAP_NPM_WALLET_ID}/0x456`;\nexport const MOCK_KEYRING_GROUP_ID = `${MOCK_KEYRING_WALLET_ID}/0x789`;\n"]}
@@ -0,0 +1,5 @@
1
+ export declare const MOCK_ENTROPY_GROUP_ID = "entropy:mock-keyring-id-1/0";
2
+ export declare const MOCK_SNAP_LOCAL_GROUP_ID: string;
3
+ export declare const MOCK_SNAP_NPM_GROUP_ID: string;
4
+ export declare const MOCK_KEYRING_GROUP_ID = "keyring:Simple Key Pair/0x789";
5
+ //# sourceMappingURL=groups.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groups.d.cts","sourceRoot":"","sources":["../../src/mocks/groups.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,qBAAqB,gCAAgC,CAAC;AACnE,eAAO,MAAM,wBAAwB,QAAuC,CAAC;AAC7E,eAAO,MAAM,sBAAsB,QAAqC,CAAC;AACzE,eAAO,MAAM,qBAAqB,kCAAoC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const MOCK_ENTROPY_GROUP_ID = "entropy:mock-keyring-id-1/0";
2
+ export declare const MOCK_SNAP_LOCAL_GROUP_ID: string;
3
+ export declare const MOCK_SNAP_NPM_GROUP_ID: string;
4
+ export declare const MOCK_KEYRING_GROUP_ID = "keyring:Simple Key Pair/0x789";
5
+ //# sourceMappingURL=groups.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groups.d.mts","sourceRoot":"","sources":["../../src/mocks/groups.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,qBAAqB,gCAAgC,CAAC;AACnE,eAAO,MAAM,wBAAwB,QAAuC,CAAC;AAC7E,eAAO,MAAM,sBAAsB,QAAqC,CAAC;AACzE,eAAO,MAAM,qBAAqB,kCAAoC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { MOCK_ENTROPY_WALLET_ID, MOCK_KEYRING_WALLET_ID, MOCK_SNAP_LOCAL_WALLET_ID, MOCK_SNAP_NPM_WALLET_ID } from "./wallets.mjs";
2
+ export const MOCK_ENTROPY_GROUP_ID = `${MOCK_ENTROPY_WALLET_ID}/0`;
3
+ export const MOCK_SNAP_LOCAL_GROUP_ID = `${MOCK_SNAP_LOCAL_WALLET_ID}/0x123`;
4
+ export const MOCK_SNAP_NPM_GROUP_ID = `${MOCK_SNAP_NPM_WALLET_ID}/0x456`;
5
+ export const MOCK_KEYRING_GROUP_ID = `${MOCK_KEYRING_WALLET_ID}/0x789`;
6
+ //# sourceMappingURL=groups.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groups.mjs","sourceRoot":"","sources":["../../src/mocks/groups.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACxB,sBAAkB;AAEnB,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,sBAAsB,IAAI,CAAC;AACnE,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,yBAAyB,QAAQ,CAAC;AAC7E,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,uBAAuB,QAAQ,CAAC;AACzE,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,sBAAsB,QAAQ,CAAC","sourcesContent":["import {\n MOCK_ENTROPY_WALLET_ID,\n MOCK_KEYRING_WALLET_ID,\n MOCK_SNAP_LOCAL_WALLET_ID,\n MOCK_SNAP_NPM_WALLET_ID,\n} from './wallets';\n\nexport const MOCK_ENTROPY_GROUP_ID = `${MOCK_ENTROPY_WALLET_ID}/0`;\nexport const MOCK_SNAP_LOCAL_GROUP_ID = `${MOCK_SNAP_LOCAL_WALLET_ID}/0x123`;\nexport const MOCK_SNAP_NPM_GROUP_ID = `${MOCK_SNAP_NPM_WALLET_ID}/0x456`;\nexport const MOCK_KEYRING_GROUP_ID = `${MOCK_KEYRING_WALLET_ID}/0x789`;\n"]}
@@ -15,4 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./accounts.cjs"), exports);
18
+ __exportStar(require("./keyrings.cjs"), exports);
19
+ __exportStar(require("./groups.cjs"), exports);
20
+ __exportStar(require("./wallets.cjs"), exports);
21
+ __exportStar(require("./snaps.cjs"), exports);
18
22
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA2B","sourcesContent":["export * from './accounts';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA2B;AAC3B,iDAA2B;AAC3B,+CAAyB;AACzB,gDAA0B;AAC1B,8CAAwB","sourcesContent":["export * from './accounts';\nexport * from './keyrings';\nexport * from './groups';\nexport * from './wallets';\nexport * from './snaps';\n"]}
@@ -1,2 +1,6 @@
1
1
  export * from "./accounts.cjs";
2
+ export * from "./keyrings.cjs";
3
+ export * from "./groups.cjs";
4
+ export * from "./wallets.cjs";
5
+ export * from "./snaps.cjs";
2
6
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,+BAA2B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,+BAA2B;AAC3B,+BAA2B;AAC3B,6BAAyB;AACzB,8BAA0B;AAC1B,4BAAwB"}
@@ -1,2 +1,6 @@
1
1
  export * from "./accounts.mjs";
2
+ export * from "./keyrings.mjs";
3
+ export * from "./groups.mjs";
4
+ export * from "./wallets.mjs";
5
+ export * from "./snaps.mjs";
2
6
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,+BAA2B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,+BAA2B;AAC3B,+BAA2B;AAC3B,6BAAyB;AACzB,8BAA0B;AAC1B,4BAAwB"}
@@ -1,2 +1,6 @@
1
1
  export * from "./accounts.mjs";
2
+ export * from "./keyrings.mjs";
3
+ export * from "./groups.mjs";
4
+ export * from "./wallets.mjs";
5
+ export * from "./snaps.mjs";
2
6
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,+BAA2B","sourcesContent":["export * from './accounts';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,+BAA2B;AAC3B,+BAA2B;AAC3B,6BAAyB;AACzB,8BAA0B;AAC1B,4BAAwB","sourcesContent":["export * from './accounts';\nexport * from './keyrings';\nexport * from './groups';\nexport * from './wallets';\nexport * from './snaps';\n"]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MOCK_PRIVATE_KEY_KEYRING_TYPE = exports.MOCK_ENTROPY_SOURCE_2 = exports.MOCK_ENTROPY_SOURCE_1 = void 0;
4
+ exports.MOCK_ENTROPY_SOURCE_1 = 'mock-keyring-id-1';
5
+ exports.MOCK_ENTROPY_SOURCE_2 = 'mock-keyring-id-2';
6
+ exports.MOCK_PRIVATE_KEY_KEYRING_TYPE = 'Simple Key Pair';
7
+ //# sourceMappingURL=keyrings.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyrings.cjs","sourceRoot":"","sources":["../../src/mocks/keyrings.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,mBAAmB,CAAC;AAC5C,QAAA,qBAAqB,GAAG,mBAAmB,CAAC;AAE5C,QAAA,6BAA6B,GAAG,iBAAiB,CAAC","sourcesContent":["export const MOCK_ENTROPY_SOURCE_1 = 'mock-keyring-id-1';\nexport const MOCK_ENTROPY_SOURCE_2 = 'mock-keyring-id-2';\n\nexport const MOCK_PRIVATE_KEY_KEYRING_TYPE = 'Simple Key Pair';\n"]}
@@ -0,0 +1,4 @@
1
+ export declare const MOCK_ENTROPY_SOURCE_1 = "mock-keyring-id-1";
2
+ export declare const MOCK_ENTROPY_SOURCE_2 = "mock-keyring-id-2";
3
+ export declare const MOCK_PRIVATE_KEY_KEYRING_TYPE = "Simple Key Pair";
4
+ //# sourceMappingURL=keyrings.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyrings.d.cts","sourceRoot":"","sources":["../../src/mocks/keyrings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AAEzD,eAAO,MAAM,6BAA6B,oBAAoB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const MOCK_ENTROPY_SOURCE_1 = "mock-keyring-id-1";
2
+ export declare const MOCK_ENTROPY_SOURCE_2 = "mock-keyring-id-2";
3
+ export declare const MOCK_PRIVATE_KEY_KEYRING_TYPE = "Simple Key Pair";
4
+ //# sourceMappingURL=keyrings.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyrings.d.mts","sourceRoot":"","sources":["../../src/mocks/keyrings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AAEzD,eAAO,MAAM,6BAA6B,oBAAoB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export const MOCK_ENTROPY_SOURCE_1 = 'mock-keyring-id-1';
2
+ export const MOCK_ENTROPY_SOURCE_2 = 'mock-keyring-id-2';
3
+ export const MOCK_PRIVATE_KEY_KEYRING_TYPE = 'Simple Key Pair';
4
+ //# sourceMappingURL=keyrings.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyrings.mjs","sourceRoot":"","sources":["../../src/mocks/keyrings.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AACzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAEzD,MAAM,CAAC,MAAM,6BAA6B,GAAG,iBAAiB,CAAC","sourcesContent":["export const MOCK_ENTROPY_SOURCE_1 = 'mock-keyring-id-1';\nexport const MOCK_ENTROPY_SOURCE_2 = 'mock-keyring-id-2';\n\nexport const MOCK_PRIVATE_KEY_KEYRING_TYPE = 'Simple Key Pair';\n"]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MOCK_SNAP_2 = exports.MOCK_SNAP_1 = void 0;
4
+ exports.MOCK_SNAP_1 = {
5
+ id: 'local:mock-snap-id-1',
6
+ name: 'Mock Snap 1',
7
+ enabled: true,
8
+ manifest: {
9
+ proposedName: 'Mock Snap 1',
10
+ },
11
+ };
12
+ exports.MOCK_SNAP_2 = {
13
+ id: 'npm:@metamask/mock-snap-id-2',
14
+ name: 'Mock Snap 2',
15
+ enabled: true,
16
+ manifest: {
17
+ proposedName: 'Mock Snap 2',
18
+ },
19
+ };
20
+ //# sourceMappingURL=snaps.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snaps.cjs","sourceRoot":"","sources":["../../src/mocks/snaps.ts"],"names":[],"mappings":";;;AAAa,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,8BAA8B;IAClC,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE;QACR,YAAY,EAAE,aAAa;KAC5B;CACF,CAAC","sourcesContent":["export 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: 'npm:@metamask/mock-snap-id-2',\n name: 'Mock Snap 2',\n enabled: true,\n manifest: {\n proposedName: 'Mock Snap 2',\n },\n};\n"]}
@@ -0,0 +1,17 @@
1
+ export declare const MOCK_SNAP_1: {
2
+ id: string;
3
+ name: string;
4
+ enabled: boolean;
5
+ manifest: {
6
+ proposedName: string;
7
+ };
8
+ };
9
+ export declare const MOCK_SNAP_2: {
10
+ id: string;
11
+ name: string;
12
+ enabled: boolean;
13
+ manifest: {
14
+ proposedName: string;
15
+ };
16
+ };
17
+ //# sourceMappingURL=snaps.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snaps.d.cts","sourceRoot":"","sources":["../../src/mocks/snaps.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;;CAOvB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;CAOvB,CAAC"}
@@ -0,0 +1,17 @@
1
+ export declare const MOCK_SNAP_1: {
2
+ id: string;
3
+ name: string;
4
+ enabled: boolean;
5
+ manifest: {
6
+ proposedName: string;
7
+ };
8
+ };
9
+ export declare const MOCK_SNAP_2: {
10
+ id: string;
11
+ name: string;
12
+ enabled: boolean;
13
+ manifest: {
14
+ proposedName: string;
15
+ };
16
+ };
17
+ //# sourceMappingURL=snaps.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snaps.d.mts","sourceRoot":"","sources":["../../src/mocks/snaps.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;;CAOvB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;CAOvB,CAAC"}
@@ -0,0 +1,17 @@
1
+ export const MOCK_SNAP_1 = {
2
+ id: 'local:mock-snap-id-1',
3
+ name: 'Mock Snap 1',
4
+ enabled: true,
5
+ manifest: {
6
+ proposedName: 'Mock Snap 1',
7
+ },
8
+ };
9
+ export const MOCK_SNAP_2 = {
10
+ id: 'npm:@metamask/mock-snap-id-2',
11
+ name: 'Mock Snap 2',
12
+ enabled: true,
13
+ manifest: {
14
+ proposedName: 'Mock Snap 2',
15
+ },
16
+ };
17
+ //# sourceMappingURL=snaps.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snaps.mjs","sourceRoot":"","sources":["../../src/mocks/snaps.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,EAAE,EAAE,sBAAsB;IAC1B,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE;QACR,YAAY,EAAE,aAAa;KAC5B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,EAAE,EAAE,8BAA8B;IAClC,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE;QACR,YAAY,EAAE,aAAa;KAC5B;CACF,CAAC","sourcesContent":["export 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: 'npm:@metamask/mock-snap-id-2',\n name: 'Mock Snap 2',\n enabled: true,\n manifest: {\n proposedName: 'Mock Snap 2',\n },\n};\n"]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MOCK_KEYRING_WALLET_ID = exports.MOCK_SNAP_NPM_WALLET_ID = exports.MOCK_SNAP_LOCAL_WALLET_ID = exports.MOCK_ENTROPY_WALLET_ID = void 0;
4
+ const keyrings_1 = require("./keyrings.cjs");
5
+ const snaps_1 = require("./snaps.cjs");
6
+ const api_1 = require("../api/index.cjs");
7
+ exports.MOCK_ENTROPY_WALLET_ID = `${api_1.AccountWalletType.Entropy}:${keyrings_1.MOCK_ENTROPY_SOURCE_1}`;
8
+ exports.MOCK_SNAP_LOCAL_WALLET_ID = `${api_1.AccountWalletType.Snap}:${snaps_1.MOCK_SNAP_1.id}`;
9
+ exports.MOCK_SNAP_NPM_WALLET_ID = `${api_1.AccountWalletType.Snap}:${snaps_1.MOCK_SNAP_2.id}`;
10
+ exports.MOCK_KEYRING_WALLET_ID = `${api_1.AccountWalletType.Keyring}:${keyrings_1.MOCK_PRIVATE_KEY_KEYRING_TYPE}`;
11
+ //# sourceMappingURL=wallets.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallets.cjs","sourceRoot":"","sources":["../../src/mocks/wallets.ts"],"names":[],"mappings":";;;AAAA,6CAGoB;AACpB,uCAAmD;AACnD,0CAA2C;AAE9B,QAAA,sBAAsB,GAAG,GAAG,uBAAiB,CAAC,OAAO,IAAI,gCAAqB,EAAE,CAAC;AACjF,QAAA,yBAAyB,GAAG,GAAG,uBAAiB,CAAC,IAAI,IAAI,mBAAW,CAAC,EAAE,EAAE,CAAC;AAC1E,QAAA,uBAAuB,GAAG,GAAG,uBAAiB,CAAC,IAAI,IAAI,mBAAW,CAAC,EAAE,EAAE,CAAC;AACxE,QAAA,sBAAsB,GAAG,GAAG,uBAAiB,CAAC,OAAO,IAAI,wCAA6B,EAAE,CAAC","sourcesContent":["import {\n MOCK_ENTROPY_SOURCE_1,\n MOCK_PRIVATE_KEY_KEYRING_TYPE,\n} from './keyrings';\nimport { MOCK_SNAP_1, MOCK_SNAP_2 } from './snaps';\nimport { AccountWalletType } from '../api';\n\nexport const MOCK_ENTROPY_WALLET_ID = `${AccountWalletType.Entropy}:${MOCK_ENTROPY_SOURCE_1}`;\nexport const MOCK_SNAP_LOCAL_WALLET_ID = `${AccountWalletType.Snap}:${MOCK_SNAP_1.id}`;\nexport const MOCK_SNAP_NPM_WALLET_ID = `${AccountWalletType.Snap}:${MOCK_SNAP_2.id}`;\nexport const MOCK_KEYRING_WALLET_ID = `${AccountWalletType.Keyring}:${MOCK_PRIVATE_KEY_KEYRING_TYPE}`;\n"]}
@@ -0,0 +1,5 @@
1
+ export declare const MOCK_ENTROPY_WALLET_ID = "entropy:mock-keyring-id-1";
2
+ export declare const MOCK_SNAP_LOCAL_WALLET_ID: string;
3
+ export declare const MOCK_SNAP_NPM_WALLET_ID: string;
4
+ export declare const MOCK_KEYRING_WALLET_ID = "keyring:Simple Key Pair";
5
+ //# sourceMappingURL=wallets.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallets.d.cts","sourceRoot":"","sources":["../../src/mocks/wallets.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,sBAAsB,8BAA0D,CAAC;AAC9F,eAAO,MAAM,yBAAyB,QAAgD,CAAC;AACvF,eAAO,MAAM,uBAAuB,QAAgD,CAAC;AACrF,eAAO,MAAM,sBAAsB,4BAAkE,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const MOCK_ENTROPY_WALLET_ID = "entropy:mock-keyring-id-1";
2
+ export declare const MOCK_SNAP_LOCAL_WALLET_ID: string;
3
+ export declare const MOCK_SNAP_NPM_WALLET_ID: string;
4
+ export declare const MOCK_KEYRING_WALLET_ID = "keyring:Simple Key Pair";
5
+ //# sourceMappingURL=wallets.d.mts.map