types

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvIDFromStr added in v1.4.1

func ConvIDFromStr(IDStr string) (uint32, error)

Types

type AMOAppConfig added in v1.3.0

type AMOAppConfig struct {
	MaxValidators          uint64   `json:"max_validators"`
	WeightValidator        uint64   `json:"weight_validator"`
	WeightDelegator        uint64   `json:"weight_delegator"`
	MinStakingUnit         Currency `json:"min_staking_unit"`
	BlkReward              Currency `json:"blk_reward"`
	TxReward               Currency `json:"tx_reward"`
	PenaltyRatioM          float64  `json:"penalty_ratio_m"` // malicious validator
	PenaltyRatioL          float64  `json:"penalty_ratio_l"` // lazy validators
	LazinessCounterWindow  int64    `json:"laziness_counter_window"`
	LazinessThreshold      float64  `json:"laziness_threshold"`
	BlockBindingWindow     uint64   `json:"block_binding_window"`
	LockupPeriod           uint64   `json:"lockup_period"`
	DraftOpenCount         uint64   `json:"draft_open_count"`
	DraftCloseCount        uint64   `json:"draft_close_count"`
	DraftApplyCount        uint64   `json:"draft_apply_count"`
	DraftDeposit           Currency `json:"draft_deposit"`
	DraftQuorumRate        float64  `json:"draft_quorum_rate"`
	DraftPassRate          float64  `json:"draft_pass_rate"`
	DraftRefundRate        float64  `json:"draft_refund_rate"`
	UpgradeProtocolHeight  int64    `json:"upgrade_protocol_height"`
	UpgradeProtocolVersion uint64   `json:"upgrade_protocol_version"`
}

type Address

type Address string

type Currency

type Currency struct {
	big.Int
}

func (Currency) MarshalJSON added in v1.4.1

func (c Currency) MarshalJSON() ([]byte, error)

func (*Currency) String

func (c *Currency) String() string

func (*Currency) UnmarshalJSON

func (c *Currency) UnmarshalJSON(b []byte) error

type Delegate

type Delegate struct {
	Delegator Address  `json:"delegator"`
	Delegatee Address  `json:"delegatee"`
	Amount    Currency `json:"amount"`
}

type Draft added in v1.4.1

type Draft struct {
	Proposer Address      `json:"proposer"`
	Config   AMOAppConfig `json:"config"`
	Desc     string       `json:"desc"`

	OpenCount  uint64   `json:"open_count"`
	CloseCount uint64   `json:"close_count"`
	ApplyCount uint64   `json:"apply_count"`
	Deposit    Currency `json:"deposit"`

	TallyQuorum  Currency `json:"tally_quorum"`
	TallyApprove Currency `json:"tally_approve"`
	TallyReject  Currency `json:"tally_reject"`
}

type DraftEx added in v1.4.1

type DraftEx struct {
	*Draft
	Votes []*VoteInfo `json:"votes"`
}

type Extra added in v1.4.1

type Extra struct {
	Register json.RawMessage `json:"register,omitempty"`
	Request  json.RawMessage `json:"request,omitempty"`
	Grant    json.RawMessage `json:"grant,omitempty"`
}

type IncentiveInfo added in v1.2.0

type IncentiveInfo struct {
	BlockHeight int64    `json:"block_height"`
	Address     Address  `json:"address"`
	Amount      Currency `json:"amount"`
}

type Parcel

type Parcel struct {
	Owner        Address `json:"owner"`
	Custody      string  `json:"custody"`
	ProxyAccount Address `json:"proxy_account,omitempty"`
	Extra        Extra   `json:"extra,omitempty"`
}

type ParcelEx added in v1.4.1

type ParcelEx struct {
	*Parcel
	Requests []*RequestEx `json:"requests,omitempty"`
	Usages   []*UsageEx   `json:"usages,omitempty"`
}

type PubKeyEd25519

type PubKeyEd25519 []byte

type Request

type Request struct {
	Payment   Currency `json:"payment"`
	Dealer    Address  `json:"dealer,omitempty"`
	DealerFee Currency `json:"dealer_fee,omitempty"`
	Extra     Extra    `json:"extra,omitempty"`
}

type RequestEx added in v1.4.1

type RequestEx struct {
	*Request
	Buyer Address `json:"buyer"`
}

type Stake

type Stake struct {
	Validator PubKeyEd25519 `json:"validator"`
	Amount    Currency      `json:"amount"`
	Delegates []Delegate    `json:"delegates"`
}

type Storage added in v1.4.1

type Storage struct {
	Owner           Address  `json:"owner"`
	Url             string   `json:"url"`
	RegistrationFee Currency `json:"registration_fee"`
	HostingFee      Currency `json:"hosting_fee"`
	Active          bool     `json:"active"`
}

type UDC added in v1.4.2

type UDC struct {
	Owner     Address   `json:"owner"`     // required
	Desc      string    `json:"desc"`      // optional
	Operators []Address `json:"operators"` // optional
	Total     Currency  `json:"total"`     // required
}

type Usage

type Usage struct {
	Custody string `json:"custody"`
	Extra   Extra  `json:"extra,omitempty"`
}

type UsageEx added in v1.4.1

type UsageEx struct {
	*Usage
	Buyer Address `json:"buyer"`
}

type Vote added in v1.4.1

type Vote struct {
	Approve bool `json:"approve"`
}

type VoteInfo added in v1.4.1

type VoteInfo struct {
	Voter Address `json:"voter"`
	*Vote
}

Jump to

Keyboard shortcuts

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