-
Notifications
You must be signed in to change notification settings - Fork 609
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Make v2 queries * More WIP * Add twap query v2 * Update twap query in whitelist * Add changelog * v2 query test * Add wasmbinding test (cherry picked from commit 6c4f423) Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
- Loading branch information
1 parent
b33406c
commit 28eaeb6
Showing
17 changed files
with
2,952 additions
and
42 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
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,38 @@ | ||
syntax = "proto3"; | ||
package osmosis.gamm.v2; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "osmosis/gamm/v1beta1/tx.proto"; | ||
|
||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "cosmos/base/query/v1beta1/pagination.proto"; | ||
import "google/api/annotations.proto"; | ||
import "google/protobuf/any.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
|
||
option go_package = "github.com/osmosis-labs/osmosis/v12/x/gamm/v2types"; | ||
|
||
service Query { | ||
// SpotPrice defines a gRPC query handler that returns the spot price given | ||
// a base denomination and a quote denomination. | ||
rpc SpotPrice(QuerySpotPriceRequest) returns (QuerySpotPriceResponse) { | ||
option (google.api.http).get = "/osmosis/gamm/v2/pools/{pool_id}/prices"; | ||
} | ||
} | ||
|
||
// QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice | ||
// query. | ||
message QuerySpotPriceRequest { | ||
uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; | ||
string base_asset_denom = 2 | ||
[ (gogoproto.moretags) = "yaml:\"base_asset_denom\"" ]; | ||
string quote_asset_denom = 3 | ||
[ (gogoproto.moretags) = "yaml:\"quote_asset_denom\"" ]; | ||
} | ||
|
||
// QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice | ||
// query. | ||
message QuerySpotPriceResponse { | ||
// String of the Dec. Ex) 10.203uatom | ||
string spot_price = 1 [ (gogoproto.moretags) = "yaml:\"spot_price\"" ]; | ||
} |
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,66 @@ | ||
syntax = "proto3"; | ||
package osmosis.twap.v2; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "osmosis/twap/v1beta1/twap_record.proto"; | ||
import "osmosis/twap/v1beta1/genesis.proto"; | ||
|
||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "cosmos/base/query/v1beta1/pagination.proto"; | ||
import "google/api/annotations.proto"; | ||
import "google/protobuf/any.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
|
||
option go_package = "github.com/osmosis-labs/osmosis/v12/x/twap/client/v2queryproto"; | ||
|
||
service Query { | ||
rpc ArithmeticTwap(ArithmeticTwapRequest) returns (ArithmeticTwapResponse) { | ||
option (google.api.http).get = "/osmosis/twap/v2/ArithmeticTwap"; | ||
} | ||
rpc ArithmeticTwapToNow(ArithmeticTwapToNowRequest) | ||
returns (ArithmeticTwapToNowResponse) { | ||
option (google.api.http).get = "/osmosis/twap/v2/ArithmeticTwapToNow"; | ||
} | ||
} | ||
|
||
message ArithmeticTwapRequest { | ||
uint64 pool_id = 1; | ||
string base_asset = 2; | ||
string quote_asset = 3; | ||
google.protobuf.Timestamp start_time = 4 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.stdtime) = true, | ||
(gogoproto.moretags) = "yaml:\"start_time\"" | ||
]; | ||
google.protobuf.Timestamp end_time = 5 [ | ||
(gogoproto.nullable) = true, | ||
(gogoproto.stdtime) = true, | ||
(gogoproto.moretags) = "yaml:\"end_time\"" | ||
]; | ||
} | ||
message ArithmeticTwapResponse { | ||
string arithmetic_twap = 1 [ | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", | ||
(gogoproto.moretags) = "yaml:\"arithmetic_twap\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
} | ||
|
||
message ArithmeticTwapToNowRequest { | ||
uint64 pool_id = 1; | ||
string base_asset = 2; | ||
string quote_asset = 3; | ||
google.protobuf.Timestamp start_time = 4 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.stdtime) = true, | ||
(gogoproto.moretags) = "yaml:\"start_time\"" | ||
]; | ||
} | ||
message ArithmeticTwapToNowResponse { | ||
string arithmetic_twap = 1 [ | ||
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", | ||
(gogoproto.moretags) = "yaml:\"arithmetic_twap\"", | ||
(gogoproto.nullable) = false | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.