@metamask-previews/assets-controllers 27.2.0-preview-07ab424 → 27.2.0-preview-a8ffe8e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/AssetsContractController.js +6 -6
  2. package/dist/AssetsContractController.mjs +5 -5
  3. package/dist/NftController.js +3 -5
  4. package/dist/NftController.mjs +2 -4
  5. package/dist/NftDetectionController.js +4 -4
  6. package/dist/NftDetectionController.mjs +3 -3
  7. package/dist/Standards/ERC20Standard.js +3 -3
  8. package/dist/Standards/ERC20Standard.mjs +2 -2
  9. package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.js +3 -3
  10. package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.mjs +2 -2
  11. package/dist/Standards/NftStandards/ERC721/ERC721Standard.js +3 -3
  12. package/dist/Standards/NftStandards/ERC721/ERC721Standard.mjs +2 -2
  13. package/dist/TokenDetectionController.js +3 -3
  14. package/dist/TokenDetectionController.mjs +2 -2
  15. package/dist/TokenListController.js +4 -4
  16. package/dist/TokenListController.mjs +3 -3
  17. package/dist/TokenRatesController.js +3 -3
  18. package/dist/TokenRatesController.mjs +2 -2
  19. package/dist/TokensController.js +6 -6
  20. package/dist/TokensController.mjs +5 -5
  21. package/dist/assetsUtil.js +2 -8
  22. package/dist/assetsUtil.mjs +1 -7
  23. package/dist/{chunk-6NO7Z5DL.js → chunk-3PHIUBM3.js} +4 -4
  24. package/dist/{chunk-KCUSDOIE.mjs → chunk-4OXWUHJZ.mjs} +4 -4
  25. package/dist/{chunk-355MWUUQ.js → chunk-BM7EPTR6.js} +3 -3
  26. package/dist/{chunk-VY7TUOK2.js → chunk-D3N35ABH.js} +3 -3
  27. package/dist/{chunk-RELRWIJN.js → chunk-D6BDJYSK.js} +2 -68
  28. package/dist/chunk-D6BDJYSK.js.map +1 -0
  29. package/dist/{chunk-NUBQRDKI.js → chunk-E2SLNUD4.js} +11 -11
  30. package/dist/{chunk-VHCPQS4X.js → chunk-GCWWC4X3.js} +5 -5
  31. package/dist/{chunk-KRTEFV4Q.mjs → chunk-IURNPMBB.mjs} +2 -2
  32. package/dist/{chunk-WSOHBBCO.js → chunk-JEGLHDNA.js} +42 -56
  33. package/dist/chunk-JEGLHDNA.js.map +1 -0
  34. package/dist/{chunk-GLZ66IRX.mjs → chunk-KDMDWUVX.mjs} +41 -55
  35. package/dist/chunk-KDMDWUVX.mjs.map +1 -0
  36. package/dist/{chunk-MQ7TIWBK.mjs → chunk-KS4MOA2T.mjs} +2 -2
  37. package/dist/{chunk-XEZJ5XMV.js → chunk-LBPVKXXG.js} +5 -5
  38. package/dist/{chunk-CEENXWOB.mjs → chunk-N5H5KDJZ.mjs} +2 -2
  39. package/dist/{chunk-25YSNHCK.mjs → chunk-NHX4QGOD.mjs} +2 -2
  40. package/dist/{chunk-AQIXUBTK.js → chunk-NIXK7RMZ.js} +74 -127
  41. package/dist/chunk-NIXK7RMZ.js.map +1 -0
  42. package/dist/{chunk-KSGMD24G.js → chunk-Q6TLNHYC.js} +7 -7
  43. package/dist/{chunk-523YP4Z3.mjs → chunk-QQAG6ECS.mjs} +3 -3
  44. package/dist/{chunk-OE2USEN3.js → chunk-RUPB4ELK.js} +4 -4
  45. package/dist/{chunk-4YU7CT4O.js → chunk-UWALRJ7V.js} +7 -7
  46. package/dist/{chunk-WIVSZVF4.mjs → chunk-XNVBYRLY.mjs} +2 -2
  47. package/dist/{chunk-ZKJSG4TA.mjs → chunk-XSFM6BLC.mjs} +2 -2
  48. package/dist/{chunk-IFJWX5RY.mjs → chunk-YJNCY2LB.mjs} +74 -127
  49. package/dist/chunk-YJNCY2LB.mjs.map +1 -0
  50. package/dist/{chunk-76KGJJJV.mjs → chunk-ZM42FNAQ.mjs} +5 -5
  51. package/dist/{chunk-E5PIGGYR.mjs → chunk-ZPAX2HLQ.mjs} +1 -67
  52. package/dist/chunk-ZPAX2HLQ.mjs.map +1 -0
  53. package/dist/index.js +13 -13
  54. package/dist/index.mjs +16 -16
  55. package/dist/token-service.js +3 -3
  56. package/dist/token-service.mjs +2 -2
  57. package/dist/tsconfig.build.tsbuildinfo +1 -1
  58. package/dist/types/NftController.d.ts +12 -87
  59. package/dist/types/NftController.d.ts.map +1 -1
  60. package/dist/types/NftDetectionController.d.ts +184 -0
  61. package/dist/types/NftDetectionController.d.ts.map +1 -1
  62. package/dist/types/assetsUtil.d.ts +1 -21
  63. package/dist/types/assetsUtil.d.ts.map +1 -1
  64. package/package.json +1 -1
  65. package/dist/chunk-AQIXUBTK.js.map +0 -1
  66. package/dist/chunk-E5PIGGYR.mjs.map +0 -1
  67. package/dist/chunk-GLZ66IRX.mjs.map +0 -1
  68. package/dist/chunk-IFJWX5RY.mjs.map +0 -1
  69. package/dist/chunk-RELRWIJN.js.map +0 -1
  70. package/dist/chunk-WSOHBBCO.js.map +0 -1
  71. /package/dist/{chunk-6NO7Z5DL.js.map → chunk-3PHIUBM3.js.map} +0 -0
  72. /package/dist/{chunk-KCUSDOIE.mjs.map → chunk-4OXWUHJZ.mjs.map} +0 -0
  73. /package/dist/{chunk-355MWUUQ.js.map → chunk-BM7EPTR6.js.map} +0 -0
  74. /package/dist/{chunk-VY7TUOK2.js.map → chunk-D3N35ABH.js.map} +0 -0
  75. /package/dist/{chunk-NUBQRDKI.js.map → chunk-E2SLNUD4.js.map} +0 -0
  76. /package/dist/{chunk-VHCPQS4X.js.map → chunk-GCWWC4X3.js.map} +0 -0
  77. /package/dist/{chunk-KRTEFV4Q.mjs.map → chunk-IURNPMBB.mjs.map} +0 -0
  78. /package/dist/{chunk-MQ7TIWBK.mjs.map → chunk-KS4MOA2T.mjs.map} +0 -0
  79. /package/dist/{chunk-XEZJ5XMV.js.map → chunk-LBPVKXXG.js.map} +0 -0
  80. /package/dist/{chunk-CEENXWOB.mjs.map → chunk-N5H5KDJZ.mjs.map} +0 -0
  81. /package/dist/{chunk-25YSNHCK.mjs.map → chunk-NHX4QGOD.mjs.map} +0 -0
  82. /package/dist/{chunk-KSGMD24G.js.map → chunk-Q6TLNHYC.js.map} +0 -0
  83. /package/dist/{chunk-523YP4Z3.mjs.map → chunk-QQAG6ECS.mjs.map} +0 -0
  84. /package/dist/{chunk-OE2USEN3.js.map → chunk-RUPB4ELK.js.map} +0 -0
  85. /package/dist/{chunk-4YU7CT4O.js.map → chunk-UWALRJ7V.js.map} +0 -0
  86. /package/dist/{chunk-WIVSZVF4.mjs.map → chunk-XNVBYRLY.mjs.map} +0 -0
  87. /package/dist/{chunk-ZKJSG4TA.mjs.map → chunk-XSFM6BLC.mjs.map} +0 -0
  88. /package/dist/{chunk-76KGJJJV.mjs.map → chunk-ZM42FNAQ.mjs.map} +0 -0
