0.0.3 • Published 2 years ago

@forta/network v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@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"
}
*/

READ THE DOCS 🌟 | FOLLOW ME 🐦