CryptocurrencyTool

abstract class CryptocurrencyTool

The CryptocurrencyTool class is a useful tool class that helps to work with cryptocurrencies details. This tool helps to get image logo of a crypto, get full name of a crypto or get symbol of a crypto.

Author

N7ghtm4r3 - Tecknobit

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
private val coins: JSONArray
coins is the instance that contains cryptocurrencies details
Link copied to clipboard
private val IMAGE_URL_KEY: String = "img_url"
IMAGE_URL_KEY is the instance that contains image url key for coins map
Link copied to clipboard
private val NAME_KEY: String = "name"
NAME_KEY is the instance that contains name key for coins map
Link copied to clipboard
private val SYMBOL_KEY: String = "symbol"
SYMBOL_KEY is the instance that contains symbol key for coins map

Functions

Link copied to clipboard
open fun getBaseFromSymbol(symbol: String): String
Method to fetch the base symbol from a symbol
Link copied to clipboard
Method to fetch cryptocurrency name
Link copied to clipboard
Method to fetch cryptocurrency symbol
Link copied to clipboard
open fun getQuoteFromSymbol(symbol: String): String
Method to fetch the quote symbol from a symbol
Link copied to clipboard
open fun getUrlLogoByName(name: String): String
Method to fetch cryptocurrency url logo image by cryptocurrency name
Link copied to clipboard
open fun getUrlLogoBySymbol(symbol: String): String
Method to fetch cryptocurrency url logo image by cryptocurrency symbol
Link copied to clipboard
private open fun getValue(researchKey: String, researchValue: String, keyToFetch: String): String
Method to fetch detail from coins map
Link copied to clipboard
private open fun getValueFromSymbol(symbol: String, isQuote: Boolean): String
Method to fetch the base or the quote symbol from a symbol
Link copied to clipboard
private open fun loadCoinsMap(): String
Method to load coins map for workflow of the tool No-any params required