// @ts-nocheck
/**
 * This file was automatically generated by @cosmwasm/ts-codegen@0.24.0.
 * 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 { CosmWasmClient, ExecuteResult, SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate'
import { Coin, StdFee } from '@cosmjs/amino'

import {
  ConfigResponse,
  Decimal,
  ExecuteMsg,
  HealthResponse,
  InstantiateMsg,
  OwnerResponse,
  OwnerUpdate,
  QueryMsg,
  Uint128,
} from './MarsRoverHealthTypes.types'
export interface MarsRoverHealthTypesReadOnlyInterface {
  contractAddress: string
  health: ({ accountId }: { accountId: string }) => Promise<HealthResponse>
  config: () => Promise<ConfigResponse>
}
export class MarsRoverHealthTypesQueryClient implements MarsRoverHealthTypesReadOnlyInterface {
  client: CosmWasmClient
  contractAddress: string

  constructor(client: CosmWasmClient, contractAddress: string) {
    this.client = client
    this.contractAddress = contractAddress
    this.health = this.health.bind(this)
    this.config = this.config.bind(this)
  }

  health = async ({ accountId }: { accountId: string }): Promise<HealthResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      health: {
        account_id: accountId,
      },
    })
  }
  config = async (): Promise<ConfigResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      config: {},
    })
  }
}
export interface MarsRoverHealthTypesInterface extends MarsRoverHealthTypesReadOnlyInterface {
  contractAddress: string
  sender: string
  updateOwner: (
    fee?: number | StdFee | 'auto',
    memo?: string,
    funds?: Coin[],
  ) => Promise<ExecuteResult>
  updateConfig: (
    {
      creditManager,
    }: {
      creditManager: string
    },
    fee?: number | StdFee | 'auto',
    memo?: string,
    funds?: Coin[],
  ) => Promise<ExecuteResult>
}
export class MarsRoverHealthTypesClient
  extends MarsRoverHealthTypesQueryClient
  implements MarsRoverHealthTypesInterface
{
  client: SigningCosmWasmClient
  sender: string
  contractAddress: string

  constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) {
    super(client, contractAddress)
    this.client = client
    this.sender = sender
    this.contractAddress = contractAddress
    this.updateOwner = this.updateOwner.bind(this)
    this.updateConfig = this.updateConfig.bind(this)
  }

  updateOwner = async (
    fee: number | StdFee | 'auto' = 'auto',
    memo?: string,
    funds?: Coin[],
  ): Promise<ExecuteResult> => {
    return await this.client.execute(
      this.sender,
      this.contractAddress,
      {
        update_owner: {},
      },
      fee,
      memo,
      funds,
    )
  }
  updateConfig = async (
    {
      creditManager,
    }: {
      creditManager: string
    },
    fee: number | StdFee | 'auto' = 'auto',
    memo?: string,
    funds?: Coin[],
  ): Promise<ExecuteResult> => {
    return await this.client.execute(
      this.sender,
      this.contractAddress,
      {
        update_config: {
          credit_manager: creditManager,
        },
      },
      fee,
      memo,
      funds,
    )
  }
}