@@ -3,16 +3,16 @@
3
3
 
4
4
 
5
5
 
6
- var _chunk4YU7CT4Ojs = require('./chunk-4YU7CT4O.js');
7
- require('./chunk-6NO7Z5DL.js');
8
- require('./chunk-VHCPQS4X.js');
9
- require('./chunk-355MWUUQ.js');
10
- require('./chunk-RELRWIJN.js');
6
+ var _chunkUWALRJ7Vjs = require('./chunk-UWALRJ7V.js');
7
+ require('./chunk-3PHIUBM3.js');
8
+ require('./chunk-GCWWC4X3.js');
9
+ require('./chunk-BM7EPTR6.js');
10
+ require('./chunk-D6BDJYSK.js');
11
11
  require('./chunk-Z4BLTVTB.js');
12
12
 
13
13
 
14
14
 
15
15
 
16
16
 
17
- exports.AssetsContractController = _chunk4YU7CT4Ojs.AssetsContractController; exports.MISSING_PROVIDER_ERROR = _chunk4YU7CT4Ojs.MISSING_PROVIDER_ERROR; exports.SINGLE_CALL_BALANCES_ADDRESS_BY_CHAINID = _chunk4YU7CT4Ojs.SINGLE_CALL_BALANCES_ADDRESS_BY_CHAINID; exports.default = _chunk4YU7CT4Ojs.AssetsContractController_default;
17
+ exports.AssetsContractController = _chunkUWALRJ7Vjs.AssetsContractController; exports.MISSING_PROVIDER_ERROR = _chunkUWALRJ7Vjs.MISSING_PROVIDER_ERROR; exports.SINGLE_CALL_BALANCES_ADDRESS_BY_CHAINID = _chunkUWALRJ7Vjs.SINGLE_CALL_BALANCES_ADDRESS_BY_CHAINID; exports.default = _chunkUWALRJ7Vjs.AssetsContractController_default;
18
18
  //# sourceMappingURL=AssetsContractController.js.map
@@ -3,11 +3,11 @@ import {
3
3
  AssetsContractController_default,
4
4
  MISSING_PROVIDER_ERROR,
5
5
  SINGLE_CALL_BALANCES_ADDRESS_BY_CHAINID
6
- } from "./chunk-KCUSDOIE.mjs";
7
- import "./chunk-WIVSZVF4.mjs";
8
- import "./chunk-CEENXWOB.mjs";
9
- import "./chunk-MQ7TIWBK.mjs";
10
- import "./chunk-E5PIGGYR.mjs";
6
+ } from "./chunk-4OXWUHJZ.mjs";
7
+ import "./chunk-XNVBYRLY.mjs";
8
+ import "./chunk-N5H5KDJZ.mjs";
9
+ import "./chunk-KS4MOA2T.mjs";
10
+ import "./chunk-ZPAX2HLQ.mjs";
11
11
  import "./chunk-XUI43LEZ.mjs";
12
12
  export {
13
13
  AssetsContractController,
@@ -2,15 +2,13 @@
2
2
 
3
3
 
4
4
 
5
-
6
- var _chunkAQIXUBTKjs = require('./chunk-AQIXUBTK.js');
5
+ var _chunkNIXK7RMZjs = require('./chunk-NIXK7RMZ.js');
7
6
  require('./chunk-RGHTNZQ6.js');
8
- require('./chunk-RELRWIJN.js');
7
+ require('./chunk-D6BDJYSK.js');
9
8
  require('./chunk-Z4BLTVTB.js');
10
9
 
11
10
 
12
11
 
13
12
 
14
-
15
- exports.NftController = _chunkAQIXUBTKjs.NftController; exports.OpenSeaV2ChainIds = _chunkAQIXUBTKjs.OpenSeaV2ChainIds; exports.default = _chunkAQIXUBTKjs.NftController_default; exports.getDefaultNftState = _chunkAQIXUBTKjs.getDefaultNftState;
13
+ exports.NftController = _chunkNIXK7RMZjs.NftController; exports.default = _chunkNIXK7RMZjs.NftController_default; exports.getDefaultNftState = _chunkNIXK7RMZjs.getDefaultNftState;
16
14
  //# sourceMappingURL=NftController.js.map
@@ -1,15 +1,13 @@
1
1
  import {
2
2
  NftController,
3
3
  NftController_default,
4
- OpenSeaV2ChainIds,
5
4
  getDefaultNftState
6
- } from "./chunk-IFJWX5RY.mjs";
5
+ } from "./chunk-YJNCY2LB.mjs";
7
6
  import "./chunk-CP3HC7AQ.mjs";
8
- import "./chunk-E5PIGGYR.mjs";
7
+ import "./chunk-ZPAX2HLQ.mjs";
9
8
  import "./chunk-XUI43LEZ.mjs";
10
9
  export {
11
10
  NftController,
12
- OpenSeaV2ChainIds,
13
11
  NftController_default as default,
14
12
  getDefaultNftState
15
13
  };
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkWSOHBBCOjs = require('./chunk-WSOHBBCO.js');
5
- require('./chunk-AQIXUBTK.js');
4
+
5
+ var _chunkJEGLHDNAjs = require('./chunk-JEGLHDNA.js');
6
6
  require('./chunk-RGHTNZQ6.js');
7
- require('./chunk-RELRWIJN.js');
8
7
  require('./chunk-Z4BLTVTB.js');
9
8
 
10
9
 
11
10
 
