Socket
Book a DemoInstallSign in
Socket

getter-erc-20-balance

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

getter-erc-20-balance

Small utility package aims you to get balance of your erc20 contact

latest
Source
npmnpm
Version
0.0.16
Version published
Maintainers
1
Created
Source

Description

This npm package provides a class called ERC20Balance that allows you to retrieve the balance of an ERC20 contract for a given wallet address using getERC20BalanceOf method.

Installation

npm install getter-erc-20-balance

API

To import ERC20Balance class use:

import { ERC20Balance } from 'getter-erc-20-balance'

The ERC20Balance class provides the following method:

  • getERC20BalanceOf(contractAddress: string, walletAddress: string, provider: JsonRpcProvider): Promise<string>

This asynchronous method retrieves the balance of an ERC20 contract for the specified wallet address:

  • contractAddress (string): The address of the ERC20 contract.
  • walletAddress (string): The address for which the balance should be retrieved.
  • provider (JsonRpcProvider): An instance of JsonRpcProvider from the ethers.js library, connected to an Ethereum JSON-RPC provider.

Returns a Promise that resolves to the balance as a string

Good luck!

FAQs

Package last updated on 17 May 2023

Did you know?

Socket

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.

Install

Related posts