diff --git a/example/src/AllDdos.tsx b/example/src/AllDdos.tsx index 7711d47..af75a76 100644 --- a/example/src/AllDdos.tsx +++ b/example/src/AllDdos.tsx @@ -15,13 +15,13 @@ export function AllDdos() { async function init() { if (!ocean || !accountId || !accountId) return - const assets = await ocean.assets.ownerAssets(accountId) - // const assets = await ocean.assets.query({ - // page: 1, - // offset: 10, - // query: {}, - // sort: { created: -1 } - // }) + //const assets = await ocean.assets.ownerAssets(accountId) + const assets = await ocean.assets.query({ + page: 1, + offset: 10, + query: {}, + sort: { created: -1 } + }) console.log('assets', assets.results) setDdos(assets.results.slice(0, 4)) } diff --git a/package-lock.json b/package-lock.json index 794dda6..4435bfd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1516,17 +1516,17 @@ } }, "@oceanprotocol/contracts": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-0.5.2.tgz", - "integrity": "sha512-PTMeP8Ixe66F2YMUgVLibg9k7r2db85Syb66tWUpI+dGnt5KzW1SmQOsyVRjp3x8avRAyMFYaOodXp570jnsmQ==" + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-0.5.3.tgz", + "integrity": "sha512-gJ8qQACJgxOPIrPE0OFQ09iYXBAisOGg56EmelQlsMUgp0yY0DKgBntDP83S/Ho1yBjGygqfxCjQrPH63hh/PA==" }, "@oceanprotocol/lib": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.5.3.tgz", - "integrity": "sha512-LYKqgAuf5PNOiGr6Je6v8yupaFmFojiPtkl/gywlBhF/MsMn/PdKLvHRaNge5y69hoJVXfYYEpr0HzyHq9Mx5w==", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.5.5.tgz", + "integrity": "sha512-TJTehUaQnFfNp0dJmw0t15+mpYbTkeF+RX4oc6D5FN7hmlhdvC8kfGf8yeHiqxI2Nb703foFLSSs38MWu/XEpg==", "requires": { "@ethereum-navigator/navigator": "^0.5.0", - "@oceanprotocol/contracts": "^0.5.1", + "@oceanprotocol/contracts": "^0.5.3", "decimal.js": "^10.2.0", "fs": "0.0.1-security", "lzma": "^2.3.2", diff --git a/package.json b/package.json index 446c1f0..43d4e72 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "dist/" ], "dependencies": { - "@oceanprotocol/lib": "^0.5.3", + "@oceanprotocol/lib": "^0.5.5", "axios": "^0.20.0", "decimal.js": "^10.2.1", "web3": "^1.3.0", diff --git a/src/hooks/useCompute/useCompute.ts b/src/hooks/useCompute/useCompute.ts index 536c8b6..81e8a22 100644 --- a/src/hooks/useCompute/useCompute.ts +++ b/src/hooks/useCompute/useCompute.ts @@ -1,10 +1,10 @@ import { useState } from 'react' -import { useOcean } from '../../providers' +import { useOcean } from 'providers' import { ComputeValue } from './ComputeOptions' import { Logger } from '@oceanprotocol/lib' import { MetadataAlgorithm } from '@oceanprotocol/lib/dist/node/ddo/interfaces/MetadataAlgorithm' import { ComputeJob } from '@oceanprotocol/lib/dist/node/ocean/interfaces/ComputeJob' -import { checkAndBuyDT } from '../../utils/dtUtils' +import { checkAndBuyDT } from 'utils/dtUtils' interface UseCompute { compute: ( diff --git a/src/hooks/useConsume/useConsume.ts b/src/hooks/useConsume/useConsume.ts index 93d3bee..3aed28c 100644 --- a/src/hooks/useConsume/useConsume.ts +++ b/src/hooks/useConsume/useConsume.ts @@ -1,8 +1,8 @@ import { useState } from 'react' -import { useOcean } from '../../providers' -import { feedback } from '../../utils' +import { useOcean } from 'providers' +import { feedback } from 'utils' import { DID, Logger, ServiceType } from '@oceanprotocol/lib' -import { checkAndBuyDT } from '../../utils/dtUtils' +import { checkAndBuyDT } from 'utils/dtUtils' interface UseConsume { consume: ( diff --git a/src/hooks/useMetadata/useMetadata.ts b/src/hooks/useMetadata/useMetadata.ts index 7548b4a..a68550a 100644 --- a/src/hooks/useMetadata/useMetadata.ts +++ b/src/hooks/useMetadata/useMetadata.ts @@ -1,9 +1,9 @@ import { useState, useEffect, useCallback } from 'react' import { DID, DDO, Metadata, Logger } from '@oceanprotocol/lib' -import { useOcean } from '../../providers' -import ProviderStatus from '../../providers/OceanProvider/ProviderStatus' -import { getBestDataTokenPrice } from '../../utils/dtUtils' -import { isDDO } from '../../utils' +import { useOcean } from 'providers' +import ProviderStatus from 'providers/OceanProvider/ProviderStatus' +import { getBestDataTokenPrice } from 'utils/dtUtils' +import { isDDO } from 'utils' import BestPrice from './BestPrice' interface UseMetadata { diff --git a/src/hooks/usePublish/usePublish.ts b/src/hooks/usePublish/usePublish.ts index e069269..e89b090 100644 --- a/src/hooks/usePublish/usePublish.ts +++ b/src/hooks/usePublish/usePublish.ts @@ -6,9 +6,9 @@ import { } from '@oceanprotocol/lib/dist/node/ddo/interfaces/Service' import { useState } from 'react' import { DataTokenOptions } from '.' -import { useOcean } from '../../providers' -import ProviderStatus from '../../providers/OceanProvider/ProviderStatus' -import { publishFeedback } from '../../utils' +import { useOcean } from 'providers' +import ProviderStatus from 'providers/OceanProvider/ProviderStatus' +import { publishFeedback } from 'utils' import { PriceOptions } from './PriceOptions' interface UsePublish { diff --git a/src/providers/OceanProvider/OceanProvider.tsx b/src/providers/OceanProvider/OceanProvider.tsx index ecfe9e3..871c60f 100644 --- a/src/providers/OceanProvider/OceanProvider.tsx +++ b/src/providers/OceanProvider/OceanProvider.tsx @@ -12,7 +12,7 @@ import ProviderStatus from './ProviderStatus' import { Ocean, Logger, Account, Config } from '@oceanprotocol/lib' import Web3Modal, { ICoreOptions } from 'web3modal' import { getDefaultProviders } from './getDefaultProviders' -import { getAccountId, getBalance } from '../../utils' +import { getAccountId, getBalance } from 'utils' interface Balance { eth: string | undefined diff --git a/src/utils/dtUtils.ts b/src/utils/dtUtils.ts index dc8e4cb..d1c813e 100644 --- a/src/utils/dtUtils.ts +++ b/src/utils/dtUtils.ts @@ -1,7 +1,7 @@ import { Logger, Ocean, Account, Config } from '@oceanprotocol/lib' import { Decimal } from 'decimal.js' -import Pool from '../hooks/useMetadata/Pool' -import BestPrice from '../hooks/useMetadata/BestPrice' +import Pool from 'hooks/useMetadata/Pool' +import BestPrice from 'hooks/useMetadata/BestPrice' import Web3 from 'web3' export async function getCheapestPool( diff --git a/src/utils/web3.ts b/src/utils/web3.ts index f6fe619..cf9f568 100644 --- a/src/utils/web3.ts +++ b/src/utils/web3.ts @@ -1,6 +1,6 @@ import Web3 from 'web3' import { Account } from '@oceanprotocol/lib' -import { Balance } from '../providers' +import { Balance } from 'providers' export async function getAccountId(web3: Web3): Promise { const accounts = await web3.eth.getAccounts() diff --git a/tsconfig.json b/tsconfig.json index d5e0f81..f3c9f7c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,7 @@ "jsx": "react", "allowSyntheticDefaultImports": true, "esModuleInterop": true, + "baseUrl": "src", "sourceMap": true, "declaration": true, "importHelpers": true,