UNPKG

@iexec/iexec-oracle-factory-wrapper

Version:
36 lines (35 loc) 1.43 kB
import { AbstractProvider, Eip1193Provider } from 'ethers'; import { OracleValue, OracleReaderOptions, ParamSet, Web3ReadOnlyProvider, Web3SignerProvider, DataType, ParamSetCID, OracleID } from '../types/index.js'; /** * Oracle Reader that interacts with iExec Oracle. */ declare class IExecOracleReader { /** * Ethereum contract address or ENS (Ethereum Name Service) for the oracle contract. */ private oracleContract; /** * IPFS gateway URL. */ private ipfsGateway; /** * Ethereum provider. */ private ethersProvider; /** * Creates an instance of IExecOracleReader. * @param {Provider} [ethProviderOrNetwork] Ethereum provider, chainId or network name. * @param {OracleReaderOptions} [options] Options for the Oracle Reader. */ constructor(ethProviderOrNetwork?: Web3ReadOnlyProvider | Web3SignerProvider | AbstractProvider | Eip1193Provider | string | number, options?: OracleReaderOptions); /** * Reads data from the oracle. * @param paramSetOrCidOrOracleId Parameters, CID or Oracle ID to read. * @param options Options for reading the oracle. * @returns {Promise<OracleValue>} Promise that resolves to the read oracle data. */ readOracle(paramSetOrCidOrOracleId: ParamSet | ParamSetCID | OracleID, options?: { dataType?: DataType; }): Promise<OracleValue>; } export { IExecOracleReader };