|
1 | 1 | # hello_etherscan |
2 | 2 |
|
3 | | -hello_etherscan is just a wrapper for the [Etherscan Api](https://etherscan.io/apis). There are many different network calls and it may be best to just abstract out this huge bulk of code into a module or library. |
| 3 | +hello_etherscan is a wrapper for the [Etherscan Api](https://etherscan.io/apis). This is just a module to handle Networking calls. |
4 | 4 |
|
5 | 5 | ## Getting Started |
6 | | - |
7 | | -This library is still in beta and not ready for it's first release, there are still a few more [issues](https://github.com/EbenezerGH/hello_etherscan/issues) to complete. |
8 | | - |
9 | | -To use this project as a module: |
10 | | - |
11 | | -Clone project or download |
12 | | -``` |
13 | | -https://github.com/EbenezerGH/hello_etherscan.git |
14 | | -``` |
15 | | - |
16 | | -In your app directory's gradle, import the module |
17 | | -``` |
18 | | -implementation project(':etherscanapi') |
19 | | -``` |
20 | | -In your root directory's settings.gradle be sure to add the module into your include right after your previous module seperated by a comma [Example Implementation](https://github.com/EbenezerGH/hello_etherscan/blob/master/settings.gradle) |
21 | | -``` |
22 | | -':etherscanapi' |
23 | | -``` |
| 6 | +No Releases yet, [issues](https://github.com/EbenezerGH/hello_etherscan/issues) to complete. |
24 | 7 |
|
25 | 8 | Call `ApiKey.takeOff.setApiKey("[your api key here]")` if recording api usage in the etherscan.io console [see [Example implementation](https://github.com/EbenezerGH/hello_etherscan/blob/master/app/src/main/java/jfyg/etherscan/helloetherescan/HelloEtherscanApplication.kt)] |
26 | 9 | ``` |
27 | 10 | ApiKey.takeOff.setApiKey("1I7CRNU2QIU253UBPFVB5UV2C2PBDURAIYZ") |
28 | 11 | ``` |
29 | 12 |
|
30 | | -Lastly call the given function that's needed by creating an instance of one of the Etherscan Apis [accounts, contracts, transactions, blocks, eventLogs, geth, websockets, tokens, stat] |
| 13 | +Create an Instance of one of the following and access values [see [Example implementation](https://github.com/EbenezerGH/hello_etherscan/blob/master/app/src/main/java/jfyg/etherscan/helloetherescan/MainActivity.kt)] |
| 14 | + |
| 15 | +``[accounts, contracts, transactions, blocks, eventLogs, geth, websockets, tokens, stat]`` |
31 | 16 |
|
32 | 17 | ``` |
33 | | -//stat |
34 | | -Log.d(TAG, "The current price of Ether in Usd: ${stat.getLastPriceInUsd()}") |
35 | | -Log.d(TAG, "The total supply of Ether: ${stat.getTotalSupply()}") |
36 | | -Log.d(TAG, "The total supply of Ether in Wei: ${stat.getTotalSupplyInWei()}") |
37 | | -
|
38 | | -//account |
39 | | -Log.d(TAG, "The Account Status is: ${account.getNetworkStatus()}") |
40 | | -Log.d(TAG, "The Account Message is: ${account.getNetworkMessage()}") |
41 | | -``` |
42 | | -``` |
43 | | -jfyg.etherscan.helloetherescan D/jfyg.etherscan.helloetherescan.MainActivity: The current price of Ether in Usd: 533.22 |
44 | | -jfyg.etherscan.helloetherescan D/jfyg.etherscan.helloetherescan.MainActivity: The total supply of Ether: 9.83557402803E25 |
45 | | -jfyg.etherscan.helloetherescan D/jfyg.etherscan.helloetherescan.MainActivity: The total supply of Ether in Wei: 9.835574028029999E7 |
46 | | -jfyg.etherscan.helloetherescan D/jfyg.etherscan.helloetherescan.MainActivity: The Account Status is: 1 |
47 | | -jfyg.etherscan.helloetherescan D/jfyg.etherscan.helloetherescan.MainActivity: The Account Message is: OK |
| 18 | +val stat = Stat() |
| 19 | +val account = Account() |
| 20 | +"The current price of Ether in Usd: ${stat.getLastPriceInUsd()}" |
| 21 | +"The Account Balance is: ${account.getBalance("0x82e4499D4b2A669831a3881d61BB24f7b620c61a")}" |
48 | 22 | ``` |
49 | | - |
50 | 23 | ## Authors |
51 | 24 |
|
52 | 25 | * [**Ebenezer Ackon**](http://www.ebenezerackon.com/) |
|
0 commit comments