Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:add USN swap page and USN to the list of tokens (#2) #2568

Closed
wants to merge 20 commits into from

Conversation

OlegYak
Copy link
Contributor

@OlegYak OlegYak commented Apr 5, 2022

This PR is part of an effort to include the USN contract.

This PR gives the wallet the right to use USN tokens, exchange them for NEAR and vice versa.

Main changes:

  1.Added a list of tokens and their total balance.
  2.Added swap page.
  3.Added a button to go to the swap page. 
  4.Added token exchange functionality.

Screenshot from 2022-04-05 21-25-42
Screenshot from 2022-04-05 21-26-06

* feat:add swap page and functionality

* feat/added changes UI in wallet, added feeature-flag

* feat/added CREATT_USN_FLAG

Co-authored-by: OlegYak <[email protected]>
@netlify
Copy link

netlify bot commented Apr 5, 2022

👷 Deploy request for near-wallet-staging pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit dca0fc3

@agileurbanite agileurbanite requested review from Patrick1904, MaximusHaximus and esaminu and removed request for Patrick1904 April 6, 2022 17:06
@esaminu
Copy link
Contributor

esaminu commented Apr 6, 2022

@OlegYak Could you link the smart contract code for usdn.testnet here as well please?

Copy link
Contributor

@esaminu esaminu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on first pass 👍 . Left some comments on fetching logic, slice shape and other comments re props etc.

I found a bunch of typos. Please make sure to check the changes for any typos and correct them.

Also please rebase the branch when complete 😄

packages/frontend/src/components/Routing.js Outdated Show resolved Hide resolved
packages/frontend/src/components/Routing.js Outdated Show resolved Hide resolved
packages/frontend/src/redux/slices/tokens/index.js Outdated Show resolved Hide resolved
[
selectAllContractMetadata,
selectOwnedTokensForAccount,
selectUSDNTokenFiatValueUSD,
Copy link
Contributor

@esaminu esaminu Apr 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be more generic fiat data selector once we add configurable fetching for token fiat values per #2568 (comment)

packages/frontend/src/redux/slices/multiplier/index.js Outdated Show resolved Hide resolved
@esaminu
Copy link
Contributor

esaminu commented Apr 12, 2022

There's some design issues I see with the current implementation:
Screen Shot 2022-04-13 at 12 57 58 AM

There is also no clear indication that the text field in the From section is editable but it's auto selected when you navigate.

cc: @corwinharrell

@heycorwin
Copy link
Contributor

@agileurbanite @nall-near @esaminu Just wanted to flag here that Jacob has been working on designs for swaps which are set to be implemented for NEAR <> wNEAR. We'll want to make sure that any work such as this falls inline with what has already been done so we aren't implementing two of the same thing. Not sure what the best course of action is with regards to this issue in particular but will leave that up to you all 🙌

Copy link
Contributor

@esaminu esaminu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 left a few more comments

packages/frontend/src/components/wallet/Wallet.js Outdated Show resolved Hide resolved
packages/frontend/src/components/wallet/TokenBox.js Outdated Show resolved Hide resolved
packages/frontend/src/components/common/balance/helpers.js Outdated Show resolved Hide resolved
packages/frontend/src/components/svg/SwapIcon.js Outdated Show resolved Hide resolved
packages/frontend/src/components/svg/SwapIconTwoArrows.js Outdated Show resolved Hide resolved
@esaminu esaminu mentioned this pull request Apr 18, 2022
Copy link
Contributor

@esaminu esaminu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment regarding a bug with fiat amount display. Also found some UI glitches on Wallet component swap buttons when switching to a few languages. Please investigate and address 👍 :

image

packages/frontend/src/components/wallet/TokenAmount.js Outdated Show resolved Hide resolved
@nall-near
Copy link

nall-near commented Apr 18, 2022

HI

@think-in-universe
Copy link
Member

think-in-universe commented Apr 21, 2022

never mind. please ignore my comments. just realized the swap feature is already merged in #2583

@agileurbanite
Copy link
Contributor

@esaminu we can close this PR right given your PR merged in?

@esaminu
Copy link
Contributor

esaminu commented Apr 21, 2022

Adopted and merged in #2583. Closing this, Thanks @OlegYak!

@esaminu esaminu closed this Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants