diff --git a/CHANGELOG.md b/CHANGELOG.md index 96df25927..00ea45f92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,7 +60,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Improvements -* [#1610](https://github.com/NibiruChain/nibiru/pull/1610) - refactor(app): Simplify app.go with less redundant imports using struct embedding. +* [#1610](https://github.com/NibiruChain/nibiru/pull/1610) - refactor(app): + Simplify app.go with less redundant imports using struct embedding. +* [#1614](https://github.com/NibiruChain/nibiru/pull/1614) - refactor(proto): Use + explicit namespacing on proto imports for #1608 ### Dependencies - Bump `github.com/prometheus/client_golang` from 1.16.0 to 1.17.0 ([#1605](https://github.com/NibiruChain/nibiru/pull/1605)) diff --git a/proto/nibiru/devgas/v1/genesis.proto b/proto/nibiru/devgas/v1/genesis.proto index 7b5dc1983..ed28cb9bd 100644 --- a/proto/nibiru/devgas/v1/genesis.proto +++ b/proto/nibiru/devgas/v1/genesis.proto @@ -8,9 +8,10 @@ option go_package = "github.com/NibiruChain/nibiru/x/devgas/v1/types"; // GenesisState defines the module's genesis state. message GenesisState { // params are the feeshare module parameters - ModuleParams params = 1 [ (gogoproto.nullable) = false ]; + nibiru.devgas.v1.ModuleParams params = 1 [ (gogoproto.nullable) = false ]; // FeeShare is a slice of active registered contracts for fee distribution - repeated FeeShare fee_share = 2 [ (gogoproto.nullable) = false ]; + repeated nibiru.devgas.v1.FeeShare fee_share = 2 + [ (gogoproto.nullable) = false ]; } // ModuleParams defines the params for the devgas module diff --git a/proto/nibiru/devgas/v1/query.proto b/proto/nibiru/devgas/v1/query.proto index 6e995bd14..a7bd65f96 100644 --- a/proto/nibiru/devgas/v1/query.proto +++ b/proto/nibiru/devgas/v1/query.proto @@ -58,7 +58,8 @@ message QueryFeeSharesRequest { // method. message QueryFeeSharesResponse { // FeeShare is the slice of all stored Reveneue for the deployer - repeated FeeShare feeshare = 1 [ (gogoproto.nullable) = false ]; + repeated nibiru.devgas.v1.FeeShare feeshare = 1 + [ (gogoproto.nullable) = false ]; } // QueryFeeShareRequest is the request type for the Query/FeeShare RPC method. @@ -70,7 +71,7 @@ message QueryFeeShareRequest { // QueryFeeShareResponse is the response type for the Query/FeeShare RPC method. message QueryFeeShareResponse { // FeeShare is a stored Reveneue for the queried contract - FeeShare feeshare = 1 [ (gogoproto.nullable) = false ]; + nibiru.devgas.v1.FeeShare feeshare = 1 [ (gogoproto.nullable) = false ]; } // QueryParamsRequest is the request type for the Query/Params RPC method. @@ -79,7 +80,7 @@ message QueryParamsRequest {} // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { // params is the returned FeeShare parameter - ModuleParams params = 1 [ (gogoproto.nullable) = false ]; + nibiru.devgas.v1.ModuleParams params = 1 [ (gogoproto.nullable) = false ]; } // QueryFeeSharesByWithdrawerRequest is the request type for the @@ -92,5 +93,6 @@ message QueryFeeSharesByWithdrawerRequest { // QueryFeeSharesByWithdrawerResponse is the response type for the // Query/FeeSharesByWithdrawer RPC method. message QueryFeeSharesByWithdrawerResponse { - repeated FeeShare feeshare = 1 [ (gogoproto.nullable) = false ]; + repeated nibiru.devgas.v1.FeeShare feeshare = 1 + [ (gogoproto.nullable) = false ]; } diff --git a/proto/nibiru/epochs/v1/genesis.proto b/proto/nibiru/epochs/v1/genesis.proto index c431ba555..0ce843e10 100644 --- a/proto/nibiru/epochs/v1/genesis.proto +++ b/proto/nibiru/epochs/v1/genesis.proto @@ -10,5 +10,6 @@ option go_package = "github.com/NibiruChain/nibiru/x/epochs/types"; // GenesisState defines the epochs module's genesis state. message GenesisState { - repeated EpochInfo epochs = 1 [ (gogoproto.nullable) = false ]; + repeated nibiru.epochs.v1.EpochInfo epochs = 1 + [ (gogoproto.nullable) = false ]; } diff --git a/proto/nibiru/epochs/v1/query.proto b/proto/nibiru/epochs/v1/query.proto index ab739f369..b25b4df0f 100644 --- a/proto/nibiru/epochs/v1/query.proto +++ b/proto/nibiru/epochs/v1/query.proto @@ -23,8 +23,9 @@ service Query { message QueryEpochsInfoRequest {} message QueryEpochsInfoResponse { - repeated EpochInfo epochs = 1 [ (gogoproto.nullable) = false ]; + repeated nibiru.epochs.v1.EpochInfo epochs = 1 + [ (gogoproto.nullable) = false ]; } message QueryCurrentEpochRequest { string identifier = 1; } -message QueryCurrentEpochResponse { uint64 current_epoch = 1; } \ No newline at end of file +message QueryCurrentEpochResponse { uint64 current_epoch = 1; } diff --git a/proto/nibiru/inflation/v1/query.proto b/proto/nibiru/inflation/v1/query.proto index 726183bb0..e7b6ec57a 100644 --- a/proto/nibiru/inflation/v1/query.proto +++ b/proto/nibiru/inflation/v1/query.proto @@ -115,5 +115,5 @@ message QueryParamsRequest {} // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { // params defines the parameters of the module. - Params params = 1 [ (gogoproto.nullable) = false ]; + nibiru.inflation.v1.Params params = 1 [ (gogoproto.nullable) = false ]; } diff --git a/proto/nibiru/oracle/v1/event.proto b/proto/nibiru/oracle/v1/event.proto index 73acb862f..f9dda8853 100644 --- a/proto/nibiru/oracle/v1/event.proto +++ b/proto/nibiru/oracle/v1/event.proto @@ -23,7 +23,7 @@ message EventDelegateFeederConsent { // Validator is the Bech32 address that is delegating voting rights. string validator = 1; - // Feeder is the delegate or representative that will be able to send + // Feeder is the delegate or representative that will be able to send // vote and prevote transaction messages. string feeder = 2; } @@ -33,23 +33,23 @@ message EventAggregateVote { // Validator is the Bech32 address to which the vote will be credited. string validator = 1; - // Feeder is the delegate or representative that will send vote and prevote + // Feeder is the delegate or representative that will send vote and prevote // transaction messages on behalf of the voting validator. string feeder = 2; - repeated ExchangeRateTuple prices = 3 [ + repeated nibiru.oracle.v1.ExchangeRateTuple prices = 3 [ (gogoproto.castrepeated) = "ExchangeRateTuples", (gogoproto.nullable) = false ]; } -// Emitted by MsgAggregateExchangePrevote when an aggregate prevote is added +// Emitted by MsgAggregateExchangePrevote when an aggregate prevote is added // to state message EventAggregatePrevote { // Validator is the Bech32 address to which the vote will be credited. string validator = 1; - // Feeder is the delegate or representative that will send vote and prevote + // Feeder is the delegate or representative that will send vote and prevote // transaction messages on behalf of the voting validator. string feeder = 2; } diff --git a/proto/nibiru/oracle/v1/genesis.proto b/proto/nibiru/oracle/v1/genesis.proto index 9643ab331..1ff78bbfb 100644 --- a/proto/nibiru/oracle/v1/genesis.proto +++ b/proto/nibiru/oracle/v1/genesis.proto @@ -9,24 +9,26 @@ option go_package = "github.com/NibiruChain/nibiru/x/oracle/types"; // GenesisState defines the oracle module's genesis state. message GenesisState { - Params params = 1 [ (gogoproto.nullable) = false ]; - repeated FeederDelegation feeder_delegations = 2 + nibiru.oracle.v1.Params params = 1 [ (gogoproto.nullable) = false ]; + repeated nibiru.oracle.v1.FeederDelegation feeder_delegations = 2 [ (gogoproto.nullable) = false ]; - repeated ExchangeRateTuple exchange_rates = 3 [ + repeated nibiru.oracle.v1.ExchangeRateTuple exchange_rates = 3 [ (gogoproto.castrepeated) = "ExchangeRateTuples", (gogoproto.nullable) = false ]; - repeated MissCounter miss_counters = 4 [ (gogoproto.nullable) = false ]; - repeated AggregateExchangeRatePrevote aggregate_exchange_rate_prevotes = 5 - [ (gogoproto.nullable) = false ]; - repeated AggregateExchangeRateVote aggregate_exchange_rate_votes = 6 + repeated nibiru.oracle.v1.MissCounter miss_counters = 4 [ (gogoproto.nullable) = false ]; + repeated nibiru.oracle.v1.AggregateExchangeRatePrevote + aggregate_exchange_rate_prevotes = 5 [ (gogoproto.nullable) = false ]; + repeated nibiru.oracle.v1.AggregateExchangeRateVote + aggregate_exchange_rate_votes = 6 [ (gogoproto.nullable) = false ]; repeated string pairs = 7 [ (gogoproto.customtype) = "github.com/NibiruChain/nibiru/x/common/asset.Pair", (gogoproto.nullable) = false ]; - repeated Rewards rewards = 8 [ (gogoproto.nullable) = false ]; + repeated nibiru.oracle.v1.Rewards rewards = 8 + [ (gogoproto.nullable) = false ]; } // FeederDelegation is the address for where oracle feeder authority are diff --git a/proto/nibiru/oracle/v1/query.proto b/proto/nibiru/oracle/v1/query.proto index 53b4cf5f7..993640b40 100644 --- a/proto/nibiru/oracle/v1/query.proto +++ b/proto/nibiru/oracle/v1/query.proto @@ -119,7 +119,7 @@ message QueryExchangeRatesRequest {} message QueryExchangeRatesResponse { // exchange_rates defines a list of the exchange rate for all whitelisted // pairs. - repeated ExchangeRateTuple exchange_rates = 1 [ + repeated nibiru.oracle.v1.ExchangeRateTuple exchange_rates = 1 [ (gogoproto.castrepeated) = "ExchangeRateTuples", (gogoproto.nullable) = false ]; @@ -204,7 +204,7 @@ message QueryAggregatePrevoteRequest { message QueryAggregatePrevoteResponse { // aggregate_prevote defines oracle aggregate prevote submitted by a validator // in the current vote period - AggregateExchangeRatePrevote aggregate_prevote = 1 + nibiru.oracle.v1.AggregateExchangeRatePrevote aggregate_prevote = 1 [ (gogoproto.nullable) = false ]; ; } @@ -218,7 +218,7 @@ message QueryAggregatePrevotesRequest {} message QueryAggregatePrevotesResponse { // aggregate_prevotes defines all oracle aggregate prevotes submitted in the // current vote period - repeated AggregateExchangeRatePrevote aggregate_prevotes = 1 + repeated nibiru.oracle.v1.AggregateExchangeRatePrevote aggregate_prevotes = 1 [ (gogoproto.nullable) = false ]; } @@ -237,7 +237,8 @@ message QueryAggregateVoteRequest { message QueryAggregateVoteResponse { // aggregate_vote defines oracle aggregate vote submitted by a validator in // the current vote period - AggregateExchangeRateVote aggregate_vote = 1 [ (gogoproto.nullable) = false ]; + nibiru.oracle.v1.AggregateExchangeRateVote aggregate_vote = 1 + [ (gogoproto.nullable) = false ]; } // QueryAggregateVotesRequest is the request type for the Query/AggregateVotes @@ -249,7 +250,7 @@ message QueryAggregateVotesRequest {} message QueryAggregateVotesResponse { // aggregate_votes defines all oracle aggregate votes submitted in the current // vote period - repeated AggregateExchangeRateVote aggregate_votes = 1 + repeated nibiru.oracle.v1.AggregateExchangeRateVote aggregate_votes = 1 [ (gogoproto.nullable) = false ]; } @@ -259,5 +260,5 @@ message QueryParamsRequest {} // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { // params defines the parameters of the module. - Params params = 1 [ (gogoproto.nullable) = false ]; -} \ No newline at end of file + nibiru.oracle.v1.Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/proto/nibiru/oracle/v1/tx.proto b/proto/nibiru/oracle/v1/tx.proto index 7a2135f82..19fd2f833 100644 --- a/proto/nibiru/oracle/v1/tx.proto +++ b/proto/nibiru/oracle/v1/tx.proto @@ -83,4 +83,4 @@ message MsgDelegateFeedConsent { // MsgDelegateFeedConsentResponse defines the Msg/DelegateFeedConsent response // type. -message MsgDelegateFeedConsentResponse {} \ No newline at end of file +message MsgDelegateFeedConsentResponse {} diff --git a/proto/nibiru/perp/v2/event.proto b/proto/nibiru/perp/v2/event.proto index e26e46c70..f8a6b7a04 100644 --- a/proto/nibiru/perp/v2/event.proto +++ b/proto/nibiru/perp/v2/event.proto @@ -12,7 +12,7 @@ option go_package = "github.com/NibiruChain/nibiru/x/perp/v2/types"; // Emitted when a position changes. message PositionChangedEvent { - Position final_position = 1 [ (gogoproto.nullable) = false ]; + nibiru.perp.v2.Position final_position = 1 [ (gogoproto.nullable) = false ]; // Position notional (in quote units) after the change. In general, // 'notional = baseAmount * priceQuotePerBase', where size is the baseAmount. @@ -92,7 +92,7 @@ message PositionChangedEvent { // Emitted when a position is liquidated. Wraps a PositionChanged event since a // liquidation causes position changes. message PositionLiquidatedEvent { - PositionChangedEvent position_changed_event = 1 + nibiru.perp.v2.PositionChangedEvent position_changed_event = 1 [ (gogoproto.nullable) = false ]; // Address of the account that executed the tx. @@ -207,7 +207,7 @@ message LiquidationFailedEvent { // - edit depth message AmmUpdatedEvent { // the final state of the AMM - AMM final_amm = 1 [ (gogoproto.nullable) = false ]; + nibiru.perp.v2.AMM final_amm = 1 [ (gogoproto.nullable) = false ]; // The mark price of the pair. string mark_price_twap = 2 [ @@ -232,5 +232,5 @@ message AmmUpdatedEvent { // - bad debt is prepaid by the ecosystem fund message MarketUpdatedEvent { // the final state of the market - Market final_market = 1 [ (gogoproto.nullable) = false ]; -} \ No newline at end of file + nibiru.perp.v2.Market final_market = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/proto/nibiru/perp/v2/genesis.proto b/proto/nibiru/perp/v2/genesis.proto index 136235de8..37634dcf5 100644 --- a/proto/nibiru/perp/v2/genesis.proto +++ b/proto/nibiru/perp/v2/genesis.proto @@ -13,19 +13,18 @@ option go_package = "github.com/NibiruChain/nibiru/x/perp/v2/types"; // Thge genesis state is used not only to start the network but also useful for // exporting and importing state during network upgrades. message GenesisState { - repeated Market markets = 2 [ (gogoproto.nullable) = false ]; + repeated nibiru.perp.v2.Market markets = 2 [ (gogoproto.nullable) = false ]; - repeated AMM amms = 3 [ (gogoproto.nullable) = false ]; + repeated nibiru.perp.v2.AMM amms = 3 [ (gogoproto.nullable) = false ]; - repeated Position positions = 4 [ (gogoproto.nullable) = false ]; + repeated nibiru.perp.v2.Position positions = 4 + [ (gogoproto.nullable) = false ]; - repeated ReserveSnapshot reserve_snapshots = 5 + repeated nibiru.perp.v2.ReserveSnapshot reserve_snapshots = 5 [ (gogoproto.nullable) = false ]; uint64 dnr_epoch = 6; - repeated TraderVolume trader_volumes = 7 [ (gogoproto.nullable) = false ]; - message TraderVolume { string trader = 1; uint64 epoch = 2; @@ -35,6 +34,8 @@ message GenesisState { ]; } + repeated TraderVolume trader_volumes = 7 [ (gogoproto.nullable) = false ]; + message Discount { string fee = 1 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", @@ -55,7 +56,7 @@ message GenesisState { Discount discount = 2; } - repeated GenesisMarketLastVersion market_last_versions = 10 + repeated nibiru.perp.v2.GenesisMarketLastVersion market_last_versions = 10 [ (gogoproto.nullable) = false ]; } diff --git a/proto/nibiru/perp/v2/query.proto b/proto/nibiru/perp/v2/query.proto index e15cb30df..bb69dacdb 100644 --- a/proto/nibiru/perp/v2/query.proto +++ b/proto/nibiru/perp/v2/query.proto @@ -42,7 +42,8 @@ service Query { message QueryPositionsRequest { string trader = 1; } message QueryPositionsResponse { - repeated QueryPositionResponse positions = 1 [ (gogoproto.nullable) = false ]; + repeated nibiru.perp.v2.QueryPositionResponse positions = 1 + [ (gogoproto.nullable) = false ]; } message QueryPositionStoreRequest { @@ -52,7 +53,8 @@ message QueryPositionStoreRequest { message QueryPositionStoreResponse { // Position responses: collection of all stored positions (with pagination) - repeated Position positions = 1 [ (gogoproto.nullable) = false ]; + repeated nibiru.perp.v2.Position positions = 1 + [ (gogoproto.nullable) = false ]; // pagination defines a paginated response cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -74,7 +76,7 @@ message QueryPositionRequest { message QueryPositionResponse { // The position as it exists in the blockchain state - Position position = 1 [ (gogoproto.nullable) = false ]; + nibiru.perp.v2.Position position = 1 [ (gogoproto.nullable) = false ]; // The position's current notional value, if it were to be entirely closed (in // margin units). @@ -101,7 +103,8 @@ message QueryPositionResponse { message QueryModuleAccountsRequest {} message QueryModuleAccountsResponse { - repeated AccountWithBalance accounts = 1 [ (gogoproto.nullable) = false ]; + repeated nibiru.perp.v2.AccountWithBalance accounts = 1 + [ (gogoproto.nullable) = false ]; } message AccountWithBalance { @@ -115,14 +118,13 @@ message AccountWithBalance { } message AmmMarket { - Market market = 1 [ (gogoproto.nullable) = false ]; - AMM amm = 2 [ (gogoproto.nullable) = false ]; + nibiru.perp.v2.Market market = 1 [ (gogoproto.nullable) = false ]; + nibiru.perp.v2.AMM amm = 2 [ (gogoproto.nullable) = false ]; } -message QueryMarketsRequest { - bool versioned = 1; -} +message QueryMarketsRequest { bool versioned = 1; } message QueryMarketsResponse { - repeated AmmMarket amm_markets = 1 [ (gogoproto.nullable) = false ]; + repeated nibiru.perp.v2.AmmMarket amm_markets = 1 + [ (gogoproto.nullable) = false ]; } diff --git a/proto/nibiru/perp/v2/tx.proto b/proto/nibiru/perp/v2/tx.proto index 23656b499..29bf3a6a2 100644 --- a/proto/nibiru/perp/v2/tx.proto +++ b/proto/nibiru/perp/v2/tx.proto @@ -54,7 +54,7 @@ message MsgRemoveMarginResponse { ]; // The resulting position - Position position = 3; + nibiru.perp.v2.Position position = 3; } // -------------------------- AddMargin -------------------------- @@ -78,7 +78,7 @@ message MsgAddMarginResponse { (gogoproto.nullable) = false ]; - Position position = 2; + nibiru.perp.v2.Position position = 2; } // -------------------------- Liquidation -------------------------- @@ -132,7 +132,7 @@ message MsgMarketOrder { (gogoproto.nullable) = false ]; - Direction side = 3; + nibiru.perp.v2.Direction side = 3; string quote_asset_amount = 4 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", @@ -151,7 +151,7 @@ message MsgMarketOrder { } message MsgMarketOrderResponse { - Position position = 1; + nibiru.perp.v2.Position position = 1; // The amount of quote assets exchanged. string exchanged_notional_value = 2 [ diff --git a/proto/nibiru/spot/v1/event.proto b/proto/nibiru/spot/v1/event.proto index b3b3ee865..3e4788d9a 100644 --- a/proto/nibiru/spot/v1/event.proto +++ b/proto/nibiru/spot/v1/event.proto @@ -16,7 +16,7 @@ message EventPoolCreated { repeated cosmos.base.v1beta1.Coin fees = 2 [ (gogoproto.nullable) = false ]; // the final state of the pool - Pool final_pool = 4 [ (gogoproto.nullable) = false ]; + nibiru.spot.v1.Pool final_pool = 4 [ (gogoproto.nullable) = false ]; // the amount of pool shares that the user received cosmos.base.v1beta1.Coin final_user_pool_shares = 5 @@ -39,7 +39,7 @@ message EventPoolJoined { [ (gogoproto.nullable) = false ]; // the final state of the pool - Pool final_pool = 5 [ (gogoproto.nullable) = false ]; + nibiru.spot.v1.Pool final_pool = 5 [ (gogoproto.nullable) = false ]; // the final amount of user pool shares cosmos.base.v1beta1.Coin final_user_pool_shares = 6 @@ -61,7 +61,7 @@ message EventPoolExited { repeated cosmos.base.v1beta1.Coin fees = 4 [ (gogoproto.nullable) = false ]; // the final state of the pool - Pool final_pool = 5 [ (gogoproto.nullable) = false ]; + nibiru.spot.v1.Pool final_pool = 5 [ (gogoproto.nullable) = false ]; // the final amount of user pool shares cosmos.base.v1beta1.Coin final_user_pool_shares = 6 @@ -82,5 +82,5 @@ message EventAssetsSwapped { cosmos.base.v1beta1.Coin fee = 4 [ (gogoproto.nullable) = false ]; // the final state of the pool - Pool final_pool = 5 [ (gogoproto.nullable) = false ]; -} \ No newline at end of file + nibiru.spot.v1.Pool final_pool = 5 [ (gogoproto.nullable) = false ]; +} diff --git a/proto/nibiru/spot/v1/genesis.proto b/proto/nibiru/spot/v1/genesis.proto index 5cbee0393..0d2e222ee 100644 --- a/proto/nibiru/spot/v1/genesis.proto +++ b/proto/nibiru/spot/v1/genesis.proto @@ -11,8 +11,8 @@ option go_package = "github.com/NibiruChain/nibiru/x/spot/types"; // GenesisState defines the spot module's genesis state. message GenesisState { // params defines all the parameters of the module. - Params params = 1 [ (gogoproto.nullable) = false ]; + nibiru.spot.v1.Params params = 1 [ (gogoproto.nullable) = false ]; // pools defines all the pools of the module. - repeated Pool pools = 2 [ (gogoproto.nullable) = false ]; + repeated nibiru.spot.v1.Pool pools = 2 [ (gogoproto.nullable) = false ]; } diff --git a/proto/nibiru/spot/v1/pool.proto b/proto/nibiru/spot/v1/pool.proto index 5e113617f..d0e67f52d 100644 --- a/proto/nibiru/spot/v1/pool.proto +++ b/proto/nibiru/spot/v1/pool.proto @@ -33,7 +33,8 @@ message PoolParams { (gogoproto.nullable) = false ]; - PoolType pool_type = 4 [ (gogoproto.moretags) = "yaml:\"pool_type\"" ]; + nibiru.spot.v1.PoolType pool_type = 4 + [ (gogoproto.moretags) = "yaml:\"pool_type\"" ]; } // - `balancer`: Balancer are pools defined by the equation xy=k, extended by @@ -69,7 +70,7 @@ message Pool { string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; // Fees and other pool-specific parameters. - PoolParams pool_params = 3 [ + nibiru.spot.v1.PoolParams pool_params = 3 [ (gogoproto.moretags) = "yaml:\"pool_params\"", (gogoproto.nullable) = false ]; diff --git a/proto/nibiru/spot/v1/query.proto b/proto/nibiru/spot/v1/query.proto index a1ef0e143..0bc6ad052 100644 --- a/proto/nibiru/spot/v1/query.proto +++ b/proto/nibiru/spot/v1/query.proto @@ -120,28 +120,28 @@ 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 ]; + nibiru.spot.v1.Params params = 1 [ (gogoproto.nullable) = false ]; } message QueryPoolNumberRequest {} message QueryPoolNumberResponse { uint64 pool_id = 1; } message QueryPoolRequest { uint64 pool_id = 1; } -message QueryPoolResponse { Pool pool = 1; } +message QueryPoolResponse { nibiru.spot.v1.Pool pool = 1; } message QueryPoolsRequest { // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 1; } message QueryPoolsResponse { - repeated Pool pools = 1; + repeated nibiru.spot.v1.Pool pools = 1; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } message QueryPoolParamsRequest { uint64 pool_id = 1; } -message QueryPoolParamsResponse { PoolParams pool_params = 1; } +message QueryPoolParamsResponse { nibiru.spot.v1.PoolParams pool_params = 1; } message QueryNumPoolsRequest {} message QueryNumPoolsResponse { uint64 num_pools = 1; } diff --git a/proto/nibiru/spot/v1/tx.proto b/proto/nibiru/spot/v1/tx.proto index 3e924f886..8e9a3fc1c 100644 --- a/proto/nibiru/spot/v1/tx.proto +++ b/proto/nibiru/spot/v1/tx.proto @@ -35,9 +35,11 @@ service Msg { message MsgCreatePool { string creator = 1; - PoolParams pool_params = 2 [ (gogoproto.moretags) = "yaml:\"pool_params\"" ]; + nibiru.spot.v1.PoolParams pool_params = 2 + [ (gogoproto.moretags) = "yaml:\"pool_params\"" ]; - repeated PoolAsset pool_assets = 3 [ (gogoproto.nullable) = false ]; + repeated nibiru.spot.v1.PoolAsset pool_assets = 3 + [ (gogoproto.nullable) = false ]; } message MsgCreatePoolResponse { uint64 pool_id = 1; } @@ -63,7 +65,7 @@ Response when a user joins a pool. */ message MsgJoinPoolResponse { // the final state of the pool after a join - Pool pool = 1; + nibiru.spot.v1.Pool pool = 1; // sum of LP tokens minted from the join cosmos.base.v1beta1.Coin num_pool_shares_out = 2 [ diff --git a/proto/nibiru/stablecoin/v1/events.proto b/proto/nibiru/stablecoin/v1/events.proto deleted file mode 100644 index d8d67c526..000000000 --- a/proto/nibiru/stablecoin/v1/events.proto +++ /dev/null @@ -1,62 +0,0 @@ -syntax = "proto3"; - -package nibiru.stablecoin.v1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/NibiruChain/nibiru/x/stablecoin/types"; - -message EventTransfer { - cosmos.base.v1beta1.Coin coin = 1 [ (gogoproto.nullable) = false ]; - string from = 2; - string to = 3; -} - -message EventMintStable { - string amount = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; -} - -message EventBurnStable { - string amount = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; -} - -message EventMintNIBI { - string amount = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; -} - -message EventBurnNIBI { - string amount = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; -} - -message EventRecollateralize { - string caller = 1; - cosmos.base.v1beta1.Coin in_coin = 2 [ (gogoproto.nullable) = false ]; - cosmos.base.v1beta1.Coin out_coin = 3 [ (gogoproto.nullable) = false ]; - string coll_ratio = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} - -message EventBuyback { - string caller = 1; - cosmos.base.v1beta1.Coin in_coin = 2 [ (gogoproto.nullable) = false ]; - cosmos.base.v1beta1.Coin out_coin = 3 [ (gogoproto.nullable) = false ]; - string coll_ratio = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} \ No newline at end of file diff --git a/proto/nibiru/stablecoin/v1/genesis.proto b/proto/nibiru/stablecoin/v1/genesis.proto deleted file mode 100644 index c19181fc5..000000000 --- a/proto/nibiru/stablecoin/v1/genesis.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package nibiru.stablecoin.v1; - -import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; -import "nibiru/stablecoin/v1/params.proto"; - -option go_package = "github.com/NibiruChain/nibiru/x/stablecoin/types"; - -// GenesisState defines the stablecoin module's genesis state. -message GenesisState { - Params params = 1 [ (gogoproto.nullable) = false ]; - cosmos.base.v1beta1.Coin module_account_balance = 2 [ - (gogoproto.moretags) = "yaml:\"module_account_balance\"", - (gogoproto.nullable) = false - ]; -} diff --git a/proto/nibiru/stablecoin/v1/params.proto b/proto/nibiru/stablecoin/v1/params.proto deleted file mode 100644 index 2835fa9d0..000000000 --- a/proto/nibiru/stablecoin/v1/params.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; -package nibiru.stablecoin.v1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/NibiruChain/nibiru/x/stablecoin/types"; - -// Params defines the parameters for the module. -message Params { - // collRatio is the ratio needed as collateral to exchange for stables - int64 coll_ratio = 1; - - // feeRatio is the ratio taken as fees when minting or burning stables - int64 fee_ratio = 2; - // efFeeRatio is the ratio taken from the fees that goes to Ecosystem Fund - int64 ef_fee_ratio = 3; - - /* BonusRateRecoll is the percentage of extra stablecoin value given to the - caller of 'Recollateralize' in units of governance tokens.*/ - int64 bonus_rate_recoll = 4; - - // distr_epoch_identifier defines the frequnecy of update for the collateral - // ratio - string distr_epoch_identifier = 5 - [ (gogoproto.moretags) = "yaml:\"distr_epoch_identifier\"" ]; - - // adjustmentStep is the size of the step taken when updating the collateral - // ratio - int64 adjustment_step = 6; - - // priceLowerBound is the lower bound for the stable coin to trigger a - // collateral ratio update - int64 price_lower_bound = 7; - - // priceUpperBound is the upper bound for the stable coin to trigger a - // collateral ratio update - int64 price_upper_bound = 8; - - // isCollateralRatioValid checks if the collateral ratio is correctly updated - bool is_collateral_ratio_valid = 9; -} diff --git a/proto/nibiru/stablecoin/v1/query.proto b/proto/nibiru/stablecoin/v1/query.proto deleted file mode 100644 index f8ab5a909..000000000 --- a/proto/nibiru/stablecoin/v1/query.proto +++ /dev/null @@ -1,108 +0,0 @@ -syntax = "proto3"; -package nibiru.stablecoin.v1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "nibiru/stablecoin/v1/params.proto"; - -option go_package = "github.com/NibiruChain/nibiru/x/stablecoin/types"; - -// Query defines the gRPC querier service. -service Query { - // Parameters queries the parameters of the x/stablecoin module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/nibiru/stablecoin/v1/params"; - } - - // ModuleAccountBalances queries the account balance of x/stablecoin. - rpc ModuleAccountBalances(QueryModuleAccountBalances) - returns (QueryModuleAccountBalancesResponse) { - option (google.api.http).get = "/nibiru/stablecoin/module_account_balance"; - } - - rpc CirculatingSupplies(QueryCirculatingSupplies) - returns (QueryCirculatingSuppliesResponse) { - option (google.api.http).get = "/nibiru/stablecoin/circulating_supplies"; - } - - rpc LiquidityRatioInfo(QueryLiquidityRatioInfoRequest) - returns (QueryLiquidityRatioInfoResponse) { - option (google.api.http).get = "/nibiru/stablecoin/liquidity_ratio_info"; - } -} - -// ---------------------------------------- Params - -// 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 ]; -} - -// ---------------------------------------- ModuleAccountBalances - -/* QueryModuleAccountBalances is the request type for the balance of the - x/stablecoin module account. */ -message QueryModuleAccountBalances {} - -message QueryModuleAccountBalancesResponse { - // ModuleAccountBalances is the balance of all coins in the x/stablecoin - // module. - repeated cosmos.base.v1beta1.Coin module_account_balances = 1 [ - (gogoproto.moretags) = "yaml:\"coins\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// ---------------------------------------- CirculatingSupplies - -/* QueryCirculatingSupplies is the request type for the circulating supply of - both NIBI and NUSD. */ -message QueryCirculatingSupplies {} - -message QueryCirculatingSuppliesResponse { - cosmos.base.v1beta1.Coin nibi = 1 [ (gogoproto.nullable) = false ]; - cosmos.base.v1beta1.Coin nusd = 2 [ (gogoproto.nullable) = false ]; -} - -// ---------------------------------------- GovToMintStable - -// QueryGovToMintStable is the request type for the Query/GovToMintStable RPC -// method -message QueryGovToMintStable { - cosmos.base.v1beta1.Coin collateral = 1 [ (gogoproto.nullable) = false ]; -} - -// QueryGovToMintStableResponse is the response type for 'QueryGovToMintStable' -message QueryGovToMintStableResponse { - cosmos.base.v1beta1.Coin gov = 1 [ (gogoproto.nullable) = false ]; -} - -// ---------------------------------------- Liquidity Ratio Info - -message LiquidityRatioInfo { - string liquidity_ratio = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string upper_band = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string lower_band = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} - -message QueryLiquidityRatioInfoRequest {} - -message QueryLiquidityRatioInfoResponse { - LiquidityRatioInfo info = 1 [ (gogoproto.nullable) = false ]; -} \ No newline at end of file diff --git a/proto/nibiru/stablecoin/v1/tx.proto b/proto/nibiru/stablecoin/v1/tx.proto deleted file mode 100644 index 8be25c9aa..000000000 --- a/proto/nibiru/stablecoin/v1/tx.proto +++ /dev/null @@ -1,110 +0,0 @@ -syntax = "proto3"; -package nibiru.stablecoin.v1; - -import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; - -option go_package = "github.com/NibiruChain/nibiru/x/stablecoin/types"; - -// Msg defines the x/stablecoin Msg service. -service Msg { - /* MintStable defines a method for trading a mixture of GOV and COLL to mint - an equivalent value of stablecoins. */ - rpc MintStable(MsgMintStable) returns (MsgMintStableResponse) { - option (google.api.http).post = "/nibiru/stablecoin/mint-sc"; - } - - /* BurnStable defines a method for redeeming/burning stablecoins to receive an - equivalent value as a mixture of governance and collateral tokens. */ - rpc BurnStable(MsgBurnStable) returns (MsgBurnStableResponse) { - option (google.api.http).post = "/nibiru/stablecoin/burn-sc"; - } - - /* Recollateralize defines a method for manually adding collateral to the - protocol in exchange for an equivalent stablecoin value in governance tokens - plus a small bonus. */ - rpc Recollateralize(MsgRecollateralize) returns (MsgRecollateralizeResponse) { - option (google.api.http).post = "/nibiru/stablecoin/recoll"; - } - - /* Buyback defines a method for manually adding NIBI to the protocol - in exchange for an equivalent stablecoin value in collateral, effectively - executing a share buyback for Nibiru Chain. The NIBI purchased by the protocol - is then burned, distributing value to all NIBI hodlers. */ - rpc Buyback(MsgBuyback) returns (MsgBuybackResponse) { - option (google.api.http).post = "/nibiru/stablecoin/buyback"; - } -} - -/* -MsgMintStable: Msg to mint NUSD. A user deposits NIBI and collateral and gets -NUSD in return. The amount of NUSD received depends on the current price set -by the oracle library and the current collateral ratio for the protocol. -*/ -message MsgMintStable { - string creator = 1; - cosmos.base.v1beta1.Coin stable = 2 [ (gogoproto.nullable) = false ]; -} - -/* MsgMintStableResponse specifies the amount of NUSD token the user will - * receive after their mint transaction*/ -message MsgMintStableResponse { - cosmos.base.v1beta1.Coin stable = 1 [ (gogoproto.nullable) = false ]; - repeated cosmos.base.v1beta1.Coin used_coins = 2 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - repeated cosmos.base.v1beta1.Coin fees_payed = 3 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -/* -MsgBurnStable allows users to burn NUSD in exchange for NIBI and collateral. -The amount of NIBI and Collateral received depends on the current price set by -the x/oracle library and the current collateral ratio. -*/ -message MsgBurnStable { - string creator = 1; - cosmos.base.v1beta1.Coin stable = 2 [ (gogoproto.nullable) = false ]; -} - -/* MsgBurnStableResponse specifies the amount of collateral and governance - token the user will receive after their burn transaction. */ -message MsgBurnStableResponse { - cosmos.base.v1beta1.Coin collateral = 1 [ (gogoproto.nullable) = false ]; - cosmos.base.v1beta1.Coin gov = 2 [ (gogoproto.nullable) = false ]; - repeated cosmos.base.v1beta1.Coin fees_payed = 3 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -/* MsgRecollateralize */ -message MsgRecollateralize { - string creator = 1; - cosmos.base.v1beta1.Coin coll = 2 [ (gogoproto.nullable) = false ]; -} - -/* MsgRecollateralizeResponse is the output of a successful 'Recollateralize' */ -message MsgRecollateralizeResponse { - // Gov (sdk.Coin): Tokens rewarded to the caller in exchange for her - // collateral. - cosmos.base.v1beta1.Coin gov = 1 [ (gogoproto.nullable) = false ]; -} - -/* MsgBuyback */ -message MsgBuyback { - string creator = 1; - /* Gov (sdk.Coin): Tokens the caller wants to sell to the protocol in exchange - for collateral. */ - cosmos.base.v1beta1.Coin gov = 2 [ (gogoproto.nullable) = false ]; -} - -/* MsgBuybackResponse is the output of a successful 'Buyback' */ -message MsgBuybackResponse { - // Coll (sdk.Coin): Tokens sold to the caller in exchange for her collateral. - cosmos.base.v1beta1.Coin coll = 1 [ (gogoproto.nullable) = false ]; -} \ No newline at end of file diff --git a/proto/nibiru/sudo/v1/event.proto b/proto/nibiru/sudo/v1/event.proto index a01d41227..f40344447 100644 --- a/proto/nibiru/sudo/v1/event.proto +++ b/proto/nibiru/sudo/v1/event.proto @@ -9,7 +9,7 @@ import "nibiru/sudo/v1/state.proto"; option go_package = "github.com/NibiruChain/nibiru/x/sudo/types"; message EventUpdateSudoers { - Sudoers sudoers = 1 [ (gogoproto.nullable) = false ]; + nibiru.sudo.v1.Sudoers sudoers = 1 [ (gogoproto.nullable) = false ]; // Action is the type of update that occured to the "sudoers" string action = 2; diff --git a/proto/nibiru/sudo/v1/query.proto b/proto/nibiru/sudo/v1/query.proto index 5729fab52..240f63c4e 100644 --- a/proto/nibiru/sudo/v1/query.proto +++ b/proto/nibiru/sudo/v1/query.proto @@ -20,5 +20,5 @@ message QuerySudoersRequest {} // QuerySudoersResponse indicates the successful execution of MsgEditSudeors. message QuerySudoersResponse { - Sudoers sudoers = 1 [ (gogoproto.nullable) = false ]; -} \ No newline at end of file + nibiru.sudo.v1.Sudoers sudoers = 1 [ (gogoproto.nullable) = false ]; +}