msgtype

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AtomicSwapRoute = "atomicSwap"
	HTLT            = "HTLT"
	DepositHTLT     = "depositHTLT"
	ClaimHTLT       = "claimHTLT"
	RefundHTLT      = "refundHTLT"

	Int64Size               = 8
	RandomNumberHashLength  = 32
	RandomNumberLength      = 32
	MaxOtherChainAddrLength = 64
	SwapIDLength            = 32
	MaxExpectedIncomeLength = 64
	MinimumHeightSpan       = 360
	MaximumHeightSpan       = 518400
)
View Source
const (
	RouteBridge = "bridge"

	BindMsgType        = "crossBind"
	UnbindMsgType      = "crossUnbind"
	TransferOutMsgType = "crossTransferOut"
)
View Source
const (
	MsgRoute = "gov"

	MaxTitleLength           = 128
	MaxDescriptionLength int = 2048
	MaxVotingPeriod          = 2 * 7 * 24 * 60 * 60 * time.Second // 2 weeks
)

name to idetify transaction types

View Source
const (
	MiniRoute        = "miniTokensIssue"
	IssueMiniMsgType = "miniIssueMsg"
)
View Source
const (
	RouteOracle = "oracle"

	ClaimMsgType = "oracleClaim"

	OracleChannelId sdk.IbcChannelID = 0x00
)
View Source
const (
	CrossChainFeeLength = 32
	PackageTypeLength   = 1
	PackageHeaderLength = CrossChainFeeLength + PackageTypeLength
)
View Source
const (
	RouteNewOrder    = "orderNew"
	RouteCancelOrder = "orderCancel"
)

Order routes

View Source
const (
	AccountFlagsRoute      = "accountFlags"
	SetAccountFlagsMsgType = "setAccountFlags"
)
View Source
const (
	MsgTypeSideSubmitProposal = "side_submit_proposal"
	MsgTypeSideDeposit        = "side_deposit"
	MsgTypeSideVote           = "side_vote"

	// side chain params change
	ProposalTypeSCParamsChange ProposalKind = 0x81
	// cross side chain param change
	ProposalTypeCSCParamsChange ProposalKind = 0x82

	MaxSideChainIdLength = 20
)
View Source
const (
	TypeMsgSideChainUnjail = "side_chain_unjail"

	SideChainSlashMsgRoute = "slashing"
)
View Source
const (
	TypeCreateSideChainValidator = "side_create_validator"
	TypeEditSideChainValidator   = "side_edit_validator"
	TypeSideChainDelegate        = "side_delegate"
	TypeSideChainRedelegate      = "side_redelegate"
	TypeSideChainUndelegate      = "side_undelegate"

	SideChainStakeMsgRoute = "stake"
	SideChainAddrLen       = 20

	MinDelegationAmount = 1e8
)
View Source
const (
	MaxTimeLockDescriptionLength = 128
	MinLockTime                  = 60 * time.Second

	InitialRecordId = 1
)
View Source
const (
	DotBSuffix                    = ".B"
	NativeToken                   = "BNB"
	NativeTokenDotBSuffixed       = "BNB" + DotBSuffix
	Decimals                int8  = 8
	MaxTotalSupply          int64 = 9000000000000000000 // 90 billions with 8 decimal digits

	TokenSymbolMaxLen          = 8
	TokenSymbolMinLen          = 2
	TokenSymbolTxHashSuffixLen = 3

	MiniTokenSymbolMaxLen          = 8
	MiniTokenSymbolMinLen          = 2
	MiniTokenSymbolSuffixLen       = 4
	MiniTokenSymbolMSuffix         = "M"
	MiniTokenSymbolTxHashSuffixLen = 3
	MaxMiniTokenNameLength         = 32
	MaxTokenURILength              = 2048
)

constants

View Source
const (
	IssueTinyMsgType = "tinyIssueMsg"
)
View Source
const (
	MaxSymbolLength = 32
)

Variables

View Source
var (
	// bnb prefix address:  bnb1wxeplyw7x8aahy93w96yhwm7xcq3ke4f8ge93u
	// tbnb prefix address: tbnb1wxeplyw7x8aahy93w96yhwm7xcq3ke4ffasp3d
	AtomicSwapCoinsAccAddr = types.AccAddress(crypto.AddressHash([]byte("BinanceChainAtomicSwapCoins")))
)
View Source
var MsgCdc = amino.NewCodec()
View Source
var OrderSide = struct {
	BUY  int8
	SELL int8
}{1, 2}

OrderSide /TimeInForce /OrderType are const, following FIX protocol convention Used as Enum

View Source
var OrderType = struct {
	LIMIT  int8
	MARKET int8
}{orderLimit, orderMarket}

OrderType is an enum of order type options supported by the matching engine

View Source
var StatusTextToString = [...]string{"pending", "success", "failed"}
View Source
var StringToStatusText = map[string]StatusText{
	"pending": PendingStatusText,
	"success": SuccessStatusText,
	"failed":  FailedStatusText,
}
View Source
var TimeInForce = struct {
	GTC int8
	IOC int8
}{tifGTC, tifIOC}

TimeInForce is an enum of TIF (Time in Force) options supported by the matching engine

View Source
var (
	TimeLockCoinsAccAddr = types.AccAddress(crypto.AddressHash([]byte("BinanceChainTimeLockCoins")))
)

Functions

func CalculateRandomHash

func CalculateRandomHash(randomNumber []byte, timestamp int64) []byte

func CalculateSwapID

func CalculateSwapID(randomNumberHash []byte, sender types.AccAddress, senderOtherChain string) []byte

func GenerateOrderID

func GenerateOrderID(sequence int64, from types.AccAddress) string

GenerateOrderID generates an order ID

func GetClaimId

func GetClaimId(chainId sdk.IbcChainID, channelId sdk.IbcChannelID, sequence int64) string

func Has0xPrefix

func Has0xPrefix(input string) bool

has0xPrefix validates str begins with '0x' or '0X'.

func HexAddress

func HexAddress(a []byte) string

func HexDecode

func HexDecode(input string) ([]byte, error)

Decode decodes a hex string with 0x prefix.

func HexEncode

func HexEncode(b []byte) string

func IToOrderType

func IToOrderType(tpe int8) string

IToOrderType conversion

func IToSide

func IToSide(side int8) string

IToSide conversion

func IToTimeInForce

func IToTimeInForce(tif int8) string

IToTimeInForce conversion

func IsValidMiniTokenSymbol

func IsValidMiniTokenSymbol(symbol string) bool

Validate and check if it's mini token

func IsValidOrderType

func IsValidOrderType(ot int8) bool

IsValidOrderType validates that an order type is valid and supported by the matching engine

func IsValidSide

func IsValidSide(side int8) bool

IsValidSide validates that a side is valid and supported by the matching engine

func IsValidTimeInForce

func IsValidTimeInForce(tif int8) bool

IsValidTimeInForce validates that a tif code is correct

func MustSortJSON

func MustSortJSON(toSortJSON []byte) []byte

MustSortJSON is like SortJSON but panic if an error occurs, e.g., if the passed JSON isn't valid.

func RegisterCodec

func RegisterCodec(cdc *amino.Codec)

func SideStringToSideCode

func SideStringToSideCode(side string) (int8, error)

SideStringToSideCode converts a string like "BUY" to its internal side code

func SortJSON

func SortJSON(toSortJSON []byte) ([]byte, error)

SortJSON takes any JSON and returns it sorted by keys. Also, all white-spaces are removed. This method can be used to canonicalize JSON to be returned by GetSignBytes, e.g. for the ledger integration. If the passed JSON isn't valid it will return an error.

func TifStringToTifCode

func TifStringToTifCode(tif string) (int8, error)

TifStringToTifCode converts a string like "GTC" to its internal tif code

func ValidateMiniTokenSymbol

func ValidateMiniTokenSymbol(symbol string) error

func ValidateSymbol

func ValidateSymbol(symbol string) error

ValidateSymbol utility

Types

type ApproveBindSynPackage

type ApproveBindSynPackage struct {
	Status          uint32
	Bep2TokenSymbol [32]byte
}

type BindMsg

type BindMsg struct {
	From             sdk.AccAddress    `json:"from"`
	Symbol           string            `json:"symbol"`
	Amount           int64             `json:"amount"`
	ContractAddress  SmartChainAddress `json:"contract_address"`
	ContractDecimals int8              `json:"contract_decimals"`
	ExpireTime       int64             `json:"expire_time"`
}

func NewBindMsg

func NewBindMsg(from sdk.AccAddress, symbol string, amount int64, contractAddress SmartChainAddress, contractDecimals int8, expireTime int64) BindMsg

func (BindMsg) GetInvolvedAddresses

func (msg BindMsg) GetInvolvedAddresses() []sdk.AccAddress

func (BindMsg) GetSignBytes

func (msg BindMsg) GetSignBytes() []byte

func (BindMsg) GetSigners

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

func (BindMsg) Route

func (msg BindMsg) Route() string

func (BindMsg) String

func (msg BindMsg) String() string

func (BindMsg) Type

func (msg BindMsg) Type() string

func (BindMsg) ValidateBasic

func (msg BindMsg) ValidateBasic() error

type BindStatus

type BindStatus int8

type BindSynPackage

type BindSynPackage struct {
	PackageType     uint8
	Bep2TokenSymbol [32]byte
	ContractAddr    [20]byte
	TotalSupply     *big.Int
	PeggyAmount     *big.Int
	Decimals        uint8
	ExpireTime      uint64
}

