0g-chain/proto/kava/swap/v1beta1/swap.proto
Nick DeLuca d5dcfe73b2
Refactor Buf Usage (#1399)
* start makefile refactor to smaller units; break out proto-dep updating;
add check-proto-deps target for use in CI in order to determine if
depdencies have diverged

* add proto check workflow

* download go modules before checking proto deps

* clean up -- hide output and add error message for check target

* add error message for check-rsync

* update any type, and ibc-go protos for v3.4.0

* add buf generate files for gogo, docs, and swagger

* update swagger dirs and run with latest swagger gen

* ignore new build directories

* refactor proto makefile logic -- use buf instead of scripts

* remove old protobuf scripts

* run all proto checks on push

* remove moved file

* set default value for protoc machine

* install build deps seperately

* fetch master for buf check breaking

* checkout from https url in CI for buf breaking

* fix rsync file permissions on darwin

* ignore build dirs

* fix issue with apple provided make; clean up build deps; switch to buf
format

* remove clang format file -- using buf format now

* run make proto-format (buf format changes)

* update generated files for proto format changes
2022-11-22 16:22:07 -07:00

70 lines
2.5 KiB
Protocol Buffer

syntax = "proto3";
package kava.swap.v1beta1;
import "cosmos/base/v1beta1/coin.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
option go_package = "github.com/kava-labs/kava/x/swap/types";
// Params defines the parameters for the swap module.
message Params {
option (gogoproto.goproto_stringer) = false; // false here because we define Stringer method in params.go
// allowed_pools defines that pools that are allowed to be created
repeated AllowedPool allowed_pools = 1 [
(gogoproto.castrepeated) = "AllowedPools",
(gogoproto.nullable) = false
];
// swap_fee defines the swap fee for all pools
string swap_fee = 2 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}
// AllowedPool defines a pool that is allowed to be created
message AllowedPool {
option (gogoproto.goproto_stringer) = false; // false here because we define Stringer method in params.go
// token_a represents the a token allowed
string token_a = 1;
// token_b represents the b token allowed
string token_b = 2;
}
// PoolRecord represents the state of a liquidity pool
// and is used to store the state of a denominated pool
message PoolRecord {
// pool_id represents the unique id of the pool
string pool_id = 1 [(gogoproto.customname) = "PoolID"];
// reserves_a is the a token coin reserves
cosmos.base.v1beta1.Coin reserves_a = 2 [(gogoproto.nullable) = false];
// reserves_b is the a token coin reserves
cosmos.base.v1beta1.Coin reserves_b = 3 [(gogoproto.nullable) = false];
// total_shares is the total distrubuted shares of the pool
string total_shares = 4 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
}
// ShareRecord stores the shares owned for a depositor and pool
message ShareRecord {
// depositor represents the owner of the shares
bytes depositor = 1 [
(cosmos_proto.scalar) = "cosmos.AddressBytes",
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"
];
// pool_id represents the pool the shares belong to
string pool_id = 2 [(gogoproto.customname) = "PoolID"];
// shares_owned represents the number of shares owned by depsoitor for the pool_id
string shares_owned = 3 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
}