Skip to content

Commit c226c83

Browse files
committed
optimizations
1 parent 241a436 commit c226c83

File tree

21 files changed

+95
-93
lines changed

21 files changed

+95
-93
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ etherscan android api is an android wrapper for the [etherscan api](https://ethe
99

1010
There are only a few [features](https://github.com/EbenezerGH/hello_etherscan/issues) left to add, however this version is completely safe to use.
1111

12+
##### Note: For RxJava Implementation use master branch [etherscan-coroutines](https://github.com/EbenezerGH/etherscan-android-api
13+
1214
## Getting Started
1315

1416
Add JitPack to your root build.gradle at the end of repositories
@@ -27,7 +29,7 @@ Add the dependency
2729

2830
```
2931
dependencies {
30-
implementation 'com.github.EbenezerGH:etherscan-android-api:v1.0.3'
32+
implementation 'com.github.EbenezerGH:etherscan-android-api:v1.5.0'
3133
}
3234
```
3335

@@ -39,7 +41,7 @@ ApiKey.takeOff.setApiKey("1I7CRNU2QIU253UBPFVB5UV2C2PBDURAIYZ")
3941

4042
Create an Instance of one of the reactive singles and access values by specifying thread and subscribing. [see [example implementation](https://github.com/EbenezerGH/etherscan-android-api/blob/master/etherscan-sample/src/main/java/jfyg/etherscan/helloetherescan/SampleActivity.kt)]
4143

42-
Currently Available: ``[accounts, contracts, transactions, blocks, stat]``
44+
Currently Available: ``[accountsApi, contractsApi, transactionsApi, blocksApi, statApi]``
4345

4446
Coming Soon: ``[eventLogs, geth, websockets, tokens]``
4547

etherscan-sample/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ android {
2525
dependencies {
2626
implementation fileTree(dir: 'libs', include: ['*.jar'])
2727

28-
2928
/**
3029
Because RxAndroid releases are few and far between, it is recommended you also
3130
explicitly depend on RxJava's latest version for bug fixes and new features.
@@ -39,7 +38,7 @@ dependencies {
3938
// google
4039
implementation 'com.android.support:appcompat-v7:26.1.0'
4140
implementation 'com.android.support:design:26.1.0'
42-
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
41+
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
4342

4443
implementation project(':etherscanapi')
4544
}

etherscan-sample/src/main/java/jfyg/etherscan/helloetherescan/SampleActivity.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import android.support.v7.app.AppCompatActivity
55
import android.util.Log
66
import io.reactivex.android.schedulers.AndroidSchedulers
77
import io.reactivex.rxkotlin.subscribeBy
8-
import jfyg.data.account.Accounts
9-
import jfyg.data.block.Blocks
10-
import jfyg.data.contract.Contracts
11-
import jfyg.data.stat.Stats
12-
import jfyg.data.transaction.Transactions
8+
import jfyg.data.account.AccountsApi
9+
import jfyg.data.block.BlocksApi
10+
import jfyg.data.contract.ContractsApi
11+
import jfyg.data.stat.StatsApi
12+
import jfyg.data.transaction.TransactionsApi
1313
import kotlinx.android.synthetic.main.activity_main.*
1414

1515

@@ -22,11 +22,11 @@ class SampleActivity : AppCompatActivity() {
2222
setSupportActionBar(toolbar)
2323

2424
//************************************************ Used To Test Singles returned from etherscanapi Module
25-
val stat = Stats()
26-
val account = Accounts()
27-
val contract = Contracts()
28-
val tx = Transactions()
29-
val blocks = Blocks()
25+
val stat = StatsApi()
26+
val account = AccountsApi()
27+
val contract = ContractsApi()
28+
val tx = TransactionsApi()
29+
val blocks = BlocksApi()
3030

3131

3232
fab.setOnClickListener {

etherscanapi/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ android {
1515

1616
buildTypes {
1717
release {
18-
minifyEnabled true
18+
minifyEnabled false
1919
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2020
}
2121
debug {
@@ -30,7 +30,7 @@ dependencies {
3030
implementation fileTree(include: ['*.jar'], dir: 'libs')
3131

3232
// kotlin
33-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$project.kotlin_version"
33+
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.10'
3434

3535
// rx
3636
implementation "io.reactivex.rxjava2:rxkotlin:$project.reactivex_rxjava2_rxkotlin_version"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package jfyg.data
22

3-
data class Balance(val account: String? = null,
3+
data class Balance(val account: String,
44

5-
val balance: String? = null)
5+
val balance: String)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package jfyg.data
22

3-
data class BlockAccount(val blockNumber: String? = null,
3+
data class BlockAccount(val blockNumber: String,
44

5-
val timeStamp: String? = null,
5+
val timeStamp: String,
66

7-
val blockReward: String? = null)
7+
val blockReward: String)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package jfyg.data
22

3-
data class BlockMined(val blockNumber: String? = null,
3+
data class BlockMined(val blockNumber: String,
44

5-
val timeStamp: String? = null,
5+
val timeStamp: String,
66

7-
val blockMiner: String? = null,
7+
val blockMiner: String,
88

9-
val blockReward: String? = null,
9+
val blockReward: String,
1010

1111
val uncles: List<Uncle> = emptyList())

etherscanapi/src/main/java/jfyg/data/ERC20Token.kt

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,42 @@ package jfyg.data
22

33
import com.google.gson.annotations.SerializedName
44

5-
data class ERC20Token(val blockNumber: String? = null,
5+
data class ERC20Token(val blockNumber: String,
66

7-
val timeStamp: String? = null,
7+
val timeStamp: String,
88

9-
val hash: String? = null,
9+
val hash: String,
1010

11-
val nonce: String? = null,
11+
val nonce: String,
1212

13-
val blockHash: String? = null,
13+
val blockHash: String,
1414

1515
@SerializedName("from")
16-
val transactionFrom: String? = null,
16+
val transactionFrom: String,
1717

18-
val contractAddress: String? = null,
18+
val contractAddress: String,
1919

2020
@SerializedName("to")
21-
val transactionTo: String? = null,
21+
val transactionTo: String,
2222

23-
val value: String? = null,
23+
val value: String,
2424

25-
val tokenName: String? = null,
25+
val tokenName: String,
2626

27-
val tokenSymbol: String? = null,
27+
val tokenSymbol: String,
2828

29-
val tokenDecimal: String? = null,
29+
val tokenDecimal: String,
3030

31-
val transactionIndex: String? = null,
31+
val transactionIndex: String,
3232

33-
val gas: String? = null,
33+
val gas: String,
3434

35-
val gasPrice: String? = null,
35+
val gasPrice: String,
3636

37-
val gasUsed: String? = null,
37+
val gasUsed: String,
3838

39-
val cumulativeGasUsed: String? = null,
39+
val cumulativeGasUsed: String,
4040

41-
val input: String? = null,
41+
val input: String,
4242

43-
val confirmations: String? = null)
43+
val confirmations: String)

etherscanapi/src/main/java/jfyg/data/StatPrice.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ package jfyg.data
33
import com.google.gson.annotations.SerializedName
44

55
data class StatPrice(@SerializedName("ethbtc")
6-
val ethBtc: String? = null,
6+
val ethBtc: String,
77

88
@SerializedName("ethbtc_timestamp")
9-
val ethBtcTimestamp: String? = null,
9+
val ethBtcTimestamp: String,
1010

1111
@SerializedName("ethusd")
12-
val ethUsd: String? = null,
12+
val ethUsd: String,
1313

1414
@SerializedName("ethusd_timestamp")
15-
val ethUsdTimestamp: String? = null
15+
val ethUsdTimestamp: String
1616
)

etherscanapi/src/main/java/jfyg/data/Tx.kt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,41 @@ package jfyg.data
22

33
import com.google.gson.annotations.SerializedName
44

5-
data class Tx(val blockNumber: String? = null,
5+
data class Tx(val blockNumber: String,
66

7-
val timeStamp: String? = null,
7+
val timeStamp: String,
88

9-
val hash: String? = null,
9+
val hash: String,
1010

11-
val nonce: String? = null,
11+
val nonce: String,
1212

13-
val blockHash: String? = null,
13+
val blockHash: String,
1414

15-
val transactionIndex: String? = null,
15+
val transactionIndex: String,
1616

1717
@SerializedName("from")
18-
val transactionFrom: String? = null,
18+
val transactionFrom: String,
1919

2020
@SerializedName("to")
21-
val transactionTo: String? = null,
21+
val transactionTo: String,
2222

23-
val value: String? = null,
23+
val value: String,
2424

25-
val gas: String? = null,
25+
val gas: String,
2626

27-
val gasPrice: String? = null,
27+
val gasPrice: String,
2828

29-
val isError: String? = null,
29+
val isError: String,
3030

3131
@SerializedName("txreceipt_status")
32-
val receiptStatus: String? = null,
32+
val receiptStatus: String,
3333

34-
val input: String? = null,
34+
val input: String,
3535

36-
val contractAddress: String? = null,
36+
val contractAddress: String,
3737

38-
val cumulativeGasUsed: String? = null,
38+
val cumulativeGasUsed: String,
3939

40-
val gasUsed: String? = null,
40+
val gasUsed: String,
4141

42-
val confirmations: String? = null)
42+
val confirmations: String)

0 commit comments

Comments
 (0)