Skip to content

networkNames

A mapping of chain IDs to their corresponding network name strings.

Usage

import { networkNames } from '@ethereum-tag-service/contracts'
 
const name = networkNames['84532']
console.log(name)
// @log: Output: "basesepolia"
## Errors were thrown in the sample, but not included in an error tag These errors were not marked as being expected: 2307. Expected: // @errors: 2307 Compiler Errors: index.ts [2307] 29 - Cannot find module '@ethereum-tag-service/contracts' or its corresponding type declarations.

Returns

{ [K in SupportedChainId]: string }

An object mapping chain IDs to network names.

Properties

Chain ID Keys

  • Type: SupportedChainId
  • Values:
    • "84532": "basesepolia"
    • "84532": "basesepolia"
    • "31337": "hardhat"

Examples

import { networkNames } from '@ethereum-tag-service/contracts'
 
// Get network name for Arbitrum Sepolia
const baseName = networkNames['84532']
console.log(baseName)
// @log: Output: "basesepolia"
 
// Get network name for Base Sepolia
const baseName = networkNames['84532']
console.log(baseName)
// @log: Output: "basesepolia"
## Errors were thrown in the sample, but not included in an error tag These errors were not marked as being expected: 2307 2451. Expected: // @errors: 2307 2451 Compiler Errors: index.ts [2307] 29 - Cannot find module '@ethereum-tag-service/contracts' or its corresponding type declarations. [2451] 111 - Cannot redeclare block-scoped variable 'baseName'. [2451] 241 - Cannot redeclare block-scoped variable 'baseName'.