Documentation ¶
Index ¶
- func CalcGasCost(gasLimit uint64, gasPrice *big.Int) *big.Int
- func FormatAmount(amount *big.Int, decimals int) float64
- func IsContract(addr string) bool
- func IsValidAddress(addr interface{}) bool
- func IsValidTxHash(txHash string) bool
- func IsZeroAddress(addr interface{}) bool
- func NewClient() (*ethclient.Client, error)
- func NewWssClient() (*ethclient.Client, error)
- func SigRSV(isig interface{}) ([32]byte, [32]byte, uint8)
- func Sign(privateKeyHex string, msg string) string
- func SignWithPrefix(privateKeyHex string, msg string) string
- func ToDecimal(val interface{}, decimals int) decimal.Decimal
- func ToWei(val interface{}, decimals int) *big.Int
- func Verify(fromAddr, signHex, msg string) bool
- func VerifyWithPrefix(fromAddr, signHex, msg string) bool
- type LogTransfer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcGasCost ¶
CalcGasCost calculate gas cost given gas limit (units) and gas price (wei)
func IsContract ¶
若在该地址存储了字节码,该地址是智能合约 当地址上没有字节码时,我们知道它不是一个智能合约,它是一个标准的以太坊账户。
func IsValidAddress ¶
func IsValidAddress(addr interface{}) bool
IsValidAddress validate hex address
func IsValidTxHash ¶
func IsZeroAddress ¶
func IsZeroAddress(addr interface{}) bool
IsZeroAddress validate if it's a 0 address
func NewWssClient ¶
func SignWithPrefix ¶
会对消息增加一个特定消息前缀,用于兼容metamask签名
func VerifyWithPrefix ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.