Documentation ¶
Index ¶
- Constants
- Variables
- func ErrDuplicatedIssueSymbol(codespace sdk.CodespaceType, format string) sdk.Error
- func ErrInvalidInitialIssuePool(codespace sdk.CodespaceType, format string) sdk.Error
- func ErrInvalidIssuePool(codespace sdk.CodespaceType, format string) sdk.Error
- func ErrInvalidSwapAmount(codespace sdk.CodespaceType, format string) sdk.Error
- func ErrIssueSymbolUsedAsTarget(codespace sdk.CodespaceType, format string) sdk.Error
- func ErrMappingDisabled(codespace sdk.CodespaceType, format string) sdk.Error
- func ErrMappingNotFound(codespace sdk.CodespaceType, format string) sdk.Error
- func ErrTargetSymbolUsedAsIssue(codespace sdk.CodespaceType, format string) sdk.Error
- func ErrUnmatchedDecimals(codespace sdk.CodespaceType, format string) sdk.Error
- func ErrUnmatchedTotalSupply(codespace sdk.CodespaceType, format string) sdk.Error
- func RegisterCodec(cdc *codec.Codec)
- type AddMappingProposal
- func (amp AddMappingProposal) GetDescription() string
- func (amp AddMappingProposal) GetTitle() string
- func (amp AddMappingProposal) ProposalRoute() string
- func (amp AddMappingProposal) ProposalToken() string
- func (amp AddMappingProposal) ProposalType() string
- func (amp AddMappingProposal) String() string
- func (amp AddMappingProposal) ValidateBasic() sdk.Error
- type DirectSwapInfo
- type DirectSwapOrder
- type FreeSwapInfo
- type FreeSwapOrder
- type MappingInfo
- type MsgCancelSwap
- type MsgCreateDirectSwap
- type MsgCreateFreeSwap
- type MsgMappingSwap
- type MsgSwapSymbol
- type Params
- type QueryDirectSwapOrderList
- type QueryDirectSwapOrderListParams
- type QueryDirectSwapOrderParams
- type QueryFreeSwapOrderList
- type QueryFreeSwapOrderListParams
- type QueryFreeSwapOrderParams
- type QueryMappingListParams
- type QueryMappingParams
- type QueryResMappingInfo
- type QueryResMappingList
- type SwapPool
- type SwitchMappingProposal
- func (smp SwitchMappingProposal) GetDescription() string
- func (smp SwitchMappingProposal) GetTitle() string
- func (smp SwitchMappingProposal) ProposalRoute() string
- func (smp SwitchMappingProposal) ProposalToken() string
- func (smp SwitchMappingProposal) ProposalType() string
- func (smp SwitchMappingProposal) String() string
- func (smp SwitchMappingProposal) ValidateBasic() sdk.Error
Constants ¶
View Source
const ( DefaultCodespace sdk.CodespaceType = ModuleName CodeInvalidSwapAmount sdk.CodeType = 2100 CodeInvalidInitialIssuePool sdk.CodeType = 2101 CodeInvalidIssuePool sdk.CodeType = 2102 CodeMappingNotFound sdk.CodeType = 2103 CodeUnmatchedDecimals sdk.CodeType = 2104 CodeMappingDisabled sdk.CodeType = 2105 CodeDuplicatedIssueSymbol sdk.CodeType = 2106 CodeTargetSymbolUsedAsIssue sdk.CodeType = 2107 CodeIssueSymbolUsedAsTarget sdk.CodeType = 2108 CodeUnmatchedTotalSupply sdk.CodeType = 2109 )
View Source
const ( EventTypeExecuteAddMappingProposal = "execute_add_mapping_proposal" EventTypeExecuteSwitchMappingProposal = "execute_switch_mapping_proposal" EventTypeCreateFreeSwap = "create_free_swap" EventTypeCreateDirectSwap = "create_direct_swap" EventTypeCancelSwap = "cancel_swap" EventTypeSwapSymbol = "swap_symbol" AttributeKeyFrom = "from" AttributeKeyIssueToken = "issue_token" AttributeKeyTargetToken = "target_token" AttributeKeyTotalSupply = "total_supply" AttributeKeyEnable = "enable" AttributeKeyOrderID = "order_id" AttributeKeyAmount = "amount" AttributeKeySwapType = "swap_type" )
View Source
const ( //module name ModuleName = "mapping" // StoreKey to be used when creating the KVStore StoreKey = ModuleName // QuerierRoute is the querier route for gov QuerierRoute = ModuleName // Parameter store default parameter store DefaultParamspace = ModuleName )
View Source
const ( TypeMsgMappingSwap = "mapping_swap" TypeMsgCreateFreeSwap = "free_swap" TypeMsgCreateDirectSwap = "direct_swap" TypeMsgSwapSymbol = "swap_symbol" TypeMsgCancelSwap = "cancel_swap" )
View Source
const ( ProposalTypeAddMapping = "AddMapping" ProposalTypeSwitchMapping = "SwitchMapping" )
View Source
const ( QueryInfo = "info" QueryList = "list" QueryFreeSwapInfo = "freeswapinfo" QueryDirectSwapInfo = "directswapinfo" QueryFreeSwapList = "freeswaplist" QueryDirectSwapList = "directswaplist" )
query endpoints supported by the mapping module
View Source
const ( SwapTypeFree = 0x0 SwapTypeDirect = 0x1 )
View Source
const RouterKey = ModuleName // this was defined in key.go file
Variables ¶
View Source
var (
DefaultNewMappingFee = sdk.NewInt(10)
)
View Source
var (
KeyNewMappingFee = []byte("NewMappingFee")
)
View Source
var ModuleCdc = codec.New()
Functions ¶
func ErrDuplicatedIssueSymbol ¶
func ErrDuplicatedIssueSymbol(codespace sdk.CodespaceType, format string) sdk.Error
func ErrInvalidInitialIssuePool ¶
func ErrInvalidInitialIssuePool(codespace sdk.CodespaceType, format string) sdk.Error
func ErrInvalidIssuePool ¶
func ErrInvalidIssuePool(codespace sdk.CodespaceType, format string) sdk.Error
func ErrInvalidSwapAmount ¶
func ErrInvalidSwapAmount(codespace sdk.CodespaceType, format string) sdk.Error
func ErrIssueSymbolUsedAsTarget ¶
func ErrIssueSymbolUsedAsTarget(codespace sdk.CodespaceType, format string) sdk.Error
func ErrMappingDisabled ¶
func ErrMappingDisabled(codespace sdk.CodespaceType, format string) sdk.Error
func ErrMappingNotFound ¶
func ErrMappingNotFound(codespace sdk.CodespaceType, format string) sdk.Error
func ErrTargetSymbolUsedAsIssue ¶
func ErrTargetSymbolUsedAsIssue(codespace sdk.CodespaceType, format string) sdk.Error
func ErrUnmatchedDecimals ¶
func ErrUnmatchedDecimals(codespace sdk.CodespaceType, format string) sdk.Error
func ErrUnmatchedTotalSupply ¶
func ErrUnmatchedTotalSupply(codespace sdk.CodespaceType, format string) sdk.Error
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
Types ¶
type AddMappingProposal ¶
type AddMappingProposal struct { From sdk.CUAddress `json:"from"` Title string `json:"title"` Description string `json:"description"` IssueSymbol sdk.Symbol `json:"issue_symbol"` TargetSymbol sdk.Symbol `json:"target_symbol"` TotalSupply sdk.Int `json:"total_supply"` }
func NewAddMappingProposal ¶
func (AddMappingProposal) GetDescription ¶
func (amp AddMappingProposal) GetDescription() string
func (AddMappingProposal) GetTitle ¶
func (amp AddMappingProposal) GetTitle() string
func (AddMappingProposal) ProposalRoute ¶
func (amp AddMappingProposal) ProposalRoute() string
func (AddMappingProposal) ProposalToken ¶
func (amp AddMappingProposal) ProposalToken() string
func (AddMappingProposal) ProposalType ¶
func (amp AddMappingProposal) ProposalType() string
func (AddMappingProposal) String ¶
func (amp AddMappingProposal) String() string
String implements the Stringer interface.
func (AddMappingProposal) ValidateBasic ¶
func (amp AddMappingProposal) ValidateBasic() sdk.Error
type DirectSwapInfo ¶
type DirectSwapInfo struct { SrcSymbol sdk.Symbol `json:"src_symbol"` TargetSymbol sdk.Symbol `json:"target_symbol"` Amount sdk.Int `json:"amount"` SwapAmount sdk.Int `json:"swap_amount"` ExpiredTime int64 `json:"expired_time"` ReceiveAddr string `json:"receieve_addr"` Desc string `json:"desc"` }
func (DirectSwapInfo) String ¶
func (s DirectSwapInfo) String() string
type DirectSwapOrder ¶
type DirectSwapOrder struct { OrderId string `json:"order_id"` Owner sdk.CUAddress `json:"owner"` SwapInfo DirectSwapInfo `json:"swap_info"` }
func (DirectSwapOrder) String ¶
func (o DirectSwapOrder) String() string
type FreeSwapInfo ¶
type FreeSwapInfo struct { SrcSymbol sdk.Symbol `json:"src_symbol"` TargetSymbol sdk.Symbol `json:"target_symbol"` TotalAmount sdk.Int `json:"total_amount"` MaxSwapAmount sdk.Int `json:"max_swap_amount"` MinSwapAmount sdk.Int `json:"min_swap_amount"` SwapPrice sdk.Int `json:"swap_price"` ExpiredTime int64 `json:"expired_time"` Desc string `json:"desc"` }
func (FreeSwapInfo) String ¶
func (s FreeSwapInfo) String() string
type FreeSwapOrder ¶
type FreeSwapOrder struct { OrderId string `json:"order_id"` Owner sdk.CUAddress `json:"owner"` SwapInfo FreeSwapInfo `json:"swap_info"` RemainAmount sdk.Int `json:"remain_amount"` }
func (FreeSwapOrder) String ¶
func (o FreeSwapOrder) String() string
type MappingInfo ¶
type MappingInfo struct { IssueSymbol sdk.Symbol `json:"issue_symbol"` TargetSymbol sdk.Symbol `json:"target_symbol"` TotalSupply sdk.Int `json:"total_supply"` IssuePool sdk.Int `json:"issue_pool"` Enabled bool `json:"enabled"` }
MappingInfo struct for mapping
func (MappingInfo) String ¶
func (m MappingInfo) String() string
type MsgCancelSwap ¶
type MsgCancelSwap struct { From string `json:"from"` SwapType int `json:"swap_type"` OrderID string `json:"order_id"` }
func NewMsgCancelSwap ¶
func NewMsgCancelSwap(from string, orderid string, swapType int) MsgCancelSwap
func (MsgCancelSwap) GetSignBytes ¶
func (msg MsgCancelSwap) GetSignBytes() []byte
func (MsgCancelSwap) GetSigners ¶
func (msg MsgCancelSwap) GetSigners() []sdk.CUAddress
func (MsgCancelSwap) Route ¶
func (msg MsgCancelSwap) Route() string
func (MsgCancelSwap) Type ¶
func (msg MsgCancelSwap) Type() string
func (MsgCancelSwap) ValidateBasic ¶
func (msg MsgCancelSwap) ValidateBasic() sdk.Error
type MsgCreateDirectSwap ¶
type MsgCreateDirectSwap struct { From string `json:"from"` OrderID string `json:"order_id"` SwapInfo DirectSwapInfo `json:"swap_info"` }
func NewMsgCreateDirectSwap ¶
func NewMsgCreateDirectSwap(from string, orderid string, swapInfo DirectSwapInfo) MsgCreateDirectSwap
func (MsgCreateDirectSwap) GetSignBytes ¶
func (msg MsgCreateDirectSwap) GetSignBytes() []byte
func (MsgCreateDirectSwap) GetSigners ¶
func (msg MsgCreateDirectSwap) GetSigners() []sdk.CUAddress
func (MsgCreateDirectSwap) Route ¶
func (msg MsgCreateDirectSwap) Route() string
func (MsgCreateDirectSwap) Type ¶
func (msg MsgCreateDirectSwap) Type() string
func (MsgCreateDirectSwap) ValidateBasic ¶
func (msg MsgCreateDirectSwap) ValidateBasic() sdk.Error
type MsgCreateFreeSwap ¶
type MsgCreateFreeSwap struct { From string `json:"from"` OrderID string `json:"order_id"` SwapInfo FreeSwapInfo `json:"swap_info"` }
func NewMsgCreateFreeSwap ¶
func NewMsgCreateFreeSwap(from string, orderid string, swapInfo FreeSwapInfo) MsgCreateFreeSwap
func (MsgCreateFreeSwap) GetSignBytes ¶
func (msg MsgCreateFreeSwap) GetSignBytes() []byte
func (MsgCreateFreeSwap) GetSigners ¶
func (msg MsgCreateFreeSwap) GetSigners() []sdk.CUAddress
func (MsgCreateFreeSwap) Route ¶
func (msg MsgCreateFreeSwap) Route() string
func (MsgCreateFreeSwap) Type ¶
func (msg MsgCreateFreeSwap) Type() string
func (MsgCreateFreeSwap) ValidateBasic ¶
func (msg MsgCreateFreeSwap) ValidateBasic() sdk.Error
type MsgMappingSwap ¶
type MsgMappingSwap struct { From sdk.CUAddress `json:"from"` IssueSymbol sdk.Symbol `json:"issue_symbol"` Coins sdk.Coins `json:"coins"` }
func NewMsgMappingSwap ¶
func (MsgMappingSwap) GetSignBytes ¶
func (msg MsgMappingSwap) GetSignBytes() []byte
func (MsgMappingSwap) GetSigners ¶
func (msg MsgMappingSwap) GetSigners() []sdk.CUAddress
func (MsgMappingSwap) Route ¶
func (msg MsgMappingSwap) Route() string
func (MsgMappingSwap) Type ¶
func (msg MsgMappingSwap) Type() string
func (MsgMappingSwap) ValidateBasic ¶
func (msg MsgMappingSwap) ValidateBasic() sdk.Error
type MsgSwapSymbol ¶
type MsgSwapSymbol struct { From string `json:"from"` DstOrderID string `json:"dst_order_id"` SwapAmount sdk.Int `json:"swap_amount"` SwapType int `json:"swap_type"` }
func NewMsgSwapSymbol ¶
func (MsgSwapSymbol) GetSignBytes ¶
func (msg MsgSwapSymbol) GetSignBytes() []byte
func (MsgSwapSymbol) GetSigners ¶
func (msg MsgSwapSymbol) GetSigners() []sdk.CUAddress
func (MsgSwapSymbol) Route ¶
func (msg MsgSwapSymbol) Route() string
func (MsgSwapSymbol) Type ¶
func (msg MsgSwapSymbol) Type() string
func (MsgSwapSymbol) ValidateBasic ¶
func (msg MsgSwapSymbol) ValidateBasic() sdk.Error
type Params ¶
Params defines the high level settings for staking
func MustUnmarshalParams ¶
unmarshal the current staking params value from store key or panic
func UnmarshalParams ¶
unmarshal the current staking params value from store key
func (Params) Equal ¶
Equal returns a boolean determining if two Param types are identical. TODO: This is slower than comparing struct fields directly
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
Implements params.ParamSet
type QueryDirectSwapOrderList ¶
type QueryDirectSwapOrderList []DirectSwapOrder
func (QueryDirectSwapOrderList) String ¶
func (o QueryDirectSwapOrderList) String() (out string)
type QueryDirectSwapOrderListParams ¶
type QueryDirectSwapOrderListParams struct {
Page, Limit int
}
func NewQueryDirectSwapInfoListParams ¶
func NewQueryDirectSwapInfoListParams(page, limit int) QueryDirectSwapOrderListParams
type QueryDirectSwapOrderParams ¶
type QueryDirectSwapOrderParams struct {
OrderID string `json:"order_id"`
}
type QueryFreeSwapOrderList ¶
type QueryFreeSwapOrderList []FreeSwapOrder
func (QueryFreeSwapOrderList) String ¶
func (o QueryFreeSwapOrderList) String() (out string)
type QueryFreeSwapOrderListParams ¶
type QueryFreeSwapOrderListParams struct {
Page, Limit int
}
func NewQueryFreeSwapInfoListParams ¶
func NewQueryFreeSwapInfoListParams(page, limit int) QueryFreeSwapOrderListParams
type QueryFreeSwapOrderParams ¶
type QueryFreeSwapOrderParams struct {
OrderID string `json:"order_id"`
}
type QueryMappingListParams ¶
type QueryMappingListParams struct {
Page, Limit int
}
func NewQueryMappingListParams ¶
func NewQueryMappingListParams(page, limit int) QueryMappingListParams
type QueryMappingParams ¶
type QueryMappingParams struct {
IssueSymbol string `json:"issue_symbol"`
}
type QueryResMappingInfo ¶
type QueryResMappingInfo struct { IssueSymbol sdk.Symbol `json:"issue_symbol"` TargetSymbol sdk.Symbol `json:"target_symbol"` TotalSupply sdk.Int `json:"total_supply"` IssuePool sdk.Int `json:"issue_pool"` Enabled bool `json:"enabled"` }
func MappingInfoToQueryRes ¶
func MappingInfoToQueryRes(mi *MappingInfo) QueryResMappingInfo
func (QueryResMappingInfo) String ¶
func (m QueryResMappingInfo) String() string
type QueryResMappingList ¶
type QueryResMappingList []QueryResMappingInfo
func (QueryResMappingList) String ¶
func (m QueryResMappingList) String() (out string)
type SwitchMappingProposal ¶
type SwitchMappingProposal struct { Title string `json:"title"` Description string `json:"description"` IssueSymbol sdk.Symbol `json:"issue_symbol"` Enable bool `json:"enable"` }
func NewSwitchMappingProposal ¶
func NewSwitchMappingProposal(title, desc string, issueSymbol sdk.Symbol, enable bool) SwitchMappingProposal
func (SwitchMappingProposal) GetDescription ¶
func (smp SwitchMappingProposal) GetDescription() string
func (SwitchMappingProposal) GetTitle ¶
func (smp SwitchMappingProposal) GetTitle() string
func (SwitchMappingProposal) ProposalRoute ¶
func (smp SwitchMappingProposal) ProposalRoute() string
func (SwitchMappingProposal) ProposalToken ¶
func (smp SwitchMappingProposal) ProposalToken() string
func (SwitchMappingProposal) ProposalType ¶
func (smp SwitchMappingProposal) ProposalType() string
func (SwitchMappingProposal) String ¶
func (smp SwitchMappingProposal) String() string
String implements the Stringer interface.
func (SwitchMappingProposal) ValidateBasic ¶
func (smp SwitchMappingProposal) ValidateBasic() sdk.Error
ValidateBasic runs basic stateless validity checks
Click to show internal directories.
Click to hide internal directories.