@metamask/assets-controllers 37.0.0 → 38.0.1

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 (372) hide show
  1. package/CHANGELOG.md +50 -1
  2. package/dist/AccountTrackerController.cjs +245 -0
  3. package/dist/AccountTrackerController.cjs.map +1 -0
  4. package/dist/{types/AccountTrackerController.d.ts → AccountTrackerController.d.cts} +6 -6
  5. package/dist/AccountTrackerController.d.cts.map +1 -0
  6. package/dist/AccountTrackerController.d.mts +112 -0
  7. package/dist/AccountTrackerController.d.mts.map +1 -0
  8. package/dist/AccountTrackerController.mjs +244 -8
  9. package/dist/AccountTrackerController.mjs.map +1 -1
  10. package/dist/AssetsContractController.cjs +389 -0
  11. package/dist/AssetsContractController.cjs.map +1 -0
  12. package/dist/{types/AssetsContractController.d.ts → AssetsContractController.d.cts} +10 -9
  13. package/dist/AssetsContractController.d.cts.map +1 -0
  14. package/dist/AssetsContractController.d.mts +277 -0
  15. package/dist/AssetsContractController.d.mts.map +1 -0
  16. package/dist/AssetsContractController.mjs +387 -16
  17. package/dist/AssetsContractController.mjs.map +1 -1
  18. package/dist/CurrencyRateController.cjs +156 -0
  19. package/dist/CurrencyRateController.cjs.map +1 -0
  20. package/dist/{types/CurrencyRateController.d.ts → CurrencyRateController.d.cts} +5 -5
  21. package/dist/CurrencyRateController.d.cts.map +1 -0
  22. package/dist/CurrencyRateController.d.mts +80 -0
  23. package/dist/CurrencyRateController.d.mts.map +1 -0
  24. package/dist/CurrencyRateController.mjs +150 -10
  25. package/dist/CurrencyRateController.mjs.map +1 -1
  26. package/dist/NftController.cjs +1159 -0
  27. package/dist/NftController.cjs.map +1 -0
  28. package/dist/{types/NftController.d.ts → NftController.d.cts} +11 -11
  29. package/dist/NftController.d.cts.map +1 -0
  30. package/dist/NftController.d.mts +424 -0
  31. package/dist/NftController.d.mts.map +1 -0
  32. package/dist/NftController.mjs +1156 -12
  33. package/dist/NftController.mjs.map +1 -1
  34. package/dist/NftDetectionController.cjs +237 -0
  35. package/dist/NftDetectionController.cjs.map +1 -0
  36. package/dist/{types/NftDetectionController.d.ts → NftDetectionController.d.cts} +9 -9
  37. package/dist/NftDetectionController.d.cts.map +1 -0
  38. package/dist/NftDetectionController.d.mts +368 -0
  39. package/dist/NftDetectionController.d.mts.map +1 -0
  40. package/dist/NftDetectionController.mjs +231 -14
  41. package/dist/NftDetectionController.mjs.map +1 -1
  42. package/dist/RatesController/RatesController.cjs +189 -0
  43. package/dist/RatesController/RatesController.cjs.map +1 -0
  44. package/dist/{types/RatesController/RatesController.d.ts → RatesController/RatesController.d.cts} +5 -5
  45. package/dist/RatesController/RatesController.d.cts.map +1 -0
  46. package/dist/RatesController/RatesController.d.mts +44 -0
  47. package/dist/RatesController/RatesController.d.mts.map +1 -0
  48. package/dist/RatesController/RatesController.mjs +183 -12
  49. package/dist/RatesController/RatesController.mjs.map +1 -1
  50. package/dist/RatesController/index.cjs +7 -0
  51. package/dist/RatesController/index.cjs.map +1 -0
  52. package/dist/{types/RatesController/index.d.ts → RatesController/index.d.cts} +3 -3
  53. package/dist/RatesController/index.d.cts.map +1 -0
  54. package/dist/RatesController/index.d.mts +3 -0
  55. package/dist/RatesController/index.d.mts.map +1 -0
  56. package/dist/RatesController/index.mjs +1 -12
  57. package/dist/RatesController/index.mjs.map +1 -1
  58. package/dist/RatesController/types.cjs +3 -0
  59. package/dist/RatesController/types.cjs.map +1 -0
  60. package/dist/{types/RatesController/types.d.ts → RatesController/types.d.cts} +4 -4
  61. package/dist/RatesController/types.d.cts.map +1 -0
  62. package/dist/RatesController/types.d.mts +100 -0
  63. package/dist/RatesController/types.d.mts.map +1 -0
  64. package/dist/RatesController/types.mjs +1 -0
  65. package/dist/RatesController/types.mjs.map +1 -1
  66. package/dist/Standards/ERC20Standard.cjs +124 -0
  67. package/dist/Standards/ERC20Standard.cjs.map +1 -0
  68. package/dist/{types/Standards/ERC20Standard.d.ts → Standards/ERC20Standard.d.cts} +3 -3
  69. package/dist/Standards/ERC20Standard.d.cts.map +1 -0
  70. package/dist/Standards/ERC20Standard.d.mts +49 -0
  71. package/dist/Standards/ERC20Standard.d.mts.map +1 -0
  72. package/dist/Standards/ERC20Standard.mjs +121 -8
  73. package/dist/Standards/ERC20Standard.mjs.map +1 -1
  74. package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.cjs +189 -0
  75. package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.cjs.map +1 -0
  76. package/dist/{types/Standards/NftStandards/ERC1155/ERC1155Standard.d.ts → Standards/NftStandards/ERC1155/ERC1155Standard.d.cts} +3 -3
  77. package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.d.cts.map +1 -0
  78. package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.d.mts +95 -0
  79. package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.d.mts.map +1 -0
  80. package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.mjs +184 -8
  81. package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.mjs.map +1 -1
  82. package/dist/Standards/NftStandards/ERC721/ERC721Standard.cjs +167 -0
  83. package/dist/Standards/NftStandards/ERC721/ERC721Standard.cjs.map +1 -0
  84. package/dist/{types/Standards/NftStandards/ERC721/ERC721Standard.d.ts → Standards/NftStandards/ERC721/ERC721Standard.d.cts} +2 -2
  85. package/dist/Standards/NftStandards/ERC721/ERC721Standard.d.cts.map +1 -0
  86. package/dist/Standards/NftStandards/ERC721/ERC721Standard.d.mts +89 -0
  87. package/dist/Standards/NftStandards/ERC721/ERC721Standard.d.mts.map +1 -0
  88. package/dist/Standards/NftStandards/ERC721/ERC721Standard.mjs +162 -8
  89. package/dist/Standards/NftStandards/ERC721/ERC721Standard.mjs.map +1 -1
  90. package/dist/TokenBalancesController.cjs +136 -0
  91. package/dist/TokenBalancesController.cjs.map +1 -0
  92. package/dist/{types/TokenBalancesController.d.ts → TokenBalancesController.d.cts} +7 -7
  93. package/dist/TokenBalancesController.d.cts.map +1 -0
  94. package/dist/TokenBalancesController.d.mts +82 -0
  95. package/dist/TokenBalancesController.d.mts.map +1 -0
  96. package/dist/TokenBalancesController.mjs +129 -10
  97. package/dist/TokenBalancesController.mjs.map +1 -1
  98. package/dist/TokenDetectionController.cjs +369 -0
  99. package/dist/TokenDetectionController.cjs.map +1 -0
  100. package/dist/{types/TokenDetectionController.d.ts → TokenDetectionController.d.cts} +10 -10
  101. package/dist/TokenDetectionController.d.cts.map +1 -0
  102. package/dist/TokenDetectionController.d.mts +109 -0
  103. package/dist/TokenDetectionController.d.mts.map +1 -0
  104. package/dist/TokenDetectionController.mjs +366 -15
  105. package/dist/TokenDetectionController.mjs.map +1 -1
  106. package/dist/TokenListController.cjs +274 -0
  107. package/dist/TokenListController.cjs.map +1 -0
  108. package/dist/{types/TokenListController.d.ts → TokenListController.d.cts} +5 -5
  109. package/dist/TokenListController.d.cts.map +1 -0
  110. package/dist/TokenListController.d.mts +117 -0
  111. package/dist/TokenListController.d.mts.map +1 -0
  112. package/dist/TokenListController.mjs +267 -12
  113. package/dist/TokenListController.mjs.map +1 -1
  114. package/dist/TokenRatesController.cjs +452 -0
  115. package/dist/TokenRatesController.cjs.map +1 -0
  116. package/dist/{types/TokenRatesController.d.ts → TokenRatesController.d.cts} +9 -9
  117. package/dist/TokenRatesController.d.cts.map +1 -0
  118. package/dist/TokenRatesController.d.mts +170 -0
  119. package/dist/TokenRatesController.d.mts.map +1 -0
  120. package/dist/TokenRatesController.mjs +446 -16
  121. package/dist/TokenRatesController.mjs.map +1 -1
  122. package/dist/TokensController.cjs +678 -0
  123. package/dist/TokensController.cjs.map +1 -0
  124. package/dist/{types/TokensController.d.ts → TokensController.d.cts} +10 -10
  125. package/dist/TokensController.d.cts.map +1 -0
  126. package/dist/TokensController.d.mts +165 -0
  127. package/dist/TokensController.d.mts.map +1 -0
  128. package/dist/TokensController.mjs +675 -14
  129. package/dist/TokensController.mjs.map +1 -1
  130. package/dist/assetsUtil.cjs +358 -0
  131. package/dist/assetsUtil.cjs.map +1 -0
  132. package/dist/{types/assetsUtil.d.ts → assetsUtil.d.cts} +7 -7
  133. package/dist/assetsUtil.d.cts.map +1 -0
  134. package/dist/assetsUtil.d.mts +177 -0
  135. package/dist/assetsUtil.d.mts.map +1 -0
  136. package/dist/assetsUtil.mjs +343 -36
  137. package/dist/assetsUtil.mjs.map +1 -1
  138. package/dist/constants.cjs +10 -0
  139. package/dist/constants.cjs.map +1 -0
  140. package/dist/{types/constants.d.ts → constants.d.cts} +1 -1
  141. package/dist/constants.d.cts.map +1 -0
  142. package/dist/constants.d.mts +6 -0
  143. package/dist/constants.d.mts.map +1 -0
  144. package/dist/constants.mjs +6 -7
  145. package/dist/constants.mjs.map +1 -1
  146. package/dist/crypto-compare-service/crypto-compare.cjs +119 -0
  147. package/dist/crypto-compare-service/crypto-compare.cjs.map +1 -0
  148. package/dist/{types/crypto-compare-service/crypto-compare.d.ts → crypto-compare-service/crypto-compare.d.cts} +1 -1
  149. package/dist/crypto-compare-service/crypto-compare.d.cts.map +1 -0
  150. package/dist/crypto-compare-service/crypto-compare.d.mts +22 -0
  151. package/dist/crypto-compare-service/crypto-compare.d.mts.map +1 -0
  152. package/dist/crypto-compare-service/crypto-compare.mjs +113 -9
  153. package/dist/crypto-compare-service/crypto-compare.mjs.map +1 -1
  154. package/dist/crypto-compare-service/index.cjs +7 -0
  155. package/dist/crypto-compare-service/index.cjs.map +1 -0
  156. package/dist/crypto-compare-service/index.d.cts +2 -0
  157. package/dist/crypto-compare-service/index.d.cts.map +1 -0
  158. package/dist/crypto-compare-service/index.d.mts +2 -0
  159. package/dist/crypto-compare-service/index.d.mts.map +1 -0
  160. package/dist/crypto-compare-service/index.mjs +1 -10
  161. package/dist/crypto-compare-service/index.mjs.map +1 -1
  162. package/dist/index.cjs +51 -0
  163. package/dist/index.cjs.map +1 -0
  164. package/dist/{types/index.d.ts → index.d.cts} +24 -24
  165. package/dist/index.d.cts.map +1 -0
  166. package/dist/index.d.mts +24 -0
  167. package/dist/index.d.mts.map +1 -0
  168. package/dist/index.mjs +13 -80
  169. package/dist/index.mjs.map +1 -1
  170. package/dist/token-prices-service/abstract-token-prices-service.cjs +3 -0
  171. package/dist/token-prices-service/abstract-token-prices-service.cjs.map +1 -0
  172. package/dist/{types/token-prices-service/abstract-token-prices-service.d.ts → token-prices-service/abstract-token-prices-service.d.cts} +2 -2
  173. package/dist/token-prices-service/abstract-token-prices-service.d.cts.map +1 -0
  174. package/dist/token-prices-service/abstract-token-prices-service.d.mts +79 -0
  175. package/dist/token-prices-service/abstract-token-prices-service.d.mts.map +1 -0
  176. package/dist/token-prices-service/abstract-token-prices-service.mjs +1 -0
  177. package/dist/token-prices-service/abstract-token-prices-service.mjs.map +1 -1
  178. package/dist/token-prices-service/codefi-v2.cjs +352 -0
  179. package/dist/token-prices-service/codefi-v2.cjs.map +1 -0
  180. package/dist/{types/token-prices-service/codefi-v2.d.ts → token-prices-service/codefi-v2.d.cts} +3 -3
  181. package/dist/token-prices-service/codefi-v2.d.cts.map +1 -0
  182. package/dist/token-prices-service/codefi-v2.d.mts +97 -0
  183. package/dist/token-prices-service/codefi-v2.d.mts.map +1 -0
  184. package/dist/token-prices-service/codefi-v2.mjs +347 -12
  185. package/dist/token-prices-service/codefi-v2.mjs.map +1 -1
  186. package/dist/token-prices-service/index.cjs +7 -0
  187. package/dist/token-prices-service/index.cjs.map +1 -0
  188. package/dist/token-prices-service/index.d.cts +3 -0
  189. package/dist/token-prices-service/index.d.cts.map +1 -0
  190. package/dist/token-prices-service/index.d.mts +3 -0
  191. package/dist/token-prices-service/index.d.mts.map +1 -0
  192. package/dist/token-prices-service/index.mjs +1 -10
  193. package/dist/token-prices-service/index.mjs.map +1 -1
  194. package/dist/token-service.cjs +130 -0
  195. package/dist/token-service.cjs.map +1 -0
  196. package/dist/{types/token-service.d.ts → token-service.d.cts} +2 -2
  197. package/dist/token-service.d.cts.map +1 -0
  198. package/dist/token-service.d.mts +31 -0
  199. package/dist/token-service.d.mts.map +1 -0
  200. package/dist/token-service.mjs +124 -14
  201. package/dist/token-service.mjs.map +1 -1
  202. package/package.json +24 -18
  203. package/dist/AccountTrackerController.js +0 -10
  204. package/dist/AccountTrackerController.js.map +0 -1
  205. package/dist/AssetsContractController.js +0 -18
  206. package/dist/AssetsContractController.js.map +0 -1
  207. package/dist/CurrencyRateController.js +0 -12
  208. package/dist/CurrencyRateController.js.map +0 -1
  209. package/dist/NftController.js +0 -14
  210. package/dist/NftController.js.map +0 -1
  211. package/dist/NftDetectionController.js +0 -16
  212. package/dist/NftDetectionController.js.map +0 -1
  213. package/dist/RatesController/RatesController.js +0 -14
  214. package/dist/RatesController/RatesController.js.map +0 -1
  215. package/dist/RatesController/index.js +0 -13
  216. package/dist/RatesController/index.js.map +0 -1
  217. package/dist/RatesController/types.js +0 -1
  218. package/dist/RatesController/types.js.map +0 -1
  219. package/dist/Standards/ERC20Standard.js +0 -9
  220. package/dist/Standards/ERC20Standard.js.map +0 -1
  221. package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.js +0 -9
  222. package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.js.map +0 -1
  223. package/dist/Standards/NftStandards/ERC721/ERC721Standard.js +0 -9
  224. package/dist/Standards/NftStandards/ERC721/ERC721Standard.js.map +0 -1
  225. package/dist/TokenBalancesController.js +0 -12
  226. package/dist/TokenBalancesController.js.map +0 -1
  227. package/dist/TokenDetectionController.js +0 -17
  228. package/dist/TokenDetectionController.js.map +0 -1
  229. package/dist/TokenListController.js +0 -14
  230. package/dist/TokenListController.js.map +0 -1
  231. package/dist/TokenRatesController.js +0 -18
  232. package/dist/TokenRatesController.js.map +0 -1
  233. package/dist/TokensController.js +0 -16
  234. package/dist/TokensController.js.map +0 -1
  235. package/dist/assetsUtil.js +0 -38
  236. package/dist/assetsUtil.js.map +0 -1
  237. package/dist/chunk-27KOXCQK.mjs +0 -1
  238. package/dist/chunk-27KOXCQK.mjs.map +0 -1
  239. package/dist/chunk-2TZK6YZA.js +0 -1405
  240. package/dist/chunk-2TZK6YZA.js.map +0 -1
  241. package/dist/chunk-3LPQTUGG.js +0 -434
  242. package/dist/chunk-3LPQTUGG.js.map +0 -1
  243. package/dist/chunk-3QDXAE2D.mjs +0 -178
  244. package/dist/chunk-3QDXAE2D.mjs.map +0 -1
  245. package/dist/chunk-46KUC5FH.mjs +0 -434
  246. package/dist/chunk-46KUC5FH.mjs.map +0 -1
  247. package/dist/chunk-54JUUBXY.mjs +0 -813
  248. package/dist/chunk-54JUUBXY.mjs.map +0 -1
  249. package/dist/chunk-5QLC2MHV.js +0 -215
  250. package/dist/chunk-5QLC2MHV.js.map +0 -1
  251. package/dist/chunk-7K6PSEAA.js +0 -1
  252. package/dist/chunk-7K6PSEAA.js.map +0 -1
  253. package/dist/chunk-ADJ3IFJH.js +0 -813
  254. package/dist/chunk-ADJ3IFJH.js.map +0 -1
  255. package/dist/chunk-AX522TDL.mjs +0 -85
  256. package/dist/chunk-AX522TDL.mjs.map +0 -1
  257. package/dist/chunk-BBCZM5P4.js +0 -300
  258. package/dist/chunk-BBCZM5P4.js.map +0 -1
  259. package/dist/chunk-BZEAPSD5.mjs +0 -215
  260. package/dist/chunk-BZEAPSD5.mjs.map +0 -1
  261. package/dist/chunk-C7LNCQXM.mjs +0 -300
  262. package/dist/chunk-C7LNCQXM.mjs.map +0 -1
  263. package/dist/chunk-CN53OZAM.mjs +0 -428
  264. package/dist/chunk-CN53OZAM.mjs.map +0 -1
  265. package/dist/chunk-CP3HC7AQ.mjs +0 -12
  266. package/dist/chunk-CP3HC7AQ.mjs.map +0 -1
  267. package/dist/chunk-CUFSPB7T.mjs +0 -530
  268. package/dist/chunk-CUFSPB7T.mjs.map +0 -1
  269. package/dist/chunk-F6L3DFOZ.js +0 -204
  270. package/dist/chunk-F6L3DFOZ.js.map +0 -1
  271. package/dist/chunk-GHG3DOUK.js +0 -428
  272. package/dist/chunk-GHG3DOUK.js.map +0 -1
  273. package/dist/chunk-HJ5GXVDT.mjs +0 -157
  274. package/dist/chunk-HJ5GXVDT.mjs.map +0 -1
  275. package/dist/chunk-HVOIBGYN.js +0 -282
  276. package/dist/chunk-HVOIBGYN.js.map +0 -1
  277. package/dist/chunk-ISK2VSBB.js +0 -178
  278. package/dist/chunk-ISK2VSBB.js.map +0 -1
  279. package/dist/chunk-JCR4H6YL.js +0 -115
  280. package/dist/chunk-JCR4H6YL.js.map +0 -1
  281. package/dist/chunk-JJX7TMH5.mjs +0 -135
  282. package/dist/chunk-JJX7TMH5.mjs.map +0 -1
  283. package/dist/chunk-JTXPJ6TK.mjs +0 -68
  284. package/dist/chunk-JTXPJ6TK.mjs.map +0 -1
  285. package/dist/chunk-JYHAAA6W.mjs +0 -1
  286. package/dist/chunk-JYHAAA6W.mjs.map +0 -1
  287. package/dist/chunk-K7A3EOIM.js +0 -85
  288. package/dist/chunk-K7A3EOIM.js.map +0 -1
  289. package/dist/chunk-KPBNX6GP.mjs +0 -215
  290. package/dist/chunk-KPBNX6GP.mjs.map +0 -1
  291. package/dist/chunk-MZI3SDQN.js +0 -215
  292. package/dist/chunk-MZI3SDQN.js.map +0 -1
  293. package/dist/chunk-OBUR4TXH.js +0 -1
  294. package/dist/chunk-OBUR4TXH.js.map +0 -1
  295. package/dist/chunk-RGHTNZQ6.js +0 -12
  296. package/dist/chunk-RGHTNZQ6.js.map +0 -1
  297. package/dist/chunk-S5CFNNOM.mjs +0 -115
  298. package/dist/chunk-S5CFNNOM.mjs.map +0 -1
  299. package/dist/chunk-SBWPU4VT.mjs +0 -204
  300. package/dist/chunk-SBWPU4VT.mjs.map +0 -1
  301. package/dist/chunk-SK2B36Q4.mjs +0 -1405
  302. package/dist/chunk-SK2B36Q4.mjs.map +0 -1
  303. package/dist/chunk-T5ZX5BV7.js +0 -157
  304. package/dist/chunk-T5ZX5BV7.js.map +0 -1
  305. package/dist/chunk-TFLYM4PY.mjs +0 -291
  306. package/dist/chunk-TFLYM4PY.mjs.map +0 -1
  307. package/dist/chunk-TTH3ES66.mjs +0 -1
  308. package/dist/chunk-TTH3ES66.mjs.map +0 -1
  309. package/dist/chunk-V6DNVROD.js +0 -348
  310. package/dist/chunk-V6DNVROD.js.map +0 -1
  311. package/dist/chunk-X2HRAVDO.js +0 -530
  312. package/dist/chunk-X2HRAVDO.js.map +0 -1
  313. package/dist/chunk-XC3SOOGC.js +0 -1
  314. package/dist/chunk-XC3SOOGC.js.map +0 -1
  315. package/dist/chunk-XQO3EG4J.mjs +0 -348
  316. package/dist/chunk-XQO3EG4J.mjs.map +0 -1
  317. package/dist/chunk-XUI43LEZ.mjs +0 -30
  318. package/dist/chunk-XUI43LEZ.mjs.map +0 -1
  319. package/dist/chunk-YGGUAMHV.js +0 -135
  320. package/dist/chunk-YGGUAMHV.js.map +0 -1
  321. package/dist/chunk-Z4BLTVTB.js +0 -30
  322. package/dist/chunk-Z4BLTVTB.js.map +0 -1
  323. package/dist/chunk-Z7RMCHD4.mjs +0 -282
  324. package/dist/chunk-Z7RMCHD4.mjs.map +0 -1
  325. package/dist/chunk-ZAR4BIOC.js +0 -291
  326. package/dist/chunk-ZAR4BIOC.js.map +0 -1
  327. package/dist/chunk-ZG5MS2TO.js +0 -68
  328. package/dist/chunk-ZG5MS2TO.js.map +0 -1
  329. package/dist/constants.js +0 -8
  330. package/dist/constants.js.map +0 -1
  331. package/dist/crypto-compare-service/crypto-compare.js +0 -10
  332. package/dist/crypto-compare-service/crypto-compare.js.map +0 -1
  333. package/dist/crypto-compare-service/index.js +0 -11
  334. package/dist/crypto-compare-service/index.js.map +0 -1
  335. package/dist/index.js +0 -81
  336. package/dist/index.js.map +0 -1
  337. package/dist/token-prices-service/abstract-token-prices-service.js +0 -1
  338. package/dist/token-prices-service/abstract-token-prices-service.js.map +0 -1
  339. package/dist/token-prices-service/codefi-v2.js +0 -14
  340. package/dist/token-prices-service/codefi-v2.js.map +0 -1
  341. package/dist/token-prices-service/index.js +0 -11
  342. package/dist/token-prices-service/index.js.map +0 -1
  343. package/dist/token-service.js +0 -15
  344. package/dist/token-service.js.map +0 -1
  345. package/dist/tsconfig.build.tsbuildinfo +0 -1
  346. package/dist/types/AccountTrackerController.d.ts.map +0 -1
  347. package/dist/types/AssetsContractController.d.ts.map +0 -1
  348. package/dist/types/CurrencyRateController.d.ts.map +0 -1
  349. package/dist/types/NftController.d.ts.map +0 -1
  350. package/dist/types/NftDetectionController.d.ts.map +0 -1
  351. package/dist/types/RatesController/RatesController.d.ts.map +0 -1
  352. package/dist/types/RatesController/index.d.ts.map +0 -1
  353. package/dist/types/RatesController/types.d.ts.map +0 -1
  354. package/dist/types/Standards/ERC20Standard.d.ts.map +0 -1
  355. package/dist/types/Standards/NftStandards/ERC1155/ERC1155Standard.d.ts.map +0 -1
  356. package/dist/types/Standards/NftStandards/ERC721/ERC721Standard.d.ts.map +0 -1
  357. package/dist/types/TokenBalancesController.d.ts.map +0 -1
  358. package/dist/types/TokenDetectionController.d.ts.map +0 -1
  359. package/dist/types/TokenListController.d.ts.map +0 -1
  360. package/dist/types/TokenRatesController.d.ts.map +0 -1
  361. package/dist/types/TokensController.d.ts.map +0 -1
  362. package/dist/types/assetsUtil.d.ts.map +0 -1
  363. package/dist/types/constants.d.ts.map +0 -1
  364. package/dist/types/crypto-compare-service/crypto-compare.d.ts.map +0 -1
  365. package/dist/types/crypto-compare-service/index.d.ts +0 -2
  366. package/dist/types/crypto-compare-service/index.d.ts.map +0 -1
  367. package/dist/types/index.d.ts.map +0 -1
  368. package/dist/types/token-prices-service/abstract-token-prices-service.d.ts.map +0 -1
  369. package/dist/types/token-prices-service/codefi-v2.d.ts.map +0 -1
  370. package/dist/types/token-prices-service/index.d.ts +0 -3
  371. package/dist/types/token-prices-service/index.d.ts.map +0 -1
  372. package/dist/types/token-service.d.ts.map +0 -1
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchTokenMetadata = exports.fetchTokenListByChainId = exports.TOKEN_METADATA_NO_SUPPORT_ERROR = exports.TOKEN_END_POINT_API = void 0;
4
+ const controller_utils_1 = require("@metamask/controller-utils");
5
+ const assetsUtil_1 = require("./assetsUtil.cjs");
6
+ exports.TOKEN_END_POINT_API = 'https://token.api.cx.metamask.io';
7
+ exports.TOKEN_METADATA_NO_SUPPORT_ERROR = 'TokenService Error: Network does not support fetchTokenMetadata';
8
+ /**
9
+ * Get the tokens URL for a specific network.
10
+ *
11
+ * @param chainId - The chain ID of the network the tokens requested are on.
12
+ * @returns The tokens URL.
13
+ */
14
+ function getTokensURL(chainId) {
15
+ const occurrenceFloor = chainId === controller_utils_1.ChainId['linea-mainnet'] ? 1 : 3;
16
+ // TODO: Either fix this lint violation or explain why it's necessary to ignore.
17
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
18
+ return `${exports.TOKEN_END_POINT_API}/tokens/${(0, controller_utils_1.convertHexToDecimal)(chainId)}?occurrenceFloor=${occurrenceFloor}&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`;
19
+ }
20
+ /**
21
+ * Get the token metadata URL for the given network and token.
22
+ *
23
+ * @param chainId - The chain ID of the network the token is on.
24
+ * @param tokenAddress - The token address.
25
+ * @returns The token metadata URL.
26
+ */
27
+ function getTokenMetadataURL(chainId, tokenAddress) {
28
+ // TODO: Either fix this lint violation or explain why it's necessary to ignore.
29
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
30
+ return `${exports.TOKEN_END_POINT_API}/token/${(0, controller_utils_1.convertHexToDecimal)(chainId)}?address=${tokenAddress}`;
31
+ }
32
+ const tenSecondsInMilliseconds = 10000;
33
+ // Token list averages 1.6 MB in size
34
+ // timeoutFetch by default has a 500ms timeout, which will almost always timeout given the response size.
35
+ const defaultTimeout = tenSecondsInMilliseconds;
36
+ /**
37
+ * Fetch the list of token metadata for a given network. This request is cancellable using the
38
+ * abort signal passed in.
39
+ *
40
+ * @param chainId - The chain ID of the network the requested tokens are on.
41
+ * @param abortSignal - The abort signal used to cancel the request if necessary.
42
+ * @param options - Additional fetch options.
43
+ * @param options.timeout - The fetch timeout.
44
+ * @returns The token list, or `undefined` if the request was cancelled.
45
+ */
46
+ async function fetchTokenListByChainId(chainId, abortSignal, { timeout = defaultTimeout } = {}) {
47
+ const tokenURL = getTokensURL(chainId);
48
+ const response = await queryApi(tokenURL, abortSignal, timeout);
49
+ if (response) {
50
+ const result = await parseJsonResponse(response);
51
+ if (Array.isArray(result) && chainId === controller_utils_1.ChainId['linea-mainnet']) {
52
+ return result.filter((elm) => elm.aggregators.includes('lineaTeam') || elm.aggregators.length >= 3);
53
+ }
54
+ return result;
55
+ }
56
+ return undefined;
57
+ }
58
+ exports.fetchTokenListByChainId = fetchTokenListByChainId;
59
+ /**
60
+ * Fetch metadata for the token address provided for a given network. This request is cancellable
61
+ * using the abort signal passed in.
62
+ *
63
+ * @param chainId - The chain ID of the network the token is on.
64
+ * @param tokenAddress - The address of the token to fetch metadata for.
65
+ * @param abortSignal - The abort signal used to cancel the request if necessary.
66
+ * @param options - Additional fetch options.
67
+ * @param options.timeout - The fetch timeout.
68
+ * @returns The token metadata, or `undefined` if the request was either aborted or failed.
69
+ */
70
+ // TODO: Either fix this lint violation or explain why it's necessary to ignore.
71
+ // eslint-disable-next-line @typescript-eslint/naming-convention
72
+ async function fetchTokenMetadata(chainId, tokenAddress, abortSignal, { timeout = defaultTimeout } = {}) {
73
+ if (!(0, assetsUtil_1.isTokenListSupportedForNetwork)(chainId)) {
74
+ throw new Error(exports.TOKEN_METADATA_NO_SUPPORT_ERROR);
75
+ }
76
+ const tokenMetadataURL = getTokenMetadataURL(chainId, tokenAddress);
77
+ const response = await queryApi(tokenMetadataURL, abortSignal, timeout);
78
+ if (response) {
79
+ return parseJsonResponse(response);
80
+ }
81
+ return undefined;
82
+ }
83
+ exports.fetchTokenMetadata = fetchTokenMetadata;
84
+ /**
85
+ * Perform fetch request against the api.
86
+ *
87
+ * @param apiURL - The URL of the API to fetch.
88
+ * @param abortSignal - The abort signal used to cancel the request if necessary.
89
+ * @param timeout - The fetch timeout.
90
+ * @returns Promise resolving request response.
91
+ */
92
+ async function queryApi(apiURL, abortSignal, timeout) {
93
+ const fetchOptions = {
94
+ referrer: apiURL,
95
+ referrerPolicy: 'no-referrer-when-downgrade',
96
+ method: 'GET',
97
+ mode: 'cors',
98
+ signal: abortSignal,
99
+ cache: 'default',
100
+ };
101
+ fetchOptions.headers = new window.Headers();
102
+ fetchOptions.headers.set('Content-Type', 'application/json');
103
+ try {
104
+ return await (0, controller_utils_1.timeoutFetch)(apiURL, fetchOptions, timeout);
105
+ }
106
+ catch (error) {
107
+ if (error instanceof Error && error.name === 'AbortError') {
108
+ console.log('Request is aborted');
109
+ }
110
+ }
111
+ return undefined;
112
+ }
113
+ /**
114
+ * Parse an API response and return the response JSON data.
115
+ *
116
+ * @param apiResponse - The API response to parse.
117
+ * @returns The response JSON data.
118
+ * @throws Will throw if the response includes an error.
119
+ */
120
+ async function parseJsonResponse(apiResponse) {
121
+ const responseObj = await apiResponse.json();
122
+ // api may return errors as json without setting an error http status code
123
+ if (responseObj?.error) {
124
+ // TODO: Either fix this lint violation or explain why it's necessary to ignore.
125
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
126
+ throw new Error(`TokenService Error: ${responseObj.error}`);
127
+ }
128
+ return responseObj;
129
+ }
130
+ //# sourceMappingURL=token-service.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-service.cjs","sourceRoot":"","sources":["../src/token-service.ts"],"names":[],"mappings":";;;AAAA,iEAIoC;AAGpC,iDAA8D;AAEjD,QAAA,mBAAmB,GAAG,kCAAkC,CAAC;AACzD,QAAA,+BAA+B,GAC1C,iEAAiE,CAAC;AAEpE;;;;;GAKG;AACH,SAAS,YAAY,CAAC,OAAY;IAChC,MAAM,eAAe,GAAG,OAAO,KAAK,0BAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC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qB;IACpD,MAAM,WAAW,GAAG,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;IAC7C,0EAA0E;IAC1E,IAAI,WAAW,EAAE,KAAK,EAAE;QACtB,gFAAgF;QAChF,4EAA4E;QAC5E,MAAM,IAAI,KAAK,CAAC,uBAAuB,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC;KAC7D;IACD,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import {\n ChainId,\n convertHexToDecimal,\n timeoutFetch,\n} from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\n\nimport { isTokenListSupportedForNetwork } from './assetsUtil';\n\nexport const TOKEN_END_POINT_API = 'https://token.api.cx.metamask.io';\nexport const TOKEN_METADATA_NO_SUPPORT_ERROR =\n 'TokenService Error: Network does not support fetchTokenMetadata';\n\n/**\n * Get the tokens URL for a specific network.\n *\n * @param chainId - The chain ID of the network the tokens requested are on.\n * @returns The tokens URL.\n */\nfunction getTokensURL(chainId: Hex) {\n const occurrenceFloor = chainId === ChainId['linea-mainnet'] ? 1 : 3;\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n return `${TOKEN_END_POINT_API}/tokens/${convertHexToDecimal(\n chainId,\n )}?occurrenceFloor=${occurrenceFloor}&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`;\n}\n\n/**\n * Get the token metadata URL for the given network and token.\n *\n * @param chainId - The chain ID of the network the token is on.\n * @param tokenAddress - The token address.\n * @returns The token metadata URL.\n */\nfunction getTokenMetadataURL(chainId: Hex, tokenAddress: string) {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n return `${TOKEN_END_POINT_API}/token/${convertHexToDecimal(\n chainId,\n )}?address=${tokenAddress}`;\n}\n\nconst tenSecondsInMilliseconds = 10_000;\n\n// Token list averages 1.6 MB in size\n// timeoutFetch by default has a 500ms timeout, which will almost always timeout given the response size.\nconst defaultTimeout = tenSecondsInMilliseconds;\n\n/**\n * Fetch the list of token metadata for a given network. This request is cancellable using the\n * abort signal passed in.\n *\n * @param chainId - The chain ID of the network the requested tokens are on.\n * @param abortSignal - The abort signal used to cancel the request if necessary.\n * @param options - Additional fetch options.\n * @param options.timeout - The fetch timeout.\n * @returns The token list, or `undefined` if the request was cancelled.\n */\nexport async function fetchTokenListByChainId(\n chainId: Hex,\n abortSignal: AbortSignal,\n { timeout = defaultTimeout } = {},\n): Promise<unknown> {\n const tokenURL = getTokensURL(chainId);\n const response = await queryApi(tokenURL, abortSignal, timeout);\n if (response) {\n const result = await parseJsonResponse(response);\n if (Array.isArray(result) && chainId === ChainId['linea-mainnet']) {\n return result.filter(\n (elm) =>\n elm.aggregators.includes('lineaTeam') || elm.aggregators.length >= 3,\n );\n }\n return result;\n }\n return undefined;\n}\n\n/**\n * Fetch metadata for the token address provided for a given network. This request is cancellable\n * using the abort signal passed in.\n *\n * @param chainId - The chain ID of the network the token is on.\n * @param tokenAddress - The address of the token to fetch metadata for.\n * @param abortSignal - The abort signal used to cancel the request if necessary.\n * @param options - Additional fetch options.\n * @param options.timeout - The fetch timeout.\n * @returns The token metadata, or `undefined` if the request was either aborted or failed.\n */\n// TODO: Either fix this lint violation or explain why it's necessary to ignore.\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport async function fetchTokenMetadata<T>(\n chainId: Hex,\n tokenAddress: string,\n abortSignal: AbortSignal,\n { timeout = defaultTimeout } = {},\n): Promise<T | undefined> {\n if (!isTokenListSupportedForNetwork(chainId)) {\n throw new Error(TOKEN_METADATA_NO_SUPPORT_ERROR);\n }\n const tokenMetadataURL = getTokenMetadataURL(chainId, tokenAddress);\n const response = await queryApi(tokenMetadataURL, abortSignal, timeout);\n if (response) {\n return parseJsonResponse(response) as Promise<T>;\n }\n return undefined;\n}\n\n/**\n * Perform fetch request against the api.\n *\n * @param apiURL - The URL of the API to fetch.\n * @param abortSignal - The abort signal used to cancel the request if necessary.\n * @param timeout - The fetch timeout.\n * @returns Promise resolving request response.\n */\nasync function queryApi(\n apiURL: string,\n abortSignal: AbortSignal,\n timeout: number,\n): Promise<Response | undefined> {\n const fetchOptions: RequestInit = {\n referrer: apiURL,\n referrerPolicy: 'no-referrer-when-downgrade',\n method: 'GET',\n mode: 'cors',\n signal: abortSignal,\n cache: 'default',\n };\n fetchOptions.headers = new window.Headers();\n fetchOptions.headers.set('Content-Type', 'application/json');\n try {\n return await timeoutFetch(apiURL, fetchOptions, timeout);\n } catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n console.log('Request is aborted');\n }\n }\n return undefined;\n}\n\n/**\n * Parse an API response and return the response JSON data.\n *\n * @param apiResponse - The API response to parse.\n * @returns The response JSON data.\n * @throws Will throw if the response includes an error.\n */\nasync function parseJsonResponse(apiResponse: Response): Promise<unknown> {\n const responseObj = await apiResponse.json();\n // api may return errors as json without setting an error http status code\n if (responseObj?.error) {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`TokenService Error: ${responseObj.error}`);\n }\n return responseObj;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { Hex } from '@metamask/utils';
1
+ import type { Hex } from "@metamask/utils";
2
2
  export declare const TOKEN_END_POINT_API = "https://token.api.cx.metamask.io";