12
- exports.NftDetectionController = _chunkWSOHBBCOjs.NftDetectionController; exports.default = _chunkWSOHBBCOjs.NftDetectionController_default;
11
+
12
+ exports.BlockaidResultType = _chunkJEGLHDNAjs.BlockaidResultType; exports.NftDetectionController = _chunkJEGLHDNAjs.NftDetectionController; exports.default = _chunkJEGLHDNAjs.NftDetectionController_default;
13
13
  //# sourceMappingURL=NftDetectionController.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
+ BlockaidResultType,
2
3
  NftDetectionController,
3
4
  NftDetectionController_default
4
- } from "./chunk-GLZ66IRX.mjs";
5
- import "./chunk-IFJWX5RY.mjs";
5
+ } from "./chunk-KDMDWUVX.mjs";
6
6
  import "./chunk-CP3HC7AQ.mjs";
7
- import "./chunk-E5PIGGYR.mjs";
8
7
  import "./chunk-XUI43LEZ.mjs";
9
8
  export {
9
+ BlockaidResultType,
10
10
  NftDetectionController,
11
11
  NftDetectionController_default as default
12
12
  };
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk355MWUUQjs = require('../chunk-355MWUUQ.js');
4
- require('../chunk-RELRWIJN.js');
3
+ var _chunkBM7EPTR6js = require('../chunk-BM7EPTR6.js');
4
+ require('../chunk-D6BDJYSK.js');
5
5
  require('../chunk-Z4BLTVTB.js');
6
6
 
7
7
 
8
- exports.ERC20Standard = _chunk355MWUUQjs.ERC20Standard;
8
+ exports.ERC20Standard = _chunkBM7EPTR6js.ERC20Standard;
9
9
  //# sourceMappingURL=ERC20Standard.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ERC20Standard
3
- } from "../chunk-MQ7TIWBK.mjs";
4
- import "../chunk-E5PIGGYR.mjs";
3
+ } from "../chunk-KS4MOA2T.mjs";
4
+ import "../chunk-ZPAX2HLQ.mjs";
5
5
  import "../chunk-XUI43LEZ.mjs";
6
6
  export {
7
7
  ERC20Standard
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkVHCPQS4Xjs = require('../../../chunk-VHCPQS4X.js');
4
- require('../../../chunk-RELRWIJN.js');
3
+ var _chunkGCWWC4X3js = require('../../../chunk-GCWWC4X3.js');
4
+ require('../../../chunk-D6BDJYSK.js');
5
5
  require('../../../chunk-Z4BLTVTB.js');
6
6
 
7
7
 
8
- exports.ERC1155Standard = _chunkVHCPQS4Xjs.ERC1155Standard;
8
+ exports.ERC1155Standard = _chunkGCWWC4X3js.ERC1155Standard;
9
9
  //# sourceMappingURL=ERC1155Standard.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ERC1155Standard
3
- } from "../../../chunk-CEENXWOB.mjs";
4
- import "../../../chunk-E5PIGGYR.mjs";
3
+ } from "../../../chunk-N5H5KDJZ.mjs";
4
+ import "../../../chunk-ZPAX2HLQ.mjs";
5
5
  import "../../../chunk-XUI43LEZ.mjs";
6
6
  export {
7
7
  ERC1155Standard
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk6NO7Z5DLjs = require('../../../chunk-6NO7Z5DL.js');
4
- require('../../../chunk-RELRWIJN.js');
3
+ var _chunk3PHIUBM3js = require('../../../chunk-3PHIUBM3.js');
4
+ require('../../../chunk-D6BDJYSK.js');
5
5
  require('../../../chunk-Z4BLTVTB.js');
6
6
 
7
7
 
8
- exports.ERC721Standard = _chunk6NO7Z5DLjs.ERC721Standard;
8
+ exports.ERC721Standard = _chunk3PHIUBM3js.ERC721Standard;
9
9
  //# sourceMappingURL=ERC721Standard.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ERC721Standard
3
- } from "../../../chunk-WIVSZVF4.mjs";
4
- import "../../../chunk-E5PIGGYR.mjs";
3
+ } from "../../../chunk-XNVBYRLY.mjs";
4
+ import "../../../chunk-ZPAX2HLQ.mjs";
5
5
  import "../../../chunk-XUI43LEZ.mjs";
6
6
  export {
7
7
  ERC721Standard
@@ -4,8 +4,8 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkXEZJ5XMVjs = require('./chunk-XEZJ5XMV.js');
8
- require('./chunk-RELRWIJN.js');
7
+ var _chunkLBPVKXXGjs = require('./chunk-LBPVKXXG.js');
8
+ require('./chunk-D6BDJYSK.js');
9
9
  require('./chunk-Z4BLTVTB.js');
10
10
 
11
11
 
@@ -13,5 +13,5 @@ require('./chunk-Z4BLTVTB.js');
13
13
 
14
14
 
15
15
 
16
- exports.STATIC_MAINNET_TOKEN_LIST = _chunkXEZJ5XMVjs.STATIC_MAINNET_TOKEN_LIST; exports.TokenDetectionController = _chunkXEZJ5XMVjs.TokenDetectionController; exports.controllerName = _chunkXEZJ5XMVjs.controllerName; exports.default = _chunkXEZJ5XMVjs.TokenDetectionController_default; exports.isEqualCaseInsensitive = _chunkXEZJ5XMVjs.isEqualCaseInsensitive;
16
+ exports.STATIC_MAINNET_TOKEN_LIST = _chunkLBPVKXXGjs.STATIC_MAINNET_TOKEN_LIST; exports.TokenDetectionController = _chunkLBPVKXXGjs.TokenDetectionController; exports.controllerName = _chunkLBPVKXXGjs.controllerName; exports.default = _chunkLBPVKXXGjs.TokenDetectionController_default; exports.isEqualCaseInsensitive = _chunkLBPVKXXGjs.isEqualCaseInsensitive;
17
17
  //# sourceMappingURL=TokenDetectionController.js.map
@@ -4,8 +4,8 @@ import {
4
4
  TokenDetectionController_default,
5
5
  controllerName,
6
6
  isEqualCaseInsensitive
7
- } from "./chunk-ZKJSG4TA.mjs";
8
- import "./chunk-E5PIGGYR.mjs";
7
+ } from "./chunk-XSFM6BLC.mjs";
8
+ import "./chunk-ZPAX2HLQ.mjs";
9
9
  import "./chunk-XUI43LEZ.mjs";
