mantle

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_blockchain_mantle_mantle_index_types_proto protoreflect.FileDescriptor

Functions

func ToEntireBlocksBatchFromLogProto

func ToEntireBlocksBatchFromLogProto(obj *MantleBlocksBatch) *seer_common.BlocksBatchJson

func ToEvenFromLogProto

func ToEvenFromLogProto(obj *MantleEventLog) *seer_common.EventJson

Types

type Client

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

func NewClient

func NewClient(url string, timeout int) (*Client, error)

func (*Client) BlockByHash

func (c *Client) BlockByHash(ctx context.Context, hash common.Hash) (*seer_common.BlockJson, error)

BlockByHash returns the block with the given hash.

func (*Client) ChainType

func (c *Client) ChainType() string

ChainType returns the chain type.

func (*Client) ClientFilterLogs

func (c *Client) ClientFilterLogs(ctx context.Context, q ethereum.FilterQuery, debug bool) ([]*seer_common.EventJson, error)

func (*Client) Close

func (c *Client) Close()

Close closes the underlying RPC client.

func (*Client) DecodeProtoBlocks

func (c *Client) DecodeProtoBlocks(data []string) ([]*MantleBlock, error)

func (*Client) DecodeProtoEntireBlockToJson

func (c *Client) DecodeProtoEntireBlockToJson(rawData *bytes.Buffer) (*seer_common.BlocksBatchJson, error)

func (*Client) DecodeProtoEntireBlockToLabels

func (c *Client) DecodeProtoEntireBlockToLabels(rawData *bytes.Buffer, blocksCache map[uint64]uint64, abiMap map[string]map[string]map[string]string) ([]indexer.EventLabel, []indexer.TransactionLabel, error)

func (*Client) DecodeProtoEventLogs

func (c *Client) DecodeProtoEventLogs(data []string) ([]*MantleEventLog, error)

func (*Client) DecodeProtoTransactions

func (c *Client) DecodeProtoTransactions(data []string) ([]*MantleTransaction, error)

func (*Client) DecodeProtoTransactionsToLabels

func (c *Client) DecodeProtoTransactionsToLabels(transactions []string, blocksCache map[uint64]uint64, abiMap map[string]map[string]map[string]string) ([]indexer.TransactionLabel, error)

func (*Client) FetchAsProtoBlocksWithEvents

func (c *Client) FetchAsProtoBlocksWithEvents(from, to *big.Int, debug bool, maxRequests int) ([]proto.Message, []indexer.BlockIndex, []indexer.TransactionIndex, []indexer.LogIndex, uint64, error)

func (*Client) FetchBlocksInRange

func (c *Client) FetchBlocksInRange(from, to *big.Int, debug bool) ([]*seer_common.BlockJson, error)

FetchBlocksInRange fetches blocks within a specified range. This could be useful for batch processing or analysis.

func (*Client) FetchBlocksInRangeAsync

func (c *Client) FetchBlocksInRangeAsync(from, to *big.Int, debug bool, maxRequests int) ([]*seer_common.BlockJson, error)

FetchBlocksInRangeAsync fetches blocks within a specified range concurrently.

func (*Client) GetBlockByNumber

func (c *Client) GetBlockByNumber(ctx context.Context, number *big.Int) (*seer_common.BlockJson, error)

BlockByNumber returns the block with the given number.

func (*Client) GetLatestBlockNumber

func (c *Client) GetLatestBlockNumber() (*big.Int, error)

GetLatestBlockNumber returns the latest block number.

func (*Client) ParseBlocksWithTransactions

func (c *Client) ParseBlocksWithTransactions(from, to *big.Int, debug bool, maxRequests int) ([]*MantleBlock, error)

ParseBlocksWithTransactions parses blocks and their transactions into custom data structure. This method showcases how to handle and transform detailed block and transaction data.

func (*Client) ParseEvents

func (c *Client) ParseEvents(from, to *big.Int, blocksCache map[uint64]indexer.BlockCache, debug bool) ([]*MantleEventLog, []indexer.LogIndex, error)

func (*Client) ProcessBlocksToBatch

func (c *Client) ProcessBlocksToBatch(msgs []proto.Message) (proto.Message, error)

func (*Client) TransactionReceipt

func (c *Client) TransactionReceipt(ctx context.Context, hash common.Hash) (*types.Receipt, error)

TransactionReceipt returns the receipt of a transaction by transaction hash.

