1
0
mirror of https://github.com/oceanprotocol/react.git synced 2024-06-13 16:03:21 +02:00
This commit is contained in:
mihaisc 2020-10-01 15:17:44 +03:00
parent 6c2353fb17
commit 54e922814d
No known key found for this signature in database
GPG Key ID: 4FB0C2329B4C6E29
3 changed files with 14 additions and 8 deletions

View File

@ -9,14 +9,20 @@ import { MetadataExample } from './MetadataExample'
export function AllDdos() {
const { chainId, account, accountId, ocean } = useOcean()
const [ddos, setDdos] = useState<DDO[] | undefined>()
const [ddos, setDdos] = useState<DDO[]>()
useEffect(() => {
async function init() {
if (!ocean || !account || !accountId) return
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 }
// })
console.log('assets', assets.results)
setDdos(assets.results.slice(0, 4))
}
init()

8
package-lock.json generated
View File

@ -1521,12 +1521,12 @@
"integrity": "sha512-bt5uwh79D759H6O4bAv+ycGdZQISFAxi65cqIygzA9hwsu29+GuOLwu1mxrzl2lVNLs6Emxo7TaDv0jAoyqnCg=="
},
"@oceanprotocol/lib": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.5.0.tgz",
"integrity": "sha512-zyhJ+I6l1095uWlYhm48tSC0+SjheZADH+dwDehlrjAl6ipzW4dLgPemSqwueEmNWuGj0hioy+DyqFn0HN8Jfg==",
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.5.1.tgz",
"integrity": "sha512-OaQTpIqi0KXfptVhrHf1adchE99olSayDjiUrP2/LXuBaAxuOlA3MbCIQ7ecsNLlY9He06h9dtypSx/x2FcdGQ==",
"requires": {
"@ethereum-navigator/navigator": "^0.5.0",
"@oceanprotocol/contracts": "^0.5.0",
"@oceanprotocol/contracts": "^0.5.1",
"decimal.js": "^10.2.0",
"fs": "0.0.1-security",
"lzma": "^2.3.2",

View File

@ -25,7 +25,7 @@
"dist/"
],
"dependencies": {
"@oceanprotocol/lib": "^0.5.0",
"@oceanprotocol/lib": "^0.5.1",
"axios": "^0.20.0",
"decimal.js": "^10.2.1",
"web3": "^1.3.0",