types

package
v0.0.0-...-17765ca Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCodespace string = ModuleName

	CodeInvalidInput                       uint32 = 66000
	CodePoolAlreadyExist                   uint32 = 66001
	CodeNoFarmPoolFound                    uint32 = 66002
	CodePoolNotInWhiteList                 uint32 = 66003
	CodeInvalidLockInfo                    uint32 = 66004
	CodeTokenNotExist                      uint32 = 66005
	CodePoolNotFinished                    uint32 = 66006
	CodeUnexpectedProposalType             uint32 = 66007
	CodeInvalidAddress                     uint32 = 66008
	CodeRemainingAmountNotZero             uint32 = 66009
	CodeInvalidPoolOwner                   uint32 = 66010
	CodeInvalidDenom                       uint32 = 66011
	CodeSendCoinsFromAccountToModuleFailed uint32 = 66012
	CodeUnknownFarmMsgType                 uint32 = 66013
	CodeUnknownFarmQueryType               uint32 = 66014
	CodeInvalidInputAmount                 uint32 = 66015
	CodeInsufficientAmount                 uint32 = 66016
	CodeInvalidStartHeight                 uint32 = 66017
	CodePoolNameLength                     uint32 = 66018
	CodeLockAmountBelowMinimum             uint32 = 66019
	CodeSendCoinsFromModuleToAccountFailed uint32 = 66020
	CodeSwapTokenPairNotExist              uint32 = 66021
)
View Source
const (
	EventTypeCreatePool  = "create-pool"
	EventTypeDestroyPool = "destroy-pool"
	EventTypeProvide     = "provide"
	EventTypeLock        = "lock"
	EventTypeUnlock      = "unlock"
	EventTypeClaim       = "claim"

	AttributeKeyAddress             = "address"
	AttributeKeyPool                = "pool"
	AttributeKeyStartHeightToYield  = "start_height_to_yield"
	AttributeKeyAmountYieldPerBlock = "amount_yield_per_block"
	AttributeKeyMinLockAmount       = "min_lock_amount"
	AttributeKeyYieldToken          = "yield_token"
	AttributeKeyDeposit             = "deposit"
	AttributeKeyWithdraw            = "withdraw"
	AttributeKeyClaimed             = "claimed"

	AttributeValueCategory = ModuleName
)

farm module event types

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "farm"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName

	// TStoreKey is the string transient store representation
	TStoreKey = "transient_" + ModuleName

	// RouterKey to be used for routing msgs
	RouterKey = ModuleName

	// MintFarmingAccount as module account to be used for saving all mint farming tokens
	MintFarmingAccount = "mint_farming_account"

	// YieldFarmingAccount as module account to be used for saving all yield farming tokens
	YieldFarmingAccount = "yield_farming_account"

	// QuerierRoute to be used for querier msgs
	QuerierRoute = ModuleName

	// Byte length of period occupied
	PeriodByteArrayLength = 8
)
View Source
const (
	QueryPool             = "pool"
	QueryPools            = "pools"
	QueryEarnings         = "earnings"
	QueryLockInfo         = "lock-info"
	QueryParameters       = "parameters"
	QueryWhitelist        = "whitelist"
	QueryAccount          = "account"
	QueryAccountsLockedTo = "accounts-locked-to"
	QueryPoolNum          = "pool-num"
)
View Source
const (
	DefaultParamspace = ModuleName
)

Default parameter namespace

View Source
const (
	MaxPoolNameLength = 128
)

Variables

View Source
var (
	FarmPoolPrefix              = []byte{0x01}
	Pool2AddressPrefix          = []byte{0x02}
	Address2PoolPrefix          = []byte{0x03}
	PoolsYieldNativeTokenPrefix = []byte{0x04}
	PoolHistoricalRewardsPrefix = []byte{0x05}
	PoolCurrentRewardsPrefix    = []byte{0x06}
)
View Source
var (
	KeyQuoteSymbol       = []byte("QuoteSymbol")
	KeyCreatePoolFee     = []byte("CreatePoolFee")
	KeyCreatePoolDeposit = []byte("CreatePoolDeposit")
)

