@metamask/assets-controllers 47.0.0 → 49.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/CHANGELOG.md +40 -1
  2. package/dist/AccountTrackerController.cjs.map +1 -1
  3. package/dist/AccountTrackerController.d.cts +8 -3
  4. package/dist/AccountTrackerController.d.cts.map +1 -1
  5. package/dist/AccountTrackerController.d.mts +8 -3
  6. package/dist/AccountTrackerController.d.mts.map +1 -1
  7. package/dist/AccountTrackerController.mjs.map +1 -1
  8. package/dist/AssetsContractController.cjs +3 -3
  9. package/dist/AssetsContractController.cjs.map +1 -1
  10. package/dist/AssetsContractController.d.cts +3 -3
  11. package/dist/AssetsContractController.d.cts.map +1 -1
  12. package/dist/AssetsContractController.d.mts +3 -3
  13. package/dist/AssetsContractController.d.mts.map +1 -1
  14. package/dist/AssetsContractController.mjs +3 -3
  15. package/dist/AssetsContractController.mjs.map +1 -1
  16. package/dist/CurrencyRateController.cjs.map +1 -1
  17. package/dist/CurrencyRateController.d.cts +2 -2
  18. package/dist/CurrencyRateController.d.cts.map +1 -1
  19. package/dist/CurrencyRateController.d.mts +2 -2
  20. package/dist/CurrencyRateController.d.mts.map +1 -1
  21. package/dist/CurrencyRateController.mjs.map +1 -1
  22. package/dist/MultichainAssetsController/MultichainAssetsController.cjs +324 -0
  23. package/dist/MultichainAssetsController/MultichainAssetsController.cjs.map +1 -0
  24. package/dist/MultichainAssetsController/MultichainAssetsController.d.cts +66 -0
  25. package/dist/MultichainAssetsController/MultichainAssetsController.d.cts.map +1 -0
  26. package/dist/MultichainAssetsController/MultichainAssetsController.d.mts +66 -0
  27. package/dist/MultichainAssetsController/MultichainAssetsController.d.mts.map +1 -0
  28. package/dist/MultichainAssetsController/MultichainAssetsController.mjs +319 -0
  29. package/dist/MultichainAssetsController/MultichainAssetsController.mjs.map +1 -0
  30. package/dist/MultichainAssetsController/index.cjs +7 -0
  31. package/dist/MultichainAssetsController/index.cjs.map +1 -0
  32. package/dist/MultichainAssetsController/index.d.cts +3 -0
  33. package/dist/MultichainAssetsController/index.d.cts.map +1 -0
  34. package/dist/MultichainAssetsController/index.d.mts +3 -0
  35. package/dist/MultichainAssetsController/index.d.mts.map +1 -0
  36. package/dist/MultichainAssetsController/index.mjs +2 -0
  37. package/dist/MultichainAssetsController/index.mjs.map +1 -0
  38. package/dist/MultichainAssetsController/utils.cjs +26 -0
  39. package/dist/MultichainAssetsController/utils.cjs.map +1 -0
  40. package/dist/MultichainAssetsController/utils.d.cts +13 -0
  41. package/dist/MultichainAssetsController/utils.d.cts.map +1 -0
  42. package/dist/MultichainAssetsController/utils.d.mts +13 -0
  43. package/dist/MultichainAssetsController/utils.d.mts.map +1 -0
  44. package/dist/MultichainAssetsController/utils.mjs +22 -0
  45. package/dist/MultichainAssetsController/utils.mjs.map +1 -0
  46. package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.cjs +205 -0
  47. package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.cjs.map +1 -0
  48. package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.d.cts +124 -0
  49. package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.d.cts.map +1 -0
  50. package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.d.mts +124 -0
  51. package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.d.mts.map +1 -0
  52. package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.mjs +200 -0
  53. package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.mjs.map +1 -0
  54. package/dist/MultichainAssetsRatesController/constant.cjs +83 -0
  55. package/dist/MultichainAssetsRatesController/constant.cjs.map +1 -0
  56. package/dist/MultichainAssetsRatesController/constant.d.cts +9 -0
  57. package/dist/MultichainAssetsRatesController/constant.d.cts.map +1 -0
  58. package/dist/MultichainAssetsRatesController/constant.d.mts +9 -0
  59. package/dist/MultichainAssetsRatesController/constant.d.mts.map +1 -0
  60. package/dist/MultichainAssetsRatesController/constant.mjs +80 -0
  61. package/dist/MultichainAssetsRatesController/constant.mjs.map +1 -0
  62. package/dist/MultichainAssetsRatesController/index.cjs +7 -0
  63. package/dist/MultichainAssetsRatesController/index.cjs.map +1 -0
  64. package/dist/MultichainAssetsRatesController/index.d.cts +3 -0
  65. package/dist/MultichainAssetsRatesController/index.d.cts.map +1 -0
  66. package/dist/MultichainAssetsRatesController/index.d.mts +3 -0
  67. package/dist/MultichainAssetsRatesController/index.d.mts.map +1 -0
  68. package/dist/MultichainAssetsRatesController/index.mjs +2 -0
  69. package/dist/MultichainAssetsRatesController/index.mjs.map +1 -0
  70. package/dist/MultichainBalancesController/MultichainBalancesController.cjs +52 -78
  71. package/dist/MultichainBalancesController/MultichainBalancesController.cjs.map +1 -1
  72. package/dist/MultichainBalancesController/MultichainBalancesController.d.cts +7 -26
  73. package/dist/MultichainBalancesController/MultichainBalancesController.d.cts.map +1 -1
  74. package/dist/MultichainBalancesController/MultichainBalancesController.d.mts +7 -26
  75. package/dist/MultichainBalancesController/MultichainBalancesController.d.mts.map +1 -1
  76. package/dist/MultichainBalancesController/MultichainBalancesController.mjs +52 -78
  77. package/dist/MultichainBalancesController/MultichainBalancesController.mjs.map +1 -1
  78. package/dist/MultichainBalancesController/index.cjs +1 -8
  79. package/dist/MultichainBalancesController/index.cjs.map +1 -1
  80. package/dist/MultichainBalancesController/index.d.cts +1 -3
  81. package/dist/MultichainBalancesController/index.d.cts.map +1 -1
  82. package/dist/MultichainBalancesController/index.d.mts +1 -3
  83. package/dist/MultichainBalancesController/index.d.mts.map +1 -1
  84. package/dist/MultichainBalancesController/index.mjs +0 -2
  85. package/dist/MultichainBalancesController/index.mjs.map +1 -1
  86. package/dist/NftController.cjs +1 -1
  87. package/dist/NftController.cjs.map +1 -1
  88. package/dist/NftController.d.cts +3 -3
  89. package/dist/NftController.d.cts.map +1 -1
  90. package/dist/NftController.d.mts +3 -3
  91. package/dist/NftController.d.mts.map +1 -1
  92. package/dist/NftController.mjs +1 -1
  93. package/dist/NftController.mjs.map +1 -1
  94. package/dist/NftDetectionController.cjs.map +1 -1
  95. package/dist/NftDetectionController.d.cts +2 -2
  96. package/dist/NftDetectionController.d.cts.map +1 -1
  97. package/dist/NftDetectionController.d.mts +2 -2
  98. package/dist/NftDetectionController.d.mts.map +1 -1
  99. package/dist/NftDetectionController.mjs.map +1 -1
  100. package/dist/RatesController/types.cjs.map +1 -1
  101. package/dist/RatesController/types.d.cts +2 -2
  102. package/dist/RatesController/types.d.cts.map +1 -1
  103. package/dist/RatesController/types.d.mts +2 -2
  104. package/dist/RatesController/types.d.mts.map +1 -1
  105. package/dist/RatesController/types.mjs.map +1 -1
  106. package/dist/TokenBalancesController.cjs.map +1 -1
  107. package/dist/TokenBalancesController.d.cts +6 -4
  108. package/dist/TokenBalancesController.d.cts.map +1 -1
  109. package/dist/TokenBalancesController.d.mts +6 -4
  110. package/dist/TokenBalancesController.d.mts.map +1 -1
  111. package/dist/TokenBalancesController.mjs.map +1 -1
  112. package/dist/TokenDetectionController.cjs +1 -1
  113. package/dist/TokenDetectionController.cjs.map +1 -1
  114. package/dist/TokenDetectionController.d.cts +2 -2
  115. package/dist/TokenDetectionController.d.cts.map +1 -1
  116. package/dist/TokenDetectionController.d.mts +2 -2
  117. package/dist/TokenDetectionController.d.mts.map +1 -1
  118. package/dist/TokenDetectionController.mjs +1 -1
  119. package/dist/TokenDetectionController.mjs.map +1 -1
  120. package/dist/TokenListController.cjs +1 -1
  121. package/dist/TokenListController.cjs.map +1 -1
  122. package/dist/TokenListController.d.cts +3 -3
  123. package/dist/TokenListController.d.cts.map +1 -1
  124. package/dist/TokenListController.d.mts +3 -3
  125. package/dist/TokenListController.d.mts.map +1 -1
  126. package/dist/TokenListController.mjs +1 -1
  127. package/dist/TokenListController.mjs.map +1 -1
  128. package/dist/TokenRatesController.cjs +1 -1
  129. package/dist/TokenRatesController.cjs.map +1 -1
  130. package/dist/TokenRatesController.d.cts +3 -3
  131. package/dist/TokenRatesController.d.cts.map +1 -1
  132. package/dist/TokenRatesController.d.mts +3 -3
  133. package/dist/TokenRatesController.d.mts.map +1 -1
  134. package/dist/TokenRatesController.mjs +1 -1
  135. package/dist/TokenRatesController.mjs.map +1 -1
  136. package/dist/TokensController.cjs +9 -6
  137. package/dist/TokensController.cjs.map +1 -1
  138. package/dist/TokensController.d.cts +3 -3
  139. package/dist/TokensController.d.cts.map +1 -1
  140. package/dist/TokensController.d.mts +3 -3
  141. package/dist/TokensController.d.mts.map +1 -1
  142. package/dist/TokensController.mjs +9 -6
  143. package/dist/TokensController.mjs.map +1 -1
  144. package/dist/index.cjs +7 -7
  145. package/dist/index.cjs.map +1 -1
  146. package/dist/index.d.cts +6 -2
  147. package/dist/index.d.cts.map +1 -1
  148. package/dist/index.d.mts +6 -2
  149. package/dist/index.d.mts.map +1 -1
  150. package/dist/index.mjs +3 -3
  151. package/dist/index.mjs.map +1 -1
  152. package/dist/token-prices-service/codefi-v2.d.cts +1 -1
  153. package/dist/token-prices-service/codefi-v2.d.mts +1 -1
  154. package/package.json +18 -15
  155. package/dist/MultichainBalancesController/BalancesTracker.cjs +0 -122
  156. package/dist/MultichainBalancesController/BalancesTracker.cjs.map +0 -1
  157. package/dist/MultichainBalancesController/BalancesTracker.d.cts +0 -54
  158. package/dist/MultichainBalancesController/BalancesTracker.d.cts.map +0 -1
  159. package/dist/MultichainBalancesController/BalancesTracker.d.mts +0 -54
  160. package/dist/MultichainBalancesController/BalancesTracker.d.mts.map +0 -1
  161. package/dist/MultichainBalancesController/BalancesTracker.mjs +0 -118
  162. package/dist/MultichainBalancesController/BalancesTracker.mjs.map +0 -1
  163. package/dist/MultichainBalancesController/Poller.cjs +0 -45
  164. package/dist/MultichainBalancesController/Poller.cjs.map +0 -1
  165. package/dist/MultichainBalancesController/Poller.d.cts +0 -7
  166. package/dist/MultichainBalancesController/Poller.d.cts.map +0 -1
  167. package/dist/MultichainBalancesController/Poller.d.mts +0 -7
  168. package/dist/MultichainBalancesController/Poller.d.mts.map +0 -1
  169. package/dist/MultichainBalancesController/Poller.mjs +0 -41
  170. package/dist/MultichainBalancesController/Poller.mjs.map +0 -1
  171. package/dist/MultichainBalancesController/constants.cjs +0 -45
  172. package/dist/MultichainBalancesController/constants.cjs.map +0 -1
  173. package/dist/MultichainBalancesController/constants.d.cts +0 -29
  174. package/dist/MultichainBalancesController/constants.d.cts.map +0 -1
  175. package/dist/MultichainBalancesController/constants.d.mts +0 -29
  176. package/dist/MultichainBalancesController/constants.d.mts.map +0 -1
  177. package/dist/MultichainBalancesController/constants.mjs +0 -42
  178. package/dist/MultichainBalancesController/constants.mjs.map +0 -1
  179. package/dist/MultichainBalancesController/error.cjs +0 -18
  180. package/dist/MultichainBalancesController/error.cjs.map +0 -1
  181. package/dist/MultichainBalancesController/error.d.cts +0 -7
  182. package/dist/MultichainBalancesController/error.d.cts.map +0 -1
  183. package/dist/MultichainBalancesController/error.d.mts +0 -7
  184. package/dist/MultichainBalancesController/error.d.mts.map +0 -1
  185. package/dist/MultichainBalancesController/error.mjs +0 -13
  186. package/dist/MultichainBalancesController/error.mjs.map +0 -1
  187. package/dist/MultichainBalancesController/utils.cjs +0 -73
  188. package/dist/MultichainBalancesController/utils.cjs.map +0 -1
  189. package/dist/MultichainBalancesController/utils.d.cts +0 -36
  190. package/dist/MultichainBalancesController/utils.d.cts.map +0 -1
  191. package/dist/MultichainBalancesController/utils.d.mts +0 -36
  192. package/dist/MultichainBalancesController/utils.d.mts.map +0 -1
  193. package/dist/MultichainBalancesController/utils.mjs +0 -66
  194. package/dist/MultichainBalancesController/utils.mjs.map +0 -1
