Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add gas included swaps (#13430)
## **Description** Users who don't have enough ETH to pay for gas fees while swapping will be able to swap now if the gas fee can be taken from one of the tokens they are swapping. Smart transactions must be enabled for this. ## **Related issues** Fixes: ## **Manual testing steps** Test case 1: 1. Make sure you are on Ethereum mainnet and have Smart Transactions on in Advanced Settings 2. Have e.g. 0 ETH and 100 USDC 3. Fill in the swap form with 10 USDC -> ETH 6. You will see gas included swaps UI Test case 2: 1. Make sure you are on Ethereum mainnet and have Smart Transactions on in Advanced Settings 4. In Swaps you can now click on `Use max` for ETH 5. Get quotes 6. You will see gas included swaps UI ## **Screenshots/Recordings** User doesn't have enough ETH for gas fees (gas included swaps):  User has enough ETH for gas fees:  ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
- Loading branch information