
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
@idecentralize/erclib
Advanced tools
ERC library for blockchain Development
In development. More networks, asset's and features are coming...
npm install @idecentralize/erclib
address should be checksumed
// using ethersV6
import {BrowserProvider} from "ethers";
const provider = new BrowserProvider(window.ethereum);
const chainId = (await PROVIDER.getNetwork()).chainId.toString()
Example of the NETWORK object entry
id: 137,
network: "Polygon",
chain: "MATIC",
chainId: 137,
type: "Mainnet",
rpc:"https://polygon-rpc.com",
explorer: "https://polygonscan.com/address/",
color: "#8247e5",
defaultNFT: "0x5265535c7
Show the chain native currency logo
import {IPFS_SVG_PATH, NETWORK} from "@idecentralize/erclib";
<Network src={`${IPFS_SVG_PATH}${NETWORK[chainId].chain}.svg`}/>
const rpc = NETWORK[chainId].rpc
const usdc = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
const decimals = ERC20[chainId][usdc].decimals
const CToken = ERC20[chainId][usdc].compound
const color = ERC20[chainId][usdc].colors
FORKING : network_id should be the chain id return by the provider. When forking the mainnet using hardhat, the network id is 31337 and we want to use the mainnet asset under network id 1.
ERC20[network_id === 31337 ? 1 : network_id][usdc].decimals // output decimals of asset
Please report any issues!
To add some assets, please submit a PR and provide the new IPFS CID.
FAQs
ERC library for blockchain development
The npm package @idecentralize/erclib receives a total of 66 weekly downloads. As such, @idecentralize/erclib popularity was classified as not popular.
We found that @idecentralize/erclib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.