@@ -1,42 +0,0 @@
1
- import { BtcAccountType, SolAccountType } from "@metamask/keyring-api";
2
- /**
3
- * The network identifiers for supported networks in CAIP-2 format.
4
- * Note: This is a temporary workaround until we have a more robust
5
- * solution for network identifiers.
6
- */
7
- export var MultichainNetworks;
8
- (function (MultichainNetworks) {
9
- MultichainNetworks["Bitcoin"] = "bip122:000000000019d6689c085ae165831e93";
10
- MultichainNetworks["BitcoinTestnet"] = "bip122:000000000933ea01ad0ee984209779ba";
11
- MultichainNetworks["Solana"] = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
12
- MultichainNetworks["SolanaDevnet"] = "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1";
13
- MultichainNetworks["SolanaTestnet"] = "solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z";
14
- })(MultichainNetworks || (MultichainNetworks = {}));
15
- export var MultichainNativeAssets;
16
- (function (MultichainNativeAssets) {
17
- MultichainNativeAssets["Bitcoin"] = "bip122:000000000019d6689c085ae165831e93/slip44:0";
18
- MultichainNativeAssets["BitcoinTestnet"] = "bip122:000000000933ea01ad0ee984209779ba/slip44:0";
19
- MultichainNativeAssets["Solana"] = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501";
20
- MultichainNativeAssets["SolanaDevnet"] = "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/slip44:501";
21
- MultichainNativeAssets["SolanaTestnet"] = "solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z/slip44:501";
22
- })(MultichainNativeAssets || (MultichainNativeAssets = {}));
23
- const BITCOIN_AVG_BLOCK_TIME = 10 * 60 * 1000; // 10 minutes in milliseconds
24
- const SOLANA_AVG_BLOCK_TIME = 400; // 400 milliseconds
25
- export const BALANCE_UPDATE_INTERVALS = {
26
- // NOTE: We set an interval of half the average block time for bitcoin
27
- // to mitigate when our interval is de-synchronized with the actual block time.
28
- [BtcAccountType.P2wpkh]: BITCOIN_AVG_BLOCK_TIME / 2,
29
- [SolAccountType.DataAccount]: SOLANA_AVG_BLOCK_TIME,
30
- };
31
- /**
32
- * Maps network identifiers to their corresponding native asset types.
33
- * Each network is mapped to an array containing its native asset for consistency.
34
- */
35
- export const NETWORK_ASSETS_MAP = {
36
- [MultichainNetworks.Solana]: [MultichainNativeAssets.Solana],
37
- [MultichainNetworks.SolanaTestnet]: [MultichainNativeAssets.SolanaTestnet],
38
- [MultichainNetworks.SolanaDevnet]: [MultichainNativeAssets.SolanaDevnet],
39
- [MultichainNetworks.Bitcoin]: [MultichainNativeAssets.Bitcoin],
40
- [MultichainNetworks.BitcoinTestnet]: [MultichainNativeAssets.BitcoinTestnet],
41
- };
42
- //# sourceMappingURL=constants.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../src/MultichainBalancesController/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,8BAA8B;AAEvE;;;;GAIG;AACH,MAAM,CAAN,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC5B,yEAAmD,CAAA;IACnD,gFAA0D,CAAA;IAC1D,wEAAkD,CAAA;IAClD,8EAAwD,CAAA;IACxD,+EAAyD,CAAA;AAC3D,CAAC,EANW,kBAAkB,KAAlB,kBAAkB,QAM7B;AAED,MAAM,CAAN,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAChC,sFAAkD,CAAA;IAClD,6FAAgE,CAAA;IAChE,uFAAkD,CAAA;IAClD,6FAA8D,CAAA;IAC9D,8FAAgE,CAAA;AAClE,CAAC,EANW,sBAAsB,KAAtB,sBAAsB,QAMjC;AAED,MAAM,sBAAsB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,6BAA6B;AAC5E,MAAM,qBAAqB,GAAG,GAAG,CAAC,CAAC,mBAAmB;AAEtD,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,sEAAsE;IACtE,+EAA+E;IAC/E,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,CAAC;IACnD,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,qBAAqB;CACpD,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA6C;IAC1E,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,sBAAsB,CAAC,MAAM,CAAC;IAC5D,CAAC,kBAAkB,CAAC,aAAa,CAAC,EAAE,CAAC,sBAAsB,CAAC,aAAa,CAAC;IAC1E,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE,CAAC,sBAAsB,CAAC,YAAY,CAAC;IACxE,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC;IAC9D,CAAC,kBAAkB,CAAC,cAAc,CAAC,EAAE,CAAC,sBAAsB,CAAC,cAAc,CAAC;CAC7E,CAAC","sourcesContent":["import { BtcAccountType, SolAccountType } from '@metamask/keyring-api';\n\n/**\n * The network identifiers for supported networks in CAIP-2 format.\n * Note: This is a temporary workaround until we have a more robust\n * solution for network identifiers.\n */\nexport enum MultichainNetworks {\n Bitcoin = 'bip122:000000000019d6689c085ae165831e93',\n BitcoinTestnet = 'bip122:000000000933ea01ad0ee984209779ba',\n Solana = 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',\n SolanaDevnet = 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1',\n SolanaTestnet = 'solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z',\n}\n\nexport enum MultichainNativeAssets {\n Bitcoin = `${MultichainNetworks.Bitcoin}/slip44:0`,\n BitcoinTestnet = `${MultichainNetworks.BitcoinTestnet}/slip44:0`,\n Solana = `${MultichainNetworks.Solana}/slip44:501`,\n SolanaDevnet = `${MultichainNetworks.SolanaDevnet}/slip44:501`,\n SolanaTestnet = `${MultichainNetworks.SolanaTestnet}/slip44:501`,\n}\n\nconst BITCOIN_AVG_BLOCK_TIME = 10 * 60 * 1000; // 10 minutes in milliseconds\nconst SOLANA_AVG_BLOCK_TIME = 400; // 400 milliseconds\n\nexport const BALANCE_UPDATE_INTERVALS = {\n // NOTE: We set an interval of half the average block time for bitcoin\n // to mitigate when our interval is de-synchronized with the actual block time.\n [BtcAccountType.P2wpkh]: BITCOIN_AVG_BLOCK_TIME / 2,\n [SolAccountType.DataAccount]: SOLANA_AVG_BLOCK_TIME,\n};\n\n/**\n * Maps network identifiers to their corresponding native asset types.\n * Each network is mapped to an array containing its native asset for consistency.\n */\nexport const NETWORK_ASSETS_MAP: Record<string, MultichainNativeAssets[]> = {\n [MultichainNetworks.Solana]: [MultichainNativeAssets.Solana],\n [MultichainNetworks.SolanaTestnet]: [MultichainNativeAssets.SolanaTestnet],\n [MultichainNetworks.SolanaDevnet]: [MultichainNativeAssets.SolanaDevnet],\n [MultichainNetworks.Bitcoin]: [MultichainNativeAssets.Bitcoin],\n [MultichainNetworks.BitcoinTestnet]: [MultichainNativeAssets.BitcoinTestnet],\n};\n"]}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PollerError = exports.BalancesTrackerError = void 0;
4
- class BalancesTrackerError extends Error {
5
- constructor(message) {
6
- super(message);
7
- this.name = 'BalancesTrackerError';
8
- }
9
- }
10
- exports.BalancesTrackerError = BalancesTrackerError;
11
- class PollerError extends Error {
12
- constructor(message) {
13
- super(message);
14
- this.name = 'PollerError';
15
- }
16
- }
17
- exports.PollerError = PollerError;
18
- //# sourceMappingURL=error.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.cjs","sourceRoot":"","sources":["../../src/MultichainBalancesController/error.ts"],"names":[],"mappings":";;;AAAA,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AALD,oDAKC;AAED,MAAa,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF;AALD,kCAKC","sourcesContent":["export class BalancesTrackerError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'BalancesTrackerError';\n }\n}\n\nexport class PollerError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'PollerError';\n }\n}\n"]}
@@ -1,7 +0,0 @@
1
- export declare class BalancesTrackerError extends Error {
2
- constructor(message: string);
3
- }
4
- export declare class PollerError extends Error {
5
- constructor(message: string);
6
- }
7
- //# sourceMappingURL=error.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.d.cts","sourceRoot":"","sources":["../../src/MultichainBalancesController/error.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,WAAY,SAAQ,KAAK;gBACxB,OAAO,EAAE,MAAM;CAI5B"}
@@ -1,7 +0,0 @@
1
- export declare class BalancesTrackerError extends Error {
2
- constructor(message: string);
3
- }
4
- export declare class PollerError extends Error {
5
- constructor(message: string);
6
- }
7
- //# sourceMappingURL=error.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.d.mts","sourceRoot":"","sources":["../../src/MultichainBalancesController/error.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,WAAY,SAAQ,KAAK;gBACxB,OAAO,EAAE,MAAM;CAI5B"}
@@ -1,13 +0,0 @@
1
- export class BalancesTrackerError extends Error {
2
- constructor(message) {
3
- super(message);
4
- this.name = 'BalancesTrackerError';
5
- }
6
- }
7
- export class PollerError extends Error {
8
- constructor(message) {
9
- super(message);
10
- this.name = 'PollerError';
11
- }
12
- }
13
- //# sourceMappingURL=error.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.mjs","sourceRoot":"","sources":["../../src/MultichainBalancesController/error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF","sourcesContent":["export class BalancesTrackerError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'BalancesTrackerError';\n }\n}\n\nexport class PollerError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'PollerError';\n }\n}\n"]}
@@ -1,73 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBlockTimeForAccount = exports.getScopeForAccount = exports.getScopeForSolAddress = exports.getScopeForBtcAddress = void 0;
4
- const keyring_api_1 = require("@metamask/keyring-api");
5
- const bitcoin_address_validation_1 = require("bitcoin-address-validation");
6
- const constants_1 = require("./constants.cjs");
7
- /**
8
- * Gets the scope for a specific and supported Bitcoin account.
9
- * Note: This is a temporary method and will be replaced by a more robust solution
10
- * once the new `account.scopes` is available in the `@metamask/keyring-api` module.
11
- *
12
- * @param account - Bitcoin account
13
- * @returns The scope for the given account.
14
- */
15
- const getScopeForBtcAddress = (account) => {
16
- if ((0, bitcoin_address_validation_1.validate)(account.address, bitcoin_address_validation_1.Network.mainnet)) {
17
- return constants_1.MultichainNetworks.Bitcoin;
18
- }
19
- if ((0, bitcoin_address_validation_1.validate)(account.address, bitcoin_address_validation_1.Network.testnet)) {
20
- return constants_1.MultichainNetworks.BitcoinTestnet;
21
- }
22
- throw new Error(`Invalid Bitcoin address: ${account.address}`);
23
- };
24
- exports.getScopeForBtcAddress = getScopeForBtcAddress;
25
- /**
26
- * Gets the scope for a specific and supported Solana account.
27
- * Note: This is a temporary method and will be replaced by a more robust solution
28
- * once the new `account.scopes` is available in the `keyring-api`.
29
- *
30
- * @param account - Solana account
31
- * @returns The scope for the given account.
32
- */
33
- const getScopeForSolAddress = (account) => {
34
- // For Solana accounts, we know we have a `scope` on the account's `options` bag.
35
- if (!account.options.scope) {
36
- throw new Error('Solana account scope is undefined');
37
- }
38
- return account.options.scope;
39
- };
40
- exports.getScopeForSolAddress = getScopeForSolAddress;
41
- /**
42
- * Get the scope for a given address.
43
- * Note: This is a temporary method and will be replaced by a more robust solution
44
- * once the new `account.scopes` is available in the `keyring-api`.
45
- *
46
- * @param account - The account to get the scope for.
47
- * @returns The scope for the given account.
48
- */
49
- const getScopeForAccount = (account) => {
50
- switch (account.type) {
51
- case keyring_api_1.BtcAccountType.P2wpkh:
52
- return (0, exports.getScopeForBtcAddress)(account);
53
- case keyring_api_1.SolAccountType.DataAccount:
54
- return (0, exports.getScopeForSolAddress)(account);
55
- default:
56
- throw new Error(`Unsupported non-EVM account type: ${account.type}`);
57
- }
58
- };
59
- exports.getScopeForAccount = getScopeForAccount;
60
- /**
61
- * Gets the block time for a given account.
62
- *
63
- * @param accountType - The account type to get the block time for.
64
- * @returns The block time for the account.
65
- */
66
- const getBlockTimeForAccount = (accountType) => {
67
- if (accountType in constants_1.BALANCE_UPDATE_INTERVALS) {
68
- return constants_1.BALANCE_UPDATE_INTERVALS[accountType];
69
- }
70
- throw new Error(`Unsupported account type for balance tracking: ${accountType}`);
71
- };
72
- exports.getBlockTimeForAccount = getBlockTimeForAccount;
73
- //# sourceMappingURL=utils.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.cjs","sourceRoot":"","sources":["../../src/MultichainBalancesController/utils.ts"],"names":[],"mappings":";;;AAAA,uDAAuE;AAEvE,2EAA+D;AAE/D,+CAA2E;AAE3E;;;;;;;GAOG;AACI,MAAM,qBAAqB,GAAG,CAAC,OAAwB,EAAU,EAAE;IACxE,IAAI,IAAA,qCAAQ,EAAC,OAAO,CAAC,OAAO,EAAE,oCAAO,CAAC,OAAO,CAAC,EAAE;QAC9C,OAAO,8BAAkB,CAAC,OAAO,CAAC;KACnC;IAED,IAAI,IAAA,qCAAQ,EAAC,OAAO,CAAC,OAAO,EAAE,oCAAO,CAAC,OAAO,CAAC,EAAE;QAC9C,OAAO,8BAAkB,CAAC,cAAc,CAAC;KAC1C;IAED,MAAM,IAAI,KAAK,CAAC,4BAA4B,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;AACjE,CAAC,CAAC;AAVW,QAAA,qBAAqB,yBAUhC;AAEF;;;;;;;GAOG;AACI,MAAM,qBAAqB,GAAG,CAAC,OAAwB,EAAU,EAAE;IACxE,iFAAiF;IACjF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;KACtD;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,KAAe,CAAC;AACzC,CAAC,CAAC;AANW,QAAA,qBAAqB,yBAMhC;AAEF;;;;;;;GAOG;AACI,MAAM,kBAAkB,GAAG,CAAC,OAAwB,EAAU,EAAE;IACrE,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,4BAAc,CAAC,MAAM;YACxB,OAAO,IAAA,6BAAqB,EAAC,OAAO,CAAC,CAAC;QACxC,KAAK,4BAAc,CAAC,WAAW;YAC7B,OAAO,IAAA,6BAAqB,EAAC,OAAO,CAAC,CAAC;QACxC;YACE,MAAM,IAAI,KAAK,CAAC,qCAAqC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;KACxE;AACH,CAAC,CAAC;AATW,QAAA,kBAAkB,sBAS7B;AAEF;;;;;GAKG;AACI,MAAM,sBAAsB,GAAG,CAAC,WAAmB,EAAU,EAAE;IACpE,IAAI,WAAW,IAAI,oCAAwB,EAAE;QAC3C,OAAO,oCAAwB,CAC7B,WAAoD,CACrD,CAAC;KACH;IACD,MAAM,IAAI,KAAK,CACb,kDAAkD,WAAW,EAAE,CAChE,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,sBAAsB,0BASjC","sourcesContent":["import { BtcAccountType, SolAccountType } from '@metamask/keyring-api';\nimport type { InternalAccount } from '@metamask/keyring-internal-api';\nimport { validate, Network } from 'bitcoin-address-validation';\n\nimport { MultichainNetworks, BALANCE_UPDATE_INTERVALS } from './constants';\n\n/**\n * Gets the scope for a specific and supported Bitcoin account.\n * Note: This is a temporary method and will be replaced by a more robust solution\n * once the new `account.scopes` is available in the `@metamask/keyring-api` module.\n *\n * @param account - Bitcoin account\n * @returns The scope for the given account.\n */\nexport const getScopeForBtcAddress = (account: InternalAccount): string => {\n if (validate(account.address, Network.mainnet)) {\n return MultichainNetworks.Bitcoin;\n }\n\n if (validate(account.address, Network.testnet)) {\n return MultichainNetworks.BitcoinTestnet;\n }\n\n throw new Error(`Invalid Bitcoin address: ${account.address}`);\n};\n\n/**\n * Gets the scope for a specific and supported Solana account.\n * Note: This is a temporary method and will be replaced by a more robust solution\n * once the new `account.scopes` is available in the `keyring-api`.\n *\n * @param account - Solana account\n * @returns The scope for the given account.\n */\nexport const getScopeForSolAddress = (account: InternalAccount): string => {\n // For Solana accounts, we know we have a `scope` on the account's `options` bag.\n if (!account.options.scope) {\n throw new Error('Solana account scope is undefined');\n }\n return account.options.scope as string;\n};\n\n/**\n * Get the scope for a given address.\n * Note: This is a temporary method and will be replaced by a more robust solution\n * once the new `account.scopes` is available in the `keyring-api`.\n *\n * @param account - The account to get the scope for.\n * @returns The scope for the given account.\n */\nexport const getScopeForAccount = (account: InternalAccount): string => {\n switch (account.type) {\n case BtcAccountType.P2wpkh:\n return getScopeForBtcAddress(account);\n case SolAccountType.DataAccount:\n return getScopeForSolAddress(account);\n default:\n throw new Error(`Unsupported non-EVM account type: ${account.type}`);\n }\n};\n\n/**\n * Gets the block time for a given account.\n *\n * @param accountType - The account type to get the block time for.\n * @returns The block time for the account.\n */\nexport const getBlockTimeForAccount = (accountType: string): number => {\n if (accountType in BALANCE_UPDATE_INTERVALS) {\n return BALANCE_UPDATE_INTERVALS[\n accountType as keyof typeof BALANCE_UPDATE_INTERVALS\n ];\n }\n throw new Error(\n `Unsupported account type for balance tracking: ${accountType}`,\n );\n};\n"]}
@@ -1,36 +0,0 @@
1
- import type { InternalAccount } from "@metamask/keyring-internal-api";
2
- /**
3
- * Gets the scope for a specific and supported Bitcoin account.
4
- * Note: This is a temporary method and will be replaced by a more robust solution
5
- * once the new `account.scopes` is available in the `@metamask/keyring-api` module.
6
- *
7
- * @param account - Bitcoin account
8
- * @returns The scope for the given account.
9
- */
10
- export declare const getScopeForBtcAddress: (account: InternalAccount) => string;
11
- /**
12
- * Gets the scope for a specific and supported Solana account.
13
- * Note: This is a temporary method and will be replaced by a more robust solution
14
- * once the new `account.scopes` is available in the `keyring-api`.
15
- *
16
- * @param account - Solana account
17
- * @returns The scope for the given account.
18
- */
19
- export declare const getScopeForSolAddress: (account: InternalAccount) => string;
20
- /**
21
- * Get the scope for a given address.
22
- * Note: This is a temporary method and will be replaced by a more robust solution
23
- * once the new `account.scopes` is available in the `keyring-api`.
24
- *
25
- * @param account - The account to get the scope for.
26
- * @returns The scope for the given account.
27
- */
28
- export declare const getScopeForAccount: (account: InternalAccount) => string;
29
- /**
30
- * Gets the block time for a given account.
31
- *
32
- * @param accountType - The account type to get the block time for.
33
- * @returns The block time for the account.
34
- */
35
- export declare const getBlockTimeForAccount: (accountType: string) => number;
36
- //# sourceMappingURL=utils.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.cts","sourceRoot":"","sources":["../../src/MultichainBalancesController/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AAKtE;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,YAAa,eAAe,KAAG,MAUhE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,YAAa,eAAe,KAAG,MAMhE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,YAAa,eAAe,KAAG,MAS7D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,gBAAiB,MAAM,KAAG,MAS5D,CAAC"}
@@ -1,36 +0,0 @@
1
- import type { InternalAccount } from "@metamask/keyring-internal-api";
2
- /**
3
- * Gets the scope for a specific and supported Bitcoin account.
4
- * Note: This is a temporary method and will be replaced by a more robust solution
5
- * once the new `account.scopes` is available in the `@metamask/keyring-api` module.
6
- *
7
- * @param account - Bitcoin account
8
- * @returns The scope for the given account.
9
- */
10
- export declare const getScopeForBtcAddress: (account: InternalAccount) => string;
11
- /**
12
- * Gets the scope for a specific and supported Solana account.
13
- * Note: This is a temporary method and will be replaced by a more robust solution
14
- * once the new `account.scopes` is available in the `keyring-api`.
15
- *
16
- * @param account - Solana account
17
- * @returns The scope for the given account.
18
- */
19
- export declare const getScopeForSolAddress: (account: InternalAccount) => string;
20
- /**
21
- * Get the scope for a given address.
22
- * Note: This is a temporary method and will be replaced by a more robust solution
23
- * once the new `account.scopes` is available in the `keyring-api`.
24
- *
25
- * @param account - The account to get the scope for.
26
- * @returns The scope for the given account.
27
- */
28
- export declare const getScopeForAccount: (account: InternalAccount) => string;
29
- /**
30
- * Gets the block time for a given account.
31
- *
32
- * @param accountType - The account type to get the block time for.
33
- * @returns The block time for the account.
34
- */
35
- export declare const getBlockTimeForAccount: (accountType: string) => number;
36
- //# sourceMappingURL=utils.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.mts","sourceRoot":"","sources":["../../src/MultichainBalancesController/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AAKtE;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,YAAa,eAAe,KAAG,MAUhE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,YAAa,eAAe,KAAG,MAMhE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,YAAa,eAAe,KAAG,MAS7D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,gBAAiB,MAAM,KAAG,MAS5D,CAAC"}
@@ -1,66 +0,0 @@
1
- import { BtcAccountType, SolAccountType } from "@metamask/keyring-api";
2
- import { validate, Network } from "bitcoin-address-validation";
3
- import { MultichainNetworks, BALANCE_UPDATE_INTERVALS } from "./constants.mjs";
4
- /**
5
- * Gets the scope for a specific and supported Bitcoin account.
6
- * Note: This is a temporary method and will be replaced by a more robust solution
7
- * once the new `account.scopes` is available in the `@metamask/keyring-api` module.
8
- *
9
- * @param account - Bitcoin account
10
- * @returns The scope for the given account.
11
- */
12
- export const getScopeForBtcAddress = (account) => {
13
- if (validate(account.address, Network.mainnet)) {
14
- return MultichainNetworks.Bitcoin;
15
- }
16
- if (validate(account.address, Network.testnet)) {
17
- return MultichainNetworks.BitcoinTestnet;
18
- }
19
- throw new Error(`Invalid Bitcoin address: ${account.address}`);
20
- };
21
- /**
22
- * Gets the scope for a specific and supported Solana account.
23
- * Note: This is a temporary method and will be replaced by a more robust solution
24
- * once the new `account.scopes` is available in the `keyring-api`.
25
- *
26
- * @param account - Solana account
27
- * @returns The scope for the given account.
28
- */
29
- export const getScopeForSolAddress = (account) => {
30
- // For Solana accounts, we know we have a `scope` on the account's `options` bag.
31
- if (!account.options.scope) {
32
- throw new Error('Solana account scope is undefined');
33
- }
34
- return account.options.scope;
35
- };
36
- /**
37
- * Get the scope for a given address.
38
- * Note: This is a temporary method and will be replaced by a more robust solution
39
- * once the new `account.scopes` is available in the `keyring-api`.
40
- *
41
- * @param account - The account to get the scope for.
42
- * @returns The scope for the given account.
43
- */
44
- export const getScopeForAccount = (account) => {
45
- switch (account.type) {
46
- case BtcAccountType.P2wpkh:
47
- return getScopeForBtcAddress(account);
48
- case SolAccountType.DataAccount:
49
- return getScopeForSolAddress(account);
50
- default:
51
- throw new Error(`Unsupported non-EVM account type: ${account.type}`);
52
- }
53
- };
54
- /**
55
- * Gets the block time for a given account.
56
- *
57
- * @param accountType - The account type to get the block time for.
58
- * @returns The block time for the account.
59
- */
60
- export const getBlockTimeForAccount = (accountType) => {
61
- if (accountType in BALANCE_UPDATE_INTERVALS) {
62
- return BALANCE_UPDATE_INTERVALS[accountType];
63
- }
64
- throw new Error(`Unsupported account type for balance tracking: ${accountType}`);
65
- };
66
- //# sourceMappingURL=utils.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.mjs","sourceRoot":"","sources":["../../src/MultichainBalancesController/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,8BAA8B;AAEvE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,mCAAmC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,wBAAoB;AAE3E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,OAAwB,EAAU,EAAE;IACxE,IAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE;QAC9C,OAAO,kBAAkB,CAAC,OAAO,CAAC;KACnC;IAED,IAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE;QAC9C,OAAO,kBAAkB,CAAC,cAAc,CAAC;KAC1C;IAED,MAAM,IAAI,KAAK,CAAC,4BAA4B,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;AACjE,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,OAAwB,EAAU,EAAE;IACxE,iFAAiF;IACjF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;KACtD;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,KAAe,CAAC;AACzC,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAwB,EAAU,EAAE;IACrE,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,cAAc,CAAC,MAAM;YACxB,OAAO,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACxC,KAAK,cAAc,CAAC,WAAW;YAC7B,OAAO,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACxC;YACE,MAAM,IAAI,KAAK,CAAC,qCAAqC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;KACxE;AACH,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,WAAmB,EAAU,EAAE;IACpE,IAAI,WAAW,IAAI,wBAAwB,EAAE;QAC3C,OAAO,wBAAwB,CAC7B,WAAoD,CACrD,CAAC;KACH;IACD,MAAM,IAAI,KAAK,CACb,kDAAkD,WAAW,EAAE,CAChE,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { BtcAccountType, SolAccountType } from '@metamask/keyring-api';\nimport type { InternalAccount } from '@metamask/keyring-internal-api';\nimport { validate, Network } from 'bitcoin-address-validation';\n\nimport { MultichainNetworks, BALANCE_UPDATE_INTERVALS } from './constants';\n\n/**\n * Gets the scope for a specific and supported Bitcoin account.\n * Note: This is a temporary method and will be replaced by a more robust solution\n * once the new `account.scopes` is available in the `@metamask/keyring-api` module.\n *\n * @param account - Bitcoin account\n * @returns The scope for the given account.\n */\nexport const getScopeForBtcAddress = (account: InternalAccount): string => {\n if (validate(account.address, Network.mainnet)) {\n return MultichainNetworks.Bitcoin;\n }\n\n if (validate(account.address, Network.testnet)) {\n return MultichainNetworks.BitcoinTestnet;\n }\n\n throw new Error(`Invalid Bitcoin address: ${account.address}`);\n};\n\n/**\n * Gets the scope for a specific and supported Solana account.\n * Note: This is a temporary method and will be replaced by a more robust solution\n * once the new `account.scopes` is available in the `keyring-api`.\n *\n * @param account - Solana account\n * @returns The scope for the given account.\n */\nexport const getScopeForSolAddress = (account: InternalAccount): string => {\n // For Solana accounts, we know we have a `scope` on the account's `options` bag.\n if (!account.options.scope) {\n throw new Error('Solana account scope is undefined');\n }\n return account.options.scope as string;\n};\n\n/**\n * Get the scope for a given address.\n * Note: This is a temporary method and will be replaced by a more robust solution\n * once the new `account.scopes` is available in the `keyring-api`.\n *\n * @param account - The account to get the scope for.\n * @returns The scope for the given account.\n */\nexport const getScopeForAccount = (account: InternalAccount): string => {\n switch (account.type) {\n case BtcAccountType.P2wpkh:\n return getScopeForBtcAddress(account);\n case SolAccountType.DataAccount:\n return getScopeForSolAddress(account);\n default:\n throw new Error(`Unsupported non-EVM account type: ${account.type}`);\n }\n};\n\n/**\n * Gets the block time for a given account.\n *\n * @param accountType - The account type to get the block time for.\n * @returns The block time for the account.\n */\nexport const getBlockTimeForAccount = (accountType: string): number => {\n if (accountType in BALANCE_UPDATE_INTERVALS) {\n return BALANCE_UPDATE_INTERVALS[\n accountType as keyof typeof BALANCE_UPDATE_INTERVALS\n ];\n }\n throw new Error(\n `Unsupported account type for balance tracking: ${accountType}`,\n );\n};\n"]}