ebenezergh / etherscan-android-api Goto Github PK
View Code? Open in Web Editor NEWAn Android wrapper for the etherscan.io API
Home Page: https://etherscan.io/
License: MIT License
An Android wrapper for the etherscan.io API
Home Page: https://etherscan.io/
License: MIT License
add readme w/ good documentation of how to use, where to assign apikey, etc..
CI isn't properly added to this project. Need to properly fill out the circleci.yml file with the proper build settings.
All of my development so far has been done with this being an Application Module for the sake of testing. I need to convert the app into a library module which seems to a 1-2 line change in gradle. Some discovery will need to be done on other gradle scrips that should probably change.
Yeah the whole app is written in kotlin, but there are many features that are available that could optimize the codebase in which are not being utilized..
Find areas that could be optimized
*data classes
*sealed classes
*ext functions
*etc...
I initially added a few dependency's like Dagger and some testing dependency's i thought would be necessary. turns out they aren't. Would be nice to remove them so the users will not have any conflicts when importing this library.
naming conventions are quite inconsistent, need to clean this up.
after changing from application -> library a lot of files made it through the gitignore, Remove them!
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getlogs
Reference ethereum repo, etc..
It's a little late, and i can't think right now about the best way to handle this.
[BETA] Get a list of "ERC20 - Token Transfer Events" by Address
[Optional Parameters] startblock: starting blockNo to retrieve results, endblock: ending blockNo to retrieve results
http://api.etherscan.io/api?module=account&action=tokentx&address=0x4e83362442b8d1bec281594cea3050c8eb01311c&startblock=0&endblock=999999999&sort=asc&apikey=YourApiKeyToken
(Returns up to a maximum of the last 10000 transactions only)
or
https://api.etherscan.io/api?module=account&action=tokentx&contractaddress=0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2&page=1&offset=100&sort=asc&apikey=YourApiKeyToken
(To get paginated results use page= and offset=)
or
https://api.etherscan.io/api?module=account&action=tokentx&contractaddress=0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2&address=0x4e83362442b8d1bec281594cea3050c8eb01311c&page=1&offset=100&sort=asc&apikey=YourApiKeyToken
(To get transfer events for a specific token contract, include the contractaddress paramter)
User needs to have a way to change the thread to observe/subscribe on someone without me exposing rx logic in main module. The goal is to not have the user need to have any excess libraries in their main module.
The only class as of now that a user of this library should need to access is Queries, Make everything else private/protected inaccessible. This may require moving around some packages.
To fall in line with current coding conventions, I should have consistency with the commands the user uses to fetch data. Instead of get, maybe a retrieve.. etc..
we are currently testing and using the library through another module. This task is for importing the library to jitpack.io
self-explanatory title is self-explanatory
private fun handleResponse(retrieveQuery: MainResponse) {
stat.status = retrieveQuery.status
stat.message = retrieveQuery.message
stat.ethBtc = retrieveQuery.etherPriceresult?.ethBtc
stat.ethBtcTimestamp = retrieveQuery.etherPriceresult?.ethBtcTimestamp
stat.ethUsd = retrieveQuery.etherPriceresult?.ethUsd
stat.ethUsdTimestamp = retrieveQuery.etherPriceresult?.ethUsdTimestamp
}
private fun handleResponse(retrieveQuery: GethResponse) {
geth...
...
...
}
Some of these queries, geth for example has maybe MANY different fields. If the responses are going to be retrieved from the fields using this current model then to prevent this class from being too convoluted I will need to pull them out to keep things clean.
This will probably be better to work on after all the responses have been added.
Priority is to write test around the Networking classes since that is the core of this library. Afterwards I will create Issues for writing tests on other classes.
First Network call is null for only these queries.
Self explanatory title is self explanatory...
make lists empty not null
Currently Blocked by race condition #29
Accidently forgot this and merged
For some reason Fields can contain different object types.
Example:
https://api.etherscan.io/api?module=proxy&action=eth_getBlockByNumber&tag=0x10d4f&boolean=true&apikey=YourApiKeyToken
https://api.etherscan.io/api?module=proxy&action=eth_blockNumber&apikey=YourApiKeyToken
Sometimes the "result" field will return an object, other times it will just completely return a string. The logic needs to be implemented to handle both of these fields.
So far i'm returning most variables as Strings. It'll be a more fluent experience for the users of the library if the returned data was returning the correct data type
Experienced an etherscan.api network outage for the first time and the module wasn't able to handle the crash gracefully. After 10 seconds the stream crashes.
Caused by: java.net.SocketTimeoutException: failed to connect to
Caused by: java.net.SocketTimeoutException: failed to connect to api.etherscan.io/23.111.151.66 (port 80) from /192.168.1.3 (port 37860) after 10000ms
**Should also handle gracefully faulty connections
There is a lot of code being reused in classes, and there are some areas where extension functions could be used. Stat,Account,querymediator, etc.. Clean these up.
I have the base URL hardcoded in RestClient.kt... I might reuse it later, probably best to put this in the resources.
Remove API key from strings before publishing
Go through Endpoints of queries and make sure they're returning the correct datatype.
For instance, i am retrieving a lot of hex values and saving them as a string. These could be saved in an easier format and allow the user of this library to access those variables without the extra step of converting the response.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.