Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- type AccountKey
- type BlockReward
- type BlockhashResult
- type Client
- func (c *Client) DoRequest(out interface{}, method string, params ...interface{}) error
- func (c *Client) GetAccountDataIn(ctx context.Context, account solana.PublicKey, inVar interface{}) (err error)
- func (c *Client) GetAccountInfo(ctx context.Context, account solana.PublicKey) (out *GetAccountInfoResult, err error)
- func (c *Client) GetBalance(ctx context.Context, publicKey string, commitment CommitmentType) (out *GetBalanceResult, err error)
- func (c *Client) GetConfirmedBlock(ctx context.Context, slot uint64, encoding string) (out *GetConfirmedBlockResult, err error)
- func (c *Client) GetConfirmedSignaturesForAddress2(ctx context.Context, address solana.PublicKey, ...) (out GetConfirmedSignaturesForAddress2Result, err error)
- func (c *Client) GetConfirmedTransaction(ctx context.Context, signature string) (out TransactionWithMeta, err error)
- func (c *Client) GetMinimumBalanceForRentExemption(ctx context.Context, dataSize int) (lamport int, err error)
- func (c *Client) GetProgramAccounts(ctx context.Context, publicKey solana.PublicKey, opts *GetProgramAccountsOpts) (out GetProgramAccountsResult, err error)
- func (c *Client) GetRecentBlockhash(ctx context.Context, commitment CommitmentType) (out *GetRecentBlockhashResult, err error)
- func (c *Client) GetSignaturesForAddress(ctx context.Context, address solana.PublicKey, ...) (out GetSignaturesForAddressResult, err error)
- func (c *Client) GetSlot(ctx context.Context, commitment CommitmentType) (out GetSlotResult, err error)
- func (c *Client) RequestAirdrop(ctx context.Context, account *solana.PublicKey, lamport uint64, ...) (signature string, err error)
- func (c *Client) SendTransaction(transaction *solana.Transaction, opts *SendTransactionOptions) (signature string, err error)
- func (c *Client) SetHeader(k, v string)
- func (c *Client) SimulateTransaction(ctx context.Context, transaction *solana.Transaction) (*SimulateTransactionResponse, error)
- type ClientOption
- type CommitmentType
- type Context
- type FeeCalculator
- type GetAccountInfoResult
- type GetBalanceResult
- type GetConfirmedBlockResult
- type GetConfirmedSignaturesForAddress2Opts
- type GetConfirmedSignaturesForAddress2Result
- type GetProgramAccountsOpts
- type GetProgramAccountsResult
- type GetRecentBlockhashResult
- type GetSignaturesForAddressOpts
- type GetSignaturesForAddressResult
- type GetSlotResult
- type InstructionInfo
- type KeyedAccount
- type Message
- type ParsedInstruction
- type ParsedTransaction
- type RPCContext
- type RPCFilter
- type RPCFilterMemcmp
- type SendTransactionOptions
- type SimulateTransactionResponse
- type TransactionError
- type TransactionMeta
- type TransactionParsed
- type TransactionSignature
- type TransactionWithMeta
Constants ¶
View Source
const ( // CommitmentProcessed queries the most recent block which has reached 1 confirmation by the connected node CommitmentProcessed = CommitmentType("processed") // CommitmentConfirmed queries the most recent block which has reached 1 confirmation by the cluster CommitmentConfirmed = CommitmentType("confirmed") // CommitmentConfirmed queries the most recent block which has been finalized by the cluster CommitmentFinalized = CommitmentType("finalized") // The following are deprecated CommitmentMax = CommitmentType("max") // Deprecated as of v1.5.5 CommitmentRecent = CommitmentType("recent") // Deprecated as of v1.5.5 CommitmentRoot = CommitmentType("root") // Deprecated as of v1.5.5 CommitmentSingle = CommitmentType("single") // Deprecated as of v1.5.5 CommitmentSingleGossip = CommitmentType("singleGossip") // Deprecated as of v1.5.5 )
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
View Source
var WithDebug = func() ClientOption { return func(cli *Client) *Client { cli.debug = true return cli } }
Functions ¶
This section is empty.
Types ¶
type AccountKey ¶
type BlockReward ¶
type BlockhashResult ¶
type BlockhashResult struct { Blockhash solana.PublicKey `json:"blockhash"` /* make this a `Hash` type, which is a copy of the PublicKey` type */ FeeCalculator FeeCalculator `json:"feeCalculator"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(rpcURL string, opts ...ClientOption) *Client
func (*Client) GetAccountDataIn ¶
func (*Client) GetAccountInfo ¶
func (c *Client) GetAccountInfo(ctx context.Context, account solana.PublicKey) (out *GetAccountInfoResult, err error)
func (*Client) GetBalance ¶
func (c *Client) GetBalance(ctx context.Context, publicKey string, commitment CommitmentType) (out *GetBalanceResult, err error)
func (*Client) GetConfirmedBlock ¶
func (*Client) GetConfirmedSignaturesForAddress2 ¶
func (c *Client) GetConfirmedSignaturesForAddress2(ctx context.Context, address solana.PublicKey, opts *GetConfirmedSignaturesForAddress2Opts) (out GetConfirmedSignaturesForAddress2Result, err error)
func (*Client) GetConfirmedTransaction ¶
func (*Client) GetMinimumBalanceForRentExemption ¶
func (*Client) GetProgramAccounts ¶
func (c *Client) GetProgramAccounts(ctx context.Context, publicKey solana.PublicKey, opts *GetProgramAccountsOpts) (out GetProgramAccountsResult, err error)
func (*Client) GetRecentBlockhash ¶
func (c *Client) GetRecentBlockhash(ctx context.Context, commitment CommitmentType) (out *GetRecentBlockhashResult, err error)
func (*Client) GetSignaturesForAddress ¶
func (c *Client) GetSignaturesForAddress(ctx context.Context, address solana.PublicKey, opts *GetSignaturesForAddressOpts) (out GetSignaturesForAddressResult, err error)
func (*Client) GetSlot ¶
func (c *Client) GetSlot(ctx context.Context, commitment CommitmentType) (out GetSlotResult, err error)
func (*Client) RequestAirdrop ¶
func (*Client) SendTransaction ¶
func (c *Client) SendTransaction( transaction *solana.Transaction, opts *SendTransactionOptions, ) (signature string, err error)
func (*Client) SimulateTransaction ¶
func (c *Client) SimulateTransaction(ctx context.Context, transaction *solana.Transaction) (*SimulateTransactionResponse, error)
type ClientOption ¶
type CommitmentType ¶
type CommitmentType string
CommitmentType is the level of commitment desired when querying state. https://docs.solana.com/developing/clients/jsonrpc-api#configuring-state-commitment
type FeeCalculator ¶
type GetAccountInfoResult ¶
type GetAccountInfoResult struct { RPCContext Value *Account `json:"value"` }
type GetBalanceResult ¶
type GetBalanceResult struct { RPCContext Value bin.Uint64 `json:"value"` }
type GetConfirmedBlockResult ¶
type GetConfirmedBlockResult struct { Blockhash solana.PublicKey `json:"blockhash"` PreviousBlockhash solana.PublicKey `json:"previousBlockhash"` // could be zeroes if ledger was clean-up and this is unavailable ParentSlot bin.Uint64 `json:"parentSlot"` Transactions []TransactionWithMeta `json:"transactions"` Rewards []BlockReward `json:"rewards"` BlockTime bin.Uint64 `json:"blockTime,omitempty"` }
type GetConfirmedSignaturesForAddress2Result ¶
type GetConfirmedSignaturesForAddress2Result []*TransactionSignature
type GetProgramAccountsOpts ¶
type GetProgramAccountsOpts struct { Commitment CommitmentType `json:"commitment,omitempty"` // Filter on accounts, implicit AND between filters Filters []RPCFilter `json:"filters,omitempty"` }
type GetProgramAccountsResult ¶
type GetProgramAccountsResult []*KeyedAccount
type GetRecentBlockhashResult ¶
type GetRecentBlockhashResult struct { RPCContext Value BlockhashResult `json:"value"` }
type GetSignaturesForAddressResult ¶
type GetSignaturesForAddressResult []*TransactionSignature
type GetSlotResult ¶
type InstructionInfo ¶
type KeyedAccount ¶
type KeyedAccount struct { Pubkey solana.PublicKey `json:"pubkey"` Account *Account `json:"account"` }
type Message ¶
type Message struct { AccountKeys []*AccountKey `json:"accountKeys"` RecentBlockhash solana.PublicKey `json:"recentBlockhash"` Instructions []ParsedInstruction `json:"instructions"` }
type ParsedInstruction ¶
type ParsedInstruction struct { Accounts []solana.PublicKey `json:"accounts,omitempty"` Data solana.Base58 `json:"data,omitempty"` Parsed *InstructionInfo `json:"parsed,omitempty"` Program string `json:"program,omitempty"` ProgramID solana.PublicKey `json:"programId"` }
func (*ParsedInstruction) IsParsed ¶
func (p *ParsedInstruction) IsParsed() bool
type ParsedTransaction ¶
type ParsedTransaction struct { Signatures []solana.Signature `json:"signatures"` Message Message `json:"message"` }
type RPCContext ¶
type RPCContext struct {
Context Context `json:"context,omitempty"`
}
type RPCFilter ¶
type RPCFilter struct { Memcmp *RPCFilterMemcmp `json:"memcmp,omitempty"` DataSize bin.Uint64 `json:"dataSize,omitempty"` }
type RPCFilterMemcmp ¶
type RPCFilterMemcmp struct { Offset int `json:"offset"` Bytes solana.Base58 `json:"bytes"` }
type SendTransactionOptions ¶
type SendTransactionOptions struct { SkipPreflight bool // disable transaction verification step PreflightCommitment CommitmentType // preflight commitment level; default: "finalized" }
type SimulateTransactionResponse ¶
type SimulateTransactionResponse struct { Err interface{} Logs []string }
type TransactionError ¶
type TransactionMeta ¶
type TransactionParsed ¶
type TransactionParsed struct { Transaction *ParsedTransaction `json:"transaction"` Meta *TransactionMeta `json:"meta,omitempty"` }
type TransactionSignature ¶
type TransactionWithMeta ¶
type TransactionWithMeta struct { Transaction *solana.Transaction `json:"transaction"` Meta *TransactionMeta `json:"meta,omitempty"` }
Click to show internal directories.
Click to hide internal directories.