UNPKG

@metamask/snaps-utils

Version:
25 lines 1.27 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OnAssetHistoricalPriceResponseStruct = exports.AssetHistoricalPriceStruct = exports.HistoricalPriceStruct = void 0; const snaps_sdk_1 = require("@metamask/snaps-sdk"); const superstruct_1 = require("@metamask/superstruct"); const time_1 = require("../time.cjs"); /** * A struct representing a historical price. */ exports.HistoricalPriceStruct = (0, snaps_sdk_1.nonEmptyRecord)((0, superstruct_1.union)([(0, superstruct_1.literal)('all'), time_1.ISO8601DurationStruct]), (0, superstruct_1.array)((0, superstruct_1.tuple)([(0, superstruct_1.number)(), (0, superstruct_1.string)()]))); /** * A struct representing an asset's historical price. */ exports.AssetHistoricalPriceStruct = (0, superstruct_1.nullable)((0, superstruct_1.object)({ intervals: exports.HistoricalPriceStruct, updateTime: (0, superstruct_1.number)(), expirationTime: (0, superstruct_1.optional)((0, superstruct_1.number)()), })); /** * A struct representing the response of the `onAssetHistoricalPrice` method. */ exports.OnAssetHistoricalPriceResponseStruct = (0, superstruct_1.object)({ historicalPrice: exports.AssetHistoricalPriceStruct, }); //# sourceMappingURL=asset-historical-price.cjs.map