types

package
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 36 Imported by: 2

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	AttributeValueCategory     = ModuleName
	EventTypeSwapDeposit       = "swap_deposit"
	EventTypeSwapWithdraw      = "swap_withdraw"
	EventTypeSwapTrade         = "swap_trade"
	AttributeKeyPoolID         = "pool_id"
	AttributeKeyDepositor      = "depositor"
	AttributeKeyShares         = "shares"
	AttributeKeyOwner          = "owner"
	AttributeKeyRequester      = "requester"
	AttributeKeySwapInput      = "input"
	AttributeKeySwapOutput     = "output"
	AttributeKeyFeePaid        = "fee"
	AttributeKeyExactDirection = "exact"
)

Event types for swap module

View Source
const (
	// ModuleName name that will be used throughout the module
	ModuleName = "swap"

	// ModuleAccountName name of module account used to hold liquidity
	ModuleAccountName = "swap"

	// StoreKey Top level store key where all module items will be stored
	StoreKey = ModuleName

	// RouterKey Top level router key
	RouterKey = ModuleName

	// DefaultParamspace default name for parameter store
	DefaultParamspace = ModuleName
)
View Source
const (
	// TypeMsgDeposit represents the type string for MsgDeposit
	TypeMsgDeposit = "swap_deposit"
	// TypeMsgWithdraw represents the type string for MsgWithdraw
	TypeMsgWithdraw = "swap_withdraw"
	// TypeSwapExactForTokens represents the type string for MsgSwapExactForTokens
	TypeSwapExactForTokens = "swap_exact_for_tokens"
	// TypeSwapForExactTokens represents the type string for MsgSwapForExactTokens
	TypeSwapForExactTokens = "swap_for_exact_tokens"
)
View Source
const PoolIDSep = ":"

PoolIDSep represents the separator used in pool ids to separate two denominations

Variables

View Source
var (
	ErrNotAllowed            = errorsmod.Register(ModuleName, 2, "not allowed")
	ErrInvalidDeadline       = errorsmod.Register(ModuleName, 3, "invalid deadline")
	ErrDeadlineExceeded      = errorsmod.Register(ModuleName, 4, "deadline exceeded")
	ErrSlippageExceeded      = errorsmod.Register(ModuleName, 5, "slippage exceeded")
	ErrInvalidPool           = errorsmod.Register(ModuleName, 6, "invalid pool")
	ErrInvalidSlippage       = errorsmod.Register(ModuleName, 7, "invalid slippage")
	ErrInsufficientLiquidity = errorsmod.Register(ModuleName, 8, "insufficient liquidity")
	ErrInvalidShares         = errorsmod.Register(ModuleName, 9, "invalid shares")
	ErrDepositNotFound       = errorsmod.Register(ModuleName, 10, "deposit not found")
	ErrInvalidCoin           = errorsmod.Register(ModuleName, 11, "invalid coin")
	ErrNotImplemented        = errorsmod.Register(ModuleName, 12, "not implemented")
)

swap module errors

View Source
var (
	// DefaultPoolRecords is used to set default records in default genesis state
	DefaultPoolRecords = PoolRecords{}
	// DefaultShareRecords is used to set default records in default genesis state
	DefaultShareRecords = ShareRecords{}
)
View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	PoolKeyPrefix             = []byte{0x01}
	DepositorPoolSharesPrefix = []byte{0x02}
)

key prefixes for store

View Source
var (
	KeyAllowedPools     = []byte("AllowedPools")
	KeySwapFee          = []byte("SwapFee")
	DefaultAllowedPools = AllowedPools{}
	DefaultSwapFee      = sdk.ZeroDec()
	MaxSwapFee          = sdk.OneDec()
)

Parameter keys and default values

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthSwap        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSwap          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSwap = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (

	// ModuleCdc represents the legacy amino codec for the module
	ModuleCdc = codec.NewAminoCodec(amino)
)

Functions

func DepositorPoolSharesKey

func DepositorPoolSharesKey(depositor sdk.AccAddress, poolID string) []byte

DepositorPoolSharesKey returns a key from a depositor and poolID

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable for swap module.

func PoolID

func PoolID(denomA string, denomB string) string

PoolID returns an alphabetically sorted pool name from two denoms. The name is commutative for any all pairs A,B: f(A,B) == f(B,A).

func PoolIDFromCoins

func PoolIDFromCoins(coins sdk.Coins) string

PoolIDFromCoins returns a poolID from a coins object

func PoolKey

func PoolKey(poolID string) []byte

PoolKey returns a key generated from a poolID

func RegisterInterfaces added in v0.16.0

func RegisterInterfaces(registry types.InterfaceRegistry)

RegisterInterfaces registers proto messages under their interfaces for unmarshalling, in addition to registerting the msg service for handling tx msgs

func RegisterLegacyAminoCodec added in v0.16.0

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers all the necessary types and interfaces for the governance module.

func RegisterMsgServer added in v0.16.0

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler added in v0.16.0

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient added in v0.16.0

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint added in v0.16.0

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer added in v0.16.0

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer added in v0.16.0

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
	SetModuleAccount(sdk.Context, types.ModuleAccountI)

	// moved in from supply
	GetModuleAddress(name string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, name string) types.ModuleAccountI
}

AccountKeeper defines the expected account keeper (noalias)

type AllowedPool

type AllowedPool struct {
	// token_a represents the a token allowed
	TokenA string `protobuf:"bytes,1,opt,name=token_a,json=tokenA,proto3" json:"token_a,omitempty"`
	// token_b represents the b token allowed
	TokenB string `protobuf:"bytes,2,opt,name=token_b,json=tokenB,proto3" json:"token_b,omitempty"`
}

AllowedPool defines a pool that is allowed to be created

func NewAllowedPool

func NewAllowedPool(tokenA, tokenB string) AllowedPool

NewAllowedPool returns a new AllowedPool object

func (*AllowedPool) Descriptor added in v0.16.0

func (*AllowedPool) Descriptor() ([]byte, []int)

func (*AllowedPool) GetTokenA added in v0.16.0

func (m *AllowedPool) GetTokenA() string

func (*AllowedPool) GetTokenB added in v0.16.0

func (m *AllowedPool) GetTokenB() string

func (*AllowedPool) Marshal added in v0.16.0

func (m *AllowedPool) Marshal() (dAtA []byte, err error)

func (*AllowedPool) MarshalTo added in v0.16.0

func (m *AllowedPool) MarshalTo(dAtA []byte) (int, error)

func (*AllowedPool) MarshalToSizedBuffer added in v0.16.0

func (m *AllowedPool) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (AllowedPool) Name

func (p AllowedPool) Name() string

Name returns the name for the allowed pool

func (*AllowedPool) ProtoMessage added in v0.16.0

func (*AllowedPool) ProtoMessage()

func (*AllowedPool) Reset added in v0.16.0

func (m *AllowedPool) Reset()

func (*AllowedPool) Size added in v0.16.0

func (m *AllowedPool) Size() (n int)

func (AllowedPool) String

func (p AllowedPool) String() string

String pretty prints the allowedPool

func (*AllowedPool) Unmarshal added in v0.16.0

func (m *AllowedPool) Unmarshal(dAtA []byte) error

func (AllowedPool) Validate

func (p AllowedPool) Validate() error

Validate validates allowedPool attributes and returns an error if invalid

func (*AllowedPool) XXX_DiscardUnknown added in v0.16.0

func (m *AllowedPool) XXX_DiscardUnknown()

func (*AllowedPool) XXX_Marshal added in v0.16.0

func (m *AllowedPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AllowedPool) XXX_Merge added in v0.16.0

func (m *AllowedPool) XXX_Merge(src proto.Message)

func (*AllowedPool) XXX_Size added in v0.16.0

func (m *AllowedPool) XXX_Size() int

func (*AllowedPool) XXX_Unmarshal added in v0.16.0

func (m *AllowedPool) XXX_Unmarshal(b []byte) error

type AllowedPools

type AllowedPools []AllowedPool

AllowedPools is a slice of AllowedPool

func NewAllowedPools

func NewAllowedPools(allowedPools ...AllowedPool) AllowedPools

NewAllowedPools returns AllowedPools from the provided values

func (AllowedPools) Validate

func (p AllowedPools) Validate() error

Validate validates each allowedPool and returns an error if there are any duplicates

type BankKeeper added in v0.16.0

type BankKeeper interface {
	GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins

	SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
}

BankKeeper defines the expected interface needed to retrieve account balances.

type BasePool

type BasePool struct {
	// contains filtered or unexported fields
}

BasePool implements a unitless constant-product liquidity pool.

