Documentation
¶
Index ¶
- Constants
- Variables
- func GetAddressID(coin, address string) string
- func GetValidParameter(first, second string) string
- type BlockAPI
- type CollectionsAPI
- type CollectionsAPIs
- type Delegation
- type DelegationMetaDataPending
- type DelegationResponse
- type DelegationStatus
- type DelegationType
- type DelegationsBatchPage
- type DelegationsPage
- type DocsResponse
- type Platform
- type Platforms
- type ResultsResponse
- type StakeAPI
- type StakeValidator
- type StakeValidatorInfo
- type StakeValidators
- type StakingBatchPage
- type StakingDetails
- type StakingResponse
- type StakingReward
- type Subscription
- type SubscriptionEvent
- type SubscriptionOperation
- type Subscriptions
- 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 )
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 GetAddressID ¶ added in v1.1.15
func GetValidParameter ¶
Types ¶
type BlockAPI ¶
type BlockAPI interface { Platform CurrentBlockNumber() (int64, error) GetBlockByNumber(num int64) (*types.Block, error) }
BlockAPI provides block information and lookups
type CollectionsAPI ¶ added in v1.1.0
type CollectionsAPI interface { Platform GetCollections(owner string) (types.CollectionPage, error) GetCollectibles(owner, collectibleID string) (types.CollectiblePage, error) }
type CollectionsAPIs ¶ added in v1.1.0
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 DocsResponse ¶
type DocsResponse struct {
Docs interface{} `json:"docs"`
}
type Platforms ¶ added in v1.1.0
func (Platforms) GetPlatformList ¶ added in v1.1.0
type ResultsResponse ¶
type ResultsResponse struct { Total int `json:"total"` 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 ¶ added in v1.1.0
type StakeValidators []StakeValidator
func (StakeValidators) ToMap ¶ added in v1.1.0
func (sv 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 Subscription ¶
func (*Subscription) AddressID ¶ added in v1.1.15
func (v *Subscription) AddressID() string
type SubscriptionEvent ¶ added in v1.1.0
type SubscriptionEvent struct { Subscriptions Subscriptions `json:"subscriptions"` Operation SubscriptionOperation `json:"operation"` }
func (*SubscriptionEvent) ParseSubscriptions ¶ added in v1.1.0
func (e *SubscriptionEvent) ParseSubscriptions(s Subscriptions) []Subscription
type SubscriptionOperation ¶ added in v1.1.0
type SubscriptionOperation string
type Subscriptions ¶ added in v1.1.0
type TokenTxAPI ¶
type TokenTxAPI interface { Platform GetTokenTxsByAddress(address, token string) (types.TxPage, error) }
TokenTxAPI provides token transaction lookups
type TokensAPI ¶ added in v1.1.0
type TokensAPI interface { Platform GetTokenListByAddress(address string) (types.TokenPage, error) }
TokensAPI provides token lookups
type TxUtxoAPI ¶ added in v1.1.0
TxUtxoAPI provides transaction lookup based on address and XPUB (Bitcoin-style)
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.