type CSCParamChange

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

	// 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 CancelOrderMsg

type CancelOrderMsg struct {
	Sender types.AccAddress `json:"sender"`
	Symbol string           `json:"symbol"`
	RefID  string           `json:"refid"`
}

CancelOrderMsg represents a message to cancel an open order

func NewCancelOrderMsg

func NewCancelOrderMsg(sender types.AccAddress, symbol, refID string) CancelOrderMsg

NewCancelOrderMsg constructs a new CancelOrderMsg

func (CancelOrderMsg) GetInvolvedAddresses

func (msg CancelOrderMsg) GetInvolvedAddresses() []types.AccAddress

GetInvolvedAddresses as part of Msg interface

func (CancelOrderMsg) GetSignBytes

func (msg CancelOrderMsg) GetSignBytes() []byte

GetSignBytes - Get the bytes for the message signer to sign on

func (CancelOrderMsg) GetSigners

func (msg CancelOrderMsg) GetSigners() []types.AccAddress

GetSigners is part of Msg interface

func (CancelOrderMsg) Route

func (msg CancelOrderMsg) Route() string

Route is part of Msg interface

func (CancelOrderMsg) String

func (msg CancelOrderMsg) String() string

String is part of Msg interface

func (CancelOrderMsg) Type

func (msg CancelOrderMsg) Type() string

Type is part of Msg interface

func (CancelOrderMsg) ValidateBasic

func (msg CancelOrderMsg) ValidateBasic() error

ValidateBasic is used to quickly disqualify obviously invalid messages quickly

type Claim

type Claim struct {
	ID               string         `json:"id"`
	ValidatorAddress sdk.ValAddress `json:"validator_address"`
	Content          string         `json:"content"`
}

Claim contains an arbitrary claim with arbitrary content made by a given validator

func NewClaim

func NewClaim(id string, validatorAddress sdk.ValAddress, content string) Claim

NewClaim returns a new Claim

type ClaimHTLTMsg

type ClaimHTLTMsg struct {
	From         types.AccAddress `json:"from"`
	SwapID       types.SwapBytes  `json:"swap_id"`
	RandomNumber types.SwapBytes  `json:"random_number"`
}

func NewClaimHTLTMsg

func NewClaimHTLTMsg(from types.AccAddress, swapID, randomNumber []byte) ClaimHTLTMsg

func (ClaimHTLTMsg) GetInvolvedAddresses

func (msg ClaimHTLTMsg) GetInvolvedAddresses() []types.AccAddress

func (ClaimHTLTMsg) GetSignBytes

func (msg ClaimHTLTMsg) GetSignBytes() []byte

func (ClaimHTLTMsg) GetSigners

func (msg ClaimHTLTMsg) GetSigners() []types.AccAddress

func (ClaimHTLTMsg) Route

func (msg ClaimHTLTMsg) Route() string

func (ClaimHTLTMsg) String

func (msg ClaimHTLTMsg) String() string

func (ClaimHTLTMsg) Type

func (msg ClaimHTLTMsg) Type() string

func (ClaimHTLTMsg) ValidateBasic

func (msg ClaimHTLTMsg) ValidateBasic() error

type ClaimMsg

type ClaimMsg struct {
	ChainId          sdk.IbcChainID `json:"chain_id"`
	Sequence         uint64         `json:"sequence"`
	Payload          []byte         `json:"payload"`
	ValidatorAddress sdk.AccAddress `json:"validator_address"`
}

func NewClaimMsg

func NewClaimMsg(ChainId sdk.IbcChainID, sequence uint64, payload []byte, validatorAddr sdk.AccAddress) ClaimMsg

func (ClaimMsg) GetInvolvedAddresses

func (msg ClaimMsg) GetInvolvedAddresses() []sdk.AccAddress

func (ClaimMsg) GetSignBytes

func (msg ClaimMsg) GetSignBytes() []byte

GetSignBytes - Get the bytes for the message signer to sign on

func (ClaimMsg) GetSigners

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

func (ClaimMsg) Route

func (msg ClaimMsg) Route() string

nolint

func (ClaimMsg) String

func (msg ClaimMsg) String() string

func (ClaimMsg) Type

func (msg ClaimMsg) Type() string

func (ClaimMsg) ValidateBasic

func (msg ClaimMsg) ValidateBasic() error

ValidateBasic is used to quickly disqualify obviously invalid messages quickly

type CommonAckPackage

type CommonAckPackage struct {
	Code uint32
}

type CreateOrderMsg

type CreateOrderMsg struct {
	Sender      types.AccAddress `json:"sender"`
	ID          string           `json:"id"`
	Symbol      string           `json:"symbol"`
	OrderType   int8             `json:"ordertype"`
	Side        int8             `json:"side"`
	Price       int64            `json:"price"`
	Quantity    int64            `json:"quantity"`
	TimeInForce int8             `json:"timeinforce"`
}

CreateOrderMsg def

func NewCreateOrderMsg

func NewCreateOrderMsg(sender types.AccAddress, id string, side int8, symbol string, price int64, qty int64) CreateOrderMsg

NewCreateOrderMsg constructs a new CreateOrderMsg

func (CreateOrderMsg) GetInvolvedAddresses

func (msg CreateOrderMsg) GetInvolvedAddresses() []types.AccAddress

GetInvolvedAddresses as part of the Msg interface

func (CreateOrderMsg) GetSignBytes

func (msg CreateOrderMsg) GetSignBytes() []byte

GetSignBytes - Get the bytes for the message signer to sign on

func (CreateOrderMsg) GetSigners

func (msg CreateOrderMsg) GetSigners() []types.AccAddress

GetSigners is part of Msg interface

func (CreateOrderMsg) Route

func (msg CreateOrderMsg) Route() string

Route is part of Msg interface

func (CreateOrderMsg) String

func (msg CreateOrderMsg) String() string

String is part of Msg interface

func (CreateOrderMsg) Type

func (msg CreateOrderMsg) Type() string

Type is part of Msg interface

func (CreateOrderMsg) ValidateBasic

func (msg CreateOrderMsg) ValidateBasic() error

ValidateBasic is used to quickly disqualify obviously invalid messages quickly

type CreateSideChainValidatorMsg

type CreateSideChainValidatorMsg struct {
	Description   Description         `json:"description"`
	Commission    types.CommissionMsg `json:"commission"`
	DelegatorAddr types.AccAddress    `json:"delegator_address"`
	ValidatorAddr types.ValAddress    `json:"validator_address"`
	Delegation    types.Coin          `json:"delegation"`
	SideChainId   string              `json:"side_chain_id"`
	SideConsAddr  []byte              `json:"side_cons_addr"`
	SideFeeAddr   []byte              `json:"side_fee_addr"`
}

func NewCreateSideChainValidatorMsg

func NewCreateSideChainValidatorMsg(valAddr types.ValAddress, delegation types.Coin,
	description Description, commission types.CommissionMsg, sideChainId string, sideConsAddr []byte, sideFeeAddr []byte) CreateSideChainValidatorMsg

func NewMsgCreateSideChainValidatorOnBehalfOf

func NewMsgCreateSideChainValidatorOnBehalfOf(delegatorAddr types.AccAddress, valAddr types.ValAddress, delegation types.Coin,
	description Description, commission types.CommissionMsg, sideChainId string, sideConsAddr []byte, sideFeeAddr []byte) CreateSideChainValidatorMsg

func (CreateSideChainValidatorMsg) GetInvolvedAddresses

func (msg CreateSideChainValidatorMsg) GetInvolvedAddresses() []types.AccAddress

func (CreateSideChainValidatorMsg) GetSignBytes

func (msg CreateSideChainValidatorMsg) GetSignBytes() []byte

func (CreateSideChainValidatorMsg) GetSigners

func (msg CreateSideChainValidatorMsg) GetSigners() []types.AccAddress

func (CreateSideChainValidatorMsg) Route

func (msg CreateSideChainValidatorMsg) Route() string

func (CreateSideChainValidatorMsg) Type

func (CreateSideChainValidatorMsg) ValidateBasic

func (msg CreateSideChainValidatorMsg) ValidateBasic() error

type CrossChainPackage

type CrossChainPackage struct {
	PackageType CrossChainPackageType
	RelayFee    big.Int
	Content     interface{}
}

func ParseClaimPayload

func ParseClaimPayload(payload []byte) ([]CrossChainPackage, error)

type CrossChainPackageType

type CrossChainPackageType uint8
const (
	SynCrossChainPackageType     CrossChainPackageType = 0x00
	AckCrossChainPackageType     CrossChainPackageType = 0x01
	FailAckCrossChainPackageType CrossChainPackageType = 0x02
)

func DecodePackageHeader

func DecodePackageHeader(packageHeader []byte) (packageType CrossChainPackageType, relayFee big.Int, err error)

type CrossParamChange

type CrossParamChange struct {
	Key    string
	Value  []byte
	Target []byte
}

type DBProphecy

type DBProphecy struct {
	ID              string `json:"id"`
	Status          Status `json:"status"`
	ValidatorClaims []byte `json:"validator_claims"`
}

DBProphecy is what the prophecy becomes when being saved to the database.

Tendermint/Amino does not support maps so we must serialize those variables into bytes.

func (DBProphecy) DeserializeFromDB

func (dbProphecy DBProphecy) DeserializeFromDB() (Prophecy, error)

