@metamask-previews/assets-controller 13.1.2-preview-823dcff → 13.1.2-preview-c449b8da8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"DetectionMiddleware.mjs","sourceRoot":"","sources":["../../src/middlewares/DetectionMiddleware.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB;AAErD,OAAO,EAAE,wBAAwB,EAAE,mDAAkD;AACrF,OAAO,EAAE,kBAAkB,EAAE,4CAA2C;AACxE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,sBAAqB;AACjE,OAAO,EAAE,YAAY,EAAE,qBAAoB;AAE3C,OAAO,EAAE,gBAAgB,EAAE,2BAA0B;AAErD,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAE9C,MAAM,GAAG,GAAG,kBAAkB,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;AAE/D;;;;;;;GAOG;AACH,SAAS,qBAAqB,CAAC,OAAe;IAC5C,IAAI,CAAC;QACH,MAAM,EAAE,cAAc,EAAE,GAAG,kBAAkB,CAAC,OAAwB,CAAC,CAAC;QACxE,OAAO,CACL,CAAC,cAAc,KAAM,kBAAkB,CAAC,KAAgB;YACtD,cAAc,KAAM,kBAAkB,CAAC,KAAgB,CAAC;YAC1D,CAAC,wBAAwB,CAAC,OAAO,CAAC,CACnC,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAyCD,MAAM,OAAO,mBAAmB;IAK9B,YAAY,UAAsC,EAAE;QAJ3C,SAAI,GAAG,eAAe,CAAC;QAEvB,+DAAwC;QAG/C,uBAAA,IAAI,gDACF,OAAO,CAAC,uBAAuB,IAAI,CAAC,GAAY,EAAE,CAAC,IAAI,CAAC,MAAA,CAAC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,OAAO,CAAC,CAAC;gBACpD,IACE,MAAM,CAAC,iBAAiB,CAAC,KAAK,SAAS;oBACvC,MAAM,CAAC,OAAO,CAAC,KAAK,SAAS,EAC7B,CAAC;oBACD,kBAAkB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;gBAC5C,CAAC;YACH,CAAC,CAAC;YAEF,KAAK,MAAM,eAAe,IAAI,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;gBAC5D,KAAK,MAAM,OAAO,IAAI,eAAe,EAAE,CAAC;oBACtC,UAAU,CAAC,OAAO,CAAC,CAAC;gBACtB,CAAC;YACH,CAAC;YAED,IAAI,QAAQ,CAAC,aAAa,EAAE,CAAC;gBAC3B,KAAK,MAAM,eAAe,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;oBACpE,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAC/B,eAA0C,CAC3C,EAAE,CAAC;wBACF,UAAU,CAAC,OAAwB,CAAC,CAAC;oBACvC,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,kBAAkB,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;gBAChC,OAAO,CAAC,oBAAoB,GAAG;oBAC7B,GAAG,CAAC,OAAO,CAAC,oBAAoB,IAAI,EAAE,CAAC;oBACvC,GAAG,kBAAkB;iBACtB,CAAC;YACJ,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import { parseCaipAssetType } from '@metamask/utils';\n\nimport { isStakingContractAssetId } from '../data-sources/evm-rpc-services/index.js';\nimport { CaipAssetNamespace } from '../data-sources/TokenDataSource.js';\nimport { projectLogger, createModuleLogger } from '../logger.js';\nimport { forDataTypes } from '../types.js';\nimport type { AccountId, Caip19AssetId, Middleware } from '../types.js';\nimport { normalizeAssetId } from '../utils/index.js';\n\n// ============================================================================\n// CONSTANTS\n// ============================================================================\n\nconst CONTROLLER_NAME = 'DetectionMiddleware';\n\nconst log = createModuleLogger(projectLogger, CONTROLLER_NAME);\n\n/**\n * Whether an asset is subject to the token-detection toggle: fungible tokens\n * (EVM `erc20`, non-EVM `token` — SPL, TRC, etc.). Natives (`slip44`),\n * staking-contract assets, and anything unparseable are never gated.\n *\n * @param assetId - The CAIP-19 asset ID to classify.\n * @returns `true` when the asset should be blocked while detection is off.\n */\nfunction isDetectionGatedAsset(assetId: string): boolean {\n try {\n const { assetNamespace } = parseCaipAssetType(assetId as Caip19AssetId);\n return (\n (assetNamespace === (CaipAssetNamespace.Erc20 as string) ||\n assetNamespace === (CaipAssetNamespace.Token as string)) &&\n !isStakingContractAssetId(assetId)\n );\n } catch {\n return false;\n }\n}\n\n// ============================================================================\n// DETECTION MIDDLEWARE\n// ============================================================================\n\n/**\n * DetectionMiddleware builds the set of assets that downstream sources use for\n * metadata and price fetching.\n *\n * An asset is included in `detectedAssets` only when it is genuinely new:\n * - Assets from `response.assetsBalance` are included only if they are absent\n * from BOTH `state.assetsBalance` (never tracked before) AND `state.assetsInfo`\n * (no metadata yet). Assets already present in either collection are considered\n * known and are intentionally excluded — PriceDataSource's own subscription\n * handles periodic refreshes for those.\n * - Each account's custom assets from state are always included because they\n * may have no balance yet and are explicitly managed by the user.\n *\n * When token detection is disabled (`isTokenDetectionEnabled` returns false),\n * new-to-state fungible tokens (`erc20` / `token` namespaces) are neither\n * detected nor persisted: their balances and stub metadata are stripped from\n * the response. Natives, staking-contract assets, custom (user-imported)\n * assets, and assets already tracked in state are unaffected.\n *\n * Usage:\n * ```typescript\n * const detectionMiddleware = new DetectionMiddleware();\n * const middleware = detectionMiddleware.assetsMiddleware;\n * ```\n */\n\n/** Constructor options for {@link DetectionMiddleware}. */\nexport type DetectionMiddlewareOptions = {\n /**\n * Whether automatic token detection is enabled (e.g. the user's\n * \"Autodetect tokens\" preference). Defaults to `() => true`.\n */\n isTokenDetectionEnabled?: () => boolean;\n};\n\nexport class DetectionMiddleware {\n readonly name = CONTROLLER_NAME;\n\n readonly #isTokenDetectionEnabled: () => boolean;\n\n constructor(options: DetectionMiddlewareOptions = {}) {\n this.#isTokenDetectionEnabled =\n options.isTokenDetectionEnabled ?? ((): boolean => true);\n }\n\n getName(): string {\n return this.name;\n }\n\n /**\n * Get the middleware that builds detectedAssets for metadata and price fetching.\n *\n * This middleware:\n * 1. Includes assets from response.assetsBalance that are absent from both\n * state.assetsBalance and state.assetsInfo (brand-new assets only)\n * 2. Always includes each account's custom assets from state\n * 3. Fills response.detectedAssets with the resulting asset IDs per account\n * 4. Queues detected assets that lack a price in state on\n * request.assetsForPriceUpdate so PriceDataSource fetches them in the same\n * pipeline pass (including the background RPC detection path)\n *\n * @returns The middleware function for the assets pipeline.\n */\n get assetsMiddleware(): Middleware {\n return forDataTypes(['balance'], async (ctx, next) => {\n const { request, response } = ctx;\n\n // Get state for custom assets, existing balances, and existing metadata\n const state = ctx.getAssetsState();\n const {\n customAssets: stateCustomAssets,\n assetsBalance: stateAssetsBalance,\n assetsInfo: stateAssetsInfo,\n assetsPrice: stateAssetsPrice,\n } = state;\n\n const detectedAssets: Record<AccountId, Caip19AssetId[]> = {};\n\n const detectionEnabled = this.#isTokenDetectionEnabled();\n // Lower-cased asset IDs stripped from the response because token\n // detection is off; used to purge their stub metadata afterwards.\n const strippedAssetIds = new Set<string>();\n // Lower-cased state metadata keys, built lazily (only when detection is\n // off) so the destructive strip below cannot misfire on a known holding\n // reported by a source in a different address case.\n let knownMetadataLower: Set<string> | null = null;\n const getKnownMetadataLower = (): Set<string> => {\n knownMetadataLower ??= new Set(\n Object.keys(stateAssetsInfo).map((id) => id.toLowerCase()),\n );\n return knownMetadataLower;\n };\n\n // 1. From balance response: only include assets that are genuinely new —\n // not already present in state.assetsBalance or state.assetsInfo.\n if (response.assetsBalance) {\n for (const [accountId, accountBalances] of Object.entries(\n response.assetsBalance,\n )) {\n const detected: Caip19AssetId[] = [];\n\n const stateAccountBalances = stateAssetsBalance[accountId] ?? {};\n const customForAccount = stateCustomAssets?.[accountId] ?? [];\n const customLowerIds = detectionEnabled\n ? null\n : new Set(customForAccount.map((id) => id.toLowerCase()));\n const knownBalanceLower = detectionEnabled\n ? null\n : new Set(\n Object.keys(stateAccountBalances).map((id) => id.toLowerCase()),\n );\n\n for (const assetId of Object.keys(\n accountBalances as Record<string, unknown>,\n )) {\n const caipAssetId = assetId as Caip19AssetId;\n // Skip if already tracked in state balances or already has metadata\n if (\n stateAccountBalances[caipAssetId] !== undefined ||\n stateAssetsInfo[caipAssetId] !== undefined\n ) {\n continue;\n }\n\n // Token detection off: new-to-state fungible tokens (erc20 / SPL\n // and similar `token` namespaces) are neither detected nor\n // persisted. Natives, staking contracts, custom assets, and\n // holdings already known to state (any address case) still flow.\n if (\n !detectionEnabled &&\n isDetectionGatedAsset(assetId) &&\n !customLowerIds?.has(assetId.toLowerCase())\n ) {\n const lowerId = assetId.toLowerCase();\n if (\n !knownBalanceLower?.has(lowerId) &&\n !getKnownMetadataLower().has(lowerId)\n ) {\n delete (accountBalances as Record<string, unknown>)[assetId];\n strippedAssetIds.add(lowerId);\n }\n continue;\n }\n\n detected.push(caipAssetId);\n }\n\n // Merge custom assets for this account, applying the same filter:\n // skip if already in state balance or already has metadata.\n for (const assetId of customForAccount) {\n if (detected.includes(assetId)) {\n continue;\n }\n if (\n stateAccountBalances[assetId] !== undefined ||\n stateAssetsInfo[assetId] !== undefined\n ) {\n continue;\n }\n detected.push(assetId);\n }\n\n if (detected.length > 0) {\n detectedAssets[accountId] = detected;\n }\n }\n }\n\n // Drop stub metadata (e.g. websocket-seeded name/symbol) of stripped\n // tokens so it never persists to state — a persisted stub would make\n // the token look \"known\" on the next update and let it bypass the\n // detection gate.\n if (strippedAssetIds.size > 0) {\n if (response.assetsInfo) {\n for (const assetId of Object.keys(response.assetsInfo)) {\n if (strippedAssetIds.has(assetId.toLowerCase())) {\n delete response.assetsInfo[assetId as Caip19AssetId];\n }\n }\n }\n log('Token detection disabled - stripped new tokens from response', {\n assetIds: [...strippedAssetIds],\n });\n }\n\n // 2. Accounts in request that weren't in balance response: include their\n // custom assets that are not yet in state.\n for (const { account } of request.accountsWithSupportedChains) {\n const accountId = account.id;\n if (detectedAssets[accountId]) {\n continue;\n }\n const stateAccountBalances = stateAssetsBalance[accountId] ?? {};\n const customForAccount = stateCustomAssets?.[accountId] ?? [];\n const newCustomAssets = customForAccount.filter((assetId) => {\n const inBalance = stateAccountBalances[assetId] !== undefined;\n const inInfo = stateAssetsInfo[assetId] !== undefined;\n return !inBalance && !inInfo;\n });\n if (newCustomAssets.length > 0) {\n detectedAssets[accountId] = newCustomAssets;\n }\n }\n\n if (Object.keys(detectedAssets).length > 0) {\n response.detectedAssets = detectedAssets;\n }\n\n // Queue prices for:\n // 1) newly detected assets missing a price, and\n // 2) assets in this balance response that already exist in state but still\n // lack a price (e.g. natives seeded before the first price poll).\n // PriceDataSource filters non-priceable IDs before calling the API.\n const prices = stateAssetsPrice as Record<string, unknown>;\n const missingPriceAssets = new Set<Caip19AssetId>();\n\n const maybeQueue = (assetId: Caip19AssetId): void => {\n const normalizedAssetId = normalizeAssetId(assetId);\n if (\n prices[normalizedAssetId] === undefined &&\n prices[assetId] === undefined\n ) {\n missingPriceAssets.add(normalizedAssetId);\n }\n };\n\n for (const accountAssetIds of Object.values(detectedAssets)) {\n for (const assetId of accountAssetIds) {\n maybeQueue(assetId);\n }\n }\n\n if (response.assetsBalance) {\n for (const accountBalances of Object.values(response.assetsBalance)) {\n for (const assetId of Object.keys(\n accountBalances as Record<string, unknown>,\n )) {\n maybeQueue(assetId as Caip19AssetId);\n }\n }\n }\n\n if (missingPriceAssets.size > 0) {\n request.assetsForPriceUpdate = [\n ...(request.assetsForPriceUpdate ?? []),\n ...missingPriceAssets,\n ];\n }\n\n return next(ctx);\n });\n }\n}\n"]}
1
+ {"version":3,"file":"DetectionMiddleware.mjs","sourceRoot":"","sources":["../../src/middlewares/DetectionMidd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M,OAAO,IAAI,eAAe,EAAE,CAAC;oBACtC,UAAU,CAAC,OAAO,CAAC,CAAC;gBACtB,CAAC;YACH,CAAC;YAED,IAAI,QAAQ,CAAC,aAAa,EAAE,CAAC;gBAC3B,KAAK,MAAM,eAAe,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;oBACpE,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAC/B,eAA0C,CAC3C,EAAE,CAAC;wBACF,UAAU,CAAC,OAAwB,CAAC,CAAC;oBACvC,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,kBAAkB,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;gBAChC,OAAO,CAAC,oBAAoB,GAAG;oBAC7B,GAAG,CAAC,OAAO,CAAC,oBAAoB,IAAI,EAAE,CAAC;oBACvC,GAAG,kBAAkB;iBACtB,CAAC;YACJ,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import { projectLogger, createModuleLogger } from '../logger.js';\nimport { forDataTypes } from '../types.js';\nimport type { AccountId, Caip19AssetId, Middleware } from '../types.js';\nimport { normalizeAssetId } from '../utils/index.js';\n\n// ============================================================================\n// CONSTANTS\n// ============================================================================\n\nconst CONTROLLER_NAME = 'DetectionMiddleware';\n\n// Logger for debugging\ncreateModuleLogger(projectLogger, CONTROLLER_NAME);\n\n// ============================================================================\n// DETECTION MIDDLEWARE\n// ============================================================================\n\n/**\n * DetectionMiddleware builds the set of assets that downstream sources use for\n * metadata and price fetching.\n *\n * An asset is included in `detectedAssets` only when it is genuinely new:\n * - Assets from `response.assetsBalance` are included only if they are absent\n * from BOTH `state.assetsBalance` (never tracked before) AND `state.assetsInfo`\n * (no metadata yet). Assets already present in either collection are considered\n * known and are intentionally excluded — PriceDataSource's own subscription\n * handles periodic refreshes for those.\n * - Each account's custom assets from state are always included because they\n * may have no balance yet and are explicitly managed by the user.\n *\n * Usage:\n * ```typescript\n * const detectionMiddleware = new DetectionMiddleware();\n * const middleware = detectionMiddleware.assetsMiddleware;\n * ```\n */\nexport class DetectionMiddleware {\n readonly name = CONTROLLER_NAME;\n\n getName(): string {\n return this.name;\n }\n\n /**\n * Get the middleware that builds detectedAssets for metadata and price fetching.\n *\n * This middleware:\n * 1. Includes assets from response.assetsBalance that are absent from both\n * state.assetsBalance and state.assetsInfo (brand-new assets only)\n * 2. Always includes each account's custom assets from state\n * 3. Fills response.detectedAssets with the resulting asset IDs per account\n * 4. Queues detected assets that lack a price in state on\n * request.assetsForPriceUpdate so PriceDataSource fetches them in the same\n * pipeline pass (including the background RPC detection path)\n *\n * @returns The middleware function for the assets pipeline.\n */\n get assetsMiddleware(): Middleware {\n return forDataTypes(['balance'], async (ctx, next) => {\n const { request, response } = ctx;\n\n // Get state for custom assets, existing balances, and existing metadata\n const state = ctx.getAssetsState();\n const {\n customAssets: stateCustomAssets,\n assetsBalance: stateAssetsBalance,\n assetsInfo: stateAssetsInfo,\n assetsPrice: stateAssetsPrice,\n } = state;\n\n const detectedAssets: Record<AccountId, Caip19AssetId[]> = {};\n\n // 1. From balance response: only include assets that are genuinely new —\n // not already present in state.assetsBalance or state.assetsInfo.\n if (response.assetsBalance) {\n for (const [accountId, accountBalances] of Object.entries(\n response.assetsBalance,\n )) {\n const detected: Caip19AssetId[] = [];\n\n const stateAccountBalances = stateAssetsBalance[accountId] ?? {};\n\n for (const assetId of Object.keys(\n accountBalances as Record<string, unknown>,\n )) {\n const caipAssetId = assetId as Caip19AssetId;\n // Skip if already tracked in state balances or already has metadata\n if (\n stateAccountBalances[caipAssetId] !== undefined ||\n stateAssetsInfo[caipAssetId] !== undefined\n ) {\n continue;\n }\n detected.push(caipAssetId);\n }\n\n // Merge custom assets for this account, applying the same filter:\n // skip if already in state balance or already has metadata.\n const customForAccount = stateCustomAssets?.[accountId] ?? [];\n for (const assetId of customForAccount) {\n if (detected.includes(assetId)) {\n continue;\n }\n if (\n stateAccountBalances[assetId] !== undefined ||\n stateAssetsInfo[assetId] !== undefined\n ) {\n continue;\n }\n detected.push(assetId);\n }\n\n if (detected.length > 0) {\n detectedAssets[accountId] = detected;\n }\n }\n }\n\n // 2. Accounts in request that weren't in balance response: include their\n // custom assets that are not yet in state.\n for (const { account } of request.accountsWithSupportedChains) {\n const accountId = account.id;\n if (detectedAssets[accountId]) {\n continue;\n }\n const stateAccountBalances = stateAssetsBalance[accountId] ?? {};\n const customForAccount = stateCustomAssets?.[accountId] ?? [];\n const newCustomAssets = customForAccount.filter((assetId) => {\n const inBalance = stateAccountBalances[assetId] !== undefined;\n const inInfo = stateAssetsInfo[assetId] !== undefined;\n return !inBalance && !inInfo;\n });\n if (newCustomAssets.length > 0) {\n detectedAssets[accountId] = newCustomAssets;\n }\n }\n\n if (Object.keys(detectedAssets).length > 0) {\n response.detectedAssets = detectedAssets;\n }\n\n // Queue prices for:\n // 1) newly detected assets missing a price, and\n // 2) assets in this balance response that already exist in state but still\n // lack a price (e.g. natives seeded before the first price poll).\n // PriceDataSource filters non-priceable IDs before calling the API.\n const prices = stateAssetsPrice as Record<string, unknown>;\n const missingPriceAssets = new Set<Caip19AssetId>();\n\n const maybeQueue = (assetId: Caip19AssetId): void => {\n const normalizedAssetId = normalizeAssetId(assetId);\n if (\n prices[normalizedAssetId] === undefined &&\n prices[assetId] === undefined\n ) {\n missingPriceAssets.add(normalizedAssetId);\n }\n };\n\n for (const accountAssetIds of Object.values(detectedAssets)) {\n for (const assetId of accountAssetIds) {\n maybeQueue(assetId);\n }\n }\n\n if (response.assetsBalance) {\n for (const accountBalances of Object.values(response.assetsBalance)) {\n for (const assetId of Object.keys(\n accountBalances as Record<string, unknown>,\n )) {\n maybeQueue(assetId as Caip19AssetId);\n }\n }\n }\n\n if (missingPriceAssets.size > 0) {\n request.assetsForPriceUpdate = [\n ...(request.assetsForPriceUpdate ?? []),\n ...missingPriceAssets,\n ];\n }\n\n return next(ctx);\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/middlewares/index.ts"],"names":[],"mappings":";;;AAAA,4FAAuF;AAA9E,qJAAA,+BAA+B,OAAA;AAExC,oEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAE5B,wEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAE9B,kEAIiC;AAH/B,wIAAA,+BAA+B,OAAA;AAC/B,iIAAA,wBAAwB,OAAA;AACxB,2HAAA,kBAAkB,OAAA","sourcesContent":["export { CustomAssetGraduationMiddleware } from './CustomAssetGraduationMiddleware.js';\nexport type { CustomAssetGraduationMiddlewareOptions } from './CustomAssetGraduationMiddleware.js';\nexport { DetectionMiddleware } from './DetectionMiddleware.js';\nexport type { DetectionMiddlewareOptions } from './DetectionMiddleware.js';\nexport { RpcFallbackMiddleware } from './RpcFallbackMiddleware.js';\nexport type { RpcFallbackMiddlewareOptions } from './RpcFallbackMiddleware.js';\nexport {\n createParallelBalanceMiddleware,\n createParallelMiddleware,\n mergeDataResponses,\n} from './ParallelMiddleware.js';\nexport type { BalanceSource } from './ParallelMiddleware.js';\nexport type { AssetsDataSource } from '../types.js';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/middlewares/index.ts"],"names":[],"mappings":";;;AAAA,4FAAuF;AAA9E,qJAAA,+BAA+B,OAAA;AAExC,oEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,wEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAE9B,kEAIiC;AAH/B,wIAAA,+BAA+B,OAAA;AAC/B,iIAAA,wBAAwB,OAAA;AACxB,2HAAA,kBAAkB,OAAA","sourcesContent":["export { CustomAssetGraduationMiddleware } from './CustomAssetGraduationMiddleware.js';\nexport type { CustomAssetGraduationMiddlewareOptions } from './CustomAssetGraduationMiddleware.js';\nexport { DetectionMiddleware } from './DetectionMiddleware.js';\nexport { RpcFallbackMiddleware } from './RpcFallbackMiddleware.js';\nexport type { RpcFallbackMiddlewareOptions } from './RpcFallbackMiddleware.js';\nexport {\n createParallelBalanceMiddleware,\n createParallelMiddleware,\n mergeDataResponses,\n} from './ParallelMiddleware.js';\nexport type { BalanceSource } from './ParallelMiddleware.js';\nexport type { AssetsDataSource } from '../types.js';\n"]}
@@ -1,7 +1,6 @@
1
1
  export { CustomAssetGraduationMiddleware } from "./CustomAssetGraduationMiddleware.cjs";