10
10
  export {
11
11
  STATIC_MAINNET_TOKEN_LIST,
@@ -2,13 +2,13 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkKSGMD24Gjs = require('./chunk-KSGMD24G.js');
6
- require('./chunk-VY7TUOK2.js');
7
- require('./chunk-RELRWIJN.js');
5
+ var _chunkQ6TLNHYCjs = require('./chunk-Q6TLNHYC.js');
6
+ require('./chunk-D3N35ABH.js');
7
+ require('./chunk-D6BDJYSK.js');
8
8
  require('./chunk-Z4BLTVTB.js');
9
9
 
10
10
 
11
11
 
12
12
 
13
- exports.TokenListController = _chunkKSGMD24Gjs.TokenListController; exports.default = _chunkKSGMD24Gjs.TokenListController_default; exports.getDefaultTokenListState = _chunkKSGMD24Gjs.getDefaultTokenListState;
13
+ exports.TokenListController = _chunkQ6TLNHYCjs.TokenListController; exports.default = _chunkQ6TLNHYCjs.TokenListController_default; exports.getDefaultTokenListState = _chunkQ6TLNHYCjs.getDefaultTokenListState;
14
14
  //# sourceMappingURL=TokenListController.js.map
@@ -2,9 +2,9 @@ import {
2
2
  TokenListController,
3
3
  TokenListController_default,
4
4
  getDefaultTokenListState
5
- } from "./chunk-523YP4Z3.mjs";
6
- import "./chunk-KRTEFV4Q.mjs";
7
- import "./chunk-E5PIGGYR.mjs";
5
+ } from "./chunk-QQAG6ECS.mjs";
6
+ import "./chunk-IURNPMBB.mjs";
7
+ import "./chunk-ZPAX2HLQ.mjs";
8
8
  import "./chunk-XUI43LEZ.mjs";
9
9
  export {
10
10
  TokenListController,
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkOE2USEN3js = require('./chunk-OE2USEN3.js');
4
+ var _chunkRUPB4ELKjs = require('./chunk-RUPB4ELK.js');
5
5
  require('./chunk-DYH5P3VY.js');
6
- require('./chunk-RELRWIJN.js');
6
+ require('./chunk-D6BDJYSK.js');
7
7
  require('./chunk-Z4BLTVTB.js');
8
8
 
9
9
 
10
10
 
11
- exports.TokenRatesController = _chunkOE2USEN3js.TokenRatesController; exports.default = _chunkOE2USEN3js.TokenRatesController_default;
11
+ exports.TokenRatesController = _chunkRUPB4ELKjs.TokenRatesController; exports.default = _chunkRUPB4ELKjs.TokenRatesController_default;
12
12
  //# sourceMappingURL=TokenRatesController.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  TokenRatesController,
3
3
  TokenRatesController_default
4
- } from "./chunk-25YSNHCK.mjs";
4
+ } from "./chunk-NHX4QGOD.mjs";
5
5
  import "./chunk-PWZE6KJV.mjs";
6
- import "./chunk-E5PIGGYR.mjs";
6
+ import "./chunk-ZPAX2HLQ.mjs";
7
7
  import "./chunk-XUI43LEZ.mjs";
8
8
  export {
9
9
  TokenRatesController,
@@ -2,15 +2,15 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkNUBQRDKIjs = require('./chunk-NUBQRDKI.js');
6
- require('./chunk-VHCPQS4X.js');
7
- require('./chunk-355MWUUQ.js');
8
- require('./chunk-VY7TUOK2.js');
9
- require('./chunk-RELRWIJN.js');
5
+ var _chunkE2SLNUD4js = require('./chunk-E2SLNUD4.js');
6
+ require('./chunk-GCWWC4X3.js');
7
+ require('./chunk-BM7EPTR6.js');
8
+ require('./chunk-D3N35ABH.js');
9
+ require('./chunk-D6BDJYSK.js');
10
10
  require('./chunk-Z4BLTVTB.js');
11
11
 
12
12
 
13
13
 
14
14
 
15
- exports.TokensController = _chunkNUBQRDKIjs.TokensController; exports.default = _chunkNUBQRDKIjs.TokensController_default; exports.getDefaultTokensState = _chunkNUBQRDKIjs.getDefaultTokensState;
15
+ exports.TokensController = _chunkE2SLNUD4js.TokensController; exports.default = _chunkE2SLNUD4js.TokensController_default; exports.getDefaultTokensState = _chunkE2SLNUD4js.getDefaultTokensState;
16
16
  //# sourceMappingURL=TokensController.js.map
@@ -2,11 +2,11 @@ import {
2
2
  TokensController,
3
3
  TokensController_default,
4
4
  getDefaultTokensState
5
- } from "./chunk-76KGJJJV.mjs";
6
- import "./chunk-CEENXWOB.mjs";
7
- import "./chunk-MQ7TIWBK.mjs";
8
- import "./chunk-KRTEFV4Q.mjs";
9
- import "./chunk-E5PIGGYR.mjs";
5
+ } from "./chunk-ZM42FNAQ.mjs";
6
+ import "./chunk-N5H5KDJZ.mjs";
7
+ import "./chunk-KS4MOA2T.mjs";
8
+ import "./chunk-IURNPMBB.mjs";
9
+ import "./chunk-ZPAX2HLQ.mjs";
10
10
  import "./chunk-XUI43LEZ.mjs";
