UNPKG

@witnet/ethers

Version:

Wit/Oracle Ethers Framework package for EVM-compatible projects

102 lines 5.45 kB
import { ContractTransactionReceipt, JsonRpcSigner } from "ethers"; import { Witnet } from "@witnet/sdk"; import { WitArtifact } from "./WitArtifact"; /** * 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. */ export declare class WitOracleRadonRegistry extends WitArtifact { constructor(signer: JsonRpcSigner, network: string); /** * Determines the unique hash that would identify the given Radon Retrieval, if it was * formally verified into the connected EVM network. * @param retrieval Instance of a Radon Retrieval object. */ determineRadonRetrievalHash(retrieval: Witnet.Radon.RadonRetrieval): Promise<string>; /** * Returns information related to some previously verified Radon Request, on the connected EVM network. * @param radHash The RAD hash that uniquely identifies the Radon Request. */ lookupRadonRequest(radHash: string): Promise<Witnet.Radon.RadonRequest>; /** * Returns the bytecode of some previously verified Radon Request, on the connected EVM network. * @param radHash The RAD hash that uniquely identifies the Radon Request. */ lookupRadonRequestBytecode(radHash: string): Promise<Witnet.HexString>; /** * Returns information about some previously verified Radon Retrieval on the connected EVM network. * This information includes retrieval the method, URL, body, headers and the Radon script in charge * to transform data before delivery, on the connected EVM network. * @param radHash The RAD hash that uniquely identifies the Radon Request. */ lookupRadonRetrieval(hash: string): Promise<Witnet.Radon.RadonRetrieval>; /** * Formally verify the given Radon Request object into the connected EVM network. * It also verifies all the Radon Retrieval scripts (i.e. data source) the Request * relies on, if not yet done before. * * Verifying Radon assets modifies the EVM storage and therefore requires * spending gas in proportion to the number and complexity of the data sources, * and whether these had been previously verified before or not. * * If the given Radon Request happened to be already verified, no gas would be actually consumed. * * @param request Instance of a Radon Request object. * @param options Async EVM transaction handlers. * @returns The RAD hash of the Radon Request, as verified on the connected EVM network. */ verifyRadonRequest(request: Witnet.Radon.RadonRequest, options?: { /** * Number of block confirmations to wait for after verifying transaction gets mined (defaults to 1). */ confirmations?: number; /** * Callback handler called just in case a `verifyRadonRequest` transaction is ultimately required. */ onVerifyRadonRequest: (radHash: string) => any; /** * Callback handler called once the `verifyRadonRequest` transaction gets confirmed. * @param receipt The `verifyRadonRequest` transaction receipt. */ onVerifyRadonRequestReceipt?: (receipt: ContractTransactionReceipt | null) => any; /** * Callback handler called for every involved `verifyRadonRetrieval` transaction. */ onVerifyRadonRetrieval?: (hash: string) => any; /** * Callback handler called after every involved `verifyRadonRetrieval` transaction gets confirmed. * @param receipt The `verifyRadonRetrieval` transaction receipt. */ onVerifyRadonRetrievalReceipt?: (receipt: ContractTransactionReceipt | null) => any; }): Promise<string>; /** * Formally verify the given Radon Retrieval script (i.e. data source), into the connected EVM network. * * Verifying Radon assets modifies the EVM storage and therefore requires * spending gas in proportion to the size of the data source parameters (e.g. URL, body, headers, or Radon script). * * If the given Radon Retrieval object happened to be already verified, no EVM gas would be actually consumed. * * @param request Instance of a Radon Retrieval object. * @param options Async EVM transaction handlers. * @returns The unique hash of the Radon Retrieval object, as verified on the connected EVM network. */ verifyRadonRetrieval(retrieval: Witnet.Radon.RadonRetrieval, options?: { /** * Number of block confirmations to wait for after verifying transaction gets mined (defaults to 1). */ confirmations?: number; /** * Callback handler called just in case a `verifyRadonRequest` transaction is ultimately required. */ onVerifyRadonRetrieval?: (hash: string) => any; /** * Callback handler called once the `verifyRadonRetrieval` transaction gets confirmed. * @param receipt The `verifyRadonRetrieval` transaction receipt. */ onVerifyRadonRetrievalReceipt?: (receipt: ContractTransactionReceipt | null) => any; }): Promise<string>; } //# sourceMappingURL=WitOracleRadonRegistry.d.ts.map