/** * @packageDocumentation * @module API-OracleVM */ import LuxCore from "../../lux"; import { JRPCAPI } from "../../common/jrpcapi"; import { OracleFeed, RegisterFeedResponse, FeedValue, SubmitObservationResponse, OracleAttestation, OracleHealthResponse } from "./interfaces"; /** * Class for interacting with a node's OracleVM API (O-Chain). * * @category RPCAPIs * * @remarks This extends the [[JRPCAPI]] class. This class should not be directly called. Instead, use the [[Lux.addAPI]] function to register this interface with Lux. */ export declare class OracleVMAPI extends JRPCAPI { /** * Registers a new oracle data feed. * * @param name Name of the feed * @param description Description of the feed * @param aggregationMethod Method used to aggregate observations * @param heartbeatInterval Maximum interval between updates in seconds * @param deviationThreshold Percentage deviation that triggers an update * * @returns Promise for a [[RegisterFeedResponse]] containing the new feedId */ registerFeed: (name: string, description: string, aggregationMethod: string, heartbeatInterval: number, deviationThreshold: number) => Promise; /** * Retrieves an oracle feed by its ID. * * @param feedId The ID of the feed to retrieve * * @returns Promise for an [[OracleFeed]] */ getFeed: (feedId: string) => Promise; /** * Retrieves the latest value for a given feed. * * @param feedId The ID of the feed * * @returns Promise for a [[FeedValue]] */ getValue: (feedId: string) => Promise; /** * Submits an observation for a given feed. * * @param feedId The ID of the feed * @param value The observed value * @param timestamp The observation timestamp * * @returns Promise for a [[SubmitObservationResponse]] */ submitObservation: (feedId: string, value: string, timestamp: number) => Promise; /** * Retrieves an attestation for a feed at a given epoch. * * @param feedId The ID of the feed * @param epoch The epoch number * * @returns Promise for an [[OracleAttestation]] */ getAttestation: (feedId: string, epoch: number) => Promise; /** * Returns the health status of the OracleVM. * * @returns Promise for an [[OracleHealthResponse]] */ health: () => Promise; /** * This class should not be instantiated directly. Instead use the [[Lux.addAPI]] method. * * @param core A reference to the Lux class * @param baseURL Defaults to the string "/ext/bc/O/rpc" as the path to rpc's baseURL */ constructor(core: LuxCore, baseURL?: string); } //# sourceMappingURL=api.d.ts.map