Documentation
¶
Index ¶
- Constants
- func GenerateBase58PrvKey(a Account) (string, error)
- func GenerateHexPrvKey(a Account) (string, error)
- type Account
- func AccountFromBase58Key(key string) (Account, error)
- func AccountFromBytes(b []byte) (Account, error)
- func AccountFromHexKey(key string) (Account, error)
- func AccountFromKeygenFile(file string) (Account, error)
- func AccountFromMnemonic(mnemonic string, args ...interface{}) (Account, error)
- func AccountFromSeed(seed []byte) (Account, error)
- func GenerateAccount() (Account, error)
- type AccountInfo
- type AccountInfoWithCtx
- type AccountMeta
- type AccountMetaSlice
- func (slice *AccountMetaSlice) Append(account *AccountMeta)
- func (slice AccountMetaSlice) Get(index int) *AccountMeta
- func (slice AccountMetaSlice) GetAccounts() (accounts []*AccountMeta)
- func (slice AccountMetaSlice) GetKeys() (keys []PublicKey)
- func (slice AccountMetaSlice) GetSigners() []*AccountMeta
- func (slice AccountMetaSlice) Len() int
- func (slice *AccountMetaSlice) SetAccounts(accounts []*AccountMeta) error
- type AccountNotifies
- type AccountWithLamport
- type AccountsGettable
- type AccountsInfoWithCtx
- type AccountsSettable
- type BalanceWithCtx
- type Base58Data
- type BlockCommitment
- type BlockInfo
- type BlockNotifies
- type BlockProduction
- type BlockProductionWithCtx
- type BlockReward
- type Client
- func (sc *Client) Close()
- func (sc *Client) GetAccountInfo(ctx context.Context, account PublicKey, cfg ...RpcAccountInfoCfg) (res AccountInfoWithCtx, err error)
- func (sc *Client) GetBalance(ctx context.Context, account PublicKey, cfg ...RpcCommitmentWithMinSlotCfg) (balance BalanceWithCtx, err error)
- func (sc *Client) GetBlock(ctx context.Context, blockNum uint64, cfg ...RpcGetBlockContextCfg) (blockInfo BlockInfo, err error)
- func (sc *Client) GetBlockCommitment(ctx context.Context, blockNum uint64) (blockCmt BlockCommitment, err error)
- func (sc *Client) GetBlockHeight(ctx context.Context, cfg ...RpcCommitmentWithMinSlotCfg) (res uint64, err error)
- func (sc *Client) GetBlockProduction(ctx context.Context, cfg ...RpcGetBlockProduction) (res BlockProductionWithCtx, err error)
- func (sc *Client) GetBlockTime(ctx context.Context, blockNum uint64) (res int64, err error)
- func (sc *Client) GetBlocks(ctx context.Context, startSlot uint64, args ...interface{}) (res []uint64, err error)
- func (sc *Client) GetBlocksWithLimit(ctx context.Context, startSlot, limit uint64, cfg ...RpcCommitmentCfg) (res []uint64, err error)
- func (sc *Client) GetClusterNodes(ctx context.Context) (res []ClusterInformation, err error)
- func (sc *Client) GetEpochInfo(ctx context.Context, cfg ...RpcCommitmentWithMinSlotCfg) (res EpochInformation, err error)
- func (sc *Client) GetEpochSchedule(ctx context.Context) (res EpochSchedule, err error)
- func (sc *Client) GetFeeForMessage(ctx context.Context, msg string, cfg ...RpcCommitmentWithMinSlotCfg) (res U64ValueWithCtx, err error)
- func (sc *Client) GetFirstAvailableBlock(ctx context.Context) (res uint64, err error)
- func (sc *Client) GetGenesisHash(ctx context.Context) (res Hash, err error)
- func (sc *Client) GetHealth(ctx context.Context) (res string, err error)
- func (sc *Client) GetHighestSnapshotSlot(ctx context.Context) (res HighestSnapshotSlot, err error)
- func (sc *Client) GetIdentity(ctx context.Context) (res Identity, err error)
- func (sc *Client) GetInflationGovernor(ctx context.Context, cfg ...RpcCommitmentCfg) (res InflationGovernor, err error)
- func (sc *Client) GetInflationRate(ctx context.Context) (res InflationRate, err error)
- func (sc *Client) GetInflationReward(ctx context.Context, args ...interface{}) (res []InflationReward, err error)
- func (sc *Client) GetLargestAccounts(ctx context.Context, cfg ...RpcCommitmentWithFilter) (res AccountWithLamport, err error)
- func (sc *Client) GetLatestBlockhash(ctx context.Context, cfg ...RpcCommitmentWithMinSlotCfg) (res LastBlockWithCtx, err error)
- func (sc *Client) GetLeaderSchedule(ctx context.Context, args ...interface{}) (res map[string][]uint64, err error)
- func (sc *Client) GetMaxRetransmitSlot(ctx context.Context) (res uint64, err error)
- func (sc *Client) GetMaxShredInsertSlot(ctx context.Context) (res uint64, err error)
- func (sc *Client) GetMinimumBalanceForRentExemption(ctx context.Context, args ...interface{}) (res uint64, err error)
- func (sc *Client) GetMultipleAccounts(ctx context.Context, accounts []PublicKey, cfg ...RpcAccountInfoCfg) (res AccountsInfoWithCtx, err error)
- func (sc *Client) GetProgramAccounts(ctx context.Context, program PublicKey, cfg ...RpcCombinedCfg) (res []ProgramAccount, err error)
- func (sc *Client) GetRecentPerformanceSamples(ctx context.Context, args ...uint64) (res []RpcPerfSample, err error)
- func (sc *Client) GetRecentPrioritizationFees(ctx context.Context, args ...interface{}) (res []RpcPrioritizationFee, err error)
- func (sc *Client) GetSignatureStatuses(ctx context.Context, signatures []Signature, cfg ...RpcSearchTxHistoryCfg) (res SignatureStatusWithCtx, err error)
- func (sc *Client) GetSignaturesForAddress(ctx context.Context, account PublicKey, cfg ...RpcSignaturesForAddressCfg) (res []SignatureInfo, err error)
- func (sc *Client) GetSlot(ctx context.Context, cfg ...RpcCommitmentWithMinSlotCfg) (res uint64, err error)
- func (sc *Client) GetSlotLeader(ctx context.Context, cfg ...RpcCommitmentWithMinSlotCfg) (res PublicKey, err error)
- func (sc *Client) GetSlotLeaders(ctx context.Context, args ...uint64) (res []PublicKey, err error)
- func (sc *Client) GetStakeActivation(ctx context.Context, account PublicKey, cfg ...RpcCommitmentWithMinSlotCfg) (res StakeActivation, err error)
- func (sc *Client) GetStakeMinimumDelegation(ctx context.Context, cfg ...RpcCommitmentCfg) (res U64ValueWithCtx, err error)
- func (sc *Client) GetSupply(ctx context.Context, cfg ...RpcSupplyCfg) (res SupplyWithCtx, err error)
- func (sc *Client) GetTokenAccountBalance(ctx context.Context, account PublicKey, cfg ...RpcCommitmentCfg) (res TokenAccountWithCtx, err error)
- func (sc *Client) GetTokenAccountsByDelegate(ctx context.Context, delegate PublicKey, mintProg RpcMintWithProgramID, ...) (res TokenAccountsWithCtx, err error)
- func (sc *Client) GetTokenAccountsByOwner(ctx context.Context, owner PublicKey, program RpcMintWithProgramID, ...) (res TokenAccountsWithCtx, err error)
- func (sc *Client) GetTokenLargestAccounts(ctx context.Context, splToken PublicKey, cfg ...RpcCommitmentCfg) (res TokenLargestHolders, err error)
- func (sc *Client) GetTokenSupply(ctx context.Context, splToken PublicKey, cfg ...RpcCommitmentCfg) (res TokenAccountWithCtx, err error)
- func (sc *Client) GetTransaction(ctx context.Context, signature Signature, cfg ...RpcGetTransactionCfg) (res TransactionInfo, err error)
- func (sc *Client) GetTransactionCount(ctx context.Context, cfg ...RpcCommitmentWithMinSlotCfg) (res uint64, err error)
- func (sc *Client) GetVersion(ctx context.Context) (res SolVersion, err error)
- func (sc *Client) GetVoteAccounts(ctx context.Context, cfg ...RpcVoteAccountCfg) (res RpcVoteAccounts, err error)
- func (sc *Client) IsBlockHashValid(ctx context.Context, hash Hash, cfg ...RpcCommitmentWithMinSlotCfg) (res bool, err error)
- func (sc *Client) MinimumLedgerSlot(ctx context.Context) (res uint64, err error)
- func (sc *Client) RequestAirdrop(ctx context.Context, address PublicKey, lamport *big.Int) (res Signature, err error)
- func (sc *Client) SendTransaction(ctx context.Context, signedTx Base58Data, cfg ...RpcSendTxCfg) (res Signature, err error)
- func (sc *Client) SetDebug(isDebug bool)
- func (sc *Client) SimulateTransaction(ctx context.Context, signedTx Base58Data) (res SimulateResult, err error)
- type ClusterInformation
- type CompiledInstruction
- type ContextSlot
- type DataSlice
- type EncodingEnum
- type EnumCirculateFilter
- type EnumRpcCommitment
- type EnumTxDetailLevel
- type EpochInformation
- type EpochSchedule
- type Hash
- func (h Hash) Base58() string
- func (h Hash) Bytes() []byte
- func (h Hash) Cmp(other Hash) int
- func (h Hash) ImplementsGraphQLType(name string) bool
- func (h Hash) MarshalJSON() ([]byte, error)
- func (h Hash) MarshalText() ([]byte, error)
- func (h *Hash) Scan(src interface{}) error
- func (h *Hash) SetBytes(b []byte)
- func (h Hash) String() string
- func (h *Hash) UnmarshalGraphQL(input interface{}) error
- func (h *Hash) UnmarshalJSON(input []byte) error
- func (h *Hash) UnmarshalText(input []byte) error
- func (h Hash) Value() (driver.Value, error)
- type HighestSnapshotSlot
- type Identity
- type InflationGovernor
- type InflationRate
- type InflationReward
- type InnerInstruction
- type Instruction
- type LastBlock
- type LastBlockWithCtx
- type LoadedAddresses
- type LogsNotifies
- type LogsValue
- type MentionsAccountProgramCfg
- type MentionsCfg
- type Message
- func (m *Message) AddAddressTableLookup(lookup MessageAddressTableLookup) *Message
- func (m Message) GetAddressTableLookupAccounts() ([]PublicKey, error)
- func (m *Message) GetAddressTables() map[PublicKey][]PublicKey
- func (m Message) GetAllKeys() (keys []PublicKey, err error)
- func (m Message) GetProgram(idIndex uint16) PublicKey
- func (m *Message) GetVersion() MessageVersion
- func (m *Message) IsSigner(account PublicKey) bool
- func (m Message) IsVersioned() bool
- func (m *Message) IsWritable(account PublicKey) bool
- func (m *Message) MarshalBinary() ([]byte, error)
- func (m *Message) MarshalLegacy() ([]byte, error)
- func (m *Message) MarshalV0() ([]byte, error)
- func (m *Message) SetAddressTableLookups(lookups []MessageAddressTableLookup) *Message
- func (m *Message) SetAddressTables(tables map[PublicKey][]PublicKey) error
- func (m *Message) Signers() []PublicKey
- func (m *Message) UnmarshalBase64(b64 string) error
- func (m *Message) UnmarshalLegacy(decoder *encodbin.Decoder) (err error)
- func (m *Message) UnmarshalV0(decoder *encodbin.Decoder) (err error)
- func (m *Message) UnmarshalWithDecoder(decoder *encodbin.Decoder) (err error)
- func (m *Message) Writable() (out []PublicKey)
- type MessageAddressTableLookup
- type MessageAddressTableLookupSlice
- type MessageHeader
- type MessageVersion
- type ProgramAccount
- type ProgramNotifies
- type PublicKey
- func (p PublicKey) Base58() string
- func (p PublicKey) Bytes() []byte
- func (p PublicKey) Cmp(other PublicKey) int
- func (p PublicKey) Equals(b PublicKey) bool
- func (p PublicKey) ImplementsGraphQLType(name string) bool
- func (p PublicKey) IsEmpty() bool
- func (p PublicKey) MarshalJSON() ([]byte, error)
- func (p PublicKey) MarshalText() ([]byte, error)
- func (p *PublicKey) Scan(src interface{}) error
- func (p *PublicKey) SetBytes(b []byte)
- func (p PublicKey) String() string
- func (p *PublicKey) UnmarshalGraphQL(input interface{}) error
- func (p *PublicKey) UnmarshalJSON(input []byte) error
- func (p *PublicKey) UnmarshalText(input []byte) error
- func (p PublicKey) Value() (driver.Value, error)
- type RawTransaction
- type RpcAccountInfoCfg
- type RpcCombinedCfg
- type RpcCommitmentCfg
- type RpcCommitmentWithEncodingCfg
- type RpcCommitmentWithFilter
- type RpcCommitmentWithIdentity
- type RpcCommitmentWithMinSlotCfg
- type RpcGetBlockContextCfg
- type RpcGetBlockProduction
- type RpcGetTransactionCfg
- type RpcMintWithProgramID
- type RpcPerfSample
- type RpcPrioritizationFee
- type RpcSearchTxHistoryCfg
- type RpcSendTxCfg
- type RpcSignaturesForAddressCfg
- type RpcSupplyCfg
- type RpcVoteAccountCfg
- type RpcVoteAccounts
- type Signature
- func (s Signature) Base58() string
- func (s Signature) Bytes() []byte
- func (s Signature) ImplementsGraphQLType(name string) bool
- func (s Signature) MarshalJSON() ([]byte, error)
- func (s Signature) MarshalText() ([]byte, error)
- func (s *Signature) Scan(src interface{}) error
- func (s *Signature) SetBytes(b []byte)
- func (s Signature) Sign(message []byte) []byte
- func (s Signature) String() string
- func (s *Signature) UnmarshalGraphQL(input interface{}) error
- func (s *Signature) UnmarshalJSON(input []byte) error
- func (s *Signature) UnmarshalText(input []byte) error
- func (s Signature) Value() (driver.Value, error)
- type SignatureInfo
- type SignatureNotifies
- type SignatureStatus
- type SignatureStatusWithCtx
- type SimulateResult
- type SimulateReturn
- type SimulationInfo
- type SlotNotifies
- type SlotRange
- type SolData
- func (sd SolData) Base58() string
- func (sd SolData) Base64() string
- func (sd SolData) Encoding() EncodingEnum
- func (sd SolData) MarshalJSON() ([]byte, error)
- func (sd SolData) MarshalText() ([]byte, error)
- func (sd SolData) MarshalWithEncoder(encoder *bin.Encoder) (err error)
- func (sd SolData) RawData() []byte
- func (sd *SolData) SetBytes(input []byte)
- func (sd *SolData) SetSolData(data []byte, encoding EncodingEnum)
- func (sd SolData) String() string
- func (sd *SolData) UnmarshalJSON(input []byte) error
- func (sd *SolData) UnmarshalText(input []byte) error
- func (sd *SolData) UnmarshalWithDecoder(decoder *bin.Decoder) (err error)
- func (sd SolData) Value() (driver.Value, error)
- type SolVersion
- type StakeActivation
- type Subscription
- type SupplyInfo
- type SupplyWithCtx
- type TokenAccount
- type TokenAccountWithCtx
- type TokenAccountsWithCtx
- type TokenBalance
- type TokenLargestHolders
- type Transaction
- func (tx *Transaction) MarshalBinary() ([]byte, error)
- func (tx *Transaction) NoSignedMarshalBinary() ([]byte, error)
- func (tx *Transaction) Sign(accounts []Account) ([]byte, error)
- func (tx Transaction) ToBase58() (string, error)
- func (tx Transaction) ToBase64() (string, error)
- func (tx *Transaction) UnmarshalBase58(b58 string) error
- func (tx *Transaction) UnmarshalBase64(b64 string) error
- func (tx *Transaction) UnmarshalJSON(input []byte) error
- func (tx *Transaction) UnmarshalWithDecoder(decoder *encodbin.Decoder) (err error)
- type TransactionInfo
- type TransactionMeta
- type TxStatus
- type TxVersion
- type U64ValueWithCtx
- type UiTokenAmount
- type Uint8Slice
- type VoteAccount
- type WsClient
- func (sc *WsClient) AccountSubscribe(ctx context.Context, ch chan<- AccountNotifies, account PublicKey, ...) (Subscription, error)
- func (sc *WsClient) BlockSubscribe(ctx context.Context, ch chan<- BlockNotifies, filter any, ...) (Subscription, error)
- func (sc *WsClient) LogsSubscribe(ctx context.Context, ch chan<- LogsNotifies, mentions any, ...) (Subscription, error)
- func (sc *WsClient) ProgramSubscribe(ctx context.Context, ch chan<- ProgramNotifies, address PublicKey, ...) (Subscription, error)
- func (sc *WsClient) SignatureSubscribe(ctx context.Context, ch chan<- SignatureNotifies, signature Signature, ...) (Subscription, error)
- func (sc *WsClient) SlotSubscribe(ctx context.Context, ch chan<- SlotNotifies) (Subscription, error)
Constants ¶
const ( // HashLength is the expected length of the hash HashLength = 32 // PublicKeyLength is the expected length of the PublicKey PublicKeyLength = 32 // SignatureLength is the expected length of the signature SignatureLength = 64 )
Lengths of signatures and PublicKeys in bytes.
Variables ¶
This section is empty.
Functions ¶
func GenerateBase58PrvKey ¶
GenerateBase58PrvKey return base58 private key
func GenerateHexPrvKey ¶
GenerateHexPrvKey return hex private key
Types ¶
type Account ¶
type Account struct {
PublicKey PublicKey
PrivateKey ed25519.PrivateKey
}
func AccountFromBase58Key ¶
AccountFromBase58Key generate an account by base58 private key
func AccountFromBytes ¶
AccountFromBytes generate an account by bytes
func AccountFromHexKey ¶
AccountFromHexKey generate an account by hex private key
func AccountFromKeygenFile ¶
AccountFromKeygenFile generate an account by keygen file
func AccountFromMnemonic ¶
AccountFromMnemonic generate an account by mnemonic @params [args]: password--> string @params [args]: path --> bool[true] (default: m/44'/501'/0'/0') @params [args]: path --> string (format: m/44'/501'/0'/0')
func AccountFromSeed ¶
AccountFromSeed generate an account by seed
func GenerateAccount ¶
GenerateAccount Random a new account from ed25519
type AccountInfo ¶
type AccountInfo struct {
// data associated with the account, either as encoded binary data or JSON format {<program>: <state>} - depending on encoding parameter
Data SolData `json:"data"`
// base-58 encoded Pubkey of the program this account has been assigned to
Owner PublicKey `json:"owner"`
// number of lamports assigned to this account, as an u64
Lamports *big.Int `json:"lamports"`
// the epoch at which this account will next owe rent, as u64
RentEpoch *big.Int `json:"rentEpoch"`
// boolean indicating if the account contains a program (and is strictly read-only)
Executable bool `json:"executable"`
// the data size of the account
Space uint64 `json:"space,omitempty"`
// the data size of the account
Size uint64 `json:"size,omitempty"`
}
type AccountInfoWithCtx ¶
type AccountInfoWithCtx struct {
Context ContextSlot `json:"context"`
AccountInfo *AccountInfo `json:"value,omitempty"`
}
type AccountMeta ¶
func Meta ¶
func Meta(pubKey PublicKey) *AccountMeta
Meta intializes a new AccountMeta with the provided pubKey.
func NewAccountMeta ¶
func NewAccountMeta(pubKey PublicKey, WRITE bool, SIGNER bool) *AccountMeta
func (*AccountMeta) Less ¶
func (meta *AccountMeta) Less(act *AccountMeta) bool
func (*AccountMeta) SIGNER ¶
func (meta *AccountMeta) SIGNER() *AccountMeta
SIGNER sets IsSigner to true.
func (*AccountMeta) WRITE ¶
func (meta *AccountMeta) WRITE() *AccountMeta
WRITE sets IsWritable to true.
type AccountMetaSlice ¶
type AccountMetaSlice []*AccountMeta
func (*AccountMetaSlice) Append ¶
func (slice *AccountMetaSlice) Append(account *AccountMeta)
func (AccountMetaSlice) Get ¶
func (slice AccountMetaSlice) Get(index int) *AccountMeta
Get returns the AccountMeta at the desired index. If the index is not present, it returns nil.
func (AccountMetaSlice) GetAccounts ¶
func (slice AccountMetaSlice) GetAccounts() (accounts []*AccountMeta)
func (AccountMetaSlice) GetKeys ¶
func (slice AccountMetaSlice) GetKeys() (keys []PublicKey)
GetKeys returns the pubkeys of all AccountMeta.
func (AccountMetaSlice) GetSigners ¶
func (slice AccountMetaSlice) GetSigners() []*AccountMeta
GetSigners returns the accounts that are signers.
func (AccountMetaSlice) Len ¶
func (slice AccountMetaSlice) Len() int
func (*AccountMetaSlice) SetAccounts ¶
func (slice *AccountMetaSlice) SetAccounts(accounts []*AccountMeta) error
type AccountNotifies ¶
type AccountNotifies AccountInfoWithCtx
type AccountWithLamport ¶
type AccountsGettable ¶
type AccountsGettable interface {
GetAccounts() (accounts []*AccountMeta)
}
type AccountsInfoWithCtx ¶
type AccountsInfoWithCtx struct {
Context ContextSlot `json:"context"`
Accounts []*AccountInfo `json:"value,omitempty"`
}
type AccountsSettable ¶
type AccountsSettable interface {
SetAccounts(accounts []*AccountMeta) error
}
type BalanceWithCtx ¶
type BalanceWithCtx struct {
Context ContextSlot `json:"context"`
Balance *big.Int `json:"value"`
}
type Base58Data ¶ added in v0.3.4
type Base58Data []byte
func (Base58Data) Base58 ¶ added in v0.3.4
func (t Base58Data) Base58() string
func (Base58Data) Hex ¶ added in v0.3.4
func (t Base58Data) Hex() string
func (Base58Data) MarshalJSON ¶ added in v0.3.4
func (t Base58Data) MarshalJSON() ([]byte, error)
func (Base58Data) String ¶ added in v0.3.4
func (t Base58Data) String() string
func (*Base58Data) UnmarshalJSON ¶ added in v0.3.4
func (t *Base58Data) UnmarshalJSON(data []byte) (err error)
type BlockCommitment ¶
type BlockCommitment struct {
// nil if Unknown block, or array of u64 integers
// logging the amount of cluster stake in lamports
// that has voted on the block at each depth from 0 to `MAX_LOCKOUT_HISTORY` + 1
Commitment []uint64 `json:"commitment"`
// Total active stake, in lamports, of the current epoch.
TotalStake uint64 `json:"totalStake"`
}
type BlockInfo ¶
type BlockInfo struct {
Err json.RawMessage `json:"err"`
BlockHeight uint64 `json:"blockHeight"`
BlockTime int64 `json:"blockTime"`
ParentSlot uint64 `json:"parentSlot"`
BlockHash Hash `json:"blockHash"`
PreviousBlockhash Hash `json:"previousBlockhash"`
Rewards []BlockReward `json:"rewards"`
Transactions []TransactionInfo `json:"transactions"`
}
type BlockNotifies ¶
type BlockNotifies struct {
Context ContextSlot `json:"context"`
BlockInfo BlockInfo `json:"value"`
}
type BlockProduction ¶
type BlockProductionWithCtx ¶
type BlockProductionWithCtx struct {
Context ContextSlot `json:"context"`
BlockProduction BlockProduction `json:"value"`
}
type BlockReward ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines typed wrappers for the solana RPC API.
func DialContext ¶
DialContext connects a client to the given URL with context.
func (*Client) GetAccountInfo ¶
func (sc *Client) GetAccountInfo(ctx context.Context, account PublicKey, cfg ...RpcAccountInfoCfg) (res AccountInfoWithCtx, err error)
GetAccountInfo Returns all information associated with the account of provided Pubkey
func (*Client) GetBalance ¶
func (sc *Client) GetBalance(ctx context.Context, account PublicKey, cfg ...RpcCommitmentWithMinSlotCfg) (balance BalanceWithCtx, err error)
GetBalance Returns the lamport balance of the account of provided Pubkey
func (*Client) GetBlock ¶
func (sc *Client) GetBlock(ctx context.Context, blockNum uint64, cfg ...RpcGetBlockContextCfg) (blockInfo BlockInfo, err error)
GetBlock Returns identity and transaction information about a confirmed block in the ledger
func (*Client) GetBlockCommitment ¶
func (sc *Client) GetBlockCommitment(ctx context.Context, blockNum uint64) (blockCmt BlockCommitment, err error)
GetBlockCommitment Returns commitment for particular block
func (*Client) GetBlockHeight ¶
func (sc *Client) GetBlockHeight(ctx context.Context, cfg ...RpcCommitmentWithMinSlotCfg) (res uint64, err error)
GetBlockHeight Returns the current block height of the node
func (*Client) GetBlockProduction ¶
func (sc *Client) GetBlockProduction(ctx context.Context, cfg ...RpcGetBlockProduction) (res BlockProductionWithCtx, err error)
GetBlockProduction Returns recent block production information from the current or previous epoch.
func (*Client) GetBlockTime ¶
GetBlockTime Returns the estimated production time of a block.
func (*Client) GetBlocks ¶
func (sc *Client) GetBlocks(ctx context.Context, startSlot uint64, args ...interface{}) (res []uint64, err error)
GetBlocks Returns a list of confirmed blocks between two slots
func (*Client) GetBlocksWithLimit ¶
func (sc *Client) GetBlocksWithLimit(ctx context.Context, startSlot, limit uint64, cfg ...RpcCommitmentCfg) (res []uint64, err error)
GetBlocksWithLimit Returns a list of confirmed blocks starting at the given slot
func (*Client) GetClusterNodes ¶
func (sc *Client) GetClusterNodes(ctx context.Context) (res []ClusterInformation, err error)
GetClusterNodes Returns information about all the nodes participating in the cluster
func (*Client) GetEpochInfo ¶
func (sc *Client) GetEpochInfo(ctx context.Context, cfg ...RpcCommitmentWithMinSlotCfg) (res EpochInformation, err error)
GetEpochInfo Returns information about the current epoch
func (*Client) GetEpochSchedule ¶
func (sc *Client) GetEpochSchedule(ctx context.Context) (res EpochSchedule, err error)
GetEpochSchedule Returns information about the current epoch
func (*Client) GetFeeForMessage ¶
func (sc *Client) GetFeeForMessage(ctx context.Context, msg string, cfg ...RpcCommitmentWithMinSlotCfg) (res U64ValueWithCtx, err error)
GetFeeForMessage Get the fee the network will charge for a particular Message
func (*Client) GetFirstAvailableBlock ¶
GetFirstAvailableBlock Returns the slot of the lowest confirmed block that has not been purged from the ledger
func (*Client) GetGenesisHash ¶
GetGenesisHash Returns the genesis hash
func (*Client) GetHealth ¶
GetHealth Returns the current health of the node. A healthy node is one that is within HEALTH_CHECK_SLOT_DISTANCE slots of the latest cluster confirmed slot.
func (*Client) GetHighestSnapshotSlot ¶
func (sc *Client) GetHighestSnapshotSlot(ctx context.Context) (res HighestSnapshotSlot, err error)
GetHighestSnapshotSlot Returns the highest slot information that the node has snapshots for. This will find the highest full snapshot slot, and the highest incremental snapshot slot based on the full snapshot slot, if there is one.
func (*Client) GetIdentity ¶
GetIdentity Returns the identity pubkey for the current node
func (*Client) GetInflationGovernor ¶
func (sc *Client) GetInflationGovernor(ctx context.Context, cfg ...RpcCommitmentCfg) (res InflationGovernor, err error)
GetInflationGovernor Returns the current inflation governor
func (*Client) GetInflationRate ¶
func (sc *Client) GetInflationRate(ctx context.Context) (res InflationRate, err error)
GetInflationRate Returns the specific inflation values for the current epoch
func (*Client) GetInflationReward ¶
func (sc *Client) GetInflationReward(ctx context.Context, args ...interface{}) (res []InflationReward, err error)
GetInflationReward Returns the inflation / staking reward for a list of PublicKeyes for an epoch
func (*Client) GetLargestAccounts ¶
func (sc *Client) GetLargestAccounts(ctx context.Context, cfg ...RpcCommitmentWithFilter) (res AccountWithLamport, err error)
GetLargestAccounts Returns the 20 largest accounts, by lamport balance (results may be cached up to two hours)
func (*Client) GetLatestBlockhash ¶
func (sc *Client) GetLatestBlockhash(ctx context.Context, cfg ...RpcCommitmentWithMinSlotCfg) (res LastBlockWithCtx, err error)
GetLatestBlockhash Returns the latest blockhash
func (*Client) GetLeaderSchedule ¶
func (sc *Client) GetLeaderSchedule(ctx context.Context, args ...interface{}) (res map[string][]uint64, err error)
GetLeaderSchedule Returns the leader schedule for an epoch --> args [slot:u64]
func (*Client) GetMaxRetransmitSlot ¶
GetMaxRetransmitSlot Get the max slot seen from retransmit stage.
func (*Client) GetMaxShredInsertSlot ¶
GetMaxShredInsertSlot Get the max slot seen from after shred insert.
func (*Client) GetMinimumBalanceForRentExemption ¶
func (sc *Client) GetMinimumBalanceForRentExemption(ctx context.Context, args ...interface{}) (res uint64, err error)
GetMinimumBalanceForRentExemption Returns minimum balance required to make account rent exempt.
func (*Client) GetMultipleAccounts ¶
func (sc *Client) GetMultipleAccounts(ctx context.Context, accounts []PublicKey, cfg ...RpcAccountInfoCfg) (res AccountsInfoWithCtx, err error)
GetMultipleAccounts Returns the account information for a list of Pubkeys.
func (*Client) GetProgramAccounts ¶
func (sc *Client) GetProgramAccounts(ctx context.Context, program PublicKey, cfg ...RpcCombinedCfg) (res []ProgramAccount, err error)
GetProgramAccounts Returns all accounts owned by the provided program Pubkey
func (*Client) GetRecentPerformanceSamples ¶
func (sc *Client) GetRecentPerformanceSamples(ctx context.Context, args ...uint64) (res []RpcPerfSample, err error)
GetRecentPerformanceSamples Returns a list of recent performance samples, in reverse slot order. Performance samples are taken every 60 seconds and include the number of transactions and slots that occur in a given time window.
func (*Client) GetRecentPrioritizationFees ¶
func (sc *Client) GetRecentPrioritizationFees(ctx context.Context, args ...interface{}) (res []RpcPrioritizationFee, err error)
GetRecentPrioritizationFees Returns a list of prioritization fees from recent blocks.
func (*Client) GetSignatureStatuses ¶
func (sc *Client) GetSignatureStatuses(ctx context.Context, signatures []Signature, cfg ...RpcSearchTxHistoryCfg) (res SignatureStatusWithCtx, err error)
GetSignatureStatuses Returns the statuses of a list of signatures. Each signature must be a txid, the first signature of a transaction.
func (*Client) GetSignaturesForAddress ¶ added in v0.3.2
func (sc *Client) GetSignaturesForAddress(ctx context.Context, account PublicKey, cfg ...RpcSignaturesForAddressCfg) (res []SignatureInfo, err error)
GetSignaturesForAddress Returns signatures for confirmed transactions that include the given PublicKey in their accountKeys list. Returns signatures backwards in time from the provided signature or most recent confirmed block
func (*Client) GetSlot ¶
func (sc *Client) GetSlot(ctx context.Context, cfg ...RpcCommitmentWithMinSlotCfg) (res uint64, err error)
GetSlot Returns the slot that has reached the given or default commitment level https://solana.com/docs/rpc#configuring-state-commitment
func (*Client) GetSlotLeader ¶
func (sc *Client) GetSlotLeader(ctx context.Context, cfg ...RpcCommitmentWithMinSlotCfg) (res PublicKey, err error)
GetSlotLeader Returns the current slot leader
func (*Client) GetSlotLeaders ¶
GetSlotLeaders Returns the slot leaders for a given slot range
func (*Client) GetStakeActivation ¶
func (sc *Client) GetStakeActivation(ctx context.Context, account PublicKey, cfg ...RpcCommitmentWithMinSlotCfg) (res StakeActivation, err error)
GetStakeActivation Returns epoch activation information for a stake account
func (*Client) GetStakeMinimumDelegation ¶
func (sc *Client) GetStakeMinimumDelegation(ctx context.Context, cfg ...RpcCommitmentCfg) (res U64ValueWithCtx, err error)
GetStakeMinimumDelegation Returns the stake minimum delegation, in lamports.
func (*Client) GetSupply ¶
func (sc *Client) GetSupply(ctx context.Context, cfg ...RpcSupplyCfg) (res SupplyWithCtx, err error)
GetSupply Returns information about the current supply.
func (*Client) GetTokenAccountBalance ¶
func (sc *Client) GetTokenAccountBalance(ctx context.Context, account PublicKey, cfg ...RpcCommitmentCfg) (res TokenAccountWithCtx, err error)
GetTokenAccountBalance Returns the token balance of an SPL Token account.
func (*Client) GetTokenAccountsByDelegate ¶
func (sc *Client) GetTokenAccountsByDelegate(ctx context.Context, delegate PublicKey, mintProg RpcMintWithProgramID, cfg ...RpcAccountInfoCfg) (res TokenAccountsWithCtx, err error)
GetTokenAccountsByDelegate Returns all SPL Token accounts by approved Delegate.
func (*Client) GetTokenAccountsByOwner ¶
func (sc *Client) GetTokenAccountsByOwner(ctx context.Context, owner PublicKey, program RpcMintWithProgramID, cfg ...RpcAccountInfoCfg) (res TokenAccountsWithCtx, err error)
GetTokenAccountsByOwner Returns all SPL Token accounts by token owner.
func (*Client) GetTokenLargestAccounts ¶
func (sc *Client) GetTokenLargestAccounts(ctx context.Context, splToken PublicKey, cfg ...RpcCommitmentCfg) (res TokenLargestHolders, err error)
GetTokenLargestAccounts Returns the 20 largest accounts of a particular SPL Token type.
func (*Client) GetTokenSupply ¶
func (sc *Client) GetTokenSupply(ctx context.Context, splToken PublicKey, cfg ...RpcCommitmentCfg) (res TokenAccountWithCtx, err error)
GetTokenSupply Returns the total supply of an SPL Token type.
func (*Client) GetTransaction ¶
func (sc *Client) GetTransaction(ctx context.Context, signature Signature, cfg ...RpcGetTransactionCfg) (res TransactionInfo, err error)
GetTransaction Returns transaction details for a confirmed transaction
func (*Client) GetTransactionCount ¶
func (sc *Client) GetTransactionCount(ctx context.Context, cfg ...RpcCommitmentWithMinSlotCfg) (res uint64, err error)
GetTransactionCount Returns the current Transaction count from the ledger
func (*Client) GetVersion ¶
func (sc *Client) GetVersion(ctx context.Context) (res SolVersion, err error)
GetVersion Returns the current Solana version running on the node
func (*Client) GetVoteAccounts ¶
func (sc *Client) GetVoteAccounts(ctx context.Context, cfg ...RpcVoteAccountCfg) (res RpcVoteAccounts, err error)
GetVoteAccounts Returns the account info and associated stake for all the voting accounts in the current bank.
func (*Client) IsBlockHashValid ¶
func (sc *Client) IsBlockHashValid(ctx context.Context, hash Hash, cfg ...RpcCommitmentWithMinSlotCfg) (res bool, err error)
IsBlockHashValid Returns whether a blockHash is still valid or not
func (*Client) MinimumLedgerSlot ¶
MinimumLedgerSlot Returns the lowest slot that the node has information about in its ledger.
func (*Client) RequestAirdrop ¶
func (sc *Client) RequestAirdrop(ctx context.Context, address PublicKey, lamport *big.Int) (res Signature, err error)
RequestAirdrop Requests an airdrop of lamports to a Pubkey
func (*Client) SendTransaction ¶
func (sc *Client) SendTransaction(ctx context.Context, signedTx Base58Data, cfg ...RpcSendTxCfg) (res Signature, err error)
SendTransaction Submits a signed transaction to the cluster for processing. This method does not alter the transaction in any way; it relays the transaction created by clients to the node as-is. If the node's rpc service receives the transaction, this method immediately succeeds, without waiting for any confirmations. A successful response from this method does not guarantee the transaction is processed or confirmed by the cluster. While the rpc service will reasonably retry to submit it, the transaction could be rejected if transaction's recent_blockhash expires before it lands. Use getSignatureStatuses to ensure a transaction is processed and confirmed. Before submitting, the following preflight checks are performed: The transaction signatures are verified The transaction is simulated against the bank slot specified by the preflight commitment. On failure an error will be returned. Preflight checks may be disabled if desired. It is recommended to specify the same commitment and preflight commitment to avoid confusing behavior. The returned signature is the first signature in the transaction, which is used to identify the transaction (transaction id). This identifier can be easily extracted from the transaction data before submission.
func (*Client) SimulateTransaction ¶
func (sc *Client) SimulateTransaction(ctx context.Context, signedTx Base58Data) (res SimulateResult, err error)
SimulateTransaction Simulate sending a transaction
type ClusterInformation ¶
type ClusterInformation struct {
// Node public key, as base-58 encoded string
PubKey PublicKey `json:"pubKey"`
// Gossip network address for the node
Gossip string `json:"gossip,omitempty"`
// TPU network address for the node
Tpu string `json:"tpu,omitempty"`
// JSON RPC network address for the node, or null if the JSON RPC service is not enabled
Rpc string `json:"rpc,omitempty"`
// The software version of the node, or null if the version information is not available
Version string `json:"version,omitempty"`
// The unique identifier of the node's feature set
FeatureSet *uint32 `json:"featureSet,omitempty"`
// The shred version the node has been configured to use
ShredVersion *uint16 `json:"shredVersion,omitempty"`
}
type CompiledInstruction ¶
type CompiledInstruction struct {
// StackHeight if empty
StackHeight *uint16 `json:"stackHeight"`
// Index into the message.accountKeys array indicating the program account that executes this instruction.
// NOTE: it is actually a uint8, but using a uint16 because uint8 is treated as a byte everywhere,
// and that can be an issue.
ProgramIDIndex uint16 `json:"programIdIndex"`
// List of ordered indices into the message.accountKeys array indicating which accounts to pass to the program.
// NOTE: it is actually a []uint8, but using a uint16 because []uint8 is treated as a []byte everywhere,
// and that can be an issue.
Accounts []uint16 `json:"accounts"`
// The program input data encoded in a base-58 string.
Data Base58Data `json:"data"`
}
type ContextSlot ¶
type EncodingEnum ¶ added in v0.3.4
type EncodingEnum string
const ( EncodingBase58 EncodingEnum = "base58" EncodingBase64 EncodingEnum = "base64" EncodingBase64Zstd EncodingEnum = "base64+zstd" EncodingJson EncodingEnum = "json" EncodingJsonParsed EncodingEnum = "jsonParsed" )
base58 base64 base64+zstd jsonParsed
type EnumCirculateFilter ¶
type EnumCirculateFilter string
const ( FilterCirculating EnumCirculateFilter = "circulating" FilterNonCirculating EnumCirculateFilter = "nonCirculating" )
filter results by account type
type EnumRpcCommitment ¶
type EnumRpcCommitment string
const ( // RpcCommitmentFinalized the node will query the most recent block confirmed // by supermajority of the cluster as having reached maximum lockout, // meaning the cluster has recognized this block as finalized RpcCommitmentFinalized EnumRpcCommitment = "finalized" // RpcCommitmentConfirmed the node will query the most recent block // that has been voted on by supermajority of the cluster. RpcCommitmentConfirmed EnumRpcCommitment = "confirmed" // RpcCommitmentProcessed the node will query its most recent block. // Note that the block may still be skipped by the cluster. RpcCommitmentProcessed EnumRpcCommitment = "processed" )
Rpc commitment context config
type EnumTxDetailLevel ¶
type EnumTxDetailLevel string
const ( TxDetailLevelNone EnumTxDetailLevel = "none" TxDetailLevelFull EnumTxDetailLevel = "full" TxDetailLevelAccounts EnumTxDetailLevel = "accounts" TxDetailLevelSignatures EnumTxDetailLevel = "signatures" )
level of transaction detail to return
type EpochInformation ¶
type EpochInformation struct {
// the current slot
AbsoluteSlot uint64 `json:"absoluteSlot"`
// the current block height
BlockHeight uint64 `json:"blockHeight"`
// the current epoch
Epoch uint64 `json:"epoch"`
// the current slot relative to the start of the current epoch
SlotIndex uint64 `json:"slotIndex"`
// the number of slots in this epoch
SlotsInEpoch uint64 `json:"slotsInEpoch"`
// total number of transactions processed without error since genesis
TransactionCount *uint64 `json:"transactionCount"`
}
type EpochSchedule ¶
type EpochSchedule struct {
// the maximum number of slots in each epoch
SlotsPerEpoch uint64 `json:"slotsPerEpoch"`
// the number of slots before beginning of an epoch to calculate a leader schedule for that epoch
LeaderScheduleSlotOffset uint64 `json:"leaderScheduleSlotOffset"`
// whether epochs start short and grow
Warmup bool `json:"warmup"`
// first normal-length epoch, log2(slotsPerEpoch) - log2(MINIMUM_SLOTS_PER_EPOCH)
FirstNormalEpoch uint64 `json:"firstNormalEpoch"`
// MINIMUM_SLOTS_PER_EPOCH * (2.pow(firstNormalEpoch) - 1)
FirstNormalSlot uint64 `json:"firstNormalSlot"`
}
type Hash ¶
type Hash [HashLength]byte
Hash The Hash
func Base58ToHash ¶
Base58ToHash returns Hash with byte values of b.
func StrToHash ¶
StrToHash returns Hash with byte values of b. Notice: only support base58/base64 str
func (Hash) ImplementsGraphQLType ¶
ImplementsGraphQLType returns true if Hash implements the specified GraphQL type.
func (Hash) MarshalJSON ¶ added in v0.3.4
func (Hash) MarshalText ¶
MarshalText returns base58 str hash
func (*Hash) UnmarshalGraphQL ¶
UnmarshalGraphQL unmarshals the provided GraphQL query data.
func (*Hash) UnmarshalJSON ¶
UnmarshalJSON parses a hash in base58 syntax.
func (*Hash) UnmarshalText ¶
UnmarshalText parses a hash in base58 syntax.
type HighestSnapshotSlot ¶
type InflationGovernor ¶
type InflationGovernor struct {
// the initial inflation percentage from time 0
Initial float64 `json:"initial"`
// terminal inflation percentage
Terminal float64 `json:"terminal"`
// rate per year at which inflation is lowered. (Rate reduction is derived using the target slot time in genesis config)
Taper float64 `json:"taper"`
// percentage of total inflation allocated to the foundation
Foundation float64 `json:"foundation"`
// duration of foundation pool inflation in years
FoundationTerm float64 `json:"foundationTerm"`
}
type InflationRate ¶
type InflationRate struct {
// total inflation
Total float64 `json:"total"`
// inflation allocated to validators
Validator float64 `json:"validator"`
// inflation allocated to the foundation
Foundation float64 `json:"foundation"`
// epoch for which these values are valid
Epoch uint64 `json:"epoch"`
}
type InflationReward ¶
type InflationReward struct {
// epoch for which reward occured
Epoch uint64 `json:"epoch"`
// the slot in which the rewards are effective
EffectiveSlot uint64 `json:"effectiveSlot"`
// reward amount in lamports
Amount uint64 `json:"amount"`
// post balance of the account in lamports
PostBalance uint64 `json:"postBalance"`
// vote account commission when the reward was credited
Commission *uint8 `json:"commission,omitempty"`
}
type InnerInstruction ¶
type InnerInstruction struct {
// Index of the transaction instruction from which the inner instruction(s) originated
Index uint16 `json:"index"`
// Ordered list of inner program instructions that were invoked during a single transaction instruction.
Instructions []CompiledInstruction `json:"instructions"`
}
type Instruction ¶
type Instruction interface {
ProgramID() PublicKey // the programID the instruction acts on
Accounts() []*AccountMeta // returns the list of accounts the instructions requires
Data() ([]byte, error) // the binary encoded instructions
}
type LastBlockWithCtx ¶
type LastBlockWithCtx struct {
Context ContextSlot `json:"context"`
LastBlock LastBlock `json:"value"`
}
type LoadedAddresses ¶
type LogsNotifies ¶
type LogsNotifies struct {
Context ContextSlot `json:"context"`
Value LogsValue `json:"value"`
}
type LogsValue ¶
type LogsValue struct {
Signature Signature `json:"signature"`
Err json.RawMessage `json:"err"`
Logs []string `json:"logs"`
}
type MentionsAccountProgramCfg ¶
type MentionsAccountProgramCfg struct {
MentionsAccountOrProgram PublicKey `json:"MentionsAccountOrProgram,omitempty"`
}
type MentionsCfg ¶
type MentionsCfg struct {
Mentions []PublicKey `json:"mentions,omitempty"`
}
type Message ¶
type Message struct {
// List of base-58 encoded public keys used by the transaction,
// including by the instructions and for signatures.
// The first `message.header.numRequiredSignatures` public keys must sign the transaction.
AccountKeys []PublicKey `json:"accountKeys"`
// Details the account types and signatures required by the transaction.
Header MessageHeader `json:"header"`
// A base-58 encoded hash of a recent block in the ledger used to
// prevent transaction duplication and to give transactions lifetimes.
RecentBlockhash Hash `json:"recentBlockhash"`
// List of program instructions that will be executed in sequence
// and committed in one atomic transaction if all succeed.
Instructions []CompiledInstruction `json:"instructions"`
// List of address table lookups used to load additional accounts for this transaction.
AddressTableLookups MessageAddressTableLookupSlice `json:"addressTableLookups"`
// contains filtered or unexported fields
}
func (*Message) AddAddressTableLookup ¶ added in v0.3.4
func (m *Message) AddAddressTableLookup(lookup MessageAddressTableLookup) *Message
AddAddressTableLookup adds a new lookup to the message.
func (Message) GetAddressTableLookupAccounts ¶ added in v0.3.6
GetAddressTableLookupAccounts associates the lookups with the accounts in the actual address tables, and returns the accounts. NOTE: you need to call `SetAddressTables` before calling this method, so that the lookups can be associated with the accounts in the address tables.
func (*Message) GetAddressTables ¶ added in v0.3.4
GetAddressTables returns the actual address tables used by this message. NOTE: you must have called `SetAddressTable` before being able to use this method.
func (Message) GetAllKeys ¶ added in v0.3.6
GetAllKeys returns ALL the message's account keys (including the keys from resolved address lookup tables).
func (Message) GetProgram ¶
GetProgram current program address
func (*Message) GetVersion ¶ added in v0.3.4
func (m *Message) GetVersion() MessageVersion
GetVersion returns the message version.
func (Message) IsVersioned ¶ added in v0.3.6
func (*Message) IsWritable ¶
func (*Message) MarshalBinary ¶
func (*Message) MarshalLegacy ¶ added in v0.3.4
func (*Message) SetAddressTableLookups ¶ added in v0.3.4
func (m *Message) SetAddressTableLookups(lookups []MessageAddressTableLookup) *Message
SetAddressTableLookups (re)sets the lookups used by this message.
func (*Message) SetAddressTables ¶ added in v0.3.4
SetAddressTables sets the actual address tables used by this message. Use `mx.GetAddressTableLookups().GetTableIDs()` to get the list of all address table IDs. NOTE: you can call this once.
func (*Message) UnmarshalBase64 ¶
func (*Message) UnmarshalLegacy ¶
func (*Message) UnmarshalWithDecoder ¶
type MessageAddressTableLookup ¶
type MessageAddressTableLookup struct {
AccountKey PublicKey `json:"accountKey"` // The account key of the address table.
WritableIndexes Uint8Slice `json:"writableIndexes"`
ReadonlyIndexes Uint8Slice `json:"readonlyIndexes"`
}
type MessageAddressTableLookupSlice ¶
type MessageAddressTableLookupSlice []MessageAddressTableLookup
func (MessageAddressTableLookupSlice) GetTableIDs ¶
func (lookups MessageAddressTableLookupSlice) GetTableIDs() []PublicKey
GetTableIDs returns the list of all address table IDs.
func (MessageAddressTableLookupSlice) NumLookups ¶
func (lookups MessageAddressTableLookupSlice) NumLookups() int
NumLookups returns the number of accounts in all the MessageAddressTableLookupSlice
func (MessageAddressTableLookupSlice) NumWritableLookups ¶ added in v0.3.4
func (lookups MessageAddressTableLookupSlice) NumWritableLookups() int
NumWritableLookups returns the number of writable accounts across all the lookups (all the address tables).
type MessageHeader ¶
type MessageHeader struct {
// The total number of signatures required to make the transaction valid.
// The signatures must match the first `numRequiredSignatures` of `message.account_keys`.
NumRequiredSignatures uint8 `json:"numRequiredSignatures"`
// The last numReadonlySignedAccounts of the signed keys are read-only accounts.
// Programs may process multiple transactions that load read-only accounts within
// a single PoH entry, but are not permitted to credit or debit lamports or modify
// account data.
// Transactions targeting the same read-write account are evaluated sequentially.
NumReadonlySignedAccounts uint8 `json:"numReadonlySignedAccounts"`
// The last `numReadonlyUnsignedAccounts` of the unsigned keys are read-only accounts.
NumReadonlyUnsignedAccounts uint8 `json:"numReadonlyUnsignedAccounts"`
}
type MessageVersion ¶
type MessageVersion int
const ( MessageVersionLegacy MessageVersion = 0 // default MessageVersionV0 MessageVersion = 1 // v0 )
type ProgramAccount ¶
type ProgramAccount struct {
Account AccountInfo `json:"account"`
PubKey PublicKey `json:"pubKey"`
}
ProgramAccount program account
type ProgramNotifies ¶
type ProgramNotifies struct {
Context ContextSlot `json:"context"`
Value TokenAccount `json:"value"`
}
type PublicKey ¶
type PublicKey [PublicKeyLength]byte
PublicKey The PublicKey
func Base58ToPublicKey ¶
Base58ToPublicKey returns PublicKey with byte values of b.
func BytesToPublicKey ¶
BytesToPublicKey returns PublicKey with value b.
func StrToPublicKey ¶
StrToPublicKey returns PublicKey with byte values of b. Notice: only support base58/base64 str
func (PublicKey) ImplementsGraphQLType ¶
ImplementsGraphQLType returns true if Hash implements the specified GraphQL type.
func (PublicKey) MarshalJSON ¶ added in v0.3.4
func (PublicKey) MarshalText ¶
MarshalText returns base58 str account
func (*PublicKey) UnmarshalGraphQL ¶
UnmarshalGraphQL unmarshals the provided GraphQL query data.
func (*PublicKey) UnmarshalJSON ¶
UnmarshalJSON parses an account in base58 syntax.
func (*PublicKey) UnmarshalText ¶
UnmarshalText parses an account in base58 syntax.
type RawTransaction ¶
type RawTransaction struct {
// contains filtered or unexported fields
}
func NewRawTransaction ¶
func NewRawTransaction(blockHash Hash, payer string, inst []Instruction, signers []string) *RawTransaction
type RpcAccountInfoCfg ¶
type RpcAccountInfoCfg struct {
Encoding EncodingEnum `json:"encoding,omitempty"`
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
MinContextSlot *uint64 `json:"minContextSlot,omitempty"`
DataSlice *DataSlice `json:"dataSlice,omitempty"`
}
RpcAccountInfoCfg Get multiple data
type RpcCombinedCfg ¶
type RpcCombinedCfg struct {
WithContext bool `json:"withContext,omitempty"`
Encoding EncodingEnum `json:"encoding,omitempty"`
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
MinContextSlot *uint64 `json:"minContextSlot,omitempty"`
DataSlice *DataSlice `json:"dataSlice,omitempty"`
Filter []map[string]interface{} `json:"filter,omitempty"`
}
type RpcCommitmentCfg ¶
type RpcCommitmentCfg struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
}
RpcCommitmentCfg rpc config of commitment
type RpcCommitmentWithEncodingCfg ¶
type RpcCommitmentWithEncodingCfg struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
Encoding EncodingEnum `json:"encoding,omitempty"`
}
RpcCommitmentWithEncodingCfg rpc config of commitment
type RpcCommitmentWithFilter ¶
type RpcCommitmentWithFilter struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
Filter EnumCirculateFilter `json:"filter,omitempty"`
}
RpcCommitmentWithFilter commitment with filter
type RpcCommitmentWithIdentity ¶
type RpcCommitmentWithIdentity struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
Identity *PublicKey `json:"identity,omitempty"`
}
type RpcCommitmentWithMinSlotCfg ¶
type RpcCommitmentWithMinSlotCfg struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
MinContextSlot *uint64 `json:"minContextSlot,omitempty"`
}
RpcCommitmentWithMinSlotCfg commitment & min slot
type RpcGetBlockContextCfg ¶
type RpcGetBlockContextCfg struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
Encoding EncodingEnum `json:"encoding,omitempty"`
TransactionDetails EnumTxDetailLevel `json:"transactionDetails,omitempty"`
MaxSupportedTxVersion uint8 `json:"maxSupportedTransactionVersion"`
Rewards *bool `json:"rewards,omitempty"`
}
RpcGetBlockContextCfg commitment & min slot
type RpcGetBlockProduction ¶
type RpcGetBlockProduction struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
Identity *PublicKey `json:"identity,omitempty"`
Range SlotRange `json:"range,omitempty"`
}
RpcGetBlockProduction getBlock production
type RpcGetTransactionCfg ¶
type RpcGetTransactionCfg struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
Encoding EncodingEnum `json:"encoding,omitempty"`
// MaxSupportedTransactionVersion Set the max transaction version to return in responses.
// If the requested transaction is a higher version, an error will be returned.
// If this parameter is omitted, only legacy transactions will be returned, and any versioned transaction will prompt the error.
MaxSupportedTxVersion uint8 `json:"maxSupportedTransactionVersion,omitempty"`
}
RpcGetTransactionCfg commitment & min slot
type RpcMintWithProgramID ¶
type RpcPerfSample ¶
type RpcPerfSample struct {
// Slot in which sample was taken at
Slot uint64 `json:"slot"`
// Number of transactions processed during the sample period
NumTransactions uint64 `json:"numTransactions"`
// Number of slots completed during the sample period
NumSlots uint64 `json:"numSlots"`
// Number of seconds in a sample window
SamplePeriodSecs uint16 `json:"samplePeriodSecs"`
// Number of non-vote transactions processed during the sample period.
NumNonVoteTransaction uint64 `json:"numNonVoteTransaction"`
}
type RpcPrioritizationFee ¶
type RpcSearchTxHistoryCfg ¶
type RpcSearchTxHistoryCfg struct {
// if true - a Solana node will search its ledger cache for any signatures not found in the recent status cache
SearchTxHistory bool `json:"searchTransactionHistory,omitempty"`
}
type RpcSendTxCfg ¶
type RpcSendTxCfg struct {
// Encoding used for the transaction data.
// Default: base58
// Values: base58 (slow, DEPRECATED), or base64.
Encoding EncodingEnum `json:"encoding,omitempty"`
// Default: false
// when true, skip the preflight transaction checks
SkipPreflight bool `json:"skipPreflight,omitempty"`
// Default: finalized
// Commitment level to use for preflight.
PreflightCommitment string `json:"preflightCommitment,omitempty"`
// Maximum number of times for the RPC node to retry sending the transaction to the leader.
// If this parameter not provided, the RPC node will retry the transaction until it is finalized or until the blockhash expires.
MaxRetries *uint64 `json:"maxRetries,omitempty"`
// set the minimum slot at which to perform preflight transaction checks
MinContextSlot *uint64 `json:"minContextSlot,omitempty"`
}
RpcSendTxCfg struct
type RpcSignaturesForAddressCfg ¶
type RpcSignaturesForAddressCfg struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
MinContextSlot *uint64 `json:"minContextSlot,omitempty"`
// Limit: maximum transaction signatures to return (between 1 and 1,000).
Limit *uint `json:"limit,omitempty"`
// start searching backwards from this transaction signature.
// If not provided the search starts from the top of the highest max confirmed block.
Before string `json:"before,omitempty"`
// search until this transaction signature, if found before limit reached
Util string `json:"util,omitempty"`
}
type RpcSupplyCfg ¶
type RpcSupplyCfg struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
// exclude non circulating accounts list from response
ExcludeNonCirculatingAccountsList *bool `json:"excludeNonCirculatingAccountsList,omitempty"`
}
type RpcVoteAccountCfg ¶
type RpcVoteAccountCfg struct {
// commitment
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
// Only return results for this validator vote address (base-58 encoded)
VotePubkey *PublicKey `json:"votePubkey,omitempty"` // optional
// Do not filter out delinquent validators with no stake
KeepUnstakedDelinquents *bool `json:"keepUnstakedDelinquents,omitempty"` // optional
// Specify the number of slots behind the tip that a validator must fall to be considered delinquent. NOTE: For the sake of consistency between ecosystem products, it is not recommended that this argument be specified.
DelinquentSlotDistance *uint64 `json:"delinquentSlotDistance,omitempty"` // optional
}
type RpcVoteAccounts ¶
type RpcVoteAccounts struct {
Current []VoteAccount `json:"current"`
Delinquent []VoteAccount `json:"delinquent"`
}
type Signature ¶
type Signature [SignatureLength]byte
Signature The signature
func Base58ToSignature ¶
Base58ToSignature returns Signature with byte values of b.
func BytesToSignature ¶
BytesToSignature returns Signature with value b.
func StrToSignature ¶
StrToSignature returns Signature with byte values of b. Notice: only support base58/base64 str
func (Signature) ImplementsGraphQLType ¶
ImplementsGraphQLType returns true if Hash implements the specified GraphQL type.
func (Signature) MarshalJSON ¶ added in v0.3.4
func (Signature) MarshalText ¶
MarshalText returns base58 str account
func (*Signature) UnmarshalGraphQL ¶
UnmarshalGraphQL unmarshals the provided GraphQL query dats.
func (*Signature) UnmarshalJSON ¶
UnmarshalJSON parses an account in base58 syntax.
func (*Signature) UnmarshalText ¶
UnmarshalText parses an account in base58 syntax.
type SignatureInfo ¶
type SignatureInfo struct {
// transaction signature as base-58 encoded string
Signature Signature `json:"signature,omitempty"`
// The slot that contains the block with the transaction
Slot uint64 `json:"slot"`
// Error if transaction failed, null if transaction succeeded. See TransactionError definitions for more info.
Err json.RawMessage `json:"err"`
// Memo associated with the transaction, null if no memo is present
Memo string `json:"memo,omitempty"`
// estimated production time, as Unix timestamp (seconds since the Unix epoch) of when transaction was processed. null if not available.
BlockTime int64 `json:"blockTime,omitempty"`
// The transaction's cluster confirmation status; Either processed, confirmed, or finalized.
ConfirmationStatus string `json:"confirmationStatus,omitempty"`
}
type SignatureNotifies ¶
type SignatureNotifies struct {
Context ContextSlot `json:"context"`
Value interface{} `json:"value"`
}
type SignatureStatus ¶
type SignatureStatus struct {
// The slot that contains the block with the transaction
Slot uint64 `json:"slot"`
// Error if transaction failed, null if transaction succeeded. See TransactionError definitions for more info.
Err json.RawMessage `json:"err"`
// estimated production time, as Unix timestamp (seconds since the Unix epoch) of when transaction was processed. null if not available.
Confirmations *uint64 `json:"confirmations,omitempty"`
// The transaction's cluster confirmation status; Either processed, confirmed, or finalized.
ConfirmationStatus string `json:"confirmationStatus,omitempty"`
}
type SignatureStatusWithCtx ¶
type SignatureStatusWithCtx struct {
Context ContextSlot `json:"context"`
SignatureStatus []SignatureStatus `json:"value,omitempty"`
}
type SimulateResult ¶ added in v0.3.3
type SimulateResult struct {
Context ContextSlot `json:"context"`
Value SimulationInfo `json:"value"`
}
type SimulateReturn ¶ added in v0.3.3
type SimulationInfo ¶ added in v0.3.3
type SimulationInfo struct {
Accounts []AccountInfo `json:"accounts"`
// Error if transaction failed, null if transaction succeeded.
// https://github.com/solana-labs/solana/blob/master/sdk/src/transaction.rs#L24
Err json.RawMessage `json:"err"`
// Fee this transaction was charged
Fee uint64 `json:"fee"`
// Array of *big.Int account balances from before the transaction was processed
PreBalances []*big.Int `json:"preBalances"`
// Array of *big.Int account balances after the transaction was processed
PostBalances []*big.Int `json:"postBalances"`
// List of inner instructions or omitted if inner instruction recording
// was not yet enabled during this transaction
InnerInstructions []InnerInstruction `json:"innerInstructions"`
// List of token balances from before the transaction was processed
// or omitted if token balance recording was not yet enabled during this transaction
PreTokenBalances []TokenBalance `json:"preTokenBalances"`
// List of token balances from after the transaction was processed
// or omitted if token balance recording was not yet enabled during this transaction
PostTokenBalances []TokenBalance `json:"postTokenBalances"`
LoadedAccountsDataSize *uint32 `json:"loadedAccountsDataSize"`
LoadedAddresses LoadedAddresses `json:"loadedAddresses"`
// Array of string log messages or omitted if log message
// recording was not yet enabled during this transaction
Logs []string `json:"logs"`
ReplacementBlockhash *LastBlock `json:"replacementBlockhash"`
ReturnData *SimulateReturn `json:"returnData"`
UnitsConsumed *uint64 `json:"unitsConsumed"`
}
type SlotNotifies ¶
type SlotRange ¶
type SlotRange struct {
FirstSlot uint64 `json:"firstSlot,omitempty"`
LastSlot uint64 `json:"lastSlot,omitempty"`
}
SlotRange the first slot --> lastSlot
type SolData ¶
type SolData struct {
// contains filtered or unexported fields
}
SolData base58, base64 data
func (SolData) Encoding ¶
func (sd SolData) Encoding() EncodingEnum
func (SolData) MarshalJSON ¶ added in v0.3.4
func (SolData) MarshalText ¶
MarshalText returns base58/base64 str
func (SolData) MarshalWithEncoder ¶ added in v0.3.4
func (*SolData) SetSolData ¶
func (sd *SolData) SetSolData(data []byte, encoding EncodingEnum)
SetSolData sets the SolData
func (*SolData) UnmarshalJSON ¶
UnmarshalJSON parses data in base58 syntax.
func (*SolData) UnmarshalText ¶
UnmarshalText parses data in base58 syntax.
func (*SolData) UnmarshalWithDecoder ¶ added in v0.3.4
type SolVersion ¶
type StakeActivation ¶
type Subscription ¶
type Subscription interface {
// Unsubscribe cancels the sending of events to the data channel
// and closes the error channel.
Unsubscribe()
// Err returns the subscription error channel. The error channel receives
// a value if there is an issue with the subscription (e.g. the network connection
// delivering the events has been closed). Only one value will ever be sent.
// The error channel is closed by Unsubscribe.
Err() <-chan error
}
Subscription represents an event subscription where events are delivered on a data channel.
type SupplyInfo ¶
type SupplyInfo struct {
// Total supply in lamports
Total uint64 `json:"total"`
// Circulating supply in lamports
Circulating uint64 `json:"circulating"`
// Non-circulating supply in lamports
NonCirculating uint64 `json:"nonCirculating"`
// an array of account addresses of non-circulating accounts, as strings. If excludeNonCirculatingAccountsList is enabled, the returned array will be empty.
NonCirculatingAccounts []PublicKey `json:"nonCirculatingAccounts"`
}
type SupplyWithCtx ¶
type SupplyWithCtx struct {
Context ContextSlot `json:"context"`
Supply SupplyInfo `json:"value"`
}
type TokenAccount ¶
type TokenAccount struct {
Account AccountInfo `json:"account"`
Pubkey PublicKey `json:"pubkey,omitempty"`
}
type TokenAccountWithCtx ¶
type TokenAccountWithCtx struct {
Context ContextSlot `json:"context"`
UiToken UiTokenAmount `json:"value"`
}
type TokenAccountsWithCtx ¶
type TokenAccountsWithCtx struct {
Context ContextSlot `json:"context"`
Accounts []TokenAccount `json:"value"`
}
type TokenBalance ¶
type TokenBalance struct {
// Index of the account in which the token balance is provided for.
AccountIndex uint16 `json:"accountIndex"`
// Pubkey of the token's mint.
Mint PublicKey `json:"mint"`
// Pubkey of token balance's owner.
Owner PublicKey `json:"owner"`
// ProgramId
ProgramId string `json:"programId"`
UiTokenAmount UiTokenAmount `json:"uiTokenAmount"`
}
type TokenLargestHolders ¶
type TokenLargestHolders struct {
Context ContextSlot `json:"context"`
Holders []UiTokenAmount `json:"value"`
}
type Transaction ¶
type Transaction struct {
// A list of base-58 encoded signatures applied to the transaction.
// The list is always of length `message.header.numRequiredSignatures` and not empty.
// The signature at index `i` corresponds to the public key at index
// `i` in `message.account_keys`. The first one is used as the transaction id.
Signatures []Signature `json:"signatures"`
// Defines the content of the transaction.
Message Message `json:"message"`
}
func NewTransaction ¶
func NewTransaction(instructions []Instruction, recentBlockHash Hash, payer PublicKey) (*Transaction, error)
func (*Transaction) MarshalBinary ¶
func (tx *Transaction) MarshalBinary() ([]byte, error)
func (*Transaction) NoSignedMarshalBinary ¶
func (tx *Transaction) NoSignedMarshalBinary() ([]byte, error)
func (*Transaction) Sign ¶
func (tx *Transaction) Sign(accounts []Account) ([]byte, error)
Sign accounts
func (Transaction) ToBase58 ¶
func (tx Transaction) ToBase58() (string, error)
func (Transaction) ToBase64 ¶
func (tx Transaction) ToBase64() (string, error)
func (*Transaction) UnmarshalBase58 ¶
func (tx *Transaction) UnmarshalBase58(b58 string) error
UnmarshalBase58 decodes a base58 encoded transaction.
func (*Transaction) UnmarshalBase64 ¶
func (tx *Transaction) UnmarshalBase64(b64 string) error
UnmarshalBase64 decodes a base64 encoded transaction.
func (*Transaction) UnmarshalJSON ¶
func (tx *Transaction) UnmarshalJSON(input []byte) error
UnmarshalJSON parses the transaction Content
func (*Transaction) UnmarshalWithDecoder ¶
func (tx *Transaction) UnmarshalWithDecoder(decoder *encodbin.Decoder) (err error)
type TransactionInfo ¶
type TransactionInfo struct {
// Transaction status metadata object
Meta *TransactionMeta `json:"meta"`
// The slot this transaction was processed in.
Slot uint64 `json:"slot"`
// Estimated production time, as Unix timestamp (seconds since the Unix epoch)
// of when the transaction was processed.
// Nil if not available.
BlockTime *int64 `json:"blockTime" bin:"optional"`
// Transaction
Transaction *Transaction `json:"transaction"`
// Version Of Transaction
Version TxVersion `json:"version"`
}
type TransactionMeta ¶
type TransactionMeta struct {
// TODO if has zero ComputeUnitsConsumed
ComputeUnitsConsumed *uint64 `json:"computeUnitsConsumed"`
// Error if transaction failed, null if transaction succeeded.
// https://github.com/solana-labs/solana/blob/master/sdk/src/transaction.rs#L24
Err json.RawMessage `json:"err"`
// Fee this transaction was charged
Fee uint64 `json:"fee"`
// Array of *big.Int account balances from before the transaction was processed
PreBalances []*big.Int `json:"preBalances"`
// Array of *big.Int account balances after the transaction was processed
PostBalances []*big.Int `json:"postBalances"`
// List of inner instructions or omitted if inner instruction recording
// was not yet enabled during this transaction
InnerInstructions []InnerInstruction `json:"innerInstructions"`
// List of token balances from before the transaction was processed
// or omitted if token balance recording was not yet enabled during this transaction
PreTokenBalances []TokenBalance `json:"preTokenBalances"`
// List of token balances from after the transaction was processed
// or omitted if token balance recording was not yet enabled during this transaction
PostTokenBalances []TokenBalance `json:"postTokenBalances"`
// Array of string log messages or omitted if log message
// recording was not yet enabled during this transaction
LogMessages []string `json:"logMessages"`
// Transaction status.
Status TxStatus `json:"status"`
Rewards []BlockReward `json:"rewards"`
LoadedAddresses LoadedAddresses `json:"loadedAddresses"`
}
type TxStatus ¶
type TxStatus struct {
Ok interface{} `json:"Ok"`
Err json.RawMessage `json:"Err"`
}
type TxVersion ¶
type TxVersion int
const (
LegacyTransactionVersion TxVersion = -1
)
func (TxVersion) MarshalJSON ¶
func (*TxVersion) UnmarshalJSON ¶
type U64ValueWithCtx ¶
type U64ValueWithCtx struct {
Context ContextSlot `json:"context"`
Value *uint64 `json:"value,omitempty"`
}
type UiTokenAmount ¶
type UiTokenAmount struct {
// Address account
Address *PublicKey `json:"address,omitempty"`
// Raw amount of tokens as a string, ignoring decimals.
Amount string `json:"amount"`
// Number of decimals configured for token's mint.
Decimals uint8 `json:"decimals"`
// Token amount as a float, accounting for decimals.
UiAmount float64 `json:"uiAmount"`
// Token amount as a string, accounting for decimals.
UiAmountString string `json:"uiAmountString"`
}
type Uint8Slice ¶ added in v0.3.6
type Uint8Slice []uint8
Uint8Slice is a slice of uint8s that can be marshaled as numbers instead of a byte slice.
func (Uint8Slice) MarshalJSON ¶ added in v0.3.6
func (u8s Uint8Slice) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type VoteAccount ¶
type VoteAccount struct {
// Vote account address, as base-58 encoded string
VotePubkey PublicKey `json:"votePubkey"`
// Validator identity, as base-58 encoded string
NodePubkey PublicKey `json:"nodePubkey"`
// the stake, in lamports, delegated to this vote account and active in this epoch
ActivatedStake uint64 `json:"activatedStake"`
// bool, whether the vote account is staked for this epoch
EpochVoteAccount bool `json:"epochVoteAccount"`
// percentage (0-100) of rewards payout owed to the vote account
Commission uint8 `json:"commission"`
// Most recent slot voted on by this vote account
LastVote uint64 `json:"lastVote"`
// Latest history of earned credits for up to five epochs, as an array of arrays containing: [epoch, credits, previousCredits].
EpochCredits [][]uint64 `json:"epochCredits"`
// Current root slot for this vote
RootSlot uint64 `json:"rootSlot"`
}
type WsClient ¶ added in v0.3.1
type WsClient struct {
// contains filtered or unexported fields
}
WsClient defines typed wrappers for the Solana RPC Subscribe.
func DialWsContext ¶ added in v0.3.1
DialWsContext connects a client to the given URL with context.
func NewWsClient ¶ added in v0.3.1
NewWsClient creates a client that uses the given RPC client.
func (*WsClient) AccountSubscribe ¶ added in v0.3.1
func (sc *WsClient) AccountSubscribe(ctx context.Context, ch chan<- AccountNotifies, account PublicKey, cfg ...RpcCommitmentWithEncodingCfg) (Subscription, error)
AccountSubscribe Subscribe to an account to receive notifications when the lamports or data for a given account public key changes
func (*WsClient) BlockSubscribe ¶ added in v0.3.1
func (sc *WsClient) BlockSubscribe(ctx context.Context, ch chan<- BlockNotifies, filter any, cfg ...RpcGetBlockContextCfg) (Subscription, error)
BlockSubscribe Subscribe to receive notification anytime a new block is confirmed or finalized. filter can receive: string | types.MentionsAccountProgramCfg
func (*WsClient) LogsSubscribe ¶ added in v0.3.1
func (sc *WsClient) LogsSubscribe(ctx context.Context, ch chan<- LogsNotifies, mentions any, cfg ...RpcCommitmentCfg) (Subscription, error)
LogsSubscribe Subscribe to transaction logging mentions can receive: string | types.MentionsCfg
func (*WsClient) ProgramSubscribe ¶ added in v0.3.1
func (sc *WsClient) ProgramSubscribe(ctx context.Context, ch chan<- ProgramNotifies, address PublicKey, cfg ...RpcCommitmentCfg) (Subscription, error)
ProgramSubscribe to a program to receive notifications when the lamports or data for an account owned by the given program changes
func (*WsClient) SignatureSubscribe ¶ added in v0.3.1
func (sc *WsClient) SignatureSubscribe(ctx context.Context, ch chan<- SignatureNotifies, signature Signature, cfg ...RpcCommitmentCfg) (Subscription, error)
SignatureSubscribe Subscribe to receive a notification when the transaction with the given signature reaches the specified commitment level.
func (*WsClient) SlotSubscribe ¶ added in v0.3.1
func (sc *WsClient) SlotSubscribe(ctx context.Context, ch chan<- SlotNotifies) (Subscription, error)
SlotSubscribe Subscribe to receive notification anytime a slot is processed by the validator