rpc_utils

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 License: GPL-3.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTxCostAgainstBalance

func CheckTxCostAgainstBalance(amount, gasLimit uint64, address [20]byte) (accountHasEnough bool, balance, totalCost big.Int, err error)

This is useful during tx construction

func EstimateGas

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

func GetBalance_byteAddressToBigInt

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

func GetBlockHash

func GetBlockHash(height string) (string, error)

func GetBlockHeight

func GetBlockHeight() (ret string, err error)

func GetGasLimit

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

func GetNonceForAddress

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

func SanitizeRpcUrls added in v0.0.16

func SanitizeRpcUrls(rpcPtr *archonAbi.UrlPtr) error

func SendRawTx

func SendRawTx(signedTx *types.Transaction) (res string, err error)

func SetRpcUrl added in v0.0.17

func SetRpcUrl(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) (Response, 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, error)

type TxReceipt

type TxReceipt struct {
	TransactionHash   string `json:"transactionHash"`
	TransactionIndex  string `json:"transactionIndex"`
	BlockHash         string `json:"blockHash"`
	BlockNumber       string `json:"blockNumber"`
	From              string `json:"from"`
	To                string `json:"to"`
	CumulativeGasUsed string `json:"cumulativeGasUsed"`
	GasUsed           string `json:"gasUsed"`
	ContractAddress   string `json:"contractAddress"`
	TxLogs            TxLogs `json:"logs"`
	LogsBloom         string `json:"logsBloom"`
}

func GetTxReceipt

func GetTxReceipt(txid string) (TxReceipt, error)

type TxReceiptResponse

type TxReceiptResponse struct {
	Result TxReceipt `json:"result"`
}

Jump to

Keyboard shortcuts

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