Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade assets-controllers to v38.2.0 #27629

Merged
merged 12 commits into from
Oct 10, 2024
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/dist/assetsUtil.cjs b/dist/assetsUtil.cjs
index e90a1b6767bc8ac54b7a4d580035cf5db6861dca..a5e0f03d2541b4e3540431ef2e6e4b60fb7ae9fe 100644
--- a/dist/assetsUtil.cjs
+++ b/dist/assetsUtil.cjs
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": 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.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");
@@ -221,7 +222,7 @@ async function getIpfsCIDv1AndPath(ipfsUrl) {
const index = url.indexOf('/');
const cid = index !== -1 ? url.substring(0, index) : url;
const path = index !== -1 ? url.substring(index) : undefined;
- const { CID } = await import("multiformats");
+ const { CID } = _interopRequireWildcard(require("multiformats"));
// We want to ensure that the CID is v1 (https://docs.ipfs.io/concepts/content-addressing/#identifier-formats)
// because most cid v0s appear to be incompatible with IPFS subdomains
return {
diff --git a/dist/token-prices-service/codefi-v2.mjs b/dist/token-prices-service/codefi-v2.mjs
index e7eaad2cfa8b233c4fd42a51f745233a1cc5c387..b89849c0caf7e5db3b53cf03dd5746b6b1433543 100644
--- a/dist/token-prices-service/codefi-v2.mjs
+++ b/dist/token-prices-service/codefi-v2.mjs
@@ -12,8 +12,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
var _CodefiTokenPricesServiceV2_tokenPricePolicy;
import { handleFetch } from "@metamask/controller-utils";
import { hexToNumber } from "@metamask/utils";
-import $cockatiel from "cockatiel";
-const { circuitBreaker, ConsecutiveBreaker, ExponentialBackoff, handleAll, retry, wrap, CircuitState } = $cockatiel;
+import { circuitBreaker, ConsecutiveBreaker, ExponentialBackoff, handleAll, retry, wrap, CircuitState } from "cockatiel";
/**
* The list of currencies that can be supplied as the `vsCurrency` parameter to
* the `/spot-prices` endpoint, in lowercase form.
12 changes: 2 additions & 10 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,8 @@
"@ethersproject/contracts": true,
"@ethersproject/providers": true,
"@metamask/abi-utils": true,
"@metamask/assets-controllers>@metamask/base-controller": true,
"@metamask/assets-controllers>@metamask/polling-controller": true,
"@metamask/base-controller": true,
"@metamask/contract-metadata": true,
"@metamask/controller-utils": true,
"@metamask/eth-query": true,
Expand All @@ -715,22 +715,14 @@
"uuid": true
}
},
"@metamask/assets-controllers>@metamask/base-controller": {
"globals": {
"setTimeout": true
},
"packages": {
"immer": true
}
},
"@metamask/assets-controllers>@metamask/polling-controller": {
"globals": {
"clearTimeout": true,
"console.error": true,
"setTimeout": true
},
"packages": {
"@metamask/assets-controllers>@metamask/base-controller": true,
"@metamask/base-controller": true,
"@metamask/snaps-utils>fast-json-stable-stringify": true,
"uuid": true
}
Expand Down
12 changes: 2 additions & 10 deletions lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,8 @@
"@ethersproject/contracts": true,
"@ethersproject/providers": true,
"@metamask/abi-utils": true,
"@metamask/assets-controllers>@metamask/base-controller": true,
"@metamask/assets-controllers>@metamask/polling-controller": true,
"@metamask/base-controller": true,
"@metamask/contract-metadata": true,
"@metamask/controller-utils": true,
"@metamask/eth-query": true,
Expand All @@ -715,22 +715,14 @@
"uuid": true
}
},
"@metamask/assets-controllers>@metamask/base-controller": {
"globals": {
"setTimeout": true
},
"packages": {
"immer": true
}
},
"@metamask/assets-controllers>@metamask/polling-controller": {
"globals": {
"clearTimeout": true,
"console.error": true,
"setTimeout": true
},
"packages": {
"@metamask/assets-controllers>@metamask/base-controller": true,
"@metamask/base-controller": true,
"@metamask/snaps-utils>fast-json-stable-stringify": true,
"uuid": true
}
Expand Down
12 changes: 2 additions & 10 deletions lavamoat/browserify/main/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,8 @@
"@ethersproject/contracts": true,
"@ethersproject/providers": true,
"@metamask/abi-utils": true,
"@metamask/assets-controllers>@metamask/base-controller": true,
"@metamask/assets-controllers>@metamask/polling-controller": true,
"@metamask/base-controller": true,
"@metamask/contract-metadata": true,
"@metamask/controller-utils": true,
"@metamask/eth-query": true,
Expand All @@ -715,22 +715,14 @@
"uuid": true
}
},
"@metamask/assets-controllers>@metamask/base-controller": {
"globals": {
"setTimeout": true
},
"packages": {
"immer": true
}
},
"@metamask/assets-controllers>@metamask/polling-controller": {
"globals": {
"clearTimeout": true,
"console.error": true,
"setTimeout": true
},
"packages": {
"@metamask/assets-controllers>@metamask/base-controller": true,
"@metamask/base-controller": true,
"@metamask/snaps-utils>fast-json-stable-stringify": true,
"uuid": true
}
Expand Down
12 changes: 2 additions & 10 deletions lavamoat/browserify/mmi/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,8 @@
"@ethersproject/contracts": true,
"@ethersproject/providers": true,
"@metamask/abi-utils": true,
"@metamask/assets-controllers>@metamask/base-controller": true,
"@metamask/assets-controllers>@metamask/polling-controller": true,
"@metamask/base-controller": true,
"@metamask/contract-metadata": true,
"@metamask/controller-utils": true,
"@metamask/eth-query": true,
Expand All @@ -807,22 +807,14 @@
"uuid": true
}
},
"@metamask/assets-controllers>@metamask/base-controller": {
"globals": {
"setTimeout": true
},
"packages": {
"immer": true
}
},
"@metamask/assets-controllers>@metamask/polling-controller": {
"globals": {
"clearTimeout": true,
"console.error": true,
"setTimeout": true
},
"packages": {
"@metamask/assets-controllers>@metamask/base-controller": true,
"@metamask/base-controller": true,
"@metamask/snaps-utils>fast-json-stable-stringify": true,
"uuid": true
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
"@metamask/address-book-controller": "^6.0.0",
"@metamask/announcement-controller": "^7.0.0",
"@metamask/approval-controller": "^7.0.0",
"@metamask/assets-controllers": "^37.0.0",
"@metamask/assets-controllers": "patch:@metamask/assets-controllers@npm%3A38.2.0#~/.yarn/patches/@metamask-assets-controllers-npm-38.2.0-40af2afaa7.patch",
"@metamask/base-controller": "^7.0.0",
"@metamask/bitcoin-wallet-snap": "^0.6.1",
"@metamask/browser-passworder": "^4.3.0",
Expand Down
88 changes: 63 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4861,22 +4861,22 @@ __metadata:
languageName: node
linkType: hard

"@metamask/assets-controllers@npm:^37.0.0":
version: 37.0.0
resolution: "@metamask/assets-controllers@npm:37.0.0"
"@metamask/assets-controllers@npm:38.2.0":
version: 38.2.0
resolution: "@metamask/assets-controllers@npm:38.2.0"
dependencies:
"@ethereumjs/util": "npm:^8.1.0"
"@ethersproject/address": "npm:^5.7.0"
"@ethersproject/bignumber": "npm:^5.7.0"
"@ethersproject/contracts": "npm:^5.7.0"
"@ethersproject/providers": "npm:^5.7.0"
"@metamask/abi-utils": "npm:^2.0.3"
"@metamask/base-controller": "npm:^6.0.2"
"@metamask/base-controller": "npm:^7.0.1"
"@metamask/contract-metadata": "npm:^2.4.0"
"@metamask/controller-utils": "npm:^11.0.2"
"@metamask/controller-utils": "npm:^11.3.0"
"@metamask/eth-query": "npm:^4.0.0"
"@metamask/metamask-eth-abis": "npm:^3.1.1"
"@metamask/polling-controller": "npm:^9.0.1"
"@metamask/polling-controller": "npm:^10.0.1"
"@metamask/rpc-errors": "npm:^6.3.1"
"@metamask/utils": "npm:^9.1.0"
"@types/bn.js": "npm:^5.1.5"
Expand All @@ -4893,9 +4893,47 @@ __metadata:
"@metamask/accounts-controller": ^18.0.0
"@metamask/approval-controller": ^7.0.0
"@metamask/keyring-controller": ^17.0.0
"@metamask/network-controller": ^20.0.0
"@metamask/network-controller": ^21.0.0
"@metamask/preferences-controller": ^13.0.0
checksum: 10/89798930cb80a134263ce82db736feebd064fe6c999ddcf41ca86fad81cfadbb9e37d1919a6384aaf6d3aa0cb520684e7b8228da3b9bc1e70e7aea174a69c4ac
checksum: 10/96ae724a002289e4df97bab568e0bba4d28ef18320298b12d828fc3b58c58ebc54b9f9d659c5e6402aad82088b699e52469d897dd4356e827e35b8f8cebb4483
languageName: node
linkType: hard

"@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A38.2.0#~/.yarn/patches/@metamask-assets-controllers-npm-38.2.0-40af2afaa7.patch":
version: 38.2.0
resolution: "@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A38.2.0#~/.yarn/patches/@metamask-assets-controllers-npm-38.2.0-40af2afaa7.patch::version=38.2.0&hash=e14ff8"
dependencies:
"@ethereumjs/util": "npm:^8.1.0"
"@ethersproject/address": "npm:^5.7.0"
"@ethersproject/bignumber": "npm:^5.7.0"
"@ethersproject/contracts": "npm:^5.7.0"
"@ethersproject/providers": "npm:^5.7.0"
"@metamask/abi-utils": "npm:^2.0.3"
"@metamask/base-controller": "npm:^7.0.1"
"@metamask/contract-metadata": "npm:^2.4.0"
"@metamask/controller-utils": "npm:^11.3.0"
"@metamask/eth-query": "npm:^4.0.0"
"@metamask/metamask-eth-abis": "npm:^3.1.1"
"@metamask/polling-controller": "npm:^10.0.1"
"@metamask/rpc-errors": "npm:^6.3.1"
"@metamask/utils": "npm:^9.1.0"
"@types/bn.js": "npm:^5.1.5"
"@types/uuid": "npm:^8.3.0"
async-mutex: "npm:^0.5.0"
bn.js: "npm:^5.2.1"
cockatiel: "npm:^3.1.2"
immer: "npm:^9.0.6"
lodash: "npm:^4.17.21"
multiformats: "npm:^13.1.0"
single-call-balance-checker-abi: "npm:^1.0.0"
uuid: "npm:^8.3.2"
peerDependencies:
"@metamask/accounts-controller": ^18.0.0
"@metamask/approval-controller": ^7.0.0
"@metamask/keyring-controller": ^17.0.0
"@metamask/network-controller": ^21.0.0
"@metamask/preferences-controller": ^13.0.0
checksum: 10/0ba3673bf9c87988d6c569a14512b8c9bb97db3516debfedf24cbcf38110e99afec8d9fc50cb0b627bfbc1d1a62069298e4e27278587197f67812cb38ee2c778
languageName: node
linkType: hard

Expand Down Expand Up @@ -5958,6 +5996,22 @@ __metadata:
languageName: node
linkType: hard

"@metamask/polling-controller@npm:^10.0.1":
version: 10.0.1
resolution: "@metamask/polling-controller@npm:10.0.1"
dependencies:
"@metamask/base-controller": "npm:^7.0.1"
"@metamask/controller-utils": "npm:^11.3.0"
"@metamask/utils": "npm:^9.1.0"
"@types/uuid": "npm:^8.3.0"
fast-json-stable-stringify: "npm:^2.1.0"
uuid: "npm:^8.3.2"
peerDependencies:
"@metamask/network-controller": ^21.0.0
checksum: 10/25c11e65eeccb08a2b4b7dec21ccabb4b797907edb03a1534ebacb87d0754a3ade52aad061aad8b3ac23bfc39917c0d61b9734e32bc748c210b2997410ae45a9
languageName: node
linkType: hard

"@metamask/polling-controller@npm:^8.0.0":
version: 8.0.0
resolution: "@metamask/polling-controller@npm:8.0.0"
Expand All @@ -5975,22 +6029,6 @@ __metadata:
languageName: node
linkType: hard

"@metamask/polling-controller@npm:^9.0.1":
version: 9.0.1
resolution: "@metamask/polling-controller@npm:9.0.1"
dependencies:
"@metamask/base-controller": "npm:^6.0.2"
"@metamask/controller-utils": "npm:^11.0.2"
"@metamask/utils": "npm:^9.1.0"
"@types/uuid": "npm:^8.3.0"
fast-json-stable-stringify: "npm:^2.1.0"
uuid: "npm:^8.3.2"
peerDependencies:
"@metamask/network-controller": ^20.0.0
checksum: 10/e9e8c51013290a2e4b2817ba1e0915783474f6a55fe614e20acf92bf707e300bec1fa612c8019ae9afe9635d018fb5d5b106c8027446ba12767220db91cf1ee5
languageName: node
linkType: hard

"@metamask/post-message-stream@npm:^8.0.0, @metamask/post-message-stream@npm:^8.1.1":
version: 8.1.1
resolution: "@metamask/post-message-stream@npm:8.1.1"
Expand Down Expand Up @@ -26059,7 +26097,7 @@ __metadata:
"@metamask/announcement-controller": "npm:^7.0.0"
"@metamask/api-specs": "npm:^0.9.3"
"@metamask/approval-controller": "npm:^7.0.0"
"@metamask/assets-controllers": "npm:^37.0.0"
"@metamask/assets-controllers": "patch:@metamask/assets-controllers@npm%3A38.2.0#~/.yarn/patches/@metamask-assets-controllers-npm-38.2.0-40af2afaa7.patch"
"@metamask/auto-changelog": "npm:^2.1.0"
"@metamask/base-controller": "npm:^7.0.0"
"@metamask/bitcoin-wallet-snap": "npm:^0.6.1"
Expand Down