util

package
v0.0.0-...-31db816 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcGasCost

func CalcGasCost(gasLimit uint64, gasPrice *big.Int) *big.Int

CalcGasCost calculate gas cost given gas limit (units) and gas price (wei)

func CreateChainHash

func CreateChainHash(str string) (*chainhash.Hash, error)

CreateChainHash is a wrapper to the chainhash.new hash function this allows for a cleaner way to check if we are not in any way letting the 0x prefix hinder the chainhash generation

func EnsureCorrectPrefix

func EnsureCorrectPrefix(str string) string

EnsureCorrectPrefix ensures we have 0x prefix

func ExtractChaincode

func ExtractChaincode(key *hdkeychain.ExtendedKey) []byte

ExtractChaincode used to get the chaincode out of extended key

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

func SigRSV

func SigRSV(isig interface{}) ([32]byte, [32]byte, uint8)

SigRSV signatures R S V returned as arrays

func ToDecimal

func ToDecimal(ivalue interface{}, decimals int) decimal.Decimal

ToDecimal wei to decimals

func ToWei

func ToWei(iamount interface{}, decimals int) *big.Int

ToWei decimals to wei

Types

This section is empty.

Jump to

Keyboard shortcuts

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