3
3
  export declare const TOKEN_METADATA_NO_SUPPORT_ERROR = "TokenService Error: Network does not support fetchTokenMetadata";
4
4
  /**
@@ -28,4 +28,4 @@ export declare function fetchTokenListByChainId(chainId: Hex, abortSignal: Abort
28
28
  export declare function fetchTokenMetadata<T>(chainId: Hex, tokenAddress: string, abortSignal: AbortSignal, { timeout }?: {
29
29
  timeout?: number | undefined;
30
30
  }): Promise<T | undefined>;
31
- //# sourceMappingURL=token-service.d.ts.map
31
+ //# sourceMappingURL=token-service.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-service.d.cts","sourceRoot":"","sources":["../src/token-service.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAI3C,eAAO,MAAM,mBAAmB,qCAAqC,CAAC;AACtE,eAAO,MAAM,+BAA+B,oEACuB,CAAC;AAsCpE;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,WAAW,EACxB,EAAE,OAAwB,EAAE;;CAAK,GAChC,OAAO,CAAC,OAAO,CAAC,CAclB;AAED;;;;;;;;;;GAUG;AAGH,wBAAsB,kBAAkB,CAAC,CAAC,EACxC,OAAO,EAAE,GAAG,EACZ,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,WAAW,EACxB,EAAE,OAAwB,EAAE;;CAAK,GAChC,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAUxB"}
@@ -0,0 +1,31 @@
1
+ import type { Hex } from "@metamask/utils";
2
+ export declare const TOKEN_END_POINT_API = "https://token.api.cx.metamask.io";
3
+ export declare const TOKEN_METADATA_NO_SUPPORT_ERROR = "TokenService Error: Network does not support fetchTokenMetadata";
4
+ /**
5
+ * Fetch the list of token metadata for a given network. This request is cancellable using the
6
+ * abort signal passed in.
7
+ *
8
+ * @param chainId - The chain ID of the network the requested tokens are on.
9
+ * @param abortSignal - The abort signal used to cancel the request if necessary.
10
+ * @param options - Additional fetch options.
11
+ * @param options.timeout - The fetch timeout.
12
+ * @returns The token list, or `undefined` if the request was cancelled.
13
+ */
14
+ export declare function fetchTokenListByChainId(chainId: Hex, abortSignal: AbortSignal, { timeout }?: {
15
+ timeout?: number | undefined;
16
+ }): Promise<unknown>;
17
+ /**
18
+ * Fetch metadata for the token address provided for a given network. This request is cancellable
19
+ * using the abort signal passed in.
20
+ *
21
+ * @param chainId - The chain ID of the network the token is on.
22
+ * @param tokenAddress - The address of the token to fetch metadata for.
23
+ * @param abortSignal - The abort signal used to cancel the request if necessary.
24
+ * @param options - Additional fetch options.
25
+ * @param options.timeout - The fetch timeout.
26
+ * @returns The token metadata, or `undefined` if the request was either aborted or failed.
27
+ */
28
+ export declare function fetchTokenMetadata<T>(chainId: Hex, tokenAddress: string, abortSignal: AbortSignal, { timeout }?: {
29
+ timeout?: number | undefined;
30
+ }): Promise<T | undefined>;
31
+ //# sourceMappingURL=token-service.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-service.d.mts","sourceRoot":"","sources":["../src/token-service.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAI3C,eAAO,MAAM,mBAAmB,qCAAqC,CAAC;AACtE,eAAO,MAAM,+BAA+B,oEACuB,CAAC;AAsCpE;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,WAAW,EACxB,EAAE,OAAwB,EAAE;;CAAK,GAChC,OAAO,CAAC,OAAO,CAAC,CAclB;AAED;;;;;;;;;;GAUG;AAGH,wBAAsB,kBAAkB,CAAC,CAAC,EACxC,OAAO,EAAE,GAAG,EACZ,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,WAAW,EACxB,EAAE,OAAwB,EAAE;;CAAK,GAChC,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAUxB"}
@@ -1,15 +1,125 @@
1
- import {
2
- TOKEN_END_POINT_API,
3
- TOKEN_METADATA_NO_SUPPORT_ERROR,
4
- fetchTokenListByChainId,
5
- fetchTokenMetadata
6
- } from "./chunk-AX522TDL.mjs";
7
- import "./chunk-BZEAPSD5.mjs";
8
- import "./chunk-XUI43LEZ.mjs";
9
- export {
10
- TOKEN_END_POINT_API,
11
- TOKEN_METADATA_NO_SUPPORT_ERROR,
12
- fetchTokenListByChainId,
13
- fetchTokenMetadata
14
- };
1
+ import { ChainId, convertHexToDecimal, timeoutFetch } from "@metamask/controller-utils";
2
+ import { isTokenListSupportedForNetwork } from "./assetsUtil.mjs";
3
+ export const TOKEN_END_POINT_API = 'https://token.api.cx.metamask.io';
4
+ export const TOKEN_METADATA_NO_SUPPORT_ERROR = 'TokenService Error: Network does not support fetchTokenMetadata';
5
+ /**
6
+ * Get the tokens URL for a specific network.
7
+ *
8
+ * @param chainId - The chain ID of the network the tokens requested are on.
9
+ * @returns The tokens URL.
10
+ */
11
+ function getTokensURL(chainId) {
12
+ const occurrenceFloor = chainId === ChainId['linea-mainnet'] ? 1 : 3;
13
+ // TODO: Either fix this lint violation or explain why it's necessary to ignore.
14
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
15
+ return `${TOKEN_END_POINT_API}/tokens/${convertHexToDecimal(chainId)}?occurrenceFloor=${occurrenceFloor}&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`;
16
+ }
17
+ /**
18
+ * Get the token metadata URL for the given network and token.
19
+ *
20
+ * @param chainId - The chain ID of the network the token is on.
21
+ * @param tokenAddress - The token address.
22
+ * @returns The token metadata URL.
23
+ */
24
+ function getTokenMetadataURL(chainId, tokenAddress) {
25
+ // TODO: Either fix this lint violation or explain why it's necessary to ignore.
26
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
27
+ return `${TOKEN_END_POINT_API}/token/${convertHexToDecimal(chainId)}?address=${tokenAddress}`;
28
+ }
29
+ const tenSecondsInMilliseconds = 10000;
30
+ // Token list averages 1.6 MB in size
31
+ // timeoutFetch by default has a 500ms timeout, which will almost always timeout given the response size.
32
+ const defaultTimeout = tenSecondsInMilliseconds;
33
+ /**
34
+ * Fetch the list of token metadata for a given network. This request is cancellable using the
35
+ * abort signal passed in.
36
+ *
37
+ * @param chainId - The chain ID of the network the requested tokens are on.
38
+ * @param abortSignal - The abort signal used to cancel the request if necessary.
39
+ * @param options - Additional fetch options.
40
+ * @param options.timeout - The fetch timeout.
41
+ * @returns The token list, or `undefined` if the request was cancelled.
42
+ */
43
+ export async function fetchTokenListByChainId(chainId, abortSignal, { timeout = defaultTimeout } = {}) {
44
+ const tokenURL = getTokensURL(chainId);
45
+ const response = await queryApi(tokenURL, abortSignal, timeout);
46
+ if (response) {
47
+ const result = await parseJsonResponse(response);
48
+ if (Array.isArray(result) && chainId === ChainId['linea-mainnet']) {
49
+ return result.filter((elm) => elm.aggregators.includes('lineaTeam') || elm.aggregators.length >= 3);
50
+ }
51
+ return result;
52
+ }
53
+ return undefined;
54
+ }
55
+ /**
56
+ * Fetch metadata for the token address provided for a given network. This request is cancellable
57
+ * using the abort signal passed in.
58
+ *
59
+ * @param chainId - The chain ID of the network the token is on.
60
+ * @param tokenAddress - The address of the token to fetch metadata for.
61
+ * @param abortSignal - The abort signal used to cancel the request if necessary.
62
+ * @param options - Additional fetch options.
63
+ * @param options.timeout - The fetch timeout.
64
+ * @returns The token metadata, or `undefined` if the request was either aborted or failed.
65
+ */
66
+ // TODO: Either fix this lint violation or explain why it's necessary to ignore.
67
+ // eslint-disable-next-line @typescript-eslint/naming-convention
68
+ export async function fetchTokenMetadata(chainId, tokenAddress, abortSignal, { timeout = defaultTimeout } = {}) {
69
+ if (!isTokenListSupportedForNetwork(chainId)) {
70
+ throw new Error(TOKEN_METADATA_NO_SUPPORT_ERROR);
71
+ }
72
+ const tokenMetadataURL = getTokenMetadataURL(chainId, tokenAddress);
73
+ const response = await queryApi(tokenMetadataURL, abortSignal, timeout);
74
+ if (response) {
75
+ return parseJsonResponse(response);
76
+ }
77
+ return undefined;
78
+ }
79
+ /**
80
+ * Perform fetch request against the api.
81
+ *
82
+ * @param apiURL - The URL of the API to fetch.
83
+ * @param abortSignal - The abort signal used to cancel the request if necessary.
84
+ * @param timeout - The fetch timeout.
85
+ * @returns Promise resolving request response.
86
+ */
87
+ async function queryApi(apiURL, abortSignal, timeout) {
88
+ const fetchOptions = {
89
+ referrer: apiURL,
90
+ referrerPolicy: 'no-referrer-when-downgrade',
91
+ method: 'GET',
92
+ mode: 'cors',
93
+ signal: abortSignal,
94
+ cache: 'default',
95
+ };
96
+ fetchOptions.headers = new window.Headers();
97
+ fetchOptions.headers.set('Content-Type', 'application/json');
98
+ try {
99
+ return await timeoutFetch(apiURL, fetchOptions, timeout);
100
+ }
101
+ catch (error) {
102
+ if (error instanceof Error && error.name === 'AbortError') {
103
+ console.log('Request is aborted');
104
+ }
105
+ }
106
+ return undefined;
107
+ }
108
+ /**
109
+ * Parse an API response and return the response JSON data.
110
+ *
111
+ * @param apiResponse - The API response to parse.
112
+ * @returns The response JSON data.
113
+ * @throws Will throw if the response includes an error.
114
+ */
115
+ async function parseJsonResponse(apiResponse) {
116
+ const responseObj = await apiResponse.json();
117
+ // api may return errors as json without setting an error http status code
118
+ if (responseObj?.error) {
119
+ // TODO: Either fix this lint violation or explain why it's necessary to ignore.
120
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
121
+ throw new Error(`TokenService Error: ${responseObj.error}`);
122
+ }
123
+ return responseObj;
124
+ }
15
125
  //# sourceMappingURL=token-service.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"file":"token-service.mjs","sourceRoot":"","sources":["../src/token-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,YAAY,EACb,mCAAmC;AAGpC,OAAO,EAAE,8BAA8B,EAAE,yBAAqB;AAE9D,MAAM,CAAC,MAAM,mBAAmB,GAAG,kCAAkC,CAAC;AACtE,MAAM,CAAC,MAAM,+BAA+B,GAC1C,iEAAiE,CAAC;AAEpE;;;;;GAKG;AACH,SAAS,YAAY,CAAC,OAAY;IAChC,MAAM,eAAe,GAAG,OAAO,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrE,gFAAgF;IAChF,4EAA4E;IAC5E,OAAO,GAAG,mBAAmB,WAAW,mBAAmB,CACzD,OAAO,CACR,oBAAoB,eAAe,2JAA2J,CAAC;AA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,KAAK,CAAC,uBAAuB,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC;KAC7D;IACD,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import {\n ChainId,\n convertHexToDecimal,\n timeoutFetch,\n} from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\n\nimport { isTokenListSupportedForNetwork } from './assetsUtil';\n\nexport const TOKEN_END_POINT_API = 'https://token.api.cx.metamask.io';\nexport const TOKEN_METADATA_NO_SUPPORT_ERROR =\n 'TokenService Error: Network does not support fetchTokenMetadata';\n\n/**\n * Get the tokens URL for a specific network.\n *\n * @param chainId - The chain ID of the network the tokens requested are on.\n * @returns The tokens URL.\n */\nfunction getTokensURL(chainId: Hex) {\n const occurrenceFloor = chainId === ChainId['linea-mainnet'] ? 1 : 3;\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n return `${TOKEN_END_POINT_API}/tokens/${convertHexToDecimal(\n chainId,\n )}?occurrenceFloor=${occurrenceFloor}&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`;\n}\n\n/**\n * Get the token metadata URL for the given network and token.\n *\n * @param chainId - The chain ID of the network the token is on.\n * @param tokenAddress - The token address.\n * @returns The token metadata URL.\n */\nfunction getTokenMetadataURL(chainId: Hex, tokenAddress: string) {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n return `${TOKEN_END_POINT_API}/token/${convertHexToDecimal(\n chainId,\n )}?address=${tokenAddress}`;\n}\n\nconst tenSecondsInMilliseconds = 10_000;\n\n// Token list averages 1.6 MB in size\n// timeoutFetch by default has a 500ms timeout, which will almost always timeout given the response size.\nconst defaultTimeout = tenSecondsInMilliseconds;\n\n/**\n * Fetch the list of token metadata for a given network. This request is cancellable using the\n * abort signal passed in.\n *\n * @param chainId - The chain ID of the network the requested tokens are on.\n * @param abortSignal - The abort signal used to cancel the request if necessary.\n * @param options - Additional fetch options.\n * @param options.timeout - The fetch timeout.\n * @returns The token list, or `undefined` if the request was cancelled.\n */\nexport async function fetchTokenListByChainId(\n chainId: Hex,\n abortSignal: AbortSignal,\n { timeout = defaultTimeout } = {},\n): Promise<unknown> {\n const tokenURL = getTokensURL(chainId);\n const response = await queryApi(tokenURL, abortSignal, timeout);\n if (response) {\n const result = await parseJsonResponse(response);\n if (Array.isArray(result) && chainId === ChainId['linea-mainnet']) {\n return result.filter(\n (elm) =>\n elm.aggregators.includes('lineaTeam') || elm.aggregators.length >= 3,\n );\n }\n return result;\n }\n return undefined;\n}\n\n/**\n * Fetch metadata for the token address provided for a given network. This request is cancellable\n * using the abort signal passed in.\n *\n * @param chainId - The chain ID of the network the token is on.\n * @param tokenAddress - The address of the token to fetch metadata for.\n * @param abortSignal - The abort signal used to cancel the request if necessary.\n * @param options - Additional fetch options.\n * @param options.timeout - The fetch timeout.\n * @returns The token metadata, or `undefined` if the request was either aborted or failed.\n */\n// TODO: Either fix this lint violation or explain why it's necessary to ignore.\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport async function fetchTokenMetadata<T>(\n chainId: Hex,\n tokenAddress: string,\n abortSignal: AbortSignal,\n { timeout = defaultTimeout } = {},\n): Promise<T | undefined> {\n if (!isTokenListSupportedForNetwork(chainId)) {\n throw new Error(TOKEN_METADATA_NO_SUPPORT_ERROR);\n }\n const tokenMetadataURL = getTokenMetadataURL(chainId, tokenAddress);\n const response = await queryApi(tokenMetadataURL, abortSignal, timeout);\n if (response) {\n return parseJsonResponse(response) as Promise<T>;\n }\n return undefined;\n}\n\n/**\n * Perform fetch request against the api.\n *\n * @param apiURL - The URL of the API to fetch.\n * @param abortSignal - The abort signal used to cancel the request if necessary.\n * @param timeout - The fetch timeout.\n * @returns Promise resolving request response.\n */\nasync function queryApi(\n apiURL: string,\n abortSignal: AbortSignal,\n timeout: number,\n): Promise<Response | undefined> {\n const fetchOptions: RequestInit = {\n referrer: apiURL,\n referrerPolicy: 'no-referrer-when-downgrade',\n method: 'GET',\n mode: 'cors',\n signal: abortSignal,\n cache: 'default',\n };\n fetchOptions.headers = new window.Headers();\n fetchOptions.headers.set('Content-Type', 'application/json');\n try {\n return await timeoutFetch(apiURL, fetchOptions, timeout);\n } catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n console.log('Request is aborted');\n }\n }\n return undefined;\n}\n\n/**\n * Parse an API response and return the response JSON data.\n *\n * @param apiResponse - The API response to parse.\n * @returns The response JSON data.\n * @throws Will throw if the response includes an error.\n */\nasync function parseJsonResponse(apiResponse: Response): Promise<unknown> {\n const responseObj = await apiResponse.json();\n // api may return errors as json without setting an error http status code\n if (responseObj?.error) {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`TokenService Error: ${responseObj.error}`);\n }\n return responseObj;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/assets-controllers",
3
- "version": "37.0.0",
3
+ "version": "38.0.1",
4
4
  "description": "Controllers which manage interactions involving ERC-20, ERC-721, and ERC-1155 tokens (including NFTs)",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -18,23 +18,29 @@
18
18
  "sideEffects": false,
19
19
  "exports": {
20
20
  ".": {
21
- "import": "./dist/index.mjs",
22
- "require": "./dist/index.js",
23
- "types": "./dist/types/index.d.ts"
21
+ "import": {
22
+ "types": "./dist/index.d.mts",
23
+ "default": "./dist/index.mjs"
24
+ },
25
+ "require": {
26
+ "types": "./dist/index.d.cts",
27
+ "default": "./dist/index.cjs"
28
+ }
24
29
  },
25
30
  "./package.json": "./package.json"
26
31
  },
27
- "main": "./dist/index.js",
28
- "types": "./dist/types/index.d.ts",
32
+ "main": "./dist/index.cjs",
33
+ "types": "./dist/index.d.cts",
29
34
  "files": [
30
35
  "dist/"
31
36
  ],
32
37
  "scripts": {
33
- "build": "tsup --config ../../tsup.config.ts --tsconfig ./tsconfig.build.json --clean",
38
+ "build": "ts-bridge --project tsconfig.build.json --verbose --clean --no-references",
34
39
  "build:docs": "typedoc",
35
40
  "changelog:update": "../../scripts/update-changelog.sh @metamask/assets-controllers",
36
41
  "changelog:validate": "../../scripts/validate-changelog.sh @metamask/assets-controllers",
37
42
  "publish:preview": "yarn npm publish --tag preview",
43
+ "since-latest-release": "../../scripts/since-latest-release.sh",
38
44
  "test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
39
45
  "test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
40
46
  "test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
@@ -47,12 +53,12 @@
47
53
  "@ethersproject/contracts": "^5.7.0",
48
54
  "@ethersproject/providers": "^5.7.0",
49
55
  "@metamask/abi-utils": "^2.0.3",
50
- "@metamask/base-controller": "^6.0.2",
56
+ "@metamask/base-controller": "^7.0.1",
51
57
  "@metamask/contract-metadata": "^2.4.0",
52
- "@metamask/controller-utils": "^11.0.2",
58
+ "@metamask/controller-utils": "^11.3.0",
53
59
  "@metamask/eth-query": "^4.0.0",
54
60
  "@metamask/metamask-eth-abis": "^3.1.1",
55
- "@metamask/polling-controller": "^9.0.1",
61
+ "@metamask/polling-controller": "^10.0.1",
56
62
  "@metamask/rpc-errors": "^6.3.1",
57
63
  "@metamask/utils": "^9.1.0",
58
64
  "@types/bn.js": "^5.1.5",
@@ -67,14 +73,14 @@
67
73
  "uuid": "^8.3.2"
68
74
  },