type MantleBlock

type MantleBlock struct {
	BlockNumber      uint64               `protobuf:"varint,1,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"`          // The block number
	Difficulty       uint64               `protobuf:"varint,2,opt,name=difficulty,proto3" json:"difficulty,omitempty"`                               // The difficulty of this block
	ExtraData        string               `protobuf:"bytes,3,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty"`                 // Extra data included in the block
	GasLimit         uint64               `protobuf:"varint,4,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"`                   // The gas limit for this block
	GasUsed          uint64               `protobuf:"varint,5,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"`                      // The total gas used by all transactions in this block
	BaseFeePerGas    string               `protobuf:"bytes,6,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty"` // The base fee per gas for this block
	Hash             string               `protobuf:"bytes,7,opt,name=hash,proto3" json:"hash,omitempty"`                                            // The hash of this block
	LogsBloom        string               `protobuf:"bytes,8,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty"`                 // The logs bloom filter for this block
	Miner            string               `protobuf:"bytes,9,opt,name=miner,proto3" json:"miner,omitempty"`                                          // The address of the miner who mined this block
	Nonce            string               `protobuf:"bytes,10,opt,name=nonce,proto3" json:"nonce,omitempty"`                                         // The nonce of this block
	ParentHash       string               `protobuf:"bytes,11,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty"`             // The hash of the parent block
	ReceiptsRoot     string               `protobuf:"bytes,12,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty"`       // The root hash of the receipts trie
	Sha3Uncles       string               `protobuf:"bytes,13,opt,name=sha3_uncles,json=sha3Uncles,proto3" json:"sha3_uncles,omitempty"`             // The SHA3 hash of the uncles data in this block
	Size             uint64               `protobuf:"varint,14,opt,name=size,proto3" json:"size,omitempty"`                                          // The size of this block
	StateRoot        string               `protobuf:"bytes,15,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty"`                // The root hash of the state trie
	Timestamp        uint64               `protobuf:"varint,16,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	TotalDifficulty  string               `protobuf:"bytes,17,opt,name=total_difficulty,json=totalDifficulty,proto3" json:"total_difficulty,omitempty"`    // The total difficulty of the chain until this block
	TransactionsRoot string               `protobuf:"bytes,18,opt,name=transactions_root,json=transactionsRoot,proto3" json:"transactions_root,omitempty"` // The root hash of the transactions trie
	IndexedAt        uint64               `protobuf:"varint,19,opt,name=indexed_at,json=indexedAt,proto3" json:"indexed_at,omitempty"`                     // When the block was indexed by crawler
	Transactions     []*MantleTransaction `protobuf:"bytes,20,rep,name=transactions,proto3" json:"transactions,omitempty"`                                 // The transactions included in this block
	// contains filtered or unexported fields
}

Represents a block in the blockchain

func ToProtoSingleBlock

func ToProtoSingleBlock(obj *seer_common.BlockJson) *MantleBlock

func (*MantleBlock) Descriptor deprecated

func (*MantleBlock) Descriptor() ([]byte, []int)

Deprecated: Use MantleBlock.ProtoReflect.Descriptor instead.

func (*MantleBlock) GetBaseFeePerGas

func (x *MantleBlock) GetBaseFeePerGas() string

func (*MantleBlock) GetBlockNumber

func (x *MantleBlock) GetBlockNumber() uint64

func (*MantleBlock) GetDifficulty

func (x *MantleBlock) GetDifficulty() uint64

func (*MantleBlock) GetExtraData

func (x *MantleBlock) GetExtraData() string

func (*MantleBlock) GetGasLimit

func (x *MantleBlock) GetGasLimit() uint64

func (*MantleBlock) GetGasUsed

func (x *MantleBlock) GetGasUsed() uint64

func (*MantleBlock) GetHash

func (x *MantleBlock) GetHash() string

func (*MantleBlock) GetIndexedAt

func (x *MantleBlock) GetIndexedAt() uint64

func (*MantleBlock) GetLogsBloom

func (x *MantleBlock) GetLogsBloom() string

func (*MantleBlock) GetMiner

func (x *MantleBlock) GetMiner() string

func (*MantleBlock) GetNonce

func (x *MantleBlock) GetNonce() string

func (*MantleBlock) GetParentHash

func (x *MantleBlock) GetParentHash() string

func (*MantleBlock) GetReceiptsRoot

func (x *MantleBlock) GetReceiptsRoot() string

func (*MantleBlock) GetSha3Uncles

func (x *MantleBlock) GetSha3Uncles() string

func (*MantleBlock) GetSize

func (x *MantleBlock) GetSize() uint64

func (*MantleBlock) GetStateRoot

func (x *MantleBlock) GetStateRoot() string

func (*MantleBlock) GetTimestamp

func (x *MantleBlock) GetTimestamp() uint64

func (*MantleBlock) GetTotalDifficulty

func (x *MantleBlock) GetTotalDifficulty() string

func (*MantleBlock) GetTransactions

func (x *MantleBlock) GetTransactions() []*MantleTransaction

func (*MantleBlock) GetTransactionsRoot

func (x *MantleBlock) GetTransactionsRoot() string

func (*MantleBlock) ProtoMessage

func (*MantleBlock) ProtoMessage()

func (*MantleBlock) ProtoReflect

func (x *MantleBlock) ProtoReflect() protoreflect.Message

func (*MantleBlock) Reset

func (x *MantleBlock) Reset()

func (*MantleBlock) String

func (x *MantleBlock) String() string

type MantleBlocksBatch

type MantleBlocksBatch struct {
	Blocks      []*MantleBlock `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"`
	SeerVersion string         `protobuf:"bytes,2,opt,name=seer_version,json=seerVersion,proto3" json:"seer_version,omitempty"`
	// contains filtered or unexported fields
}

