ethcli

package
v0.0.0-...-500bc43 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EthClient

type EthClient struct {
	*ethclient.Client
	// contains filtered or unexported fields
}

func NewEthClient

func NewEthClient(url string) (*EthClient, error)

func (*EthClient) DecodeRawTx

func (c *EthClient) DecodeRawTx(rawtx string) (*types.Transaction, error)

DecodeRawTX decodes a raw ethereum RLP encoded transaction and returns a go-ethereum types.Transaction

func (*EthClient) GetAdressFromPrivateKey

func (c *EthClient) GetAdressFromPrivateKey(privKeyHex string) (string, error)

GetAdressFromPrivateKey returns the ethereum address from a private key encoded as a hex string

func (*EthClient) GetBalance

func (c *EthClient) GetBalance(address string, blockNumber *big.Int) (string, error)

GetBalance returns a string with the balance of an address in units of wei

func (*EthClient) GetTransactionsByHash

func (c *EthClient) GetTransactionsByHash(hashes []common.Hash) (txs []*types.Transaction, err error)

Returns a slice of transactions given a slice of transaction hashes

func (*EthClient) ImportRawKey

func (c *EthClient) ImportRawKey(key string) (string, error)

ImportRawKey() imports a private key into the keystore of the node

func (*EthClient) PrintPretty

func (c *EthClient) PrintPretty(msg string, source interface{})

func (*EthClient) Send

func (c *EthClient) Send(key string, receiver string, weiAmount string) (signedTx *types.Transaction, err error)

type Eth_GasPriceRequest

type Eth_GasPriceRequest string

RPC Method: eth_gasPrice

type Eth_GasPriceResponse

type Eth_GasPriceResponse string

type Eth_GetTransactionByHashResponse

type Eth_GetTransactionByHashResponse struct {
	BlockHash        string `json:"blockHash"`
	BlockNumber      string `json:"blockNumber"`
	From             string `json:"from"`
	Gas              string `json:"gas"`
	GasPrice         string `json:"gasPrice"`
	Hash             string `json:"hash"`
	Input            string `json:"input"`
	Nonce            string `json:"nonce"`
	To               string `json:"to"`
	TransactionIndex string `json:"transactionIndex"`
	Value            string `json:"value"`
	V                string `json:"v"`
	R                string `json:"r"`
	S                string `json:"s"`
}

RPC Method: eth_getTransactionByHash

type Eth_SendRawTransactionRequest

type Eth_SendRawTransactionRequest struct {
	RawTx string `json:"rawtx"`
}

RPC Method: eth_sendRawTransaction

type Eth_SendRawTransactionResponse

type Eth_SendRawTransactionResponse struct {
	Hash string `json:"hash"`
}

type Net_VersionRequest

type Net_VersionRequest string

RPC Method: net_version

type Net_VersionResponse

type Net_VersionResponse string

type RawTransaction

type RawTransaction struct {
	From             string `json:"from"`
	Gas              string `json:"gas"`
	GasPrice         string `json:"gasPrice"`
	Hash             string `json:"hash"`
	Input            string `json:"input"`
	Nonce            string `json:"nonce"`
	To               string `json:"to"`
	TransactionIndex string `json:"transactionIndex"`
	Value            string `json:"value"`
	V                string `json:"v"`
	R                string `json:"r"`
	S                string `json:"s"`
}

type RlpDecodedRawTransaction

type RlpDecodedRawTransaction struct {
	types.Transaction
}

func (*RlpDecodedRawTransaction) Unmarshal

func (tx *RlpDecodedRawTransaction) Unmarshal() (*RawTransaction, error)

type TransactionHash

type TransactionHash struct {
	Hash string `json:"hash"`
}

Jump to

Keyboard shortcuts

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