Parameter store keys

View Source
var ModuleCdc *codec.Codec

ModuleCdc defines the module codec

Functions

func ErrInsufficientAmount

func ErrInsufficientAmount(amount string, inputAmount string) sdk.EnvelopedErr

ErrInsufficientAmount returns an error when there is no enough tokens

func ErrInvalidDenom

func ErrInvalidDenom(symbolLocked string, token string) sdk.EnvelopedErr

ErrInvalidDenom returns an error when it provides an unmatched token name

func ErrInvalidInput

func ErrInvalidInput(msg string) sdk.EnvelopedErr

ErrInvalidInput returns an error when an input parameter is invalid

func ErrInvalidInputAmount

func ErrInvalidInputAmount(amount string) sdk.EnvelopedErr

ErrInvalidInputAmount returns an error when an input amount is invaild

func ErrInvalidPoolOwner

func ErrInvalidPoolOwner(address string, poolName string) sdk.EnvelopedErr

ErrInvalidPoolOwner returns an error when an input address is not the owner of pool

func ErrInvalidStartHeight

func ErrInvalidStartHeight() sdk.EnvelopedErr

ErrInvalidStartHeight returns an error when the start_height_to_yield parameter is invalid

func ErrLockAmountBelowMinimum

func ErrLockAmountBelowMinimum(minLockAmount, amount sdk.Dec) sdk.EnvelopedErr

ErrLockAmountBelowMinimum returns an error when lock amount belows minimum

func ErrNilAddress

func ErrNilAddress() sdk.EnvelopedErr

ErrNilAddress returns an error when an empty address appears

func ErrNoFarmPoolFound

func ErrNoFarmPoolFound(poolName string) sdk.EnvelopedErr

ErrNoFarmPoolFound returns an error when a farm pool doesn't exist

func ErrNoLockInfoFound

func ErrNoLockInfoFound(addr string, pool string) sdk.EnvelopedErr

ErrNoLockInfoFound returns an error when an address doesn't have any lock infos

func ErrPoolAlreadyExist

func ErrPoolAlreadyExist(poolName string) sdk.EnvelopedErr

ErrPoolAlreadyExist returns an error when a pool exist

func ErrPoolNameLength

func ErrPoolNameLength(poolName string, got, max int) sdk.EnvelopedErr

ErrPoolNameLength returns an error when length of pool name is invalid

func ErrPoolNameNotExistedInWhiteList

func ErrPoolNameNotExistedInWhiteList(poolName string) sdk.EnvelopedErr

ErrPoolNameNotExistedInWhiteList returns an error when the pool name is not existed in the white list

func ErrPoolNotFinished

func ErrPoolNotFinished(poolName string) sdk.EnvelopedErr

ErrPoolNotFinished returns an error when the pool is not finished and can not be destroyed

func ErrRemainingAmountNotZero

func ErrRemainingAmountNotZero(amount string) sdk.EnvelopedErr

ErrRemainingAmountNotZero returns an error when the remaining amount in yieldedTokenInfo is not zero

func ErrSendCoinsFromAccountToModuleFailed

func ErrSendCoinsFromAccountToModuleFailed(content string) sdk.EnvelopedErr

func ErrSendCoinsFromModuleToAccountFailed

func ErrSendCoinsFromModuleToAccountFailed(content string) sdk.EnvelopedErr

func ErrSwapTokenPairNotExist

func ErrSwapTokenPairNotExist(tokenName string) sdk.EnvelopedErr

ErrSwapTokenPairNotExist returns an error when a swap token pair not exists

func ErrTokenNotExist

func ErrTokenNotExist(tokenName string) sdk.EnvelopedErr

ErrTokenNotExist returns an error when a token not exists

func ErrUnexpectedProposalType

func ErrUnexpectedProposalType(proposalType string) sdk.EnvelopedErr

ErrUnexpectedProposalType returns an error when the proposal type is not supported in farm module

func ErrUnknownFarmMsgType

func ErrUnknownFarmMsgType(content string) sdk.EnvelopedErr

func ErrUnknownFarmQueryType

