solana

package
v0.0.0-...-07d62d3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	// Number of lamports assigned to this account
	Lamports uint64 `json:"lamports"`

	// Pubkey of the program this account has been assigned to
	Owner string `json:"owner"`

	// Data associated with the account, hardstuck in its binary form
	Data []string `json:"data"`

	// Boolean indicating if the account contains a program (and is strictly read-only)
	Executable bool `json:"executable"`

	// The epoch at which this account will next owe rent
	RentEpoch uint64 `json:"rentEpoch"`
}

func (Account) GetBinary

func (account Account) GetBinary() ([]byte, error)

GetBinary by decoding the second item in the data field for the account

type Block

type Block struct {
	Blockhash    string              `json:"blockhash"`
	Transactions []TransactionResult `json:"transactions"`
}

type BufferedTransaction

type BufferedTransaction struct {
	Slot         uint64        `json:"slot"`
	Transactions []Transaction `json:"transactions"`

	// LogsCount of the number of logs previously sent in the buffered logs
	LogsCount            int    `json:"logs_count"`
	SecondsSinceLastSlot uint64 `json:"seconds_since_last_slot"`
}

BufferedTransactions that were seen together in the same slot

type BufferedTransactionLog

type BufferedTransactionLog struct {
	Slot                 uint64           `json:"slot"`
	Logs                 []TransactionLog `json:"logs"`
	SecondsSinceLastSlot uint64           `json:"seconds_since_last_slot"`
}

BufferedTransactionsLogs created by microservice-solana-buffer-logs, including the slot (block number) that could be useful for calculating the number of fluid transfers in a block

type BufferedUserActions

type BufferedUserActions struct {
	Slot                 uint64                    `json:"slot"`
	UserActions          []user_actions.UserAction `json:"user_actions"`
	LogCount             int                       `json:"logs_count"`
	SecondsSinceLastSlot uint64                    `json:"seconds_since_last_slot"`
}

type RpcError

type RpcError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type Slot

type Slot struct {
	Slot uint64 `json:"slot"`
}

Slot is the type that logs the current slot as sent by the solana RPC

type SubscriptionError

type SubscriptionError struct {
	Message string `json:"message"`
}

type SubscriptionResponse

type SubscriptionResponse struct {
	Result int               `json:"result"`
	Id     int               `json:"id"`
	Error  SubscriptionError `json:"error"`
}

SubscriptionResponse is the confirmation or rejection of a subscription on the Solana websocket

type Transaction

type Transaction struct {
	Result      TransactionResult `json:"result"`
	AdjustedFee *big.Rat          `json:"adjusted_fee"`
}

Transaction is part of the transaction info type returned from the Solana RPC call

type TransactionAddressTableLookups

type TransactionAddressTableLookups struct {
	AccountKey      string `json:"accountKey"`
	ReadonlyIndexes []int  `json:"readonlyIndexes"`
	WritableIndexes []int  `json:"writableIndexes"`
}

type TransactionInnerInstruction

type TransactionInnerInstruction struct {
	Index        int                      `json:"index"`
	Instructions []TransactionInstruction `json:"instructions"`
}

type TransactionInnerTxn

type TransactionInnerTxn struct {
	Message    TransactionMessage `json:"message"`
	Signatures []string           `json:"signatures"`
}

type TransactionInstruction

type TransactionInstruction struct {
	Accounts       []int  `json:"accounts"`
	Data           string `json:"data"`
	ProgramIdIndex int    `json:"programIdIndex"`
}

type TransactionLog

type TransactionLog struct {
	Params params `json:"params"`
}

TransactionLog is a simplified version of the transaction log type returned from Solana websocket subscriptions

type TransactionMessage

type TransactionMessage struct {
	AccountKeys  []string                 `json:"accountKeys"`
	Instructions []TransactionInstruction `json:"instructions"`
	// only present in v0
	AddressTableLookups []TransactionAddressTableLookups `json:"addressTableLookups"`
}

type TransactionMeta

type TransactionMeta struct {
	// TODO solana doesn't doccument what this type actually is
	Err               interface{}                   `json:"err"`
	Fee               uint64                        `json:"fee"`
	PreTokenBalances  []TransactionTokenBalance     `json:"preTokenBalances"`
	PostTokenBalances []TransactionTokenBalance     `json:"postTokenBalances"`
	InnerInstructions []TransactionInnerInstruction `json:"innerInstructions"`
	Logs              []string                      `json:"logMessages"`
}

type TransactionResult

type TransactionResult struct {
	// "legacy" or 0 or sometimes unset
	Version     json.RawMessage     `json:"version"`
	Meta        TransactionMeta     `json:"meta"`
	Slot        int                 `json:"slot"`
	Transaction TransactionInnerTxn `json:"transaction"`
}

type TransactionTokenAmount

type TransactionTokenAmount struct {
	Amount         string `json:"amount"`
	Decimals       int    `json:"decimals"`
	UiAmountString string `json:"uiAmountString"`
}

type TransactionTokenBalance

type TransactionTokenBalance struct {
	AccountIndex  int                    `json:"accountIndex"`
	Mint          string                 `json:"mint"`
	Owner         string                 `json:"owner"`
	UiTokenAmount TransactionTokenAmount `json:"uiTokenAmount"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL