81 lines
2.2 KiB
Protocol Buffer
Raw Normal View History

2019-09-01 14:29:53 -07:00
syntax = "proto3";
package cash.z.wallet.sdk.rpc;
option go_package = "walletrpc";
import "compact_formats.proto";
// A BlockID message contains identifiers to select a block: a height or a
// hash. If the hash is present it takes precedence.
message BlockID {
uint64 height = 1;
bytes hash = 2;
}
// BlockRange technically allows ranging from hash to hash etc but this is not
// currently intended for support, though there is no reason you couldn't do
// it. Further permutations are left as an exercise.
message BlockRange {
BlockID start = 1;
BlockID end = 2;
}
// A TxFilter contains the information needed to identify a particular
// transaction: either a block and an index, or a direct transaction hash.
message TxFilter {
BlockID block = 1;
uint64 index = 2;
bytes hash = 3;
}
2019-09-13 19:13:09 -07:00
// RawTransaction contains the complete transaction data. It also optionally includes
// the block height in which the transaction was included
2019-09-01 14:29:53 -07:00
message RawTransaction {
bytes data = 1;
2019-09-13 19:13:09 -07:00
uint64 height = 2;
2019-09-01 14:29:53 -07:00
}
message SendResponse {
int32 errorCode = 1;
string errorMessage = 2;
}
// Empty placeholder. Someday we may want to specify e.g. a particular chain fork.
message ChainSpec {}
2019-09-05 13:19:48 -07:00
message Empty {}
2019-09-11 17:05:14 -07:00
message LightdInfo {
string version = 1;
string vendor = 2;
bool taddrSupport = 3;
2019-09-18 21:16:28 -07:00
string chainName = 4;
uint64 saplingActivationHeight = 5;
2019-09-25 17:45:25 -07:00
string consensusBranchId = 6; // This should really be u32 or []byte, but string for readability
2019-09-11 17:05:14 -07:00
}
message TransparentAddress {
string address = 1;
}
message TransparentAddressBlockFilter {
string address = 1;
BlockRange range = 2;
}
2019-09-01 14:29:53 -07:00
service CompactTxStreamer {
2019-09-11 17:05:14 -07:00
// Compact Blocks
2019-09-01 14:29:53 -07:00
rpc GetLatestBlock(ChainSpec) returns (BlockID) {}
rpc GetBlock(BlockID) returns (CompactBlock) {}
rpc GetBlockRange(BlockRange) returns (stream CompactBlock) {}
2019-09-11 17:05:14 -07:00
// Transactions
2019-09-01 14:29:53 -07:00
rpc GetTransaction(TxFilter) returns (RawTransaction) {}
rpc SendTransaction(RawTransaction) returns (SendResponse) {}
2019-09-11 17:05:14 -07:00
// t-Address support
rpc GetAddressTxids(TransparentAddressBlockFilter) returns (stream RawTransaction) {}
2019-09-11 17:05:14 -07:00
// Misc
rpc GetLightdInfo(Empty) returns (LightdInfo) {}
2019-09-01 14:29:53 -07:00
}