JoinSEEDS / seeds_light_wallet

http://www.joinseeds.earth/
MIT License
45 stars 23 forks source link

Integrate LW with tmastr.seeds master token list (redux) #1880

Closed chuck-h closed 2 years ago

chuck-h commented 2 years ago

πŸ—ƒ Github Issue Or Explanation for this PR. (What is it supposed to do and Why is needed)

Issue #1759 Also ref Pull #1870 (pulled from chuck-h git repo)

βœ… Checklist

πŸ•΅οΈβ€β™‚οΈ Notes for Code Reviewer

Technical explanations to help your peers review your work - including environments, credentials, etc. The principal changes are

  1. install featureFlagMasterTokenList to enable/disable use of the master token list contract
  2. create a datasource http api to pull token model metadata from tmastr.seeds contract. (tmastr latest merge was https://github.com/JoinSEEDS/seeds-smart-contracts/pull/471 ). Metadata is served from tmastr as explicit fields (e.g. contract, token symbol) combined with JSON data (e.g. logo image url). Only the SEEDS token is handled as a hard-coded model in the token_models.dart file; all others (e.g. HYPHA, TLOS, STARS) are imported from tmastr.seeds. (However, if the feature flag is disabled, the old hard-coded token models are used.)
  3. define a JSON schema and use it to validate the metadata set from the tmastr contract. This schema is loaded from a table in the tmastr.seeds contract.
  4. Support logo and background images served from general web urls, in addition to LW assets. TBD: expand schema to allow two or more alternative sources, e.g. asset & url? Also TBD: check error handling when web image access times out.
  5. Support "Seeds ecosystem approved token" concept recommended by Seeds Currency Working Group.
  6. Support an "experimental" token usecase which displays a warning banner
  7. Make the code "token contract aware" so that it does not assume that token symbols are unique over the Telos blockchain.

Note tmastr.seeds is not yet deployed to mainnet; for testing purposes seeds_scopes.dart references rainboissuer (a random mainnet account I own) where I have installed the tokensmaster contract.

πŸ™ˆ Screenshots

For all UI changes

token balance card with "approved" mark and "experimental" banner send token screen
Clipboard-1 image

On small screen (480x800) LWCurrency480x800

πŸ‘―β€β™€οΈ Paired with

"nobody" yet but I would benefit from having a partner

chuck-h commented 2 years ago

@n13 @gguijarro-c-chwy I think I've fixed everything that needed fixing, can you take another look? I'd love to see this in 2.9.1 !

buildc0de commented 2 years ago

βœ… Test Case 1

  1. Run the app.
  2. Observe the token cards.

As discussed in the meeting on Jun 28, nothing else to test at this point. We will place the feature behind a flag and fall back to the previous logic in case of any issues.

chuck-h commented 2 years ago

Re: test case. Some "previous logic" has been reimplemented, so I suggest under step 2:

make sure all the old cards appear (SEEDS, HUSD, HYPHA, LSCL, STARS, TLOS) verify fiat conversion behavior where present perform send and receive actions for at least one token @buildc0de