-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into MMPD-1363
- Loading branch information
Showing
76 changed files
with
2,267 additions
and
1,163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...s-controllers-npm-42.0.0-57b3d695bb.patch → ...s-controllers-npm-44.0.0-c223d56176.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
.yarn/patches/@metamask-assets-controllers-patch-9e00573eb4.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
diff --git a/dist/TokenDetectionController.cjs b/dist/TokenDetectionController.cjs | ||
index ab23c95d667357db365f925c4c4acce4736797f8..8fd5efde7a3c24080f8a43f79d10300e8c271245 100644 | ||
--- a/dist/TokenDetectionController.cjs | ||
+++ b/dist/TokenDetectionController.cjs | ||
@@ -204,13 +204,10 @@ class TokenDetectionController extends (0, polling_controller_1.StaticIntervalPo | ||
// Try detecting tokens via Account API first if conditions allow | ||
if (supportedNetworks && chainsToDetectUsingAccountAPI.length > 0) { | ||
const apiResult = await __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_attemptAccountAPIDetection).call(this, chainsToDetectUsingAccountAPI, addressToDetect, supportedNetworks); | ||
- // If API succeeds and no chains are left for RPC detection, we can return early | ||
- if (apiResult?.result === 'success' && | ||
- chainsToDetectUsingRpc.length === 0) { | ||
- return; | ||
+ // If the account API call failed, have those chains fall back to RPC detection | ||
+ if (apiResult?.result === 'failed') { | ||
+ __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_addChainsToRpcDetection).call(this, chainsToDetectUsingRpc, chainsToDetectUsingAccountAPI, clientNetworks); | ||
} | ||
- // If API fails or chainsToDetectUsingRpc still has items, add chains to RPC detection | ||
- __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_addChainsToRpcDetection).call(this, chainsToDetectUsingRpc, chainsToDetectUsingAccountAPI, clientNetworks); | ||
} | ||
// Proceed with RPC detection if there are chains remaining in chainsToDetectUsingRpc | ||
if (chainsToDetectUsingRpc.length > 0) { | ||
@@ -446,8 +443,7 @@ async function _TokenDetectionController_addDetectedTokensViaAPI({ selectedAddre | ||
const tokenBalancesByChain = await __classPrivateFieldGet(this, _TokenDetectionController_accountsAPI, "f") | ||
.getMultiNetworksBalances(selectedAddress, chainIds, supportedNetworks) | ||
.catch(() => null); | ||
- if (!tokenBalancesByChain || | ||
- Object.keys(tokenBalancesByChain).length === 0) { | ||
+ if (tokenBalancesByChain === null) { | ||
return { result: 'failed' }; | ||
} | ||
// Process each chain ID individually | ||
diff --git a/dist/TokenDetectionController.mjs b/dist/TokenDetectionController.mjs | ||
index f75eb5c2c74f2a9d15a79760985111171dc938e1..ebc30bb915cc39dabf49f9e0da84a7948ae1ed48 100644 | ||
--- a/dist/TokenDetectionController.mjs | ||
+++ b/dist/TokenDetectionController.mjs | ||
@@ -205,13 +205,10 @@ export class TokenDetectionController extends StaticIntervalPollingController() | ||
// Try detecting tokens via Account API first if conditions allow | ||
if (supportedNetworks && chainsToDetectUsingAccountAPI.length > 0) { | ||
const apiResult = await __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_attemptAccountAPIDetection).call(this, chainsToDetectUsingAccountAPI, addressToDetect, supportedNetworks); | ||
- // If API succeeds and no chains are left for RPC detection, we can return early | ||
- if (apiResult?.result === 'success' && | ||
- chainsToDetectUsingRpc.length === 0) { | ||
- return; | ||
+ // If the account API call failed, have those chains fall back to RPC detection | ||
+ if (apiResult?.result === 'failed') { | ||
+ __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_addChainsToRpcDetection).call(this, chainsToDetectUsingRpc, chainsToDetectUsingAccountAPI, clientNetworks); | ||
} | ||
- // If API fails or chainsToDetectUsingRpc still has items, add chains to RPC detection | ||
- __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_addChainsToRpcDetection).call(this, chainsToDetectUsingRpc, chainsToDetectUsingAccountAPI, clientNetworks); | ||
} | ||
// Proceed with RPC detection if there are chains remaining in chainsToDetectUsingRpc | ||
if (chainsToDetectUsingRpc.length > 0) { | ||
@@ -446,8 +443,7 @@ async function _TokenDetectionController_addDetectedTokensViaAPI({ selectedAddre | ||
const tokenBalancesByChain = await __classPrivateFieldGet(this, _TokenDetectionController_accountsAPI, "f") | ||
.getMultiNetworksBalances(selectedAddress, chainIds, supportedNetworks) | ||
.catch(() => null); | ||
- if (!tokenBalancesByChain || | ||
- Object.keys(tokenBalancesByChain).length === 0) { | ||
+ if (tokenBalancesByChain === null) { | ||
return { result: 'failed' }; | ||
} | ||
// Process each chain ID individually |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.