69
75
  "devDependencies": {
70
- "@metamask/accounts-controller": "^18.0.0",
71
- "@metamask/approval-controller": "^7.0.2",
76
+ "@metamask/accounts-controller": "^18.2.1",
77
+ "@metamask/approval-controller": "^7.0.4",
72
78
  "@metamask/auto-changelog": "^3.4.4",
73
79
  "@metamask/ethjs-provider-http": "^0.3.0",
74
- "@metamask/keyring-api": "^8.0.1",
75
- "@metamask/keyring-controller": "^17.1.2",
76
- "@metamask/network-controller": "^20.1.0",
77
- "@metamask/preferences-controller": "^13.0.1",
80
+ "@metamask/keyring-api": "^8.1.0",
81
+ "@metamask/keyring-controller": "^17.2.1",
82
+ "@metamask/network-controller": "^21.0.1",
83
+ "@metamask/preferences-controller": "^13.0.3",
78
84
  "@types/jest": "^27.4.1",
79
85
  "@types/lodash": "^4.14.191",
80
86
  "@types/node": "^16.18.54",
@@ -86,13 +92,13 @@
86
92
  "ts-jest": "^27.1.4",
87
93
  "typedoc": "^0.24.8",
88
94
  "typedoc-plugin-missing-exports": "^2.0.0",
89
- "typescript": "~5.0.4"
95
+ "typescript": "~5.2.2"
90
96
  },
