1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00
metamask-extension/shared/lib
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
..
deep-linking.js Add extension desktop UI (#17748) 2023-02-23 16:39:48 +00:00
deep-linking.test.js Add extension desktop UI (#17748) 2023-02-23 16:39:48 +00:00
error-utils.js Move desktop code to flask build type (#17960) 2023-03-06 19:35:00 +00:00
error-utils.test.js Show error message if service worker did not load (respond to the UI) (#15774) 2022-11-03 21:25:13 +04:00
fetch-with-cache.js Remove related UI code from the app dir (#15384) 2022-09-16 14:05:21 -05:00
fetch-with-cache.test.js Remove related UI code from the app dir (#15384) 2022-09-16 14:05:21 -05:00
metamask-controller-utils.js Relocate conversion utils to shared/modules/conversion.utils.js (#17319) 2023-01-20 11:04:37 -06:00
storage-helpers.js Remove related UI code from the app dir (#15384) 2022-09-16 14:05:21 -05:00
swaps-utils.js feat(mme-17214): migrate L33 files to typescript (#17372) 2023-01-31 12:01:10 +00:00
swaps-utils.test.js Ensure 0% slippage on Arbitrum for wrapping / unwrapping (#16778) 2022-12-06 10:44:09 -06:00
switch-direction.js Use modern stylesheet selector (#15962) 2022-09-26 12:09:38 -05:00
token-util.js Remove related UI code from the app dir (#15384) 2022-09-16 14:05:21 -05:00
token-util.ts Use tokenList to get token details, when available, in getTokenStanda… (#17891) 2023-03-08 14:05:45 -03:30
transaction-controller-utils.test.js adds test and fix for conversion to use numeric (#17758) 2023-02-15 10:26:32 -06:00
transactions-controller-utils.js adds test and fix for conversion to use numeric (#17758) 2023-02-15 10:26:32 -06:00
ui-utils.js [MMI] Adds the MMI support link and the mmi_website link as well (#17853) 2023-03-02 10:19:20 -06:00