@agoric/zoe
Version:
Zoe: the Smart Contract Framework for Offer Enforcement
77 lines • 2.25 kB
TypeScript
type OracleAdmin<R extends unknown> = {
/**
* Remove the oracle from the aggregator
*/
delete: () => Promise<void>;
/**
* Rather than waiting for the polling query, push a result directly from this oracle
*/
pushResult: (result: R) => Promise<void>;
};
type OracleKey = {} | string;
type PriceAggregatorKit = Pick<import("./priceAggregator").PriceAggregatorContract, "creatorFacet" | "publicFacet">;
type OracleQuery = Record<string, unknown> & {
kind?: string;
increment?: bigint;
};
/**
* The public methods accessible from the contract instance
*/
type OraclePublicFacet = {
/**
* Create an invitation for an oracle query
*/
makeQueryInvitation: (query: OracleQuery) => ERef<Invitation>;
/**
* Make an unpaid query
*/
query: (query: OracleQuery) => ERef<unknown>;
};
type OracleCreatorFacetMakeWithdrawInvitation = (total?: boolean | undefined) => ERef<Invitation>;
/**
* The private methods accessible from the contract instance
*/
type OracleCreatorFacet = {
/**
* Get the current fee amounts
*/
getCurrentFees: () => AmountKeywordRecord;
/**
* Create an invitation to withdraw fees
*/
makeWithdrawInvitation: OracleCreatorFacetMakeWithdrawInvitation;
/**
* Make an invitation to withdraw all fees and shutdown
*/
makeShutdownInvitation: () => Promise<Invitation>;
};
type OraclePrivateParameters = {
oracleHandler: OracleHandler;
};
type OracleInitializationFacet = {
initialize: (privateParams: OraclePrivateParameters) => OracleCreatorFacet;
};
type OracleKit = {
creatorFacet: OracleCreatorFacet;
publicFacet: OraclePublicFacet;
instance: Instance;
};
type OracleReply = {
reply: unknown;
requiredFee?: globalThis.Amount | undefined;
};
type OracleHandler = {
/**
* Callback to reply to a query
*/
onQuery: (query: OracleQuery, fee: Amount) => Promise<OracleReply>;
/**
* Notice an error
*/
onError: (query: OracleQuery, reason: unknown) => void;
/**
* Notice a successful reply
*/
onReply: (query: OracleQuery, reply: unknown, requiredFee: Amount | undefined) => void;
};
//# sourceMappingURL=priceAggregatorTypes.d.ts.map