solana

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: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EstimateTimestamp added in v1.1.15

func EstimateTimestamp(slot uint64) int64

func NormalizeDelegations

func NormalizeDelegations(stakeAccounts []StakeData, validators blockatlas.ValidatorMap, epochInfo EpochInfo) (blockatlas.DelegationsPage, error)

Types

type Account

type Account struct {
	Data       string `json:"data"`
	Executable bool   `json:"executable"`
	Lamports   uint64 `json:"lamports"`
	Owner      string `json:"owner"`
	RentEpoch  uint64 `json:"rentEpoch"`
}

type Client

type Client struct {
	client.Request
}

func (*Client) GetAccount

func (c *Client) GetAccount(pubkey string) (account Account, err error)

func (*Client) GetCurrentVoteAccounts

func (c *Client) GetCurrentVoteAccounts() (validators []VoteAccount, err error)

func (*Client) GetEpochInfo

func (c *Client) GetEpochInfo() (epochInfo EpochInfo, err error)

func (*Client) GetMinimumBalanceForRentExemption

func (c *Client) GetMinimumBalanceForRentExemption() (minimumBalance uint64, err error)

func (*Client) GetStakeAccounts

func (c *Client) GetStakeAccounts() (accounts []KeyedAccount, err error)

func (*Client) GetTransactionList added in v1.1.15

func (c *Client) GetTransactionList(address string) ([]ConfirmedSignature, error)

func (*Client) GetTransactions added in v1.1.15

func (c *Client) GetTransactions(address string) ([]ConfirmedTransaction, error)

type ConfirmedSignature added in v1.1.15

type ConfirmedSignature struct {
	Memo      string `json:"memo"`
	Signature string `json:"signature"`
	Slot      uint64 `json:"slot"`
}

type ConfirmedTransaction added in v1.1.15

type ConfirmedTransaction struct {
	Meta        Meta        `json:"meta"`
	Slot        uint64      `json:"slot"`
	Transaction Transaction `json:"transaction"`
}

type EpochInfo

type EpochInfo struct {
	AbsoluteSlot uint64 `json:"absoluteSlot"`
	Epoch        uint64 `json:"epoch"`
	SlotIndex    uint64 `json:"slotIndex"`
	SlotsInEpoch uint64 `json:"slotsInEpoch"`
}

type Info added in v1.1.15

type Info struct {
	Destination string `json:"destination"`
	Lamports    uint64 `json:"lamports"`
	Source      string `json:"source"`
}

type Instructions added in v1.1.15

type Instructions struct {
	Parsed  Parsed `json:"parsed"`
	Program string `json:"program"`
}

type KeyedAccount

type KeyedAccount struct {
	Account Account `json:"account"`
	Pubkey  string  `json:"pubkey"`
}

type Message added in v1.1.15

type Message struct {
	Instructions []Instructions `json:"instructions"`
}

type Meta added in v1.1.15

type Meta struct {
	Err interface{} `json:"err"`
	Fee uint64      `json:"fee"`
}

type Parsed added in v1.1.15

type Parsed struct {
	Info Info   `json:"info"`
	Type string `json:"type"`
}

type Platform

type Platform struct {
	// contains filtered or unexported fields
}

func Init

func Init(api string) *Platform

func (*Platform) Coin

func (p *Platform) Coin() coin.Coin

func (*Platform) GetActiveValidators added in v1.1.4

func (p *Platform) GetActiveValidators() (blockatlas.StakeValidators, error)

func (*Platform) GetDelegations

func (p *Platform) GetDelegations(address string) (blockatlas.DelegationsPage, error)

func (*Platform) GetDetails

func (p *Platform) GetDetails() blockatlas.StakingDetails

func (*Platform) GetTxsByAddress

func (p *Platform) GetTxsByAddress(address string) (types.TxPage, error)

func (*Platform) GetValidators

func (p *Platform) GetValidators() (blockatlas.ValidatorPage, error)

func (*Platform) NormalizeTx added in v1.1.15

func (p *Platform) NormalizeTx(tx ConfirmedTransaction, address string) (normalized types.Tx, err error)

func (*Platform) UndelegatedBalance

func (p *Platform) UndelegatedBalance(address string) (string, error)

type RpcAccount

type RpcAccount struct {
	Context RpcContext `json:"context"`
	Account Account    `json:"value"`
}

type RpcContext

type RpcContext struct {
	Slot uint64 `json:"slot"`
}

type StakeData

type StakeData struct {
	State                StakeState
	RentExemptReserve    uint64
	AuthorizedStaker     [32]byte
	AuthorizedWithdrawer [32]byte
	UnixTimestamp        int64
	LockupEpoch          uint64
	Custodian            [32]byte
	VoterPubkey          [32]byte
	Stake                uint64
	ActivationEpoch      uint64
	DeactivationEpoch    uint64
	WarmupCooldownRate   float64
	CreditsObserved      uint64
}

type StakeState

type StakeState uint32
const (
	StakeStateUninitialized StakeState = 0
	StakeStateInitialized   StakeState = 1
	StakeStateDelegated     StakeState = 2
	StakeStateRewardsPool   StakeState = 3
)

type Transaction added in v1.1.15

type Transaction struct {
	Message    Message  `json:"message"`
	Signatures []string `json:"signatures"`
}

type VoteAccount

type VoteAccount struct {
	NodePubkey       string     `json:"nodePubkey"`
	VotePubkey       string     `json:"votePubkey"`
	Commission       uint64     `json:"commission"`
	ActivatedStake   uint64     `json:"activatedStake"`
	RootSlot         uint64     `json:"rootSlot"`
	LastVote         uint64     `json:"lastVote"`
	EpochCredits     [][]uint64 `json:"epochCredits"`
	EpochVoteAccount bool       `json:"epochVoteAccount"`
}

type VoteAccounts

type VoteAccounts struct {
	Current    []VoteAccount `json:"current"`
	Delinquent []VoteAccount `json:"delinquent"`
}

Jump to

Keyboard shortcuts

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