2
2
  export type { CustomAssetGraduationMiddlewareOptions } from "./CustomAssetGraduationMiddleware.cjs";
3
3
  export { DetectionMiddleware } from "./DetectionMiddleware.cjs";
4
- export type { DetectionMiddlewareOptions } from "./DetectionMiddleware.cjs";
5
4
  export { RpcFallbackMiddleware } from "./RpcFallbackMiddleware.cjs";
6
5
  export type { RpcFallbackMiddlewareOptions } from "./RpcFallbackMiddleware.cjs";
7
6
  export { createParallelBalanceMiddleware, createParallelMiddleware, mergeDataResponses, } from "./ParallelMiddleware.cjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/middlewares/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,8CAA6C;AACvF,YAAY,EAAE,sCAAsC,EAAE,8CAA6C;AACnG,OAAO,EAAE,mBAAmB,EAAE,kCAAiC;AAC/D,YAAY,EAAE,0BAA0B,EAAE,kCAAiC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,oCAAmC;AACnE,YAAY,EAAE,4BAA4B,EAAE,oCAAmC;AAC/E,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EACxB,kBAAkB,GACnB,iCAAgC;AACjC,YAAY,EAAE,aAAa,EAAE,iCAAgC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,qBAAoB"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/middlewares/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,8CAA6C;AACvF,YAAY,EAAE,sCAAsC,EAAE,8CAA6C;AACnG,OAAO,EAAE,mBAAmB,EAAE,kCAAiC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,oCAAmC;AACnE,YAAY,EAAE,4BAA4B,EAAE,oCAAmC;AAC/E,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EACxB,kBAAkB,GACnB,iCAAgC;AACjC,YAAY,EAAE,aAAa,EAAE,iCAAgC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,qBAAoB"}
