balance-io / balance-manager

A tool to manage your wallets
https://manager.balance.io
GNU General Public License v3.0
143 stars 84 forks source link

📊 Expanded state on token balances #214

Open ricburton opened 6 years ago

ricburton commented 6 years ago
screen shot 2018-05-14 at 19 51 41

I have always thought it would be cool to see the value of all the tokens fluctuating over time like this. I'm imaging it being at the top of the balances page.

ricburton commented 6 years ago

I would love to integrate data from OnChainFX.com

expanded balances

https://onchainfx.com/asset/ethereum

ricburton commented 6 years ago

I think a good V1 here is to add data from https://trivial.co

Here is the API: http://telegra.ph/API-draft-06-06

ricburton commented 6 years ago

I also think adding this data set in would be great: https://github.com/MyEtherWallet/ethereum-lists/blob/master/tokens/tokens-eth.json

{
        "symbol": "BLT",
        "address": "0x107c4504cd79C5d2696Ea0030a8dD4e92601B82e",
        "decimals": 18,
        "name": "Bloom",
        "ens_address": "",
        "website": "https://hellobloom.io",
        "logo": {
            "src": "https://etherscan.io/token/images/hellobloom_28.png",
            "width": 28,
            "height": 28,
            "ipfs_hash": ""
        },
        "support": {
            "email": "team@hellobloom.io",
            "url": "https://hellobloom.io/faq"
        },
        "social": {
            "blog": "https://blog.hellobloom.io",
            "chat": "",
            "facebook": "https://facebook.com/bloomtoken",
            "forum": "",
            "github": "https://github.com/hellobloom",
            "gitter": "",
            "instagram": "",
            "linkedin": "",
            "reddit": "https://www.reddit.com/r/BloomToken",
            "slack": "https://slack.hellobloom.io",
            "telegram": "https://t.me/joinchat/FFWDdQ1hxqIg3jLe7zBVFQ",
            "twitter": "https://twitter.com/bloomtoken",
            "youtube": "https://www.youtube.com/channel/UCaMfVoHQzwX47XKUawWVCzg"
        }
    },
mfolkeseth commented 6 years ago

Cryptocompare seems to have a neat and open API for getting news https://min-api.cryptocompare.com/

mfolkeseth commented 6 years ago

Trivial changed their endpoint today. New docs https://docs.google.com/document/d/1ytiXg2XmNbAqK12ne5-Of104qP55d3F-TpNs1K5Vyzg/edit

ricburton commented 6 years ago

Thanks @mfolkeseth. Excited to play with this.

Polej commented 6 years ago

Hi,

I'm from Trivial and we're thinking quite seriously about expanding token balance information with data from our API ( https://docs.google.com/document/d/1ytiXg2XmNbAqK12ne5-Of104qP55d3F-TpNs1K5Vyzg/edit ).

Firstly we would like to add the simplest token data, e.g. our token description.

Is it ok for me to (try to :) ) do it or maybe you have your own idea how to do it?

mfolkeseth commented 6 years ago

Hi @Polej ,

Thanks for reaching out!

I'm sorry, but I'm not quite sure what you mean. Can you elaborate? You are already have a lot if information in your api, including token description.

EDIT: Ah, were you thinking about taking on this task?

Polej commented 6 years ago

I meant to modify the code of Balance Manager to load the data from the API. Both backend and frontend. But then I found out you already done it. Great! 👍

Is the issue with setting proxy connected with CORS (Cross-Origin-Resource-Sharing), AJAX-ing the data from another host?

mfolkeseth commented 6 years ago

That is correct, or, we needed to create a proxy to solve the problem below. Failed to load https://trivial.co/api/tokeninformation?token_address=0xf230b790e05390fc8295f4d3f60332c93bed42e2: The 'Access-Control-Allow-Origin' header has a value 'http://localhost:8080' that is not equal to the supplied origin. Origin 'https://localhost:3000' is therefore not allowed access.

Polej commented 6 years ago

I'll fix it

mfolkeseth commented 6 years ago

Thanks a lot!

By the way. I find your price chart and daily active users very neat. Any chance of exposing those data? And also. You also have a lot of other useful info on trivial.co like more than 2 news, discussions. Do you plan on expanding the public API in the future?

Polej commented 6 years ago

I think it should be fixed now. Not 100% sure, please test it :)

For this data I need to discuss with my team, I'll respond tomorrow. I think it is highly possible to share this data :)

mfolkeseth commented 6 years ago

Like a charm :) Thanks @Polej! You can follow the update on #269

ricburton commented 6 years ago

Can you post screenshots? I’m on mobile and eager to see it 🤗 On 12 Jun 2018, 03:31 -0400, Martin Folkeseth notifications@github.com, wrote:

