rpc

package
v0.0.0-...-11d313d Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CheckTxCostAgainstBalance

func CheckTxCostAgainstBalance(amount, gasLimit uint64,
	bBalance *big.Int) (accountHasEnough bool, balance,
	totalCost big.Int, err error)

This is useful during tx construction

func EstimateGas

func EstimateGas(from [20]byte, to [20]byte,
	gasPrice, value *big.Int, data []byte) (res *big.Int, er error)

func EstimateGas_CH

func EstimateGas_CH(from [20]byte, to [20]byte,
	gasPrice, value *big.Int, data []byte) (<-chan *big.Int, <-chan error)

func GetBalanceCH

func GetBalanceCH(address [20]byte) (<-chan *big.Int, <-chan error)

func GetBalance_byteAddressToBigInt

func GetBalance_byteAddressToBigInt(address [20]byte) (big.Int, error)

func GetBlockHash

func GetBlockHash(height string) (hash string, er error)

func GetBlockHeight

func GetBlockHeight() (ret string, er error)

func GetBlockHeightNGasLimit_CH

func GetBlockHeightNGasLimit_CH() (<-chan string, <-chan uint64, <-chan error)

func GetBlockHeight_CH

func GetBlockHeight_CH() (<-chan string, <-chan error)

func GetCode

func GetCode(address string) (hex string, er error)

func GetGasLimit

func GetGasLimit(height string) (res uint64, er error)

func GetGasPrice

func GetGasPrice() (ret uint64, er error)

func GetGasPrice_CH

func GetGasPrice_CH() (<-chan uint64, <-chan error)

func GetNonceForAddress

func GetNonceForAddress(address [20]byte) (ret uint64, er error)

func GetNonceForAddress_CH

func GetNonceForAddress_CH(address [20]byte) (<-chan uint64, <-chan error)

func GetStorageAtCH

func GetStorageAtCH(hexStoragePosition string,
	w *sync.WaitGroup) <-chan ResponseMessage

func GetTransactionByHash

func GetTransactionByHash(hash string) (tr TxByHashResult, er error)

func HttpPost

func HttpPost(reqBytes []byte) (body []byte, er error)

func SanitizeRpcUrls

func SanitizeRpcUrls(rpcPtr *abi.UrlPtr) error

func SendRawTx

func SendRawTx(signedTx *types.Transaction) (txid string, er error)

func SetAbi

func SetAbi() error

func SetRpcUrls

func SetRpcUrls(r []string) error

Types

type LogsResponse

type LogsResponse struct {
	Result TxLogs `json:"result"`
}

type Response

type Response struct {
	Result string `json:"result"`
}

func GetBalance

func GetBalance(hexAddress string) (Response, error)

func GetBalance_byteAddress

func GetBalance_byteAddress(address [20]byte) (Response, error)

func GetStorageAt

func GetStorageAt(hexStoragePosition string) (Response, error)

func HttpPostWResponse

func HttpPostWResponse(reqBytes []byte) (res Response, er error)

type ResponseMessage

type ResponseMessage struct {
	R     *Response
	Error error
}

type TxLog

type TxLog struct {
	Address          string   `json:"address"`
	BlockHash        string   `json:"blockHash"`
	BlockNumber      string   `json:"blockNumber"`
	Data             string   `json:"data"`
	LogIndex         string   `json:"logIndex"`
	Removed          bool     `json:"removed"`
	Topics           []string `json:"topics"`
	TransactionHash  string   `json:"transactionHash"`
	TransactionIndex string   `json:"transactionIndex"`
}

type TxLogs

type TxLogs []TxLog

func GetLogs

func GetLogs(topics []string, fromBlock,
	toBlock string) (txLogs TxLogs, er error)

Jump to

Keyboard shortcuts

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