2024-02-02 09:39:10 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package cerc.bond.v1;
|
|
|
|
|
|
|
|
import "gogoproto/gogo.proto";
|
|
|
|
import "google/api/annotations.proto";
|
|
|
|
import "cosmos/base/query/v1beta1/pagination.proto";
|
2024-02-08 13:23:20 +00:00
|
|
|
import "cosmos/base/v1beta1/coin.proto";
|
2024-02-09 08:44:45 +00:00
|
|
|
import "cerc/bond/v1/bond.proto";
|
2024-02-02 09:39:10 +00:00
|
|
|
// import "cosmos/query/v1/query.proto";
|
|
|
|
|
2024-04-01 09:57:26 +00:00
|
|
|
option go_package = "git.vdb.to/cerc-io/laconicd/x/bond";
|
2024-02-15 07:08:32 +00:00
|
|
|
|
2024-02-02 09:39:10 +00:00
|
|
|
// Query defines the gRPC querier service for bond module
|
|
|
|
service Query {
|
2024-02-08 13:23:20 +00:00
|
|
|
// Params queries bonds module params.
|
|
|
|
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
|
|
|
option (google.api.http).get = "/cerc/bond/v1/params";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Bonds queries bonds list
|
2024-03-07 11:25:15 +00:00
|
|
|
rpc Bonds(QueryBondsRequest) returns (QueryBondsResponse) {
|
2024-02-08 13:23:20 +00:00
|
|
|
// Mark query as module_query_safe?
|
|
|
|
// option (cosmos.query.v1.module_query_safe) = true;
|
2024-02-02 09:39:10 +00:00
|
|
|
option (google.api.http).get = "/cerc/bond/v1/bonds";
|
|
|
|
}
|
2024-02-08 13:23:20 +00:00
|
|
|
|
|
|
|
// GetBondById
|
|
|
|
rpc GetBondById(QueryGetBondByIdRequest) returns (QueryGetBondByIdResponse) {
|
|
|
|
option (google.api.http).get = "/cerc/bond/v1/bonds/{id}";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get Bonds list by Owner
|
2024-03-07 11:25:15 +00:00
|
|
|
rpc GetBondsByOwner(QueryGetBondsByOwnerRequest)
|
|
|
|
returns (QueryGetBondsByOwnerResponse) {
|
2024-02-08 13:23:20 +00:00
|
|
|
option (google.api.http).get = "/cerc/bond/v1/by-owner/{owner}";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get Bond module balance
|
2024-03-07 11:25:15 +00:00
|
|
|
rpc GetBondModuleBalance(QueryGetBondModuleBalanceRequest)
|
|
|
|
returns (QueryGetBondModuleBalanceResponse) {
|
2024-02-08 13:23:20 +00:00
|
|
|
option (google.api.http).get = "/cerc/bond/v1/balance";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// QueryParamsRequest is request for query the bond module params
|
|
|
|
message QueryParamsRequest {}
|
|
|
|
|
|
|
|
// QueryParamsResponse returns response type of bond module params
|
|
|
|
message QueryParamsResponse {
|
2024-03-07 11:25:15 +00:00
|
|
|
Params params = 1
|
|
|
|
[ (gogoproto.moretags) = "json:\"params\" yaml:\"params\"" ];
|
2024-02-02 09:39:10 +00:00
|
|
|
}
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
// QueryBondsRequest queries bonds
|
|
|
|
message QueryBondsRequest {
|
2024-02-02 09:39:10 +00:00
|
|
|
// pagination defines an optional pagination for the request.
|
|
|
|
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
|
|
|
}
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
// QueryBondsResponse is response type for get the bonds by bond-id
|
|
|
|
message QueryBondsResponse {
|
|
|
|
repeated Bond bonds = 1
|
|
|
|
[ (gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\"" ];
|
2024-02-02 09:39:10 +00:00
|
|
|
|
|
|
|
// pagination defines the pagination in the response.
|
|
|
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
|
|
|
}
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
// QueryGetBondById queries bond by bond id
|
2024-02-08 13:23:20 +00:00
|
|
|
message QueryGetBondByIdRequest {
|
2024-03-07 11:25:15 +00:00
|
|
|
string id = 1 [ (gogoproto.moretags) = "json:\"id\" yaml:\"id\"" ];
|
2024-02-08 13:23:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// QueryGetBondByIdResponse returns QueryGetBondById query response
|
|
|
|
message QueryGetBondByIdResponse {
|
2024-03-07 11:25:15 +00:00
|
|
|
Bond bond = 1 [ (gogoproto.moretags) = "json:\"bond\" yaml:\"bond\"" ];
|
2024-02-08 13:23:20 +00:00
|
|
|
}
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
// QueryGetBondsByOwnerRequest is request type for Query/GetBondsByOwner RPC
|
|
|
|
// Method
|
2024-02-08 13:23:20 +00:00
|
|
|
message QueryGetBondsByOwnerRequest {
|
|
|
|
string owner = 1;
|
|
|
|
// pagination defines the pagination in the response.
|
|
|
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
|
|
|
}
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
// QueryGetBondsByOwnerResponse is response type for Query/GetBondsByOwner RPC
|
|
|
|
// Method
|
2024-02-08 13:23:20 +00:00
|
|
|
message QueryGetBondsByOwnerResponse {
|
2024-02-12 08:34:40 +00:00
|
|
|
repeated Bond bonds = 1 [
|
|
|
|
(gogoproto.nullable) = false,
|
|
|
|
(gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\""
|
|
|
|
];
|
2024-02-08 13:23:20 +00:00
|
|
|
|
|
|
|
// pagination defines the pagination in the response.
|
|
|
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
|
|
|
}
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
// QueryGetBondModuleBalanceRequest is request type for bond module balance rpc
|
|
|
|
// method
|
2024-02-08 13:23:20 +00:00
|
|
|
message QueryGetBondModuleBalanceRequest {}
|
|
|
|
|
2024-03-07 11:25:15 +00:00
|
|
|
// QueryGetBondModuleBalanceResponse is the response type for bond module
|
|
|
|
// balance rpc method
|
2024-02-08 13:23:20 +00:00
|
|
|
message QueryGetBondModuleBalanceResponse {
|
2024-02-09 08:44:45 +00:00
|
|
|
repeated cosmos.base.v1beta1.Coin balance = 1 [
|
2024-03-07 11:25:15 +00:00
|
|
|
(gogoproto.nullable) = false,
|
2024-02-08 13:23:20 +00:00
|
|
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
|
2024-03-07 11:25:15 +00:00
|
|
|
(gogoproto.moretags) = "json:\"coins\" yaml:\"coins\""
|
2024-02-08 13:23:20 +00:00
|
|
|
];
|
|
|
|
}
|