@forta/network
v0.0.3
Published
🌤️ A goodie to get chains common metadata.
Downloads
16
Maintainers
Readme
@forta/network 🦍
Install
npm i @forta/network
Get Started
import { Rinkeby } from "@forta/network"
const ADDRR = "0x6635f83421bf059cd8111f180f0727128685bae4"
console.log(Rinkeby.getExplorerURL(ADDRR))
// https://rinkeby.etherscan.io/address/0x6635f83421bf059cd8111f180f0727128685bae4
Networks
Each exported network(Mainnet or Testnet) follows the model bellow:
export type NetworkType = "Mainnet" | "Testnet"
export interface NetworkProps {
chainName: string
shortName: string
chainId: string
chainDecimalId: number
currency: string
rpcUrl: string
blockExplorerUrl: string
type: NetworkType
}
Example for Polygon:
import { Rinkeby } from "@forta/network"
console.log(Rinkeby)
/**
{
chainName: "Matic Mainnet"
shortName: "Matic"
chainId: "0x89"
chainDecimalId: 137
currency: "MATIC"
rpcUrl: "https://rpc-mainnet.maticvigil.com"
blockExplorerUrl: "https://polygonscan.com"
type: "Mainnet"
}
*/