mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
add ownerAssets
This commit is contained in:
parent
28d1775593
commit
d8dadf5495
@ -315,6 +315,20 @@ export class MetadataStore {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async getOwnerAssets(owner: string): Promise<DDO[]> {
|
||||||
|
const query = {
|
||||||
|
offset: 100,
|
||||||
|
page: 1,
|
||||||
|
query: {
|
||||||
|
'publickey.id.owner': owner
|
||||||
|
},
|
||||||
|
sort: {
|
||||||
|
value: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (await this.queryMetadata(query)).results
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit Metadata for a DDO.
|
* Edit Metadata for a DDO.
|
||||||
* @param {did} string DID.
|
* @param {did} string DID.
|
||||||
|
@ -172,10 +172,8 @@ export class Assets extends Instantiable {
|
|||||||
* @param {string} owner Owner address.
|
* @param {string} owner Owner address.
|
||||||
* @return {Promise<string[]>} List of DIDs.
|
* @return {Promise<string[]>} List of DIDs.
|
||||||
*/
|
*/
|
||||||
public async ownerAssets(owner: string): Promise<string[]> {
|
public async ownerAssets(owner: string): Promise<DDO[]> {
|
||||||
// TODO:
|
return this.ocean.metadatastore.getOwnerAssets(owner)
|
||||||
// return this.ocean.keeper.didRegistry.getAttributesByOwner(owner)
|
|
||||||
return ['']
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,7 +41,6 @@ describe('Marketplace flow', () => {
|
|||||||
|
|
||||||
ocean = await Ocean.getInstance(config)
|
ocean = await Ocean.getInstance(config)
|
||||||
owner = (await ocean.accounts.list())[0]
|
owner = (await ocean.accounts.list())[0]
|
||||||
console.log(owner.getId())
|
|
||||||
alice = (await ocean.accounts.list())[1]
|
alice = (await ocean.accounts.list())[1]
|
||||||
bob = (await ocean.accounts.list())[2]
|
bob = (await ocean.accounts.list())[2]
|
||||||
marketplace = (await ocean.accounts.list())[3]
|
marketplace = (await ocean.accounts.list())[3]
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user