web3

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateWeb3Server

func GenerateWeb3Server(server *aggregator.Server) (*rpc.Server, error)

Types

type CallTxArgs

type CallTxArgs struct {
	From     *common.Address `json:"from"`
	To       *common.Address `json:"to"`
	Gas      *hexutil.Uint64 `json:"gas"`
	GasPrice *hexutil.Big    `json:"gasPrice"`
	Value    *hexutil.Big    `json:"value"`
	Data     *hexutil.Bytes  `json:"data"`
}

type GetBlockResult

type GetBlockResult struct {
	Number           *hexutil.Big      `json:"number"`
	Hash             hexutil.Bytes     `json:"hash"`
	ParentHash       hexutil.Bytes     `json:"parentHash"`
	MixDigest        hexutil.Bytes     `json:"mixHash"`
	Nonce            *types.BlockNonce `json:"nonce"`
	Sha3Uncles       hexutil.Bytes     `json:"sha3Uncles"`
	LogsBloom        hexutil.Bytes     `json:"logsBloom"`
	TransactionsRoot hexutil.Bytes     `json:"transactionsRoot"`
	StateRoot        hexutil.Bytes     `json:"stateRoot"`
	ReceiptsRoot     hexutil.Bytes     `json:"receiptsRoot"`
	Miner            hexutil.Bytes     `json:"miner"`
	Difficulty       *hexutil.Big      `json:"difficulty"`
	TotalDifficulty  *hexutil.Big      `json:"totalDifficulty"`
	ExtraData        *hexutil.Bytes    `json:"extraData"`
	Size             *hexutil.Uint64   `json:"size"`
	GasLimit         *hexutil.Uint64   `json:"gasLimit"`
	GasUsed          *hexutil.Uint64   `json:"gasUsed"`
	Timestamp        *hexutil.Uint64   `json:"timestamp"`
	Transactions     interface{}       `json:"transactions"`
	Uncles           *[]hexutil.Bytes  `json:"uncles"`
}

type GetTransactionReceiptResult

type GetTransactionReceiptResult struct {
	TransactionHash   common.Hash     `json:"transactionHash"`
	TransactionIndex  hexutil.Uint64  `json:"transactionIndex"`
	BlockHash         common.Hash     `json:"blockHash"`
	BlockNumber       *hexutil.Big    `json:"blockNumber"`
	From              common.Address  `json:"from"`
	To                *common.Address `json:"to"`
	CumulativeGasUsed hexutil.Uint64  `json:"cumulativeGasUsed"`
	GasUsed           hexutil.Uint64  `json:"gasUsed"`
	ContractAddress   *common.Address `json:"contractAddress"`
	Logs              []*types.Log    `json:"logs"`
	LogsBloom         hexutil.Bytes   `json:"logsBloom"`
	Status            hexutil.Uint64  `json:"status"`

	// Arbitrum Specific Fields
	ReturnCode hexutil.Uint64 `json:"returnCode"`
	ReturnData hexutil.Bytes  `json:"returnData"`
}

Receipt represents the results of a transaction.

type Net

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

func (*Net) Version

func (net *Net) Version() string

type Server

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

func NewServer

func NewServer(
	srv *aggregator.Server,
) *Server

func (*Server) Accounts added in v0.7.2

func (s *Server) Accounts() []common.Address

func (*Server) BlockNumber

func (s *Server) BlockNumber() hexutil.Uint64

func (*Server) Call

func (s *Server) Call(callArgs CallTxArgs, blockNum *rpc.BlockNumber) (hexutil.Bytes, error)

func (*Server) ChainId added in v0.7.1

func (s *Server) ChainId() hexutil.Uint64

func (*Server) EstimateGas

func (s *Server) EstimateGas(args CallTxArgs) (hexutil.Uint64, error)

func (*Server) GasPrice

func (s *Server) GasPrice() hexutil.Uint64

func (*Server) GetBalance

