From 822082b0a1bfbd2e2a841010bd0985b8cbd37218 Mon Sep 17 00:00:00 2001 From: Ebenezer Ackon Date: Sun, 15 Apr 2018 22:40:17 -0400 Subject: [PATCH] keep reactive stream open by returning Singles --- README.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index dbf32e8..b315d34 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,34 @@ # hello_etherscan -hello_etherscan is a wrapper for the [Etherscan Api](https://etherscan.io/apis). This is just a module to handle Networking calls. +hello_etherscan is a wrapper for the [Etherscan Api](https://etherscan.io/apis). This is just a module to handle networking calls. ## Getting Started -No Releases yet, [issues](https://github.com/EbenezerGH/hello_etherscan/issues) to complete. +No Releases yet, [features](https://github.com/EbenezerGH/hello_etherscan/issues) to complete. -Call `ApiKey.takeOff.setApiKey("[your api key here]")` if recording api usage in the etherscan.io console [see [Example implementation](https://github.com/EbenezerGH/hello_etherscan/blob/master/app/src/main/java/jfyg/etherscan/helloetherescan/HelloEtherscanApplication.kt)] +Optional: Call `ApiKey.takeOff.setApiKey("[your api key here]")` when recording api usage in the etherscan.io console. [see [Example implementation](https://github.com/EbenezerGH/hello_etherscan/blob/master/app/src/main/java/jfyg/etherscan/helloetherescan/HelloEtherscanApplication.kt)] ``` ApiKey.takeOff.setApiKey("1I7CRNU2QIU253UBPFVB5UV2C2PBDURAIYZ") ``` -Create an Instance of one of the following and access values [see [Example implementation](https://github.com/EbenezerGH/hello_etherscan/blob/master/app/src/main/java/jfyg/etherscan/helloetherescan/MainActivity.kt)] +Create an Instance of one of the reactive Singles and access values by specifying thread and subscribing. [see [Example implementation](https://github.com/EbenezerGH/hello_etherscan/blob/master/app/src/main/java/jfyg/etherscan/helloetherescan/MainActivity.kt)] ``[accounts, contracts, transactions, blocks, eventLogs, geth, websockets, tokens, stat]`` ``` val stat = Stat() val account = Account() -"The current price of Ether in Usd: ${stat.getLastPriceInUsd()}" -"The Account Balance is: ${account.getBalance("0x82e4499D4b2A669831a3881d61BB24f7b620c61a")}" + + //stat test + stat.getLastPriceInBtc()?.observeOn(AndroidSchedulers.mainThread()) + ?.subscribeBy { + Log.d(TAG, "The current price of Ether in Btc: $it") + } + + //account test + account.getTransactions("0x2c1ba59d6f58433fb1eaee7d20b26ed83bda51a3")?.observeOn(AndroidSchedulers.mainThread()) + ?.subscribeBy { + Log.d(TAG, "The Account Size of Transactions is: ${it.size}") + } ``` ## Authors