Like a charm :) Thanks @Polej! You can follow the update on #269 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

mfolkeseth commented 6 years ago

Try one of your tokens at: https://deploy-preview-269--balance-manager.netlify.com/metamask

screen shot 2018-06-13 at 08 27 58

Polej commented 6 years ago

@mfolkeseth

By the way. I find your price chart and daily active users very neat. Any chance of exposing those data? And also. You also have a lot of other useful info on trivial.co like more than 2 news, discussions. Do you plan on expanding the public API in the future?

Yes we may expand API in the nearest future, probably even this week. It's nice to see first use in such short time.

What data do you need?

  1. Price chart data
  2. Daily active users chart data
  3. More news (how much?)
  4. Discussions (how much?) Maybe anything else?

I'm trying to group all the requests in one place and find out what to add in the next iteration.

mfolkeseth commented 6 years ago

Maybe you can weigh in here @ricburton ? If we are going to have discussions and more news, it would be useful to have pagination.

ricburton commented 6 years ago

This is a great start! Today is a launch day so we're busy with that. Will think on all this more.

Thanks for all your hard work :)

Richard

Sent via Superhuman ( https://sprh.mn/?vip=richard@balance.io )

On Wed, Jun 13, 2018 at 08:02:23, Martin Folkeseth < notifications@github.com > wrote:

Maybe you can weigh in here @ ricburton ( https://github.com/ricburton ) ? If we are going to have discussions and more news it would be nice useful to have pagination.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub ( https://github.com/balance-io/balance-manager/issues/214#issuecomment-396913228 ) , or mute the thread ( https://github.com/notifications/unsubscribe-auth/AAavkGCa1euJqCYoMzudlNQxtVK64uz5ks5t8P9PgaJpZM4T-r7p ).

mfolkeseth commented 6 years ago

@Polej, by the way. Any chance this API can return similar information about ethereum itself?

Polej commented 6 years ago

@mfolkeseth We are currently working on ethereum data.

Polej commented 6 years ago

At this moment our API has been a bit updated (to give results for ETH), but we don't collect much data about it yet.

Ethereum data is accessible here: (token_address=eth or ETH) https://trivial.co/api/tokeninformation?token_address=eth

Many of the API fields are nulled now, we will gradually add them.

The reason to post this small API change is to give you, @mfolkeseth a possibility to update the Balance Manager build. Maybe the crash was because of lacking ETH data? Hope it will somehow solve the problem.

mfolkeseth commented 6 years ago

Really great stuff! I will try to make some changes to the build over the weekend to include ETH.

The cause of the crash was due in a proxy which was not included in the build. Will fix that also. I’ll let you know once I make the changes. Thanks!

mfolkeseth commented 6 years ago

@ricburton how about using the same toggle function as transactions? I like it!

Polej commented 6 years ago

Hello, a little update: Trivial.co now shares price chart and daily active users chart data for tokens (as seen on our token page, for example here https://trivial.co/t/0xf230b790e05390fc8295f4d3f60332c93bed42e2 )

Price chart data is accessible at /api/token-price-chart with GET parameter token_address (address of token smart contract on Ethereum network): Example: https://trivial.co/api/token-price-chart?token_address=0xf230b790e05390fc8295f4d3f60332c93bed42e2

Daily active users chart data is accessible at /api/daily-active-chart with GET parameter token_address: Example: https://trivial.co/api/daily-active-chart?token_address=0xf230b790e05390fc8295f4d3f60332c93bed42e2

Please let me know if there are any issues :)

ricburton commented 6 years ago

Damn this is cool.

Cannot wait to integrate this more deeply.

Richard

Sent via Superhuman ( https://sprh.mn/?vip=richard@balance.io )

On Mon, Jun 18, 2018 at 4:36 AM, Polej < notifications@github.com > wrote:

Hello, a little update: Trivial. co ( http://trivial.co/ ) now shares price chart and daily active users chart data for tokens (as seen on our token page, for example here https:/ / trivial. co/ t/ 0xf230b790e05390fc8295f4d3f60332c93bed42e2 ( https://trivial.co/t/0xf230b790e05390fc8295f4d3f60332c93bed42e2 ) )

Price chart data is accessible at /api/token-price-chart with GET parameter token_address (address of token smart contract on Ethereum network): Example: https:/ / trivial. co/ api/ token-price-chart?token_address=0xf230b790e05390fc8295f4d3f60332c93bed42e2 ( https://trivial.co/api/token-price-chart?token_address=0xf230b790e05390fc8295f4d3f60332c93bed42e2 )

Daily active users chart data is accessible at /api/daily-active-chart with GET parameter token_address : Example: https:/ / trivial. co/ api/ daily-active-chart?token_address=0xf230b790e05390fc8295f4d3f60332c93bed42e2 ( https://trivial.co/api/daily-active-chart?token_address=0xf230b790e05390fc8295f4d3f60332c93bed42e2 )

Please let me know if there are any issues :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub ( https://github.com/balance-io/balance-manager/issues/214#issuecomment-398025715 ) , or mute the thread ( https://github.com/notifications/unsubscribe-auth/AAavkPBoU09bSthAnpv4Iuqw3h8Sh3oiks5t95DYgaJpZM4T-r7p ).

mfolkeseth commented 6 years ago

A little later than anticipated but the new integration is here #311.

Will update daily active users and price charts to the pull request soon. Real nice work @Polej!

ricburton commented 6 years ago

Out right now but stoked to see this.

Any screenshots? :) On 18 Jun 2018, 18:51 -0400, Martin Folkeseth notifications@github.com, wrote:

A little later than anticipated but the new integration is here #311. Will update daily active users and price charts to the pull request soon. Real nice work @Polej! — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

mfolkeseth commented 6 years ago

The build went trough on the PR, so the preview is up if you wanna look around. Here is a screenshot. My plan is to add the price charts on to the right.

screen shot 2018-06-19 at 00 43 42
Polej commented 6 years ago

Amazing, looks brilliant @mfolkeseth ! <3

ricburton commented 6 years ago

This is fantastic! Thank you so much to both of you.

Cannot wait to play around with this :) On 19 Jun 2018, 06:03 -0400, Polej notifications@github.com, wrote:

Amazing, looks brilliant @mfolkeseth ! <3 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

mfolkeseth commented 6 years ago

Added some graphs for active users and price via recharts.

Some feedback @Polej. I see that the price charts endpoint returns empty array for tokens that have no data, whereas eth gets null value. I think it would be beneficial to return the same value for the same result to avoid unexpected behaviour and unnecessary checks.

Also, would it be possible to have price charts and active users as includes for the token info endpoint? That way we don't have to make multiple request.

All in all, the API is damn good to work with and responds really fast! 🎊

Big screen

screen shot 2018-06-19 at 12 44 04

Smaller screen

screen shot 2018-06-19 at 12 44 24
ricburton commented 6 years ago

This is absolutely incredible! Amazing work. ❤️

We need a warning for TRON though. 🤓 On 19 Jun 2018, 07:08 -0400, Martin Folkeseth notifications@github.com, wrote:

Added some graphs for active users and price via recharts. Some feedback @Polej. I see that the price charts endpoint returns empty array for tokens that have no data, whereas eth gets null value. I think it would be beneficial to return the same value for the same result to avoid unexpected behaviour and unnecessary checks. Also, would it be possible to have price charts and active users as includes for the token info endpoint? That way we don't have to make multiple request. But all in all, the API is great to work with and responds really fast. Big screen Smaller screen — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Polej commented 6 years ago

@mfolkeseth Thanks for the work! And thanks for the feedback. I'll take your hints into consideration, not sure how quickly though :) Putting it on high priority.

About price chart/DAU chart data inside /tokeninformation/ : Current design is motivated by the fact that not everyone using API will need all the data. However your argument is very important, doing everything in one request may be very helpful.

Maybe a compromise, a Golden mean solution will suit our needs: Passing additional parameter(s) like price_chart_data=true and/or dau_chart_data=true will fill additional fields.

What do you think about such solution?

mfolkeseth commented 6 years ago

@Polej yes, my thoughts exactly. I just didn't explain it very well 😃 Let's go with that 👍

I totally agree with your initial design about not sending too data over the wire unnecessarily. That's an approach I personally embrace, in all API's, especially in our case where the client requests the API directly.

Thanks again for being so on to this. It has made the integration way smoother and pleasant.

Polej commented 6 years ago

Ok, now there are 3 new GET parameters:

price_chart_data - setting it to 1 or True or true gives non-null field 'price_by_day' with price chart data (just like in /api/token-price-chart/), when default the field 'price_by_day' is null

dau_chart_data - setting it to 1 or True or true gives non-null field 'daily_active_by_day' with daily active users (DAU) chart data (just like in /api/daily-active-chart/), when default the field 'daily_active_by_day' is null

news_count - you can set how many news items are given, default is 4, if you don't need any news set it to 0, max is 10 (setting more gives at most 10)

Example: https://trivial.co/api/token-information?token_address=0xb5a5f22694352c15b00323844ad545abb2b11028&dau_chart_data=1&price_chart_data=True&news_count=15

Little tweak of api route: now you should use /api/token-information, with hyphen -, but old version will still work.

ricburton commented 6 years ago

Thanks @Polej. This is going to be great.

Are you working on highlighting the disastrous projects like EOS? We are happy to do that.

ricburton commented 6 years ago

This thread is amazing: https://twitter.com/blockchainjoy/status/1009136079096541184

Some highlights:

Polej commented 6 years ago

@ricburton We don’t plan to add this at the moment, however we’re planning implementation of commenting box, where people can add comments like this one, and this will come alive pretty soon.

And to both of you @ricburton and @mfolkeseth , would it be possible to place a link to our token site "For more information visit Trivial.co", just like this one?

screen shot 2018-06-20 at 11 40 46
ricburton commented 6 years ago

I would love to expose the data source. I think this is great.

Richard

Sent via Superhuman ( https://sprh.mn/?vip=richard@balance.io )

On Wed, Jun 20, 2018 at 06:02:07, Polej < notifications@github.com > wrote:

@ ricburton ( https://github.com/ricburton ) We don’t plan to add this at the moment, however we’re planning implementation of commenting box, where people can add comments like this one, and this will come alive pretty soon.

And to both of you @ ricburton ( https://github.com/ricburton ) and @ mfolkeseth ( https://github.com/mfolkeseth ) , would it be possible to place a link to our token site "For more information visit Trivial. co ( http://trivial.co/ ) ", just like this one?

screen shot 2018-06-20 at 11 40 46 ( https://user-images.githubusercontent.com/2440412/41651715-7ef9444a-7481-11e8-929a-2bebc819a2a1.png )

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub ( https://github.com/balance-io/balance-manager/issues/214#issuecomment-398695185 ) , or mute the thread ( https://github.com/notifications/unsubscribe-auth/AAavkEC74AVZqq3W0tkkYml035IhPpRVks5t-h2fgaJpZM4T-r7p ).

mfolkeseth commented 6 years ago

@Polej of cource :) what is the address of that image? Maybe it’s better for you to have it on your side, rather than that every consumer app implements their own? If you want them to look similar I mean. Although it’s totally up to you 👍

mfolkeseth commented 6 years ago

@ricburton I’m keen to hear your thoughts or goal on how sophisticated the token info graphs should be.

ricburton commented 6 years ago

@mfolkeseth I will keep thinking on this. I am not 100% sure at the moment. Just love seeing this different data. So handy.

@christianbaroni any thoughts here?

Polej commented 6 years ago

@mfolkeseth The image button path is https://trivial.co/static/for_more_info.png It should link to https://trivial.co/t/ API gives this URL in a field "token_page", or you can construct it from "address" (token eth address)

The image will probably (slightly) change, we need to work on it a bit more.

mfolkeseth commented 6 years ago

@Polej alright, so I've updated the api route to /api/token-information. No need to keep it deprecated, for us at least 😄 I have also replaced three requests to use just one, with include parameters instead.

As for the more visual changes, I've also added the data source link to trivial.co.

You can view the last build here: https://deploy-preview-311--balance-manager.netlify.com

Big screen screen shot 2018-06-22 at 16 52 54

Small screen screen shot 2018-06-22 at 16 53 34

Polej commented 6 years ago

@mfolkeseth Very good! Our need of linking to our site is satisfied :) Also good to hear about API use changes.

Amazing work!

ricburton commented 6 years ago

This is awesome! Amazing work. 

@jinchung is back on Monday <3

Richard

Sent via Superhuman ( https://sprh.mn/?vip=richard@balance.io )

On Fri, Jun 22, 2018 at 11:46:49, Polej < notifications@github.com > wrote:

@ mfolkeseth ( https://github.com/mfolkeseth ) Very good! Our need of linking to our site is satisfied :) Also good to hear about API use changes.

Amazing work!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub ( https://github.com/balance-io/balance-manager/issues/214#issuecomment-399487326 ) , or mute the thread ( https://github.com/notifications/unsubscribe-auth/AAavkBoEntkpSyhN9jEh721sLOnsQJSTks5t_RFpgaJpZM4T-r7p ).

Polej commented 6 years ago

Hey @mfolkeseth, I've discovered bug when clicking on ETH, it looks the same as before: black screen.

@ricburton How much possible is deploying these features to master (after fixing this bug)? :)

mfolkeseth commented 6 years ago

@Polej thanks for the report. I'll look into it this evening. Cheers.

mfolkeseth commented 6 years ago

@Polej Turns out the reason why Ethereum crashed the app in this particular case was that there was no check whether the news object had source or not. Turns out some of them are null :) So I added a check for that and the app is working just fine.

One question tho; what's up with the date formats? I saw that the graphs and news have separate date formats (number for graphs and some other string format for news). In both cases date-fns@alpha-11 has trouble parsing those. This may be date-fns's problem, but either way, is it possible to look into this and use a common format that works for all platforms?

Other changes: