mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
Matthias Kretschmann
40754ca46a
* refactor all .order() methods to use one single method * remove `index` parameter from ocean.assets.order() * update compute test flow
56 lines
1.4 KiB
TypeScript
56 lines
1.4 KiB
TypeScript
import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract'
|
|
|
|
import { ServiceUtils } from './ServiceUtils'
|
|
import { ServiceAgreement } from './ServiceAgreement'
|
|
import { SignatureUtils } from './SignatureUtils'
|
|
import { WebServiceConnector } from './WebServiceConnector'
|
|
|
|
/**
|
|
* Utils internal submodule of Ocean Protocol.
|
|
*/
|
|
export class OceanUtils extends Instantiable {
|
|
/**
|
|
* Returns the instance of OceanUtils.
|
|
* @return {Promise<OceanUtils>}
|
|
*/
|
|
public static async getInstance(config: InstantiableConfig): Promise<OceanUtils> {
|
|
const instance = new OceanUtils()
|
|
instance.setInstanceConfig(config)
|
|
|
|
instance.agreements = new ServiceAgreement(
|
|
config.ocean,
|
|
config.logger,
|
|
config.web3
|
|
)
|
|
instance.services = new ServiceUtils(config.ocean, config.logger)
|
|
instance.signature = new SignatureUtils(config.web3, config.logger)
|
|
instance.fetch = new WebServiceConnector(config.logger)
|
|
|
|
return instance
|
|
}
|
|
|
|
/**
|
|
* Agreement utils.
|
|
* @type {ServiceAgreement}
|
|
*/
|
|
public agreements: ServiceAgreement
|
|
|
|
/**
|
|
* Service utils.
|
|
* @type {ServiceUtils}
|
|
*/
|
|
public services: ServiceUtils
|
|
|
|
/**
|
|
* Signature utils.
|
|
* @type {SignatureUtils}
|
|
*/
|
|
public signature: SignatureUtils
|
|
|
|
/**
|
|
* Fetch utils.
|
|
* @type {WebServiceConnector}
|
|
*/
|
|
public fetch: WebServiceConnector
|
|
}
|