From 13e43d7b4021b356646c279a95e4fcdb07924ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Guti=C3=A9rrez?= Date: Thu, 5 Sep 2019 13:34:36 +0200 Subject: [PATCH] Inlcude new methods on DIDRegistry. --- src/keeper/contracts/DIDRegistry.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/keeper/contracts/DIDRegistry.ts b/src/keeper/contracts/DIDRegistry.ts index eca2cb4..96c55df 100644 --- a/src/keeper/contracts/DIDRegistry.ts +++ b/src/keeper/contracts/DIDRegistry.ts @@ -65,4 +65,30 @@ export default class DIDRegistry extends ContractBase { }) )[0] } + + public async grantPermission( + did: string, + grantee: string, + ownerAddress: string + ) { + return this.send('grantPermission', ownerAddress, [ + zeroX(did), + zeroX(grantee) + ]) + } + + public async revokePermission( + did: string, + grantee: string, + ownerAddress: string + ) { + return this.send('revokePermission', ownerAddress, [ + zeroX(did), + zeroX(grantee) + ]) + } + + public async getPermission(did: string, grantee: string): Promise { + return this.call('getPermission', [didZeroX(did), zeroX(grantee)]) + } }