/** @type {bigint} */ export const ROUND_MAX: bigint; export function prepareRoundsManagerKit(baggage: any): (args_0: Readonly; brandIn: Brand<"nat">; brandOut: Brand<"nat">; latestRoundPublisher: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder; timerPresence: TimerService; }> & { unitAmountIn: Amount<"nat">; }) => import("@endo/exo").GuardedKit<{ helper: { /** @param {bigint} roundId */ acceptingSubmissions(roundId: bigint): boolean; /** * @param {OracleStatus} status * @param {bigint} roundId */ delayed(status: OracleStatus, roundId: bigint): boolean; /** @param {bigint} roundId */ deleteRoundDetails(roundId: bigint): void; /** @param {bigint} roundId */ isNextRound(roundId: bigint): boolean; /** * @param {bigint} roundId * @param {Timestamp} blockTimestamp * @param {string} oracleId */ initializeNewRound(roundId: bigint, blockTimestamp: Timestamp, oracleId: string): void; /** * @param {bigint} roundId * @param {bigint} rrId reporting round ID */ previousAndCurrentUnanswered(roundId: bigint, rrId: bigint): boolean; /** * @param {bigint} roundId * @param {OracleStatus} status * @param {Timestamp} blockTimestamp * @returns {OracleStatus | undefined} the new status */ proposeNewRound(roundId: bigint, status: OracleStatus, blockTimestamp: Timestamp): OracleStatus | undefined; /** * @param {bigint} submission * @param {bigint} roundId * @param {OracleStatus} status * @returns {OracleStatus} the new status */ recordSubmission(submission: bigint, roundId: bigint, status: OracleStatus): OracleStatus; /** * @param {bigint} roundId * @param {Timestamp} blockTimestamp */ supersedable(roundId: bigint, blockTimestamp: Timestamp): boolean; /** * @param {bigint} roundId * @param {Timestamp} blockTimestamp */ timedOut(roundId: bigint, blockTimestamp: Timestamp): boolean; /** * @param {bigint} roundId * @param {Timestamp} blockTimestamp */ updateRoundAnswer(roundId: bigint, blockTimestamp: Timestamp): (number | boolean)[] | (bigint | boolean)[]; /** * @param {bigint} roundId * @param {Timestamp} blockTimestamp */ updateTimedOutRoundInfo(roundId: bigint, blockTimestamp: Timestamp): void; /** * @param {OracleStatus} status * @param {bigint} roundId * @param {Timestamp} blockTimestamp * @returns {string | null} error message, if there is one */ validateOracleRound(status: OracleStatus, roundId: bigint, blockTimestamp: Timestamp): string | null; }; contract: { /** @param {PriceQuoteValue} quote */ authenticateQuote(quote: PriceQuoteValue): Promise<{ quoteAmount: import("@agoric/ertp").SetAmount; quotePayment: globalThis.Payment<"set", PriceDescription>; }>; /** * @param {object} param0 * @param {number} [param0.overrideValueOut] * @param {Timestamp} [param0.timestamp] */ makeCreateQuote({ overrideValueOut, timestamp }?: { overrideValueOut?: number | undefined; timestamp?: Timestamp | undefined; }): ((priceQuery: any) => Promise<{ quoteAmount: import("@agoric/ertp").SetAmount; quotePayment: globalThis.Payment<"set", PriceDescription>; }> | undefined) & RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, (priceQuery: any) => Promise<{ quoteAmount: import("@agoric/ertp").SetAmount; quotePayment: globalThis.Payment<"set", PriceDescription>; }> | undefined>; /** * @param {OracleStatus} status * @param {bigint} queriedRoundId * @param {Timestamp} blockTimestamp */ eligibleForSpecificRound(status: OracleStatus, queriedRoundId: bigint, blockTimestamp: Timestamp): boolean; /** * consumers are encouraged to check that they're receiving fresh data * by inspecting the updatedAt and answeredInRound return values. * * @param {bigint | number} roundIdRaw * @returns {Promise} */ getRoundData(roundIdRaw: bigint | number): Promise; getRoundStatus(roundId: bigint): Readonly; /** * a method to provide all current info oracleStatuses need. Intended * only to be callable by oracleStatuses. Not for use by contracts to * read state. * * @param {OracleStatus} status * @param {Timestamp} blockTimestamp */ oracleRoundStateSuggestRound(status: OracleStatus, blockTimestamp: Timestamp): { eligibleForSpecificRound: boolean; queriedRoundId: bigint; latestSubmission: bigint; startedAt: Timestamp; roundTimeout: number; }; }; oracle: { /** * push a unitPrice result from this oracle * * @param {OracleStatus} status * @param {PriceRound} result */ handlePush(status: OracleStatus, { roundId: roundIdRaw, unitPrice: valueRaw }: PriceRound): Promise; }; }>; export type PriceRound = { roundId: number | undefined; unitPrice: NatValue; }; export type LatestRound = Pick & { startedBy: string; }; export type RoundData = Round & { roundId: bigint; }; export type Round = { /** * the answer for the given round */ answer: bigint; /** * the timestamp when the round was started. * This is 0 if the round hasn't been started yet. */ startedAt: Timestamp; /** * the timestamp when the round last was updated * (i.e. answer was last computed) */ updatedAt: Timestamp; /** * the round ID of the round in which the * answer was computed. answeredInRound may be smaller than roundId when the * round timed out. answeredInRound is equal to roundId when the round didn't * time out and was completed regularly. */ answeredInRound: bigint; }; export type RoundDetails = { submissions: bigint[]; maxSubmissions: number; minSubmissions: number; roundTimeout: number; }; export type QuoteKit = IssuerKit<"set", PriceDescription>; export type HeldParams = Readonly; brandIn: Brand<"nat">; brandOut: Brand<"nat">; latestRoundPublisher: import("@agoric/zoe/src/contractSupport/recorder.js").Recorder; timerPresence: TimerService; }>; export type ImmutableState = Readonly; rounds: MapStore; unitIn: bigint; }>; export type MutableState = { lastValueOutForUnitIn: bigint | null; reportingRoundId: bigint; }; export type State = ImmutableState & MutableState; import type { TimerService } from '@agoric/time'; import type { OracleStatus } from './priceOracleKit.js'; import type { Timestamp } from '@agoric/time'; import type { PriceQuoteValue } from '@agoric/zoe/tools/types.js'; import type { PriceDescription } from '@agoric/zoe/tools/types.js'; import type { MapStore } from '@agoric/store'; //# sourceMappingURL=roundsManager.d.ts.map