DeserializeFromDB deserializes a DBProphecy into a prophecy

type DepositHTLTMsg

type DepositHTLTMsg struct {
	From   types.AccAddress `json:"from"`
	Amount types.Coins      `json:"amount"`
	SwapID types.SwapBytes  `json:"swap_id"`
}

func NewDepositHTLTMsg

func NewDepositHTLTMsg(from types.AccAddress, swapID []byte, amount types.Coins) DepositHTLTMsg

func (DepositHTLTMsg) GetInvolvedAddresses

func (msg DepositHTLTMsg) GetInvolvedAddresses() []types.AccAddress

func (DepositHTLTMsg) GetSignBytes

func (msg DepositHTLTMsg) GetSignBytes() []byte

func (DepositHTLTMsg) GetSigners

func (msg DepositHTLTMsg) GetSigners() []types.AccAddress

func (DepositHTLTMsg) Route

func (msg DepositHTLTMsg) Route() string

func (DepositHTLTMsg) String

func (msg DepositHTLTMsg) String() string

func (DepositHTLTMsg) Type

func (msg DepositHTLTMsg) Type() string

func (DepositHTLTMsg) ValidateBasic

func (msg DepositHTLTMsg) ValidateBasic() error

type DepositMsg

type DepositMsg struct {
	ProposalID int64            `json:"proposal_id"` // ID of the proposal
	Depositer  types.AccAddress `json:"depositer"`   // Address of the depositer
	Amount     types.Coins      `json:"amount"`      // Coins to add to the proposal's deposit
}

----------------------------------------------------------- DepositMsg

func NewDepositMsg

func NewDepositMsg(depositer types.AccAddress, proposalID int64, amount types.Coins) DepositMsg

func (DepositMsg) Get

func (msg DepositMsg) Get(key interface{}) (value interface{})

Implements Msg.

func (DepositMsg) GetInvolvedAddresses

func (msg DepositMsg) GetInvolvedAddresses() []types.AccAddress

func (DepositMsg) GetSignBytes

func (msg DepositMsg) GetSignBytes() []byte

Implements Msg.

func (DepositMsg) GetSigners

func (msg DepositMsg) GetSigners() []types.AccAddress

Implements Msg.

func (DepositMsg) Route

func (msg DepositMsg) Route() string

Implements Msg. nolint

func (DepositMsg) String

func (msg DepositMsg) String() string

func (DepositMsg) Type

func (msg DepositMsg) Type() string

func (DepositMsg) ValidateBasic

func (msg DepositMsg) ValidateBasic() error

Implements Msg.

type Description

type Description struct {
	Moniker  string `json:"moniker"`  // name
	Identity string `json:"identity"` // optional identity signature (ex. UPort or Keybase)
	Website  string `json:"website"`  // optional website link
	Details  string `json:"details"`  // optional details
}

Description - description fields for a validator

func (Description) EnsureLength

func (d Description) EnsureLength() (Description, error)

EnsureLength ensures the length of a validator's description.

type DexListMsg

type DexListMsg struct {
	From             types.AccAddress `json:"from"`
	ProposalId       int64            `json:"proposal_id"`
	BaseAssetSymbol  string           `json:"base_asset_symbol"`
	QuoteAssetSymbol string           `json:"quote_asset_symbol"`
	InitPrice        int64            `json:"init_price"`
}

DexListMsg def

func NewDexListMsg

func NewDexListMsg(from types.AccAddress, proposalId int64, baseAssetSymbol string, quoteAssetSymbol string, initPrice int64) DexListMsg

NewDexListMsg for instance creation

func (DexListMsg) GetInvolvedAddresses

func (msg DexListMsg) GetInvolvedAddresses() []types.AccAddress

GetInvolvedAddresses part of Msg interface

func (DexListMsg) GetSignBytes

func (msg DexListMsg) GetSignBytes() []byte

GetSignBytes part of Msg interface

func (DexListMsg) GetSigners

func (msg DexListMsg) GetSigners() []types.AccAddress

GetSigners part of Msg interface

func (DexListMsg) Route

func (msg DexListMsg) Route() string

Route part of Msg interface

func (DexListMsg) String

func (msg DexListMsg) String() string

String part of Msg interface

func (DexListMsg) Type

func (msg DexListMsg) Type() string

Type part of Msg interface

func (DexListMsg) ValidateBasic

func (msg DexListMsg) ValidateBasic() error

ValidateBasic part of Msg interface

type EditSideChainValidatorMsg

type EditSideChainValidatorMsg struct {
	Description   Description      `json:"description"`
	ValidatorAddr types.ValAddress `json:"address"`

	CommissionRate *types.Dec `json:"commission_rate"`

	SideChainId string `json:"side_chain_id"`
	SideFeeAddr []byte `json:"side_fee_addr"`
}

func NewEditSideChainValidatorMsg

func NewEditSideChainValidatorMsg(sideChainId string, validatorAddr types.ValAddress, description Description, commissionRate *types.Dec, sideFeeAddr []byte) EditSideChainValidatorMsg

func (EditSideChainValidatorMsg) GetInvolvedAddresses

func (msg EditSideChainValidatorMsg) GetInvolvedAddresses() []types.AccAddress

func (EditSideChainValidatorMsg) GetSignBytes

func (msg EditSideChainValidatorMsg) GetSignBytes() []byte

func (EditSideChainValidatorMsg) GetSigners

func (msg EditSideChainValidatorMsg) GetSigners() []types.AccAddress

func (EditSideChainValidatorMsg) Route

func (msg EditSideChainValidatorMsg) Route() string

func (EditSideChainValidatorMsg) Type

func (msg EditSideChainValidatorMsg) Type() string

func (EditSideChainValidatorMsg) ValidateBasic

func (msg EditSideChainValidatorMsg) ValidateBasic() error

type HTLTMsg

type HTLTMsg struct {
	From                types.AccAddress `json:"from"`
	To                  types.AccAddress `json:"to"`
	RecipientOtherChain string           `json:"recipient_other_chain"`
	SenderOtherChain    string           `json:"sender_other_chain"`
	RandomNumberHash    types.SwapBytes  `json:"random_number_hash"`
	Timestamp           int64            `json:"timestamp"`
	Amount              types.Coins      `json:"amount"`
	ExpectedIncome      string           `json:"expected_income"`
	HeightSpan          int64            `json:"height_span"`
	CrossChain          bool             `json:"cross_chain"`
}

func NewHTLTMsg

func NewHTLTMsg(from, to types.AccAddress, recipientOtherChain, senderOtherChain string, randomNumberHash types.SwapBytes, timestamp int64,
	amount types.Coins, expectedIncome string, heightSpan int64, crossChain bool) HTLTMsg

func (HTLTMsg) GetInvolvedAddresses

func (msg HTLTMsg) GetInvolvedAddresses() []types.AccAddress

func (HTLTMsg) GetSignBytes

func (msg HTLTMsg) GetSignBytes() []byte

func (HTLTMsg) GetSigners

func (msg HTLTMsg) GetSigners() []types.AccAddress

func (HTLTMsg) Route

func (msg HTLTMsg) Route() string

func (HTLTMsg) String

func (msg HTLTMsg) String() string

func (HTLTMsg) Type

func (msg HTLTMsg) Type() string

func (HTLTMsg) ValidateBasic

func (msg HTLTMsg) ValidateBasic() error

type IbcParams

type IbcParams struct {
	RelayerFee int64 `json:"relayer_fee"`
}

func (*IbcParams) GetParamAttribute

func (p *IbcParams) GetParamAttribute() (string, bool)

func (*IbcParams) UpdateCheck

func (p *IbcParams) UpdateCheck() error

type IbcValidator

type IbcValidator struct {
	ConsAddr []byte
	FeeAddr  []byte
	DistAddr []byte
	Power    uint64
}

type IbcValidatorSetPackage

type IbcValidatorSetPackage struct {
	Type         uint8
	ValidatorSet []IbcValidator
}

type Input

type Input struct {
	Address types.AccAddress `json:"address"`
	Coins   types.Coins      `json:"coins"`
}

Transaction Input

func NewInput

func NewInput(addr types.AccAddress, coins types.Coins) Input

NewInput - create a transaction input, used with SendMsg

func (Input) GetSignBytes

func (in Input) GetSignBytes() []byte

Return bytes to sign for Input

func (Input) ValidateBasic

func (in Input) ValidateBasic() error

ValidateBasic - validate transaction input

type ListMiniMsg

type ListMiniMsg struct {
	From             types.AccAddress `json:"from"`
	BaseAssetSymbol  string           `json:"base_asset_symbol"`
	QuoteAssetSymbol string           `json:"quote_asset_symbol"`
	InitPrice        int64            `json:"init_price"`
}

ListMiniMsg def

func NewListMiniMsg

func NewListMiniMsg(from types.AccAddress, baseAssetSymbol string, quoteAssetSymbol string, initPrice int64) ListMiniMsg

NewListMiniMsg for instance creation

func (ListMiniMsg) GetInvolvedAddresses

func (msg ListMiniMsg) GetInvolvedAddresses() []types.AccAddress

GetInvolvedAddresses part of Msg interface

func (ListMiniMsg) GetSignBytes

func (msg ListMiniMsg) GetSignBytes() []byte

GetSignBytes part of Msg interface

func (ListMiniMsg) GetSigners

func (msg ListMiniMsg) GetSigners() []types.AccAddress

GetSigners part of Msg interface

func (ListMiniMsg) Route