func (*MantleBlocksBatch) Descriptor deprecated

func (*MantleBlocksBatch) Descriptor() ([]byte, []int)

Deprecated: Use MantleBlocksBatch.ProtoReflect.Descriptor instead.

func (*MantleBlocksBatch) GetBlocks

func (x *MantleBlocksBatch) GetBlocks() []*MantleBlock

func (*MantleBlocksBatch) GetSeerVersion added in v0.1.15

func (x *MantleBlocksBatch) GetSeerVersion() string

func (*MantleBlocksBatch) ProtoMessage

func (*MantleBlocksBatch) ProtoMessage()

func (*MantleBlocksBatch) ProtoReflect

func (x *MantleBlocksBatch) ProtoReflect() protoreflect.Message

func (*MantleBlocksBatch) Reset

func (x *MantleBlocksBatch) Reset()

func (*MantleBlocksBatch) String

func (x *MantleBlocksBatch) String() string

type MantleEventLog

type MantleEventLog struct {
	Address          string   `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`                                            // The address of the contract that generated the log
	Topics           []string `protobuf:"bytes,2,rep,name=topics,proto3" json:"topics,omitempty"`                                              // Topics are indexed parameters during log generation
	Data             string   `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`                                                  // The data field from the log
	BlockNumber      uint64   `protobuf:"varint,4,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"`                // The block number where this log was in
	TransactionHash  string   `protobuf:"bytes,5,opt,name=transaction_hash,json=transactionHash,proto3" json:"transaction_hash,omitempty"`     // The hash of the transaction that generated this log
	BlockHash        string   `protobuf:"bytes,6,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"`                       // The hash of the block where this log was in
	Removed          bool     `protobuf:"varint,7,opt,name=removed,proto3" json:"removed,omitempty"`                                           // True if the log was reverted due to a chain reorganization
	LogIndex         uint64   `protobuf:"varint,8,opt,name=log_index,json=logIndex,proto3" json:"log_index,omitempty"`                         // The index of the log in the block
	TransactionIndex uint64   `protobuf:"varint,9,opt,name=transaction_index,json=transactionIndex,proto3" json:"transaction_index,omitempty"` // The index of the transaction in the block
	// contains filtered or unexported fields
}

func ToProtoSingleEventLog

func ToProtoSingleEventLog(obj *seer_common.EventJson) *MantleEventLog

func (*MantleEventLog) Descriptor deprecated

func (*MantleEventLog) Descriptor() ([]byte, []int)

Deprecated: Use MantleEventLog.ProtoReflect.Descriptor instead.

func (*MantleEventLog) GetAddress

func (x *MantleEventLog) GetAddress() string

func (*MantleEventLog) GetBlockHash

func (x *MantleEventLog) GetBlockHash() string

func (*MantleEventLog) GetBlockNumber

func (x *MantleEventLog) GetBlockNumber() uint64

func (*MantleEventLog) GetData

func (x *MantleEventLog) GetData() string

