import Web3 from 'web3'; import { FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults } from '../@types/'; export interface HttpCallback { (httpMethod: string, url: string, body: string, header: any): Promise; } export interface ServiceEndpoint { serviceName: string; method: string; urlPath: string; } export interface UserCustomParameters { [key: string]: any; } export declare class Provider { /** * Returns the provider endpoints * @return {Promise} */ getEndpoints(providerUri: string): Promise; getEndpointURL(servicesEndpoints: ServiceEndpoint[], serviceName: string): ServiceEndpoint; /** * Returns the service endpoints that exist in provider. * @param {any} endpoints * @return {Promise} */ getServiceEndpoints(providerEndpoint: string, endpoints: any): Promise; /** Gets current nonce * @param {string} providerUri provider uri address * @param {string} consumerAddress Publisher address * @param {AbortSignal} signal abort signal * @param {string} providerEndpoints Identifier of the asset to be registered in ocean * @param {string} serviceEndpoints document description object (DDO)= * @return {Promise} urlDetails */ getNonce(providerUri: string, consumerAddress: string, signal?: AbortSignal, providerEndpoints?: any, serviceEndpoints?: ServiceEndpoint[]): Promise; signProviderRequest(web3: Web3, accountId: string, message: string, password?: string): Promise; /** Encrypt data using the Provider's own symmetric key * @param {string} data data in json format that needs to be sent , it can either be a DDO or a File array * @param {string} providerUri provider uri address * @param {AbortSignal} signal abort signal * @return {Promise} urlDetails */ encrypt(data: any, providerUri: string, signal?: AbortSignal): Promise; /** Get DDO File details (if possible) * @param {string} did did * @param {number} serviceId the id of the service for which to check the files * @param {string} providerUri uri of the provider that will be used to check the file * @param {AbortSignal} signal abort signal * @param {boolean} checksum if true, will return checksum of files content * @return {Promise} urlDetails */ checkDidFiles(did: string, serviceId: string, providerUri: string, withChecksum?: boolean, signal?: AbortSignal): Promise; /** Get URL details (if possible) * @param {string} url or did * @param {string} providerUri uri of the provider that will be used to check the file * @param {AbortSignal} signal abort signal * @param {boolean} checksum if true, will return checksum of files content * @return {Promise} urlDetails */ checkFileUrl(url: string, providerUri: string, signal?: AbortSignal, headers?: any, checksum?: boolean): Promise; /** Get Compute Environments * @return {Promise} urlDetails */ getComputeEnvironments(providerUri: string, signal?: AbortSignal): Promise; /** Initialize a service request. * @param {DDO | string} asset * @param {number} serviceIndex * @param {string} serviceType * @param {string} consumerAddress * @param {UserCustomParameters} userCustomParameters * @param {string} providerUri Identifier of the asset to be registered in ocean * @param {AbortSignal} signal abort signal * @return {Promise} ProviderInitialize data */ initialize(did: string, serviceId: string, fileIndex: number, consumerAddress: string, providerUri: string, signal?: AbortSignal, userCustomParameters?: UserCustomParameters, computeEnv?: string, validUntil?: number): Promise; /** Initialize a compute request. * @param {ComputeAsset} assets * @param {ComputeAlgorithmber} algorithm * @param {string} computeEnv * @param {number} validUntil * @param {string} providerUri Identifier of the asset to be registered in ocean * @param {string} accountId * @param {AbortSignal} signal abort signal * @return {Promise} ProviderComputeInitialize data */ initializeCompute(assets: ComputeAsset[], algorithm: ComputeAlgorithm, computeEnv: string, validUntil: number, providerUri: string, accountId: string, signal?: AbortSignal): Promise; /** Gets fully signed URL for download * @param {string} did * @param {string} accountId * @param {string} serviceId * @param {number} fileIndex * @param {string} providerUri * @param {Web3} web3 * @param {UserCustomParameters} userCustomParameters * @return {Promise} */ getDownloadUrl(did: string, accountId: string, serviceId: string, fileIndex: number, transferTxId: string, providerUri: string, web3: Web3, userCustomParameters?: UserCustomParameters): Promise; /** Instruct the provider to start a compute job * @param {string} did * @param {string} consumerAddress * @param {string} computeEnv * @param {ComputeAlgorithm} algorithm * @param {string} providerUri * @param {Web3} web3 * @param {AbortSignal} signal abort signal * @param {ComputeOutput} output * @return {Promise} */ computeStart(providerUri: string, web3: Web3, consumerAddress: string, computeEnv: string, dataset: ComputeAsset, algorithm: ComputeAlgorithm, signal?: AbortSignal, additionalDatasets?: ComputeAsset[], output?: ComputeOutput): Promise; /** Instruct the provider to Stop the execution of a to stop a compute job. * @param {string} did * @param {string} consumerAddress * @param {string} jobId * @param {string} providerUri * @param {Web3} web3 * @param {AbortSignal} signal abort signal * @return {Promise} */ computeStop(did: string, consumerAddress: string, jobId: string, providerUri: string, web3: Web3, signal?: AbortSignal): Promise; /** Get compute status for a specific jobId/documentId/owner. * @param {string} providerUri The URI of the provider we want to query * @param {string} consumerAddress The consumer ethereum address * @param {string} jobId The ID of a compute job. * @param {string} did The ID of the asset * @param {AbortSignal} signal abort signal * @return {Promise} */ computeStatus(providerUri: string, consumerAddress: string, jobId?: string, did?: string, signal?: AbortSignal): Promise; /** Get compute result url * @param {string} providerUri The URI of the provider we want to query * @param {Web3} web3 Web3 instance * @param {string} consumerAddress The consumer ethereum address * @param {string} jobId The ID of a compute job. * @param {number} index Result index * @return {Promise} */ getComputeResultUrl(providerUri: string, web3: Web3, consumerAddress: string, jobId: string, index: number): Promise; /** Deletes a compute job. * @param {string} did * @param {string} consumerAddress * @param {string} jobId * @param {string} providerUri * @param {Web3} web3 * @param {AbortSignal} signal abort signal * @return {Promise} */ computeDelete(did: string, consumerAddress: string, jobId: string, providerUri: string, web3: Web3, signal?: AbortSignal): Promise; /** Check for a valid provider at URL * @param {String} url provider uri address * @param {AbortSignal} signal abort signal * @return {Promise} string */ isValidProvider(url: string, signal?: AbortSignal): Promise; } export declare const ProviderInstance: Provider; export default ProviderInstance;