client

package
v0.0.0-...-85922c0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Bc  blockchain.Blockchains
	Tp  *txpool.Pool
	Cfg *config.CfgInfo
}

func New

new Client

func (*Client) ContractCall

func (c *Client) ContractCall(origin string, contractAddr string, callInput, value string) (string, string, error)

cal contract

func (*Client) GetBalance

func (c *Client) GetBalance(from string) (uint64, error)

Get from Balance

func (*Client) GetBlockByHash

func (c *Client) GetBlockByHash(hash string) (*block.Block, error)

get block by hash

func (*Client) GetBlockByNumber

func (c *Client) GetBlockByNumber(num uint64) (*block.Block, error)

get block by Number

func (*Client) GetCode

func (c *Client) GetCode(contractAddr string) string

Get Code by contract Address

func (*Client) GetLogs

func (c *Client) GetLogs(address string, fromB, toB uint64, topics []string, blockH string) []*types.Log

get Logs

func (*Client) GetMaxBlockNumber

func (c *Client) GetMaxBlockNumber() (uint64, error)

Get Max BlockNumber

func (*Client) GetNonce

func (c *Client) GetNonce(from string) (uint64, error)

Get address Nonce

func (*Client) GetStorageAt

func (c *Client) GetStorageAt(addr, hash string) string

GetStorageAt

func (*Client) GetTransactionByHash

func (c *Client) GetTransactionByHash(hash string) (*transaction.FinishedTransaction, error)

Get Transaction By Hash

func (*Client) GetTransactionReceipt

func (c *Client) GetTransactionReceipt(hash string) (*transaction.FinishedTransaction, error)

Get Transaction Receipt by hash

func (*Client) SendRawTransaction

func (c *Client) SendRawTransaction(rawTx string) (string, error)

Send signed Transaction

type Clients

type Clients interface {
	//call contract
	ContractCall(origin string, contractAddr string, callInput, value string) (string, string, error)
	//get balance by from
	GetBalance(from string) (uint64, error)
	//get block by hash
	GetBlockByHash(hash string) (*block.Block, error)
	//get block by number
	GetBlockByNumber(num uint64) (*block.Block, error)
	//get code by contract address
	GetCode(contractAddr string) string
	//get nonce by address
	GetNonce(addr string) (uint64, error)
	//get transaction by hash
	GetTransactionByHash(hash string) (*transaction.FinishedTransaction, error)
	//send signed transaction
	SendRawTransaction(rawTx string) (string, error)
	//get transaction receipt
	GetTransactionReceipt(hash string) (*transaction.FinishedTransaction, error)

	//get Storage by address and hash
	GetStorageAt(addr, hash string) string
	//get logs
	GetLogs(address string, fromB, toB uint64, topics []string, blockH string) []*types.Log
	//get max block number
	GetMaxBlockNumber() (uint64, error)
}

Jump to

Keyboard shortcuts

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