change proto

This commit is contained in:
Pham Tu
2024-01-17 11:13:50 +07:00
parent c6cd723c40
commit 1d1efbb50a
+3 -2
View File
@@ -52,10 +52,11 @@ import {
QueryClientImpl,
} from 'cosmjs-types/cosmos/auth/v1beta1/query';
import type { Any } from 'cosmjs-types/google/protobuf/any';
import { BaseAccount } from 'cosmjs-types/cosmos/auth/v1beta1/auth';
export interface AuthExtension {
readonly auth: {
readonly account: (address: string) => Promise<Any | undefined>;
readonly account: (address: string) => Promise<BaseAccount | undefined>;
readonly accounts: () => Promise<QueryAccountsResponse>;
};
}
@@ -66,7 +67,7 @@ function setupAuthExtension(base: QueryClient) {
auth: {
account: async (address: string) => {
const { account } = await queryService.Account({ address: address });
return account;
return account?.value ? BaseAccount.decode(account.value) : undefined;
},
accounts: async () => {
return await queryService.Accounts();