1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 06:07:06 +01:00
metamask-extension/ui/pages/swaps
Dan J Miller efaaf4fab2
Use tokenList to get token details, when available, in getTokenStanda… (#17891)
* Use tokenList to get token details, when available, in getTokenStandardAndDetails

Previously, every call to getTokenStandardAndDetails would fetch data via the provider.
This would result in at least 3 network requests whenever that method is called for an
ERC20 token, contributing to unneccesary loading and lagging in multiple places.
This commit takes advantage of stored data we already have available to avoid the unnecessary
loading.

* Lint fix

* Fix build-quote test

* bump coverage targets

* Pass provider to token-util, for use in ethers Contract module

* Check all possible sources of ERC20 token data before async call to assetsContractController

* Add and update tests

* Update app/scripts/metamask-controller.js

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* Update app/scripts/metamask-controller.js

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* Remove unnecessary this.ethQuery changes

* Use metamask-eth-abis instead of human-standard-token-abi in token-util.ts

* Add explanatory comments to getTokenStandardAndDetails

* lint fix

* Cleanup

* fix test

* Update app/scripts/metamask-controller.js

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* update error message

---------

Co-authored-by: Alex Donesky <adonesky@gmail.com>
2023-03-08 14:05:45 -03:30
..
__snapshots__ Swaps UI redesign for the View Quote page (#12950) 2021-12-07 00:21:26 -03:30
awaiting-signatures feature: migrate design-system.ts (#17518) 2023-02-02 20:15:26 +00:00
awaiting-swap fix: fix non-critical warning in tests (#17567) 2023-02-02 20:37:53 +00:00
build-quote Use tokenList to get token details, when available, in getTokenStanda… (#17891) 2023-03-08 14:05:45 -03:30
countdown-timer Added storybook check to CI (#17092) 2023-01-21 00:57:46 +05:30
create-new-swap fix: fix non-critical warning in tests (#17567) 2023-02-02 20:37:53 +00:00
dropdown-input-pair Added storybook check to CI (#17092) 2023-01-21 00:57:46 +05:30
dropdown-search-list Added storybook check to CI (#17092) 2023-01-21 00:57:46 +05:30
exchange-rate-display Added storybook check to CI (#17092) 2023-01-21 00:57:46 +05:30
fee-card feature: migrate design-system.ts (#17518) 2023-02-02 20:15:26 +00:00
import-token feature: migrate design-system.ts (#17518) 2023-02-02 20:15:26 +00:00
loading-swaps-quotes fix: fix non-critical warning in tests (#17567) 2023-02-02 20:37:53 +00:00
main-quote-summary Added storybook check to CI (#17092) 2023-01-21 00:57:46 +05:30
searchable-item-list Added storybook check to CI (#17092) 2023-01-21 00:57:46 +05:30
select-quote-popover Added storybook check to CI (#17092) 2023-01-21 00:57:46 +05:30
slippage-buttons feature: migrate design-system.ts (#17518) 2023-02-02 20:15:26 +00:00
smart-transaction-status feature: migrate design-system.ts (#17518) 2023-02-02 20:15:26 +00:00
swaps-footer Add hardcoded list of human-readable snap names (#17595) 2023-02-06 11:05:57 +01:00
view-on-block-explorer fix: fix non-critical warning in tests (#17567) 2023-02-02 20:37:53 +00:00
view-quote feature: migrate design-system.ts (#17518) 2023-02-02 20:15:26 +00:00
index.js Remove a notification for falling back from STX to regular swaps (#17374) 2023-01-25 20:01:10 +01:00
index.scss Update media query instances (#15068) 2022-08-04 09:03:02 -05:00
index.test.js Send all swaps requests to api2, remove useNewSwapsApi boolean (#12792) 2021-11-30 19:56:28 +01:00
swaps-util-test-constants.js update prettier (#15360) 2022-07-31 13:26:40 -05:00
swaps.util.test.js feat(mme-17214): migrate L33 files to typescript (#17372) 2023-01-31 12:01:10 +00:00
swaps.util.ts Use tokenList to get token details, when available, in getTokenStanda… (#17891) 2023-03-08 14:05:45 -03:30