// @ts-nocheck
/**
 * This file was automatically generated by @cosmwasm/ts-codegen@0.30.1.
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
 * and run the @cosmwasm/ts-codegen generate command to regenerate this file.
 */

import { UseQueryOptions, useQuery, useMutation, UseMutationOptions } from '@tanstack/react-query'
import { ExecuteResult } from '@cosmjs/cosmwasm-stargate'
import { StdFee } from '@cosmjs/amino'
import {
  InstantiateMsg,
  ExecuteMsg,
  OwnerUpdate,
  OsmosisRoute,
  Uint128,
  Decimal,
  Addr,
  SwapAmountInRoute,
  Coin,
  QueryMsg,
  EstimateExactInSwapResponse,
  OwnerResponse,
  RouteResponseForEmpty,
  Empty,
  ArrayOfRouteResponseForEmpty,
} from './MarsSwapperOsmosis.types'
import {
  MarsSwapperOsmosisQueryClient,
  MarsSwapperOsmosisClient,
} from './MarsSwapperOsmosis.client'
export const marsSwapperOsmosisQueryKeys = {
  contract: [
    {
      contract: 'marsSwapperOsmosis',
    },
  ] as const,
  address: (contractAddress: string | undefined) =>
    [{ ...marsSwapperOsmosisQueryKeys.contract[0], address: contractAddress }] as const,
  owner: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
    [
      { ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], method: 'owner', args },
    ] as const,
  route: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
    [
      { ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], method: 'route', args },
    ] as const,
  routes: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
    [
      { ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], method: 'routes', args },
    ] as const,
  estimateExactInSwap: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
    [
      {
        ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0],
        method: 'estimate_exact_in_swap',
        args,
      },
    ] as const,
}
export interface MarsSwapperOsmosisReactQuery<TResponse, TData = TResponse> {
  client: MarsSwapperOsmosisQueryClient | undefined
  options?: Omit<
    UseQueryOptions<TResponse, Error, TData>,
    "'queryKey' | 'queryFn' | 'initialData'"
  > & {
    initialData?: undefined
  }
}
export interface MarsSwapperOsmosisEstimateExactInSwapQuery<TData>
  extends MarsSwapperOsmosisReactQuery<EstimateExactInSwapResponse, TData> {
  args: {
    coinIn: Coin
    denomOut: string
  }
}
export function useMarsSwapperOsmosisEstimateExactInSwapQuery<TData = EstimateExactInSwapResponse>({
  client,
  args,
  options,
}: MarsSwapperOsmosisEstimateExactInSwapQuery<TData>) {
  return useQuery<EstimateExactInSwapResponse, Error, TData>(
    marsSwapperOsmosisQueryKeys.estimateExactInSwap(client?.contractAddress, args),
    () =>
      client
        ? client.estimateExactInSwap({
            coinIn: args.coinIn,
            denomOut: args.denomOut,
          })
        : Promise.reject(new Error('Invalid client')),
    { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
  )
}
export interface MarsSwapperOsmosisRoutesQuery<TData>
  extends MarsSwapperOsmosisReactQuery<ArrayOfRouteResponseForEmpty, TData> {
  args: {
    limit?: number
    startAfter?: string[][]
  }
}
export function useMarsSwapperOsmosisRoutesQuery<TData = ArrayOfRouteResponseForEmpty>({
  client,
  args,
  options,
}: MarsSwapperOsmosisRoutesQuery<TData>) {
  return useQuery<ArrayOfRouteResponseForEmpty, Error, TData>(
    marsSwapperOsmosisQueryKeys.routes(client?.contractAddress, args),
    () =>
      client
        ? client.routes({
            limit: args.limit,
            startAfter: args.startAfter,
          })
        : Promise.reject(new Error('Invalid client')),
    { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
  )
}
export interface MarsSwapperOsmosisRouteQuery<TData>
  extends MarsSwapperOsmosisReactQuery<RouteResponseForEmpty, TData> {
  args: {
    denomIn: string
    denomOut: string
  }
}
export function useMarsSwapperOsmosisRouteQuery<TData = RouteResponseForEmpty>({
  client,
  args,
  options,
}: MarsSwapperOsmosisRouteQuery<TData>) {
  return useQuery<RouteResponseForEmpty, Error, TData>(
    marsSwapperOsmosisQueryKeys.route(client?.contractAddress, args),
    () =>
      client
        ? client.route({
            denomIn: args.denomIn,
            denomOut: args.denomOut,
          })
        : Promise.reject(new Error('Invalid client')),
    { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
  )
}
export interface MarsSwapperOsmosisOwnerQuery<TData>
  extends MarsSwapperOsmosisReactQuery<OwnerResponse, TData> {}
export function useMarsSwapperOsmosisOwnerQuery<TData = OwnerResponse>({
  client,
  options,
}: MarsSwapperOsmosisOwnerQuery<TData>) {
  return useQuery<OwnerResponse, Error, TData>(
    marsSwapperOsmosisQueryKeys.owner(client?.contractAddress),
    () => (client ? client.owner() : Promise.reject(new Error('Invalid client'))),
    { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
  )
}
export interface MarsSwapperOsmosisTransferResultMutation {
  client: MarsSwapperOsmosisClient
  msg: {
    denomIn: string
    denomOut: string
    recipient: Addr
  }
  args?: {
    fee?: number | StdFee | 'auto'
    memo?: string
    funds?: Coin[]
  }
}
export function useMarsSwapperOsmosisTransferResultMutation(
  options?: Omit<
    UseMutationOptions<ExecuteResult, Error, MarsSwapperOsmosisTransferResultMutation>,
    'mutationFn'
  >,
) {
  return useMutation<ExecuteResult, Error, MarsSwapperOsmosisTransferResultMutation>(
    ({ client, msg, args: { fee, memo, funds } = {} }) =>
      client.transferResult(msg, fee, memo, funds),
    options,
  )
}
export interface MarsSwapperOsmosisSwapExactInMutation {
  client: MarsSwapperOsmosisClient
  msg: {
    coinIn: Coin
    denomOut: string
    slippage: Decimal
  }
  args?: {
    fee?: number | StdFee | 'auto'
    memo?: string
    funds?: Coin[]
  }
}
export function useMarsSwapperOsmosisSwapExactInMutation(
  options?: Omit<
    UseMutationOptions<ExecuteResult, Error, MarsSwapperOsmosisSwapExactInMutation>,
    'mutationFn'
  >,
) {
  return useMutation<ExecuteResult, Error, MarsSwapperOsmosisSwapExactInMutation>(
    ({ client, msg, args: { fee, memo, funds } = {} }) => client.swapExactIn(msg, fee, memo, funds),
    options,
  )
}
export interface MarsSwapperOsmosisSetRouteMutation {
  client: MarsSwapperOsmosisClient
  msg: {
    denomIn: string
    denomOut: string
    route: OsmosisRoute
  }
  args?: {
    fee?: number | StdFee | 'auto'
    memo?: string
    funds?: Coin[]
  }
}
export function useMarsSwapperOsmosisSetRouteMutation(
  options?: Omit<
    UseMutationOptions<ExecuteResult, Error, MarsSwapperOsmosisSetRouteMutation>,
    'mutationFn'
  >,
) {
  return useMutation<ExecuteResult, Error, MarsSwapperOsmosisSetRouteMutation>(
    ({ client, msg, args: { fee, memo, funds } = {} }) => client.setRoute(msg, fee, memo, funds),
    options,
  )
}
export interface MarsSwapperOsmosisUpdateOwnerMutation {
  client: MarsSwapperOsmosisClient
  msg: OwnerUpdate
  args?: {
    fee?: number | StdFee | 'auto'
    memo?: string
    funds?: Coin[]
  }
}
export function useMarsSwapperOsmosisUpdateOwnerMutation(
  options?: Omit<
    UseMutationOptions<ExecuteResult, Error, MarsSwapperOsmosisUpdateOwnerMutation>,
    'mutationFn'
  >,
) {
  return useMutation<ExecuteResult, Error, MarsSwapperOsmosisUpdateOwnerMutation>(
    ({ client, msg, args: { fee, memo, funds } = {} }) => client.updateOwner(msg, fee, memo, funds),
    options,
  )
}
