File tree Expand file tree Collapse file tree 2 files changed +72
-0
lines changed
app/src/main/java/jfyg/etherscan/helloetherescan/ethereum Expand file tree Collapse file tree 2 files changed +72
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments