Skip to content

Commit b15e531

Browse files
committed
fixes10
1 parent 699335c commit b15e531

File tree

101 files changed

+741
-581
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+741
-581
lines changed

configs/envs/.env.zetachain

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ NEXT_PUBLIC_HAS_CONTRACT_AUDIT_REPORTS=true
2929
NEXT_PUBLIC_HOMEPAGE_CHARTS=['daily_txs']
3030
NEXT_PUBLIC_HOMEPAGE_HERO_BANNER_CONFIG={'background':['linear-gradient(0, rgb(0,87,65), rgb(0,87,65))'],'text_color':['rgb(220, 254, 118)']}
3131
NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED=true
32-
NEXT_PUBLIC_LOGOUT_URL=https://zetachain.us.auth0.com/v2/logout
3332
NEXT_PUBLIC_MARKETPLACE_CATEGORIES_URL=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/marketplace-categories/default.json
3433
NEXT_PUBLIC_MARKETPLACE_ENABLED=true
3534
NEXT_PUBLIC_MARKETPLACE_FEATURED_APP=rubic
@@ -61,5 +60,5 @@ NEXT_PUBLIC_VIEWS_TOKEN_SCAM_TOGGLE_ENABLED=true
6160
NEXT_PUBLIC_VISUALIZE_API_HOST=https://visualizer.services.blockscout.com
6261
NEXT_PUBLIC_ZETACHAIN_SERVICE_API_HOST=https://zetachain-cctx-mainnet.k8s-prod-2.blockscout.com
6362
NEXT_PUBLIC_ZETACHAIN_SERVICE_CHAINS_CONFIG_URL=https://raw.githubusercontent.com/blockscout/frontend-configs/refs/heads/main/configs/cross-chain/zetachain-mainnet.json
64-
NEXT_PUBLIC_ZETACHAIN_COSMOS_TX_URL_TEMPLATE=https://www.mintscan.io/cosmos/tx/{hash}
65-
NEXT_PUBLIC_ZETACHAIN_COSMOS_ADDRESS_URL_TEMPLATE=https://www.mintscan.io/cosmos/address/{hash}
63+
NEXT_PUBLIC_ZETACHAIN_COSMOS_TX_URL_TEMPLATE=https://zetachain.exploreme.pro/transactions/{hash}
64+
NEXT_PUBLIC_ZETACHAIN_COSMOS_ADDRESS_URL_TEMPLATE=https://zetachain.exploreme.pro/account/{hash}

configs/envs/.env.zetachain_testnet

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ NEXT_PUBLIC_HOMEPAGE_CHARTS=['daily_txs']
2727
NEXT_PUBLIC_HOMEPAGE_HERO_BANNER_CONFIG={'background':['linear-gradient(0, rgb(0,87,65), rgb(0,87,65))'],'text_color':['rgb(220, 254, 118)']}
2828
NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED=true
2929
NEXT_PUBLIC_IS_TESTNET=true
30-
NEXT_PUBLIC_LOGOUT_URL=https://zetachain.us.auth0.com/v2/logout
3130
NEXT_PUBLIC_MARKETPLACE_ENABLED=false
3231
NEXT_PUBLIC_METADATA_SERVICE_API_HOST=https://metadata.services.blockscout.com
3332
NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS=18
@@ -51,6 +50,6 @@ NEXT_PUBLIC_VIEWS_TOKEN_SCAM_TOGGLE_ENABLED=true
5150
NEXT_PUBLIC_VISUALIZE_API_HOST=https://visualizer.services.blockscout.com
5251
NEXT_PUBLIC_ZETACHAIN_SERVICE_API_HOST=https://zetachain-cctx-testnet.k8s-prod-1.blockscout.com
5352
NEXT_PUBLIC_ZETACHAIN_SERVICE_CHAINS_CONFIG_URL=https://raw.githubusercontent.com/blockscout/frontend-configs/refs/heads/main/configs/cross-chain/zetachain-testnet.json
54-
NEXT_PUBLIC_ZETACHAIN_COSMOS_TX_URL_TEMPLATE=https://www.mintscan.io/cosmos/tx/{hash}
55-
NEXT_PUBLIC_ZETACHAIN_COSMOS_ADDRESS_URL_TEMPLATE=https://www.mintscan.io/cosmos/address/{hash}
53+
NEXT_PUBLIC_ZETACHAIN_COSMOS_TX_URL_TEMPLATE=https://testnet.zetachain.exploreme.pro/transactions/{hash}
54+
NEXT_PUBLIC_ZETACHAIN_COSMOS_ADDRESS_URL_TEMPLATE=https://testnet.zetachain.exploreme.pro/account/{hash}
5655
NEXT_PUBLIC_DATA_AVAILABILITY_ENABLED=true

deploy/tools/envs-validator/schema.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import type { TxExternalTxsConfig } from '../../../types/client/externalTxsConfi
4949
import { replaceQuotes } from '../../../configs/app/utils';
5050
import * as regexp from '../../../toolkit/utils/regexp';
5151
import type { IconName } from '../../../ui/shared/IconSvg';
52-
import type { ChainInfo } from '../../../types/client/chainInfo';
52+
import type { CrossChainInfo } from '../../../types/client/crossChainInfo';
5353

