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
|
||||
}
|
||||
|
||||
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.
|
||||
* @param {did} string DID.
|
||||
|
@ -172,10 +172,8 @@ export class Assets extends Instantiable {
|
||||
* @param {string} owner Owner address.
|
||||
* @return {Promise<string[]>} List of DIDs.
|
||||
*/
|
||||
public async ownerAssets(owner: string): Promise<string[]> {
|
||||
// TODO:
|
||||
// return this.ocean.keeper.didRegistry.getAttributesByOwner(owner)
|
||||
return ['']
|
||||
public async ownerAssets(owner: string): Promise<DDO[]> {
|
||||
return this.ocean.metadatastore.getOwnerAssets(owner)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,7 +41,6 @@ describe('Marketplace flow', () => {
|
||||
|
||||
ocean = await Ocean.getInstance(config)
|
||||
owner = (await ocean.accounts.list())[0]
|
||||
console.log(owner.getId())
|
||||
alice = (await ocean.accounts.list())[1]
|
||||
bob = (await ocean.accounts.list())[2]
|
||||
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