Skip to content

Commit

Permalink
Merge pull request MyEtherWallet#3477 from MyEtherWallet/fix/sentry-2…
Browse files Browse the repository at this point in the history
…505736127

fix: 🐛 sentry #2505736127
  • Loading branch information
gamalielhere authored Sep 30, 2021
2 parents 40abf76 + 2ea90a0 commit 0362ccb
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 17 deletions.
1 change: 1 addition & 0 deletions changelog/fix-3477.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* fix sentry issue #2505736127
135 changes: 118 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions src/modules/swap/handlers/providers/changelly.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import Configs from '../configs';
import { toBN, toHex, toWei } from 'web3-utils';
import Web3Contract from 'web3-eth-contract';
import { ETH } from '@/utils/networks/types';
import { Toast, ERROR } from '@/modules/toast/handler/handlerToast';

const HOST_URL = 'https://swap.mewapi.io/changelly';
const REQUEST_CACHER = 'https://requestcache.mewapi.io/?url=';
class Changelly {
Expand Down Expand Up @@ -41,6 +43,9 @@ class Changelly {
isEth: d.contractAddress ? true : false
};
});
})
.catch(err => {
Toast(err, {}, ERROR);
});
}
isValidToAddress({ toT, address }) {
Expand All @@ -57,6 +62,9 @@ class Changelly {
})
.then(response => {
return response.data.result.result;
})
.catch(err => {
Toast(err, {}, ERROR);
});
}
getMinMaxAmount({ fromT, toT }) {
Expand All @@ -78,6 +86,9 @@ class Changelly {
minFrom: result?.minFrom,
maxFrom: result?.maxFrom
};
})
.catch(err => {
Toast(err, {}, ERROR);
});
}
getQuote({ fromT, toT, fromAmount }) {
Expand Down Expand Up @@ -117,6 +128,9 @@ class Changelly {
maxFrom: minmax.maxFrom
}
];
})
.catch(err => {
Toast(err, {}, ERROR);
});
});
}
Expand Down Expand Up @@ -173,6 +187,9 @@ class Changelly {
transactions: [txObj]
};
});
})
.catch(err => {
Toast(err, {}, ERROR);
});
}
async executeTrade(tradeObj, confirmInfo) {
Expand Down Expand Up @@ -220,6 +237,9 @@ class Changelly {
if (completedStatuses.includes(status)) return Configs.status.COMPLETED;
if (failedStatuses.includes(status)) return Configs.status.COMPLETED;
return Configs.status.UNKNOWN;
})
.catch(err => {
Toast(err, {}, ERROR);
});
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/modules/swap/handlers/providers/mew-provider-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const GET_TRADE = '/swap/trade';
const REQUEST_CACHER = 'https://requestcache.mewapi.io/?url=';
import { isAddress } from 'web3-utils';
import Configs from '../configs';
import { Toast, ERROR } from '@/modules/toast/handler/handlerToast';
class MEWPClass {
constructor(providerName, web3, supportednetworks, chain) {
this.web3 = web3;
Expand All @@ -33,6 +34,9 @@ class MEWPClass {
type: 'ERC20'
};
});
})
.catch(err => {
Toast(err, {}, ERROR);
});
}
isValidToAddress({ address }) {
Expand Down Expand Up @@ -117,6 +121,9 @@ class MEWPClass {
provider: this.provider,
transactions: response.data.transactions
};
})
.catch(err => {
Toast(err, {}, ERROR);
});
}
async executeTrade(tradeObj, confirmInfo) {
Expand Down

0 comments on commit 0362ccb

Please sign in to comment.