diff --git a/.env.example b/.env.example index 6d8460a..66e3098 100644 --- a/.env.example +++ b/.env.example @@ -1,11 +1,11 @@ -# dev +# codegen +CODEGEN_POCO_SUBGRAPH_URL="https://thegraph.arbitrum.iex.ec/api/subgraphs/id/B1comLe9SANBLrjdnoNTJSubbeC7cY7EoNu6zD82HeKy" +CODEGEN_DATAPROTECTOR_SUBGRAPH_URL="https://thegraph.arbitrum.iex.ec/api/subgraphs/id/Ep5zs5zVr4tDiVuQJepUu51e5eWYJpka624X4DMBxe3u" -VITE_POCO_SUBGRAPH_URL="https://thegraph.iex.ec/subgraphs/name/bellecour/poco-v5" -VITE_DATAPROTECTOR_SUBGRAPH_URL="https://thegraph.iex.ec/subgraphs/name/bellecour/dataprotector-v2" +# dev VITE_REOWN_PROJECT_ID= VITE_CLERK_PUBLISHABLE_KEY= -VITE_FAUCET_API_URL = 'https://dev-rlc-faucet.iex.ec' +VITE_FAUCET_API_URL='https://dev-rlc-faucet.iex.ec' # prod - -VITE_FAUCET_API_URL = 'https://rlc-faucet.iex.ec' \ No newline at end of file +VITE_FAUCET_API_URL='https://rlc-faucet.iex.ec' \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b64b1cb..c73f3c8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,8 +27,8 @@ jobs: - name: Generate GraphQL types env: - VITE_POCO_SUBGRAPH_URL: ${{ secrets.VITE_POCO_SUBGRAPH_URL }} - VITE_DATAPROTECTOR_SUBGRAPH_URL: ${{ secrets.VITE_DATAPROTECTOR_SUBGRAPH_URL }} + CODEGEN_POCO_SUBGRAPH_URL: ${{ vars.CODEGEN_POCO_SUBGRAPH_URL }} + CODEGEN_DATAPROTECTOR_SUBGRAPH_URL: ${{ vars.CODEGEN_DATAPROTECTOR_SUBGRAPH_URL }} run: npm run codegen - name: Check Prettier @@ -39,8 +39,6 @@ jobs: - name: Build application env: - VITE_POCO_SUBGRAPH_URL: ${{ secrets.VITE_POCO_SUBGRAPH_URL }} - VITE_DATAPROTECTOR_SUBGRAPH_URL: ${{ secrets.VITE_DATAPROTECTOR_SUBGRAPH_URL }} VITE_REOWN_PROJECT_ID: ${{ secrets.VITE_REOWN_PROJECT_ID }} VITE_CLERK_PUBLISHABLE_KEY: ${{ secrets.VITE_CLERK_PUBLISHABLE_KEY }} VITE_FAUCET_API_URL: ${{ secrets.VITE_FAUCET_API_URL }} @@ -51,8 +49,6 @@ jobs: - name: Run Playwright Tests env: - VITE_POCO_SUBGRAPH_URL: ${{ secrets.VITE_POCO_SUBGRAPH_URL }} - VITE_DATAPROTECTOR_SUBGRAPH_URL: ${{ secrets.VITE_DATAPROTECTOR_SUBGRAPH_URL }} VITE_REOWN_PROJECT_ID: ${{ secrets.VITE_REOWN_PROJECT_ID }} VITE_CLERK_PUBLISHABLE_KEY: ${{ secrets.VITE_CLERK_PUBLISHABLE_KEY }} VITE_FAUCET_API_URL: ${{ secrets.VITE_FAUCET_API_URL }} diff --git a/README.md b/README.md index a384974..950be48 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## Description -**iExec Explorer** is a modern web app to explore the iExec protocol across multiple supported blockchains (Bellecour, Arbitrum Sepolia, etc.). It lets you search, browse, and analyze deals, tasks, apps, datasets, workerpools, transactions, and accounts, with an integrated wallet manager. +**iExec Explorer** is a modern web app to explore the iExec protocol across multiple supported blockchains (Arbitrum, Arbitrum Sepolia, etc.). It lets you search, browse, and analyze deals, tasks, apps, datasets, workerpools, transactions, and accounts, with an integrated wallet manager. ## Main Features @@ -77,7 +77,6 @@ npm run preview ## Links - [iExec Website](https://www.iex.ec/) - [iExec Docs](https://docs.iex.ec/) -- [Blockscout Bellecour](https://blockscout-bellecour.iex.ec/) ## Contributing Contributions are welcome! Please open issues or pull requests. diff --git a/codegenDataprotector.ts b/codegenDataprotector.ts index 5596d5e..deb780c 100644 --- a/codegenDataprotector.ts +++ b/codegenDataprotector.ts @@ -1,26 +1,26 @@ -import type { CodegenConfig } from '@graphql-codegen/cli' +import type { CodegenConfig } from '@graphql-codegen/cli'; import * as dotenv from 'dotenv'; dotenv.config(); const config: CodegenConfig = { - schema: process.env.VITE_DATAPROTECTOR_SUBGRAPH_URL, + schema: process.env.CODEGEN_DATAPROTECTOR_SUBGRAPH_URL, documents: ['src/**/*DpQuery.ts'], ignoreNoDocuments: true, generates: { './src/graphql/dataprotector/': { preset: 'client', config: { - documentMode: 'string' - } + documentMode: 'string', + }, }, './src/graphql/dataprotector/schema.graphql': { plugins: ['schema-ast'], config: { - includeDirectives: true - } - } - } -} - -export default config \ No newline at end of file + includeDirectives: true, + }, + }, + }, +}; + +export default config; diff --git a/codegenPoco.ts b/codegenPoco.ts index 6c286c7..d5dc1ed 100644 --- a/codegenPoco.ts +++ b/codegenPoco.ts @@ -1,26 +1,26 @@ -import type { CodegenConfig } from '@graphql-codegen/cli' +import type { CodegenConfig } from '@graphql-codegen/cli'; import * as dotenv from 'dotenv'; dotenv.config(); const config: CodegenConfig = { - schema: process.env.VITE_POCO_SUBGRAPH_URL, - documents: ['src/**/*.tsx', "src/**/*.ts", '!src/**/*DpQuery.ts'], + schema: process.env.CODEGEN_POCO_SUBGRAPH_URL, + documents: ['src/**/*.tsx', 'src/**/*.ts', '!src/**/*DpQuery.ts'], ignoreNoDocuments: true, generates: { './src/graphql/poco/': { preset: 'client', config: { - documentMode: 'string' - } + documentMode: 'string', + }, }, './src/graphql/poco/schema.graphql': { plugins: ['schema-ast'], config: { - includeDirectives: true - } - } - } -} - -export default config \ No newline at end of file + includeDirectives: true, + }, + }, + }, +}; + +export default config; diff --git a/package-lock.json b/package-lock.json index f8abf62..fb469e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "graphql": "^16.12.0", - "iexec": "^8.24.0", + "iexec": "^9.0.1", "lucide-react": "^0.556.0", "prettier-plugin-tailwindcss": "^0.7.2", "react": "^19.2.1", @@ -10560,9 +10560,9 @@ "license": "BSD-3-Clause" }, "node_modules/iexec": { - "version": "8.24.0", - "resolved": "https://registry.npmjs.org/iexec/-/iexec-8.24.0.tgz", - "integrity": "sha512-XMi+kZlRHPB5prubA7PQvhEmKxENN/5P0+gfe96eKKUWZSb3qllzi14btRE/MEmUXwsQok9kpIOq9IajUY8VQQ==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/iexec/-/iexec-9.0.1.tgz", + "integrity": "sha512-3wZ7dm+x6bosJ5HiwtCt9Lo24zAjOrHNFghAuk0YPB0+U0Xw/7ZYH1bdoMUoNTeTihLi8FjvdX1F18hZW4ZUpw==", "license": "Apache-2.0", "dependencies": { "@multiformats/multiaddr": "^13.0.1", diff --git a/package.json b/package.json index 5c0922d..5f7b599 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "graphql": "^16.12.0", - "iexec": "^8.24.0", + "iexec": "^9.0.1", "lucide-react": "^0.556.0", "prettier-plugin-tailwindcss": "^0.7.2", "react": "^19.2.1", diff --git a/src/components/SmartLinkGroup.tsx b/src/components/SmartLinkGroup.tsx index 3d20576..3c4e487 100644 --- a/src/components/SmartLinkGroup.tsx +++ b/src/components/SmartLinkGroup.tsx @@ -1,11 +1,8 @@ -import { useQuery } from '@tanstack/react-query'; import { Link } from '@tanstack/react-router'; import { ExternalLink } from 'lucide-react'; import CopyButton from '@/components/CopyButton'; import { Button } from '@/components/ui/button'; -import { getIExec, getReadonlyIExec } from '@/externals/iexecSdkClient'; import useUserStore from '@/stores/useUser.store'; -import { isValidAddress } from '@/utils/addressOrIdCheck'; import { getBlockExplorerUrl, getChainFromId } from '@/utils/chain.utils'; import { truncateAddress } from '@/utils/truncateAddress'; import { @@ -40,7 +37,7 @@ export default function SmartLinkGroup({ isCurrentPage = false, showAddressOrIdAndLabel = false, }: SmartLinkGroupProps) { - const { chainId, isConnected } = useUserStore(); + const { chainId } = useUserStore(); const basePath = { deal: 'deal', task: 'task', @@ -52,20 +49,6 @@ export default function SmartLinkGroup({ order: 'order', }; - const { data: ens } = useQuery({ - queryKey: ['ens', addressOrId], - queryFn: async () => { - const iexec = isConnected ? await getIExec() : getReadonlyIExec(chainId!); - const resolved = await iexec.ens.lookupAddress(addressOrId); - if (!resolved) { - return null; - } - return resolved; - }, - enabled: !!chainId && isValidAddress(addressOrId), - staleTime: Infinity, - }); - const blockExplorerPath = { deal: `tx/${addressOrId}`, dataset: `address/${addressOrId}`, @@ -91,7 +74,6 @@ export default function SmartLinkGroup({ : truncateAddress(addressOrId)) ?? addressOrId} {showAddressOrIdAndLabel && label ? `(${label})` : ''} - {ens ? `(${ens})` : ''} ) : ( @@ -101,7 +83,6 @@ export default function SmartLinkGroup({ {(label ? truncateAddress(label) : truncateAddress(addressOrId)) ?? addressOrId} - {ens ? `(${ens})` : ''} )} diff --git a/src/config.ts b/src/config.ts index ab2c4c8..e8b0408 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,6 +1,5 @@ import arbitrumSepoliaIcon from './assets/chain-icons/arbitrum-sepolia.svg'; -import iexecLogo from './assets/iexec-logo.svg'; -import { bellecour, arbitrumSepolia, arbitrum } from './utils/wagmiNetworks'; +import { arbitrumSepolia, arbitrum } from './utils/wagmiNetworks'; export const LOCAL_STORAGE_PREFIX = 'Explorer'; @@ -45,25 +44,6 @@ export const SUPPORTED_CHAINS = [ wagmiNetwork: arbitrumSepolia, tokenSymbol: 'RLC', }, - { - id: 134, - deprecated: true, - name: 'Bellecour', - slug: 'bellecour', - color: '#95A4FC', - icon: iexecLogo, - blockExplorerUrl: 'https://blockscout-bellecour.iex.ec', - subgraphUrl: { - poco: 'https://thegraph.iex.ec/subgraphs/name/bellecour/poco-v5', - dataprotector: - 'https://thegraph.iex.ec/subgraphs/name/bellecour/dataprotector-v2', - }, - bridge: 'https://bridge-bellecour.iex.ec/', - bridgeInformation: - 'Move your xRLC in your wallet between bellecour and Ethereum Mainnet with our bridge.', - wagmiNetwork: bellecour, - tokenSymbol: 'xRLC', - }, ]; export const datasetSchemaTypeGroups = [ diff --git a/src/externals/iexecSdkClient.ts b/src/externals/iexecSdkClient.ts index 34df923..2345ab2 100644 --- a/src/externals/iexecSdkClient.ts +++ b/src/externals/iexecSdkClient.ts @@ -1,9 +1,7 @@ import { IExec, IExecConfig, Eip1193Provider } from 'iexec'; import { type Connector } from 'wagmi'; -import { getChainFromId } from '@/utils/chain.utils'; let iExec: IExec | null = null; -let readonlyIExec: IExec | null = null; // Basic promise queue for pending getIExec() requests const IEXEC_CLIENT_RESOLVES: Array> = []; @@ -11,7 +9,6 @@ const IEXEC_CLIENT_RESOLVES: Array> = []; // Clean both SDKs export function cleanIExecSDKs() { iExec = null; - readonlyIExec = null; } export async function initIExecSDKs({ @@ -51,16 +48,3 @@ export function getIExec(): Promise { } return Promise.resolve(iExec); } - -export function getReadonlyIExec(chainId: number): IExec { - const chain = getChainFromId(chainId); - if (!chain) throw new Error(`Unknown chainId ${chainId}`); - - if (!readonlyIExec) { - readonlyIExec = new IExec( - { ethProvider: chain.id }, - { allowExperimentalNetworks: true } - ); - } - return readonlyIExec; -} diff --git a/src/modules/account/ManageIexecAccount.tsx b/src/modules/account/ManageIexecAccount.tsx index c8214bd..ad3017d 100644 --- a/src/modules/account/ManageIexecAccount.tsx +++ b/src/modules/account/ManageIexecAccount.tsx @@ -3,7 +3,7 @@ import { cn } from '@/lib/utils'; import { useMutation, useQuery } from '@tanstack/react-query'; import { formatRLC } from 'iexec/utils'; import { ArrowRight, Check } from 'lucide-react'; -import { useEffect, useState } from 'react'; +import { useState } from 'react'; import { ChainLink } from '@/components/ChainLink'; import { Stepper } from '@/components/Stepper'; import IexecAccountIcon from '@/components/icons/IexecAccountIcon'; @@ -144,15 +144,6 @@ export function ManageIexecAccount() { const [currentStep] = getStepState(currentTab); const token = getChainFromId(chainId)?.tokenSymbol; - useEffect(() => { - const chain = getChainFromId(chainId); - const bridge = chain?.bridge; - - if (!bridge && currentTab === 2) { - setCurrentTab(1); - } - }, [chainId, currentTab, setCurrentTab]); - if (!userAddress) { return (
diff --git a/src/modules/account/getTabs.tsx b/src/modules/account/getTabs.tsx index 1d4685d..3fdfe8a 100644 --- a/src/modules/account/getTabs.tsx +++ b/src/modules/account/getTabs.tsx @@ -1,7 +1,7 @@ import { DefaultError } from '@tanstack/query-core'; import { UseMutationResult } from '@tanstack/react-query'; import { formatRLC } from 'iexec/utils'; -import { LoaderCircle, CheckCircle, ExternalLink } from 'lucide-react'; +import { LoaderCircle, CheckCircle } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { getChainFromId } from '@/utils/chain.utils'; @@ -174,26 +174,5 @@ export function getTabs({ }, ], }, - { - title: `BRIDGE ${token}`, - longTitle: `Bridge your ${token} between chains`, - desc: getChainFromId(chainId)?.bridgeInformation, - content: ( - - ), - }, - ].filter((tab, index) => { - const chain = getChainFromId(chainId); - if (index === 0 && (!chain || chain.deprecated)) return false; // hide deposit if chain is deprecated - if (index === 2 && (!chain || !chain.bridge)) return false; - return true; - }); + ]; } diff --git a/src/modules/search/SearcherBar.tsx b/src/modules/search/SearcherBar.tsx index 349b481..8e1e619 100644 --- a/src/modules/search/SearcherBar.tsx +++ b/src/modules/search/SearcherBar.tsx @@ -6,7 +6,6 @@ import { Search } from 'lucide-react'; import { useEffect, useId, useRef, useState } from 'react'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; -import { getIExec, getReadonlyIExec } from '@/externals/iexecSdkClient'; import useUserStore from '@/stores/useUser.store'; import { isValidAddress, isValidId } from '@/utils/addressOrIdCheck'; import { getChainFromId, getChainFromSlug } from '@/utils/chain.utils'; @@ -59,35 +58,21 @@ export function SearcherBar({ const { mutate, mutateAsync, isPending, isError, error } = useMutation({ mutationKey: ['search', inputValue], mutationFn: async (value: string) => { - const isValid = - isValidAddress(value) || isValidId(value) || value.endsWith('.eth'); // ENS + const isValid = isValidAddress(value) || isValidId(value); if (!isValid) { throw new Error('Invalid value'); } - let resolvedValue = value; - - if (value.endsWith('.eth')) { - const iexec = isConnected - ? await getIExec() - : getReadonlyIExec(chainId!); - const resolved = await iexec.ens.resolveName(value); - if (!resolved) { - throw new Error(`Fail to resolve ENS : ${value}`); - } - resolvedValue = resolved.toLowerCase(); - } - const result = await execute(searchQuery, chainId, { - search: resolvedValue, + search: value, }); const isEmpty = Object.values(result).every((v) => v === null); if (isEmpty) { throw new Error('No data found'); } - return { result, id: resolvedValue }; + return { result, id: value }; }, onSuccess: (data) => { const chainSlug = getChainFromId(chainId)?.slug; diff --git a/src/utils/wagmiNetworks.ts b/src/utils/wagmiNetworks.ts index 33d8774..195e7df 100644 --- a/src/utils/wagmiNetworks.ts +++ b/src/utils/wagmiNetworks.ts @@ -1,34 +1,8 @@ -import { - AppKitNetwork, - arbitrumSepolia, - arbitrum, -} from '@reown/appkit/networks'; +import { arbitrumSepolia, arbitrum } from '@reown/appkit/networks'; export { arbitrumSepolia, arbitrum } from '@reown/appkit/networks'; -export const bellecour: AppKitNetwork = { - id: 0x86, - name: 'iExec Sidechain', - nativeCurrency: { - decimals: 18, - name: 'xRLC', - symbol: 'xRLC', - }, - rpcUrls: { - public: { http: ['https://bellecour.iex.ec'] }, - default: { http: ['https://bellecour.iex.ec'] }, - }, - blockExplorers: { - etherscan: { - name: 'Blockscout', - url: 'https://blockscout-bellecour.iex.ec', - }, - default: { name: 'Blockscout', url: 'https://blockscout-bellecour.iex.ec' }, - }, -}; - const wagmiNetworks = { - bellecour, arbitrumSepolia, arbitrum, };