beamer-bridge / beamer

Beamer - Bridging rollups with L1 inherited security
https://beamerbridge.com
MIT License
45 stars 21 forks source link

frontend: check liquidity on target chain #2143

Closed manuelwedler closed 1 year ago

manuelwedler commented 1 year ago

closes #2141

Disables transfer button if not enough liquidity on target chain. Checks against the liquidity provider with the highest amount of tokens. Agent addresses are hardcoded.

I started to refactor our provider classes a little in the way it was discussed earlier. It was much easier to implement this functionality when having an option to create providers from an rpc url. This allows now to get rid of many of the JsonRpcProvider objects. Ideally we would have a central place (a store) with one provider per chain which use our internal rpc urls.

GabrielBuragev commented 1 year ago

In order to provide a comprehensive solution for displaying the "time to expire" text i used the date-fns library. It doesn't add much overhead (13.82kb gzipped) as it is tree-shaked on build-time. Here is the result of the build analyze: Screenshot 2023-08-23 at 11 26 28

GabrielBuragev commented 1 year ago

@DBecane @andfletcher Here is an overview of the displayed text:

Screenshot 2023-08-23 at 09 54 24

Please let me know if this is fine by giving a thumbs up or otherwise leave your suggestions.