Documentation ¶
Index ¶
- Constants
- type AccountEncoding
- type AccountInfo
- type Commitment
- type Context
- type DataSlice
- type GetAccountInfo
- type GetAccountInfoConfig
- type GetAccountResponse
- type GetBalance
- type GetBalanceConfig
- type GetBalanceResponse
- type GetBlock
- type GetBlockCommitment
- type GetBlockCommitmentResponse
- type GetBlockConfig
- type GetBlockConfigEncoding
- type GetBlockConfigTransactionDetails
- type GetBlockHeightConfig
- type GetBlockHeightResponse
- type GetBlockProduction
- type GetBlockProductionConfig
- type GetBlockProductionRange
- type GetBlockProductionResponse
- type GetBlockProductionResponseResultValue
- type GetBlockResponse
- type GetBlockTimeResponse
- type GetBlockTransaction
- type GetBlocksConfig
- type GetBlocksResponse
- type GetBlocksWithLimitConfig
- type GetBlocksWithLimitResponse
- type GetClusterNode
- type GetClusterNodes
- type GetClusterNodesResponse
- type GetEpochInfo
- type GetEpochInfoConfig
- type GetEpochInfoResponse
- type GetEpochSchedule
- type GetEpochScheduleResponse
- type GetFeeForMessage
- type GetFeeForMessageConfig
- type GetFeeForMessageResponse
- type GetFirstAvailableBlockResponse
- type GetGenesisHashResponse
- type GetIdentity
- type GetIdentityResponse
- type GetInflationGovernor
- type GetInflationGovernorConfig
- type GetInflationGovernorResponse
- type GetInflationRate
- type GetInflationRateResponse
- type GetInflationReward
- type GetInflationRewardConfig
- type GetInflationRewardResponse
- type GetLatestBlockhash
- type GetLatestBlockhashConfig
- type GetLatestBlockhashResponse
- type GetLatestBlockhashValue
- type GetMinimumBalanceForRentExemptionConfig
- type GetMinimumBalanceForRentExemptionResponse
- type GetMultipleAccounts
- type GetMultipleAccountsConfig
- type GetMultipleAccountsConfigEncoding
- type GetMultipleAccountsResponse
- type GetProgramAccount
- type GetProgramAccounts
- type GetProgramAccountsConfig
- type GetProgramAccountsConfigFilter
- type GetProgramAccountsConfigFilterMemCmp
- type GetProgramAccountsResponse
- type GetProgramAccountsWithContext
- type GetProgramAccountsWithContextResponse
- type GetSignatureStatuses
- type GetSignatureStatusesConfig
- type GetSignatureStatusesResponse
- type GetSignaturesForAddress
- type GetSignaturesForAddressConfig
- type GetSignaturesForAddressResponse
- type GetSlotConfig
- type GetSlotResponse
- type GetTokenAccountBalance
- type GetTokenAccountBalanceConfig
- type GetTokenAccountBalanceResponse
- type GetTokenAccountsByOwner
- type GetTokenAccountsByOwnerConfig
- type GetTokenAccountsByOwnerConfigFilter
- type GetTokenAccountsByOwnerResponse
- type GetTokenSupply
- type GetTokenSupplyConfig
- type GetTokenSupplyResponse
- type GetTokenSupplyResultValue
- type GetTransaction
- type GetTransactionConfig
- type GetTransactionCountConfig
- type GetTransactionCountResponse
- type GetTransactionResponse
- type GetVersion
- type GetVersionResponse
- type GetVoteAccounts
- type GetVoteAccountsConfig
- type GetVoteAccountsResponse
- type Instruction
- type IsBlockhashValid
- type IsBlockhashValidConfig
- type IsBlockhashValidResponse
- type JsonRpcError
- type JsonRpcRequest
- type JsonRpcResponse
- type MinimumLedgerSlotResponse
- type Option
- type RequestAirdropConfig
- type RequestAirdropResponse
- type ReturnData
- type Reward
- type RewardType
- type RpcClient
- func (c *RpcClient) Call(ctx context.Context, params ...any) ([]byte, error)
- func (c *RpcClient) GetAccountInfo(ctx context.Context, base58Addr string) (JsonRpcResponse[ValueWithContext[AccountInfo]], error)
- func (c *RpcClient) GetAccountInfoWithConfig(ctx context.Context, base58Addr string, cfg GetAccountInfoConfig) (JsonRpcResponse[ValueWithContext[AccountInfo]], error)
- func (c *RpcClient) GetBalance(ctx context.Context, base58Addr string) (JsonRpcResponse[ValueWithContext[uint64]], error)
- func (c *RpcClient) GetBalanceWithConfig(ctx context.Context, base58Addr string, cfg GetBalanceConfig) (JsonRpcResponse[ValueWithContext[uint64]], 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[ValueWithContext[*uint64]], error)
- func (c *RpcClient) GetFeeForMessageWithConfig(ctx context.Context, message string, cfg GetFeeForMessageConfig) (JsonRpcResponse[ValueWithContext[*uint64]], 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[ValueWithContext[GetLatestBlockhashValue]], error)
- func (c *RpcClient) GetLatestBlockhashWithConfig(ctx context.Context, cfg GetLatestBlockhashConfig) (JsonRpcResponse[ValueWithContext[GetLatestBlockhashValue]], 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[ValueWithContext[[]AccountInfo]], error)
- func (c *RpcClient) GetMultipleAccountsWithConfig(ctx context.Context, base58Addrs []string, cfg GetMultipleAccountsConfig) (JsonRpcResponse[ValueWithContext[[]AccountInfo]], 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[ValueWithContext[SignatureStatuses]], error)
- func (c *RpcClient) GetSignatureStatusesWithConfig(ctx context.Context, signatures []string, cfg GetSignatureStatusesConfig) (JsonRpcResponse[ValueWithContext[SignatureStatuses]], 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[ValueWithContext[TokenAccountBalance]], error)
- func (c *RpcClient) GetTokenAccountBalanceWithConfig(ctx context.Context, base58Addr string, cfg GetTokenAccountBalanceConfig) (JsonRpcResponse[ValueWithContext[TokenAccountBalance]], error)
- func (c *RpcClient) GetTokenAccountsByOwner(ctx context.Context, base58Addr string, ...) (JsonRpcResponse[ValueWithContext[GetProgramAccounts]], error)
- func (c *RpcClient) GetTokenAccountsByOwnerWithConfig(ctx context.Context, base58Addr string, ...) (JsonRpcResponse[ValueWithContext[GetProgramAccounts]], error)
- func (c *RpcClient) GetTokenSupply(ctx context.Context, mintAddr string) (JsonRpcResponse[ValueWithContext[GetTokenSupplyResultValue]], error)
- func (c *RpcClient) GetTokenSupplyWithConfig(ctx context.Context, mintAddr string, cfg GetTokenSupplyConfig) (JsonRpcResponse[ValueWithContext[GetTokenSupplyResultValue]], 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[ValueWithContext[bool]], error)
- func (c *RpcClient) IsBlockhashValidWithConfig(ctx context.Context, message string, cfg IsBlockhashValidConfig) (JsonRpcResponse[ValueWithContext[bool]], 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[ValueWithContext[SimulateTransactionValue]], error)
- func (c *RpcClient) SimulateTransactionWithConfig(ctx context.Context, rawTx string, cfg SimulateTransactionConfig) (JsonRpcResponse[ValueWithContext[SimulateTransactionValue]], error)
- type SendTransactionConfig
- type SendTransactionConfigEncoding
- type SendTransactionResponse
- type SignatureStatus
- type SignatureStatuses
- type SignatureWithStatus
- type SimulateTransaction
- type SimulateTransactionConfig
- type SimulateTransactionConfigAccounts
- type SimulateTransactionEncoding
- type SimulateTransactionResponse
- type SimulateTransactionValue
- type TokenAccountBalance
- type TransactionEncoding
- type TransactionLoadedAddresses
- type TransactionMeta
- type TransactionMetaInnerInstruction
- type TransactionMetaTokenBalance
- type ValueWithContext
- type VoteAccount
- type VoteAccounts
Constants ¶
const ( LocalnetRPCEndpoint = "http://localhost:8899" 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 AccountEncoding ¶ added in v1.20.0
type AccountEncoding string
const ( AccountEncodingBase58 AccountEncoding = "base58" AccountEncodingJsonParsed AccountEncoding = "jsonParsed" AccountEncodingBase64 AccountEncoding = "base64" AccountEncodingBase64Zstd AccountEncoding = "base64+zstd" )
type AccountInfo ¶ added in v1.19.0
type Commitment ¶
type Commitment string
Commitment describes how finalized a block is at that point in time
const ( CommitmentFinalized Commitment = "finalized" CommitmentConfirmed Commitment = "confirmed" CommitmentProcessed Commitment = "processed" )
type GetAccountInfo ¶ added in v1.20.0
type GetAccountInfo ValueWithContext[AccountInfo]
type GetAccountInfoConfig ¶
type GetAccountInfoConfig struct { Commitment Commitment `json:"commitment,omitempty"` Encoding AccountEncoding `json:"encoding,omitempty"` DataSlice *DataSlice `json:"dataSlice,omitempty"` }
GetAccountInfoConfig is an option config for `getAccountInfo`
type GetAccountResponse ¶ added in v1.20.0
type GetAccountResponse JsonRpcResponse[GetAccountInfo]
type GetBalance ¶ added in v1.20.0
type GetBalance ValueWithContext[uint64]
type GetBalanceConfig ¶
type GetBalanceConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
GetBalanceConfig is a option config for `getBalance`
type GetBalanceResponse ¶
type GetBalanceResponse JsonRpcResponse[GetBalance]
type GetBlock ¶ added in v1.20.0
type GetBlock struct { Blockhash string `json:"blockhash"` BlockTime *int64 `json:"blockTime"` BlockHeight *int64 `json:"blockHeight"` PreviousBlockhash string `json:"previousBlockhash"` ParentSlot uint64 `json:"parentSlot"` Transactions []GetBlockTransaction `json:"transactions"` Signatures []string `json:"signatures"` Rewards []Reward `json:"rewards"` }
type GetBlockCommitment ¶ added in v1.20.0
type GetBlockCommitment struct { Commitment *[]uint64 `json:"commitment"` TotalStake uint64 `json:"totalStake"` }
GetBlockCommitmentResult is a part of raw rpc response of `getBlockCommitment`
type GetBlockCommitmentResponse ¶
type GetBlockCommitmentResponse JsonRpcResponse[GetBlockCommitment]
type GetBlockConfig ¶
type GetBlockConfig struct { Encoding GetBlockConfigEncoding `json:"encoding,omitempty"` // default: "json" TransactionDetails GetBlockConfigTransactionDetails `json:"transactionDetails,omitempty"` // default: "full", either "full", "signatures", "none" Rewards *bool `json:"rewards,omitempty"` // default: true Commitment Commitment `json:"commitment,omitempty"` // "processed" is not supported MaxSupportedTransactionVersion *uint8 `json:"maxSupportedTransactionVersion,omitempty"` // default: nil legacy only }
type GetBlockConfigEncoding ¶
type GetBlockConfigEncoding string
const ( GetBlockConfigEncodingJson GetBlockConfigEncoding = "json" GetBlockConfigEncodingJsonParsed GetBlockConfigEncoding = "jsonParsed" GetBlockConfigEncodingBase58 GetBlockConfigEncoding = "base58" GetBlockConfigEncodingBase64 GetBlockConfigEncoding = "base64" )
type GetBlockConfigTransactionDetails ¶
type GetBlockConfigTransactionDetails string
const ( GetBlockConfigTransactionDetailsFull GetBlockConfigTransactionDetails = "full" GetBlockConfigTransactionDetailsSignatures GetBlockConfigTransactionDetails = "signatures" GetBlockConfigTransactionDetailsNone GetBlockConfigTransactionDetails = "none" )
type GetBlockHeightConfig ¶
type GetBlockHeightConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
GetBlockHeightConfig is a option config for `getBlockHeight`
type GetBlockHeightResponse ¶
type GetBlockHeightResponse JsonRpcResponse[uint64]
type GetBlockProduction ¶ added in v1.20.0
type GetBlockProduction ValueWithContext[GetBlockProductionResponseResultValue]
type GetBlockProductionConfig ¶ added in v1.10.0
type GetBlockProductionConfig struct { Commitment Commitment `json:"commitment,omitempty"` Range *GetBlockProductionRange `json:"range,omitempty"` Identity string `json:"identity,omitempty"` }
GetBlockProductionConfig is a option config for `getBlockProduction`
type GetBlockProductionRange ¶ added in v1.10.0
type GetBlockProductionResponse ¶ added in v1.10.0
type GetBlockProductionResponse JsonRpcResponse[GetBlockProduction]
type GetBlockProductionResponseResultValue ¶ added in v1.10.0
type GetBlockProductionResponseResultValue struct { ByIdentity map[string][]uint64 `json:"byIdentity"` Range GetBlockProductionRange `json:"range"` }
type GetBlockResponse ¶
type GetBlockResponse JsonRpcResponse[GetBlock]
type GetBlockTimeResponse ¶
type GetBlockTimeResponse JsonRpcResponse[*int64]
type GetBlockTransaction ¶
type GetBlockTransaction struct { Transaction any `json:"transaction"` Meta *TransactionMeta `json:"meta"` Version any `json:"version"` }
type GetBlocksConfig ¶
type GetBlocksConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
GetBlocksConfig is a option config for `getBlocks`
type GetBlocksResponse ¶
type GetBlocksResponse JsonRpcResponse[[]uint64]
type GetBlocksWithLimitConfig ¶
type GetBlocksWithLimitConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
GetBlocksWithLimitConfig is a option config for `getBlocksWithLimit`
type GetBlocksWithLimitResponse ¶
type GetBlocksWithLimitResponse JsonRpcResponse[[]uint64]
type GetClusterNode ¶ added in v1.20.0
type GetClusterNodes ¶ added in v1.20.0
type GetClusterNodes []GetClusterNode
type GetClusterNodesResponse ¶ added in v1.10.0
type GetClusterNodesResponse JsonRpcResponse[GetClusterNodes]
type GetEpochInfo ¶ added in v1.20.0
type GetEpochInfoConfig ¶
type GetEpochInfoConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
GetEpochInfoConfig is a option config for `getEpochInfo`
type GetEpochInfoResponse ¶
type GetEpochInfoResponse JsonRpcResponse[GetEpochInfo]
type GetEpochSchedule ¶ added in v1.20.0
type GetEpochScheduleResponse ¶ added in v1.10.0
type GetEpochScheduleResponse JsonRpcResponse[GetEpochSchedule]
type GetFeeForMessage ¶ added in v1.20.0
type GetFeeForMessage ValueWithContext[*uint64]
type GetFeeForMessageConfig ¶ added in v1.13.0
type GetFeeForMessageConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
GetFeeForMessageConfig is a option config for `GetFeeForMessage`
type GetFeeForMessageResponse ¶ added in v1.13.0
type GetFeeForMessageResponse JsonRpcResponse[ValueWithContext[*uint64]]
type GetFirstAvailableBlockResponse ¶
type GetFirstAvailableBlockResponse JsonRpcResponse[uint64]
type GetGenesisHashResponse ¶
type GetGenesisHashResponse JsonRpcResponse[string]
type GetIdentity ¶ added in v1.20.0
type GetIdentity struct {
Identity string `json:"identity"`
}
type GetIdentityResponse ¶
type GetIdentityResponse JsonRpcResponse[GetIdentity]
type GetInflationGovernor ¶ added in v1.20.0
type GetInflationGovernorConfig ¶ added in v1.10.0
type GetInflationGovernorConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
GetInflationGovernorConfig is a option config for `getInflationGovernor`
type GetInflationGovernorResponse ¶ added in v1.10.0
type GetInflationGovernorResponse JsonRpcResponse[GetInflationGovernor]
type GetInflationRate ¶ added in v1.20.0
type GetInflationRateResponse ¶
type GetInflationRateResponse JsonRpcResponse[GetInflationRate]
type GetInflationReward ¶ added in v1.20.0
type GetInflationReward struct { Epoch uint64 `json:"epoch"` EffectiveSlot uint64 `json:"effectiveSlot"` Amount uint64 `json:"amount"` PostBalance uint64 `json:"postBalance"` Commission *uint8 `json:"commission"` }
GetInflationRewardResult is a part of raw rpc response of `getInflationReward`
type GetInflationRewardConfig ¶ added in v1.10.0
type GetInflationRewardConfig struct { Commitment Commitment `json:"commitment,omitempty"` Epoch uint64 `json:"epoch,omitempty"` }
GetInflationRewardConfig is a option config for `getInflationReward`
type GetInflationRewardResponse ¶ added in v1.10.0
type GetInflationRewardResponse JsonRpcResponse[[]*GetInflationReward]
type GetLatestBlockhash ¶ added in v1.20.0
type GetLatestBlockhash ValueWithContext[GetLatestBlockhashValue]
type GetLatestBlockhashConfig ¶ added in v1.13.0
type GetLatestBlockhashConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
GetLatestBlockhashConfig is a option config for `getLatestBlockhash`
type GetLatestBlockhashResponse ¶ added in v1.13.0
type GetLatestBlockhashResponse JsonRpcResponse[GetLatestBlockhash]
type GetLatestBlockhashValue ¶ added in v1.13.0
type GetLatestBlockhashValue struct { Blockhash string `json:"blockhash"` LatestValidBlockHeight uint64 `json:"lastValidBlockHeight"` }
GetLatestBlockhashResult is a part of raw rpc response of `getLatestBlockhash`
type GetMinimumBalanceForRentExemptionConfig ¶
type GetMinimumBalanceForRentExemptionConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
type GetMinimumBalanceForRentExemptionResponse ¶
type GetMinimumBalanceForRentExemptionResponse JsonRpcResponse[uint64]
type GetMultipleAccounts ¶ added in v1.20.0
type GetMultipleAccounts ValueWithContext[[]AccountInfo]
type GetMultipleAccountsConfig ¶ added in v1.13.0
type GetMultipleAccountsConfig struct { Commitment Commitment `json:"commitment,omitempty"` Encoding AccountEncoding `json:"encoding,omitempty"` DataSlice *DataSlice `json:"dataSlice,omitempty"` }
GetMultipleAccountsConfig is an option config for `getAccountInfo`
type GetMultipleAccountsConfigEncoding ¶ added in v1.13.0
type GetMultipleAccountsConfigEncoding string
GetMultipleAccountsConfigEncoding is account's data encode format
type GetMultipleAccountsResponse ¶ added in v1.13.0
type GetMultipleAccountsResponse JsonRpcResponse[GetMultipleAccounts]
type GetProgramAccount ¶ added in v1.20.0
type GetProgramAccount struct { Pubkey string `json:"pubkey"` Account AccountInfo `json:"account"` }
type GetProgramAccounts ¶
type GetProgramAccounts []GetProgramAccount
type GetProgramAccountsConfig ¶
type GetProgramAccountsConfig struct { Encoding AccountEncoding `json:"encoding,omitempty"` Commitment Commitment `json:"commitment,omitempty"` DataSlice *DataSlice `json:"dataSlice,omitempty"` Filters []GetProgramAccountsConfigFilter `json:"filters,omitempty"` }
GetProgramAccountsConfig is a option config for `getProgramAccounts`
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 JsonRpcResponse[GetProgramAccounts]
type GetProgramAccountsWithContext ¶ added in v1.20.0
type GetProgramAccountsWithContext ValueWithContext[GetProgramAccounts]
type GetProgramAccountsWithContextResponse ¶
type GetProgramAccountsWithContextResponse JsonRpcResponse[GetProgramAccountsWithContext]
type GetSignatureStatuses ¶ added in v1.20.0
type GetSignatureStatuses ValueWithContext[SignatureStatuses]
type GetSignatureStatusesConfig ¶
type GetSignatureStatusesConfig struct {
SearchTransactionHistory bool `json:"searchTransactionHistory,omitempty"`
}
GetSignatureStatusesConfig is a option config for `getSignatureStatuses`
type GetSignatureStatusesResponse ¶
type GetSignatureStatusesResponse JsonRpcResponse[GetSignatureStatuses]
type GetSignaturesForAddress ¶ added in v1.20.0
type GetSignaturesForAddress []SignatureWithStatus
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" }
GetSignaturesForAddressConfig is option config of `getSignaturesForAddress`
type GetSignaturesForAddressResponse ¶
type GetSignaturesForAddressResponse JsonRpcResponse[GetSignaturesForAddress]
type GetSlotConfig ¶
type GetSlotConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
GetSlotConfig is a option config for `getSlot`
type GetSlotResponse ¶
type GetSlotResponse JsonRpcResponse[uint64]
type GetTokenAccountBalance ¶ added in v1.20.0
type GetTokenAccountBalance ValueWithContext[TokenAccountBalance]
type GetTokenAccountBalanceConfig ¶
type GetTokenAccountBalanceConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
type GetTokenAccountBalanceResponse ¶
type GetTokenAccountBalanceResponse JsonRpcResponse[ValueWithContext[TokenAccountBalance]]
type GetTokenAccountsByOwner ¶ added in v1.20.0
type GetTokenAccountsByOwner ValueWithContext[GetProgramAccounts]
type GetTokenAccountsByOwnerConfig ¶
type GetTokenAccountsByOwnerConfig struct { Commitment Commitment `json:"commitment,omitempty"` Encoding AccountEncoding `json:"encoding,omitempty"` DataSlice *DataSlice `json:"dataSlice,omitempty"` }
GetTokenAccountsByOwnerConfig is a option config for `GetTokenAccountsByOwner`
type GetTokenAccountsByOwnerConfigFilter ¶
type GetTokenAccountsByOwnerConfigFilter struct { Mint string `json:"mint,omitempty"` ProgramId string `json:"programId,omitempty"` }
GetTokenAccountsByOwnerConfigFilter either mint or programId
type GetTokenAccountsByOwnerResponse ¶
type GetTokenAccountsByOwnerResponse JsonRpcResponse[GetTokenAccountsByOwner]
type GetTokenSupply ¶ added in v1.20.0
type GetTokenSupply ValueWithContext[GetTokenSupplyResultValue]
type GetTokenSupplyConfig ¶
type GetTokenSupplyConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
GetTokenSupplyConfig is option config of `getTokenSupply`
type GetTokenSupplyResponse ¶
type GetTokenSupplyResponse JsonRpcResponse[GetTokenSupply]
type GetTokenSupplyResultValue ¶
type GetTokenSupplyResultValue struct { Amount string `json:"amount"` Decimals uint8 `json:"decimals"` UIAmountString string `json:"uiAmountString"` }
GetTokenSupplyResultValue is a part of `getTokenSupply` raw response
type GetTransaction ¶ added in v1.20.0
type GetTransaction struct { Slot uint64 `json:"slot"` Meta *TransactionMeta `json:"meta"` Transaction any `json:"transaction"` BlockTime *int64 `json:"blockTime"` Version any `json:"version,omitempty"` }
GetTransaction is a part of GetTransactionResponse
type GetTransactionConfig ¶
type GetTransactionConfig struct { Encoding TransactionEncoding `json:"encoding,omitempty"` Commitment Commitment `json:"commitment,omitempty"` // "processed" is not supported MaxSupportedTransactionVersion *uint8 `json:"maxSupportedTransactionVersion,omitempty"` // default: nil legacy only }
GetTransactionConfig is a option config for `getTransaction`
type GetTransactionCountConfig ¶
type GetTransactionCountConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
GetTransactionCountConfig is a option config for `getTransactionCount`
type GetTransactionCountResponse ¶
type GetTransactionCountResponse JsonRpcResponse[uint64]
type GetTransactionResponse ¶
type GetTransactionResponse JsonRpcResponse[*GetTransaction]
type GetVersion ¶ added in v1.20.0
type GetVersion struct { SolanaCore string `json:"solana-core"` FeatureSet *uint32 `json:"feature-set"` }
GetVersionResult is a part of raw rpc response of `getVersion`
type GetVersionResponse ¶
type GetVersionResponse JsonRpcResponse[GetVersion]
type GetVoteAccounts ¶ added in v1.23.0
type GetVoteAccounts struct { Current VoteAccounts `json:"current"` Deliquent VoteAccounts `json:"delinquent"` }
type GetVoteAccountsConfig ¶ added in v1.23.0
type GetVoteAccountsConfig struct { Commitment Commitment `json:"commitment,omitempty"` VotePubkey string `json:"votePubkey,omitempty"` KeepUnstakedDelinquents bool `json:"keepUnstakedDelinquents,omitempty"` DelinquentSlotDistance uint64 `json:"delinquentSlotDistance,omitempty"` }
type GetVoteAccountsResponse ¶ added in v1.23.0
type GetVoteAccountsResponse JsonRpcResponse[GetVoteAccounts]
type Instruction ¶
type Instruction struct { ProgramIDIndex int `json:"programIdIndex"` Accounts []int `json:"accounts"` Data string `json:"data"` }
Instruction is a part of TransactionMetaInnerInstruction
type IsBlockhashValid ¶ added in v1.20.0
type IsBlockhashValid ValueWithContext[bool]
type IsBlockhashValidConfig ¶ added in v1.13.0
type IsBlockhashValidConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
IsBlockhashValidConfig is a option config for `IsBlockhashValid`
type IsBlockhashValidResponse ¶ added in v1.13.0
type IsBlockhashValidResponse JsonRpcResponse[IsBlockhashValid]
type JsonRpcError ¶ added in v1.20.0
type JsonRpcError struct { Code int `json:"code"` Message string `json:"message"` Data any `json:"data"` }
func (*JsonRpcError) Error ¶ added in v1.22.0
func (e *JsonRpcError) Error() string
type JsonRpcRequest ¶ added in v1.20.0
type JsonRpcResponse ¶ added in v1.20.0
type JsonRpcResponse[T any] struct { JsonRpc string `json:"jsonrpc"` Id uint64 `json:"id"` Result T `json:"result"` Error *JsonRpcError `json:"error,omitempty"` }
func (JsonRpcResponse[T]) GetError ¶ added in v1.24.0
func (j JsonRpcResponse[T]) GetError() error
func (JsonRpcResponse[T]) GetResult ¶ added in v1.24.0
func (j JsonRpcResponse[T]) GetResult() T
type MinimumLedgerSlotResponse ¶
type MinimumLedgerSlotResponse JsonRpcResponse[uint64]
type Option ¶ added in v1.19.0
type Option func(*RpcClient)
Option is a configuration type for the Client
func WithEndpoint ¶ added in v1.19.0
WithEndpoint is an Option that allows you configure the rpc endpoint that our client will point to
func WithHTTPClient ¶ added in v1.19.0
HTTPClient is an Option type that allows you provide your own HTTP client
type RequestAirdropConfig ¶
type RequestAirdropConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
}
RequestAirdropConfig is a option config for `requestAirdrop`
type RequestAirdropResponse ¶
type RequestAirdropResponse JsonRpcResponse[string]
type ReturnData ¶ added in v1.23.0
type Reward ¶ added in v1.24.0
type Reward struct { Pubkey string `json:"pubkey"` Lamports int64 `json:"lamports"` PostBalances uint64 `json:"postBalance"` RewardType *RewardType `json:"rewardType"` Commission *uint8 `json:"commission"` }
type RewardType ¶ added in v1.24.0
type RewardType string
const ( RewardTypeFee RewardType = "Fee" RewardTypeRent RewardType = "Rent" RewardTypeVoting RewardType = "Voting" RewardTypeStaking RewardType = "Staking" )
type RpcClient ¶
type RpcClient struct {
// contains filtered or unexported fields
}
func New ¶ added in v1.19.0
New applies the given options to the rpc client being created. if no options is passed, it defaults to a bare bone http client and solana mainnet
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) (JsonRpcResponse[ValueWithContext[AccountInfo]], error)
GetAccountInfo returns all information associated with the account of provided Pubkey
func (*RpcClient) GetAccountInfoWithConfig ¶
func (c *RpcClient) GetAccountInfoWithConfig(ctx context.Context, base58Addr string, cfg GetAccountInfoConfig) (JsonRpcResponse[ValueWithContext[AccountInfo]], error)
GetAccountInfo returns all information associated with the account of provided Pubkey
func (*RpcClient) GetBalance ¶
func (c *RpcClient) GetBalance(ctx context.Context, base58Addr string) (JsonRpcResponse[ValueWithContext[uint64]], error)
GetBalance returns the SOL balance
func (*RpcClient) GetBalanceWithConfig ¶
func (c *RpcClient) GetBalanceWithConfig(ctx context.Context, base58Addr string, cfg GetBalanceConfig) (JsonRpcResponse[ValueWithContext[uint64]], error)
GetBalanceWithConfig returns the SOL balance
func (*RpcClient) GetBlock ¶
GetBlock returns identity and transaction information about a confirmed block in the ledger
func (*RpcClient) GetBlockCommitment ¶
func (c *RpcClient) GetBlockCommitment(ctx context.Context, slot uint64) (JsonRpcResponse[GetBlockCommitment], error)
GetBlockCommitment returns commitment for particular block
func (*RpcClient) GetBlockHeight ¶
GetBlockHeight returns the current block height of the node
func (*RpcClient) GetBlockHeightWithConfig ¶
func (c *RpcClient) GetBlockHeightWithConfig(ctx context.Context, cfg GetBlockHeightConfig) (JsonRpcResponse[uint64], error)
GetBlockHeightWithConfig returns the current block height of the node
func (*RpcClient) GetBlockProduction ¶ added in v1.10.0
func (c *RpcClient) GetBlockProduction(ctx context.Context) (JsonRpcResponse[GetBlockProduction], error)
GetBlockProduction returns the current block height of the node
func (*RpcClient) GetBlockProductionWithConfig ¶ added in v1.10.0
func (c *RpcClient) GetBlockProductionWithConfig(ctx context.Context, cfg GetBlockProductionConfig) (JsonRpcResponse[GetBlockProduction], error)
GetBlockProductionWithConfig returns the current block height of the node
func (*RpcClient) GetBlockTime ¶
GetBlockTime returns the estimated production time of a block.
func (*RpcClient) GetBlockWithConfig ¶
func (c *RpcClient) GetBlockWithConfig(ctx context.Context, slot uint64, cfg GetBlockConfig) (JsonRpcResponse[*GetBlock], error)
GetBlockWithConfig returns identity and transaction information about a confirmed block in the ledger
func (*RpcClient) GetBlocks ¶
func (c *RpcClient) GetBlocks(ctx context.Context, startSlot uint64, endSlot uint64) (JsonRpcResponse[[]uint64], error)
GetBlocks returns a list of confirmed blocks between two slots Max range allowed is 500,000 slot
func (*RpcClient) GetBlocksWithConfig ¶
func (c *RpcClient) GetBlocksWithConfig(ctx context.Context, startSlot uint64, endSlot uint64, cfg GetBlocksConfig) (JsonRpcResponse[[]uint64], error)
GetBlocks returns a list of confirmed blocks between two slots Max range allowed is 500,000 slot
func (*RpcClient) GetBlocksWithLimit ¶
func (c *RpcClient) GetBlocksWithLimit(ctx context.Context, startSlot uint64, limit uint64) (JsonRpcResponse[[]uint64], error)
GetBlocksWithLimit eturns a list of confirmed blocks starting at the given slot
func (*RpcClient) GetBlocksWithLimitWithConfig ¶
func (c *RpcClient) GetBlocksWithLimitWithConfig(ctx context.Context, startSlot uint64, limit uint64, cfg GetBlocksWithLimitConfig) (JsonRpcResponse[[]uint64], error)
GetBlocksWithLimit eturns a list of confirmed blocks starting at the given slot
func (*RpcClient) GetClusterNodes ¶ added in v1.10.0
func (c *RpcClient) GetClusterNodes(ctx context.Context) (JsonRpcResponse[GetClusterNodes], error)
GetClusterNodes returns information about all the nodes participating in the cluster
func (*RpcClient) GetEpochInfo ¶
func (c *RpcClient) GetEpochInfo(ctx context.Context) (JsonRpcResponse[GetEpochInfo], error)
GetEpochInfo returns the SOL balance
func (*RpcClient) GetEpochInfoWithConfig ¶
func (c *RpcClient) GetEpochInfoWithConfig(ctx context.Context, cfg GetEpochInfoConfig) (JsonRpcResponse[GetEpochInfo], error)
GetEpochInfoWithConfig returns the SOL balance
func (*RpcClient) GetEpochSchedule ¶ added in v1.10.0
func (c *RpcClient) GetEpochSchedule(ctx context.Context) (JsonRpcResponse[GetEpochSchedule], error)
GetEpochSchedule returns epoch schedule information from this cluster's genesis config
func (*RpcClient) GetFeeForMessage ¶ added in v1.13.0
func (c *RpcClient) GetFeeForMessage(ctx context.Context, message string) (JsonRpcResponse[ValueWithContext[*uint64]], error)
NEW: This method is only available in solana-core v1.9 or newer. Please use getFees for solana-core v1.8 GetFeeForMessage get the fee the network will charge for a particular Message
func (*RpcClient) GetFeeForMessageWithConfig ¶ added in v1.13.0
func (c *RpcClient) GetFeeForMessageWithConfig(ctx context.Context, message string, cfg GetFeeForMessageConfig) (JsonRpcResponse[ValueWithContext[*uint64]], error)
NEW: This method is only available in solana-core v1.9 or newer. Please use getFees for solana-core v1.8 GetFeeForMessageWithConfig get the fee the network will charge for a particular Message
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 ¶
func (c *RpcClient) GetIdentity(ctx context.Context) (JsonRpcResponse[GetIdentity], error)
GetIdentity returns the identity pubkey for the current node
func (*RpcClient) GetInflationGovernor ¶ added in v1.10.0
func (c *RpcClient) GetInflationGovernor(ctx context.Context) (JsonRpcResponse[GetInflationGovernor], error)
GetInflationGovernor returns the current inflation governor
func (*RpcClient) GetInflationGovernorWithConfig ¶ added in v1.10.0
func (c *RpcClient) GetInflationGovernorWithConfig(ctx context.Context, cfg GetInflationGovernorConfig) (JsonRpcResponse[GetInflationGovernor], error)
GetInflationGovernorWithConfig returns the current inflation governor
func (*RpcClient) GetInflationRate ¶
func (c *RpcClient) GetInflationRate(ctx context.Context) (JsonRpcResponse[GetInflationRate], error)
GetInflationRate returns the specific inflation values for the current epoch
func (*RpcClient) GetInflationReward ¶ added in v1.10.0
func (c *RpcClient) GetInflationReward(ctx context.Context, stakeAccountAddrs []string) (JsonRpcResponse[[]*GetInflationReward], error)
GetInflationReward returns the inflation reward for a list of addresses for an epoch
func (*RpcClient) GetInflationRewardWithConfig ¶ added in v1.10.0
func (c *RpcClient) GetInflationRewardWithConfig(ctx context.Context, stakeAccountAddrs []string, cfg GetInflationRewardConfig) (JsonRpcResponse[[]*GetInflationReward], error)
GetInflationRewardWithConfig returns the inflation reward for a list of addresses for an epoch
func (*RpcClient) GetLatestBlockhash ¶ added in v1.13.0
func (c *RpcClient) GetLatestBlockhash(ctx context.Context) (JsonRpcResponse[ValueWithContext[GetLatestBlockhashValue]], error)
NEW: This method is only available in solana-core v1.9 or newer. Please use getRecentBlockhash for solana-core v1.8 GetLatestBlockhash returns the latest blockhash
func (*RpcClient) GetLatestBlockhashWithConfig ¶ added in v1.13.0
func (c *RpcClient) GetLatestBlockhashWithConfig(ctx context.Context, cfg GetLatestBlockhashConfig) (JsonRpcResponse[ValueWithContext[GetLatestBlockhashValue]], error)
NEW: This method is only available in solana-core v1.9 or newer. Please use getRecentBlockhash for solana-core v1.8 GetLatestBlockhashWithConfig returns the latest blockhash
func (*RpcClient) GetMinimumBalanceForRentExemption ¶
func (c *RpcClient) GetMinimumBalanceForRentExemption(ctx context.Context, dataLen uint64) (JsonRpcResponse[uint64], error)
GetMinimumBalanceForRentExemption returns minimum balance required to make account rent exempt
func (*RpcClient) GetMinimumBalanceForRentExemptionWithConfig ¶
func (c *RpcClient) GetMinimumBalanceForRentExemptionWithConfig(ctx context.Context, dataLen uint64, cfg GetMinimumBalanceForRentExemptionConfig) (JsonRpcResponse[uint64], error)
GetMinimumBalanceForRentExemptionWithConfig returns minimum balance required to make account rent exempt
func (*RpcClient) GetMultipleAccounts ¶ added in v1.13.0
func (c *RpcClient) GetMultipleAccounts(ctx context.Context, base58Addrs []string) (JsonRpcResponse[ValueWithContext[[]AccountInfo]], error)
GetMultipleAccounts returns all information associated with the account of provided Pubkey
func (*RpcClient) GetMultipleAccountsWithConfig ¶ added in v1.13.0
func (c *RpcClient) GetMultipleAccountsWithConfig(ctx context.Context, base58Addrs []string, cfg GetMultipleAccountsConfig) (JsonRpcResponse[ValueWithContext[[]AccountInfo]], error)
GetMultipleAccounts returns all information associated with the account of provided Pubkey
func (*RpcClient) GetProgramAccounts ¶
func (c *RpcClient) GetProgramAccounts(ctx context.Context, programId string) (JsonRpcResponse[GetProgramAccounts], error)
func (*RpcClient) GetProgramAccountsWithConfig ¶
func (c *RpcClient) GetProgramAccountsWithConfig(ctx context.Context, programId string, cfg GetProgramAccountsConfig) (JsonRpcResponse[GetProgramAccounts], error)
func (*RpcClient) GetProgramAccountsWithContext ¶
func (c *RpcClient) GetProgramAccountsWithContext(ctx context.Context, programId string) (JsonRpcResponse[GetProgramAccountsWithContext], error)
func (*RpcClient) GetProgramAccountsWithContextAndConfig ¶
func (c *RpcClient) GetProgramAccountsWithContextAndConfig(ctx context.Context, programId string, cfg GetProgramAccountsConfig) (JsonRpcResponse[GetProgramAccountsWithContext], error)
func (*RpcClient) GetSignatureStatuses ¶
func (c *RpcClient) GetSignatureStatuses(ctx context.Context, signatures []string) (JsonRpcResponse[ValueWithContext[SignatureStatuses]], error)
GetSignatureStatuses returns the SOL balance
func (*RpcClient) GetSignatureStatusesWithConfig ¶
func (c *RpcClient) GetSignatureStatusesWithConfig(ctx context.Context, signatures []string, cfg GetSignatureStatusesConfig) (JsonRpcResponse[ValueWithContext[SignatureStatuses]], error)
GetSignatureStatusesWithConfig returns the SOL balance
func (*RpcClient) GetSignaturesForAddress ¶
func (c *RpcClient) GetSignaturesForAddress(ctx context.Context, base58Addr string) (JsonRpcResponse[GetSignaturesForAddress], error)
GetSignaturesForAddress returns confirmed signatures for transactions involving an address backwards in time from the provided signature or most recent confirmed block
func (*RpcClient) GetSignaturesForAddressWithConfig ¶
func (c *RpcClient) GetSignaturesForAddressWithConfig(ctx context.Context, base58Addr string, cfg GetSignaturesForAddressConfig) (JsonRpcResponse[GetSignaturesForAddress], error)
GetSignaturesForAddressWithConfig returns confirmed signatures for transactions involving an address backwards in time from the provided signature or most recent confirmed block
func (*RpcClient) GetSlotWithConfig ¶
func (c *RpcClient) GetSlotWithConfig(ctx context.Context, cfg GetSlotConfig) (JsonRpcResponse[uint64], error)
GetSlotWithConfig returns the SOL balance
func (*RpcClient) GetTokenAccountBalance ¶
func (c *RpcClient) GetTokenAccountBalance(ctx context.Context, base58Addr string) (JsonRpcResponse[ValueWithContext[TokenAccountBalance]], error)
GetTokenAccountBalance returns the token balance of an SPL Token account
func (*RpcClient) GetTokenAccountBalanceWithConfig ¶
func (c *RpcClient) GetTokenAccountBalanceWithConfig(ctx context.Context, base58Addr string, cfg GetTokenAccountBalanceConfig) (JsonRpcResponse[ValueWithContext[TokenAccountBalance]], error)
GetTokenAccountBalance returns the token balance of an SPL Token account
func (*RpcClient) GetTokenAccountsByOwner ¶
func (c *RpcClient) GetTokenAccountsByOwner(ctx context.Context, base58Addr string, filter GetTokenAccountsByOwnerConfigFilter) (JsonRpcResponse[ValueWithContext[GetProgramAccounts]], error)
func (*RpcClient) GetTokenAccountsByOwnerWithConfig ¶
func (c *RpcClient) GetTokenAccountsByOwnerWithConfig(ctx context.Context, base58Addr string, filter GetTokenAccountsByOwnerConfigFilter, cfg GetTokenAccountsByOwnerConfig) (JsonRpcResponse[ValueWithContext[GetProgramAccounts]], error)
func (*RpcClient) GetTokenSupply ¶
func (c *RpcClient) GetTokenSupply(ctx context.Context, mintAddr string) (JsonRpcResponse[ValueWithContext[GetTokenSupplyResultValue]], error)
GetTokenSupply returns the token balance of an SPL Token account
func (*RpcClient) GetTokenSupplyWithConfig ¶
func (c *RpcClient) GetTokenSupplyWithConfig(ctx context.Context, mintAddr string, cfg GetTokenSupplyConfig) (JsonRpcResponse[ValueWithContext[GetTokenSupplyResultValue]], error)
GetTokenSupply returns the token balance of an SPL Token account
func (*RpcClient) GetTransaction ¶
func (c *RpcClient) GetTransaction(ctx context.Context, txhash string) (JsonRpcResponse[*GetTransaction], error)
GetTransaction returns transaction details for a confirmed transaction
func (*RpcClient) GetTransactionCount ¶
GetTransactionCount returns the current Transaction count from the ledger
func (*RpcClient) GetTransactionCountWithConfig ¶
func (c *RpcClient) GetTransactionCountWithConfig(ctx context.Context, cfg GetTransactionCountConfig) (JsonRpcResponse[uint64], error)
GetTransactionCountWithConfig returns the current Transaction count from the ledger
func (*RpcClient) GetTransactionWithConfig ¶
func (c *RpcClient) GetTransactionWithConfig(ctx context.Context, txhash string, cfg GetTransactionConfig) (JsonRpcResponse[*GetTransaction], error)
GetTransactionWithConfig returns transaction details for a confirmed transaction
func (*RpcClient) GetVersion ¶
func (c *RpcClient) GetVersion(ctx context.Context) (JsonRpcResponse[GetVersion], error)
GetVersion returns the current solana versions running on the node
func (*RpcClient) GetVoteAccounts ¶ added in v1.23.0
func (c *RpcClient) GetVoteAccounts(ctx context.Context) (JsonRpcResponse[GetVoteAccounts], error)
GetVoteAccounts returns the account info and associated stake for all the voting accounts in the current bank.
func (*RpcClient) GetVoteAccountsWithConfig ¶ added in v1.23.0
func (c *RpcClient) GetVoteAccountsWithConfig(ctx context.Context, cfg GetVoteAccountsConfig) (JsonRpcResponse[GetVoteAccounts], error)
GetVoteAccountsWithConfig returns the account info and associated stake for all the voting accounts in the current bank.
func (*RpcClient) IsBlockhashValid ¶ added in v1.13.0
func (c *RpcClient) IsBlockhashValid(ctx context.Context, message string) (JsonRpcResponse[ValueWithContext[bool]], error)
IsBlockhashValid get the fee the network will charge for a particular Message
func (*RpcClient) IsBlockhashValidWithConfig ¶ added in v1.13.0
func (c *RpcClient) IsBlockhashValidWithConfig(ctx context.Context, message string, cfg IsBlockhashValidConfig) (JsonRpcResponse[ValueWithContext[bool]], error)
IsBlockhashValidWithConfig get the fee the network will charge for a particular Message
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 (c *RpcClient) RequestAirdrop(ctx context.Context, base58Addr string, lamports uint64) (JsonRpcResponse[string], error)
RequestAirdrop requests an airdrop of lamports to a Pubkey
func (*RpcClient) RequestAirdropWithConfig ¶
func (c *RpcClient) RequestAirdropWithConfig(ctx context.Context, base58Addr string, lamports uint64, cfg RequestAirdropConfig) (JsonRpcResponse[string], error)
RequestAirdropWithConfig requests an airdrop of lamports to a Pubkey
func (*RpcClient) SendTransaction ¶
func (c *RpcClient) SendTransaction(ctx context.Context, tx string) (JsonRpcResponse[string], 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) (JsonRpcResponse[string], error)
SendTransaction submits a signed transaction to the cluster for processing
func (*RpcClient) SimulateTransaction ¶
func (c *RpcClient) SimulateTransaction(ctx context.Context, rawTx string) (JsonRpcResponse[ValueWithContext[SimulateTransactionValue]], error)
SimulateTransaction simulate sending a transaction
func (*RpcClient) SimulateTransactionWithConfig ¶
func (c *RpcClient) SimulateTransactionWithConfig(ctx context.Context, rawTx string, cfg SimulateTransactionConfig) (JsonRpcResponse[ValueWithContext[SimulateTransactionValue]], 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 JsonRpcResponse[string]
type SignatureStatus ¶ added in v1.20.0
type SignatureStatus struct { Slot uint64 `json:"slot"` Confirmations *uint64 `json:"confirmations"` ConfirmationStatus *Commitment `json:"confirmationStatus"` Err any `json:"err"` }
type SignatureStatuses ¶ added in v1.20.0
type SignatureStatuses []*SignatureStatus
type SignatureWithStatus ¶ added in v1.20.0
type SimulateTransaction ¶ added in v1.20.0
type SimulateTransaction ValueWithContext[SimulateTransactionValue]
type SimulateTransactionConfig ¶
type SimulateTransactionConfig struct { SigVerify bool `json:"sigVerify,omitempty"` // default: false, conflicts with replace blockhash Commitment Commitment `json:"commitment,omitempty"` // default: finalized Encoding SimulateTransactionEncoding `json:"encoding,omitempty"` // default: "base58" ReplaceRecentBlockhash bool `json:"replaceRecentBlockhash,omitempty"` // default: false, conflicts with sigVerify Accounts *SimulateTransactionConfigAccounts `json:"accounts,omitempty"` }
type SimulateTransactionConfigAccounts ¶
type SimulateTransactionConfigAccounts struct { Encoding AccountEncoding `json:"encoding,omitempty"` // An array of accounts to return, as base-58 encoded strings Addresses []string `json:"addresses"` }
type SimulateTransactionEncoding ¶ added in v1.20.0
type SimulateTransactionEncoding string
const ( SimulateTransactionEncodingBase58 SimulateTransactionEncoding = "base58" SimulateTransactionEncodingBase64 SimulateTransactionEncoding = "base64" )
type SimulateTransactionResponse ¶
type SimulateTransactionResponse JsonRpcResponse[SimulateTransaction]
type SimulateTransactionValue ¶ added in v1.20.0
type SimulateTransactionValue struct { Err any `json:"err"` Logs []string `json:"logs,omitempty"` Accounts []*AccountInfo `json:"accounts,omitempty"` ReturnData *ReturnData `json:"returnData,omitempty"` }
SimulateTransactionValue is a part of SimulateTransactionResponseResult
type TokenAccountBalance ¶ added in v1.20.0
type TransactionEncoding ¶ added in v1.20.0
type TransactionEncoding string
const ( TransactionEncodingBinary TransactionEncoding = "binary" TransactionEncodingBase64 TransactionEncoding = "base64" TransactionEncodingBase58 TransactionEncoding = "base58" TransactionEncodingJson TransactionEncoding = "json" TransactionEncodingJsonParsed TransactionEncoding = "jsonParsed" )
type TransactionLoadedAddresses ¶ added in v1.22.0
type TransactionMeta ¶
type TransactionMeta struct { Err any `json:"err"` Fee uint64 `json:"fee"` PreBalances []int64 `json:"preBalances"` PostBalances []int64 `json:"postBalances"` PreTokenBalances []TransactionMetaTokenBalance `json:"preTokenBalances"` PostTokenBalances []TransactionMetaTokenBalance `json:"postTokenBalances"` Rewards []Reward `json:"rewards"` LogMessages []string `json:"logMessages"` InnerInstructions []TransactionMetaInnerInstruction `json:"innerInstructions"` LoadedAddresses TransactionLoadedAddresses `json:"loadedAddresses"` ReturnData *ReturnData `json:"returnData"` ComputeUnitsConsumed *uint64 `json:"computeUnitsConsumed"` }
TransactionMeta is a part of GetTransactionResult
type TransactionMetaInnerInstruction ¶
type TransactionMetaInnerInstruction struct { Index uint64 `json:"index"` Instructions []any `json:"instructions"` }
TransactionMetaInnerInstruction is a part of TransactionMeta
type TransactionMetaTokenBalance ¶
type TransactionMetaTokenBalance struct { AccountIndex uint64 `json:"accountIndex"` Mint string `json:"mint"` Owner string `json:"owner,omitempty"` ProgramId string `json:"programId,omitempty"` UITokenAmount TokenAccountBalance `json:"uiTokenAmount"` }
TransactionMetaTokenBalance is a part of TransactionMeta
type ValueWithContext ¶ added in v1.24.0
type VoteAccount ¶ added in v1.23.0
type VoteAccount struct { VotePubkey string `json:"votePubkey"` NodePubkey string `json:"nodePubkey"` ActivatedStake uint64 `json:"activatedStake"` Commission uint8 `json:"commission"` EpochVoteAccount bool `json:"epochVoteAccount"` LastVote uint64 `json:"lastVote"` EpochCredits [][3]uint64 `json:"epochCredits"` RootSlot uint64 `json:"rootSlot"` }
type VoteAccounts ¶ added in v1.23.0
type VoteAccounts []VoteAccount
Source Files ¶
- client.go
- get_account_info.go
- get_balance.go
- get_block.go
- get_block_commitment.go
- get_block_height.go
- get_block_production.go
- get_block_time.go
- get_blocks.go
- get_blocks_with_limit.go
- get_cluster_nodes.go
- get_epoch_info.go
- get_epoch_schedule.go
- get_fee_for_message.go
- get_first_available_block.go
- get_genesis_hash.go
- get_identity.go
- get_inflation_governor.go
- get_inflation_rate.go
- get_inflation_reward.go
- get_latest_blockhash.go
- get_minimum_balance_for_rent_exemption.go
- get_multiple_accounts.go
- get_program_accounts.go
- get_signature_statuses.go
- get_signatures_for_address.go
- get_slot.go
- get_token_account_balance.go
- get_token_account_by_owner.go
- get_token_supply.go
- get_transaction.go
- get_transaction_count.go
- get_version.go
- get_vote_accounts.go
- is_blockhash_valid.go
- minimum_ledger_slot.go
- options.go
- request_aridrop.go
- send_transaction.go
- simulate_transaction.go
- types.go