api

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SafeBlockNumber      = rpc.BlockNumber(-4)
	FinalizedBlockNumber = rpc.BlockNumber(-3)
	PendingBlockNumber   = rpc.BlockNumber(-2)
	LatestBlockNumber    = rpc.BlockNumber(-1)
	EarliestBlockNumber  = rpc.BlockNumber(0)
)

Variables

This section is empty.

Functions

func LoadIndexHints added in v1.2.3

func LoadIndexHints(db *sql.DB) error

Types

type BlockAPI

type BlockAPI struct {
	// contains filtered or unexported fields
}

func NewBlockAPI

func NewBlockAPI(db *sql.DB, network uint64, pl *plugins.PluginLoader, cfg *config.Config) *BlockAPI

func (*BlockAPI) BlockNumber

func (api *BlockAPI) BlockNumber(ctx context.Context) hexutil.Uint64

func (*BlockAPI) ChainId

func (api *BlockAPI) ChainId(ctx context.Context) hexutil.Uint64

func (*BlockAPI) GetBlockByHash

func (api *BlockAPI) GetBlockByHash(ctx context.Context, blockHash types.Hash, includeTxns bool) (*map[string]interface{}, error)

func (*BlockAPI) GetBlockByNumber

func (api *BlockAPI) GetBlockByNumber(ctx context.Context, blockNumber rpc.BlockNumber, includeTxns bool) (*map[string]interface{}, error)

func (*BlockAPI) GetBlockReceipts added in v1.7.0

func (api *BlockAPI) GetBlockReceipts(ctx context.Context, input BlockNumberOrHash) ([]map[string]interface{}, error)

func (*BlockAPI) GetBlockTransactionCountByHash

func (api *BlockAPI) GetBlockTransactionCountByHash(ctx context.Context, blockHash types.Hash) (*hexutil.Uint64, error)

func (*BlockAPI) GetBlockTransactionCountByNumber

func (api *BlockAPI) GetBlockTransactionCountByNumber(ctx context.Context, blockNumber rpc.BlockNumber) (*hexutil.Uint64, error)

func (*BlockAPI) GetUncleCountByBlockHash

func (api *BlockAPI) GetUncleCountByBlockHash(ctx context.Context, blockHash types.Hash) (*hexutil.Uint64, error)

func (*BlockAPI) GetUncleCountByBlockNumber

func (api *BlockAPI) GetUncleCountByBlockNumber(ctx context.Context, blockNumber rpc.BlockNumber) (*hexutil.Uint64, error)

type BlockNumberOrHash added in v1.7.0

type BlockNumberOrHash struct {
	BlockNumber      *rpc.BlockNumber `json:"blockNumber,omitempty"`
	BlockHash        *types.Hash      `json:"blockHash,omitempty"`
	RequireCanonical bool             `json:"requireCanonical,omitempty"`
}

func BlockNumberOrHashWithHash added in v1.7.0

func BlockNumberOrHashWithHash(hash types.Hash, canonical bool) BlockNumberOrHash

func BlockNumberOrHashWithNumber added in v1.7.0

func BlockNumberOrHashWithNumber(blockNr rpc.BlockNumber) BlockNumberOrHash

func (*BlockNumberOrHash) Hash added in v1.7.0

func (bnh *BlockNumberOrHash) Hash() (types.Hash, bool)

func (*BlockNumberOrHash) Number added in v1.7.0

func (bnh *BlockNumberOrHash) Number() (rpc.BlockNumber, bool)

func (*BlockNumberOrHash) String added in v1.7.0

func (bnh *BlockNumberOrHash) String() string

func (*BlockNumberOrHash) UnmarshalJSON added in v1.7.0

func (bnh *BlockNumberOrHash) UnmarshalJSON(data []byte) error

type DecimalOrHex

type DecimalOrHex uint64

func (*DecimalOrHex) UnmarshalJSON added in v1.0.1

func (dh *DecimalOrHex) UnmarshalJSON(data []byte) error

type FilterQuery

