Documentation ¶
Index ¶
- type Commitment
- type EpochInfo
- type GetBlockTimeResponse
- type GetConfirmedBlocksResponse
- type GetEpochInfoResponse
- type GetLeaderScheduleResponse
- type GetVoteAccountsBalanceResponse
- type GetVoteAccountsResponse
- type LeaderSchedule
- type RPCClient
- func (c *RPCClient) GetBlockTime(ctx context.Context, slot int64) (int64, error)
- func (c *RPCClient) GetConfirmedBlocks(ctx context.Context, startSlot, endSlot int64) ([]int64, error)
- func (c *RPCClient) GetEpochInfo(ctx context.Context, commitment Commitment) (*EpochInfo, error)
- func (c *RPCClient) GetLeaderSchedule(ctx context.Context, epochSlot int64) (LeaderSchedule, error)
- func (c *RPCClient) GetVoteAccounts(ctx context.Context, commitment Commitment) (*GetVoteAccountsResponse, error)
- func (c *RPCClient) GetVoteAccountsBalance(ctx context.Context, commitment Commitment) (*GetVoteAccountsBalanceResponse, error)
- type VoteAccount
- type VoteAccountKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commitment ¶
type Commitment string
const ( // Most recent block confirmed by supermajority of the cluster as having reached maximum lockout. CommitmentMax Commitment = "max" // Most recent block having reached maximum lockout on this node. CommitmentRoot Commitment = "root" // Most recent block that has been voted on by supermajority of the cluster (optimistic confirmation). CommitmentSingleGossip Commitment = "singleGossip" // The node will query its most recent block. Note that the block may not be complete. CommitmentRecent Commitment = "recent" )
func (Commitment) MarshalJSON ¶
func (c Commitment) MarshalJSON() ([]byte, error)
type EpochInfo ¶
type EpochInfo struct { // Current absolute slot in epoch AbsoluteSlot int64 `json:"absoluteSlot"` // Current block height BlockHeight int64 `json:"blockHeight"` // Current epoch number Epoch int64 `json:"epoch"` // Current slot relative to the start of the current epoch SlotIndex int64 `json:"slotIndex"` // Number of slots in this epoch SlotsInEpoch int64 `json:"slotsInEpoch"` // Total number of transactions ever (?) TransactionCount int64 `json:"transactionCount"` }
type GetBlockTimeResponse ¶
type GetBlockTimeResponse struct { Result int64 `json:"result"` Error rpcError `json:"error"` }
type GetConfirmedBlocksResponse ¶
type GetConfirmedBlocksResponse struct { Result []int64 `json:"result"` Error rpcError `json:"error"` }
type GetEpochInfoResponse ¶
type GetEpochInfoResponse struct { Result EpochInfo `json:"result"` Error rpcError `json:"error"` }
type GetLeaderScheduleResponse ¶
type GetLeaderScheduleResponse struct { Result LeaderSchedule `json:"result"` Error rpcError `json:"error"` }
type GetVoteAccountsBalanceResponse ¶
type GetVoteAccountsBalanceResponse struct { Result struct { Current []VoteAccountKey `json:"current"` } `json:"result"` Error rpcError `json:"error"` }
type GetVoteAccountsResponse ¶
type GetVoteAccountsResponse struct { Result struct { Current []VoteAccount `json:"current"` Delinquent []VoteAccount `json:"delinquent"` } `json:"result"` Error rpcError `json:"error"` }
type LeaderSchedule ¶
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
func NewRPCClient ¶
func (*RPCClient) GetBlockTime ¶
https://docs.solana.com/developing/clients/jsonrpc-api#getblocktime
func (*RPCClient) GetConfirmedBlocks ¶
func (c *RPCClient) GetConfirmedBlocks(ctx context.Context, startSlot, endSlot int64) ([]int64, error)
https://docs.solana.com/developing/clients/jsonrpc-api#getconfirmedblocks
func (*RPCClient) GetEpochInfo ¶
https://docs.solana.com/developing/clients/jsonrpc-api#getepochinfo
func (*RPCClient) GetLeaderSchedule ¶
https://docs.solana.com/developing/clients/jsonrpc-api#getleaderschedule
func (*RPCClient) GetVoteAccounts ¶
func (c *RPCClient) GetVoteAccounts(ctx context.Context, commitment Commitment) (*GetVoteAccountsResponse, error)
https://docs.solana.com/developing/clients/jsonrpc-api#getvoteaccounts
func (*RPCClient) GetVoteAccountsBalance ¶
func (c *RPCClient) GetVoteAccountsBalance(ctx context.Context, commitment Commitment) (*GetVoteAccountsBalanceResponse, error)
https://docs.solana.com/developing/clients/jsonrpc-api#getvoteaccounts
type VoteAccount ¶
type VoteAccount struct { ActivatedStake int64 `json:"activatedStake"` Commission int `json:"commission"` EpochCredits [][]int `json:"epochCredits"` EpochVoteAccount bool `json:"epochVoteAccount"` LastVote int `json:"lastVote"` NodePubkey string `json:"nodePubkey"` RootSlot int `json:"rootSlot"` IdentityBalance int VotePubkey string `json:"votePubkey"` }
type VoteAccountKey ¶
Click to show internal directories.
Click to hide internal directories.