oceanprotocol/ocean.js

Wrong type for getComputeEnvironments function

Closed this issue · 1 comments

With the change to the multichain provider, the returned data from getComputeEnvironments function have a different type than indicated. Now the type should be something like:

Promise<{[chainId: number]: ComputeEnvironment[]>

/** Get Compute Environments
* @return {Promise<ComputeEnvironment[]>} urlDetails
*/
public async getComputeEnvironments(
providerUri: string,
signal?: AbortSignal
): Promise<ComputeEnvironment[]> {
const providerEndpoints = await this.getEndpoints(providerUri)
const serviceEndpoints = await this.getServiceEndpoints(

Multichain provider and old provider returns data differently. Is it possible to make it that this function will check the version of the provider and returns data in the same format for both providers?

Maybe other provider endpoints are also effected by this.