type FilterQuery struct {
	BlockHash *types.Hash      // used by eth_getLogs, return logs only from block with this hash
	FromBlock *rpc.BlockNumber // beginning of the queried range, nil means latest block, oldest block in query
	ToBlock   *rpc.BlockNumber // end of the range, nil means latest block, newest block in query
	Addresses []common.Address // restricts matches to events created by specific contracts

	// The Topic list restricts matches to particular event topics. Each event has a list
	// of topics. Topics matches a prefix of that list. An empty element slice matches any
	// topic. Non-empty elements represent an alternative that matches any of the
	// contained topics.
	//
	// Examples:
	// {} or nil          matches any topic list
	// {{A}}              matches topic A in first position
	// {{}, {B}}          matches any topic in first position AND B in second position
	// {{A}, {B}}         matches topic A in first position AND B in second position
	// {{A, B}, {C, D}}   matches topic (A OR B) in first position AND (C OR D) in second position
	Topics [][]types.Hash
}

func (FilterQuery) MarshalJSON added in v1.0.4

func (args FilterQuery) MarshalJSON() ([]byte, error)

func (*FilterQuery) UnmarshalJSON

func (args *FilterQuery) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *args fields with given data.

type FlumeAPI

type FlumeAPI struct {
	// contains filtered or unexported fields
}

func NewFlumeAPI

func NewFlumeAPI(db *sql.DB, network uint64, pl *plugins.PluginLoader, cfg *config.Config, mempool bool) *FlumeAPI

func (*FlumeAPI) AddressWithPrefix added in v1.6.0

func (api *FlumeAPI) AddressWithPrefix(ctx *rpc.CallContext, partialHexString string) ([]string, error)

func (*FlumeAPI) BlockHashesWithPrefix added in v1.6.0

func (api *FlumeAPI) BlockHashesWithPrefix(ctx *rpc.CallContext, partialHexString string) ([]string, error)

func (*FlumeAPI) ClientVersion added in v1.2.1

func (api *FlumeAPI) ClientVersion(ctx context.Context) string

func (*FlumeAPI) GetBlockByTransactionHash added in v1.5.0

func (api *FlumeAPI) GetBlockByTransactionHash(ctx context.Context, txHash types.Hash) (*map[string]interface{}, error)

func (*FlumeAPI) GetTransactionReceiptsByBlockHash

func (api *FlumeAPI) GetTransactionReceiptsByBlockHash(ctx context.Context, blockHash types.Hash) ([]map[string]interface{}, error)

func (*FlumeAPI) GetTransactionReceiptsByBlockNumber

func (api *FlumeAPI) GetTransactionReceiptsByBlockNumber(ctx context.Context, blockNumber rpc.BlockNumber) ([]map[string]interface{}, error)

func (*FlumeAPI) GetTransactionReceiptsByParticipant

func (api *FlumeAPI) GetTransactionReceiptsByParticipant(ctx *rpc.CallContext, address common.Address, offset *int) (*paginator[map[string]interface{}], error)

func (*FlumeAPI) GetTransactionReceiptsByRecipient

func (api *FlumeAPI) GetTransactionReceiptsByRecipient(ctx *rpc.CallContext, address common.Address, offset *int) (*paginator[map[string]interface{}], error)

func (*FlumeAPI) GetTransactionReceiptsBySender

func (api *FlumeAPI) GetTransactionReceiptsBySender(ctx *rpc.CallContext, address common.Address, offset *int) (*paginator[map[string]interface{}], error)

func (*FlumeAPI) GetTransactionsByParticipant

func (api *FlumeAPI) GetTransactionsByParticipant(ctx *rpc.CallContext, address common.Address, offset *int) (*paginator[map[string]interface{}], error)

func (*FlumeAPI) GetTransactionsByRecipient

func (api *FlumeAPI) GetTransactionsByRecipient(ctx *rpc.CallContext, address common.Address, offset *int) (*paginator[map[string]interface{}], error)

func (*FlumeAPI) GetTransactionsBySender

func (api *FlumeAPI) GetTransactionsBySender(ctx *rpc.CallContext, address common.Address, offset *int) (*paginator[map[string]interface{}], error)

func (*FlumeAPI) HeavyClientVersion added in v1.2.1

