How to use etherscan.io api with etherum wallet

时间:2017-12-18 07:13:40

标签: android ethereum

I would like to integrate etherscan.io api with my android project but I don't know how to maps etherum wallet with etherscan.io api. I have created a test etherum wallet and made some transaction in wallet.

I created the api key on etherscan.io account and having the address on my etherum wallet but when I am using etherscan.io api to get the balance for that address , it is returning 0 even it has some balance.

Can anyone guide me how to integrate etherscan.io api?

1 个答案:

答案 0 :(得分:0)

您是否将API URL用于正确的网络?

主网: https://api.etherscan.io/api?module=account&action=balance&address=0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a&tag=latest&apikey= ***

Ropsten: https://api-ropsten.etherscan.io/api?module=account&action=balance&address=0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a&tag=latest&apikey= ***

Rinkeby: https://api-rinkeby.etherscan.io/api?module=account&action=balance&address=0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a&tag=latest&apikey= ***

P.s。我认为使用标准的JSON-RPC将是最佳做法。 您将不受限于etherscan API,并且可以使用任何打开的地址(例如“ infura.io”)或您的节点。

对于开发android-app,可以使用web3j库