Versions in this module Expand all Collapse all v1 v1.23.11 May 10, 2023 v1.23.10 May 5, 2023 v1.23.9 Jan 26, 2023 v1.23.8 Jan 26, 2023 Changes in this version type JsonRpcResponse + func (j JsonRpcResponse[T]) GetError() error + func (j JsonRpcResponse[T]) GetResult() T + type ValueWithContext struct + Context Context + Value T v1.23.7 Jan 17, 2023 v1.23.6 Dec 14, 2022 v1.23.5 Dec 13, 2022 v1.23.4 Dec 13, 2022 v1.23.3 Dec 13, 2022 v1.23.2 Dec 13, 2022 v1.23.1 Dec 13, 2022 Changes in this version + const DevnetRPCEndpoint + const LocalnetRPCEndpoint + const MainnetRPCEndpoint + const TestnetRPCEndpoint + type AccountEncoding string + const AccountEncodingBase58 + const AccountEncodingBase64 + const AccountEncodingBase64Zstd + const AccountEncodingJsonParsed + type AccountInfo struct + Data any + Executable bool + Lamports uint64 + Owner string + RentEpoch uint64 + type Commitment string + const CommitmentConfirmed + const CommitmentFinalized + const CommitmentProcessed + type Context struct + ApiVersion string + Slot uint64 + type DataSlice struct + Length uint64 + Offset uint64 + type GetAccountInfo struct + Context Context + Value AccountInfo + type GetAccountInfoConfig struct + Commitment Commitment + DataSlice *DataSlice + Encoding AccountEncoding + type GetAccountResponse JsonRpcResponse[GetAccountInfo] + type GetBalance struct + Context Context + Value uint64 + type GetBalanceConfig struct + Commitment Commitment + type GetBalanceResponse JsonRpcResponse[GetBalance] + type GetBlock struct + BlockHeight *int64 + BlockTime *int64 + Blockhash string + ParentSlot uint64 + PreviousBlockhash string + Rewards []GetBlockReward + Signatures []string + Transactions []GetBlockTransaction + type GetBlockCommitment struct + Commitment *[]uint64 + TotalStake uint64 + type GetBlockCommitmentResponse JsonRpcResponse[GetBlockCommitment] + type GetBlockConfig struct + Commitment Commitment + Encoding GetBlockConfigEncoding + MaxSupportedTransactionVersion *uint8 + Rewards *bool + TransactionDetails GetBlockConfigTransactionDetails + type GetBlockConfigEncoding string + const GetBlockConfigEncodingBase58 + const GetBlockConfigEncodingBase64 + const GetBlockConfigEncodingJson + const GetBlockConfigEncodingJsonParsed + type GetBlockConfigTransactionDetails string + const GetBlockConfigTransactionDetailsFull + const GetBlockConfigTransactionDetailsNone + const GetBlockConfigTransactionDetailsSignatures + type GetBlockHeightConfig struct + Commitment Commitment + type GetBlockHeightResponse JsonRpcResponse[uint64] + type GetBlockProduction struct + Context Context + Value GetBlockProductionResponseResultValue + type GetBlockProductionConfig struct + Commitment Commitment + Identity string + Range *GetBlockProductionRange + type GetBlockProductionRange struct + FirstSlot uint64 + LastSlot uint64 + type GetBlockProductionResponse JsonRpcResponse[GetBlockProduction] + type GetBlockProductionResponseResultValue struct + ByIdentity map[string][]uint64 + Range GetBlockProductionRange + type GetBlockResponse JsonRpcResponse[GetBlock] + type GetBlockReward struct + Commission *uint8 + Lamports int64 + PostBalances uint64 + Pubkey string + RewardType GetBlockRewardType + type GetBlockRewardType string + const GetBlockRewardTypeFee + const GetBlockRewardTypeNone + const GetBlockRewardTypeRent + const GetBlockRewardTypeStaking + const GetBlockRewardTypeVoting + type GetBlockTimeResponse JsonRpcResponse[int64] + type GetBlockTransaction struct + Meta *TransactionMeta + Transaction any + Version any + type GetBlocksConfig struct + Commitment Commitment + type GetBlocksResponse JsonRpcResponse[[]uint64] + type GetBlocksWithLimitConfig struct + Commitment Commitment + type GetBlocksWithLimitResponse JsonRpcResponse[[]uint64] + type GetClusterNode struct + FeatureSet *uint32 + Gossip *string + Pubkey string + Rpc *string + ShredVersion *uint16 + Tpu *string + Version *string + type GetClusterNodes []GetClusterNode + type GetClusterNodesResponse JsonRpcResponse[GetClusterNodes] + type GetEpochInfo struct + AbsoluteSlot uint64 + BlockHeight uint64 + Epoch uint64 + SlotIndex uint64 + SlotsInEpoch uint64 + TransactionCount *uint64 + type GetEpochInfoConfig struct + Commitment Commitment + type GetEpochInfoResponse JsonRpcResponse[GetEpochInfo] + type GetEpochSchedule struct + FirstNormalEpoch uint64 + FirstNormalSlot uint64 + LeaderScheduleSlotOffset uint64 + SlotsPerEpoch uint64 + Warmup bool + type GetEpochScheduleResponse JsonRpcResponse[GetEpochSchedule] + type GetFeeForMessage struct + Context Context + Value *uint64 + type GetFeeForMessageConfig struct + Commitment Commitment + type GetFeeForMessageResponse JsonRpcResponse[GetFeeForMessage] + type GetFirstAvailableBlockResponse JsonRpcResponse[uint64] + type GetGenesisHashResponse JsonRpcResponse[string] + type GetIdentity struct + Identity string + type GetIdentityResponse JsonRpcResponse[GetIdentity] + type GetInflationGovernor struct + Foundation float64 + FoundationTerm float64 + Initial float64 + Taper float64 + Terminal float64 + type GetInflationGovernorConfig struct + Commitment Commitment + type GetInflationGovernorResponse JsonRpcResponse[GetInflationGovernor] + type GetInflationRate struct + Epoch uint64 + Foundation float64 + Total float64 + Validator float64 + type GetInflationRateResponse JsonRpcResponse[GetInflationRate] + type GetInflationReward struct + Amount uint64 + Commission *uint8 + EffectiveSlot uint64 + Epoch uint64 + PostBalance uint64 + type GetInflationRewardConfig struct + Commitment Commitment + Epoch uint64 + type GetInflationRewardResponse JsonRpcResponse[[]*GetInflationReward] + type GetLatestBlockhash struct + Context Context + Value GetLatestBlockhashValue + type GetLatestBlockhashConfig struct + Commitment Commitment + type GetLatestBlockhashResponse JsonRpcResponse[GetLatestBlockhash] + type GetLatestBlockhashValue struct + Blockhash string + LatestValidBlockHeight uint64 + type GetMinimumBalanceForRentExemptionConfig struct + Commitment Commitment + type GetMinimumBalanceForRentExemptionResponse JsonRpcResponse[uint64] + type GetMultipleAccounts struct + Context Context + Value []AccountInfo + type GetMultipleAccountsConfig struct + Commitment Commitment + DataSlice *DataSlice + Encoding AccountEncoding + type GetMultipleAccountsConfigEncoding string + type GetMultipleAccountsResponse JsonRpcResponse[GetMultipleAccounts] + type GetProgramAccount struct + Account AccountInfo + Pubkey string + type GetProgramAccounts []GetProgramAccount + type GetProgramAccountsConfig struct + Commitment Commitment + DataSlice *DataSlice + Encoding AccountEncoding + Filters []GetProgramAccountsConfigFilter + type GetProgramAccountsConfigFilter struct + DataSize uint64 + MemCmp *GetProgramAccountsConfigFilterMemCmp + type GetProgramAccountsConfigFilterMemCmp struct + Bytes string + Offset uint64 + type GetProgramAccountsResponse JsonRpcResponse[GetProgramAccounts] + type GetProgramAccountsWithContext struct + Context Context + Value GetProgramAccounts + type GetProgramAccountsWithContextResponse JsonRpcResponse[GetProgramAccountsWithContext] + type GetSignatureStatuses struct + Context Context + Value SignatureStatuses + type GetSignatureStatusesConfig struct + SearchTransactionHistory bool + type GetSignatureStatusesResponse JsonRpcResponse[GetSignatureStatuses] + type GetSignaturesForAddress []SignatureWithStatus + type GetSignaturesForAddressConfig struct + Before string + Commitment Commitment + Limit int + Until string + type GetSignaturesForAddressResponse JsonRpcResponse[GetSignaturesForAddress] + type GetSlotConfig struct + Commitment Commitment + type GetSlotResponse JsonRpcResponse[uint64] + type GetTokenAccountBalance struct + Context Context + Value TokenAccountBalance + type GetTokenAccountBalanceConfig struct + Commitment Commitment + type GetTokenAccountBalanceResponse JsonRpcResponse[GetTokenAccountBalance] + type GetTokenAccountsByOwner struct + Context Context + Value GetProgramAccounts + type GetTokenAccountsByOwnerConfig struct + Commitment Commitment + DataSlice *DataSlice + Encoding AccountEncoding + type GetTokenAccountsByOwnerConfigFilter struct + Mint string + ProgramId string + type GetTokenAccountsByOwnerResponse JsonRpcResponse[GetTokenAccountsByOwner] + type GetTokenSupply struct + Context Context + Value GetTokenSupplyResultValue + type GetTokenSupplyConfig struct + Commitment Commitment + type GetTokenSupplyResponse JsonRpcResponse[GetTokenSupply] + type GetTokenSupplyResultValue struct + Amount string + Decimals uint8 + UIAmountString string + type GetTransaction struct + BlockTime *int64 + Meta *TransactionMeta + Slot uint64 + Transaction any + Version any + type GetTransactionConfig struct + Commitment Commitment + Encoding TransactionEncoding + MaxSupportedTransactionVersion *uint8 + type GetTransactionCountConfig struct + Commitment Commitment + type GetTransactionCountResponse JsonRpcResponse[uint64] + type GetTransactionResponse JsonRpcResponse[*GetTransaction] + type GetVersion struct + FeatureSet *uint32 + SolanaCore string + type GetVersionResponse JsonRpcResponse[GetVersion] + type GetVoteAccounts struct + Current VoteAccounts + Deliquent VoteAccounts + type GetVoteAccountsConfig struct + Commitment Commitment + DelinquentSlotDistance uint64 + KeepUnstakedDelinquents bool + VotePubkey string + type GetVoteAccountsResponse JsonRpcResponse[GetVoteAccounts] + type Instruction struct + Accounts []int + Data string + ProgramIDIndex int + type IsBlockhashValid struct + Context Context + Value bool + type IsBlockhashValidConfig struct + Commitment Commitment + type IsBlockhashValidResponse JsonRpcResponse[IsBlockhashValid] + type JsonRpcError struct + Code int + Data any + Message string + func (e *JsonRpcError) Error() string + type JsonRpcRequest struct + Id uint64 + JsonRpc string + Method string + Params []any + type JsonRpcResponse struct + Error *JsonRpcError + Id uint64 + JsonRpc string + Result T + type MinimumLedgerSlotResponse JsonRpcResponse[uint64] + type Option func(*RpcClient) + func WithEndpoint(endpoint string) Option + func WithHTTPClient(h *http.Client) Option + type RequestAirdropConfig struct + Commitment Commitment + type RequestAirdropResponse JsonRpcResponse[string] + type ReturnData struct + Data any + ProgramId string + type RpcClient struct + func New(opts ...Option) RpcClient + func NewRpcClient(endpoint string) RpcClient + func (c *RpcClient) Call(ctx context.Context, params ...any) ([]byte, error) + func (c *RpcClient) GetAccountInfo(ctx context.Context, base58Addr string) (JsonRpcResponse[GetAccountInfo], error) + func (c *RpcClient) GetAccountInfoWithConfig(ctx context.Context, base58Addr string, cfg GetAccountInfoConfig) (JsonRpcResponse[GetAccountInfo], error) + func (c *RpcClient) GetBalance(ctx context.Context, base58Addr string) (JsonRpcResponse[GetBalance], error) + func (c *RpcClient) GetBalanceWithConfig(ctx context.Context, base58Addr string, cfg GetBalanceConfig) (JsonRpcResponse[GetBalance], error) + func (c *RpcClient) GetBlock(ctx context.Context, slot uint64) (JsonRpcResponse[GetBlock], error) + func (c *RpcClient) GetBlockCommitment(ctx context.Context, slot uint64) (JsonRpcResponse[GetBlockCommitment], error) + func (c *RpcClient) GetBlockHeight(ctx context.Context) (JsonRpcResponse[uint64], error) + func (c *RpcClient) GetBlockHeightWithConfig(ctx context.Context, cfg GetBlockHeightConfig) (JsonRpcResponse[uint64], error) + func (c *RpcClient) GetBlockProduction(ctx context.Context) (JsonRpcResponse[GetBlockProduction], error) + func (c *RpcClient) GetBlockProductionWithConfig(ctx context.Context, cfg GetBlockProductionConfig) (JsonRpcResponse[GetBlockProduction], error) + func (c *RpcClient) GetBlockTime(ctx context.Context, slot uint64) (JsonRpcResponse[int64], error) + func (c *RpcClient) GetBlockWithConfig(ctx context.Context, slot uint64, cfg GetBlockConfig) (JsonRpcResponse[GetBlock], error) + func (c *RpcClient) GetBlocks(ctx context.Context, startSlot uint64, endSlot uint64) (JsonRpcResponse[[]uint64], error) + func (c *RpcClient) GetBlocksWithConfig(ctx context.Context, startSlot uint64, endSlot uint64, cfg GetBlocksConfig) (JsonRpcResponse[[]uint64], error) + func (c *RpcClient) GetBlocksWithLimit(ctx context.Context, startSlot uint64, limit uint64) (JsonRpcResponse[[]uint64], error) + func (c *RpcClient) GetBlocksWithLimitWithConfig(ctx context.Context, startSlot uint64, limit uint64, ...) (JsonRpcResponse[[]uint64], error) + func (c *RpcClient) GetClusterNodes(ctx context.Context) (JsonRpcResponse[GetClusterNodes], error) + func (c *RpcClient) GetEpochInfo(ctx context.Context) (JsonRpcResponse[GetEpochInfo], error) + func (c *RpcClient) GetEpochInfoWithConfig(ctx context.Context, cfg GetEpochInfoConfig) (JsonRpcResponse[GetEpochInfo], error) + func (c *RpcClient) GetEpochSchedule(ctx context.Context) (JsonRpcResponse[GetEpochSchedule], error) + func (c *RpcClient) GetFeeForMessage(ctx context.Context, message string) (JsonRpcResponse[GetFeeForMessage], error) + func (c *RpcClient) GetFeeForMessageWithConfig(ctx context.Context, message string, cfg GetFeeForMessageConfig) (JsonRpcResponse[GetFeeForMessage], error) + func (c *RpcClient) GetFirstAvailableBlock(ctx context.Context) (JsonRpcResponse[uint64], error) + func (c *RpcClient) GetGenesisHash(ctx context.Context) (JsonRpcResponse[string], error) + func (c *RpcClient) GetIdentity(ctx context.Context) (JsonRpcResponse[GetIdentity], error) + func (c *RpcClient) GetInflationGovernor(ctx context.Context) (JsonRpcResponse[GetInflationGovernor], error) + func (c *RpcClient) GetInflationGovernorWithConfig(ctx context.Context, cfg GetInflationGovernorConfig) (JsonRpcResponse[GetInflationGovernor], error) + func (c *RpcClient) GetInflationRate(ctx context.Context) (JsonRpcResponse[GetInflationRate], error) + func (c *RpcClient) GetInflationReward(ctx context.Context, stakeAccountAddrs []string) (JsonRpcResponse[[]*GetInflationReward], error) + func (c *RpcClient) GetInflationRewardWithConfig(ctx context.Context, stakeAccountAddrs []string, cfg GetInflationRewardConfig) (JsonRpcResponse[[]*GetInflationReward], error) + func (c *RpcClient) GetLatestBlockhash(ctx context.Context) (JsonRpcResponse[GetLatestBlockhash], error) + func (c *RpcClient) GetLatestBlockhashWithConfig(ctx context.Context, cfg GetLatestBlockhashConfig) (JsonRpcResponse[GetLatestBlockhash], error) + func (c *RpcClient) GetMinimumBalanceForRentExemption(ctx context.Context, dataLen uint64) (JsonRpcResponse[uint64], error) + func (c *RpcClient) GetMinimumBalanceForRentExemptionWithConfig(ctx context.Context, dataLen uint64, ...) (JsonRpcResponse[uint64], error) + func (c *RpcClient) GetMultipleAccounts(ctx context.Context, base58Addrs []string) (JsonRpcResponse[GetMultipleAccounts], error) + func (c *RpcClient) GetMultipleAccountsWithConfig(ctx context.Context, base58Addrs []string, cfg GetMultipleAccountsConfig) (JsonRpcResponse[GetMultipleAccounts], error) + func (c *RpcClient) GetProgramAccounts(ctx context.Context, programId string) (JsonRpcResponse[GetProgramAccounts], error) + func (c *RpcClient) GetProgramAccountsWithConfig(ctx context.Context, programId string, cfg GetProgramAccountsConfig) (JsonRpcResponse[GetProgramAccounts], error) + func (c *RpcClient) GetProgramAccountsWithContext(ctx context.Context, programId string) (JsonRpcResponse[GetProgramAccountsWithContext], error) + func (c *RpcClient) GetProgramAccountsWithContextAndConfig(ctx context.Context, programId string, cfg GetProgramAccountsConfig) (JsonRpcResponse[GetProgramAccountsWithContext], error) + func (c *RpcClient) GetSignatureStatuses(ctx context.Context, signatures []string) (JsonRpcResponse[GetSignatureStatuses], error) + func (c *RpcClient) GetSignatureStatusesWithConfig(ctx context.Context, signatures []string, cfg GetSignatureStatusesConfig) (JsonRpcResponse[GetSignatureStatuses], error) + func (c *RpcClient) GetSignaturesForAddress(ctx context.Context, base58Addr string) (JsonRpcResponse[GetSignaturesForAddress], error) + func (c *RpcClient) GetSignaturesForAddressWithConfig(ctx context.Context, base58Addr string, cfg GetSignaturesForAddressConfig) (JsonRpcResponse[GetSignaturesForAddress], error) + func (c *RpcClient) GetSlot(ctx context.Context) (JsonRpcResponse[uint64], error) + func (c *RpcClient) GetSlotWithConfig(ctx context.Context, cfg GetSlotConfig) (JsonRpcResponse[uint64], error) + func (c *RpcClient) GetTokenAccountBalance(ctx context.Context, base58Addr string) (JsonRpcResponse[GetTokenAccountBalance], error) + func (c *RpcClient) GetTokenAccountBalanceWithConfig(ctx context.Context, base58Addr string, cfg GetTokenAccountBalanceConfig) (JsonRpcResponse[GetTokenAccountBalance], error) + func (c *RpcClient) GetTokenAccountsByOwner(ctx context.Context, base58Addr string, ...) (JsonRpcResponse[GetTokenAccountsByOwner], error) + func (c *RpcClient) GetTokenAccountsByOwnerWithConfig(ctx context.Context, base58Addr string, ...) (JsonRpcResponse[GetTokenAccountsByOwner], error) + func (c *RpcClient) GetTokenSupply(ctx context.Context, mintAddr string) (JsonRpcResponse[GetTokenSupply], error) + func (c *RpcClient) GetTokenSupplyWithConfig(ctx context.Context, mintAddr string, cfg GetTokenSupplyConfig) (JsonRpcResponse[GetTokenSupply], error) + func (c *RpcClient) GetTransaction(ctx context.Context, txhash string) (JsonRpcResponse[*GetTransaction], error) + func (c *RpcClient) GetTransactionCount(ctx context.Context) (JsonRpcResponse[uint64], error) + func (c *RpcClient) GetTransactionCountWithConfig(ctx context.Context, cfg GetTransactionCountConfig) (JsonRpcResponse[uint64], error) + func (c *RpcClient) GetTransactionWithConfig(ctx context.Context, txhash string, cfg GetTransactionConfig) (JsonRpcResponse[*GetTransaction], error) + func (c *RpcClient) GetVersion(ctx context.Context) (JsonRpcResponse[GetVersion], error) + func (c *RpcClient) GetVoteAccounts(ctx context.Context) (JsonRpcResponse[GetVoteAccounts], error) + func (c *RpcClient) GetVoteAccountsWithConfig(ctx context.Context, cfg GetVoteAccountsConfig) (JsonRpcResponse[GetVoteAccounts], error) + func (c *RpcClient) IsBlockhashValid(ctx context.Context, message string) (JsonRpcResponse[IsBlockhashValid], error) + func (c *RpcClient) IsBlockhashValidWithConfig(ctx context.Context, message string, cfg IsBlockhashValidConfig) (JsonRpcResponse[IsBlockhashValid], error) + func (c *RpcClient) MinimumLedgerSlot(ctx context.Context) (JsonRpcResponse[uint64], error) + func (c *RpcClient) RequestAirdrop(ctx context.Context, base58Addr string, lamports uint64) (JsonRpcResponse[string], error) + func (c *RpcClient) RequestAirdropWithConfig(ctx context.Context, base58Addr string, lamports uint64, ...) (JsonRpcResponse[string], error) + func (c *RpcClient) SendTransaction(ctx context.Context, tx string) (JsonRpcResponse[string], error) + func (c *RpcClient) SendTransactionWithConfig(ctx context.Context, tx string, cfg SendTransactionConfig) (JsonRpcResponse[string], error) + func (c *RpcClient) SimulateTransaction(ctx context.Context, rawTx string) (JsonRpcResponse[SimulateTransaction], error) + func (c *RpcClient) SimulateTransactionWithConfig(ctx context.Context, rawTx string, cfg SimulateTransactionConfig) (JsonRpcResponse[SimulateTransaction], error) + type SendTransactionConfig struct + Encoding SendTransactionConfigEncoding + MaxRetries uint64 + PreflightCommitment Commitment + SkipPreflight bool + type SendTransactionConfigEncoding string + const SendTransactionConfigEncodingBase58 + const SendTransactionConfigEncodingBase64 + type SendTransactionResponse JsonRpcResponse[string] + type SignatureStatus struct + ConfirmationStatus *Commitment + Confirmations *uint64 + Err any + Slot uint64 + type SignatureStatuses []*SignatureStatus + type SignatureWithStatus struct + BlockTime *int64 + Err any + Memo *string + Signature string + Slot uint64 + type SimulateTransaction struct + Context Context + Value SimulateTransactionValue + type SimulateTransactionConfig struct + Accounts *SimulateTransactionConfigAccounts + Commitment Commitment + Encoding SimulateTransactionEncoding + ReplaceRecentBlockhash bool + SigVerify bool + type SimulateTransactionConfigAccounts struct + Addresses []string + Encoding AccountEncoding + type SimulateTransactionEncoding string + const SimulateTransactionEncodingBase58 + const SimulateTransactionEncodingBase64 + type SimulateTransactionResponse JsonRpcResponse[SimulateTransaction] + type SimulateTransactionValue struct + Accounts []*AccountInfo + Err any + Logs []string + ReturnData *ReturnData + type TokenAccountBalance struct + Amount string + Decimals uint8 + UIAmountString string + type TransactionEncoding string + const TransactionEncodingBase58 + const TransactionEncodingBase64 + const TransactionEncodingBinary + const TransactionEncodingJson + const TransactionEncodingJsonParsed + type TransactionLoadedAddresses struct + Readonly []string + Writable []string + type TransactionMeta struct + ComputeUnitsConsumed *uint64 + Err any + Fee uint64 + InnerInstructions []TransactionMetaInnerInstruction + LoadedAddresses TransactionLoadedAddresses + LogMessages []string + PostBalances []int64 + PostTokenBalances []TransactionMetaTokenBalance + PreBalances []int64 + PreTokenBalances []TransactionMetaTokenBalance + ReturnData *ReturnData + type TransactionMetaInnerInstruction struct + Index uint64 + Instructions []any + type TransactionMetaReward struct + Commission *uint8 + Lamports int64 + PostBalances uint64 + Pubkey string + RewardType TransactionMetaRewardType + type TransactionMetaRewardType string + const TransactionMetaRewardTypeRent + type TransactionMetaTokenBalance struct + AccountIndex uint64 + Mint string + Owner string + UITokenAmount TokenAccountBalance + type VoteAccount struct + ActivatedStake uint64 + Commission uint8 + EpochCredits [][3]uint64 + EpochVoteAccount bool + LastVote uint64 + NodePubkey string + RootSlot uint64 + VotePubkey string + type VoteAccounts []VoteAccount