UNPKG

client-aftermath-ts-sdk

Version:
34 lines (33 loc) 1.44 kB
"use strict"; // import { Url } from "../../types"; // import { SuiPriceServiceConnection } from "@pythnetwork/pyth-sui-js"; // import { PythPriceFeedId } from "./priceFeedsTypes"; Object.defineProperty(exports, "__esModule", { value: true }); // export class PriceFeedsApi { // // ========================================================================= // // Class Members // // ========================================================================= // protected readonly connection: SuiPriceServiceConnection; // // ========================================================================= // // Constructor // // ========================================================================= // constructor(priceServiceEndpoint: Url) { // this.connection = new SuiPriceServiceConnection(priceServiceEndpoint); // } // // ========================================================================= // // Public Methods // // ========================================================================= // public fetchPrices = async ( // priceFeedIds: PythPriceFeedId[] // ): Promise<number[]> => { // const priceFeeds = await this.connection.getLatestPriceFeeds( // priceFeedIds // ); // if (priceFeeds === undefined) // throw new Error("unable to fetch pyth price feeds"); // return priceFeeds?.map((feed) => // feed.getPriceUnchecked().getPriceAsNumberUnchecked() // ); // }; // } exports.default = {};