Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mykeels/crypto-dip-alert

Software that tells you when the price of a crypto has gone down.
https://github.com/mykeels/crypto-dip-alert

crypto crypto-dip nodejs-script react-native-app

Last synced: 3 months ago
JSON representation

Software that tells you when the price of a crypto has gone down.

Awesome Lists containing this project

README

        

# Crypto Dip Alert

Contains software for notifying the user, when the price of monitored cryptocurrency, drops past a set threshold.

## Included Software

- [NodeJS Script](./scripts/nodejs-crypto-dip-alert/README.md)
- [React Native App](./app/README.md)

## Third Party API

- [coincap.io](https://docs.coincap.io/?version=latest)

## Custom Notifications

To add a Custom Notification Provider:
* Create a file entry in the `scripts/nodejs-crypto-dip-alert/notifications` folder ending with `.notification.js`
* Expose a `notify` function from `module.exports`
* The function is an async function so return a Promise
* Function has the following as parameters
* `coin`
* `maxPrice`
* `currentPrice`
* `dipThreshold`
* You can add configs to the `.env` file to determine if custom notif will be used.
* e.g. `NOTIFY_YORUBA=` `NOTIFY_MAILGUN=`

### Example with Yoruba Notification
```js

/**
* posts a notification in the terminal console
* @param {{symbol: string, priceUsd: number}} coin
* @param {number} maxPrice
* @param {number} currentPrice
* @param {number} dipThreshold
*/
const notify = async (coin, maxPrice, currentPrice, dipThreshold) => {
// early return if not set in env flags
if (!process.env.NOTIFY_YORUBA || process.env.NOTIFY_YORUBA !== 'true') return;
console.log(`[๐Ÿšจ๐Ÿšจ๐Ÿšจ๐Ÿ’ฐ๐Ÿšจ๐Ÿšจ๐Ÿšจ] Egbami, ye, ๐Ÿ˜ข ${coin.symbol} ti jona`);
console.log(`[๐Ÿ‘€] Iwแปn ti o pแปju: ${maxPrice} `);
console.log(`[๐Ÿ‘€] Ni in si: ${currentPrice} `);
console.log(`[๐Ÿ‘€] ร€bรกwแปlรฉ: ${dipThreshold} `);
// await here if you need to
return Promise.resolve();
}

module.exports = notify;
```