2021-02-13 07:41:47 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2021-03-19 21:24:49 +00:00
|
|
|
import "types/types.proto";
|
2021-02-13 07:41:47 +00:00
|
|
|
|
|
|
|
package txpool;
|
|
|
|
|
2021-04-15 08:58:26 +00:00
|
|
|
option go_package = "./txpool;txpool";
|
|
|
|
|
2021-03-19 21:24:49 +00:00
|
|
|
message TxHashes { repeated types.H256 hashes = 1; }
|
2021-02-13 07:41:47 +00:00
|
|
|
|
|
|
|
message ImportRequest { repeated bytes txs = 1; }
|
|
|
|
|
|
|
|
enum ImportResult {
|
2021-03-19 21:24:49 +00:00
|
|
|
SUCCESS = 0;
|
|
|
|
ALREADY_EXISTS = 1;
|
|
|
|
FEE_TOO_LOW = 2;
|
|
|
|
STALE = 3;
|
|
|
|
INVALID = 4;
|
2021-02-13 07:41:47 +00:00
|
|
|
INTERNAL_ERROR = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ImportReply { repeated ImportResult imported = 1; }
|
|
|
|
|
2021-03-19 21:24:49 +00:00
|
|
|
message GetTransactionsRequest { repeated types.H256 hashes = 1; }
|
2021-02-13 07:41:47 +00:00
|
|
|
message GetTransactionsReply { repeated bytes txs = 1; }
|
|
|
|
|
|
|
|
service Txpool {
|
2021-04-24 15:46:29 +00:00
|
|
|
// preserves incoming order, changes amount, unknown hashes will be omitted
|
2021-03-19 21:24:49 +00:00
|
|
|
rpc FindUnknownTransactions(TxHashes) returns (TxHashes);
|
2021-04-24 15:46:29 +00:00
|
|
|
// preserves incoming order and amount
|
2021-03-19 21:24:49 +00:00
|
|
|
rpc ImportTransactions(ImportRequest) returns (ImportReply);
|
2021-04-24 15:46:29 +00:00
|
|
|
// preserves incoming order and amount, if some transaction doesn't exists in pool - returns nil in this slot
|
2021-03-19 21:24:49 +00:00
|
|
|
rpc GetTransactions(GetTransactionsRequest) returns (GetTransactionsReply);
|
2021-02-13 07:41:47 +00:00
|
|
|
}
|