types

package
v0.0.0-...-f498596 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const (
	CodeAddrAndProductAllRequired uint32 = 64000

	CodeTokenPairSaveFailed         uint32 = 64009
	CodeInsufficientFeeCoins        uint32 = 64010
	CodeTokenPairAlreadyExist       uint32 = 64011
	CodeMustTokenPairOwner          uint32 = 64012
	CodeDepositOnlySupportDenom     uint32 = 64013
	CodeInsufficientDepositCoins    uint32 = 64014
	CodeWithdrawOnlySupportDenom    uint32 = 64015
	CodeInsufficientWithdrawCoins   uint32 = 64016
	CodeInvalidAddress              uint32 = 64017
	CodeUnauthorized                uint32 = 64018
	CodeInvalidCoins                uint32 = 64019
	CodeRepeatedTransferOwner       uint32 = 64020
	CodeDepositFailed               uint32 = 64021
	CodeWithdrawFailed              uint32 = 64022
	CodeGetConfirmOwnershipNotExist uint32 = 64023
	CodeTokenPairIsRequired         uint32 = 64024
	CodeIsTokenPairLocked           uint32 = 64025
	CodeDexUnknownMsgType           uint32 = 64026
	CodeDexUnknownQueryType         uint32 = 64027
	CodeInitPriceIsNotPositive      uint32 = 64028
	CodeAddressIsRequired           uint32 = 64029
	CodeTokenOfPairNotExist         uint32 = 64030
	CodeIsTransferringOwner         uint32 = 64031
	CodeTransferOwnerExpired        uint32 = 64032
	CodeUnauthorizedOperator        uint32 = 64033
)

const CodeType

View Source
const (

	// DefaultMaxPriceDigitSize defines default max price digit size
	DefaultMaxPriceDigitSize = 4
	// DefaultMaxQuantityDigitSize defines default max quantity digit size
	DefaultMaxQuantityDigitSize = 4
)
View Source
const (
	// ModuleName is the name of the dex module
	ModuleName = "dex"
	// DefaultParamspace defines default param space
	DefaultParamspace = ModuleName
	// DefaultCodespace defines default code space
	DefaultCodespace = ModuleName
	// QuerierRoute is the querier route for the dex module
	QuerierRoute = ModuleName
	// RouterKey is the msg router key for the dex module
	RouterKey = ModuleName
	// StoreKey is the string store representation
	StoreKey = ModuleName
	// TokenPairStoreKey is the token pair store key
	TokenPairStoreKey = "token_pair"

	// QueryProductsDelisting defines delisting query route path
	QueryProductsDelisting = "products_delisting"
	// QueryProducts defines products query route path
	QueryProducts = "products"
	// QueryDeposits defines deposits query route path
	QueryDeposits = "deposits"
	// QueryMatchOrder defines match-order query route path
	QueryMatchOrder = "match-order"
	// QueryParameters defines 	QueryParameters = "params" query route path
	QueryParameters = "params"
	// QueryOperator defines operator query route path
	QueryOperator = "operator"
	// QueryOperators defines operators query route path
	QueryOperators = "operators"
)
View Source
const (
	// DefaultPage defines default number of page
	DefaultPage = 1
	// DefaultPerPage defines default number per page
	DefaultPerPage = 50
)
View Source
const DefaultOwnershipConfirmWindow = 24 * time.Hour

DefaultOwnershipConfirmWindow defines default confirm window

View Source
const DefaultWithdrawPeriod = time.Hour * 24 * 3

DefaultWithdrawPeriod defines default withdraw period

View Source
const (
	// TestTokenPairOwner defines owner of token pair, just for test
	TestTokenPairOwner = "ex10q0rk5qnyag7wfvvt7rtphlw589m7frs3hvqmf"
)

Variables

