hypha-dao / treasury-service

Web service(s) used to query information from Hypha treasuries
2 stars 0 forks source link

Query Ethereum treasury balance for ETH and ERC20 tokens #2

Closed mgravitt closed 3 years ago

mgravitt commented 3 years ago

Hypha uses a multisig Ethereum address to store ETH and USDT ERC20 tokens.

Current Balances

These can be retrieved using the web3.js library. This project has one function for querying ETH balance and another for querying ERC20 balance. You can test this at this web address. The Hypha address is: 0xC20f453a4B4995CA032570f212988F4978B35dDd

The USDT contract address is: 0xdac17f958d2ee523a2206206994597c13d831ec7

The results look like this: image

History

There seem to be a few options for querying the transaction history of ethereum addresses. dfuse seems like the best option.

The query within eosq looks like this: https://ethq.app/search?q=(from:0xC20f453a4B4995CA032570f212988F4978B35dDd%20OR%20to:0xC20f453a4B4995CA032570f212988F4978B35dDd)

Here's an example from the dfuse docs. https://github.com/dfuse-io/docs/blob/master/samples/javascript/eth/node-server/index.js

sebastianmontero commented 3 years ago

Hi @dappdever, what is remaining to be done on this issue?

mgravitt commented 3 years ago

Hi @dappdever, what is remaining to be done on this issue?

I think this is all for now.