diff --git a/app/components/UI/Swaps/utils/index.js b/app/components/UI/Swaps/utils/index.js index 33712553726..622f89dd85e 100644 --- a/app/components/UI/Swaps/utils/index.js +++ b/app/components/UI/Swaps/utils/index.js @@ -4,9 +4,9 @@ import { swapsUtils } from '@metamask/swaps-controller'; import { strings } from '../../../../../locales/i18n'; import AppConstants from '../../../../core/AppConstants'; -const { ETH_CHAIN_ID, BSC_CHAIN_ID, SWAPS_TESTNET_CHAIN_ID, POLYGON_CHAIN_ID } = swapsUtils; +const { ETH_CHAIN_ID, BSC_CHAIN_ID, SWAPS_TESTNET_CHAIN_ID, POLYGON_CHAIN_ID, AVALANCHE_CHAIN_ID } = swapsUtils; -const allowedChainIds = [ETH_CHAIN_ID, BSC_CHAIN_ID, POLYGON_CHAIN_ID, SWAPS_TESTNET_CHAIN_ID]; +const allowedChainIds = [ETH_CHAIN_ID, BSC_CHAIN_ID, POLYGON_CHAIN_ID, AVALANCHE_CHAIN_ID, SWAPS_TESTNET_CHAIN_ID]; export function isSwapsAllowed(chainId) { if (!AppConstants.SWAPS.ACTIVE) { diff --git a/app/core/Engine.js b/app/core/Engine.js index 4be8a7c9d5c..b429a2d8f8b 100644 --- a/app/core/Engine.js +++ b/app/core/Engine.js @@ -237,6 +237,13 @@ class Engine { fetchAggregatorMetadataThreshold: AppConstants.SWAPS.CACHE_AGGREGATOR_METADATA_THRESHOLD, fetchTokensThreshold: AppConstants.SWAPS.CACHE_TOKENS_THRESHOLD, fetchTopAssetsThreshold: AppConstants.SWAPS.CACHE_TOP_ASSETS_THRESHOLD, + supportedChainIds: [ + swapsUtils.ETH_CHAIN_ID, + swapsUtils.BSC_CHAIN_ID, + swapsUtils.SWAPS_TESTNET_CHAIN_ID, + swapsUtils.POLYGON_CHAIN_ID, + swapsUtils.AVALANCHE_CHAIN_ID, + ], } ), gasFeeController, diff --git a/package.json b/package.json index 54aa255f9f8..9fea3af85e0 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "@metamask/contract-metadata": "^1.30.0", "@metamask/controllers": "^22.0.0", "@metamask/etherscan-link": "^2.0.0", - "@metamask/swaps-controller": "^6.3.0", + "@metamask/swaps-controller": "^6.5.0", "@react-native-clipboard/clipboard": "^1.8.4", "@react-native-community/async-storage": "1.12.1", "@react-native-community/blur": "^3.6.0", diff --git a/yarn.lock b/yarn.lock index dafdf08dc68..b094fc8a2b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2153,19 +2153,19 @@ resolved "https://registry.yarnpkg.com/@lavamoat/preinstall-always-fail/-/preinstall-always-fail-1.0.0.tgz#e78a6e3d9e212a4fef869ec37d4f5fb498dea373" integrity sha512-vD2DcC0ffJj1w2y1Lu0OU39wHmlPEd2tCDW04Bm6Kf4LyRnCHCezTsS8yzeSJ+4so7XP+TITuR5FGJRWxPb+GA== -"@metamask/contract-metadata@^1.29.0", "@metamask/contract-metadata@^1.30.0", "@metamask/contract-metadata@^1.31.0": +"@metamask/contract-metadata@^1.30.0", "@metamask/contract-metadata@^1.31.0": version "1.30.0" resolved "https://registry.yarnpkg.com/@metamask/contract-metadata/-/contract-metadata-1.30.0.tgz#fa8e1b0c3e7aaa963986088f691fb553ffbe3904" integrity sha512-b2usYW/ptQYnE6zhUmr4T+nvOAQJK5ABcpKudyQANpy4K099elpv4aN0WcrcOcwV99NHOdMzFP3ZuG0HoAyOBQ== -"@metamask/controllers@^15.0.1": - version "15.1.0" - resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-15.1.0.tgz#f480e7bdfb8c4a31ea8b21214b919478df507cab" - integrity sha512-LCz23ZsJRD9SYWPYdSthP5SLKI40XJaVflUOF4VxDnaEA9DKmCVI3Y9TzjJITT3cRIQXD6Z5fEIGBRrZHXkufQ== +"@metamask/controllers@^22.0.0": + version "22.0.0" + resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-22.0.0.tgz#54f172be2ae7e32ce47536a1ff06e35cc6ee3c80" + integrity sha512-5m4aT+B87IOAvvlbfgqI5n7Pd6VSQUjHBfm34qMBBL5jjUFUSfK6BL0h6ef2jxTE2VCuyBibQ8A7sETQ1+Hd+Q== dependencies: "@ethereumjs/common" "^2.3.1" "@ethereumjs/tx" "^3.2.1" - "@metamask/contract-metadata" "^1.29.0" + "@metamask/contract-metadata" "^1.31.0" "@types/uuid" "^8.3.0" abort-controller "^3.0.0" async-mutex "^0.2.6" @@ -2184,10 +2184,12 @@ ethjs-unit "^0.1.6" ethjs-util "^0.1.6" human-standard-collectible-abi "^1.0.2" + human-standard-multi-collectible-abi "^1.0.4" human-standard-token-abi "^2.0.0" immer "^9.0.6" isomorphic-fetch "^3.0.0" jsonschema "^1.2.4" + multiformats "^9.5.2" nanoid "^3.1.12" punycode "^2.1.1" single-call-balance-checker-abi "^1.0.0" @@ -2195,14 +2197,15 @@ web3 "^0.20.7" web3-provider-engine "^16.0.3" -"@metamask/controllers@^22.0.0": - version "22.0.0" - resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-22.0.0.tgz#54f172be2ae7e32ce47536a1ff06e35cc6ee3c80" - integrity sha512-5m4aT+B87IOAvvlbfgqI5n7Pd6VSQUjHBfm34qMBBL5jjUFUSfK6BL0h6ef2jxTE2VCuyBibQ8A7sETQ1+Hd+Q== +"@metamask/controllers@^25.1.0": + version "25.1.0" + resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-25.1.0.tgz#2efee24a9a2b03ab2a2b0422c8f250931c269560" + integrity sha512-syndn2lIhtlACzaqjDrw23dJzw8pZ6en4Cr35C7B9RRS87EhahUqkPP73moAzLtvbyqtBlAUO1HHrqV3lw4E5g== dependencies: "@ethereumjs/common" "^2.3.1" "@ethereumjs/tx" "^3.2.1" "@metamask/contract-metadata" "^1.31.0" + "@metamask/metamask-eth-abis" "^2.1.0" "@types/uuid" "^8.3.0" abort-controller "^3.0.0" async-mutex "^0.2.6" @@ -2219,15 +2222,11 @@ ethereumjs-wallet "^1.0.1" ethers "^5.4.1" ethjs-unit "^0.1.6" - ethjs-util "^0.1.6" - human-standard-collectible-abi "^1.0.2" - human-standard-multi-collectible-abi "^1.0.4" - human-standard-token-abi "^2.0.0" immer "^9.0.6" isomorphic-fetch "^3.0.0" jsonschema "^1.2.4" multiformats "^9.5.2" - nanoid "^3.1.12" + nanoid "^3.1.31" punycode "^2.1.1" single-call-balance-checker-abi "^1.0.0" uuid "^8.3.2" @@ -2249,6 +2248,11 @@ resolved "https://registry.yarnpkg.com/@metamask/etherscan-link/-/etherscan-link-2.1.0.tgz#c0be8e68445b7b83cf85bcc03a56cdf8e256c973" integrity sha512-ADuWlTUkFfN2vXlz81Bg/0BA+XRor+CdK1055p6k7H6BLIPoDKn9SBOFld9haQFuR9cKh/JYHcnlSIv5R4fUEw== +"@metamask/metamask-eth-abis@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@metamask/metamask-eth-abis/-/metamask-eth-abis-2.1.0.tgz#316c2e72373506f1a0120b76e432760a27eb6806" + integrity sha512-T8LBEB0PQo0N1tZQKZ2K8BGmv+IDLcXkzt8Pn7x0YnwZD6YpCIvKqYM3iy2fJ6wFXeCvRKqpn4K6EqwnkSJAbQ== + "@metamask/mobile-provider@^2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@metamask/mobile-provider/-/mobile-provider-2.1.0.tgz#685b2f6a55d24197af3f26de4dd0bb78e10ac83e" @@ -2259,12 +2263,12 @@ resolved "https://registry.yarnpkg.com/@metamask/safe-event-emitter/-/safe-event-emitter-2.0.0.tgz#af577b477c683fad17c619a78208cede06f9605c" integrity sha512-/kSXhY692qiV1MXu6EeOZvg5nECLclxNXcKCxJ3cXQgYuRymRHpdx/t7JXfsK+JLjwA1e1c1/SBrlQYpusC29Q== -"@metamask/swaps-controller@^6.3.0": - version "6.3.0" - resolved "https://registry.yarnpkg.com/@metamask/swaps-controller/-/swaps-controller-6.3.0.tgz#c250749b8056eb984ddd873d45c57125a1c108a3" - integrity sha512-cmAMICC3z5PS2qbxPvnXkM9wZbSVL0pwrE2wGWQ+V6ucxNeO6m2XwGQfU5XhFLfTvHEg0aWmegrUScG1RE5kZQ== +"@metamask/swaps-controller@^6.5.0": + version "6.5.0" + resolved "https://registry.yarnpkg.com/@metamask/swaps-controller/-/swaps-controller-6.5.0.tgz#b0cf80abecdefc6c6b930b6d954ed6f5bea550d8" + integrity sha512-Q4xYEng6H3ECiQmwF1RpM1rSUdWWiJ8wukclR4DGIu/WSXCIPpcb9lbs/Qyf+uyrYJi5PzuRqcYzhLsFjMvKHg== dependencies: - "@metamask/controllers" "^15.0.1" + "@metamask/controllers" "^25.1.0" abort-controller "^3.0.0" async-mutex "^0.3.1" bignumber.js "^9.0.1"