11
11
  export {
12
12
  TokensController,
@@ -14,10 +14,7 @@
14
14
 
15
15
 
16
16
 
17
-
18
-
19
-
20
- var _chunkRELRWIJNjs = require('./chunk-RELRWIJN.js');
17
+ var _chunkD6BDJYSKjs = require('./chunk-D6BDJYSK.js');
21
18
  require('./chunk-Z4BLTVTB.js');
22
19
 
23
20
 
@@ -35,8 +32,5 @@ require('./chunk-Z4BLTVTB.js');
35
32
 
36
33
 
37
34
 
38
-
39
-
40
-
41
- exports.SupportedTokenDetectionNetworks = _chunkRELRWIJNjs.SupportedTokenDetectionNetworks; exports.TOKEN_PRICES_BATCH_SIZE = _chunkRELRWIJNjs.TOKEN_PRICES_BATCH_SIZE; exports.addUrlProtocolPrefix = _chunkRELRWIJNjs.addUrlProtocolPrefix; exports.compareNftMetadata = _chunkRELRWIJNjs.compareNftMetadata; exports.divideIntoBatches = _chunkRELRWIJNjs.divideIntoBatches; exports.ethersBigNumberToBN = _chunkRELRWIJNjs.ethersBigNumberToBN; exports.fetchTokenContractExchangeRates = _chunkRELRWIJNjs.fetchTokenContractExchangeRates; exports.formatAggregatorNames = _chunkRELRWIJNjs.formatAggregatorNames; exports.formatIconUrlWithProxy = _chunkRELRWIJNjs.formatIconUrlWithProxy; exports.getFormattedIpfsUrl = _chunkRELRWIJNjs.getFormattedIpfsUrl; exports.getIpfsCIDv1AndPath = _chunkRELRWIJNjs.getIpfsCIDv1AndPath; exports.isTokenDetectionSupportedForNetwork = _chunkRELRWIJNjs.isTokenDetectionSupportedForNetwork; exports.isTokenListSupportedForNetwork = _chunkRELRWIJNjs.isTokenListSupportedForNetwork; exports.mapOpenSeaContractV2ToV1 = _chunkRELRWIJNjs.mapOpenSeaContractV2ToV1; exports.mapOpenSeaDetailedNftV2ToV1 = _chunkRELRWIJNjs.mapOpenSeaDetailedNftV2ToV1; exports.mapOpenSeaNftV2ToV1 = _chunkRELRWIJNjs.mapOpenSeaNftV2ToV1; exports.reduceInBatchesSerially = _chunkRELRWIJNjs.reduceInBatchesSerially; exports.removeIpfsProtocolPrefix = _chunkRELRWIJNjs.removeIpfsProtocolPrefix;
35
+ exports.SupportedTokenDetectionNetworks = _chunkD6BDJYSKjs.SupportedTokenDetectionNetworks; exports.TOKEN_PRICES_BATCH_SIZE = _chunkD6BDJYSKjs.TOKEN_PRICES_BATCH_SIZE; exports.addUrlProtocolPrefix = _chunkD6BDJYSKjs.addUrlProtocolPrefix; exports.compareNftMetadata = _chunkD6BDJYSKjs.compareNftMetadata; exports.divideIntoBatches = _chunkD6BDJYSKjs.divideIntoBatches; exports.ethersBigNumberToBN = _chunkD6BDJYSKjs.ethersBigNumberToBN; exports.fetchTokenContractExchangeRates = _chunkD6BDJYSKjs.fetchTokenContractExchangeRates; exports.formatAggregatorNames = _chunkD6BDJYSKjs.formatAggregatorNames; exports.formatIconUrlWithProxy = _chunkD6BDJYSKjs.formatIconUrlWithProxy; exports.getFormattedIpfsUrl = _chunkD6BDJYSKjs.getFormattedIpfsUrl; exports.getIpfsCIDv1AndPath = _chunkD6BDJYSKjs.getIpfsCIDv1AndPath; exports.isTokenDetectionSupportedForNetwork = _chunkD6BDJYSKjs.isTokenDetectionSupportedForNetwork; exports.isTokenListSupportedForNetwork = _chunkD6BDJYSKjs.isTokenListSupportedForNetwork; exports.reduceInBatchesSerially = _chunkD6BDJYSKjs.reduceInBatchesSerially; exports.removeIpfsProtocolPrefix = _chunkD6BDJYSKjs.removeIpfsProtocolPrefix;
42
36
  //# sourceMappingURL=assetsUtil.js.map
@@ -12,12 +12,9 @@ import {
12
12
  getIpfsCIDv1AndPath,
13
13
  isTokenDetectionSupportedForNetwork,
14
14
  isTokenListSupportedForNetwork,
15
- mapOpenSeaContractV2ToV1,
16
- mapOpenSeaDetailedNftV2ToV1,
17
- mapOpenSeaNftV2ToV1,
18
15
  reduceInBatchesSerially,
19
16
  removeIpfsProtocolPrefix
20
- } from "./chunk-E5PIGGYR.mjs";
17
+ } from "./chunk-ZPAX2HLQ.mjs";
21
18
  import "./chunk-XUI43LEZ.mjs";
22
19
  export {
23
20
  SupportedTokenDetectionNetworks,
@@ -33,9 +30,6 @@ export {
33
30
  getIpfsCIDv1AndPath,
34
31
  isTokenDetectionSupportedForNetwork,
35
32
  isTokenListSupportedForNetwork,
36
- mapOpenSeaContractV2ToV1,
37
- mapOpenSeaDetailedNftV2ToV1,
38
- mapOpenSeaNftV2ToV1,
39
33
  reduceInBatchesSerially,
40
34
  removeIpfsProtocolPrefix
41
35
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkRELRWIJNjs = require('./chunk-RELRWIJN.js');
3
+ var _chunkD6BDJYSKjs = require('./chunk-D6BDJYSK.js');
4
4
 
5
5
  // src/Standards/NftStandards/ERC721/ERC721Standard.ts
6
6
  var _contracts = require('@ethersproject/contracts');
@@ -133,7 +133,7 @@ var ERC721Standard = class {
133
133
  _controllerutils.safelyExecute.call(void 0, () => this.getAssetName(address)),
134
134
  tokenId ? _controllerutils.safelyExecute.call(void 0,
135
135
  () => this.getTokenURI(address, tokenId).then(
136
- (uri) => uri.startsWith("ipfs://") ? _chunkRELRWIJNjs.getFormattedIpfsUrl.call(void 0, ipfsGateway, uri, true) : uri
136
+ (uri) => uri.startsWith("ipfs://") ? _chunkD6BDJYSKjs.getFormattedIpfsUrl.call(void 0, ipfsGateway, uri, true) : uri
137
137
  )
138
138
  ) : void 0
139
139
  ]);
@@ -144,7 +144,7 @@ var ERC721Standard = class {
144
144
  const object = await response.json();
145
145
  image = object?.image;
146
146
  if (image?.startsWith("ipfs://")) {
147
- image = _chunkRELRWIJNjs.getFormattedIpfsUrl.call(void 0, ipfsGateway, image, true);
147
+ image = _chunkD6BDJYSKjs.getFormattedIpfsUrl.call(void 0, ipfsGateway, image, true);
148
148
  }
149
149
  } catch {
150
150
  }
@@ -175,4 +175,4 @@ var ERC721Standard = class {
175
175
 
176
176
 
177
177
  exports.ERC721Standard = ERC721Standard;
178
- //# sourceMappingURL=chunk-6NO7Z5DL.js.map
178
+ //# sourceMappingURL=chunk-3PHIUBM3.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ERC721Standard
3
- } from "./chunk-WIVSZVF4.mjs";
3
+ } from "./chunk-XNVBYRLY.mjs";
4
4
  import {
5
5
  ERC1155Standard
6
- } from "./chunk-CEENXWOB.mjs";
6
+ } from "./chunk-N5H5KDJZ.mjs";
7
7
  import {
8
8
  ERC20Standard
9
- } from "./chunk-MQ7TIWBK.mjs";
9
+ } from "./chunk-KS4MOA2T.mjs";
10
10
 
11
11
  // src/AssetsContractController.ts
12
12
  import { Contract } from "@ethersproject/contracts";
@@ -358,4 +358,4 @@ export {
358
358
  AssetsContractController,
359
359
  AssetsContractController_default
360
360
  };
361
- //# sourceMappingURL=chunk-KCUSDOIE.mjs.map
361
+ //# sourceMappingURL=chunk-4OXWUHJZ.mjs.map
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkRELRWIJNjs = require('./chunk-RELRWIJN.js');
3
+ var _chunkD6BDJYSKjs = require('./chunk-D6BDJYSK.js');
4
4
 
5
5
  // src/Standards/ERC20Standard.ts
6
6
  var _util = require('@ethereumjs/util');
