Documentation ¶
Index ¶
- Constants
- type BlockResponse
- type GetTokenAccountBalanceResult
- type GetTokenSupplyResult
- type Http
- type Provider
- func (s Provider) GetAccountInfo(account_ solana.PublicKey) (*types.Account, error)
- func (s Provider) GetConfirmedBlocks(from, to uint64) ([]uint64, error)
- func (s Provider) GetLatestSlot() (uint64, error)
- func (s *Provider) GetRecentBlockhash(commitment string) (hash solana.Hash, err error)
- func (s *Provider) GetTokenAccountBalance(pda solana.PublicKey, commitment string) (*GetTokenAccountBalanceResult, error)
- func (s *Provider) GetTokenSupply(mint solana.PublicKey, commitment string) (*GetTokenSupplyResult, error)
- func (s Provider) RawInvoke(method string, body interface{}) (json.RawMessage, error)
- func (s *Provider) SendTransaction(transaction *solana.Transaction) (sig solana.Signature, err error)
- func (s Provider) SimulateTransaction(transaction []byte, signatureVerify bool, commitment string, ...) (*SimulationValue, error)
- type RpcContext
- type SimulationResponse
- type SimulationValue
- type Subscription
- type SubscriptionResponse
- type Websocket
- func (websocket Websocket) RawInvoke(method string, params interface{}) (json.RawMessage, error)
- func (websocket Websocket) SubscribeAccount(publicKey solana.PublicKey, f func(types.Account))
- func (websocket Websocket) SubscribeBlocks(accountOrProgram solCommon.PublicKey, f func(BlockResponse))
- func (websocket Websocket) SubscribeSlots(f func(solana.Slot))
Constants ¶
View Source
const LogContextHttp = "COMMON/SOLANA/HTTP"
View Source
const LogContextWebsocket = "SOLANA/RPC/WEBSOCKET"
LogContextWebsocket to use for following errors
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockResponse ¶
type GetTokenAccountBalanceResult ¶
type GetTokenAccountBalanceResult struct { RpcContext Value *struct { // Raw balance of tokens as a string, ignoring decimals. Amount string `json:"amount"` // Number of decimals configured for token's mint. Decimals uint8 `json:"decimals"` // TODO: <number> == int64 ??? // DEPRECATED: Token amount as a float, accounting for decimals. UiAmount *float64 `json:"uiAmount"` // Token amount as a string, accounting for decimals. UiAmountString string `json:"uiAmountString"` } `json:"value"` }
type GetTokenSupplyResult ¶
type GetTokenSupplyResult struct { RpcContext Value *struct { // Raw amount of tokens as a string, ignoring decimals. Amount string `json:"amount"` // Number of decimals configured for token's mint. Decimals uint8 `json:"decimals"` // TODO: <number> == int64 ??? // DEPRECATED: Token amount as a float, accounting for decimals. UiAmount *float64 `json:"uiAmount"` // Token amount as a string, accounting for decimals. UiAmountString string `json:"uiAmountString"` } `json:"value"` }
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider supporting
func (Provider) GetAccountInfo ¶
func (Provider) GetConfirmedBlocks ¶
func (Provider) GetLatestSlot ¶
func (*Provider) GetRecentBlockhash ¶
func (*Provider) GetTokenAccountBalance ¶
func (*Provider) GetTokenSupply ¶
func (Provider) RawInvoke ¶
func (s Provider) RawInvoke(method string, body interface{}) (json.RawMessage, error)
Invoke Solana RPC method
func (*Provider) SendTransaction ¶
type RpcContext ¶
type RpcContext struct { Context struct { Slot uint64 `json:"slot"` } `json:"context,omitempty"` }
RpcContext used for tracing the outcome of different uses of the RPC
type SimulationResponse ¶
type SimulationResponse struct {
Value SimulationValue `json:"value"`
}
type SimulationValue ¶
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
type SubscriptionResponse ¶
type Websocket ¶
type Websocket struct {
// contains filtered or unexported fields
}
func NewWebsocket ¶
func (Websocket) RawInvoke ¶
func (websocket Websocket) RawInvoke(method string, params interface{}) (json.RawMessage, error)
func (Websocket) SubscribeAccount ¶
SubscribeAccount subscribes to changes to account and dies with log.Fatal if something goes wrong
func (Websocket) SubscribeBlocks ¶
func (websocket Websocket) SubscribeBlocks(accountOrProgram solCommon.PublicKey, f func(BlockResponse))
SubscribeBlocks to subscribe to new blocks with the given filter, if provided
func (Websocket) SubscribeSlots ¶
SubscribeSlots subscribes to new slots
Click to show internal directories.
Click to hide internal directories.