burner-wallet / burner-wallet-2

A modular, extendable Burner Wallet
MIT License
87 stars 36 forks source link

Display loading component in exchange operations #21

Closed patitonar closed 4 years ago

patitonar commented 4 years ago

Relates to https://github.com/burner-wallet/burner-wallet-2/issues/6

This PR updates the exchange plugin to display a Loading component (similar to transfer operations) when exchanging assets.

I added a custom loading message property to the Pairs. It is useful especially for pairs that use a bridge, so the user can be properly informed that it requires some time to finish the operation.

Also, I refactored the XDaiBridge component, to extract the common functionality of bridges to a separate Bridge class, so new bridges pairs can be added easily.

Finally, the bridge exchange operations were updated to resolve when the asset from the other network is transferred to the user instead of when the transaction of the user is mined. This allows displaying the Loading component all the time until the assets are relayed by the bridge.

bridgeLoading