@@ -1,7 +1,6 @@
1
1
  export { CustomAssetGraduationMiddleware } from "./CustomAssetGraduationMiddleware.mjs";
2
2
  export type { CustomAssetGraduationMiddlewareOptions } from "./CustomAssetGraduationMiddleware.mjs";
3
3
  export { DetectionMiddleware } from "./DetectionMiddleware.mjs";
4
- export type { DetectionMiddlewareOptions } from "./DetectionMiddleware.mjs";
5
4
  export { RpcFallbackMiddleware } from "./RpcFallbackMiddleware.mjs";
6
5
  export type { RpcFallbackMiddlewareOptions } from "./RpcFallbackMiddleware.mjs";
7
6
  export { createParallelBalanceMiddleware, createParallelMiddleware, mergeDataResponses, } from "./ParallelMiddleware.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/middlewares/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,8CAA6C;AACvF,YAAY,EAAE,sCAAsC,EAAE,8CAA6C;AACnG,OAAO,EAAE,mBAAmB,EAAE,kCAAiC;AAC/D,YAAY,EAAE,0BAA0B,EAAE,kCAAiC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,oCAAmC;AACnE,YAAY,EAAE,4BAA4B,EAAE,oCAAmC;AAC/E,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EACxB,kBAAkB,GACnB,iCAAgC;AACjC,YAAY,EAAE,aAAa,EAAE,iCAAgC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,qBAAoB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/middlewares/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,8CAA6C;AACvF,YAAY,EAAE,sCAAsC,EAAE,8CAA6C;AACnG,OAAO,EAAE,mBAAmB,EAAE,kCAAiC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,oCAAmC;AACnE,YAAY,EAAE,4BAA4B,EAAE,oCAAmC;AAC/E,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EACxB,kBAAkB,GACnB,iCAAgC;AACjC,YAAY,EAAE,aAAa,EAAE,iCAAgC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,qBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/middlewares/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,8CAA6C;AAEvF,OAAO,EAAE,mBAAmB,EAAE,kCAAiC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,oCAAmC;AAEnE,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EACxB,kBAAkB,EACnB,iCAAgC","sourcesContent":["export { CustomAssetGraduationMiddleware } from './CustomAssetGraduationMiddleware.js';\nexport type { CustomAssetGraduationMiddlewareOptions } from './CustomAssetGraduationMiddleware.js';\nexport { DetectionMiddleware } from './DetectionMiddleware.js';\nexport type { DetectionMiddlewareOptions } from './DetectionMiddleware.js';\nexport { RpcFallbackMiddleware } from './RpcFallbackMiddleware.js';\nexport type { RpcFallbackMiddlewareOptions } from './RpcFallbackMiddleware.js';\nexport {\n createParallelBalanceMiddleware,\n createParallelMiddleware,\n mergeDataResponses,\n} from './ParallelMiddleware.js';\nexport type { BalanceSource } from './ParallelMiddleware.js';\nexport type { AssetsDataSource } from '../types.js';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/middlewares/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,8CAA6C;AAEvF,OAAO,EAAE,mBAAmB,EAAE,kCAAiC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,oCAAmC;AAEnE,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EACxB,kBAAkB,EACnB,iCAAgC","sourcesContent":["export { CustomAssetGraduationMiddleware } from './CustomAssetGraduationMiddleware.js';\nexport type { CustomAssetGraduationMiddlewareOptions } from './CustomAssetGraduationMiddleware.js';\nexport { DetectionMiddleware } from './DetectionMiddleware.js';\nexport { RpcFallbackMiddleware } from './RpcFallbackMiddleware.js';\nexport type { RpcFallbackMiddlewareOptions } from './RpcFallbackMiddleware.js';\nexport {\n createParallelBalanceMiddleware,\n createParallelMiddleware,\n mergeDataResponses,\n} from './ParallelMiddleware.js';\nexport type { BalanceSource } from './ParallelMiddleware.js';\nexport type { AssetsDataSource } from '../types.js';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/assets-controller",
3
- "version": "13.1.2-preview-823dcff",
3
+ "version": "13.1.2-preview-c449b8da8",
4
4
  "description": "Tracks assets balances/prices and handles token detection across all digital assets",
5
5
  "keywords": [
6
6
  "Ethereum",