The pool is symmetric. For all A,B,s, any operation F on a pool (A,B,s) and pool (B,A,s) will result in equal state values of A', B', s': F(A,B,s) => (A',B',s'), F(B,A,s) => (B',A',s')

In addition, the pool is protected from overflow in intermediate calculations, and will only overflow when A, B, or s become larger than the max sdkmath.Int.

Pool operations with non-positive values are invalid, and all functions on a pool will panic when given zero or negative values.

func NewBasePool

func NewBasePool(reservesA, reservesB sdkmath.Int) (*BasePool, error)

NewBasePool returns a pointer to a base pool with reserves and total shares initialized

func NewBasePoolWithExistingShares

func NewBasePoolWithExistingShares(reservesA, reservesB, totalShares sdkmath.Int) (*BasePool, error)

NewBasePoolWithExistingShares returns a pointer to a base pool with existing shares

func (*BasePool) AddLiquidity

func (p *BasePool) AddLiquidity(desiredA sdkmath.Int, desiredB sdkmath.Int) (sdkmath.Int, sdkmath.Int, sdkmath.Int)

AddLiquidity adds liquidity to the pool returns the actual reservesA, reservesB deposits in addition to the number of shares created. The deposits are always less than or equal to the provided and desired values.

func (*BasePool) IsEmpty

func (p *BasePool) IsEmpty() bool

IsEmpty returns true if all reserves are zero and returns false if reserveA or reserveB is not empty

func (*BasePool) RemoveLiquidity

func (p *BasePool) RemoveLiquidity(shares sdkmath.Int) (sdkmath.Int, sdkmath.Int)

RemoveLiquidity removes liquidity from the pool and panics if the shares provided are greater than the total shares of the pool or the shares are not positive. In addition, also panics if reserves go negative, which should not happen. If panic occurs, it is a bug.

func (*BasePool) ReservesA

func (p *BasePool) ReservesA() sdkmath.Int

ReservesA returns the A reserves of the pool

func (*BasePool) ReservesB

func (p *BasePool) ReservesB() sdkmath.Int

ReservesB returns the B reserves of the pool

func (*BasePool) ShareValue

func (p *BasePool) ShareValue(shares sdkmath.Int) (sdkmath.Int, sdkmath.Int)

ShareValue returns the value of the provided shares and panics if the shares are greater than the total shares of the pool or if the shares are not positive.

func (*BasePool) SwapAForExactB

func (p *BasePool) SwapAForExactB(b sdkmath.Int, fee sdk.Dec) (sdkmath.Int, sdkmath.Int)

SwapAForExactB trades a for an exact b. Returns the positive amount a that is added to the pool, and the portion of a that is used to pay the fee.

func (*BasePool) SwapBForExactA

func (p *BasePool) SwapBForExactA(a sdkmath.Int, fee sdk.Dec) (sdkmath.Int, sdkmath.Int)

SwapBForExactA trades b for an exact a. Returns the positive amount b that is added to the pool, and the portion of b that is used to pay the fee.

func (*BasePool) SwapExactAForB

func (p *BasePool) SwapExactAForB(a sdkmath.Int, fee sdk.Dec) (sdkmath.Int, sdkmath.Int)

SwapExactAForB trades an exact value of a for b. Returns the positive amount b that is removed from the pool and the portion of a that is used for paying the fee.

func (*BasePool) SwapExactBForA

func (p *BasePool) SwapExactBForA(b sdkmath.Int, fee sdk.Dec) (sdkmath.Int, sdkmath.Int)

SwapExactBForA trades an exact value of b for a. Returns the positive amount a that is removed from the pool and the portion of b that is used for paying the fee.

func (*BasePool) TotalShares

func (p *BasePool) TotalShares() sdkmath.Int

TotalShares returns the total number of shares in the pool

type DenominatedPool

type DenominatedPool struct {
	// contains filtered or unexported fields
}

DenominatedPool implements a denominated constant-product liquidity pool

func NewDenominatedPool

func NewDenominatedPool(reserves sdk.Coins) (*DenominatedPool, error)

NewDenominatedPool creates a new denominated pool from reserve coins

func NewDenominatedPoolWithExistingShares

func NewDenominatedPoolWithExistingShares(reserves sdk.Coins, totalShares sdkmath.Int) (*DenominatedPool, error)

NewDenominatedPoolWithExistingShares creates a new denominated pool from reserve coins

func (*DenominatedPool) AddLiquidity

func (p *DenominatedPool) AddLiquidity(deposit sdk.Coins) (sdk.Coins, sdkmath.Int)

AddLiquidity adds liquidity to the reserves and returns the added amount and shares created

func (*DenominatedPool) IsEmpty

func (p *DenominatedPool) IsEmpty() bool

IsEmpty returns true if the pool is empty

func (*DenominatedPool) RemoveLiquidity

func (p *DenominatedPool) RemoveLiquidity(shares sdkmath.Int) sdk.Coins

RemoveLiquidity removes liquidity from the pool

func (*DenominatedPool) Reserves

func (p *DenominatedPool) Reserves() sdk.Coins

Reserves returns the reserves held in the pool

func (*DenominatedPool) ShareValue

func (p *DenominatedPool) ShareValue(shares sdkmath.Int) sdk.Coins

ShareValue returns the value of the provided shares

func (*DenominatedPool) SwapWithExactInput

func (p *DenominatedPool) SwapWithExactInput(swapInput sdk.Coin, fee sdk.Dec) (sdk.Coin, sdk.Coin)

SwapWithExactInput trades an exact input coin for the other. Returns the positive other coin amount that is removed from the pool and the portion of the input coin that is used for the fee. It panics if the input denom does not match the pool reserves.

func (*DenominatedPool) SwapWithExactOutput

func (p *DenominatedPool) SwapWithExactOutput(swapOutput sdk.Coin, fee sdk.Dec) (sdk.Coin, sdk.Coin)

SwapWithExactOutput trades a coin for an exact output coin b. Returns the positive input coin that is added to the pool, and the portion of that input that is used to pay the fee. Panics if the output denom does not match the pool reserves.

func (*DenominatedPool) TotalShares

func (p *DenominatedPool) TotalShares() sdkmath.Int

TotalShares returns the total shares for the pool

type DepositResponse added in v0.16.0

type DepositResponse struct {
	// depositor represents the owner of the deposit
	Depositor string `protobuf:"bytes,1,opt,name=depositor,proto3" json:"depositor,omitempty"`
	// pool_id represents the pool the deposit is for
	PoolId string `protobuf:"bytes,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"`
	// shares_owned presents the shares owned by the depositor for the pool
	SharesOwned github_com_cosmos_cosmos_sdk_types.Int `` /* 134-byte string literal not displayed */
	// shares_value represents the coin value of the shares_owned
	SharesValue github_com_cosmos_cosmos_sdk_types.Coins `` /* 138-byte string literal not displayed */
}

DepositResponse defines a single deposit query response type.

func (*DepositResponse) Descriptor added in v0.16.0

func (*DepositResponse) Descriptor() ([]byte, []int)

func (*DepositResponse) Marshal added in v0.16.0

func (m *DepositResponse) Marshal() (dAtA []byte, err error)

func (*DepositResponse) MarshalTo added in v0.16.0

func (m *DepositResponse) MarshalTo(dAtA []byte) (int, error)

func (*DepositResponse) MarshalToSizedBuffer added in v0.16.0

func (m *DepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DepositResponse) ProtoMessage added in v0.16.0

func (*DepositResponse) ProtoMessage()

func (*DepositResponse) Reset added in v0.16.0

func (m *DepositResponse) Reset()

func (*DepositResponse) Size added in v0.16.0

func (m *DepositResponse) Size() (n int)

func (*DepositResponse) String added in v0.16.0

func (m *DepositResponse) String() string

func (*DepositResponse) Unmarshal added in v0.16.0

func (m *DepositResponse) Unmarshal(dAtA []byte) error

func (*DepositResponse) XXX_DiscardUnknown added in v0.16.0

func (m *DepositResponse) XXX_DiscardUnknown()

func (*DepositResponse) XXX_Marshal added in v0.16.0

func (m *DepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DepositResponse) XXX_Merge added in v0.16.0

func (m *DepositResponse) XXX_Merge(src proto.Message)

func (*DepositResponse) XXX_Size added in v0.16.0

func (m *DepositResponse) XXX_Size() int

func (*DepositResponse) XXX_Unmarshal added in v0.16.0

func (m *DepositResponse) XXX_Unmarshal(b []byte) error

type GenesisState

type GenesisState struct {
	// params defines all the parameters related to swap
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	// pool_records defines the available pools
	PoolRecords PoolRecords `protobuf:"bytes,2,rep,name=pool_records,json=poolRecords,proto3,castrepeated=PoolRecords" json:"pool_records"`
	// share_records defines the owned shares of each pool
	ShareRecords ShareRecords `protobuf:"bytes,3,rep,name=share_records,json=shareRecords,proto3,castrepeated=ShareRecords" json:"share_records"`
}

GenesisState defines the swap module's genesis state.

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState returns a default genesis state

func NewGenesisState

func NewGenesisState(params Params, poolRecords PoolRecords, shareRecords ShareRecords) GenesisState

NewGenesisState creates a new genesis state.

func (*GenesisState) Descriptor added in v0.16.0

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetParams added in v0.16.0

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetPoolRecords added in v0.16.0

func (m *GenesisState) GetPoolRecords() PoolRecords

func (*GenesisState) GetShareRecords added in v0.16.0

func (m *GenesisState) GetShareRecords() ShareRecords

func (*GenesisState) Marshal added in v0.16.0

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo added in v0.16.0

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer added in v0.16.0

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage added in v0.16.0

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset added in v0.16.0

func (m *GenesisState) Reset()

func (*GenesisState) Size added in v0.16.0

func (m *GenesisState) Size() (n int)

func (*GenesisState) String added in v0.16.0

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal added in v0.16.0

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) Validate

