Skip to content

Instantly share code, notes, and snippets.

@radius
Last active April 4, 2023 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radius/06ee8a1eb207472316529b6db23636c5 to your computer and use it in GitHub Desktop.
Save radius/06ee8a1eb207472316529b6db23636c5 to your computer and use it in GitHub Desktop.
service ExposureChartService {
rpc GetExposureChart (GetExposureChartRequest) returns (GetExposureChartResponse);
rpc GetExposureInfluencingAddresses (GetExposureInfluencingAddressesRequest) returns (GetExposureInfluencingAddressesResponse);
}
message GetExposureChartRequest {
string network_name = 1;
string address = 2;
}
message GetExposureChartResponse {
ExposureChart exposure_chart = 1;
}
enum RiskLevelType {
RISK_LEVEL_TYPE_UNSPECIFIED = 0;
RISK_LEVEL_TYPE_LOW = 1;
RISK_LEVEL_TYPE_MEDIUM = 2;
RISK_LEVEL_TYPE_HIGH = 3;
}
message Label {
string id = 1;
string display_name = 2;
RiskLevelType risk_level = 3;
}
enum InfluenceLevel {
INFLUENCE_LEVEL_UNSPECIFIED = 0;
INFLUENCE_LEVEL_LOW = 1;
INFLUENCE_LEVEL_MEDIUM = 2;
INFLUENCE_LEVEL_HIGH = 3;
}
message DirectExposure {
Label label = 1;
double exposure_percent = 2;
int32 num_addresses = 3;
}
message IndirectExposure {
Label label = 1;
InfluenceLevel influence = 2;
int32 num_addresses = 3;
int32 min_hops = 4;
int32 max_hops = 5;
}
message ExposureChart {
repeated DirectExposure sending_direct = 1;
repeated IndirectExposure sending_indirect = 2;
repeated DirectExposure receiving_direct = 3;
repeated IndirectExposure receiving_indirect = 4;
}
message GetExposureInfluencingAddressesRequest {
string network_name = 1;
string address = 2;
enum Direction {
DIRECTION_UNSPECIFIED = 0;
DIRECTION_RECEIVE = 1;
DIRECTION_SEND = 2;
}
Direction direction = 3;
enum ExposureType {
EXPOSURE_TYPE_UNSPECIFIED = 0;
EXPOSURE_TYPE_DIRECT = 1;
EXPOSURE_TYPE_INDIRECT = 2;
}
ExposureType exposure = 4;
string label = 5;
}
message InfluencingAddress {
string address = 1;
int32 min_hops = 2;
int32 max_hops = 3;
repeated string connecting_addresses = 4;
}
message GetExposureInfluencingAddressesResponse {
repeated InfluencingAddress influencing_addresses = 3;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment