types

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: ISC Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Address   string `json:"address"`
	Nonce     uint64 `json:"nonce"`
	Tokens    Tokens `json:"tokens"`
	Confirmed uint64 `json:"confirmed"`
}

func ToRpcAccount

func ToRpcAccount(a *types.Account) *Account

type Local

type Local struct {
	// Node version
	Version string `json:"version"`
	// Node network
	Network string `json:"network"`
	// Node p2p id
	Peer string `json:"peer"`
	// Node p2p address
	Address string `json:"address"`
	// Linked node
	Connections uint32 `json:"connections"`
	// Pool message
	Messages uint32 `json:"messages"`
	// Current block height
	Height uint64 `json:"height"`
	// Current effective block height
	Confirmed uint64 `json:"confirmed"`
}

type Record

type Record struct {
	Height   uint64  `json:"height"`
	Receiver string  `json:"receiver"`
	MsgHash  string  `json:"msghash"`
	Time     uint64  `json:"time"`
	Amount   float64 `json:"amount"`
}

type RpcBlock

type RpcBlock struct {
	RpcHeader *RpcHeader `json:"header"`
	RpcBody   *RpcBody   `json:"body"`
	Confirmed bool       `json:"confirmed"`
}

func BlockToRpcBlock

func BlockToRpcBlock(block *fmctypes.Block, confirmed uint64) (*RpcBlock, error)

type RpcBody

type RpcBody struct {
	Messages []*types.RpcMessage `json:"transactions"`
}

func BodyToRpcBody

func BodyToRpcBody(body *types.Body) (*RpcBody, error)

type RpcCandidates

type RpcCandidates struct {
	Members []*RpcMember `json:"members"`
}

func CandidatesToRpcCandidates

func CandidatesToRpcCandidates(candidates types.ICandidates) *RpcCandidates

func SupersToRpcCandidates

func SupersToRpcCandidates(candidates types.ICandidates) *RpcCandidates

type RpcHeader

type RpcHeader struct {
	Version   uint32              `json:"version"`
	Hash      string              `json:"hash"`
	PreHash   string              `json:"parenthash"`
	MsgRoot   string              `json:"txroot"`
	ActRoot   string              `json:"actroot"`
	TokenRoot string              `json:"tokenroot"`
	DPosRoot  string              `json:"dposroot"`
	Height    uint64              `json:"height"`
	Time      time.Time           `json:"time"`
	Cycle     uint64              `json:"cycle"`
	Signer    string              `json:"signer"`
	Signature *types.RpcSignature `json:"signature"`
}

func HeaderToRpcHeader

func HeaderToRpcHeader(header *types.Header) *RpcHeader

type RpcMember

type RpcMember struct {
	Signer   string `json:"address"`
	PeerId   string `json:"peerid"`
	Weight   uint64 `json:"votes"`
	MntCount uint32 `json:"mntcount"`
}

type RpcToken

type RpcToken struct {
	Address        string    `json:"address"`
	Sender         string    `json:"sender"`
	Name           string    `json:"name"`
	Shorthand      string    `json:"shorthand"`
	IncreaseIssues bool      `json:"increaseissues"`
	Records        []*Record `json:"records"`
}

func TokenToRpcToken

func TokenToRpcToken(token *types.TokenRecord) *RpcToken

type TokenAccount

type TokenAccount struct {
	Address  string  `json:"address"`
	Balance  float64 `json:"balance"`
	LockedIn float64 `json:"locked"`
}

type Tokens

type Tokens []*TokenAccount

List of secondary accounts

type TxPool

type TxPool struct {
	MsgsCount  int                    `json:"msgs"`
	ReadyCount int                    `json:"ready"`
	CacheCount int                    `json:"cache"`
	ReadyMsgs  []*fmctypes.RpcMessage `json:"readymsgs"`
	CacheMsgs  []*fmctypes.RpcMessage `json:"cachemsgs"`
}

func MsgsToRpcMsgsPool

func MsgsToRpcMsgsPool(readyMsgs []types.IMessage, cacheMsgs []types.IMessage) *TxPool

Jump to

Keyboard shortcuts

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