@@ -23,7 +23,7 @@ var ERC20Standard = class {
23
23
  async getBalanceOf(address, selectedAddress) {
24
24
  const contract = new (0, _contracts.Contract)(address, _metamaskethabis.abiERC20, this.provider);
25
25
  const balance = await contract.balanceOf(selectedAddress);
26
- return _chunkRELRWIJNjs.ethersBigNumberToBN.call(void 0, balance);
26
+ return _chunkD6BDJYSKjs.ethersBigNumberToBN.call(void 0, balance);
27
27
  }
28
28
  /**
29
29
  * Query for the decimals for a given ERC20 asset.
@@ -112,4 +112,4 @@ var ERC20Standard = class {
112
112
 
113
113
 
114
114
  exports.ERC20Standard = ERC20Standard;
115
- //# sourceMappingURL=chunk-355MWUUQ.js.map
115
+ //# sourceMappingURL=chunk-BM7EPTR6.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkRELRWIJNjs = require('./chunk-RELRWIJN.js');
3
+ var _chunkD6BDJYSKjs = require('./chunk-D6BDJYSK.js');
4
4
 
5
5
  // src/token-service.ts
6
6
  var _controllerutils = require('@metamask/controller-utils');
@@ -27,7 +27,7 @@ async function fetchTokenListByChainId(chainId, abortSignal, { timeout = default
27
27
  return void 0;
28
28
  }
29
29
  async function fetchTokenMetadata(chainId, tokenAddress, abortSignal, { timeout = defaultTimeout } = {}) {
30
- if (!_chunkRELRWIJNjs.isTokenListSupportedForNetwork.call(void 0, chainId)) {
30
+ if (!_chunkD6BDJYSKjs.isTokenListSupportedForNetwork.call(void 0, chainId)) {
31
31
  throw new Error(TOKEN_METADATA_NO_SUPPORT_ERROR);
32
32
  }
33
33
  const tokenMetadataURL = getTokenMetadataURL(chainId, tokenAddress);
@@ -71,4 +71,4 @@ async function parseJsonResponse(apiResponse) {
71
71
 
72
72
 
73
73
  exports.TOKEN_END_POINT_API = TOKEN_END_POINT_API; exports.TOKEN_METADATA_NO_SUPPORT_ERROR = TOKEN_METADATA_NO_SUPPORT_ERROR; exports.fetchTokenListByChainId = fetchTokenListByChainId; exports.fetchTokenMetadata = fetchTokenMetadata;
74
- //# sourceMappingURL=chunk-VY7TUOK2.js.map
74
+ //# sourceMappingURL=chunk-D3N35ABH.js.map
@@ -144,69 +144,6 @@ async function reduceInBatchesSerially({
144
144
  const finalResult = workingResult;
145
145
  return finalResult;
146
146
  }
147
- function mapOpenSeaNftV2ToV1(nft) {
148
- return {
149
- token_id: nft.identifier,
150
- num_sales: null,
151
- background_color: null,
152
- image_url: nft.image_url ?? null,
153
- image_preview_url: null,
154
- image_thumbnail_url: null,
155
- image_original_url: null,
156
- animation_url: null,
157
- animation_original_url: null,
158
- name: nft.name,
159
- description: nft.description,
160
- external_link: null,
161
- asset_contract: {
162
- address: nft.contract,
163
- asset_contract_type: null,
164
- created_date: null,
165
- schema_name: nft.token_standard.toUpperCase(),
166
- symbol: null,
167
- total_supply: null,
168
- description: nft.description,
169
- external_link: null,
170
- collection: {
171
- name: nft.collection,
172
- image_url: null
173
- }
174
- },
175
- creator: {
176
- user: { username: "" },
177
- profile_img_url: "",
178
- address: ""
179
- },
180
- last_sale: null
181
- };
182
- }
183
- function mapOpenSeaDetailedNftV2ToV1(nft) {
184
- const mapped = mapOpenSeaNftV2ToV1(nft);
185
- return {
186
- ...mapped,
187
- animation_url: nft.animation_url ?? null,
188
- creator: {
189
- ...mapped.creator,
190
- address: nft.creator
191
- }
192
- };
193
- }
194
- function mapOpenSeaContractV2ToV1(contract, collection) {
195
- return {
196
- address: contract.address,
197
- asset_contract_type: null,
198
- created_date: null,
199
- schema_name: contract.contract_standard.toUpperCase(),
200
- symbol: null,
201
- total_supply: collection?.total_supply?.toString() ?? contract.total_supply?.toString() ?? null,
202
- description: collection?.description ?? null,
203
- external_link: collection?.project_url ?? null,
204
- collection: {
205
- name: collection?.name ?? contract.name,
206
- image_url: collection?.image_url
207
- }
208
- };
209
- }
210
147
  async function fetchTokenContractExchangeRates({
211
148
  tokenPricesService,
212
149
  nativeCurrency,
@@ -261,8 +198,5 @@ async function fetchTokenContractExchangeRates({
261
198
 
262
199
 
263
200
 
264
-
265
-
266
-
267
- exports.TOKEN_PRICES_BATCH_SIZE = TOKEN_PRICES_BATCH_SIZE; exports.compareNftMetadata = compareNftMetadata; exports.formatAggregatorNames = formatAggregatorNames; exports.formatIconUrlWithProxy = formatIconUrlWithProxy; exports.SupportedTokenDetectionNetworks = SupportedTokenDetectionNetworks; exports.isTokenDetectionSupportedForNetwork = isTokenDetectionSupportedForNetwork; exports.isTokenListSupportedForNetwork = isTokenListSupportedForNetwork; exports.removeIpfsProtocolPrefix = removeIpfsProtocolPrefix; exports.getIpfsCIDv1AndPath = getIpfsCIDv1AndPath; exports.getFormattedIpfsUrl = getFormattedIpfsUrl; exports.addUrlProtocolPrefix = addUrlProtocolPrefix; exports.ethersBigNumberToBN = ethersBigNumberToBN; exports.divideIntoBatches = divideIntoBatches; exports.reduceInBatchesSerially = reduceInBatchesSerially; exports.mapOpenSeaNftV2ToV1 = mapOpenSeaNftV2ToV1; exports.mapOpenSeaDetailedNftV2ToV1 = mapOpenSeaDetailedNftV2ToV1; exports.mapOpenSeaContractV2ToV1 = mapOpenSeaContractV2ToV1; exports.fetchTokenContractExchangeRates = fetchTokenContractExchangeRates;
268
- //# sourceMappingURL=chunk-RELRWIJN.js.map
201
+ exports.TOKEN_PRICES_BATCH_SIZE = TOKEN_PRICES_BATCH_SIZE; exports.compareNftMetadata = compareNftMetadata; exports.formatAggregatorNames = formatAggregatorNames; exports.formatIconUrlWithProxy = formatIconUrlWithProxy; exports.SupportedTokenDetectionNetworks = SupportedTokenDetectionNetworks; exports.isTokenDetectionSupportedForNetwork = isTokenDetectionSupportedForNetwork; exports.isTokenListSupportedForNetwork = isTokenListSupportedForNetwork; exports.removeIpfsProtocolPrefix = removeIpfsProtocolPrefix; exports.getIpfsCIDv1AndPath = getIpfsCIDv1AndPath; exports.getFormattedIpfsUrl = getFormattedIpfsUrl; exports.addUrlProtocolPrefix = addUrlProtocolPrefix; exports.ethersBigNumberToBN = ethersBigNumberToBN; exports.divideIntoBatches = divideIntoBatches; exports.reduceInBatchesSerially = reduceInBatchesSerially; exports.fetchTokenContractExchangeRates = fetchTokenContractExchangeRates;
202
+ //# sourceMappingURL=chunk-D6BDJYSK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/assetsUtil.ts"],"names":["SupportedTokenDetectionNetworks"],"mappings":"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","sourcesContent":["import type { BigNumber } from '@ethersproject/bignumber';\nimport {\n convertHexToDecimal,\n toChecksumHexAddress,\n} from '@metamask/controller-utils';\nimport type { Hex } from '@metamask/utils';\nimport { remove0x } from '@metamask/utils';\nimport BN from 'bn.js';\nimport { CID } from 'multiformats/cid';\n\nimport type { Nft, NftMetadata } from './NftController';\nimport type { AbstractTokenPricesService } from './token-prices-service';\nimport { type ContractExchangeRates } from './TokenRatesController';\n\n/**\n * The maximum number of token addresses that should be sent to the Price API in\n * a single request.\n */\nexport const TOKEN_PRICES_BATCH_SIZE = 30;\n\n/**\n * Compares nft metadata entries to any nft entry.\n * We need this method when comparing a new fetched nft metadata, in case a entry changed to a defined value,\n * there's a need to update the nft in state.\n *\n * @param newNftMetadata - Nft metadata object.\n * @param nft - Nft object to compare with.\n * @returns Whether there are differences.\n */\nexport function compareNftMetadata(newNftMetadata: NftMetadata, nft: Nft) {\n const keys: (keyof NftMetadata)[] = [\n 'image',\n 'backgroundColor',\n 'imagePreview',\n 'imageThumbnail',\n 'imageOriginal',\n 'animation',\n 'animationOriginal',\n 'externalLink',\n 'tokenURI',\n ];\n const differentValues = keys.reduce((value, key) => {\n if (newNftMetadata[key] && newNftMetadata[key] !== nft[key]) {\n return value + 1;\n }\n return value;\n }, 0);\n return differentValues > 0;\n}\n\nconst aggregatorNameByKey: Record<string, string> = {\n aave: 'Aave',\n bancor: 'Bancor',\n cmc: 'CMC',\n cryptocom: 'Crypto.com',\n coinGecko: 'CoinGecko',\n oneInch: '1inch',\n paraswap: 'Paraswap',\n pmm: 'PMM',\n zapper: 'Zapper',\n zerion: 'Zerion',\n zeroEx: '0x',\n synthetix: 'Synthetix',\n yearn: 'Yearn',\n apeswap: 'ApeSwap',\n binanceDex: 'BinanceDex',\n pancakeTop100: 'PancakeTop100',\n pancakeExtended: 'PancakeExtended',\n balancer: 'Balancer',\n quickswap: 'QuickSwap',\n matcha: 'Matcha',\n pangolinDex: 'PangolinDex',\n pangolinDexStableCoin: 'PangolinDexStableCoin',\n pangolinDexAvaxBridge: 'PangolinDexAvaxBridge',\n traderJoe: 'TraderJoe',\n airswapLight: 'AirswapLight',\n kleros: 'Kleros',\n};\n\n/**\n * Formats aggregator names to presentable format.\n *\n * @param aggregators - List of token list names in camelcase.\n * @returns Formatted aggregator names.\n */\nexport const formatAggregatorNames = (aggregators: string[]) => {\n return aggregators.map(\n (key) =>\n aggregatorNameByKey[key] ||\n `${key[0].toUpperCase()}${key.substring(1, key.length)}`,\n );\n};\n\n/**\n * Format token list assets to use image proxy from Codefi.\n *\n * @param params - Object that contains chainID and tokenAddress.\n * @param params.chainId - ChainID of network in 0x-prefixed hexadecimal format.\n * @param params.tokenAddress - Address of token in mixed or lowercase.\n * @returns Formatted image url\n */\nexport const formatIconUrlWithProxy = ({\n chainId,\n tokenAddress,\n}: {\n chainId: Hex;\n tokenAddress: string;\n}) => {\n const chainIdDecimal = convertHexToDecimal(chainId).toString();\n return `https://static.metafi.codefi.network/api/v1/tokenIcons/${chainIdDecimal}/${tokenAddress.toLowerCase()}.png`;\n};\n\n/**\n * Networks where token detection is supported - Values are in decimal format\n */\nexport enum SupportedTokenDetectionNetworks {\n mainnet = '0x1', // decimal: 1\n bsc = '0x38', // decimal: 56\n polygon = '0x89', // decimal: 137\n avax = '0xa86a', // decimal: 43114\n aurora = '0x4e454152', // decimal: 1313161554\n linea_goerli = '0xe704', // decimal: 59140\n linea_mainnet = '0xe708', // decimal: 59144\n arbitrum = '0xa4b1', // decimal: 42161\n optimism = '0xa', // decimal: 10\n base = '0x2105', // decimal: 8453\n zksync = '0x144', // decimal: 324\n}\n\n/**\n * Check if token detection is enabled for certain networks.\n *\n * @param chainId - ChainID of network\n * @returns Whether the current network supports token detection\n */\nexport function isTokenDetectionSupportedForNetwork(chainId: Hex): boolean {\n return Object.values<Hex>(SupportedTokenDetectionNetworks).includes(chainId);\n}\n\n/**\n * Check if token list polling is enabled for a given network.\n * Currently this method is used to support e2e testing for consumers of this package.\n *\n * @param chainId - ChainID of network\n * @returns Whether the current network supports tokenlists\n */\nexport function isTokenListSupportedForNetwork(chainId: Hex): boolean {\n return isTokenDetectionSupportedForNetwork(chainId);\n}\n\n/**\n * Removes IPFS protocol prefix from input string.\n *\n * @param ipfsUrl - An IPFS url (e.g. ipfs://{content id})\n * @returns IPFS content identifier and (possibly) path in a string\n * @throws Will throw if the url passed is not IPFS.\n */\nexport function removeIpfsProtocolPrefix(ipfsUrl: string) {\n if (ipfsUrl.startsWith('ipfs://ipfs/')) {\n return ipfsUrl.replace('ipfs://ipfs/', '');\n } else if (ipfsUrl.startsWith('ipfs://')) {\n return ipfsUrl.replace('ipfs://', '');\n }\n // this method should not be used with non-ipfs urls (i.e. startsWith('ipfs://') === true)\n throw new Error('this method should not be used with non ipfs urls');\n}\n\n/**\n * Extracts content identifier and path from an input string.\n *\n * @param ipfsUrl - An IPFS URL minus the IPFS protocol prefix\n * @returns IFPS content identifier (cid) and sub path as string.\n * @throws Will throw if the url passed is not ipfs.\n */\nexport function getIpfsCIDv1AndPath(ipfsUrl: string): {\n cid: string;\n path?: string;\n} {\n const url = removeIpfsProtocolPrefix(ipfsUrl);\n\n // check if there is a path\n // (CID is everything preceding first forward slash, path is everything after)\n const index = url.indexOf('/');\n const cid = index !== -1 ? url.substring(0, index) : url;\n const path = index !== -1 ? url.substring(index) : undefined;\n\n // We want to ensure that the CID is v1 (https://docs.ipfs.io/concepts/content-addressing/#identifier-formats)\n // because most cid v0s appear to be incompatible with IPFS subdomains\n return {\n cid: CID.parse(cid).toV1().toString(),\n path,\n };\n}\n\n/**\n * Formats URL correctly for use retrieving assets hosted on IPFS.\n *\n * @param ipfsGateway - The users preferred IPFS gateway (full URL or just host).\n * @param ipfsUrl - The IFPS URL pointed at the asset.\n * @param subdomainSupported - Boolean indicating whether the URL should be formatted with subdomains or not.\n * @returns A formatted URL, with the user's preferred IPFS gateway and format (subdomain or not), pointing to an asset hosted on IPFS.\n */\nexport function getFormattedIpfsUrl(\n ipfsGateway: string,\n ipfsUrl: string,\n subdomainSupported: boolean,\n): string {\n const { host, protocol, origin } = new URL(addUrlProtocolPrefix(ipfsGateway));\n if (subdomainSupported) {\n const { cid, path } = getIpfsCIDv1AndPath(ipfsUrl);\n return `${protocol}//${cid}.ipfs.${host}${path ?? ''}`;\n }\n const cidAndPath = removeIpfsProtocolPrefix(ipfsUrl);\n return `${origin}/ipfs/${cidAndPath}`;\n}\n\n/**\n * Adds URL protocol prefix to input URL string if missing.\n *\n * @param urlString - An IPFS URL.\n * @returns A URL with a https:// prepended.\n */\nexport function addUrlProtocolPrefix(urlString: string): string {\n if (!urlString.match(/(^http:\\/\\/)|(^https:\\/\\/)/u)) {\n return `https://${urlString}`;\n }\n return urlString;\n}\n\n/**\n * Converts an Ethers BigNumber to a BN.\n *\n * @param bigNumber - An Ethers BigNumber instance.\n * @returns A BN object.\n */\nexport function ethersBigNumberToBN(bigNumber: BigNumber): BN {\n return new BN(remove0x(bigNumber.toHexString()), 'hex');\n}\n\n/**\n * Partitions a list of values into groups that are at most `batchSize` in\n * length.\n *\n * @param values - The list of values.\n * @param args - The remaining arguments.\n * @param args.batchSize - The desired maximum number of values per batch.\n * @returns The list of batches.\n */\nexport function divideIntoBatches<Value>(\n values: Value[],\n { batchSize }: { batchSize: number },\n): Value[][] {\n const batches = [];\n for (let i = 0; i < values.length; i += batchSize) {\n batches.push(values.slice(i, i + batchSize));\n }\n return batches;\n}\n\n/**\n * Constructs an object from processing batches of the given values\n * sequentially.\n *\n * @param args - The arguments to this function.\n * @param args.values - A list of values to iterate over.\n * @param args.batchSize - The maximum number of values in each batch.\n * @param args.eachBatch - A function to call for each batch. This function is\n * similar to the function that `Array.prototype.reduce` takes, in that it\n * receives the object that is being built, each batch in the list of batches\n * and the index, and should return an updated version of the object.\n * @param args.initialResult - The initial value of the final data structure,\n * i.e., the value that will be fed into the first call of `eachBatch`.\n * @returns The built object.\n */\nexport async function reduceInBatchesSerially<\n Value,\n Result extends Record<PropertyKey, unknown>,\n>({\n values,\n batchSize,\n eachBatch,\n initialResult,\n}: {\n values: Value[];\n batchSize: number;\n eachBatch: (\n workingResult: Partial<Result>,\n batch: Value[],\n index: number,\n ) => Partial<Result> | Promise<Partial<Result>>;\n initialResult: Partial<Result>;\n}): Promise<Result> {\n const batches = divideIntoBatches(values, { batchSize });\n let workingResult = initialResult;\n for (const [index, batch] of batches.entries()) {\n workingResult = await eachBatch(workingResult, batch, index);\n }\n // There's no way around this — we have to assume that in the end, the result\n // matches the intended type.\n const finalResult = workingResult as Result;\n return finalResult;\n}\n\n/**\n * Retrieves token prices for a set of contract addresses in a specific currency and chainId.\n *\n * @param args - The arguments to function.\n * @param args.tokenPricesService - An object in charge of retrieving token prices.\n * @param args.nativeCurrency - The native currency to request price in.\n * @param args.tokenAddresses - The list of contract addresses.\n * @param args.chainId - The chainId of the tokens.\n * @returns The prices for the requested tokens.\n */\nexport async function fetchTokenContractExchangeRates({\n tokenPricesService,\n nativeCurrency,\n tokenAddresses,\n chainId,\n}: {\n tokenPricesService: AbstractTokenPricesService;\n nativeCurrency: string;\n tokenAddresses: Hex[];\n chainId: Hex;\n}): Promise<ContractExchangeRates> {\n const isChainIdSupported =\n tokenPricesService.validateChainIdSupported(chainId);\n const isCurrencySupported =\n tokenPricesService.validateCurrencySupported(nativeCurrency);\n\n if (!isChainIdSupported || !isCurrencySupported) {\n return {};\n }\n\n const tokenPricesByTokenAddress = await reduceInBatchesSerially<\n Hex,\n Awaited<ReturnType<AbstractTokenPricesService['fetchTokenPrices']>>\n >({\n values: [...tokenAddresses].sort(),\n batchSize: TOKEN_PRICES_BATCH_SIZE,\n eachBatch: async (allTokenPricesByTokenAddress, batch) => {\n const tokenPricesByTokenAddressForBatch =\n await tokenPricesService.fetchTokenPrices({\n tokenAddresses: batch,\n chainId,\n currency: nativeCurrency,\n });\n\n return {\n ...allTokenPricesByTokenAddress,\n ...tokenPricesByTokenAddressForBatch,\n };\n },\n initialResult: {},\n });\n\n return Object.entries(tokenPricesByTokenAddress).reduce(\n (obj, [tokenAddress, tokenPrice]) => {\n return {\n ...obj,\n [toChecksumHexAddress(tokenAddress)]: tokenPrice?.value,\n };\n },\n {},\n );\n}\n"]}