mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 00:05:18 +00:00
d5dcfe73b2
* 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
115 lines
4.6 KiB
Protocol Buffer
115 lines
4.6 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";
|
|
|
|
// Msg defines the swap Msg service.
|
|
service Msg {
|
|
// Deposit defines a method for depositing liquidity into a pool
|
|
rpc Deposit(MsgDeposit) returns (MsgDepositResponse);
|
|
// Withdraw defines a method for withdrawing liquidity into a pool
|
|
rpc Withdraw(MsgWithdraw) returns (MsgWithdrawResponse);
|
|
// SwapExactForTokens represents a message for trading exact coinA for coinB
|
|
rpc SwapExactForTokens(MsgSwapExactForTokens) returns (MsgSwapExactForTokensResponse);
|
|
// SwapForExactTokens represents a message for trading coinA for an exact coinB
|
|
rpc SwapForExactTokens(MsgSwapForExactTokens) returns (MsgSwapForExactTokensResponse);
|
|
}
|
|
|
|
// MsgDeposit represents a message for depositing liquidity into a pool
|
|
message MsgDeposit {
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
// depositor represents the address to deposit funds from
|
|
string depositor = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
// token_a represents one token of deposit pair
|
|
cosmos.base.v1beta1.Coin token_a = 2 [(gogoproto.nullable) = false];
|
|
// token_b represents one token of deposit pair
|
|
cosmos.base.v1beta1.Coin token_b = 3 [(gogoproto.nullable) = false];
|
|
// slippage represents the max decimal percentage price change
|
|
string slippage = 4 [
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
// deadline represents the unix timestamp to complete the deposit by
|
|
int64 deadline = 5;
|
|
}
|
|
|
|
// MsgDepositResponse defines the Msg/Deposit response type.
|
|
message MsgDepositResponse {}
|
|
|
|
// MsgWithdraw represents a message for withdrawing liquidity from a pool
|
|
message MsgWithdraw {
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
// from represents the address we are withdrawing for
|
|
string from = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
// shares represents the amount of shares to withdraw
|
|
string shares = 2 [
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
// min_token_a represents the minimum a token to withdraw
|
|
cosmos.base.v1beta1.Coin min_token_a = 3 [(gogoproto.nullable) = false];
|
|
// min_token_a represents the minimum a token to withdraw
|
|
cosmos.base.v1beta1.Coin min_token_b = 4 [(gogoproto.nullable) = false];
|
|
// deadline represents the unix timestamp to complete the withdraw by
|
|
int64 deadline = 5;
|
|
}
|
|
|
|
// MsgWithdrawResponse defines the Msg/Withdraw response type.
|
|
message MsgWithdrawResponse {}
|
|
|
|
// MsgSwapExactForTokens represents a message for trading exact coinA for coinB
|
|
message MsgSwapExactForTokens {
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
// represents the address swaping the tokens
|
|
string requester = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
// exact_token_a represents the exact amount to swap for token_b
|
|
cosmos.base.v1beta1.Coin exact_token_a = 2 [(gogoproto.nullable) = false];
|
|
// token_b represents the desired token_b to swap for
|
|
cosmos.base.v1beta1.Coin token_b = 3 [(gogoproto.nullable) = false];
|
|
// slippage represents the maximum change in token_b allowed
|
|
string slippage = 4 [
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
// deadline represents the unix timestamp to complete the swap by
|
|
int64 deadline = 5;
|
|
}
|
|
|
|
// MsgSwapExactForTokensResponse defines the Msg/SwapExactForTokens response
|
|
// type.
|
|
message MsgSwapExactForTokensResponse {}
|
|
|
|
// MsgSwapForExactTokens represents a message for trading coinA for an exact
|
|
// coinB
|
|
message MsgSwapForExactTokens {
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
// represents the address swaping the tokens
|
|
string requester = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
|
// token_a represents the desired token_a to swap for
|
|
cosmos.base.v1beta1.Coin token_a = 2 [(gogoproto.nullable) = false];
|
|
// exact_token_b represents the exact token b amount to swap for token a
|
|
cosmos.base.v1beta1.Coin exact_token_b = 3 [(gogoproto.nullable) = false];
|
|
// slippage represents the maximum change in token_a allowed
|
|
string slippage = 4 [
|
|
(cosmos_proto.scalar) = "cosmos.Dec",
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
(gogoproto.nullable) = false
|
|
];
|
|
// deadline represents the unix timestamp to complete the swap by
|
|
int64 deadline = 5;
|
|
}
|
|
|
|
// MsgSwapForExactTokensResponse defines the Msg/SwapForExactTokensResponse
|
|
// response type.
|
|
message MsgSwapForExactTokensResponse {}
|