func (gs GenesisState) Validate() error

Validate validates the module's genesis state

func (*GenesisState) XXX_DiscardUnknown added in v0.16.0

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal added in v0.16.0

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge added in v0.16.0

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size added in v0.16.0

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal added in v0.16.0

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type MsgClient added in v0.16.0

type MsgClient interface {
	// Deposit defines a method for depositing liquidity into a pool
	Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error)
	// Withdraw defines a method for withdrawing liquidity into a pool
	Withdraw(ctx context.Context, in *MsgWithdraw, opts ...grpc.CallOption) (*MsgWithdrawResponse, error)
	// SwapExactForTokens represents a message for trading exact coinA for coinB
	SwapExactForTokens(ctx context.Context, in *MsgSwapExactForTokens, opts ...grpc.CallOption) (*MsgSwapExactForTokensResponse, error)
	// SwapForExactTokens represents a message for trading coinA for an exact coinB
	SwapForExactTokens(ctx context.Context, in *MsgSwapForExactTokens, opts ...grpc.CallOption) (*MsgSwapForExactTokensResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient added in v0.16.0

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgDeposit

type MsgDeposit struct {
	// depositor represents the address to deposit funds from
	Depositor string `protobuf:"bytes,1,opt,name=depositor,proto3" json:"depositor,omitempty"`
	// token_a represents one token of deposit pair
	TokenA types.Coin `protobuf:"bytes,2,opt,name=token_a,json=tokenA,proto3" json:"token_a"`
	// token_b represents one token of deposit pair
	TokenB types.Coin `protobuf:"bytes,3,opt,name=token_b,json=tokenB,proto3" json:"token_b"`
	// slippage represents the max decimal percentage price change
	Slippage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=slippage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slippage"`
	// deadline represents the unix timestamp to complete the deposit by
	Deadline int64 `protobuf:"varint,5,opt,name=deadline,proto3" json:"deadline,omitempty"`
}

MsgDeposit represents a message for depositing liquidity into a pool

func NewMsgDeposit

func NewMsgDeposit(depositor string, tokenA sdk.Coin, tokenB sdk.Coin, slippage sdk.Dec, deadline int64) *MsgDeposit

NewMsgDeposit returns a new MsgDeposit

func (MsgDeposit) DeadlineExceeded

func (msg MsgDeposit) DeadlineExceeded(blockTime time.Time) bool

DeadlineExceeded returns if the msg has exceeded it's deadline

func (*MsgDeposit) Descriptor added in v0.16.0

func (*MsgDeposit) Descriptor() ([]byte, []int)

func (MsgDeposit) GetDeadline

func (msg MsgDeposit) GetDeadline() time.Time

GetDeadline returns the time at which the msg is considered invalid

func (MsgDeposit) GetSignBytes

func (msg MsgDeposit) GetSignBytes() []byte

GetSignBytes gets the canonical byte representation of the Msg.

func (MsgDeposit) GetSigners

func (msg MsgDeposit) GetSigners() []sdk.AccAddress

GetSigners returns the addresses of signers that must sign.

func (*MsgDeposit) Marshal added in v0.16.0

func (m *MsgDeposit) Marshal() (dAtA []byte, err error)

func (*MsgDeposit) MarshalTo added in v0.16.0

func (m *MsgDeposit) MarshalTo(dAtA []byte) (int, error)

func (*MsgDeposit) MarshalToSizedBuffer added in v0.16.0

func (m *MsgDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgDeposit) ProtoMessage added in v0.16.0

func (*MsgDeposit) ProtoMessage()

func (*MsgDeposit) Reset added in v0.16.0

func (m *MsgDeposit) Reset()

func (MsgDeposit) Route

func (msg MsgDeposit) Route() string

Route return the message type used for routing the message.

func (*MsgDeposit) Size added in v0.16.0

func (m *MsgDeposit) Size() (n int)

func (*MsgDeposit) String added in v0.16.0

func (m *MsgDeposit) String() string

func (MsgDeposit) Type

func (msg MsgDeposit) Type() string

Type returns a human-readable string for the message, intended for utilization within tags.

func (*MsgDeposit) Unmarshal added in v0.16.0

func (m *MsgDeposit) Unmarshal(dAtA []byte) error

func (MsgDeposit) ValidateBasic

func (msg MsgDeposit) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

func (*MsgDeposit) XXX_DiscardUnknown added in v0.16.0

func (m *MsgDeposit) XXX_DiscardUnknown()

func (*MsgDeposit) XXX_Marshal added in v0.16.0

func (m *MsgDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgDeposit) XXX_Merge added in v0.16.0

func (m *MsgDeposit) XXX_Merge(src proto.Message)

func (*MsgDeposit) XXX_Size added in v0.16.0

func (m *MsgDeposit) XXX_Size() int

func (*MsgDeposit) XXX_Unmarshal added in v0.16.0

func (m *MsgDeposit) XXX_Unmarshal(b []byte) error

type MsgDepositResponse added in v0.16.0

type MsgDepositResponse struct {
}

MsgDepositResponse defines the Msg/Deposit response type.

func (*MsgDepositResponse) Descriptor added in v0.16.0

func (*MsgDepositResponse) Descriptor() ([]byte, []int)

func (*MsgDepositResponse) Marshal added in v0.16.0

func (m *MsgDepositResponse) Marshal() (dAtA []byte, err error)

func (*MsgDepositResponse) MarshalTo added in v0.16.0

func (m *MsgDepositResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgDepositResponse) MarshalToSizedBuffer added in v0.16.0

func (m *MsgDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgDepositResponse) ProtoMessage added in v0.16.0

func (*MsgDepositResponse) ProtoMessage()

func (*MsgDepositResponse) Reset added in v0.16.0

func (m *MsgDepositResponse) Reset()

func (*MsgDepositResponse) Size added in v0.16.0

func (m *MsgDepositResponse) Size() (n int)

func (*MsgDepositResponse) String added in v0.16.0

func (m *MsgDepositResponse) String() string

func (*MsgDepositResponse) Unmarshal added in v0.16.0

func (m *MsgDepositResponse) Unmarshal(dAtA []byte) error

func (*MsgDepositResponse) XXX_DiscardUnknown added in v0.16.0

func (m *MsgDepositResponse) XXX_DiscardUnknown()

func (*MsgDepositResponse) XXX_Marshal added in v0.16.0

func (m *MsgDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgDepositResponse) XXX_Merge added in v0.16.0

func (m *MsgDepositResponse) XXX_Merge(src proto.Message)

func (*MsgDepositResponse) XXX_Size added in v0.16.0

func (m *MsgDepositResponse) XXX_Size() int

func (*MsgDepositResponse) XXX_Unmarshal added in v0.16.0

func (m *MsgDepositResponse) XXX_Unmarshal(b []byte) error

type MsgServer added in v0.16.0

type MsgServer interface {
	// Deposit defines a method for depositing liquidity into a pool
	Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error)
	// Withdraw defines a method for withdrawing liquidity into a pool
	Withdraw(context.Context, *MsgWithdraw) (*MsgWithdrawResponse, error)
	// SwapExactForTokens represents a message for trading exact coinA for coinB
	SwapExactForTokens(context.Context, *MsgSwapExactForTokens) (*MsgSwapExactForTokensResponse, error)
	// SwapForExactTokens represents a message for trading coinA for an exact coinB
	SwapForExactTokens(context.Context, *MsgSwapForExactTokens) (*MsgSwapForExactTokensResponse, error)
}