5454
const protocols = [ 'http', 'https' ];
5555

@@ -628,11 +628,11 @@ const multichainProviderConfigSchema: yup.ObjectSchema<MultichainProviderConfig>
628628
dapp_id: yup.string(),
629629
});
630630

631-
const zetaChainCCTXConfigSchema: yup.ObjectSchema<ChainInfo> = yup.object({
631+
const zetaChainCCTXConfigSchema: yup.ObjectSchema<CrossChainInfo> = yup.object({
632632
chain_id: yup.number().required(),
633633
chain_name: yup.string().required(),
634634
chain_logo: yup.string(),
635-
instance_url: yup.string(),
635+
instance_url: yup.string().test(urlTest),
636636
address_url_template: yup.string(),
637637
tx_url_template: yup.string(),
638638
});

docs/ENVS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -958,14 +958,14 @@ This feature allows to display widgets on the address page with data from 3rd pa
958958

959959
### ZetaChain cross-chain transactions
960960

961-
This feature enables cross-chain transactions pages and views on zetaChain instances
961+
This feature enables cross-chain transactions pages and views on ZetaChain instances
962962

963963
| Variable | Type| Description | Compulsoriness | Default value | Example value | Version |
964964
| --- | --- | --- | --- | --- | --- | --- |
965-
| NEXT_PUBLIC_ZETACHAIN_SERVICE_API_HOST | `string` | ZetaChain cross-chain transactions service API endpoint url | - | - | `https://zetachain-cctx.services.blockscout.com` | v2.3.0+ |
966-
| NEXT_PUBLIC_ZETACHAIN_SERVICE_CHAINS_CONFIG_URL | `string` | URL of configuration file (`.json` format only) which contains chains info for the supported chains. | - | - | `https://example.com/zetachain_chains_config.json` | v2.3.0+ |
967-
| NEXT_PUBLIC_ZETACHAIN_COSMOS_TX_URL_TEMPLATE | `string` | URL template to redirect cosmos tx search. | - | - | `https://example.com/cosmos/tx/{hash}` | v2.3.0+ |
968-
| NEXT_PUBLIC_ZETACHAIN_COSMOS_ADDRESS_URL_TEMPLATE | `string` URL template to redirect cosmos address search. | - | - | `https://example.com/cosmos/address/{hash}` | v2.3.0+ |
965+
| NEXT_PUBLIC_ZETACHAIN_SERVICE_API_HOST | `string` | ZetaChain cross-chain transactions service API endpoint url | - | - | `https://zetachain-cctx.services.blockscout.com` | v2.3.2+ |
966+
| NEXT_PUBLIC_ZETACHAIN_SERVICE_CHAINS_CONFIG_URL | `string` | URL of configuration file (`.json` format only) which contains chains info for the supported chains. | - | - | `https://example.com/zetachain_chains_config.json` | v2.3.2+ |
967+
| NEXT_PUBLIC_ZETACHAIN_COSMOS_TX_URL_TEMPLATE | `string` | URL template to redirect cosmos tx search. | - | - | `https://example.com/cosmos/tx/{hash}` | v2.3.2+ |
968+
| NEXT_PUBLIC_ZETACHAIN_COSMOS_ADDRESS_URL_TEMPLATE | `string` URL template to redirect cosmos address search. | - | - | `https://example.com/cosmos/address/{hash}` | v2.3.2+ |
969969

970970

971971
#### ZetaChain supported cain configuration properties

icons/interop_slim.svg

Lines changed: 1 addition & 2 deletions
Loading

lib/api/services/zetaChain.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { ApiResource } from '../types';
2-
import type { ZetaChainCCTXFilterParams, ZetaChainCCTXListResponse, ZetaChainCCTXResponse, ZetaChainTokensResponse } from 'types/api/zetaChain';
2+
import type * as zetaChainCCTXType from '@blockscout/zetachain-cctx-types';
3+
import type { ZetaChainCCTXFilterParams } from 'types/client/zetaChain';
34

45
export const ZETA_CHAIN_API_RESOURCES = {
56
transactions: {
@@ -33,9 +34,9 @@ export type ZetaChainApiResourceName = `zetachain:${ keyof typeof ZETA_CHAIN_API
3334

3435
/* eslint-disable @stylistic/indent */
3536
export type ZetaChainApiResourcePayload<R extends ZetaChainApiResourceName> =
36-
R extends 'zetachain:transactions' ? ZetaChainCCTXListResponse :
37-
R extends 'zetachain:transaction' ? ZetaChainCCTXResponse :
38-
R extends 'zetachain:tokens' ? ZetaChainTokensResponse :
37+
R extends 'zetachain:transactions' ? zetaChainCCTXType.ListCctxsResponse :
38+
R extends 'zetachain:transaction' ? zetaChainCCTXType.CrossChainTx :
39+
R extends 'zetachain:tokens' ? zetaChainCCTXType.Tokens :
3940
never;
4041
/* eslint-enable @stylistic/indent */
4142

lib/hooks/useNavItems.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export default function useNavItems(): ReturnType {
2323
const router = useRouter();
2424
const pathname = router.pathname;
2525
const query = router.query;
26+
const tab = query.tab;
2627

2728
return React.useMemo(() => {
2829
let blockchainNavItems: Array<NavItem> | Array<Array<NavItem>> = [];
@@ -45,15 +46,15 @@ export default function useNavItems(): ReturnType {
4546
icon: 'transactions',
4647
isActive:
4748
// sorry, but this is how it was designed
48-
(pathname === '/txs' && (!config.features.zetachain.isEnabled || !query.tab || !query.tab.includes('cctx'))) ||
49+
(pathname === '/txs' && (!config.features.zetachain.isEnabled || !tab || !tab.includes('cctx'))) ||
4950
pathname === '/tx/[hash]' ||
5051
pathname === '/chain/[chain-slug]/tx/[hash]',
5152
};
5253
const cctxs: NavItem | null = config.features.zetachain.isEnabled ? {
5354
text: 'Cross-chain transactions',
5455
nextRoute: { pathname: '/txs' as const, query: { tab: 'cctx' } },
5556
icon: 'interop',
56-
isActive: pathname === '/cc/tx/[hash]' || (pathname === '/txs' && query.tab?.includes('cctx')),
57+
isActive: pathname === '/cc/tx/[hash]' || (pathname === '/txs' && tab?.includes('cctx')),
5758
} : null;
5859
const operations: NavItem | null = config.features.tac.isEnabled ? {
5960
text: 'Operations',
@@ -358,5 +359,5 @@ export default function useNavItems(): ReturnType {
358359
].filter(Boolean);
359360

360361
return { mainNavItems, accountNavItems };
361-
}, [ pathname, query ]);
362+
}, [ pathname, tab ]);
362363
}

lib/socket/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Channel } from 'phoenix';
22

33
import type * as multichain from '@blockscout/multichain-aggregator-types';
4+
import type * as zetaChainCCTXType from '@blockscout/zetachain-cctx-types';
45
import type { AddressCoinBalanceHistoryItem, AddressTokensBalancesSocketMessage } from 'types/api/address';
56
import type { NewArbitrumBatchSocketResponse } from 'types/api/arbitrumL2';
67
import type { NewBlockSocketResponse } from 'types/api/block';
@@ -9,7 +10,6 @@ import type { RawTracesResponse } from 'types/api/rawTrace';
910
import type { TokenInstanceMetadataSocketMessage } from 'types/api/token';
1011
import type { TokenTransfer } from 'types/api/tokenTransfer';
1112
import type { Transaction } from 'types/api/transaction';
12-
import type { ZetaChainCCTX } from 'types/api/zetaChain';
1313
import type { NewZkEvmBatchSocketResponse } from 'types/api/zkEvmL2';
1414

1515
export type SocketMessageParams = SocketMessage.NewBlock |
@@ -89,6 +89,6 @@ export namespace SocketMessage {
8989
export type ContractVerification = SocketMessageParamsGeneric<'verification_result', SmartContractVerificationResponse>;
9090
export type NewZkEvmL2Batch = SocketMessageParamsGeneric<'new_zkevm_confirmed_batch', NewZkEvmBatchSocketResponse>;
9191
export type NewArbitrumL2Batch = SocketMessageParamsGeneric<'new_arbitrum_batch', NewArbitrumBatchSocketResponse>;
92-
export type NewZetaChainCCTXs = SocketMessageParamsGeneric<'new_cctxs', Array<ZetaChainCCTX>>;
92+
export type NewZetaChainCCTXs = SocketMessageParamsGeneric<'new_cctxs', Array<zetaChainCCTXType.CctxListItem>>;
9393
export type Unknown = SocketMessageParamsGeneric<undefined, unknown>;
9494
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function getStatsLabelFromTitle(title: string) {
2+
return title.replace(/\s*\([^)]*\)\s*$/, '');
3+
}

lib/token/metadata/attributesParser.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { upperFirst } from 'es-toolkit';
33
import type { Metadata, MetadataAttributes } from 'types/client/token';
44

55
import dayjs from 'lib/date/dayjs';
6+
import { SECOND } from 'toolkit/utils/consts';
67

78
function formatValue(value: string | number, display: string | undefined, trait: string | undefined): Pick<MetadataAttributes, 'value' | 'value_type'> {
89
// https://docs.opensea.io/docs/metadata-standards#attributes
@@ -19,7 +20,7 @@ function formatValue(value: string | number, display: string | undefined, trait:
1920
}
2021
case 'date': {
2122
return {
22-
value: dayjs(Number(value) * 1000).format('YYYY-MM-DD'),
23+
value: dayjs(Number(value) * SECOND).format('YYYY-MM-DD'),
2324
};
2425
}
2526
default: {

0 commit comments

Comments
 (0)