-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/update-focus-outline-menu-item
- Loading branch information
Showing
162 changed files
with
9,375 additions
and
3,768 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
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
13 changes: 13 additions & 0 deletions
13
.yarn/patches/@json-schema-spec-json-pointer-npm-0.1.2-3d06119887.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,13 @@ | ||
diff --git a/lib/index.js b/lib/index.js | ||
index f5795884311124b221d91f488ed45750eb6e9c80..e030d6f8d8e85e6d1350c565d36ad48bc49af881 100644 | ||
--- a/lib/index.js | ||
+++ b/lib/index.js | ||
@@ -25,7 +25,7 @@ class Ptr { | ||
}); | ||
return `/${tokens.join("/")}`; | ||
} | ||
- eval(instance) { | ||
+ shmeval(instance) { | ||
for (const token of this.tokens) { | ||
if (instance.hasOwnProperty(token)) { | ||
instance = instance[token]; |
13 changes: 13 additions & 0 deletions
13
.yarn/patches/@json-schema-tools-reference-resolver-npm-1.2.6-4e1497c16d.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,13 @@ | ||
diff --git a/build/resolve-pointer.js b/build/resolve-pointer.js | ||
index d5a8ec7486250cd17572eb0e0449725643fc9842..044e74bb51a46e9bf3547f6d7a84763b93260613 100644 | ||
--- a/build/resolve-pointer.js | ||
+++ b/build/resolve-pointer.js | ||
@@ -27,7 +27,7 @@ exports.default = (function (ref, root) { | ||
try { | ||
var withoutHash = ref.replace("#", ""); | ||
var pointer = json_pointer_1.default.parse(withoutHash); | ||
- return pointer.eval(root); | ||
+ return pointer.shmeval(root); | ||
} | ||
catch (e) { | ||
throw new InvalidJsonPointerRefError(ref, e.message); |
108 changes: 108 additions & 0 deletions
108
.yarn/patches/@metamask-assets-controllers-patch-d114308c1b.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,108 @@ | ||
diff --git a/dist/assetsUtil.cjs b/dist/assetsUtil.cjs | ||
index 61246f51500c8cab48f18296a73629fb73454caa..34396ba143e3ebcb04fa2c80f7a35d1abd06710e 100644 | ||
--- a/dist/assetsUtil.cjs | ||
+++ b/dist/assetsUtil.cjs | ||
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } | ||
-exports.fetchTokenContractExchangeRates = exports.reduceInBatchesSerially = exports.divideIntoBatches = exports.ethersBigNumberToBN = exports.addUrlProtocolPrefix = exports.getFormattedIpfsUrl = exports.getIpfsCIDv1AndPath = exports.removeIpfsProtocolPrefix = exports.isTokenListSupportedForNetwork = exports.isTokenDetectionSupportedForNetwork = exports.SupportedStakedBalanceNetworks = exports.SupportedTokenDetectionNetworks = exports.formatIconUrlWithProxy = exports.formatAggregatorNames = exports.hasNewCollectionFields = exports.compareNftMetadata = exports.TOKEN_PRICES_BATCH_SIZE = void 0; | ||
+exports.getKeyByValue = exports.fetchTokenContractExchangeRates = exports.reduceInBatchesSerially = exports.divideIntoBatches = exports.ethersBigNumberToBN = exports.addUrlProtocolPrefix = exports.getFormattedIpfsUrl = exports.getIpfsCIDv1AndPath = exports.removeIpfsProtocolPrefix = exports.isTokenListSupportedForNetwork = exports.isTokenDetectionSupportedForNetwork = exports.SupportedStakedBalanceNetworks = exports.SupportedTokenDetectionNetworks = exports.formatIconUrlWithProxy = exports.formatAggregatorNames = exports.hasNewCollectionFields = exports.compareNftMetadata = exports.TOKEN_PRICES_BATCH_SIZE = void 0; | ||
const controller_utils_1 = require("@metamask/controller-utils"); | ||
const utils_1 = require("@metamask/utils"); | ||
const bn_js_1 = __importDefault(require("bn.js")); | ||
@@ -368,4 +368,19 @@ async function fetchTokenContractExchangeRates({ tokenPricesService, nativeCurre | ||
}, {}); | ||
} | ||
exports.fetchTokenContractExchangeRates = fetchTokenContractExchangeRates; | ||
+/** | ||
+ * Function to search for a specific value in a given map and return the key | ||
+ * @param map - map input to search value | ||
+ * @param value - the value to search for | ||
+ * @returns returns key that corresponds to the value | ||
+ */ | ||
+function getKeyByValue(map, value) { | ||
+ for (const [key, val] of map.entries()) { | ||
+ if (val === value) { | ||
+ return key; | ||
+ } | ||
+ } | ||
+ return null; // Return null if no match is found | ||
+} | ||
+exports.getKeyByValue = getKeyByValue; | ||
//# sourceMappingURL=assetsUtil.cjs.map | ||
\ No newline at end of file | ||
diff --git a/dist/assetsUtil.mjs b/dist/assetsUtil.mjs | ||
index 1e14797c8e1cd48e75287b37c29eb6065daac5e6..c288b56227bd7779982083be4cae9674d01ae1dd 100644 | ||
--- a/dist/assetsUtil.mjs | ||
+++ b/dist/assetsUtil.mjs | ||
@@ -354,4 +354,18 @@ export async function fetchTokenContractExchangeRates({ tokenPricesService, nati | ||
}; | ||
}, {}); | ||
} | ||
+/** | ||
+ * Function to search for a specific value in a given map and return the key | ||
+ * @param map - map input to search value | ||
+ * @param value - the value to search for | ||
+ * @returns returns key that corresponds to the value | ||
+ */ | ||
+export function getKeyByValue(map, value) { | ||
+ for (const [key, val] of map.entries()) { | ||
+ if (val === value) { | ||
+ return key; | ||
+ } | ||
+ } | ||
+ return null; // Return null if no match is found | ||
+} | ||
//# sourceMappingURL=assetsUtil.mjs.map | ||
\ No newline at end of file | ||
diff --git a/dist/crypto-compare-service/crypto-compare.cjs b/dist/crypto-compare-service/crypto-compare.cjs | ||
index 4cdf9c15053fb4acbc8aa7cade912e87c7aaf224..7bddcf4322f7825affdf34116778ba08b7676951 100644 | ||
--- a/dist/crypto-compare-service/crypto-compare.cjs | ||
+++ b/dist/crypto-compare-service/crypto-compare.cjs | ||
@@ -2,6 +2,7 @@ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.fetchMultiExchangeRate = exports.fetchExchangeRate = void 0; | ||
const controller_utils_1 = require("@metamask/controller-utils"); | ||
+const assetsUtil_1 = require("../assetsUtil.cjs"); | ||
/** | ||
* A map from native currency symbol to CryptoCompare identifier. | ||
* This is only needed when the values don't match. | ||
@@ -105,12 +106,14 @@ exports.fetchExchangeRate = fetchExchangeRate; | ||
* @returns Promise resolving to exchange rates for given currencies. | ||
*/ | ||
async function fetchMultiExchangeRate(fiatCurrency, cryptocurrencies, includeUSDRate) { | ||
- const url = getMultiPricingURL(cryptocurrencies, [fiatCurrency], includeUSDRate); | ||
+ const fsyms = cryptocurrencies.map((nativeCurrency) => nativeSymbolOverrides.get(nativeCurrency) ?? nativeCurrency); | ||
+ const url = getMultiPricingURL(fsyms, [fiatCurrency], includeUSDRate); | ||
const response = await (0, controller_utils_1.handleFetch)(url); | ||
handleErrorResponse(response); | ||
const rates = {}; | ||
for (const [cryptocurrency, values] of Object.entries(response)) { | ||
- rates[cryptocurrency.toLowerCase()] = { | ||
+ const key = (0, assetsUtil_1.getKeyByValue)(nativeSymbolOverrides, cryptocurrency); | ||
+ rates[key?.toLowerCase() ?? cryptocurrency.toLowerCase()] = { | ||
[fiatCurrency.toLowerCase()]: values[fiatCurrency.toUpperCase()], | ||
...(includeUSDRate && { usd: values.USD }), | ||
}; | ||
diff --git a/dist/crypto-compare-service/crypto-compare.mjs b/dist/crypto-compare-service/crypto-compare.mjs | ||
index 58db2280159669c1b48fb94a9164b8e0be2850a7..74e0560718d42202e9183ff7ff1bfdac1424506e 100644 | ||
--- a/dist/crypto-compare-service/crypto-compare.mjs | ||
+++ b/dist/crypto-compare-service/crypto-compare.mjs | ||
@@ -101,12 +101,14 @@ export async function fetchExchangeRate(currency, nativeCurrency, includeUSDRate | ||
* @returns Promise resolving to exchange rates for given currencies. | ||
*/ | ||
export async function fetchMultiExchangeRate(fiatCurrency, cryptocurrencies, includeUSDRate) { | ||
- const url = getMultiPricingURL(cryptocurrencies, [fiatCurrency], includeUSDRate); | ||
+ const fsyms = cryptocurrencies.map((nativeCurrency) => nativeSymbolOverrides.get(nativeCurrency) ?? nativeCurrency); | ||
+ const url = getMultiPricingURL(fsyms, [fiatCurrency], includeUSDRate); | ||
const response = await handleFetch(url); | ||
handleErrorResponse(response); | ||
const rates = {}; | ||
for (const [cryptocurrency, values] of Object.entries(response)) { | ||
- rates[cryptocurrency.toLowerCase()] = { | ||
+ const key = getKeyByValue(nativeSymbolOverrides, cryptocurrency); | ||
+ rates[key?.toLowerCase() ?? cryptocurrency.toLowerCase()] = { | ||
[fiatCurrency.toLowerCase()]: values[fiatCurrency.toUpperCase()], | ||
...(includeUSDRate && { usd: values.USD }), | ||
}; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.