forked from realiotech/realio-network
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
7,501 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
syntax = "proto3"; | ||
package realionetwork.bridge.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/protobuf/duration.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "realionetwork/bridge/v1/params.proto"; | ||
import "realionetwork/bridge/v1/ratelimit.proto"; | ||
|
||
option go_package = "github.com/realiotech/realio-network/x/bridge/types"; | ||
|
||
// GenesisState defines the bridge module's genesis state. | ||
message GenesisState { | ||
Params params = 1 [ (gogoproto.nullable) = false ]; | ||
// registered denoms and its rate limit | ||
repeated cosmos.base.v1beta1.Coin registered_coins = 2 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" | ||
]; | ||
|
||
// rate limit epoch info | ||
EpochInfo ratelimit_epoch_info = 3 [ (gogoproto.nullable) = false ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
syntax = "proto3"; | ||
package realionetwork.bridge.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/realiotech/realio-network/x/bridge/types"; | ||
|
||
// Params defines the parameters for the module. | ||
message Params { | ||
option (gogoproto.goproto_stringer) = false; | ||
string authority = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
syntax = "proto3"; | ||
package realionetwork.bridge.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/api/annotations.proto"; | ||
import "realionetwork/bridge/v1/params.proto"; | ||
import "realionetwork/bridge/v1/ratelimit.proto"; | ||
|
||
option go_package = "github.com/realiotech/realio-network/x/bridge/types"; | ||
|
||
// Query defines the gRPC querier service. | ||
service Query { | ||
// Parameters queries the parameters of the module. | ||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { | ||
option (google.api.http).get = "/realionetwork/bridge/v1/params"; | ||
} | ||
|
||
// Parameters queries the ratelimits of the module. | ||
rpc RateLimits(QueryRateLimitsRequest) returns (QueryRateLimitsResponse) { | ||
option (google.api.http).get = "/realionetwork/bridge/v1/ratelimits"; | ||
} | ||
|
||
// Parameters queries the ratelimit of a specific denom of the module. | ||
rpc RateLimit(QueryRateLimitRequest) returns (QueryRateLimitResponse) { | ||
option (google.api.http).get = | ||
"/realionetwork/bridge/v1/ratelimits/{denom}"; | ||
} | ||
|
||
// Parameters queries the epoch info of the module. | ||
rpc EpochInfo(QueryEpochInfoRequest) returns (QueryEpochInfoResponse) { | ||
option (google.api.http).get = "/realionetwork/bridge/v1/epoch_info"; | ||
} | ||
} | ||
|
||
// QueryParamsRequest is request type for the Query/Params RPC method. | ||
message QueryParamsRequest {} | ||
|
||
// QueryParamsResponse is response type for the Query/Params RPC method. | ||
message QueryParamsResponse { | ||
// params holds all the parameters of this module. | ||
Params params = 1 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
// QueryRateLimitsRequest is request type for the Query/RateLimits RPC method. | ||
message QueryRateLimitsRequest {} | ||
|
||
// QueryRateLimitsResponse is response type for the Query/RateLimits RPC method. | ||
message QueryRateLimitsResponse { | ||
repeated RateLimit ratelimits = 1 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
// QueryRateLimitRequest is request type for the Query/RateLimit RPC method. | ||
message QueryRateLimitRequest { | ||
// denom of the coin to query for. | ||
string denom = 1; | ||
} | ||
|
||
// QueryRateLimitResponse is response type for the Query/RateLimit RPC method. | ||
message QueryRateLimitResponse { | ||
RateLimit ratelimit = 1 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
// QueryEpochInfoRequest is request type for the Query/EpochInfo RPC method. | ||
message QueryEpochInfoRequest {} | ||
|
||
// QueryEpochInfoResponse is response type for the Query/EpochInfo RPC method. | ||
message QueryEpochInfoResponse { | ||
EpochInfo epoch_info = 1 [ (gogoproto.nullable) = false ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
syntax = "proto3"; | ||
package realionetwork.bridge.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/protobuf/duration.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "realionetwork/bridge/v1/params.proto"; | ||
|
||
option go_package = "github.com/realiotech/realio-network/x/bridge/types"; | ||
|
||
// EpochInfo defines the rate limit epoch info | ||
message EpochInfo { | ||
// start_time is the time at which the timer first ever ticks. | ||
// If start_time is in the future, the epoch will not begin until the start | ||
// time. | ||
google.protobuf.Timestamp start_time = 1 | ||
[ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; | ||
|
||
// duration is the time in between epoch ticks. | ||
// In order for intended behavior to be met, duration should | ||
// be greater than the chains expected block time. | ||
// Duration must be non-zero. | ||
google.protobuf.Duration duration = 2 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.stdduration) = true, | ||
(gogoproto.jsontag) = "duration,omitempty" | ||
]; | ||
google.protobuf.Timestamp current_epoch_start_time = 3 | ||
[ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; | ||
// epoch_counting_started is a boolean, that indicates whether this | ||
// epoch timer has began yet. | ||
bool epoch_counting_started = 4; | ||
int64 current_epoch_start_height = 5; | ||
} | ||
|
||
message RateLimit { | ||
string ratelimit = 1 [ | ||
(gogoproto.customtype) = "cosmossdk.io/math.Int", | ||
(gogoproto.nullable) = false | ||
]; | ||
|
||
string current_inflow = 2 [ | ||
(gogoproto.customtype) = "cosmossdk.io/math.Int", | ||
(gogoproto.nullable) = false | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
syntax = "proto3"; | ||
package realionetwork.bridge.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/protobuf/duration.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "realionetwork/bridge/v1/params.proto"; | ||
|
||
option go_package = "github.com/realiotech/realio-network/x/bridge/types"; | ||
|
||
// Msg defines the Msg service. | ||
service Msg { | ||
rpc BridgeIn(MsgBridgeIn) returns (MsgBridgeInResponse); | ||
rpc BridgeOut(MsgBridgeOut) returns (MsgBridgeOutResponse); | ||
rpc RegisterNewCoins(MsgRegisterNewCoins) returns (MsgRegisterNewCoinsResponse); | ||
rpc DeregisterCoins(MsgDeregisterCoins) returns (MsgDeregisterCoinsResponse); | ||
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); | ||
rpc UpdateEpochDuration(MsgUpdateEpochDuration) | ||
returns (MsgUpdateEpochDurationResponse); | ||
} | ||
|
||
message MsgBridgeIn { | ||
string authority = 1; | ||
cosmos.base.v1beta1.Coin coin = 2 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" | ||
]; | ||
} | ||
|
||
message MsgBridgeInResponse {} | ||
|
||
message MsgBridgeOut { | ||
string signer = 1; | ||
cosmos.base.v1beta1.Coin coin = 2 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" | ||
]; | ||
} | ||
|
||
message MsgBridgeOutResponse {} | ||
|
||
message MsgRegisterNewCoins { | ||
string authority = 1; | ||
repeated cosmos.base.v1beta1.Coin coins = 2 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" | ||
]; | ||
} | ||
|
||
message MsgRegisterNewCoinsResponse {} | ||
|
||
message MsgDeregisterCoins { | ||
string authority = 1; | ||
repeated string denoms = 2; | ||
} | ||
|
||
message MsgDeregisterCoinsResponse {} | ||
|
||
message MsgUpdateParams { | ||
// authority is the address that controls the module (defaults to x/gov unless | ||
// overwritten). | ||
string authority = 1; | ||
|
||
// params defines the x/mint parameters to update. | ||
// | ||
// NOTE: All parameters must be supplied. | ||
Params params = 2 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
message MsgUpdateParamsResponse {} | ||
|
||
message MsgUpdateEpochDuration { | ||
// authority is the address that controls the module (defaults to x/gov unless | ||
// overwritten). | ||
string authority = 1; | ||
|
||
google.protobuf.Duration duration = 2 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.stdduration) = true, | ||
(gogoproto.jsontag) = "duration,omitempty" | ||
]; | ||
} | ||
|
||
message MsgUpdateEpochDurationResponse {} |
Oops, something went wrong.