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

EVM bridge with design #164

Merged
merged 60 commits into from
Sep 5, 2023
Merged

EVM bridge with design #164

merged 60 commits into from
Sep 5, 2023

Conversation

dafuga
Copy link
Contributor

@dafuga dafuga commented Jun 30, 2023

No description provided.

@dafuga dafuga changed the base branch from dev to evm-bridge June 30, 2023 00:16
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jun 30, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 79d5ff5
Status: ✅  Deploy successful!
Preview URL: https://3428fb69.wallet-2tl.pages.dev
Branch Preview URL: https://evm-bridge-with-design.wallet-2tl.pages.dev

View logs

@dafuga dafuga marked this pull request as ready for review June 30, 2023 17:08
@dafuga dafuga changed the title Evm bridge with design EVM bridge with design Jun 30, 2023
@dafuga dafuga requested a review from aaroncox June 30, 2023 17:08
@aaroncox
Copy link
Member

Yeah, my bad, I'll put a border with radius like in the design.

You are ok with the values that are displayed though, right? I don't know if we need to show the memo field and I also think that the fee and received amounts are pretty important.

Yeah, I think the values are probably fine. It's just purely the styles here, being the border, spacing, fonts, etc. It looks completely unstyled at the moment

@aaroncox
Copy link
Member

I think it might be because it takes a while for the balance to get updated. If you leave the page opened for a bit, does the correct balance end up being displayed?

I thought we actually had caching somewhere in Unicove to prevent spamming the APIs, and we had some way to invalidate that 🤔

Not sure though now that you say this. It does eventually update, it just takes like 15-30 seconds or something

@aaroncox
Copy link
Member

That's because the native -> evm transaction uses the common TxFollower component which we can't use for evm -> native transactions. I can make an EvmTxFollower component that looks similar to the native one, but it will be a bit different.

My main concern was that it's just completely unstyled. The design has a specific look to it that we should make the EvmTxFollower match

@aaroncox
Copy link
Member

I actually started off doing it this way, but it didn't work in situations where the entire balance is transferred because some amount needs to be left over to pay the transfer fees 😄 One option would be to calculate the fee on the form page and deduct it from the maximum amount that the user can withdraw. I figured that that could be confusing for some users though which is why I opted for the current implementation (which is also simpler to implement).

Calculating on the form field when the user clicks "Send entire balance" is probably the cleanest way to make both scenarios work 🤔

Maybe what we need is on the right side of the form, we show a status change, that then shows the total. So below the "to" field it then shows:

  • Amount Received
  • Fee
  • Total transferred

Then that "total transferred" field will match the entire balance, and the amount received will be accurate.

However when a user inputs a specific number (1 for example), it'll show:

  • Amount Received: 1
  • Fee: 0.0120
  • Total transferred: 1.0120

@aaroncox
Copy link
Member

aaroncox commented Sep 5, 2023

Whenever I first load into the page with a fresh session, I get errors. This is a browser without metamask, but we should still handle this since just loading into an error isn't a good experience.

image

@aaroncox
Copy link
Member

aaroncox commented Sep 5, 2023

When typing in an amount greater than my balance from EVM to Native, simply by typing it throws an error and pulls me away from the form. Typing shouldn't cause this error to appear like that.

image

@dafuga dafuga changed the base branch from evm-bridge to dev September 5, 2023 15:20
@dafuga dafuga merged commit f76005f into dev Sep 5, 2023
2 checks passed
@dafuga dafuga deleted the evm-bridge-with-design branch September 5, 2023 15:25
aaroncox added a commit that referenced this pull request Sep 22, 2023
* chore: added evm-bridge page

* chore: added link to evm-swap page

* chore: added native swap page

* chore: added evmToNativeTransfer section

* fix: getting the /evm/swap pages working

* refactor: renamed transfer functions

* chore: styled the evm swap page

* fix: got the native to evm swap working

* fix: got the evm section working

* style: linted

* Removed package-lock.json and rebuilt yarn.lock

* refactor: moved evm logic to separate file

* fix: getting site building

* enhancement: polishing swap page

* enhancement: polishing of the swap page form

* chore: moved select to element component

* enhancement: polishing of the swap confirm page

* enhancement: added EOS native balance

* enhancement: added EVM EOS balance

* enhancement: added basic validation

* enhancement: better error handling

* enhancement: polished the swap success page

* enhancement: general polishing of evm bridge

* style: linted

* enhancement: polished the error page

* enhancement: connecting to evm wallet on page load

* chore: trying to connect to eth wallet automatically every 3 seconds

* enhancement: general polishing of new transfer page

* enhancement: making transfer confirm screen bigger

* enhancement: clearing the form when changing active session

* refactor: using from and to instead of transferOption

* enhancement: using the token selector to let users select account

* fix: getting the token selector working with evm swap form

* enhancement: general polishing of evm swap form

* enhancement: added selectedToken to TokenSelector

* fix: only allowing form submission once both from and to tokens are selected

* enhancement: making the evm swap section look decent on mobile

* style: linted

* enhancement: added ability to pass string instead of balance

* fix: removed border on transfer confirm page

* chore: using /send and /transfer as urls

* fix: preventing submit if not connected to evm wallet

* enhancement: displaying fee amount on confirmation page

* fix: handling useEntireBalance case gracefully

* style: linted

* enhancement: making sure that evm provider is always accessible

* enhancement: updating the balances after transfer

* style: linted

* enhancement: adding fee to transfer amount as opposed to removing it

* chore: displaying fee and net amount in form

* enhancement: styled the confirm page

* enhancement: calculating fee every time an input changes

* enhancement: useEntireBalance now takes into account transferFee

* enhancement: displaying error when funds are insufficient to cover the transfer fee

* chore: added EvmTxFollower component

* enhancement: adding customization props to TxFollower components

* fix: resetting the form properly when appropriate

* chore: displaying usd prices on confirm page

* enhancement: displaying EOS token on confirmation page

* style: linted

---------

Co-authored-by: Aaron Cox <[email protected]>
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.

2 participants