View Source
var (

	// TokenPairKey is the store key for token pair
	TokenPairKey = []byte{0x01}
	// MaxTokenPairIDKey is the store key for token pair max ID
	MaxTokenPairIDKey = []byte{0x02}
	// TokenPairLockKeyPrefix is the store key for token pair prefix
	TokenPairLockKeyPrefix = []byte{0x03}

	// DEXOperatorKeyPrefix is the store key prefix for DEXOperator
	DEXOperatorKeyPrefix = []byte{0x04}

	// DEXOperatorTokenPairCntPrefix is the store key prefix for DEXOperator's tokenpair count
	DEXOperatorTokenPairCntPrefix = []byte{0x05}

	// WithdrawAddressKeyPrefix is the store key for withdraw address
	WithdrawAddressKeyPrefix = []byte{0x53}
	// WithdrawTimeKeyPrefix is the store key for withdraw time
	WithdrawTimeKeyPrefix = []byte{0x54}
	// UserTokenPairKeyPrefix is the store key for user token pair num
	UserTokenPairKeyPrefix = []byte{0x06}
	//the prefix of the confirm ownership key
	PrefixConfirmOwnershipKey = []byte{0x07}
)
View Source
var DefaultTokenPairDeposit = sdk.NewDecCoin(sdk.DefaultBondDenom, sdk.NewInt(0))

DefaultTokenPairDeposit defines default deposit of token pair

View Source
var ModuleCdc *codec.Codec

ModuleCdc represents generic sealed codec to be used throughout this module

Functions

func ErrAddrAndProductAllRequired

func ErrAddrAndProductAllRequired() sdk.EnvelopedErr

Addr and Product All Required

func ErrAddressIsRequired

func ErrAddressIsRequired(addrType string) sdk.EnvelopedErr

func ErrBalanceNotEnough

func ErrBalanceNotEnough(proposer string, initialDeposit string) sdk.EnvelopedErr

ErrInvalidBalanceNotEnough returns invalid balance not enough error

func ErrDepositFailed

func ErrDepositFailed(msg string) sdk.EnvelopedErr

func ErrDepositOnlySupportDenom

func ErrDepositOnlySupportDenom(denom string) sdk.EnvelopedErr

func ErrDexUnknownMsgType

func ErrDexUnknownMsgType(msg string) sdk.EnvelopedErr

func ErrDexUnknownQueryType

func ErrDexUnknownQueryType() sdk.EnvelopedErr

func ErrExistOperator

func ErrExistOperator(addr sdk.AccAddress) sdk.EnvelopedErr

func ErrGetConfirmOwnershipNotExist

func ErrGetConfirmOwnershipNotExist(address string) sdk.EnvelopedErr

func ErrInitPriceIsNotPositive

func ErrInitPriceIsNotPositive() sdk.EnvelopedErr

func ErrInsufficientDepositCoins

func ErrInsufficientDepositCoins(depositCoins string) sdk.EnvelopedErr

func ErrInsufficientFeeCoins

func ErrInsufficientFeeCoins(fee sdk.Coins) sdk.EnvelopedErr

func ErrInsufficientWithdrawCoins

func ErrInsufficientWithdrawCoins(depositCoins string, amount string) sdk.EnvelopedErr

func ErrInvalidAddress

func ErrInvalidAddress(msg string) sdk.EnvelopedErr

func ErrInvalidAsset

func ErrInvalidAsset(localMinDeposit string) sdk.EnvelopedErr

ErrInvalidAsset returns invalid asset error

func ErrInvalidCoins

func ErrInvalidCoins() sdk.EnvelopedErr

func ErrInvalidTokenPair

func ErrInvalidTokenPair(tokenPair string) sdk.EnvelopedErr

ErrInvalidTokenPair returns invalid product error

func ErrInvalidWebsiteLength

func ErrInvalidWebsiteLength(got, max int) sdk.EnvelopedErr

func ErrInvalidWebsiteURL

func ErrInvalidWebsiteURL(msg string) sdk.EnvelopedErr

func ErrIsTokenPairLocked

func ErrIsTokenPairLocked(tokenPairName string) sdk.EnvelopedErr

func ErrIsTransferOwnerExpired

func ErrIsTransferOwnerExpired(time string) sdk.EnvelopedErr

func ErrIsTransferringOwner

func ErrIsTransferringOwner(product string) sdk.EnvelopedErr

func ErrMustTokenPairOwner

func ErrMustTokenPairOwner(addr string, tokenPair string) sdk.EnvelopedErr

func ErrRepeatedTransferOwner

func ErrRepeatedTransferOwner(product string) sdk.EnvelopedErr

func ErrTokenOfPairNotExist

func ErrTokenOfPairNotExist(baseAsset string, quoteAsset string) sdk.EnvelopedErr

func ErrTokenPairExisted

func ErrTokenPairExisted(baseAsset string, quoteAsset string) sdk.EnvelopedErr

