Skip to content

EthereumBalance is a Java class for fetching real-time Ethereum wallet balances using the Web3j library and Infura API. Simply provide a wallet address, and getBalance() returns the balance in Ether (ETH), facilitating easy integration into Java applications.

License

Notifications You must be signed in to change notification settings

jyremi/etherbal-by-jyremi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# EthereumBalance

EthereumBalance is a Java utility for retrieving real-time Ethereum wallet balances. It provides a simple way to integrate balance querying functionality into Java applications or services.

## Features

- Fetch Ethereum wallet balances in real-time.
- Utilizes the Web3j library for seamless integration.
- Supports retrieval of balances from the Ethereum mainnet via the Infura API.

## Installation

1. Clone the repository:

```bash
git clone https://github.com/your-username/ethereum-balance.git
  1. Import the project into your preferred Java development environment.

  2. Ensure that you have the necessary dependencies installed (Web3j library).

Usage

  1. Import the EthereumBalance class into your Java project.

  2. Call the getBalance() method, providing the Ethereum wallet address as an argument.

  3. Receive the wallet balance in Ether (ETH) as a BigDecimal object.

import java.math.BigDecimal;
import java.util.concurrent.ExecutionException;
import EthereumBalance;

public class Main {
    public static void main(String[] args) {
        String address = "0xYourAddress";
        try {
            BigDecimal balance = EthereumBalance.getBalance(address);
            System.out.println("Balance: " + balance + " ETH");
        } catch (ExecutionException | InterruptedException e) {
            e.printStackTrace();
        }
    }
}

Contributions

Contributions are welcome! Feel free to open issues or submit pull requests to improve this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.


This README file provides a brief overview of the project, installation instructions, usage examples, information about contributions, and licensing details.

About

EthereumBalance is a Java class for fetching real-time Ethereum wallet balances using the Web3j library and Infura API. Simply provide a wallet address, and getBalance() returns the balance in Ether (ETH), facilitating easy integration into Java applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published