Lambda that provides API to retrieve data about crypto market prices and performance
Main page. Sends the readme content as an HTML response.
Returns a list of the best and least performing cryptocurrencies in the last 24 hours.
Query Params:
limit
: (number) Amount of tokens to retrieve, default is 5category
: (string) Tokens category, default undefined, which means all- orderBy - ('price' | 'marketCap' | '24hVolume' | 'change' | 'listedAt') Order tokens by price change, volume or market capitalization, default is
change
timeframe
: ('1h' | '3h' | '12h' | '24h' | '7d' | '30d' | '3m' | '1y' | '3y' | '5y') Timeframe for price change, default is24h
Response:
Returns a JSON of tokens based on https://docs.moralis.com/market-insights-api/reference/get-top-erc20-tokens-by-price-movers
with additional meta data https://docs.moralis.com/web3-data-api/evm/reference/get-token-metadata-by-symbol
You can test the API using the following curl commands:
# api/tokens/by-price-change
curl -X GET -H "Content-Type: application/json" http://localhost:3000/api/tokens/by-price-change
Clone repo
git clone https://github.com/eonian-core/crypto-market-api.git
Install dependencies
cd crypto-market-api
npm i
Build and start server
npm run dev
build
- Build projectstart
- Start server
To run tests, run the following command
# Unit tests on mocks
npm run test
# E2E tests with real requests
npm run test:e2e
To deploy, you need install flyctl and login using fly auth login
To deploy this project run
npm run deploy
- Run
fly status
- show the status of the application instances. - Run
fly apps open
- open your browser and direct it to your app.
Eonian internal project. We trying to be as transparent as possible with our users, as part of this practice we publishing this project. You can also use it for own development. Any contributions and suggestions are welcome!
Contributions are always welcome!
Create new issues or contact us in Discord for any questions!