Skip to content

tlapata/eth-balance-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ethereum Balance API (Rust + Axum)

A simple Rust microservice that returns the ETH balance of a given address using ethers-rs and axum.

Features

  • Connects to Ethereum via RPC
  • Parses address from query
  • Returns balance in ETH
  • Async performance via Tokio

Usage

Set your RPC URL first:

export RPC_URL=https://mainnet.infura.io/v3/YOUR_KEY

2. Run the server

cargo run

3. Query balance

GET /balance?address=0x742d35Cc6634C0532925a3b844Bc454e4438f44e

Example:

http://localhost:3000/balance?address=0x742d35Cc6634C0532925a3b844Bc454e4438f44e

Dependencies

License

MIT

About

A Rust service that reads smart contract data using ethers, aggregates token balances, and exposes it over an HTTP API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages