Documentation ¶
Index ¶
- Constants
- type Commitment
- type Context
- type Encoding
- type ErrorResponse
- type FeeCalculator
- type GeneralResponse
- type GetAccountInfoConfig
- type GetAccountInfoConfigDataSlice
- type GetAccountInfoConfigEncoding
- type GetAccountInfoResponse
- type GetAccountInfoResult
- type GetAccountInfoResultValue
- type GetBalanceConfig
- type GetBalanceResponse
- type GetBalanceResult
- type GetBlockCommitmentResponse
- type GetBlockConfig
- type GetBlockHeightConfig
- type GetBlockResponse
- type GetBlocksConfig
- type GetBlocksWithLimitConfig
- type GetClusterNodesResponse
- type GetConfirmBlockResponse
- type GetConfirmedSignaturesForAddress
- type GetConfirmedSignaturesForAddressConfig
- type GetConfirmedTransactionResponse
- type GetEpochInfoResponse
- type GetInflationRate
- type GetProgramAccounts
- type GetProgramAccountsAccount
- type GetProgramAccountsConfig
- type GetProgramAccountsConfigDataSlice
- type GetProgramAccountsConfigEncoding
- type GetProgramAccountsConfigFilter
- type GetProgramAccountsConfigFilterMemCmp
- type GetProgramAccountsResponse
- type GetProgramAccountsWithContextResponse
- type GetProgramAccountsWithContextResult
- type GetRecentBlockHashResponse
- type GetRecentBlockHashResult
- type GetRecentBlockHashResultValue
- type GetRecentBlockhashConfig
- type GetSignatureStatusesResponse
- type GetSignaturesForAddress
- type GetSignaturesForAddressConfig
- type GetSlotConfig
- type GetSlotResponse
- type GetStakeActivationConfig
- type GetStakeActivationResponse
- type GetTokenAccountBalanceConfig
- type GetTokenAccountBalanceResponse
- type GetTokenAccountBalanceResult
- type GetTokenAccountBalanceResultValue
- type GetTokenSupply
- type GetTransaction
- type GetTransactionWithLimitConfig
- type GetVersionResponse
- type Instruction
- type Message
- type MessageHeader
- type RpcClient
- func (c *RpcClient) Call(ctx context.Context, params ...interface{}) ([]byte, error)
- func (c *RpcClient) GetAccountInfo(ctx context.Context, base58Addr string) (GetAccountInfoResponse, error)
- func (c *RpcClient) GetAccountInfoWithCfg(ctx context.Context, base58Addr string, cfg GetAccountInfoConfig) (GetAccountInfoResponse, error)
- func (c *RpcClient) GetBalance(ctx context.Context, base58Addr string) (GetBalanceResponse, error)
- func (c *RpcClient) GetBalanceWithCfg(ctx context.Context, base58Addr string, cfg GetBalanceConfig) (GetBalanceResponse, error)
- func (s *RpcClient) GetBlock(ctx context.Context, slot uint64, cfg GetBlockConfig) (GetBlockResponse, error)
- func (s *RpcClient) GetBlockCommitment(ctx context.Context, slot uint64) (GetBlockCommitmentResponse, error)
- func (s *RpcClient) GetBlockHeight(ctx context.Context, cfg GetBlockHeightConfig) (uint64, error)
- func (s *RpcClient) GetBlockTime(ctx context.Context, slot uint64) (int64, error)
- func (s *RpcClient) GetBlocks(ctx context.Context, startSlot uint64, endSlot uint64, cfg GetBlocksConfig) ([]uint64, error)
- func (s *RpcClient) GetBlocksWithLimit(ctx context.Context, startSlot uint64, limit uint64, ...) ([]uint64, error)
- func (s *RpcClient) GetClusterNodes(ctx context.Context) ([]GetClusterNodesResponse, error)
- func (s *RpcClient) GetConfirmedBlock(ctx context.Context, slot uint64) (GetConfirmBlockResponse, error)
- func (s *RpcClient) GetConfirmedBlocks(ctx context.Context, startSlot uint64, endSlot uint64) ([]uint64, error)
- func (s *RpcClient) GetConfirmedBlocksWithLimit(ctx context.Context, startSlot uint64, limit uint64) ([]uint64, error)
- func (s *RpcClient) GetConfirmedSignaturesForAddress(ctx context.Context, base58Addr string, ...) ([]GetConfirmedSignaturesForAddress, error)
- func (s *RpcClient) GetConfirmedTransaction(ctx context.Context, txhash string) (GetConfirmedTransactionResponse, error)
- func (s *RpcClient) GetEpochInfo(ctx context.Context, commitment Commitment) (GetEpochInfoResponse, error)
- func (s *RpcClient) GetFirstAvailableBlock(ctx context.Context) (uint64, error)
- func (s *RpcClient) GetGenesisHash(ctx context.Context) (string, error)
- func (s *RpcClient) GetIdentity(ctx context.Context) (string, error)
- func (s *RpcClient) GetInflationRate(ctx context.Context) (GetInflationRate, error)
- func (s *RpcClient) GetMinimumBalanceForRentExemption(ctx context.Context, accountDataLen uint64) (uint64, error)
- func (c *RpcClient) GetProgramAccounts(ctx context.Context, programId string) (GetProgramAccountsResponse, error)
- func (c *RpcClient) GetProgramAccountsWithConfig(ctx context.Context, programId string, cfg GetProgramAccountsConfig) (GetProgramAccountsResponse, error)
- func (c *RpcClient) GetProgramAccountsWithContext(ctx context.Context, programId string) (GetProgramAccountsWithContextResponse, error)
- func (c *RpcClient) GetProgramAccountsWithContextAndConfig(ctx context.Context, programId string, cfg GetProgramAccountsConfig) (GetProgramAccountsWithContextResponse, error)
- func (c *RpcClient) GetRecentBlockhash(ctx context.Context) (GetRecentBlockHashResponse, error)
- func (c *RpcClient) GetRecentBlockhashWithConfig(ctx context.Context, cfg GetRecentBlockhashConfig) (GetRecentBlockHashResponse, error)
- func (s *RpcClient) GetSignatureStatuses(ctx context.Context, signatures []string) ([]GetSignatureStatusesResponse, error)
- func (s *RpcClient) GetSignaturesForAddress(ctx context.Context, base58Addr string, ...) ([]GetConfirmedSignaturesForAddress, error)
- func (c *RpcClient) GetSlot(ctx context.Context) (GetSlotResponse, error)
- func (c *RpcClient) GetSlotWithCfg(ctx context.Context, cfg GetSlotConfig) (GetSlotResponse, error)
- func (s *RpcClient) GetStakeActivation(ctx context.Context, address string, cfg GetStakeActivationConfig) (GetStakeActivationResponse, error)
- func (c *RpcClient) GetTokenAccountBalance(ctx context.Context, base58Addr string) (GetTokenAccountBalanceResponse, error)
- func (c *RpcClient) GetTokenAccountBalanceWithCfg(ctx context.Context, base58Addr string, cfg GetTokenAccountBalanceConfig) (GetTokenAccountBalanceResponse, error)
- func (s *RpcClient) GetTokenSupply(ctx context.Context, mintBase58Addr string, commitment Commitment) (GetTokenSupply, error)
- func (s *RpcClient) GetTransaction(ctx context.Context, txhash string, cfg GetTransactionWithLimitConfig) (GetConfirmedTransactionResponse, error)
- func (s *RpcClient) GetTransactionCount(ctx context.Context) (uint64, error)
- func (s *RpcClient) GetVersion(ctx context.Context) (GetVersionResponse, error)
- func (s *RpcClient) MinimumLedgerSlot(ctx context.Context) (uint64, error)
- func (s *RpcClient) RequestAirdrop(ctx context.Context, base58Addr string, lamport uint64) (string, error)
- func (c *RpcClient) SendTransaction(ctx context.Context, tx string) (SendTransactionResponse, error)
- func (c *RpcClient) SendTransactionWithConfig(ctx context.Context, tx string, cfg SendTransactionConfig) (SendTransactionResponse, error)
- func (s *RpcClient) SimulateTransaction(ctx context.Context, rawTx string, cfg SimulateTransactionConfig) (SimulateTransactionResponse, error)
- type SendTransactionConfig
- type SendTransactionConfigEncoding
- type SendTransactionResponse
- type SimulateTransactionConfig
- type SimulateTransactionConfigAccounts
- type SimulateTransactionConfigAccountsEncoding
- type SimulateTransactionEncoding
- type SimulateTransactionResponse
- type StakeActivationState
- type Transaction
- type TransactionMeta
- type TransactionMetaTokenBalance
Constants ¶
const ( DevnetRPCEndpoint = "https://api.devnet.solana.com" TestnetRPCEndpoint = "https://api.testnet.solana.com" MainnetRPCEndpoint = "https://api.mainnet-beta.solana.com" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commitment ¶
type Commitment string
const ( CommitmentFinalized Commitment = "finalized" CommitmentConfirmed Commitment = "confirmed" CommitmentProcessed Commitment = "processed" )
type ErrorResponse ¶
type FeeCalculator ¶
type FeeCalculator struct {
LamportsPerSignature uint64 `json:"lamportsPerSignature"`
}
FeeCalculator is a list of fee
type GeneralResponse ¶
type GeneralResponse struct { JsonRPC string `json:"jsonrpc"` ID uint64 `json:"id"` Error *ErrorResponse `json:"error,omitempty"` }
type GetAccountInfoConfig ¶
type GetAccountInfoConfig struct { Commitment Commitment `json:"commitment,omitempty"` Encoding GetAccountInfoConfigEncoding `json:"encoding,omitempty"` DataSlice *GetAccountInfoConfigDataSlice `json:"dataSlice,omitempty"` }
GetAccountInfoConfig is an option config for `getAccountInfo`
type GetAccountInfoConfigDataSlice ¶
type GetAccountInfoConfigDataSlice struct { Offset uint64 `json:"offset,omitempty"` Length uint64 `json:"length,omitempty"` }
GetAccountInfoConfigDataSlice is a part of GetAccountInfoConfig
type GetAccountInfoConfigEncoding ¶
type GetAccountInfoConfigEncoding string
GetAccountInfoConfigEncoding is account's data encode format
const ( // GetAccountInfoConfigEncodingBase58 limited to Account data of less than 128 bytes GetAccountInfoConfigEncodingBase58 GetAccountInfoConfigEncoding = "base58" GetAccountInfoConfigEncodingJsonParsed GetAccountInfoConfigEncoding = "jsonParsed" GetAccountInfoConfigEncodingBase64 GetAccountInfoConfigEncoding = "base64" GetAccountInfoConfigEncodingBase64Zstd GetAccountInfoConfigEncoding = "base64+zstd" )
type GetAccountInfoResponse ¶
type GetAccountInfoResponse struct { GeneralResponse Result GetAccountInfoResult `json:"result"` }
GetAccountInfoResponse is a full raw rpc response of `getAccountInfo`
type GetAccountInfoResult ¶
type GetAccountInfoResult struct { Context Context `json:"context"` Value GetAccountInfoResultValue `json:"value"` }
GetAccountInfoResult is rpc result of `getAccountInfo`
type GetAccountInfoResultValue ¶
type GetAccountInfoResultValue struct { Lamports uint64 `json:"lamports"` Owner string `json:"owner"` Excutable bool `json:"excutable"` RentEpoch uint64 `json:"rentEpoch"` Data interface{} `json:"data"` }
GetAccountInfoResultValue is rpc result of `getAccountInfo`
type GetBalanceConfig ¶
type GetBalanceConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
GetBalanceConfig is a option config for `getBalance`
type GetBalanceResponse ¶
type GetBalanceResponse struct { GeneralResponse Result GetBalanceResult `json:"result"` }
GetBalanceResponse is a full raw rpc response of `getBalance`
type GetBalanceResult ¶
GetBalanceResult is a part of raw rpc response of `getBalance`
type GetBlockConfig ¶
type GetBlockConfig struct { // TODO custom // Encoding string `json:"encoding"` // default: "json", either "json", "jsonParsed", "base58" (slow), "base64" // TransactionDetails string `json:"transactionDetails"` // default: "full", either "full", "signatures", "none" Commitment Commitment `json:"commitment,omitempty"` // "processed" is not supported. If parameter not provided, the default is "finalized". }
type GetBlockHeightConfig ¶
type GetBlockHeightConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
type GetBlockResponse ¶
type GetBlockResponse struct { Blockhash string `json:"blockhash"` PreviousBlockhash string `json:"previousBlockhash"` ParentSLot uint64 `json:"parentSlot"` BlockTime int64 `json:"blockTime"` Transactions []struct { Meta TransactionMeta `json:"meta"` Transaction Transaction `json:"transaction"` } `json:"transactions"` Rewards []struct { Pubkey string `json:"pubkey"` Lamports int64 `json:"lamports"` PostBalance uint64 `json:"postBalance"` RewardType string `json:"rewardType"` // type of reward: "fee", "rent", "voting", "staking" } `json:"rewards"` }
type GetBlocksConfig ¶
type GetBlocksConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
type GetBlocksWithLimitConfig ¶
type GetBlocksWithLimitConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
type GetClusterNodesResponse ¶
type GetConfirmBlockResponse ¶
type GetConfirmBlockResponse struct { Blockhash string `json:"blockhash"` PreviousBlockhash string `json:"previousBlockhash"` ParentSLot uint64 `json:"parentSlot"` BlockTime int64 `json:"blockTime"` Transactions []struct { Meta TransactionMeta `json:"meta"` Transaction Transaction `json:"transaction"` } `json:"transactions"` Rewards []struct { Pubkey string `json:"pubkey"` Lamports int64 `json:"lamports"` PostBalance uint64 `json:"postBalance"` RewardType string `json:"rewardType"` // type of reward: "fee", "rent", "voting", "staking" } `json:"rewards"` }
type GetConfirmedSignaturesForAddressConfig ¶
type GetConfirmedSignaturesForAddressConfig struct { Limit int `json:"limit,omitempty"` Before string `json:"before,omitempty"` Until string `json:"until,omitempty"` Commitment Commitment `json:"commitment,omitempty"` }
type GetConfirmedTransactionResponse ¶
type GetConfirmedTransactionResponse struct { Slot uint64 `json:"slot"` Meta TransactionMeta `json:"meta"` Transaction Transaction `json:"transaction"` }
type GetEpochInfoResponse ¶
type GetInflationRate ¶
type GetProgramAccounts ¶
type GetProgramAccounts struct { Pubkey string `json:"pubkey"` Account GetProgramAccountsAccount `json:"account"` }
type GetProgramAccountsConfig ¶
type GetProgramAccountsConfig struct { Encoding GetProgramAccountsConfigEncoding `json:"encoding,omitempty"` Commitment Commitment `json:"commitment,omitempty"` DataSlice *GetProgramAccountsConfigDataSlice `json:"dataSlice,omitempty"` Filters []GetProgramAccountsConfigFilter `json:"filters,omitempty"` }
GetProgramAccountsConfig is a option config for `getProgramAccounts`
type GetProgramAccountsConfigDataSlice ¶
type GetProgramAccountsConfigDataSlice struct { Offset uint64 `json:"offset"` Length uint64 `json:"length"` }
GetProgramAccountsConfigDataSlice is a part of GetProgramAccountsConfig
type GetProgramAccountsConfigEncoding ¶
type GetProgramAccountsConfigEncoding string
const ( // GetProgramAccountsConfigEncodingBase58 limited to Account data of less than 128 bytes GetProgramAccountsConfigEncodingBase58 GetProgramAccountsConfigEncoding = "base58" GetProgramAccountsConfigEncodingJsonParsed GetProgramAccountsConfigEncoding = "jsonParsed" GetProgramAccountsConfigEncodingBase64 GetProgramAccountsConfigEncoding = "base64" GetProgramAccountsConfigEncodingBase64Zstd GetProgramAccountsConfigEncoding = "base64+zstd" )
type GetProgramAccountsConfigFilter ¶
type GetProgramAccountsConfigFilter struct { MemCmp *GetProgramAccountsConfigFilterMemCmp `json:"memcmp,omitempty"` DataSize uint64 `json:"dataSize,omitempty"` }
GetProgramAccountsConfigFilter you can set either MemCmp or DataSize but can be both, if needed, separate them into two
type GetProgramAccountsResponse ¶
type GetProgramAccountsResponse struct { GeneralResponse Result []GetProgramAccounts `json:"result"` }
GetProgramAccountsResponse is a full rpc response for `getProgramAccounts`
type GetProgramAccountsWithContextResponse ¶
type GetProgramAccountsWithContextResponse struct { GeneralResponse Result GetProgramAccountsWithContextResult `json:"result"` }
GetProgramAccountsResponse is a full rpc response for `getProgramAccounts` with context
type GetProgramAccountsWithContextResult ¶
type GetProgramAccountsWithContextResult struct { Context Context `json:"context"` Value []GetProgramAccounts `json:"value"` }
type GetRecentBlockHashResponse ¶
type GetRecentBlockHashResponse struct { GeneralResponse Result GetRecentBlockHashResult `json:"result"` }
GetRecentBlockHashResponse is full raw response of `getRecentBlockhash`
type GetRecentBlockHashResult ¶
type GetRecentBlockHashResult struct { Context Context `json:"context"` Value GetRecentBlockHashResultValue `json:"value"` }
GetRecentBlockHashResult is part of response of `getRecentBlockhash`
type GetRecentBlockHashResultValue ¶
type GetRecentBlockHashResultValue struct { Blockhash string `json:"blockhash"` FeeCalculator FeeCalculator `json:"feeCalculator"` }
GetRecentBlockHashResultValue is part of response of `getRecentBlockhash`
type GetRecentBlockhashConfig ¶
type GetRecentBlockhashConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
GetRecentBlockhashConfig is a option config for `getRecentBlockhash`
type GetSignatureStatusesResponse ¶
type GetSignatureStatusesResponse struct { Slot uint64 `json:"slot"` Confirmations *uint64 `json:"confirmations"` ConfirmationStatus *Commitment `json:"confirmationStatus"` Err interface{} `json:"err"` }
type GetSignaturesForAddress ¶
type GetSignaturesForAddressConfig ¶
type GetSignaturesForAddressConfig struct { Limit int `json:"limit,omitempty"` // between 1 and 1000, default: 1000 Before string `json:"before,omitempty"` Until string `json:"until,omitempty"` Commitment Commitment `json:"commitment,omitempty"` // "processed" is not supported, default is "finalized" }
type GetSlotConfig ¶
type GetSlotConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
GetSlotConfig is a option config for `getSlot`
type GetSlotResponse ¶
type GetSlotResponse struct { GeneralResponse Result uint64 `json:"result"` }
GetSlotResponse is a full raw rpc response of `getSlot`
type GetStakeActivationConfig ¶
type GetStakeActivationConfig struct { Commitment Commitment `json:"commitment,omitempty"` Epoch uint64 `json:"epoch,omitempty"` }
type GetStakeActivationResponse ¶
type GetStakeActivationResponse struct { State StakeActivationState `json:"state"` Active uint64 `json:"active"` Inactive uint64 `json:"inactive"` }
type GetTokenAccountBalanceConfig ¶
type GetTokenAccountBalanceConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
type GetTokenAccountBalanceResponse ¶
type GetTokenAccountBalanceResponse struct { GeneralResponse Result GetTokenAccountBalanceResult `json:"result"` }
type GetTokenAccountBalanceResult ¶
type GetTokenAccountBalanceResult struct { Context Context `json:"context"` Value GetTokenAccountBalanceResultValue `json:"value"` }
type GetTokenSupply ¶
type GetTransaction ¶
type GetTransaction struct { Slot uint64 `json:"slot"` Meta TransactionMeta `json:"meta"` Transaction Transaction `json:"transaction"` }
type GetTransactionWithLimitConfig ¶
type GetTransactionWithLimitConfig struct { // TODO custom encoding // Encoding string `json:"encoding"` // either "json", "jsonParsed", "base58" (slow), "base64", default: json Commitment Commitment `json:"commitment,omitempty"` // "processed" is not supported. If parameter not provided, the default is "finalized". }
type GetVersionResponse ¶
type Instruction ¶
type Message ¶
type Message struct { Header MessageHeader `json:"header"` AccountKeys []string `json:"accountKeys"` RecentBlockhash string `json:"recentBlockhash"` Instructions []Instruction `json:"instructions"` }
type MessageHeader ¶
type RpcClient ¶
type RpcClient struct {
// contains filtered or unexported fields
}
func NewRpcClient ¶
func (*RpcClient) Call ¶
Call will return body of response. if http code beyond 200~300, the error also returns.
func (*RpcClient) GetAccountInfo ¶
func (c *RpcClient) GetAccountInfo(ctx context.Context, base58Addr string) (GetAccountInfoResponse, error)
GetAccountInfo returns all information associated with the account of provided Pubkey
func (*RpcClient) GetAccountInfoWithCfg ¶
func (c *RpcClient) GetAccountInfoWithCfg(ctx context.Context, base58Addr string, cfg GetAccountInfoConfig) (GetAccountInfoResponse, error)
GetAccountInfo returns all information associated with the account of provided Pubkey
func (*RpcClient) GetBalance ¶
GetBalance returns the SOL balance
func (*RpcClient) GetBalanceWithCfg ¶
func (c *RpcClient) GetBalanceWithCfg(ctx context.Context, base58Addr string, cfg GetBalanceConfig) (GetBalanceResponse, error)
GetBalanceWithCfg returns the SOL balance
func (*RpcClient) GetBlock ¶
func (s *RpcClient) GetBlock(ctx context.Context, slot uint64, cfg GetBlockConfig) (GetBlockResponse, error)
NEW: This method is only available in solana-core v1.7 or newer. Please use getConfirmedBlock for solana-core v1.6 GetBlock returns identity and transaction information about a confirmed block in the ledger
func (*RpcClient) GetBlockCommitment ¶
func (s *RpcClient) GetBlockCommitment(ctx context.Context, slot uint64) (GetBlockCommitmentResponse, error)
GetBlockCommitment returns commitment for particular block
func (*RpcClient) GetBlockHeight ¶
GetBlockHeight returns the current block height of the node
func (*RpcClient) GetBlockTime ¶
GetBlockTime returns the estimated production time of a block.
func (*RpcClient) GetBlocks ¶
func (s *RpcClient) GetBlocks(ctx context.Context, startSlot uint64, endSlot uint64, cfg GetBlocksConfig) ([]uint64, error)
NEW: This method is only available in solana-core v1.7 or newer. Please use getConfirmedBlocks for solana-core v1.6 GetBlocks returns a list of confirmed blocks between two slots Max range allowed is 500,000 slots
func (*RpcClient) GetBlocksWithLimit ¶
func (s *RpcClient) GetBlocksWithLimit(ctx context.Context, startSlot uint64, limit uint64, cfg GetBlocksWithLimitConfig) ([]uint64, error)
NEW: This method is only available in solana-core v1.7 or newer. Please use getConfirmedBlocksWithLimit for solana-core v1.6 GetBlocksWithLimit returns a list of confirmed blocks starting at the given slot
func (*RpcClient) GetClusterNodes ¶
func (s *RpcClient) GetClusterNodes(ctx context.Context) ([]GetClusterNodesResponse, error)
GetClusterNodes returns information about all the nodes participating in the cluster
func (*RpcClient) GetConfirmedBlock ¶
func (s *RpcClient) GetConfirmedBlock(ctx context.Context, slot uint64) (GetConfirmBlockResponse, error)
DEPRECATED: Please use getBlock instead This method is expected to be removed in solana-core v1.8 GetConfirmedBlock returns identity and transaction information about a confirmed block in the ledger
func (*RpcClient) GetConfirmedBlocks ¶
func (s *RpcClient) GetConfirmedBlocks(ctx context.Context, startSlot uint64, endSlot uint64) ([]uint64, error)
DEPRECATED: Please use getBlocks instead This method is expected to be removed in solana-core v1.8 GetConfirmedBlocks returns a list of confirmed blocks between two slots
func (*RpcClient) GetConfirmedBlocksWithLimit ¶
func (s *RpcClient) GetConfirmedBlocksWithLimit(ctx context.Context, startSlot uint64, limit uint64) ([]uint64, error)
DEPRECATED: Please use getBlocksWithLimit instead This method is expected to be removed in solana-core v1.8 GetConfirmedBlocksWithLimit returns a list of confirmed blocks starting at the given slot
func (*RpcClient) GetConfirmedSignaturesForAddress ¶
func (s *RpcClient) GetConfirmedSignaturesForAddress(ctx context.Context, base58Addr string, config GetConfirmedSignaturesForAddressConfig) ([]GetConfirmedSignaturesForAddress, error)
DEPRECATED: Please use getSignaturesForAddress instead This method is expected to be removed in solana-core v1.8 GetConfirmedSignaturesForAddress returns confirmed signatures for transactions involving an address backwards in time from the provided signature or most recent confirmed block
func (*RpcClient) GetConfirmedTransaction ¶
func (s *RpcClient) GetConfirmedTransaction(ctx context.Context, txhash string) (GetConfirmedTransactionResponse, error)
DEPRECATED: Please use getTransaction instead This method is expected to be removed in solana-core v1.8 GetConfirmedTransaction returns transaction details for a confirmed transaction
func (*RpcClient) GetEpochInfo ¶
func (s *RpcClient) GetEpochInfo(ctx context.Context, commitment Commitment) (GetEpochInfoResponse, error)
GetEpochInfo returns information about the current epoch
func (*RpcClient) GetFirstAvailableBlock ¶
GetFirstAvailableBlock returns the slot of the lowest confirmed block that has not been purged from the ledger
func (*RpcClient) GetGenesisHash ¶
GetGenesisHash returns the genesis hash
func (*RpcClient) GetIdentity ¶
GetIdentity returns the identity pubkey for the current node
func (*RpcClient) GetInflationRate ¶
func (s *RpcClient) GetInflationRate(ctx context.Context) (GetInflationRate, error)
GetInflationRate returns the specific inflation values for the current epoch
func (*RpcClient) GetMinimumBalanceForRentExemption ¶
func (s *RpcClient) GetMinimumBalanceForRentExemption(ctx context.Context, accountDataLen uint64) (uint64, error)
GetMinimumBalanceForRentExemption returns minimum balance required to make account rent exempt.
func (*RpcClient) GetProgramAccounts ¶
func (*RpcClient) GetProgramAccountsWithConfig ¶
func (c *RpcClient) GetProgramAccountsWithConfig(ctx context.Context, programId string, cfg GetProgramAccountsConfig) (GetProgramAccountsResponse, error)
func (*RpcClient) GetProgramAccountsWithContext ¶
func (*RpcClient) GetProgramAccountsWithContextAndConfig ¶
func (c *RpcClient) GetProgramAccountsWithContextAndConfig(ctx context.Context, programId string, cfg GetProgramAccountsConfig) (GetProgramAccountsWithContextResponse, error)
func (*RpcClient) GetRecentBlockhash ¶
func (c *RpcClient) GetRecentBlockhash(ctx context.Context) (GetRecentBlockHashResponse, error)
getRecentBlockhash returns a recent block hash from the ledger, and a fee schedule that can be used to compute the cost of submitting a transaction using it.
func (*RpcClient) GetRecentBlockhashWithConfig ¶
func (c *RpcClient) GetRecentBlockhashWithConfig(ctx context.Context, cfg GetRecentBlockhashConfig) (GetRecentBlockHashResponse, error)
getRecentBlockhash returns a recent block hash from the ledger, and a fee schedule that can be used to compute the cost of submitting a transaction using it.
func (*RpcClient) GetSignatureStatuses ¶
func (*RpcClient) GetSignaturesForAddress ¶
func (s *RpcClient) GetSignaturesForAddress(ctx context.Context, base58Addr string, config GetConfirmedSignaturesForAddressConfig) ([]GetConfirmedSignaturesForAddress, error)
NEW: This method is only available in solana-core v1.7 or newer. Please use "getConfirmedSignaturesForAddress2" for solana-core v1.6 GetSignaturesForAddress Returns confirmed signatures for transactions involving an address backwards in time from the provided signature or most recent confirmed block
func (*RpcClient) GetSlot ¶
func (c *RpcClient) GetSlot(ctx context.Context) (GetSlotResponse, error)
GetSlot returns the SOL balance
func (*RpcClient) GetSlotWithCfg ¶
func (c *RpcClient) GetSlotWithCfg(ctx context.Context, cfg GetSlotConfig) (GetSlotResponse, error)
GetSlotWithCfg returns the SOL balance
func (*RpcClient) GetStakeActivation ¶
func (s *RpcClient) GetStakeActivation(ctx context.Context, address string, cfg GetStakeActivationConfig) (GetStakeActivationResponse, error)
GetStakeActivation returns epoch activation information for a stake account
func (*RpcClient) GetTokenAccountBalance ¶
func (c *RpcClient) GetTokenAccountBalance(ctx context.Context, base58Addr string) (GetTokenAccountBalanceResponse, error)
GetTokenAccountBalance returns the token balance of an SPL Token account
func (*RpcClient) GetTokenAccountBalanceWithCfg ¶
func (c *RpcClient) GetTokenAccountBalanceWithCfg(ctx context.Context, base58Addr string, cfg GetTokenAccountBalanceConfig) (GetTokenAccountBalanceResponse, error)
GetTokenAccountBalance returns the token balance of an SPL Token account
func (*RpcClient) GetTokenSupply ¶
func (s *RpcClient) GetTokenSupply(ctx context.Context, mintBase58Addr string, commitment Commitment) (GetTokenSupply, error)
GetTokenSupply returns the total supply of an SPL Token type.
func (*RpcClient) GetTransaction ¶
func (s *RpcClient) GetTransaction(ctx context.Context, txhash string, cfg GetTransactionWithLimitConfig) (GetConfirmedTransactionResponse, error)
NEW: This method is only available in solana-core v1.7 or newer. Please use getConfirmedTransaction for solana-core v1.6 GetConfirmedTransaction returns transaction details for a confirmed transaction
func (*RpcClient) GetTransactionCount ¶
GetTransactionCount returns the current transaction count from the ledger
func (*RpcClient) GetVersion ¶
func (s *RpcClient) GetVersion(ctx context.Context) (GetVersionResponse, error)
GetVersion returns the current solana versions running on the node
func (*RpcClient) MinimumLedgerSlot ¶
MinimumLedgerSlot returns the lowest slot that the node has information about in its ledger. This value may increase over time if the node is configured to purge older ledger data
func (*RpcClient) RequestAirdrop ¶
func (s *RpcClient) RequestAirdrop(ctx context.Context, base58Addr string, lamport uint64) (string, error)
RequestAirdrop Requests an airdrop of lamports to a Pubkey, return string is Transaction Signature of airdrop, as base-58 encoded
func (*RpcClient) SendTransaction ¶
func (c *RpcClient) SendTransaction(ctx context.Context, tx string) (SendTransactionResponse, error)
SendTransaction submits a signed transaction to the cluster for processing
func (*RpcClient) SendTransactionWithConfig ¶
func (c *RpcClient) SendTransactionWithConfig(ctx context.Context, tx string, cfg SendTransactionConfig) (SendTransactionResponse, error)
SendTransaction submits a signed transaction to the cluster for processing
func (*RpcClient) SimulateTransaction ¶
func (s *RpcClient) SimulateTransaction(ctx context.Context, rawTx string, cfg SimulateTransactionConfig) (SimulateTransactionResponse, error)
SimulateTransaction simulate sending a transaction
type SendTransactionConfig ¶
type SendTransactionConfig struct { SkipPreflight bool `json:"skipPreflight,omitempty"` // default: false PreflightCommitment Commitment `json:"preflightCommitment,omitempty"` // default: finalized Encoding SendTransactionConfigEncoding `json:"encoding,omitempty"` // default: base58 MaxRetries uint64 `json:"maxRetries,omitempty"` }
type SendTransactionConfigEncoding ¶
type SendTransactionConfigEncoding string
const ( SendTransactionConfigEncodingBase58 SendTransactionConfigEncoding = "base58" SendTransactionConfigEncodingBase64 SendTransactionConfigEncoding = "base64" )
type SendTransactionResponse ¶
type SendTransactionResponse struct { GeneralResponse Result string `json:"result"` }
type SimulateTransactionConfig ¶
type SimulateTransactionConfig struct { SigVerify bool `json:"sigVerify,omitempty"` // default: false, conflicts with replace blockhash PreflightCommitment Commitment `json:"preflightCommitment,omitempty"` // default: finalized Encoding SimulateTransactionEncoding `json:"encoding,omitempty"` // default: "base58", either "base58" or "base64" ReplaceRecentBlockhash bool `json:"replaceRecentBlockhash,omitempty"` // default: false, conflicts with sigVerify Accounts *SimulateTransactionConfigAccounts `json:"accounts,omitempty"` }
type SimulateTransactionConfigAccountsEncoding ¶
type SimulateTransactionConfigAccountsEncoding string
type SimulateTransactionEncoding ¶
type SimulateTransactionEncoding string
const ( SimulateTransactionEncodingBase58 SimulateTransactionEncoding = "base58" // (slow, DEPRECATED) SimulateTransactionEncodingBase64 SimulateTransactionEncoding = "base64" )
type SimulateTransactionResponse ¶
type SimulateTransactionResponse struct { Err interface{} `json:"err"` Logs []string `json:"logs"` Accounts []GetAccountInfoResponse `json:"accounts"` }
type StakeActivationState ¶
type StakeActivationState string
const ( StakeActivationStateActive StakeActivationState = "active" StakeActivationStateInactive StakeActivationState = "inactive" StakeActivationStateActivating StakeActivationState = "activating" StakeActivationStateDeactivating StakeActivationState = "deactivating" )
type Transaction ¶
type TransactionMeta ¶
type TransactionMeta struct { Fee uint64 `json:"fee"` PreBalances []int64 `json:"preBalances"` PostBalances []int64 `json:"postBalances"` PreTokenBalances []TransactionMetaTokenBalance `json:"preTokenBalances"` PostTokenBalances []TransactionMetaTokenBalance `json:"postTokenBalances"` LogMessages []string `json:"logMessages"` InnerInstructions []struct { Index uint64 `json:"index"` Instructions []Instruction `json:"instructions"` } `json:"innerInstructions"` Err interface{} `json:"err"` Status map[string]interface{} `json:"status"` }
Source Files ¶
- client.go
- get_account_info.go
- get_balance.go
- get_block.go
- get_block_commitment.go
- get_block_height.go
- get_block_time.go
- get_blocks.go
- get_blocks_with_limit.go
- get_cluster_nodes.go
- get_confirmed_block.go
- get_confirmed_block_with_limit.go
- get_confirmed_blocks.go
- get_confirmed_signatures_for_address.go
- get_confirmed_tx.go
- get_epoch_info.go
- get_first_available_block.go
- get_genesis_hash.go
- get_identity.go
- get_inflation_rate.go
- get_min_balance_for_rent_free.go
- get_program_accounts.go
- get_recent_blockhash.go
- get_signature_status.go
- get_signatures_for_address.go
- get_slot.go
- get_stake_activation.go
- get_token_account_balance.go
- get_token_supply.go
- get_transaction.go
- get_transaction_count.go
- get_version.go
- minimum_ledger_slot.go
- request_aridrop.go
- send_transaction.go
- simulate_transaction.go
- test_util.go
- types.go