func ErrUnknownFarmQueryType(content string) sdk.EnvelopedErr

func GetAddressInFarmPoolKey

func GetAddressInFarmPoolKey(poolName string, addr sdk.AccAddress) []byte

func GetFarmPoolKey

func GetFarmPoolKey(poolName string) []byte

func GetLockInfoKey

func GetLockInfoKey(addr sdk.AccAddress, poolName string) []byte

func GetPoolCurrentRewardsKey

func GetPoolCurrentRewardsKey(poolName string) []byte

GetPoolCurrentRewardsKey gets the key for a pool's current period reward

func GetPoolHistoricalRewardsKey

func GetPoolHistoricalRewardsKey(poolName string, period uint64) []byte

GetPoolHistoricalRewardsKey gets the key for a pool's historical reward

func GetPoolHistoricalRewardsPrefix

func GetPoolHistoricalRewardsPrefix(poolName string) []byte

GetPoolHistoricalRewardsPrefix gets the prefix key with pool name for a pool's historical rewards

func GetWhitelistMemberKey

func GetWhitelistMemberKey(poolName string) []byte

GetWhitelistMemberKey builds the key for a available pool name

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable for farm module

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on codec

func SplitPoolNameFromLockInfoKey

func SplitPoolNameFromLockInfoKey(lockInfoKey []byte) string

SplitPoolNameFromLockInfoKey splits the pool name out from a LockInfoKey

func SplitPoolsYieldNativeTokenKey

func SplitPoolsYieldNativeTokenKey(keyWithPrefix []byte) (poolName string)

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis validates the farm genesis parameters

Types

type AccAddrList

type AccAddrList []sdk.AccAddress

AccAddrList is the type alias for []sdk.AccAddress

func (AccAddrList) String

func (aal AccAddrList) String() string

String returns a human readable string representation of AccAddrList

type BackendKeeper

type BackendKeeper interface {
	OnFarmClaim(ctx sdk.Context, address sdk.AccAddress, poolName string, claimedCoins sdk.SysCoins)
}

type CodeType

type CodeType = uint32

type Earnings

type Earnings struct {
	TargetBlockHeight int64        `json:"target_block_height"`
	AmountLocked      sdk.SysCoin  `json:"amount_locked"`
	AmountYielded     sdk.SysCoins `json:"amount_yielded"`
}

Earnings - structure for a earning query

func NewEarnings

func NewEarnings(targetBlockHeight int64, amountLocked sdk.SysCoin, amountYielded sdk.SysCoins) Earnings

NewEarnings creates a new instance of Earnings

func (Earnings) String

func (e Earnings) String() string

String returns a human readable string representation of Earnings

type FarmPool

type FarmPool struct {
	Owner         sdk.AccAddress `json:"owner"`
	Name          string         `json:"name"`
	MinLockAmount sdk.SysCoin    `json:"min_lock_amount"`
	DepositAmount sdk.SysCoin    `json:"deposit_amount"`
	// sum of LockInfo.Amount
	TotalValueLocked        sdk.SysCoin       `json:"total_value_locked"`
	YieldedTokenInfos       YieldedTokenInfos `json:"yielded_token_infos"`
	TotalAccumulatedRewards sdk.SysCoins      `json:"total_accumulated_rewards"`
}

FarmPool is the pool where an address can lock specified token to yield other tokens

func NewFarmPool

func NewFarmPool(
	owner sdk.AccAddress, name string, minLockAmount sdk.SysCoin, depositAmount, totalValueLocked sdk.SysCoin,
	yieldedTokenInfos YieldedTokenInfos, accumulatedRewards sdk.SysCoins,
) FarmPool

NewFarmPool creates a new instance of FarmPool

func (FarmPool) Finished

func (fp FarmPool) Finished() bool

func (FarmPool) String

func (fp FarmPool) String() string

String returns a human readable string representation of FarmPool

type FarmPools

type FarmPools []FarmPool

FarmPools is a collection of FarmPool

func (FarmPools) String

func (fps FarmPools) String() (out string)

String returns a human readable string representation of FarmPools

type GenesisState

type GenesisState struct {
	Pools                 FarmPools                     `json:"pools" yaml:"pools"`
	LockInfos             []LockInfo                    `json:"lock_infos" yaml:"lock_infos"`
	PoolHistoricalRewards []PoolHistoricalRewardsRecord `json:"historical_rewards" yaml:"historical_rewards"`
	PoolCurrentRewards    []PoolCurrentRewardsRecord    `json:"current_rewards" yaml:"current_rewards"`
	WhiteList             PoolNameList                  `json:"pools_yield_native_token" yaml:"pools_yield_native_token"`
	Params                Params                        `json:"params" yaml:"params"`
}

GenesisState - all farm state that must be provided at genesis

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState - default GenesisState used by Cosmos Hub

func NewGenesisState

func NewGenesisState(pools FarmPools, lockInfos []LockInfo, histories []PoolHistoricalRewardsRecord,
	currents []PoolCurrentRewardsRecord, whiteList PoolNameList, params Params,
) GenesisState

NewGenesisState creates a new GenesisState object

type LockInfo

type LockInfo struct {
	Owner            sdk.AccAddress `json:"owner"`
	PoolName         string         `json:"pool_name"`
	Amount           sdk.SysCoin    `json:"amount"`
	StartBlockHeight int64          `json:"start_block_height"`
	ReferencePeriod  uint64         `json:"reference_period"`
}

LockInfo is locked info of an address

func NewLockInfo

func NewLockInfo(owner sdk.AccAddress, poolName string, amount sdk.SysCoin, startBlockHeight int64, referencePeriod uint64) LockInfo

NewLockInfo creates a new instance of LockInfo

func (LockInfo) String

func (li LockInfo) String() string

String returns a human readable string representation of LockInfo

type LockInfoRecord

type LockInfoRecord struct {
	PoolName    string         `json:"pool_name" yaml:"pool_name"`
	LockAddress sdk.AccAddress `json:"lock_address" yaml:"lock_address"`
	LockInfo    LockInfo       `json:"lock_info" yaml:"lock_info"`
}

used for import / export via genesis json

type ManageWhiteListProposal

type ManageWhiteListProposal struct {
	Title       string `json:"title" yaml:"title"`
	Description string `json:"description" yaml:"description"`
	PoolName    string `json:"pool_name" yaml:"pool_name"`
	IsAdded     bool   `json:"is_added" yaml:"is_added"`
}

ManageWhiteListProposal - structure for the proposal to add or delete a pool name from white list

func NewManageWhiteListProposal

func NewManageWhiteListProposal(title, description, poolName string, isAdded bool) ManageWhiteListProposal

NewManageWhiteListProposal creates a new instance of ManageWhiteListProposal

func (ManageWhiteListProposal) GetDescription

func (mp ManageWhiteListProposal) GetDescription() string

GetDescription returns description of a manage white list proposal object

func (ManageWhiteListProposal) GetTitle

func (mp ManageWhiteListProposal) GetTitle() string

GetTitle returns title of a manage white list proposal object

func (ManageWhiteListProposal) ProposalRoute

func (mp ManageWhiteListProposal) ProposalRoute() string

ProposalRoute returns route key of a manage white list proposal object

func (ManageWhiteListProposal) ProposalType

func (mp ManageWhiteListProposal) ProposalType() string

ProposalType returns type of a manage white list proposal object

func (ManageWhiteListProposal) String

func (mp ManageWhiteListProposal) String() string

String returns a human readable string representation of a ManageWhiteListProposal

func (ManageWhiteListProposal) ValidateBasic

func (mp ManageWhiteListProposal) ValidateBasic() sdk.Error

ValidateBasic validates a manage white list proposal

type MsgClaim

type MsgClaim struct {
	PoolName string         `json:"pool_name" yaml:"pool_name"`
	Address  sdk.AccAddress `json:"address" yaml:"address"`
}

func NewMsgClaim

func NewMsgClaim(poolName string, address sdk.AccAddress) MsgClaim

func (MsgClaim) GetSignBytes

