types

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 36 Imported by: 0

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

	// QuerierRoute Top level query string
	QuerierRoute = 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 (
	QueryGetParams   = "params"
	QueryGetDeposits = "deposits"
	QueryGetPool     = "pool"
	QueryGetPools    = "pools"
)

Querier routes for the swap module

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

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

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

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

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

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

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

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

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

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

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

func (*AllowedPool) GetTokenA

func (m *AllowedPool) GetTokenA() string

func (*AllowedPool) GetTokenB

func (m *AllowedPool) GetTokenB() string

func (*AllowedPool) Marshal

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

func (*AllowedPool) MarshalTo

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

func (*AllowedPool) MarshalToSizedBuffer

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

func (*AllowedPool) ProtoMessage()

func (*AllowedPool) Reset

func (m *AllowedPool) Reset()

func (*AllowedPool) Size

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

func (AllowedPool) String

func (p AllowedPool) String() string

String pretty prints the allowedPool

func (*AllowedPool) Unmarshal

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

func (m *AllowedPool) XXX_DiscardUnknown()

func (*AllowedPool) XXX_Marshal

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

func (*AllowedPool) XXX_Merge

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

func (*AllowedPool) XXX_Size

func (m *AllowedPool) XXX_Size() int

func (*AllowedPool) XXX_Unmarshal

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

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

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

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

func (*DepositResponse) Marshal

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

func (*DepositResponse) MarshalTo

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

func (*DepositResponse) MarshalToSizedBuffer

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

func (*DepositResponse) ProtoMessage

func (*DepositResponse) ProtoMessage()

func (*DepositResponse) Reset

func (m *DepositResponse) Reset()

func (*DepositResponse) Size

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

func (*DepositResponse) String

func (m *DepositResponse) String() string

func (*DepositResponse) Unmarshal

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

func (*DepositResponse) XXX_DiscardUnknown

func (m *DepositResponse) XXX_DiscardUnknown()

func (*DepositResponse) XXX_Marshal

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

func (*DepositResponse) XXX_Merge

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

func (*DepositResponse) XXX_Size

func (m *DepositResponse) XXX_Size() int

func (*DepositResponse) XXX_Unmarshal

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

type DepositsQueryResult

type DepositsQueryResult struct {
	Depositor   sdk.AccAddress `json:"depositor" yaml:"depositor"`
	PoolID      string         `json:"pool_id" yaml:"pool_id"`
	SharesOwned sdkmath.Int    `json:"shares_owned" yaml:"shares_owned"`
	SharesValue sdk.Coins      `json:"shares_value" yaml:"shares_value"`
}

DepositsQueryResult contains the result of a deposits query

func NewDepositsQueryResult

func NewDepositsQueryResult(shareRecord ShareRecord, sharesValue sdk.Coins) DepositsQueryResult

NewDepositsQueryResult creates a new DepositsQueryResult

type DepositsQueryResults

type DepositsQueryResults []DepositsQueryResult

DepositsQueryResults is a slice of DepositsQueryResult

type GenesisState

