Documentation
¶
Index ¶
- Constants
- func CalcGasCost(gasLimit uint64, gasPrice *big.Int) *big.Int
- func IsValidAddress(iaddress interface{}) bool
- func IsZeroAddress(iaddress interface{}) bool
- func ToWei(iamount interface{}, unit EthUnit) *big.Int
- func WeiToDecimal(ivalue *big.Int, unit EthUnit) decimal.Decimal
- type EthClient
- func (*EthClient) CreateNewWallet() (priv, pub []byte, addr string, e error)
- func (client *EthClient) GetBalance(address common.Address) (decimal.Decimal, error)
- func (client *EthClient) GetTokenBalance(contractAddr common.Address, address common.Address, ethUnit EthUnit) (amount decimal.Decimal, err error)
- func (client *EthClient) Transfer(fromPri []byte, fromAddr, toAddr string, gasSpeedUp float64, ...) (txid string, maxGas decimal.Decimal, err error)
- func (client *EthClient) TransferToken(contractAddr string, fromPri []byte, fromAddr, toAddr string, tokenUnit string, ...) (string, decimal.Decimal, error)
- type EthUnit
Constants ¶
View Source
const ( WEI EthUnit = 1 KWEI = 3 WWEI = 4 MWEI = 6 LWEI = 8 GWEI = 9 SZABO = 12 FINNEY = 15 ETHER = 18 KETHER = 21 METHER = 24 GETHER = 27 )
Variables ¶
This section is empty.
Functions ¶
func CalcGasCost ¶
CalcGasCost calculate gas cost given gas limit (units) and gas price (wei)
func IsValidAddress ¶
func IsValidAddress(iaddress interface{}) bool
IsValidAddress validate hex address
func IsZeroAddress ¶
func IsZeroAddress(iaddress interface{}) bool
IsZeroAddress validate if it's a 0 address
Types ¶
type EthClient ¶
func NewEthClient ¶
func (*EthClient) CreateNewWallet ¶
func (*EthClient) GetBalance ¶
func (*EthClient) GetTokenBalance ¶
Click to show internal directories.
Click to hide internal directories.