mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-25 15:55:18 +00:00
ffef832d45
- Upgrade cosmos-sdk to v0.44.5 from v0.39.2 - Add Legacy Tx Endpoint for backwards compatibility - Add IBC v1.2.3 Support Co-authored-by: DracoLi <draco@dracoli.com> Co-authored-by: drklee3 <derrick@dlee.dev> Co-authored-by: denalimarsh <denalimarsh@gmail.com> Co-authored-by: Draco Li <draco@kava.io> Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Denali Marsh <denali@kava.io>
112 lines
4.6 KiB
Protocol Buffer
112 lines
4.6 KiB
Protocol Buffer
syntax = "proto3";
|
|
package kava.swap.v1beta1;
|
|
|
|
import "gogoproto/gogo.proto";
|
|
import "cosmos_proto/cosmos.proto";
|
|
import "cosmos/base/v1beta1/coin.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 {}
|