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) FilterTxsByDenom(txs []Tx, denom string) []Tx
- 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) GetTokenTxsByAddress(address, token string) (types.TxPage, error)
- 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 ¶
func NormalizeDelegations ¶
func NormalizeDelegations(delegations []Delegation, validators blockatlas.ValidatorMap) []blockatlas.Delegation
func NormalizeUnbondingDelegations ¶
func NormalizeUnbondingDelegations(delegations []UnbondingDelegation, validators blockatlas.ValidatorMap) []blockatlas.Delegation
Types ¶
type Account ¶
type Account struct {
Value AccountValue `json:"value"`
}
type AccountValue ¶
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 ¶
type Attribute struct { Key AttributeKey `json:"key"` Value string `json:"value"` }
type AttributeKey ¶
type AttributeKey string
type Attributes ¶
type Attributes []Attribute
func (Attributes) GetWithdrawRewardValue ¶
func (a Attributes) GetWithdrawRewardValue() int64
type AuthAccount ¶
type AuthAccount struct {
Account Account `json:"result"`
}
type Block ¶
type Block struct {
Meta BlockMeta `json:"block"`
}
Block - top object of get las block request
type BlockHeader ¶
type BlockHeader struct {
Height string `json:"height"`
}
BlockHeader - "BlockMeta" sub object, height
type BlockMeta ¶
type BlockMeta struct {
Header BlockHeader `json:"header"`
}
BlockMeta - "Block" sub object
type Client ¶
Client - the HTTP client
func (*Client) CurrentBlockNumber ¶
func (*Client) GetAccount ¶
func (c *Client) GetAccount(address string) (result AuthAccount, err error)
func (*Client) GetAddrTxs ¶
GetAddrTxs - get all KAVA transactions for a given address
func (*Client) GetBlockByNumber ¶
func (*Client) GetDelegations ¶
func (c *Client) GetDelegations(address string) (delegations Delegations, err error)
func (*Client) GetInflation ¶
func (*Client) GetPool ¶
func (c *Client) GetPool() (result StakingPool, err error)
func (*Client) GetUnbondingDelegations ¶
func (c *Client) GetUnbondingDelegations(address string) (delegations UnbondingDelegations, err error)
func (*Client) GetValidators ¶
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 ¶
type CosmosCommission struct {
Commision CosmosCommissionRates `json:"commission_rates"`
}
type CosmosCommissionRates ¶
type CosmosCommissionRates struct {
Rate string `json:"rate"`
}
type Delegation ¶
type Delegation struct { DelegatorAddress string `json:"delegator_address"` ValidatorAddress string `json:"validator_address"` Balance struct { Denom string `json:"denom"` Amount string `json:"amount"` } `json:"balance"` }
func (*Delegation) Value ¶
func (d *Delegation) Value() string
type Delegations ¶
type Delegations struct {
List []Delegation `json:"result"`
}
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 ¶
UnmarshalJSON reads different message types
type MessageValueDelegate ¶
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 ¶
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 ¶
func (*Platform) FilterTxsByDenom ¶ added in v1.1.15
func (*Platform) GetActiveValidators ¶
func (p *Platform) GetActiveValidators() (blockatlas.StakeValidators, error)
func (*Platform) GetBlockByNumber ¶
func (*Platform) GetDelegations ¶
func (p *Platform) GetDelegations(address string) (blockatlas.DelegationsPage, error)
func (*Platform) GetDetails ¶
func (p *Platform) GetDetails() blockatlas.StakingDetails
func (*Platform) GetTokenTxsByAddress ¶ added in v1.1.15
func (*Platform) GetTxsByAddress ¶
func (*Platform) GetValidators ¶
func (p *Platform) GetValidators() (blockatlas.ValidatorPage, error)
func (*Platform) NormalizeTxs ¶
NormalizeTxs converts multiple Cosmos transactions
type StakingPool ¶
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 ¶
type UnbondingDelegation struct { Delegation Entries []UnbondingDelegationEntry `json:"entries"` }
type UnbondingDelegations ¶
type UnbondingDelegations struct {
List []UnbondingDelegation `json:"result"`
}
type Validator ¶
type Validator struct { Status int `json:"status"` Address string `json:"operator_address"` Commission CosmosCommission `json:"commission"` }
type Validators ¶
type Validators struct {
Result []Validator `json:"result"`
}