Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/mykeels/crypto-dip-alert
- Owner: mykeels
- License: mit
- Created: 2020-04-23T10:40:43.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T04:20:35.000Z (about 2 years ago)
- Last Synced: 2024-09-28T18:43:08.693Z (3 months ago)
- Topics: crypto, crypto-dip, nodejs-script, react-native-app
- Language: JavaScript
- Homepage:
- Size: 3.52 MB
- Stars: 23
- Watchers: 3
- Forks: 2
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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;
```