github.com/Finschia/finschia-sdk@v0.49.1/proto/cosmos/tx/v1beta1/service.proto (about)

     1  syntax = "proto3";
     2  package cosmos.tx.v1beta1;
     3  
     4  import "google/api/annotations.proto";
     5  import "cosmos/base/abci/v1beta1/abci.proto";
     6  import "cosmos/tx/v1beta1/tx.proto";
     7  import "gogoproto/gogo.proto";
     8  import "cosmos/base/query/v1beta1/pagination.proto";
     9  import "tendermint/types/block.proto";
    10  import "tendermint/types/types.proto";
    11  
    12  option (gogoproto.goproto_registration) = true;
    13  option go_package                       = "github.com/Finschia/finschia-sdk/types/tx";
    14  
    15  // Service defines a gRPC service for interacting with transactions.
    16  service Service {
    17    // Simulate simulates executing a transaction for estimating gas usage.
    18    rpc Simulate(SimulateRequest) returns (SimulateResponse) {
    19      option (google.api.http) = {
    20        post: "/cosmos/tx/v1beta1/simulate"
    21        body: "*"
    22      };
    23    }
    24    // GetTx fetches a tx by hash.
    25    rpc GetTx(GetTxRequest) returns (GetTxResponse) {
    26      option (google.api.http).get = "/cosmos/tx/v1beta1/txs/{hash}";
    27    }
    28    // BroadcastTx broadcast transaction.
    29    rpc BroadcastTx(BroadcastTxRequest) returns (BroadcastTxResponse) {
    30      option (google.api.http) = {
    31        post: "/cosmos/tx/v1beta1/txs"
    32        body: "*"
    33      };
    34    }
    35    // GetTxsEvent fetches txs by event.
    36    rpc GetTxsEvent(GetTxsEventRequest) returns (GetTxsEventResponse) {
    37      option (google.api.http).get = "/cosmos/tx/v1beta1/txs";
    38    }
    39    // GetBlockWithTxs fetches a block with decoded txs.
    40    //
    41    // Since: cosmos-sdk 0.45.2
    42    // WARNING: In `GetBlockWithTxs` for compatibility with cosmos-sdk API, the result converted from Ostracon block type
    43    // to tendermint block type without `entropy` is returned.
    44    // Therefore, verification fails with the tendermint block validation method.
    45    // For original information, please check `GetBlockWithTxs` in `lbm/tx/v1beta1/service.proto`.
    46    rpc GetBlockWithTxs(GetBlockWithTxsRequest) returns (GetBlockWithTxsResponse) {
    47      option (google.api.http).get = "/cosmos/tx/v1beta1/txs/block/{height}";
    48    }
    49  }
    50  
    51  // GetTxsEventRequest is the request type for the Service.TxsByEvents
    52  // RPC method.
    53  message GetTxsEventRequest {
    54    // events is the list of transaction event type.
    55    repeated string events = 1;
    56    // pagination defines a pagination for the request.
    57    cosmos.base.query.v1beta1.PageRequest pagination = 2;
    58    OrderBy                               order_by   = 3;
    59  }
    60  
    61  // OrderBy defines the sorting order
    62  enum OrderBy {
    63    // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case.
    64    ORDER_BY_UNSPECIFIED = 0;
    65    // ORDER_BY_ASC defines ascending order
    66    ORDER_BY_ASC = 1;
    67    // ORDER_BY_DESC defines descending order
    68    ORDER_BY_DESC = 2;
    69  }
    70  
    71  // GetTxsEventResponse is the response type for the Service.TxsByEvents
    72  // RPC method.
    73  message GetTxsEventResponse {
    74    // txs is the list of queried transactions.
    75    repeated cosmos.tx.v1beta1.Tx txs = 1;
    76    // tx_responses is the list of queried TxResponses.
    77    repeated cosmos.base.abci.v1beta1.TxResponse tx_responses = 2;
    78    // pagination defines a pagination for the response.
    79    cosmos.base.query.v1beta1.PageResponse pagination = 3;
    80  }
    81  
    82  // BroadcastTxRequest is the request type for the Service.BroadcastTxRequest
    83  // RPC method.
    84  message BroadcastTxRequest {
    85    // tx_bytes is the raw transaction.
    86    bytes         tx_bytes = 1;
    87    BroadcastMode mode     = 2;
    88  }
    89  
    90  // BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method.
    91  enum BroadcastMode {
    92    // zero-value for mode ordering
    93    BROADCAST_MODE_UNSPECIFIED = 0;
    94    // DEPRECATED: use BROADCAST_MODE_SYNC instead,
    95    BROADCAST_MODE_BLOCK = 1 [deprecated = true];
    96    // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for
    97    // a CheckTx execution response only.
    98    BROADCAST_MODE_SYNC = 2;
    99    // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns
   100    // immediately.
   101    BROADCAST_MODE_ASYNC = 3;
   102  }
   103  
   104  // BroadcastTxResponse is the response type for the
   105  // Service.BroadcastTx method.
   106  message BroadcastTxResponse {
   107    // tx_response is the queried TxResponses.
   108    cosmos.base.abci.v1beta1.TxResponse tx_response = 1;
   109  }
   110  
   111  // SimulateRequest is the request type for the Service.Simulate
   112  // RPC method.
   113  message SimulateRequest {
   114    // tx is the transaction to simulate.
   115    // Deprecated. Send raw tx bytes instead.
   116    cosmos.tx.v1beta1.Tx tx = 1 [deprecated = true];
   117    // tx_bytes is the raw transaction.
   118    //
   119    // Since: cosmos-sdk 0.43
   120    bytes tx_bytes = 2;
   121  }
   122  
   123  // SimulateResponse is the response type for the
   124  // Service.SimulateRPC method.
   125  message SimulateResponse {
   126    // gas_info is the information about gas used in the simulation.
   127    cosmos.base.abci.v1beta1.GasInfo gas_info = 1;
   128    // result is the result of the simulation.
   129    cosmos.base.abci.v1beta1.Result result = 2;
   130  }
   131  
   132  // GetTxRequest is the request type for the Service.GetTx
   133  // RPC method.
   134  message GetTxRequest {
   135    // hash is the tx hash to query, encoded as a hex string.
   136    string hash = 1;
   137  }
   138  
   139  // GetTxResponse is the response type for the Service.GetTx method.
   140  message GetTxResponse {
   141    // tx is the queried transaction.
   142    cosmos.tx.v1beta1.Tx tx = 1;
   143    // tx_response is the queried TxResponses.
   144    cosmos.base.abci.v1beta1.TxResponse tx_response = 2;
   145  }
   146  
   147  // GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs
   148  // RPC method.
   149  //
   150  // Since: cosmos-sdk 0.45.2
   151  message GetBlockWithTxsRequest {
   152    // height is the height of the block to query.
   153    int64 height = 1;
   154    // pagination defines a pagination for the request.
   155    cosmos.base.query.v1beta1.PageRequest pagination = 2;
   156  }
   157  
   158  // GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method.
   159  //
   160  // Since: cosmos-sdk 0.45.2
   161  message GetBlockWithTxsResponse {
   162    // txs are the transactions in the block.
   163    repeated cosmos.tx.v1beta1.Tx txs      = 1;
   164    .tendermint.types.BlockID     block_id = 2;
   165    .tendermint.types.Block       block    = 3;
   166    // pagination defines a pagination for the response.
   167    cosmos.base.query.v1beta1.PageResponse pagination = 4;
   168  }