Documentation
¶
Index ¶
- Constants
- type AccountInfoPayload
- type GetAccountInfoConfig
- type GetAccountInfoDataSlice
- type GetAccountInfoResp
- type GetAccountInfoRespContext
- type GetAccountInfoRespValue
- type GetEpochInfoResp
- type GetLatestBlockhashResp
- type GetLatestBlockhashRespContext
- type GetLatestBlockhashRespValue
- type InnerInstruction
- type InnerInstructionGroup
- type InvalidParamsError
- type LoadedAddressesPayload
- type MinContextSlotNotReachedError
- type ReplacementBlockhashPayload
- type ReturnDataPayload
- type RpcServer
- func (rpcServer *RpcServer) GetAccountInfo(ctx context.Context, p jsonrpc.RawParams) (GetAccountInfoResp, error)
- func (rpcServer *RpcServer) GetBankHash(ctx context.Context, p jsonrpc.RawParams) (string, error)
- func (rpcServer *RpcServer) GetBlockHeight(ctx context.Context, p jsonrpc.RawParams) (uint64, error)
- func (rpcServer *RpcServer) GetEpochInfo(ctx context.Context, p jsonrpc.RawParams) (GetEpochInfoResp, error)
- func (rpcServer *RpcServer) GetLatestBlockhash(ctx context.Context, p jsonrpc.RawParams) (GetLatestBlockhashResp, error)
- func (rpcServer *RpcServer) SendTransaction(ctx context.Context, p jsonrpc.RawParams) (string, error)
- func (rpcServer *RpcServer) SetSlotCtx(slotCtx *sealevel.SlotCtx)
- func (rpcServer *RpcServer) SimulateTransaction(ctx context.Context, p jsonrpc.RawParams) (SimulateTransactionResp, error)
- func (rpcServer *RpcServer) Start()
- type SendTransactionPreflightFailureError
- type SimulateTransactionResp
- type SimulateTransactionRespContext
- type SimulateTransactionRespValue
- type TokenBalancePayload
- type UiTokenAmountPayload
Constants ¶
const ( GetAccountEncodingBase58 = iota GetAccountEncodingBase64 GetAccountEncodingBase64Zstd GetAccountEncodingJson )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountInfoPayload ¶
type GetAccountInfoConfig ¶
type GetAccountInfoConfig struct {
Commitment string
EncodingType *int
DataSlice *GetAccountInfoDataSlice
MinContextSlot uint64
}
type GetAccountInfoDataSlice ¶
type GetAccountInfoResp ¶
type GetAccountInfoResp struct {
Context GetAccountInfoRespContext `json:"context"`
Value *GetAccountInfoRespValue `json:"value"`
}
type GetAccountInfoRespValue ¶
type GetEpochInfoResp ¶
type GetLatestBlockhashResp ¶
type GetLatestBlockhashResp struct {
Context GetLatestBlockhashRespContext `json:"context"`
Value *GetLatestBlockhashRespValue `json:"value"`
}
type GetLatestBlockhashRespContext ¶
type GetLatestBlockhashRespContext struct {
Slot uint64 `json:"slot"`
}
type InnerInstruction ¶
type InnerInstruction struct {
ProgramIdIndex uint8 `json:"programIdIndex"`
Accounts []uint8 `json:"accounts"`
Data string `json:"data"`
StackHeight *uint32 `json:"stackHeight"`
}
InnerInstruction matches Agave's UiCompiledInstruction. `Data` is base58-encoded; `StackHeight` is nil when not tracked. `StackHeight` is `Option<u32>` in Agave's wire format; using *uint32 here so the field's JSON-number range matches the spec exactly even though real-world CPI depth never exceeds the 4-deep cap.
type InnerInstructionGroup ¶
type InnerInstructionGroup struct {
Index uint8 `json:"index"`
Instructions []InnerInstruction `json:"instructions"`
}
type InvalidParamsError ¶
type InvalidParamsError struct {
Message string
}
func (*InvalidParamsError) Error ¶
func (e *InvalidParamsError) Error() string
func (*InvalidParamsError) FromJSONRPCError ¶
func (e *InvalidParamsError) FromJSONRPCError(rpcErr jsonrpc.JSONRPCError) error
func (*InvalidParamsError) ToJSONRPCError ¶
func (e *InvalidParamsError) ToJSONRPCError() (jsonrpc.JSONRPCError, error)
type LoadedAddressesPayload ¶
type MinContextSlotNotReachedError ¶
type MinContextSlotNotReachedError struct {
ContextSlot uint64
}
func (*MinContextSlotNotReachedError) Error ¶
func (e *MinContextSlotNotReachedError) Error() string
func (*MinContextSlotNotReachedError) FromJSONRPCError ¶
func (e *MinContextSlotNotReachedError) FromJSONRPCError(rpcErr jsonrpc.JSONRPCError) error
func (*MinContextSlotNotReachedError) ToJSONRPCError ¶
func (e *MinContextSlotNotReachedError) ToJSONRPCError() (jsonrpc.JSONRPCError, error)
type ReturnDataPayload ¶
type RpcServer ¶
type RpcServer struct {
// contains filtered or unexported fields
}
func NewRpcServer ¶
func NewRpcServer(acctsDb *accountsdb.AccountsDb, port uint16) *RpcServer
func (*RpcServer) GetAccountInfo ¶
func (*RpcServer) GetBankHash ¶
func (*RpcServer) GetBlockHeight ¶
func (*RpcServer) GetEpochInfo ¶
func (*RpcServer) GetLatestBlockhash ¶
func (*RpcServer) SendTransaction ¶
func (*RpcServer) SetSlotCtx ¶
func (*RpcServer) SimulateTransaction ¶
type SendTransactionPreflightFailureError ¶
type SendTransactionPreflightFailureError struct {
Message string
Result SimulateTransactionRespValue
}
func (*SendTransactionPreflightFailureError) Error ¶
func (e *SendTransactionPreflightFailureError) Error() string
func (*SendTransactionPreflightFailureError) FromJSONRPCError ¶
func (e *SendTransactionPreflightFailureError) FromJSONRPCError(rpcErr jsonrpc.JSONRPCError) error
func (*SendTransactionPreflightFailureError) ToJSONRPCError ¶
func (e *SendTransactionPreflightFailureError) ToJSONRPCError() (jsonrpc.JSONRPCError, error)
type SimulateTransactionResp ¶
type SimulateTransactionResp struct {
Context SimulateTransactionRespContext `json:"context"`
Value SimulateTransactionRespValue `json:"value"`
}
type SimulateTransactionRespValue ¶
type SimulateTransactionRespValue struct {
Err interface{} `json:"err"`
Logs *[]string `json:"logs"`
Accounts *[]*AccountInfoPayload `json:"accounts"`
UnitsConsumed *uint64 `json:"unitsConsumed"`
ReturnData *ReturnDataPayload `json:"returnData"`
InnerInstructions *[]InnerInstructionGroup `json:"innerInstructions"`
ReplacementBlockhash *ReplacementBlockhashPayload `json:"replacementBlockhash"`
LoadedAccountsDataSize *uint32 `json:"loadedAccountsDataSize"`
Fee *uint64 `json:"fee"`
PreBalances *[]uint64 `json:"preBalances"`
PostBalances *[]uint64 `json:"postBalances"`
PreTokenBalances *[]TokenBalancePayload `json:"preTokenBalances"`
PostTokenBalances *[]TokenBalancePayload `json:"postTokenBalances"`
LoadedAddresses *LoadedAddressesPayload `json:"loadedAddresses"`
}
SimulateTransactionRespValue mirrors Agave's RpcSimulateTransactionResult field-for-field. Every field is emitted unconditionally as either a real value or null; no omitempty. Pointer types model Agave's Option<T> so nil → JSON null and a populated value → the value.
`Err` is intentionally left as interface{}: it is a true sum type (nil | string | *replay.TransactionError), and *replay.TransactionError carries a custom MarshalJSON. Wrapping it in a concrete struct would only force a custom MarshalJSON without adding type safety.
type TokenBalancePayload ¶
type TokenBalancePayload struct {
AccountIndex uint8 `json:"accountIndex"`
Mint string `json:"mint"`
Owner string `json:"owner,omitempty"`
ProgramId string `json:"programId,omitempty"`
UiTokenAmount UiTokenAmountPayload `json:"uiTokenAmount"`
}