eth_chain

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigIntFromHex

func BigIntFromHex(h string) *big.Int

func EstimateGas

func EstimateGas(ctx context.Context, client *ethclient.Client, from common.Address, to *common.Address, value *big.Int, input []byte) (fee *big.Int, limit uint64, err error)

获取 fee ,limit

func HexFormat

func HexFormat(s string) string

func HexToUint64

func HexToUint64(hex string) (uint64, error)

func NewTransaction

func NewTransaction(ctx context.Context, client *ethclient.Client, rpcAddr, private, to string, amount *big.Int, data []byte) (trx *types.Transaction, err error)

func PendingNonceAt

func PendingNonceAt(rpc, address string) (uint64, error)

获取 nonce

func SignByPrivateKey

func SignByPrivateKey(hexKey, msg string) ([]byte, error)

func VerifySign

func VerifySign(hexAddr, msg string, sig []byte) (bool, error)

Types

type BaseResp

type BaseResp struct {
	JsonRpc string      `json:"jsonrpc"`
	Id      int32       `json:"id"`
	Result  interface{} `json:"result"`
	Error   Error       `json:"error"`
}

func (*BaseResp) Request

func (b *BaseResp) Request(url, method string) error

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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