blockatlas

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 4 Imported by: 18

Documentation

Index

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 GetAddressID(coin, address string) string

func GetValidParameter

func GetValidParameter(first, second string) string

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 Platform

type Platform interface {
	Coin() coin.Coin
}

Platform can be used to access a crypto service

type Platforms added in v1.1.0

type Platforms map[string]Platform

func (Platforms) GetPlatformList added in v1.1.0

func (ps Platforms) GetPlatformList() []Platform

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 StakeValidatorInfo struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Image       string `json:"image"`
	Website     string `json:"website"`
}

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

type Subscription struct {
	Coin    uint   `json:"coin"`
	Address string `json:"address"`
}

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 Subscriptions map[string][]string

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 TxAPI

type TxAPI interface {
	Platform
	GetTxsByAddress(address string) (types.TxPage, error)
}

TxAPI provides transaction lookups based on address

type TxUtxoAPI added in v1.1.0

type TxUtxoAPI interface {
	TxAPI
	GetTxsByXpub(xpub string) (types.TxPage, error)
}

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

Jump to

Keyboard shortcuts

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