func (*MantleEventLog) GetLogIndex

func (x *MantleEventLog) GetLogIndex() uint64

func (*MantleEventLog) GetRemoved

func (x *MantleEventLog) GetRemoved() bool

func (*MantleEventLog) GetTopics

func (x *MantleEventLog) GetTopics() []string

func (*MantleEventLog) GetTransactionHash

func (x *MantleEventLog) GetTransactionHash() string

func (*MantleEventLog) GetTransactionIndex

func (x *MantleEventLog) GetTransactionIndex() uint64

func (*MantleEventLog) ProtoMessage

func (*MantleEventLog) ProtoMessage()

func (*MantleEventLog) ProtoReflect

func (x *MantleEventLog) ProtoReflect() protoreflect.Message

func (*MantleEventLog) Reset

func (x *MantleEventLog) Reset()

func (*MantleEventLog) String

func (x *MantleEventLog) String() string

type MantleTransaction

type MantleTransaction struct {
	Hash                 string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`                                         // The hash of the transaction
	BlockNumber          uint64 `protobuf:"varint,2,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"`       // The block number the transaction is in
	FromAddress          string `protobuf:"bytes,3,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"`        // The address the transaction is sent from
	ToAddress            string `protobuf:"bytes,4,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"`              // The address the transaction is sent to
	Gas                  string `protobuf:"bytes,5,opt,name=gas,proto3" json:"gas,omitempty"`                                           // The gas limit of the transaction
	GasPrice             string `protobuf:"bytes,6,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"`                 // The gas price of the transaction
	MaxFeePerGas         string `protobuf:"bytes,7,opt,name=max_fee_per_gas,json=maxFeePerGas,proto3" json:"max_fee_per_gas,omitempty"` // Used as a field to match potential EIP-1559 transaction types
	MaxPriorityFeePerGas string ``                                                                                                      // Used as a field to match potential EIP-1559 transaction types
	/* 127-byte string literal not displayed */
	Input            string                         `protobuf:"bytes,9,opt,name=input,proto3" json:"input,omitempty"`                                                 // The input data of the transaction
	Nonce            string                         `protobuf:"bytes,10,opt,name=nonce,proto3" json:"nonce,omitempty"`                                                // The nonce of the transaction
	TransactionIndex uint64                         `protobuf:"varint,11,opt,name=transaction_index,json=transactionIndex,proto3" json:"transaction_index,omitempty"` // The index of the transaction in the block
	TransactionType  uint64                         `protobuf:"varint,12,opt,name=transaction_type,json=transactionType,proto3" json:"transaction_type,omitempty"`    // Field to match potential EIP-1559 transaction types
	Value            string                         `protobuf:"bytes,13,opt,name=value,proto3" json:"value,omitempty"`                                                // The value of the transaction
	IndexedAt        uint64                         `protobuf:"varint,14,opt,name=indexed_at,json=indexedAt,proto3" json:"indexed_at,omitempty"`                      // When the transaction was indexed by crawler
	BlockTimestamp   uint64                         `protobuf:"varint,15,opt,name=block_timestamp,json=blockTimestamp,proto3" json:"block_timestamp,omitempty"`       // The timestamp of this block
	BlockHash        string                         `protobuf:"bytes,16,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"`                       // The hash of the block the transaction is in
	ChainId          string                         `protobuf:"bytes,17,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`                             // Used as a field to match potential EIP-1559 transaction types
	V                string                         `protobuf:"bytes,18,opt,name=v,proto3" json:"v,omitempty"`                                                        // Used as a field to match potential EIP-1559 transaction types
	R                string                         `protobuf:"bytes,19,opt,name=r,proto3" json:"r,omitempty"`                                                        // Used as a field to match potential EIP-1559 transaction types
	S                string                         `protobuf:"bytes,20,opt,name=s,proto3" json:"s,omitempty"`                                                        // Used as a field to match potential EIP-1559 transaction types
	AccessList       []*MantleTransactionAccessList `protobuf:"bytes,21,rep,name=access_list,json=accessList,proto3" json:"access_list,omitempty"`
	YParity          string                         `protobuf:"bytes,22,opt,name=y_parity,json=yParity,proto3" json:"y_parity,omitempty"` // Used as a field to match potential EIP-1559 transaction types
	Logs             []*MantleEventLog              `protobuf:"bytes,23,rep,name=logs,proto3" json:"logs,omitempty"`                      // The logs generated by this transaction
	// contains filtered or unexported fields
}

