proxy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockNumberAndIndex

type BlockNumberAndIndex struct {
	Number uint64 `etherscan:"tag,hex"`
	Index  uint32 `etherscan:"index,hex"`
}

BlockNumberAndIndex uniquely identifies a transaction's position in a block.

type CallRequest

type CallRequest struct {
	To   common.Address
	Data []byte
	Tag  ecommon.BlockParameter
}

CallRequest contains the request parameters for Call.

type EstimateGasRequest

type EstimateGasRequest struct {
	Data     []byte
	To       common.Address
	Value    *big.Int `etherscan:"value,hex"`
	Gas      *big.Int `etherscan:"gas,hex"`
	GasPrice *big.Int `etherscan:"gasPrice,hex"`
}

EstimateGasRequest contains the request parameters for EstimateGas.

type GetCodeRequest

type GetCodeRequest struct {
	Address common.Address
	Tag     ecommon.BlockParameter
}

GetCodeRequest contains the request parameters for GetCode.

type GetStorageRequest

type GetStorageRequest struct {
	Address  common.Address
	Position uint32 `etherscan:"position,hex"`
	Tag      ecommon.BlockParameter
}

GetStorageRequest contains the request parameters for GetStorageAt.

type ProxyBaseBlockInfo

type ProxyBaseBlockInfo struct {
	Difficulty       *big.Int `etherscan:"difficulty,hex"`
	ExtraData        []byte   `etherscan:"extraData,hex"`
	GasLimit         *big.Int `etherscan:"gasLimit,hex"`
	GasUsed          *big.Int `etherscan:"gasUsed,hex"`
	Hash             common.Hash
	LogsBloom        []byte `etherscan:"logsBloom,hex"`
	Miner            common.Address
	MixHash          common.Hash `etherscan:"mixHash"`
	Nonce            *big.Int    `etherscan:"nonce,hex"`
	Number           uint64      `etherscan:"number,hex"`
	ParentHash       common.Hash `etherscan:"parentHash"`
	ReceiptsRoot     common.Hash `etherscan:"receiptsRoot"`
	SHA3Uncles       common.Hash `etherscan:"sha3Uncles"`
	Size             uint64      `etherscan:"size,hex"`
	StateRoot        common.Hash `etherscan:"stateRoot"`
	Timestamp        time.Time   `etherscan:"timestamp,hex"`
	TransactionsRoot common.Hash `etherscan:"transactionsRoot"`
	Uncles           []common.Hash
}

ProxyBaseBlockInfo contains common information on a block.

type ProxyClient

type ProxyClient struct {
	API *httpapi.APIClient
}

ProxyClient is the client for ethereum proxy actions.

func (*ProxyClient) BlockNumber

func (c *ProxyClient) BlockNumber(ctx context.Context) (uint64, error)

BlockNumber returns the current block number.

func (*ProxyClient) Call

func (c *ProxyClient) Call(
	ctx context.Context, req *CallRequest,
) ([]byte, error)

Call executes a new message call immediately without creating a transaction on the block chain.

func (*ProxyClient) EstimateGas

func (c *ProxyClient) EstimateGas(
	ctx context.Context, req *EstimateGasRequest,
) (*big.Int, error)

EstimateGas makes a call or transaction, which won't be added to the blockchain and returns the used gas.

func (*ProxyClient) GasPrice

func (c *ProxyClient) GasPrice(ctx context.Context) (*big.Int, error)

GasPrice returns the current price per gas in wei.

func (*ProxyClient) GetBlockByNumberFull

func (c *ProxyClient) GetBlockByNumberFull(
	ctx context.Context, number uint64,
) (*ProxyFullBlockInfo, error)

GetBlockByNumberFull returns full information about a block by block number.

func (*ProxyClient) GetBlockByNumberSummary

func (c *ProxyClient) GetBlockByNumberSummary(
	ctx context.Context, number uint64,
) (*ProxySummaryBlockInfo, error)

GetBlockByNumberSummary returns summary information about a block by block number.

func (*ProxyClient) GetBlockTransactionCountByNumber

func (c *ProxyClient) GetBlockTransactionCountByNumber(
	ctx context.Context, number uint64,
) (uint32, error)

GetBlockTransactionCountByNumber returns the number of transactions in a block.

func (*ProxyClient) GetCode

func (c *ProxyClient) GetCode(
	ctx context.Context, req *GetCodeRequest,
) ([]byte, error)

GetCode returns code at a given address.

func (*ProxyClient) GetStorageAt

func (c *ProxyClient) GetStorageAt(
	ctx context.Context, req *GetStorageRequest,
) ([]byte, error)

GetStorageAt returns the value from a storage position at a given address.

func (*ProxyClient) GetTransactionByBlockNumberAndIndex

func (c *ProxyClient) GetTransactionByBlockNumberAndIndex(
	ctx context.Context, req *BlockNumberAndIndex,
) (*ProxyTransactionInfo, error)

GetTransactionByBlockNumberAndIndex returns information about a transaction by block number and transaction index position.

func (*ProxyClient) GetTransactionByHash

func (c *ProxyClient) GetTransactionByHash(
	ctx context.Context, txHash common.Hash,
) (*ProxyTransactionInfo, error)

GetTransactionsByHash returns the information about a transaction requested by transaction hash.

func (*ProxyClient) GetTransactionCount

func (c *ProxyClient) GetTransactionCount(
	ctx context.Context, req *TxCountRequest,
) (uint64, error)

GetTransactionCount returns the number of transactions performed by an address.

func (*ProxyClient) GetTransactionReceipt

func (c *ProxyClient) GetTransactionReceipt(
	ctx context.Context, txHash common.Hash,
) (*ProxyTransactionReceipt, error)

GetTransactionReceipt returns the receipt of a transaction by transaction hash.

func (*ProxyClient) GetUncleByBlockNumberAndIndex

func (c *ProxyClient) GetUncleByBlockNumberAndIndex(
	ctx context.Context, req *BlockNumberAndIndex,
) (*ProxyUncleBlockInfo, error)

GetUncleByBlockNumberAndIndex returns information about a uncle by block number.

func (*ProxyClient) SendRawTransaction

func (c *ProxyClient) SendRawTransaction(
	ctx context.Context, data []byte,
) (result common.Hash, err error)

SendRawTransaction submits a pre-signed transaction for broadcast to the Ethereum network.

type ProxyFullBlockInfo

type ProxyFullBlockInfo struct {
	ProxyBaseBlockInfo
	TotalDifficulty *big.Int `etherscan:"totalDifficulty,hex"`
	Transactions    []ProxyTransactionInfo
}

ProxyFullBlockInfo contains the full information on a block and its transactions.

type ProxySummaryBlockInfo

type ProxySummaryBlockInfo struct {
	ProxyBaseBlockInfo
	TotalDifficulty *big.Int `etherscan:"totalDifficulty,hex"`
	Transactions    []common.Hash
}

ProxySummaryBlockInfo contains summary information on a block, including a slice of transaction hashes.

type ProxyTransactionInfo

type ProxyTransactionInfo struct {
	BlockHash        common.Hash `etherscan:"blockHash"`
	BlockNumber      uint64      `etherscan:"blockNumber,hex"`
	From             common.Address
	Gas              *big.Int `etherscan:"gas,hex"`
	GasPrice         *big.Int `etherscan:"gasPrice,hex"`
	Hash             common.Hash
	Input            []byte
	Nonce            uint64 `etherscan:"nonce,hex"`
	To               common.Address
	TransactionIndex uint64   `etherscan:"transactionIndex,hex"`
	Value            *big.Int `etherscan:"value,hex"`
	Type             uint32   `etherscan:"type,hex"`
	V                uint32   `etherscan:"v,hex"`
	R                *big.Int `etherscan:"r,hex"`
	S                *big.Int `etherscan:"s,hex"`
}

ProxyTransactionInfo contains information about a transaction.

type ProxyTransactionReceipt

type ProxyTransactionReceipt struct {
	BlockHash         common.Hash     `etherscan:"blockHash"`
	BlockNumber       uint64          `etherscan:"blockNumber,hex"`
	ContractAddress   *common.Address `etherscan:"contractAddress"`
	CumulativeGasUsed *big.Int        `etherscan:"cumulativeGasUsed,hex"`
	EffectiveGasPrice *big.Int        `etherscan:"effectiveGasPrice,hex"`
	From              common.Address
	GasUsed           *big.Int `etherscan:"gasUsed,hex"`
	Logs              []ProxyTxLog
	LogsBloom         []byte `etherscan:"logsBloom"`
	Status            bool   `etherscan:"status,hex"`
	To                common.Address
	TransactionHash   common.Hash `etherscan:"transactionHash"`
	TransactionIndex  uint32      `etherscan:"transactionIndex,hex"`
	Type              uint32      `etherscan:"type,hex"`
}

ProxyTransactionReceipt describes a transaction receipt.

type ProxyTxLog

type ProxyTxLog struct {
	Address             common.Address
	BlockHash           common.Hash `etherscan:"blockHash"`
	BlockNumber         uint64      `etherscan:"blockNumber,hex"`
	Data                []byte
	LogIndex            uint32 `etherscan:"logIndex,hex"`
	Removed             bool
	Topics              []common.Hash
	TransactionHash     common.Hash `etherscan:"transactionHash"`
	TransactionIndex    uint32      `etherscan:"transactionIndex,hex"`
	TransactionLogIndex uint32      `etherscan:"transactionLogIndex,hex"`
	Type                string
}

ProxyTxLog describes a transaction log.

type ProxyUncleBlockInfo

type ProxyUncleBlockInfo struct {
	ProxyBaseBlockInfo
	BaseFeePerGas *big.Int `etherscan:"baseFeePerGas,hex"`
}

ProxyUncleBlockInfo contains information about an uncle block.

type TxCountRequest

type TxCountRequest struct {
	Address common.Address
	Tag     ecommon.BlockParameter
}

TxCountRequest contains request parameters for GetTransactionCount.

Jump to

Keyboard shortcuts

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