types

package
v0.0.0-...-2eee87b Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// module pooldata
	ModuleName = "swapservice"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName
)
View Source
const RouterKey = ModuleName // this was defined in your key.go file

Variables

View Source
var ModuleCdc = codec.New()

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

Types

type AccStake

type AccStake struct {
	Name  string `json:"name"`
	Atom  string `json:"atom"`
	Token string `json:"token"`
}

type AccStruct

type AccStruct struct {
	Name     string    `json:"name"`
	Holdings []Holding `json:"holdings"`
}

AccStruct is a struct that contains balances of an account

func NewAccStruct

func NewAccStruct() AccStruct

func (AccStruct) String

func (w AccStruct) String() string

type Holding

type Holding struct {
	Ticker string `json:"ticker"`
	Amount string `json:"amount"`
}

type MsgSetAccData

type MsgSetAccData struct {
	AccID  string         `json:"acc_id"`
	Name   string         `json:"name"`
	Ticker string         `json:"atom"`
	Amount string         `json:"token"`
	Owner  sdk.AccAddress `json:"owner"`
}

MsgSetAccData defines a SetAccData message

func NewMsgSetAccData

func NewMsgSetAccData(name, ticker, amount string, owner sdk.AccAddress) MsgSetAccData

NewMsgSetPoolData is a constructor function for MsgSetPoolData

func (MsgSetAccData) GetSignBytes

func (msg MsgSetAccData) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgSetAccData) GetSigners

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

GetSigners defines whose signature is required

func (MsgSetAccData) Route

func (msg MsgSetAccData) Route() string

Route should return the pooldata of the module

func (MsgSetAccData) Type

func (msg MsgSetAccData) Type() string

Type should return the action

func (MsgSetAccData) ValidateBasic

func (msg MsgSetAccData) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgSetPoolData

type MsgSetPoolData struct {
	PoolID       string         `json:"pool_id"`
	BalanceAtom  string         `json:"balance_atom"`
	BalanceToken string         `json:"balance_token"`
	Ticker       string         `json:"ticker"`
	TokenName    string         `json:"token_name"`
	Owner        sdk.AccAddress `json:"owner"`
}

MsgSetPoolData defines a SetPoolData message

func NewMsgSetPoolData

func NewMsgSetPoolData(tokenName, ticker string, owner sdk.AccAddress) MsgSetPoolData

NewMsgSetPoolData is a constructor function for MsgSetPoolData

func (MsgSetPoolData) GetSignBytes

func (msg MsgSetPoolData) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgSetPoolData) GetSigners

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

GetSigners defines whose signature is required

func (MsgSetPoolData) Route

func (msg MsgSetPoolData) Route() string

Route should return the pooldata of the module

func (MsgSetPoolData) Type

func (msg MsgSetPoolData) Type() string

Type should return the action

func (MsgSetPoolData) ValidateBasic

func (msg MsgSetPoolData) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgSetStakeData

type MsgSetStakeData struct {
	StakeID string         `json:"acc_id"`
	Name    string         `json:"name"`
	Ticker  string         `json:"ticker"`
	Atom    string         `json:"atom"`
	Token   string         `json:"token"`
	Owner   sdk.AccAddress `json:"owner"`
}

MsgSetStakeData defines a SetStakeData message

func NewMsgSetStakeData

func NewMsgSetStakeData(name, ticker, atom, token string, owner sdk.AccAddress) MsgSetStakeData

NewMsgSetPoolData is a constructor function for MsgSetPoolData

func (MsgSetStakeData) GetSignBytes

func (msg MsgSetStakeData) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgSetStakeData) GetSigners

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

GetSigners defines whose signature is required

func (MsgSetStakeData) Route

func (msg MsgSetStakeData) Route() string

Route should return the pooldata of the module

func (MsgSetStakeData) Type

func (msg MsgSetStakeData) Type() string

Type should return the action

func (MsgSetStakeData) ValidateBasic

func (msg MsgSetStakeData) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgStake

type MsgStake struct {
	Name        string         `json:"name"`
	Ticker      string         `json:"ticker"`
	AtomAmount  string         `json:"atom_amount"`
	TokenAmount string         `json:"token_amount"`
	Owner       sdk.AccAddress `json:"owner"`
}

MsgStake defines a MsgStake message

type MsgSwap

type MsgSwap struct {
	PoolID       string         `json:"pool_id"`
	SourceTicker string         `json:"source_ticker"`
	TargetTicker string         `json:"target_ticker"`
	Requester    string         `json:"requester"`
	Destination  string         `json:"destination"`
	Amount       string         `json:"amount"`
	Owner        sdk.AccAddress `json:"owner"`
}

MsgSwap defines a MsgSwap message

func NewMsgSwap

func NewMsgSwap(source, target, amount, requester, destination string, owner sdk.AccAddress) MsgSwap

NewMsgSwap is a constructor function for MsgSwap

func (MsgSwap) GetSignBytes

func (msg MsgSwap) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgSwap) GetSigners

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

GetSigners defines whose signature is required

func (MsgSwap) Route

func (msg MsgSwap) Route() string

Route should return the pooldata of the module

func (MsgSwap) Type

func (msg MsgSwap) Type() string

Type should return the action

func (MsgSwap) ValidateBasic

func (msg MsgSwap) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type PoolStruct

type PoolStruct struct {
	BalanceAtom  string `json:"balance_atom"`
	BalanceToken string `json:"balance_token"`
	Ticker       string `json:"ticker"`
	TokenName    string `json:"token_name"`
}

PoolStruct is a struct that contains all the metadata of a pooldata

func NewPoolStruct

func NewPoolStruct() PoolStruct

Returns a new PoolStruct

func (PoolStruct) String

func (w PoolStruct) String() string

implement fmt.Stringer

type QueryResAccDatas

type QueryResAccDatas []string

Query Result Payload for a pooldatas query

func (QueryResAccDatas) String

func (n QueryResAccDatas) String() string

implement fmt.Stringer

type QueryResPoolDatas

type QueryResPoolDatas []PoolStruct

Query Result Payload for a pooldatas query

func (QueryResPoolDatas) String

func (n QueryResPoolDatas) String() string

implement fmt.Stringer

type QueryResResolve

type QueryResResolve struct {
	Value string `json:"value"`
}

Query Result Payload for a resolve query

func (QueryResResolve) String

func (r QueryResResolve) String() string

implement fmt.Stringer

type QueryResStakeDatas

type QueryResStakeDatas []string

Query Result Payload for a pooldatas query

func (QueryResStakeDatas) String

func (n QueryResStakeDatas) String() string

implement fmt.Stringer

type StakeStruct

type StakeStruct struct {
	Ticker string     `json:"ticker"`
	Stakes []AccStake `json:"stakes"`
}

Stake Struct is a struct that contain amount of coins stake towards a specific pool

func NewStakeStruct

func NewStakeStruct() StakeStruct

func (StakeStruct) String

func (w StakeStruct) String() string

Jump to

Keyboard shortcuts

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