{"version":3,"file":"assets-conversion.mjs","sourceRoot":"","sources":["../../../src/types/handlers/assets-conversion.ts"],"names":[],"mappings":"","sourcesContent":["import { type CaipAssetType } from '@metamask/utils';\n/**\n * The conversion rate between two assets.\n *\n * @property rate - The conversion rate between the two assets.\n * @property conversionTime - The time at which the conversion rate was calculated.\n * @property expirationTime - The time at which the conversion rate expires.\n */\nexport type AssetConversion = {\n  rate: string;\n  conversionTime: number;\n  expirationTime?: number;\n};\n\n/**\n * The arguments for the `onAssetsConversion` handler.\n *\n * @property conversions - An array of objects containing the `from` and `to` asset types.\n * @property includeMarketData - Whether to include market data in the response.\n */\nexport type OnAssetsConversionArguments = {\n  conversions: { from: CaipAssetType; to: CaipAssetType }[];\n};\n\n/**\n * The `onAssetsConversion` handler. This is called by MetaMask when querying about asset conversion on specific chains.\n *\n * @param args - The arguments for the handler.\n * see {@link OnAssetsConversionArguments}.\n * @returns The conversion for each asset. See\n * {@link OnAssetsConversionResponse}.\n */\nexport type OnAssetsConversionHandler = (\n  args: OnAssetsConversionArguments,\n) => Promise<OnAssetsConversionResponse>;\n\n/**\n * The response from the conversion query, containing rates about each requested asset pair.\n *\n * @property conversionRates - A nested object with two CAIP-19 keys that contains a conversion rate or null between the two keys.\n */\nexport type OnAssetsConversionResponse = {\n  conversionRates: Record<\n    CaipAssetType,\n    Record<CaipAssetType, AssetConversion | null>\n  >;\n};\n"]}