func (msg ListMiniMsg) Route() string

Route part of Msg interface

func (ListMiniMsg) String

func (msg ListMiniMsg) String() string

String part of Msg interface

func (ListMiniMsg) Type

func (msg ListMiniMsg) Type() string

Type part of Msg interface

func (ListMiniMsg) ValidateBasic

func (msg ListMiniMsg) ValidateBasic() error

ValidateBasic part of Msg interface

type ListTradingPairParams

type ListTradingPairParams struct {
	BaseAssetSymbol  string    `json:"base_asset_symbol"`  // base asset symbol
	QuoteAssetSymbol string    `json:"quote_asset_symbol"` // quote asset symbol
	InitPrice        int64     `json:"init_price"`         // init price
	Description      string    `json:"description"`        // description
	ExpireTime       time.Time `json:"expire_time"`        // expire time
}

-----------------------------------------------------------

type MiniTokenIssueMsg

type MiniTokenIssueMsg struct {
	From        types.AccAddress `json:"from"`
	Name        string           `json:"name"`
	Symbol      string           `json:"symbol"`
	TotalSupply int64            `json:"total_supply"`
	Mintable    bool             `json:"mintable"`
	TokenURI    string           `json:"token_uri"`
}

MiniTokenIssueMsg def

func NewMiniTokenIssueMsg

func NewMiniTokenIssueMsg(from types.AccAddress, name, symbol string, supply int64, mintable bool, tokenURI string) MiniTokenIssueMsg

NewMiniTokenIssueMsg for instance creation

func (MiniTokenIssueMsg) GetInvolvedAddresses

func (msg MiniTokenIssueMsg) GetInvolvedAddresses() []types.AccAddress

GetInvolvedAddresses part of Msg interface

func (MiniTokenIssueMsg) GetSignBytes

func (msg MiniTokenIssueMsg) GetSignBytes() []byte

GetSignBytes part of Msg interface

func (MiniTokenIssueMsg) GetSigners

func (msg MiniTokenIssueMsg) GetSigners() []types.AccAddress

GetSigners part of Msg interface

func (MiniTokenIssueMsg) Route

func (msg MiniTokenIssueMsg) Route() string

Route part of Msg interface

func (MiniTokenIssueMsg) String

func (msg MiniTokenIssueMsg) String() string

String part of Msg interface

func (MiniTokenIssueMsg) Type

func (msg MiniTokenIssueMsg) Type() string

Type part of Msg interface

func (MiniTokenIssueMsg) ValidateBasic

func (msg MiniTokenIssueMsg) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

type MintMsg

type MintMsg struct {
	From   types.AccAddress `json:"from"`
	Symbol string           `json:"symbol"`
	Amount int64            `json:"amount"`
}

func NewMintMsg

func NewMintMsg(from types.AccAddress, symbol string, amount int64) MintMsg

func (MintMsg) GetInvolvedAddresses

func (msg MintMsg) GetInvolvedAddresses() []types.AccAddress

func (MintMsg) GetSignBytes

func (msg MintMsg) GetSignBytes() []byte

func (MintMsg) GetSigners

func (msg MintMsg) GetSigners() []types.AccAddress

func (MintMsg) Route

func (msg MintMsg) Route() string

Implements MintMsg.

func (MintMsg) String

func (msg MintMsg) String() string

func (MintMsg) Type

func (msg MintMsg) Type() string

func (MintMsg) ValidateBasic

func (msg MintMsg) ValidateBasic() error

type Msg

type Msg interface {
	// Return the message type.
	// Must be alphanumeric or empty.
	Route() string

	// Returns a human-readable string for the message, intended for utilization
	// within tags
	Type() string

	// ValidateBasic does a simple validation check that
	// doesn't require access to any other information.
	ValidateBasic() error

	// Get the canonical byte representation of the Msg.
	GetSignBytes() []byte

	// Signers returns the addrs of signers that must sign.
	// CONTRACT: All signatures must be present to be valid.
	// CONTRACT: Returns addrs in some deterministic order.
	GetSigners() []types.AccAddress

	// Get involved addresses of this msg so that we can publish account balance change
	GetInvolvedAddresses() []types.AccAddress
}

Msg - Transactions messages must fulfill the Msg

type MsgCreateValidator

type MsgCreateValidator struct {
	Description   Description
	Commission    types.CommissionMsg
	DelegatorAddr types.AccAddress `json:"delegator_address"`
	ValidatorAddr types.ValAddress `json:"validator_address"`
	PubKey        crypto.PubKey    `json:"pubkey"`
	Delegation    types.Coin       `json:"delegation"`
}

MsgCreateValidator - struct for bonding transactions

func (MsgCreateValidator) GetInvolvedAddresses

func (msg MsgCreateValidator) GetInvolvedAddresses() []types.AccAddress

func (MsgCreateValidator) GetSignBytes

func (msg MsgCreateValidator) GetSignBytes() []byte

get the bytes for the message signer to sign on

func (MsgCreateValidator) GetSigners

func (msg MsgCreateValidator) GetSigners() []types.AccAddress

Return address(es) that must sign over msg.GetSignBytes()

func (MsgCreateValidator) Route

func (msg MsgCreateValidator) Route() string

func (MsgCreateValidator) Type

func (msg MsgCreateValidator) Type() string

func (MsgCreateValidator) ValidateBasic

func (msg MsgCreateValidator) ValidateBasic() error

quick validity check

type MsgCreateValidatorProposal

type MsgCreateValidatorProposal struct {
	MsgCreateValidator
	ProposalId int64 `json:"proposal_id"`
}

type MsgRemoveValidator

type MsgRemoveValidator struct {
	LauncherAddr types.AccAddress  `json:"launcher_addr"`
	ValAddr      types.ValAddress  `json:"val_addr"`
	ValConsAddr  types.ConsAddress `json:"val_cons_addr"`
	ProposalId   int64             `json:"proposal_id"`
}

func NewMsgRemoveValidator

func NewMsgRemoveValidator(launcherAddr types.AccAddress, valAddr types.ValAddress,
	valConsAddr types.ConsAddress, proposalId int64) MsgRemoveValidator

func (MsgRemoveValidator) GetInvolvedAddresses

func (msg MsgRemoveValidator) GetInvolvedAddresses() []types.AccAddress

func (MsgRemoveValidator) GetSignBytes

func (msg MsgRemoveValidator) GetSignBytes() []byte

get the bytes for the message signer to sign on

func (MsgRemoveValidator) GetSigners

func (msg MsgRemoveValidator) GetSigners() []types.AccAddress

func (MsgRemoveValidator) Route

func (msg MsgRemoveValidator) Route() string

nolint

func (MsgRemoveValidator) Type

func (msg MsgRemoveValidator) Type() string

func (MsgRemoveValidator) ValidateBasic

func (msg MsgRemoveValidator) ValidateBasic() error

quick validity check

type MsgSideChainUnjail

type MsgSideChainUnjail struct {
	ValidatorAddr types.ValAddress `json:"address"`
	SideChainId   string           `json:"side_chain_id"`
}

func NewMsgSideChainUnjail

func NewMsgSideChainUnjail(validatorAddr types.ValAddress, sideChainId string) MsgSideChainUnjail

func (MsgSideChainUnjail) GetInvolvedAddresses

func (msg MsgSideChainUnjail) GetInvolvedAddresses() []types.AccAddress

func (MsgSideChainUnjail) GetSignBytes

func (msg MsgSideChainUnjail) GetSignBytes() []byte

func (MsgSideChainUnjail) GetSigners

func (msg MsgSideChainUnjail) GetSigners() []types.AccAddress

func (MsgSideChainUnjail) Route

func (msg MsgSideChainUnjail) Route() string

func (MsgSideChainUnjail) Type

func (msg MsgSideChainUnjail) Type() string

func (MsgSideChainUnjail) ValidateBasic

func (msg MsgSideChainUnjail) ValidateBasic() error

type OracleParams

type OracleParams struct {
	ConsensusNeeded types.Dec `json:"ConsensusNeeded"` //  Minimum deposit for a proposal to enter voting period.
}

func (*OracleParams) GetParamAttribute

func (p *OracleParams) GetParamAttribute() (string, bool)

func (*OracleParams) UpdateCheck

func (p *OracleParams) UpdateCheck() error

type Output

type Output struct {
	Address types.AccAddress `json:"address"`
	Coins   types.Coins      `json:"coins"`
}

Transaction Output

func NewOutput

func NewOutput(addr types.AccAddress, coins types.Coins) Output

NewOutput - create a transaction output, used with SendMsg

func (Output) GetSignBytes

func (out Output) GetSignBytes() []byte

Return bytes to sign for Output

func (Output) ValidateBasic

func (out Output) ValidateBasic() error

ValidateBasic - validate transaction output

type Package

type Package struct {
	ChannelId sdk.IbcChannelID
	Sequence  uint64
	Payload   []byte
}

type Packages

type Packages []Package

type Prophecy

type Prophecy struct {
	ID     string `json:"id"`
	Status Status `json:"status"`

	//This is a mapping from a claim to the list of validators that made that claim.
	ClaimValidators map[string][]types.ValAddress `json:"claim_validators"`
	//This is a mapping from a validator bech32 address to their claim
	ValidatorClaims map[string]string `json:"validator_claims"`
}

func (Prophecy) SerializeForDB

func (prophecy Prophecy) SerializeForDB() (DBProphecy, error)

SerializeForDB serializes a prophecy into a DBProphecy

