# Overview Here is an overview of all ot the main functions and submodules: ### Ocean instance Create/get datatoken, get dtfactory, user orders (history) ``` import { Ocean } from '@oceanprotocol/lib' const ocean = await Ocean.getInstance(config) ``` Then use the following submodules... # Assets Publish, get, list, search, order, consume/download ```Typescript ocean.asset.getInstance(config: InstantiableConfig): Promise; ``` ```Typescript ocean.asset.create(metadata: Metadata, publisher: Account, services?: Service[], dtAddress?: string, cap?: string, name?: string, symbol?: string, providerUri?: string): SubscribablePromise; ``` ```Typescript ocean.asset.ownerAssets(owner: string): Promise; ``` ```Typescript ocean.asset.resolve(did: string): Promise; ``` ```Typescript ocean.asset.resolveByDTAddress(dtAddress: string, offset?: number, page?: number, sort?: number): Promise; ``` ```Typescript ocean.asset.editMetadata(ddo: DDO, newMetadata: EditableMetadata): Promise; ``` ```Typescript ocean.asset.updateMetadata(ddo: DDO, consumerAccount: string): Promise; ``` ```Typescript ocean.asset.editServiceTimeout(ddo: DDO, serviceIndex: number, timeout: number): Promise; ``` ```Typescript ocean.asset.creator(did: string): Promise; ``` ```Typescript ocean.asset.query(query: SearchQuery): Promise; ``` ```Typescript ocean.asset.search(text: string): Promise; ``` ```Typescript ocean.asset.getServiceByType(did: string, serviceType: string): Promise; ``` ```Typescript ocean.asset.getServiceByIndex(did: string, serviceIndex: number): Promise; ``` ```Typescript ocean.asset.createAccessServiceAttributes(creator: Account, cost: string, datePublished: string, timeout?: number, providerUri?: string): Promise; ``` ```Typescript ocean.asset.initialize(did: string, serviceType: string, consumerAddress: string, serviceIndex: number, serviceEndpoint: string): Promise; ``` ```Typescript ocean.asset.order(did: string, serviceType: string, payerAddress: string, serviceIndex?: number, mpAddress?: string, consumerAddress?: string, searchPreviousOrders?: boolean): Promise; ``` ```Typescript ocean.asset.download(did: string, txId: string, tokenAddress: string, consumerAccount: Account, destination: string): Promise; ``` ```Typescript ocean.asset.simpleDownload(dtAddress: string, serviceEndpoint: string, txId: string, account: string): Promise; ``` ```Typescript ocean.asset.getOrderHistory(account: Account, serviceType?: string, fromBlock?: number): Promise; ``` # Datatoken Pool Create, add/remove liquidity, check liquidity, price, buy datatokens ```Typescript ocean.pool. ``` ```Typescript ocean.pool.createDTPool(account: string, token: string, amount: string, weight: string, fee: string): Promise; ``` ```Typescript ocean.pool.getDTAddress(poolAddress: string): Promise; ``` ```Typescript ocean.pool.getOceanReserve(poolAddress: string): Promise; ``` ```Typescript ocean.pool.getDTReserve(poolAddress: string): Promise; ``` ```Typescript ocean.pool.getMaxBuyQuantity(poolAddress: string, tokenAddress: string): Promise; ``` ```Typescript ocean.pool.getOceanMaxBuyQuantity(poolAddress: string): Promise; ``` ```Typescript ocean.pool.getDTMaxBuyQuantity(poolAddress: string): Promise; ``` ```Typescript ocean.pool.calcInGivenOut(poolAddress: string, tokenInAddress: string, tokenOutAddress: string, tokenOutAmount: string): Promise; ``` ```Typescript ocean.pool.calcOutGivenIn(poolAddress: string, tokenInAddress: string, tokenOutAddress: string, tokenInAmount: string): Promise; ``` ```Typescript ocean.pool.calcPoolOutGivenSingleIn(poolAddress: string, tokenInAddress: string, tokenInAmount: string): Promise; ``` ```Typescript ocean.pool.calcSingleInGivenPoolOut(poolAddress: string, tokenInAddress: string, poolShares: string): Promise; ``` ```Typescript ocean.pool.calcSingleOutGivenPoolIn(poolAddress: string, tokenOutAddress: string, poolShares: string): Promise; ``` ```Typescript ocean.pool.calcPoolInGivenSingleOut(poolAddress: string, tokenOutAddress: string, tokenOutAmount: string): Promise; ``` ```Typescript ocean.pool.getPoolSharesRequiredToRemoveDT(poolAddress: string, dtAmount: string): Promise; ``` ```Typescript ocean.pool.getDTRemovedforPoolShares(poolAddress: string, poolShares: string): Promise; ``` ```Typescript ocean.pool.getPoolSharesRequiredToRemoveOcean(poolAddress: string, oceanAmount: string): Promise; ``` ```Typescript ocean.pool.getOceanRemovedforPoolShares(poolAddress: string, poolShares: string): Promise; ``` ```Typescript ocean.pool.getTokensRemovedforPoolShares(poolAddress: string, poolShares: string): Promise; ``` ```Typescript ocean.pool.getDTMaxAddLiquidity(poolAddress: string): Promise; ``` ```Typescript ocean.pool.getOceanMaxAddLiquidity(poolAddress: string): Promise; ``` ```Typescript ocean.pool.getMaxAddLiquidity(poolAddress: string, tokenAddress: string): Promise; ``` ```Typescript ocean.pool.getMaxRemoveLiquidity(poolAddress: string, tokenAddress: string): Promise; ``` ```Typescript ocean.pool.getDTMaxRemoveLiquidity(poolAddress: string): Promise; ``` ```Typescript ocean.pool.getOceanMaxRemoveLiquidity(poolAddress: string): Promise; ``` ```Typescript ocean.pool.buyDT(account: string, poolAddress: string, dtAmountWanted: string, maxOceanAmount: string, maxPrice?: string): Promise; ``` ```Typescript ocean.pool.sellDT(account: string, poolAddress: string, dtAmount: string, oceanAmountWanted: string, maxPrice?: string): Promise; ``` ```Typescript ocean.pool.addDTLiquidity(account: string, poolAddress: string, amount: string): Promise; ``` ```Typescript ocean.pool.removeDTLiquidity(account: string, poolAddress: string, amount: string, maximumPoolShares: string): Promise; ``` ```Typescript ocean.pool.addOceanLiquidity(account: string, poolAddress: string, amount: string): Promise; ``` ```Typescript ocean.pool.removeOceanLiquidity(account: string, poolAddress: string, amount: string, maximumPoolShares: string): Promise; ``` ```Typescript ocean.pool.removePoolLiquidity(account: string, poolAddress: string, poolShares: string, minDT?: string, minOcean?: string): Promise; ``` ```Typescript ocean.pool.getDTPrice(poolAddress: string): Promise; ``` ```Typescript ocean.pool.searchPoolforDT(dtAddress: string): Promise; ``` ```Typescript ocean.pool.getOceanNeeded(poolAddress: string, dtRequired: string): Promise; ``` ```Typescript ocean.pool.getOceanReceived(poolAddress: string, dtSold: string): Promise; ``` ```Typescript ocean.pool.getDTNeeded(poolAddress: string, OceanRequired: string): Promise; ``` ```Typescript ocean.pool.getPoolsbyCreator(account?: string): Promise; ``` ```Typescript ocean.pool.getPoolDetails(poolAddress: string): Promise; ``` ```Typescript ocean.pool.getPoolLogs(poolAddress: string, account?: string): Promise; ``` ```Typescript ocean.pool.getAllPoolLogs(account: string): Promise; ``` # Fixed rate exchange Create, price, buy datatokens ```Typescript ocean.exchange.create(dataToken: string, rate: string, address: string): Promise; ``` ```Typescript ocean.exchange.generateExchangeId(dataToken: string, owner: string): Promise; ``` ```Typescript ocean.exchange.buyDT(exchangeId: string, dataTokenAmount: string, address: string): Promise; ``` ```Typescript ocean.exchange.getNumberOfExchanges(): Promise; ``` ```Typescript ocean.exchange.setRate(exchangeId: string, newRate: number, address: string): Promise; ``` ```Typescript ocean.exchange.activate(exchangeId: string, address: string): Promise; ``` ```Typescript ocean.exchange.deactivate(exchangeId: string, address: string): Promise; ``` ```Typescript ocean.exchange.getRate(exchangeId: string): Promise; ``` ```Typescript ocean.exchange.getSupply(exchangeId: string): Promise; ``` ```Typescript ocean.exchange.getOceanNeeded(exchangeId: string, dataTokenAmount: string): Promise; ``` ```Typescript ocean.exchange.getExchange(exchangeId: string): Promise; ``` ```Typescript ocean.exchange.getExchanges(): Promise; ``` ```Typescript ocean.exchange.isActive(exchangeId: string): Promise; ``` ```Typescript ocean.exchange.CalcInGivenOut(exchangeId: string, dataTokenAmount: string): Promise; ``` ```Typescript ocean.exchange.searchforDT(dataTokenAddress: string, minSupply: string): Promise; ``` ```Typescript ocean.exchange.getExchangesbyCreator(account?: string): Promise; ``` ```Typescript ocean.exchange.getExchangeSwaps(exchangeId: string, account?: string): Promise; ``` ```Typescript ocean.exchange.getAllExchangesSwaps(account: string): Promise; ``` # Compute-to-data consume/start, stop, results, status, define-service ```Typescript ocean.compute.start(did: string, txId: string, tokenAddress: string, consumerAccount: Account, algorithmDid?: string, algorithmMeta?: MetadataAlgorithm, output?: Output, serviceIndex?: string, serviceType?: string, algorithmTransferTxId?: string, algorithmDataToken?: string): Promise; ``` ```Typescript ocean.compute.stop(consumerAccount: Account, did: string, jobId: string): Promise; ``` ```Typescript ocean.compute.delete(consumerAccount: Account, did: string, jobId: string): Promise; ``` ```Typescript ocean.compute.status(consumerAccount: Account, did?: string, jobId?: string): Promise; ``` ```Typescript ocean.compute.result(consumerAccount: Account, did: string, jobId: string): Promise; ``` ```Typescript ocean.compute.createServerAttributes(serverId: string, serverType: string, cost: string, cpu: string, gpu: string, memory: string, disk: string, maxExecutionTime: number): Server; ``` ```Typescript ocean.compute.createContainerAttributes(image: string, tag: string, checksum: string): Container; ``` ```Typescript ocean.compute.createClusterAttributes(type: string, url: string): Cluster; ``` ```Typescript ocean.compute.createProviderAttributes(type: string, description: string, cluster: Cluster, containers: Container[], servers: Server[]): { type: string; description: string; environment: { cluster: Cluster; supportedServers: Server[]; supportedContainers: Container[]; }; }; ``` ```Typescript ocean.compute.createComputeService(consumerAccount: Account, cost: string, datePublished: string, providerAttributes: any, computePrivacy?: ServiceComputePrivacy, timeout?: number, providerUri?: string): ServiceCompute; ``` ```Typescript ocean.compute.order(consumerAccount: string, datasetDid: string, serviceIndex: number, algorithmDid?: string, algorithmMeta?: MetadataAlgorithm, mpAddress?: string): SubscribablePromise; ```