diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 962aa308c..b1bedc2de 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -16,5 +16,9 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 + - name: Proto format + run: make check-proto-format + - name: Test run: make test + diff --git a/Makefile b/Makefile index d53ec1161..65d265475 100644 --- a/Makefile +++ b/Makefile @@ -202,13 +202,13 @@ proto-gen: proto-swagger-gen: @$(protoImage) sh ./scripts/protoc-swagger-gen.sh -PROTO_FORMATTER_IMAGE=tendermintdev/docker-build-proto@sha256:aabcfe2fc19c31c0f198d4cd26393f5e5ca9502d7ea3feafbfe972448fee7cae +PROTO_FORMATTER_IMAGE=bufbuild/buf:1.28.1 proto-format: @echo "Formatting Protobuf files" $(DOCKER) run --rm -v $(CURDIR):/workspace \ --workdir /workspace $(PROTO_FORMATTER_IMAGE) \ - find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \; + format proto -w .PHONY: all install install-debug \ @@ -256,3 +256,11 @@ openapi: mocks: @echo "Regenerate mocks..." @go generate ./... + +format-all: format proto-format + +check-proto-format: + @echo "Formatting Protobuf files" + $(DOCKER) run --rm -v $(CURDIR):/workspace \ + --workdir /workspace $(PROTO_FORMATTER_IMAGE) \ + format proto -d --exit-code diff --git a/proto/neutron/contractmanager/failure.proto b/proto/neutron/contractmanager/failure.proto index 757ae1421..57fc76992 100644 --- a/proto/neutron/contractmanager/failure.proto +++ b/proto/neutron/contractmanager/failure.proto @@ -7,7 +7,8 @@ option go_package = "github.com/neutron-org/neutron/v2/x/contractmanager/types"; // Failure message contains information about ACK failures and can be used to // replay ACK in case of requirement. -// Note that Failure means that sudo handler to cosmwasm contract failed for some reason +// Note that Failure means that sudo handler to cosmwasm contract failed for +// some reason message Failure { // Address of the failed contract string address = 1; diff --git a/proto/neutron/contractmanager/genesis.proto b/proto/neutron/contractmanager/genesis.proto index 9d41184fb..661437dce 100644 --- a/proto/neutron/contractmanager/genesis.proto +++ b/proto/neutron/contractmanager/genesis.proto @@ -2,16 +2,16 @@ syntax = "proto3"; package neutron.contractmanager; import "gogoproto/gogo.proto"; -import "neutron/contractmanager/params.proto"; import "neutron/contractmanager/failure.proto"; +import "neutron/contractmanager/params.proto"; // this line is used by starport scaffolding # genesis/proto/import option go_package = "github.com/neutron-org/neutron/v2/x/contractmanager/types"; // GenesisState defines the contractmanager module's genesis state. message GenesisState { - Params params = 1 [ (gogoproto.nullable) = false ]; + Params params = 1 [(gogoproto.nullable) = false]; // List of the contract failures - repeated Failure failures_list = 2 [ (gogoproto.nullable) = false ]; + repeated Failure failures_list = 2 [(gogoproto.nullable) = false]; // this line is used by starport scaffolding # genesis/proto/state -} \ No newline at end of file +} diff --git a/proto/neutron/contractmanager/query.proto b/proto/neutron/contractmanager/query.proto index 68095e46b..f8a45bd0d 100644 --- a/proto/neutron/contractmanager/query.proto +++ b/proto/neutron/contractmanager/query.proto @@ -1,11 +1,11 @@ syntax = "proto3"; package neutron.contractmanager; +import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "neutron/contractmanager/params.proto"; import "neutron/contractmanager/failure.proto"; +import "neutron/contractmanager/params.proto"; // this line is used by starport scaffolding # 1 option go_package = "github.com/neutron-org/neutron/v2/x/contractmanager/types"; @@ -24,8 +24,7 @@ service Query { // Queries Failures by contract address. rpc AddressFailures(QueryFailuresRequest) returns (QueryFailuresResponse) { - option (google.api.http).get = - "/neutron/contractmanager/failures/{address}"; + option (google.api.http).get = "/neutron/contractmanager/failures/{address}"; } // Queries a list of Failures occurred on the network. @@ -42,7 +41,7 @@ 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 ]; + Params params = 1 [(gogoproto.nullable) = false]; } // QueryFailuresRequest is request type for the Query/Failures RPC method. @@ -56,8 +55,8 @@ message QueryFailuresRequest { // QueryFailuresResponse is response type for the Query/Failures RPC method. message QueryFailuresResponse { - repeated Failure failures = 1 [ (gogoproto.nullable) = false ]; + repeated Failure failures = 1 [(gogoproto.nullable) = false]; cosmos.base.query.v1beta1.PageResponse pagination = 2; } -// this line is used by starport scaffolding # 3 \ No newline at end of file +// this line is used by starport scaffolding # 3 diff --git a/proto/neutron/contractmanager/tx.proto b/proto/neutron/contractmanager/tx.proto index 07f38b7cc..0d4c23fb7 100644 --- a/proto/neutron/contractmanager/tx.proto +++ b/proto/neutron/contractmanager/tx.proto @@ -1,11 +1,11 @@ syntax = "proto3"; package neutron.contractmanager; -import "neutron/contractmanager/params.proto"; -import "gogoproto/gogo.proto"; +import "amino/amino.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "neutron/contractmanager/params.proto"; // this line is used by starport scaffolding # proto/tx/import @@ -13,25 +13,27 @@ option go_package = "github.com/neutron-org/neutron/v2/x/contractmanager/types"; // Msg defines the Msg service. service Msg { - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - // this line is used by starport scaffolding # proto/tx/rpc + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + // this line is used by starport scaffolding # proto/tx/rpc } // MsgUpdateParams is the MsgUpdateParams request type. // // Since: 0.47 message MsgUpdateParams { - option (amino.name) = "contractmanager/MsgUpdateParams"; - option (cosmos.msg.v1.signer) = "authority"; - - // Authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - - // params defines the x/contractmanager parameters to update. - // - // NOTE: All parameters must be supplied. - contractmanager.Params params = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + option (amino.name) = "contractmanager/MsgUpdateParams"; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/contractmanager parameters to update. + // + // NOTE: All parameters must be supplied. + contractmanager.Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // MsgUpdateParamsResponse defines the response structure for executing a diff --git a/proto/neutron/cron/genesis.proto b/proto/neutron/cron/genesis.proto index d9701d54c..22fbeec38 100644 --- a/proto/neutron/cron/genesis.proto +++ b/proto/neutron/cron/genesis.proto @@ -10,7 +10,7 @@ option go_package = "github.com/neutron-org/neutron/v2/x/cron/types"; // GenesisState defines the cron module's genesis state. message GenesisState { - repeated Schedule scheduleList = 2 [ (gogoproto.nullable) = false ]; - Params params = 1 [ (gogoproto.nullable) = false ]; + repeated Schedule scheduleList = 2 [(gogoproto.nullable) = false]; + Params params = 1 [(gogoproto.nullable) = false]; // this line is used by starport scaffolding # genesis/proto/state -} \ No newline at end of file +} diff --git a/proto/neutron/cron/query.proto b/proto/neutron/cron/query.proto index 55db0cfb6..d0a68a742 100644 --- a/proto/neutron/cron/query.proto +++ b/proto/neutron/cron/query.proto @@ -1,9 +1,9 @@ syntax = "proto3"; package neutron.cron; +import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; import "neutron/cron/params.proto"; import "neutron/cron/schedule.proto"; // this line is used by starport scaffolding # 1 @@ -34,13 +34,15 @@ message QueryParamsRequest {} message QueryParamsResponse { // params holds all the parameters of this module. - Params params = 1 [ (gogoproto.nullable) = false ]; + Params params = 1 [(gogoproto.nullable) = false]; } -message QueryGetScheduleRequest { string name = 1; } +message QueryGetScheduleRequest { + string name = 1; +} message QueryGetScheduleResponse { - Schedule schedule = 1 [ (gogoproto.nullable) = false ]; + Schedule schedule = 1 [(gogoproto.nullable) = false]; } message QuerySchedulesRequest { @@ -48,7 +50,7 @@ message QuerySchedulesRequest { } message QuerySchedulesResponse { - repeated Schedule schedules = 1 [ (gogoproto.nullable) = false ]; + repeated Schedule schedules = 1 [(gogoproto.nullable) = false]; cosmos.base.query.v1beta1.PageResponse pagination = 2; } diff --git a/proto/neutron/cron/schedule.proto b/proto/neutron/cron/schedule.proto index ee505ea34..aa86af256 100644 --- a/proto/neutron/cron/schedule.proto +++ b/proto/neutron/cron/schedule.proto @@ -1,17 +1,17 @@ syntax = "proto3"; package neutron.cron; -option go_package = "github.com/neutron-org/neutron/v2/x/cron/types"; - import "gogoproto/gogo.proto"; +option go_package = "github.com/neutron-org/neutron/v2/x/cron/types"; + message Schedule { // Name of schedule string name = 1; // Period in blocks uint64 period = 2; // Msgs that will be executed every period amount of time - repeated MsgExecuteContract msgs = 3 [ (gogoproto.nullable) = false ]; + repeated MsgExecuteContract msgs = 3 [(gogoproto.nullable) = false]; // Last execution's block height uint64 last_execute_height = 4; } diff --git a/proto/neutron/cron/tx.proto b/proto/neutron/cron/tx.proto index 510a88178..3da18eed3 100644 --- a/proto/neutron/cron/tx.proto +++ b/proto/neutron/cron/tx.proto @@ -1,11 +1,11 @@ syntax = "proto3"; package neutron.cron; -import "neutron/cron/params.proto"; -import "gogoproto/gogo.proto"; +import "amino/amino.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "neutron/cron/params.proto"; // this line is used by starport scaffolding # proto/tx/import @@ -13,8 +13,8 @@ option go_package = "github.com/neutron-org/neutron/v2/x/cron/types"; // Msg defines the Msg service. service Msg { - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - // this line is used by starport scaffolding # proto/tx/rpc + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + // this line is used by starport scaffolding # proto/tx/rpc } // this line is used by starport scaffolding # proto/tx/message @@ -23,17 +23,19 @@ service Msg { // // Since: 0.47 message MsgUpdateParams { - option (amino.name) = "cron/MsgUpdateParams"; - option (cosmos.msg.v1.signer) = "authority"; - - // Authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - - // params defines the x/cron parameters to update. - // - // NOTE: All parameters must be supplied. - Params params = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + option (amino.name) = "cron/MsgUpdateParams"; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/cron parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // MsgUpdateParamsResponse defines the response structure for executing a diff --git a/proto/neutron/dex/deposit_record.proto b/proto/neutron/dex/deposit_record.proto index 804629516..c3507147c 100644 --- a/proto/neutron/dex/deposit_record.proto +++ b/proto/neutron/dex/deposit_record.proto @@ -1,18 +1,19 @@ syntax = "proto3"; package neutron.dex; -option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; import "gogoproto/gogo.proto"; import "neutron/dex/pair_id.proto"; +option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; + message DepositRecord { PairID pair_id = 1; string shares_owned = 2 [ - (gogoproto.moretags) = "yaml:\"shares_owned\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "shares_owned" - ]; + (gogoproto.moretags) = "yaml:\"shares_owned\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "shares_owned" + ]; int64 center_tick_index = 3; int64 lower_tick_index = 4; int64 upper_tick_index = 5; diff --git a/proto/neutron/dex/genesis.proto b/proto/neutron/dex/genesis.proto index eb9e22cf5..7704c3b1c 100644 --- a/proto/neutron/dex/genesis.proto +++ b/proto/neutron/dex/genesis.proto @@ -3,11 +3,11 @@ syntax = "proto3"; package neutron.dex; import "gogoproto/gogo.proto"; -import "neutron/dex/params.proto"; -import "neutron/dex/limit_order_tranche_user.proto"; import "neutron/dex/limit_order_tranche.proto"; -import "neutron/dex/tick_liquidity.proto"; +import "neutron/dex/limit_order_tranche_user.proto"; +import "neutron/dex/params.proto"; import "neutron/dex/pool_metadata.proto"; +import "neutron/dex/tick_liquidity.proto"; // this line is used by starport scaffolding # genesis/proto/import @@ -15,12 +15,11 @@ option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; // GenesisState defines the dex module's genesis state. message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; - repeated TickLiquidity tick_liquidity_list = 2 [(gogoproto.nullable) = true ]; - repeated LimitOrderTranche inactive_limit_order_tranche_list = 3 [(gogoproto.nullable) = true ]; - repeated LimitOrderTrancheUser limit_order_tranche_user_list = 4 [(gogoproto.nullable) = true ]; - repeated PoolMetadata pool_metadata_list = 5 [(gogoproto.nullable) = false]; - uint64 pool_count = 6; + Params params = 1 [(gogoproto.nullable) = false]; + repeated TickLiquidity tick_liquidity_list = 2 [(gogoproto.nullable) = true]; + repeated LimitOrderTranche inactive_limit_order_tranche_list = 3 [(gogoproto.nullable) = true]; + repeated LimitOrderTrancheUser limit_order_tranche_user_list = 4 [(gogoproto.nullable) = true]; + repeated PoolMetadata pool_metadata_list = 5 [(gogoproto.nullable) = false]; + uint64 pool_count = 6; // this line is used by starport scaffolding # genesis/proto/state } - diff --git a/proto/neutron/dex/limit_order_expiration.proto b/proto/neutron/dex/limit_order_expiration.proto index e69d3212a..108a1b1bc 100644 --- a/proto/neutron/dex/limit_order_expiration.proto +++ b/proto/neutron/dex/limit_order_expiration.proto @@ -1,18 +1,16 @@ syntax = "proto3"; package neutron.dex; -option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; +import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; -import "gogoproto/gogo.proto"; +option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; message LimitOrderExpiration { // see limitOrderTranche.proto for details on goodTilDate google.protobuf.Timestamp expiration_time = 1 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false - ]; + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; bytes tranche_ref = 2; - } - diff --git a/proto/neutron/dex/limit_order_tranche.proto b/proto/neutron/dex/limit_order_tranche.proto index d18822eed..0d7d2ad3c 100644 --- a/proto/neutron/dex/limit_order_tranche.proto +++ b/proto/neutron/dex/limit_order_tranche.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package neutron.dex; -option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; -import "google/protobuf/timestamp.proto"; - -import "neutron/dex/trade_pair_id.proto"; import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; import "neutron/dex/pair_id.proto"; +import "neutron/dex/trade_pair_id.proto"; + +option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; message LimitOrderTrancheKey { TradePairID trade_pair_id = 1; @@ -16,45 +16,44 @@ message LimitOrderTrancheKey { message LimitOrderTranche { LimitOrderTrancheKey key = 1; - string reserves_maker_denom = 2 [ - (gogoproto.moretags) = "yaml:\"reserves_maker_denom\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "reserves_maker_denom" - ]; - string reserves_taker_denom = 3 [ - (gogoproto.moretags) = "yaml:\"reserves_taker_denom\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "reserves_taker_denom" - ]; - string total_maker_denom = 4 [ - (gogoproto.moretags) = "yaml:\"total_maker_denom\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "total_maker_denom" - ]; - string total_taker_denom = 5 [ - (gogoproto.moretags) = "yaml:\"total_taker_denom\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "total_taker_denom" + string reserves_maker_denom = 2 [ + (gogoproto.moretags) = "yaml:\"reserves_maker_denom\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "reserves_maker_denom" ]; - // GoodTilDate is represented as seconds since January 1, year 1, 00:00:00.00 UTC - // LimitOrders with goodTilDate set are valid as long as blockTime <= goodTilDate - - // JIT orders also use goodTilDate to handle deletion but represent a special case - // All JIT orders have a goodTilDate of 0 and an exception is made to still still treat these orders as live - // Order deletion still functions the same and the orders will be deleted at the end of the block + string reserves_taker_denom = 3 [ + (gogoproto.moretags) = "yaml:\"reserves_taker_denom\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "reserves_taker_denom" + ]; + string total_maker_denom = 4 [ + (gogoproto.moretags) = "yaml:\"total_maker_denom\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "total_maker_denom" + ]; + string total_taker_denom = 5 [ + (gogoproto.moretags) = "yaml:\"total_taker_denom\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "total_taker_denom" + ]; + // expiration_time is represented as an RFC 3339 formatted date. + // LimitOrders with expiration_time set are valid as long as blockTime <= expiration_time. + // JIT orders also use expiration_time to handle deletion, but represent a special case. + // All JIT orders have an expiration_time of 0001-01-01T00:00:00Z, and an exception is made to + // still treat these orders as live. Order deletion still functions the + // same, and the orders will be deleted at the end of the block. google.protobuf.Timestamp expiration_time = 6 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = true - ]; + (gogoproto.stdtime) = true, + (gogoproto.nullable) = true + ]; string price_taker_to_maker = 7 [ - (gogoproto.moretags) = "yaml:\"price_taker_to_maker\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/v2/utils/math.PrecDec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price_taker_to_maker" - ]; + (gogoproto.moretags) = "yaml:\"price_taker_to_maker\"", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v2/utils/math.PrecDec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "price_taker_to_maker" + ]; } - diff --git a/proto/neutron/dex/limit_order_tranche_user.proto b/proto/neutron/dex/limit_order_tranche_user.proto index 0896f753a..09838cfdf 100644 --- a/proto/neutron/dex/limit_order_tranche_user.proto +++ b/proto/neutron/dex/limit_order_tranche_user.proto @@ -1,34 +1,34 @@ syntax = "proto3"; package neutron.dex; -option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; import "gogoproto/gogo.proto"; import "neutron/dex/trade_pair_id.proto"; import "neutron/dex/tx.proto"; +option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; + message LimitOrderTrancheUser { TradePairID trade_pair_id = 1; int64 tick_index_taker_to_maker = 2; string tranche_key = 3; - string address = 4; - string shares_owned = 5 [ - (gogoproto.moretags) = "yaml:\"shares_owned\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "shares_owned" - ]; - string shares_withdrawn = 6 [ - (gogoproto.moretags) = "yaml:\"shares_withdrawn\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "shares_withdrawn" - ]; - string shares_cancelled = 7 [ - (gogoproto.moretags) = "yaml:\"shares_cancelled\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "shares_cancelled" + string address = 4; + string shares_owned = 5 [ + (gogoproto.moretags) = "yaml:\"shares_owned\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "shares_owned" + ]; + string shares_withdrawn = 6 [ + (gogoproto.moretags) = "yaml:\"shares_withdrawn\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "shares_withdrawn" + ]; + string shares_cancelled = 7 [ + (gogoproto.moretags) = "yaml:\"shares_cancelled\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "shares_cancelled" ]; LimitOrderType order_type = 8; } - diff --git a/proto/neutron/dex/pair_id.proto b/proto/neutron/dex/pair_id.proto index 9eb624a6c..13fd69427 100644 --- a/proto/neutron/dex/pair_id.proto +++ b/proto/neutron/dex/pair_id.proto @@ -4,6 +4,6 @@ package neutron.dex; option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; message PairID { - string token0 = 1; - string token1 = 2; + string token0 = 1; + string token1 = 2; } diff --git a/proto/neutron/dex/params.proto b/proto/neutron/dex/params.proto index 910919a9e..1d8d77a47 100644 --- a/proto/neutron/dex/params.proto +++ b/proto/neutron/dex/params.proto @@ -10,10 +10,9 @@ message Params { option (gogoproto.goproto_stringer) = false; repeated uint64 fee_tiers = 1; string max_true_taker_spread = 2 [ - (gogoproto.moretags) = "yaml:\"max_true_taker_spread\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/v2/utils/math.PrecDec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "max_true_taker_spread" - ]; - + (gogoproto.moretags) = "yaml:\"max_true_taker_spread\"", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v2/utils/math.PrecDec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "max_true_taker_spread" + ]; } diff --git a/proto/neutron/dex/pool.proto b/proto/neutron/dex/pool.proto index c2b686ce4..87420dddc 100644 --- a/proto/neutron/dex/pool.proto +++ b/proto/neutron/dex/pool.proto @@ -1,14 +1,16 @@ syntax = "proto3"; package neutron.dex; -option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; import "gogoproto/gogo.proto"; import "neutron/dex/pool_reserves.proto"; -// NOTE: This struct is never actually stored in the KV store. It is merely a convenience wrapper for holding both sides of a pool. +option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; + +// NOTE: This struct is never actually stored in the KV store. It is merely a +// convenience wrapper for holding both sides of a pool. message Pool { - uint64 id = 1; - PoolReserves lower_tick0 = 2; - PoolReserves upper_tick1 = 3; + uint64 id = 1; + PoolReserves lower_tick0 = 2; + PoolReserves upper_tick1 = 3; } diff --git a/proto/neutron/dex/pool_metadata.proto b/proto/neutron/dex/pool_metadata.proto index c023935f1..a34cc417a 100644 --- a/proto/neutron/dex/pool_metadata.proto +++ b/proto/neutron/dex/pool_metadata.proto @@ -1,10 +1,10 @@ syntax = "proto3"; package neutron.dex; -option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; - import "neutron/dex/pair_id.proto"; +option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; + message PoolMetadata { uint64 id = 1; int64 tick = 2; diff --git a/proto/neutron/dex/pool_reserves.proto b/proto/neutron/dex/pool_reserves.proto index 8c444481e..1e9e7c967 100644 --- a/proto/neutron/dex/pool_reserves.proto +++ b/proto/neutron/dex/pool_reserves.proto @@ -1,35 +1,35 @@ syntax = "proto3"; package neutron.dex; -option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; import "gogoproto/gogo.proto"; import "neutron/dex/trade_pair_id.proto"; +option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; + message PoolReservesKey { - TradePairID trade_pair_id = 1; - int64 tick_index_taker_to_maker = 2; - uint64 fee = 3; + TradePairID trade_pair_id = 1; + int64 tick_index_taker_to_maker = 2; + uint64 fee = 3; } message PoolReserves { PoolReservesKey key = 1; string reserves_maker_denom = 2 [ - (gogoproto.moretags) = "yaml:\"reserves_maker_denom\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.jsontag) = "reserves_maker_denom", - (gogoproto.nullable) = false - ]; + (gogoproto.moretags) = "yaml:\"reserves_maker_denom\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.jsontag) = "reserves_maker_denom", + (gogoproto.nullable) = false + ]; string price_taker_to_maker = 3 [ - (gogoproto.moretags) = "yaml:\"price_taker_to_maker\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/v2/utils/math.PrecDec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price_taker_to_maker" - ]; + (gogoproto.moretags) = "yaml:\"price_taker_to_maker\"", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v2/utils/math.PrecDec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "price_taker_to_maker" + ]; string price_opposite_taker_to_maker = 4 [ - (gogoproto.moretags) = "yaml:\"price_opposite_taker_to_maker\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/v2/utils/math.PrecDec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price_opposite_taker_to_maker" - ]; + (gogoproto.moretags) = "yaml:\"price_opposite_taker_to_maker\"", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v2/utils/math.PrecDec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "price_opposite_taker_to_maker" + ]; } - diff --git a/proto/neutron/dex/query.proto b/proto/neutron/dex/query.proto index 981b24352..64d078eae 100644 --- a/proto/neutron/dex/query.proto +++ b/proto/neutron/dex/query.proto @@ -2,20 +2,20 @@ syntax = "proto3"; package neutron.dex; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; -import "neutron/dex/params.proto"; -import "neutron/dex/limit_order_tranche_user.proto"; -import "neutron/dex/limit_order_tranche.proto"; -import "neutron/dex/deposit_record.proto"; -import "neutron/dex/tick_liquidity.proto"; -import "neutron/dex/pool_reserves.proto"; -import "neutron/dex/tx.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; import "google/protobuf/timestamp.proto"; +import "neutron/dex/deposit_record.proto"; +import "neutron/dex/limit_order_tranche.proto"; +import "neutron/dex/limit_order_tranche_user.proto"; +import "neutron/dex/params.proto"; import "neutron/dex/pool.proto"; import "neutron/dex/pool_metadata.proto"; +import "neutron/dex/pool_reserves.proto"; +import "neutron/dex/tick_liquidity.proto"; +import "neutron/dex/tx.proto"; // this line is used by starport scaffolding # 1 @@ -24,117 +24,114 @@ option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; // Query defines the gRPC querier service. service Query { // Parameters queries the parameters of the module. - rpc Params (QueryParamsRequest) returns (QueryParamsResponse) { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/neutron/dex/params"; - } - + // Queries a LimitOrderTrancheUser by index. - rpc LimitOrderTrancheUser (QueryGetLimitOrderTrancheUserRequest) returns (QueryGetLimitOrderTrancheUserResponse) { + rpc LimitOrderTrancheUser(QueryGetLimitOrderTrancheUserRequest) returns (QueryGetLimitOrderTrancheUserResponse) { option (google.api.http).get = "/neutron/dex/limit_order_tranche_user/{address}/{tranche_key}"; - } - + // Queries a list of LimitOrderTrancheMap items. - rpc LimitOrderTrancheUserAll (QueryAllLimitOrderTrancheUserRequest) returns (QueryAllLimitOrderTrancheUserResponse) { + rpc LimitOrderTrancheUserAll(QueryAllLimitOrderTrancheUserRequest) returns (QueryAllLimitOrderTrancheUserResponse) { option (google.api.http).get = "/neutron/dex/limit_order_tranche_user"; - } // Queries a list of LimitOrderTrancheUser items for a given address. - rpc LimitOrderTrancheUserAllByAddress(QueryAllUserLimitOrdersRequest) returns (QueryAllUserLimitOrdersResponse) { - option (google.api.http).get = "/neutron/dex/user/limit_orders/{address}"; - } - + rpc LimitOrderTrancheUserAllByAddress(QueryAllUserLimitOrdersRequest) returns (QueryAllUserLimitOrdersResponse) { + option (google.api.http).get = "/neutron/dex/user/limit_orders/{address}"; + } + // Queries a LimitOrderTranche by index. - rpc LimitOrderTranche (QueryGetLimitOrderTrancheRequest) returns (QueryGetLimitOrderTrancheResponse) { - option (google.api.http).get = "/neutron/dex/limit_order_tranche/{pair_id}/{token_in}/{tick_index}/{tranche_key}"; + rpc LimitOrderTranche(QueryGetLimitOrderTrancheRequest) returns (QueryGetLimitOrderTrancheResponse) { + option (google.api.http).get = + "/neutron/dex/limit_order_tranche/{pair_id}/" + "{token_in}/{tick_index}/{tranche_key}"; } - - // Queries a list of LimitOrderTranche items for a given pairID / TokenIn combination. - rpc LimitOrderTrancheAll (QueryAllLimitOrderTrancheRequest) returns (QueryAllLimitOrderTrancheResponse) { + + // Queries a list of LimitOrderTranche items for a given pairID / TokenIn + // combination. + rpc LimitOrderTrancheAll(QueryAllLimitOrderTrancheRequest) returns (QueryAllLimitOrderTrancheResponse) { option (google.api.http).get = "/neutron/dex/limit_order_tranche/{pair_id}/{token_in}"; } - + // Queries a list of UserDeposits items. - rpc UserDepositsAll (QueryAllUserDepositsRequest) returns (QueryAllUserDepositsResponse) { + rpc UserDepositsAll(QueryAllUserDepositsRequest) returns (QueryAllUserDepositsResponse) { option (google.api.http).get = "/neutron/dex/user/deposits/{address}"; } - + // Queries a list of TickLiquidity items. - rpc TickLiquidityAll (QueryAllTickLiquidityRequest) returns (QueryAllTickLiquidityResponse) { + rpc TickLiquidityAll(QueryAllTickLiquidityRequest) returns (QueryAllTickLiquidityResponse) { option (google.api.http).get = "/neutron/dex/tick_liquidity/{pair_id}/{token_in}"; } - + // Queries a InactiveLimitOrderTranche by index. - rpc InactiveLimitOrderTranche (QueryGetInactiveLimitOrderTrancheRequest) returns (QueryGetInactiveLimitOrderTrancheResponse) { - option (google.api.http).get = "/neutron/dex/filled_limit_order_tranche/{pair_id}/{token_in}/{tick_index}/{tranche_key}"; + rpc InactiveLimitOrderTranche(QueryGetInactiveLimitOrderTrancheRequest) returns (QueryGetInactiveLimitOrderTrancheResponse) { + option (google.api.http).get = + "/neutron/dex/filled_limit_order_tranche/{pair_id}/{token_in}/" + "{tick_index}/{tranche_key}"; } - + // Queries a list of InactiveLimitOrderTranche items. - rpc InactiveLimitOrderTrancheAll (QueryAllInactiveLimitOrderTrancheRequest) returns (QueryAllInactiveLimitOrderTrancheResponse) { + rpc InactiveLimitOrderTrancheAll(QueryAllInactiveLimitOrderTrancheRequest) returns (QueryAllInactiveLimitOrderTrancheResponse) { option (google.api.http).get = "/neutron/dex/filled_limit_order_tranche"; } - + // Queries a list of PoolReserves items. - rpc PoolReservesAll (QueryAllPoolReservesRequest) returns (QueryAllPoolReservesResponse) { + rpc PoolReservesAll(QueryAllPoolReservesRequest) returns (QueryAllPoolReservesResponse) { option (google.api.http).get = "/neutron/dex/pool_reserves/{pair_id}/{token_in}"; } - + // Queries a PoolReserve by index - rpc PoolReserves (QueryGetPoolReservesRequest) returns (QueryGetPoolReservesResponse) { + rpc PoolReserves(QueryGetPoolReservesRequest) returns (QueryGetPoolReservesResponse) { option (google.api.http).get = "/neutron/dex/pool_reserves/{pair_id}/{token_in}/{tick_index}/{fee}"; } - - // Queries the simulated result of a multihop swap - rpc EstimateMultiHopSwap (QueryEstimateMultiHopSwapRequest) returns (QueryEstimateMultiHopSwapResponse) { + + // Queries the simulated result of a multihop swap + rpc EstimateMultiHopSwap(QueryEstimateMultiHopSwapRequest) returns (QueryEstimateMultiHopSwapResponse) { option (google.api.http).get = "/neutron/dex/estimate_multi_hop_swap"; } - - // Queries the simulated result of a multihop swap - rpc EstimatePlaceLimitOrder (QueryEstimatePlaceLimitOrderRequest) returns (QueryEstimatePlaceLimitOrderResponse) { + + // Queries the simulated result of a multihop swap + rpc EstimatePlaceLimitOrder(QueryEstimatePlaceLimitOrderRequest) returns (QueryEstimatePlaceLimitOrderResponse) { option (google.api.http).get = "/neutron/dex/estimate_place_limit_order"; } - + // Queries a pool by pair, tick and fee - rpc Pool (QueryPoolRequest) returns (QueryPoolResponse) { + rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { option (google.api.http).get = "/neutron/dex/pool/{pair_id}/{tick_index}/{fee}"; - } - + // Queries a pool by ID - rpc PoolByID (QueryPoolByIDRequest) returns (QueryPoolResponse) { + rpc PoolByID(QueryPoolByIDRequest) returns (QueryPoolResponse) { option (google.api.http).get = "/neutron/dex/pool/{pool_id}"; - } // Queries a PoolMetadata by ID - rpc PoolMetadata (QueryGetPoolMetadataRequest) returns (QueryGetPoolMetadataResponse) { + rpc PoolMetadata(QueryGetPoolMetadataRequest) returns (QueryGetPoolMetadataResponse) { option (google.api.http).get = "/neutron/dex/pool_metadata/{id}"; - } // Queries a list of PoolMetadata items. - rpc PoolMetadataAll (QueryAllPoolMetadataRequest) returns (QueryAllPoolMetadataResponse) { + rpc PoolMetadataAll(QueryAllPoolMetadataRequest) returns (QueryAllPoolMetadataResponse) { option (google.api.http).get = "/neutron/dex/pool_metadata"; - } -// this line is used by starport scaffolding # 2 - + // this line is used by starport scaffolding # 2 } + // 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]; } message QueryGetLimitOrderTrancheUserRequest { - string address = 1; + string address = 1; string tranche_key = 2; } @@ -147,14 +144,14 @@ message QueryAllLimitOrderTrancheUserRequest { } message QueryAllLimitOrderTrancheUserResponse { - repeated LimitOrderTrancheUser limit_order_tranche_user = 1 [(gogoproto.nullable) = true]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated LimitOrderTrancheUser limit_order_tranche_user = 1 [(gogoproto.nullable) = true]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } message QueryGetLimitOrderTrancheRequest { - string pair_id = 1; - int64 tick_index = 2; - string token_in = 3; + string pair_id = 1; + int64 tick_index = 2; + string token_in = 3; string tranche_key = 4; } @@ -163,29 +160,29 @@ message QueryGetLimitOrderTrancheResponse { } message QueryAllLimitOrderTrancheRequest { - string pair_id = 1; - string token_in = 2; + string pair_id = 1; + string token_in = 2; cosmos.base.query.v1beta1.PageRequest pagination = 3; } message QueryAllLimitOrderTrancheResponse { - repeated LimitOrderTranche limit_order_tranche = 1 [(gogoproto.nullable) = true]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated LimitOrderTranche limit_order_tranche = 1 [(gogoproto.nullable) = true]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } message QueryAllUserDepositsRequest { string address = 1; - cosmos.base.query.v1beta1.PageRequest pagination = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 2; } message QueryAllUserDepositsResponse { repeated DepositRecord deposits = 1 [(gogoproto.nullable) = true]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } message QueryAllUserLimitOrdersRequest { string address = 1; - cosmos.base.query.v1beta1.PageRequest pagination = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 2; } message QueryAllUserLimitOrdersResponse { @@ -194,20 +191,20 @@ message QueryAllUserLimitOrdersResponse { } message QueryAllTickLiquidityRequest { - string pair_id = 1; - string token_in = 2; + string pair_id = 1; + string token_in = 2; cosmos.base.query.v1beta1.PageRequest pagination = 3; } message QueryAllTickLiquidityResponse { - repeated TickLiquidity tick_liquidity = 1 [(gogoproto.nullable) = true]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated TickLiquidity tick_liquidity = 1 [(gogoproto.nullable) = true]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } message QueryGetInactiveLimitOrderTrancheRequest { - string pair_id = 1; - string token_in = 2; - int64 tick_index = 3; + string pair_id = 1; + string token_in = 2; + int64 tick_index = 3; string tranche_key = 4; } @@ -220,26 +217,26 @@ message QueryAllInactiveLimitOrderTrancheRequest { } message QueryAllInactiveLimitOrderTrancheResponse { - repeated LimitOrderTranche inactive_limit_order_tranche = 1 [(gogoproto.nullable) = true]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated LimitOrderTranche inactive_limit_order_tranche = 1 [(gogoproto.nullable) = true]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } message QueryAllPoolReservesRequest { - string pair_id = 1; - string token_in = 2; + string pair_id = 1; + string token_in = 2; cosmos.base.query.v1beta1.PageRequest pagination = 3; } message QueryAllPoolReservesResponse { - repeated PoolReserves pool_reserves = 1 [(gogoproto.nullable) = true]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated PoolReserves pool_reserves = 1 [(gogoproto.nullable) = true]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } message QueryGetPoolReservesRequest { - string pair_id = 1; - string token_in = 2; - int64 tick_index = 3; - uint64 fee = 4; + string pair_id = 1; + string token_in = 2; + int64 tick_index = 3; + uint64 fee = 4; } message QueryGetPoolReservesResponse { @@ -247,54 +244,97 @@ message QueryGetPoolReservesResponse { } message QueryEstimateMultiHopSwapRequest { - string creator = 1; - string receiver = 2; - repeated MultiHopRoute routes = 3; - string amount_in = 4 [(gogoproto.moretags) = "yaml:\"amount_in\"" , (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false, (gogoproto.jsontag) = "amount_in" ]; - string exit_limit_price = 5 [(gogoproto.moretags) = "yaml:\"exit_limit_price\"", (gogoproto.customtype) = "github.com/neutron-org/neutron/v2/utils/math.PrecDec", (gogoproto.nullable) = false, (gogoproto.jsontag) = "exit_limit_price"]; - - // If pickBestRoute == true then all routes are run and the route with the best price is chosen - // otherwise, the first succesful route is used. + string creator = 1; + string receiver = 2; + repeated MultiHopRoute routes = 3; + string amount_in = 4 [ + (gogoproto.moretags) = "yaml:\"amount_in\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "amount_in" + ]; + string exit_limit_price = 5 [ + (gogoproto.moretags) = "yaml:\"exit_limit_price\"", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v2/utils/math.PrecDec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "exit_limit_price" + ]; + + // If pickBestRoute == true then all routes are run and the route with the + // best price is chosen otherwise, the first succesful route is used. bool pick_best_route = 6; } message QueryEstimateMultiHopSwapResponse { - cosmos.base.v1beta1.Coin coin_out = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.jsontag) = "coin_out"]; + cosmos.base.v1beta1.Coin coin_out = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "coin_out" + ]; } message QueryEstimatePlaceLimitOrderRequest { - string creator = 1; - string receiver = 2; - string token_in = 3; - string token_out = 4; - int64 tick_index_in_to_out = 5; - string amount_in = 6 [(gogoproto.moretags) = "yaml:\"amount_in\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false, (gogoproto.jsontag) = "amount_in"]; - LimitOrderType order_type = 7; - + string creator = 1; + string receiver = 2; + string token_in = 3; + string token_out = 4; + int64 tick_index_in_to_out = 5; + string amount_in = 6 [ + (gogoproto.moretags) = "yaml:\"amount_in\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "amount_in" + ]; + LimitOrderType order_type = 7; + // expirationTime is only valid iff orderType == GOOD_TIL_TIME. - google.protobuf.Timestamp expiration_time = 8 [(gogoproto.stdtime) = true , (gogoproto.nullable) = true ] ; - string maxAmount_out = 9 [(gogoproto.moretags) = "yaml:\"max_amount_out\"", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = true, (gogoproto.jsontag) = "max_amount_out"]; + google.protobuf.Timestamp expiration_time = 8 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = true + ]; + string maxAmount_out = 9 [ + (gogoproto.moretags) = "yaml:\"max_amount_out\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = true, + (gogoproto.jsontag) = "max_amount_out" + ]; } message QueryEstimatePlaceLimitOrderResponse { - // Total amount of coin used for the limit order - // You can derive makerLimitInCoin using the equation: totalInCoin = swapInCoin + makerLimitInCoin - cosmos.base.v1beta1.Coin total_in_coin = 1 [(gogoproto.moretags) = "yaml:\"total_in_coin\"", (gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.jsontag) = "total_in_coin"]; - + // You can derive makerLimitInCoin using the equation: totalInCoin = + // swapInCoin + makerLimitInCoin + cosmos.base.v1beta1.Coin total_in_coin = 1 [ + (gogoproto.moretags) = "yaml:\"total_in_coin\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "total_in_coin" + ]; + // Total amount of the token in that was immediately swapped for swapOutCoin - cosmos.base.v1beta1.Coin swap_in_coin = 2 [(gogoproto.moretags) = "yaml:\"swap_in_coin\"", (gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.jsontag) = "swap_in_coin"]; - + cosmos.base.v1beta1.Coin swap_in_coin = 2 [ + (gogoproto.moretags) = "yaml:\"swap_in_coin\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "swap_in_coin" + ]; + // Total amount of coin received from the taker portion of the limit order - // This is the amount of coin immediately available in the users account after executing the - // limit order. It does not include any future proceeds from the maker portion which will have withdrawn in the future - cosmos.base.v1beta1.Coin swap_out_coin = 3 [(gogoproto.moretags) = "yaml:\"swap_out_coin\"", (gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.jsontag) = "swap_out_coin"]; + // This is the amount of coin immediately available in the users account after + // executing the limit order. It does not include any future proceeds from the + // maker portion which will have withdrawn in the future + cosmos.base.v1beta1.Coin swap_out_coin = 3 [ + (gogoproto.moretags) = "yaml:\"swap_out_coin\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "swap_out_coin" + ]; } message QueryPoolRequest { - string pair_id = 1; - int64 tick_index = 2; - uint64 fee = 3; + string pair_id = 1; + int64 tick_index = 2; + uint64 fee = 3; } message QueryPoolByIDRequest { @@ -305,7 +345,6 @@ message QueryPoolResponse { Pool pool = 1 [(gogoproto.nullable) = true]; } - message QueryGetPoolMetadataRequest { uint64 id = 1; } @@ -319,9 +358,8 @@ message QueryAllPoolMetadataRequest { } message QueryAllPoolMetadataResponse { - repeated PoolMetadata pool_metadata = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated PoolMetadata pool_metadata = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } // this line is used by starport scaffolding # 3 - diff --git a/proto/neutron/dex/tick_liquidity.proto b/proto/neutron/dex/tick_liquidity.proto index 0fc588102..f5e4c4c07 100644 --- a/proto/neutron/dex/tick_liquidity.proto +++ b/proto/neutron/dex/tick_liquidity.proto @@ -1,17 +1,15 @@ syntax = "proto3"; package neutron.dex; -option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; import "gogoproto/gogo.proto"; import "neutron/dex/limit_order_tranche.proto"; import "neutron/dex/pool_reserves.proto"; +option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; message TickLiquidity { oneof liquidity { PoolReserves pool_reserves = 1; LimitOrderTranche limit_order_tranche = 2; } - } - diff --git a/proto/neutron/dex/trade_pair_id.proto b/proto/neutron/dex/trade_pair_id.proto index 9e839dc2d..54726015e 100644 --- a/proto/neutron/dex/trade_pair_id.proto +++ b/proto/neutron/dex/trade_pair_id.proto @@ -4,6 +4,6 @@ package neutron.dex; option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; message TradePairID { - string maker_denom = 2; - string taker_denom = 3; + string maker_denom = 2; + string taker_denom = 3; } diff --git a/proto/neutron/dex/tx.proto b/proto/neutron/dex/tx.proto index 43ffe14e3..9957f930f 100644 --- a/proto/neutron/dex/tx.proto +++ b/proto/neutron/dex/tx.proto @@ -1,16 +1,17 @@ syntax = "proto3"; package neutron.dex; -// this line is used by starport scaffolding # proto/tx/import - -option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "google/protobuf/timestamp.proto"; import "amino/amino.proto"; -import "neutron/dex/params.proto"; +import "cosmos/base/v1beta1/coin.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "neutron/dex/params.proto"; + +// this line is used by starport scaffolding # proto/tx/import + +option go_package = "github.com/neutron-org/neutron/v2/x/dex/types"; // Msg defines the Msg service. service Msg { @@ -21,11 +22,11 @@ service Msg { rpc CancelLimitOrder(MsgCancelLimitOrder) returns (MsgCancelLimitOrderResponse); rpc MultiHopSwap(MsgMultiHopSwap) returns (MsgMultiHopSwapResponse); rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); -// this line is used by starport scaffolding # proto/tx/rpc + // this line is used by starport scaffolding # proto/tx/rpc } message DepositOptions { - bool disable_autoswap = 1; + bool disable_autoswap = 1; } message MsgDeposit { @@ -33,36 +34,36 @@ message MsgDeposit { string receiver = 2; string token_a = 3; string token_b = 4; - repeated string amounts_a = 5 [ - (gogoproto.moretags) = "yaml:\"amounts_a\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "amounts_a" - ]; - repeated string amounts_b = 6 [ - (gogoproto.moretags) = "yaml:\"amounts_b\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "amounts_b" - ]; + repeated string amounts_a = 5 [ + (gogoproto.moretags) = "yaml:\"amounts_a\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "amounts_a" + ]; + repeated string amounts_b = 6 [ + (gogoproto.moretags) = "yaml:\"amounts_b\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "amounts_b" + ]; repeated int64 tick_indexes_a_to_b = 7; repeated uint64 fees = 8; repeated DepositOptions options = 9; } message MsgDepositResponse { - repeated string reserve0_deposited = 1 [ - (gogoproto.moretags) = "yaml:\"reserve0_deposited\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "reserve0_deposited" - ]; - repeated string reserve1_deposited = 2[ - (gogoproto.moretags) = "yaml:\"reserve1_deposited\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "reserve1_deposited" - ]; + repeated string reserve0_deposited = 1 [ + (gogoproto.moretags) = "yaml:\"reserve0_deposited\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "reserve0_deposited" + ]; + repeated string reserve1_deposited = 2 [ + (gogoproto.moretags) = "yaml:\"reserve1_deposited\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "reserve1_deposited" + ]; } message MsgWithdrawal { @@ -70,21 +71,19 @@ message MsgWithdrawal { string receiver = 2; string token_a = 3; string token_b = 4; - repeated string shares_to_remove = 5 [ - (gogoproto.moretags) = "yaml:\"shares_to_remove\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "shares_to_remove" - ]; + repeated string shares_to_remove = 5 [ + (gogoproto.moretags) = "yaml:\"shares_to_remove\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "shares_to_remove" + ]; repeated int64 tick_indexes_a_to_b = 6; repeated uint64 fees = 7; - } -message MsgWithdrawalResponse { -} +message MsgWithdrawalResponse {} -enum LimitOrderType{ +enum LimitOrderType { GOOD_TIL_CANCELLED = 0; FILL_OR_KILL = 1; IMMEDIATE_OR_CANCEL = 2; @@ -99,44 +98,44 @@ message MsgPlaceLimitOrder { string token_out = 4; int64 tick_index_in_to_out = 5; string amount_in = 7 [ - (gogoproto.moretags) = "yaml:\"amount_in\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "amount_in" + (gogoproto.moretags) = "yaml:\"amount_in\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "amount_in" ]; LimitOrderType order_type = 8; // expirationTime is only valid iff orderType == GOOD_TIL_TIME. google.protobuf.Timestamp expiration_time = 9 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = true - ]; + (gogoproto.stdtime) = true, + (gogoproto.nullable) = true + ]; string max_amount_out = 10 [ - (gogoproto.moretags) = "yaml:\"max_amount_out\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = true, - (gogoproto.jsontag) = "max_amount_out" - ]; + (gogoproto.moretags) = "yaml:\"max_amount_out\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = true, + (gogoproto.jsontag) = "max_amount_out" + ]; } message MsgPlaceLimitOrderResponse { string trancheKey = 1; // Total amount of coin used for the limit order cosmos.base.v1beta1.Coin coin_in = 2 [ - (gogoproto.moretags) = "yaml:\"coin_in\"", - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.jsontag) = "coin_in" - ]; + (gogoproto.moretags) = "yaml:\"coin_in\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "coin_in" + ]; // Total amount of coin received from the taker portion of the limit order - // This is the amount of coin immediately available in the users account after executing the - // limit order. It does not include any future proceeds from the maker portion which will have withdrawn in the future + // This is the amount of coin immediately available in the users account after + // executing the limit order. It does not include any future proceeds from the + // maker portion which will have withdrawn in the future cosmos.base.v1beta1.Coin taker_coin_out = 3 [ - (gogoproto.moretags) = "yaml:\"taker_coin_out\"", - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.jsontag) = "taker_coin_out" - ]; - + (gogoproto.moretags) = "yaml:\"taker_coin_out\"", + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "taker_coin_out" + ]; } message MsgWithdrawFilledLimitOrder { @@ -144,16 +143,14 @@ message MsgWithdrawFilledLimitOrder { string tranche_key = 2; } -message MsgWithdrawFilledLimitOrderResponse { -} +message MsgWithdrawFilledLimitOrderResponse {} message MsgCancelLimitOrder { string creator = 1; string tranche_key = 2; } -message MsgCancelLimitOrderResponse { -} +message MsgCancelLimitOrderResponse {} message MultiHopRoute { repeated string hops = 1; @@ -164,28 +161,28 @@ message MsgMultiHopSwap { string receiver = 2; repeated MultiHopRoute routes = 3; string amount_in = 4 [ - (gogoproto.moretags) = "yaml:\"amount_in\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "amount_in" - ]; + (gogoproto.moretags) = "yaml:\"amount_in\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "amount_in" + ]; string exit_limit_price = 5 [ - (gogoproto.moretags) = "yaml:\"exit_limit_price\"", - (gogoproto.customtype) = "github.com/neutron-org/neutron/v2/utils/math.PrecDec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "exit_limit_price" - ]; - // If pickBestRoute == true then all routes are run and the route with the best price is chosen - // otherwise, the first succesful route is used. + (gogoproto.moretags) = "yaml:\"exit_limit_price\"", + (gogoproto.customtype) = "github.com/neutron-org/neutron/v2/utils/math.PrecDec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "exit_limit_price" + ]; + // If pickBestRoute == true then all routes are run and the route with the + // best price is chosen otherwise, the first succesful route is used. bool pick_best_route = 6; } message MsgMultiHopSwapResponse { cosmos.base.v1beta1.Coin coin_out = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.jsontag) = "coin_out" - ]; + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.jsontag) = "coin_out" + ]; } message MsgUpdateParams { @@ -193,10 +190,12 @@ message MsgUpdateParams { option (cosmos.msg.v1.signer) = "authority"; // Authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // NOTE: All parameters must be supplied. - Params params = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // MsgUpdateParamsResponse defines the response structure for executing a @@ -205,5 +204,4 @@ message MsgUpdateParams { // Since: 0.47 message MsgUpdateParamsResponse {} - // this line is used by starport scaffolding # proto/tx/message diff --git a/proto/neutron/feeburner/genesis.proto b/proto/neutron/feeburner/genesis.proto index 3df5b28f1..5ee52554e 100644 --- a/proto/neutron/feeburner/genesis.proto +++ b/proto/neutron/feeburner/genesis.proto @@ -10,8 +10,7 @@ option go_package = "github.com/neutron-org/neutron/v2/x/feeburner/types"; // GenesisState defines the feeburner module's genesis state. message GenesisState { - Params params = 1 [ (gogoproto.nullable) = false ]; - TotalBurnedNeutronsAmount total_burned_neutrons_amount = 2 - [ (gogoproto.nullable) = false ]; + Params params = 1 [(gogoproto.nullable) = false]; + TotalBurnedNeutronsAmount total_burned_neutrons_amount = 2 [(gogoproto.nullable) = false]; // this line is used by starport scaffolding # genesis/proto/state -} \ No newline at end of file +} diff --git a/proto/neutron/feeburner/query.proto b/proto/neutron/feeburner/query.proto index 2a08c3ea7..5bb6710a9 100644 --- a/proto/neutron/feeburner/query.proto +++ b/proto/neutron/feeburner/query.proto @@ -1,9 +1,9 @@ syntax = "proto3"; package neutron.feeburner; +import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; import "neutron/feeburner/params.proto"; import "neutron/feeburner/total_burned_neutrons_amount.proto"; // this line is used by starport scaffolding # 1 @@ -18,10 +18,8 @@ service Query { } // TotalBurnedNeutronsAmount queries total amount of burned neutron fees. - rpc TotalBurnedNeutronsAmount(QueryTotalBurnedNeutronsAmountRequest) - returns (QueryTotalBurnedNeutronsAmountResponse) { - option (google.api.http).get = - "/neutron/feeburner/total_burned_neutrons_amount"; + rpc TotalBurnedNeutronsAmount(QueryTotalBurnedNeutronsAmountRequest) returns (QueryTotalBurnedNeutronsAmountResponse) { + option (google.api.http).get = "/neutron/feeburner/total_burned_neutrons_amount"; } // this line is used by starport scaffolding # 2 } @@ -32,7 +30,7 @@ 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 ]; + Params params = 1 [(gogoproto.nullable) = false]; } // QueryTotalBurnedNeutronsAmountRequest is request type for the @@ -42,8 +40,7 @@ message QueryTotalBurnedNeutronsAmountRequest {} // QueryTotalBurnedNeutronsAmountResponse is response type for the // Query/QueryTotalBurnedNeutronsAmount method. message QueryTotalBurnedNeutronsAmountResponse { - TotalBurnedNeutronsAmount total_burned_neutrons_amount = 1 - [ (gogoproto.nullable) = false ]; + TotalBurnedNeutronsAmount total_burned_neutrons_amount = 1 [(gogoproto.nullable) = false]; } -// this line is used by starport scaffolding # 3 \ No newline at end of file +// this line is used by starport scaffolding # 3 diff --git a/proto/neutron/feeburner/total_burned_neutrons_amount.proto b/proto/neutron/feeburner/total_burned_neutrons_amount.proto index 77be55c17..666754a14 100644 --- a/proto/neutron/feeburner/total_burned_neutrons_amount.proto +++ b/proto/neutron/feeburner/total_burned_neutrons_amount.proto @@ -8,6 +8,8 @@ option go_package = "github.com/neutron-org/neutron/v2/x/feeburner/types"; // TotalBurnedNeutronsAmount defines total amount of burned neutron fees message TotalBurnedNeutronsAmount { - cosmos.base.v1beta1.Coin coin = 1 - [ (gogoproto.moretags) = "yaml:\"coin\"", (gogoproto.nullable) = false ]; + cosmos.base.v1beta1.Coin coin = 1 [ + (gogoproto.moretags) = "yaml:\"coin\"", + (gogoproto.nullable) = false + ]; } diff --git a/proto/neutron/feeburner/tx.proto b/proto/neutron/feeburner/tx.proto index 915caca56..5ef6bfed8 100644 --- a/proto/neutron/feeburner/tx.proto +++ b/proto/neutron/feeburner/tx.proto @@ -1,12 +1,11 @@ syntax = "proto3"; package neutron.feeburner; -import "neutron/feeburner/params.proto"; -import "gogoproto/gogo.proto"; +import "amino/amino.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - +import "gogoproto/gogo.proto"; +import "neutron/feeburner/params.proto"; // this line is used by starport scaffolding # proto/tx/import @@ -14,25 +13,27 @@ option go_package = "github.com/neutron-org/neutron/v2/x/feeburner/types"; // Msg defines the Msg service. service Msg { - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - // this line is used by starport scaffolding # proto/tx/rpc + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + // this line is used by starport scaffolding # proto/tx/rpc } // MsgUpdateParams is the MsgUpdateParams request type. // // Since: 0.47 message MsgUpdateParams { - option (amino.name) = "feeburner/MsgUpdateParams"; - option (cosmos.msg.v1.signer) = "authority"; - - // Authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - - // params defines the x/feeburner parameters to update. - // - // NOTE: All parameters must be supplied. - feeburner.Params params = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + option (amino.name) = "feeburner/MsgUpdateParams"; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/feeburner parameters to update. + // + // NOTE: All parameters must be supplied. + feeburner.Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // MsgUpdateParamsResponse defines the response structure for executing a @@ -40,4 +41,3 @@ message MsgUpdateParams { // // Since: 0.47 message MsgUpdateParamsResponse {} - diff --git a/proto/neutron/feerefunder/genesis.proto b/proto/neutron/feerefunder/genesis.proto index f4a4e6b44..b9c707e69 100644 --- a/proto/neutron/feerefunder/genesis.proto +++ b/proto/neutron/feerefunder/genesis.proto @@ -2,21 +2,21 @@ syntax = "proto3"; package neutron.feerefunder; import "gogoproto/gogo.proto"; -import "neutron/feerefunder/params.proto"; import "neutron/feerefunder/fee.proto"; +import "neutron/feerefunder/params.proto"; // this line is used by starport scaffolding # genesis/proto/import option go_package = "github.com/neutron-org/neutron/v2/x/feerefunder/types"; // GenesisState defines the fee module's genesis state. message GenesisState { - Params params = 1 [ (gogoproto.nullable) = false ]; - repeated FeeInfo fee_infos = 2 [ (gogoproto.nullable) = false ]; + Params params = 1 [(gogoproto.nullable) = false]; + repeated FeeInfo fee_infos = 2 [(gogoproto.nullable) = false]; // this line is used by starport scaffolding # genesis/proto/state } message FeeInfo { string payer = 1; - PacketID packet_id = 2 [ (gogoproto.nullable) = false ]; - Fee fee = 3 [ (gogoproto.nullable) = false ]; -} \ No newline at end of file + PacketID packet_id = 2 [(gogoproto.nullable) = false]; + Fee fee = 3 [(gogoproto.nullable) = false]; +} diff --git a/proto/neutron/feerefunder/params.proto b/proto/neutron/feerefunder/params.proto index 5707f9d2c..a9ea99695 100644 --- a/proto/neutron/feerefunder/params.proto +++ b/proto/neutron/feerefunder/params.proto @@ -10,5 +10,5 @@ option go_package = "github.com/neutron-org/neutron/v2/x/feerefunder/types"; message Params { option (gogoproto.goproto_stringer) = false; - Fee min_fee = 1 [ (gogoproto.nullable) = false ]; + Fee min_fee = 1 [(gogoproto.nullable) = false]; } diff --git a/proto/neutron/feerefunder/query.proto b/proto/neutron/feerefunder/query.proto index 33d82cf1b..fb6061abe 100644 --- a/proto/neutron/feerefunder/query.proto +++ b/proto/neutron/feerefunder/query.proto @@ -1,11 +1,11 @@ syntax = "proto3"; package neutron.feerefunder; +import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "neutron/feerefunder/params.proto"; import "neutron/feerefunder/genesis.proto"; +import "neutron/feerefunder/params.proto"; // this line is used by starport scaffolding # 1 option go_package = "github.com/neutron-org/neutron/v2/x/feerefunder/types"; @@ -28,7 +28,7 @@ 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 ]; + Params params = 1 [(gogoproto.nullable) = false]; } message FeeInfoRequest { @@ -37,6 +37,8 @@ message FeeInfoRequest { uint64 sequence = 3; } -message FeeInfoResponse { FeeInfo fee_info = 1; } +message FeeInfoResponse { + FeeInfo fee_info = 1; +} -// this line is used by starport scaffolding # 3 \ No newline at end of file +// this line is used by starport scaffolding # 3 diff --git a/proto/neutron/feerefunder/tx.proto b/proto/neutron/feerefunder/tx.proto index f669ccfd1..43825f8bc 100644 --- a/proto/neutron/feerefunder/tx.proto +++ b/proto/neutron/feerefunder/tx.proto @@ -1,12 +1,11 @@ syntax = "proto3"; package neutron.feerefunder; -import "neutron/feerefunder/params.proto"; -import "gogoproto/gogo.proto"; +import "amino/amino.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - +import "gogoproto/gogo.proto"; +import "neutron/feerefunder/params.proto"; // this line is used by starport scaffolding # proto/tx/import @@ -14,25 +13,27 @@ option go_package = "github.com/neutron-org/neutron/v2/x/feerefunder/types"; // Msg defines the Msg service. service Msg { - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - // this line is used by starport scaffolding # proto/tx/rpc + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + // this line is used by starport scaffolding # proto/tx/rpc } // MsgUpdateParams is the MsgUpdateParams request type. // // Since: 0.47 message MsgUpdateParams { - option (amino.name) = "feerefunder/MsgUpdateParams"; - option (cosmos.msg.v1.signer) = "authority"; - - // Authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - - // params defines the x/feerefunder parameters to update. - // - // NOTE: All parameters must be supplied. - feerefunder.Params params = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + option (amino.name) = "feerefunder/MsgUpdateParams"; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/feerefunder parameters to update. + // + // NOTE: All parameters must be supplied. + feerefunder.Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // MsgUpdateParamsResponse defines the response structure for executing a @@ -40,4 +41,3 @@ message MsgUpdateParams { // // Since: 0.47 message MsgUpdateParamsResponse {} - diff --git a/proto/neutron/interchainqueries/genesis.proto b/proto/neutron/interchainqueries/genesis.proto index 4957677eb..987bb2703 100644 --- a/proto/neutron/interchainqueries/genesis.proto +++ b/proto/neutron/interchainqueries/genesis.proto @@ -1,10 +1,10 @@ syntax = "proto3"; package neutron.interchainqueries; -import "gogoproto/gogo.proto"; -import "neutron/interchainqueries/params.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; +import "neutron/interchainqueries/params.proto"; option go_package = "github.com/neutron-org/neutron/v2/x/interchainqueries/types"; @@ -59,6 +59,6 @@ message KVKey { // GenesisState defines the interchainqueries module's genesis state. message GenesisState { - Params params = 1 [ (gogoproto.nullable) = false ]; + Params params = 1 [(gogoproto.nullable) = false]; repeated RegisteredQuery registered_queries = 2; } diff --git a/proto/neutron/interchainqueries/params.proto b/proto/neutron/interchainqueries/params.proto index 6767bf28b..928780e6a 100644 --- a/proto/neutron/interchainqueries/params.proto +++ b/proto/neutron/interchainqueries/params.proto @@ -1,8 +1,8 @@ syntax = "proto3"; package neutron.interchainqueries; -import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; option go_package = "github.com/neutron-org/neutron/v2/x/interchainqueries/types"; diff --git a/proto/neutron/interchainqueries/query.proto b/proto/neutron/interchainqueries/query.proto index 10459c23e..c2d340c07 100644 --- a/proto/neutron/interchainqueries/query.proto +++ b/proto/neutron/interchainqueries/query.proto @@ -1,11 +1,11 @@ syntax = "proto3"; package neutron.interchainqueries; +import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "neutron/interchainqueries/params.proto"; import "neutron/interchainqueries/genesis.proto"; +import "neutron/interchainqueries/params.proto"; import "neutron/interchainqueries/tx.proto"; option go_package = "github.com/neutron-org/neutron/v2/x/interchainqueries/types"; @@ -17,25 +17,19 @@ service Query { option (google.api.http).get = "/neutron/interchainqueries/params"; } - rpc RegisteredQueries(QueryRegisteredQueriesRequest) - returns (QueryRegisteredQueriesResponse) { - option (google.api.http).get = - "/neutron/interchainqueries/registered_queries"; + rpc RegisteredQueries(QueryRegisteredQueriesRequest) returns (QueryRegisteredQueriesResponse) { + option (google.api.http).get = "/neutron/interchainqueries/registered_queries"; } - rpc RegisteredQuery(QueryRegisteredQueryRequest) - returns (QueryRegisteredQueryResponse) { - option (google.api.http).get = - "/neutron/interchainqueries/registered_query"; + rpc RegisteredQuery(QueryRegisteredQueryRequest) returns (QueryRegisteredQueryResponse) { + option (google.api.http).get = "/neutron/interchainqueries/registered_query"; } - rpc QueryResult(QueryRegisteredQueryResultRequest) - returns (QueryRegisteredQueryResultResponse) { + rpc QueryResult(QueryRegisteredQueryResultRequest) returns (QueryRegisteredQueryResultResponse) { option (google.api.http).get = "/neutron/interchainqueries/query_result"; } - rpc LastRemoteHeight(QueryLastRemoteHeight) - returns (QueryLastRemoteHeightResponse) { + rpc LastRemoteHeight(QueryLastRemoteHeight) returns (QueryLastRemoteHeightResponse) { option (google.api.http).get = "/neutron/interchainqueries/remote_height"; } } @@ -46,7 +40,7 @@ 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 ]; + Params params = 1 [(gogoproto.nullable) = false]; } message QueryRegisteredQueriesRequest { @@ -56,20 +50,27 @@ message QueryRegisteredQueriesRequest { } message QueryRegisteredQueriesResponse { - repeated RegisteredQuery registered_queries = 1 - [ (gogoproto.nullable) = false ]; + repeated RegisteredQuery registered_queries = 1 [(gogoproto.nullable) = false]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } -message QueryRegisteredQueryRequest { uint64 query_id = 1; } +message QueryRegisteredQueryRequest { + uint64 query_id = 1; +} -message QueryRegisteredQueryResponse { RegisteredQuery registered_query = 1; } +message QueryRegisteredQueryResponse { + RegisteredQuery registered_query = 1; +} -message QueryRegisteredQueryResultRequest { uint64 query_id = 1; } +message QueryRegisteredQueryResultRequest { + uint64 query_id = 1; +} -message QueryRegisteredQueryResultResponse { QueryResult result = 1; } +message QueryRegisteredQueryResultResponse { + QueryResult result = 1; +} message Transaction { uint64 id = 1; @@ -77,6 +78,10 @@ message Transaction { bytes data = 3; } -message QueryLastRemoteHeight { string connection_id = 1; } +message QueryLastRemoteHeight { + string connection_id = 1; +} -message QueryLastRemoteHeightResponse { uint64 height = 1; } +message QueryLastRemoteHeightResponse { + uint64 height = 1; +} diff --git a/proto/neutron/interchainqueries/tx.proto b/proto/neutron/interchainqueries/tx.proto index 45d57fb65..873ef35f7 100644 --- a/proto/neutron/interchainqueries/tx.proto +++ b/proto/neutron/interchainqueries/tx.proto @@ -1,28 +1,24 @@ syntax = "proto3"; package neutron.interchainqueries; -import "neutron/interchainqueries/params.proto"; -import "tendermint/crypto/proof.proto"; -import "tendermint/abci/types.proto"; -import "google/protobuf/any.proto"; -import "neutron/interchainqueries/genesis.proto"; -import "gogoproto/gogo.proto"; +import "amino/amino.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "neutron/interchainqueries/genesis.proto"; +import "neutron/interchainqueries/params.proto"; +import "tendermint/abci/types.proto"; +import "tendermint/crypto/proof.proto"; option go_package = "github.com/neutron-org/neutron/v2/x/interchainqueries/types"; // Msg defines the Msg service. service Msg { - rpc RegisterInterchainQuery(MsgRegisterInterchainQuery) - returns (MsgRegisterInterchainQueryResponse); - rpc SubmitQueryResult(MsgSubmitQueryResult) - returns (MsgSubmitQueryResultResponse); - rpc RemoveInterchainQuery(MsgRemoveInterchainQueryRequest) - returns (MsgRemoveInterchainQueryResponse); - rpc UpdateInterchainQuery(MsgUpdateInterchainQueryRequest) - returns (MsgUpdateInterchainQueryResponse); + rpc RegisterInterchainQuery(MsgRegisterInterchainQuery) returns (MsgRegisterInterchainQueryResponse); + rpc SubmitQueryResult(MsgSubmitQueryResult) returns (MsgSubmitQueryResultResponse); + rpc RemoveInterchainQuery(MsgRemoveInterchainQueryRequest) returns (MsgRemoveInterchainQueryResponse); + rpc UpdateInterchainQuery(MsgUpdateInterchainQueryRequest) returns (MsgUpdateInterchainQueryResponse); rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } @@ -47,7 +43,9 @@ message MsgRegisterInterchainQuery { string sender = 6; } -message MsgRegisterInterchainQueryResponse { uint64 id = 1; } +message MsgRegisterInterchainQueryResponse { + uint64 id = 1; +} message MsgSubmitQueryResult { uint64 query_id = 1; @@ -134,13 +132,15 @@ message MsgUpdateParams { option (cosmos.msg.v1.signer) = "authority"; // Authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // params defines the x/interchainqueries parameters to update. // // NOTE: All parameters must be supplied. - Params params = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // MsgUpdateParamsResponse defines the response structure for executing a diff --git a/proto/neutron/interchaintxs/v1/genesis.proto b/proto/neutron/interchaintxs/v1/genesis.proto index 9c0ff4b58..16046cf08 100644 --- a/proto/neutron/interchaintxs/v1/genesis.proto +++ b/proto/neutron/interchaintxs/v1/genesis.proto @@ -7,4 +7,6 @@ import "neutron/interchaintxs/v1/params.proto"; option go_package = "github.com/neutron-org/neutron/v2/x/interchaintxs/types"; // GenesisState defines the interchaintxs module's genesis state. -message GenesisState { Params params = 1 [ (gogoproto.nullable) = false ]; } +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/neutron/interchaintxs/v1/params.proto b/proto/neutron/interchaintxs/v1/params.proto index 5d9bc909e..0f688eb2e 100644 --- a/proto/neutron/interchaintxs/v1/params.proto +++ b/proto/neutron/interchaintxs/v1/params.proto @@ -1,8 +1,8 @@ syntax = "proto3"; package neutron.interchaintxs.v1; -import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; option go_package = "github.com/neutron-org/neutron/v2/x/interchaintxs/types"; @@ -12,5 +12,5 @@ message Params { // Defines maximum amount of messages to be passed in MsgSubmitTx uint64 msg_submit_tx_max_messages = 1; // Defines a minimum fee required to register interchain account - repeated cosmos.base.v1beta1.Coin register_fee = 2 [ (gogoproto.nullable) = false ]; + repeated cosmos.base.v1beta1.Coin register_fee = 2 [(gogoproto.nullable) = false]; } diff --git a/proto/neutron/interchaintxs/v1/query.proto b/proto/neutron/interchaintxs/v1/query.proto index c402218d4..401004133 100644 --- a/proto/neutron/interchaintxs/v1/query.proto +++ b/proto/neutron/interchaintxs/v1/query.proto @@ -1,9 +1,9 @@ syntax = "proto3"; package neutron.interchaintxs.v1; +import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; import "neutron/interchaintxs/v1/params.proto"; option go_package = "github.com/neutron-org/neutron/v2/x/interchaintxs/types"; @@ -14,9 +14,10 @@ service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/neutron/interchaintxs/params"; } - rpc InterchainAccountAddress(QueryInterchainAccountAddressRequest) - returns (QueryInterchainAccountAddressResponse) { - option (google.api.http).get = "/neutron/interchaintxs/{owner_address}/{interchain_account_id}/{connection_id}/interchain_account_address"; + rpc InterchainAccountAddress(QueryInterchainAccountAddressRequest) returns (QueryInterchainAccountAddressResponse) { + option (google.api.http).get = + "/neutron/interchaintxs/{owner_address}/{interchain_account_id}/" + "{connection_id}/interchain_account_address"; } } @@ -26,7 +27,7 @@ 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 ]; + Params params = 1 [(gogoproto.nullable) = false]; } message QueryInterchainAccountAddressRequest { diff --git a/proto/neutron/interchaintxs/v1/tx.proto b/proto/neutron/interchaintxs/v1/tx.proto index e1abcb898..480905973 100644 --- a/proto/neutron/interchaintxs/v1/tx.proto +++ b/proto/neutron/interchaintxs/v1/tx.proto @@ -1,24 +1,23 @@ syntax = "proto3"; package neutron.interchaintxs.v1; -option go_package = "github.com/neutron-org/neutron/v2/x/interchaintxs/types"; - -import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; -import "neutron/interchaintxs/v1/params.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -import "google/api/http.proto"; import "google/api/annotations.proto"; +import "google/api/http.proto"; import "google/protobuf/any.proto"; import "neutron/feerefunder/fee.proto"; -import "cosmos/msg/v1/msg.proto"; -import "amino/amino.proto"; +import "neutron/interchaintxs/v1/params.proto"; + +option go_package = "github.com/neutron-org/neutron/v2/x/interchaintxs/types"; // Msg defines the Msg service. service Msg { - rpc RegisterInterchainAccount(MsgRegisterInterchainAccount) - returns (MsgRegisterInterchainAccountResponse) {}; - rpc SubmitTx(MsgSubmitTx) returns (MsgSubmitTxResponse) {}; + rpc RegisterInterchainAccount(MsgRegisterInterchainAccount) returns (MsgRegisterInterchainAccountResponse) {} + rpc SubmitTx(MsgSubmitTx) returns (MsgSubmitTxResponse) {} rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } @@ -28,9 +27,8 @@ message MsgRegisterInterchainAccount { option (gogoproto.goproto_getters) = false; string from_address = 1; - string connection_id = 2 [ (gogoproto.moretags) = "yaml:\"connection_id\"" ]; - string interchain_account_id = 3 - [ (gogoproto.moretags) = "yaml:\"interchain_account_id\"" ]; + string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string interchain_account_id = 3 [(gogoproto.moretags) = "yaml:\"interchain_account_id\""]; repeated cosmos.base.v1beta1.Coin register_fee = 4 [ (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" @@ -58,7 +56,7 @@ message MsgSubmitTx { // timeout in seconds after which the packet times out uint64 timeout = 6; - neutron.feerefunder.Fee fee = 7 [ (gogoproto.nullable) = false ]; + neutron.feerefunder.Fee fee = 7 [(gogoproto.nullable) = false]; } // MsgSubmitTxResponse defines the response for Msg/SubmitTx @@ -77,13 +75,15 @@ message MsgUpdateParams { option (cosmos.msg.v1.signer) = "authority"; // Authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // params defines the x/interchaintxs parameters to update. // // NOTE: All parameters must be supplied. - Params params = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // MsgUpdateParamsResponse defines the response structure for executing a @@ -91,4 +91,3 @@ message MsgUpdateParams { // // Since: 0.47 message MsgUpdateParamsResponse {} - diff --git a/proto/neutron/transfer/v1/query.proto b/proto/neutron/transfer/v1/query.proto index 8ab9fbe4f..02025e85a 100644 --- a/proto/neutron/transfer/v1/query.proto +++ b/proto/neutron/transfer/v1/query.proto @@ -2,34 +2,30 @@ syntax = "proto3"; package neutron.transfer; -option go_package = "github.com/neutron-org/neutron/v2/x/transfer/types"; - -import "ibc/applications/transfer/v1/query.proto"; import "google/api/annotations.proto"; +import "ibc/applications/transfer/v1/query.proto"; + +option go_package = "github.com/neutron-org/neutron/v2/x/transfer/types"; // Query provides defines the gRPC querier service. service Query { // DenomTrace queries a denomination trace information. - rpc DenomTrace(ibc.applications.transfer.v1.QueryDenomTraceRequest) - returns (ibc.applications.transfer.v1.QueryDenomTraceResponse) { + rpc DenomTrace(ibc.applications.transfer.v1.QueryDenomTraceRequest) returns (ibc.applications.transfer.v1.QueryDenomTraceResponse) { option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces/{hash}"; } // DenomTraces queries all denomination traces. - rpc DenomTraces(ibc.applications.transfer.v1.QueryDenomTracesRequest) - returns (ibc.applications.transfer.v1.QueryDenomTracesResponse) { + rpc DenomTraces(ibc.applications.transfer.v1.QueryDenomTracesRequest) returns (ibc.applications.transfer.v1.QueryDenomTracesResponse) { option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces"; } // Params queries all parameters of the ibc-transfer module. - rpc Params(ibc.applications.transfer.v1.QueryParamsRequest) - returns (ibc.applications.transfer.v1.QueryParamsResponse) { + rpc Params(ibc.applications.transfer.v1.QueryParamsRequest) returns (ibc.applications.transfer.v1.QueryParamsResponse) { option (google.api.http).get = "/ibc/apps/transfer/v1/params"; } // DenomHash queries a denomination hash information. - rpc DenomHash(ibc.applications.transfer.v1.QueryDenomHashRequest) - returns (ibc.applications.transfer.v1.QueryDenomHashResponse) { + rpc DenomHash(ibc.applications.transfer.v1.QueryDenomHashRequest) returns (ibc.applications.transfer.v1.QueryDenomHashResponse) { option (google.api.http).get = "/ibc/apps/transfer/v1/denom_hashes/{trace}"; } } diff --git a/proto/neutron/transfer/v1/tx.proto b/proto/neutron/transfer/v1/tx.proto index 1ccbd79c8..98fcdcdc5 100644 --- a/proto/neutron/transfer/v1/tx.proto +++ b/proto/neutron/transfer/v1/tx.proto @@ -2,13 +2,13 @@ syntax = "proto3"; package neutron.transfer; -option go_package = "github.com/neutron-org/neutron/v2/x/transfer/types"; - -import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; import "neutron/feerefunder/fee.proto"; +option go_package = "github.com/neutron-org/neutron/v2/x/transfer/types"; + // Msg defines the ibc/transfer Msg service. service Msg { // Transfer defines a rpc handler method for MsgTransfer. @@ -20,12 +20,11 @@ message MsgTransfer { option (gogoproto.goproto_getters) = false; // the port on which the packet will be sent - string source_port = 1 [ (gogoproto.moretags) = "yaml:\"source_port\"" ]; + string source_port = 1 [(gogoproto.moretags) = "yaml:\"source_port\""]; // the channel by which the packet will be sent - string source_channel = 2 - [ (gogoproto.moretags) = "yaml:\"source_channel\"" ]; + string source_channel = 2 [(gogoproto.moretags) = "yaml:\"source_channel\""]; // the tokens to be transferred - cosmos.base.v1beta1.Coin token = 3 [ (gogoproto.nullable) = false ]; + cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false]; // the sender address string sender = 4; // the recipient address on the destination chain @@ -38,12 +37,11 @@ message MsgTransfer { ]; // Timeout timestamp in absolute nanoseconds since unix epoch. // The timeout is disabled when set to 0. - uint64 timeout_timestamp = 7 - [ (gogoproto.moretags) = "yaml:\"timeout_timestamp\"" ]; + uint64 timeout_timestamp = 7 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; string memo = 8; - neutron.feerefunder.Fee fee = 9 [ (gogoproto.nullable) = false ]; + neutron.feerefunder.Fee fee = 9 [(gogoproto.nullable) = false]; } // MsgTransferResponse is the modified response type for diff --git a/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto b/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto index abf1c18eb..0a674ab71 100644 --- a/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto +++ b/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto @@ -1,8 +1,8 @@ syntax = "proto3"; package osmosis.tokenfactory.v1beta1; -import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; option go_package = "github.com/neutron-org/neutron/v2/x/tokenfactory/types"; @@ -13,5 +13,5 @@ message DenomAuthorityMetadata { option (gogoproto.equal) = true; // Can be empty for no admin, or a valid osmosis address - string Admin = 1 [ (gogoproto.moretags) = "yaml:\"admin\"" ]; + string Admin = 1 [(gogoproto.moretags) = "yaml:\"admin\""]; } diff --git a/proto/osmosis/tokenfactory/v1beta1/genesis.proto b/proto/osmosis/tokenfactory/v1beta1/genesis.proto index 008b2f37f..e2dca2548 100644 --- a/proto/osmosis/tokenfactory/v1beta1/genesis.proto +++ b/proto/osmosis/tokenfactory/v1beta1/genesis.proto @@ -10,7 +10,7 @@ option go_package = "github.com/neutron-org/neutron/v2/x/tokenfactory/types"; // GenesisState defines the tokenfactory module's genesis state. message GenesisState { // params defines the paramaters of the module. - Params params = 1 [ (gogoproto.nullable) = false ]; + Params params = 1 [(gogoproto.nullable) = false]; repeated GenesisDenom factory_denoms = 2 [ (gogoproto.moretags) = "yaml:\"factory_denoms\"", @@ -24,7 +24,7 @@ message GenesisState { message GenesisDenom { option (gogoproto.equal) = true; - string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + string denom = 1 [(gogoproto.moretags) = "yaml:\"denom\""]; DenomAuthorityMetadata authority_metadata = 2 [ (gogoproto.moretags) = "yaml:\"authority_metadata\"", (gogoproto.nullable) = false diff --git a/proto/osmosis/tokenfactory/v1beta1/params.proto b/proto/osmosis/tokenfactory/v1beta1/params.proto index 2c7e381c3..d54a5e5f1 100644 --- a/proto/osmosis/tokenfactory/v1beta1/params.proto +++ b/proto/osmosis/tokenfactory/v1beta1/params.proto @@ -1,32 +1,33 @@ syntax = "proto3"; package osmosis.tokenfactory.v1beta1; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/neutron-org/neutron/v2/x/tokenfactory/types"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; // Params defines the parameters for the tokenfactory module. message Params { - // DenomCreationFee defines the fee to be charged on the creation of a new - // denom. The fee is drawn from the MsgCreateDenom's sender account, and - // transferred to the community pool. - repeated cosmos.base.v1beta1.Coin denom_creation_fee = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"denom_creation_fee\"", - (gogoproto.nullable) = false - ]; + // DenomCreationFee defines the fee to be charged on the creation of a new + // denom. The fee is drawn from the MsgCreateDenom's sender account, and + // transferred to the community pool. + repeated cosmos.base.v1beta1.Coin denom_creation_fee = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"denom_creation_fee\"", + (gogoproto.nullable) = false + ]; - // DenomCreationGasConsume defines the gas cost for creating a new denom. - // This is intended as a spam deterrence mechanism. - // - // See: https://github.com/CosmWasm/token-factory/issues/11 - uint64 denom_creation_gas_consume = 2 [ - (gogoproto.moretags) = "yaml:\"denom_creation_gas_consume\"", - (gogoproto.nullable) = true - ]; + // DenomCreationGasConsume defines the gas cost for creating a new denom. + // This is intended as a spam deterrence mechanism. + // + // See: https://github.com/CosmWasm/token-factory/issues/11 + uint64 denom_creation_gas_consume = 2 [ + (gogoproto.moretags) = "yaml:\"denom_creation_gas_consume\"", + (gogoproto.nullable) = true + ]; - // FeeCollectorAddress is the address where fees collected from denom creation are sent to - string fee_collector_address = 3; + // FeeCollectorAddress is the address where fees collected from denom creation + // are sent to + string fee_collector_address = 3; } diff --git a/proto/osmosis/tokenfactory/v1beta1/query.proto b/proto/osmosis/tokenfactory/v1beta1/query.proto index de597b88c..7a61535d8 100644 --- a/proto/osmosis/tokenfactory/v1beta1/query.proto +++ b/proto/osmosis/tokenfactory/v1beta1/query.proto @@ -18,26 +18,24 @@ service Query { // DenomAuthorityMetadata defines a gRPC query method for fetching // DenomAuthorityMetadata for a particular denom. - rpc DenomAuthorityMetadata(QueryDenomAuthorityMetadataRequest) - returns (QueryDenomAuthorityMetadataResponse) { + rpc DenomAuthorityMetadata(QueryDenomAuthorityMetadataRequest) returns (QueryDenomAuthorityMetadataResponse) { option (google.api.http).get = - "/osmosis/tokenfactory/v1beta1/denoms/factory/{creator}/{subdenom}/authority_metadata"; + "/osmosis/tokenfactory/v1beta1/denoms/factory/{creator}/{subdenom}/" + "authority_metadata"; } // DenomsFromCreator defines a gRPC query method for fetching all // denominations created by a specific admin/creator. - rpc DenomsFromCreator(QueryDenomsFromCreatorRequest) - returns (QueryDenomsFromCreatorResponse) { - option (google.api.http).get = - "/osmosis/tokenfactory/v1beta1/denoms_from_creator/{creator}"; + rpc DenomsFromCreator(QueryDenomsFromCreatorRequest) returns (QueryDenomsFromCreatorResponse) { + option (google.api.http).get = "/osmosis/tokenfactory/v1beta1/denoms_from_creator/{creator}"; } // BeforeSendHookAddress defines a gRPC query method for // getting the address registered for the before send hook. - rpc BeforeSendHookAddress(QueryBeforeSendHookAddressRequest) - returns (QueryBeforeSendHookAddressResponse) { + rpc BeforeSendHookAddress(QueryBeforeSendHookAddressRequest) returns (QueryBeforeSendHookAddressResponse) { option (google.api.http).get = - "/osmosis/tokenfactory/v1beta1/denoms/factory/{creator}/{subdenom}/before_send_hook"; + "/osmosis/tokenfactory/v1beta1/denoms/factory/{creator}/{subdenom}/" + "before_send_hook"; } } @@ -47,14 +45,14 @@ 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 ]; + Params params = 1 [(gogoproto.nullable) = false]; } // QueryDenomAuthorityMetadataRequest defines the request structure for the // DenomAuthorityMetadata gRPC query. message QueryDenomAuthorityMetadataRequest { - string creator = 1 [ (gogoproto.moretags) = "yaml:\"creator\"" ]; - string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ]; + string creator = 1 [(gogoproto.moretags) = "yaml:\"creator\""]; + string subdenom = 2 [(gogoproto.moretags) = "yaml:\"subdenom\""]; } // QueryDenomAuthorityMetadataResponse defines the response structure for the @@ -69,23 +67,22 @@ message QueryDenomAuthorityMetadataResponse { // QueryDenomsFromCreatorRequest defines the request structure for the // DenomsFromCreator gRPC query. message QueryDenomsFromCreatorRequest { - string creator = 1 [ (gogoproto.moretags) = "yaml:\"creator\"" ]; + string creator = 1 [(gogoproto.moretags) = "yaml:\"creator\""]; } // QueryDenomsFromCreatorRequest defines the response structure for the // DenomsFromCreator gRPC query. message QueryDenomsFromCreatorResponse { - repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ]; + repeated string denoms = 1 [(gogoproto.moretags) = "yaml:\"denoms\""]; } message QueryBeforeSendHookAddressRequest { - string creator = 1 [ (gogoproto.moretags) = "yaml:\"creator\"" ]; - string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ]; + string creator = 1 [(gogoproto.moretags) = "yaml:\"creator\""]; + string subdenom = 2 [(gogoproto.moretags) = "yaml:\"subdenom\""]; } // QueryBeforeSendHookAddressResponse defines the response structure for the // DenomBeforeSendHook gRPC query. message QueryBeforeSendHookAddressResponse { - string contract_addr = 1 - [ (gogoproto.moretags) = "yaml:\"contract_addr\"" ]; + string contract_addr = 1 [(gogoproto.moretags) = "yaml:\"contract_addr\""]; } diff --git a/proto/osmosis/tokenfactory/v1beta1/tx.proto b/proto/osmosis/tokenfactory/v1beta1/tx.proto index a4aa9be53..a6d755f82 100644 --- a/proto/osmosis/tokenfactory/v1beta1/tx.proto +++ b/proto/osmosis/tokenfactory/v1beta1/tx.proto @@ -1,27 +1,24 @@ syntax = "proto3"; package osmosis.tokenfactory.v1beta1; -import "osmosis/tokenfactory/v1beta1/params.proto"; -import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "cosmos/bank/v1beta1/bank.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; -import "cosmos/bank/v1beta1/bank.proto"; +import "gogoproto/gogo.proto"; +import "osmosis/tokenfactory/v1beta1/params.proto"; option go_package = "github.com/neutron-org/neutron/v2/x/tokenfactory/types"; - // Msg defines the tokefactory module's gRPC message service. service Msg { rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse); rpc Mint(MsgMint) returns (MsgMintResponse); rpc Burn(MsgBurn) returns (MsgBurnResponse); rpc ChangeAdmin(MsgChangeAdmin) returns (MsgChangeAdminResponse); - rpc SetDenomMetadata(MsgSetDenomMetadata) - returns (MsgSetDenomMetadataResponse); - rpc SetBeforeSendHook(MsgSetBeforeSendHook) - returns (MsgSetBeforeSendHookResponse); + rpc SetDenomMetadata(MsgSetDenomMetadata) returns (MsgSetDenomMetadataResponse); + rpc SetBeforeSendHook(MsgSetBeforeSendHook) returns (MsgSetBeforeSendHookResponse); rpc ForceTransfer(MsgForceTransfer) returns (MsgForceTransferResponse); rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } @@ -38,16 +35,15 @@ service Msg { message MsgCreateDenom { option (amino.name) = "osmosis/tokenfactory/create-denom"; - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string sender = 1 [(gogoproto.moretags) = "yaml:\"sender\""]; // subdenom can be up to 44 "alphanumeric" characters long. - string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ]; + string subdenom = 2 [(gogoproto.moretags) = "yaml:\"subdenom\""]; } // MsgCreateDenomResponse is the return value of MsgCreateDenom // It returns the full string of the newly created denom message MsgCreateDenomResponse { - string new_token_denom = 1 - [ (gogoproto.moretags) = "yaml:\"new_token_denom\"" ]; + string new_token_denom = 1 [(gogoproto.moretags) = "yaml:\"new_token_denom\""]; } // MsgMint is the sdk.Msg type for allowing an admin account to mint @@ -55,13 +51,12 @@ message MsgCreateDenomResponse { message MsgMint { option (amino.name) = "osmosis/tokenfactory/mint"; - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string sender = 1 [(gogoproto.moretags) = "yaml:\"sender\""]; cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; - string mintToAddress = 3 - [ (gogoproto.moretags) = "yaml:\"mint_to_address\"" ]; + string mintToAddress = 3 [(gogoproto.moretags) = "yaml:\"mint_to_address\""]; } message MsgMintResponse {} @@ -71,13 +66,12 @@ message MsgMintResponse {} message MsgBurn { option (amino.name) = "osmosis/tokenfactory/burn"; - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string sender = 1 [(gogoproto.moretags) = "yaml:\"sender\""]; cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; - string burnFromAddress = 3 - [ (gogoproto.moretags) = "yaml:\"burn_from_address\"" ]; + string burnFromAddress = 3 [(gogoproto.moretags) = "yaml:\"burn_from_address\""]; } message MsgBurnResponse {} @@ -87,9 +81,9 @@ message MsgBurnResponse {} message MsgChangeAdmin { option (amino.name) = "osmosis/tokenfactory/change-admin"; - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; - string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; - string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ]; + string sender = 1 [(gogoproto.moretags) = "yaml:\"sender\""]; + string denom = 2 [(gogoproto.moretags) = "yaml:\"denom\""]; + string new_admin = 3 [(gogoproto.moretags) = "yaml:\"new_admin\""]; } // MsgChangeAdminResponse defines the response structure for an executed @@ -101,10 +95,9 @@ message MsgChangeAdminResponse {} message MsgSetBeforeSendHook { option (amino.name) = "osmosis/tokenfactory/set-beforesend-hook"; - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; - string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; - string contract_addr = 3 - [ (gogoproto.moretags) = "yaml:\"contract_addr\"" ]; + string sender = 1 [(gogoproto.moretags) = "yaml:\"sender\""]; + string denom = 2 [(gogoproto.moretags) = "yaml:\"denom\""]; + string contract_addr = 3 [(gogoproto.moretags) = "yaml:\"contract_addr\""]; } // MsgSetBeforeSendHookResponse defines the response structure for an executed @@ -114,7 +107,7 @@ message MsgSetBeforeSendHookResponse {} // MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set // the denom's bank metadata message MsgSetDenomMetadata { - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string sender = 1 [(gogoproto.moretags) = "yaml:\"sender\""]; cosmos.bank.v1beta1.Metadata metadata = 2 [ (gogoproto.moretags) = "yaml:\"metadata\"", (gogoproto.nullable) = false @@ -128,15 +121,13 @@ message MsgSetDenomMetadataResponse {} message MsgForceTransfer { option (amino.name) = "osmosis/tokenfactory/force-transfer"; - string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string sender = 1 [(gogoproto.moretags) = "yaml:\"sender\""]; cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.moretags) = "yaml:\"amount\"", (gogoproto.nullable) = false ]; - string transferFromAddress = 3 - [ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ]; - string transferToAddress = 4 - [ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ]; + string transferFromAddress = 3 [(gogoproto.moretags) = "yaml:\"transfer_from_address\""]; + string transferToAddress = 4 [(gogoproto.moretags) = "yaml:\"transfer_to_address\""]; } message MsgForceTransferResponse {} @@ -149,13 +140,15 @@ message MsgUpdateParams { option (cosmos.msg.v1.signer) = "authority"; // Authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // params defines the x/tokenfactory parameters to update. // // NOTE: All parameters must be supplied. - Params params = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // MsgUpdateParamsResponse defines the response structure for executing a