type ProposalKind

type ProposalKind byte

Type that represents Proposal Type as a byte

const (
	ProposalTypeNil             ProposalKind = 0x00
	ProposalTypeText            ProposalKind = 0x01
	ProposalTypeParameterChange ProposalKind = 0x02
	ProposalTypeSoftwareUpgrade ProposalKind = 0x03
	ProposalTypeListTradingPair ProposalKind = 0x04
	// ProposalTypeFeeChange belongs to ProposalTypeParameterChange. We use this to make it easily to distinguish。
	ProposalTypeFeeChange ProposalKind = 0x05
)

nolint

func ProposalTypeFromString

func ProposalTypeFromString(str string) (ProposalKind, error)

String to proposalType byte. Returns ff if invalid.

func (ProposalKind) Format

func (pt ProposalKind) Format(s fmt.State, verb rune)

For Printf / Sprintf, returns bech32 when using %s nolint: errcheck

func (ProposalKind) Marshal

func (pt ProposalKind) Marshal() ([]byte, error)

Marshal needed for protobuf compatibility

func (ProposalKind) MarshalJSON

func (pt ProposalKind) MarshalJSON() ([]byte, error)

Marshals to JSON using string

func (ProposalKind) String

func (pt ProposalKind) String() string

Turns VoteOption byte to String

func (*ProposalKind) Unmarshal

func (pt *ProposalKind) Unmarshal(data []byte) error

Unmarshal needed for protobuf compatibility

func (*ProposalKind) UnmarshalJSON

func (pt *ProposalKind) UnmarshalJSON(data []byte) error

Unmarshals from JSON assuming Bech32 encoding

type RefundHTLTMsg

type RefundHTLTMsg struct {
	From   types.AccAddress `json:"from"`
	SwapID types.SwapBytes  `json:"swap_id"`
}

func NewRefundHTLTMsg

func NewRefundHTLTMsg(from types.AccAddress, swapID []byte) RefundHTLTMsg

func (RefundHTLTMsg) GetInvolvedAddresses

func (msg RefundHTLTMsg) GetInvolvedAddresses() []types.AccAddress

func (RefundHTLTMsg) GetSignBytes

func (msg RefundHTLTMsg) GetSignBytes() []byte

func (RefundHTLTMsg) GetSigners

func (msg RefundHTLTMsg) GetSigners() []types.AccAddress

func (RefundHTLTMsg) Route

func (msg RefundHTLTMsg) Route() string

func (RefundHTLTMsg) String

func (msg RefundHTLTMsg) String() string

func (RefundHTLTMsg) Type

func (msg RefundHTLTMsg) Type() string

func (RefundHTLTMsg) ValidateBasic

func (msg RefundHTLTMsg) ValidateBasic() error

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 {
	UpdateCheck() error
	// native means weather the parameter stored in native store context or side chain store context
	//GetParamAttribute() (string, bool)
	GetParamAttribute() (string, bool)
}

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

type SendMsg

type SendMsg struct {
	Inputs  []Input  `json:"inputs"`
	Outputs []Output `json:"outputs"`
}

SendMsg - high level transaction of the coin module

func CreateSendMsg

func CreateSendMsg(from types.AccAddress, fromCoins types.Coins, transfers []Transfer) SendMsg

func NewMsgSend

func NewMsgSend(in []Input, out []Output) SendMsg

NewMsgSend - construct arbitrary multi-in, multi-out send msg.

func (SendMsg) GetInvolvedAddresses

func (msg SendMsg) GetInvolvedAddresses() []types.AccAddress

func (SendMsg) GetSignBytes

func (msg SendMsg) GetSignBytes() []byte

Implements Msg.

func (SendMsg) GetSigners

func (msg SendMsg) GetSigners() []types.AccAddress

Implements Msg.

func (SendMsg) Route

func (msg SendMsg) Route() string

func (SendMsg) Type

func (msg SendMsg) Type() string

func (SendMsg) ValidateBasic

func (msg SendMsg) ValidateBasic() error

Implements Msg.

type SetAccountFlagsMsg

type SetAccountFlagsMsg struct {
	From  types.AccAddress `json:"from"`
	Flags uint64           `json:"flags"`
}

func NewSetAccountFlagsMsg

func NewSetAccountFlagsMsg(from types.AccAddress, flags uint64) SetAccountFlagsMsg

func (SetAccountFlagsMsg) GetInvolvedAddresses

func (msg SetAccountFlagsMsg) GetInvolvedAddresses() []types.AccAddress

func (SetAccountFlagsMsg) GetSignBytes

func (msg SetAccountFlagsMsg) GetSignBytes() []byte

func (SetAccountFlagsMsg) GetSigners

func (msg SetAccountFlagsMsg) GetSigners() []types.AccAddress

func (SetAccountFlagsMsg) Route

func (msg SetAccountFlagsMsg) Route() string

func (SetAccountFlagsMsg) String

func (msg SetAccountFlagsMsg) String() string

func (SetAccountFlagsMsg) Type

func (msg SetAccountFlagsMsg) Type() string

func (SetAccountFlagsMsg) ValidateBasic

func (msg SetAccountFlagsMsg) ValidateBasic() error

type SetURIMsg

type SetURIMsg struct {
	From     types.AccAddress `json:"from"`
	Symbol   string           `json:"symbol"`
	TokenURI string           `json:"token_uri"`
}

SetURIMsg def

func NewSetUriMsg

func NewSetUriMsg(from types.AccAddress, symbol string, tokenURI string) SetURIMsg

NewSetUriMsg for instance creation

func (SetURIMsg) GetInvolvedAddresses

func (msg SetURIMsg) GetInvolvedAddresses() []types.AccAddress

GetInvolvedAddresses part of Msg interface

func (SetURIMsg) GetSignBytes

func (msg SetURIMsg) GetSignBytes() []byte

GetSignBytes part of Msg interface

func (SetURIMsg) GetSigners

func (msg SetURIMsg) GetSigners() []types.AccAddress

GetSigners part of Msg interface

func (SetURIMsg) Route

func (msg SetURIMsg) Route() string

Route part of Msg interface

func (SetURIMsg) String

func (msg SetURIMsg) String() string

String part of Msg interface

func (SetURIMsg) Type

func (msg SetURIMsg) Type() string

Type part of Msg interface

func (SetURIMsg) ValidateBasic

func (msg SetURIMsg) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

type SideChainDelegateMsg

type SideChainDelegateMsg struct {
	DelegatorAddr types.AccAddress `json:"delegator_addr"`
	ValidatorAddr types.ValAddress `json:"validator_addr"`
	Delegation    types.Coin       `json:"delegation"`

	SideChainId string `json:"side_chain_id"`
}

func NewSideChainDelegateMsg

func NewSideChainDelegateMsg(sideChainId string, delAddr types.AccAddress, valAddr types.ValAddress, delegation types.Coin) SideChainDelegateMsg

func (SideChainDelegateMsg) GetInvolvedAddresses

func (msg SideChainDelegateMsg) GetInvolvedAddresses() []types.AccAddress

func (SideChainDelegateMsg) GetSignBytes

func (msg SideChainDelegateMsg) GetSignBytes() []byte

func (SideChainDelegateMsg) GetSigners

func (msg SideChainDelegateMsg) GetSigners() []types.AccAddress

func (SideChainDelegateMsg) Route

func (msg SideChainDelegateMsg) Route() string

func (SideChainDelegateMsg) Type

func (msg SideChainDelegateMsg) Type() string

func (SideChainDelegateMsg) ValidateBasic

func (msg SideChainDelegateMsg) ValidateBasic() error

type SideChainDepositMsg

type SideChainDepositMsg struct {
	ProposalID  int64            `json:"proposal_id"` // ID of the proposal
	Depositer   types.AccAddress `json:"depositer"`   // Address of the depositer
	Amount      types.Coins      `json:"amount"`      // Coins to add to the proposal's deposit
	SideChainId string           `json:"side_chain_id"`
}

----------------------------------------------------------- SideChainDepositMsg

func NewSideChainDepositMsg

func NewSideChainDepositMsg(depositer types.AccAddress, proposalID int64, amount types.Coins, sideChainId string) SideChainDepositMsg

func (SideChainDepositMsg) GetInvolvedAddresses

func (msg SideChainDepositMsg) GetInvolvedAddresses() []types.AccAddress

Implements Msg. Identical to MsgDeposit, keep here for code readability.

func (SideChainDepositMsg) GetSignBytes

func (msg SideChainDepositMsg) GetSignBytes() []byte

Implements Msg.

func (SideChainDepositMsg) GetSigners

func (msg SideChainDepositMsg) GetSigners() []types.AccAddress

Implements Msg. Identical to MsgDeposit, keep here for code readability.

func (SideChainDepositMsg) Route

func (msg SideChainDepositMsg) Route() string

nolint

func (SideChainDepositMsg) String

func (msg SideChainDepositMsg) String() string

func (SideChainDepositMsg) Type

func (msg SideChainDepositMsg) Type() string

func (SideChainDepositMsg) ValidateBasic

func (msg SideChainDepositMsg) ValidateBasic() error

Implements Msg.

type SideChainRedelegateMsg

type SideChainRedelegateMsg struct {
	DelegatorAddr    types.AccAddress `json:"delegator_addr"`
	ValidatorSrcAddr types.ValAddress `json:"validator_src_addr"`
	ValidatorDstAddr types.ValAddress `json:"validator_dst_addr"`
	Amount           types.Coin       `json:"amount"`
	SideChainId      string           `json:"side_chain_id"`
}