MsgServer is the server API for Msg service.

type MsgSwapExactForTokens

type MsgSwapExactForTokens struct {
	// represents the address swaping the tokens
	Requester string `protobuf:"bytes,1,opt,name=requester,proto3" json:"requester,omitempty"`
	// exact_token_a represents the exact amount to swap for token_b
	ExactTokenA types.Coin `protobuf:"bytes,2,opt,name=exact_token_a,json=exactTokenA,proto3" json:"exact_token_a"`
	// token_b represents the desired token_b to swap for
	TokenB types.Coin `protobuf:"bytes,3,opt,name=token_b,json=tokenB,proto3" json:"token_b"`
	// slippage represents the maximum change in token_b allowed
	Slippage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=slippage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slippage"`
	// deadline represents the unix timestamp to complete the swap by
	Deadline int64 `protobuf:"varint,5,opt,name=deadline,proto3" json:"deadline,omitempty"`
}

MsgSwapExactForTokens represents a message for trading exact coinA for coinB

func NewMsgSwapExactForTokens

func NewMsgSwapExactForTokens(requester string, exactTokenA sdk.Coin, tokenB sdk.Coin, slippage sdk.Dec, deadline int64) *MsgSwapExactForTokens

NewMsgSwapExactForTokens returns a new MsgSwapExactForTokens

func (MsgSwapExactForTokens) DeadlineExceeded

func (msg MsgSwapExactForTokens) DeadlineExceeded(blockTime time.Time) bool

DeadlineExceeded returns if the msg has exceeded it's deadline

func (*MsgSwapExactForTokens) Descriptor added in v0.16.0

func (*MsgSwapExactForTokens) Descriptor() ([]byte, []int)

func (MsgSwapExactForTokens) GetDeadline

func (msg MsgSwapExactForTokens) GetDeadline() time.Time

GetDeadline returns the time at which the msg is considered invalid

func (MsgSwapExactForTokens) GetSignBytes

func (msg MsgSwapExactForTokens) GetSignBytes() []byte

GetSignBytes gets the canonical byte representation of the Msg.

func (MsgSwapExactForTokens) GetSigners

func (msg MsgSwapExactForTokens) GetSigners() []sdk.AccAddress

GetSigners returns the addresses of signers that must sign.

func (*MsgSwapExactForTokens) Marshal added in v0.16.0

func (m *MsgSwapExactForTokens) Marshal() (dAtA []byte, err error)

func (*MsgSwapExactForTokens) MarshalTo added in v0.16.0

func (m *MsgSwapExactForTokens) MarshalTo(dAtA []byte) (int, error)

func (*MsgSwapExactForTokens) MarshalToSizedBuffer added in v0.16.0

func (m *MsgSwapExactForTokens) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSwapExactForTokens) ProtoMessage added in v0.16.0

func (*MsgSwapExactForTokens) ProtoMessage()

func (*MsgSwapExactForTokens) Reset added in v0.16.0

func (m *MsgSwapExactForTokens) Reset()

func (MsgSwapExactForTokens) Route

func (msg MsgSwapExactForTokens) Route() string

Route return the message type used for routing the message.

func (*MsgSwapExactForTokens) Size added in v0.16.0

func (m *MsgSwapExactForTokens) Size() (n int)

func (*MsgSwapExactForTokens) String added in v0.16.0

func (m *MsgSwapExactForTokens) String() string

func (MsgSwapExactForTokens) Type

func (msg MsgSwapExactForTokens) Type() string

Type returns a human-readable string for the message, intended for utilization within tags.

func (*MsgSwapExactForTokens) Unmarshal added in v0.16.0

func (m *MsgSwapExactForTokens) Unmarshal(dAtA []byte) error

func (MsgSwapExactForTokens) ValidateBasic

func (msg MsgSwapExactForTokens) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

func (*MsgSwapExactForTokens) XXX_DiscardUnknown added in v0.16.0

func (m *MsgSwapExactForTokens) XXX_DiscardUnknown()

func (*MsgSwapExactForTokens) XXX_Marshal added in v0.16.0

func (m *MsgSwapExactForTokens) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSwapExactForTokens) XXX_Merge added in v0.16.0

func (m *MsgSwapExactForTokens) XXX_Merge(src proto.Message)

func (*MsgSwapExactForTokens) XXX_Size added in v0.16.0

func (m *MsgSwapExactForTokens) XXX_Size() int

func (*MsgSwapExactForTokens) XXX_Unmarshal added in v0.16.0

func (m *MsgSwapExactForTokens) XXX_Unmarshal(b []byte) error

type MsgSwapExactForTokensResponse added in v0.16.0

type MsgSwapExactForTokensResponse struct {
}

MsgSwapExactForTokensResponse defines the Msg/SwapExactForTokens response type.

func (*MsgSwapExactForTokensResponse) Descriptor added in v0.16.0

func (*MsgSwapExactForTokensResponse) Descriptor() ([]byte, []int)

func (*MsgSwapExactForTokensResponse) Marshal added in v0.16.0

func (m *MsgSwapExactForTokensResponse) Marshal() (dAtA []byte, err error)

func (*MsgSwapExactForTokensResponse) MarshalTo added in v0.16.0

func (m *MsgSwapExactForTokensResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgSwapExactForTokensResponse) MarshalToSizedBuffer added in v0.16.0

func (m *MsgSwapExactForTokensResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSwapExactForTokensResponse) ProtoMessage added in v0.16.0

func (*MsgSwapExactForTokensResponse) ProtoMessage()

func (*MsgSwapExactForTokensResponse) Reset added in v0.16.0

func (m *MsgSwapExactForTokensResponse) Reset()

func (*MsgSwapExactForTokensResponse) Size added in v0.16.0

func (m *MsgSwapExactForTokensResponse) Size() (n int)

func (*MsgSwapExactForTokensResponse) String added in v0.16.0

func (*MsgSwapExactForTokensResponse) Unmarshal added in v0.16.0

func (m *MsgSwapExactForTokensResponse) Unmarshal(dAtA []byte) error

func (*MsgSwapExactForTokensResponse) XXX_DiscardUnknown added in v0.16.0

func (m *MsgSwapExactForTokensResponse) XXX_DiscardUnknown()

func (*MsgSwapExactForTokensResponse) XXX_Marshal added in v0.16.0

func (m *MsgSwapExactForTokensResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSwapExactForTokensResponse) XXX_Merge added in v0.16.0

func (m *MsgSwapExactForTokensResponse) XXX_Merge(src proto.Message)

func (*MsgSwapExactForTokensResponse) XXX_Size added in v0.16.0

func (m *MsgSwapExactForTokensResponse) XXX_Size() int

func (*MsgSwapExactForTokensResponse) XXX_Unmarshal added in v0.16.0

func (m *MsgSwapExactForTokensResponse) XXX_Unmarshal(b []byte) error

type MsgSwapForExactTokens

type MsgSwapForExactTokens struct {
	// represents the address swaping the tokens
	Requester string `protobuf:"bytes,1,opt,name=requester,proto3" json:"requester,omitempty"`
	// token_a represents the desired token_a to swap for
	TokenA types.Coin `protobuf:"bytes,2,opt,name=token_a,json=tokenA,proto3" json:"token_a"`
	// exact_token_b represents the exact token b amount to swap for token a
	ExactTokenB types.Coin `protobuf:"bytes,3,opt,name=exact_token_b,json=exactTokenB,proto3" json:"exact_token_b"`
	// slippage represents the maximum change in token_a allowed
	Slippage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=slippage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slippage"`
	// deadline represents the unix timestamp to complete the swap by
	Deadline int64 `protobuf:"varint,5,opt,name=deadline,proto3" json:"deadline,omitempty"`
}

MsgSwapForExactTokens represents a message for trading coinA for an exact coinB

func NewMsgSwapForExactTokens

func NewMsgSwapForExactTokens(requester string, tokenA sdk.Coin, exactTokenB sdk.Coin, slippage sdk.Dec, deadline int64) *MsgSwapForExactTokens

NewMsgSwapForExactTokens returns a new MsgSwapForExactTokens

func (MsgSwapForExactTokens) DeadlineExceeded

func (msg MsgSwapForExactTokens) DeadlineExceeded(blockTime time.Time) bool

DeadlineExceeded returns if the msg has exceeded it's deadline

func (*MsgSwapForExactTokens) Descriptor added in v0.16.0