type GenesisState struct {
	// params defines all the paramaters 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

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

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetPoolRecords

func (m *GenesisState) GetPoolRecords() PoolRecords

func (*GenesisState) GetShareRecords

func (m *GenesisState) GetShareRecords() ShareRecords

func (*GenesisState) Marshal

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

func (*GenesisState) MarshalTo

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

func (*GenesisState) MarshalToSizedBuffer

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

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

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

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

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

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

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

func (*GenesisState) XXX_Merge

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

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

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

type MsgClient

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

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

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

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

func (*MsgDeposit) MarshalTo

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

func (*MsgDeposit) MarshalToSizedBuffer

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

func (*MsgDeposit) ProtoMessage

func (*MsgDeposit) ProtoMessage()

func (*MsgDeposit) Reset

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

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

func (*MsgDeposit) String

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

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

func (m *MsgDeposit) XXX_DiscardUnknown()

func (*MsgDeposit) XXX_Marshal

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

func (*MsgDeposit) XXX_Merge

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

func (*MsgDeposit) XXX_Size

func (m *MsgDeposit) XXX_Size() int

func (*MsgDeposit) XXX_Unmarshal

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

type MsgDepositResponse

type MsgDepositResponse struct {
}

MsgDepositResponse defines the Msg/Deposit response type.

func (*MsgDepositResponse) Descriptor

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

func (*MsgDepositResponse) Marshal

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

func (*MsgDepositResponse) MarshalTo

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

func (*MsgDepositResponse) MarshalToSizedBuffer

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

func (*MsgDepositResponse) ProtoMessage

func (*MsgDepositResponse) ProtoMessage()

func (*MsgDepositResponse) Reset

func (m *MsgDepositResponse) Reset()

func (*MsgDepositResponse) Size

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

func (*MsgDepositResponse) String

func (m *MsgDepositResponse) String() string

func (*MsgDepositResponse) Unmarshal

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

func (*MsgDepositResponse) XXX_DiscardUnknown

func (m *MsgDepositResponse) XXX_DiscardUnknown()

func (*MsgDepositResponse) XXX_Marshal

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

func (*MsgDepositResponse) XXX_Merge

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

func (*MsgDepositResponse) XXX_Size

func (m *MsgDepositResponse) XXX_Size() int

func (*MsgDepositResponse) XXX_Unmarshal

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

type MsgServer

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

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

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

func (*MsgSwapExactForTokens) MarshalTo

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

func (*MsgSwapExactForTokens) MarshalToSizedBuffer

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

func (*MsgSwapExactForTokens) ProtoMessage

func (*MsgSwapExactForTokens) ProtoMessage()

func (*MsgSwapExactForTokens) Reset

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

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

func (*MsgSwapExactForTokens) String

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

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

func (m *MsgSwapExactForTokens) XXX_DiscardUnknown()

func (*MsgSwapExactForTokens) XXX_Marshal

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

func (*MsgSwapExactForTokens) XXX_Merge

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

func (*MsgSwapExactForTokens) XXX_Size

func (m *MsgSwapExactForTokens) XXX_Size() int

func (*MsgSwapExactForTokens) XXX_Unmarshal

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

type MsgSwapExactForTokensResponse

type MsgSwapExactForTokensResponse struct {
}

MsgSwapExactForTokensResponse defines the Msg/SwapExactForTokens response type.

func (*MsgSwapExactForTokensResponse) Descriptor

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

func (*MsgSwapExactForTokensResponse) Marshal

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

func (*MsgSwapExactForTokensResponse) MarshalTo

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

func (*MsgSwapExactForTokensResponse) MarshalToSizedBuffer

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

func (*MsgSwapExactForTokensResponse) ProtoMessage

func (*MsgSwapExactForTokensResponse) ProtoMessage()

func (*MsgSwapExactForTokensResponse) Reset

func (m *MsgSwapExactForTokensResponse) Reset()

func (*MsgSwapExactForTokensResponse) Size

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

func (*MsgSwapExactForTokensResponse) String

func (*MsgSwapExactForTokensResponse) Unmarshal

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

func (*MsgSwapExactForTokensResponse) XXX_DiscardUnknown

func (m *MsgSwapExactForTokensResponse) XXX_DiscardUnknown()

func (*MsgSwapExactForTokensResponse) XXX_Marshal

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

func (*MsgSwapExactForTokensResponse) XXX_Merge

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

func (*MsgSwapExactForTokensResponse) XXX_Size

func (m *MsgSwapExactForTokensResponse) XXX_Size() int

func (*MsgSwapExactForTokensResponse) XXX_Unmarshal

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

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

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

func (*MsgSwapForExactTokens) MarshalTo

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

func (*MsgSwapForExactTokens) MarshalToSizedBuffer

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

func (*MsgSwapForExactTokens) ProtoMessage

func (*MsgSwapForExactTokens) ProtoMessage()

func (*MsgSwapForExactTokens) Reset

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

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

func (*MsgSwapForExactTokens) String

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

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

func (m *MsgSwapForExactTokens) XXX_DiscardUnknown()

func (*MsgSwapForExactTokens) XXX_Marshal

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

func (*MsgSwapForExactTokens) XXX_Merge

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

func (*MsgSwapForExactTokens) XXX_Size

func (m *MsgSwapForExactTokens) XXX_Size() int

func (*MsgSwapForExactTokens) XXX_Unmarshal

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

type MsgSwapForExactTokensResponse

type MsgSwapForExactTokensResponse struct {
}

MsgSwapForExactTokensResponse defines the Msg/SwapForExactTokensResponse response type.

func (*MsgSwapForExactTokensResponse) Descriptor

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

func (*MsgSwapForExactTokensResponse) Marshal

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

func (*MsgSwapForExactTokensResponse) MarshalTo

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

func (*MsgSwapForExactTokensResponse) MarshalToSizedBuffer

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

func (*MsgSwapForExactTokensResponse) ProtoMessage

func (*MsgSwapForExactTokensResponse) ProtoMessage()

func (*MsgSwapForExactTokensResponse) Reset

func (m *MsgSwapForExactTokensResponse) Reset()

func (*MsgSwapForExactTokensResponse) Size

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

func (*MsgSwapForExactTokensResponse) String

func (*MsgSwapForExactTokensResponse) Unmarshal

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

func (*MsgSwapForExactTokensResponse) XXX_DiscardUnknown

func (m *MsgSwapForExactTokensResponse) XXX_DiscardUnknown()

func (*MsgSwapForExactTokensResponse) XXX_Marshal

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

func (*MsgSwapForExactTokensResponse) XXX_Merge

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

func (*MsgSwapForExactTokensResponse) XXX_Size

func (m *MsgSwapForExactTokensResponse) XXX_Size() int

func (*MsgSwapForExactTokensResponse) XXX_Unmarshal

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

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

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

func (*MsgWithdraw) MarshalTo

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

func (*MsgWithdraw) MarshalToSizedBuffer

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

func (*MsgWithdraw) ProtoMessage

func (*MsgWithdraw) ProtoMessage()

func (*MsgWithdraw) Reset

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

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

func (*MsgWithdraw) String

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

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

func (m *MsgWithdraw) XXX_DiscardUnknown()

func (*MsgWithdraw) XXX_Marshal

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

func (*MsgWithdraw) XXX_Merge

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

func (*MsgWithdraw) XXX_Size

func (m *MsgWithdraw) XXX_Size() int

func (*MsgWithdraw) XXX_Unmarshal

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

type MsgWithdrawResponse

type MsgWithdrawResponse struct {
}

MsgWithdrawResponse defines the Msg/Withdraw response type.

func (*MsgWithdrawResponse) Descriptor

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

func (*MsgWithdrawResponse) Marshal

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

func (*MsgWithdrawResponse) MarshalTo

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

func (*MsgWithdrawResponse) MarshalToSizedBuffer

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

func (*MsgWithdrawResponse) ProtoMessage

func (*MsgWithdrawResponse) ProtoMessage()

func (*MsgWithdrawResponse) Reset

func (m *MsgWithdrawResponse) Reset()

func (*MsgWithdrawResponse) Size

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

func (*MsgWithdrawResponse) String

func (m *MsgWithdrawResponse) String() string

func (*MsgWithdrawResponse) Unmarshal

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

func (*MsgWithdrawResponse) XXX_DiscardUnknown

func (m *MsgWithdrawResponse) XXX_DiscardUnknown()

func (*MsgWithdrawResponse) XXX_Marshal

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

func (*MsgWithdrawResponse) XXX_Merge

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

func (*MsgWithdrawResponse) XXX_Size

func (m *MsgWithdrawResponse) XXX_Size() int

func (*MsgWithdrawResponse) XXX_Unmarshal

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

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

func (*Params) GetAllowedPools

func (m *Params) GetAllowedPools() AllowedPools

func (*Params) Marshal

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

func (*Params) MarshalTo

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

func (*Params) MarshalToSizedBuffer

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

func (*Params) ParamSetPairs

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

ParamSetPairs implements params.ParamSet

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

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

func (Params) String

func (p Params) String() string

String implements fmt.Stringer

func (*Params) Unmarshal

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

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

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

func (*Params) XXX_Merge

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

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

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

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

func (*PoolRecord) GetPoolID

func (m *PoolRecord) GetPoolID() string

func (*PoolRecord) GetReservesA

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

func (*PoolRecord) GetReservesB

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

func (*PoolRecord) Marshal

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

func (*PoolRecord) MarshalTo

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

func (*PoolRecord) MarshalToSizedBuffer

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

func (*PoolRecord) ProtoMessage

func (*PoolRecord) ProtoMessage()

func (PoolRecord) Reserves

func (p PoolRecord) Reserves() sdk.Coins

Reserves returns the total reserves for a pool

func (*PoolRecord) Reset

func (m *PoolRecord) Reset()

func (*PoolRecord) Size

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

func (*PoolRecord) String

func (m *PoolRecord) String() string

func (*PoolRecord) Unmarshal

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

func (m *PoolRecord) XXX_DiscardUnknown()

func (*PoolRecord) XXX_Marshal

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

func (*PoolRecord) XXX_Merge

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

func (*PoolRecord) XXX_Size

func (m *PoolRecord) XXX_Size() int

func (*PoolRecord) XXX_Unmarshal

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

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

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

func (*PoolResponse) Marshal

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

func (*PoolResponse) MarshalTo

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

func (*PoolResponse) MarshalToSizedBuffer

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

func (*PoolResponse) ProtoMessage

func (*PoolResponse) ProtoMessage()

func (*PoolResponse) Reset

func (m *PoolResponse) Reset()

func (*PoolResponse) Size

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

func (*PoolResponse) String

func (m *PoolResponse) String() string

func (*PoolResponse) Unmarshal

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

func (*PoolResponse) XXX_DiscardUnknown

func (m *PoolResponse) XXX_DiscardUnknown()

func (*PoolResponse) XXX_Marshal

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

func (*PoolResponse) XXX_Merge

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

func (*PoolResponse) XXX_Size

func (m *PoolResponse) XXX_Size() int

func (*PoolResponse) XXX_Unmarshal

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

type PoolStatsQueryResult

type PoolStatsQueryResult struct {
	Name        string      `json:"name" yaml:"name"`
	Coins       sdk.Coins   `json:"coins" yaml:"coins"`
	TotalShares sdkmath.Int `json:"total_shares" yaml:"total_shares"`
}

PoolStatsQueryResult contains the result of a pool query

func NewPoolStatsQueryResult

func NewPoolStatsQueryResult(name string, coins sdk.Coins, totalShares sdkmath.Int) PoolStatsQueryResult

NewPoolStatsQueryResult creates a new PoolStatsQueryResult

type PoolStatsQueryResults

type PoolStatsQueryResults []PoolStatsQueryResult

PoolStatsQueryResults is a slice of PoolStatsQueryResult

type QueryClient

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

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryDepositsParams

type QueryDepositsParams struct {
	Page  int            `json:"page" yaml:"page"`
	Limit int            `json:"limit" yaml:"limit"`
	Owner sdk.AccAddress `json:"owner" yaml:"owner"`
	Pool  string         `json:"pool" yaml:"pool"`
}

QueryDepositsParams is the params for a filtered deposits query

func NewQueryDepositsParams

func NewQueryDepositsParams(page, limit int, owner sdk.AccAddress, pool string) QueryDepositsParams

NewQueryDepositsParams creates a new QueryDepositsParams

type QueryDepositsRequest

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

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

func (*QueryDepositsRequest) Marshal

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

func (*QueryDepositsRequest) MarshalTo

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

func (*QueryDepositsRequest) MarshalToSizedBuffer

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

func (*QueryDepositsRequest) ProtoMessage

func (*QueryDepositsRequest) ProtoMessage()

func (*QueryDepositsRequest) Reset

func (m *QueryDepositsRequest) Reset()

func (*QueryDepositsRequest) Size

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

func (*QueryDepositsRequest) String

func (m *QueryDepositsRequest) String() string

func (*QueryDepositsRequest) Unmarshal

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

func (*QueryDepositsRequest) XXX_DiscardUnknown

func (m *QueryDepositsRequest) XXX_DiscardUnknown()

func (*QueryDepositsRequest) XXX_Marshal

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

func (*QueryDepositsRequest) XXX_Merge

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

func (*QueryDepositsRequest) XXX_Size

func (m *QueryDepositsRequest) XXX_Size() int

func (*QueryDepositsRequest) XXX_Unmarshal

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

type QueryDepositsResponse

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

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

func (*QueryDepositsResponse) Marshal

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

func (*QueryDepositsResponse) MarshalTo

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

func (*QueryDepositsResponse) MarshalToSizedBuffer

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

func (*QueryDepositsResponse) ProtoMessage

func (*QueryDepositsResponse) ProtoMessage()

func (*QueryDepositsResponse) Reset

func (m *QueryDepositsResponse) Reset()

func (*QueryDepositsResponse) Size

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

func (*QueryDepositsResponse) String

func (m *QueryDepositsResponse) String() string

func (*QueryDepositsResponse) Unmarshal

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

func (*QueryDepositsResponse) XXX_DiscardUnknown

func (m *QueryDepositsResponse) XXX_DiscardUnknown()

func (*QueryDepositsResponse) XXX_Marshal

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

func (*QueryDepositsResponse) XXX_Merge

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

func (*QueryDepositsResponse) XXX_Size

func (m *QueryDepositsResponse) XXX_Size() int

func (*QueryDepositsResponse) XXX_Unmarshal

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

type QueryParamsRequest

type QueryParamsRequest struct {
}

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

func (*QueryParamsRequest) Descriptor

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

func (*QueryParamsRequest) Marshal

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

func (*QueryParamsRequest) MarshalTo

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

func (*QueryParamsRequest) MarshalToSizedBuffer

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

func (*QueryParamsRequest) ProtoMessage

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size

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

func (*QueryParamsRequest) String

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal

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

func (*QueryParamsRequest) XXX_DiscardUnknown

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal

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

func (*QueryParamsRequest) XXX_Merge

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

func (*QueryParamsRequest) XXX_Size

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal

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

type QueryParamsResponse

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

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

func (*QueryParamsResponse) Marshal

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

func (*QueryParamsResponse) MarshalTo

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

func (*QueryParamsResponse) MarshalToSizedBuffer

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

func (*QueryParamsResponse) ProtoMessage

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size

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

func (*QueryParamsResponse) String

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal

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

func (*QueryParamsResponse) XXX_DiscardUnknown

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal

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

func (*QueryParamsResponse) XXX_Merge

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

func (*QueryParamsResponse) XXX_Size

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal

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

type QueryPoolParams

type QueryPoolParams struct {
	Pool string `json:"pool" yaml:"pool"`
}

QueryPoolParams is the params for a pool query

func NewQueryPoolParams

func NewQueryPoolParams(pool string) QueryPoolParams

NewQueryPoolParams creates a new QueryPoolParams

type QueryPoolsRequest

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

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

func (*QueryPoolsRequest) GetPagination

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

func (*QueryPoolsRequest) GetPoolId

func (m *QueryPoolsRequest) GetPoolId() string

func (*QueryPoolsRequest) Marshal

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

func (*QueryPoolsRequest) MarshalTo

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

func (*QueryPoolsRequest) MarshalToSizedBuffer

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

func (*QueryPoolsRequest) ProtoMessage

func (*QueryPoolsRequest) ProtoMessage()

func (*QueryPoolsRequest) Reset

func (m *QueryPoolsRequest) Reset()

func (*QueryPoolsRequest) Size

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

func (*QueryPoolsRequest) String

func (m *QueryPoolsRequest) String() string

func (*QueryPoolsRequest) Unmarshal

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

func (*QueryPoolsRequest) XXX_DiscardUnknown

func (m *QueryPoolsRequest) XXX_DiscardUnknown()

func (*QueryPoolsRequest) XXX_Marshal

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

func (*QueryPoolsRequest) XXX_Merge

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

func (*QueryPoolsRequest) XXX_Size

func (m *QueryPoolsRequest) XXX_Size() int

func (*QueryPoolsRequest) XXX_Unmarshal

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

type QueryPoolsResponse

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

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

func (*QueryPoolsResponse) GetPagination

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

func (*QueryPoolsResponse) GetPools

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

func (*QueryPoolsResponse) Marshal

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

func (*QueryPoolsResponse) MarshalTo

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

func (*QueryPoolsResponse) MarshalToSizedBuffer

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

func (*QueryPoolsResponse) ProtoMessage

func (*QueryPoolsResponse) ProtoMessage()

func (*QueryPoolsResponse) Reset

func (m *QueryPoolsResponse) Reset()

func (*QueryPoolsResponse) Size

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

func (*QueryPoolsResponse) String

func (m *QueryPoolsResponse) String() string

func (*QueryPoolsResponse) Unmarshal

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

func (*QueryPoolsResponse) XXX_DiscardUnknown

func (m *QueryPoolsResponse) XXX_DiscardUnknown()

func (*QueryPoolsResponse) XXX_Marshal

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

func (*QueryPoolsResponse) XXX_Merge

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

func (*QueryPoolsResponse) XXX_Size

func (m *QueryPoolsResponse) XXX_Size() int

func (*QueryPoolsResponse) XXX_Unmarshal

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

type QueryServer

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

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

func (*ShareRecord) GetDepositor

func (*ShareRecord) GetPoolID

func (m *ShareRecord) GetPoolID() string

func (*ShareRecord) Marshal

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

func (*ShareRecord) MarshalTo

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

func (*ShareRecord) MarshalToSizedBuffer

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

func (*ShareRecord) ProtoMessage

func (*ShareRecord) ProtoMessage()

func (*ShareRecord) Reset

func (m *ShareRecord) Reset()

func (*ShareRecord) Size

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

func (*ShareRecord) String

func (m *ShareRecord) String() string

func (*ShareRecord) Unmarshal

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

func (m *ShareRecord) XXX_DiscardUnknown()

func (*ShareRecord) XXX_Marshal

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

func (*ShareRecord) XXX_Merge

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

func (*ShareRecord) XXX_Size

func (m *ShareRecord) XXX_Size() int

func (*ShareRecord) XXX_Unmarshal

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

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) Deposit

func (*UnimplementedMsgServer) SwapExactForTokens

func (*UnimplementedMsgServer) SwapForExactTokens

func (*UnimplementedMsgServer) Withdraw

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Deposits

func (*UnimplementedQueryServer) Params

func (*UnimplementedQueryServer) Pools

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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