Skip to content

Commit

Permalink
fix: Fix send flow deeplinks (#12965)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

This PR aims to fix deeplinks using `Send` flow.

## **Related issues**

Fixes: #12689

## **Manual testing steps**

1. Open safari/chrome in the testing device - navigate
https://metamask.github.io/metamask-deeplinks/
2. Click "Payment Request" then "Eth Payment"
3. Fill the form - you dont need to put chain id
4. Click "Generate url"
5. Click generated url 
6. See that it opens send flow page

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->



https://github.com/user-attachments/assets/ec6324b0-188f-4079-90ee-3d30b7e6056d



### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [X] 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).
- [X] I've completed the PR template to the best of my ability
- [X] I’ve included tests if applicable
- [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [X] 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
OGPoyraz authored Jan 15, 2025
1 parent 00bc6d3 commit 249e035
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/components/Views/confirmations/Send/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ class Send extends PureComponent {
* Resets gas and gasPrice of transaction
*/
async reset() {
const { transaction } = this.props;
const { gas, gasPrice } = await estimateGas(transaction);
const { networkClientId, transaction } = this.props;
const { gas, gasPrice } = await estimateGas(transaction, networkClientId);
this.props.setTransactionObject({
gas: hexToBN(gas),
gasPrice: hexToBN(gasPrice),
Expand Down Expand Up @@ -320,8 +320,6 @@ class Send extends PureComponent {
handleNewTxMeta = async ({
target_address,
action,
chain_id = null,
function_name = null, // eslint-disable-line no-unused-vars
parameters = null,
}) => {
const { addressBook, chainId, internalAccounts, selectedAddress } =
Expand Down Expand Up @@ -408,7 +406,10 @@ class Send extends PureComponent {

// if gas and gasPrice is not defined in the deeplink, we should define them
if (!gas && !gasPrice) {
const { gas, gasPrice } = await estimateGas(this.props.transaction);
const { gas, gasPrice } = await estimateGas(
this.props.transaction,
this.props.networkClientId,
);
newTxMeta = {
...newTxMeta,
gas,
Expand Down

0 comments on commit 249e035

Please sign in to comment.