func NewSideChainRedelegateMsg

func NewSideChainRedelegateMsg(sideChainId string, delegatorAddr types.AccAddress, valSrcAddr types.ValAddress, valDstAddr types.ValAddress, amount types.Coin) SideChainRedelegateMsg

func (SideChainRedelegateMsg) GetInvolvedAddresses

func (msg SideChainRedelegateMsg) GetInvolvedAddresses() []types.AccAddress

func (SideChainRedelegateMsg) GetSignBytes

func (msg SideChainRedelegateMsg) GetSignBytes() []byte

func (SideChainRedelegateMsg) GetSigners

func (msg SideChainRedelegateMsg) GetSigners() []types.AccAddress

func (SideChainRedelegateMsg) Route

func (msg SideChainRedelegateMsg) Route() string

func (SideChainRedelegateMsg) Type

func (msg SideChainRedelegateMsg) Type() string

func (SideChainRedelegateMsg) ValidateBasic

func (msg SideChainRedelegateMsg) ValidateBasic() error

type SideChainSubmitProposalMsg

type SideChainSubmitProposalMsg struct {
	Title          string           `json:"title"`           //  Title of the proposal
	Description    string           `json:"description"`     //  Description of the proposal
	ProposalType   ProposalKind     `json:"proposal_type"`   //  Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal}
	Proposer       types.AccAddress `json:"proposer"`        //  Address of the proposer
	InitialDeposit types.Coins      `json:"initial_deposit"` //  Initial deposit paid by sender. Must be strictly positive.
	VotingPeriod   time.Duration    `json:"voting_period"`   //  Length of the voting period (s)
	SideChainId    string           `json:"side_chain_id"`
}

----------------------------------------------------------- SideChainSubmitProposalMsg

func NewSideChainSubmitProposalMsg

func NewSideChainSubmitProposalMsg(title string, description string, proposalType ProposalKind, proposer types.AccAddress, initialDeposit types.Coins, votingPeriod time.Duration, sideChainId string) SideChainSubmitProposalMsg

func (SideChainSubmitProposalMsg) GetInvolvedAddresses

func (msg SideChainSubmitProposalMsg) GetInvolvedAddresses() []types.AccAddress

Implements Msg. Identical to MsgSubmitProposal, keep here for code readability.

func (SideChainSubmitProposalMsg) GetSignBytes

func (msg SideChainSubmitProposalMsg) GetSignBytes() []byte

Implements Msg.

func (SideChainSubmitProposalMsg) GetSigners

func (msg SideChainSubmitProposalMsg) GetSigners() []types.AccAddress

Implements Msg. Identical to MsgSubmitProposal, keep here for code readability.

func (SideChainSubmitProposalMsg) Route

func (msg SideChainSubmitProposalMsg) Route() string

nolint

func (SideChainSubmitProposalMsg) String

func (msg SideChainSubmitProposalMsg) String() string

func (SideChainSubmitProposalMsg) Type

func (SideChainSubmitProposalMsg) ValidateBasic

func (msg SideChainSubmitProposalMsg) ValidateBasic() error

Implements Msg.

type SideChainUndelegateMsg

type SideChainUndelegateMsg struct {
	DelegatorAddr types.AccAddress `json:"delegator_addr"`
	ValidatorAddr types.ValAddress `json:"validator_addr"`
	Amount        types.Coin       `json:"amount"`
	SideChainId   string           `json:"side_chain_id"`
}

func NewSideChainUndelegateMsg

func NewSideChainUndelegateMsg(sideChainId string, delegatorAddr types.AccAddress, valAddr types.ValAddress, amount types.Coin) SideChainUndelegateMsg

func (SideChainUndelegateMsg) GetInvolvedAddresses

func (msg SideChainUndelegateMsg) GetInvolvedAddresses() []types.AccAddress

func (SideChainUndelegateMsg) GetSignBytes

func (msg SideChainUndelegateMsg) GetSignBytes() []byte

func (SideChainUndelegateMsg) GetSigners

func (msg SideChainUndelegateMsg) GetSigners() []types.AccAddress

func (SideChainUndelegateMsg) Route

func (msg SideChainUndelegateMsg) Route() string

func (SideChainUndelegateMsg) Type

func (msg SideChainUndelegateMsg) Type() string

func (SideChainUndelegateMsg) ValidateBasic

func (msg SideChainUndelegateMsg) ValidateBasic() error

type SideChainVoteMsg

type SideChainVoteMsg struct {
	ProposalID  int64            `json:"proposal_id"` // ID of the proposal
	Voter       types.AccAddress `json:"voter"`       //  address of the voter
	Option      VoteOption       `json:"option"`      //  option from OptionSet chosen by the voter
	SideChainId string           `json:"side_chain_id"`
}

func NewSideChainVoteMsg

func NewSideChainVoteMsg(voter types.AccAddress, proposalID int64, option VoteOption, sideChainId string) SideChainVoteMsg

func (SideChainVoteMsg) GetInvolvedAddresses

func (msg SideChainVoteMsg) GetInvolvedAddresses() []types.AccAddress

Implements Msg. Identical to MsgVote, keep here for code readability.

func (SideChainVoteMsg) GetSignBytes

func (msg SideChainVoteMsg) GetSignBytes() []byte

Implements Msg.

func (SideChainVoteMsg) GetSigners

func (msg SideChainVoteMsg) GetSigners() []types.AccAddress

Implements Msg. Identical to MsgVote, keep here for code readability.

func (SideChainVoteMsg) Route

func (msg SideChainVoteMsg) Route() string

func (SideChainVoteMsg) String

func (msg SideChainVoteMsg) String() string

func (SideChainVoteMsg) Type

func (msg SideChainVoteMsg) Type() string

func (SideChainVoteMsg) ValidateBasic

func (msg SideChainVoteMsg) ValidateBasic() error

Implements Msg.

type SideDowntimeSlashPackage

type SideDowntimeSlashPackage struct {
	SideConsAddr  []byte `json:"side_cons_addr"`
	SideHeight    uint64 `json:"side_height"`
	SideChainId   uint16 `json:"side_chain_id"`
	SideTimestamp uint64 `json:"side_timestamp"`
}

type SlashParams

type SlashParams struct {
	MaxEvidenceAge           time.Duration `json:"max_evidence_age"`
	SignedBlocksWindow       int64         `json:"signed_blocks_window"`
	MinSignedPerWindow       types.Dec     `json:"min_signed_per_window"`
	DoubleSignUnbondDuration time.Duration `json:"double_sign_unbond_duration"`
	DowntimeUnbondDuration   time.Duration `json:"downtime_unbond_duration"`
	TooLowDelUnbondDuration  time.Duration `json:"too_low_del_unbond_duration"`
	SlashFractionDoubleSign  types.Dec     `json:"slash_fraction_double_sign"`
	SlashFractionDowntime    types.Dec     `json:"slash_fraction_downtime"`
	DoubleSignSlashAmount    int64         `json:"double_sign_slash_amount"`
	DowntimeSlashAmount      int64         `json:"downtime_slash_amount"`
	SubmitterReward          int64         `json:"submitter_reward"`
	DowntimeSlashFee         int64         `json:"downtime_slash_fee"`
}

func (*SlashParams) GetParamAttribute

func (p *SlashParams) GetParamAttribute() (string, bool)

func (*SlashParams) UpdateCheck

func (p *SlashParams) UpdateCheck() error

type SmartChainAddress

type SmartChainAddress [20]byte

SmartChainAddress defines a standard smart chain address

func NewSmartChainAddress

func NewSmartChainAddress(addr string) SmartChainAddress

NewSmartChainAddress is a constructor function for SmartChainAddress

func (SmartChainAddress) IsEmpty

func (addr SmartChainAddress) IsEmpty() bool

func (SmartChainAddress) MarshalJSON

func (addr SmartChainAddress) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ethereum address to JSON

func (*SmartChainAddress) SetBytes

func (addr *SmartChainAddress) SetBytes(b []byte)

func (SmartChainAddress) String

func (addr SmartChainAddress) String() string

Route should return the name of the module

func (*SmartChainAddress) UnmarshalJSON

func (addr *SmartChainAddress) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals an smart chain address

type StakeParams

type StakeParams struct {
	UnbondingTime time.Duration `json:"unbonding_time"`

	MaxValidators       uint16 `json:"max_validators"`        // maximum number of validators
	BondDenom           string `json:"bond_denom"`            // bondable coin denomination
	MinSelfDelegation   int64  `json:"min_self_delegation"`   // the minimal self-delegation amount
	MinDelegationChange int64  `json:"min_delegation_change"` // the minimal delegation amount changed
}

Params defines the high level settings for staking

func (*StakeParams) GetParamAttribute

func (p *StakeParams) GetParamAttribute() (string, bool)

func (*StakeParams) UpdateCheck

func (p *StakeParams) UpdateCheck() error

type Status

type Status struct {
	Text       StatusText `json:"text"`
	FinalClaim string     `json:"final_claim"`
}

type StatusText

type StatusText int
const (
	PendingStatusText StatusText = iota
	SuccessStatusText
	FailedStatusText
)

func (StatusText) MarshalJSON

func (text StatusText) MarshalJSON() ([]byte, error)

func (StatusText) String

func (text StatusText) String() string

func (*StatusText) UnmarshalJSON