Represents a single transaction within a block

func ToProtoSingleTransaction

func ToProtoSingleTransaction(obj *seer_common.TransactionJson) *MantleTransaction

func (*MantleTransaction) Descriptor deprecated

func (*MantleTransaction) Descriptor() ([]byte, []int)

Deprecated: Use MantleTransaction.ProtoReflect.Descriptor instead.

func (*MantleTransaction) GetAccessList

func (x *MantleTransaction) GetAccessList() []*MantleTransactionAccessList

func (*MantleTransaction) GetBlockHash

func (x *MantleTransaction) GetBlockHash() string

func (*MantleTransaction) GetBlockNumber

func (x *MantleTransaction) GetBlockNumber() uint64

func (*MantleTransaction) GetBlockTimestamp

func (x *MantleTransaction) GetBlockTimestamp() uint64

func (*MantleTransaction) GetChainId

func (x *MantleTransaction) GetChainId() string

func (*MantleTransaction) GetFromAddress

func (x *MantleTransaction) GetFromAddress() string

func (*MantleTransaction) GetGas

func (x *MantleTransaction) GetGas() string

func (*MantleTransaction) GetGasPrice

func (x *MantleTransaction) GetGasPrice() string

func (*MantleTransaction) GetHash

func (x *MantleTransaction) GetHash() string

func (*MantleTransaction) GetIndexedAt

func (x *MantleTransaction) GetIndexedAt() uint64

func (*MantleTransaction) GetInput

func (x *MantleTransaction) GetInput() string

func (*MantleTransaction) GetLogs

func (x *MantleTransaction) GetLogs() []*MantleEventLog

func (*MantleTransaction) GetMaxFeePerGas

func (x *MantleTransaction) GetMaxFeePerGas() string

func (*MantleTransaction) GetMaxPriorityFeePerGas

func (x *MantleTransaction) GetMaxPriorityFeePerGas() string

func (*MantleTransaction) GetNonce

func (x *MantleTransaction) GetNonce() string

func (*MantleTransaction) GetR

func (x *MantleTransaction) GetR() string

func (*MantleTransaction) GetS

func (x *MantleTransaction) GetS() string

func (*MantleTransaction) GetToAddress

func (x *MantleTransaction) GetToAddress() string

func (*MantleTransaction) GetTransactionIndex

func (x *MantleTransaction) GetTransactionIndex() uint64

func (*MantleTransaction) GetTransactionType

func (x *MantleTransaction) GetTransactionType() uint64

func (*MantleTransaction) GetV

func (x *MantleTransaction) GetV() string

func (*MantleTransaction) GetValue

func (x *MantleTransaction) GetValue() string

func (*MantleTransaction) GetYParity

func (x *MantleTransaction) GetYParity() string

func (*MantleTransaction) ProtoMessage

func (*MantleTransaction) ProtoMessage()

func (*MantleTransaction) ProtoReflect

func (x *MantleTransaction) ProtoReflect() protoreflect.Message

func (*MantleTransaction) Reset

func (x *MantleTransaction) Reset()

func (*MantleTransaction) String

func (x *MantleTransaction) String() string

type MantleTransactionAccessList

type MantleTransactionAccessList struct {
	Address     string   `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	StorageKeys []string `protobuf:"bytes,2,rep,name=storage_keys,json=storageKeys,proto3" json:"storage_keys,omitempty"`
	// contains filtered or unexported fields
}

func (*MantleTransactionAccessList) Descriptor deprecated

func (*MantleTransactionAccessList) Descriptor() ([]byte, []int)

Deprecated: Use MantleTransactionAccessList.ProtoReflect.Descriptor instead.

func (*MantleTransactionAccessList) GetAddress

func (x *MantleTransactionAccessList) GetAddress() string

func (*MantleTransactionAccessList) GetStorageKeys

func (x *MantleTransactionAccessList) GetStorageKeys() []string

func (*MantleTransactionAccessList) ProtoMessage

func (*MantleTransactionAccessList) ProtoMessage()

func (*MantleTransactionAccessList) ProtoReflect

func (*MantleTransactionAccessList) Reset

func (x *MantleTransactionAccessList) Reset()

func (*MantleTransactionAccessList) String

func (x *MantleTransactionAccessList) String() string

Jump to

Keyboard shortcuts

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