github.com/InjectiveLabs/sdk-go@v1.53.0/exchange/campaign_rpc/pb/injective_campaign_rpc.proto (about)

     1  // Code generated with goa v3.7.0, DO NOT EDIT.
     2  //
     3  // InjectiveCampaignRPC protocol buffer definition
     4  //
     5  // Command:
     6  // $ goa gen github.com/InjectiveLabs/injective-indexer/api/design -o ../
     7  
     8  syntax = "proto3";
     9  
    10  package injective_campaign_rpc;
    11  
    12  option go_package = "/injective_campaign_rpcpb";
    13  
    14  // InjectiveCampaignRPC defined a gRPC service for Injective Campaigns.
    15  service InjectiveCampaignRPC {
    16  	// Lists all participants in campaign
    17  	rpc Ranking (RankingRequest) returns (RankingResponse);
    18  	// List current round active campaigns
    19  	rpc Campaigns (CampaignsRequest) returns (CampaignsResponse);
    20  	// List campaigns v2
    21  	rpc CampaignsV2 (CampaignsV2Request) returns (CampaignsV2Response);
    22  	// List guilds by campaign
    23  	rpc ListGuilds (ListGuildsRequest) returns (ListGuildsResponse);
    24  	// List guild members of given campaign and guildId
    25  	rpc ListGuildMembers (ListGuildMembersRequest) returns (ListGuildMembersResponse);
    26  	// Get single member guild info
    27  	rpc GetGuildMember (GetGuildMemberRequest) returns (GetGuildMemberResponse);
    28  }
    29  
    30  message RankingRequest {
    31  	// Campaign ID
    32  	string campaign_id = 1;
    33  	// MarketId of the campaign
    34  	string market_id = 2;
    35  	// Account address
    36  	string account_address = 3;
    37  	sint32 limit = 4;
    38  	uint64 skip = 5;
    39  	// Contract address that manages the round and reward
    40  	string contract_address = 6;
    41  }
    42  
    43  message RankingResponse {
    44  	// The campaign information
    45  	Campaign campaign = 1;
    46  	// The campaign users
    47  	repeated CampaignUser users = 2;
    48  	Paging paging = 3;
    49  }
    50  
    51  message Campaign {
    52  	string campaign_id = 1;
    53  	// MarketId of the trading strategy
    54  	string market_id = 2;
    55  	// Total campaign score
    56  	string total_score = 4;
    57  	// Last time the campaign score has been updated.
    58  	sint64 last_updated = 5;
    59  	// Campaign start date in UNIX millis.
    60  	sint64 start_date = 6;
    61  	// Campaign end date in UNIX millis.
    62  	sint64 end_date = 7;
    63  	// Whether the campaign rewards can be claimed.
    64  	bool is_claimable = 8;
    65  	// Campaigns round ID
    66  	sint32 round_id = 9;
    67  	// Contract address that controls this campaign
    68  	string manager_contract = 10;
    69  	// Reward tokens of this campaign
    70  	repeated Coin rewards = 11;
    71  	// Total user score if accountAddress is passed, this is useful to estimate
    72  // account's reward
    73  	string user_score = 12;
    74  	// Return true if user claimed the reward of this campaign
    75  	bool user_claimed = 13;
    76  	// Suffix of the subaccount that eligible for volume score
    77  	string subaccount_id_suffix = 14;
    78  	// Contract that manage users reward
    79  	string reward_contract = 15;
    80  	// Version of reward contract, UI use this to determine the message that need
    81  // to be sent
    82  	string version = 16;
    83  	// Campaign type
    84  	string type = 17;
    85  }
    86  
    87  message Coin {
    88  	// Denom of the coin
    89  	string denom = 1;
    90  	string amount = 2;
    91  }
    92  
    93  message CampaignUser {
    94  	string campaign_id = 1;
    95  	// MarketId of the trading strategy
    96  	string market_id = 2;
    97  	// Account address
    98  	string account_address = 3;
    99  	// Campaign score
   100  	string score = 4;
   101  	// Whether the distribution contract has been updated with the latest score
   102  	bool contract_updated = 5;
   103  	// Block height when the score has been updated.
   104  	sint64 block_height = 6;
   105  	// Block time timestamp in UNIX millis.
   106  	sint64 block_time = 7;
   107  	// Amount swapped but only count base denom of the market
   108  	string purchased_amount = 8;
   109  	// True if this user is updated to be in Galxe Campain list, only eligible
   110  // address are added
   111  	bool galxe_updated = 9;
   112  	// True if this user claimed the reward
   113  	bool reward_claimed = 10;
   114  }
   115  // Paging defines the structure for required params for handling pagination
   116  message Paging {
   117  	// total number of txs saved in database
   118  	sint64 total = 1;
   119  	// can be either block height or index num
   120  	sint32 from = 2;
   121  	// can be either block height or index num
   122  	sint32 to = 3;
   123  	// count entries by subaccount, serving some places on helix
   124  	sint64 count_by_subaccount = 4;
   125  	// array of tokens to navigate to the next pages
   126  	repeated string next = 5;
   127  }
   128  
   129  message CampaignsRequest {
   130  	// Round ID, if not specified, it will return latest roundId
   131  	sint64 round_id = 1;
   132  	// Address of login account, if not specified it will return no user rewards
   133  	string account_address = 2;
   134  	// This will return campaign x where x.roundId <= toRoundId. Useful for listing
   135  // multiple rounds
   136  	sint32 to_round_id = 3;
   137  	// Contract address that manages the round and reward
   138  	string contract_address = 4;
   139  	// Campaign type
   140  	string type = 5;
   141  }
   142  
   143  message CampaignsResponse {
   144  	repeated Campaign campaigns = 1;
   145  	repeated Coin accumulated_rewards = 2;
   146  	sint32 reward_count = 3;
   147  }
   148  
   149  message CampaignsV2Request {
   150  	// Campaign type
   151  	string type = 1;
   152  	// Whether the campaign is active
   153  	bool active = 2;
   154  	// Limit number of returned campaigns
   155  	sint32 limit = 3;
   156  	// Cursor for pagination
   157  	string cursor = 4;
   158  }
   159  
   160  message CampaignsV2Response {
   161  	repeated CampaignV2 campaigns = 1;
   162  	string cursor = 2;
   163  }
   164  
   165  message CampaignV2 {
   166  	string campaign_id = 1;
   167  	// MarketId of the trading strategy
   168  	string market_id = 2;
   169  	// Total campaign score
   170  	string total_score = 4;
   171  	// Campaign creation date in UNIX millis.
   172  	sint64 created_at = 5;
   173  	// Campaign last update date in UNIX millis.
   174  	sint64 updated_at = 6;
   175  	// Campaign start date in UNIX millis.
   176  	sint64 start_date = 7;
   177  	// Campaign end date in UNIX millis.
   178  	sint64 end_date = 8;
   179  	// Whether the campaign rewards can be claimed.
   180  	bool is_claimable = 9;
   181  	// Campaigns round ID
   182  	sint32 round_id = 10;
   183  	// Contract address that controls this campaign
   184  	string manager_contract = 11;
   185  	// Reward tokens of this campaign
   186  	repeated Coin rewards = 12;
   187  	// Suffix of the subaccount that eligible for volume score
   188  	string subaccount_id_suffix = 13;
   189  	// Contract that manage users reward
   190  	string reward_contract = 14;
   191  	// Campaign type
   192  	string type = 15;
   193  	// Version of reward contract, UI use this to determine the message that need
   194  // to be sent
   195  	string version = 16;
   196  	// Campaign name
   197  	string name = 17;
   198  	// Campaign description
   199  	string description = 18;
   200  }
   201  
   202  message ListGuildsRequest {
   203  	// Campaign contract address
   204  	string campaign_contract = 1;
   205  	// Limit number of returned guilds
   206  	sint32 limit = 2;
   207  	// Skip some first guilds in the list for next page
   208  	sint32 skip = 3;
   209  	// Sort by some metrics
   210  	string sort_by = 4;
   211  }
   212  
   213  message ListGuildsResponse {
   214  	repeated Guild guilds = 1;
   215  	Paging paging = 2;
   216  	// Snapshot updated at time in UNIX milli
   217  	sint64 updated_at = 3;
   218  	// Summary of the campaign
   219  	CampaignSummary campaign_summary = 4;
   220  }
   221  
   222  message Guild {
   223  	string campaign_contract = 1;
   224  	// Guild ID
   225  	string guild_id = 2;
   226  	// Guild's master address
   227  	string master_address = 3;
   228  	// Guild creation date (in UNIX milliseconds)
   229  	sint64 created_at = 4;
   230  	// Average TVL score
   231  	string tvl_score = 5;
   232  	// Total volume score
   233  	string volume_score = 6;
   234  	// guild's rank by volume
   235  	sint32 rank_by_volume = 7;
   236  	// guild's rank by TVL
   237  	sint32 rank_by_tvl = 8;
   238  	// guild's logo, at the moment it supports numberic string (i.e '1', '2' and so
   239  // on) not a random URL because of front end limitation
   240  	string logo = 9;
   241  	// guild's total TVL
   242  	string total_tvl = 10;
   243  	// Snapshot updated at time in UNIX milli
   244  	sint64 updated_at = 11;
   245  	// Guild name
   246  	string name = 14;
   247  	// Active status of guild, true when master total tvl meets the minimum
   248  // requirements
   249  	bool is_active = 13;
   250  	// Master balance (in current campaigns denom)
   251  	string master_balance = 15;
   252  	// Guild description, set by master of the guild
   253  	string description = 16;
   254  }
   255  
   256  message CampaignSummary {
   257  	// Campaign id
   258  	string campaign_id = 1;
   259  	// Guild manager contract address
   260  	string campaign_contract = 2;
   261  	// Number of guild in the campaign
   262  	sint32 total_guilds_count = 3;
   263  	// Total TVL
   264  	string total_tvl = 4;
   265  	// Sum average TVL of all guilds
   266  	string total_average_tvl = 5;
   267  	// Total volume across all guilds (in market quote denom, often USDT)
   268  	string total_volume = 6;
   269  	// Snapshot updated at time in UNIX milli
   270  	sint64 updated_at = 7;
   271  	// Total member joined the campaign (include guild masters)
   272  	sint32 total_members_count = 8;
   273  	// Campaign start time
   274  	sint64 start_time = 9;
   275  	// Campaign end time
   276  	sint64 end_time = 10;
   277  }
   278  
   279  message ListGuildMembersRequest {
   280  	// Campaign contract address
   281  	string campaign_contract = 1;
   282  	// ID of guild, inside campaign
   283  	string guild_id = 2;
   284  	// Limit number of returned guild members
   285  	sint32 limit = 3;
   286  	// Skip some first guild members in the list for next page
   287  	sint32 skip = 4;
   288  	// whether to include guild summary info, it's better to use this in terms of
   289  // latency, instead of sending 2 requests we just need once
   290  	bool include_guild_info = 5;
   291  	// Sort by some metrics
   292  	string sort_by = 6;
   293  }
   294  
   295  message ListGuildMembersResponse {
   296  	repeated GuildMember members = 1;
   297  	Paging paging = 2;
   298  	Guild guild_info = 3;
   299  }
   300  
   301  message GuildMember {
   302  	// Guild manager contract address
   303  	string campaign_contract = 1;
   304  	// Guild ID
   305  	string guild_id = 2;
   306  	// Guild member address
   307  	string address = 3;
   308  	// Guild enrollment date (in UNIX milliseconds)
   309  	sint64 joined_at = 4;
   310  	// Average TVL score
   311  	string tvl_score = 5;
   312  	// Total volume score
   313  	string volume_score = 6;
   314  	// Total volume score
   315  	string total_tvl = 7;
   316  	// Volume percentage out of guilds total volume
   317  	double volume_score_percentage = 8;
   318  	// TVL percentage out of guilds total TVL score
   319  	double tvl_score_percentage = 9;
   320  	// Rewards for volume campaign (amount+denom)
   321  	repeated Coin tvl_reward = 10;
   322  	// Rewards for TVL campaign (amount+denom)
   323  	repeated Coin volume_reward = 11;
   324  }
   325  
   326  message GetGuildMemberRequest {
   327  	// Campaign contract address
   328  	string campaign_contract = 1;
   329  	// User address
   330  	string address = 2;
   331  }
   332  
   333  message GetGuildMemberResponse {
   334  	GuildMember info = 1;
   335  }