diff --git a/packages/stargate/src/modules/authz/queries.ts b/packages/stargate/src/modules/authz/queries.ts index 9c548e6f..5c73d78e 100644 --- a/packages/stargate/src/modules/authz/queries.ts +++ b/packages/stargate/src/modules/authz/queries.ts @@ -10,6 +10,8 @@ export interface AuthzExtension { msgTypeUrl: string, paginationKey?: Uint8Array, ) => Promise; + readonly granteeGrants: (grantee: string, paginationKey?: Uint8Array) => Promise; + readonly granterGrants: (granter: string, paginationKey?: Uint8Array) => Promise; }; } @@ -22,14 +24,24 @@ export function setupAuthzExtension(base: QueryClient): AuthzExtension { return { authz: { grants: async (granter: string, grantee: string, msgTypeUrl: string, paginationKey?: Uint8Array) => { - const response = await queryService.Grants({ + return await queryService.Grants({ granter: granter, grantee: grantee, msgTypeUrl: msgTypeUrl, pagination: createPagination(paginationKey), }); - - return response; + }, + granteeGrants: async (grantee: string, paginationKey?: Uint8Array) => { + return await queryService.GranteeGrants({ + grantee: grantee, + pagination: createPagination(paginationKey), + }); + }, + granterGrants: async (granter: string, paginationKey?: Uint8Array) => { + return await queryService.GranterGrants({ + granter: granter, + pagination: createPagination(paginationKey), + }); }, }, };