UNPKG

@metamask/snaps-sdk

Version:

A library containing the core functionality for building MetaMask Snaps

1 lines 1.21 kB
{"version":3,"file":"get-currency-rate.cjs","sourceRoot":"","sources":["../../../src/types/methods/get-currency-rate.ts"],"names":[],"mappings":"","sourcesContent":["export type Currency<Value extends string> =\n | Lowercase<Value>\n | Uppercase<Value>;\n\nexport type AvailableCurrency = Currency<'btc'>;\n\n/**\n * The currency rate object.\n *\n * @property currency - The native currency symbol used for the conversion (e.g 'usd').\n * @property conversionRate - The conversion rate from the cryptocurrency to the native currency.\n * @property conversionDate - The date of the conversion rate as a UNIX timestamp.\n * @property usdConversionRate - The conversion rate to USD.\n */\nexport type CurrencyRate = {\n currency: string;\n conversionRate: number;\n conversionDate: number;\n usdConversionRate?: number;\n};\n\n/**\n * The request parameters for the `snap_getCurrencyRate` method.\n *\n * @property currency - The currency symbol.\n */\nexport type GetCurrencyRateParams = {\n currency: AvailableCurrency;\n};\n\n/**\n * The result returned by the `snap_getCurrencyRate` method, which is the {@link CurrencyRate} object.\n */\nexport type GetCurrencyRateResult = CurrencyRate | null;\n"]}