Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matteodanelli/MMM-cryptocurrency
A MagicMirror module for crypto currencies value.
https://github.com/matteodanelli/MMM-cryptocurrency
Last synced: 23 days ago
JSON representation
A MagicMirror module for crypto currencies value.
- Host: GitHub
- URL: https://github.com/matteodanelli/MMM-cryptocurrency
- Owner: matteodanelli
- License: mit
- Created: 2017-05-07T19:56:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-08-08T07:28:20.000Z (over 2 years ago)
- Last Synced: 2024-08-04T10:03:01.677Z (4 months ago)
- Language: JavaScript
- Size: 1.72 MB
- Stars: 94
- Watchers: 6
- Forks: 42
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-mmm - **MMM-cryptocurrency**
README
# MMM-cryptocurrency
A MagicMirror module used to get real-time values of crypto currencies.## Installation
1. Navigate into your MagicMirror's `modules` folder and execute `git clone https://github.com/matteodanelli/MMM-cryptocurrency.git`.
2. Add the module inside `config.js` placing it where you prefer ;)## Config
|Option|Description|
|---|---|
|`apikey`|MANDATORY: API key from [CoinMarketCap](https://pro.coinmarketcap.com/).
**Type:** `string`|
|`apiDelay`|Frequency, in minutes, to updata data values
**Type:** `number`
**Default** 5 |
|`currency`|One or more currencies you want to display.
**Type:** `array`
**Options:** `bitcoin, ethereum, xrp, dash, bitcoin-gold, litecoin, iota, ethereum-classic, nem, stratis, bitcoin-cash, cardano, solana, neo, poken, bnb`
**Default:** ['bitcoin']|
|`conversion`|The currency used to convert crypto currency value.
**Type:** `string`
**Options:** `AUD, BRL, CAD, CHF, CNY, EUR, GBP, HKD, IDR, INR, JPY, KRW, MXN, RUB`
**Default:** USD|
|`displayLongNames`| Option that show full name of the currency or the shortest version. (eg. Bitcoin/BTC ).
**Type** `boolean`
**Default** false |
|`displayType`| Sets the display of the module.
**Type:** `string`
**Options:** `detail, logo, logoWithChanges`
**Default:** detail
|`logoHeaderText`| Defines the headline text if `displayType: logo` is set.
**Type:** `string`
**Default:** Crypto currency
|`headers`| Possibility to show currency change in the last hour, day or week.
**Type** One of the following: `change1h, change24h, change7d`
**Default** None. All optionals. |
|`significantDigits`|Total digits to use for rounding the price (including before and after decimal point).
**Type** `number`
**Default** none |
|`minimumFractionDigits`|Minimum number of digits after the decimal point in the price.
**Type** `number`
**Default** 2 |
|`maximumFractionDigits`|Maximum number of digits after the decimal point in the price.
**Type** `number`
**Default** 5 |
|`showGraphs`| Possibility to show currency graph over the last week in `displayType: logo`.
**Type:** `boolean`
**Default** false |
|`coloredLogos`| Toggles white or colored logos `displayType: logo`.
**Type:** `boolean`
**Default** true |
|`fontSize`| Dimension of price text. You can specify pixel values, em values or keywords.
**Type:** `string`
**Options:** `xx-small`, `x-small`, `small`, `medium`, `large`, `x-large`, `xx-large`
**Default** xx-large |Here is an example of an entry in `config.js`
```
{
module: "MMM-cryptocurrency",
position: "top_right",
config: {
apikey: '1234-5678-9009-8765-4321',
currency: ['ethereum', 'bitcoin'],
conversion: 'EUR',
headers: ['change24h', 'change1h', 'change7d'],
displayType: 'logoWithChanges',
showGraphs: true
}
}
```## Screenshots
#### Display type: details
![Screenshot of detail mode](/MMM-cryptocurrency.png?raw=true "Example screenshot")#### Display type: logo
![Screenshot with logo](/logoView.png?raw=true "displayType: 'logo'")#### Display type: logoWithChanges
![Screenshot with logo and Changes](/logoWithChangesView.png?raw=true "displayType: 'logoWithChanges'")#### Display type: logo + significantDigits=5
![Screenshot with logo and 5 significant digits](/logoViewWithSignificantDigits.png?raw=true "displayType: 'logo', significantDigits: 5")#### Display type: logo + showGraphs
![Screenshot with logo and graphs](/logoViewWithGraphs.png?raw=true "displayType: 'logo', showGraphs: 'true'")#### Display type: logoWithChanges + showGraphs
![Screenshot with logo changes and graphs](/logoWithChangesAndGraphView.png?raw=true "displayType: 'logoWithChanges', showGraphs: 'true'")#### Display type: logo + coloredLogos + showGraphs
![Screenshot with logo](/logoColoredGraph.png?raw=true "displayType: 'logo', showGraphs: 'true', coloredLogos: true")## Cryptocurrency Logo
Logo provided only for the following currencies:
- Bitcoin, Bitcoin cash, Bitcoin gold, Bitcoin SV
- Ethereum, Ethereum classic
- Basic Attention Token
- Binance Coin
- Cardano
- Crypto.com Coin
- Dash
- Dogecoin
- Eos
- Iota
- Lisk
- Litecoin
- Monero
- Nano
- Nem
- Neo
- Polkadot
- Poken
- Ripple
- Shiba Inu
- Solana
- Stellar
- Stratis
- SwissBorg
- The graph
- Tron
- XRPFeel free to ask for support of your favorite currency. Else, just implement it (eg: to add Litecoin logo):
- Add `'litecoin'` to the currency module config
- Create the logo (png, 50x50px)
- Name the file `litecoin.png`
- Put it in the `/public/` `black-white/` and `colored` directory of the module
- Restart MagicMirror## Notes
Data provided by coinmarketcap.com.
- Endpoints update every 5 minutes.
- Currently you can only display currencies listed within top-25 on coinmarketcap.com.
- `significantDigits` only has a visible effect when set to 4 or more. It is useful for showing low-value coins (such as Ripple) at a higher resolution, rounding to more digits after the decimal point than the minimal 2. Rounding always keeps at least two digits after the decimal.## Feedback
It's my first module here after that I built a MagicMirror. I'm so proud of it and I have found a lot of interesting modules, including one similar to this, based on Bitcoin only MMM-bitcoin.
I am open to work on this project and to expand it to add other interesting features, and a bit of cool style too.
Leave me some feedback in the forum. Thank you!## Contributors
- Klizzy for translations and multiple currencies.
- olexs for currencies graphs and significant digits.
- mattdy for minimum/maximum fraction length on pricing, and refactor for new APIThe MIT License (MIT)
=====================Copyright © 2021 Matteo Danelli
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.**The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability,
fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability,
whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.**