diff --git a/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts b/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts index a77654b..1b27b82 100644 --- a/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts +++ b/src/keeper/contracts/conditions/AccessSecretStoreCondition.ts @@ -20,9 +20,11 @@ export class AccessSecretStoreCondition extends Condition { return this.call("checkPermissions", [grantee, didZeroX(did)].map(zeroX), from) } - public async getGrantedDidByConsumer(consumer: string): Promise { + public async getGrantedDidByConsumer(consumer: string): Promise<{did: string, agreementId: string}[]> { return (await this.getPastEvents("Fulfilled", {_grantee: zeroX(consumer)})) - .map(({returnValues}) => returnValues._documentId) - .map(didPrefixed) + .map(({returnValues}) => ({ + did: didPrefixed(returnValues._documentId), + agreementId: zeroX(returnValues._agreementId), + })) } } diff --git a/src/ocean/OceanAssets.ts b/src/ocean/OceanAssets.ts index 3da627c..9357394 100644 --- a/src/ocean/OceanAssets.ts +++ b/src/ocean/OceanAssets.ts @@ -292,7 +292,8 @@ export class OceanAssets extends Instantiable { * @return {Promise} List of DIDs. */ public async consumerAssets(consumer: string) { - return this.ocean.keeper.conditions.accessSecretStoreCondition.getGrantedDidByConsumer(consumer) + return (await this.ocean.keeper.conditions.accessSecretStoreCondition.getGrantedDidByConsumer(consumer)) + .map(({did}) => did) } /**