func (m MsgClaim) GetSignBytes() []byte

func (MsgClaim) GetSigners

func (m MsgClaim) GetSigners() []sdk.AccAddress

func (MsgClaim) Route

func (m MsgClaim) Route() string

func (MsgClaim) Type

func (m MsgClaim) Type() string

func (MsgClaim) ValidateBasic

func (m MsgClaim) ValidateBasic() sdk.Error

type MsgCreatePool

type MsgCreatePool struct {
	Owner         sdk.AccAddress `json:"owner" yaml:"owner"`
	PoolName      string         `json:"pool_name" yaml:"pool_name"`
	MinLockAmount sdk.SysCoin    `json:"min_lock_amount" yaml:"min_lock_amount"`
	YieldedSymbol string         `json:"yielded_symbol"  yaml:"yielded_symbol"`
}

func NewMsgCreatePool

func NewMsgCreatePool(address sdk.AccAddress, poolName string, minLockAmount sdk.SysCoin, yieldedSymbol string) MsgCreatePool

func (MsgCreatePool) GetSignBytes

func (m MsgCreatePool) GetSignBytes() []byte

func (MsgCreatePool) GetSigners

func (m MsgCreatePool) GetSigners() []sdk.AccAddress

func (MsgCreatePool) Route

func (m MsgCreatePool) Route() string

func (MsgCreatePool) Type

func (m MsgCreatePool) Type() string

func (MsgCreatePool) ValidateBasic

func (m MsgCreatePool) ValidateBasic() sdk.Error

type MsgDestroyPool

type MsgDestroyPool struct {
	Owner    sdk.AccAddress `json:"owner" yaml:"owner"`
	PoolName string         `json:"pool_name" yaml:"pool_name"`
}

func NewMsgDestroyPool

func NewMsgDestroyPool(address sdk.AccAddress, poolName string) MsgDestroyPool

func (MsgDestroyPool) GetSignBytes

func (m MsgDestroyPool) GetSignBytes() []byte

func (MsgDestroyPool) GetSigners

func (m MsgDestroyPool) GetSigners() []sdk.AccAddress

func (MsgDestroyPool) Route

func (m MsgDestroyPool) Route() string

func (MsgDestroyPool) Type

func (m MsgDestroyPool) Type() string

func (MsgDestroyPool) ValidateBasic

func (m MsgDestroyPool) ValidateBasic() sdk.Error

type MsgLock

type MsgLock struct {
	PoolName string         `json:"pool_name" yaml:"pool_name"`
	Address  sdk.AccAddress `json:"address" yaml:"address"`
	Amount   sdk.SysCoin    `json:"amount" yaml:"amount"`
}

func NewMsgLock

func NewMsgLock(poolName string, address sdk.AccAddress, amount sdk.SysCoin) MsgLock

func (MsgLock) GetSignBytes

func (m MsgLock) GetSignBytes() []byte

func (MsgLock) GetSigners

func (m MsgLock) GetSigners() []sdk.AccAddress

func (MsgLock) Route

func (m MsgLock) Route() string

func (MsgLock) Type

func (m MsgLock) Type() string

func (MsgLock) ValidateBasic

func (m MsgLock) ValidateBasic() sdk.Error

type MsgProvide

type MsgProvide struct {
	PoolName              string         `json:"pool_name" yaml:"pool_name"`
	Address               sdk.AccAddress `json:"address" yaml:"address"`
	Amount                sdk.SysCoin    `json:"amount" yaml:"amount"`
	AmountYieldedPerBlock sdk.Dec        `json:"amount_yielded_per_block" yaml:"amount_yielded_per_block"`
	StartHeightToYield    int64          `json:"start_height_to_yield" yaml:"start_height_to_yield"`
}

func NewMsgProvide

func NewMsgProvide(poolName string, address sdk.AccAddress, amount sdk.SysCoin,
	amountYieldedPerBlock sdk.Dec, startHeightToYield int64) MsgProvide

func (MsgProvide) GetSignBytes

func (m MsgProvide) GetSignBytes() []byte

func (MsgProvide) GetSigners

