hub3

package
v0.0.0-...-e01acf0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SendMsg                        = "/cosmos.bank.v1beta1.MsgSend"
	MultiSendMsg                   = "/cosmos.bank.v1beta1.MsgMultiSend"
	DelegateMsg                    = "/cosmos.staking.v1beta1.MsgDelegate"
	UndelegateMsg                  = "/cosmos.staking.v1beta1.MsgUndelegate"
	BeginRedelegateMsg             = "/cosmos.staking.v1beta1.MsgBeginRedelegate"
	WithdrawDelegationRewardMsg    = "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"
	WithdrawValidatorCommissionMsg = "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"
	SubmitProposalMsg              = "/cosmos.gov.v1beta1.MsgSubmitProposal"
	DepositMsg                     = "/cosmos.gov.v1beta1.MsgDeposit"
	VoteMsg                        = "/cosmos.gov.v1beta1.MsgVote"
	UnJailMsg                      = "/cosmos.slashing.v1beta1.MsgUnjail"
)
View Source
const ParserTitle = "hub3"

Variables

This section is empty.

Functions

func ShowGenesisStructure

func ShowGenesisStructure()

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(address string) *API

func (*API) GetBlock

func (api *API) GetBlock(height uint64) (block Block, err error)

func (*API) GetLatestBlock

func (api *API) GetLatestBlock() (block Block, err error)

func (*API) GetTx

func (api *API) GetTx(hash string) (tx Tx, err error)

func (*API) GetValidatorset

func (api *API) GetValidatorset(height uint64) (set Validatorsets, err error)

type Amount

type Amount struct {
	Denom  string          `json:"denom"`
	Amount decimal.Decimal `json:"amount"`
}

type BaseMsg

type BaseMsg struct {
	Type string `json:"@type"`
}

type Block

type Block struct {
	BlockID struct {
		Hash  string `json:"hash"`
		Parts struct {
			Total int    `json:"total"`
			Hash  string `json:"hash"`
		} `json:"parts"`
	} `json:"block_id"`
	Block struct {
		Header struct {
			Version struct {
				Block uint64 `json:"block,string"`
			} `json:"version"`
			ChainID     string    `json:"chain_id"`
			Height      uint64    `json:"height,string"`
			Time        time.Time `json:"time"`
			LastBlockID struct {
				Hash  string `json:"hash"`
				Parts struct {
					Total int    `json:"total"`
					Hash  string `json:"hash"`
				} `json:"parts"`
			} `json:"last_block_id"`
			ProposerAddress string `json:"proposer_address"`
		} `json:"header"`
		Data struct {
			Txs []string `json:"txs"`
		} `json:"data"`
		Evidence struct {
			Evidence []interface{} `json:"evidence"`
		} `json:"evidence"`
		LastCommit struct {
			Height  string `json:"height"`
			Round   int    `json:"round"`
			BlockID struct {
				Hash  string `json:"hash"`
				Parts struct {
					Total int    `json:"total"`
					Hash  string `json:"hash"`
				} `json:"parts"`
			} `json:"block_id"`
			Signatures []struct {
				ValidatorAddress string `json:"validator_address"`
			}
		} `json:"last_commit"`
	} `json:"block"`
}

type Genesis

type Genesis struct {
	AppState struct {
		Accounts []struct {
			Address string   `json:"address"`
			Coins   []Amount `json:"coins"`
		} `json:"accounts"`
		Distribution struct {
			DelegatorStartingInfos []struct {
				StartingInfo struct {
					DelegatorAddress string `json:"delegator_address"`
					StartingInfo     struct {
						Stake decimal.Decimal `json:"stake"`
					} `json:"starting_info"`
					ValidatorAddress string `json:"validator_address"`
				} `json:"starting_info"`
			} `json:"delegator_starting_infos"`
		} `json:"distribution"`
		Staking struct {
			Delegations []struct {
				DelegatorAddress string          `json:"delegator_address"`
				Shares           decimal.Decimal `json:"shares"`
				ValidatorAddress string          `json:"validator_address"`
			} `json:"delegations"`
			Redelegations []struct {
				DelegatorAddress string `json:"delegator_address"`
				Entries          []struct {
					SharesDst decimal.Decimal `json:"shares_dst"`
				} `json:"entries"`
				ValidatorDstAddress string `json:"validator_dst_address"`
				ValidatorSrcAddress string `json:"validator_src_address"`
			} `json:"redelegations"`
		} `json:"staking"`
	} `json:"app_state"`
	GenesisTime time.Time `json:"genesis_time"`
	Validators  []struct {
		Address string          `json:"address"`
		Name    string          `json:"name"`
		Power   decimal.Decimal `json:"power"`
	} `json:"validators"`
}

func GetGenesisState

func GetGenesisState() (state Genesis, err error)

type MsgBeginRedelegate

