github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/cosmos-sdk/types/tx/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 10 option (gogoproto.goproto_registration) = true; 11 option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; 12 13 // Service defines a gRPC service for interacting with transactions. 14 service Service { 15 // Simulate simulates executing a transaction for estimating gas usage. 16 rpc Simulate(SimulateRequest) returns (SimulateResponse) { 17 option (google.api.http) = { 18 post: "/cosmos/tx/v1beta1/simulate" 19 body: "*" 20 }; 21 } 22 // GetTx fetches a tx by hash. 23 rpc GetTx(GetTxRequest) returns (GetTxResponse) { 24 option (google.api.http).get = "/cosmos/tx/v1beta1/txs/{hash}"; 25 } 26 // BroadcastTx broadcast transaction. 27 rpc BroadcastTx(BroadcastTxRequest) returns (BroadcastTxResponse) { 28 option (google.api.http) = { 29 post: "/cosmos/tx/v1beta1/txs" 30 body: "*" 31 }; 32 } 33 // GetTxsEvent fetches txs by event. 34 rpc GetTxsEvent(GetTxsEventRequest) returns (GetTxsEventResponse) { 35 option (google.api.http).get = "/cosmos/tx/v1beta1/txs"; 36 } 37 } 38 39 // GetTxsEventRequest is the request type for the Service.TxsByEvents 40 // RPC method. 41 message GetTxsEventRequest { 42 // events is the list of transaction event type. 43 repeated string events = 1; 44 // pagination defines an pagination for the request. 45 cosmos.base.query.v1beta1.PageRequest pagination = 2; 46 OrderBy order_by = 3; 47 } 48 49 // OrderBy defines the sorting order 50 enum OrderBy { 51 // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. 52 ORDER_BY_UNSPECIFIED = 0; 53 // ORDER_BY_ASC defines ascending order 54 ORDER_BY_ASC = 1; 55 // ORDER_BY_DESC defines descending order 56 ORDER_BY_DESC = 2; 57 } 58 59 // GetTxsEventResponse is the response type for the Service.TxsByEvents 60 // RPC method. 61 message GetTxsEventResponse { 62 // txs is the list of queried transactions. 63 repeated cosmos.tx.v1beta1.Tx txs = 1; 64 // tx_responses is the list of queried TxResponses. 65 repeated cosmos.base.abci.v1beta1.TxResponse tx_responses = 2; 66 // pagination defines an pagination for the response. 67 cosmos.base.query.v1beta1.PageResponse pagination = 3; 68 } 69 70 // BroadcastTxRequest is the request type for the Service.BroadcastTxRequest 71 // RPC method. 72 message BroadcastTxRequest { 73 // tx_bytes is the raw transaction. 74 bytes tx_bytes = 1; 75 BroadcastMode mode = 2; 76 } 77 78 // BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. 79 enum BroadcastMode { 80 // zero-value for mode ordering 81 BROADCAST_MODE_UNSPECIFIED = 0; 82 // BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for 83 // the tx to be committed in a block. 84 BROADCAST_MODE_BLOCK = 1; 85 // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for 86 // a CheckTx execution response only. 87 BROADCAST_MODE_SYNC = 2; 88 // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns 89 // immediately. 90 BROADCAST_MODE_ASYNC = 3; 91 } 92 93 // BroadcastTxResponse is the response type for the 94 // Service.BroadcastTx method. 95 message BroadcastTxResponse { 96 // tx_response is the queried TxResponses. 97 cosmos.base.abci.v1beta1.TxResponse tx_response = 1; 98 } 99 100 // SimulateRequest is the request type for the Service.Simulate 101 // RPC method. 102 message SimulateRequest { 103 // tx is the transaction to simulate. 104 // Deprecated. Send raw tx bytes instead. 105 cosmos.tx.v1beta1.Tx tx = 1 [deprecated = true]; 106 // tx_bytes is the raw transaction. 107 // 108 // Since: cosmos-sdk 0.43 109 bytes tx_bytes = 2; 110 } 111 112 // SimulateResponse is the response type for the 113 // Service.SimulateRPC method. 114 message SimulateResponse { 115 // gas_info is the information about gas used in the simulation. 116 cosmos.base.abci.v1beta1.GasInfo gas_info = 1; 117 // result is the result of the simulation. 118 cosmos.base.abci.v1beta1.Result result = 2; 119 } 120 121 // GetTxRequest is the request type for the Service.GetTx 122 // RPC method. 123 message GetTxRequest { 124 // hash is the tx hash to query, encoded as a hex string. 125 string hash = 1; 126 } 127 128 // GetTxResponse is the response type for the Service.GetTx method. 129 message GetTxResponse { 130 // tx is the queried transaction. 131 cosmos.tx.v1beta1.Tx tx = 1; 132 // tx_response is the queried TxResponses. 133 cosmos.base.abci.v1beta1.TxResponse tx_response = 2; 134 }