An open API service indexing awesome lists of open source software.

https://github.com/anders94/lido-balance-reader

Reads the stETH balance of a given address.
https://github.com/anders94/lido-balance-reader

Last synced: 2 days ago
JSON representation

Reads the stETH balance of a given address.

Awesome Lists containing this project

README

          

# lido-balance-reader

Reads the stETH balance of a given address. (or a popular whale address if one isn't given)

## Prerequisites

* Node.js
* Access to a full ETH node (defaults to `http://localhost:8545`)

## Setup

```
git clone https://github.com/anders94/lido-balance-reader
cd lido-balance-reader/
npm install
```

## Run
Using a local ETH node at `http://localhost:8545`:
```
node app 0x7153d2ef9f14a6b1bb2ed822745f65e58d836c3f
```

Specify `http://example.com:8545` as an ETH endpoint:
```
URI=http://example.com:8545 node app 0x7153d2ef9f14a6b1bb2ed822745f65e58d836c3f
```

## Output
```
Sat, 17 Dec 2022 04:00:01 GMT balance 59416.3961092668570237 shares 53969.391556769290368068 totalPooledEther 4807173.129287314948053176 totalShares 4366475.011688289253384975
```

### Notes

The thing that makes this interesting is we are reading an upgradable contract. You'll see there
are two ABI .json files in the repository. One is the proxy contract and the other is the
implementation. We have to read through the proxy contract as you can see in `app.js`.