func (*MsgSwapForExactTokens) Descriptor() ([]byte, []int)

func (MsgSwapForExactTokens) GetDeadline

func (msg MsgSwapForExactTokens) GetDeadline() time.Time

GetDeadline returns the time at which the msg is considered invalid

func (MsgSwapForExactTokens) GetSignBytes

func (msg MsgSwapForExactTokens) GetSignBytes() []byte

GetSignBytes gets the canonical byte representation of the Msg.

func (MsgSwapForExactTokens) GetSigners

func (msg MsgSwapForExactTokens) GetSigners() []sdk.AccAddress

GetSigners returns the addresses of signers that must sign.

func (*MsgSwapForExactTokens) Marshal added in v0.16.0

func (m *MsgSwapForExactTokens) Marshal() (dAtA []byte, err error)

func (*MsgSwapForExactTokens) MarshalTo added in v0.16.0

func (m *MsgSwapForExactTokens) MarshalTo(dAtA []byte) (int, error)

func (*MsgSwapForExactTokens) MarshalToSizedBuffer added in v0.16.0

func (m *MsgSwapForExactTokens) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSwapForExactTokens) ProtoMessage added in v0.16.0

func (*MsgSwapForExactTokens) ProtoMessage()

func (*MsgSwapForExactTokens) Reset added in v0.16.0

func (m *MsgSwapForExactTokens) Reset()

func (MsgSwapForExactTokens) Route

func (msg MsgSwapForExactTokens) Route() string

Route return the message type used for routing the message.

func (*MsgSwapForExactTokens) Size added in v0.16.0

func (m *MsgSwapForExactTokens) Size() (n int)

func (*MsgSwapForExactTokens) String added in v0.16.0

func (m *MsgSwapForExactTokens) String() string

func (MsgSwapForExactTokens) Type

func (msg MsgSwapForExactTokens) Type() string

Type returns a human-readable string for the message, intended for utilization within tags.

func (*MsgSwapForExactTokens) Unmarshal added in v0.16.0

func (m *MsgSwapForExactTokens) Unmarshal(dAtA []byte) error

func (MsgSwapForExactTokens) ValidateBasic

func (msg MsgSwapForExactTokens) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

func (*MsgSwapForExactTokens) XXX_DiscardUnknown added in v0.16.0

func (m *MsgSwapForExactTokens) XXX_DiscardUnknown()

func (*MsgSwapForExactTokens) XXX_Marshal added in v0.16.0

func (m *MsgSwapForExactTokens) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSwapForExactTokens) XXX_Merge added in v0.16.0

func (m *MsgSwapForExactTokens) XXX_Merge(src proto.Message)

func (*MsgSwapForExactTokens) XXX_Size added in v0.16.0

func (m *MsgSwapForExactTokens) XXX_Size() int

func (*MsgSwapForExactTokens) XXX_Unmarshal added in v0.16.0

func (m *MsgSwapForExactTokens) XXX_Unmarshal(b []byte) error

type MsgSwapForExactTokensResponse added in v0.16.0

type MsgSwapForExactTokensResponse struct {
}

MsgSwapForExactTokensResponse defines the Msg/SwapForExactTokensResponse response type.

func (*MsgSwapForExactTokensResponse) Descriptor added in v0.16.0

func (*MsgSwapForExactTokensResponse) Descriptor() ([]byte, []int)

func (*MsgSwapForExactTokensResponse) Marshal added in v0.16.0

func (m *MsgSwapForExactTokensResponse) Marshal() (dAtA []byte, err error)

func (*MsgSwapForExactTokensResponse) MarshalTo added in v0.16.0

func (m *MsgSwapForExactTokensResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgSwapForExactTokensResponse) MarshalToSizedBuffer added in v0.16.0

func (m *MsgSwapForExactTokensResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSwapForExactTokensResponse) ProtoMessage added in v0.16.0

func (*MsgSwapForExactTokensResponse) ProtoMessage()

func (*MsgSwapForExactTokensResponse) Reset added in v0.16.0

func (m *MsgSwapForExactTokensResponse) Reset()

func (*MsgSwapForExactTokensResponse) Size added in v0.16.0

func (m *MsgSwapForExactTokensResponse) Size() (n int)

func (*MsgSwapForExactTokensResponse) String added in v0.16.0

func (*MsgSwapForExactTokensResponse) Unmarshal added in v0.16.0

func (m *MsgSwapForExactTokensResponse) Unmarshal(dAtA []byte) error

func (*MsgSwapForExactTokensResponse) XXX_DiscardUnknown added in v0.16.0

func (m *MsgSwapForExactTokensResponse) XXX_DiscardUnknown()

func (*MsgSwapForExactTokensResponse) XXX_Marshal added in v0.16.0

func (m *MsgSwapForExactTokensResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSwapForExactTokensResponse) XXX_Merge added in v0.16.0

func (m *MsgSwapForExactTokensResponse) XXX_Merge(src proto.Message)

func (*MsgSwapForExactTokensResponse) XXX_Size added in v0.16.0

func (m *MsgSwapForExactTokensResponse) XXX_Size() int

func (*MsgSwapForExactTokensResponse) XXX_Unmarshal added in v0.16.0

func (m *MsgSwapForExactTokensResponse) XXX_Unmarshal(b []byte) error

type MsgWithDeadline

type MsgWithDeadline interface {
	GetDeadline() time.Time
	DeadlineExceeded(blockTime time.Time) bool
}

MsgWithDeadline allows messages to define a deadline of when they are considered invalid

type MsgWithdraw

type MsgWithdraw struct {
	// from represents the address we are withdrawing for
	From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	// shares represents the amount of shares to withdraw
	Shares github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=shares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"shares"`
	// min_token_a represents the minimum a token to withdraw
	MinTokenA types.Coin `protobuf:"bytes,3,opt,name=min_token_a,json=minTokenA,proto3" json:"min_token_a"`
	// min_token_a represents the minimum a token to withdraw
	MinTokenB types.Coin `protobuf:"bytes,4,opt,name=min_token_b,json=minTokenB,proto3" json:"min_token_b"`
	// deadline represents the unix timestamp to complete the withdraw by
	Deadline int64 `protobuf:"varint,5,opt,name=deadline,proto3" json:"deadline,omitempty"`
}

MsgWithdraw represents a message for withdrawing liquidity from a pool

func NewMsgWithdraw

func NewMsgWithdraw(from string, shares sdkmath.Int, minTokenA, minTokenB sdk.Coin, deadline int64) *MsgWithdraw

NewMsgWithdraw returns a new MsgWithdraw

func (MsgWithdraw) DeadlineExceeded

func (msg MsgWithdraw) DeadlineExceeded(blockTime time.Time) bool

DeadlineExceeded returns if the msg has exceeded it's deadline

func (*MsgWithdraw) Descriptor added in v0.16.0

func (*MsgWithdraw) Descriptor() ([]byte, []int)

func (MsgWithdraw) GetDeadline

func (msg MsgWithdraw) GetDeadline() time.Time

GetDeadline returns the time at which the msg is considered invalid

func (MsgWithdraw) GetSignBytes

func (msg MsgWithdraw) GetSignBytes() []byte

GetSignBytes gets the canonical byte representation of the Msg.

func (MsgWithdraw) GetSigners

func (msg MsgWithdraw) GetSigners() []sdk.AccAddress

GetSigners returns the addresses of signers that must sign.

func (*MsgWithdraw) Marshal added in v0.16.0

func (m *MsgWithdraw) Marshal() (dAtA []byte, err error)

func (*MsgWithdraw) MarshalTo added in v0.16.0

func (m *MsgWithdraw) MarshalTo(dAtA []byte) (int, error)

func (*MsgWithdraw) MarshalToSizedBuffer added in v0.16.0

func (m *MsgWithdraw) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgWithdraw) ProtoMessage added in v0.16.0

func (*MsgWithdraw) ProtoMessage()

func (*MsgWithdraw) Reset added in v0.16.0

func (m *MsgWithdraw) Reset()

func (MsgWithdraw) Route

func (msg MsgWithdraw) Route() string

Route return the message type used for routing the message.

func (*MsgWithdraw) Size added in v0.16.0

func (m *MsgWithdraw) Size() (n int)

func (*MsgWithdraw) String added in v0.16.0

func (m *MsgWithdraw) String() string

func (MsgWithdraw) Type

func (msg MsgWithdraw) Type() string

Type returns a human-readable string for the message, intended for utilization within tags.

func (*MsgWithdraw) Unmarshal added in v0.16.0

func (m *MsgWithdraw) Unmarshal(dAtA []byte) error

func (MsgWithdraw) ValidateBasic

func (msg MsgWithdraw) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

func (*MsgWithdraw) XXX_DiscardUnknown added in v0.16.0

func (m *MsgWithdraw) XXX_DiscardUnknown()

func (*MsgWithdraw) XXX_Marshal added in v0.16.0

func (m *MsgWithdraw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgWithdraw) XXX_Merge added in v0.16.0

func (m *MsgWithdraw) XXX_Merge(src proto.Message)

func (*MsgWithdraw) XXX_Size added in v0.16.0

func (m *MsgWithdraw) XXX_Size() int

func (*MsgWithdraw) XXX_Unmarshal added in v0.16.0

func (m *MsgWithdraw) XXX_Unmarshal(b []byte) error

type MsgWithdrawResponse added in v0.16.0

type MsgWithdrawResponse struct {
}

MsgWithdrawResponse defines the Msg/Withdraw response type.

func (*MsgWithdrawResponse) Descriptor added in v0.16.0

func (*MsgWithdrawResponse) Descriptor() ([]byte, []int)

func (*MsgWithdrawResponse) Marshal added in v0.16.0

func (m *MsgWithdrawResponse) Marshal() (dAtA []byte, err error)

func (*MsgWithdrawResponse) MarshalTo added in v0.16.0

func (m *MsgWithdrawResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgWithdrawResponse) MarshalToSizedBuffer added in v0.16.0

func (m *MsgWithdrawResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgWithdrawResponse) ProtoMessage added in v0.16.0

func (*MsgWithdrawResponse) ProtoMessage()

func (*MsgWithdrawResponse) Reset added in v0.16.0

func (m *MsgWithdrawResponse) Reset()

func (*MsgWithdrawResponse) Size added in v0.16.0

func (m *MsgWithdrawResponse) Size() (n int)

func (*MsgWithdrawResponse) String added in v0.16.0

func (m *MsgWithdrawResponse) String() string

func (*MsgWithdrawResponse) Unmarshal added in v0.16.0

func (m *MsgWithdrawResponse) Unmarshal(dAtA []byte) error

func (*MsgWithdrawResponse) XXX_DiscardUnknown added in v0.16.0

func (m *MsgWithdrawResponse) XXX_DiscardUnknown()

func (*MsgWithdrawResponse) XXX_Marshal added in v0.16.0

func (m *MsgWithdrawResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgWithdrawResponse) XXX_Merge added in v0.16.0

func (m *MsgWithdrawResponse) XXX_Merge(src proto.Message)

func (*MsgWithdrawResponse) XXX_Size added in v0.16.0

func (m *MsgWithdrawResponse) XXX_Size() int

func (*MsgWithdrawResponse) XXX_Unmarshal added in v0.16.0

func (m *MsgWithdrawResponse) XXX_Unmarshal(b []byte) error

type Params

type Params struct {
	// allowed_pools defines that pools that are allowed to be created
	AllowedPools AllowedPools `protobuf:"bytes,1,rep,name=allowed_pools,json=allowedPools,proto3,castrepeated=AllowedPools" json:"allowed_pools"`
	// swap_fee defines the swap fee for all pools
	SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee"`
}

