Skip to content

Commit 54996e2

Browse files
authored
Merge branch 'main' into release/638.0.0
2 parents 481f7f7 + d385649 commit 54996e2

File tree

5 files changed

+24
-7
lines changed

5 files changed

+24
-7
lines changed

packages/assets-controllers/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- **BREAKING:** Bump peer dependency `@metamask/core-backend` from `^2.0.0` to `^3.0.0` ([#6923](https://github.com/MetaMask/core/pull/6923))
1515
- Bump `@metamask/base-controller` from `^8.4.1` to `^8.4.2` ([#6917](https://github.com/MetaMask/core/pull/6917))
1616

17+
### Fixed
18+
19+
- Downgrade `multiformats` to `^9.9.0` to avoid ESM-only dependency ([#6920](https://github.com/MetaMask/core/pull/6920))
20+
1721
## [82.0.0]
1822

1923
### Added

packages/assets-controllers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"bn.js": "^5.2.1",
7373
"immer": "^9.0.6",
7474
"lodash": "^4.17.21",
75-
"multiformats": "^13.1.0",
75+
"multiformats": "^9.9.0",
7676
"reselect": "^5.1.1",
7777
"single-call-balance-checker-abi": "^1.0.0",
7878
"uuid": "^8.3.2"

packages/assets-controllers/src/assetsUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
toCaipChainId,
1212
} from '@metamask/utils';
1313
import BN from 'bn.js';
14+
import { CID } from 'multiformats/cid';
1415

1516
import type { Nft, NftMetadata } from './NftController';
1617
import type { AbstractTokenPricesService } from './token-prices-service';
@@ -268,7 +269,6 @@ export async function getIpfsCIDv1AndPath(ipfsUrl: string): Promise<{
268269
const cid = index !== -1 ? url.substring(0, index) : url;
269270
const path = index !== -1 ? url.substring(index) : undefined;
270271

271-
const { CID } = await import('multiformats');
272272
// We want to ensure that the CID is v1 (https://docs.ipfs.io/concepts/content-addressing/#identifier-formats)
273273
// because most cid v0s appear to be incompatible with IPFS subdomains
274274
return {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Partial type definitions for `multiformats/cid`. This only covers the parts
3+
* used in the codebase.
4+
*/
5+
declare module 'multiformats/cid' {
6+
export class CID {
7+
static parse(cidString: string): CID;
8+
9+
toV1(): CID;
10+
11+
toString(): string;
12+
}
13+
}

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2791,7 +2791,7 @@ __metadata:
27912791
jest: "npm:^27.5.1"
27922792
jest-environment-jsdom: "npm:^27.5.1"
27932793
lodash: "npm:^4.17.21"
2794-
multiformats: "npm:^13.1.0"
2794+
multiformats: "npm:^9.9.0"
27952795
nock: "npm:^13.3.1"
27962796
reselect: "npm:^5.1.1"
27972797
single-call-balance-checker-abi: "npm:^1.0.0"
@@ -12502,10 +12502,10 @@ __metadata:
1250212502
languageName: node
1250312503
linkType: hard
1250412504

12505-
"multiformats@npm:^13.1.0":
12506-
version: 13.2.2
12507-
resolution: "multiformats@npm:13.2.2"
12508-
checksum: 10/6e673320e9b06d5fdbbf2bde0d3132f13fac94fb40f36d646265b5c38eba4a28c40a2c76b4efa0c1a23517fe87320e540e9ef7f28d71c1cc3239c91bf6770ce6
12505+
"multiformats@npm:^9.9.0":
12506+
version: 9.9.0
12507+
resolution: "multiformats@npm:9.9.0"
12508+
checksum: 10/ad55c7d480d22f4258a68fd88aa2aab744fe0cb1e68d732fc886f67d858b37e3aa6c2cec12b2960ead7730d43be690931485238569952d8a3d7f90fdc726c652
1250912509
languageName: node
1251012510
linkType: hard
1251112511

0 commit comments

Comments
 (0)