glitch452 / MMM-CoinMarketCap

A MagicMirror² module that displays cryptocurrency information from the Coin Market Cap website.
MIT License
36 stars 11 forks source link

Portfolio #14

Open yceballost opened 3 years ago

yceballost commented 3 years ago

Hi there,

Thanks for the module.

Can I see my portfolio profits?

Thanks!

adelineas commented 2 years ago

I have made a few small modifications for myself. So I see the total amount of my coins. Only in USD an and other configurations are not tested.

config.js

currencies: ['bitcoin', 'vechain', 'cardano', 'adax', 'xrp'],
wallet: [0.56,5802,920.78,112.6,2.044],   // enter the number of coins you have here
view: 'graphWithChanges',
conversion: 'USD',
graphColored: false,
showColumnHeaders: true,
columns: [ 'logo', 'name', 'price', 'changes', 'graph' ],
significantDigits: 0,
decimalPlaces: 7,
graphRange: 1,
fontSize: 'x-small'

MMM-CoinMarketCap.js

add code in row 22

wallet:  [ 1, 1027 ],   // add row

change row 563

row.appendChild(self.getCell(self.config.columns[i], c, k));  // add parameter k

change row 609

getCell: function(colType, currency, wid) {  // add parameter wid

add code in 623

var mywallet = price * self.config.wallet[wid]; // add row

change row 627

if (currency.showCurrencyWithPrice) { cell.innerHTML += " " + self.config.conversion + "<br>Wallet " + mywallet.toFixed(2) + " $ USD"; }

best regards Andreas

yceballost commented 2 years ago

works like a charm! Thanks a lot!