Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Zetazzz committed Nov 4, 2024
1 parent 5861ace commit db9ded1
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions libs/interchainjs/src/react-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const useRpcClient = <TData = ProtobufRpcClient>({
};

export interface UseQueryBuilderOptions<TReq, TRes> {
builderQueryFn: (clientResolver: RpcResolver) => (request: TReq) => Promise<TRes>,
builderQueryFn: (clientResolver?: RpcResolver) => (request: TReq) => Promise<TRes>,
queryKeyPrefix: string,
}

Expand Down Expand Up @@ -127,10 +127,6 @@ export function buildUseQuery<TReq, TRes>(opts: UseQueryBuilderOptions<TReq, TRe
rpcResolver = clientResolver;
}

if(!rpcResolver) {
throw new Error('RpcResolver is not initialized');
}

const queryFn = opts.builderQueryFn(rpcResolver);
return useQuery<TRes, Error, TData>(customizedQueryKey || [opts.queryKeyPrefix, request], () => queryFn(request), options);
};
Expand All @@ -149,7 +145,7 @@ export interface ReactMutationParams<TData, TError, TVariables, TContext = unkno


export interface UseMutationBuilderOptions<TMsg> {
builderMutationFn: (getSigningClientInstance: SigningClientResolver) => (
builderMutationFn: (clientResolver?: SigningClientResolver) => (
signerAddress: string,
message: TMsg,
fee: StdFee | 'auto',
Expand Down Expand Up @@ -179,10 +175,6 @@ export function buildUseMutation<TMsg, TError>(opts: UseMutationBuilderOptions<T
clientResolver = clientResolver;
}

if(!signingClientResolver) {
throw new Error('SigningClientResolver is not initialized');
}

const mutationFn = opts.builderMutationFn(signingClientResolver);

return useMutation<DeliverTxResponse, Error, ITxArgs<TMsg>>(
Expand Down

0 comments on commit db9ded1

Please sign in to comment.