entrega_04
v2.0.2
Published
Create a *CryptoApi* instance with a valid api key
Downloads
2
Readme
CryptoApi
First Step: Create CryptoApi instance
Create a CryptoApi instance with a valid api key
const api = new CryptoApi('valid_api_key_here')
Now you're free to use the Api as intended
Check for cryptocurrency quote
You can check the cryptocurrency quote passing an array of cryptocurrencies valid symbols to the api quote method
const cryptocurrencies = ['ETH', 'LTC']
const quotes = api.quotes(cryptocurrencies)
NOTE: null will be returned if at least one of the passed cryptocurrency symbol is incorrect
Quote conversion between different cryptocurrencies
You can convert a given cryptocurrency quote for one or more cryptocurrencies using the api conversion method
const cryptocurrencyToConvert = 'BTC'
const cryptocurrenciesToBeConvertedTo = ['ETH', 'LTC']
const amountToConvert = 1.5
const conversion = api.quotes(cryptocurrencyToConvert, amountToConvert, cryptocurrenciesToBeConvertedTo)
NOTE: null will be returned if at least one of the passed cryptocurrency symbols is incorrect