UNPKG

@witnet/ethers

Version:

Wit/Oracle Ethers Framework package for EVM-compatible projects

105 lines 5.48 kB
import { BlockTag, JsonRpcSigner } from "ethers"; import { Witnet } from "@witnet/sdk"; import { WitOracleQuery, WitOracleQueryParams, WitOracleQueryResponse, WitOracleQueryStatus } from "../types"; import { WitArtifact } from "./WitArtifact"; import { WitOracleConsumer } from "./WitOracleConsumer"; import { WitOracleRadonRegistry } from "./WitOracleRadonRegistry"; import { WitOracleRadonRequestFactory, WitOracleRadonRequestModal, WitOracleRadonRequestTemplate } from "./WitOracleRadonRequestFactory"; import { WitPriceFeeds } from "./WitPriceFeeds"; import { WitPriceFeedsLegacy } from "./WitPriceFeedsLegacy"; import { WitRandomness } from "./WitRandomness"; /** * Wrapper class for the Wit/Oracle contract as deployed in some specified EVM network. * It provides wrappers to other main artifacts of the Wit/Oracle Framework, as well * as factory methods for wrapping existing `WitOracleRadonRequestTemplate` and `WitOracleConsumer` * compliant contracts, provably bound to the Wit/Oracle core contract. * */ export declare class WitOracle extends WitArtifact { constructor(signer: JsonRpcSigner, network: string); /** * Create a WitOracle attached to the Wit/Oracle main address on the connected EVM network. * Fails if the EVM network served at the specified JSON ETH/RPC endpoint, is not currently bridged * to the Witnet blockchain. * @param url ETH/RPC endpoint URL. * @param signer Specific signer address, other than default, to use for signing EVM transactions. */ static fromJsonRpcUrl(url: string, signerId?: number | string): Promise<WitOracle>; estimateBaseFee(evmGasPrice: bigint): Promise<bigint>; estimateBaseFeeWithCallback(evmGasPrice: bigint, evmCallbackGas: number): Promise<bigint>; estimateExtraFee(evmGasPrice: bigint, evmWitPrice: bigint, queryParams: WitOracleQueryParams): Promise<bigint>; filterWitOracleQueryEvents(options: { fromBlock: BlockTag; toBlock?: BlockTag; where?: { evmRequester?: string; queryRadHash?: Witnet.Hash; }; }): Promise<Array<{ evmBlockNumber: bigint; evmRequester: string; evmTransactionHash: string; queryId: bigint; queryRadHash: Witnet.Hash; queryParams: WitOracleQueryParams; }>>; filterWitOracleReportEvents(options: { fromBlock: BlockTag; toBlock?: BlockTag; where?: { evmOrigin?: string; evmConsumer?: string; queryRadHash?: Witnet.Hash; }; }): Promise<Array<{ evmBlockNumber: bigint; evmOrigin: string; evmConsumer: string; evmReporter: string; evmTransactionHash: string; witDrTxHash: Witnet.Hash; queryRadHash: Witnet.Hash; queryParams: WitOracleQueryParams; resultCborBytes: Witnet.HexString; resultTimestamp: number; }>>; getEvmChainId(): Promise<number>; getEvmChannel(): Promise<Witnet.HexString>; getNextQueryId(): Promise<bigint>; getQuery(queryId: bigint): Promise<WitOracleQuery>; getQueryResponse(queryId: bigint): Promise<WitOracleQueryResponse>; getQueryResultStatusDescription(queryId: bigint): Promise<string>; getQueryStatuses(queryIds: bigint[]): Promise<Array<WitOracleQueryStatus>>; getWitOracleConsumerAt(target: string): Promise<WitOracleConsumer>; /** * Wrapper class for the Wit/Oracle Radon Registry core contract as deployed in some supported EVM network. * It allows formal verification of Radon Requests and Witnet-compliant data sources into such network, * as to be securely referred on both Wit/Oracle queries pulled from within smart contracts, * or Wit/Oracle query results pushed into smart contracts from offchain workflows. */ getWitOracleRadonRegistry(): Promise<WitOracleRadonRegistry>; /** * Wrapper class for the Wit/Oracle Request Factory core contract as deployed in some supported EVM network. * It allows construction of `WitOracleRadonRequestTemplate` minimal-proxy contracts out of one ore more * parameterized Radon Retievals (Witnet-compliant data sources). Template addresses are counter-factual to * the set of data sources they are built on. */ getWitOracleRadonRequestFactory(): Promise<WitOracleRadonRequestFactory>; /** * Wrapper class for Wit/Oracle Radon Template artifacts as deployed in some supported EVM network. * `IWitOracleRadonRequestTemplate` contracts enable smart contracts to formally verify Radon Requests * built out out of a set of parameterized Witnet-compliant data sources, on the fly. */ getWitOracleRadonRequestTemplateAt(target: string): Promise<WitOracleRadonRequestTemplate>; /** * Wrapper class for Wit/Oracle Radon Modal artifacts as deployed in some supported EVM network. * `IWitOracleRadonRequestModal` contracts enable smart contracts to formally verify Radon Requests * built out out of a single Radon Retrieval and multiple data providers, all of them expected to * provided exactly the same data. */ getWitOracleRadonRequestModalAt(target: string): Promise<WitOracleRadonRequestModal>; getWitPriceFeedsAt(target: string): Promise<WitPriceFeeds>; getWitPriceFeedsLegacyAt(target: string): Promise<WitPriceFeedsLegacy>; getWitRandomnessAt(target: string): Promise<WitRandomness>; } //# sourceMappingURL=WitOracle.d.ts.map