Skip to content
An Android wrapper for the etherscan.io API
Kotlin
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
etherscan-sample
etherscanapi
gradle/wrapper
.gitignore
LICENSE
README.md
build.gradle
circle.yml
gradle.properties
gradlew
gradlew.bat
settings.gradle
versions.gradle

README.md

Generic badge Generic badge Generic badge License: MIT

etherscan-android-api

etherscan android api is an android wrapper for the etherscan api. This is just a module to handle networking calls.

There are only a few features left to add, however this version is completely safe to use.

Note: For Coroutines Implementation use coroutines-master branch etherscan-coroutines

Getting Started

Add JitPack to your root build.gradle at the end of repositories

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Add the dependency

	dependencies {
	        implementation 'com.github.EbenezerGH:etherscan-android-api:v1.4.0'
	}

Optional: Call ApiKey.takeOff.setApiKey("[your api key here]") in your module's application class when recording api usage in the etherscan.io console. [see example implementation]

ApiKey.takeOff.setApiKey("1I7CRNU2QIU253UBPFVB5UV2C2PBDURAIYZ")

Create an Instance of one of the reactive singles and access values by specifying thread and subscribing. [see example implementation]

Currently Available: [accountsApi, contractsApi, transactionsApi, blocksApi, statApi]

Coming Soon: [eventLogs, geth, websockets, tokens]

        val account = Account()
        val contract = ContractABI()
        val blocks = BlocksMined()

            //account
            account.getERC20Tokens("0x4e83362442b8d1bec281594cea3050c8eb01311c")
                    .observeOn(AndroidSchedulers.mainThread())
                    .subscribeBy(
                            onSuccess = { Log.d(TAG, "The Account Size of Transactions is: ${it.size}") },
                            onError = { Log.d(TAG, "error receiving ERC20") })

            //contracts
            contract.getContractABI("0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413")
                    .observeOn(AndroidSchedulers.mainThread())
                    .subscribeBy(
                            onSuccess = { Log.d(TAG, "The ABI has returned: $it") },
                            onError = { Log.d(TAG, "error receiving abi contract") })

            //blocks
            blocks.getBlocksMined("2165403")
                    .observeOn(AndroidSchedulers.mainThread())
                    .subscribeBy(
                            onSuccess = {
                                Log.d(TAG, "The block miner is: ${it.blockMiner} and " +
                                        "the first miner : ${it.uncles.get(0).miner}")
                            },
                            onError = { Log.d(TAG, "error receiving blocks mined") })

Authors

BTC: 1MLaf31sjVG3LbMyQEuY16qosPAhwNRQeZ
ETH: 82e4499D4b2A669831a3881d61BB24f7b620c61a
LTC: LUF9RpzZ3kyKMYpSNiAT5hx7qR3q7ShV3H

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

References

Etherscan APIs

Contracts Verified

Ethereum Github Repo

Ethereum Wiki

You can’t perform that action at this time.