Skip to content

Commit b5a8c79

Browse files
committed
solved the issue: createGetVote is not a function
1 parent 1d9e0f9 commit b5a8c79

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

templates/chain-template/hooks/voting/useVotingData.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useEffect, useMemo, useState } from 'react';
22
import { useChain } from '@interchain-kit/react';
33
import { defaultContext, useQueries } from '@tanstack/react-query';
44
import { ProposalStatus } from '@interchainjs/react/cosmos/gov/v1beta1/gov';
5-
import { createGetVote } from '@interchainjs/react/cosmos/gov/v1beta1/query.rpc.func';
5+
import { getVote } from '@interchainjs/react/cosmos/gov/v1beta1/query.rpc.func';
66
import { Proposal as ProposalV1 } from '@interchainjs/react/cosmos/gov/v1/gov';
77
import { chains } from 'chain-registry';
88
import {
@@ -50,7 +50,6 @@ export function useVotingData(chainName: string) {
5050
const { address } = useChain(chainName);
5151
const { data: rpcEndpoint, isFetching } = useRpcEndpoint(chainName);
5252

53-
const getVote = createGetVote(rpcEndpoint);
5453
const chain = chains.find((c) => c.chain_name === chainName);
5554
const isReady = !!address && !!rpcEndpoint;
5655

@@ -112,7 +111,7 @@ export function useVotingData(chainName: string) {
112111
queries: (votedProposalsQuery.data || []).map(({ id }) => ({
113112
queryKey: ['voteQuery', id, address],
114113
queryFn: () =>
115-
getVote({
114+
getVote(rpcEndpoint?.toString() || '',{
116115
proposalId: id,
117116
voter: address || '',
118117
}),

0 commit comments

Comments
 (0)