func (text *StatusText) UnmarshalJSON(b []byte) error

type SubmitProposalMsg

type SubmitProposalMsg struct {
	Title          string           `json:"title"`           //  Title of the proposal
	Description    string           `json:"description"`     //  Description of the proposal
	ProposalType   ProposalKind     `json:"proposal_type"`   //  Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal}
	Proposer       types.AccAddress `json:"proposer"`        //  Address of the proposer
	InitialDeposit types.Coins      `json:"initial_deposit"` //  Initial deposit paid by sender. Must be strictly positive.
	VotingPeriod   time.Duration    `json:"voting_period"`   //  Length of the voting period (s)
}

----------------------------------------------------------- SubmitProposalMsg

func NewMsgSubmitProposal

func NewMsgSubmitProposal(title string, description string, proposalType ProposalKind, proposer types.AccAddress, initialDeposit types.Coins, votingPeriod time.Duration) SubmitProposalMsg

func (SubmitProposalMsg) Get

func (msg SubmitProposalMsg) Get(key interface{}) (value interface{})

Implements Msg.

func (SubmitProposalMsg) GetInvolvedAddresses

func (msg SubmitProposalMsg) GetInvolvedAddresses() []types.AccAddress

func (SubmitProposalMsg) GetSignBytes

func (msg SubmitProposalMsg) GetSignBytes() []byte

Implements Msg.

func (SubmitProposalMsg) GetSigners

func (msg SubmitProposalMsg) GetSigners() []types.AccAddress

Implements Msg.

func (SubmitProposalMsg) Route

func (msg SubmitProposalMsg) Route() string

nolint

func (SubmitProposalMsg) String

func (msg SubmitProposalMsg) String() string

func (SubmitProposalMsg) Type

func (msg SubmitProposalMsg) Type() string

func (SubmitProposalMsg) ValidateBasic

func (msg SubmitProposalMsg) ValidateBasic() error

Implements Msg.

type TimeLockMsg

type TimeLockMsg struct {
	From        types.AccAddress `json:"from"`
	Description string           `json:"description"`
	Amount      types.Coins      `json:"amount"`
	LockTime    int64            `json:"lock_time"`
}

func NewTimeLockMsg

func NewTimeLockMsg(from types.AccAddress, description string, amount types.Coins, lockTime int64) TimeLockMsg

func (TimeLockMsg) GetInvolvedAddresses

func (msg TimeLockMsg) GetInvolvedAddresses() []types.AccAddress

func (TimeLockMsg) GetSignBytes

func (msg TimeLockMsg) GetSignBytes() []byte

func (TimeLockMsg) GetSigners

func (msg TimeLockMsg) GetSigners() []types.AccAddress

func (TimeLockMsg) Route

func (msg TimeLockMsg) Route() string

func (TimeLockMsg) String

func (msg TimeLockMsg) String() string

func (TimeLockMsg) Type

func (msg TimeLockMsg) Type() string

func (TimeLockMsg) ValidateBasic

func (msg TimeLockMsg) ValidateBasic() error

type TimeRelockMsg

type TimeRelockMsg struct {
	From        types.AccAddress `json:"from"`
	Id          int64            `json:"time_lock_id"`
	Description string           `json:"description"`
	Amount      types.Coins      `json:"amount"`
	LockTime    int64            `json:"lock_time"`
}

func NewTimeRelockMsg

func NewTimeRelockMsg(from types.AccAddress, id int64, description string, amount types.Coins, lockTime int64) TimeRelockMsg

func (TimeRelockMsg) GetInvolvedAddresses

func (msg TimeRelockMsg) GetInvolvedAddresses() []types.AccAddress

func (TimeRelockMsg) GetSignBytes

func (msg TimeRelockMsg) GetSignBytes() []byte

func (TimeRelockMsg) GetSigners

func (msg TimeRelockMsg) GetSigners() []types.AccAddress

func (TimeRelockMsg) Route

func (msg TimeRelockMsg) Route() string

func (TimeRelockMsg) String

func (msg TimeRelockMsg) String() string

func (TimeRelockMsg) Type

func (msg TimeRelockMsg) Type() string

func (TimeRelockMsg) ValidateBasic

func (msg TimeRelockMsg) ValidateBasic() error

type TimeUnlockMsg

type TimeUnlockMsg struct {
	From types.AccAddress `json:"from"`
	Id   int64            `json:"time_lock_id"`
}

func NewTimeUnlockMsg

func NewTimeUnlockMsg(from types.AccAddress, id int64) TimeUnlockMsg

func (TimeUnlockMsg) GetInvolvedAddresses

func (msg TimeUnlockMsg) GetInvolvedAddresses() []types.AccAddress

func (TimeUnlockMsg) GetSignBytes

func (msg TimeUnlockMsg) GetSignBytes() []byte

func (TimeUnlockMsg) GetSigners

func (msg TimeUnlockMsg) GetSigners() []types.AccAddress

func (TimeUnlockMsg) Route

func (msg TimeUnlockMsg) Route() string

func (TimeUnlockMsg) String

func (msg TimeUnlockMsg) String() string

func (TimeUnlockMsg) Type

func (msg TimeUnlockMsg) Type() string

func (TimeUnlockMsg) ValidateBasic

func (msg TimeUnlockMsg) ValidateBasic() error

type TinyTokenIssueMsg

type TinyTokenIssueMsg struct {
	From        types.AccAddress `json:"from"`
	Name        string           `json:"name"`
	Symbol      string           `json:"symbol"`
	TotalSupply int64            `json:"total_supply"`
	Mintable    bool             `json:"mintable"`
	TokenURI    string           `json:"token_uri"`
}

TinyTokenIssueMsg def

func NewTinyTokenIssueMsg

func NewTinyTokenIssueMsg(from types.AccAddress, name, symbol string, supply int64, mintable bool, tokenURI string) TinyTokenIssueMsg

NewTinyTokenIssueMsg for instance creation

func (TinyTokenIssueMsg) GetInvolvedAddresses

func (msg TinyTokenIssueMsg) GetInvolvedAddresses() []types.AccAddress

GetInvolvedAddresses part of Msg interface

func (TinyTokenIssueMsg) GetSignBytes

func (msg TinyTokenIssueMsg) GetSignBytes() []byte

GetSignBytes part of Msg interface

func (TinyTokenIssueMsg) GetSigners

func (msg TinyTokenIssueMsg) GetSigners() []types.AccAddress

GetSigners part of Msg interface

func (TinyTokenIssueMsg) Route

func (msg TinyTokenIssueMsg) Route() string

Route part of Msg interface

func (TinyTokenIssueMsg) String

func (msg TinyTokenIssueMsg) String() string

String part of Msg interface

func (TinyTokenIssueMsg) Type

func (msg TinyTokenIssueMsg) Type() string

Type part of Msg interface

func (TinyTokenIssueMsg) ValidateBasic

func (msg TinyTokenIssueMsg) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

type TokenBurnMsg

type TokenBurnMsg struct {
	From   types.AccAddress `json:"from"`
	Symbol string           `json:"symbol"`
	Amount int64            `json:"amount"`
}

TokenBurnMsg def

func NewTokenBurnMsg

func NewTokenBurnMsg(from types.AccAddress, symbol string, amount int64) TokenBurnMsg

NewMsg for instance creation

func (TokenBurnMsg) GetInvolvedAddresses

func (msg TokenBurnMsg) GetInvolvedAddresses() []types.AccAddress

GetInvolvedAddresses is part of Msg interface

func (TokenBurnMsg) GetSignBytes

func (msg TokenBurnMsg) GetSignBytes() []byte

func (TokenBurnMsg) GetSigners

func (msg TokenBurnMsg) GetSigners() []types.AccAddress

GetSigners is part of Msg interface

func (TokenBurnMsg) Route

func (msg TokenBurnMsg) Route() string

Route is part of Msg interface

func (TokenBurnMsg) String

func (msg TokenBurnMsg) String() string

String is part of Msg interface

func (TokenBurnMsg) Type

func (msg TokenBurnMsg) Type() string

Type is part of Msg interface

func (TokenBurnMsg) ValidateBasic

func (msg TokenBurnMsg) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

type TokenFreezeMsg

type TokenFreezeMsg struct {
	From   types.AccAddress `json:"from"`
	Symbol string           `json:"symbol"`
	Amount int64            `json:"amount"`
}

TokenFreezeMsg def

func NewFreezeMsg

func NewFreezeMsg(from types.AccAddress, symbol string, amount int64) TokenFreezeMsg

NewFreezeMsg for instance creation

func (TokenFreezeMsg) GetInvolvedAddresses

func (msg TokenFreezeMsg) GetInvolvedAddresses() []types.AccAddress

GetInvolvedAddresses is part of Msg interface

func (TokenFreezeMsg) GetSignBytes

func (msg TokenFreezeMsg) GetSignBytes() []byte

func (TokenFreezeMsg) GetSigners

func (msg TokenFreezeMsg) GetSigners() []types.AccAddress

func (TokenFreezeMsg) Route

func (msg TokenFreezeMsg) Route() string

Route is part of Msg interface

func (TokenFreezeMsg) String

func (msg TokenFreezeMsg) String() string

String is part of Msg interface

func (TokenFreezeMsg) Type

func (msg TokenFreezeMsg) Type() string

Type is part of Msg interface

func (TokenFreezeMsg) ValidateBasic

func (msg TokenFreezeMsg) ValidateBasic() error

type TokenIssueMsg

