types

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

nolint

Index

Constants

View Source
const (
	OperateFeeType  = "operate"
	TransferFeeType = "transfer"
	DexFeeType      = "dex"

	JSONFORMAT  = "json"
	AMINOFORMAT = "amino"
)

Variables

View Source
var (
	// To avoid cycle import , use literal key. Please update here when new type message is introduced.
	ValidFixedFeeMsgTypes = map[string]struct{}{
		"submit_proposal":          {},
		"deposit":                  {},
		"vote":                     {},
		"dexList":                  {},
		"orderNew":                 {},
		"orderCancel":              {},
		"issueMsg":                 {},
		"mintMsg":                  {},
		"tokensBurn":               {},
		"setAccountFlags":          {},
		"tokensFreeze":             {},
		"transferOwnership":        {},
		"create_validator":         {},
		"remove_validator":         {},
		"timeLock":                 {},
		"timeUnlock":               {},
		"timeRelock":               {},
		"crossBind":                {},
		"crossUnbind":              {},
		"crossTransferOut":         {},
		"crossBindRelayFee":        {},
		"crossUnbindRelayFee":      {},
		"crossTransferOutRelayFee": {},
		"oracleClaim":              {},

		"HTLT":        {},
		"depositHTLT": {},
		"claimHTLT":   {},
		"refundHTLT":  {},

		"side_create_validator": {},
		"side_edit_validator":   {},
		"side_delegate":         {},
		"side_redelegate":       {},
		"side_undelegate":       {},

		"axc_submit_evidence": {},
		"side_chain_unjail":   {},

		"side_submit_proposal": {},
		"side_deposit":         {},
		"side_vote":            {},
		"tinyIssueMsg":         {},
		"miniIssueMsg":         {},
		"miniTokensSetURI":     {},
		"dexListMini":          {},

		"crossDistributeRewardRelayFee":      {},
		"crossDistributeUndelegatedRelayFee": {},

		"create_validator_open": {},
		"edit_validator":        {},
		"delegate":              {},
		"redelegate":            {},
		"undelegate":            {},
		"unjail":                {},
	}

	ValidTransferFeeMsgTypes = map[string]struct{}{
		"send": {},
	}
)

Functions

func ErrInvalidCrossChainPackage

func ErrInvalidCrossChainPackage(codespace sdk.CodespaceType) sdk.Error

func ErrInvalidSideChainId

func ErrInvalidSideChainId(codespace sdk.CodespaceType, msg string) sdk.Error

func ErrMissSideChainId

func ErrMissSideChainId(codespace sdk.CodespaceType) sdk.Error

Types

type BCChangeParams

type BCChangeParams struct {
	BCParams    []BCParam `json:"bc_params"`
	Description string    `json:"description"`
}

func (*BCChangeParams) Check

func (s *BCChangeParams) Check() error

type BCParam

type BCParam interface {
	subspace.ParamSet
	UpdateCheck() error
	GetBCParamAttribute() string
}

type BCParamChangePublisher

type BCParamChangePublisher interface {
	SubscribeBCParamChange(updateCb func(sdk.Context, interface{}), spaceProto *BCParamSpaceProto)
}

type BCParamSpaceProto

type BCParamSpaceProto struct {
	ParamSpace subspace.Subspace
	Proto      func() BCParam
}

--------- Definition beacon chain prams change ------------------- //

type CSCParamChange

type CSCParamChange struct {
	Key    string `json:"key"` // the name of the parameter
	Value  string `json:"value" rlp:"-"`
	Target string `json:"target" rlp:"-"`

	// Since byte slice is not friendly to show in proposal description, omit it.
	ValueBytes  []byte `json:"-"` // the value of the parameter
	TargetBytes []byte `json:"-"` // the address of the target contract
}

func (*CSCParamChange) Check

func (c *CSCParamChange) Check() error

type CSCParamChanges

type CSCParamChanges struct {
	Changes []CSCParamChange
	ChainID string
}

--------- Definition cross side chain prams change ------------------- //

type CodeType

type CodeType = sdk.CodeType
const (
	DefaultCodespace sdk.CodespaceType = 12

	CodeMissSideChainId          CodeType = 101
	CodeInvalidSideChainId       CodeType = 102
	CodeInvalidCrossChainPackage CodeType = 103
)

type DexFeeField

type DexFeeField struct {
	FeeName  string `json:"fee_name"`
	FeeValue int64  `json:"fee_value"`
}

type DexFeeParam

type DexFeeParam struct {
	DexFeeFields []DexFeeField `json:"dex_fee_fields"`
}

func (*DexFeeParam) Check

func (p *DexFeeParam) Check() error

func (*DexFeeParam) GetParamType

func (p *DexFeeParam) GetParamType() string

type FeeChangeParams

type FeeChangeParams struct {
	FeeParams   []FeeParam `json:"fee_params"`
	Description string     `json:"description"`
}

func (*FeeChangeParams) Check

func (f *FeeChangeParams) Check() error

func (*FeeChangeParams) String

func (f *FeeChangeParams) String() string

type FeeParam

type FeeParam interface {
	GetParamType() string
	Check() error
}

type FixedFeeParams

type FixedFeeParams struct {
	MsgType string                `json:"msg_type"`
	Fee     int64                 `json:"fee"`
	FeeFor  sdk.FeeDistributeType `json:"fee_for"`
}

func (*FixedFeeParams) Check

func (p *FixedFeeParams) Check() error

func (*FixedFeeParams) GetMsgType

func (p *FixedFeeParams) GetMsgType() string

func (*FixedFeeParams) GetParamType

func (p *FixedFeeParams) GetParamType() string

type GenesisState

type GenesisState struct {
	FeeGenesis []FeeParam `json:"fees"`
}

type LastProposalID

type LastProposalID struct {
	ProposalID int64 `json:"proposal_id"`
}

type MsgFeeParams

type MsgFeeParams interface {
	FeeParam
	GetMsgType() string
}

type ParamChangePublisher

type ParamChangePublisher interface {
	SubscribeParamChange(updateCb func(sdk.Context, interface{}), spaceProto *ParamSpaceProto, genesisCb func(sdk.Context, interface{}), loadCb func(sdk.Context, interface{}))
}

type ParamSpaceProto

type ParamSpaceProto struct {
	ParamSpace subspace.Subspace

	Proto func() SCParam
}

--------- Definition side chain prams change ------------------- //

type SCChangeParams

type SCChangeParams struct {
	SCParams    []SCParam `json:"sc_params"`
	Description string    `json:"description"`
}

func (*SCChangeParams) Check

func (s *SCChangeParams) Check() error

type SCParam

type SCParam interface {
	subspace.ParamSet
	UpdateCheck() error
	// native means weather the parameter stored in native store context or side chain store context
	//GetParamAttribute() (string, bool)
	GetParamAttribute() (string, bool)
}

type TransferFeeParam

type TransferFeeParam struct {
	FixedFeeParams    `json:"fixed_fee_params"`
	MultiTransferFee  int64 `json:"multi_transfer_fee"`
	LowerLimitAsMulti int64 `json:"lower_limit_as_multi"`
}

func (*TransferFeeParam) Check

func (p *TransferFeeParam) Check() error

func (*TransferFeeParam) GetParamType

func (p *TransferFeeParam) GetParamType() string

Jump to

Keyboard shortcuts

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