Versions in this module Expand all Collapse all v0 v0.2.0 Dec 1, 2025 v0.1.0 Nov 28, 2025 Changes in this version + const MaxTransactionSize + const PollRate + var CommitmentConfirmed = Commitment + var CommitmentFinalized = Commitment + var CommitmentProcessed = Commitment + var ErrBlockNotAvailable = errors.New("block not available") + var ErrIncorrectInstruction = errors.New("incorrect instruction") + var ErrIncorrectProgram = errors.New("incorrect program") + var ErrInvalidPublicKey = errors.New("invalid public key") + var ErrMaxSeedLengthExceeded = errors.New("max seed length exceeded") + var ErrNoAccountInfo = errors.New("no account info") + var ErrNoBalance = errors.New("no balance") + var ErrSignatureNotFound = errors.New("signature not found") + var ErrStaleData = errors.New("rpc data is stale") + var ErrTooManySeeds = errors.New("too many seeds") + func CreateProgramAddress(program ed25519.PublicKey, seeds ...[]byte) (ed25519.PublicKey, error) + func FindProgramAddress(program ed25519.PublicKey, seeds ...[]byte) (ed25519.PublicKey, error) + func FindProgramAddressAndBump(program ed25519.PublicKey, seeds ...[]byte) (ed25519.PublicKey, uint8, error) + type AccountInfo struct + Data []byte + Executable bool + Lamports uint64 + Owner ed25519.PublicKey + type AccountMeta struct + IsSigner bool + IsWritable bool + PublicKey ed25519.PublicKey + func NewAccountMeta(pub ed25519.PublicKey, isSigner bool) AccountMeta + func NewReadonlyAccountMeta(pub ed25519.PublicKey, isSigner bool) AccountMeta + type AddressLookupTable struct + Addresses []ed25519.PublicKey + PublicKey ed25519.PublicKey + type Block struct + BlockTime *time.Time + Hash []byte + ParentSlot uint64 + PrevHash []byte + Slot uint64 + Transactions []BlockTransaction + type BlockTransaction struct + Err *TransactionError + Meta *TransactionMeta + Transaction Transaction + type Blockhash [sha256.Size]byte + type Client interface + GetAccountDataAfterBlock func(ed25519.PublicKey, uint64) ([]byte, uint64, error) + GetAccountInfo func(ed25519.PublicKey, Commitment) (AccountInfo, error) + GetBalance func(ed25519.PublicKey) (uint64, error) + GetBlock func(slot uint64) (*Block, error) + GetBlockSignatures func(slot uint64) ([]string, error) + GetBlockTime func(block uint64) (time.Time, error) + GetConfirmationStatus func(Signature, Commitment) (bool, error) + GetConfirmedBlock func(slot uint64) (*Block, error) + GetConfirmedBlocksWithLimit func(start, limit uint64) ([]uint64, error) + GetFilteredProgramAccounts func(program ed25519.PublicKey, offset uint, filterValue []byte) ([]string, uint64, error) + GetLatestBlockhash func() (Blockhash, error) + GetMinimumBalanceForRentExemption func(size uint64) (lamports uint64, err error) + GetSignatureStatus func(Signature, Commitment) (*SignatureStatus, error) + GetSignatureStatuses func([]Signature) ([]*SignatureStatus, error) + GetSignaturesForAddress func(owner ed25519.PublicKey, commitment Commitment, limit uint64, ...) ([]*TransactionSignature, error) + GetSlot func(Commitment) (uint64, error) + GetTokenAccountBalance func(ed25519.PublicKey) (uint64, uint64, error) + GetTokenAccountsByOwner func(owner, mint ed25519.PublicKey) ([]ed25519.PublicKey, error) + GetTransaction func(Signature, Commitment) (ConfirmedTransaction, error) + GetTransactionTokenBalances func(Signature) (TransactionTokenBalances, error) + SubmitTransaction func(Transaction, Commitment) (Signature, error) + func New(endpoint string) Client + func NewWithRPCOptions(endpoint string, opts *jsonrpc.RPCClientOpts) Client + type Commitment struct + Commitment string + type CompiledInstruction struct + Accounts []byte + Data []byte + ProgramIndex byte + type ConfirmedTransaction struct + BlockTime *time.Time + Err *TransactionError + Meta *TransactionMeta + Slot uint64 + Transaction Transaction + type CustomError int + func (c CustomError) Error() string + type Environment string + const EnvironmentDev + const EnvironmentProd + const EnvironmentTest + type Header struct + NumReadOnly byte + NumReadonlySigned byte + NumSignatures byte + type Instruction struct + Accounts []AccountMeta + Data []byte + Program ed25519.PublicKey + func NewInstruction(program ed25519.PublicKey, data []byte, accounts ...AccountMeta) Instruction + type InstructionError struct + Err error + Index int + func (i InstructionError) CustomError() *CustomError + func (i InstructionError) Error() string + func (i InstructionError) ErrorKey() InstructionErrorKey + func (i InstructionError) JSONString() string + type InstructionErrorKey string + const InstructionErrorAccountAlreadyInitialized + const InstructionErrorAccountBorrowFailed + const InstructionErrorAccountBorrowOutstanding + const InstructionErrorAccountDataSizeChanged + const InstructionErrorAccountDataTooSmall + const InstructionErrorAccountNotExecutable + const InstructionErrorCallDepth + const InstructionErrorCustom + const InstructionErrorDuplicateAccountIndex + const InstructionErrorDuplicateAccountOutOfSync + const InstructionErrorExecutableAccountNotRentExempt + const InstructionErrorExecutableDataModified + const InstructionErrorExecutableLamportChange + const InstructionErrorExecutableModified + const InstructionErrorExternalAccountDataModified + const InstructionErrorExternalAccountLamportSpend + const InstructionErrorGenericError + const InstructionErrorIncorrectProgramID + const InstructionErrorInsufficientFunds + const InstructionErrorInvalidAccountData + const InstructionErrorInvalidArgument + const InstructionErrorInvalidError + const InstructionErrorInvalidInstructionData + const InstructionErrorInvalidRealloc + const InstructionErrorInvalidSeeds + const InstructionErrorMaxSeedLengthExceeded + const InstructionErrorMissingAccount + const InstructionErrorMissingRequiredSignature + const InstructionErrorModifiedProgramID + const InstructionErrorNotEnoughAccountKeys + const InstructionErrorReadonlyDataModified + const InstructionErrorReadonlyLamportChange + const InstructionErrorReentrancyNotAllowed + const InstructionErrorRentEpochModified + const InstructionErrorUnbalancedInstruction + const InstructionErrorUninitializedAccount + const InstructionErrorUnsupportedProgramID + type LoadedAddresses struct + Readonly []string + Writable []string + type Message struct + Accounts []ed25519.PublicKey + AddressTableLookups []MessageAddressTableLookup + Header Header + Instructions []CompiledInstruction + RecentBlockhash Blockhash + Version MessageVersion + func (m *Message) Unmarshal(b []byte) (err error) + func (m Message) Marshal() []byte + type MessageAddressTableLookup struct + PublicKey ed25519.PublicKey + ReadonlyIndexes []byte + WritableIndexes []byte + type MessageVersion uint8 + const MessageVersion0 + const MessageVersionLegacy + func (v MessageVersion) String() string + type Signature [ed25519.SignatureSize]byte + type SignatureStatus struct + ConfirmationStatus string + Confirmations *int + ErrorResult *TransactionError + Slot uint64 + func (s SignatureStatus) Confirmed() bool + func (s SignatureStatus) Finalized() bool + type SortableAccountMeta []AccountMeta + func (s SortableAccountMeta) Len() int + func (s SortableAccountMeta) Less(i int, j int) bool + func (s SortableAccountMeta) Swap(i int, j int) + type SortableAddressLookupTables []AddressLookupTable + func (s SortableAddressLookupTables) Len() int + func (s SortableAddressLookupTables) Less(i int, j int) bool + func (s SortableAddressLookupTables) Swap(i int, j int) + type TokenAmount struct + Amount string + Decimals uint64 + type TokenBalance struct + AccountIndex uint64 + Mint string + TokenAmount TokenAmount + type Transaction struct + Message Message + Signatures []Signature + func NewLegacyTransaction(payer ed25519.PublicKey, instructions ...Instruction) Transaction + func NewV0Transaction(payer ed25519.PublicKey, addressLookupTables []AddressLookupTable, ...) Transaction + func (t *Transaction) SetBlockhash(bh Blockhash) + func (t *Transaction) Sign(signers ...ed25519.PrivateKey) error + func (t *Transaction) Signature() []byte + func (t *Transaction) String() string + func (t *Transaction) Unmarshal(b []byte) error + func (t Transaction) Marshal() []byte + type TransactionError struct + func NewTransactionError(key TransactionErrorKey) *TransactionError + func ParseRPCError(err *jsonrpc.RPCError) (*TransactionError, error) + func ParseTransactionError(raw interface{}) (*TransactionError, error) + func TransactionErrorFromInstructionError(err *InstructionError) (*TransactionError, error) + func (t TransactionError) Error() string + func (t TransactionError) ErrorKey() TransactionErrorKey + func (t TransactionError) InstructionError() *InstructionError + func (t TransactionError) JSONString() (string, error) + type TransactionErrorKey string + const TransactionErrorAccountBorrowOutstanding + const TransactionErrorAccountInUse + const TransactionErrorAccountLoadedTwice + const TransactionErrorAccountNotFound + const TransactionErrorBlockhashNotFound + const TransactionErrorCallChainTooDeep + const TransactionErrorClusterMaintenance + const TransactionErrorDuplicateSignature + const TransactionErrorInstructionError + const TransactionErrorInsufficientFundsForFee + const TransactionErrorInternal + const TransactionErrorInvalidAccountForFee + const TransactionErrorInvalidAccountIndex + const TransactionErrorInvalidProgramForExecution + const TransactionErrorInvalidWritableAccount + const TransactionErrorMissingSignatureForFee + const TransactionErrorProgramAccountNotFound + const TransactionErrorSanitizeFailure + const TransactionErrorSignatureFailure + const TransactionErrorUnsupportedVersion + const TransactionErrorWouldExceedMaxBlockCostLimit + type TransactionMeta struct + Err interface{} + Fee uint64 + LoadedAddresses LoadedAddresses + PostBalances []uint64 + PostTokenBalances []TokenBalance + PreBalances []uint64 + PreTokenBalances []TokenBalance + type TransactionSignature struct + BlockTime *time.Time + Err *TransactionError + Memo *string + Signature Signature + Slot uint64 + func (s TransactionSignature) ToBase58() string + type TransactionTokenBalances struct + Accounts []string + BlockTime *time.Time + PostTokenBalances []TokenBalance + PreTokenBalances []TokenBalance + Slot uint64