Replace OP Superchain feature with generic Multichain explorer (#3299)
* rename feature * rename evn preset * types, mocks and stubs renaming * rename UI components
@@ -23,11 +23,12 @@ on:
|
||||
- filecoin
|
||||
- immutable
|
||||
- mega_eth
|
||||
- multichain_dev
|
||||
- multichain_prod
|
||||
- neon_devnet
|
||||
- numine
|
||||
- optimism
|
||||
- optimism_sepolia
|
||||
- optimism_superchain
|
||||
- polygon
|
||||
- rootstock
|
||||
- scroll_sepolia
|
||||
|
||||
@@ -25,11 +25,12 @@ on:
|
||||
- main
|
||||
- mega_eth
|
||||
- mekong
|
||||
- multichain_dev
|
||||
- multichain_prod
|
||||
- neon_devnet
|
||||
- numine
|
||||
- optimism
|
||||
- optimism_sepolia
|
||||
- optimism_superchain
|
||||
- polygon
|
||||
- rari_testnet
|
||||
- rootstock
|
||||
|
||||
@@ -354,11 +354,12 @@
|
||||
"filecoin",
|
||||
"mega_eth",
|
||||
"mekong",
|
||||
"multichain_dev",
|
||||
"multichain_prod",
|
||||
"neon_devnet",
|
||||
"numine",
|
||||
"optimism",
|
||||
"optimism_sepolia",
|
||||
"optimism_superchain",
|
||||
"polygon",
|
||||
"rari_testnet",
|
||||
"rootstock_testnet",
|
||||
|
||||
@@ -4,7 +4,7 @@ import app from '../app';
|
||||
import chain from '../chain';
|
||||
import { getEnvValue, parseEnvJson } from '../utils';
|
||||
import accountFeature from './account';
|
||||
import opSuperchain from './opSuperchain';
|
||||
import multichain from './multichain';
|
||||
|
||||
const walletConnectProjectId = getEnvValue('NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID');
|
||||
|
||||
@@ -31,11 +31,11 @@ const config: Feature<FeaturePayload> = (() => {
|
||||
chain.rpcUrls.length > 0,
|
||||
);
|
||||
|
||||
const isOpSuperchain = opSuperchain.isEnabled;
|
||||
const isMultichain = multichain.isEnabled;
|
||||
|
||||
if (
|
||||
!app.isPrivateMode &&
|
||||
(isSingleChain || isOpSuperchain)
|
||||
(isSingleChain || isMultichain)
|
||||
) {
|
||||
if (accountFeature.isEnabled && accountFeature.authProvider === 'dynamic' && accountFeature.dynamic?.environmentId) {
|
||||
return Object.freeze({
|
||||
|
||||
@@ -29,9 +29,9 @@ export { default as megaEth } from './megaEth';
|
||||
export { default as metasuites } from './metasuites';
|
||||
export { default as mixpanel } from './mixpanel';
|
||||
export { default as mudFramework } from './mudFramework';
|
||||
export { default as multichain } from './multichain';
|
||||
export { default as multichainButton } from './multichainButton';
|
||||
export { default as nameServices } from './nameServices';
|
||||
export { default as opSuperchain } from './opSuperchain';
|
||||
export { default as pools } from './pools';
|
||||
export { default as publicTagsSubmission } from './publicTagsSubmission';
|
||||
export { default as rewards } from './rewards';
|
||||
|
||||
@@ -6,12 +6,7 @@ import { getEnvValue } from '../utils';
|
||||
const isEnabled = getEnvValue('NEXT_PUBLIC_MULTICHAIN_ENABLED') === 'true';
|
||||
const cluster = getEnvValue('NEXT_PUBLIC_MULTICHAIN_CLUSTER');
|
||||
|
||||
// The feature was initially implemented for OP Superchain interop cluster
|
||||
// but later the project was abandoned by Optimism team.
|
||||
// Now it serves mainly for demo purposes of multichain explorer possible functionalities.
|
||||
// So for now I have kept all naming in the code as it was initially done
|
||||
// and later it could be changed when specific multichain cluster will be implemented.
|
||||
const title = 'OP Superchain interop explorer';
|
||||
const title = 'Multichain explorer';
|
||||
|
||||
const config: Feature<{ cluster: string }> = (() => {
|
||||
if (apis.multichainAggregator && apis.multichainStats && isEnabled && cluster) {
|
||||
@@ -1,12 +1,12 @@
|
||||
import type { Feature } from './types';
|
||||
|
||||
import apis from '../apis';
|
||||
import opSuperchain from './opSuperchain';
|
||||
import multichain from './multichain';
|
||||
|
||||
const title = 'Blockchain statistics';
|
||||
|
||||
const config: Feature<{}> = (() => {
|
||||
if (apis.stats || opSuperchain.isEnabled) {
|
||||
if (apis.stats || multichain.isEnabled) {
|
||||
return Object.freeze({
|
||||
title,
|
||||
isEnabled: true,
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# Set of ENVs for OP Mainnet network explorer
|
||||
# https://xxx.blockscout.com
|
||||
# This is an auto-generated file. To update all values, run "yarn dev:preset:sync --name=multichain_dev"
|
||||
|
||||
# Local ENVs
|
||||
NEXT_PUBLIC_APP_PROTOCOL=http
|
||||
NEXT_PUBLIC_APP_HOST=localhost
|
||||
NEXT_PUBLIC_APP_PORT=3000
|
||||
NEXT_PUBLIC_APP_ENV=development
|
||||
|
||||
NEXT_PUBLIC_MULTICHAIN_ENABLED=true
|
||||
NEXT_PUBLIC_MULTICHAIN_AGGREGATOR_API_HOST=https://multichain-aggregator.k8s-dev.blockscout.com
|
||||
NEXT_PUBLIC_MULTICHAIN_CLUSTER=interop
|
||||
NEXT_PUBLIC_MULTICHAIN_STATS_API_HOST=http://multichain-search-stats.k8s-dev.blockscout.com
|
||||
|
||||
SKIP_ENVS_VALIDATION=true
|
||||
NEXT_PUBLIC_MULTICHAIN_BALANCE_PROVIDER_CONFIG=[{'name': 'zerion', 'url_template': 'https://app.zerion.io/{address}/overview?utm_source=blockscout&utm_medium=address', 'logo': 'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/marketplace-logos/zerion.svg'}]
|
||||
|
||||
NEXT_PUBLIC_HOMEPAGE_CHARTS=['daily_txs','coin_price','market_cap']
|
||||
NEXT_PUBLIC_HOMEPAGE_STATS=['total_txs','wallet_addresses']
|
||||
NEXT_PUBLIC_API_DOCS_TABS=[]
|
||||
NEXT_PUBLIC_NETWORK_NAME=Blockscout
|
||||
NEXT_PUBLIC_GAS_TRACKER_ENABLED=false
|
||||
NEXT_PUBLIC_HIDE_INDEXING_ALERT_BLOCKS=true
|
||||
NEXT_PUBLIC_HIDE_INDEXING_ALERT_INT_TXS=true
|
||||
NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED=false
|
||||
NEXT_PUBLIC_IS_TESTNET=false
|
||||
NEXT_PUBLIC_USE_NEXT_JS_PROXY=true
|
||||
NEXT_PUBLIC_HAS_USER_OPS=true
|
||||
NEXT_PUBLIC_ADVANCED_FILTER_ENABLED=false
|
||||
@@ -1,6 +1,6 @@
|
||||
# Set of ENVs for OP Mainnet network explorer
|
||||
# https://xxx.blockscout.com
|
||||
# This is an auto-generated file. To update all values, run "yarn dev:preset:sync --name=optimism_superchain"
|
||||
# This is an auto-generated file. To update all values, run "yarn dev:preset:sync --name=multichain_prod"
|
||||
|
||||
# Local ENVs
|
||||
NEXT_PUBLIC_APP_PROTOCOL=http
|
||||
@@ -9,9 +9,6 @@ NEXT_PUBLIC_APP_PORT=3000
|
||||
NEXT_PUBLIC_APP_ENV=development
|
||||
|
||||
NEXT_PUBLIC_MULTICHAIN_ENABLED=true
|
||||
# NEXT_PUBLIC_MULTICHAIN_AGGREGATOR_API_HOST=https://multichain-aggregator.k8s-dev.blockscout.com
|
||||
# NEXT_PUBLIC_MULTICHAIN_CLUSTER=interop
|
||||
# NEXT_PUBLIC_MULTICHAIN_STATS_API_HOST=http://multichain-search-stats.k8s-dev.blockscout.com
|
||||
NEXT_PUBLIC_MULTICHAIN_AGGREGATOR_API_HOST=https://multichain-aggregator.services.blockscout.com
|
||||
NEXT_PUBLIC_MULTICHAIN_CLUSTER=multichain
|
||||
NEXT_PUBLIC_MULTICHAIN_STATS_API_HOST=https://multichain-stats.k8s-prod-3.blockscout.com
|
||||
@@ -5,7 +5,7 @@ import * as multichainConfigNodejs from 'configs/multichain/config.nodejs';
|
||||
import { isBrowser } from 'toolkit/utils/isBrowser';
|
||||
|
||||
const multichainConfig: () => MultichainConfig | undefined = () => {
|
||||
if (!config.features.opSuperchain.isEnabled) {
|
||||
if (!config.features.multichain.isEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ NEXT_PUBLIC_NETWORK_ICON=http://example.com
|
||||
NEXT_PUBLIC_NETWORK_ICON_DARK=http://example.com
|
||||
NEXT_PUBLIC_NETWORK_LOGO=http://example.com
|
||||
NEXT_PUBLIC_NETWORK_LOGO_DARK=http://example.com
|
||||
NEXT_PUBLIC_NETWORK_NAME=OP Superchain
|
||||
NEXT_PUBLIC_NETWORK_SHORT_NAME=OP Superchain
|
||||
NEXT_PUBLIC_NETWORK_NAME=Multichain
|
||||
NEXT_PUBLIC_NETWORK_SHORT_NAME=Multichain
|
||||
NEXT_PUBLIC_OG_IMAGE_URL=http://example.com
|
||||
NEXT_PUBLIC_GAS_TRACKER_ENABLED=false
|
||||
NEXT_PUBLIC_HIDE_INDEXING_ALERT_BLOCKS=true
|
||||
|
||||
@@ -12,7 +12,7 @@ const outputFile = resolvePath(outputDir, 'llms.txt');
|
||||
|
||||
function run() {
|
||||
try {
|
||||
if(config.features.opSuperchain.isEnabled){
|
||||
if(config.features.multichain.isEnabled){
|
||||
console.log('⏭️ Skipping llms.txt generation for multichain explorer');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ApiResource } from '../types';
|
||||
import type * as multichain from '@blockscout/multichain-aggregator-types';
|
||||
import type { AddressTokensFilter, AddressTokensResponse, TokensResponse } from 'types/client/multichain-aggregator';
|
||||
import type { AddressTokensFilter, AddressTokensResponse, TokensResponse } from 'types/client/multichainAggregator';
|
||||
|
||||
export const MULTICHAIN_AGGREGATOR_API_RESOURCES = {
|
||||
address: {
|
||||
|
||||
@@ -272,7 +272,7 @@ export default function useNavItems(): ReturnType {
|
||||
icon: 'navigation/chain_stats',
|
||||
isActive: pathname.startsWith('/stats'),
|
||||
},
|
||||
config.features.opSuperchain.isEnabled && {
|
||||
config.features.multichain.isEnabled && {
|
||||
text: 'Ecosystems',
|
||||
nextRoute: { pathname: '/ecosystems' as const },
|
||||
icon: 'navigation/ecosystems',
|
||||
@@ -319,7 +319,7 @@ export default function useNavItems(): ReturnType {
|
||||
} : null;
|
||||
|
||||
const otherNavItems: Array<NavItem> | Array<Array<NavItem>> = [
|
||||
config.features.opSuperchain.isEnabled ? {
|
||||
config.features.multichain.isEnabled ? {
|
||||
text: 'Verify contract',
|
||||
url: 'https://vera.blockscout.com',
|
||||
} : {
|
||||
|
||||
@@ -12,7 +12,7 @@ import getQueryParamString from 'lib/router/getQueryParamString';
|
||||
|
||||
import * as userProfile from './userProfile';
|
||||
|
||||
const opSuperchainFeature = config.features.opSuperchain;
|
||||
const multichainFeature = config.features.multichain;
|
||||
|
||||
export default function useMixpanelInit() {
|
||||
const [ isInitialized, setIsInitialized ] = React.useState(false);
|
||||
@@ -46,7 +46,7 @@ export default function useMixpanelInit() {
|
||||
Language: window.navigator.language,
|
||||
'Device type': capitalize(deviceType),
|
||||
'User id': uuid,
|
||||
...(opSuperchainFeature.isEnabled ? { 'Cluster name': opSuperchainFeature.cluster } : {}),
|
||||
...(multichainFeature.isEnabled ? { 'Cluster name': multichainFeature.cluster } : {}),
|
||||
});
|
||||
mixpanel.identify(uuid);
|
||||
userProfile.set({
|
||||
|
||||
@@ -40,7 +40,7 @@ const getChainInfo = (
|
||||
};
|
||||
};
|
||||
|
||||
export const currentChain: Chain | undefined = !appConfig.features.opSuperchain.isEnabled ? getChainInfo() : undefined;
|
||||
export const currentChain: Chain | undefined = !appConfig.features.multichain.isEnabled ? getChainInfo() : undefined;
|
||||
|
||||
export const parentChain: Chain | undefined = (() => {
|
||||
const rollupFeature = appConfig.features.rollup;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { AddressTokenItem } from 'types/client/multichain-aggregator';
|
||||
import type { AddressTokenItem } from 'types/client/multichainAggregator';
|
||||
|
||||
import { chainA, chainB, chainC } from './chains';
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ let cspPolicies: { 'private': string; 'default': string } | undefined = undefine
|
||||
|
||||
async function initializeCspPolicies() {
|
||||
if (!cspPolicies) {
|
||||
appConfig.features.opSuperchain.isEnabled && await multichainConfig.load();
|
||||
appConfig.features.multichain.isEnabled && await multichainConfig.load();
|
||||
marketplaceFeature.isEnabled && marketplaceFeature.essentialDapps && await essentialDappsChainsConfig.load();
|
||||
|
||||
// Generate and cache both policies upfront
|
||||
|
||||
@@ -336,16 +336,16 @@ export const crossChainTxs: Guard = (chainConfig: typeof config) => async() => {
|
||||
}
|
||||
};
|
||||
|
||||
export const opSuperchain: Guard = () => async() => {
|
||||
if (!config.features.opSuperchain.isEnabled) {
|
||||
export const multichain: Guard = () => async() => {
|
||||
if (!config.features.multichain.isEnabled) {
|
||||
return {
|
||||
notFound: true,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export const notOpSuperchain: Guard = () => async() => {
|
||||
if (config.features.opSuperchain.isEnabled) {
|
||||
export const notMultichain: Guard = () => async() => {
|
||||
if (config.features.multichain.isEnabled) {
|
||||
return {
|
||||
notFound: true,
|
||||
};
|
||||
|
||||
@@ -2,9 +2,9 @@ import * as guards from './guards';
|
||||
import { factory } from './utils';
|
||||
|
||||
export const base = factory([ ]);
|
||||
export const block = factory([ guards.notOpSuperchain ]);
|
||||
export const tx = factory([ guards.notOpSuperchain ]);
|
||||
export const token = factory([ guards.notOpSuperchain ]);
|
||||
export const block = factory([ guards.notMultichain ]);
|
||||
export const tx = factory([ guards.notMultichain ]);
|
||||
export const token = factory([ guards.notMultichain ]);
|
||||
export const account = factory([ guards.account ]);
|
||||
export const accountAuth0 = factory([ guards.accountAuth0 ]);
|
||||
export const verifiedAddresses = factory([ guards.account, guards.verifiedAddresses ]);
|
||||
@@ -32,7 +32,7 @@ export const publicTagsSubmit = factory([ guards.publicTagsSubmit ]);
|
||||
export const pools = factory([ guards.pools ]);
|
||||
export const megaEth = factory([ guards.megaEth ]);
|
||||
export const zetaChainCCTX = factory([ guards.zetaChainCCTX ]);
|
||||
export const crossChainTxs = factory([ guards.notOpSuperchain, guards.crossChainTxs ]);
|
||||
export const crossChainTxs = factory([ guards.notMultichain, guards.crossChainTxs ]);
|
||||
|
||||
// ROLLUPS
|
||||
export const rollup = factory([ guards.rollup ]);
|
||||
@@ -47,4 +47,4 @@ export const mud = factory([ guards.mud ]);
|
||||
export const tac = factory([ guards.tac ]);
|
||||
export const celo = factory([ guards.celo ]);
|
||||
export const interopMessages = factory([ guards.interopMessages ]);
|
||||
export const opSuperchain = factory([ guards.opSuperchain ]);
|
||||
export const multichain = factory([ guards.multichain ]);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import * as guards from './guards';
|
||||
import { factoryMultichain } from './utils';
|
||||
|
||||
export const base = factoryMultichain([ guards.opSuperchain ]);
|
||||
export const userOps = factoryMultichain([ guards.opSuperchain, guards.userOps ]);
|
||||
export const accountsLabelSearch = factoryMultichain([ guards.opSuperchain, guards.accountsLabelSearch ]);
|
||||
export const advancedFilter = factoryMultichain([ guards.opSuperchain, guards.advancedFilter ]);
|
||||
export const csvExport = factoryMultichain([ guards.opSuperchain, guards.csvExport ]);
|
||||
export const base = factoryMultichain([ guards.multichain ]);
|
||||
export const userOps = factoryMultichain([ guards.multichain, guards.userOps ]);
|
||||
export const accountsLabelSearch = factoryMultichain([ guards.multichain, guards.accountsLabelSearch ]);
|
||||
export const advancedFilter = factoryMultichain([ guards.multichain, guards.advancedFilter ]);
|
||||
export const csvExport = factoryMultichain([ guards.multichain, guards.csvExport ]);
|
||||
|
||||
@@ -4,7 +4,7 @@ import config from 'configs/app';
|
||||
import * as cookiesLib from 'lib/cookies';
|
||||
|
||||
export default function poorReputationTokensMiddleware(req: NextRequest, res: NextResponse) {
|
||||
if (config.features.opSuperchain.isEnabled) {
|
||||
if (config.features.multichain.isEnabled) {
|
||||
const showPoorReputationTokensCookie = req.cookies.get(cookiesLib.NAMES.SHOW_POOR_REPUTATION_TOKENS);
|
||||
|
||||
if (!showPoorReputationTokensCookie) {
|
||||
|
||||
@@ -93,7 +93,7 @@ function MyApp({ Component, pageProps }: AppPropsWithLayout) {
|
||||
|
||||
const RewardsProvider = config.features.rewards.isEnabled ? RewardsContextProvider : FallbackProvider;
|
||||
|
||||
const socketUrl = !config.features.opSuperchain.isEnabled ? getSocketUrl() : undefined;
|
||||
const socketUrl = !config.features.multichain.isEnabled ? getSocketUrl() : undefined;
|
||||
|
||||
return (
|
||||
<ChakraProvider>
|
||||
|
||||
@@ -46,7 +46,7 @@ class MyDocument extends Document {
|
||||
|
||||
{ /* eslint-disable-next-line @next/next/no-sync-scripts */ }
|
||||
<script src="/assets/envs.js"/>
|
||||
{ config.features.opSuperchain.isEnabled && (
|
||||
{ config.features.multichain.isEnabled && (
|
||||
<>
|
||||
{ /* eslint-disable-next-line @next/next/no-sync-scripts */ }
|
||||
<script src="/assets/multichain/config.js"/>
|
||||
|
||||
@@ -7,8 +7,8 @@ import PageNextJs from 'nextjs/PageNextJs';
|
||||
import config from 'configs/app';
|
||||
|
||||
const Accounts = dynamic(() => {
|
||||
if (config.features.opSuperchain.isEnabled) {
|
||||
return import('ui/optimismSuperchain/accounts/OpSuperchainAccounts');
|
||||
if (config.features.multichain.isEnabled) {
|
||||
return import('ui/multichain/accounts/MultichainAccounts');
|
||||
}
|
||||
|
||||
return import('ui/pages/Accounts');
|
||||
|
||||
@@ -10,7 +10,7 @@ import fetchApi from 'nextjs/utils/fetchApi';
|
||||
|
||||
import config from 'configs/app';
|
||||
import getQueryParamString from 'lib/router/getQueryParamString';
|
||||
import OpSuperchainAddress from 'ui/optimismSuperchain/address/OpSuperchainAddress';
|
||||
import MultichainAddress from 'ui/multichain/address/MultichainAddress';
|
||||
import Address from 'ui/pages/Address';
|
||||
|
||||
const pathname: Route['pathname'] = '/address/[hash]';
|
||||
@@ -18,7 +18,7 @@ const pathname: Route['pathname'] = '/address/[hash]';
|
||||
const Page: NextPage<Props<typeof pathname>> = (props: Props<typeof pathname>) => {
|
||||
return (
|
||||
<PageNextJs pathname={ pathname } query={ props.query } apiData={ props.apiData }>
|
||||
{ config.features.opSuperchain.isEnabled ? <OpSuperchainAddress/> : <Address/> }
|
||||
{ config.features.multichain.isEnabled ? <MultichainAddress/> : <Address/> }
|
||||
</PageNextJs>
|
||||
);
|
||||
};
|
||||
@@ -28,7 +28,7 @@ export default Page;
|
||||
export const getServerSideProps: GetServerSideProps<Props<typeof pathname>> = async(ctx) => {
|
||||
const baseResponse = await gSSP.base<typeof pathname>(ctx);
|
||||
|
||||
if (config.meta.og.enhancedDataEnabled && 'props' in baseResponse && !config.features.opSuperchain.isEnabled) {
|
||||
if (config.meta.og.enhancedDataEnabled && 'props' in baseResponse && !config.features.multichain.isEnabled) {
|
||||
const botInfo = detectBotRequest(ctx.req);
|
||||
|
||||
if (botInfo?.type === 'social_preview') {
|
||||
|
||||
@@ -7,8 +7,8 @@ import PageNextJs from 'nextjs/PageNextJs';
|
||||
import config from 'configs/app';
|
||||
|
||||
const Blocks = dynamic(() => {
|
||||
if (config.features.opSuperchain.isEnabled) {
|
||||
return import('ui/optimismSuperchain/blocks/OpSuperchainBlocks');
|
||||
if (config.features.multichain.isEnabled) {
|
||||
return import('ui/multichain/blocks/MultichainBlocks');
|
||||
}
|
||||
|
||||
return import('ui/pages/Blocks');
|
||||
|
||||
@@ -5,12 +5,12 @@ import React from 'react';
|
||||
import type { Props } from 'nextjs/getServerSideProps/handlers';
|
||||
import PageNextJs from 'nextjs/PageNextJs';
|
||||
|
||||
const OpSuperchainBlock = dynamic(() => import('ui/optimismSuperchain/block/OpSuperchainBlock'), { ssr: false });
|
||||
const MultichainBlock = dynamic(() => import('ui/multichain/block/MultichainBlock'), { ssr: false });
|
||||
|
||||
const Page: NextPage<Props> = (props: Props) => {
|
||||
return (
|
||||
<PageNextJs pathname="/chain/[chain_slug]/block/[height_or_hash]" query={ props.query }>
|
||||
<OpSuperchainBlock/>
|
||||
<MultichainBlock/>
|
||||
</PageNextJs>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -6,14 +6,14 @@ import type { Route } from 'nextjs-routes';
|
||||
import type { Props } from 'nextjs/getServerSideProps/handlers';
|
||||
import PageNextJs from 'nextjs/PageNextJs';
|
||||
|
||||
const OpSuperchainToken = dynamic(() => import('ui/optimismSuperchain/token/OpSuperchainToken'), { ssr: false });
|
||||
const MultichainToken = dynamic(() => import('ui/multichain/token/MultichainToken'), { ssr: false });
|
||||
|
||||
const pathname: Route['pathname'] = '/token/[hash]';
|
||||
|
||||
const Page: NextPage<Props<typeof pathname>> = (props: Props<typeof pathname>) => {
|
||||
return (
|
||||
<PageNextJs pathname={ pathname } query={ props.query } apiData={ props.apiData }>
|
||||
<OpSuperchainToken/>
|
||||
<MultichainToken/>
|
||||
</PageNextJs>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -6,14 +6,14 @@ import type { Route } from 'nextjs-routes';
|
||||
import type { Props } from 'nextjs/getServerSideProps/handlers';
|
||||
import PageNextJs from 'nextjs/PageNextJs';
|
||||
|
||||
const OpSuperchainTokenInstance = dynamic(() => import('ui/optimismSuperchain/tokenInstance/OpSuperchainTokenInstance'), { ssr: false });
|
||||
const MultichainTokenInstance = dynamic(() => import('ui/multichain/tokenInstance/MultichainTokenInstance'), { ssr: false });
|
||||
|
||||
const pathname: Route['pathname'] = '/token/[hash]/instance/[id]';
|
||||
|
||||
const Page: NextPage<Props<typeof pathname>> = (props: Props<typeof pathname>) => {
|
||||
return (
|
||||
<PageNextJs pathname={ pathname } query={ props.query } apiData={ props.apiData }>
|
||||
<OpSuperchainTokenInstance/>
|
||||
<MultichainTokenInstance/>
|
||||
</PageNextJs>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -5,12 +5,12 @@ import React from 'react';
|
||||
import type { Props } from 'nextjs/getServerSideProps/handlers';
|
||||
import PageNextJs from 'nextjs/PageNextJs';
|
||||
|
||||
const OpSuperchainTx = dynamic(() => import('ui/optimismSuperchain/tx/OpSuperchainTx'), { ssr: false });
|
||||
const MultichainTx = dynamic(() => import('ui/multichain/tx/MultichainTx'), { ssr: false });
|
||||
|
||||
const Page: NextPage<Props> = (props: Props) => {
|
||||
return (
|
||||
<PageNextJs pathname="/chain/[chain_slug]/tx/[hash]" query={ props.query }>
|
||||
<OpSuperchainTx/>
|
||||
<MultichainTx/>
|
||||
</PageNextJs>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -4,12 +4,12 @@ import React from 'react';
|
||||
|
||||
import PageNextJs from 'nextjs/PageNextJs';
|
||||
|
||||
const OpSuperchainEcosystems = dynamic(() => import('ui/optimismSuperchain/ecosystems/OpSuperchainEcosystems'), { ssr: false });
|
||||
const MultichainEcosystems = dynamic(() => import('ui/multichain/ecosystems/MultichainEcosystems'), { ssr: false });
|
||||
|
||||
const Page: NextPage = () => {
|
||||
return (
|
||||
<PageNextJs pathname="/ecosystems">
|
||||
<OpSuperchainEcosystems/>
|
||||
<MultichainEcosystems/>
|
||||
</PageNextJs>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -5,14 +5,14 @@ import type { NextPageWithLayout } from 'nextjs/types';
|
||||
import PageNextJs from 'nextjs/PageNextJs';
|
||||
|
||||
import config from 'configs/app';
|
||||
import OpSuperchainHome from 'ui/optimismSuperchain/home/OpSuperchainHome';
|
||||
import MultichainHome from 'ui/multichain/home/MultichainHome';
|
||||
import Home from 'ui/pages/Home';
|
||||
import LayoutHome from 'ui/shared/layout/LayoutHome';
|
||||
|
||||
const Page: NextPageWithLayout = () => {
|
||||
return (
|
||||
<PageNextJs pathname="/">
|
||||
{ config.features.opSuperchain.isEnabled ? <OpSuperchainHome/> : <Home/> }
|
||||
{ config.features.multichain.isEnabled ? <MultichainHome/> : <Home/> }
|
||||
</PageNextJs>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -7,8 +7,8 @@ import PageNextJs from 'nextjs/PageNextJs';
|
||||
import config from 'configs/app';
|
||||
|
||||
const InternalTxs = dynamic(() => {
|
||||
if (config.features.opSuperchain.isEnabled) {
|
||||
return import('ui/optimismSuperchain/internalTxs/OpSuperchainInternalTxs');
|
||||
if (config.features.multichain.isEnabled) {
|
||||
return import('ui/multichain/internalTxs/MultichainInternalTxs');
|
||||
}
|
||||
|
||||
return import('ui/pages/InternalTxs');
|
||||
|
||||
@@ -7,8 +7,8 @@ import PageNextJs from 'nextjs/PageNextJs';
|
||||
import config from 'configs/app';
|
||||
|
||||
const UserOps = dynamic(() => {
|
||||
if (config.features.opSuperchain.isEnabled) {
|
||||
return import('ui/optimismSuperchain/userOps/OpSuperchainUserOps');
|
||||
if (config.features.multichain.isEnabled) {
|
||||
return import('ui/multichain/userOps/MultichainUserOps');
|
||||
}
|
||||
|
||||
return import('ui/pages/UserOps');
|
||||
|
||||
@@ -10,8 +10,8 @@ import config from 'configs/app';
|
||||
import LayoutSearchResults from 'ui/shared/layout/LayoutSearchResults';
|
||||
|
||||
const SearchResults = dynamic(() => {
|
||||
if (config.features.opSuperchain.isEnabled) {
|
||||
return import('ui/optimismSuperchain/searchResults/SearchResults');
|
||||
if (config.features.multichain.isEnabled) {
|
||||
return import('ui/multichain/searchResults/SearchResults');
|
||||
}
|
||||
|
||||
return import('ui/pages/SearchResults');
|
||||
|
||||
@@ -21,7 +21,7 @@ const pathname: Route['pathname'] = '/stats/[id]';
|
||||
const Page: NextPage<Props<typeof pathname>> = (props: Props<typeof pathname>) => {
|
||||
return (
|
||||
<PageNextJs pathname={ pathname } query={ props.query } apiData={ props.apiData }>
|
||||
{ config.features.opSuperchain.isEnabled ? (
|
||||
{ config.features.multichain.isEnabled ? (
|
||||
<MultichainProvider chainId={ getQueryParamString(props.query?.chain_id) }>
|
||||
<Chart/>
|
||||
</MultichainProvider>
|
||||
|
||||
@@ -4,13 +4,13 @@ import React from 'react';
|
||||
import PageNextJs from 'nextjs/PageNextJs';
|
||||
|
||||
import config from 'configs/app';
|
||||
import OpSuperchainStats from 'ui/optimismSuperchain/stats/OpSuperchainStats';
|
||||
import MultichainStats from 'ui/multichain/stats/MultichainStats';
|
||||
import Stats from 'ui/pages/Stats';
|
||||
|
||||
const Page: NextPage = () => {
|
||||
return (
|
||||
<PageNextJs pathname="/stats">
|
||||
{ config.features.opSuperchain.isEnabled ? <OpSuperchainStats/> : <Stats/> }
|
||||
{ config.features.multichain.isEnabled ? <MultichainStats/> : <Stats/> }
|
||||
</PageNextJs>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -7,8 +7,8 @@ import PageNextJs from 'nextjs/PageNextJs';
|
||||
import config from 'configs/app';
|
||||
|
||||
const TokenTransfers = dynamic(() => {
|
||||
if (config.features.opSuperchain.isEnabled) {
|
||||
return import('ui/optimismSuperchain/tokenTransfers/OpSuperchainTokenTransfers');
|
||||
if (config.features.multichain.isEnabled) {
|
||||
return import('ui/multichain/tokenTransfers/MultichainTokenTransfers');
|
||||
}
|
||||
|
||||
return import('ui/pages/TokenTransfers');
|
||||
|
||||
@@ -27,7 +27,7 @@ export default Page;
|
||||
export const getServerSideProps: GetServerSideProps<Props<typeof pathname>> = async(ctx) => {
|
||||
const baseResponse = await gSSP.token<typeof pathname>(ctx);
|
||||
|
||||
if ('props' in baseResponse && !config.features.opSuperchain.isEnabled) {
|
||||
if ('props' in baseResponse && !config.features.multichain.isEnabled) {
|
||||
if (
|
||||
config.meta.seo.enhancedDataEnabled ||
|
||||
(config.meta.og.enhancedDataEnabled && detectBotRequest(ctx.req)?.type === 'social_preview')
|
||||
|
||||
@@ -7,8 +7,8 @@ import PageNextJs from 'nextjs/PageNextJs';
|
||||
import config from 'configs/app';
|
||||
|
||||
const Tokens = dynamic(() => {
|
||||
if (config.features.opSuperchain.isEnabled) {
|
||||
return import('ui/optimismSuperchain/tokens/OpSuperchainTokens');
|
||||
if (config.features.multichain.isEnabled) {
|
||||
return import('ui/multichain/tokens/MultichainTokens');
|
||||
}
|
||||
|
||||
return import('ui/pages/Tokens');
|
||||
|
||||
@@ -7,8 +7,8 @@ import PageNextJs from 'nextjs/PageNextJs';
|
||||
import config from 'configs/app';
|
||||
|
||||
const Transactions = dynamic(() => {
|
||||
if (config.features.opSuperchain.isEnabled) {
|
||||
return import('ui/optimismSuperchain/txs/OpSuperchainTxs');
|
||||
if (config.features.multichain.isEnabled) {
|
||||
return import('ui/multichain/txs/MultichainTxs');
|
||||
}
|
||||
|
||||
if (config.features.zetachain.isEnabled) {
|
||||
|
||||
@@ -7,8 +7,8 @@ import PageNextJs from 'nextjs/PageNextJs';
|
||||
import config from 'configs/app';
|
||||
|
||||
const VerifiedContracts = dynamic(() => {
|
||||
if (config.features.opSuperchain.isEnabled) {
|
||||
return import('ui/optimismSuperchain/verifiedContracts/OpSuperchainVerifiedContracts');
|
||||
if (config.features.multichain.isEnabled) {
|
||||
return import('ui/multichain/verifiedContracts/MultichainVerifiedContracts');
|
||||
}
|
||||
|
||||
return import('ui/pages/VerifiedContracts');
|
||||
|
||||
@@ -114,7 +114,7 @@ export const ENVS_MAP: Record<string, Array<[string, string]>> = {
|
||||
celo: [
|
||||
[ 'NEXT_PUBLIC_CELO_ENABLED', 'true' ],
|
||||
],
|
||||
opSuperchain: [
|
||||
multichain: [
|
||||
[ 'NEXT_PUBLIC_MULTICHAIN_ENABLED', 'true' ],
|
||||
[ 'NEXT_PUBLIC_MULTICHAIN_CLUSTER', 'test' ],
|
||||
[ 'NEXT_PUBLIC_MULTICHAIN_AGGREGATOR_API_HOST', 'http://localhost:3012' ],
|
||||
|
||||
@@ -5,6 +5,6 @@ import * as multichainConfig from 'configs/multichain/config.nodejs';
|
||||
const marketplaceFeature = config.features.marketplace;
|
||||
|
||||
(async() => {
|
||||
config.features.opSuperchain.isEnabled && await multichainConfig.load();
|
||||
config.features.multichain.isEnabled && await multichainConfig.load();
|
||||
marketplaceFeature.isEnabled && marketplaceFeature.essentialDapps && await essentialDappsChainsConfig.load();
|
||||
})();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type * as multichain from '@blockscout/multichain-aggregator-types';
|
||||
import type * as stats from '@blockscout/stats-types';
|
||||
import type { AddressTokenItem } from 'types/client/multichain-aggregator';
|
||||
import type { AddressTokenItem } from 'types/client/multichainAggregator';
|
||||
|
||||
import { ADDRESS_HASH } from './addressParams';
|
||||
|
||||
@@ -17,10 +17,11 @@ const PRESETS = {
|
||||
immutable: 'https://explorer.immutable.com',
|
||||
mega_eth: 'https://megaeth.blockscout.com',
|
||||
mekong: 'https://mekong.blockscout.com',
|
||||
multichain_dev: 'https://superchain.k8s-dev.blockscout.com',
|
||||
// multichain_prod: 'https://multichain.blockscout.com',
|
||||
neon_devnet: 'https://neon-devnet.blockscout.com',
|
||||
numine: 'https://numine.blockscout.com',
|
||||
optimism: 'https://optimism.blockscout.com',
|
||||
optimism_superchain: 'https://superchain.k8s-dev.blockscout.com',
|
||||
optimism_sepolia: 'https://optimism-sepolia.blockscout.com',
|
||||
polygon: 'https://polygon.blockscout.com',
|
||||
rari_testnet: 'https://rari-testnet.cloud.blockscout.com',
|
||||
|
||||
@@ -26,7 +26,7 @@ dotenv \
|
||||
-- bash -c './deploy/scripts/download_assets.sh ./public/assets/configs'
|
||||
|
||||
# generate multichain config (adjust condition accordingly)
|
||||
if [[ "$preset_name" == "optimism_superchain" ]]; then
|
||||
if [[ "$preset_name" =~ "multichain_" ]]; then
|
||||
dotenv \
|
||||
-e $config_file \
|
||||
-- bash -c 'cd deploy/tools/multichain-config-generator && yarn install --silent && yarn build && yarn generate' || exit 1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { CctxListItem } from '@blockscout/zetachain-cctx-types';
|
||||
import type * as api from 'types/api/search';
|
||||
import type * as multichain from 'types/client/multichain-aggregator';
|
||||
import type * as multichain from 'types/client/multichainAggregator';
|
||||
|
||||
export interface SearchResultFutureBlock {
|
||||
type: 'block';
|
||||
|
||||
@@ -29,7 +29,7 @@ const ContractDetailsVerificationButton = ({ isLoading, addressHash, ...rest }:
|
||||
return (
|
||||
<Link
|
||||
href={ href }
|
||||
target={ config.features.opSuperchain.isEnabled ? '_blank' : undefined }
|
||||
target={ config.features.multichain.isEnabled ? '_blank' : undefined }
|
||||
flexShrink={ 0 }
|
||||
asChild
|
||||
{ ...rest }
|
||||
|
||||
@@ -14,7 +14,7 @@ const CHART_ITEMS: Record<ChainIndicatorId, Pick<TimeChartDataItem, 'name' | 'va
|
||||
valueFormatter: (x: number) => x.toLocaleString(undefined, { maximumFractionDigits: 2, notation: 'compact' }),
|
||||
},
|
||||
coin_price: {
|
||||
name: `${ config.features.opSuperchain.isEnabled ? 'ETH' : config.chain.currency.symbol } price`,
|
||||
name: `${ config.features.multichain.isEnabled ? 'ETH' : config.chain.currency.symbol } price`,
|
||||
valueFormatter: (x: number) => '$' + x.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 6 }),
|
||||
},
|
||||
secondary_coin_price: {
|
||||
|
||||
@@ -8,14 +8,14 @@ import { TOP_ADDRESS } from 'stubs/address';
|
||||
import { generateListStub } from 'stubs/utils';
|
||||
import AddressesListItem from 'ui/addresses/AddressesListItem';
|
||||
import AddressesTable from 'ui/addresses/AddressesTable';
|
||||
import ChainSelect from 'ui/optimismSuperchain/components/ChainSelect';
|
||||
import ChainSelect from 'ui/multichain/components/ChainSelect';
|
||||
import ActionBar, { ACTION_BAR_HEIGHT_DESKTOP } from 'ui/shared/ActionBar';
|
||||
import DataListDisplay from 'ui/shared/DataListDisplay';
|
||||
import PageTitle from 'ui/shared/Page/PageTitle';
|
||||
import Pagination from 'ui/shared/pagination/Pagination';
|
||||
import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages';
|
||||
|
||||
const OpSuperchainAccounts = () => {
|
||||
const MultichainAccounts = () => {
|
||||
const { isError, isPlaceholderData, data, pagination, chainValue, onChainValueChange } = useQueryWithPages({
|
||||
resourceName: 'general:addresses',
|
||||
options: {
|
||||
@@ -91,4 +91,4 @@ const OpSuperchainAccounts = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAccounts);
|
||||
export default React.memo(MultichainAccounts);
|
||||
@@ -8,7 +8,7 @@ import { ENVS_MAP } from 'playwright/fixtures/mockEnvs';
|
||||
import { test, expect } from 'playwright/lib';
|
||||
import * as pwConfig from 'playwright/utils/config';
|
||||
|
||||
import OpSuperchainAddress from './OpSuperchainAddress';
|
||||
import MultichainAddress from './MultichainAddress';
|
||||
|
||||
const CURRENT_ADDRESS = addressMock.addressA.hash;
|
||||
|
||||
@@ -21,7 +21,7 @@ const hooksConfig = {
|
||||
test('base view', async({ mockApiResponse, render, page, mockMultichainConfig, mockEnvs, mockAssetResponse, mockTextAd }) => {
|
||||
|
||||
await mockMultichainConfig();
|
||||
await mockEnvs(ENVS_MAP.opSuperchain);
|
||||
await mockEnvs(ENVS_MAP.multichain);
|
||||
await mockTextAd();
|
||||
|
||||
await mockApiResponse('multichainAggregator:address', addressMock.addressA, { pathParams: { hash: CURRENT_ADDRESS } });
|
||||
@@ -41,7 +41,7 @@ test('base view', async({ mockApiResponse, render, page, mockMultichainConfig, m
|
||||
await mockAssetResponse(addressMock.domainProtocols[1].icon_url as string, './playwright/mocks/duck.png');
|
||||
|
||||
const component = await render(
|
||||
<OpSuperchainAddress/>,
|
||||
<MultichainAddress/>,
|
||||
{ hooksConfig },
|
||||
);
|
||||
|
||||
@@ -9,28 +9,28 @@ import useApiQuery from 'lib/api/useApiQuery';
|
||||
import throwOnResourceLoadError from 'lib/errors/throwOnResourceLoadError';
|
||||
import * as contract from 'lib/multichain/contract';
|
||||
import getQueryParamString from 'lib/router/getQueryParamString';
|
||||
import { ADDRESS } from 'stubs/optimismSuperchain';
|
||||
import { ADDRESS } from 'stubs/multichain';
|
||||
import RoutedTabs from 'toolkit/components/RoutedTabs/RoutedTabs';
|
||||
import { CONTRACT_TAB_IDS } from 'ui/address/contract/utils';
|
||||
import AddressQrCode from 'ui/address/details/AddressQrCode';
|
||||
import ClusterChainsPopover from 'ui/optimismSuperchain/components/ClusterChainsPopover';
|
||||
import ClusterChainsPopover from 'ui/multichain/components/ClusterChainsPopover';
|
||||
import TextAd from 'ui/shared/ad/TextAd';
|
||||
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
|
||||
import EnsEntity from 'ui/shared/entities/ens/EnsEntity';
|
||||
import PageTitle from 'ui/shared/Page/PageTitle';
|
||||
|
||||
import OpSuperchainAddressEnsDomains from './header/OpSuperchainAddressEnsDomains';
|
||||
import OpSuperchainAddressCoinBalanceHistory from './OpSuperchainAddressCoinBalanceHistory';
|
||||
import OpSuperchainAddressContract from './OpSuperchainAddressContract';
|
||||
import OpSuperchainAddressInternalTxs from './OpSuperchainAddressInternalTxs';
|
||||
import OpSuperchainAddressLogs from './OpSuperchainAddressLogs';
|
||||
import OpSuperchainAddressPortfolio from './OpSuperchainAddressPortfolio';
|
||||
import OpSuperchainAddressTokenTransfers, { ADDRESS_OP_SUPERCHAIN_TOKEN_TRANSFERS_TAB_IDS } from './OpSuperchainAddressTokenTransfers';
|
||||
import OpSuperchainAddressTxs, { ADDRESS_OP_SUPERCHAIN_TXS_TAB_IDS } from './OpSuperchainAddressTxs';
|
||||
import MultichainAddressEnsDomains from './header/MultichainAddressEnsDomains';
|
||||
import MultichainAddressCoinBalanceHistory from './MultichainAddressCoinBalanceHistory';
|
||||
import MultichainAddressContract from './MultichainAddressContract';
|
||||
import MultichainAddressInternalTxs from './MultichainAddressInternalTxs';
|
||||
import MultichainAddressLogs from './MultichainAddressLogs';
|
||||
import MultichainAddressPortfolio from './MultichainAddressPortfolio';
|
||||
import MultichainAddressTokenTransfers, { ADDRESS_MULTICHAIN_TOKEN_TRANSFERS_TAB_IDS } from './MultichainAddressTokenTransfers';
|
||||
import MultichainAddressTxs, { ADDRESS_MULTICHAIN_TXS_TAB_IDS } from './MultichainAddressTxs';
|
||||
|
||||
const TABS_PRESERVED_PARAMS = [ 'chain_id' ];
|
||||
|
||||
const OpSuperchainAddress = () => {
|
||||
const MultichainAddress = () => {
|
||||
const router = useRouter();
|
||||
|
||||
const hash = getQueryParamString(router.query.hash);
|
||||
@@ -62,40 +62,40 @@ const OpSuperchainAddress = () => {
|
||||
{
|
||||
id: 'portfolio',
|
||||
title: 'Portfolio',
|
||||
component: <OpSuperchainAddressPortfolio addressData={ addressQuery.data } isLoading={ isLoading }/>,
|
||||
component: <MultichainAddressPortfolio addressData={ addressQuery.data } isLoading={ isLoading }/>,
|
||||
},
|
||||
isContractSomewhere && {
|
||||
id: 'contract',
|
||||
title: 'Contract',
|
||||
component: <OpSuperchainAddressContract addressHash={ checkSummedHash } data={ addressQuery.data } isLoading={ isLoading }/>,
|
||||
component: <MultichainAddressContract addressHash={ checkSummedHash } data={ addressQuery.data } isLoading={ isLoading }/>,
|
||||
subTabs: CONTRACT_TAB_IDS,
|
||||
},
|
||||
{
|
||||
id: 'txs',
|
||||
title: 'Transactions',
|
||||
component: <OpSuperchainAddressTxs addressData={ addressQuery.data } isLoading={ isLoading }/>,
|
||||
subTabs: ADDRESS_OP_SUPERCHAIN_TXS_TAB_IDS,
|
||||
component: <MultichainAddressTxs addressData={ addressQuery.data } isLoading={ isLoading }/>,
|
||||
subTabs: ADDRESS_MULTICHAIN_TXS_TAB_IDS,
|
||||
},
|
||||
{
|
||||
id: 'token_transfers',
|
||||
title: 'Token transfers',
|
||||
component: <OpSuperchainAddressTokenTransfers addressData={ addressQuery.data } isLoading={ isLoading }/>,
|
||||
subTabs: ADDRESS_OP_SUPERCHAIN_TOKEN_TRANSFERS_TAB_IDS,
|
||||
component: <MultichainAddressTokenTransfers addressData={ addressQuery.data } isLoading={ isLoading }/>,
|
||||
subTabs: ADDRESS_MULTICHAIN_TOKEN_TRANSFERS_TAB_IDS,
|
||||
},
|
||||
{
|
||||
id: 'internal_txs',
|
||||
title: 'Internal txns',
|
||||
component: <OpSuperchainAddressInternalTxs addressData={ addressQuery.data } isLoading={ isLoading }/>,
|
||||
component: <MultichainAddressInternalTxs addressData={ addressQuery.data } isLoading={ isLoading }/>,
|
||||
},
|
||||
{
|
||||
id: 'coin_balance_history',
|
||||
title: 'Coin balance history',
|
||||
component: <OpSuperchainAddressCoinBalanceHistory addressData={ addressQuery.data } isLoading={ isLoading }/>,
|
||||
component: <MultichainAddressCoinBalanceHistory addressData={ addressQuery.data } isLoading={ isLoading }/>,
|
||||
},
|
||||
isContractSomewhere && {
|
||||
id: 'logs',
|
||||
title: 'Logs',
|
||||
component: <OpSuperchainAddressLogs addressData={ addressQuery.data } isLoading={ isLoading }/>,
|
||||
component: <MultichainAddressLogs addressData={ addressQuery.data } isLoading={ isLoading }/>,
|
||||
},
|
||||
].filter(Boolean);
|
||||
}, [ addressQuery.data, isLoading, isContractSomewhere, checkSummedHash ]);
|
||||
@@ -132,7 +132,7 @@ const OpSuperchainAddress = () => {
|
||||
/>
|
||||
<AddressQrCode hash={ checkSummedHash } isLoading={ isLoading }/>
|
||||
<Box ml="auto"/>
|
||||
<OpSuperchainAddressEnsDomains
|
||||
<MultichainAddressEnsDomains
|
||||
mainDomain={ addressQuery.data?.domains?.[0] }
|
||||
isLoading={ isLoading }
|
||||
hash={ checkSummedHash }
|
||||
@@ -154,4 +154,4 @@ const OpSuperchainAddress = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddress);
|
||||
export default React.memo(MultichainAddress);
|
||||
@@ -8,7 +8,7 @@ import { MultichainProvider } from 'lib/contexts/multichain';
|
||||
import useRoutedChainSelect from 'lib/multichain/useRoutedChainSelect';
|
||||
import { SocketProvider } from 'lib/socket/context';
|
||||
import AddressCoinBalance from 'ui/address/AddressCoinBalance';
|
||||
import ChainSelect from 'ui/optimismSuperchain/components/ChainSelect';
|
||||
import ChainSelect from 'ui/multichain/components/ChainSelect';
|
||||
|
||||
import getAvailableChainIds from './getAvailableChainIds';
|
||||
|
||||
@@ -19,7 +19,7 @@ interface Props {
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressCoinBalanceHistory = ({ addressData, isLoading }: Props) => {
|
||||
const MultichainAddressCoinBalanceHistory = ({ addressData, isLoading }: Props) => {
|
||||
const chainIds = React.useMemo(() => getAvailableChainIds(addressData), [ addressData ]);
|
||||
|
||||
const chainSelect = useRoutedChainSelect({ persistedParams: QUERY_PRESERVED_PARAMS, chainIds, isLoading });
|
||||
@@ -49,4 +49,4 @@ const OpSuperchainAddressCoinBalanceHistory = ({ addressData, isLoading }: Props
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddressCoinBalanceHistory);
|
||||
export default React.memo(MultichainAddressCoinBalanceHistory);
|
||||
@@ -11,7 +11,7 @@ import useRoutedChainSelect from 'lib/multichain/useRoutedChainSelect';
|
||||
import { SocketProvider } from 'lib/socket/context';
|
||||
import { ADDRESS_INFO } from 'stubs/address';
|
||||
import AddressContract from 'ui/address/AddressContract';
|
||||
import ChainSelect from 'ui/optimismSuperchain/components/ChainSelect';
|
||||
import ChainSelect from 'ui/multichain/components/ChainSelect';
|
||||
|
||||
import getAvailableChainIds from './getAvailableChainIds';
|
||||
|
||||
@@ -27,7 +27,7 @@ interface Props {
|
||||
data: multichain.GetAddressResponse | undefined;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressContract = ({ addressHash, isLoading, data }: Props) => {
|
||||
const MultichainAddressContract = ({ addressHash, isLoading, data }: Props) => {
|
||||
const chainIds = React.useMemo(() => getAvailableChainIds(data), [ data ]);
|
||||
const chainSelect = useRoutedChainSelect({ persistedParams: QUERY_PRESERVED_PARAMS, isLoading, chainIds });
|
||||
const isMobile = useIsMobile();
|
||||
@@ -70,4 +70,4 @@ const OpSuperchainAddressContract = ({ addressHash, isLoading, data }: Props) =>
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddressContract);
|
||||
export default React.memo(MultichainAddressContract);
|
||||
@@ -10,7 +10,7 @@ import AddressTxsFilter from 'ui/address/AddressTxsFilter';
|
||||
import useAddressInternalTxsQuery from 'ui/address/useAddressInternalTxsQuery';
|
||||
import InternalTxsList from 'ui/internalTxs/InternalTxsList';
|
||||
import InternalTxsTable from 'ui/internalTxs/InternalTxsTable';
|
||||
import ChainSelect from 'ui/optimismSuperchain/components/ChainSelect';
|
||||
import ChainSelect from 'ui/multichain/components/ChainSelect';
|
||||
import ActionBar from 'ui/shared/ActionBar';
|
||||
import DataListDisplay from 'ui/shared/DataListDisplay';
|
||||
import Pagination from 'ui/shared/pagination/Pagination';
|
||||
@@ -22,7 +22,7 @@ interface Props {
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressInternalTxs = ({ addressData, isLoading }: Props) => {
|
||||
const MultichainAddressInternalTxs = ({ addressData, isLoading }: Props) => {
|
||||
const chainIds = React.useMemo(() => getAvailableChainIds(addressData), [ addressData ]);
|
||||
|
||||
const { hash, query, filterValue, onFilterChange } = useAddressInternalTxsQuery({
|
||||
@@ -96,4 +96,4 @@ const OpSuperchainAddressInternalTxs = ({ addressData, isLoading }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddressInternalTxs);
|
||||
export default React.memo(MultichainAddressInternalTxs);
|
||||
@@ -10,7 +10,7 @@ import getQueryParamString from 'lib/router/getQueryParamString';
|
||||
import { LOG } from 'stubs/log';
|
||||
import { generateListStub } from 'stubs/utils';
|
||||
import AddressCsvExportLink from 'ui/address/AddressCsvExportLink';
|
||||
import ChainSelect from 'ui/optimismSuperchain/components/ChainSelect';
|
||||
import ChainSelect from 'ui/multichain/components/ChainSelect';
|
||||
import ActionBar from 'ui/shared/ActionBar';
|
||||
import DataListDisplay from 'ui/shared/DataListDisplay';
|
||||
import LogItem from 'ui/shared/logs/LogItem';
|
||||
@@ -24,7 +24,7 @@ interface Props {
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressLogs = ({ addressData, isLoading }: Props) => {
|
||||
const MultichainAddressLogs = ({ addressData, isLoading }: Props) => {
|
||||
const router = useRouter();
|
||||
const chainIds = React.useMemo(() => getAvailableChainIds(addressData), [ addressData ]);
|
||||
const isMobile = useIsMobile();
|
||||
@@ -99,4 +99,4 @@ const OpSuperchainAddressLogs = ({ addressData, isLoading }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default OpSuperchainAddressLogs;
|
||||
export default MultichainAddressLogs;
|
||||
@@ -9,13 +9,13 @@ import { ENVS_MAP } from 'playwright/fixtures/mockEnvs';
|
||||
import { test, expect } from 'playwright/lib';
|
||||
import * as pwConfig from 'playwright/utils/config';
|
||||
|
||||
import OpSuperchainAddressPortfolio from './OpSuperchainAddressPortfolio';
|
||||
import MultichainAddressPortfolio from './MultichainAddressPortfolio';
|
||||
|
||||
const CURRENT_ADDRESS = '0xd789a607CEac2f0E14867de4EB15b15C9FFB5859';
|
||||
|
||||
test.beforeEach(async({ mockMultichainConfig, mockEnvs }) => {
|
||||
await mockMultichainConfig();
|
||||
await mockEnvs(ENVS_MAP.opSuperchain);
|
||||
await mockEnvs(ENVS_MAP.multichain);
|
||||
});
|
||||
|
||||
test.describe('nfts', () => {
|
||||
@@ -36,7 +36,7 @@ test.describe('nfts', () => {
|
||||
|
||||
component = await render(
|
||||
<Box pt={{ base: 0, lg: '30px' }}>
|
||||
<OpSuperchainAddressPortfolio addressData={ addressMock.addressA } isLoading={ false }/>
|
||||
<MultichainAddressPortfolio addressData={ addressMock.addressA } isLoading={ false }/>
|
||||
</Box>,
|
||||
{ hooksConfig },
|
||||
);
|
||||
@@ -14,11 +14,11 @@ import AddressNftDisplayTypeRadio from 'ui/address/tokens/AddressNftDisplayTypeR
|
||||
import AddressNFTs from 'ui/address/tokens/AddressNFTs';
|
||||
import AddressNftTypeFilter from 'ui/address/tokens/AddressNftTypeFilter';
|
||||
import useAddressNftQuery from 'ui/address/tokens/useAddressNftQuery';
|
||||
import ChainSelect from 'ui/optimismSuperchain/components/ChainSelect';
|
||||
import ChainSelect from 'ui/multichain/components/ChainSelect';
|
||||
import Pagination from 'ui/shared/pagination/Pagination';
|
||||
|
||||
import getAvailableChainIds from './getAvailableChainIds';
|
||||
import OpSuperchainAddressPortfolioTokens from './portfolio/OpSuperchainAddressPortfolioTokens';
|
||||
import MultichainAddressPortfolioTokens from './portfolio/MultichainAddressPortfolioTokens';
|
||||
|
||||
export const ADDRESS_OP_PORTFOLIO_TAB_IDS = [ 'portfolio_tokens' as const, 'portfolio_nfts' as const ];
|
||||
const TABS_RIGHT_SLOT_PROPS = {
|
||||
@@ -40,7 +40,7 @@ interface Props {
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressPortfolio = ({ addressData, isLoading }: Props) => {
|
||||
const MultichainAddressPortfolio = ({ addressData, isLoading }: Props) => {
|
||||
const scrollRef = React.useRef<HTMLDivElement>(null);
|
||||
|
||||
const isMobile = useIsMobile();
|
||||
@@ -108,7 +108,7 @@ const OpSuperchainAddressPortfolio = ({ addressData, isLoading }: Props) => {
|
||||
{
|
||||
id: 'portfolio_tokens',
|
||||
title: 'Tokens',
|
||||
component: <OpSuperchainAddressPortfolioTokens addressData={ addressData } isLoading={ isLoading } onChainChange={ handleChainChange }/>,
|
||||
component: <MultichainAddressPortfolioTokens addressData={ addressData } isLoading={ isLoading } onChainChange={ handleChainChange }/>,
|
||||
},
|
||||
{
|
||||
id: 'portfolio_nfts',
|
||||
@@ -142,4 +142,4 @@ const OpSuperchainAddressPortfolio = ({ addressData, isLoading }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddressPortfolio);
|
||||
export default React.memo(MultichainAddressPortfolio);
|
||||
@@ -10,7 +10,7 @@ import { ENVS_MAP } from 'playwright/fixtures/mockEnvs';
|
||||
import { test, expect } from 'playwright/lib';
|
||||
import * as pwConfig from 'playwright/utils/config';
|
||||
|
||||
import OpSuperchainAddressTokenTransfers from './OpSuperchainAddressTokenTransfers';
|
||||
import MultichainAddressTokenTransfers from './MultichainAddressTokenTransfers';
|
||||
|
||||
const CURRENT_ADDRESS = '0xd789a607CEac2f0E14867de4EB15b15C9FFB5859';
|
||||
|
||||
@@ -26,7 +26,7 @@ test.describe('local transfers', () => {
|
||||
|
||||
test.beforeEach(async({ render, mockMultichainConfig, mockEnvs, mockApiResponse, mockAssetResponse, createSocket }) => {
|
||||
await mockMultichainConfig();
|
||||
await mockEnvs(ENVS_MAP.opSuperchain);
|
||||
await mockEnvs(ENVS_MAP.multichain);
|
||||
await mockApiResponse(
|
||||
'general:address_token_transfers',
|
||||
{ items: [ tokenTransferMock.erc20 ], next_page_params: DEFAULT_PAGINATION },
|
||||
@@ -41,7 +41,7 @@ test.describe('local transfers', () => {
|
||||
|
||||
component = await render(
|
||||
<Box pt={{ base: '134px', lg: 6 }}>
|
||||
<OpSuperchainAddressTokenTransfers addressData={ addressMock.addressA } isLoading={ false }/>
|
||||
<MultichainAddressTokenTransfers addressData={ addressMock.addressA } isLoading={ false }/>
|
||||
</Box>,
|
||||
{ hooksConfig },
|
||||
{ withSocket: true },
|
||||
@@ -18,7 +18,7 @@ import AddressCsvExportLink from 'ui/address/AddressCsvExportLink';
|
||||
import AddressTokenTransfersLocal from 'ui/address/AddressTokenTransfersLocal';
|
||||
import useAddressTokenTransfersQuery from 'ui/address/useAddressTokenTransfersQuery';
|
||||
import useAddressCountersQuery from 'ui/address/utils/useAddressCountersQuery';
|
||||
import ChainSelect from 'ui/optimismSuperchain/components/ChainSelect';
|
||||
import ChainSelect from 'ui/multichain/components/ChainSelect';
|
||||
import Pagination from 'ui/shared/pagination/Pagination';
|
||||
import TokenTransferFilter from 'ui/shared/TokenTransfer/TokenTransferFilter';
|
||||
import { getTokenFilterValue } from 'ui/tokens/utils';
|
||||
@@ -26,7 +26,7 @@ import { getTokenFilterValue } from 'ui/tokens/utils';
|
||||
import ListCounterText from '../components/ListCounterText';
|
||||
import getAvailableChainIds from './getAvailableChainIds';
|
||||
|
||||
export const ADDRESS_OP_SUPERCHAIN_TOKEN_TRANSFERS_TAB_IDS = [ 'token_transfers_cross_chain' as const, 'token_transfers_local' as const ];
|
||||
export const ADDRESS_MULTICHAIN_TOKEN_TRANSFERS_TAB_IDS = [ 'token_transfers_cross_chain' as const, 'token_transfers_local' as const ];
|
||||
const TABS_RIGHT_SLOT_PROPS = {
|
||||
display: 'flex',
|
||||
justifyContent: { base: 'flex-end', lg: 'space-between' },
|
||||
@@ -45,12 +45,12 @@ interface Props {
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressTokenTransfers = ({ addressData, isLoading }: Props) => {
|
||||
const MultichainAddressTokenTransfers = ({ addressData, isLoading }: Props) => {
|
||||
const router = useRouter();
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
const hash = getQueryParamString(router.query.hash);
|
||||
const tab = getQueryParamString(router.query.tab) as typeof ADDRESS_OP_SUPERCHAIN_TOKEN_TRANSFERS_TAB_IDS[number] | 'token_transfers' | undefined;
|
||||
const tab = getQueryParamString(router.query.tab) as typeof ADDRESS_MULTICHAIN_TOKEN_TRANSFERS_TAB_IDS[number] | 'token_transfers' | undefined;
|
||||
const isLocalTab = tab === 'token_transfers_local' || tab === 'token_transfers';
|
||||
|
||||
const chainIds = React.useMemo(() => getAvailableChainIds(addressData), [ addressData ]);
|
||||
@@ -198,4 +198,4 @@ const OpSuperchainAddressTokenTransfers = ({ addressData, isLoading }: Props) =>
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddressTokenTransfers);
|
||||
export default React.memo(MultichainAddressTokenTransfers);
|
||||
@@ -10,7 +10,7 @@ import { ENVS_MAP } from 'playwright/fixtures/mockEnvs';
|
||||
import { test, expect } from 'playwright/lib';
|
||||
import * as pwConfig from 'playwright/utils/config';
|
||||
|
||||
import OpSuperchainAddressTxs from './OpSuperchainAddressTxs';
|
||||
import MultichainAddressTxs from './MultichainAddressTxs';
|
||||
|
||||
const CURRENT_ADDRESS = '0xd789a607CEac2f0E14867de4EB15b15C9FFB5859';
|
||||
|
||||
@@ -26,7 +26,7 @@ test.describe('local txs', () => {
|
||||
|
||||
test.beforeEach(async({ render, mockMultichainConfig, mockEnvs, mockApiResponse, mockAssetResponse, createSocket }) => {
|
||||
await mockMultichainConfig();
|
||||
await mockEnvs(ENVS_MAP.opSuperchain);
|
||||
await mockEnvs(ENVS_MAP.multichain);
|
||||
await mockApiResponse(
|
||||
'general:address_txs',
|
||||
{ items: [ txMock.base ], next_page_params: DEFAULT_PAGINATION },
|
||||
@@ -41,7 +41,7 @@ test.describe('local txs', () => {
|
||||
|
||||
component = await render(
|
||||
<Box pt={{ base: '134px', lg: 6 }}>
|
||||
<OpSuperchainAddressTxs addressData={ addressMock.addressA } isLoading={ false }/>
|
||||
<MultichainAddressTxs addressData={ addressMock.addressA } isLoading={ false }/>
|
||||
</Box>,
|
||||
{ hooksConfig },
|
||||
{ withSocket: true },
|
||||
@@ -17,7 +17,7 @@ import AddressCsvExportLink from 'ui/address/AddressCsvExportLink';
|
||||
import AddressTxsFilter from 'ui/address/AddressTxsFilter';
|
||||
import useAddressTxsQuery from 'ui/address/useAddressTxsQuery';
|
||||
import useAddressCountersQuery from 'ui/address/utils/useAddressCountersQuery';
|
||||
import ChainSelect from 'ui/optimismSuperchain/components/ChainSelect';
|
||||
import ChainSelect from 'ui/multichain/components/ChainSelect';
|
||||
import { ACTION_BAR_HEIGHT_DESKTOP } from 'ui/shared/ActionBar';
|
||||
import Pagination from 'ui/shared/pagination/Pagination';
|
||||
import TxsWithAPISorting from 'ui/txs/TxsWithAPISorting';
|
||||
@@ -25,7 +25,7 @@ import TxsWithAPISorting from 'ui/txs/TxsWithAPISorting';
|
||||
import ListCounterText from '../components/ListCounterText';
|
||||
import getAvailableChainIds from './getAvailableChainIds';
|
||||
|
||||
export const ADDRESS_OP_SUPERCHAIN_TXS_TAB_IDS = [ 'txs_cross_chain' as const, 'txs_local' as const ];
|
||||
export const ADDRESS_MULTICHAIN_TXS_TAB_IDS = [ 'txs_cross_chain' as const, 'txs_local' as const ];
|
||||
const TAB_LIST_PROPS = {
|
||||
marginBottom: 0,
|
||||
pt: 6,
|
||||
@@ -44,12 +44,12 @@ interface Props {
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressTxs = ({ addressData, isLoading }: Props) => {
|
||||
const MultichainAddressTxs = ({ addressData, isLoading }: Props) => {
|
||||
const router = useRouter();
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
const hash = getQueryParamString(router.query.hash);
|
||||
const tab = getQueryParamString(router.query.tab) as typeof ADDRESS_OP_SUPERCHAIN_TXS_TAB_IDS[number] | 'txs' | undefined;
|
||||
const tab = getQueryParamString(router.query.tab) as typeof ADDRESS_MULTICHAIN_TXS_TAB_IDS[number] | 'txs' | undefined;
|
||||
const isLocalTab = tab === 'txs_local' || tab === 'txs';
|
||||
|
||||
const chainIds = React.useMemo(() => getAvailableChainIds(addressData), [ addressData ]);
|
||||
@@ -181,4 +181,4 @@ const OpSuperchainAddressTxs = ({ addressData, isLoading }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddressTxs);
|
||||
export default React.memo(MultichainAddressTxs);
|
||||
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
@@ -32,7 +32,7 @@ interface Props {
|
||||
hash: string;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressEnsDomains = ({ mainDomain, isLoading, hash }: Props) => {
|
||||
const MultichainAddressEnsDomains = ({ mainDomain, isLoading, hash }: Props) => {
|
||||
const rootRef = React.useRef<HTMLDivElement>(null);
|
||||
|
||||
const popover = useDisclosure();
|
||||
@@ -117,4 +117,4 @@ const OpSuperchainAddressEnsDomains = ({ mainDomain, isLoading, hash }: Props) =
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddressEnsDomains);
|
||||
export default React.memo(MultichainAddressEnsDomains);
|
||||
@@ -24,7 +24,7 @@ interface Props {
|
||||
onClick?: (chainId: string) => void;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressPortfolioCard = ({ chain, value, share, isLoading, isSelected: isSelectedProp, noneIsSelected, totalNum, onClick }: Props) => {
|
||||
const MultichainAddressPortfolioCard = ({ chain, value, share, isLoading, isSelected: isSelectedProp, noneIsSelected, totalNum, onClick }: Props) => {
|
||||
|
||||
const isSelected = isSelectedProp || totalNum === 1;
|
||||
|
||||
@@ -74,4 +74,4 @@ const OpSuperchainAddressPortfolioCard = ({ chain, value, share, isLoading, isSe
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddressPortfolioCard);
|
||||
export default React.memo(MultichainAddressPortfolioCard);
|
||||
@@ -11,7 +11,7 @@ import useIsMobile from 'lib/hooks/useIsMobile';
|
||||
import { CollapsibleList } from 'toolkit/chakra/collapsible';
|
||||
import IconSvg from 'ui/shared/IconSvg';
|
||||
|
||||
import OpSuperchainAddressPortfolioCard from './OpSuperchainAddressPortfolioCard';
|
||||
import MultichainAddressPortfolioCard from './MultichainAddressPortfolioCard';
|
||||
|
||||
const TRIGGER_PROPS: LinkProps = {
|
||||
variant: 'secondary',
|
||||
@@ -27,7 +27,7 @@ interface Props {
|
||||
totalValue?: string;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressPortfolioCards = ({ isLoading, selectedChainId, onChange, chainValues, totalValue }: Props) => {
|
||||
const MultichainAddressPortfolioCards = ({ isLoading, selectedChainId, onChange, chainValues, totalValue }: Props) => {
|
||||
|
||||
const [ initialActiveIndex, setInitialActiveIndex ] = React.useState<number | undefined>(undefined);
|
||||
|
||||
@@ -70,7 +70,7 @@ const OpSuperchainAddressPortfolioCards = ({ isLoading, selectedChainId, onChang
|
||||
|
||||
const renderItem = React.useCallback((item: typeof items[number]) => {
|
||||
return (
|
||||
<OpSuperchainAddressPortfolioCard
|
||||
<MultichainAddressPortfolioCard
|
||||
key={ item.chain.id }
|
||||
chain={ item.chain }
|
||||
value={ item.value }
|
||||
@@ -116,4 +116,4 @@ const OpSuperchainAddressPortfolioCards = ({ isLoading, selectedChainId, onChang
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddressPortfolioCards);
|
||||
export default React.memo(MultichainAddressPortfolioCards);
|
||||
@@ -35,7 +35,7 @@ interface Props {
|
||||
topTokens?: Array<{ symbol: string; share: number }>;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressPortfolioNetWorth = ({ addressHash, netWorth, isLoading, topTokens }: Props) => {
|
||||
const MultichainAddressPortfolioNetWorth = ({ addressHash, netWorth, isLoading, topTokens }: Props) => {
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
const handleMultichainClick = React.useCallback(() => {
|
||||
@@ -152,4 +152,4 @@ const OpSuperchainAddressPortfolioNetWorth = ({ addressHash, netWorth, isLoading
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddressPortfolioNetWorth);
|
||||
export default React.memo(MultichainAddressPortfolioNetWorth);
|
||||
@@ -8,7 +8,7 @@ import { ENVS_MAP } from 'playwright/fixtures/mockEnvs';
|
||||
import { test, expect } from 'playwright/lib';
|
||||
import * as pwConfig from 'playwright/utils/config';
|
||||
|
||||
import OpSuperchainAddressPortfolioTokens from './OpSuperchainAddressPortfolioTokens';
|
||||
import MultichainAddressPortfolioTokens from './MultichainAddressPortfolioTokens';
|
||||
|
||||
const CURRENT_ADDRESS = '0xd789a607CEac2f0E14867de4EB15b15C9FFB5859';
|
||||
const hooksConfig = {
|
||||
@@ -19,7 +19,7 @@ const hooksConfig = {
|
||||
|
||||
test.beforeEach(async({ mockMultichainConfig, mockAssetResponse, mockEnvs }) => {
|
||||
await mockMultichainConfig();
|
||||
await mockEnvs(ENVS_MAP.opSuperchain);
|
||||
await mockEnvs(ENVS_MAP.multichain);
|
||||
await mockAssetResponse(chainDataMock.chainA.logo as string, './playwright/mocks/duck.png');
|
||||
await mockAssetResponse(chainDataMock.chainB.logo as string, './playwright/mocks/goose.png');
|
||||
});
|
||||
@@ -42,7 +42,7 @@ test('many chains +@mobile +@dark-mode', async({ render, mockApiResponse, page }
|
||||
});
|
||||
|
||||
const component = await render(
|
||||
<OpSuperchainAddressPortfolioTokens addressData={ addressMock.addressA } isLoading={ false }/>,
|
||||
<MultichainAddressPortfolioTokens addressData={ addressMock.addressA } isLoading={ false }/>,
|
||||
{ hooksConfig },
|
||||
);
|
||||
await expect(component).toHaveScreenshot({
|
||||
@@ -77,7 +77,7 @@ test('zero net worth', async({ render, mockApiResponse, page }) => {
|
||||
}, { pathParams: { hash: CURRENT_ADDRESS }, queryParams: { type: 'ERC-20,NATIVE', include_poor_reputation_tokens: false } });
|
||||
|
||||
const component = await render(
|
||||
<OpSuperchainAddressPortfolioTokens addressData={ addressData } isLoading={ false }/>,
|
||||
<MultichainAddressPortfolioTokens addressData={ addressData } isLoading={ false }/>,
|
||||
{ hooksConfig },
|
||||
);
|
||||
await expect(component).toHaveScreenshot({
|
||||
@@ -12,7 +12,7 @@ import useApiQuery from 'lib/api/useApiQuery';
|
||||
import * as cookies from 'lib/cookies';
|
||||
import useDebounce from 'lib/hooks/useDebounce';
|
||||
import getQueryParamString from 'lib/router/getQueryParamString';
|
||||
import { ADDRESS_PORTFOLIO, TOKEN } from 'stubs/optimismSuperchain';
|
||||
import { ADDRESS_PORTFOLIO, TOKEN } from 'stubs/multichain';
|
||||
import { generateListStub } from 'stubs/utils';
|
||||
import { FilterInput } from 'toolkit/components/filters/FilterInput';
|
||||
import { ZERO } from 'toolkit/utils/consts';
|
||||
@@ -22,10 +22,10 @@ import DataListDisplay from 'ui/shared/DataListDisplay';
|
||||
import Pagination from 'ui/shared/pagination/Pagination';
|
||||
import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages';
|
||||
|
||||
import OpSuperchainAddressPortfolioCards from './OpSuperchainAddressPortfolioCards';
|
||||
import OpSuperchainAddressPortfolioNetWorth from './OpSuperchainAddressPortfolioNetWorth';
|
||||
import OpSuperchainAddressTokensListItem from './OpSuperchainAddressTokensListItem';
|
||||
import OpSuperchainAddressTokensTable from './OpSuperchainAddressTokensTable';
|
||||
import MultichainAddressPortfolioCards from './MultichainAddressPortfolioCards';
|
||||
import MultichainAddressPortfolioNetWorth from './MultichainAddressPortfolioNetWorth';
|
||||
import MultichainAddressTokensListItem from './MultichainAddressTokensListItem';
|
||||
import MultichainAddressTokensTable from './MultichainAddressTokensTable';
|
||||
|
||||
interface Props {
|
||||
addressData: multichain.GetAddressResponse | undefined;
|
||||
@@ -33,7 +33,7 @@ interface Props {
|
||||
onChainChange?: (chainId: string | null) => void;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressPortfolioTokens = ({ addressData, isLoading, onChainChange }: Props) => {
|
||||
const MultichainAddressPortfolioTokens = ({ addressData, isLoading, onChainChange }: Props) => {
|
||||
const config = multichainConfig();
|
||||
const router = useRouter();
|
||||
|
||||
@@ -190,7 +190,7 @@ const OpSuperchainAddressPortfolioTokens = ({ addressData, isLoading, onChainCha
|
||||
const tokensContent = tokensQuery.data?.items ? (
|
||||
<>
|
||||
<Box hideBelow="lg">
|
||||
<OpSuperchainAddressTokensTable
|
||||
<MultichainAddressTokensTable
|
||||
data={ tokensQuery.data.items }
|
||||
top={ ACTION_BAR_HEIGHT_DESKTOP }
|
||||
isLoading={ tokensQuery.isPlaceholderData }
|
||||
@@ -198,7 +198,7 @@ const OpSuperchainAddressPortfolioTokens = ({ addressData, isLoading, onChainCha
|
||||
</Box>
|
||||
<Box hideFrom="lg">
|
||||
{ tokensQuery.data.items.map((item, index) => (
|
||||
<OpSuperchainAddressTokensListItem
|
||||
<MultichainAddressTokensListItem
|
||||
key={ item.token.address_hash + (tokensQuery.isPlaceholderData ? index : '') + (item.chain_values ? Object.keys(item.chain_values).join(',') : '') }
|
||||
data={ item }
|
||||
isLoading={ tokensQuery.isPlaceholderData }
|
||||
@@ -226,13 +226,13 @@ const OpSuperchainAddressPortfolioTokens = ({ addressData, isLoading, onChainCha
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<OpSuperchainAddressPortfolioNetWorth
|
||||
<MultichainAddressPortfolioNetWorth
|
||||
addressHash={ hash }
|
||||
netWorth={ portfolioQuery.data?.portfolio?.total_value }
|
||||
isLoading={ portfolioQuery.isPlaceholderData || allTokensQuery.isPlaceholderData || isLoading }
|
||||
topTokens={ topTokens }
|
||||
/>
|
||||
<OpSuperchainAddressPortfolioCards
|
||||
<MultichainAddressPortfolioCards
|
||||
chainValues={ portfolioData }
|
||||
totalValue={ portfolioQuery.data?.portfolio?.total_value }
|
||||
selectedChainId={ selectedChainId }
|
||||
@@ -254,4 +254,4 @@ const OpSuperchainAddressPortfolioTokens = ({ addressData, isLoading, onChainCha
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddressPortfolioTokens);
|
||||
export default React.memo(MultichainAddressPortfolioTokens);
|
||||
@@ -20,7 +20,7 @@ interface Props {
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressTokensListItem = ({ data, isLoading }: Props) => {
|
||||
const MultichainAddressTokensListItem = ({ data, isLoading }: Props) => {
|
||||
const chainInfo = React.useMemo(() => {
|
||||
if (!data.chain_values) {
|
||||
return;
|
||||
@@ -107,4 +107,4 @@ const OpSuperchainAddressTokensListItem = ({ data, isLoading }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddressTokensListItem);
|
||||
export default React.memo(MultichainAddressTokensListItem);
|
||||
@@ -4,7 +4,7 @@ import type { AddressTokensErc20Item } from 'ui/address/tokens/types';
|
||||
|
||||
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
|
||||
|
||||
import OpSuperchainAddressTokensTableItem from './OpSuperchainAddressTokensTableItem';
|
||||
import MultichainAddressTokensTableItem from './MultichainAddressTokensTableItem';
|
||||
|
||||
interface Props {
|
||||
data: Array<AddressTokensErc20Item>;
|
||||
@@ -12,7 +12,7 @@ interface Props {
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressTokensTable = ({ data, top, isLoading }: Props) => {
|
||||
const MultichainAddressTokensTable = ({ data, top, isLoading }: Props) => {
|
||||
return (
|
||||
<TableRoot>
|
||||
<TableHeaderSticky top={ top }>
|
||||
@@ -25,7 +25,7 @@ const OpSuperchainAddressTokensTable = ({ data, top, isLoading }: Props) => {
|
||||
</TableHeaderSticky>
|
||||
<TableBody>
|
||||
{ data.map((item, index) => (
|
||||
<OpSuperchainAddressTokensTableItem
|
||||
<MultichainAddressTokensTableItem
|
||||
key={ item.token.address_hash + (isLoading ? index : '') + (item.chain_values ? Object.keys(item.chain_values).join(',') : '') }
|
||||
data={ item }
|
||||
isLoading={ isLoading }
|
||||
@@ -36,4 +36,4 @@ const OpSuperchainAddressTokensTable = ({ data, top, isLoading }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddressTokensTable);
|
||||
export default React.memo(MultichainAddressTokensTable);
|
||||
@@ -20,7 +20,7 @@ interface Props {
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
const OpSuperchainAddressTokensTableItem = ({ data, isLoading }: Props) => {
|
||||
const MultichainAddressTokensTableItem = ({ data, isLoading }: Props) => {
|
||||
|
||||
const {
|
||||
valueBn: tokenQuantity,
|
||||
@@ -99,4 +99,4 @@ const OpSuperchainAddressTokensTableItem = ({ data, isLoading }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainAddressTokensTableItem);
|
||||
export default React.memo(MultichainAddressTokensTableItem);
|
||||
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 118 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
@@ -6,7 +6,7 @@ import { MultichainProvider } from 'lib/contexts/multichain';
|
||||
import getQueryParamString from 'lib/router/getQueryParamString';
|
||||
import Block from 'ui/pages/Block';
|
||||
|
||||
const OpSuperchainBlock = () => {
|
||||
const MultichainBlock = () => {
|
||||
const router = useRouter();
|
||||
const chainSlug = getQueryParamString(router.query.chain_slug);
|
||||
const chainData = multichainConfig()?.chains.find(chain => chain.slug === chainSlug);
|
||||
@@ -18,4 +18,4 @@ const OpSuperchainBlock = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainBlock);
|
||||
export default React.memo(MultichainBlock);
|
||||
@@ -13,13 +13,13 @@ import { BLOCK } from 'stubs/block';
|
||||
import { generateListStub } from 'stubs/utils';
|
||||
import { Link } from 'toolkit/chakra/link';
|
||||
import RoutedTabs from 'toolkit/components/RoutedTabs/RoutedTabs';
|
||||
import ChainSelect from 'ui/optimismSuperchain/components/ChainSelect';
|
||||
import ChainSelect from 'ui/multichain/components/ChainSelect';
|
||||
import IconSvg from 'ui/shared/IconSvg';
|
||||
import PageTitle from 'ui/shared/Page/PageTitle';
|
||||
import Pagination from 'ui/shared/pagination/Pagination';
|
||||
import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages';
|
||||
|
||||
import OpSuperchainBlocksContent from './OpSuperchainBlocksContent';
|
||||
import MultichainBlocksContent from './MultichainBlocksContent';
|
||||
|
||||
const QUERY_PRESERVED_PARAMS = [ 'chain_id' ];
|
||||
const TABS_LEFT_SLOT_PROPS = {
|
||||
@@ -32,7 +32,7 @@ const TAB_LIST_PROPS = {
|
||||
pb: { base: 9, lg: 3 },
|
||||
};
|
||||
|
||||
const OpSuperchainBlocks = () => {
|
||||
const MultichainBlocks = () => {
|
||||
const router = useRouter();
|
||||
const tab = getQueryParamString(router.query.tab);
|
||||
const isMobile = useIsMobile();
|
||||
@@ -77,9 +77,9 @@ const OpSuperchainBlocks = () => {
|
||||
});
|
||||
|
||||
const tabs: Array<TabItemRegular> = [
|
||||
{ id: 'blocks', title: 'All', component: <OpSuperchainBlocksContent type="block" query={ blocksQuery } chainId={ blocksQuery.chainValue?.[0] }/> },
|
||||
{ id: 'reorgs', title: 'Forked', component: <OpSuperchainBlocksContent type="reorg" query={ reorgsQuery } chainId={ reorgsQuery.chainValue?.[0] }/> },
|
||||
{ id: 'uncles', title: 'Uncles', component: <OpSuperchainBlocksContent type="uncle" query={ unclesQuery } chainId={ unclesQuery.chainValue?.[0] }/> },
|
||||
{ id: 'blocks', title: 'All', component: <MultichainBlocksContent type="block" query={ blocksQuery } chainId={ blocksQuery.chainValue?.[0] }/> },
|
||||
{ id: 'reorgs', title: 'Forked', component: <MultichainBlocksContent type="reorg" query={ reorgsQuery } chainId={ reorgsQuery.chainValue?.[0] }/> },
|
||||
{ id: 'uncles', title: 'Uncles', component: <MultichainBlocksContent type="uncle" query={ unclesQuery } chainId={ unclesQuery.chainValue?.[0] }/> },
|
||||
];
|
||||
|
||||
const currentQuery = (() => {
|
||||
@@ -130,4 +130,4 @@ const OpSuperchainBlocks = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainBlocks);
|
||||
export default React.memo(MultichainBlocks);
|
||||
@@ -12,7 +12,7 @@ interface Props extends BlocksContentProps {
|
||||
chainId: string | undefined;
|
||||
}
|
||||
|
||||
const OpSuperchainBlocksContent = ({ chainId, ...rest }: Props) => {
|
||||
const MultichainBlocksContent = ({ chainId, ...rest }: Props) => {
|
||||
const chainConfig = multichainConfig()?.chains.find(chain => chain.id === chainId);
|
||||
|
||||
return (
|
||||
@@ -27,4 +27,4 @@ const OpSuperchainBlocksContent = ({ chainId, ...rest }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainBlocksContent);
|
||||
export default React.memo(MultichainBlocksContent);
|
||||
@@ -5,17 +5,17 @@ import * as statsMock from 'mocks/multichain/stats';
|
||||
import { ENVS_MAP } from 'playwright/fixtures/mockEnvs';
|
||||
import { test, expect } from 'playwright/lib';
|
||||
|
||||
import OpSuperchainEcosystems from './OpSuperchainEcosystems';
|
||||
import MultichainEcosystems from './MultichainEcosystems';
|
||||
|
||||
test('base view +@mobile', async({ render, mockTextAd, mockApiResponse, mockEnvs, mockMultichainConfig, mockAssetResponse }) => {
|
||||
test.slow();
|
||||
await mockMultichainConfig();
|
||||
await mockEnvs(ENVS_MAP.opSuperchain);
|
||||
await mockEnvs(ENVS_MAP.multichain);
|
||||
await mockTextAd();
|
||||
await mockAssetResponse(chainDataMock.chainA.logo as string, './playwright/mocks/duck.png');
|
||||
await mockAssetResponse(chainDataMock.chainB.logo as string, './playwright/mocks/goose.png');
|
||||
await mockApiResponse('multichainAggregator:chain_metrics', statsMock.chainMetrics);
|
||||
|
||||
const component = await render(<OpSuperchainEcosystems/>);
|
||||
const component = await render(<MultichainEcosystems/>);
|
||||
await expect(component).toHaveScreenshot({ timeout: 10_000 });
|
||||
});
|
||||
@@ -2,11 +2,11 @@ import { Box, createListCollection } from '@chakra-ui/react';
|
||||
import { useRouter } from 'next/router';
|
||||
import React from 'react';
|
||||
|
||||
import type { ChainMetricsSorting, ChainMetricsSortingField, ChainMetricsSortingValue } from 'types/client/multichain-aggregator';
|
||||
import type { ChainMetricsSorting, ChainMetricsSortingField, ChainMetricsSortingValue } from 'types/client/multichainAggregator';
|
||||
|
||||
import multichainConfig from 'configs/multichain';
|
||||
import useApiQuery from 'lib/api/useApiQuery';
|
||||
import { CHAIN_METRICS } from 'stubs/optimismSuperchain';
|
||||
import { CHAIN_METRICS } from 'stubs/multichain';
|
||||
import ActionBar from 'ui/shared/ActionBar';
|
||||
import DataListDisplay from 'ui/shared/DataListDisplay';
|
||||
import PageTitle from 'ui/shared/Page/PageTitle';
|
||||
@@ -14,15 +14,15 @@ import getSortParamsFromValue from 'ui/shared/sort/getSortParamsFromValue';
|
||||
import getSortValueFromQuery from 'ui/shared/sort/getSortValueFromQuery';
|
||||
import Sort from 'ui/shared/sort/Sort';
|
||||
|
||||
import OpSuperchainEcosystemsListItem from './OpSuperchainEcosystemsListItem';
|
||||
import OpSuperchainEcosystemsTable from './OpSuperchainEcosystemsTable';
|
||||
import MultichainEcosystemsListItem from './MultichainEcosystemsListItem';
|
||||
import MultichainEcosystemsTable from './MultichainEcosystemsTable';
|
||||
import { SORT_OPTIONS } from './utils';
|
||||
|
||||
const sortCollection = createListCollection({
|
||||
items: SORT_OPTIONS,
|
||||
});
|
||||
|
||||
const OpSuperchainEcosystems = () => {
|
||||
const MultichainEcosystems = () => {
|
||||
const router = useRouter();
|
||||
|
||||
const [ sort, setSort ] =
|
||||
@@ -44,7 +44,7 @@ const OpSuperchainEcosystems = () => {
|
||||
const content = data?.items ? (
|
||||
<>
|
||||
<Box hideBelow="lg">
|
||||
<OpSuperchainEcosystemsTable
|
||||
<MultichainEcosystemsTable
|
||||
data={ data.items }
|
||||
sort={ sort }
|
||||
setSorting={ handleSortChange }
|
||||
@@ -62,7 +62,7 @@ const OpSuperchainEcosystems = () => {
|
||||
/>
|
||||
</ActionBar>
|
||||
{ data.items.map((item, index) => (
|
||||
<OpSuperchainEcosystemsListItem
|
||||
<MultichainEcosystemsListItem
|
||||
key={ item.chain_id + (isPlaceholderData ? String(index) : '') }
|
||||
data={ item }
|
||||
chainInfo={ chains?.find((chain) => chain.id === item.chain_id) }
|
||||
@@ -90,4 +90,4 @@ const OpSuperchainEcosystems = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(OpSuperchainEcosystems);
|
||||
export default React.memo(MultichainEcosystems);
|
||||