File tree 3 files changed +22
-29
lines changed
etherscan-sample/src/main/java/jfyg/etherscan/helloetherescan
etherscanapi/src/main/java/jfyg
3 files changed +22
-29
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,18 @@ class SampleActivity : AppCompatActivity() {
35
35
stat.getEtherStatistics()
36
36
.observeOn(AndroidSchedulers .mainThread())
37
37
.subscribeBy(
38
- onSuccess = { Log .d(TAG , " The current price of Ether in Btc: ${it.ethUsd} " ) },
38
+ onSuccess = { Log .d(TAG , " The current price of Ether in Usd: ${it.ethUsd} " ) },
39
+ onError = { Log .d(TAG , " error receiving stat" ) })
40
+
41
+
42
+ // account MultiBalance test
43
+ account.getMultiBalance(listOf (
44
+ " 0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413" ,
45
+ " 0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413" ,
46
+ " 0x4e83362442b8d1bec281594cea3050c8eb01311c" ))
47
+ .observeOn(AndroidSchedulers .mainThread())
48
+ .subscribeBy(
49
+ onSuccess = { Log .d(TAG , " The current balance in account 2 is: ${it[1 ].balance} " ) },
39
50
onError = { Log .d(TAG , " error receiving stat" ) })
40
51
41
52
Original file line number Diff line number Diff line change @@ -7,20 +7,7 @@ import jfyg.data.ERC20Token
7
7
import jfyg.data.Tx
8
8
import jfyg.data.TxsInternal
9
9
import jfyg.network.queries.ApiQuery
10
- import jfyg.utils.QueryUtils
11
- import jfyg.utils.ACCOUNT
12
- import jfyg.utils.ASC
13
- import jfyg.utils.BALANCE
14
- import jfyg.utils.BALANCE_MULTI
15
- import jfyg.utils.BLOCKS
16
- import jfyg.utils.END_BLOCK
17
- import jfyg.utils.GENERIC_PUBLIC_ADDRESS
18
- import jfyg.utils.GET_MINED_BLOCKS
19
- import jfyg.utils.LATEST
20
- import jfyg.utils.START_BLOCK
21
- import jfyg.utils.TOKEN_TX
22
- import jfyg.utils.TX_LIST
23
- import jfyg.utils.TX_LIST_INTERNAL
10
+ import jfyg.utils.*
24
11
25
12
/* *
26
13
* https://etherscan.io/apis#accounts
@@ -51,7 +38,7 @@ class Accounts : AccountsContract {
51
38
Single <List <Balance >> = query.accountMultiBalance(
52
39
ACCOUNT ,
53
40
BALANCE_MULTI ,
54
- QueryUtils . retrieveList(addresses),
41
+ retrieveList(addresses),
55
42
LATEST ).map { it.result }
56
43
57
44
/* *
Original file line number Diff line number Diff line change 1
1
package jfyg.utils
2
2
3
3
/* *
4
- * Utilities that may be used to provide successful Queries
4
+ * Retrieve a list of mulitple items
5
5
*/
6
- internal object QueryUtils {
7
- /* *
8
- * Retrieve a list of mulitple items
9
- */
10
- fun retrieveList (listItems : List <String >? ): String {
6
+ internal fun retrieveList (listItems : List <String >? ): String {
11
7
12
- var getList = " "
8
+ var getList = " "
13
9
14
- for (item in listItems!! ) {
15
- getList + = item + " ,"
16
- }
17
-
18
- return getList.dropLast(1 )
10
+ for (item in listItems!! ) {
11
+ getList + = item + " ,"
19
12
}
20
- }
13
+
14
+ return getList.dropLast(1 )
15
+ }
You can’t perform that action at this time.
0 commit comments