Params defines the parameters for the swap module.

func DefaultParams

func DefaultParams() Params

DefaultParams returns default params for swap module

func NewParams

func NewParams(pairs AllowedPools, swapFee sdk.Dec) Params

NewParams returns a new params object

func (*Params) Descriptor added in v0.16.0

func (*Params) Descriptor() ([]byte, []int)

func (*Params) GetAllowedPools added in v0.16.0

func (m *Params) GetAllowedPools() AllowedPools

func (*Params) Marshal added in v0.16.0

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo added in v0.16.0

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer added in v0.16.0

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs implements params.ParamSet

func (*Params) ProtoMessage added in v0.16.0

func (*Params) ProtoMessage()

func (*Params) Reset added in v0.16.0

func (m *Params) Reset()

func (*Params) Size added in v0.16.0

func (m *Params) Size() (n int)

func (Params) String

func (p Params) String() string

String implements fmt.Stringer

func (*Params) Unmarshal added in v0.16.0

func (m *Params) Unmarshal(dAtA []byte) error

func (Params) Validate

func (p Params) Validate() error

Validate checks that the parameters have valid values.

func (*Params) XXX_DiscardUnknown added in v0.16.0

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal added in v0.16.0

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge added in v0.16.0

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size added in v0.16.0

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal added in v0.16.0

func (m *Params) XXX_Unmarshal(b []byte) error

type PoolRecord

type PoolRecord struct {
	// pool_id represents the unique id of the pool
	PoolID string `protobuf:"bytes,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"`
	// reserves_a is the a token coin reserves
	ReservesA types.Coin `protobuf:"bytes,2,opt,name=reserves_a,json=reservesA,proto3" json:"reserves_a"`
	// reserves_b is the a token coin reserves
	ReservesB types.Coin `protobuf:"bytes,3,opt,name=reserves_b,json=reservesB,proto3" json:"reserves_b"`
	// total_shares is the total distrubuted shares of the pool
	TotalShares github_com_cosmos_cosmos_sdk_types.Int `` /* 134-byte string literal not displayed */
}

PoolRecord represents the state of a liquidity pool and is used to store the state of a denominated pool

func NewPoolRecord

func NewPoolRecord(reserves sdk.Coins, totalShares sdkmath.Int) PoolRecord

NewPoolRecord takes reserve coins and total shares, returning a new pool record with a id

func NewPoolRecordFromPool

func NewPoolRecordFromPool(pool *DenominatedPool) PoolRecord

NewPoolRecordFromPool takes a pointer to a denominated pool and returns a pool record for storage in state.

func (*PoolRecord) Descriptor added in v0.16.0

func (*PoolRecord) Descriptor() ([]byte, []int)

func (*PoolRecord) GetPoolID added in v0.16.0

func (m *PoolRecord) GetPoolID() string

func (*PoolRecord) GetReservesA added in v0.16.0

func (m *PoolRecord) GetReservesA() types.Coin

func (*PoolRecord) GetReservesB added in v0.16.0

func (m *PoolRecord) GetReservesB() types.Coin

func (*PoolRecord) Marshal added in v0.16.0

func (m *PoolRecord) Marshal() (dAtA []byte, err error)

func (*PoolRecord) MarshalTo added in v0.16.0

func (m *PoolRecord) MarshalTo(dAtA []byte) (int, error)

func (*PoolRecord) MarshalToSizedBuffer added in v0.16.0

func (m *PoolRecord) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PoolRecord) ProtoMessage added in v0.16.0

func (*PoolRecord) ProtoMessage()

func (PoolRecord) Reserves

func (p PoolRecord) Reserves() sdk.Coins

Reserves returns the total reserves for a pool

func (*PoolRecord) Reset added in v0.16.0

func (m *PoolRecord) Reset()

func (*PoolRecord) Size added in v0.16.0

func (m *PoolRecord) Size() (n int)

func (*PoolRecord) String added in v0.16.0

func (m *PoolRecord) String() string

func (*PoolRecord) Unmarshal added in v0.16.0

func (m *PoolRecord) Unmarshal(dAtA []byte) error

func (PoolRecord) Validate

func (p PoolRecord) Validate() error

Validate performs basic validation checks of the record data

func (*PoolRecord) XXX_DiscardUnknown added in v0.16.0

func (m *PoolRecord) XXX_DiscardUnknown()

func (*PoolRecord) XXX_Marshal added in v0.16.0

func (m *PoolRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PoolRecord) XXX_Merge added in v0.16.0

func (m *PoolRecord) XXX_Merge(src proto.Message)

func (*PoolRecord) XXX_Size added in v0.16.0

func (m *PoolRecord) XXX_Size() int

func (*PoolRecord) XXX_Unmarshal added in v0.16.0

func (m *PoolRecord) XXX_Unmarshal(b []byte) error

type PoolRecords

type PoolRecords []PoolRecord

PoolRecords is a slice of PoolRecord

func (PoolRecords) Validate

func (prs PoolRecords) Validate() error

Validate performs basic validation checks on all records in the slice

type PoolResponse added in v0.16.0

type PoolResponse struct {
	// name represents the name of the pool
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// coins represents the total reserves of the pool
	Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"`
	//  total_shares represents the total shares of the pool
	TotalShares github_com_cosmos_cosmos_sdk_types.Int `` /* 134-byte string literal not displayed */
}

Pool represents the state of a single pool

func (*PoolResponse) Descriptor added in v0.16.0

func (*PoolResponse) Descriptor() ([]byte, []int)

func (*PoolResponse) Marshal added in v0.16.0

func (m *PoolResponse) Marshal() (dAtA []byte, err error)

func (*PoolResponse) MarshalTo added in v0.16.0

func (m *PoolResponse) MarshalTo(dAtA []byte) (int, error)

func (*PoolResponse) MarshalToSizedBuffer added in v0.16.0

func (m *PoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PoolResponse) ProtoMessage added in v0.16.0

func (*PoolResponse) ProtoMessage()

func (*PoolResponse) Reset added in v0.16.0

func (m *PoolResponse) Reset()

func (*PoolResponse) Size added in v0.16.0

func (m *PoolResponse) Size() (n int)

func (*PoolResponse) String added in v0.16.0

func (m *PoolResponse) String() string

func (*PoolResponse) Unmarshal added in v0.16.0

func (m *PoolResponse) Unmarshal(dAtA []byte) error

func (*PoolResponse) XXX_DiscardUnknown added in v0.16.0

func (m *PoolResponse) XXX_DiscardUnknown()

func (*PoolResponse) XXX_Marshal added in v0.16.0

func (m *PoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PoolResponse) XXX_Merge added in v0.16.0

func (m *PoolResponse) XXX_Merge(src proto.Message)

func (*PoolResponse) XXX_Size added in v0.16.0

func (m *PoolResponse) XXX_Size() int

func (*PoolResponse) XXX_Unmarshal added in v0.16.0

func (m *PoolResponse) XXX_Unmarshal(b []byte) error

type QueryClient added in v0.16.0

type QueryClient interface {
	// Params queries all parameters of the swap module.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	// Pools queries pools based on pool ID
	Pools(ctx context.Context, in *QueryPoolsRequest, opts ...grpc.CallOption) (*QueryPoolsResponse, error)
	// Deposits queries deposit details based on owner address and pool
	Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient added in v0.16.0

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryDepositsRequest added in v0.16.0

type QueryDepositsRequest struct {
	// owner optionally filters deposits by owner
	Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
	// pool_id optionally fitlers deposits by pool id
	PoolId string `protobuf:"bytes,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"`
	// pagination defines an optional pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryDepositsRequest is the request type for the Query/Deposits RPC method.

func (*QueryDepositsRequest) Descriptor added in v0.16.0

func (*QueryDepositsRequest) Descriptor() ([]byte, []int)

func (*QueryDepositsRequest) Marshal added in v0.16.0

func (m *QueryDepositsRequest) Marshal() (dAtA []byte, err error)

func (*QueryDepositsRequest) MarshalTo added in v0.16.0

func (m *QueryDepositsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryDepositsRequest) MarshalToSizedBuffer added in v0.16.0

func (m *QueryDepositsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryDepositsRequest) ProtoMessage added in v0.16.0

func (*QueryDepositsRequest) ProtoMessage()

func (*QueryDepositsRequest) Reset added in v0.16.0

func (m *QueryDepositsRequest) Reset()

func (*QueryDepositsRequest) Size added in v0.16.0

func (m *QueryDepositsRequest) Size() (n int)

func (*QueryDepositsRequest) String added in v0.16.0

func (m *QueryDepositsRequest) String() string

func (*QueryDepositsRequest) Unmarshal added in v0.16.0

func (m *QueryDepositsRequest) Unmarshal(dAtA []byte) error

func (*QueryDepositsRequest) XXX_DiscardUnknown added in v0.16.0

func (m *QueryDepositsRequest) XXX_DiscardUnknown()

func (*QueryDepositsRequest) XXX_Marshal added in v0.16.0

func (m *QueryDepositsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryDepositsRequest) XXX_Merge added in v0.16.0

func (m *QueryDepositsRequest) XXX_Merge(src proto.Message)

func (*QueryDepositsRequest) XXX_Size added in v0.16.0

func (m *QueryDepositsRequest) XXX_Size() int

func (*QueryDepositsRequest) XXX_Unmarshal added in v0.16.0

func (m *QueryDepositsRequest) XXX_Unmarshal(b []byte) error

type QueryDepositsResponse added in v0.16.0

type QueryDepositsResponse struct {
	// deposits returns the deposits matching the requested parameters
	Deposits []DepositResponse `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits"`
	// pagination defines the pagination in the response.
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryDepositsResponse is the response type for the Query/Deposits RPC method.

func (*QueryDepositsResponse) Descriptor added in v0.16.0

func (*QueryDepositsResponse) Descriptor() ([]byte, []int)

func (*QueryDepositsResponse) Marshal added in v0.16.0

func (m *QueryDepositsResponse) Marshal() (dAtA []byte, err error)

func (*QueryDepositsResponse) MarshalTo added in v0.16.0

func (m *QueryDepositsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryDepositsResponse) MarshalToSizedBuffer added in v0.16.0

func (m *QueryDepositsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryDepositsResponse) ProtoMessage added in v0.16.0

func (*QueryDepositsResponse) ProtoMessage()

func (*QueryDepositsResponse) Reset added in v0.16.0

func (m *QueryDepositsResponse) Reset()

func (*QueryDepositsResponse) Size added in v0.16.0

func (m *QueryDepositsResponse) Size() (n int)

func (*QueryDepositsResponse) String added in v0.16.0

func (m *QueryDepositsResponse) String() string

func (*QueryDepositsResponse) Unmarshal added in v0.16.0

func (m *QueryDepositsResponse) Unmarshal(dAtA []byte) error

func (*QueryDepositsResponse) XXX_DiscardUnknown added in v0.16.0

func (m *QueryDepositsResponse) XXX_DiscardUnknown()

func (*QueryDepositsResponse) XXX_Marshal added in v0.16.0

func (m *QueryDepositsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryDepositsResponse) XXX_Merge added in v0.16.0

func (m *QueryDepositsResponse) XXX_Merge(src proto.Message)

func (*QueryDepositsResponse) XXX_Size added in v0.16.0

func (m *QueryDepositsResponse) XXX_Size() int

func (*QueryDepositsResponse) XXX_Unmarshal added in v0.16.0

func (m *QueryDepositsResponse) XXX_Unmarshal(b []byte) error

type QueryParamsRequest added in v0.16.0

type QueryParamsRequest struct {
}

QueryParamsRequest defines the request type for querying x/swap parameters.

func (*QueryParamsRequest) Descriptor added in v0.16.0

func (*QueryParamsRequest) Descriptor() ([]byte, []int)

func (*QueryParamsRequest) Marshal added in v0.16.0

func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)

func (*QueryParamsRequest) MarshalTo added in v0.16.0

func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsRequest) MarshalToSizedBuffer added in v0.16.0

func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsRequest) ProtoMessage added in v0.16.0

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset added in v0.16.0

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size added in v0.16.0

func (m *QueryParamsRequest) Size() (n int)

func (*QueryParamsRequest) String added in v0.16.0

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal added in v0.16.0

func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error

func (*QueryParamsRequest) XXX_DiscardUnknown added in v0.16.0

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal added in v0.16.0

func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsRequest) XXX_Merge added in v0.16.0

func (m *QueryParamsRequest) XXX_Merge(src proto.Message)

func (*QueryParamsRequest) XXX_Size added in v0.16.0

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal added in v0.16.0

func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error

type QueryParamsResponse added in v0.16.0

type QueryParamsResponse struct {
	// params represents the swap module parameters
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryParamsResponse defines the response type for querying x/swap parameters.

func (*QueryParamsResponse) Descriptor added in v0.16.0

func (*QueryParamsResponse) Descriptor() ([]byte, []int)

func (*QueryParamsResponse) Marshal added in v0.16.0

func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)

func (*QueryParamsResponse) MarshalTo added in v0.16.0

func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsResponse) MarshalToSizedBuffer added in v0.16.0

func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsResponse) ProtoMessage added in v0.16.0

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset added in v0.16.0

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size added in v0.16.0

func (m *QueryParamsResponse) Size() (n int)

func (*QueryParamsResponse) String added in v0.16.0

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal added in v0.16.0

func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error

func (*QueryParamsResponse) XXX_DiscardUnknown added in v0.16.0

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal added in v0.16.0

func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsResponse) XXX_Merge added in v0.16.0

func (m *QueryParamsResponse) XXX_Merge(src proto.Message)

func (*QueryParamsResponse) XXX_Size added in v0.16.0

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal added in v0.16.0

func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error

type QueryPoolsRequest added in v0.16.0

type QueryPoolsRequest struct {
	// pool_id filters pools by id
	PoolId string `protobuf:"bytes,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"`
	// pagination defines an optional pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryPoolsRequest is the request type for the Query/Pools RPC method.

func (*QueryPoolsRequest) Descriptor added in v0.16.0

func (*QueryPoolsRequest) Descriptor() ([]byte, []int)

func (*QueryPoolsRequest) GetPagination added in v0.16.0

func (m *QueryPoolsRequest) GetPagination() *query.PageRequest

func (*QueryPoolsRequest) GetPoolId added in v0.16.0

func (m *QueryPoolsRequest) GetPoolId() string

func (*QueryPoolsRequest) Marshal added in v0.16.0

func (m *QueryPoolsRequest) Marshal() (dAtA []byte, err error)

func (*QueryPoolsRequest) MarshalTo added in v0.16.0

func (m *QueryPoolsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryPoolsRequest) MarshalToSizedBuffer added in v0.16.0

func (m *QueryPoolsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryPoolsRequest) ProtoMessage added in v0.16.0

func (*QueryPoolsRequest) ProtoMessage()

func (*QueryPoolsRequest) Reset added in v0.16.0

func (m *QueryPoolsRequest) Reset()

func (*QueryPoolsRequest) Size added in v0.16.0

func (m *QueryPoolsRequest) Size() (n int)

func (*QueryPoolsRequest) String added in v0.16.0

func (m *QueryPoolsRequest) String() string

func (*QueryPoolsRequest) Unmarshal added in v0.16.0

func (m *QueryPoolsRequest) Unmarshal(dAtA []byte) error

func (*QueryPoolsRequest) XXX_DiscardUnknown added in v0.16.0

func (m *QueryPoolsRequest) XXX_DiscardUnknown()

func (*QueryPoolsRequest) XXX_Marshal added in v0.16.0

func (m *QueryPoolsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryPoolsRequest) XXX_Merge added in v0.16.0

func (m *QueryPoolsRequest) XXX_Merge(src proto.Message)

func (*QueryPoolsRequest) XXX_Size added in v0.16.0

func (m *QueryPoolsRequest) XXX_Size() int

func (*QueryPoolsRequest) XXX_Unmarshal added in v0.16.0

func (m *QueryPoolsRequest) XXX_Unmarshal(b []byte) error

type QueryPoolsResponse added in v0.16.0

type QueryPoolsResponse struct {
	// pools represents returned pools
	Pools []PoolResponse `protobuf:"bytes,1,rep,name=pools,proto3" json:"pools"`
	// pagination defines the pagination in the response.
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryPoolsResponse is the response type for the Query/Pools RPC method.

func (*QueryPoolsResponse) Descriptor added in v0.16.0

func (*QueryPoolsResponse) Descriptor() ([]byte, []int)

func (*QueryPoolsResponse) GetPagination added in v0.16.0

func (m *QueryPoolsResponse) GetPagination() *query.PageResponse

func (*QueryPoolsResponse) GetPools added in v0.16.0

func (m *QueryPoolsResponse) GetPools() []PoolResponse

func (*QueryPoolsResponse) Marshal added in v0.16.0

func (m *QueryPoolsResponse) Marshal() (dAtA []byte, err error)

func (*QueryPoolsResponse) MarshalTo added in v0.16.0

func (m *QueryPoolsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryPoolsResponse) MarshalToSizedBuffer added in v0.16.0

func (m *QueryPoolsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryPoolsResponse) ProtoMessage added in v0.16.0

func (*QueryPoolsResponse) ProtoMessage()

func (*QueryPoolsResponse) Reset added in v0.16.0

func (m *QueryPoolsResponse) Reset()

func (*QueryPoolsResponse) Size added in v0.16.0

func (m *QueryPoolsResponse) Size() (n int)

func (*QueryPoolsResponse) String added in v0.16.0

func (m *QueryPoolsResponse) String() string

func (*QueryPoolsResponse) Unmarshal added in v0.16.0

func (m *QueryPoolsResponse) Unmarshal(dAtA []byte) error

func (*QueryPoolsResponse) XXX_DiscardUnknown added in v0.16.0

func (m *QueryPoolsResponse) XXX_DiscardUnknown()

func (*QueryPoolsResponse) XXX_Marshal added in v0.16.0

func (m *QueryPoolsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryPoolsResponse) XXX_Merge added in v0.16.0

func (m *QueryPoolsResponse) XXX_Merge(src proto.Message)

func (*QueryPoolsResponse) XXX_Size added in v0.16.0

func (m *QueryPoolsResponse) XXX_Size() int

func (*QueryPoolsResponse) XXX_Unmarshal added in v0.16.0

func (m *QueryPoolsResponse) XXX_Unmarshal(b []byte) error

type QueryServer added in v0.16.0

type QueryServer interface {
	// Params queries all parameters of the swap module.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	// Pools queries pools based on pool ID
	Pools(context.Context, *QueryPoolsRequest) (*QueryPoolsResponse, error)
	// Deposits queries deposit details based on owner address and pool
	Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error)
}

QueryServer is the server API for Query service.

type ShareRecord

type ShareRecord struct {
	// depositor represents the owner of the shares
	Depositor github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 126-byte string literal not displayed */
	// pool_id represents the pool the shares belong to
	PoolID string `protobuf:"bytes,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"`
	// shares_owned represents the number of shares owned by depsoitor for the pool_id
	SharesOwned github_com_cosmos_cosmos_sdk_types.Int `` /* 134-byte string literal not displayed */
}

ShareRecord stores the shares owned for a depositor and pool

func NewShareRecord

func NewShareRecord(depositor sdk.AccAddress, poolID string, sharesOwned sdkmath.Int) ShareRecord

NewShareRecord takes a depositor, poolID, and shares and returns a new share record for storage in state.

func (*ShareRecord) Descriptor added in v0.16.0

func (*ShareRecord) Descriptor() ([]byte, []int)

func (*ShareRecord) GetDepositor added in v0.16.0

func (*ShareRecord) GetPoolID added in v0.16.0

func (m *ShareRecord) GetPoolID() string

func (*ShareRecord) Marshal added in v0.16.0

func (m *ShareRecord) Marshal() (dAtA []byte, err error)

func (*ShareRecord) MarshalTo added in v0.16.0

func (m *ShareRecord) MarshalTo(dAtA []byte) (int, error)

func (*ShareRecord) MarshalToSizedBuffer added in v0.16.0

func (m *ShareRecord) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ShareRecord) ProtoMessage added in v0.16.0

func (*ShareRecord) ProtoMessage()

func (*ShareRecord) Reset added in v0.16.0

func (m *ShareRecord) Reset()

func (*ShareRecord) Size added in v0.16.0

func (m *ShareRecord) Size() (n int)

func (*ShareRecord) String added in v0.16.0

func (m *ShareRecord) String() string

func (*ShareRecord) Unmarshal added in v0.16.0

func (m *ShareRecord) Unmarshal(dAtA []byte) error

func (ShareRecord) Validate

func (sr ShareRecord) Validate() error

Validate performs basic validation checks of the record data

func (*ShareRecord) XXX_DiscardUnknown added in v0.16.0

func (m *ShareRecord) XXX_DiscardUnknown()

func (*ShareRecord) XXX_Marshal added in v0.16.0

func (m *ShareRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ShareRecord) XXX_Merge added in v0.16.0

func (m *ShareRecord) XXX_Merge(src proto.Message)

func (*ShareRecord) XXX_Size added in v0.16.0

func (m *ShareRecord) XXX_Size() int

func (*ShareRecord) XXX_Unmarshal added in v0.16.0

func (m *ShareRecord) XXX_Unmarshal(b []byte) error

type ShareRecords

type ShareRecords []ShareRecord

ShareRecords is a slice of ShareRecord

func (ShareRecords) Validate

func (srs ShareRecords) Validate() error

Validate performs basic validation checks on all records in the slice

type SwapHooks

type SwapHooks interface {
	AfterPoolDepositCreated(ctx sdk.Context, poolID string, depositor sdk.AccAddress, sharedOwned sdkmath.Int)
	BeforePoolDepositModified(ctx sdk.Context, poolID string, depositor sdk.AccAddress, sharedOwned sdkmath.Int)
}

SwapHooks are event hooks called when a user's deposit to a swap pool changes.

type UnimplementedMsgServer added in v0.16.0

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) Deposit added in v0.16.0

func (*UnimplementedMsgServer) SwapExactForTokens added in v0.16.0

func (*UnimplementedMsgServer) SwapForExactTokens added in v0.16.0

func (*UnimplementedMsgServer) Withdraw added in v0.16.0

type UnimplementedQueryServer added in v0.16.0

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Deposits added in v0.16.0

func (*UnimplementedQueryServer) Params added in v0.16.0

func (*UnimplementedQueryServer) Pools added in v0.16.0

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL