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.
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.