func (m MsgProvide) GetSigners() []sdk.AccAddress

func (MsgProvide) Route

func (m MsgProvide) Route() string

func (MsgProvide) Type

func (m MsgProvide) Type() string

func (MsgProvide) ValidateBasic

func (m MsgProvide) ValidateBasic() sdk.Error

type MsgSetWhite

type MsgSetWhite struct {
	PoolName string         `json:"pool_name" yaml:"pool_name"`
	Address  sdk.AccAddress `json:"address" yaml:"address"`
}

func NewMsgSetWhite

func NewMsgSetWhite(poolName string, address sdk.AccAddress) MsgSetWhite

func (MsgSetWhite) GetSignBytes

func (m MsgSetWhite) GetSignBytes() []byte

func (MsgSetWhite) GetSigners

func (m MsgSetWhite) GetSigners() []sdk.AccAddress

func (MsgSetWhite) Route

func (m MsgSetWhite) Route() string

func (MsgSetWhite) Type

func (m MsgSetWhite) Type() string

func (MsgSetWhite) ValidateBasic

func (m MsgSetWhite) ValidateBasic() sdk.Error

type MsgUnlock

type MsgUnlock struct {
	PoolName string         `json:"pool_name" yaml:"pool_name"`
	Address  sdk.AccAddress `json:"address" yaml:"address"`
	Amount   sdk.SysCoin    `json:"amount" yaml:"amount"`
}

func NewMsgUnlock

func NewMsgUnlock(poolName string, address sdk.AccAddress, amount sdk.SysCoin) MsgUnlock

func (MsgUnlock) GetSignBytes

func (m MsgUnlock) GetSignBytes() []byte

func (MsgUnlock) GetSigners

func (m MsgUnlock) GetSigners() []sdk.AccAddress

func (MsgUnlock) Route

func (m MsgUnlock) Route() string

func (MsgUnlock) Type

func (m MsgUnlock) Type() string

func (MsgUnlock) ValidateBasic

func (m MsgUnlock) ValidateBasic() sdk.Error

type ParamSubspace

type ParamSubspace interface {
	WithKeyTable(table params.KeyTable) params.Subspace
	Get(ctx sdk.Context, key []byte, ptr interface{})
	GetParamSet(ctx sdk.Context, ps params.ParamSet)
	SetParamSet(ctx sdk.Context, ps params.ParamSet)
}

ParamSubspace defines the expected Subspace interfacace

type Params

type Params struct {
	QuoteSymbol       string      `json:"quote_symbol"`
	CreatePoolFee     sdk.SysCoin `json:"create_pool_fee"`
	CreatePoolDeposit sdk.SysCoin `json:"create_pool_deposit"`
	// proposal params
	YieldNativeToken bool `json:"yield_native_token"`
}

Params - used for initializing default parameter for farm at genesis

func DefaultParams

func DefaultParams() Params

DefaultParams defines the parameters for this module

func (*Params) ParamSetPairs

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

ParamSetPairs - Implements params.ParamSet

func (Params) String

func (p Params) String() string

String implements the stringer interface for Params

type PoolCurrentRewards

type PoolCurrentRewards struct {
	StartBlockHeight int64
	Period           uint64
	Rewards          sdk.SysCoins
}

PoolCurrentRewards records the current period

func NewPoolCurrentRewards

func NewPoolCurrentRewards(startBlockHeight int64, period uint64, token sdk.SysCoins) PoolCurrentRewards

NewPoolCurrentRewards creates a new instance of PoolCurrentRewards

type PoolCurrentRewardsRecord

type PoolCurrentRewardsRecord struct {
	PoolName string             `json:"pool_name" yaml:"pool_name"`
	Rewards  PoolCurrentRewards `json:"rewards" yaml:"rewards"`
}

used for import / export via genesis json

type PoolHistoricalRewards

type PoolHistoricalRewards struct {
	CumulativeRewardRatio sdk.SysCoins
	ReferenceCount        uint16
}

PoolHistoricalRewards records the reward ratio of one user in a pool

func NewPoolHistoricalRewards

