import { oracleTypeFromJSON } from "../../oracle/v1beta1/oracle";
import { orderTypeFromJSON, marketStatusFromJSON } from "./exchange";
import { Long } from "../../../helpers";
export const AminoConverter = {
  "/injective.exchange.v1beta1.MsgDeposit": {
    aminoType: "/injective.exchange.v1beta1.MsgDeposit",
    toAmino: ({
      sender,
      subaccountId,
      amount
    }) => {
      return {
        sender,
        subaccount_id: subaccountId,
        amount: {
          denom: amount.denom,
          amount: Long.fromValue(amount.amount).toString()
        }
      };
    },
    fromAmino: ({
      sender,
      subaccount_id,
      amount
    }) => {
      return {
        sender,
        subaccountId: subaccount_id,
        amount: {
          denom: amount.denom,
          amount: amount.amount
        }
      };
    }
  },
  "/injective.exchange.v1beta1.MsgWithdraw": {
    aminoType: "/injective.exchange.v1beta1.MsgWithdraw",
    toAmino: ({
      sender,
      subaccountId,
      amount
    }) => {
      return {
        sender,
        subaccount_id: subaccountId,
        amount: {
          denom: amount.denom,
          amount: Long.fromValue(amount.amount).toString()
        }
      };
    },
    fromAmino: ({
      sender,
      subaccount_id,
      amount
    }) => {
      return {
        sender,
        subaccountId: subaccount_id,
        amount: {
          denom: amount.denom,
          amount: amount.amount
        }
      };
    }
  },
  "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch": {
    aminoType: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch",
    toAmino: ({
      sender,
      ticker,
      baseDenom,
      quoteDenom,
      minPriceTickSize,
      minQuantityTickSize
    }) => {
      return {
        sender,
        ticker,
        base_denom: baseDenom,
        quote_denom: quoteDenom,
        min_price_tick_size: minPriceTickSize,
        min_quantity_tick_size: minQuantityTickSize
      };
    },
    fromAmino: ({
      sender,
      ticker,
      base_denom,
      quote_denom,
      min_price_tick_size,
      min_quantity_tick_size
    }) => {
      return {
        sender,
        ticker,
        baseDenom: base_denom,
        quoteDenom: quote_denom,
        minPriceTickSize: min_price_tick_size,
        minQuantityTickSize: min_quantity_tick_size
      };
    }
  },
  "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunch": {
    aminoType: "/injective.exchange.v1beta1.MsgInstantPerpetualMarketLaunch",
    toAmino: ({
      sender,
      ticker,
      quoteDenom,
      oracleBase,
      oracleQuote,
      oracleScaleFactor,
      oracleType,
      makerFeeRate,
      takerFeeRate,
      initialMarginRatio,
      maintenanceMarginRatio,
      minPriceTickSize,
      minQuantityTickSize
    }) => {
      return {
        sender,
        ticker,
        quote_denom: quoteDenom,
        oracle_base: oracleBase,
        oracle_quote: oracleQuote,
        oracle_scale_factor: oracleScaleFactor,
        oracle_type: oracleType,
        maker_fee_rate: makerFeeRate,
        taker_fee_rate: takerFeeRate,
        initial_margin_ratio: initialMarginRatio,
        maintenance_margin_ratio: maintenanceMarginRatio,
        min_price_tick_size: minPriceTickSize,
        min_quantity_tick_size: minQuantityTickSize
      };
    },
    fromAmino: ({
      sender,
      ticker,
      quote_denom,
      oracle_base,
      oracle_quote,
      oracle_scale_factor,
      oracle_type,
      maker_fee_rate,
      taker_fee_rate,
      initial_margin_ratio,
      maintenance_margin_ratio,
      min_price_tick_size,
      min_quantity_tick_size
    }) => {
      return {
        sender,
        ticker,
        quoteDenom: quote_denom,
        oracleBase: oracle_base,
        oracleQuote: oracle_quote,
        oracleScaleFactor: oracle_scale_factor,
        oracleType: oracleTypeFromJSON(oracle_type),
        makerFeeRate: maker_fee_rate,
        takerFeeRate: taker_fee_rate,
        initialMarginRatio: initial_margin_ratio,
        maintenanceMarginRatio: maintenance_margin_ratio,
        minPriceTickSize: min_price_tick_size,
        minQuantityTickSize: min_quantity_tick_size
      };
    }
  },
  "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunch": {
    aminoType: "/injective.exchange.v1beta1.MsgInstantExpiryFuturesMarketLaunch",
    toAmino: ({
      sender,
      ticker,
      quoteDenom,
      oracleBase,
      oracleQuote,
      oracleType,
      oracleScaleFactor,
      expiry,
      makerFeeRate,
      takerFeeRate,
      initialMarginRatio,
      maintenanceMarginRatio,
      minPriceTickSize,
      minQuantityTickSize
    }) => {
      return {
        sender,
        ticker,
        quote_denom: quoteDenom,
        oracle_base: oracleBase,
        oracle_quote: oracleQuote,
        oracle_type: oracleType,
        oracle_scale_factor: oracleScaleFactor,
        expiry: expiry.toString(),
        maker_fee_rate: makerFeeRate,
        taker_fee_rate: takerFeeRate,
        initial_margin_ratio: initialMarginRatio,
        maintenance_margin_ratio: maintenanceMarginRatio,
        min_price_tick_size: minPriceTickSize,
        min_quantity_tick_size: minQuantityTickSize
      };
    },
    fromAmino: ({
      sender,
      ticker,
      quote_denom,
      oracle_base,
      oracle_quote,
      oracle_type,
      oracle_scale_factor,
      expiry,
      maker_fee_rate,
      taker_fee_rate,
      initial_margin_ratio,
      maintenance_margin_ratio,
      min_price_tick_size,
      min_quantity_tick_size
    }) => {
      return {
        sender,
        ticker,
        quoteDenom: quote_denom,
        oracleBase: oracle_base,
        oracleQuote: oracle_quote,
        oracleType: oracleTypeFromJSON(oracle_type),
        oracleScaleFactor: oracle_scale_factor,
        expiry: Long.fromString(expiry),
        makerFeeRate: maker_fee_rate,
        takerFeeRate: taker_fee_rate,
        initialMarginRatio: initial_margin_ratio,
        maintenanceMarginRatio: maintenance_margin_ratio,
        minPriceTickSize: min_price_tick_size,
        minQuantityTickSize: min_quantity_tick_size
      };
    }
  },
  "/injective.exchange.v1beta1.MsgCreateSpotLimitOrder": {
    aminoType: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrder",
    toAmino: ({
      sender,
      order
    }) => {
      return {
        sender,
        order: {
          market_id: order.marketId,
          order_info: {
            subaccount_id: order.orderInfo.subaccountId,
            fee_recipient: order.orderInfo.feeRecipient,
            price: order.orderInfo.price,
            quantity: order.orderInfo.quantity
          },
          order_type: order.orderType,
          trigger_price: order.triggerPrice
        }
      };
    },
    fromAmino: ({
      sender,
      order
    }) => {
      return {
        sender,
        order: {
          marketId: order.market_id,
          orderInfo: {
            subaccountId: order.order_info.subaccount_id,
            feeRecipient: order.order_info.fee_recipient,
            price: order.order_info.price,
            quantity: order.order_info.quantity
          },
          orderType: orderTypeFromJSON(order.order_type),
          triggerPrice: order.trigger_price
        }
      };
    }
  },
  "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrders": {
    aminoType: "/injective.exchange.v1beta1.MsgBatchCreateSpotLimitOrders",
    toAmino: ({
      sender,
      orders
    }) => {
      return {
        sender,
        orders: orders.map(el0 => ({
          market_id: el0.marketId,
          order_info: {
            subaccount_id: el0.orderInfo.subaccountId,
            fee_recipient: el0.orderInfo.feeRecipient,
            price: el0.orderInfo.price,
            quantity: el0.orderInfo.quantity
          },
          order_type: el0.orderType,
          trigger_price: el0.triggerPrice
        }))
      };
    },
    fromAmino: ({
      sender,
      orders
    }) => {
      return {
        sender,
        orders: orders.map(el0 => ({
          marketId: el0.market_id,
          orderInfo: {
            subaccountId: el0.order_info.subaccount_id,
            feeRecipient: el0.order_info.fee_recipient,
            price: el0.order_info.price,
            quantity: el0.order_info.quantity
          },
          orderType: orderTypeFromJSON(el0.order_type),
          triggerPrice: el0.trigger_price
        }))
      };
    }
  },
  "/injective.exchange.v1beta1.MsgCreateSpotMarketOrder": {
    aminoType: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrder",
    toAmino: ({
      sender,
      order
    }) => {
      return {
        sender,
        order: {
          market_id: order.marketId,
          order_info: {
            subaccount_id: order.orderInfo.subaccountId,
            fee_recipient: order.orderInfo.feeRecipient,
            price: order.orderInfo.price,
            quantity: order.orderInfo.quantity
          },
          order_type: order.orderType,
          trigger_price: order.triggerPrice
        }
      };
    },
    fromAmino: ({
      sender,
      order
    }) => {
      return {
        sender,
        order: {
          marketId: order.market_id,
          orderInfo: {
            subaccountId: order.order_info.subaccount_id,
            feeRecipient: order.order_info.fee_recipient,
            price: order.order_info.price,
            quantity: order.order_info.quantity
          },
          orderType: orderTypeFromJSON(order.order_type),
          triggerPrice: order.trigger_price
        }
      };
    }
  },
  "/injective.exchange.v1beta1.MsgCancelSpotOrder": {
    aminoType: "/injective.exchange.v1beta1.MsgCancelSpotOrder",
    toAmino: ({
      sender,
      marketId,
      subaccountId,
      orderHash
    }) => {
      return {
        sender,
        market_id: marketId,
        subaccount_id: subaccountId,
        order_hash: orderHash
      };
    },
    fromAmino: ({
      sender,
      market_id,
      subaccount_id,
      order_hash
    }) => {
      return {
        sender,
        marketId: market_id,
        subaccountId: subaccount_id,
        orderHash: order_hash
      };
    }
  },
  "/injective.exchange.v1beta1.MsgBatchCancelSpotOrders": {
    aminoType: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrders",
    toAmino: ({
      sender,
      data
    }) => {
      return {
        sender,
        data: data.map(el0 => ({
          market_id: el0.marketId,
          subaccount_id: el0.subaccountId,
          order_hash: el0.orderHash,
          order_mask: el0.orderMask
        }))
      };
    },
    fromAmino: ({
      sender,
      data
    }) => {
      return {
        sender,
        data: data.map(el0 => ({
          marketId: el0.market_id,
          subaccountId: el0.subaccount_id,
          orderHash: el0.order_hash,
          orderMask: el0.order_mask
        }))
      };
    }
  },
  "/injective.exchange.v1beta1.MsgBatchUpdateOrders": {
    aminoType: "/injective.exchange.v1beta1.MsgBatchUpdateOrders",
    toAmino: ({
      sender,
      subaccountId,
      spotMarketIdsToCancelAll,
      derivativeMarketIdsToCancelAll,
      spotOrdersToCancel,
      derivativeOrdersToCancel,
      spotOrdersToCreate,
      derivativeOrdersToCreate,
      binaryOptionsOrdersToCancel,
      binaryOptionsMarketIdsToCancelAll,
      binaryOptionsOrdersToCreate
    }) => {
      return {
        sender,
        subaccount_id: subaccountId,
        spot_market_ids_to_cancel_all: spotMarketIdsToCancelAll,
        derivative_market_ids_to_cancel_all: derivativeMarketIdsToCancelAll,
        spot_orders_to_cancel: spotOrdersToCancel.map(el0 => ({
          market_id: el0.marketId,
          subaccount_id: el0.subaccountId,
          order_hash: el0.orderHash,
          order_mask: el0.orderMask
        })),
        derivative_orders_to_cancel: derivativeOrdersToCancel.map(el0 => ({
          market_id: el0.marketId,
          subaccount_id: el0.subaccountId,
          order_hash: el0.orderHash,
          order_mask: el0.orderMask
        })),
        spot_orders_to_create: spotOrdersToCreate.map(el0 => ({
          market_id: el0.marketId,
          order_info: {
            subaccount_id: el0.orderInfo.subaccountId,
            fee_recipient: el0.orderInfo.feeRecipient,
            price: el0.orderInfo.price,
            quantity: el0.orderInfo.quantity
          },
          order_type: el0.orderType,
          trigger_price: el0.triggerPrice
        })),
        derivative_orders_to_create: derivativeOrdersToCreate.map(el0 => ({
          market_id: el0.marketId,
          order_info: {
            subaccount_id: el0.orderInfo.subaccountId,
            fee_recipient: el0.orderInfo.feeRecipient,
            price: el0.orderInfo.price,
            quantity: el0.orderInfo.quantity
          },
          order_type: el0.orderType,
          margin: el0.margin,
          trigger_price: el0.triggerPrice
        })),
        binary_options_orders_to_cancel: binaryOptionsOrdersToCancel.map(el0 => ({
          market_id: el0.marketId,
          subaccount_id: el0.subaccountId,
          order_hash: el0.orderHash,
          order_mask: el0.orderMask
        })),
        binary_options_market_ids_to_cancel_all: binaryOptionsMarketIdsToCancelAll,
        binary_options_orders_to_create: binaryOptionsOrdersToCreate.map(el0 => ({
          market_id: el0.marketId,
          order_info: {
            subaccount_id: el0.orderInfo.subaccountId,
            fee_recipient: el0.orderInfo.feeRecipient,
            price: el0.orderInfo.price,
            quantity: el0.orderInfo.quantity
          },
          order_type: el0.orderType,
          margin: el0.margin,
          trigger_price: el0.triggerPrice
        }))
      };
    },
    fromAmino: ({
      sender,
      subaccount_id,
      spot_market_ids_to_cancel_all,
      derivative_market_ids_to_cancel_all,
      spot_orders_to_cancel,
      derivative_orders_to_cancel,
      spot_orders_to_create,
      derivative_orders_to_create,
      binary_options_orders_to_cancel,
      binary_options_market_ids_to_cancel_all,
      binary_options_orders_to_create
    }) => {
      return {
        sender,
        subaccountId: subaccount_id,
        spotMarketIdsToCancelAll: spot_market_ids_to_cancel_all,
        derivativeMarketIdsToCancelAll: derivative_market_ids_to_cancel_all,
        spotOrdersToCancel: spot_orders_to_cancel.map(el0 => ({
          marketId: el0.market_id,
          subaccountId: el0.subaccount_id,
          orderHash: el0.order_hash,
          orderMask: el0.order_mask
        })),
        derivativeOrdersToCancel: derivative_orders_to_cancel.map(el0 => ({
          marketId: el0.market_id,
          subaccountId: el0.subaccount_id,
          orderHash: el0.order_hash,
          orderMask: el0.order_mask
        })),
        spotOrdersToCreate: spot_orders_to_create.map(el0 => ({
          marketId: el0.market_id,
          orderInfo: {
            subaccountId: el0.order_info.subaccount_id,
            feeRecipient: el0.order_info.fee_recipient,
            price: el0.order_info.price,
            quantity: el0.order_info.quantity
          },
          orderType: orderTypeFromJSON(el0.order_type),
          triggerPrice: el0.trigger_price
        })),
        derivativeOrdersToCreate: derivative_orders_to_create.map(el0 => ({
          marketId: el0.market_id,
          orderInfo: {
            subaccountId: el0.order_info.subaccount_id,
            feeRecipient: el0.order_info.fee_recipient,
            price: el0.order_info.price,
            quantity: el0.order_info.quantity
          },
          orderType: orderTypeFromJSON(el0.order_type),
          margin: el0.margin,
          triggerPrice: el0.trigger_price
        })),
        binaryOptionsOrdersToCancel: binary_options_orders_to_cancel.map(el0 => ({
          marketId: el0.market_id,
          subaccountId: el0.subaccount_id,
          orderHash: el0.order_hash,
          orderMask: el0.order_mask
        })),
        binaryOptionsMarketIdsToCancelAll: binary_options_market_ids_to_cancel_all,
        binaryOptionsOrdersToCreate: binary_options_orders_to_create.map(el0 => ({
          marketId: el0.market_id,
          orderInfo: {
            subaccountId: el0.order_info.subaccount_id,
            feeRecipient: el0.order_info.fee_recipient,
            price: el0.order_info.price,
            quantity: el0.order_info.quantity
          },
          orderType: orderTypeFromJSON(el0.order_type),
          margin: el0.margin,
          triggerPrice: el0.trigger_price
        }))
      };
    }
  },
  "/injective.exchange.v1beta1.MsgExec": {
    aminoType: "/injective.exchange.v1beta1.MsgExec",
    toAmino: ({
      sender,
      bankFunds,
      depositsSubaccountId,
      depositFunds,
      contractAddress,
      data
    }) => {
      return {
        sender,
        bank_funds: bankFunds.map(el0 => ({
          denom: el0.denom,
          amount: el0.amount
        })),
        deposits_subaccount_id: depositsSubaccountId,
        deposit_funds: depositFunds.map(el0 => ({
          denom: el0.denom,
          amount: el0.amount
        })),
        contract_address: contractAddress,
        data
      };
    },
    fromAmino: ({
      sender,
      bank_funds,
      deposits_subaccount_id,
      deposit_funds,
      contract_address,
      data
    }) => {
      return {
        sender,
        bankFunds: bank_funds.map(el0 => ({
          denom: el0.denom,
          amount: el0.amount
        })),
        depositsSubaccountId: deposits_subaccount_id,
        depositFunds: deposit_funds.map(el0 => ({
          denom: el0.denom,
          amount: el0.amount
        })),
        contractAddress: contract_address,
        data
      };
    }
  },
  "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder": {
    aminoType: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder",
    toAmino: ({
      sender,
      order
    }) => {
      return {
        sender,
        order: {
          market_id: order.marketId,
          order_info: {
            subaccount_id: order.orderInfo.subaccountId,
            fee_recipient: order.orderInfo.feeRecipient,
            price: order.orderInfo.price,
            quantity: order.orderInfo.quantity
          },
          order_type: order.orderType,
          margin: order.margin,
          trigger_price: order.triggerPrice
        }
      };
    },
    fromAmino: ({
      sender,
      order
    }) => {
      return {
        sender,
        order: {
          marketId: order.market_id,
          orderInfo: {
            subaccountId: order.order_info.subaccount_id,
            feeRecipient: order.order_info.fee_recipient,
            price: order.order_info.price,
            quantity: order.order_info.quantity
          },
          orderType: orderTypeFromJSON(order.order_type),
          margin: order.margin,
          triggerPrice: order.trigger_price
        }
      };
    }
  },
  "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrders": {
    aminoType: "/injective.exchange.v1beta1.MsgBatchCreateDerivativeLimitOrders",
    toAmino: ({
      sender,
      orders
    }) => {
      return {
        sender,
        orders: orders.map(el0 => ({
          market_id: el0.marketId,
          order_info: {
            subaccount_id: el0.orderInfo.subaccountId,
            fee_recipient: el0.orderInfo.feeRecipient,
            price: el0.orderInfo.price,
            quantity: el0.orderInfo.quantity
          },
          order_type: el0.orderType,
          margin: el0.margin,
          trigger_price: el0.triggerPrice
        }))
      };
    },
    fromAmino: ({
      sender,
      orders
    }) => {
      return {
        sender,
        orders: orders.map(el0 => ({
          marketId: el0.market_id,
          orderInfo: {
            subaccountId: el0.order_info.subaccount_id,
            feeRecipient: el0.order_info.fee_recipient,
            price: el0.order_info.price,
            quantity: el0.order_info.quantity
          },
          orderType: orderTypeFromJSON(el0.order_type),
          margin: el0.margin,
          triggerPrice: el0.trigger_price
        }))
      };
    }
  },
  "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder": {
    aminoType: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder",
    toAmino: ({
      sender,
      order
    }) => {
      return {
        sender,
        order: {
          market_id: order.marketId,
          order_info: {
            subaccount_id: order.orderInfo.subaccountId,
            fee_recipient: order.orderInfo.feeRecipient,
            price: order.orderInfo.price,
            quantity: order.orderInfo.quantity
          },
          order_type: order.orderType,
          margin: order.margin,
          trigger_price: order.triggerPrice
        }
      };
    },
    fromAmino: ({
      sender,
      order
    }) => {
      return {
        sender,
        order: {
          marketId: order.market_id,
          orderInfo: {
            subaccountId: order.order_info.subaccount_id,
            feeRecipient: order.order_info.fee_recipient,
            price: order.order_info.price,
            quantity: order.order_info.quantity
          },
          orderType: orderTypeFromJSON(order.order_type),
          margin: order.margin,
          triggerPrice: order.trigger_price
        }
      };
    }
  },
  "/injective.exchange.v1beta1.MsgCancelDerivativeOrder": {
    aminoType: "/injective.exchange.v1beta1.MsgCancelDerivativeOrder",
    toAmino: ({
      sender,
      marketId,
      subaccountId,
      orderHash,
      orderMask
    }) => {
      return {
        sender,
        market_id: marketId,
        subaccount_id: subaccountId,
        order_hash: orderHash,
        order_mask: orderMask
      };
    },
    fromAmino: ({
      sender,
      market_id,
      subaccount_id,
      order_hash,
      order_mask
    }) => {
      return {
        sender,
        marketId: market_id,
        subaccountId: subaccount_id,
        orderHash: order_hash,
        orderMask: order_mask
      };
    }
  },
  "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders": {
    aminoType: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders",
    toAmino: ({
      sender,
      data
    }) => {
      return {
        sender,
        data: data.map(el0 => ({
          market_id: el0.marketId,
          subaccount_id: el0.subaccountId,
          order_hash: el0.orderHash,
          order_mask: el0.orderMask
        }))
      };
    },
    fromAmino: ({
      sender,
      data
    }) => {
      return {
        sender,
        data: data.map(el0 => ({
          marketId: el0.market_id,
          subaccountId: el0.subaccount_id,
          orderHash: el0.order_hash,
          orderMask: el0.order_mask
        }))
      };
    }
  },
  "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch": {
    aminoType: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch",
    toAmino: ({
      sender,
      ticker,
      oracleSymbol,
      oracleProvider,
      oracleType,
      oracleScaleFactor,
      makerFeeRate,
      takerFeeRate,
      expirationTimestamp,
      settlementTimestamp,
      admin,
      quoteDenom,
      minPriceTickSize,
      minQuantityTickSize
    }) => {
      return {
        sender,
        ticker,
        oracle_symbol: oracleSymbol,
        oracle_provider: oracleProvider,
        oracle_type: oracleType,
        oracle_scale_factor: oracleScaleFactor,
        maker_fee_rate: makerFeeRate,
        taker_fee_rate: takerFeeRate,
        expiration_timestamp: expirationTimestamp.toString(),
        settlement_timestamp: settlementTimestamp.toString(),
        admin,
        quote_denom: quoteDenom,
        min_price_tick_size: minPriceTickSize,
        min_quantity_tick_size: minQuantityTickSize
      };
    },
    fromAmino: ({
      sender,
      ticker,
      oracle_symbol,
      oracle_provider,
      oracle_type,
      oracle_scale_factor,
      maker_fee_rate,
      taker_fee_rate,
      expiration_timestamp,
      settlement_timestamp,
      admin,
      quote_denom,
      min_price_tick_size,
      min_quantity_tick_size
    }) => {
      return {
        sender,
        ticker,
        oracleSymbol: oracle_symbol,
        oracleProvider: oracle_provider,
        oracleType: oracleTypeFromJSON(oracle_type),
        oracleScaleFactor: oracle_scale_factor,
        makerFeeRate: maker_fee_rate,
        takerFeeRate: taker_fee_rate,
        expirationTimestamp: Long.fromString(expiration_timestamp),
        settlementTimestamp: Long.fromString(settlement_timestamp),
        admin,
        quoteDenom: quote_denom,
        minPriceTickSize: min_price_tick_size,
        minQuantityTickSize: min_quantity_tick_size
      };
    }
  },
  "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder": {
    aminoType: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder",
    toAmino: ({
      sender,
      order
    }) => {
      return {
        sender,
        order: {
          market_id: order.marketId,
          order_info: {
            subaccount_id: order.orderInfo.subaccountId,
            fee_recipient: order.orderInfo.feeRecipient,
            price: order.orderInfo.price,
            quantity: order.orderInfo.quantity
          },
          order_type: order.orderType,
          margin: order.margin,
          trigger_price: order.triggerPrice
        }
      };
    },
    fromAmino: ({
      sender,
      order
    }) => {
      return {
        sender,
        order: {
          marketId: order.market_id,
          orderInfo: {
            subaccountId: order.order_info.subaccount_id,
            feeRecipient: order.order_info.fee_recipient,
            price: order.order_info.price,
            quantity: order.order_info.quantity
          },
          orderType: orderTypeFromJSON(order.order_type),
          margin: order.margin,
          triggerPrice: order.trigger_price
        }
      };
    }
  },
  "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder": {
    aminoType: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder",
    toAmino: ({
      sender,
      order
    }) => {
      return {
        sender,
        order: {
          market_id: order.marketId,
          order_info: {
            subaccount_id: order.orderInfo.subaccountId,
            fee_recipient: order.orderInfo.feeRecipient,
            price: order.orderInfo.price,
            quantity: order.orderInfo.quantity
          },
          order_type: order.orderType,
          margin: order.margin,
          trigger_price: order.triggerPrice
        }
      };
    },
    fromAmino: ({
      sender,
      order
    }) => {
      return {
        sender,
        order: {
          marketId: order.market_id,
          orderInfo: {
            subaccountId: order.order_info.subaccount_id,
            feeRecipient: order.order_info.fee_recipient,
            price: order.order_info.price,
            quantity: order.order_info.quantity
          },
          orderType: orderTypeFromJSON(order.order_type),
          margin: order.margin,
          triggerPrice: order.trigger_price
        }
      };
    }
  },
  "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder": {
    aminoType: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder",
    toAmino: ({
      sender,
      marketId,
      subaccountId,
      orderHash,
      orderMask
    }) => {
      return {
        sender,
        market_id: marketId,
        subaccount_id: subaccountId,
        order_hash: orderHash,
        order_mask: orderMask
      };
    },
    fromAmino: ({
      sender,
      market_id,
      subaccount_id,
      order_hash,
      order_mask
    }) => {
      return {
        sender,
        marketId: market_id,
        subaccountId: subaccount_id,
        orderHash: order_hash,
        orderMask: order_mask
      };
    }
  },
  "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders": {
    aminoType: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders",
    toAmino: ({
      sender,
      data
    }) => {
      return {
        sender,
        data: data.map(el0 => ({
          market_id: el0.marketId,
          subaccount_id: el0.subaccountId,
          order_hash: el0.orderHash,
          order_mask: el0.orderMask
        }))
      };
    },
    fromAmino: ({
      sender,
      data
    }) => {
      return {
        sender,
        data: data.map(el0 => ({
          marketId: el0.market_id,
          subaccountId: el0.subaccount_id,
          orderHash: el0.order_hash,
          orderMask: el0.order_mask
        }))
      };
    }
  },
  "/injective.exchange.v1beta1.MsgSubaccountTransfer": {
    aminoType: "/injective.exchange.v1beta1.MsgSubaccountTransfer",
    toAmino: ({
      sender,
      sourceSubaccountId,
      destinationSubaccountId,
      amount
    }) => {
      return {
        sender,
        source_subaccount_id: sourceSubaccountId,
        destination_subaccount_id: destinationSubaccountId,
        amount: {
          denom: amount.denom,
          amount: Long.fromValue(amount.amount).toString()
        }
      };
    },
    fromAmino: ({
      sender,
      source_subaccount_id,
      destination_subaccount_id,
      amount
    }) => {
      return {
        sender,
        sourceSubaccountId: source_subaccount_id,
        destinationSubaccountId: destination_subaccount_id,
        amount: {
          denom: amount.denom,
          amount: amount.amount
        }
      };
    }
  },
  "/injective.exchange.v1beta1.MsgExternalTransfer": {
    aminoType: "/injective.exchange.v1beta1.MsgExternalTransfer",
    toAmino: ({
      sender,
      sourceSubaccountId,
      destinationSubaccountId,
      amount
    }) => {
      return {
        sender,
        source_subaccount_id: sourceSubaccountId,
        destination_subaccount_id: destinationSubaccountId,
        amount: {
          denom: amount.denom,
          amount: Long.fromValue(amount.amount).toString()
        }
      };
    },
    fromAmino: ({
      sender,
      source_subaccount_id,
      destination_subaccount_id,
      amount
    }) => {
      return {
        sender,
        sourceSubaccountId: source_subaccount_id,
        destinationSubaccountId: destination_subaccount_id,
        amount: {
          denom: amount.denom,
          amount: amount.amount
        }
      };
    }
  },
  "/injective.exchange.v1beta1.MsgLiquidatePosition": {
    aminoType: "/injective.exchange.v1beta1.MsgLiquidatePosition",
    toAmino: ({
      sender,
      subaccountId,
      marketId,
      order
    }) => {
      return {
        sender,
        subaccount_id: subaccountId,
        market_id: marketId,
        order: {
          market_id: order.marketId,
          order_info: {
            subaccount_id: order.orderInfo.subaccountId,
            fee_recipient: order.orderInfo.feeRecipient,
            price: order.orderInfo.price,
            quantity: order.orderInfo.quantity
          },
          order_type: order.orderType,
          margin: order.margin,
          trigger_price: order.triggerPrice
        }
      };
    },
    fromAmino: ({
      sender,
      subaccount_id,
      market_id,
      order
    }) => {
      return {
        sender,
        subaccountId: subaccount_id,
        marketId: market_id,
        order: {
          marketId: order.market_id,
          orderInfo: {
            subaccountId: order.order_info.subaccount_id,
            feeRecipient: order.order_info.fee_recipient,
            price: order.order_info.price,
            quantity: order.order_info.quantity
          },
          orderType: orderTypeFromJSON(order.order_type),
          margin: order.margin,
          triggerPrice: order.trigger_price
        }
      };
    }
  },
  "/injective.exchange.v1beta1.MsgIncreasePositionMargin": {
    aminoType: "/injective.exchange.v1beta1.MsgIncreasePositionMargin",
    toAmino: ({
      sender,
      sourceSubaccountId,
      destinationSubaccountId,
      marketId,
      amount
    }) => {
      return {
        sender,
        source_subaccount_id: sourceSubaccountId,
        destination_subaccount_id: destinationSubaccountId,
        market_id: marketId,
        amount
      };
    },
    fromAmino: ({
      sender,
      source_subaccount_id,
      destination_subaccount_id,
      market_id,
      amount
    }) => {
      return {
        sender,
        sourceSubaccountId: source_subaccount_id,
        destinationSubaccountId: destination_subaccount_id,
        marketId: market_id,
        amount
      };
    }
  },
  "/injective.exchange.v1beta1.MsgRewardsOptOut": {
    aminoType: "/injective.exchange.v1beta1.MsgRewardsOptOut",
    toAmino: ({
      sender
    }) => {
      return {
        sender
      };
    },
    fromAmino: ({
      sender
    }) => {
      return {
        sender
      };
    }
  },
  "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket": {
    aminoType: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket",
    toAmino: ({
      sender,
      marketId,
      settlementPrice,
      expirationTimestamp,
      settlementTimestamp,
      status
    }) => {
      return {
        sender,
        market_id: marketId,
        settlement_price: settlementPrice,
        expiration_timestamp: expirationTimestamp.toString(),
        settlement_timestamp: settlementTimestamp.toString(),
        status
      };
    },
    fromAmino: ({
      sender,
      market_id,
      settlement_price,
      expiration_timestamp,
      settlement_timestamp,
      status
    }) => {
      return {
        sender,
        marketId: market_id,
        settlementPrice: settlement_price,
        expirationTimestamp: Long.fromString(expiration_timestamp),
        settlementTimestamp: Long.fromString(settlement_timestamp),
        status: marketStatusFromJSON(status)
      };
    }
  }
};