ErrTokenPairExisted returns an error when the token pair is existing during the process of listing

func ErrTokenPairIsRequired

func ErrTokenPairIsRequired() sdk.EnvelopedErr

func ErrTokenPairNotFound

func ErrTokenPairNotFound(product string) sdk.EnvelopedErr

ErrTokenPairNotFound returns token pair not found error

func ErrTokenPairSaveFailed

func ErrTokenPairSaveFailed(err string) sdk.EnvelopedErr

func ErrUnauthorized

func ErrUnauthorized(address, product string) sdk.EnvelopedErr

func ErrUnauthorizedOperator

func ErrUnauthorizedOperator(operator, owner string) sdk.EnvelopedErr

func ErrUnknownOperator

func ErrUnknownOperator(addr sdk.AccAddress) sdk.EnvelopedErr

func ErrWithdrawFailed

func ErrWithdrawFailed(msg string) sdk.EnvelopedErr

func ErrWithdrawOnlySupportDenom

func ErrWithdrawOnlySupportDenom(denom string) sdk.EnvelopedErr

func GetConfirmOwnershipKey

func GetConfirmOwnershipKey(product string) []byte

func GetKey

func GetKey(it sdk.Iterator) string

GetKey returns keys between index 1 to the end

func GetLockProductKey

func GetLockProductKey(product string) []byte

GetLockProductKey returns key of token pair

func GetOperatorAddressKey

func GetOperatorAddressKey(addr sdk.AccAddress) []byte

GetOperatorAddressKey returns key of operator address

func GetTokenPairAddress

func GetTokenPairAddress(key string) []byte

GetTokenPairAddress returns store key of token pair

func GetUserTokenPairAddress

func GetUserTokenPairAddress(owner sdk.AccAddress, assertPair string) []byte

GetUserTokenPairAddress returns token pair address key

func GetUserTokenPairAddressPrefix

func GetUserTokenPairAddressPrefix(owner sdk.AccAddress) []byte

GetUserTokenPairAddressPrefix returns token pair address prefix key

func GetWithdrawAddressKey

func GetWithdrawAddressKey(addr sdk.AccAddress) []byte

GetWithdrawAddressKey returns key of withdraw address

func GetWithdrawTimeAddressKey

func GetWithdrawTimeAddressKey(completeTime time.Time, addr sdk.AccAddress) []byte

GetWithdrawTimeAddressKey returns withdraw time address key

func GetWithdrawTimeKey

func GetWithdrawTimeKey(completeTime time.Time) []byte

GetWithdrawTimeKey returns key of withdraw time

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable for auth module

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

func SplitWithdrawTimeKey

func SplitWithdrawTimeKey(key []byte) (time.Time, sdk.AccAddress)

SplitWithdrawTimeKey splits the key and returns the complete time and address

Types

type ConfirmOwnership

type ConfirmOwnership struct {
	Product     string         `json:"product"`
	FromAddress sdk.AccAddress `json:"from_address"`
	ToAddress   sdk.AccAddress `json:"to_address"`
	Expire      time.Time      `json:expire`
}

type DEXOperator

type DEXOperator struct {
	Address            sdk.AccAddress `json:"address"`
	HandlingFeeAddress sdk.AccAddress `json:"handling_fee_address"`
	Website            string         `json:"website"`
	InitHeight         int64          `json:"init_height"`
	TxHash             string         `json:"tx_hash"`
}

OperatorAddress sdk.ValAddress `json:"operator_address" yaml:"operator_address"`

func (DEXOperator) String

func (o DEXOperator) String() string

nolint

type DEXOperators

type DEXOperators []DEXOperator

func (DEXOperators) String

func (o DEXOperators) String() string

type DelistProposal

type DelistProposal struct {
	Title       string         `json:"title" yaml:"title"`
	Description string         `json:"description" yaml:"description"`
	Proposer    sdk.AccAddress `json:"proposer" yaml:"proposer"`
	BaseAsset   string         `json:"base_asset" yaml:"base_asset"`
	QuoteAsset  string         `json:"quote_asset" yaml:"quote_asset"`
}

DelistProposal represents delist proposal object

func NewDelistProposal

func NewDelistProposal(title, description string, proposer sdk.AccAddress, baseAsset, quoteAsset string) DelistProposal

NewDelistProposal create a new delist proposal object

func (DelistProposal) GetDescription

func (drp DelistProposal) GetDescription() string