func NewPoolHistoricalRewards(cumulativeRewardRatio sdk.SysCoins, referenceCount uint16) PoolHistoricalRewards

NewPoolHistoricalRewards creates a new instance of PoolHistoricalRewards

type PoolHistoricalRewardsRecord

type PoolHistoricalRewardsRecord struct {
	PoolName string                `json:"pool_name" yaml:"pool_name"`
	Period   uint64                `json:"period" yaml:"period"`
	Rewards  PoolHistoricalRewards `json:"rewards" yaml:"rewards"`
}

used for import / export via genesis json

type PoolNameList

type PoolNameList []string

PoolNameList is the type alias for []string

func (PoolNameList) String

func (pnl PoolNameList) String() string

String returns a human readable string representation of PoolNameList

type PoolNum

type PoolNum struct {
	Number uint `json:"number"`
}

PoolNum is a wrapped structure of uint to display by cli query

func NewPoolNum

func NewPoolNum(num uint) PoolNum

NewPoolNum creates a new instance of PoolNum

func (PoolNum) String

func (pn PoolNum) String() string

String returns a human readable string representation of PoolNum

type QueryAccountParams

type QueryAccountParams struct {
	AccAddress sdk.AccAddress
}

QueryAccountParams defines the params for the following queries: - 'custom/farm/account'

func NewQueryAccountParams

func NewQueryAccountParams(accAddr sdk.AccAddress) QueryAccountParams

NewQueryAccountParams creates a new instance of QueryAccountParams

type QueryPoolAccountParams

type QueryPoolAccountParams struct {
	PoolName   string
	AccAddress sdk.AccAddress
}

QueryPoolAccountParams defines the params for the following queries: - 'custom/farm/earnings' - 'custom/farm/lock-info'

func NewQueryPoolAccountParams

func NewQueryPoolAccountParams(poolName string, accAddr sdk.AccAddress) QueryPoolAccountParams

NewQueryPoolAccountParams creates a new instance of QueryPoolAccountParams

type QueryPoolParams

type QueryPoolParams struct {
	PoolName string
}

QueryPoolParams defines the params for the following queries: - 'custom/farm/pool'

func NewQueryPoolParams

func NewQueryPoolParams(poolName string) QueryPoolParams

NewQueryPoolParams creates a new instance of QueryPoolParams

type QueryPoolsParams

type QueryPoolsParams struct {
	Page, Limit int
}

QueryPoolsParams defines the params for the following queries: - 'custom/farm/pools'

func NewQueryPoolsParams

func NewQueryPoolsParams(page, limit int) QueryPoolsParams

NewQueryPoolsParams creates a new instance of QueryPoolsParams

type YieldedTokenInfo

type YieldedTokenInfo struct {
	RemainingAmount         sdk.SysCoin `json:"remaining_amount"`
	StartBlockHeightToYield int64       `json:"start_block_height_to_yield"`
	AmountYieldedPerBlock   sdk.Dec     `json:"amount_yielded_per_block"`
}

YieldedTokenInfo is the token excluding native token which can be yielded by locking other tokens including LPT and token issued

func NewYieldedTokenInfo

func NewYieldedTokenInfo(
	remainingAmount sdk.SysCoin, startBlockHeightToYield int64, amountYieldedPerBlock sdk.Dec,
) YieldedTokenInfo

NewYieldedTokenInfo creates a new instance of YieldedTokenInfo

func (YieldedTokenInfo) String

func (yti YieldedTokenInfo) String() string

String returns a human readable string representation of a YieldedTokenInfo

type YieldedTokenInfos

type YieldedTokenInfos []YieldedTokenInfo

YieldedTokenInfos is a collection of YieldedTokenInfo

func NewYieldedTokenInfos

func NewYieldedTokenInfos(yieldedTokenInfos ...YieldedTokenInfo) YieldedTokenInfos

NewYieldedTokenInfo creates a new instance of YieldedTokenInfo

func (YieldedTokenInfos) String

func (ytis YieldedTokenInfos) String() (out string)

String returns a human readable string representation of YieldedTokenInfos

Jump to

Keyboard shortcuts

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