type MsgBeginRedelegate struct {
	DelegatorAddress    string `json:"delegator_address"`
	ValidatorSrcAddress string `json:"validator_src_address"`
	ValidatorDstAddress string `json:"validator_dst_address"`
	Amount              Amount `json:"amount"`
}

type MsgDelegate

type MsgDelegate struct {
	DelegatorAddress string `json:"delegator_address"`
	ValidatorAddress string `json:"validator_address"`
	Amount           Amount `json:"amount"`
}

type MsgDeposit

type MsgDeposit struct {
	ProposalID uint64   `json:"proposal_id,string"`
	Depositor  string   `json:"depositor" `
	Amount     []Amount `json:"amount" `
}

type MsgMultiSendValue

type MsgMultiSendValue struct {
	Inputs []struct {
		Address string   `json:"address"`
		Coins   []Amount `json:"coins"`
	} `json:"inputs"`
	Outputs []struct {
		Address string   `json:"address"`
		Coins   []Amount `json:"coins"`
	} `json:"outputs"`
}

type MsgSend

type MsgSend struct {
	FromAddress string   `json:"from_address,omitempty"`
	ToAddress   string   `json:"to_address,omitempty"`
	Amount      []Amount `json:"amount"`
}

type MsgSubmitProposal

type MsgSubmitProposal struct {
	Content struct {
		Type  string `json:"type"`
		Value struct {
			Title       string   `json:"title"`
			Description string   `json:"description"`
			Recipient   string   `json:"recipient"`
			Amount      []Amount `json:"amount"`
		} `json:"value"`
	} `json:"content"`
	InitialDeposit []Amount `json:"initial_deposit"`
	Proposer       string   `json:"proposer"`
}

type MsgUndelegate

type MsgUndelegate struct {
	DelegatorAddress string `json:"delegator_address"`
	ValidatorAddress string `json:"validator_address"`
	Amount           Amount `json:"amount"`
}

type MsgUnjail

type MsgUnjail struct {
	ValidatorAddr string `json:"validator_addr"`
}

type MsgVote

type MsgVote struct {
	ProposalID uint64 `json:"proposal_id,string"`
	Voter      string `json:"voter"`
	Option     string `json:"option"`
}

type MsgWithdrawDelegationReward

type MsgWithdrawDelegationReward struct {
	DelegatorAddress string `json:"delegator_address"`
	ValidatorAddress string `json:"validator_address"`
}

type MsgWithdrawDelegationRewardsAll

type MsgWithdrawDelegationRewardsAll struct {
	DelegatorAddress string `json:"delegator_address"`
}

type MsgWithdrawValidatorCommission

type MsgWithdrawValidatorCommission struct {
	ValidatorAddress string `json:"validator_address"`
}

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser(cfg config.Config, d dao.DAO) *Parser

func (*Parser) Run

func (p *Parser) Run() error

func (*Parser) Stop

func (p *Parser) Stop() error

func (*Parser) Title

func (p *Parser) Title() string

type Tx

type Tx struct {
	Tx struct {
		Body struct {
			Messages []json.RawMessage `json:"messages"`
			Memo     string            `json:"memo"`
		} `json:"body"`
		AuthInfo struct {
			Fee struct {
				Amount   []Amount `json:"amount"`
				GasLimit uint64   `json:"gas_limit,string"`
				Payer    string   `json:"payer"`
				Granter  string   `json:"granter"`
			} `json:"fee"`
			Signatures []string `json:"signatures"`
		} `json:"auth_info"`
	} `json:"tx"`
	TxResponse struct {
		Height uint64 `json:"height,string"`
		Hash   string `json:"txhash"`
		Data   string `json:"data"`
		RawLog string `json:"raw_log"`
		Code   int64  `json:"code"`
		Logs   []struct {
			Events []struct {
				Type       string `json:"type"`
				Attributes []struct {
					Key   string `json:"key"`
					Value string `json:"value"`
				} `json:"attributes"`
			} `json:"events"`
		} `json:"logs"`
		GasWanted uint64 `json:"gas_wanted,string"`
		GasUsed   uint64 `json:"gas_used,string"`
		Tx        struct {
			Type string `json:"@type"`
			Body struct {
				Messages []json.RawMessage `json:"messages"`
				Memo     string            `json:"memo"`
			} `json:"body"`
		} `json:"tx"`
		Timestamp time.Time `json:"timestamp"`
	} `json:"tx_response"`
}

type TxsFilter

type TxsFilter struct {
	Limit     uint64
	Page      uint64
	Height    uint64
	MinHeight uint64
	MaxHeight uint64
}

type Validatorsets

type Validatorsets struct {
	Validators []struct {
		Address string `json:"address"`
		PubKey  struct {
			Type string `json:"@type"`
			Key  string `json:"key"`
		} `json:"pub_key"`
		VotingPower decimal.Decimal `json:"voting_power"`
	} `json:"validators"`
}

Jump to

Keyboard shortcuts

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