GetDescription returns description of delist proposal object

func (DelistProposal) GetTitle

func (drp DelistProposal) GetTitle() string

GetTitle returns title of delist proposal object

func (DelistProposal) ProposalRoute

func (DelistProposal) ProposalRoute() string

ProposalRoute returns route key of delist proposal object

func (DelistProposal) ProposalType

func (DelistProposal) ProposalType() string

ProposalType returns type of delist proposal object

func (DelistProposal) String

func (drp DelistProposal) String() string

String converts delist proposal object to string

func (DelistProposal) ValidateBasic

func (drp DelistProposal) ValidateBasic() sdk.Error

ValidateBasic validates delist proposal

type MsgConfirmOwnership

type MsgConfirmOwnership struct {
	Product string         `json:"product"`
	Address sdk.AccAddress `json:"new_owner"`
}

MsgConfirmOwnership - high level transaction of the coin module

func NewMsgConfirmOwnership

func NewMsgConfirmOwnership(newOwner sdk.AccAddress, product string) MsgConfirmOwnership

func (MsgConfirmOwnership) GetSignBytes

func (msg MsgConfirmOwnership) GetSignBytes() []byte

func (MsgConfirmOwnership) GetSigners

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

func (MsgConfirmOwnership) Route

func (msg MsgConfirmOwnership) Route() string

func (MsgConfirmOwnership) Type

func (msg MsgConfirmOwnership) Type() string

func (MsgConfirmOwnership) ValidateBasic

func (msg MsgConfirmOwnership) ValidateBasic() sdk.Error

type MsgCreateOperator

type MsgCreateOperator struct {
	Owner              sdk.AccAddress `json:"owner"`
	Website            string         `json:"website"`
	HandlingFeeAddress sdk.AccAddress `json:"handling_fee_address"`
}

MsgCreateOperator register a new DEXOperator or update it Addr represent an DEXOperator if DEXOperator not exist, register a new DEXOperator else update Website or HandlingFeeAddress

func NewMsgCreateOperator

func NewMsgCreateOperator(website string, owner, handlingFeeAddress sdk.AccAddress) MsgCreateOperator

NewMsgCreateOperator creates a new MsgCreateOperator

func (MsgCreateOperator) GetSignBytes

func (msg MsgCreateOperator) GetSignBytes() []byte

GetSignBytes Implements Msg

func (MsgCreateOperator) GetSigners

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

GetSigners Implements Msg

func (MsgCreateOperator) Route

func (msg MsgCreateOperator) Route() string

Route Implements Msg

func (MsgCreateOperator) Type

func (msg MsgCreateOperator) Type() string

Type Implements Msg

func (MsgCreateOperator) ValidateBasic

func (msg MsgCreateOperator) ValidateBasic() sdk.Error

ValidateBasic Implements Msg

type MsgDeposit

type MsgDeposit struct {
	Product   string         `json:"product"`   // product for trading pair in full name of the tokens
	Amount    sdk.SysCoin    `json:"amount"`    // Coins to add to the deposit
	Depositor sdk.AccAddress `json:"depositor"` // Address of the depositor
}

MsgDeposit - high level transaction of the dex module

func NewMsgDeposit

func NewMsgDeposit(product string, amount sdk.SysCoin, depositor sdk.AccAddress) MsgDeposit

NewMsgDeposit creates a new MsgDeposit

func (MsgDeposit) GetSignBytes

func (msg MsgDeposit) GetSignBytes() []byte

GetSignBytes Implements Msg

func (MsgDeposit) GetSigners

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

GetSigners Implements Msg

func (MsgDeposit) Route

func (msg MsgDeposit) Route() string

Route Implements Msg

func (MsgDeposit) Type

func (msg MsgDeposit) Type() string

Type Implements Msg

func (MsgDeposit) ValidateBasic

func (msg MsgDeposit) ValidateBasic() sdk.Error

ValidateBasic Implements Msg

type MsgList

type MsgList struct {
	Owner      sdk.AccAddress `json:"owner"`
	ListAsset  string         `json:"list_asset"`  //  Symbol of asset listed on Dex.
	QuoteAsset string         `json:"quote_asset"` //  Symbol of asset quoted by asset listed on Dex.
	InitPrice  sdk.Dec        `json:"init_price"`
}

MsgList - high level transaction of the dex module

func NewMsgList

