Skip to content

getAlchemyRpcUrl

Generates the base Alchemy RPC URL for a given chain Id.

Usage

import { getAlchemyRpcUrl } from '@ethereum-tag-service/contracts/utils'
 
const url = getAlchemyRpcUrl('421614')
Output: "https://arb-sepolia.g.alchemy.com/v2/"

Returns

string

A string representing the Alchemy RPC URL for the specified chain.

Parameters

chainId

  • Type: string
  • Description: The chain ID (e.g., "421614" for Arbitrum Sepolia)

Supported Chain IDs

  • "421614": arb-sepolia
  • "84532": base-sepolia

Examples

import { getAlchemyRpcUrl } from '@ethereum-tag-service/contracts/utils'
 
// Get Arbitrum Sepolia RPC URL
const arbitrumUrl = getAlchemyRpcUrl('421614')
Output: https://arb-sepolia.g.alchemy.com/v2/
// Get Base Sepolia RPC URL const baseUrl = getAlchemyRpcUrl('84532')
Output: https://base-sepolia.g.alchemy.com/v2/