func (api *FlumeAPI) HeavyClientVersion(ctx context.Context) (string, error)

func (*FlumeAPI) ResolvePrefix added in v1.6.0

func (api *FlumeAPI) ResolvePrefix(ctx *rpc.CallContext, partialHexString string) (map[string][]string, error)

func (*FlumeAPI) TransactionHashesWithPrefix added in v1.6.0

func (api *FlumeAPI) TransactionHashesWithPrefix(ctx *rpc.CallContext, partialHexString string) ([]string, error)

type FlumeTokensAPI

type FlumeTokensAPI struct {
	// contains filtered or unexported fields
}

func NewFlumeTokensAPI

func NewFlumeTokensAPI(db *sql.DB, network uint64, pl *plugins.PluginLoader, cfg *config.Config) *FlumeTokensAPI

func (*FlumeTokensAPI) Erc20ByAccount added in v1.0.4

func (api *FlumeTokensAPI) Erc20ByAccount(ctx *rpc.CallContext, addr common.Address, offset *int) (*paginator[common.Address], error)

func (*FlumeTokensAPI) Erc20Holders added in v1.0.4

func (api *FlumeTokensAPI) Erc20Holders(ctx *rpc.CallContext, addr common.Address, offset *int) (*paginator[common.Address], error)

type GasAPI

type GasAPI struct {
	// contains filtered or unexported fields
}

func NewGasAPI

func NewGasAPI(db *sql.DB, network uint64, pl *plugins.PluginLoader, cfg *config.Config, mempool bool) *GasAPI

func (*GasAPI) FeeHistory

func (api *GasAPI) FeeHistory(ctx context.Context, blockCount DecimalOrHex, terminalBlock rpc.BlockNumber, rewardPercentiles []float64) (res *feeHistoryResult, err error)

func (*GasAPI) GasPrice

func (api *GasAPI) GasPrice(ctx context.Context) (string, error)

func (*GasAPI) MaxPriorityFeePerGas

func (api *GasAPI) MaxPriorityFeePerGas(ctx context.Context) (res string, err error)

type LogsAPI

type LogsAPI struct {
	// contains filtered or unexported fields
}

func NewLogsAPI

func NewLogsAPI(db *sql.DB, network uint64, pl *plugins.PluginLoader, cfg *config.Config) *LogsAPI

func (*LogsAPI) GetLogs

func (api *LogsAPI) GetLogs(ctx context.Context, crit FilterQuery) ([]*logType, error)

type TransactionAPI

type TransactionAPI struct {
	// contains filtered or unexported fields
}

func NewTransactionAPI

func NewTransactionAPI(db *sql.DB, network uint64, pl *plugins.PluginLoader, cfg *config.Config, mempool bool) *TransactionAPI

func (*TransactionAPI) GetTransactionByBlockHashAndIndex

func (api *TransactionAPI) GetTransactionByBlockHashAndIndex(ctx context.Context, blockHash types.Hash, index hexutil.Uint64) (*map[string]interface{}, error)

func (*TransactionAPI) GetTransactionByBlockNumberAndIndex

func (api *TransactionAPI) GetTransactionByBlockNumberAndIndex(ctx context.Context, blockNumber rpc.BlockNumber, index hexutil.Uint64) (*map[string]interface{}, error)

func (*TransactionAPI) GetTransactionByHash

func (api *TransactionAPI) GetTransactionByHash(ctx context.Context, txHash types.Hash) (*map[string]interface{}, error)

func (*TransactionAPI) GetTransactionCount

func (api *TransactionAPI) GetTransactionCount(ctx context.Context, addr common.Address, blockNumber rpc.BlockNumber) (*hexutil.Uint64, error)

func (*TransactionAPI) GetTransactionReceipt

func (api *TransactionAPI) GetTransactionReceipt(ctx context.Context, txHash types.Hash) (*map[string]interface{}, error)

type TransactionTypeOne

type TransactionTypeOne struct {
	Transactions []*rpcTransaction `json:"transactions"`
}

type TransactionTypeTwo

type TransactionTypeTwo struct {
	Transactions []types.Hash `json:"transactions"`
}

Jump to

Keyboard shortcuts

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