func NewMsgList(owner sdk.AccAddress, listAsset, quoteAsset string, initPrice sdk.Dec) MsgList

NewMsgList creates a new MsgList

func (MsgList) GetSignBytes

func (msg MsgList) GetSignBytes() []byte

GetSignBytes Implements Msg

func (MsgList) GetSigners

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

GetSigners Implements Msg

func (MsgList) Route

func (msg MsgList) Route() string

Route Implements Msg

func (MsgList) Type

func (msg MsgList) Type() string

Type Implements Msg

func (MsgList) ValidateBasic

func (msg MsgList) ValidateBasic() sdk.Error

ValidateBasic Implements Msg

type MsgTransferOwnership

type MsgTransferOwnership struct {
	FromAddress sdk.AccAddress `json:"from_address"`
	ToAddress   sdk.AccAddress `json:"to_address"`
	Product     string         `json:"product"`
}

MsgTransferOwnership - high level transaction of the dex module

func NewMsgTransferOwnership

func NewMsgTransferOwnership(from, to sdk.AccAddress, product string) MsgTransferOwnership

NewMsgTransferOwnership create a new MsgTransferOwnership

func (MsgTransferOwnership) GetSignBytes

func (msg MsgTransferOwnership) GetSignBytes() []byte

GetSignBytes Implements Msg

func (MsgTransferOwnership) GetSigners

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

GetSigners Implements Msg

func (MsgTransferOwnership) Route

func (msg MsgTransferOwnership) Route() string

Route Implements Msg

func (MsgTransferOwnership) Type

func (msg MsgTransferOwnership) Type() string

Type Implements Msg

func (MsgTransferOwnership) ValidateBasic

func (msg MsgTransferOwnership) ValidateBasic() sdk.Error

ValidateBasic Implements Msg

type MsgUpdateOperator

type MsgUpdateOperator struct {
	Owner              sdk.AccAddress `json:"owner"`
	Website            string         `json:"website"`
	HandlingFeeAddress sdk.AccAddress `json:"handling_fee_address"`
}

MsgUpdateOperator register a new DEXOperator or update it Addr represent an DEXOperator if DEXOperator not exist, register a new DEXOperator else update Website or HandlingFeeAddress

func NewMsgUpdateOperator

func NewMsgUpdateOperator(website string, owner, handlingFeeAddress sdk.AccAddress) MsgUpdateOperator

NewMsgUpdateOperator creates a new MsgUpdateOperator

func (MsgUpdateOperator) GetSignBytes

func (msg MsgUpdateOperator) GetSignBytes() []byte

GetSignBytes Implements Msg

func (MsgUpdateOperator) GetSigners

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

GetSigners Implements Msg

func (MsgUpdateOperator) Route

func (msg MsgUpdateOperator) Route() string

Route Implements Msg

func (MsgUpdateOperator) Type

func (msg MsgUpdateOperator) Type() string

Type Implements Msg

func (MsgUpdateOperator) ValidateBasic

func (msg MsgUpdateOperator) ValidateBasic() sdk.Error

ValidateBasic Implements Msg

type MsgWithdraw

type MsgWithdraw struct {
	Product   string         `json:"product"`   // product for trading pair in full name of the tokens
	Amount    sdk.SysCoin    `json:"amount"`    // Coins to add to the deposit
	Depositor sdk.AccAddress `json:"depositor"` // Address of the depositor
}

MsgWithdraw - high level transaction of the dex module

func NewMsgWithdraw

func NewMsgWithdraw(product string, amount sdk.SysCoin, depositor sdk.AccAddress) MsgWithdraw

NewMsgWithdraw creates a new MsgWithdraw

func (MsgWithdraw) GetSignBytes

func (msg MsgWithdraw) GetSignBytes() []byte

GetSignBytes Implements Msg

func (MsgWithdraw) GetSigners

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

GetSigners Implements Msg

func (MsgWithdraw) Route

func (msg MsgWithdraw) Route() string

Route Implements Msg

func (MsgWithdraw) Type

func (msg MsgWithdraw) Type() string

Type Implements Msg

func (MsgWithdraw) ValidateBasic

func (msg MsgWithdraw) ValidateBasic() sdk.Error

ValidateBasic Implements Msg

type Params

