npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@roninbuilders/contracts

v0.4.8

Published

Ronin Network Contracts

Downloads

246

Readme

Ronin Contracts Addresses and ABI's

This project provides a community-maintained list of contract addresses and ABI's for the Ronin Network. It is intended to be a useful resource for developers working with the Ronin Network.

Installation

To install the project, run the following command:

npm i @roninbuilders/contracts

Usage viem

Here's an example of how to use this project to fetch balances of different tokens for a specific address using the viem package:

npm i @roninbuilders/contracts viem
import { formatEther } from "viem";
import { AXIE_PROXY, USD_COIN, WRAPPED_ETHER } from "@roninbuilders/contracts"

// Initialize your viemClient here

// Fetch RON balance
const ronBalance = await viemClient.getBalance({ address });
console.log(`RON: ${formatEther(ronBalance)}`);

// Fetch WRAPPED_ETHER balance
const wethBalance = await viemClient.readContract({
  address: WRAPPED_ETHER.address,
  abi: WRAPPED_ETHER.abi,
  functionName: 'balanceOf',
  args: [address]
});
console.log(`WETH: ${formatEther(wethBalance)}`);

// Fetch Axies balance 
const axiesBalance = await viemClient.readContract({
  address: AXIE_PROXY.address,
  abi: AXIE_PROXY.abi,
  functionName: 'balanceOf',
  args: [address]
});
console.log(`Axies: ${axiesBalance.toString()}`);

// Fetch USDC balance
const usdcBalance = await viemClient.readContract({
  address: USD_COIN.address,
  abi: USD_COIN.abi,
  functionName: 'balanceOf',
  args: [address]
});
console.log(`USDC balance: ${formatEther(usdcBalance)}`);

Usage with ethers

First, install the necessary packages:

npm i @roninbuilders/contracts [email protected]

Then, you can use the following code to fetch balances of different tokens for a specific address:

import { AXIE_PROXY, USD_COIN, WRAPPED_ETHER } from "@roninbuilders/contracts"

// Initialize your ethers provider here

// Fetch RON balance
const balance = await ethers.provider.getBalance(address)
const balanceInEther = ethers.utils.formatEther(balance)
console.log(`RON: ${balanceInEther}`)

// Fetch WRAPPED_ETHER balance
const wethContract = new ethers.Contract(WRAPPED_ETHER.address, WRAPPED_ETHER.abi, ethers.provider)
const wethBalance = await wethContract.balanceOf(address)
const wethBalanceInEther = ethers.utils.formatEther(wethBalance)
console.log(`WETH: ${wethBalanceInEther}`)

// Fetch Axies balance 
const axieContract = new ethers.Contract(AXIE_PROXY.address, AXIE_PROXY.abi, ethers.provider)
const axiesBalance = await axieContract.balanceOf(address)
console.log(`Axies: ${axiesBalance.toString()}`)

// Fetch USDC balance
const usdcContract = new ethers.Contract(USD_COIN.address, USD_COIN.abi, ethers.provider)
const usdcBalance = await usdcContract.balanceOf(address)
const usdcBalanceFormated = ethers.utils.formatUnits(usdcBalance, 6) // 6 decimals
console.log(`USDC balance: ${usdcBalanceFormated}`)

Contributing

We welcome contributions from the community. To get started, please fork this repository, make your changes, and open a pull request. We appreciate any contributions you can make, whether it's fixing bugs, improving documentation, or adding new features.

Please read our CONTRIBUTING.md guide for details on our code of conduct, and the process for submitting pull requests to us.