Documentation ¶
Index ¶
- Constants
- func CalculateAnnualReward(p Pool, inflation float64, validator Validator) float64
- func NormalizeDelegations(delegations []Delegation, validators blockatlas.ValidatorMap) []blockatlas.Delegation
- func NormalizeUnbondingDelegations(delegations []UnbondingDelegation, validators blockatlas.ValidatorMap) []blockatlas.Delegation
- type Account
- type AccountValue
- type Amount
- type Attribute
- type AttributeKey
- type Attributes
- type AuthAccount
- type Balance
- type Block
- type BlockHeader
- type BlockMeta
- type Client
- func (c *Client) CurrentBlockNumber() (num int64, err error)
- func (c *Client) GetAccount(address string) (result AuthAccount, err error)
- func (c *Client) GetAddrTxs(address, tag string, page int) (txs TxPage, err error)
- func (c *Client) GetBlockByNumber(num int64) (txs TxPage, err error)
- func (c *Client) GetDelegations(address string) (delegations Delegations, err error)
- func (c *Client) GetInflation() (inflation Inflation, err error)
- func (c *Client) GetPool() (result StakingPool, err error)
- func (c *Client) GetUnbondingDelegations(address string) (delegations UnbondingDelegations, err error)
- func (c *Client) GetValidators() (validators Validators, err error)
- type Contents
- type CosmosCommission
- type CosmosCommissionRates
- type Data
- type Delegation
- type Delegations
- type DenomType
- type Event
- type EventType
- type Events
- type Fee
- type Inflation
- type Message
- type MessageValueDelegate
- type MessageValueTransfer
- type Platform
- func (p *Platform) Coin() coin.Coin
- func (p *Platform) CurrentBlockNumber() (int64, error)
- func (p *Platform) Denom() DenomType
- func (p *Platform) GetActiveValidators() (blockatlas.StakeValidators, error)
- func (p *Platform) GetBlockByNumber(num int64) (*types.Block, error)
- func (p *Platform) GetDelegations(address string) (blockatlas.DelegationsPage, error)
- func (p *Platform) GetDetails() blockatlas.StakingDetails
- func (p *Platform) GetMaxAPR() float64
- func (p *Platform) GetTxsByAddress(address string) (types.TxPage, error)
- func (p *Platform) GetValidators() (blockatlas.ValidatorPage, error)
- func (p *Platform) Normalize(srcTx *Tx) (tx types.Tx, ok bool)
- func (p *Platform) NormalizeTxs(srcTxs []Tx) types.TxPage
- func (p *Platform) UndelegatedBalance(address string) (string, error)
- type Pool
- type StakingPool
- type Tx
- type TxPage
- type TxType
- type UnbondingDelegation
- type UnbondingDelegationEntry
- type UnbondingDelegations
- type Validator
- type Validators
Constants ¶
const ( MsgSend TxType = "cosmos-sdk/MsgSend" MsgMultiSend TxType = "cosmos-sdk/MsgMultiSend" MsgCreateValidator TxType = "cosmos-sdk/MsgCreateValidator" MsgDelegate TxType = "cosmos-sdk/MsgDelegate" MsgUndelegate TxType = "cosmos-sdk/MsgUndelegate" MsgBeginRedelegate TxType = "cosmos-sdk/MsgBeginRedelegate" MsgWithdrawDelegationReward TxType = "cosmos-sdk/MsgWithdrawDelegationReward" MsgWithdrawValidatorCommission TxType = "cosmos-sdk/MsgWithdrawValidatorCommission" MsgSubmitProposal TxType = "cosmos-sdk/MsgSubmitProposal" MsgDeposit TxType = "cosmos-sdk/MsgDeposit" MsgVote TxType = "cosmos-sdk/MsgVote" TextProposal TxType = "cosmos-sdk/TextProposal" MsgUnjail TxType = "cosmos-sdk/MsgUnjail" EventTransfer EventType = "transfer" EventWithdrawRewards EventType = "withdraw_rewards" AttributeAmount AttributeKey = "amount" AttributeValidator AttributeKey = "validator" DenomAtom DenomType = "uatom" DenomKava DenomType = "ukava" )
Types of messages
Variables ¶
This section is empty.
Functions ¶
func CalculateAnnualReward ¶ added in v1.0.37
func NormalizeDelegations ¶ added in v1.0.37
func NormalizeDelegations(delegations []Delegation, validators blockatlas.ValidatorMap) []blockatlas.Delegation
func NormalizeUnbondingDelegations ¶ added in v1.0.37
func NormalizeUnbondingDelegations(delegations []UnbondingDelegation, validators blockatlas.ValidatorMap) []blockatlas.Delegation
Types ¶
type Account ¶ added in v1.0.37
type Account struct {
Value AccountValue `json:"value"`
}
type AccountValue ¶ added in v1.0.37
type AccountValue struct {
Coins []Balance `json:"coins"`
}
type Amount ¶
Amount - the asset & quantity. Always seems to be enclosed in an array/list for some reason. Perhaps used for multiple tokens transferred in a single sender/reciever transfer?
type Attribute ¶ added in v1.0.37
type Attribute struct { Key AttributeKey `json:"key"` Value string `json:"value"` }
type AttributeKey ¶ added in v1.0.37
type AttributeKey string
type Attributes ¶ added in v1.0.37
type Attributes []Attribute
func (Attributes) GetWithdrawRewardValue ¶ added in v1.0.37
func (a Attributes) GetWithdrawRewardValue() int64
type AuthAccount ¶ added in v1.0.37
type AuthAccount struct {
Account Account `json:"result"`
}
type Block ¶ added in v1.0.37
type Block struct {
Meta BlockMeta `json:"block_meta"`
}
Block - top object of get las block request
type BlockHeader ¶ added in v1.0.37
type BlockHeader struct {
Height string `json:"height"`
}
BlockHeader - "BlockMeta" sub object, height
type BlockMeta ¶ added in v1.0.37
type BlockMeta struct {
Header BlockHeader `json:"header"`
}
BlockMeta - "Block" sub object
type Client ¶
Client - the HTTP client
func (*Client) CurrentBlockNumber ¶ added in v1.0.37
func (*Client) GetAccount ¶ added in v1.0.37
func (c *Client) GetAccount(address string) (result AuthAccount, err error)
func (*Client) GetAddrTxs ¶ added in v1.0.37
GetAddrTxs - get all ATOM transactions for a given address
func (*Client) GetBlockByNumber ¶ added in v1.0.37
func (*Client) GetDelegations ¶ added in v1.0.37
func (c *Client) GetDelegations(address string) (delegations Delegations, err error)
func (*Client) GetInflation ¶ added in v1.0.37
func (*Client) GetPool ¶ added in v1.0.37
func (c *Client) GetPool() (result StakingPool, err error)
func (*Client) GetUnbondingDelegations ¶ added in v1.0.37
func (c *Client) GetUnbondingDelegations(address string) (delegations UnbondingDelegations, err error)
func (*Client) GetValidators ¶ added in v1.0.37
func (c *Client) GetValidators() (validators Validators, err error)
type Contents ¶
type Contents struct { Message []Message `json:"msg"` Fee Fee `json:"fee"` Memo string `json:"memo"` }
Contents - amount, fee, and memo
type CosmosCommission ¶ added in v1.0.37
type CosmosCommission struct {
Commision CosmosCommissionRates `json:"commission_rates"`
}
type CosmosCommissionRates ¶ added in v1.0.37
type CosmosCommissionRates struct {
Rate string `json:"rate"`
}
type Delegation ¶ added in v1.0.37
type Delegation struct { DelegatorAddress string `json:"delegator_address"` ValidatorAddress string `json:"validator_address"` Balance string `json:"balance,omitempty"` }
func (*Delegation) Value ¶ added in v1.0.37
func (d *Delegation) Value() string
type Delegations ¶ added in v1.0.37
type Delegations struct {
List []Delegation `json:"result"`
}
type Event ¶ added in v1.0.37
type Event struct { Type EventType Attributes Attributes `json:"Attributes"` }
Events
type Events ¶ added in v1.0.37
type Events []*Event
func (Events) GetWithdrawRewardValue ¶ added in v1.0.37
type Fee ¶
type Fee struct {
FeeAmount []Amount `json:"amount"`
}
Fee - also references the "amount" struct
type Message ¶
type Message struct { Type TxType Value interface{} }
Message - an array that holds multiple 'particulars' entries. Possibly used for multiple transfers in one transaction?
func (*Message) UnmarshalJSON ¶ added in v1.0.37
UnmarshalJSON reads different message types
type MessageValueDelegate ¶ added in v1.0.37
type MessageValueDelegate struct { DelegatorAddr string `json:"delegator_address"` ValidatorAddr string `json:"validator_address"` Amount Amount `json:"amount,omitempty"` }
MessageValueDelegate - from, to, and amount
type MessageValueTransfer ¶ added in v1.0.37
type MessageValueTransfer struct { FromAddr string `json:"from_address"` ToAddr string `json:"to_address"` Amount []Amount `json:"amount,omitempty"` }
MessageValueTransfer - from, to, and amount
type Platform ¶
type Platform struct { CoinIndex uint // contains filtered or unexported fields }
func (*Platform) CurrentBlockNumber ¶ added in v1.0.37
func (*Platform) GetActiveValidators ¶ added in v1.1.4
func (p *Platform) GetActiveValidators() (blockatlas.StakeValidators, error)
func (*Platform) GetBlockByNumber ¶ added in v1.0.37
func (*Platform) GetDelegations ¶ added in v1.0.37
func (p *Platform) GetDelegations(address string) (blockatlas.DelegationsPage, error)
func (*Platform) GetDetails ¶ added in v1.0.37
func (p *Platform) GetDetails() blockatlas.StakingDetails
func (*Platform) GetTxsByAddress ¶
func (*Platform) GetValidators ¶ added in v1.0.37
func (p *Platform) GetValidators() (blockatlas.ValidatorPage, error)
func (*Platform) Normalize ¶ added in v1.0.37
Normalize converts an Cosmos transaction into the generic model
func (*Platform) NormalizeTxs ¶ added in v1.0.37
NormalizeTxs converts multiple Cosmos transactions
type StakingPool ¶ added in v1.0.37
type StakingPool struct {
Pool Pool `json:"result"`
}
type Tx ¶
type Tx struct { Block string `json:"height"` Code int `json:"code"` Date string `json:"timestamp"` ID string `json:"txhash"` Data Data `json:"tx"` Events Events `json:"events"` }
Tx - Base transaction object. Always returned as part of an array
type UnbondingDelegation ¶ added in v1.0.37
type UnbondingDelegation struct { Delegation Entries []UnbondingDelegationEntry `json:"entries"` }
type UnbondingDelegationEntry ¶ added in v1.0.37
type UnbondingDelegations ¶ added in v1.0.37
type UnbondingDelegations struct {
List []UnbondingDelegation `json:"result"`
}
type Validator ¶ added in v1.0.37
type Validator struct { Status int `json:"status"` Address string `json:"operator_address"` Commission CosmosCommission `json:"commission"` }
type Validators ¶ added in v1.0.37
type Validators struct {
Result []Validator `json:"result"`
}