syntax = "proto3";
package tendermint.liquidity;

import "google/api/annotations.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "tx.proto";

option go_package = "github.com/tendermint/liquidity/x/liquidity/types";
//option (gogoproto.goproto_getters_all) = false;

//option (gogoproto.goproto_stringer_all) = false;
//option (gogoproto.stringer_all)         = false;

// Msg defines the staking Msg service.
service MsgApi {
  // Submit create liquidity pool message.
  rpc CreatePoolApi(MsgCreatePoolRequest) returns (MsgCreatePoolResponse) {
    option (google.api.http) = {
      post: "/liquidity/pools/{test}"
      body: "msg" // WARNING(protoanalysis): changed from * to msg to test: param + body
    };
    option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
      description: "unsigned tx can be generated upon request through this POST endpoint, you can broadcast adding signature to the generated tx, through endpoint such as /txs or rpc, After broadcast, the result can be subscribe through the event and please refer to the spec."
      tags: "Tx";
      external_docs: {
        //        url: "https://github.com/tendermint/liquidity/tree/develop/x/liquidity/spec";
        //        description: "Find out more message spec and response events here";
        url: "https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/migrations/00-intro.md";
        description: "According to migrating-to-new-rest-endpoints, the POST endpoints of the New gGPC-gateway REST are N/A and guided directly to use Protobuf, need to use cli or localhost:1317/cosmos/tx/v1beta1/txs for broadcast txs temporarily";
      }
//      responses: {
//        key: "500";
//        value: {
//          description: "Server internal error";
//        }
//      }
//      responses: {
//        key: "400";
//        value: {
//          description: "Invalid request";
//        }
//      }
    };
  };

  // Submit deposit to the liquidity pool batch
  rpc DepositWithinBatchApi(MsgDepositWithinBatchRequest) returns (MsgDepositWithinBatchResponse) {
    option (google.api.http) = {
      post: "/liquidity/pools/{pool_id}/batch/deposits"
      body: "*"
    };
    option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
      description: "unsigned tx can be generated upon request through this POST endpoint, you can broadcast adding signature to the generated tx, through endpoint such as /txs or rpc, After broadcast, the result can be subscribe through the event and please refer to the spec."
      tags: "Tx";
      external_docs: {
        url: "https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/migrations/00-intro.md";
        description: "According to migrating-to-new-rest-endpoints, the POST endpoints of the New gGPC-gateway REST are N/A and guided directly to use Protobuf, need to use cli or localhost:1317/cosmos/tx/v1beta1/txs for broadcast txs temporarily";
      }
    };
  };

  // Submit withdraw from to the liquidity pool batch
  rpc WithdrawWithinBatchApi(MsgWithdrawWithinBatchRequest) returns (MsgWithdrawWithinBatchResponse) {
    option (google.api.http) = {
      post: "/liquidity/pools/{pool_id}/batch/withdraws"
      body: "*"
    };
    option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
      description: "unsigned tx can be generated upon request through this POST endpoint, you can broadcast adding signature to the generated tx, through endpoint such as /txs or rpc, After broadcast, the result can be subscribe through the event and please refer to the spec."
      tags: "Tx";
      external_docs: {
        url: "https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/migrations/00-intro.md";
        description: "According to migrating-to-new-rest-endpoints, the POST endpoints of the New gGPC-gateway REST are N/A and guided directly to use Protobuf, need to use cli or localhost:1317/cosmos/tx/v1beta1/txs for broadcast txs temporarily";
      }
    };
  };

  // Submit swap to the liquidity pool batch
  rpc SwapApi(MsgSwapWithinBatchRequest) returns (MsgSwapWithinBatchResponse) {
    option (google.api.http) = {
      post: "/liquidity/pools/{pool_id}/batch/swaps"
      body: "msg" // WARNING(protoanalysis): changed from * to msg to test: param + query + body
    };
    option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
      description: "unsigned tx can be generated upon request through this POST endpoint, you can broadcast adding signature to the generated tx, through endpoint such as /txs or rpc, After broadcast, the result can be subscribe through the event and please refer to the spec."
      tags: "Tx";
      external_docs: {
        url: "https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/migrations/00-intro.md";
        description: "According to migrating-to-new-rest-endpoints, the POST endpoints of the New gGPC-gateway REST are N/A and guided directly to use Protobuf, need to use cli or localhost:1317/cosmos/tx/v1beta1/txs for broadcast txs temporarily";
      }
    };
  };
}
