Skip to content

Commit

Permalink
Update proto files to match 3.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
besated committed Jun 27, 2023
1 parent 37818b2 commit b04e9f3
Show file tree
Hide file tree
Showing 77 changed files with 2,302 additions and 3,597 deletions.
5 changes: 5 additions & 0 deletions packages/proto/proto/seiprotocol/seichain/dex/contract.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ message ContractInfoV2 {
int64 numIncomingDependencies = 6;
string creator = 7;
uint64 rentBalance = 8;
bool suspended = 9;
string suspensionReason = 10;
}

// suppose A is first registered and depends on X, then B is added and depends on X,
// and then C is added and depends on X, then A is the elder sibling to B and B is
// the younger sibling to A, and B is the elder sibling to C and C is the younger to B
message ContractDependencyInfo {
string dependency = 1;
string immediateElderSibling = 2;
Expand Down
1 change: 0 additions & 1 deletion packages/proto/proto/seiprotocol/seichain/dex/enums.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ enum PositionEffect {
enum OrderType {
LIMIT = 0;
MARKET = 1;
LIQUIDATION = 2;
FOKMARKET = 3; // fill-or-kill market order
FOKMARKETBYVALUE = 4; // fill-or-kill market by value order
STOPLOSS = 5;
Expand Down
3 changes: 1 addition & 2 deletions packages/proto/proto/seiprotocol/seichain/dex/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import "gogoproto/gogo.proto";
import "seiprotocol/seichain/dex/params.proto";
import "seiprotocol/seichain/dex/long_book.proto";
import "seiprotocol/seichain/dex/short_book.proto";
import "seiprotocol/seichain/dex/tick_size.proto";
import "seiprotocol/seichain/dex/order.proto";
import "seiprotocol/seichain/dex/contract.proto";
import "seiprotocol/seichain/dex/pair.proto";
import "seiprotocol/seichain/dex/match_result.proto";
import "seiprotocol/seichain/dex/price.proto";
// this line is used by starport scaffolding # genesis/proto/import

Expand All @@ -30,6 +28,7 @@ message ContractState {
repeated Order triggeredOrdersList = 4 [(gogoproto.nullable) = false];
repeated Pair pairList = 5 [(gogoproto.nullable) = false];
repeated ContractPairPrices priceList = 6 [(gogoproto.nullable) = false];
uint64 nextOrderId = 7;
}

message ContractPairPrices {
Expand Down
8 changes: 4 additions & 4 deletions packages/proto/proto/seiprotocol/seichain/dex/long_book.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";
package seiprotocol.seichain.dex;

option go_package = "github.com/sei-protocol/sei-chain/x/dex/types";
import "seiprotocol/seichain/dex/order_entry.proto";
import "seiprotocol/seichain/dex/order_entry.proto";
import "gogoproto/gogo.proto";

message LongBook {
Expand All @@ -14,6 +14,6 @@ message LongBook {
];
OrderEntry entry = 2 [
(gogoproto.jsontag) = "entry"
];
}
];

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto3";
package seiprotocol.seichain.dex;

option go_package = "github.com/sei-protocol/sei-chain/x/dex/types";
import "seiprotocol/seichain/dex/order.proto";
import "seiprotocol/seichain/dex/settlement.proto";
import "seiprotocol/seichain/dex/order.proto";
import "seiprotocol/seichain/dex/settlement.proto";
import "gogoproto/gogo.proto";

message MatchResult {
Expand All @@ -12,4 +12,4 @@ message MatchResult {
repeated Order orders = 3 [(gogoproto.jsontag) = "orders"];
repeated SettlementEntry settlements = 4 [(gogoproto.jsontag) = "settlements"];
repeated Cancellation cancellations = 5 [(gogoproto.jsontag) = "cancellations"];
}
}
32 changes: 32 additions & 0 deletions packages/proto/proto/seiprotocol/seichain/dex/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,36 @@ message Params {
(gogoproto.jsontag) = "default_gas_per_cancel",
(gogoproto.moretags) = "yaml:\"default_gas_per_cancel\""
];
uint64 min_rent_deposit = 7 [
(gogoproto.jsontag) = "min_rent_deposit",
(gogoproto.moretags) = "yaml:\"min_rent_deposit\""
];
uint64 gas_allowance_per_settlement = 8 [
(gogoproto.jsontag) = "gas_allowance_per_settlement",
(gogoproto.moretags) = "yaml:\"gas_allowance_per_settlement\""
];
uint64 min_processable_rent = 9 [
(gogoproto.jsontag) = "min_processable_rent",
(gogoproto.moretags) = "yaml:\"min_processable_rent\""
];
uint64 order_book_entries_per_load = 10 [
(gogoproto.jsontag) = "order_book_entries_per_load",
(gogoproto.moretags) = "yaml:\"order_book_entries_per_load\""
];
uint64 contract_unsuspend_cost = 11 [
(gogoproto.jsontag) = "contract_unsuspend_cost",
(gogoproto.moretags) = "yaml:\"contract_unsuspend_cost\""
];
uint64 max_order_per_price = 12 [
(gogoproto.jsontag) = "max_order_per_price",
(gogoproto.moretags) = "yaml:\"max_order_per_price\""
];
uint64 max_pairs_per_contract = 13 [
(gogoproto.jsontag) = "max_pairs_per_contract",
(gogoproto.moretags) = "yaml:\"max_pairs_per_contract\""
];
uint64 default_gas_per_order_data_byte = 14 [
(gogoproto.jsontag) = "default_gas_per_order_data_byte",
(gogoproto.moretags) = "yaml:\"default_gas_per_order_data_byte\""
];
}
2 changes: 1 addition & 1 deletion packages/proto/proto/seiprotocol/seichain/dex/price.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "seiprotocol/seichain/dex/pair.proto";
option go_package = "github.com/sei-protocol/sei-chain/x/dex/types";

message Price {

uint64 snapshotTimestampInSeconds = 1 [
(gogoproto.jsontag) = "snapshot_timestamp_in_seconds"
];
Expand Down
48 changes: 45 additions & 3 deletions packages/proto/proto/seiprotocol/seichain/dex/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import "cosmos/base/query/v1beta1/pagination.proto";
import "seiprotocol/seichain/dex/params.proto";
import "seiprotocol/seichain/dex/long_book.proto";
import "seiprotocol/seichain/dex/short_book.proto";
import "seiprotocol/seichain/dex/settlement.proto";
import "seiprotocol/seichain/dex/enums.proto";
import "seiprotocol/seichain/dex/price.proto";
import "seiprotocol/seichain/dex/contract.proto";
import "seiprotocol/seichain/dex/twap.proto";
import "seiprotocol/seichain/dex/asset_list.proto";
import "seiprotocol/seichain/dex/pair.proto";
import "seiprotocol/seichain/dex/order.proto";
import "seiprotocol/seichain/dex/match_result.proto";
import "seiprotocol/seichain/dex/enums.proto";
// this line is used by starport scaffolding # 1

option go_package = "github.com/sei-protocol/sei-chain/x/dex/types";
Expand Down Expand Up @@ -76,6 +76,11 @@ service Query {
option (google.api.http).get = "/sei-protocol/seichain/dex/registered_pairs";
}

// Returns registered contract information
rpc GetRegisteredContract(QueryRegisteredContractRequest) returns (QueryRegisteredContractResponse) {
option (google.api.http).get = "/sei-protocol/seichain/dex/registered_contract/{contractAddr}";
}

rpc GetOrders(QueryGetOrdersRequest) returns (QueryGetOrdersResponse) {
option (google.api.http).get = "/sei-protocol/seichain/dex/get_orders/{contractAddr}/{account}";
}
Expand All @@ -91,11 +96,13 @@ service Query {
rpc GetMarketSummary(QueryGetMarketSummaryRequest) returns (QueryGetMarketSummaryResponse) {
option (google.api.http).get = "/sei-protocol/seichain/dex/get_market_summary/{contractAddr}/{priceDenom}/{assetDenom}/{lookbackInSeconds}";
}

rpc GetOrderSimulation(QueryOrderSimulationRequest) returns (QueryOrderSimulationResponse) {}

rpc GetMatchResult(QueryGetMatchResultRequest) returns (QueryGetMatchResultResponse) {}

rpc GetOrderCount(QueryGetOrderCountRequest) returns (QueryGetOrderCountResponse) {}

// this line is used by starport scaffolding # 2
}

Expand Down Expand Up @@ -231,6 +238,16 @@ message QueryRegisteredPairsResponse {
repeated Pair pairs = 1 [(gogoproto.nullable) = false];
}

message QueryRegisteredContractRequest {
string contractAddr = 1 [
(gogoproto.jsontag) = "contract_address"
];
}

message QueryRegisteredContractResponse {
ContractInfoV2 contract_info = 1;
}

message QueryGetOrdersRequest{
string contractAddr = 1 [
(gogoproto.jsontag) = "contract_address"
Expand Down Expand Up @@ -356,4 +373,29 @@ message QueryGetMatchResultResponse {
(gogoproto.jsontag) = "result"
];
}

message QueryGetOrderCountRequest {
string contractAddr = 1 [
(gogoproto.jsontag) = "contract_address"
];
string priceDenom = 2 [
(gogoproto.jsontag) = "price_denom"
];
string assetDenom = 3 [
(gogoproto.jsontag) = "asset_denom"
];
string price = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.jsontag) = "price"
];
PositionDirection positionDirection = 5 [
(gogoproto.jsontag) = "position_direction"
];
}

message QueryGetOrderCountResponse {
uint64 count = 1 [
(gogoproto.jsontag) = "count"
];
}
// this line is used by starport scaffolding # 3
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";
package seiprotocol.seichain.dex;

option go_package = "github.com/sei-protocol/sei-chain/x/dex/types";
import "seiprotocol/seichain/dex/order_entry.proto";
import "seiprotocol/seichain/dex/order_entry.proto";
import "gogoproto/gogo.proto";

message ShortBook {
Expand All @@ -14,6 +14,6 @@ message ShortBook {
];
OrderEntry entry = 2 [
(gogoproto.jsontag) = "entry"
];
}
];

}
4 changes: 2 additions & 2 deletions packages/proto/proto/seiprotocol/seichain/dex/tick_size.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";
package seiprotocol.seichain.dex;

