diff --git a/.env.defaults b/.env.defaults new file mode 100644 index 00000000000..d2afdd4594d --- /dev/null +++ b/.env.defaults @@ -0,0 +1,35 @@ +ALCHEMY_API_KEY='key' +AMPLITUDE_EXPERIMENTS_DEPLOYMENT_KEY='key' +AMPLITUDE_PROXY_URL_OVERRIDE='' +API_BASE_URL_OVERRIDE='' +API_BASE_URL_V2_OVERRIDE='' +APPSFLYER_API_KEY='key' +APPSFLYER_APP_ID=123 +DATADOG_CLIENT_TOKEN='key' +DATADOG_PROJECT_ID=123 +FIREBASE_APP_CHECK_DEBUG_TOKEN='token' +FOR_API_URL_OVERRIDE='' +GRAPHQL_URL_OVERRIDE='' +INFURA_KEY='key' +ONESIGNAL_APP_ID=123 +OPENAI_API_KEY='key' +QUICKNODE_ENDPOINT_NAME='name' +QUICKNODE_ENDPOINT_TOKEN='token' +REACT_APP_WALLET_CONNECT_PROJECT_ID=f6b70677d6a36a04b32a25dd638c5396 +SCANTASTIC_API_URL_OVERRIDE='' +SENTRY_DSN='http://sentry.com' +SHAKE_CLIENT_ID=123 +SHAKE_CLIENT_SECRET=123 +SIMPLEHASH_API_KEY='key' +SIMPLEHASH_API_URL='https://api.simplehash.com' +STATSIG_API_KEY='client-000000000000000000000000000000000000000000' +STATSIG_PROXY_URL='https://api.statsig.com' +STATSIG_PROXY_URL_OVERRIDE='' +TRADING_API_KEY='key' +TRADING_API_URL_OVERRIDE='' +UNISWAP_API_KEY='key' +UNITAGS_API_URL_OVERRIDE='' +WALLETCONNECT_PROJECT_ID=123 +WALLETCONNECT_PROJECT_ID_BETA=123 +WALLETCONNECT_PROJECT_ID_DEV=123 +INCLUDE_PROTOTYPE_FEATURES=true diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index f6571f4af95..00000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -yarn g:run-fast-checks - -if command -v git-secrets &> /dev/null -then # only run if git-secrets is installed - # Initialise git-secrets configuration - git-secrets --register-aws > /dev/null - - echo "Running git-secrets..." - # Scans all files that are about to be committed. - git-secrets --pre_commit_hook -- "$@" -fi - -if command -v trufflehog &> /dev/null -then # only run if trufflehog is installed - trufflehog git file://. --since-commit HEAD --only-verified --fail -fi diff --git a/apps/mobile/src/app/migrations.ts b/apps/mobile/src/app/migrations.ts index 6d19894fe3c..3dc940b770a 100644 --- a/apps/mobile/src/app/migrations.ts +++ b/apps/mobile/src/app/migrations.ts @@ -689,11 +689,7 @@ export const migrations = { newState.chains.byChainId = { '1': { isActive: true }, - '10': { isActive: true }, - '56': { isActive: true }, - '137': { isActive: true }, - '8453': { isActive: true }, - '42161': { isActive: true }, + '10000': { isActive: true }, } return newState diff --git a/apps/mobile/src/app/schema.ts b/apps/mobile/src/app/schema.ts index ce562fb0a8d..02441a919b3 100644 --- a/apps/mobile/src/app/schema.ts +++ b/apps/mobile/src/app/schema.ts @@ -13,9 +13,7 @@ export const initialSchema = { chains: { byChainId: { '1': { isActive: true }, - '10': { isActive: true }, - '137': { isActive: true }, - '42161': { isActive: true }, + '10000': { isActive: true }, }, }, favorites: { diff --git a/apps/mobile/src/features/deepLinking/handleSwapLinkSaga.test.ts b/apps/mobile/src/features/deepLinking/handleSwapLinkSaga.test.ts deleted file mode 100644 index fc49c9e4860..00000000000 --- a/apps/mobile/src/features/deepLinking/handleSwapLinkSaga.test.ts +++ /dev/null @@ -1,141 +0,0 @@ -import { URL } from 'react-native-url-polyfill' -import { expectSaga } from 'redux-saga-test-plan' -import { handleSwapLink } from 'src/features/deepLinking/handleSwapLinkSaga' -import { openModal } from 'src/features/modals/modalSlice' -import { DAI, UNI, USDC_UNICHAIN_SEPOLIA } from 'uniswap/src/constants/tokens' -import { UniverseChainId } from 'uniswap/src/features/chains/types' -import { ModalName } from 'uniswap/src/features/telemetry/constants' -import { signerMnemonicAccount } from 'wallet/src/test/fixtures' - -const account = signerMnemonicAccount() - -const formSwapUrl = ( - userAddress?: Address, - chain?: UniverseChainId | number, - inputAddress?: string, - outputAddress?: string, - currencyField?: string, - amount?: string, -): URL => - new URL( - `https://uniswap.org/app?screen=swap -&userAddress=${userAddress} -&inputCurrencyId=${chain}-${inputAddress} -&outputCurrencyId=${chain}-${outputAddress} -¤cyField=${currencyField} -&amount=${amount}`.trim(), - ) - -const swapUrl = formSwapUrl( - account.address, - UniverseChainId.Mainnet, - DAI.address, - UNI[UniverseChainId.Mainnet].address, - 'input', - '100', -) - -const testnetSwapUrl = formSwapUrl( - account.address, - UniverseChainId.Sepolia, - USDC_UNICHAIN_SEPOLIA.address, - UNI[UniverseChainId.Sepolia].address, - 'input', - '100', -) - -const invalidOutputCurrencySwapUrl = formSwapUrl( - account.address, - UniverseChainId.Mainnet, - DAI.address, - undefined, - 'input', - '100', -) - -const invalidInputTokenSwapURl = formSwapUrl( - account.address, - UniverseChainId.Mainnet, - '0x00', - UNI[UniverseChainId.Mainnet].address, - 'input', - '100', -) - -const invalidChainSwapUrl = formSwapUrl( - account.address, - 23, - DAI.address, - UNI[UniverseChainId.Mainnet].address, - 'input', - '100', -) - -const invalidAmountSwapUrl = formSwapUrl( - account.address, - UniverseChainId.Mainnet, - DAI.address, - UNI[UniverseChainId.Mainnet].address, - 'input', - 'not a number', -) - -const invalidCurrencyFieldSwapUrl = formSwapUrl( - account.address, - UniverseChainId.Mainnet, - DAI.address, - UNI[UniverseChainId.Mainnet].address, - 'token1', - '100', -) - -describe(handleSwapLink, () => { - describe('valid inputs', () => { - it('Navigates to the swap screen with all params if all inputs are valid; testnet mode aligned', () => { - return expectSaga(handleSwapLink, swapUrl) - .put(openModal({ name: ModalName.Swap })) - .silentRun() - }) - it('Navigates to the swap screen with all params if all inputs are valid; testnet mode not aligned', () => { - return expectSaga(handleSwapLink, testnetSwapUrl) - .put(openModal({ name: ModalName.Swap })) - .silentRun() - }) - }) - - describe('invalid inputs', () => { - beforeAll(() => { - jest.spyOn(console, 'error').mockImplementation(() => undefined) - }) - - it('Navigates to an empty swap screen if outputCurrency is invalid', () => { - return expectSaga(handleSwapLink, invalidOutputCurrencySwapUrl) - .put(openModal({ name: ModalName.Swap })) - .silentRun() - }) - - it('Navigates to an empty swap screen if inputToken is invalid', () => { - return expectSaga(handleSwapLink, invalidInputTokenSwapURl) - .put(openModal({ name: ModalName.Swap })) - .silentRun() - }) - - it('Navigates to an empty swap screen if the chain is not supported', () => { - return expectSaga(handleSwapLink, invalidChainSwapUrl) - .put(openModal({ name: ModalName.Swap })) - .silentRun() - }) - - it('Navigates to an empty swap screen if the swap amount is invalid', () => { - return expectSaga(handleSwapLink, invalidAmountSwapUrl) - .put(openModal({ name: ModalName.Swap })) - .silentRun() - }) - - it('Navigates to an empty swap screen if currency field is invalid', () => { - return expectSaga(handleSwapLink, invalidCurrencyFieldSwapUrl) - .put(openModal({ name: ModalName.Swap })) - .silentRun() - }) - }) -}) diff --git a/apps/web/.env b/apps/web/.env index d040ae1707f..d4d4f23a47b 100644 --- a/apps/web/.env +++ b/apps/web/.env @@ -2,6 +2,7 @@ ESLINT_NO_DEV_ERRORS=true REACT_APP_AMPLITUDE_PROXY_URL="https://interface.gateway.uniswap.org/v1/amplitude-proxy" REACT_APP_AWS_API_ENDPOINT="https://beta.gateway.uniswap.org/v1/graphql" +REACT_APP_SUBGRAPH_ENDPOINT="http://localhost:3000/subgraphs/name/smartbch" REACT_APP_INFURA_KEY="4bf032f2d38a4ed6bb975b80d6340847" REACT_APP_QUICKNODE_ENDPOINT_NAME="" REACT_APP_QUICKNODE_ENDPOINT_TOKEN="" diff --git a/apps/web/cypress/fixtures/fiatOnRamp/supported-tokens.json b/apps/web/cypress/fixtures/fiatOnRamp/supported-tokens.json index fda2dd50fa1..a44f86361da 100644 --- a/apps/web/cypress/fixtures/fiatOnRamp/supported-tokens.json +++ b/apps/web/cypress/fixtures/fiatOnRamp/supported-tokens.json @@ -7,102 +7,6 @@ "cryptoCurrencyChain": "Ethereum", "chainId": "1", "symbol": "https://images-currency.meld.io/crypto/ETH/symbol.png" - }, - { - "cryptoCurrencyCode": "USDC", - "displayName": "USD Coin", - "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", - "cryptoCurrencyChain": "Ethereum", - "chainId": "1", - "symbol": "https://images-currency.meld.io/crypto/USDC/symbol.png" - }, - { - "cryptoCurrencyCode": "USDT", - "displayName": "Tether", - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "cryptoCurrencyChain": "Ethereum", - "chainId": "1", - "symbol": "https://images-currency.meld.io/crypto/USDT/symbol.png" - }, - { - "cryptoCurrencyCode": "DAI", - "displayName": "Dai", - "address": "0x6b175474e89094c44da98b954eedeac495271d0f", - "cryptoCurrencyChain": "Ethereum", - "chainId": "1", - "symbol": "https://images-currency.meld.io/crypto/DAI/symbol.png" - }, - { - "cryptoCurrencyCode": "WBTC", - "displayName": "Wrapped Bitcoin", - "address": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599", - "cryptoCurrencyChain": "Ethereum", - "chainId": "1", - "symbol": "https://images-currency.meld.io/crypto/WBTC/symbol.png" - }, - { - "cryptoCurrencyCode": "WETH", - "displayName": "Wrapped Ether (ERC-20)", - "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", - "cryptoCurrencyChain": "ethereum", - "chainId": "1", - "symbol": "" - }, - { - "cryptoCurrencyCode": "ETH_BASE", - "displayName": "Ethereum", - "address": null, - "cryptoCurrencyChain": "Base", - "chainId": "8453", - "symbol": "https://images-currency.meld.io/crypto/ETH_BASE/symbol.png" - }, - { - "cryptoCurrencyCode": "USDC_BASE", - "displayName": "USD Coin", - "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", - "cryptoCurrencyChain": "Base", - "chainId": "8453", - "symbol": "https://images-currency.meld.io/crypto/USDC_BASE/symbol.png" - }, - { - "cryptoCurrencyCode": "ETH_OPTIMISM", - "displayName": "Ethereum", - "address": null, - "cryptoCurrencyChain": "Optimism", - "chainId": "10", - "symbol": "https://images-currency.meld.io/crypto/ETH_OPTIMISM/symbol.png" - }, - { - "cryptoCurrencyCode": "USDC_OPTIMISM", - "displayName": "USD Coin", - "address": "0x7f5c764cbc14f9669b88837ca1490cca17c31607", - "cryptoCurrencyChain": "Optimism", - "chainId": "10", - "symbol": "https://images-currency.meld.io/crypto/USDC_OPTIMISM/symbol.png" - }, - { - "cryptoCurrencyCode": "ETH_ARBITRUM", - "displayName": "Ethereum", - "address": null, - "cryptoCurrencyChain": "Arbitrum", - "chainId": "42161", - "symbol": "https://images-currency.meld.io/crypto/ETH_ARBITRUM/symbol.png" - }, - { - "cryptoCurrencyCode": "USDC_ARBITRUM", - "displayName": "USD Coin", - "address": "0xaf88d065e77c8cc2239327c5edb3a432268e5831", - "cryptoCurrencyChain": "Arbitrum", - "chainId": "42161", - "symbol": "https://images-currency.meld.io/crypto/USDC_ARBITRUM/symbol.png" - }, - { - "cryptoCurrencyCode": "MATIC", - "displayName": "Matic", - "address": null, - "cryptoCurrencyChain": "Polygon", - "chainId": "137", - "symbol": "https://images-currency.meld.io/crypto/MATIC/symbol.png" } ] } diff --git a/apps/web/package.json b/apps/web/package.json index 152ec75bba7..ffc9ac32b5b 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -42,11 +42,6 @@ "storybook:test": "test-storybook --excludeTags=\"no-tests\" --testTimeout 60000", "storybook:test:standalone": "concurrently -k -s first -n \"SB BUILD,SB TEST\" -c \"magenta,blue\" \"yarn storybook:build && http-server storybook-static --port 6006 --silent\" \"wait-on --timeout 600000 tcp:127.0.0.1:6006 && yarn storybook:test --maxWorkers=2\"" }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } - }, "lint-staged": { "yarn.lock": [ "yarn deduplicate" @@ -302,6 +297,7 @@ "use-resize-observer": "9.1.0", "utilities": "workspace:^", "uuid": "9.0.0", + "v3-subgraph": "workspace:^", "video-extensions": "1.2.0", "viem": "2.x", "wagmi": "2.9.3", diff --git a/apps/web/public/csp.json b/apps/web/public/csp.json index 1f0d1eae7d2..b84710e55c5 100644 --- a/apps/web/public/csp.json +++ b/apps/web/public/csp.json @@ -26,6 +26,10 @@ "'self'", "blob:", "data:", + "localhost", + "https://*.quartzo.studio", + "https://*.greyh.at", + "https://*.fountainhead.cash", "https://*.alchemy.com", "https://*.arbitrum.io", "https://*.base.org/", @@ -41,6 +45,7 @@ "https://*.quiknode.pro", "https://*.twnodes.com", "https://*.uniswap.org", + "https://*.walletconnect.org", "https://*.walletconnect.com", "https://*.zerion.io", "https://alfajores-forno.celo-testnet.org", diff --git a/apps/web/public/dev-csp.json b/apps/web/public/dev-csp.json index a9f9324ca1a..6bc21e8793c 100644 --- a/apps/web/public/dev-csp.json +++ b/apps/web/public/dev-csp.json @@ -1,5 +1,6 @@ { "connectSrc": [ + "http://127.0.0.1:3000", "http://127.0.0.1:8545", "http://127.0.0.1:8546" ] diff --git a/apps/web/public/index.html b/apps/web/public/index.html index 0096ea9a986..9032d5fa17f 100644 --- a/apps/web/public/index.html +++ b/apps/web/public/index.html @@ -31,10 +31,10 @@ <% const cspDevConfig = require('./dev-csp.json'); %> <% Object.entries(cspDevConfig).forEach(([key, value]) => cspConfig[key] = cspConfig[key].concat(value)) %> <% } %> - + > --> <% } %> @@ -45,7 +45,7 @@ <%= htmlWebpackPlugin.files.js.map((href) => ``).join('\n ') %> - +