91
97
  "peerDependencies": {
92
98
  "@metamask/accounts-controller": "^18.0.0",
93
99
  "@metamask/approval-controller": "^7.0.0",
94
100
  "@metamask/keyring-controller": "^17.0.0",
95
- "@metamask/network-controller": "^20.0.0",
101
+ "@metamask/network-controller": "^21.0.0",
96
102
  "@metamask/preferences-controller": "^13.0.0"
97
103
  },
98
104
  "engines": {
@@ -1,10 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
- var _chunkHVOIBGYNjs = require('./chunk-HVOIBGYN.js');
5
- require('./chunk-Z4BLTVTB.js');
6
-
7
-
8
-
9
- exports.AccountTrackerController = _chunkHVOIBGYNjs.AccountTrackerController; exports.default = _chunkHVOIBGYNjs.AccountTrackerController_default;
10
- //# sourceMappingURL=AccountTrackerController.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
- var _chunkGHG3DOUKjs = require('./chunk-GHG3DOUK.js');
7
- require('./chunk-ISK2VSBB.js');
8
- require('./chunk-JCR4H6YL.js');
9
- require('./chunk-5QLC2MHV.js');
10
- require('./chunk-MZI3SDQN.js');
11
- require('./chunk-Z4BLTVTB.js');
12
-
13
-
14
-
15
-
16
-
17
- exports.AssetsContractController = _chunkGHG3DOUKjs.AssetsContractController; exports.MISSING_PROVIDER_ERROR = _chunkGHG3DOUKjs.MISSING_PROVIDER_ERROR; exports.SINGLE_CALL_BALANCES_ADDRESS_BY_CHAINID = _chunkGHG3DOUKjs.SINGLE_CALL_BALANCES_ADDRESS_BY_CHAINID; exports.default = _chunkGHG3DOUKjs.AssetsContractController_default;
18
- //# sourceMappingURL=AssetsContractController.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,12 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
- var _chunkT5ZX5BV7js = require('./chunk-T5ZX5BV7.js');
5
- require('./chunk-7K6PSEAA.js');
6
- require('./chunk-ZG5MS2TO.js');
7
- require('./chunk-Z4BLTVTB.js');
8
-
9
-
10
-
11
- exports.CurrencyRateController = _chunkT5ZX5BV7js.CurrencyRateController; exports.default = _chunkT5ZX5BV7js.CurrencyRateController_default;
12
- //# sourceMappingURL=CurrencyRateController.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,14 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
- var _chunk2TZK6YZAjs = require('./chunk-2TZK6YZA.js');
6
- require('./chunk-RGHTNZQ6.js');
7
- require('./chunk-MZI3SDQN.js');
8
- require('./chunk-Z4BLTVTB.js');
9
-
10
-
11
-
12
-
13
- exports.NftController = _chunk2TZK6YZAjs.NftController; exports.default = _chunk2TZK6YZAjs.NftController_default; exports.getDefaultNftControllerState = _chunk2TZK6YZAjs.getDefaultNftControllerState;
14
- //# sourceMappingURL=NftController.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,16 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
- var _chunkBBCZM5P4js = require('./chunk-BBCZM5P4.js');
7
- require('./chunk-RGHTNZQ6.js');
8
- require('./chunk-MZI3SDQN.js');
9
- require('./chunk-Z4BLTVTB.js');
10
-
11
-
12
-
13
-
14
-
15
- exports.BlockaidResultType = _chunkBBCZM5P4js.BlockaidResultType; exports.MAX_GET_COLLECTION_BATCH_SIZE = _chunkBBCZM5P4js.MAX_GET_COLLECTION_BATCH_SIZE; exports.NftDetectionController = _chunkBBCZM5P4js.NftDetectionController; exports.default = _chunkBBCZM5P4js.NftDetectionController_default;
16
- //# sourceMappingURL=NftDetectionController.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,14 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
- var _chunkF6L3DFOZjs = require('../chunk-F6L3DFOZ.js');
6
- require('../chunk-7K6PSEAA.js');
7
- require('../chunk-ZG5MS2TO.js');
8
- require('../chunk-Z4BLTVTB.js');
9
-
10
-
11
-
12
-
13
- exports.Cryptocurrency = _chunkF6L3DFOZjs.Cryptocurrency; exports.RatesController = _chunkF6L3DFOZjs.RatesController; exports.name = _chunkF6L3DFOZjs.name;
14
- //# sourceMappingURL=RatesController.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-XC3SOOGC.js');
2
-
3
-
4
-
5
- var _chunkF6L3DFOZjs = require('../chunk-F6L3DFOZ.js');
6
- require('../chunk-7K6PSEAA.js');
7
- require('../chunk-ZG5MS2TO.js');
8
- require('../chunk-Z4BLTVTB.js');
9
-
10
-
11
-
12
- exports.Cryptocurrency = _chunkF6L3DFOZjs.Cryptocurrency; exports.RatesController = _chunkF6L3DFOZjs.RatesController;
13
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- "use strict";//# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkJCR4H6YLjs = require('../chunk-JCR4H6YL.js');
4
- require('../chunk-MZI3SDQN.js');
5
- require('../chunk-Z4BLTVTB.js');
6
-
7
-
8
- exports.ERC20Standard = _chunkJCR4H6YLjs.ERC20Standard;
9
- //# sourceMappingURL=ERC20Standard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunk5QLC2MHVjs = require('../../../chunk-5QLC2MHV.js');
4
- require('../../../chunk-MZI3SDQN.js');
5
- require('../../../chunk-Z4BLTVTB.js');
6
-
7
-
8
- exports.ERC1155Standard = _chunk5QLC2MHVjs.ERC1155Standard;
9
- //# sourceMappingURL=ERC1155Standard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}