From 800071c38ffa1f9e005c377fa90131275200e682 Mon Sep 17 00:00:00 2001 From: msvstj Date: Wed, 12 Jun 2024 11:43:12 +0300 Subject: [PATCH 1/2] feat: add migrated subgraph, fix build issues --- .../@uniswap+smart-order-router+3.15.0.patch | 35 ++++++++++++++----- .../MiniPortfolio/Activity/parseRemote.tsx | 33 +++++++++-------- .../AccountDrawer/MiniPortfolio/constants.tsx | 2 ++ src/graphql/thegraph/apollo.ts | 4 ++- 4 files changed, 51 insertions(+), 23 deletions(-) diff --git a/patches/@uniswap+smart-order-router+3.15.0.patch b/patches/@uniswap+smart-order-router+3.15.0.patch index 8a315d652a7..f31b91a6818 100644 --- a/patches/@uniswap+smart-order-router+3.15.0.patch +++ b/patches/@uniswap+smart-order-router+3.15.0.patch @@ -168,18 +168,27 @@ index 4e71f87..1412d32 100644 +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhdGljLXN1YmdyYXBoLXByb3ZpZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3Byb3ZpZGVycy92My9zdGF0aWMtc3ViZ3JhcGgtcHJvdmlkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsNkRBQTZEO0FBQzdELGdEQUFtRDtBQUNuRCw0Q0FBa0Q7QUFDbEQsZ0RBQXdCO0FBQ3hCLG9EQUF1QjtBQUV2QixnREFBc0Q7QUFDdEQsOENBQTREO0FBQzVELHdDQUFxQztBQUVyQyxzREE0RDJCO0FBUzNCLE1BQU0sNkJBQTZCLEdBQW1CO0lBQ3BELENBQUMsa0JBQU8sQ0FBQyxPQUFPLENBQUMsRUFBRTtRQUNqQixnQ0FBdUIsQ0FBQyxrQkFBTyxDQUFDLE9BQU8sQ0FBRTtRQUN6Qyw0QkFBVztRQUNYLDZCQUFZO1FBQ1osNkJBQVk7UUFDWiw2QkFBWTtLQUNiO0lBQ0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TUFBTSxlQUFlLEdBQUcsY0FBSSxDQUFDLFFBQVEsQ0FBQyxTQUFTLENBQUMsQ0FBQztZQUVqRCxPQUFPO2dCQUNMLEVBQUUsRUFBRSxXQUFXO2dCQUNmLE9BQU8sRUFBRSxJQUFBLDBCQUFnQixFQUFDLEdBQUcsQ0FBQztnQkFDOUIsU0FBUyxFQUFFLFNBQVMsQ0FBQyxRQUFRLEVBQUU7Z0JBQy9CLE1BQU0sRUFBRTtvQkFDTixFQUFFLEVBQUUsTUFBTSxDQUFDLE9BQU87aUJBQ25CO2dCQUNELE1BQU0sRUFBRTtvQkFDTixFQUFFLEVBQUUsTUFBTSxDQUFDLE9BQU87aUJBQ25CO2dCQUNELHVEQUF1RDtnQkFDdkQsTUFBTSxFQUFFLGVBQWU7Z0JBQ3ZCLE1BQU0sRUFBRSxlQUFlO2FBQ3hCLENBQUM7UUFDSixDQUFDLENBQUM7YUFDRCxPQUFPLEVBQUU7YUFDVCxLQUFLLEVBQUUsQ0FBQztRQUVYLE9BQU8sYUFBYSxDQUFDO0lBQ3ZCLENBQUM7Q0FDRjtBQXhGRCw0REF3RkMifQ== \ No newline at end of file diff --git a/node_modules/@uniswap/smart-order-router/build/main/providers/v3/subgraph-provider.js b/node_modules/@uniswap/smart-order-router/build/main/providers/v3/subgraph-provider.js -index bc019f6..ee22b90 100644 +index bc019f6..5aa81d6 100644 --- a/node_modules/@uniswap/smart-order-router/build/main/providers/v3/subgraph-provider.js +++ b/node_modules/@uniswap/smart-order-router/build/main/providers/v3/subgraph-provider.js -@@ -35,6 +35,7 @@ const SUBGRAPH_URL_BY_CHAIN = { +@@ -25,6 +25,8 @@ const printV3SubgraphPool = (s) => `${s.token0.id}/${s.token1.id}/${s.feeTier}`; + exports.printV3SubgraphPool = printV3SubgraphPool; + const printV2SubgraphPool = (s) => `${s.token0.id}/${s.token1.id}`; + exports.printV2SubgraphPool = printV2SubgraphPool; ++ ++const API_KEY = process.env.REACT_APP_GRAPH_API_KEY ?? '2f4a91bec2a65276da7373494a68652e' + const SUBGRAPH_URL_BY_CHAIN = { + [sdk_core_1.ChainId.MAINNET]: 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3', + [sdk_core_1.ChainId.OPTIMISM]: 'https://api.thegraph.com/subgraphs/name/ianlapham/optimism-post-regenesis', +@@ -35,6 +37,7 @@ const SUBGRAPH_URL_BY_CHAIN = { [sdk_core_1.ChainId.BNB]: 'https://api.thegraph.com/subgraphs/name/ilyamk/uniswap-v3---bnb-chain', [sdk_core_1.ChainId.AVALANCHE]: 'https://api.thegraph.com/subgraphs/name/lynnshaoyu/uniswap-v3-avax', [sdk_core_1.ChainId.BASE]: 'https://api.studio.thegraph.com/query/48211/uniswap-v3-base/v0.0.1', -+ [sdk_core_1.ChainId.HARMONY]: 'https://api.thegraph.com/subgraphs/name/nick8319/uniswap-v3-harmony', ++ [sdk_core_1.ChainId.HARMONY]: `https://gateway-arbitrum.network.thegraph.com/api/${API_KEY}/subgraphs/id/GVkp9F6TzzC5hY4g18Ukzb6gGcYDfQrpMpcj867jsenJ` }; const PAGE_SIZE = 1000; // 1k is max possible query size from subgraph. class V3SubgraphProvider { -@@ -142,4 +143,4 @@ class V3SubgraphProvider { +@@ -142,4 +145,4 @@ class V3SubgraphProvider { } } exports.V3SubgraphProvider = V3SubgraphProvider; @@ -748,18 +757,28 @@ index 26f8306..0c9a38c 100644 +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhdGljLXN1YmdyYXBoLXByb3ZpZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3Byb3ZpZGVycy92My9zdGF0aWMtc3ViZ3JhcGgtcHJvdmlkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNkRBQTZEO0FBQzdELE9BQU8sRUFBRSxPQUFPLEVBQVMsTUFBTSxtQkFBbUIsQ0FBQztBQUNuRCxPQUF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xFQUFFLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztZQUV4RSxJQUFJLGNBQWMsQ0FBQyxHQUFHLENBQUMsV0FBVyxDQUFDLEVBQUU7Z0JBQ25DLE9BQU8sU0FBUyxDQUFDO2FBQ2xCO1lBQ0QsY0FBYyxDQUFDLEdBQUcsQ0FBQyxXQUFXLENBQUMsQ0FBQztZQUVoQyxNQUFNLGVBQWUsR0FBRyxJQUFJLENBQUMsUUFBUSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1lBRWpELE9BQU87Z0JBQ0wsRUFBRSxFQUFFLFdBQVc7Z0JBQ2YsT0FBTyxFQUFFLGdCQUFnQixDQUFDLEdBQUcsQ0FBQztnQkFDOUIsU0FBUyxFQUFFLFNBQVMsQ0FBQyxRQUFRLEVBQUU7Z0JBQy9CLE1BQU0sRUFBRTtvQkFDTixFQUFFLEVBQUUsTUFBTSxDQUFDLE9BQU87aUJBQ25CO2dCQUNELE1BQU0sRUFBRTtvQkFDTixFQUFFLEVBQUUsTUFBTSxDQUFDLE9BQU87aUJBQ25CO2dCQUNELHVEQUF1RDtnQkFDdkQsTUFBTSxFQUFFLGVBQWU7Z0JBQ3ZCLE1BQU0sRUFBRSxlQUFlO2FBQ3hCLENBQUM7UUFDSixDQUFDLENBQUM7YUFDRCxPQUFPLEVBQUU7YUFDVCxLQUFLLEVBQUUsQ0FBQztRQUVYLE9BQU8sYUFBYSxDQUFDO0lBQ3ZCLENBQUM7Q0FDRiJ9 \ No newline at end of file diff --git a/node_modules/@uniswap/smart-order-router/build/module/providers/v3/subgraph-provider.js b/node_modules/@uniswap/smart-order-router/build/module/providers/v3/subgraph-provider.js -index 9820ba5..6128ee4 100644 +index 9820ba5..9f8c823 100644 --- a/node_modules/@uniswap/smart-order-router/build/module/providers/v3/subgraph-provider.js +++ b/node_modules/@uniswap/smart-order-router/build/module/providers/v3/subgraph-provider.js -@@ -16,6 +16,7 @@ const SUBGRAPH_URL_BY_CHAIN = { +@@ -6,6 +6,9 @@ import _ from 'lodash'; + import { log } from '../../util'; + export const printV3SubgraphPool = (s) => `${s.token0.id}/${s.token1.id}/${s.feeTier}`; + export const printV2SubgraphPool = (s) => `${s.token0.id}/${s.token1.id}`; ++ ++const API_KEY = process.env.REACT_APP_GRAPH_API_KEY ?? '2f4a91bec2a65276da7373494a68652e' ++ + const SUBGRAPH_URL_BY_CHAIN = { + [ChainId.MAINNET]: 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3', + [ChainId.OPTIMISM]: 'https://api.thegraph.com/subgraphs/name/ianlapham/optimism-post-regenesis', +@@ -16,6 +19,7 @@ const SUBGRAPH_URL_BY_CHAIN = { [ChainId.BNB]: 'https://api.thegraph.com/subgraphs/name/ilyamk/uniswap-v3---bnb-chain', [ChainId.AVALANCHE]: 'https://api.thegraph.com/subgraphs/name/lynnshaoyu/uniswap-v3-avax', [ChainId.BASE]: 'https://api.studio.thegraph.com/query/48211/uniswap-v3-base/v0.0.1', -+ [ChainId.HARMONY]: 'https://api.thegraph.com/subgraphs/name/nick8319/uniswap-v3-harmony', ++ [ChainId.HARMONY]: `https://gateway-arbitrum.network.thegraph.com/api/${API_KEY}/subgraphs/id/GVkp9F6TzzC5hY4g18Ukzb6gGcYDfQrpMpcj867jsenJ`, }; const PAGE_SIZE = 1000; // 1k is max possible query size from subgraph. export class V3SubgraphProvider { -@@ -129,4 +130,4 @@ export class V3SubgraphProvider { +@@ -129,4 +133,4 @@ export class V3SubgraphProvider { return poolsSanitized; } } diff --git a/src/components/AccountDrawer/MiniPortfolio/Activity/parseRemote.tsx b/src/components/AccountDrawer/MiniPortfolio/Activity/parseRemote.tsx index 64f7b6479a3..77677f368ec 100644 --- a/src/components/AccountDrawer/MiniPortfolio/Activity/parseRemote.tsx +++ b/src/components/AccountDrawer/MiniPortfolio/Activity/parseRemote.tsx @@ -266,6 +266,7 @@ function parseUnknown(_changes: TransactionChanges, assetActivity: TransactionAc } type ActivityTypeParser = (changes: TransactionChanges, assetActivity: TransactionActivity) => Partial +// eslint-disable-next-line @typescript-eslint/no-unused-vars const ActivityParserByType: { [key: string]: ActivityTypeParser | undefined } = { [ActivityType.Swap]: parseSwap, [ActivityType.SwapOrder]: parseSwapOrder, @@ -276,6 +277,7 @@ const ActivityParserByType: { [key: string]: ActivityTypeParser | undefined } = [ActivityType.Unknown]: parseUnknown, } +// eslint-disable-next-line @typescript-eslint/no-unused-vars function getLogoSrcs(changes: TransactionChanges): string[] { // Uses set to avoid duplicate logos (e.g. nft's w/ same image url) const logoSet = new Set() @@ -334,6 +336,7 @@ function parseRemoteActivity(assetActivity: AssetActivityPartsFragment): Activit return parseUniswapXOrder(assetActivity as OrderActivity) } + // eslint-disable-next-line @typescript-eslint/no-unused-vars const changes = assetActivity.assetChanges.reduce( (acc: TransactionChanges, assetChange) => { if (assetChange.__typename === 'NftApproval') acc.NftApproval.push(assetChange) @@ -354,26 +357,28 @@ function parseRemoteActivity(assetActivity: AssetActivityPartsFragment): Activit }) return undefined } - const defaultFields = { - hash: assetActivity.details.hash, - chainId: supportedChain, - status: assetActivity.details.status, - timestamp: assetActivity.timestamp, - logos: getLogoSrcs(changes), - title: assetActivity.type, - descriptor: assetActivity.details.to, - from: assetActivity.details.from, - nonce: assetActivity.details.nonce, - } - - const parsedFields = ActivityParserByType[assetActivity.type]?.(changes, assetActivity as TransactionActivity) - return { ...defaultFields, ...parsedFields } + // const defaultFields = { + // hash: assetActivity.details.hash, + // chainId: supportedChain, + // status: assetActivity.details.status, + // timestamp: assetActivity.timestamp, + // logos: getLogoSrcs(changes), + // title: assetActivity.type, + // descriptor: assetActivity.details.to, + // from: assetActivity.details.from, + // nonce: assetActivity.details.nonce, + // } + + // const parsedFields = ActivityParserByType[assetActivity.type]?.(changes, assetActivity as TransactionActivity) + // return { /...defaultFields, ...parsedFields } + return undefined } catch (e) { console.error('Failed to parse activity', e, assetActivity) return undefined } } +// eslint-disable-next-line import/no-unused-modules export function parseRemoteActivities(assetActivities?: readonly AssetActivityPartsFragment[]) { return assetActivities?.reduce((acc: { [hash: string]: Activity }, assetActivity) => { const activity = parseRemoteActivity(assetActivity) diff --git a/src/components/AccountDrawer/MiniPortfolio/constants.tsx b/src/components/AccountDrawer/MiniPortfolio/constants.tsx index d9033c60ec5..b60c86375d8 100644 --- a/src/components/AccountDrawer/MiniPortfolio/constants.tsx +++ b/src/components/AccountDrawer/MiniPortfolio/constants.tsx @@ -235,4 +235,6 @@ export const OrderStatusTable: { [key in SwapOrderStatus]: UniswapXOrderStatus } [SwapOrderStatus.Expired]: UniswapXOrderStatus.EXPIRED, [SwapOrderStatus.Error]: UniswapXOrderStatus.ERROR, [SwapOrderStatus.InsufficientFunds]: UniswapXOrderStatus.INSUFFICIENT_FUNDS, + [SwapOrderStatus.Cancelled]: UniswapXOrderStatus.CANCELLED, + [SwapOrderStatus.Filled]: UniswapXOrderStatus.FILLED, } diff --git a/src/graphql/thegraph/apollo.ts b/src/graphql/thegraph/apollo.ts index 0d237417775..16d7b10df1e 100644 --- a/src/graphql/thegraph/apollo.ts +++ b/src/graphql/thegraph/apollo.ts @@ -3,6 +3,8 @@ import { ChainId } from '@uniswap/sdk-core' import store from '../../state/index' +const API_KEY = process.env.REACT_APP_GRAPH_API_KEY ?? '2f4a91bec2a65276da7373494a68652e' + const CHAIN_SUBGRAPH_URL: Record = { [ChainId.MAINNET]: 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3', [ChainId.ARBITRUM_ONE]: 'https://thegraph.com/hosted-service/subgraph/ianlapham/uniswap-arbitrum-one', @@ -11,7 +13,7 @@ const CHAIN_SUBGRAPH_URL: Record = { [ChainId.CELO]: 'https://api.thegraph.com/subgraphs/name/jesse-sawa/uniswap-celo', [ChainId.BNB]: 'https://api.thegraph.com/subgraphs/name/ianlapham/uniswap-v3-bsc', - [ChainId.HARMONY]: 'https://api.thegraph.com/subgraphs/name/nick8319/uniswap-v3-harmony', + [ChainId.HARMONY]: `https://gateway-arbitrum.network.thegraph.com/api/${API_KEY}/subgraphs/id/GVkp9F6TzzC5hY4g18Ukzb6gGcYDfQrpMpcj867jsenJ`, [ChainId.AVALANCHE]: 'https://api.thegraph.com/subgraphs/name/lynnshaoyu/uniswap-v3-avax', } From b22623af45c1f47c20d151571580e43ae48a6989 Mon Sep 17 00:00:00 2001 From: msvstj Date: Wed, 12 Jun 2024 13:13:20 +0300 Subject: [PATCH 2/2] fix: build --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 70f96614f1e..55865c84105 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16619,7 +16619,7 @@ polished@^3.3.2: polyfill-object.fromentries@^1.0.1: version "1.0.1" - resolved "https://registry.nlark.com/polyfill-object.fromentries/download/polyfill-object.fromentries-1.0.1.tgz#1a5d89e3777684a852c9b6a6a1d2c3f9c262fc86" + resolved "https://registry.npmmirror.com/polyfill-object.fromentries/download/polyfill-object.fromentries-1.0.1.tgz#1a5d89e3777684a852c9b6a6a1d2c3f9c262fc86" integrity sha1-Gl2J43d2hKhSybamodLD+cJi/IY= postcss-attribute-case-insensitive@^5.0.2: