Skip to content

Commit b54bf2c

Browse files
author
Ebenezer Ackon
committed
add etherum stat queries
1 parent ebc5684 commit b54bf2c

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package jfyg.etherscan.helloetherescan.ethereum
2+
3+
4+
import android.util.Log
5+
import jfyg.etherscan.helloetherescan.MainActivity
6+
7+
class EthereumStat : EthereumStatFunctions {
8+
9+
var activity = MainActivity()
10+
11+
override fun getTotalSupply(): Long? {
12+
val stats = "stats"
13+
val ethSupply = "ethSupply"
14+
15+
activity.queryStats(stats, ethSupply)
16+
return 0 //TODO: Figure out how to parse supply
17+
}
18+
19+
20+
override fun getTotalSupplyInWei(): Int? {
21+
val stats = "stats"
22+
val ethSupply = "ethSupply"
23+
24+
activity.queryStats(stats, ethSupply)
25+
return 0 //TODO: Figure out how to parse supply
26+
}
27+
28+
override fun getLastPriceInUsd(): String? {
29+
val stats = "stats"
30+
val ethPrice = "ethprice"
31+
32+
activity.queryStats(stats, ethPrice)
33+
Log.d("Ebenezer", activity.etherPrice.ethUsd)
34+
return activity.etherPrice.ethUsd //TODO: Make this return Int
35+
}
36+
37+
override fun getLastPriceInBtc(): String? {
38+
val stats = "stats"
39+
val ethPrice = "ethprice"
40+
41+
activity.queryStats(stats, ethPrice)
42+
Log.d("Ebenezer", activity.etherPrice.ethBtc)
43+
return activity.etherPrice.ethBtc //TODO: Make this return Int
44+
}
45+
46+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package jfyg.etherscan.helloetherescan.ethereum
2+
3+
4+
interface EthereumStatFunctions {
5+
6+
/**
7+
* Return Total Supply of Ether
8+
*/
9+
fun getTotalSupply(): Long?
10+
11+
/**
12+
* Return Total Supply of Ether in Wei
13+
*/
14+
fun getTotalSupplyInWei(): Int?
15+
16+
/**
17+
* Return Last price of ether in Btc
18+
*/
19+
fun getLastPriceInBtc(): String?
20+
21+
/**
22+
* Return Last price of ether in Usd
23+
*/
24+
fun getLastPriceInUsd(): String?
25+
26+
}

0 commit comments

Comments
 (0)