Skip to content

Feat: Add VIA network #2756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deploy-review-l2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ on:
- zkevm
- zilliqa_prototestnet
- zksync
- via
- zora

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ on:
- zkevm
- zilliqa_prototestnet
- zksync
- via
- zora

jobs:
Expand Down
1 change: 1 addition & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@
"zkevm",
"zilliqa_prototestnet",
"zksync",
"via",
"zora",
],
"default": "main"
Expand Down
2 changes: 1 addition & 1 deletion configs/app/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const homePageStats: Array<HomeStatsWidgetId> = (() => {
if (!Array.isArray(parsedValue)) {
const rollupFeature = features.rollup;

if (rollupFeature.isEnabled && [ 'zkEvm', 'zkSync', 'arbitrum' ].includes(rollupFeature.type)) {
if (rollupFeature.isEnabled && [ 'zkEvm', 'zkSync', 'via', 'arbitrum' ].includes(rollupFeature.type)) {
return [ 'latest_batch', 'average_block_time', 'total_txs', 'wallet_addresses', 'gas_tracker' ];
}

Expand Down
54 changes: 54 additions & 0 deletions configs/envs/.env.via_testnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Set of ENVs for VIA network explorer
# https://via.blockscout.com
# This is an auto-generated file. To update all values, run "yarn dev:preset:sync --name=via"

# Local ENVs
NEXT_PUBLIC_APP_PROTOCOL=http
NEXT_PUBLIC_APP_HOST=localhost
NEXT_PUBLIC_APP_PORT=3000
NEXT_PUBLIC_APP_ENV=development
NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL=ws

# Instance ENVs
NEXT_PUBLIC_VIEWS_CONTRACT_EXTRA_VERIFICATION_METHODS=none

NEXT_PUBLIC_ADMIN_SERVICE_API_HOST=https://admin-rs.services.blockscout.com
NEXT_PUBLIC_API_BASE_PATH=/
NEXT_PUBLIC_API_HOST=via.blockscout.com
NEXT_PUBLIC_API_SPEC_URL=https://github.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml
NEXT_PUBLIC_CONTRACT_INFO_API_HOST=https://contracts-info.services.blockscout.com
NEXT_PUBLIC_FEATURED_NETWORKS=https://github.com/blockscout/frontend-configs/main/configs/featured-networks/zksync.json
NEXT_PUBLIC_FOOTER_LINKS=https://github.com/blockscout/frontend-configs/main/configs/footer-links/zksync.json
NEXT_PUBLIC_GRAPHIQL_TRANSACTION=0x79c7802ccdf3be5a49c47cc751aad351b0027e8275f6f54878eda50ee559a648
NEXT_PUBLIC_HOMEPAGE_CHARTS=[]
NEXT_PUBLIC_HOMEPAGE_PLATE_BACKGROUND=rgba(53, 103, 246, 1)
NEXT_PUBLIC_HOMEPAGE_PLATE_TEXT_COLOR=rgba(255, 255, 255, 1)
NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED=true
NEXT_PUBLIC_LOGOUT_URL=https://via.us.auth0.com/v2/logout
NEXT_PUBLIC_METADATA_SERVICE_API_HOST=https://metadata.services.blockscout.com
NEXT_PUBLIC_METASUITES_ENABLED=true
NEXT_PUBLIC_MULTICHAIN_BALANCE_PROVIDER_CONFIG=[]
NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS=18
NEXT_PUBLIC_NETWORK_CURRENCY_NAME=Bitcoin
NEXT_PUBLIC_NETWORK_CURRENCY_SYMBOL=BTC
NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS=18
NEXT_PUBLIC_NETWORK_CURRENCY_WEI_NAME=satoshi
NEXT_PUBLIC_NETWORK_EXPLORERS=[]
NEXT_PUBLIC_NETWORK_ICON=https://github.com/blockscout/frontend-configs/refs/heads/main/configs/network-logos/via-light.svg
NEXT_PUBLIC_NETWORK_ICON_DARK=https://github.com/blockscout/frontend-configs/refs/heads/main/configs/network-logos/via-dark.svg
NEXT_PUBLIC_NETWORK_ID=25223
NEXT_PUBLIC_NETWORK_LOGO=https://github.com/blockscout/frontend-configs/refs/heads/main/configs/network-logos/via-light.svg
NEXT_PUBLIC_NETWORK_LOGO_DARK=https://github.com/blockscout/frontend-configs/refs/heads/main/configs/network-logos/via-dark.svg
NEXT_PUBLIC_NETWORK_NAME=VIA Testnet
NEXT_PUBLIC_NETWORK_RPC_URL=https://mainnet.era.zksync.io
NEXT_PUBLIC_NETWORK_SHORT_NAME=VIA Testnet
NEXT_PUBLIC_OG_ENHANCED_DATA_ENABLED=false
NEXT_PUBLIC_OG_IMAGE_URL=https://github.com/blockscout/frontend-configs/main/configs/og-images/zksync.png
NEXT_PUBLIC_OTHER_LINKS=[{'url':'https://zksync.drpc.org?ref=559183','text':'Public RPC'}]
NEXT_PUBLIC_ROLLUP_L1_BASE_URL=https://mempool.space/testnet
NEXT_PUBLIC_ROLLUP_TYPE=via
NEXT_PUBLIC_SAFE_TX_SERVICE_URL=https://safe-transaction-zksync.safe.global
NEXT_PUBLIC_STATS_API_HOST=https://stats-zksync-era-mainnet.k8s-prod-2.blockscout.com
NEXT_PUBLIC_TRANSACTION_INTERPRETATION_PROVIDER=blockscout
NEXT_PUBLIC_VIEWS_CONTRACT_SOLIDITYSCAN_ENABLED=true
NEXT_PUBLIC_VISUALIZE_API_HOST=https://visualizer.services.blockscout.com
4 changes: 2 additions & 2 deletions docs/ENVS.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ All json-like values should be single-quoted. If it contains a hash (`#`) or a d
| Variable | Type| Description | Compulsoriness | Default value | Example value | Version |
| --- | --- | --- | --- | --- | --- | --- |
| NEXT_PUBLIC_HOMEPAGE_CHARTS | `Array<'daily_txs' \| 'daily_operational_txs' \| 'coin_price' \| 'secondary_coin_price' \| 'market_cap' \| 'tvl'>` | List of charts displayed on the home page | - | - | `['daily_txs','coin_price','market_cap']` | v1.0.x+ |
| NEXT_PUBLIC_HOMEPAGE_STATS | `Array<'latest_batch' \| 'total_blocks' \| 'average_block_time' \| 'total_txs' \| 'total_operational_txs' \| 'latest_l1_state_batch' \| 'wallet_addresses' \| 'gas_tracker' \| 'btc_locked' \| 'current_epoch'>` | List of stats widgets displayed on the home page | - | For zkSync, zkEvm and Arbitrum rollups: `['latest_batch','average_block_time','total_txs','wallet_addresses','gas_tracker']`, for other cases: `['total_blocks','average_block_time','total_txs','wallet_addresses','gas_tracker']` | `['total_blocks','total_txs','wallet_addresses']` | v1.35.x+ |
| NEXT_PUBLIC_HOMEPAGE_STATS | `Array<'latest_batch' \| 'total_blocks' \| 'average_block_time' \| 'total_txs' \| 'total_operational_txs' \| 'latest_l1_state_batch' \| 'wallet_addresses' \| 'gas_tracker' \| 'btc_locked' \| 'current_epoch'>` | List of stats widgets displayed on the home page | - | For zkSync, via, zkEvm and Arbitrum rollups: `['latest_batch','average_block_time','total_txs','wallet_addresses','gas_tracker']`, for other cases: `['total_blocks','average_block_time','total_txs','wallet_addresses','gas_tracker']` | `['total_blocks','total_txs','wallet_addresses']` | v1.35.x+ |
| NEXT_PUBLIC_HOMEPAGE_PLATE_TEXT_COLOR | `string` | Text color of the hero plate on the homepage (escape "#" symbol if you use HEX color codes or use rgba-value instead). **DEPRECATED** _Use `NEXT_PUBLIC_HOMEPAGE_HERO_BANNER_CONFIG` instead_ | - | `white` | `\#DCFE76` | v1.0.x+ |
| NEXT_PUBLIC_HOMEPAGE_PLATE_BACKGROUND | `string` | Background css value for hero plate on the homepage (escape "#" symbol if you use HEX color codes or use rgba-value instead). **DEPRECATED** _Use `NEXT_PUBLIC_HOMEPAGE_HERO_BANNER_CONFIG` instead_ | - | `radial-gradient(103.03% 103.03% at 0% 0%, rgba(183, 148, 244, 0.8) 0%, rgba(0, 163, 196, 0.8) 100%), var(--chakra-colors-blue-400)` | `radial-gradient(at 15% 86%, hsla(350,65%,70%,1) 0px, transparent 50%)` \| `no-repeat bottom 20% right 0px/100% url(https://placekitten/1400/200)` | v1.1.0+ |
| NEXT_PUBLIC_HOMEPAGE_HERO_BANNER_CONFIG | `HeroBannerConfig`, see details [below](#hero-banner-configuration-properties) | Configuration of hero banner appearance. | - | - | See [below](#hero-banner-configuration-properties) | v1.35.0+ |
Expand Down Expand Up @@ -461,7 +461,7 @@ This feature is **enabled by default** with the `coinzilla` ads provider. To swi

| Variable | Type| Description | Compulsoriness | Default value | Example value | Version |
| --- | --- | --- | --- | --- | --- | --- |
| NEXT_PUBLIC_ROLLUP_TYPE | `'optimistic' \| 'arbitrum' \| 'shibarium' \| 'zkEvm' \| 'zkSync' \| 'scroll'` | Rollup chain type | Required | - | `'optimistic'` | v1.24.0+ |
| NEXT_PUBLIC_ROLLUP_TYPE | `'optimistic' \| 'arbitrum' \| 'shibarium' \| 'zkEvm' \| 'zkSync' \| 'via' \| 'scroll'` | Rollup chain type | Required | - | `'optimistic'` | v1.24.0+ |
| NEXT_PUBLIC_ROLLUP_L1_BASE_URL | `string` | Blockscout base URL for L1 network. **DEPRECATED** _Use `NEXT_PUBLIC_ROLLUP_PARENT_CHAIN` instead_ | Required | - | `'http://eth-goerli.blockscout.com'` | v1.24.0+ |
| NEXT_PUBLIC_ROLLUP_L2_WITHDRAWAL_URL | `string` | URL for L2 -> L1 withdrawals (Optimistic stack only) | Required for `optimistic` rollups | - | `https://app.optimism.io/bridge/withdraw` | v1.24.0+ |
| NEXT_PUBLIC_FAULT_PROOF_ENABLED | `boolean` | Set to `true` for chains with fault proof system enabled (Optimistic stack only) | - | - | `true` | v1.31.0+ |
Expand Down
4 changes: 4 additions & 0 deletions lib/api/services/general/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ export const GENERAL_API_MISC_RESOURCES = {
homepage_zksync_latest_batch: {
path: '/api/v2/main-page/zksync/batches/latest-number',
},
homepage_via_latest_batch: {
path: '/api/v2/main-page/via/batches/latest-number',
},
homepage_arbitrum_latest_batch: {
path: '/api/v2/main-page/arbitrum/batches/latest-number',
},
Expand Down Expand Up @@ -255,6 +258,7 @@ R extends 'general:homepage_arbitrum_l2_batches' ? { items: Array<ArbitrumL2TxnB
R extends 'general:homepage_indexing_status' ? IndexingStatus :
R extends 'general:homepage_zkevm_latest_batch' ? number :
R extends 'general:homepage_zksync_latest_batch' ? number :
R extends 'general:homepage_via_latest_batch' ? number :
R extends 'general:homepage_arbitrum_latest_batch' ? number :
R extends 'general:quick_search' ? Array<SearchResultItem> :
R extends 'general:search' ? SearchResult :
Expand Down
25 changes: 25 additions & 0 deletions lib/api/services/general/rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import type {
ScrollL2MessagesResponse,
} from 'types/api/scrollL2';
import type { ShibariumWithdrawalsResponse, ShibariumDepositsResponse } from 'types/api/shibarium';
import type { ViaBatch, ViaBatchesResponse, ViaBatchTxs } from 'types/api/viaL2';
import type {
ZkEvmL2DepositsResponse,
ZkEvmL2TxnBatch,
Expand Down Expand Up @@ -227,6 +228,26 @@ export const GENERAL_API_ROLLUP_RESOURCES = {
paginated: true,
},

// via
via_l2_txn_batches: {
path: '/api/v2/via/batches',
filterFields: [],
paginated: true,
},
via_l2_txn_batches_count: {
path: '/api/v2/via/batches/count',
},
via_l2_txn_batch: {
path: '/api/v2/via/batches/:number',
pathParams: [ 'number' as const ],
},
via_l2_txn_batch_txs: {
path: '/api/v2/transactions/via-batch/:number',
pathParams: [ 'number' as const ],
filterFields: [],
paginated: true,
},

// zkEvm
zkevm_l2_deposits: {
path: '/api/v2/zkevm/deposits',
Expand Down Expand Up @@ -370,6 +391,10 @@ R extends 'general:zksync_l2_txn_batches' ? ZkSyncBatchesResponse :
R extends 'general:zksync_l2_txn_batches_count' ? number :
R extends 'general:zksync_l2_txn_batch' ? ZkSyncBatch :
R extends 'general:zksync_l2_txn_batch_txs' ? ZkSyncBatchTxs :
R extends 'general:via_l2_txn_batches' ? ViaBatchesResponse :
R extends 'general:via_l2_txn_batches_count' ? number :
R extends 'general:via_l2_txn_batch' ? ViaBatch :
R extends 'general:via_l2_txn_batch_txs' ? ViaBatchTxs :
R extends 'general:scroll_l2_txn_batch_txs' ? ScrollL2TxnBatchTxs :
R extends 'general:scroll_l2_txn_batch_blocks' ? ScrollL2TxnBatchBlocks :
R extends 'general:scroll_l2_txn_batches' ? ScrollL2BatchesResponse :
Expand Down
16 changes: 16 additions & 0 deletions lib/hooks/useNavItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,22 @@ export default function useNavItems(): ReturnType {
ensLookup,
].filter(Boolean),
];
} else if (rollupFeature.isEnabled && rollupFeature.type === 'via') {
blockchainNavItems = [
[
txs,
internalTxs,
userOps,
blocks,
rollupTxnBatches,
].filter(Boolean),
[
topAccounts,
validators,
verifiedContracts,
ensLookup,
].filter(Boolean),
];
} else {
blockchainNavItems = [
txs,
Expand Down
7 changes: 7 additions & 0 deletions mocks/contract/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ export const zkSync: SmartContract = {
optimization_runs: 's',
};

export const via: SmartContract = {
...verified,
zk_compiler_version: 'v1.2.5',
optimization_enabled: true,
optimization_runs: 's',
};

export const stylusRust: SmartContract = {
...verified,
language: 'stylus_rust',
Expand Down
20 changes: 20 additions & 0 deletions mocks/via/viaTxnBatch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { ViaBatch } from 'types/api/viaL2';

export const base: ViaBatch = {
commit_transaction_hash: '0x7cd80c88977c2b310f79196b0b2136da18012be015ce80d0d9e9fe6cfad52b16',
commit_transaction_timestamp: '2022-03-19T09:37:38.726996Z',
end_block_number: 1245490,
execute_transaction_hash: '0x110b9a19afbabd5818a996ab2b493a9b23c888d73d95f1ab5272dbae503e103a',
execute_transaction_timestamp: '2022-03-19T10:29:05.358066Z',
l1_gas_price: '4173068062',
l1_transactions_count: 0,
l2_fair_gas_price: '100000000',
l2_transactions_count: 287,
number: 8051,
prove_transaction_hash: '0xb424162ba5afe17c710dceb5fc8d15d7d46a66223454dae8c74aa39f6802625b',
prove_transaction_timestamp: '2022-03-19T10:29:05.279179Z',
root_hash: '0x108c635b94f941fcabcb85500daec2f6be4f0747dff649b1cdd9dd7a7a264792',
start_block_number: 1245209,
status: 'Executed on L1',
timestamp: '2022-03-19T09:05:49.000000Z',
};
49 changes: 49 additions & 0 deletions mocks/via/viaTxnBatches.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import type { ViaBatchesItem, ViaBatchesResponse } from 'types/api/viaL2';

export const sealed: ViaBatchesItem = {
commit_transaction_hash: null,
commit_transaction_timestamp: null,
execute_transaction_hash: null,
execute_transaction_timestamp: null,
number: 8055,
prove_transaction_hash: null,
prove_transaction_timestamp: null,
status: 'Sealed on L2',
timestamp: '2022-03-19T12:53:36.000000Z',
transactions_count: 738,
};

export const sent: ViaBatchesItem = {
commit_transaction_hash: '0x262e7215739d6a7e33b2c20b45a838801a0f5f080f20bec8e54eb078420c4661',
commit_transaction_timestamp: '2022-03-19T13:09:07.357570Z',
execute_transaction_hash: null,
execute_transaction_timestamp: null,
number: 8054,
prove_transaction_hash: null,
prove_transaction_timestamp: null,
status: 'Sent to L1',
timestamp: '2022-03-19T11:36:45.000000Z',
transactions_count: 766,
};

export const executed: ViaBatchesItem = {
commit_transaction_hash: '0xa2628f477e1027ac1c60fa75c186b914647769ac1cb9c7e1cab50b13506a0035',
commit_transaction_timestamp: '2022-03-19T11:52:18.963659Z',
execute_transaction_hash: '0xb7bd6b2b17498c66d3f6e31ac3685133a81b7f728d4f6a6f42741daa257d0d68',
execute_transaction_timestamp: '2022-03-19T13:28:16.712656Z',
number: 8053,
prove_transaction_hash: '0x9d44f2b775bd771f8a53205755b3897929aa672d2cd419b3b988c16d41d4f21e',
prove_transaction_timestamp: '2022-03-19T13:28:16.603104Z',
status: 'Executed on L1',
timestamp: '2022-03-19T10:01:52.000000Z',
transactions_count: 1071,
};

export const baseResponse: ViaBatchesResponse = {
items: [
sealed,
sent,
executed,
],
next_page_params: null,
};
2 changes: 1 addition & 1 deletion nextjs/getServerSideProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const outputRoots: GetServerSideProps<Props> = async(context) => {
return base(context);
};

const BATCH_ROLLUP_TYPES: Array<RollupType> = [ 'zkEvm', 'zkSync', 'arbitrum', 'optimistic', 'scroll' ];
const BATCH_ROLLUP_TYPES: Array<RollupType> = [ 'zkEvm', 'zkSync', 'via', 'arbitrum', 'optimistic', 'scroll' ];
export const batch: GetServerSideProps<Props> = async(context) => {
if (!(rollupFeature.isEnabled && BATCH_ROLLUP_TYPES.includes(rollupFeature.type))) {
return {
Expand Down
2 changes: 2 additions & 0 deletions pages/batches/[number].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const Batch = dynamic(() => {
return import('ui/pages/ZkEvmL2TxnBatch');
case 'zkSync':
return import('ui/pages/ZkSyncL2TxnBatch');
case 'via':
return import('ui/pages/ViaL2TxnBatch');
case 'scroll':
return import('ui/pages/ScrollL2TxnBatch');
}
Expand Down
2 changes: 2 additions & 0 deletions pages/batches/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const Batches = dynamic(() => {
return import('ui/pages/ZkEvmL2TxnBatches');
case 'zkSync':
return import('ui/pages/ZkSyncL2TxnBatches');
case 'via':
return import('ui/pages/ViaL2TxnBatches');
case 'optimistic':
return import('ui/pages/OptimisticL2TxnBatches');
case 'arbitrum':
Expand Down
5 changes: 5 additions & 0 deletions playwright/fixtures/mockEnvs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export const ENVS_MAP: Record<string, Array<[string, string]>> = {
[ 'NEXT_PUBLIC_ROLLUP_L1_BASE_URL', 'https://localhost:3101' ],
[ 'NEXT_PUBLIC_VIEWS_CONTRACT_EXTRA_VERIFICATION_METHODS', 'none' ],
],
ViaRollup: [
[ 'NEXT_PUBLIC_ROLLUP_TYPE', 'via' ],
[ 'NEXT_PUBLIC_ROLLUP_L1_BASE_URL', 'https://localhost:3101' ],
[ 'NEXT_PUBLIC_VIEWS_CONTRACT_EXTRA_VERIFICATION_METHODS', 'none' ],
],
scrollRollup: [
[ 'NEXT_PUBLIC_ROLLUP_TYPE', 'scroll' ],
[ 'NEXT_PUBLIC_ROLLUP_L1_BASE_URL', 'https://localhost:3101' ],
Expand Down
27 changes: 27 additions & 0 deletions stubs/viaL2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { ViaBatch, ViaBatchesItem } from 'types/api/viaL2';

import { TX_HASH } from './tx';

export const VIA_L2_TXN_BATCHES_ITEM: ViaBatchesItem = {
commit_transaction_hash: TX_HASH,
commit_transaction_timestamp: '2022-03-17T19:33:04.519145Z',
execute_transaction_hash: TX_HASH,
execute_transaction_timestamp: '2022-03-17T20:49:48.856345Z',
number: 8002,
prove_transaction_hash: TX_HASH,
prove_transaction_timestamp: '2022-03-17T20:49:48.772442Z',
status: 'Executed on L1',
timestamp: '2022-03-17T17:00:11.000000Z',
transactions_count: 1215,
};

export const VIA_L2_TXN_BATCH: ViaBatch = {
...VIA_L2_TXN_BATCHES_ITEM,
start_block_number: 1245209,
end_block_number: 1245490,
l1_gas_price: '4173068062',
l1_transactions_count: 0,
l2_fair_gas_price: '100000000',
l2_transactions_count: 287,
root_hash: '0x108c635b94f941fcabcb85500daec2f6be4f0747dff649b1cdd9dd7a7a264792',
};
1 change: 1 addition & 0 deletions tools/preset-sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const PRESETS = {
stability_testnet: 'https://stability-testnet.blockscout.com',
zkevm: 'https://zkevm.blockscout.com',
zksync: 'https://zksync.blockscout.com',
via: 'https://via.blockscout.com',
zilliqa_prototestnet: 'https://zilliqa-prototestnet.blockscout.com',
zora: 'https://explorer.zora.energy',
// main === staging
Expand Down
5 changes: 5 additions & 0 deletions types/api/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { ArbitrumBatchStatus, ArbitrumL2TxData } from './arbitrumL2';
import type { OptimisticL2BatchDataContainer, OptimisticL2BlobTypeEip4844, OptimisticL2BlobTypeCelestia } from './optimisticL2';
import type { TokenInfo } from './token';
import type { TokenTransfer } from './tokenTransfer';
import type { ViaBatchesItem } from './viaL2';
import type { ZkSyncBatchesItem } from './zkSyncL2';

export type BlockType = 'block' | 'reorg' | 'uncle';
Expand Down Expand Up @@ -59,6 +60,10 @@ export interface Block {
zksync?: Omit<ZkSyncBatchesItem, 'number' | 'transactions_count' | 'timestamp'> & {
batch_number: number | null;
};
// VIA FIELDS
via?: Omit<ViaBatchesItem, 'number' | 'transactions_count' | 'timestamp'> & {
batch_number: number | null;
};
arbitrum?: ArbitrumBlockData;
optimism?: OptimismBlockData;
// CELO FIELDS
Expand Down
5 changes: 5 additions & 0 deletions types/api/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { ScrollL2BlockStatus } from './scrollL2';
import type { TokenInfo } from './token';
import type { TokenTransfer } from './tokenTransfer';
import type { TxAction } from './txAction';
import type { ViaBatchesItem } from './viaL2';
import type { ZkSyncBatchesItem } from './zkSyncL2';

export type TransactionRevertReason = {
Expand Down Expand Up @@ -92,6 +93,10 @@ export type Transaction = {
zksync?: Omit<ZkSyncBatchesItem, 'number' | 'transactions_count' | 'timestamp'> & {
batch_number: number | null;
};
// via FIELDS
via?: Omit<ViaBatchesItem, 'number' | 'transactions_count' | 'timestamp'> & {
batch_number: number | null;
};
// Zilliqa fields
zilliqa?: {
is_scilla: boolean;
Expand Down
Loading