type TokenIssueMsg struct {
	From        types.AccAddress `json:"from"`
	Name        string           `json:"name"`
	Symbol      string           `json:"symbol"`
	TotalSupply int64            `json:"total_supply"`
	Mintable    bool             `json:"mintable"`
}

TokenIssueMsg def

func NewTokenIssueMsg

func NewTokenIssueMsg(from types.AccAddress, name, symbol string, supply int64, mintable bool) TokenIssueMsg

NewTokenIssueMsg for instance creation

func (TokenIssueMsg) GetInvolvedAddresses

func (msg TokenIssueMsg) GetInvolvedAddresses() []types.AccAddress

GetInvolvedAddresses part of Msg interface

func (TokenIssueMsg) GetSignBytes

func (msg TokenIssueMsg) GetSignBytes() []byte

GetSignBytes part of Msg interface

func (TokenIssueMsg) GetSigners

func (msg TokenIssueMsg) GetSigners() []types.AccAddress

GetSigners part of Msg interface

func (TokenIssueMsg) Route

func (msg TokenIssueMsg) Route() string

Route part of Msg interface

func (TokenIssueMsg) String

func (msg TokenIssueMsg) String() string

String part of Msg interface

func (TokenIssueMsg) Type

func (msg TokenIssueMsg) Type() string

Type part of Msg interface

func (TokenIssueMsg) ValidateBasic

func (msg TokenIssueMsg) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

type TokenUnfreezeMsg

type TokenUnfreezeMsg struct {
	From   types.AccAddress `json:"from"`
	Symbol string           `json:"symbol"`
	Amount int64            `json:"amount"`
}

TokenUnfreezeMsg def

func NewUnfreezeMsg

func NewUnfreezeMsg(from types.AccAddress, symbol string, amount int64) TokenUnfreezeMsg

NewUnfreezeMsg for instance creation

func (TokenUnfreezeMsg) GetInvolvedAddresses

func (msg TokenUnfreezeMsg) GetInvolvedAddresses() []types.AccAddress

GetInvolvedAddresses is part of Msg interface

func (TokenUnfreezeMsg) GetSignBytes

func (msg TokenUnfreezeMsg) GetSignBytes() []byte

func (TokenUnfreezeMsg) GetSigners

func (msg TokenUnfreezeMsg) GetSigners() []types.AccAddress

func (TokenUnfreezeMsg) Route

func (msg TokenUnfreezeMsg) Route() string

Route is part of Msg interface

func (TokenUnfreezeMsg) String

func (msg TokenUnfreezeMsg) String() string

String is part of Msg interface

func (TokenUnfreezeMsg) Type

func (msg TokenUnfreezeMsg) Type() string

Type is part of Msg interface

func (TokenUnfreezeMsg) ValidateBasic

func (msg TokenUnfreezeMsg) ValidateBasic() error

type Transfer

type Transfer struct {
	ToAddr types.AccAddress
	Coins  types.Coins
}

type TransferInSynPackage

type TransferInSynPackage struct {
	Bep2TokenSymbol   [32]byte
	ContractAddress   [20]byte
	Amounts           []*big.Int
	ReceiverAddresses [][]byte
	RefundAddresses   [][20]byte
	ExpireTime        uint64
}

type TransferOutMsg

type TransferOutMsg struct {
	From       sdk.AccAddress    `json:"from"`
	To         SmartChainAddress `json:"to"`
	Amount     sdk.Coin          `json:"amount"`
	ExpireTime int64             `json:"expire_time"`
}

func NewTransferOutMsg

func NewTransferOutMsg(from sdk.AccAddress, to SmartChainAddress, amount sdk.Coin, expireTime int64) TransferOutMsg

func (TransferOutMsg) GetInvolvedAddresses

func (msg TransferOutMsg) GetInvolvedAddresses() []sdk.AccAddress

func (TransferOutMsg) GetSignBytes

func (msg TransferOutMsg) GetSignBytes() []byte

func (TransferOutMsg) GetSigners

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

func (TransferOutMsg) Route

func (msg TransferOutMsg) Route() string

func (TransferOutMsg) String

func (msg TransferOutMsg) String() string

func (TransferOutMsg) Type

func (msg TransferOutMsg) Type() string

func (TransferOutMsg) ValidateBasic

func (msg TransferOutMsg) ValidateBasic() error

type TransferOutRefundPackage

type TransferOutRefundPackage struct {
	Bep2TokenSymbol [32]byte
	RefundAmount    *big.Int
	RefundAddr      []byte
	RefundReason    uint32
}

type TransferOutSynPackage

type TransferOutSynPackage struct {
	Bep2TokenSymbol [32]byte
	ContractAddress [20]byte
	Amount          *big.Int
	Recipient       [20]byte
	RefundAddress   []byte
	ExpireTime      uint64
}

type TransferOwnershipMsg

type TransferOwnershipMsg struct {
	From     types.AccAddress `json:"from"`
	Symbol   string           `json:"symbol"`
	NewOwner types.AccAddress `json:"new_owner"`
}

TransferOwnershipMsg def

func NewTransferOwnershipMsg

func NewTransferOwnershipMsg(from types.AccAddress, symbol string, newOwner types.AccAddress) TransferOwnershipMsg

func (TransferOwnershipMsg) GetInvolvedAddresses

func (msg TransferOwnershipMsg) GetInvolvedAddresses() []types.AccAddress

func (TransferOwnershipMsg) GetSignBytes

func (msg TransferOwnershipMsg) GetSignBytes() []byte

func (TransferOwnershipMsg) GetSigners

func (msg TransferOwnershipMsg) GetSigners() []types.AccAddress

func (TransferOwnershipMsg) Route

func (msg TransferOwnershipMsg) Route() string

func (TransferOwnershipMsg) String

func (msg TransferOwnershipMsg) String() string

func (TransferOwnershipMsg) Type

func (msg TransferOwnershipMsg) Type() string

func (TransferOwnershipMsg) ValidateBasic

func (msg TransferOwnershipMsg) ValidateBasic() error

type UnbindMsg

type UnbindMsg struct {
	From   sdk.AccAddress `json:"from"`
	Symbol string         `json:"symbol"`
}

func NewUnbindMsg

func NewUnbindMsg(from sdk.AccAddress, symbol string) UnbindMsg

func (UnbindMsg) GetInvolvedAddresses

func (msg UnbindMsg) GetInvolvedAddresses() []sdk.AccAddress

func (UnbindMsg) GetSignBytes

func (msg UnbindMsg) GetSignBytes() []byte

func (UnbindMsg) GetSigners

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

func (UnbindMsg) Route

func (msg UnbindMsg) Route() string

func (UnbindMsg) String

func (msg UnbindMsg) String() string

func (UnbindMsg) Type

func (msg UnbindMsg) Type() string

func (UnbindMsg) ValidateBasic

func (msg UnbindMsg) ValidateBasic() error

type VoteMsg

type VoteMsg struct {
	ProposalID int64            `json:"proposal_id"` // ID of the proposal
	Voter      types.AccAddress `json:"voter"`       //  address of the voter
	Option     VoteOption       `json:"option"`      //  option from OptionSet chosen by the voter
}

----------------------------------------------------------- VoteMsg

func NewMsgVote

func NewMsgVote(voter types.AccAddress, proposalID int64, option VoteOption) VoteMsg

func (VoteMsg) Get

func (msg VoteMsg) Get(key interface{}) (value interface{})

Implements Msg.

func (VoteMsg) GetInvolvedAddresses

func (msg VoteMsg) GetInvolvedAddresses() []types.AccAddress

func (VoteMsg) GetSignBytes

func (msg VoteMsg) GetSignBytes() []byte

Implements Msg.

func (VoteMsg) GetSigners

func (msg VoteMsg) GetSigners() []types.AccAddress

Implements Msg.

func (VoteMsg) Route

func (msg VoteMsg) Route() string

Implements Msg. nolint

func (VoteMsg) String

func (msg VoteMsg) String() string

func (VoteMsg) Type

func (msg VoteMsg) Type() string

func (VoteMsg) ValidateBasic

func (msg VoteMsg) ValidateBasic() error

Implements Msg.

type VoteOption

type VoteOption byte
const (
	OptionEmpty      VoteOption = 0x00
	OptionYes        VoteOption = 0x01
	OptionAbstain    VoteOption = 0x02
	OptionNo         VoteOption = 0x03
	OptionNoWithVeto VoteOption = 0x04
)

nolint

func VoteOptionFromString

func VoteOptionFromString(str string) (VoteOption, error)

String to proposalType byte. Returns ff if invalid.

func (VoteOption) Format

func (vo VoteOption) Format(s fmt.State, verb rune)

For Printf / Sprintf, returns bech32 when using %s nolint: errcheck

func (VoteOption) Marshal

func (vo VoteOption) Marshal() ([]byte, error)

Marshal needed for protobuf compatibility

func (VoteOption) MarshalJSON

func (vo VoteOption) MarshalJSON() ([]byte, error)

Marshals to JSON using string

func (VoteOption) String

func (vo VoteOption) String() string

Turns VoteOption byte to String

func (*VoteOption) Unmarshal

func (vo *VoteOption) Unmarshal(data []byte) error

Unmarshal needed for protobuf compatibility

func (*VoteOption) UnmarshalJSON

func (vo *VoteOption) UnmarshalJSON(data []byte) error

Unmarshals from JSON assuming Bech32 encoding

Jump to

Keyboard shortcuts

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