154 lines
2.9 KiB
Protocol Buffer
154 lines
2.9 KiB
Protocol Buffer
syntax = "proto3";
|
|
package emerald;
|
|
option java_package = "io.emeraldpay.api.proto";
|
|
import "common.proto";
|
|
|
|
service Blockchain {
|
|
rpc SubscribeHead (Chain) returns (stream ChainHead) {
|
|
}
|
|
rpc SubscribeBalance (BalanceRequest) returns (stream AddressBalance) {
|
|
}
|
|
rpc SubscribeTxStatus (TxStatusRequest) returns (stream TxStatus) {
|
|
}
|
|
|
|
rpc GetBalance (BalanceRequest) returns (stream AddressBalance) {
|
|
}
|
|
|
|
rpc NativeCall (NativeCallRequest) returns (stream NativeCallReplyItem) {
|
|
}
|
|
|
|
rpc Describe (DescribeRequest) returns (DescribeResponse) {
|
|
}
|
|
rpc SubscribeStatus (StatusRequest) returns (stream ChainStatus) {
|
|
}
|
|
}
|
|
|
|
message NativeCallRequest {
|
|
ChainRef chain = 1;
|
|
repeated NativeCallItem items = 2;
|
|
Selector selector = 3;
|
|
int32 quorum = 4;
|
|
AvailabilityEnum min_availability = 5;
|
|
}
|
|
|
|
message NativeCallItem {
|
|
uint32 id = 1;
|
|
string method = 3;
|
|
bytes payload = 4;
|
|
}
|
|
|
|
message NativeCallReplyItem {
|
|
uint32 id = 1;
|
|
bool succeed = 2;
|
|
bytes payload = 3;
|
|
string errorMessage = 4;
|
|
}
|
|
|
|
message ChainHead {
|
|
ChainRef chain = 1;
|
|
uint64 height = 2;
|
|
string block_id = 3;
|
|
uint64 timestamp = 4;
|
|
bytes weight = 5;
|
|
uint64 reorg = 6;
|
|
}
|
|
|
|
message TxStatusRequest {
|
|
ChainRef chain = 1;
|
|
string tx_id = 2;
|
|
uint32 confirmation_limit = 3;
|
|
}
|
|
|
|
message TxStatus {
|
|
string tx_id = 1;
|
|
bool broadcasted = 2;
|
|
bool mined = 3;
|
|
BlockInfo block = 4;
|
|
uint32 confirmations = 5;
|
|
}
|
|
|
|
message BalanceRequest {
|
|
Asset asset = 1;
|
|
AnyAddress address = 2;
|
|
}
|
|
|
|
message AddressBalance {
|
|
Asset asset = 1;
|
|
SingleAddress address = 2;
|
|
string balance = 3;
|
|
}
|
|
|
|
message DescribeRequest {
|
|
}
|
|
|
|
message DescribeResponse {
|
|
repeated DescribeChain chains = 1;
|
|
}
|
|
|
|
message DescribeChain {
|
|
ChainRef chain = 1;
|
|
ChainStatus status = 2;
|
|
repeated NodeDetails nodes = 3;
|
|
repeated string supportedMethods = 4;
|
|
repeated string excludedMethods = 5;
|
|
}
|
|
|
|
message StatusRequest {
|
|
repeated ChainRef chains = 1;
|
|
}
|
|
|
|
message ChainStatus {
|
|
ChainRef chain = 1;
|
|
AvailabilityEnum availability = 2;
|
|
uint32 quorum = 3;
|
|
}
|
|
|
|
enum AvailabilityEnum {
|
|
AVAIL_UNKNOWN = 0;
|
|
AVAIL_OK = 1;
|
|
AVAIL_LAGGING = 2;
|
|
AVAIL_IMMATURE = 3;
|
|
AVAIL_SYNCING = 4;
|
|
AVAIL_UNAVAILABLE = 5;
|
|
}
|
|
|
|
message NodeDetails {
|
|
uint32 quorum = 1;
|
|
repeated Label labels = 2;
|
|
}
|
|
|
|
message Label {
|
|
string name = 1;
|
|
string value = 2;
|
|
}
|
|
|
|
message Selector {
|
|
oneof selector_type {
|
|
LabelSelector labelSelector = 1;
|
|
OrSelector orSelector = 2;
|
|
AndSelector andSelector = 3;
|
|
NotSelector notSelector = 4;
|
|
ExistsSelector existsSelector = 5;
|
|
}
|
|
}
|
|
|
|
message LabelSelector {
|
|
string name = 1;
|
|
repeated string value = 2;
|
|
}
|
|
|
|
message OrSelector {
|
|
repeated Selector selectors = 1;
|
|
}
|
|
|
|
message AndSelector {
|
|
repeated Selector selectors = 1;
|
|
}
|
|
|
|
message NotSelector {
|
|
Selector selector = 1;
|
|
}
|
|
|
|
message ExistsSelector {
|
|
string name = 1;
|
|
} |