Skip to content

Commit

Permalink
stash
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorLift committed May 22, 2024
1 parent 5b2d07d commit 26937bc
Show file tree
Hide file tree
Showing 13 changed files with 274 additions and 47 deletions.
21 changes: 21 additions & 0 deletions .yarn/patches/@metamask-keyring-api-npm-6.1.0-1b3da6f710.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/dist/superstruct.d.ts b/dist/superstruct.d.ts
index b81329da445b729dc26533adb51443f14e58e5dc..2857b6d3d4c9070d7c557bd15f7c1b9bc41c9951 100644
--- a/dist/superstruct.d.ts
+++ b/dist/superstruct.d.ts
@@ -1,6 +1,6 @@
import type { Infer } from 'superstruct';
import { Struct } from 'superstruct';
-import type { ObjectSchema, OmitBy, Optionalize, PickBy, Simplify } from 'superstruct/dist/utils';
+import type { ObjectSchema, OmitBy, Optionalize, PickBy, Simplify } from 'superstruct';
declare const ExactOptionalSymbol: unique symbol;
export declare type ExactOptionalTag = {
type: typeof ExactOptionalSymbol;
diff --git a/dist/superstruct.js.map b/dist/superstruct.js.map
index 746668d2b1959fedd9150a9faf35ea30e30b5a7a..aaf130b761f57ade6c49f009f1f5c825186e858a 100644
--- a/dist/superstruct.js.map
+++ b/dist/superstruct.js.map
@@ -1 +1 @@
-{"version":3,"file":"superstruct.js","sourceRoot":"","sources":["../src/superstruct.ts"],"names":[],"mappings":";;;AACA,6CAAiE;AAkDjE;;;;;;GAMG;AACH,SAAgB,MAAM,CACpB,MAAc;IAEd,OAAO,IAAA,oBAAQ,EAAC,MAAM,CAAQ,CAAC;AACjC,CAAC;AAJD,wBAIC;AAED;;;;;GAKG;AACH,SAAS,WAAW,CAAC,GAAY;IAC/B,MAAM,QAAQ,GAAW,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACvD,MAAM,MAAM,GAA4B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAE1E,OAAO,QAAQ,IAAI,MAAM,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,aAAa,CAC3B,MAA4B;IAE5B,OAAO,IAAI,oBAAM,CAAC;QAChB,GAAG,MAAM;QAET,SAAS,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CACxB,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;QAEnD,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CACtB,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAa,EAAE,GAAG,CAAC;KAC1D,CAAC,CAAC;AACL,CAAC;AAZD,sCAYC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,aAAa,CAC3B,IAAY,EACZ,OAAe;IAEf,OAAO,IAAA,oBAAM,EACX,IAAI,EACJ,CAAC,KAAc,EAAW,EAAE,CAC1B,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CACnD,CAAC;AACJ,CAAC;AATD,sCASC;AAED;;;;;GAKG;AACU,QAAA,SAAS,GAAG,IAAA,oBAAM,EAAS,KAAK,EAAE,CAAC,KAAc,EAAE,EAAE;IAChE,IAAI,GAAG,CAAC;IAER,IAAI;QACF,GAAG,GAAG,IAAI,GAAG,CAAC,KAAe,CAAC,CAAC;KAChC;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;IAED,OAAO,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC;AAC/D,CAAC,CAAC,CAAC","sourcesContent":["import type { Infer, Context } from 'superstruct';\nimport { Struct, define, object as stObject } from 'superstruct';\nimport type {\n ObjectSchema,\n OmitBy,\n Optionalize,\n PickBy,\n Simplify,\n} from 'superstruct/dist/utils';\n\ndeclare const ExactOptionalSymbol: unique symbol;\n\nexport type ExactOptionalTag = {\n type: typeof ExactOptionalSymbol;\n};\n\n/**\n * Exclude type `Type` from the properties of `Obj`.\n *\n * ```ts\n * type Foo = { a: string | null; b: number };\n * type Bar = ExcludeType<Foo, null>;\n * // Bar = { a: string, b: number }\n * ```\n */\nexport type ExcludeType<Obj, Type> = {\n [K in keyof Obj]: Exclude<Obj[K], Type>;\n};\n\n/**\n * Make optional all properties that have the `ExactOptionalTag` type.\n *\n * ```ts\n * type Foo = { a: string | ExactOptionalTag; b: number};\n * type Bar = ExactOptionalize<Foo>;\n * // Bar = { a?: string; b: number}\n * ```\n */\nexport type ExactOptionalize<Schema extends object> = OmitBy<\n Schema,\n ExactOptionalTag\n> &\n Partial<ExcludeType<PickBy<Schema, ExactOptionalTag>, ExactOptionalTag>>;\n\n/**\n * Infer a type from an superstruct object schema.\n */\nexport type ObjectType<Schema extends ObjectSchema> = Simplify<\n ExactOptionalize<Optionalize<{ [K in keyof Schema]: Infer<Schema[K]> }>>\n>;\n\n/**\n * Change the return type of a superstruct object struct to support exact\n * optional properties.\n *\n * @param schema - The object schema.\n * @returns A struct representing an object with a known set of properties.\n */\nexport function object<Schema extends ObjectSchema>(\n schema: Schema,\n): Struct<ObjectType<Schema>, Schema> {\n return stObject(schema) as any;\n}\n\n/**\n * Check if the current property is present in its parent object.\n *\n * @param ctx - The context to check.\n * @returns `true` if the property is present, `false` otherwise.\n */\nfunction hasOptional(ctx: Context): boolean {\n const property: string = ctx.path[ctx.path.length - 1];\n const parent: Record<string, unknown> = ctx.branch[ctx.branch.length - 2];\n\n return property in parent;\n}\n\n/**\n * Augment a struct to allow exact-optional values. Exact-optional values can\n * be omitted but cannot be `undefined`.\n *\n * ```ts\n * const foo = object({ bar: exactOptional(string()) });\n * type Foo = Infer<typeof foo>;\n * // Foo = { bar?: string }\n * ```\n *\n * @param struct - The struct to augment.\n * @returns The augmented struct.\n */\nexport function exactOptional<Type, Schema>(\n struct: Struct<Type, Schema>,\n): Struct<Type | ExactOptionalTag, Schema> {\n return new Struct({\n ...struct,\n\n validator: (value, ctx) =>\n !hasOptional(ctx) || struct.validator(value, ctx),\n\n refiner: (value, ctx) =>\n !hasOptional(ctx) || struct.refiner(value as Type, ctx),\n });\n}\n\n/**\n * Defines a new string-struct matching a regular expression.\n *\n * Example:\n *\n * ```ts\n * const EthAddressStruct = definePattern('EthAddress', /^0x[0-9a-f]{40}$/iu);\n * ```\n *\n * @param name - Type name.\n * @param pattern - Regular expression to match.\n * @returns A new string-struct that matches the given pattern.\n */\nexport function definePattern(\n name: string,\n pattern: RegExp,\n): Struct<string, null> {\n return define<string>(\n name,\n (value: unknown): boolean =>\n typeof value === 'string' && pattern.test(value),\n );\n}\n\n/**\n * Validates if a given value is a valid URL.\n *\n * @param value - The value to be validated.\n * @returns A boolean indicating if the value is a valid URL.\n */\nexport const UrlStruct = define<string>('Url', (value: unknown) => {\n let url;\n\n try {\n url = new URL(value as string);\n } catch (_) {\n return false;\n }\n\n return url.protocol === 'http:' || url.protocol === 'https:';\n});\n"]}
\ No newline at end of file
+{"version":3,"file":"superstruct.js","sourceRoot":"","sources":["../src/superstruct.ts"],"names":[],"mappings":";;;AACA,6CAAiE;AAkDjE;;;;;;GAMG;AACH,SAAgB,MAAM,CACpB,MAAc;IAEd,OAAO,IAAA,oBAAQ,EAAC,MAAM,CAAQ,CAAC;AACjC,CAAC;AAJD,wBAIC;AAED;;;;;GAKG;AACH,SAAS,WAAW,CAAC,GAAY;IAC/B,MAAM,QAAQ,GAAW,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACvD,MAAM,MAAM,GAA4B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAE1E,OAAO,QAAQ,IAAI,MAAM,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,aAAa,CAC3B,MAA4B;IAE5B,OAAO,IAAI,oBAAM,CAAC;QAChB,GAAG,MAAM;QAET,SAAS,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CACxB,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;QAEnD,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CACtB,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAa,EAAE,GAAG,CAAC;KAC1D,CAAC,CAAC;AACL,CAAC;AAZD,sCAYC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,aAAa,CAC3B,IAAY,EACZ,OAAe;IAEf,OAAO,IAAA,oBAAM,EACX,IAAI,EACJ,CAAC,KAAc,EAAW,EAAE,CAC1B,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CACnD,CAAC;AACJ,CAAC;AATD,sCASC;AAED;;;;;GAKG;AACU,QAAA,SAAS,GAAG,IAAA,oBAAM,EAAS,KAAK,EAAE,CAAC,KAAc,EAAE,EAAE;IAChE,IAAI,GAAG,CAAC;IAER,IAAI;QACF,GAAG,GAAG,IAAI,GAAG,CAAC,KAAe,CAAC,CAAC;KAChC;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;IAED,OAAO,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC;AAC/D,CAAC,CAAC,CAAC","sourcesContent":["import type { Infer, Context } from 'superstruct';\nimport { Struct, define, object as stObject } from 'superstruct';\nimport type {\n ObjectSchema,\n OmitBy,\n Optionalize,\n PickBy,\n Simplify,\n} from 'superstruct';\n\ndeclare const ExactOptionalSymbol: unique symbol;\n\nexport type ExactOptionalTag = {\n type: typeof ExactOptionalSymbol;\n};\n\n/**\n * Exclude type `Type` from the properties of `Obj`.\n *\n * ```ts\n * type Foo = { a: string | null; b: number };\n * type Bar = ExcludeType<Foo, null>;\n * // Bar = { a: string, b: number }\n * ```\n */\nexport type ExcludeType<Obj, Type> = {\n [K in keyof Obj]: Exclude<Obj[K], Type>;\n};\n\n/**\n * Make optional all properties that have the `ExactOptionalTag` type.\n *\n * ```ts\n * type Foo = { a: string | ExactOptionalTag; b: number};\n * type Bar = ExactOptionalize<Foo>;\n * // Bar = { a?: string; b: number}\n * ```\n */\nexport type ExactOptionalize<Schema extends object> = OmitBy<\n Schema,\n ExactOptionalTag\n> &\n Partial<ExcludeType<PickBy<Schema, ExactOptionalTag>, ExactOptionalTag>>;\n\n/**\n * Infer a type from an superstruct object schema.\n */\nexport type ObjectType<Schema extends ObjectSchema> = Simplify<\n ExactOptionalize<Optionalize<{ [K in keyof Schema]: Infer<Schema[K]> }>>\n>;\n\n/**\n * Change the return type of a superstruct object struct to support exact\n * optional properties.\n *\n * @param schema - The object schema.\n * @returns A struct representing an object with a known set of properties.\n */\nexport function object<Schema extends ObjectSchema>(\n schema: Schema,\n): Struct<ObjectType<Schema>, Schema> {\n return stObject(schema) as any;\n}\n\n/**\n * Check if the current property is present in its parent object.\n *\n * @param ctx - The context to check.\n * @returns `true` if the property is present, `false` otherwise.\n */\nfunction hasOptional(ctx: Context): boolean {\n const property: string = ctx.path[ctx.path.length - 1];\n const parent: Record<string, unknown> = ctx.branch[ctx.branch.length - 2];\n\n return property in parent;\n}\n\n/**\n * Augment a struct to allow exact-optional values. Exact-optional values can\n * be omitted but cannot be `undefined`.\n *\n * ```ts\n * const foo = object({ bar: exactOptional(string()) });\n * type Foo = Infer<typeof foo>;\n * // Foo = { bar?: string }\n * ```\n *\n * @param struct - The struct to augment.\n * @returns The augmented struct.\n */\nexport function exactOptional<Type, Schema>(\n struct: Struct<Type, Schema>,\n): Struct<Type | ExactOptionalTag, Schema> {\n return new Struct({\n ...struct,\n\n validator: (value, ctx) =>\n !hasOptional(ctx) || struct.validator(value, ctx),\n\n refiner: (value, ctx) =>\n !hasOptional(ctx) || struct.refiner(value as Type, ctx),\n });\n}\n\n/**\n * Defines a new string-struct matching a regular expression.\n *\n * Example:\n *\n * ```ts\n * const EthAddressStruct = definePattern('EthAddress', /^0x[0-9a-f]{40}$/iu);\n * ```\n *\n * @param name - Type name.\n * @param pattern - Regular expression to match.\n * @returns A new string-struct that matches the given pattern.\n */\nexport function definePattern(\n name: string,\n pattern: RegExp,\n): Struct<string, null> {\n return define<string>(\n name,\n (value: unknown): boolean =>\n typeof value === 'string' && pattern.test(value),\n );\n}\n\n/**\n * Validates if a given value is a valid URL.\n *\n * @param value - The value to be validated.\n * @returns A boolean indicating if the value is a valid URL.\n */\nexport const UrlStruct = define<string>('Url', (value: unknown) => {\n let url;\n\n try {\n url = new URL(value as string);\n } catch (_) {\n return false;\n }\n\n return url.protocol === 'http:' || url.protocol === 'https:';\n});\n"]}
\ No newline at end of file
86 changes: 86 additions & 0 deletions .yarn/patches/@metamask-snaps-sdk-npm-4.2.0-68c745cc62.patch

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions .yarn/patches/@metamask-snaps-utils-npm-7.4.0-61301b942a.patch

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jest.config.scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = {
// This ensures that Babel can resolve ESM exports correctly.
moduleNameMapper: {
'^@metamask/utils/(.+)$': [
'<rootDir>/node_modules/@metamask/utils/dist/$1.js',
'<rootDir>/node_modules/@metamask/utils/dist/$1.cjs',
],
},

Expand Down
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,18 @@
"pre-push": "yarn lint"
},
"resolutions": {
"@metamask/utils": "file:/Users/jongsun/Code/utils",
"tsup@^8.0.2": "patch:tsup@npm%3A8.0.2#./.yarn/patches/tsup-npm-8.0.2-86e40f68a7.patch"
"@metamask/utils": "github:MetaMask/utils#use-superstruct-fork",
"superstruct": "github:MetaMask/superstruct#ts-bridge-preview-build",
"tsup@^8.0.2": "patch:tsup@npm%3A8.0.2#./.yarn/patches/tsup-npm-8.0.2-86e40f68a7.patch",
"@metamask/keyring-api@^6.0.0": "patch:@metamask/keyring-api@npm%3A6.1.0#./.yarn/patches/@metamask-keyring-api-npm-6.1.0-1b3da6f710.patch",
"@metamask/keyring-api@^6.1.0": "patch:@metamask/keyring-api@npm%3A6.1.0#./.yarn/patches/@metamask-keyring-api-npm-6.1.0-1b3da6f710.patch",
"@metamask/snaps-sdk@^4.0.1": "patch:@metamask/snaps-sdk@npm%3A4.2.0#./.yarn/patches/@metamask-snaps-sdk-npm-4.2.0-68c745cc62.patch",
"@metamask/snaps-sdk@^4.0.0": "patch:@metamask/snaps-sdk@npm%3A4.2.0#./.yarn/patches/@metamask-snaps-sdk-npm-4.2.0-68c745cc62.patch",
"@metamask/snaps-sdk@^4.2.0": "patch:@metamask/snaps-sdk@npm%3A4.2.0#./.yarn/patches/@metamask-snaps-sdk-npm-4.2.0-68c745cc62.patch",
"@metamask/snaps-sdk@^4.1.0": "patch:@metamask/snaps-sdk@npm%3A4.2.0#./.yarn/patches/@metamask-snaps-sdk-npm-4.2.0-68c745cc62.patch",
"@metamask/snaps-utils@^7.1.0": "patch:@metamask/snaps-utils@npm%3A7.4.0#./.yarn/patches/@metamask-snaps-utils-npm-7.4.0-61301b942a.patch",
"@metamask/snaps-utils@^7.0.3": "patch:@metamask/snaps-utils@npm%3A7.4.0#./.yarn/patches/@metamask-snaps-utils-npm-7.4.0-61301b942a.patch",
"@metamask/snaps-utils@^7.3.0": "patch:@metamask/snaps-utils@npm%3A7.4.0#./.yarn/patches/@metamask-snaps-utils-npm-7.4.0-61301b942a.patch"
},
"devDependencies": {
"@babel/core": "^7.23.5",
Expand Down
14 changes: 6 additions & 8 deletions packages/assets-controllers/src/NftController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ const SECOND_OWNER_ADDRESS = '0x500017171kasdfbou081';
const DEPRESSIONIST_CID_V1 =
'bafybeidf7aw7bmnmewwj4ayq3she2jfk5jrdpp24aaucf6fddzb3cfhrvm';

const DEPRESSIONIST_CLOUDFLARE_IPFS_SUBDOMAIN_PATH = getFormattedIpfsUrl(
IPFS_DEFAULT_GATEWAY_URL,
`ipfs://${DEPRESSIONIST_CID_V1}`,
true,
);

const SEPOLIA = {
chainId: toHex(11155111),
type: NetworkType.sepolia,
Expand Down Expand Up @@ -210,7 +204,7 @@ function setupController(
}

describe('NftController', () => {
beforeEach(() => {
beforeEach(async () => {
nock(NFT_API_BASE_URL)
.get(
`/tokens?chainIds=1&tokens=0x01%3A1&includeTopBid=true&includeAttributes=true&includeLastSale=true`,
Expand All @@ -231,7 +225,11 @@ describe('NftController', () => {
},
],
});

const DEPRESSIONIST_CLOUDFLARE_IPFS_SUBDOMAIN_PATH = await getFormattedIpfsUrl(
IPFS_DEFAULT_GATEWAY_URL,
`ipfs://${DEPRESSIONIST_CID_V1}`,
true,
);
nock(DEPRESSIONIST_CLOUDFLARE_IPFS_SUBDOMAIN_PATH).get('/').reply(200, {
name: 'name',
image: 'image',
Expand Down
2 changes: 1 addition & 1 deletion packages/assets-controllers/src/NftController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ export class NftController extends BaseControllerV1<NftConfig, NftState> {
}

if (hasIpfsTokenURI) {
tokenURI = getFormattedIpfsUrl(ipfsGateway, tokenURI, useIPFSSubdomains);
tokenURI = await getFormattedIpfsUrl(ipfsGateway, tokenURI, useIPFSSubdomains);
}

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import type {
NetworkClientId,
} from '@metamask/network-controller';
import { defaultState as defaultNetworkState } from '@metamask/network-controller';
import type { AutoManagedNetworkClient } from '@metamask/network-controller/src/create-auto-managed-network-client';
import type { CustomNetworkClientConfiguration } from '@metamask/network-controller/src/types';
import type { AutoManagedNetworkClient, CustomNetworkClientConfiguration } from '@metamask/network-controller';
import {
getDefaultPreferencesState,
type PreferencesState,
Expand Down
12 changes: 6 additions & 6 deletions packages/assets-controllers/src/assetsUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
import type { Hex } from '@metamask/utils';
import { remove0x } from '@metamask/utils';
import BN from 'bn.js';
import { CID } from 'multiformats';

import type { Nft, NftMetadata } from './NftController';
import type { AbstractTokenPricesService } from './token-prices-service';
Expand Down Expand Up @@ -179,10 +178,10 @@ export function removeIpfsProtocolPrefix(ipfsUrl: string) {
* @returns IFPS content identifier (cid) and sub path as string.
* @throws Will throw if the url passed is not ipfs.
*/
export function getIpfsCIDv1AndPath(ipfsUrl: string): {
export async function getIpfsCIDv1AndPath(ipfsUrl: string): Promise<{
cid: string;
path?: string;
} {
}> {
const url = removeIpfsProtocolPrefix(ipfsUrl);

// check if there is a path
Expand All @@ -191,6 +190,7 @@ export function getIpfsCIDv1AndPath(ipfsUrl: string): {
const cid = index !== -1 ? url.substring(0, index) : url;
const path = index !== -1 ? url.substring(index) : undefined;

const { CID } = await import('multiformats/cid');
// 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 {
Expand All @@ -207,14 +207,14 @@ export function getIpfsCIDv1AndPath(ipfsUrl: string): {
* @param subdomainSupported - Boolean indicating whether the URL should be formatted with subdomains or not.
* @returns A formatted URL, with the user's preferred IPFS gateway and format (subdomain or not), pointing to an asset hosted on IPFS.
*/
export function getFormattedIpfsUrl(
export async function getFormattedIpfsUrl(
ipfsGateway: string,
ipfsUrl: string,
subdomainSupported: boolean,
): string {
): Promise<string> {
const { host, protocol, origin } = new URL(addUrlProtocolPrefix(ipfsGateway));
if (subdomainSupported) {
const { cid, path } = getIpfsCIDv1AndPath(ipfsUrl);
const { cid, path } = await getIpfsCIDv1AndPath(ipfsUrl);
return `${protocol}//${cid}.ipfs.${host}${path ?? ''}`;
}
const cidAndPath = removeIpfsProtocolPrefix(ipfsUrl);
Expand Down
3 changes: 2 additions & 1 deletion packages/network-controller/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export type { AutoManagedNetworkClient } from './create-auto-managed-network-client';
export * from './NetworkController';
export * from './constants';
export type { BlockTracker, Provider } from './types';
export type { NetworkClientConfiguration } from './types';
export type { NetworkClientConfiguration, InfuraNetworkClientConfiguration, CustomNetworkClientConfiguration } from './types';
export { NetworkClientType } from './types';
export type { NetworkClient } from './create-network-client';
2 changes: 1 addition & 1 deletion packages/user-operation-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@
"@metamask/network-controller": "^18.1.0",
"@metamask/polling-controller": "^6.0.2",
"@metamask/rpc-errors": "^6.2.1",
"@metamask/superstruct": "^2.0.0",
"@metamask/transaction-controller": "^28.1.1",
"@metamask/utils": "^8.3.0",
"bn.js": "^5.2.1",
"immer": "^9.0.6",
"lodash": "^4.17.21",
"superstruct": "^1.0.3",
"uuid": "^8.3.2"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/user-operation-controller/src/utils/validation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { TransactionType } from '@metamask/transaction-controller';
import { isStrictHexString } from '@metamask/utils';
import type { Struct, StructError } from 'superstruct';
import type { Struct, StructError } from '@metamask/superstruct';
import {
assert,
boolean,
Expand All @@ -12,7 +10,9 @@ import {
optional,
refine,
string,
} from 'superstruct';
} from '@metamask/superstruct';
import { TransactionType } from '@metamask/transaction-controller';
import { isStrictHexString } from '@metamask/utils';

import { EMPTY_BYTES } from '../constants';
import type {
Expand Down
Loading

0 comments on commit 26937bc

Please sign in to comment.