type Params struct {
	ListFee              sdk.SysCoin `json:"list_fee"`
	TransferOwnershipFee sdk.SysCoin `json:"transfer_ownership_fee"`
	RegisterOperatorFee  sdk.SysCoin `json:"register_operator_fee"`

	//  maximum period for fibo holders to deposit on a dex delist proposal
	DelistMaxDepositPeriod time.Duration `json:"delist_max_deposit_period"`
	//  minimum deposit for a critical dex delist proposal to enter voting period
	DelistMinDeposit sdk.SysCoins `json:"delist_min_deposit"`
	//  length of the critical voting period for dex delist proposal
	DelistVotingPeriod time.Duration `json:"delist_voting_period"`

	WithdrawPeriod         time.Duration `json:"withdraw_period"`
	OwnershipConfirmWindow time.Duration `json:"ownership_confirm_window"`
}

Params defines param object

func DefaultParams

func DefaultParams() *Params

DefaultParams returns a default set of parameters.

func (*Params) ParamSetPairs

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

ParamSetPairs implements the ParamSet interface and returns all the key/value pairs

func (Params) String

func (p Params) String() string

String implements the stringer interface.

type QueryDepositParams

type QueryDepositParams struct {
	Address    string
	BaseAsset  string
	QuoteAsset string
	Page       int
	PerPage    int
}

nolint

func NewQueryDepositParams

func NewQueryDepositParams(address, baseAsset, quoteAsset string, page, perPage int) QueryDepositParams

NewQueryDepositParams creates a new instance of QueryDepositParams

type QueryDexInfoParams

type QueryDexInfoParams struct {
	Owner   string
	Page    int
	PerPage int
}

QueryDexInfoParams defines query params of dex info

func NewQueryDexInfoParams

func NewQueryDexInfoParams(owner string, page, perPage int) QueryDexInfoParams

NewQueryDexInfoParams creates query params of dex info

type QueryDexOperatorParams

type QueryDexOperatorParams struct {
	Addr sdk.AccAddress
}

func NewQueryDexOperatorParams

func NewQueryDexOperatorParams(addr sdk.AccAddress) QueryDexOperatorParams

creates a new instance of QueryDexOperatorParams

type TokenPair

type TokenPair struct {
	BaseAssetSymbol  string         `json:"base_asset_symbol"`
	QuoteAssetSymbol string         `json:"quote_asset_symbol"`
	InitPrice        sdk.Dec        `json:"price"`
	MaxPriceDigit    int64          `json:"max_price_digit"`
	MaxQuantityDigit int64          `json:"max_size_digit"`
	MinQuantity      sdk.Dec        `json:"min_trade_size"`
	ID               uint64         `json:"token_pair_id"`
	Delisting        bool           `json:"delisting"`
	Owner            sdk.AccAddress `json:"owner"`
	Deposits         sdk.SysCoin    `json:"deposits"`
	BlockHeight      int64          `json:"block_height"`
}

TokenPair represents token pair object

func (*TokenPair) IsGT

func (tp *TokenPair) IsGT(other *TokenPair) bool

IsGT returns true if the token pair is greater than the other one 1. compare deposits 2. compare block height 3. compare name

func (*TokenPair) Name

func (tp *TokenPair) Name() string

Name returns name of token pair

type TokenPairs

type TokenPairs []*TokenPair

TokenPairs represents token pair slice, support sorting

func (TokenPairs) Len

func (tp TokenPairs) Len() int

Len Implements Sort

func (TokenPairs) Less

func (tp TokenPairs) Less(i, j int) bool

Less Implements Sort

func (TokenPairs) Swap

func (tp TokenPairs) Swap(i, j int)

Swap Implements Sort

type WithdrawInfo

type WithdrawInfo struct {
	Owner        sdk.AccAddress `json:"owner"`
	Deposits     sdk.SysCoin    `json:"deposits"`
	CompleteTime time.Time      `json:"complete_time"`
}

WithdrawInfo represents infos for withdrawing

func (WithdrawInfo) Equal

func (w WithdrawInfo) Equal(other WithdrawInfo) bool

Equal returns boolean for whether two WithdrawInfo are Equal

type WithdrawInfos

type WithdrawInfos []WithdrawInfo

WithdrawInfos defines list of WithdrawInfo

func (WithdrawInfos) Equal

func (ws WithdrawInfos) Equal(other WithdrawInfos) bool

Equal returns boolean for whether two WithdrawInfos are Equal

Jump to

Keyboard shortcuts

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