Closed kcole16 closed 3 years ago
@vgrichina could you post the simple schema for tokens and their contracts that we had talked about? Just need to get a basic sense of hierarchy and parent-child relationship between tokens and their contracts to inform how they might be displayed in the UI.
Following is a summary of the proposed initial design changes for the wallet. Note that while the changes being proposed in direct relation to the need to display fungible token balances are few, there are other high level changes being proposed that occur downstream (eg navigation / information architecture). These changes act as the first steps towards improving the overall information architecture of the wallet in order to be more accommodating of upcoming functionality around portfolio and asset management. Additional tweaks are suggested to the UI to make navigating through and interacting with the wallet and it's core feature set a more user friendly experience.
For the first iteration of displaying balances of fungible tokens in the wallet, the aim is to keep the feature-set small, and make improvements across the board in preparation for future iterations where functionality around managing your assets becomes more robust. This iteration's changes regarding fungible token balances are limited to their display. At this point, a user can only view the balances of their fungible tokens, and cannot interact with them in the wallet. Additional functionality will follow once these changes are in place.
The primary proposed changes are as follows:
/summary
summary
to highlight NEAR as the primary asset, with other tokens being labeled as secondary.Send
and Receive
to the main wallet view in order to highlight them as core wallet functions, and paving the way for additional functions to be added in a scalable manner./summary
to "Account Settings". Moving forward, the primary function of "Account Settings" will be to house functions related to security, authentication, and other admin functions not related to core wallet features.If this is something we would like to include in this iteration, I am happy to design the view as soon as we can confirm what metadata we would have available.
There are certainly some things here up for debate as far as what fits into the scope of this work, so we can certainly adjust or extract work as necessary depending on scope.
I agree with the proposed solution.
I have minor concerns/queries on the following items:
lockup
and staked
tokens as accounts (similar to BNNA
and AVDO
) since their liquidity and balance are subject to additional rules. This decision would let us explore the UX of controlling the assets (as you proposed, cumulative value and performance). Cc @vgrichina - since it might need to have them listed hereRe: "Approved Apps", this list is a list of applications that you have already authenticated and used, and that currently have permission to interface with your wallet account. While related, I view this more as an authentication setting than identical to the issue of creating an opportunity for new users to find apps that they might like to use. In the case of this issue, I'm simply proposing we relocate the list of authenticated applications to the profile, where similar authentication settings can be found.
I like the proposed solution!
Re: #7 (authorized apps to /profile
), we do have the page /authorized-apps
, and we could consider directing users to this page more explicitly rather than adding this section to the /profile
page.
Re: token display, we should consider showing the actual token account name as well, as we have the benefit over Ethereum of this name being human readable and potentially useful for verification (though there are some phishing vectors here).
Timing is my only other concern. If we feel confident we can implement the above in ~2-3 weeks, let's go for it. Otherwise, we should consider how best to implement it iteratively to meet the goal of launching token support by March 1 or so.
Re: token display, we should consider showing the actual token account name as well, as we have the benefit over Ethereum of this name being human readable and potentially useful for verification (though there are some phishing vectors here).
Happy to work this in, although I'm curious to hear articulated what we think the biggest benefit is to displaying outside of a "details" or "metadata" view?
Timing is my only other concern. If we feel confident we can implement the above in ~2-3 weeks, let's go for it. Otherwise, we should consider how best to implement it iteratively to meet the goal of launching token support by March 1 or so.
Yes absolutely, I'll have @vgrichina and @Patrick1904 weigh in here. If we think this is out of scope for the proposed timeline, please suggest which elements we think would be best to omit.
Timing is my only other concern. If we feel confident we can implement the above in ~2-3 weeks, let's go for it. Otherwise, we should consider how best to implement it iteratively to meet the goal of launching token support by March 1 or so.
IMO we should go with the absolute lowest lift solution this first implementation considering no work has been done so far on this and since we need it in by March 1. It's very soon. We could ship a more fancy v2 a week or two after initial version.
@Patrick1904 yep I'm on board with this approach. Please specify what you believe should be trimmed / is out of scope.
@corwinharrell how about for V0 we implement the portfolio/wallet screen and the activity screen? Also, should we include activity on the wallet page vs stand alone, as it's the 'default' page? Essentially put activity below the secondary assets. Personally I look at the activity feed quite a lot and would prefer to not have to navigate to a separate page for it.
sorry that this wasn't very clear in https://gist.github.com/vgrichina/f39623e3cc80b3a4d36fc8eb81a49374
but basically we don't really have a master list of tokens what we have is a list of contracts that user interacted with (and potentially that have been sent to user)
the only part in the data that we for sure can trust is contract account ID
everything besides contract account ID is returned by the contract and so can potentially be spoofed by the contract (user has to trust specific contract to use it). There can be balances of the same type of token in multiple different contracts as well.
so the structure is more like this:
basically we have multiple contract each supposedly having multiple assets in it we cannot easily have a flat list of assets given what is actually on chain
even if we hardcode for fungible tokens only assuming that we only have one balance per contract – we have to surface actual contract IDs, as basically anybody can make their contract return BNNA
as token symbol
Token whitelist would solve the security aspect of trusting token symbol. However I think we shouldn't build a system that is only scalable for whitelisted tokens, as it seriously limits adoption of any new tokens. Like basically social tokens won't stand a chance in such system.
This also doesn't scale for our existing apps like Berry Club which have multiple balances per contract.
Small refactor to how activity items are displayed in order to make them easier to consume and scan.
We also need to look into how to display activity with fungible tokens, as right now these would basically be pretty opaque function calls.
what we have is a list of contracts that user interacted with (and potentially that have been sent to user)
WIP for it on backend is here https://github.com/near/near-contract-helper/pull/322/files
@vgrichina thanks for the clarification. I was definitely working off an incorrect set of assumptions based on your first example. Here's a thought and a question. It's clear that since the way we access fungible token balances isn't via a whitelist, we can't simply display tokens as they would appear say, on an exchange. There is benefit though to adhering to a similar model when it comes to displaying them in the context of the wallet, just because it's what people are used to seeing, and it's in our best interest not to introduce too many new concepts and mental models. I'm curious if there's a middle ground to be struck here. Would it be possible to display tokens on the wallet screen as a list, but then make sure to denote the contract to which they belong? Here's an example:
Since multiple contracts can contain the same token, I'm wondering if we can work in this direction, and then provide a breakdown of how your tokens may be distributed. To explain further, here's an example:
The reason I favor this approach is that it bubbles up to a "total" on the top level screen, where a user is most likely less concerned with contract details, and more concerned with token balances and the cumulative value of their portfolio. Then if they need to see details, it makes sense for them to drill down to see exactly which contracts of theirs hold that asset.
My biggest assumption in all of this is that we can aggregate token balances from multiple contracts in order to display them on the summary view. This is different from a "whitelist", since the token balances are extracted from existing contracts, and are only aggregated if their data matches.
I could be totally off base here if my understanding is still flawed, so just let me know if there are any holes in this thinking. Will defer to you to determine feasibility of each component.
I support @corwinharrell 's approach, but we still need to solve the "false BNNA problem", where the user is using a contract claiming to host BNNAs, but they are fake.
Note on what this project includes:
@Patrick1904 @marcinbodnar please be vocal and ruthless about scoping this stuff down. Several of these are not essential to displaying fungible token balances, but rather are downstream changes which we can afford to make after the current sprint. They improve the experience quite a bit, but shouldn't prevent us from meeting the March 1 deadline. Only commit to what you feel comfortable taking on.
Closing as this has been released in https://github.com/near/near-wallet/pull/1551
Overview
The first story of #456 is enabling users to view their balances of NEP-21 tokens. The scope of this issue is limited to a token whitelist, which we should create.
Acceptance Criteria
Design
https://www.figma.com/file/MOMOnm89esHGC4PMKDBEDw/Fungible-Token-Balances?node-id=0%3A1