Documentation ¶
Index ¶
- Variables
- func ValidaEthAddress(address string) bool
- type EthClient
- func (e *EthClient) EthAccount() (string, string)
- func (e *EthClient) EthBalanceByAddress(address string) *big.Float
- func (e *EthClient) EthBalanceByBlockNumber(address string, blockNumber int64) *big.Float
- func (e *EthClient) EthBlockContentByBlockNumber(blockNumber int64) *types.Block
- func (e *EthClient) EthBlockNumber() string
- func (e *EthClient) EthBlockNumber2() uint64
- func (e *EthClient) EthBlockSingleTransactionByHash(hash string) (*Transaction, bool)
- func (e *EthClient) EthBlockTransaction(blockNumber int64) []*Transaction
- func (e *EthClient) EthBlockTransactionCountByBlockNumber(hash common.Hash) uint
- func (e *EthClient) EthSignature(privateKey string, data []byte) string
- func (e *EthClient) EthTransactionEth(fromPrivateKey, toAddress string, value *big.Int, gasLimit uint64, data []byte) (bool, error)
- func (e *EthClient) ValidateEthAddressIsSmartContract(address string) bool
- func (e *EthClient) VerifySignature(privateKey string, data []byte) bool
- func (e *EthClient) VerifySignatureOfEqual(privateKey string, data []byte) bool
- func (e *EthClient) VerifySignatureOfSigToPub(privateKey string, data []byte) bool
- type Transaction
Constants ¶
This section is empty.
Variables ¶
View Source
var ( InquireEthBlockNumberError = "Inquire eth block number failed !!!" InquireEthBlockByNumberError = "Inquire eth block by number failed !!!" InquireEthBlockTransactionCountHashError = "Inquire eth block transaction count by hash failed !!!" )
View Source
var ( EthSignatureHexToECDSAError = "signature hex to ECDSA failed !!!" EthSignatureSignError = "sign private key failed !!!" EthSignError = "Sign failed !!!" EthVerifySignEcrecoverError = "the uncompressed public key that created the given signature failed !!!" )
View Source
var ( EthNetworkError = "the network ID for this client failed !!!" EthBlockTransactionSenderError = "eth block transaction sender failed !!!" EthBlockTransactionReceiptError = "the receipt of a transaction by transaction hash failed !!!" EthBlockSingleTransactionByHashError = "the transaction with the given hash failed !!!" )
View Source
var ( GenerateEthAddressError = "Generate eth address failed !!!" CanNotType = "cannot assert type: publicKey is not of type *ecdsa.PublicKey" )
View Source
var (
EthClientDialError = "Dial eth client error"
)
View Source
var (
InquireEthBalanceErr = "Inquire eth balance failed !!!"
)
View Source
var (
ValidateIsSmartContractErr = "The contract code of the given account is failed !!!"
)
Functions ¶
Types ¶
type EthClient ¶
type EthClient struct {
// contains filtered or unexported fields
}
func NewEthClient ¶
func (*EthClient) EthBalanceByAddress ¶
EthBalanceByAddress 获取账户余额
func (*EthClient) EthBalanceByBlockNumber ¶
EthBalanceByBlockNumber 获取该区块时的账户余额
func (*EthClient) EthBlockContentByBlockNumber ¶
EthBlockContentByBlockNumber 读取区块的所有内容和元数据
func (*EthClient) EthBlockNumber ¶
EthBlockNumber 最新区块高度
func (*EthClient) EthBlockNumber2 ¶
EthBlockNumber2 最新区块高度
func (*EthClient) EthBlockSingleTransactionByHash ¶
func (e *EthClient) EthBlockSingleTransactionByHash(hash string) (*Transaction, bool)
EthBlockSingleTransactionByHash 单条交易
func (*EthClient) EthBlockTransaction ¶
func (e *EthClient) EthBlockTransaction(blockNumber int64) []*Transaction
EthBlockTransaction 查询交易区块内交易记录
func (*EthClient) EthBlockTransactionCountByBlockNumber ¶
EthBlockTransactionCountByBlockNumber 块中的交易计数
func (*EthClient) EthSignature ¶
EthSignature 签名
func (*EthClient) EthTransactionEth ¶ added in v0.0.7
func (e *EthClient) EthTransactionEth(fromPrivateKey, toAddress string, value *big.Int, gasLimit uint64, data []byte) (bool, error)
EthTransactionEth 交易eth
func (*EthClient) ValidateEthAddressIsSmartContract ¶
ValidateEthAddressIsSmartContract 检查地址是否为账户或智能合约
func (*EthClient) VerifySignature ¶
VerifySignature 验证签名
func (*EthClient) VerifySignatureOfEqual ¶
VerifySignatureOfEqual 验证签名
Click to show internal directories.
Click to hide internal directories.