func (s *Server) GetBalance(address *common.Address, blockNum *rpc.BlockNumber) (*hexutil.Big, error)

func (*Server) GetBlockByHash

func (s *Server) GetBlockByHash(blockHashRaw hexutil.Bytes, includeTxData bool) (*GetBlockResult, error)

func (*Server) GetBlockByNumber

func (s *Server) GetBlockByNumber(blockNum *rpc.BlockNumber, includeTxData bool) (*GetBlockResult, error)

func (*Server) GetBlockTransactionCountByHash added in v0.7.2

func (s *Server) GetBlockTransactionCountByHash(blockHash common.Hash) (*hexutil.Big, error)

func (*Server) GetBlockTransactionCountByNumber added in v0.7.2

func (s *Server) GetBlockTransactionCountByNumber(blockNum *rpc.BlockNumber) (*hexutil.Big, error)

func (*Server) GetCode

func (s *Server) GetCode(address *common.Address, blockNum *rpc.BlockNumber) (hexutil.Bytes, error)

func (*Server) GetStorageAt

func (s *Server) GetStorageAt(address *common.Address, index *hexutil.Big, blockNum *rpc.BlockNumber) (*hexutil.Big, error)

func (*Server) GetTransactionByBlockHashAndIndex added in v0.7.2

func (s *Server) GetTransactionByBlockHashAndIndex(blockHash common.Hash, index hexutil.Uint64) (*TransactionResult, error)

func (*Server) GetTransactionByBlockNumberAndIndex added in v0.7.2

func (s *Server) GetTransactionByBlockNumberAndIndex(blockNum *rpc.BlockNumber, index hexutil.Uint64) (*TransactionResult, error)

func (*Server) GetTransactionByHash

func (s *Server) GetTransactionByHash(txHash hexutil.Bytes) (*TransactionResult, error)

func (*Server) GetTransactionCount

func (s *Server) GetTransactionCount(ctx context.Context, address *common.Address, blockNum *rpc.BlockNumber) (hexutil.Uint64, error)

func (*Server) GetTransactionReceipt

func (s *Server) GetTransactionReceipt(txHash hexutil.Bytes) (*GetTransactionReceiptResult, error)

func (*Server) SendRawTransaction

func (s *Server) SendRawTransaction(ctx context.Context, data hexutil.Bytes) (hexutil.Bytes, error)

type TransactionResult

type TransactionResult struct {
	BlockHash        *common.Hash    `json:"blockHash"`
	BlockNumber      *hexutil.Big    `json:"blockNumber"`
	From             common.Address  `json:"from"`
	Gas              hexutil.Uint64  `json:"gas"`
	GasPrice         *hexutil.Big    `json:"gasPrice"`
	Hash             common.Hash     `json:"hash"`
	Input            hexutil.Bytes   `json:"input"`
	Nonce            hexutil.Uint64  `json:"nonce"`
	To               *common.Address `json:"to"`
	TransactionIndex *hexutil.Uint64 `json:"transactionIndex"`
	Value            *hexutil.Big    `json:"value"`
	V                *hexutil.Big    `json:"v"`
	R                *hexutil.Big    `json:"r"`
	S                *hexutil.Big    `json:"s"`

	// Arbitrum Specific Fields
	L1SeqNum        *hexutil.Big    `json:"l1SequenceNumber"`
	ParentRequestId *common.Hash    `json:"parentRequestId"`
	IndexInParent   *hexutil.Big    `json:"indexInParent"`
	ArbType         hexutil.Uint64  `json:"arbType"`
	ArbSubType      *hexutil.Uint64 `json:"arbSubType"`
}

type Web3

type Web3 struct {
}

func (*Web3) ClientVersion

func (web3 *Web3) ClientVersion() string

func (*Web3) Sha3 added in v0.7.2

func (web3 *Web3) Sha3(data hexutil.Bytes) hexutil.Bytes

Jump to

Keyboard shortcuts

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