Documentation
¶
Index ¶
- type AccountInfo
- type Client
- func (c *Client) GetAccountInfo(ctx context.Context, base58Addr string) (AccountInfo, error)
- func (c *Client) GetAccountInfoWithConfig(ctx context.Context, base58Addr string, cfg GetAccountInfoConfig) (AccountInfo, error)
- func (c *Client) GetBalance(ctx context.Context, base58Addr string) (uint64, error)
- func (c *Client) GetBalanceWithConfig(ctx context.Context, base58Addr string, cfg rpc.GetBalanceConfig) (uint64, error)
- func (c *Client) GetBlock(ctx context.Context, slot uint64) (GetBlockResponse, error)
- func (c *Client) GetBlockTime(ctx context.Context, slot uint64) (int64, error)
- func (c *Client) GetClusterNodes(ctx context.Context) ([]ClusterNode, error)
- func (c *Client) GetFeeForMessage(ctx context.Context, message types.Message) (*uint64, error)
- func (c *Client) GetFeeForMessageWithConfig(ctx context.Context, message types.Message, cfg GetFeeForMessageConfig) (*uint64, error)
- func (c *Client) GetFirstAvailableBlock(ctx context.Context) (uint64, error)
- func (c *Client) GetGenesisHash(ctx context.Context) (string, error)
- func (c *Client) GetIdentity(ctx context.Context) (string, error)
- func (c *Client) GetLatestBlockhash(ctx context.Context) (rpc.GetLatestBlockhashValue, error)
- func (c *Client) GetLatestBlockhashWithConfig(ctx context.Context, cfg GetLatestBlockhashConfig) (rpc.GetLatestBlockhashValue, error)
- func (c *Client) GetMinimumBalanceForRentExemption(ctx context.Context, dataLen uint64) (uint64, error)
- func (c *Client) GetMultipleAccounts(ctx context.Context, base58Addrs []string) ([]AccountInfo, error)
- func (c *Client) GetMultipleAccountsWithConfig(ctx context.Context, base58Addrs []string, cfg GetMultipleAccountsConfig) ([]AccountInfo, error)
- func (c *Client) GetNonceAccount(ctx context.Context, base58Addr string) (system.NonceAccount, error)
- func (c *Client) GetNonceFromNonceAccount(ctx context.Context, base58Addr string) (string, error)
- func (c *Client) GetSignatureStatus(ctx context.Context, signature string) (*rpc.SignatureStatus, error)
- func (c *Client) GetSignatureStatusWithConfig(ctx context.Context, signature string, cfg rpc.GetSignatureStatusesConfig) (*rpc.SignatureStatus, error)
- func (c *Client) GetSignatureStatuses(ctx context.Context, signatures []string) (rpc.SignatureStatuses, error)
- func (c *Client) GetSignatureStatusesWithConfig(ctx context.Context, signatures []string, cfg rpc.GetSignatureStatusesConfig) (rpc.SignatureStatuses, error)
- func (c *Client) GetSignaturesForAddress(ctx context.Context, base58Addr string) (rpc.GetSignaturesForAddress, error)
- func (c *Client) GetSignaturesForAddressWithConfig(ctx context.Context, base58Addr string, cfg rpc.GetSignaturesForAddressConfig) (rpc.GetSignaturesForAddress, error)
- func (c *Client) GetSlot(ctx context.Context) (uint64, error)
- func (c *Client) GetSlotWithConfig(ctx context.Context, cfg rpc.GetSlotConfig) (uint64, error)
- func (c *Client) GetTokenAccount(ctx context.Context, base58Addr string) (token.TokenAccount, error)
- func (c *Client) GetTokenAccountBalance(ctx context.Context, base58Addr string) (uint64, uint8, error)
- func (c *Client) GetTokenAccountBalanceWithConfig(ctx context.Context, base58Addr string, cfg rpc.GetTokenAccountBalanceConfig) (uint64, uint8, error)
- func (c *Client) GetTokenAccountsByOwner(ctx context.Context, base58Addr string) (map[common.PublicKey]token.TokenAccount, error)
- func (c *Client) GetTokenSupply(ctx context.Context, mintAddr string) (uint64, uint8, error)
- func (c *Client) GetTokenSupplyWithConfig(ctx context.Context, mintAddr string, cfg rpc.GetTokenSupplyConfig) (uint64, uint8, error)
- func (c *Client) GetTransaction(ctx context.Context, txhash string) (*GetTransactionResponse, error)
- func (c *Client) GetTransactionCount(ctx context.Context) (uint64, error)
- func (c *Client) GetTransactionCountWithConfig(ctx context.Context, cfg rpc.GetTransactionCountConfig) (uint64, error)
- func (c *Client) GetTransactionWithConfig(ctx context.Context, txhash string, cfg rpc.GetTransactionConfig) (*GetTransactionResponse, error)
- func (c *Client) GetVersion(ctx context.Context) (rpc.GetVersion, error)
- func (c *Client) IsBlockhashValid(ctx context.Context, blockhash string) (bool, error)
- func (c *Client) IsBlockhashValidWithConfig(ctx context.Context, blockhash string, cfg IsBlockhashConfig) (bool, error)
- func (c *Client) MinimumLedgerSlot(ctx context.Context) (uint64, error)
- func (c *Client) QuickSendTransaction(ctx context.Context, param QuickSendTransactionParam) (string, error)
- func (c *Client) RequestAirdrop(ctx context.Context, base58Addr string, lamports uint64) (string, error)
- func (c *Client) SendTransaction(ctx context.Context, tx types.Transaction) (string, error)
- func (c *Client) SendTransactionWithConfig(ctx context.Context, tx types.Transaction, config SendTransactionConfig) (string, error)
- func (c *Client) SimulateTransaction(ctx context.Context, tx types.Transaction) (SimulateTransaction, error)
- func (c *Client) SimulateTransactionWithConfig(ctx context.Context, tx types.Transaction, cfg SimulateTransactionConfig) (SimulateTransaction, error)
- type ClusterNode
- type GetAccountInfoConfig
- type GetBlockResponse
- type GetBlockTransaction
- type GetFeeForMessageConfig
- type GetLatestBlockhashConfig
- type GetMultipleAccountsConfig
- type GetTransactionResponse
- type IsBlockhashConfig
- type QuickSendTransactionParam
- type SendTransactionConfig
- type SimulateTransaction
- type SimulateTransactionConfig
- type TransactionMeta
- type TransactionMetaInnerInstruction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountInfo ¶ added in v1.4.0
type Client ¶
func (*Client) GetAccountInfo ¶ added in v1.4.0
GetAccountInfo return account's info
func (*Client) GetAccountInfoWithConfig ¶ added in v1.11.0
func (c *Client) GetAccountInfoWithConfig(ctx context.Context, base58Addr string, cfg GetAccountInfoConfig) (AccountInfo, error)
GetAccountInfoWithConfig return account's info
func (*Client) GetBalance ¶
GetBalance fetch users lamports(SOL) balance
func (*Client) GetBalanceWithConfig ¶ added in v1.9.0
func (c *Client) GetBalanceWithConfig(ctx context.Context, base58Addr string, cfg rpc.GetBalanceConfig) (uint64, error)
GetBalance fetch users lamports(SOL) balance with specific commitment
func (*Client) GetBlock ¶ added in v1.9.0
GetBlock returns identity and transaction information about a confirmed block in the ledger
func (*Client) GetBlockTime ¶ added in v1.9.0
GetBlockTime returns the estimated production time of a block.
func (*Client) GetClusterNodes ¶ added in v1.10.0
func (c *Client) GetClusterNodes(ctx context.Context) ([]ClusterNode, error)
GetClusterNodes returns information about all the nodes participating in the cluster
func (*Client) GetFeeForMessage ¶ added in v1.13.0
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 (*Client) GetFeeForMessageWithConfig ¶ added in v1.13.0
func (c *Client) GetFeeForMessageWithConfig(ctx context.Context, message types.Message, cfg GetFeeForMessageConfig) (*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 (*Client) GetFirstAvailableBlock ¶ added in v1.9.0
GetFirstAvailableBlock returns the slot of the lowest confirmed block that has not been purged from the ledger
func (*Client) GetGenesisHash ¶ added in v1.9.0
GetGenesisHash returns the genesis hash
func (*Client) GetIdentity ¶ added in v1.9.0
GetIdentity returns the identity pubkey for the current node
func (*Client) GetLatestBlockhash ¶ added in v1.13.0
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 (*Client) GetLatestBlockhashWithConfig ¶ added in v1.13.0
func (c *Client) GetLatestBlockhashWithConfig(ctx context.Context, cfg GetLatestBlockhashConfig) (rpc.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 (*Client) GetMinimumBalanceForRentExemption ¶ added in v1.9.0
func (c *Client) GetMinimumBalanceForRentExemption(ctx context.Context, dataLen uint64) (uint64, error)
GetMinimumBalanceForRentExemption returns minimum balance required to make account rent exempt
func (*Client) GetMultipleAccounts ¶ added in v1.13.0
func (c *Client) GetMultipleAccounts(ctx context.Context, base58Addrs []string) ([]AccountInfo, error)
GetMultipleAccounts returns multiple accounts info
func (*Client) GetMultipleAccountsWithConfig ¶ added in v1.13.0
func (c *Client) GetMultipleAccountsWithConfig(ctx context.Context, base58Addrs []string, cfg GetMultipleAccountsConfig) ([]AccountInfo, error)
GetAccountInfoWithConfig return account's info
func (*Client) GetNonceAccount ¶ added in v1.16.0
func (*Client) GetNonceFromNonceAccount ¶ added in v1.16.0
func (*Client) GetSignatureStatus ¶ added in v1.11.0
func (*Client) GetSignatureStatusWithConfig ¶ added in v1.11.0
func (c *Client) GetSignatureStatusWithConfig(ctx context.Context, signature string, cfg rpc.GetSignatureStatusesConfig) (*rpc.SignatureStatus, error)
func (*Client) GetSignatureStatuses ¶ added in v1.11.0
func (*Client) GetSignatureStatusesWithConfig ¶ added in v1.11.0
func (c *Client) GetSignatureStatusesWithConfig(ctx context.Context, signatures []string, cfg rpc.GetSignatureStatusesConfig) (rpc.SignatureStatuses, error)
func (*Client) GetSignaturesForAddress ¶ added in v1.15.0
func (*Client) GetSignaturesForAddressWithConfig ¶ added in v1.15.0
func (c *Client) GetSignaturesForAddressWithConfig(ctx context.Context, base58Addr string, cfg rpc.GetSignaturesForAddressConfig) (rpc.GetSignaturesForAddress, error)
func (*Client) GetSlotWithConfig ¶ added in v1.9.0
GetSlotWithConfig get slot by commitment
func (*Client) GetTokenAccount ¶ added in v1.19.0
func (*Client) GetTokenAccountBalance ¶ added in v1.8.0
func (c *Client) GetTokenAccountBalance(ctx context.Context, base58Addr string) (uint64, uint8, error)
GetTokenAccountBalance returns the token balance of an SPL Token account
func (*Client) GetTokenAccountBalanceWithConfig ¶ added in v1.9.0
func (c *Client) GetTokenAccountBalanceWithConfig(ctx context.Context, base58Addr string, cfg rpc.GetTokenAccountBalanceConfig) (uint64, uint8, error)
GetTokenAccountBalance returns the token balance of an SPL Token account
func (*Client) GetTokenAccountsByOwner ¶ added in v1.19.0
func (*Client) GetTokenSupply ¶ added in v1.9.0
GetTokenSupply returns the total supply of an SPL Token type.
func (*Client) GetTokenSupplyWithConfig ¶ added in v1.9.0
func (c *Client) GetTokenSupplyWithConfig(ctx context.Context, mintAddr string, cfg rpc.GetTokenSupplyConfig) (uint64, uint8, error)
GetTokenSupply returns the total supply of an SPL Token type.
func (*Client) GetTransaction ¶ added in v1.9.0
func (c *Client) GetTransaction(ctx context.Context, txhash string) (*GetTransactionResponse, error)
GetTransaction returns transaction details for a confirmed transaction
func (*Client) GetTransactionCount ¶ added in v1.9.0
GetTransactionCount returns the current Transaction count from the ledger
func (*Client) GetTransactionCountWithConfig ¶ added in v1.9.0
func (c *Client) GetTransactionCountWithConfig(ctx context.Context, cfg rpc.GetTransactionCountConfig) (uint64, error)
GetTransactionCountWithConfig returns the current Transaction count from the ledger
func (*Client) GetTransactionWithConfig ¶ added in v1.9.0
func (c *Client) GetTransactionWithConfig(ctx context.Context, txhash string, cfg rpc.GetTransactionConfig) (*GetTransactionResponse, error)
GetTransactionWithConfig returns transaction details for a confirmed transaction will ignore encoding
func (*Client) GetVersion ¶ added in v1.9.0
GetVersion returns the current solana versions running on the node
func (*Client) IsBlockhashValid ¶ added in v1.13.0
NEW: This method is only available in solana-core v1.9 or newer. Please use getFees for solana-core v1.8 IsBlockhashValid get the fee the network will charge for a particular Message
func (*Client) IsBlockhashValidWithConfig ¶ added in v1.13.0
func (c *Client) IsBlockhashValidWithConfig(ctx context.Context, blockhash string, cfg IsBlockhashConfig) (bool, error)
NEW: This method is only available in solana-core v1.9 or newer. Please use getFees for solana-core v1.8 IsBlockhashValidWithConfig get the fee the network will charge for a particular Message
func (*Client) MinimumLedgerSlot ¶ added in v1.9.0
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 (*Client) QuickSendTransaction ¶ added in v1.9.0
func (c *Client) QuickSendTransaction(ctx context.Context, param QuickSendTransactionParam) (string, error)
QuickSendTransaction is a quick way to send tx
func (*Client) RequestAirdrop ¶ added in v1.9.0
func (c *Client) RequestAirdrop(ctx context.Context, base58Addr string, lamports uint64) (string, error)
RequestAirdrop requests an airdrop of lamports to a Pubkey
func (*Client) SendTransaction ¶ added in v1.4.0
SendTransaction send transaction struct directly
func (*Client) SendTransactionWithConfig ¶ added in v1.10.0
func (c *Client) SendTransactionWithConfig(ctx context.Context, tx types.Transaction, config SendTransactionConfig) (string, error)
SendTransaction send transaction struct directly
func (*Client) SimulateTransaction ¶ added in v1.11.0
func (c *Client) SimulateTransaction(ctx context.Context, tx types.Transaction) (SimulateTransaction, error)
func (*Client) SimulateTransactionWithConfig ¶ added in v1.11.0
func (c *Client) SimulateTransactionWithConfig(ctx context.Context, tx types.Transaction, cfg SimulateTransactionConfig) (SimulateTransaction, error)
type ClusterNode ¶ added in v1.10.0
type GetAccountInfoConfig ¶ added in v1.11.0
type GetAccountInfoConfig struct { Commitment rpc.Commitment DataSlice *rpc.DataSlice }
type GetBlockResponse ¶ added in v1.9.0
type GetBlockResponse struct { Blockhash string BlockTime *int64 BlockHeight *int64 PreviousBlockhash string ParentSlot uint64 Transactions []GetBlockTransaction Rewards []rpc.GetBlockReward }
type GetBlockTransaction ¶ added in v1.9.0
type GetBlockTransaction struct { Meta *TransactionMeta Transaction types.Transaction }
type GetFeeForMessageConfig ¶ added in v1.13.0
type GetFeeForMessageConfig struct {
Commitment rpc.Commitment `json:"commitment,omitempty"`
}
type GetLatestBlockhashConfig ¶ added in v1.13.0
type GetLatestBlockhashConfig struct {
Commitment rpc.Commitment `json:"commitment,omitempty"`
}
type GetMultipleAccountsConfig ¶ added in v1.13.0
type GetMultipleAccountsConfig struct { Commitment rpc.Commitment DataSlice *rpc.DataSlice }
type GetTransactionResponse ¶ added in v1.9.0
type GetTransactionResponse struct { Slot uint64 Meta *TransactionMeta Transaction types.Transaction BlockTime *int64 }
type IsBlockhashConfig ¶ added in v1.13.0
type IsBlockhashConfig struct {
Commitment rpc.Commitment `json:"commitment,omitempty"`
}
type QuickSendTransactionParam ¶ added in v1.9.0
type SendTransactionConfig ¶ added in v1.10.0
type SendTransactionConfig struct { SkipPreflight bool PreflightCommitment rpc.Commitment MaxRetries uint64 }
type SimulateTransaction ¶ added in v1.11.0
type SimulateTransaction struct { Err any Logs []string Accounts []*AccountInfo }
type SimulateTransactionConfig ¶ added in v1.11.0
type SimulateTransactionConfig struct { SigVerify bool Commitment rpc.Commitment ReplaceRecentBlockhash bool Addresses []string }
type TransactionMeta ¶ added in v1.9.0
type TransactionMeta struct { Err any Fee uint64 PreBalances []int64 PostBalances []int64 PreTokenBalances []rpc.TransactionMetaTokenBalance PostTokenBalances []rpc.TransactionMetaTokenBalance LogMessages []string InnerInstructions []TransactionMetaInnerInstruction }
type TransactionMetaInnerInstruction ¶ added in v1.9.0
type TransactionMetaInnerInstruction struct { Index uint64 Instructions []types.CompiledInstruction }