forked from osmosis-labs/osmosis
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from dymensionxyz/txfees
feat: Add ability to pay tx fees with various tokens
- Loading branch information
Showing
38 changed files
with
5,723 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
syntax = "proto3"; | ||
package osmosis.txfees.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/osmosis-labs/osmosis/v15/x/txfees/types"; | ||
|
||
// FeeToken is a struct that specifies a coin denom, and pool ID pair. | ||
// This marks the token as eligible for use as a tx fee asset in Osmosis. | ||
// Its price in osmo is derived through looking at the provided pool ID. | ||
// The pool ID must have base denom as one of its assets. | ||
message FeeToken { | ||
option (gogoproto.equal) = true; | ||
|
||
string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; | ||
uint64 poolID = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
syntax = "proto3"; | ||
package osmosis.txfees.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "osmosis/txfees/v1beta1/feetoken.proto"; | ||
|
||
|
||
option go_package = "github.com/osmosis-labs/osmosis/v15/x/txfees/types"; | ||
|
||
// GenesisState defines the txfees module's genesis state. | ||
message GenesisState { | ||
// params are all the parameters of the module | ||
Params params = 1 [ (gogoproto.nullable) = false ]; | ||
string basedenom = 2; | ||
repeated FeeToken feetokens = 3 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
|
||
// Params holds parameters for the incentives module | ||
message Params { | ||
// epoch_identifier is what epoch type swap and burn will be triggered by | ||
// (day, week, etc.) | ||
string epoch_identifier = 1 | ||
[ (gogoproto.moretags) = "yaml:\"epoch_identifier\"" ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
syntax = "proto3"; | ||
package osmosis.txfees.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/api/annotations.proto"; | ||
import "google/protobuf/duration.proto"; | ||
|
||
import "osmosis/txfees/v1beta1/feetoken.proto"; | ||
import "osmosis/txfees/v1beta1/genesis.proto"; | ||
|
||
option go_package = "github.com/osmosis-labs/osmosis/v15/x/txfees/types"; | ||
|
||
service Query { | ||
// Params returns params. | ||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { | ||
option (google.api.http).get = "/osmosis/txfees/v1beta1/params"; | ||
} | ||
|
||
|
||
// FeeTokens returns a list of all the accepted fee tokens and their | ||
// corresponding pools. It does not include the BaseDenom, which has its own | ||
// query endpoint | ||
rpc FeeTokens(QueryFeeTokensRequest) returns (QueryFeeTokensResponse) { | ||
option (google.api.http).get = "/osmosis/txfees/v1beta1/fee_tokens"; | ||
} | ||
|
||
// DenomSpotPrice returns all spot prices by each registered token denom. | ||
rpc DenomSpotPrice(QueryDenomSpotPriceRequest) | ||
returns (QueryDenomSpotPriceResponse) { | ||
option (google.api.http).get = | ||
"/osmosis/txfees/v1beta1/spot_price_by_denom"; | ||
} | ||
|
||
// Returns the poolID for a specified denom input. | ||
rpc DenomPoolId(QueryDenomPoolIdRequest) returns (QueryDenomPoolIdResponse) { | ||
option (google.api.http).get = | ||
"/osmosis/txfees/v1beta1/denom_pool_id/{denom}"; | ||
} | ||
|
||
// Returns a list of all base denom tokens and their corresponding pools. | ||
rpc BaseDenom(QueryBaseDenomRequest) returns (QueryBaseDenomResponse) { | ||
option (google.api.http).get = "/osmosis/txfees/v1beta1/base_denom"; | ||
} | ||
} | ||
|
||
|
||
message QueryParamsRequest {} | ||
message QueryParamsResponse { | ||
Params params = 1 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
|
||
message QueryFeeTokensRequest {} | ||
message QueryFeeTokensResponse { | ||
repeated FeeToken fee_tokens = 1 [ | ||
(gogoproto.moretags) = "yaml:\"fee_tokens\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
} | ||
|
||
// QueryDenomSpotPriceRequest defines grpc request structure for querying spot | ||
// price for the specified tx fee denom | ||
message QueryDenomSpotPriceRequest { | ||
string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; | ||
} | ||
|
||
// QueryDenomSpotPriceRequest defines grpc response structure for querying spot | ||
// price for the specified tx fee denom | ||
message QueryDenomSpotPriceResponse { | ||
uint64 poolID = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; | ||
string spot_price = 2 [ | ||
(gogoproto.moretags) = "yaml:\"spot_price\"", | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", | ||
(gogoproto.nullable) = false | ||
]; | ||
} | ||
|
||
message QueryDenomPoolIdRequest { | ||
string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; | ||
} | ||
message QueryDenomPoolIdResponse { | ||
uint64 poolID = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; | ||
} | ||
|
||
message QueryBaseDenomRequest {} | ||
message QueryBaseDenomResponse { | ||
string base_denom = 1 [ (gogoproto.moretags) = "yaml:\"base_denom\"" ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.