Giter Club home page Giter Club logo

getter-erc-20-balance's Introduction

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:

  1. contractAddress (string): The address of the ERC20 contract.
  2. walletAddress (string): The address for which the balance should be retrieved.
  3. 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!

getter-erc-20-balance's People

Contributors

spiritokyo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.