Documentation ¶
Index ¶
- Constants
- Variables
- func FindHightestAPR(validators []Validator) float64
- func GenCollectibleId(contract, tokenId string) string
- func GetValidParameter(first, second string) string
- func MapJsonObject(from interface{}, to interface{}) error
- type BlockAPI
- type CollectionsAPI
- type CollectionsAPIs
- type Delegation
- type DelegationMetaDataPending
- type DelegationResponse
- type DelegationStatus
- type DelegationType
- type DelegationsBatchPage
- type DelegationsPage
- type Platform
- type Platforms
- type ResultsResponse
- type StakeAPI
- type StakeValidator
- type StakeValidatorInfo
- type StakeValidators
- type StakingBatchPage
- type StakingDetails
- type StakingResponse
- type StakingReward
- type TokenTxAPI
- type TokensAPI
- type TxAPI
- type TxUtxoAPI
- type Validator
- type ValidatorMap
- type ValidatorPage
Constants ¶
View Source
const ( DelegationStatusActive DelegationStatus = "active" DelegationStatusPending DelegationStatus = "pending" DelegationTypeAuto DelegationType = "auto" DelegationTypeDelegate DelegationType = "delegate" DefaultAnnualReward = 0.0 )
Variables ¶
View Source
var ( // ErrSourceConn signals that the connection to the source API failed ErrSourceConn = errors.New("connection to servers failed") // ErrInvalidAddr signals that the requested address is invalid ErrInvalidAddr = errors.New("invalid address") // ErrNotFound signals that the resource has not been found ErrNotFound = errors.New("not found") // ErrInvalidKey signals that the requested key is invalid ErrInvalidKey = errors.New("invalid key") )
Functions ¶
func FindHightestAPR ¶
func GenCollectibleId ¶
func GetValidParameter ¶
func MapJsonObject ¶
func MapJsonObject(from interface{}, to interface{}) error
Types ¶
type BlockAPI ¶
type BlockAPI interface { Platform CurrentBlockNumber() (int64, error) GetBlockByNumber(num int64) (*types.Block, error) }
BlockAPI provides block information and lookups
type CollectionsAPI ¶
type CollectionsAPI interface { Platform GetCollections(owner string) (types.CollectionPage, error) GetCollectibles(owner, collectibleID string) (types.CollectiblePage, error) }
type CollectionsAPIs ¶
type CollectionsAPIs map[uint]CollectionsAPI
type Delegation ¶
type Delegation struct { Delegator StakeValidator `json:"delegator"` Value string `json:"value"` Status DelegationStatus `json:"status"` Metadata interface{} `json:"metadata,omitempty"` }
type DelegationMetaDataPending ¶
type DelegationMetaDataPending struct {
AvailableDate uint `json:"available_date"`
}
type DelegationResponse ¶
type DelegationResponse struct { Delegations DelegationsPage `json:"delegations"` Balance string `json:"balance"` Address string `json:"address"` StakingResponse }
type DelegationStatus ¶
type DelegationStatus string
type DelegationType ¶
type DelegationType string
type DelegationsBatchPage ¶
type DelegationsBatchPage []DelegationResponse
type DelegationsPage ¶
type DelegationsPage []Delegation
type Platforms ¶
func (Platforms) GetPlatformList ¶
type ResultsResponse ¶
type ResultsResponse struct {
Results interface{} `json:"docs"`
}
type StakeAPI ¶
type StakeAPI interface { Platform UndelegatedBalance(address string) (string, error) GetDetails() StakingDetails GetValidators() (ValidatorPage, error) GetDelegations(address string) (DelegationsPage, error) GetActiveValidators() (StakeValidators, error) }
StakingAPI provides staking information
type StakeValidator ¶
type StakeValidator struct { ID string `json:"id"` Status bool `json:"status"` Info StakeValidatorInfo `json:"info,omitempty"` Details StakingDetails `json:"details,omitempty"` }
type StakeValidatorInfo ¶
type StakeValidators ¶
type StakeValidators []StakeValidator
func (StakeValidators) ToMap ¶
func (s StakeValidators) ToMap() ValidatorMap
type StakingBatchPage ¶
type StakingBatchPage []StakingResponse
type StakingDetails ¶
type StakingDetails struct { Reward StakingReward `json:"reward"` LockTime int `json:"locktime"` MinimumAmount types.Amount `json:"minimum_amount"` Type DelegationType `json:"type"` }
type StakingResponse ¶
type StakingResponse struct { Coin *coin.ExternalCoin `json:"coin"` Details StakingDetails `json:"details"` }
type StakingReward ¶
type StakingReward struct {
Annual float64 `json:"annual"`
}
type TokenTxAPI ¶
type TokenTxAPI interface { Platform GetTokenTxsByAddress(address, token string) (types.Txs, error) }
TokenTxAPI provides token transaction lookups
type TokensAPI ¶
type TokensAPI interface { Platform GetTokenListByAddress(address string) ([]types.Token, error) GetTokenListIdsByAddress(address string) ([]string, error) }
TokensAPI provides token lookups
type Validator ¶
type Validator struct { ID string `json:"id"` Status bool `json:"status"` Details StakingDetails `json:"details"` }
type ValidatorMap ¶
type ValidatorMap map[string]StakeValidator
type ValidatorPage ¶
type ValidatorPage []Validator
Click to show internal directories.
Click to hide internal directories.