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

Ref: Swap crypto #429

Merged
merged 6 commits into from
Oct 7, 2022
Merged

Ref: Swap crypto #429

merged 6 commits into from
Oct 7, 2022

Conversation

Gamboster
Copy link
Collaborator

@Gamboster Gamboster commented Oct 3, 2022

In this PR:

  • Refactor amount limits to be able to see them inside the Amount modal
  • New maximum button "MAX" inside the Amount modal
    = Behavior of the "MAX" button:
  • If Changelly's maxLim > wallet's max => Make a "Send max" for the wallet
  • If Changelly's maxLim < wallet's max => Set Changelly's maxLim as the amount to send
  • If Changelly's minLim > wallet's max => "Not enough funds" message is displayed
  • If the "MAX" button is shown => Hide the previous "Send max" from the upper right corner in the Amount modal

=============

  • Now the user can make swaps between any coin supported by Changelly:
  • The walletFrom selection modal remains as it was, showing only the currencies that have wallets with funds enabled for swapping.
  • Refactor of the walletTo selection modal in which the list of all chains/tokens supported as destination of a swap is shown.

= Behavior of the walletTo selection modal:

  • If the user selects a coin for which he already has wallets => Show the wallet selector by Key
  • If the user selects a coin (not a token) for which he does not have any wallet => Show the Keys selector => Create a wallet in the selected Key => He must back up the key if necessary.
  • If the user selects a token for which he does not have any wallet but does not have an ETH wallet that can be associatedWallet => Show the Keys selector => Creates an ETH wallet in the selected Key and associates it with the selected token => He must back up the key if necessary.
  • If the user selects a token for which he does not have any wallet but does have an ETH wallet that can be associatedWallet => Show the ETH Wallets selector to select the associated wallet => Create a wallet of the selected token and associate it with ETH selected

=============

Fix: Some changelly tokens change their names arbitrarily. For each particular case there must be a translation to be able to support it within our app. For example:

In the ERC20 network:
USDT => It is called USDT20 by changelly

On the Matic network:
matic => It is called "maticpolygon" by changelly
usdc => It is called "usdcmatic" by changelly

=============

Added a control when all coins are disabled by Changelly. Now it shows an error messages saying "Our partner Changelly is not currently available. Please try again later."

@Gamboster Gamboster marked this pull request as draft October 3, 2022 19:25
@Gamboster Gamboster force-pushed the ref/swapCrypto branch 6 times, most recently from c9065b7 to f758257 Compare October 4, 2022 19:48
@Gamboster Gamboster marked this pull request as ready for review October 5, 2022 14:48
@Gamboster Gamboster changed the title WIP: Ref: Swap crypto Ref: Swap crypto Oct 5, 2022
rastajpa
rastajpa previously approved these changes Oct 6, 2022
Copy link
Collaborator

@rastajpa rastajpa left a comment

Choose a reason for hiding this comment

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

LGTM! Nice work!

gabrielbazan7
gabrielbazan7 previously approved these changes Oct 6, 2022
Copy link
Collaborator

@gabrielbazan7 gabrielbazan7 left a comment

Choose a reason for hiding this comment

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

Awesome! ACK

@Gamboster Gamboster dismissed stale reviews from gabrielbazan7 and rastajpa via b8bb5a0 October 6, 2022 20:00
@JohnathanWhite JohnathanWhite merged commit 369c567 into bitpay:master Oct 7, 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.

4 participants