option go_package = "github.com/sei-protocol/sei-chain/x/dex/types";
import "seiprotocol/seichain/dex/pair.proto";
import "seiprotocol/seichain/dex/pair.proto";
import "gogoproto/gogo.proto";

message TickSize {
Expand All @@ -19,4 +19,4 @@ message TickSize {
(gogoproto.moretags) = "yaml:\"tick_size\"",
(gogoproto.jsontag) = "contract_addr"
];
}
}
14 changes: 13 additions & 1 deletion packages/proto/proto/seiprotocol/seichain/dex/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ service Msg {
rpc RegisterPairs(MsgRegisterPairs) returns(MsgRegisterPairsResponse);
rpc UpdatePriceTickSize(MsgUpdatePriceTickSize) returns(MsgUpdateTickSizeResponse);
rpc UpdateQuantityTickSize(MsgUpdateQuantityTickSize) returns(MsgUpdateTickSizeResponse);
rpc UnsuspendContract(MsgUnsuspendContract) returns(MsgUnsuspendContractResponse);
// privileged endpoints below

// this line is used by starport scaffolding # proto/tx/rpc
Expand Down Expand Up @@ -132,4 +133,15 @@ message MsgUpdateQuantityTickSize {

message MsgUpdateTickSizeResponse {}

// this line is used by starport scaffolding # proto/tx/message
message MsgUnsuspendContract {
string creator = 1 [
(gogoproto.jsontag) = "creator"
];
string contractAddr = 2 [
(gogoproto.jsontag) = "contract_address"
];
}

message MsgUnsuspendContractResponse {}

// this line is used by starport scaffolding # proto/tx/message
19 changes: 19 additions & 0 deletions packages/proto/proto/seiprotocol/seichain/mint/v1beta1/gov.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";
package seiprotocol.seichain.mint;

import "gogoproto/gogo.proto";
import "seiprotocol/seichain/mint/v1beta1/mint.proto";

option go_package = "github.com/sei-protocol/sei-chain/x/mint/types";

// AddAssetMetadataProposal is a gov Content type for adding a new asset
// to the dex module's asset list.
message UpdateMinterProposal {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ];
string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ];
mint.Minter minter = 3 [ (gogoproto.moretags) = "yaml:\"minter\"" ];
}
41 changes: 37 additions & 4 deletions packages/proto/proto/seiprotocol/seichain/mint/v1beta1/mint.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,40 @@ import "gogoproto/gogo.proto";

