// @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 { Coin } from '@cosmjs/amino'
import { toUtf8 } from '@cosmjs/encoding'
import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx'
import { MsgExecuteContractEncodeObject } from 'cosmwasm'

import { Decimal } from './MarsMockOracle.types'
export interface MarsMockOracleMessage {
  contractAddress: string
  sender: string
  changePrice: (
    {
      denom,
      price,
    }: {
      denom: string
      price: Decimal
    },
    funds?: Coin[],
  ) => MsgExecuteContractEncodeObject
}
export class MarsMockOracleMessageComposer implements MarsMockOracleMessage {
  sender: string
  contractAddress: string

  constructor(sender: string, contractAddress: string) {
    this.sender = sender
    this.contractAddress = contractAddress
    this.changePrice = this.changePrice.bind(this)
  }

  changePrice = (
    {
      denom,
      price,
    }: {
      denom: string
      price: Decimal
    },
    funds?: Coin[],
  ): MsgExecuteContractEncodeObject => {
    return {
      typeUrl: '/cosmwasm.wasm.v1.MsgExecuteContract',
      value: MsgExecuteContract.fromPartial({
        sender: this.sender,
        contract: this.contractAddress,
        msg: toUtf8(
          JSON.stringify({
            change_price: {
              denom,
              price,
            },
          }),
        ),
        funds,
      }),
    }
  }
}