// Minter represents the most recent
message Minter {
string start_date = 1; // yyyy-mm-dd
string end_date = 2; // yyyy-mm-dd
string denom = 3;
uint64 total_mint_amount = 4;
uint64 remaining_mint_amount = 5;
uint64 last_mint_amount = 6;
string last_mint_date = 7;
uint64 last_mint_height = 8; // yyyy-mm-dd
}

message ScheduledTokenRelease {
string start_date = 1; // yyyy-mm-dd
string end_date = 2; // yyyy-mm-dd
uint64 token_release_amount = 3;
}

// Params holds parameters for the mint module.
message Params {
option (gogoproto.goproto_stringer) = false;

// type of coin to mint
string mint_denom = 1;
// List of token release schedules
repeated ScheduledTokenRelease token_release_schedule = 2 [
(gogoproto.moretags) = "yaml:\"token_release_schedule\"",
(gogoproto.nullable) = false
];
}


// Legacy Protobufs used for migration purposes

// Minter represents the most recent
message Version2Minter {
string last_mint_amount = 1 [
(gogoproto.moretags) = "yaml:\"last_mint_amount\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
Expand All @@ -23,21 +57,20 @@ message Minter {
];
}

message ScheduledTokenRelease {
message Version2ScheduledTokenRelease {
string date = 1; // yyyy-mm-dd
int64 token_release_amount = 2;
}

// Params holds parameters for the mint module.
message Params {
message Version2Params {
option (gogoproto.goproto_stringer) = false;

// type of coin to mint
string mint_denom = 1;
// List of token release schedules
repeated ScheduledTokenRelease token_release_schedule = 2 [
repeated Version2ScheduledTokenRelease token_release_schedule = 2 [
(gogoproto.moretags) = "yaml:\"token_release_schedule\"",
(gogoproto.nullable) = false
];
}

22 changes: 8 additions & 14 deletions packages/proto/proto/seiprotocol/seichain/mint/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,12 @@ message QueryMinterRequest {}
// QueryMinterResponse is the response type for the
// Query/Minter RPC method.
message QueryMinterResponse {
string last_mint_amount = 1 [
(gogoproto.moretags) = "yaml:\"last_mint_amount\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
string last_mint_date = 2 [
(gogoproto.moretags) = "yaml:\"last_mint_date\""
];
int64 last_mint_height = 3 [
(gogoproto.moretags) = "yaml:\"last_mint_height\""
];
string denom = 4 [
(gogoproto.moretags) = "yaml:\"denom\""
];
string start_date = 1 [(gogoproto.moretags) = "yaml:\"start_date\""];
string end_date = 2 [(gogoproto.moretags) = "yaml:\"end_date\""];
string denom = 3 [(gogoproto.moretags) = "yaml:\"denom\""];
uint64 total_mint_amount = 4 [(gogoproto.moretags) = "yaml:\"total_mint_amount\""];
uint64 remaining_mint_amount = 5 [(gogoproto.moretags) = "yaml:\"remaining_mint_amount\""];
uint64 last_mint_amount = 6 [(gogoproto.moretags) = "yaml:\"last_mint_amount\""];
string last_mint_date = 7 [(gogoproto.moretags) = "yaml:\"last_mint_date\""];
uint64 last_mint_height = 8 [(gogoproto.moretags) = "yaml:\"last_mint_height\""];
}
Loading

0 comments on commit b04e9f3

Please sign in to comment.